{"commit":"2a12e542d63959826c536774f943bb1787ff582d","subject":"Design raspicam 'feet' and add some improvements.","message":"Design raspicam 'feet' and add some improvements.\n","repos":"jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets","old_file":"openscad\/raspicam.scad","new_file":"openscad\/raspicam.scad","new_contents":"\/\/ Raspicam\n\n\/\/ Copyright (c) 2014, J\u00e9r\u00e9mie Decock (jd.jdhp@gmail.com)\n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {\n difference() {\n union() {\n difference() {\n translate([0, board_width\/2, 0]){ \/\/ TODO: REMOVE THIS LINE!\n rotate(a=[0,0,90]){ \/\/ TODO: REMOVE THIS LINE!\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n }\n }\n\n union() {\n translate([0, board_width - num_screw_holes * screw_hole_spacing - 12.5, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([0, camera_screw_holes_spacing_y\/2 + 10, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n translate([0, camera_screw_holes_spacing_y\/2, 0]){\n body_camera_holes(camera_holes_width, screw_hole_depth);\n }\n }\n }\n }\n translate([0, board_width, hinge_radius_out - board_depth\/2]) {\n rotate(a=[0,90,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n translate([0, board_width, hinge_radius_out - board_depth\/2]) {\n cube([hinge_slot_length, hinge_radius_out * 2 + 2, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n \/\/\tcylinder(r=radius, h=depth, center=true);\n \/\/}\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([0, i*spacing, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_holes(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n translate([0, 0, 0]) {\n cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n }\n}\n\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n\n translate([15, 0, 0]) {\n difference() {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n }\n }\n}\n\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {\n difference() {\n feet_main_board(board_width, board_height, board_depth, board_corner_radius);\n feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);\n feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);\n }\n\n translate([board_width\/2 + hinge_shelf_width\/2, 0, 0]) {\n cube([hinge_shelf_width, hinge_length, board_depth], center=true);\n }\n\n translate([board_width\/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);\n }\n }\n}\n\nmodule feet_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule feet_ventilation_holes(radius, depth) {\n\t$fn=50;\n\t\n translate([0, 0, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n}\n\nmodule feet_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n\t\/\/\tcylinder(r=radius, h=depth, center=true);\n\t\/\/}\n}\n\nmodule feet_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n translate([0, 0, 0]) {\n cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nassign(feet_board_width=98,\n feet_board_height=65,\n feet_board_depth=3,\n feet_board_corner_radius=3,\n feet_screw_holes_radius=1.5,\n feet_screw_holes_spacing_x=70,\n feet_screw_holes_spacing_y=30,\n feet_screw_hole_depth=10,\n feet_hinge_shelf_width=20,\n feet_ventilation_holes_radius=3,\n body_board_width=100,\n body_board_height=40,\n body_board_depth=3,\n body_board_corner_radius=3,\n body_screw_hole_radius=1.5,\n body_screw_hole_spacing=5,\n body_screw_hole_depth=10,\n body_num_screw_holes=9,\n body_camera_screw_holes_radius=1,\n body_camera_screw_holes_spacing_x=20,\n body_camera_screw_holes_spacing_y=12,\n body_camera_holes_width=8,\n body_hinge_radius_out=4.6,\n hinge_radius=1.5,\n hinge_head_radius=4.6,\n hinge_head_length=5) {\n\n color([1,0,0]) {\n translate([0, -50, feet_board_depth\/2]) {\n feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height\/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=body_hinge_radius_out, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);\n }\n }\n\n color([0,0,1]) {\n translate([0, 0, body_board_depth\/2]) {\n body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=body_hinge_radius_out, hinge_slot_length=body_board_height \/ 3 + 1);\n }\n }\n\n color([0,1,0]) {\n translate([-50, 0, 0]) {\n hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);\n }\n }\n}\n\n","old_contents":"\/\/ Raspicam\n\n\/\/ Copyright (c) 2014, J\u00e9r\u00e9mie Decock (jd.jdhp@gmail.com)\n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out) {\n difference() {\n union() {\n difference() {\n translate([0, board_width\/2, 0]){\n rotate(a=[0,0,90]){\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n }\n }\n\n union() {\n translate([0, board_width - num_screw_holes * screw_hole_spacing - 12.5, 0]){\n \/\/translate([0, 0, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([-camera_screw_holes_spacing_x\/2, 10, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n }\n \n translate([0, camera_screw_holes_spacing_y + 10, 0]){\n body_camera_holes(camera_holes_width, screw_hole_depth);\n }\n }\n }\n translate([0, board_width, hinge_radius_out - board_depth\/2]) {\n rotate(a=[0,90,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n translate([0, board_width, hinge_radius_out - board_depth\/2]) {\n cube([board_height \/ 3 + 1, hinge_radius_out * 2 + 2, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n \/\/\tcylinder(r=radius, h=depth, center=true);\n \/\/}\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([0, i*spacing, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [0:1]) { \n for (j = [0:1]) { \n translate([i*spacing_x, j*spacing_y, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_holes(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n translate([0, 0, 0]) {\n cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n }\n}\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, 0]) {\n cylinder(r=radius, h=length, $fn=50);\n }\n}\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nmodule feet(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth]);\n\t\/\/\tcylinder(r=radius, h=depth, center=true);\n\t\/\/}\n}\n\n\ncolor([1,0,0]) translate([0, -100, 0]) feet(98, 65, 3, 3);\n\ncolor([0,0,1]) translate([0, 0, 0]) body(board_width=100, board_height=40, board_depth=3, board_corner_radius=3, screw_hole_radius=1.5, screw_hole_spacing=5, screw_hole_depth=10, num_screw_holes=9, camera_screw_holes_radius=1, camera_screw_holes_spacing_x=20, camera_screw_holes_spacing_y=12, camera_holes_width=8, hinge_radius_in=1.6, hinge_radius_out=4.6);\n\ncolor([0,1,0]) translate([-50, 0, 0]) hinge_screw(radius=1.5, head_radius=3, length=65, head_length=5);\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6bc2bd623c31440238f26a8f6bee9eb88112f206","subject":"added features to anker hub","message":"added features to anker hub\n","repos":"beckdac\/zynthian-build","old_file":"case\/zynthian-case.scad","new_file":"case\/zynthian-case.scad","new_contents":"$fn = 64;\n\nuse \n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 119;\ndisplayScreenHeight = 72;\ndisplayScreenThickness = 3;\ndisplayScreenYOffset = 3.5;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 79;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2 + displayScreenYOffset, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\ndisplayMountThickness = displayBoardThickness;\ndisplayMountScrewOffset = 2;\nmodule display_mount() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayMountThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness])\n cylinder(h=2 * displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d * 2);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule lid() {\n \/\/display_mount_tabs();\n \n difference() {\n \/\/ face plate\n union() {\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n display_mount();\n }\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * (encoderWidth * 1.1), j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=20, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\nmcp23017BoardWidth = 40;\nmcp23017BoardLength = 60;\nmcp23017BoardHeight = 1.4;\nmcp23017BoardScrewDiameter = 2;\nmcp23017BoardScrewInset = 1.7;\nheader40PinWidth = 4.8;\nheader40PinLength = 51;\nheader40PinHeight = 11;\nheader40pinInsetL = 4.5;\nheader40pinInsetW = 4.5;\nmcpToHifiOffset = 10.2;\nhifiBoardWidth = 56;\nhifiBoardLength = 65.3;\nhifiBoardHeight = 1.4;\nhifiBoardCutoutWidth = lidThickness * 3;\nhifiBoardCutoutLength = 46;\nhifiBoardCutoutHeight = 14.5;\nhifiBoardScrewDiameter = 4;\nhifiBoardScrewInset = 3.7;\nhifiMcpWidth = mcp23017BoardWidth - mcpToHifiOffset + hifiBoardWidth;\nmodule hifi_mcp23017_boards() {\n \/\/ mcp23017 protoboard\n color(\"limegreen\")\n difference() {\n \/\/ board\n cube([mcp23017BoardWidth, mcp23017BoardLength, mcp23017BoardHeight]);\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n }\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n \/\/ sainsmart pifi dac board\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset, 0, mcp23017BoardHeight + header40PinHeight])\n difference() {\n \/\/ board\n cube([hifiBoardWidth, hifiBoardLength, hifiBoardHeight]);\n \/\/ screw holes\n translate([hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n }\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset - hifiBoardCutoutWidth \/ 2, hifiBoardLength \/ 2 - hifiBoardCutoutLength \/ 2, mcp23017BoardHeight + header40PinHeight])\n cube([hifiBoardCutoutWidth, hifiBoardCutoutLength, hifiBoardCutoutHeight]);\n}\n\nanker7PortHubHeight = 44.5;\nanker7PortHubLength = 110;\nanker7PortHubWidth = 23;\nanker7PortHubPowerDiameter = 10.5;\nanker7PortHubPowerHeight = 31;\nanker7PortHubPowerLength = 5;\nanker7PortHubPowerWidth = 10.4;\nanker7PortHubUSBH = 9;\nanker7PortHubUSBW = 11;\nanker7PortHubUSBHeight = 14.5;\nanker7PortHubUSBLength = 5;\nanker7PortHubUSBWidth = 9;\nmodule anker_7port_usb_hub() {\n difference() {\n color(\"black\")\n translate([0, 0, boxThickness])\n cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight]);\n translate([anker7PortHubPowerWidth, anker7PortHubPowerLength, anker7PortHubPowerHeight])\n rotate([90, 0, 0])\n cylinder(h=20, d=anker7PortHubPowerDiameter);\n translate([anker7PortHubUSBWidth - anker7PortHubUSBW \/ 2, anker7PortHubUSBLength, anker7PortHubUSBHeight - anker7PortHubUSBH\/2])\n rotate([90, 0, 0])\n cube([anker7PortHubUSBW, anker7PortHubUSBH, 20]);\n }\n}\n\n\/\/ box with pi mounts and holes\nrPi3BottomSpacer = 4;\nrPi3Length = 85;\nrpi3Width = 56;\nboxHeight = 80;\nboxThickness = lidThickness;\nhifiMcpSpacer = 4;\nmodule box() {\n\n \/\/ bottom\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, boxThickness]);\n \/\/ pi mount holes\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - rPi3Length \/ 2, (displayBoardHeight * 1.25 + encoderLength)\/2 - 29, boxThickness + rPi3BottomSpacer])\n pi3();\n \/\/ sides\n for (i = [-1, 1])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -i * (displayBoardHeight * 1.25 + encoderLength)\/2 - (i == -1 ? boxThickness : 0), 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, boxThickness, boxHeight]);\n for (i = [-1, 1])\n translate([-i * (displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - (i == -1 ? boxThickness : 0), -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([boxThickness, displayBoardHeight * 1.25 + encoderLength, boxHeight]);\n \/\/ pi usb \/ ethernet cutou\n\n \/\/ hifi audio out board with mcp23017 board\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, 0, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ anker usb power hub\n anker_7port_usb_hub();\n \/\/ translate([0,0,boxHeight + 2])\n \/\/ lid();\n}\n\n\/\/display();\n\/\/encoder();\n\/\/lid();\n\/\/display_mount_tabs();\nbox();","old_contents":"$fn = 64;\n\nuse \n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 119;\ndisplayScreenHeight = 72;\ndisplayScreenThickness = 3;\ndisplayScreenYOffset = 3.5;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 79;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2 + displayScreenYOffset, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\ndisplayMountThickness = displayBoardThickness;\ndisplayMountScrewOffset = 2;\nmodule display_mount() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayMountThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness])\n cylinder(h=2 * displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d * 2);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule lid() {\n \/\/display_mount_tabs();\n \n difference() {\n \/\/ face plate\n union() {\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n display_mount();\n }\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * (encoderWidth * 1.1), j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=20, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\nmcp23017BoardWidth = 40;\nmcp23017BoardLength = 60;\nmcp23017BoardHeight = 1.4;\nmcp23017BoardScrewDiameter = 2;\nmcp23017BoardScrewInset = 1.7;\nheader40PinWidth = 4.8;\nheader40PinLength = 51;\nheader40PinHeight = 11;\nheader40pinInsetL = 4.5;\nheader40pinInsetW = 4.5;\nmcpToHifiOffset = 10.2;\nhifiBoardWidth = 56;\nhifiBoardLength = 65.3;\nhifiBoardHeight = 1.4;\nhifiBoardCutoutWidth = lidThickness * 3;\nhifiBoardCutoutLength = 46;\nhifiBoardCutoutHeight = 14.5;\nhifiBoardScrewDiameter = 4;\nhifiBoardScrewInset = 3.7;\nhifiMcpWidth = mcp23017BoardWidth - mcpToHifiOffset + hifiBoardWidth;\nmodule hifi_mcp23017_boards() {\n \/\/ mcp23017 protoboard\n color(\"limegreen\")\n difference() {\n \/\/ board\n cube([mcp23017BoardWidth, mcp23017BoardLength, mcp23017BoardHeight]);\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n }\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n \/\/ sainsmart pifi dac board\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset, 0, mcp23017BoardHeight + header40PinHeight])\n difference() {\n \/\/ board\n cube([hifiBoardWidth, hifiBoardLength, hifiBoardHeight]);\n \/\/ screw holes\n translate([hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n }\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset - hifiBoardCutoutWidth \/ 2, hifiBoardLength \/ 2 - hifiBoardCutoutLength \/ 2, mcp23017BoardHeight + header40PinHeight])\n cube([hifiBoardCutoutWidth, hifiBoardCutoutLength, hifiBoardCutoutHeight]);\n}\n\nanker7PortHubHeight = 44.5;\nanker7PortHubLength = 110;\nanker7PortHubWidth = 23;\nmodule anker_7port_usb_hub() {\n color(\"black\")\n translate([0, 0, boxThickness])\n cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight]);\n}\n\n\/\/ box with pi mounts and holes\nrPi3BottomSpacer = 4;\nrPi3Length = 85;\nrpi3Width = 56;\nboxHeight = 80;\nboxThickness = lidThickness;\nhifiMcpSpacer = 4;\nmodule box() {\n\n \/\/ bottom\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, boxThickness]);\n \/\/ pi mount holes\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - rPi3Length \/ 2, (displayBoardHeight * 1.25 + encoderLength)\/2 - 29, boxThickness + rPi3BottomSpacer])\n pi3();\n \/\/ sides\n for (i = [-1, 1])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -i * (displayBoardHeight * 1.25 + encoderLength)\/2 - (i == -1 ? boxThickness : 0), 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, boxThickness, boxHeight]);\n for (i = [-1, 1])\n translate([-i * (displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - (i == -1 ? boxThickness : 0), -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([boxThickness, displayBoardHeight * 1.25 + encoderLength, boxHeight]);\n \/\/ pi usb \/ ethernet cutou\n\n \/\/ hifi audio out board with mcp23017 board\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, 0, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ anker usb power hub\n anker_7port_usb_hub();\n \/\/ translate([0,0,boxHeight + 2])\n \/\/ lid();\n}\n\n\/\/display();\n\/\/encoder();\n\/\/lid();\n\/\/display_mount_tabs();\nbox();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6d3f0ec68f60ac9a33e076b8a5d68cd48ad22aab","subject":"The icon height was increased for the default settings.","message":"The icon height was increased for the default settings.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/name-tags\/nametag.scad","new_file":"OpenSCAD\/name-tags\/nametag.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3;\/\/3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconType = \"Trooper\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat]\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n","old_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3;\/\/3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconType = \"Trooper\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat]\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 0.85; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nxOffset = 84; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Storm Trooper\";\r\nbottomLetterSize = 8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f75f070b6d950dda7369c53c5d52ffd6e03acab0","subject":"y\/idler: use button head screws","message":"y\/idler: use button head screws\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,0,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extra_size=[yaxis_idler_pulley_tight_len,0,0], \n extra_align=[-1,0,0]\n );\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,0,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head_embed=false, h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extra_size=[yaxis_idler_pulley_tight_len,0,0], \n extra_align=[-1,0,0]\n );\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9740b0a4687daaf8991b783fede15ae988ee3c66","subject":"yaxis\/idler: increase pulley block length","message":"yaxis\/idler: increase pulley block length\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 21.5*mm);\n\n\/\/ 2GT2 20T pulley\nyaxis_pulley_d = 12.2;\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\nyaxis_idler_pulley_h = 10*mm;\n\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 21.5*mm);\n\n\/\/ 2GT2 20T pulley\nyaxis_pulley_d = 12.2;\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\nyaxis_idler_pulley_h = 10*mm;\n\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c1f4ca084081ec33204a789f2b7a37f598afc2e2","subject":"system: add U as undef alias","message":"system: add U as undef alias\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"system.scad","new_file":"system.scad","new_contents":"X = [1, 0, 0];\nY = [0, 1, 0];\nZ = [0, 0, 1];\nXAXIS = [1,0,0];\nYAXIS = [0,1,0];\nZAXIS = [0,0,1];\n\nAXES = [X,Y,Z];\n\nU = undef;\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n","old_contents":"X = [1, 0, 0];\nY = [0, 1, 0];\nZ = [0, 0, 1];\nXAXIS = [1,0,0];\nYAXIS = [0,1,0];\nZAXIS = [0,0,1];\n\nAXES = [X,Y,Z];\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9117ed2b5ef20e523815c675ed43293320182dda","subject":"fix: wrong function used to get the size of the chamfered box","message":"fix: wrong function used to get the size of the chamfered box\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/polyhedron.scad","new_file":"shape\/3D\/polyhedron.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polyhedron shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a box.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBox(size, l, w, h) =\n let(\n size = apply3D(size, l, w, h)\n )\n [\n divisor(size.x),\n divisor(size.y),\n divisor(size.z)\n ]\n;\n\n\/**\n * Computes the size of a chamfered box.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[] - Returns an array containing the size vector and the chamfer vector.\n *\/\nfunction sizeChamferedBox(size, chamfer, l, w, h, cl, cw) =\n let(\n s = apply3D(size, l, w, h),\n c = apply2D(chamfer, cl, cw),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y * 2),\n divisor(s.z)\n ],\n chamfer = [\n min(size.x \/ 2, c.x),\n min(size.y \/ 2, c.y)\n ]\n )\n [ size, chamfer.x && chamfer.y ? chamfer : [0, 0] ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @returns Vector - Returns the size vector, as [a, b, w, h].\n *\/\nfunction sizeTrapeziumBox(size, a, b, w, h) =\n let(\n h = uor(h, is_num(size) ? size : size[3]),\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size.x),\n divisor(size.y),\n divisor(size.z),\n divisor(h)\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, h, n].\n *\/\nfunction sizeRegularPolygonBox(size, n, l, w, h, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector3D(2 * divisor(s) \/ (2 * sin(STRAIGHT \/ n)))\n : apply3D(size, l, w, h)\n )\n [\n divisor(size.x),\n divisor(size.y),\n divisor(size.z),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStarBox(size, core, edges, l, w, h, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? vector2D(size) * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Computes the size of a cross shape.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the cross\n *\/\nfunction sizeCrossBox(size, core, l, w, h, cl, cw) =\n let(\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core\n ]\n;\n\n\/**\n * Creates a box at the origin.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule box(size, l, w, h, center) {\n size = sizeBox(size=size, l=l, w=w, h=h);\n linear_extrude(height=size.z, center=center, convexity=10) {\n rectangle(size);\n }\n}\n\n\/**\n * Creates a chamfered box at the origin.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule chamferedBox(size, chamfer, l, w, h, cl, cw, center) {\n size = sizeChamferedBox(size=size, chamfer=chamfer, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n chamferedRectangle(size=size[0], chamfer=size[1]);\n }\n}\n\n\/**\n * Creates a trapezium box at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule trapeziumBox(size, a, b, w, h, center) {\n size = sizeTrapeziumBox(size=size, a=a, b=b, w=w, h=h);\n linear_extrude(height=size[3], center=center, convexity=10) {\n trapezium(size);\n }\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularPolygonBox(size, n, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=n, l=l, w=w, h=h, s=s);\n linear_extrude(height=size.z, center=center, convexity=10) {\n regularPolygon(size, size[3]);\n }\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule hexagonBox(size, pointy, adjust, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=6, l=l, w=w, h=h, s=s);\n linear_extrude(height=size.z, center=center, convexity=10) {\n hexagon(size=size, pointy=pointy, adjust=adjust);\n }\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width\n * @param Number [h] - The overall height.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule starBox(size, core, edges, l, w, h, cl, cw, center) {\n size = sizeStarBox(size=size, core=core, edges=edges, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n star(size[0], size[1], size[2]);\n }\n}\n\n\/**\n * Creates a cross box at the origin.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularCrossBox(size, core, l, w, h, cl, cw, center) {\n size = sizeCrossBox(size=size, core=core, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n regularCross(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule meshBox(size, count, gap, pointy, linear, even, l, w, h, cx, cy, gx, gy, center) {\n size = apply3D(size, l, w, h);\n linear_extrude(height=size.z, center=center, convexity=10) {\n mesh(size=size, count=count, gap=gap, pointy=pointy, linear=linear, even=even, cx=cx, cy=cy, gx=gx, gy=gy);\n }\n}\n\n\/**\n * Creates a simple polyhedron, where only two opposite faces are defined by a\n * list of points. Several possibilities are available:\n * - provides the points for one face, then set a distance for the opposite face\n * - provides the points for two opposite faces\n * - provides the points for two opposite faces, then set a distance between them\n *\n * Note: both faces should have the same number of points.\n *\n * @param Vector[] [bottom] - The list of points for the bottom face.\n * @param Vector[] [top] - The list of points for the top face.\n * @param Vector[] [points] - The list of points for a main face.\n * @param Vector [distance] - The distance between two main faces.\n * @param Number [x] - The distance between two main faces on the X-axis.\n * @param Number [y] - The distance between two main faces on the Y-axis.\n * @param Number [z] - The distance between two main faces on the Z-axis.\n * @returns Vector[]\n *\/\nmodule simplePolyhedron(bottom, top, points, distance, x, y, z) {\n points = simplePolyhedronPoints(bottom=bottom, top=top, points=points, distance=distance, x=x, y=y, z=z);\n polyhedron(\n points = points,\n faces = simplePolyhedronFaces(len(points) \/ 2),\n convexity = 10\n );\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polyhedron shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a box.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBox(size, l, w, h) =\n let(\n size = apply3D(size, l, w, h)\n )\n [\n divisor(size.x),\n divisor(size.y),\n divisor(size.z)\n ]\n;\n\n\/**\n * Computes the size of a chamfered box.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[] - Returns an array containing the size vector and the chamfer vector.\n *\/\nfunction sizeChamferedBox(size, chamfer, l, w, h, cl, cw) =\n let(\n s = apply3D(size, l, w, h),\n c = apply2D(chamfer, cl, cw),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y * 2),\n divisor(s.z)\n ],\n chamfer = [\n min(size.x \/ 2, c.x),\n min(size.y \/ 2, c.y)\n ]\n )\n [ size, chamfer.x && chamfer.y ? chamfer : [0, 0] ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @returns Vector - Returns the size vector, as [a, b, w, h].\n *\/\nfunction sizeTrapeziumBox(size, a, b, w, h) =\n let(\n h = uor(h, is_num(size) ? size : size[3]),\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size.x),\n divisor(size.y),\n divisor(size.z),\n divisor(h)\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, h, n].\n *\/\nfunction sizeRegularPolygonBox(size, n, l, w, h, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector3D(2 * divisor(s) \/ (2 * sin(STRAIGHT \/ n)))\n : apply3D(size, l, w, h)\n )\n [\n divisor(size.x),\n divisor(size.y),\n divisor(size.z),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStarBox(size, core, edges, l, w, h, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? vector2D(size) * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Computes the size of a cross shape.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the cross\n *\/\nfunction sizeCrossBox(size, core, l, w, h, cl, cw) =\n let(\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core\n ]\n;\n\n\/**\n * Creates a box at the origin.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule box(size, l, w, h, center) {\n size = sizeBox(size=size, l=l, w=w, h=h);\n linear_extrude(height=size.z, center=center, convexity=10) {\n rectangle(size);\n }\n}\n\n\/**\n * Creates a chamfered box at the origin.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule chamferedBox(size, chamfer, l, w, h, cl, cw, center) {\n size = sizeBox(size=size, chamfer=chamfer, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size.z, center=center, convexity=10) {\n chamferedRectangle(size, chamfer);\n }\n}\n\n\/**\n * Creates a trapezium box at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule trapeziumBox(size, a, b, w, h, center) {\n size = sizeTrapeziumBox(size=size, a=a, b=b, w=w, h=h);\n linear_extrude(height=size[3], center=center, convexity=10) {\n trapezium(size);\n }\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularPolygonBox(size, n, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=n, l=l, w=w, h=h, s=s);\n linear_extrude(height=size.z, center=center, convexity=10) {\n regularPolygon(size, size[3]);\n }\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule hexagonBox(size, pointy, adjust, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=6, l=l, w=w, h=h, s=s);\n linear_extrude(height=size.z, center=center, convexity=10) {\n hexagon(size=size, pointy=pointy, adjust=adjust);\n }\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width\n * @param Number [h] - The overall height.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule starBox(size, core, edges, l, w, h, cl, cw, center) {\n size = sizeStarBox(size=size, core=core, edges=edges, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n star(size[0], size[1], size[2]);\n }\n}\n\n\/**\n * Creates a cross box at the origin.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularCrossBox(size, core, l, w, h, cl, cw, center) {\n size = sizeCrossBox(size=size, core=core, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n regularCross(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule meshBox(size, count, gap, pointy, linear, even, l, w, h, cx, cy, gx, gy, center) {\n size = apply3D(size, l, w, h);\n linear_extrude(height=size.z, center=center, convexity=10) {\n mesh(size=size, count=count, gap=gap, pointy=pointy, linear=linear, even=even, cx=cx, cy=cy, gx=gx, gy=gy);\n }\n}\n\n\/**\n * Creates a simple polyhedron, where only two opposite faces are defined by a\n * list of points. Several possibilities are available:\n * - provides the points for one face, then set a distance for the opposite face\n * - provides the points for two opposite faces\n * - provides the points for two opposite faces, then set a distance between them\n *\n * Note: both faces should have the same number of points.\n *\n * @param Vector[] [bottom] - The list of points for the bottom face.\n * @param Vector[] [top] - The list of points for the top face.\n * @param Vector[] [points] - The list of points for a main face.\n * @param Vector [distance] - The distance between two main faces.\n * @param Number [x] - The distance between two main faces on the X-axis.\n * @param Number [y] - The distance between two main faces on the Y-axis.\n * @param Number [z] - The distance between two main faces on the Z-axis.\n * @returns Vector[]\n *\/\nmodule simplePolyhedron(bottom, top, points, distance, x, y, z) {\n points = simplePolyhedronPoints(bottom=bottom, top=top, points=points, distance=distance, x=x, y=y, z=z);\n polyhedron(\n points = points,\n faces = simplePolyhedronFaces(len(points) \/ 2),\n convexity = 10\n );\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"77d39f0ad82dcfe9fef2c58ae315e3278360090c","subject":"guanin","message":"guanin","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Guanin.scad","new_file":"3D-models\/SCAD\/Guanin.scad","new_contents":"x=50; \ny=19; \nz=7;\nz2=2.5; \/\/\u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439\n \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0413\u0443\u0430\u043d\u0438\u043d \ndifference(){\n union(){ \ndifference() { \ncolor(\"Red\") cube ([x+10, y, z], center=true);\n #rotate([0, 90, 0]) translate([0, 4.5, 26.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 26.5]) cylinder(9, 2.65, 2.65); \n} \n\ncolor(\"Red\") translate ([-29, y\/200000, -3.5]) cylinder (z, y\/2, y\/2);\n} \n#rotate([90, 0, 90]) translate([0, 0, -44.4]) cylinder(9, 2.65, 2.65);\n\ntranslate([-3, 0, 1.1]) cube([40, 21, 5], center=true);\n\n} \nrotate([90, 0, 0]) color(\"red\") translate([-23, 0, -9.5]) cylinder(19, 3.5, 3.5);\nrotate([90, 0, 0]) color(\"red\") translate([17.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0413\ntranslate([-6, -6, 0,]) cube([6, 2, 2]);\ntranslate([0, -6, 0,]) cube([2, 12, 2]);\n \n\n\n\n","old_contents":"x=50; \ny=19; \nz=7;\nz2=2.5; \/\/\u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439\n \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0413\u0443\u0430\u043d\u0438\u043d \ndifference(){\n union(){ \ndifference() { \ncolor(\"Red\") cube ([x+10, y, z], center=true);\n #rotate([0, 90, 0]) translate([0, 4.5, 26.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 26.5]) cylinder(9, 2.65, 2.65); \n} \n\ncolor(\"Red\") translate ([-29, y\/200000, -3.5]) cylinder (z, y\/2, y\/2);\n} \n#rotate([90, 0, 90]) translate([0, 0, -44.4]) cylinder(9, 2.65, 2.65);\n\ntranslate([-3, 0, 1.1]) cube([40, 21, 5], center=true);\n\n} \nrotate([90, 0, 0]) color(\"red\") translate([-23, 0, -9.5]) cylinder(19, 3.5, 3.5);\nrotate([90, 0, 0]) color(\"red\") translate([17.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e65e3b0bb6587bdb057489f2720f5600076c0f24","subject":"shapes: cleanup vector","message":"shapes: cleanup vector\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_array(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_array(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5813734d085ff376b148583b5cc3445c51a1daf8","subject":"shapes: Change default value of fnr to 0.8","message":"shapes: Change default value of fnr to 0.8\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"518d6cf6efea81fd68bc9611f11fad1f01bdd91b","subject":"shapes: fix rcylinder","message":"shapes: fix rcylinder\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n size_align(size=[sizexy,sizexy,h], extra_size=[extra_sizexy, extra_sizexy, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_=d==undef?r:d\/2;\n d_=r==undef?d:r*2;\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n size_align(size=[sizexy,sizexy,h], extra_size=[extra_sizexy, extra_sizexy, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_=d==undef?r:d\/2;\n d_=r==undef?d:r*2;\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"518b2c30fbb2639f6e81c82e97b8c08df040802e","subject":"corner roller holder started","message":"corner roller holder started\n","repos":"JoeSuber\/QuickerPicker","old_file":"CardStack\/rollerbits.scad","new_file":"CardStack\/rollerbits.scad","new_contents":"\/\/ corner parts & rollers to guide cards & belts\n\ncornershape();\n\npartht = 14;\ncurve = 10.9;\n\nmodule cornershape(diam=curve, ht=partht, rod=0.254*25.4\/2){\n difference(){\n union(){\n cylinder(r=diam\/2, h=ht, $fn=64, center=false);\n translate([0,diam\/1.41, ht\/2])\n cube([diam,diam*1.41,ht], center=true);\n translate([diam\/1.41, 0, ht\/2])\n cube([diam*1.41, diam, ht], center=true);\n }\n translate([0,0,-.05])\n #boltnut();\n }\n}\n\nmodule boltnut(rod=.254*25.4\/2, ht=partht, nutrad=12.65\/2, washrad=14\/2, washthk=2, nutht=5.6){\n cylinder(r=rod, h=ht+0.1, $fn=24, center=false);\n translate([0,0,ht-nutht])\n cylinder(r=nutrad, h=partht, $fn=6, center=false);\n}\n\nmodule axles(rad=0.254*25.4\/2, length=curve*1.41);","old_contents":"","returncode":1,"stderr":"error: pathspec 'CardStack\/rollerbits.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"912223d2676d1a48622ecc07c1c66bc53d62e612","subject":"The syntax error was corrected.","message":"The syntax error was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/electronics\/keyboards\/switch-mounting-holes\/httm-backlit-capacitive-switch\/httm-backlit-capacitive-switch.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/electronics\/keyboards\/switch-mounting-holes\/httm-backlit-capacitive-switch\/httm-backlit-capacitive-switch.scad","new_contents":"\r\n\/**\r\n * Mike Hall showed and gave me afew of one day at work.\r\n *\r\n * The height of the board with cap touch plat is listed as 3mm.\r\n\r\n *\t\thttp:\/\/www.cnx-software.com\/2017\/07\/27\/httm-backlit-capacitive-touch-switch-button-sells-for-about-one-dollar\/\r\n *\r\n * From the link:\r\n\t\t\t\t HTTM button specifications:\r\n\r\n\t\t\t\t Voltage input range: + 2.7v to + 6v\r\n\t\t\t\t Signal output \u2013 Voltage: + 3.3v; Current up to 500 mA\r\n\t\t\t\t Header \u2013 3-pin with GND, VCC, and OUT\r\n\t\t\t\t Backlight color \u2013 red, blue (cyan), or yellow\r\n\t\t\t\t Dimensions \u2013 20.4 x 16.6 mm\r\n\t\t\t\t Operating temperature range: -30 \u2103 to + 70 \u2103\r\n\r\n\t https:\/\/www.aliexpress.com\/item\/10-pcs-red-color-HTTM-Series-2-7V-6V-Capacitive-Touch-Switch-Module-Strong-anti-interference\/32814839036.html\r\n\r\n\t\t From aliexpress:\r\n\r\n\t\t\t Working voltage: + 2.7 ~ 6V\r\n\t\t\t Working temperature: 30 ~ +70 \u00b0\r\n\t\t\t OUT pin Output voltage: + 3.3V \u00b1 0.1V\r\n\t\t\t OUTPin maximum output current:500mA\r\n *\/\r\n\r\nmodule httmBacklitCapacitiveTouchSwitchMountingHole(zLength = 3.0)\r\n{\r\n\txLength = 20.4;\r\n\tyLength = 16.6;\r\n\r\n\tcube([xLength, yLength, zLength]);\r\n}\r\n","old_contents":"\r\n\/**\r\n * Mike Hall showed and gave me afew of one day at work.\r\n *\r\n * The height of the board with cap touch plat is listed as 3mm.\r\n\r\n *\t\thttp:\/\/www.cnx-software.com\/2017\/07\/27\/httm-backlit-capacitive-touch-switch-button-sells-for-about-one-dollar\/\r\n *\r\n * From the link:\r\n\t\t\t\t HTTM button specifications:\r\n\r\n\t\t\t\t Voltage input range: + 2.7v to + 6v\r\n\t\t\t\t Signal output \u2013 Voltage: + 3.3v; Current up to 500 mA\r\n\t\t\t\t Header \u2013 3-pin with GND, VCC, and OUT\r\n\t\t\t\t Backlight color \u2013 red, blue (cyan), or yellow\r\n\t\t\t\t Dimensions \u2013 20.4 x 16.6 mm\r\n\t\t\t\t Operating temperature range: -30 \u2103 to + 70 \u2103\r\n\r\n\t https:\/\/www.aliexpress.com\/item\/10-pcs-red-color-HTTM-Series-2-7V-6V-Capacitive-Touch-Switch-Module-Strong-anti-interference\/32814839036.html\r\n\r\n\t\t From aliexpress:\r\n\r\n\t\t\t Working voltage: + 2.7 ~ 6V\r\n\t\t\t Working temperature: 30 ~ +70 \u00b0\r\n\t\t\t OUT pin Output voltage: + 3.3V \u00b1 0.1V\r\n\t\t\t OUTPin maximum output current:500mA\r\n *\/\r\n\r\nmodule httmBacklitCapacitiveTouchSwitchMountingHole(zLength = 3.0)\r\n{\r\n\txLength = 20.4;\r\n\tyLength = 16.6\r\n\r\n\tcube([xLength, yLength, zLength]);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b0a245a9a43a77ef58d5ab1bc252df7de81f7f79","subject":"code simplified and distances re-calculated","message":"code simplified and distances re-calculated\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module pair(d, h)\n {\n translate([0, 0, 11-h+eps])\n {\n cylinder(d=d, h=h);\n translate([0, 9, 0])\n cylinder(d=d, h=h+10);\n }\n translate([1.5*d, 0, 0])\n children();\n }\n\n difference()\n {\n cube([35, 20, 11]);\n translate([5, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","old_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module rise_for(h)\n {\n translate([0, 0, 11-h+eps])\n children();\n }\n module up()\n {\n translate([0, 9, 0])\n children();\n }\n module right()\n {\n translate([9, 0, 0])\n children();\n }\n module pair(d, h)\n {\n right()\n {\n rise_for(h)\n {\n cylinder(d=d, h=h);\n up()\n cylinder(d=d, h=h+10);\n }\n children();\n }\n }\n\n difference()\n {\n cube([37, 20, 11]);\n translate([-3, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9268de784d865d08d9099dad15aa04386953709e","subject":"positioned sides #1","message":"positioned sides #1\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/tank.scad","new_file":"resin\/tank\/tank.scad","new_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h], center=true);\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n color([1,0.1,0.0,0.75])\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.1,0.0,0.75])\n difference() {\n side1(width, height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\nheight = 80;\nglass_thickness = 8;\nwall_height = 30;\nwall_thickness = 3;\ncut_depth = 1;\nsupport_height = 1;\n\nglass(width, height, glass_thickness);\nrotate([-90,0,0])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(height+wall_thickness)\/2])\n side1(width, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\nrotate([90,180,0])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(height+wall_thickness)\/2])\n side1(width, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n\/\/ side2(width, 30, wall_thickness, cut_depth, glass_thickness);","old_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h], center=true);\n}\n\nmodule side1(width, height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n support_width = 2;\n color([1,0.1,0.0,0.75])\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_width - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side2(width, height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.1,0.0,0.75])\n difference() {\n side1(width, height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\ndepth = 80;\nglass_thickness = 4;\nwall_thickness = 3;\ncut_depth = 1;\n\n\/\/glass(width, depth, glass_thickness);\n\/\/rotate([90,00,0])\n side2(width, 30, wall_thickness, cut_depth, glass_thickness);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e4bd5e98935fc81fbda74a3790432305f72d9af7","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"70e1dcd585a8fd223eb744e42b4c5244e7031664","subject":"config: switch to sf1 bushings on X","message":"config: switch to sf1 bushings on X\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*zaxis_bearing=bearing_sf1_1212;*\/\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\n\/*xaxis_bearing=bearing_sf1_1010;*\/\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*zaxis_bearing=bearing_sf1_1212;*\/\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ad10adca8dc5d5638a122d501c41ce565be924a9","subject":"moved link up a bit from foot to make a bit of an ankle","message":"moved link up a bit from foot to make a bit of an ankle\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/JansenFoot.scad","new_file":"Drawings\/JansenFoot.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenFoot.scad $\n\/\/ $Id: JansenFoot.scad 438 2015-03-03 14:39:59Z mrwhat $\n\npadH = 0.3; \/\/ extra clearance amount for H end of CH link\n\nmodule bracedFoot(dLeft,dBase,dPerp) { \/\/ ---------------- foot with out-of-axis support\nbraceHeight = NodeHeight3; \/\/ 3*TrueNodeHeight-.4; \/\/ A little shorter than the hinge-pin\ndRight = 0.65 * (dBase-dLeft); \/\/ scoot brace in a bit from foot\ndLeft1 = dLeft-Frad-1-((0.5*Frad)\/(dLeft-Frad-1));\nunion() { difference() { union() {\n translate([-dLeft,0,0]) {\n cylinder(h=NodeHeight,r1=Frad+.2,r2=Frad-.2,$fn=48); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+2,r2=Hrad+1.6,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([.22*dRight,.8*dPerp,1.1]) sphere(r=1,$fn=6); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+1.9,r2=Hrad+1.4,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([-.28*dLeft1,(1-.23)*dPerp,2]) sphere(r=1,$fn=6); }\n\n \/\/ foot\n translate([dBase-dLeft-LinkRad,0,0]) cylinder(h=NodeHeight+.5,r=LinkRad,$fn=80);\n\n hull() {\n translate([0,dPerp ,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight+0.8,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([0,dPerp ,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() {\n translate([-dLeft1,-Frad*0.5,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6);\n translate([0,dPerp,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([-dLeft1+((8*Frad)\/(dLeft-Frad-1)),0,0])\n cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([0,dPerp,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() { \/\/ re-inforcing pyramid over main, long leg\n translate([-dLeft+2*Frad,0,0]) cylinder(h=BarHeight,r1=Frad-1,r2=Frad-3,$fn=6);\n translate([dBase-dLeft-2*LinkRad,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-2,$fn=6);\n translate([0,0,1.5*NodeHeight-1]) sphere(r=1,$fn=16); }\n\n difference() { hull() { \/\/ main, long-leg segment\n translate([-dLeft,0,0]) { nodeCyl(BarHeight,Frad-1);\n translate([dBase-LinkRad,0,0]) nodeCyl(BarHeight,LinkRad-1); }\n }\n translate([-dLeft,0,-1.5]) hull(){nodeCyl(BarHeight,Frad-2.4);\n translate([dBase-LinkRad-2,0,0])nodeCyl(BarHeight,.4);}\n }\n\n hull(){ \/\/ stop to keep \"knee\" from hyper-extending\n translate([-dLeft-Frad+2,0,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft,-Frad+2,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft-Frad+2,-Frad-3,0]) cylinder(h=BarHeight,r=2,$fn=12); }\n translate( [-dLeft-Frad+2,-Frad-3,0]) cylinder(h=3*BarHeight,r1=3,r2=2,$fn=24);\n }\n translate([0,dPerp,0]) drillHole(Hrad);\n translate([-dLeft,0,0]) drillHole(Drad);\n\n \/\/ hollow out re-inforcing pyramid\n hull() { translate([-dLeft+2*Frad+2,0,-1.5]) cylinder(h=BarHeight,r1=Frad-2,r2=Frad-4,$fn=6);\n translate([dBase-dLeft-3*LinkRad,0,-1.5]) cylinder(h=BarHeight,r1=1.5,r2=.2,$fn=6);\n translate([0,0,1.5*NodeHeight-2.5]) sphere(r=0.5,$fn=16); }\n\n \/\/ had trouble with fill around braced link. See if adding little hollows\n \/\/ helps slicer to fill better\n translate([-dLeft,0,NodeHeight\/2]) {\n for(a=[0,30,60,90,120,150,180,210,240,270,300,330]) {\n translate([0.5*(Frad+Drad)*cos(a),0.5*(Frad+Drad)*sin(a),0])\n cylinder(h=NodeHeight-1.4,r=.4,$fn=6,center=true);\n }}\n\n \/\/ knock out a slot to take the CH linkage.\n translate([0,dPerp,NodeHeight-padH]) {\n cylinder(h=NodeHeight+2*padH,r=Hrad+3,$fn=48);\n hull() {\n translate([ 0,-4,0]) cube([.1,.1,NodeHeight+2*padH]);\n translate([ 7,-1,0]) cube([2,5,NodeHeight+2*padH]);\n translate([-7,-2,0]) cube([1,5,NodeHeight+2*padH]);\n }\n }\n\n \/\/cube([3,11,11]); \/\/ diagnostic slice to examine pyramid shell\n }\n}\n\n\/\/ custom support at H node\ncolor(\"Cyan\") union() {\n translate([0,29,NodeHeight-padH*.9]) difference() {\n cylinder(r2=4.4,r1=3.73,h=NodeHeight-.5,$fn=8);\n translate([0,0,-.1]) cylinder(r2=2.6,r1=3.4,h=5,$fn=8);\n }\nif(0) {\n translate([0,29,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=4.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=4.1,h=1.2,$fn=8);\n }\n translate([0,29.4,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=3.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=3.1,h=1.2,$fn=8);\n }\n translate([4,28,NodeHeight*2-1.6]) rotate([0,0,60]) rotate([25,0,0]) cube([4,.35,4],center=true);\n translate([-3.5,27,NodeHeight*2-1.6]) rotate([0,0,-50]) rotate([25,0,0]) cube([4,.35,4],center=true);\n} else {\n translate([0,dPerp,NodeHeight+2+padH]) {\n Hblade(4);\n rotate([0,0, 20]) Hblade();\n rotate([0,0, 50]) Hblade();\n rotate([0,0, 80]) Hblade();\n rotate([0,0,110]) Hblade();\n rotate([0,0,140]) Hblade();\n rotate([0,0,170]) Hblade();\n rotate([0,0,200]) Hblade(3.6);\n rotate([0,0,230]) Hblade(3.3);\n rotate([0,0,250]) Hblade(3.3);\n rotate([0,0,270]) Hblade(3.3);\n rotate([0,0,290]) Hblade(3.3);\n rotate([0,0,310]) Hblade(3.3);\n rotate([0,0,330]) Hblade(3.3);\n rotate([0,0,345]) Hblade(4.5);\n }\n}\n}\n\n}\n\n\/\/ Support blade for H node\nlineW = 0.41; \/\/ single line width\nplateH = NodeHeight-2-padH*0.2;\nmodule Hblade(len=3,h=plateH,w=lineW,cr=2) {\n translate([cr,-w\/2,0]) cube([len,w,h]);\n}\n\n\/\/ example from config E, circa 140227\n\/\/bracedFoot(28.3675,75.792,29.3843);","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenFoot.scad $\n\/\/ $Id: JansenFoot.scad 438 2015-03-03 14:39:59Z mrwhat $\n\npadH = 0.3; \/\/ extra clearance amount for H end of CH link\n\nmodule bracedFoot(dLeft,dBase,dPerp) { \/\/ ---------------- foot with out-of-axis support\nbraceHeight = NodeHeight3; \/\/ 3*TrueNodeHeight-.4; \/\/ A little shorter than the hinge-pin\ndRight = 0.9 * (dBase-dLeft); \/\/ scoot brace in a bit from foot\ndLeft1 = dLeft-Frad-1-((0.5*Frad)\/(dLeft-Frad-1));\nunion() { difference() { union() {\n translate([-dLeft,0,0]) {\n cylinder(h=NodeHeight,r1=Frad+.2,r2=Frad-.2,$fn=48); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+2,r2=Hrad+1.6,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([.22*dRight,.85*dPerp,1.1]) sphere(r=1,$fn=6); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+1.9,r2=Hrad+1.4,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([-.28*dLeft1,(1-.23)*dPerp,2]) sphere(r=1,$fn=6); }\n\n \/\/ foot\n translate([dBase-dLeft-LinkRad,0,0]) cylinder(h=NodeHeight+.5,r=LinkRad,$fn=80);\n\n hull() {\n translate([0,dPerp ,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([0,dPerp ,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() {\n translate([-dLeft1,-Frad*0.5,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6);\n translate([0,dPerp,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([-dLeft1+((8*Frad)\/(dLeft-Frad-1)),0,0])\n cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([0,dPerp,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() { \/\/ re-inforcing pyramid over main, long leg\n translate([-dLeft+2*Frad,0,0]) cylinder(h=BarHeight,r1=Frad-1,r2=Frad-3,$fn=6);\n translate([dBase-dLeft-2*LinkRad,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-2,$fn=6);\n translate([0,0,1.5*NodeHeight-1]) sphere(r=1,$fn=16); }\n\n difference() { hull() { \/\/ main, long-leg segment\n translate([-dLeft,0,0]) { nodeCyl(BarHeight,Frad-1);\n translate([dBase-LinkRad,0,0]) nodeCyl(BarHeight,LinkRad-1); }\n }\n translate([-dLeft,0,-1.5]) hull(){nodeCyl(BarHeight,Frad-2.4);\n translate([dBase-LinkRad-2,0,0])nodeCyl(BarHeight,.4);}\n }\n\n hull(){ \/\/ stop to keep \"knee\" from hyper-extending\n translate([-dLeft-Frad+2,0,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft,-Frad+2,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft-Frad+2,-Frad-3,0]) cylinder(h=BarHeight,r=2,$fn=12); }\n translate( [-dLeft-Frad+2,-Frad-3,0]) cylinder(h=3*BarHeight,r1=3,r2=2,$fn=24);\n }\n translate([0,dPerp,0]) drillHole(Hrad);\n translate([-dLeft,0,0]) drillHole(Drad);\n\n \/\/ hollow out re-inforcing pyramid\n hull() { translate([-dLeft+2*Frad+2,0,-1.5]) cylinder(h=BarHeight,r1=Frad-2,r2=Frad-4,$fn=6);\n translate([dBase-dLeft-3*LinkRad,0,-1.5]) cylinder(h=BarHeight,r1=1.5,r2=.2,$fn=6);\n translate([0,0,1.5*NodeHeight-2.5]) sphere(r=0.5,$fn=16); }\n\n \/\/ had trouble with fill around braced link. See if adding little hollows\n \/\/ helps slicer to fill better\n translate([-dLeft,0,NodeHeight\/2]) {\n for(a=[0,30,60,90,120,150,180,210,240,270,300,330]) {\n translate([0.5*(Frad+Drad)*cos(a),0.5*(Frad+Drad)*sin(a),0])\n cylinder(h=NodeHeight-1.4,r=.4,$fn=6,center=true);\n }}\n\n \/\/ knock out a slot to take the CH linkage.\n translate([0,dPerp,NodeHeight-padH]) {\n cylinder(h=NodeHeight+2*padH,r=Hrad+3,$fn=48);\n hull() {\n translate([ 0,-4,0]) cube([.1,.1,NodeHeight+2*padH]);\n translate([ 7,-1,0]) cube([2,5,NodeHeight+2*padH]);\n translate([-7,-2,0]) cube([1,5,NodeHeight+2*padH]);\n }\n }\n\n \/\/cube([3,11,11]); \/\/ diagnostic slice to examine pyramid shell\n }\n}\n\n\/\/ custom support at H node\ncolor(\"Cyan\") union() {\n translate([0,29,NodeHeight-padH*.9]) difference() {\n cylinder(r2=4.4,r1=3.73,h=NodeHeight-.5,$fn=8);\n translate([0,0,-.1]) cylinder(r2=2.6,r1=3.4,h=5,$fn=8);\n }\nif(0) {\n translate([0,29,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=4.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=4.1,h=1.2,$fn=8);\n }\n translate([0,29.4,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=3.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=3.1,h=1.2,$fn=8);\n }\n translate([4,28,NodeHeight*2-1.6]) rotate([0,0,60]) rotate([25,0,0]) cube([4,.35,4],center=true);\n translate([-3.5,27,NodeHeight*2-1.6]) rotate([0,0,-50]) rotate([25,0,0]) cube([4,.35,4],center=true);\n} else {\n translate([0,dPerp,NodeHeight+2+padH]) {\n Hblade(4);\n rotate([0,0, 20]) Hblade();\n rotate([0,0, 50]) Hblade();\n rotate([0,0, 80]) Hblade();\n rotate([0,0,110]) Hblade();\n rotate([0,0,140]) Hblade();\n rotate([0,0,170]) Hblade();\n rotate([0,0,200]) Hblade(3.6);\n rotate([0,0,230]) Hblade(3.3);\n rotate([0,0,250]) Hblade(3.3);\n rotate([0,0,270]) Hblade(3.3);\n rotate([0,0,290]) Hblade(3.3);\n rotate([0,0,310]) Hblade(3.3);\n rotate([0,0,330]) Hblade(3.3);\n rotate([0,0,345]) Hblade(4.5);\n }\n}\n}\n\n}\n\n\/\/ Support blade for H node\nlineW = 0.41; \/\/ single line width\nplateH = NodeHeight-2-padH*0.2;\nmodule Hblade(len=3,h=plateH,w=lineW,cr=2) {\n translate([cr,-w\/2,0]) cube([len,w,h]);\n}\n\n\/\/ example from config E, circa 140227\n\/\/bracedFoot(28.3675,75.792,29.3843);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a13253eadf1ebe10f97265a00d12522cf2794173","subject":"Created scad file for the BLE112 radio.","message":"Created scad file for the BLE112 radio.\n","repos":"DrYerzinia\/Cat-Finder","old_file":"schem\/scad\/BLE112.scad","new_file":"schem\/scad\/BLE112.scad","new_contents":"module BLE112(){\n\n\tboard_width = 12.05;\n\tboard_length = 18.10;\n\tboard_thickness = 0.80;\n\tcontact_radius = 0.35;\n\tcontact_spacing = 1.25;\n\tshield_width = 10.85;\n\tshield_length = 11.85;\n\tshield_thickness = 1.5;\n\tshield_offset = 0.85;\n\tshield_corner = sqrt(2);\n\tantenna_width = 1.6;\n\tantenna_length = 3.2;\n\tantenna_thickness = 1.3;\n\tantenna_offset_x = 0.6;\n\tantenna_offset_y = 0.9;\n\n\ttranslate([0,-contact_spacing,0]){\n\t\tunion(){\n\t\t\t\/\/ Board\n\t\t\tcolor([0.3,0.3,1])\n\t\t\t\ttranslate([0,0,board_thickness \/ 2])\n\t\t\t\t\tdifference(){\n\t\t\t\t\t\tcube([board_width, board_length, board_thickness], center=true);\n\t\t\t\t\t\tunion(){\n\t\t\t\t\t\t\ttranslate([-contact_spacing*3.5,-board_length\/2,0])\n\t\t\t\t\t\t\t\tfor (i = [0 : 7]){\n\t\t\t\t\t\t\t\t\ttranslate([contact_spacing*i,0,0])\n\t\t\t\t\t\t\t\t\t\tcylinder(h=board_thickness + 2,\n\t\t\t\t\t\t\t\t\t\t\tr = contact_radius, center=true, $fn=18);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttranslate([board_width\/2,-contact_spacing*6,0])\n\t\t\t\t\t\t\t\tfor (i = [0 : 8]){\n\t\t\t\t\t\t\t\t\ttranslate([0,contact_spacing*i,0])\n\t\t\t\t\t\t\t\t\t\tcylinder(h=board_thickness + 2,\n\t\t\t\t\t\t\t\t\t\t\tr = contact_radius, center=true, $fn=18);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttranslate([-board_width\/2,-contact_spacing*6,0])\n\t\t\t\t\t\t\t\tfor (i = [0 : 12]){\n\t\t\t\t\t\t\t\t\ttranslate([0,contact_spacing*i,0])\n\t\t\t\t\t\t\t\t\t\tcylinder(h=board_thickness + 2,\n\t\t\t\t\t\t\t\t\t\t\tr = contact_radius, center=true, $fn=18);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\/\/ Shield\n\t\t\tcolor([0.6,0.6,0.6])\n\t\t\t\ttranslate([0,-(board_length - shield_length) \/ 2 + shield_offset,\n\t\t\t\t\tboard_thickness + shield_thickness \/ 2])\n\t\t\t\t\tdifference(){\n\t\t\t\t\t\tcube([shield_width, shield_length, shield_thickness],\n\t\t\t\t\t\t\tcenter=true\t);\n\t\t\t\t\t\tunion(){\n\t\t\t\t\t\t\ttranslate([shield_width \/ 2, shield_length \/ 2,0])\n\t\t\t\t\t\t\t\trotate([0,0,45])\n\t\t\t\t\t\t\t\t\tcube([shield_corner,shield_corner,shield_thickness + 2],\n\t\t\t\t\t\t\t\t\tcenter=true);\n\t\t\t\t\t\t\ttranslate([-shield_width \/ 2, shield_length \/ 2,0])\n\t\t\t\t\t\t\t\trotate([0,0,45])\n\t\t\t\t\t\t\t\t\tcube([shield_corner,shield_corner,shield_thickness + 2],\n\t\t\t\t\t\t\t\t\tcenter=true);\n\t\t\t\t\t\t\ttranslate([shield_width \/ 2, -shield_length \/ 2,0])\n\t\t\t\t\t\t\t\trotate([0,0,45])\n\t\t\t\t\t\t\t\t\tcube([shield_corner,shield_corner,shield_thickness + 2],\n\t\t\t\t\t\t\t\t\tcenter=true);\n\t\t\t\t\t\t\ttranslate([-shield_width \/ 2, -shield_length \/ 2,0])\n\t\t\t\t\t\t\t\trotate([0,0,45])\n\t\t\t\t\t\t\t\t\tcube([shield_corner,shield_corner,shield_thickness + 2],\n\t\t\t\t\t\t\t\t\tcenter=true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\/\/ Antenna\n\t\t\tcolor([1,1,1])\n\t\t\t\ttranslate([(board_width - antenna_length) \/ 2 - antenna_offset_y,\n\t\t\t\t\t(board_length - antenna_width) \/ 2 - antenna_offset_x,\n\t\t\t\t\tboard_thickness + antenna_thickness \/ 2])\n\t\t\t\t\tcube([antenna_length,antenna_width,antenna_thickness], center=true);\n\t\t}\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'schem\/scad\/BLE112.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"e3efa0ced09bb83c7a2b655aa56893c8fb7cf728","subject":"screws: add demo mode to show all screws","message":"screws: add demo mode to show all screws\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = get(NutThickness,nut)*tolerance;\n d = get(NutWidthMin, nut)*tolerance;\n facets = get(NutFacets, nut);\n nut_hex_radius = hex_radius(get(NutWidthMax, nut))+.1;\n cylindera($fn=get(NutFacets, nut), r=nut_hex_radius, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = get(NutThickness,nut)*tolerance;\n d = get(NutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width = get(NutWidthMin, nut);\n nut_hex_radius = hex_radius(nut_width)+.1*mm;\n s = nut_hex_radius;\n total_h = nut_h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=get(NutFacets, nut), r=nut_hex_radius, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width,nut_width,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidth = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidth, 0, nuti)[nuti]*1.2;\n translate(XAXIS*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n }\n}\n\nif(false)\n{\n box_w = 40;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.1;\n $fa = 5;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlInsertM3_3_42;\n nut4 = NutKnurlInsertM3_5_42;\n\n difference()\n {\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);*\/\n\n \/*screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = get(NutThickness,nut)*tolerance;\n d = get(NutWidthMin, nut)*tolerance;\n facets = get(NutFacets, nut);\n nut_hex_radius = hex_radius(get(NutWidthMax, nut))+.1;\n cylindera($fn=get(NutFacets, nut), r=nut_hex_radius, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = get(NutThickness,nut)*tolerance;\n d = get(NutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width = get(NutWidthMin, nut);\n nut_hex_radius = hex_radius(nut_width)+.1*mm;\n s = nut_hex_radius;\n total_h = nut_h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=get(NutFacets, nut), r=nut_hex_radius, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width,nut_width,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\nif(false)\n{\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlInsertM3_3_42;\n nut4 = NutKnurlInsertM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 40;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);*\/\n\n \/*screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"725ac79a13432052b3969202cea932be8b9d73e9","subject":"*: replace MCAD stepper with libutils","message":"*: replace MCAD stepper with libutils\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-motor-mount.scad","new_file":"z-motor-mount.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\nuse \n\n\nmodule zaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n zaxis_motor_mount(part=\"pos\");\n zaxis_motor_mount(part=\"neg\");\n }\n if($show_vit)\n zaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ top plate\n rcubea([zmotor_w+zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=X+Z);\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=X-Z, extra_size=[0,0,2], extra_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=X+Z);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=X+Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_w,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=X-Z,\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=X-Z);\n }\n\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=-Z);\n\n \/\/ screw holes top\n for(y=[-1,1])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ screw hole bottom\n for(y=[0])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size-main_lower_dist_z)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ cut out z rod\n tx(zmotor_mount_rod_offset_x)\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n }\n else if(part==\"vit\")\n {\n }\n\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nif(false)\nzaxis_motor_mount();\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\nuse \n\n\nmodule zaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n zaxis_motor_mount(part=\"pos\");\n zaxis_motor_mount(part=\"neg\");\n }\n if($show_vit)\n zaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ top plate\n rcubea([zmotor_w+zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=X+Z);\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=X-Z, extra_size=[0,0,2], extra_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=X+Z);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=X+Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_w,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=X-Z,\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=X-Z);\n }\n\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=-Z);\n\n \/\/ screw holes top\n for(y=[-1,1])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ screw hole bottom\n for(y=[0])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size-main_lower_dist_z)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ cut out z rod\n tx(zmotor_mount_rod_offset_x)\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n }\n else if(part==\"vit\")\n {\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c2a8d585c46c840fe4e1c270010156eb02752d61","subject":"The include paths were corrected.","message":"The include paths were corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/shortcut\/examples\/trinket-mini\/base\/trinket-mini-shortcut-keyboard.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/shortcut\/examples\/trinket-mini\/base\/trinket-mini-shortcut-keyboard.scad","new_contents":" \r\nuse <..\/..\/..\/..\/..\/..\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/..\/microcontrollers\/adafruit\/trinket-mini\/mounting-standoffs\/trinket-mini-mounting-standoffs.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/..\/electronics\/keyboards\/switch-mounting-holes\/keyboard-switch-mounting-holes.scad>\r\n\r\ntrinketMiniShortcutKeyboard();\r\n\r\nmodule frameWithTrinketMounts(boardLengthZ, cornerRadius)\r\n{\r\n\tunion()\r\n\t{\r\n\t\tboardLengthX = 60;\r\n\t\tboardLengthY = 60;\r\n\r\n\t\troundedCubeEnclosure(boardLengthX = boardLengthX,\r\n\t\t\t\t\t\t\tboardLengthY = boardLengthY,\r\n\t\t\t\t\t\t\tboardLengthZ = boardLengthZ,\r\n\t\t\t\t\t\t\tcornerRadius = cornerRadius,\r\n\t\t\t\t\t\t\txAxisCutout_yPercentage = 0.8,\r\n\t\t\t\t\t\t\txAxisCutout_zPercentage = 0.8,\r\n\t\t\t\t\t\t\tyAxisCutout_xPercentage = 0.85,\r\n\t\t\t\t\t\t\tyAxisCutout_zPercentage = 0.75);\r\n\r\n\t\txTranslate = (boardLengthX + cornerRadius) * 0.6;\r\n\t\tyTranslate = (boardLengthY + cornerRadius) * 0.3;\r\n\t\tzTranslate = 2;\r\n\r\n\t\tcolor(\"red\")\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\ttrinketMiniStandoffs();\r\n\t}\r\n}\r\n\r\nmodule trinketMiniShortcutKeyboard()\r\n{\r\n\tboardLengthZ = 30;\r\n\tbuttonSide = 12;\r\n\tcornerRadius = 3;\r\n\r\n\tdifference()\r\n\t{\r\n\t\tframeWithTrinketMounts(boardLengthZ, cornerRadius);\r\n\r\n\t\txTranslate = -12;\r\n\t\tyTranslate = 1;\r\n\t\tzTranslate = boardLengthZ * 0.8;\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\tkeyboardSwitchMountingHoles(buttonCount = 4,\r\n\t\t\t\t\t buttonSide = buttonSide,\r\n\t\t\t\t \t panelHeight = 5);\r\n\r\n\t\t panelCutout_xLength = buttonSide + 4;\r\n\t\t panelCutout_yLength = (panelCutout_xLength * 4) - 5;\r\n\t\t panelCutout_zLength = 10;\r\n\t\t panelCutout_xTranslate = 2;\r\n\t\t panelCutout_yTranslate = 0;\r\n\t\t panelCutout_zTranslate = (boardLengthZ + cornerRadius) - panelCutout_zLength - 1; \/\/ the minus 1 is for the panel mount height\r\n\t\t color(\"pink\")\r\n\t\t translate([panelCutout_xTranslate, panelCutout_yTranslate, panelCutout_zTranslate])\r\n\t\t cube([panelCutout_xLength, panelCutout_yLength, panelCutout_zLength]);\r\n\t}\r\n}\r\n","old_contents":"\r\nuse <..\/..\/..\/..\/..\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/microcontrollers\/adafruit\/trinket-mini\/mounting-standoffs\/trinket-mini-mounting-standoffs.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/electronics\/keyboards\/switch-mounting-holes\/keyboard-switch-mounting-holes.scad>\r\n\r\ntrinketMiniShortcutKeyboard();\r\n\r\nmodule frameWithTrinketMounts(boardLengthZ, cornerRadius)\r\n{\r\n\tunion()\r\n\t{\r\n\t\tboardLengthX = 60;\r\n\t\tboardLengthY = 60;\r\n\r\n\t\troundedCubeEnclosure(boardLengthX = boardLengthX,\r\n\t\t\t\t\t\t\tboardLengthY = boardLengthY,\r\n\t\t\t\t\t\t\tboardLengthZ = boardLengthZ,\r\n\t\t\t\t\t\t\tcornerRadius = cornerRadius,\r\n\t\t\t\t\t\t\txAxisCutout_yPercentage = 0.8,\r\n\t\t\t\t\t\t\txAxisCutout_zPercentage = 0.8,\r\n\t\t\t\t\t\t\tyAxisCutout_xPercentage = 0.85,\r\n\t\t\t\t\t\t\tyAxisCutout_zPercentage = 0.75);\r\n\r\n\t\txTranslate = (boardLengthX + cornerRadius) * 0.6;\r\n\t\tyTranslate = (boardLengthY + cornerRadius) * 0.3;\r\n\t\tzTranslate = 2;\r\n\r\n\t\tcolor(\"red\")\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\ttrinketMiniStandoffs();\r\n\t}\r\n}\r\n\r\nmodule trinketMiniShortcutKeyboard()\r\n{\r\n\tboardLengthZ = 30;\r\n\tbuttonSide = 12;\r\n\tcornerRadius = 3;\r\n\r\n\tdifference()\r\n\t{\r\n\t\tframeWithTrinketMounts(boardLengthZ, cornerRadius);\r\n\r\n\t\txTranslate = -12;\r\n\t\tyTranslate = 1;\r\n\t\tzTranslate = boardLengthZ * 0.8;\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\tkeyboardSwitchMountingHoles(buttonCount = 4,\r\n\t\t\t\t\t buttonSide = buttonSide,\r\n\t\t\t\t \t panelHeight = 5);\r\n\r\n\t\t panelCutout_xLength = buttonSide + 4;\r\n\t\t panelCutout_yLength = (panelCutout_xLength * 4) - 5;\r\n\t\t panelCutout_zLength = 10;\r\n\t\t panelCutout_xTranslate = 2;\r\n\t\t panelCutout_yTranslate = 0;\r\n\t\t panelCutout_zTranslate = (boardLengthZ + cornerRadius) - panelCutout_zLength - 1; \/\/ the minus 1 is for the panel mount height\r\n\t\t color(\"pink\")\r\n\t\t translate([panelCutout_xTranslate, panelCutout_yTranslate, panelCutout_zTranslate])\r\n\t\t cube([panelCutout_xLength, panelCutout_yLength, panelCutout_zLength]);\r\n\t}\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3a57f872becaf44f48e9f7175ec3acb34b261f56","subject":"screws\/screw_nut: fix nut thread hole cutout","message":"screws\/screw_nut: fix nut thread hole cutout\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n material(Mat_Steel)\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0007ab7c850a3d97898d39b096ed4666ec58a34d","subject":"screws: fix screw trap offset","message":"screws: fix screw trap offset\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n tz(trap_offset)\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4012ddf2a97b7f0517b935c2ab73b82501dea528","subject":"stepper: fixes","message":"stepper: fixes\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"stepper.scad","new_file":"stepper.scad","new_contents":" \/\/ Some code from MCAD\/stepper.scad\n \/\/ Originally by Hans H\u00e4ggstr\u00f6m, 2010.\n \/\/ Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later\n\ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \n\n\/*test2();*\/\n\nmodule test()\n{\n for (size = AllNemaSizes)\n {\n ty(size*100)\n stack(axis=X, dist=100)\n {\n motor(model=Nema34, size=size, dual_axis=true);\n motor(model=Nema23, size=size, dual_axis=true);\n motor(model=Nema17, size=size, dual_axis=true);\n motor(model=Nema14, size=size, dual_axis=true);\n motor(model=Nema11, size=size, dual_axis=true);\n motor(model=Nema08, size=size, dual_axis=true);\n }\n }\n}\n\nmodule test2()\n{\n $show_vit=true;\n model = Nema17;\n size = NemaMedium;\n all_axes()\n color($color)\n translate(100*$axis)\n motor_mount(model=model, size=size, thickness=6*mm, dual_axis=true, orient=$axis);\n \/*motor(model=model, size=size, thickness=6*mm, dual_axis=true, orient=$axis);*\/\n}\n\nfunction motorWidth(model) = get(NemaSideSize, model);\nfunction motorLength(model, size=NemaMedium) = get(size, model);\n\nmodule motor_mount(part=U, model, thickness, size=NemaMedium, extra_size=U, dual_axis=false, orient=Z, align=N)\n{\n assert(model!=U, \"motor_mount(): model==U\");\n assert(thickness!=U, \"motor_mount(): thickness==U\");\n assert(size!=U, \"motor_mount(): size==U\");\n\n length = get(size, model);\n side = get(NemaSideSize, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n s=[side+fallback(extra_size.x,0), side+fallback(extra_size.y,0), length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n material(Mat_Plastic)\n render()\n difference()\n {\n motor_mount(part=\"pos\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n motor_mount(part=\"neg\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n\n if($show_vit)\n motor_mount(part=\"vit\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n else if(part==\"pos\")\n {\n rcubea([s.x,s.y,thickness], align=Z);\n }\n else if(part==\"neg\")\n {\n cylindera(h=thickness+.1, r=extrRad, align=Z, extra_h=.1, extra_align=-Z);\n\n \/\/ main motor\n tz(-s.z)\n cubea(size=[side+.3*mm,side+.3*mm,length], align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=thickness+.1, r=holeRadius, align=Z, extra_h=.1, extra_align=-Z);\n\n }\n else if(part==\"vit\")\n {\n motor(model=model, size=size, dualAxis=dual_axis);\n }\n}\n\nmodule motor(part=U, model, size=NemaMedium, dual_axis=false, orient=Z, align=N)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n side = get(NemaSideSize, model);\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n holeDepth = get(NemaMountingHoleDepth, model);\n\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n mid = side \/ 2;\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n s=[side, side, length];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==U)\n {\n difference()\n {\n motor(part=\"pos\", model=model, size=size, dual_axis=dual_axis);\n motor(part=\"neg\", model=model, size=size, dual_axis=dual_axis);\n }\n motor(part=\"vit\", model=model, size=size, dual_axis=dual_axis);\n\n motor_axle(model=model, size=size, dual_axis=dual_axis);\n }\n if(part==\"echo\")\n {\n echo(str(\" Motor: Nema\",get(NemaModel, model),\", length= \",length,\"mm, dual axis=\",dual_axis));\n }\n else if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n tz(-s.z)\n cubea(s, align=Z, extra_size=Z*extrSize, extra_align=Z);\n }\n else if(part==\"neg\")\n {\n \/\/ Axle hole\n material(Mat_Aluminium)\n cylindera(r=axleRadius+.2*mm, h=1000);\n\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=Z);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=Z, extra_size=.1*Z, extra_align=-Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=holeDepth+.1*mm, r=holeRadius, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ Grinded flat\n material(Mat_BlackPaint)\n difference()\n {\n cubea(size=[side+.1, side+.1, extrSize+.1], align=Z);\n cylindera(h=extrSize, r=extrRad, align=Z);\n }\n }\n}\n\nmodule motor_axle(model=Nema23, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n axleLengthFront = get(NemaFrontAxleLength, model);\n axleLengthBack = get(NemaBackAxleLength, model);\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n axleFlatDepth = get(NemaAxleFlatDepth, model);\n axleFlatLengthFront = get(NemaAxleFlatLengthFront, model);\n axleFlatLengthBack = get(NemaAxleFlatLengthBack, model);\n\n material(Mat_Steel)\n render()\n intersection()\n {\n material(Mat_Aluminium)\n tz(-length)\n cylindera(r=axleRadius, h=length+extrSize+axleLengthFront, align=Z, extra_h=dual_axis?axleLengthBack:0, extra_align=-Z);\n\n material(Mat_Aluminium)\n union()\n {\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthFront], align=Z);\n\n cubea(size=[2*axleRadius, 2*axleRadius, length+.4*mm], align=-Z, extra_size=Z*(extrSize+.4*mm), extra_align=Z);\n\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n tz(-length)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthBack], align=-Z);\n }\n }\n}\n\n","old_contents":" \/\/ Some code from MCAD\/stepper.scad\n \/\/ Originally by Hans H\u00e4ggstr\u00f6m, 2010.\n \/\/ Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later\n\ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \n\n\/*test2();*\/\n\nmodule test()\n{\n for (size = AllNemaSizes)\n {\n ty(size*100)\n stack(axis=X, dist=100)\n {\n motor(model=Nema34, size=size, dual_axis=true);\n motor(model=Nema23, size=size, dual_axis=true);\n motor(model=Nema17, size=size, dual_axis=true);\n motor(model=Nema14, size=size, dual_axis=true);\n motor(model=Nema11, size=size, dual_axis=true);\n motor(model=Nema08, size=size, dual_axis=true);\n }\n }\n}\n\nmodule test2()\n{\n model = Nema17;\n size = NemaMedium;\n motor_mount(model=model, size=size, dual_axis=true);\n}\n\nfunction motorWidth(model) = get(NemaSideSize, model);\nfunction motorLength(model, size=NemaMedium) = get(size, model);\n\nmodule motor_mount(part=U, model, thickness, size=NemaMedium, extra_size=U, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"motor_mount(): model==U\");\n assert(thickness!=U, \"motor_mount(): thickness==U\");\n assert(size!=U, \"motor_mount(): size==U\");\n\n length = get(size, model);\n side = get(NemaSideSize, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n s=[side+fallback(extra_size.x,0), side+fallback(extra_size.y,0), length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n material(Mat_Plastic)\n render()\n difference()\n {\n motor_mount(part=\"pos\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n motor_mount(part=\"neg\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n\n if($show_vit)\n motor_mount(part=\"vit\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n else if(part==\"pos\")\n {\n rcubea([s.x,s.y,thickness], align=Z);\n }\n else if(part==\"neg\")\n {\n cylindera(h=thickness+.1, r=extrRad, align=Z, extra_h=.1, extra_align=-Z);\n\n \/\/ main motor\n tz(-s.z)\n cubea(size=[side+.3*mm,side+.3*mm,length], align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=thickness+.1, r=holeRadius, align=Z, extra_h=.1, extra_align=-Z);\n\n }\n else if(part==\"vit\")\n {\n motor(model=model, size=size, dualAxis=dual_axis, orient=Z);\n }\n}\n\nmodule motor(part=U, model, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n side = get(NemaSideSize, model);\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n holeDepth = get(NemaMountingHoleDepth, model);\n\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n mid = side \/ 2;\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n s=[side, side, length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n difference()\n {\n motor(part=\"pos\", model=model, size=size, dual_axis=dual_axis);\n motor(part=\"neg\", model=model, size=size, dual_axis=dual_axis);\n }\n motor(part=\"vit\", model=model, size=size, dual_axis=dual_axis);\n\n motor_axle(model=model, size=size, dual_axis=dual_axis);\n }\n if(part==\"echo\")\n {\n echo(str(\" Motor: Nema\",get(NemaModel, model),\", length= \",length,\"mm, dual axis=\",dual_axis));\n }\n else if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n tz(-s.z)\n cubea(s, align=Z, extra_size=Z*extrSize, extra_align=Z);\n }\n else if(part==\"neg\")\n {\n \/\/ Axle hole\n material(Mat_Aluminium)\n cylindera(r=axleRadius+.2*mm, h=1000);\n\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=Z);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=Z, extra_size=.1*Z, extra_align=-Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=holeDepth+.1*mm, r=holeRadius, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ Grinded flat\n material(Mat_BlackPaint)\n difference()\n {\n cubea(size=[side+.1, side+.1, extrSize+.1], align=Z);\n cylindera(h=extrSize, r=extrRad, align=Z);\n }\n }\n}\n\nmodule motor_axle(model=Nema23, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n axleLengthFront = get(NemaFrontAxleLength, model);\n axleLengthBack = get(NemaBackAxleLength, model);\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n axleFlatDepth = get(NemaAxleFlatDepth, model);\n axleFlatLengthFront = get(NemaAxleFlatLengthFront, model);\n axleFlatLengthBack = get(NemaAxleFlatLengthBack, model);\n\n material(Mat_Steel)\n render()\n intersection()\n {\n material(Mat_Aluminium)\n tz(-length)\n cylindera(r=axleRadius, h=length+extrSize+axleLengthFront, align=Z, extra_h=dual_axis?axleLengthBack:0, extra_align=-Z);\n\n material(Mat_Aluminium)\n union()\n {\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthFront], align=Z);\n\n cubea(size=[2*axleRadius, 2*axleRadius, length+.4*mm], align=-Z, extra_size=Z*(extrSize+.4*mm), extra_align=Z);\n\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n tz(-length)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthBack], align=-Z);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"abe81a6df884dcd00d5c9e7ddfa56d54a63d7d12","subject":"Add an operator module that apply a render mode","message":"Add an operator module that apply a render mode\n","repos":"jsconan\/camelSCAD","old_file":"core\/mode.scad","new_file":"core\/mode.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rendering mode.\n *\n * @package core\/mode\n * @author jsconan\n *\/\n\n\/**\n * Specifications for each rendering modes.\n * Each mode is defined this way: [\"name\", value for $fa, value for $fs]\n * @type Vector\n *\/\nMODES = [\n [\"dirty\", 6, 2],\n [\"dev\", 1, 1.5],\n [\"prod\", .5, .5]\n];\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = \"dev\";\n\n\/**\n * Gets the specifications of a particular rendering mode.\n *\n * @param String [mode] - The mode for which get the specifications.\n * @returns Vector\n *\/\nfunction renderMode(mode) = fetch(MODES, or(mode, DEFAULT_MODE));\n\n\/**\n * Gets the minimum facet angle for a particular rendering mode.\n *\n * @param String [mode] - The mode for which get the specification.\n * @returns Number\n *\/\nfunction facetAngle(mode) = renderMode(mode)[1];\n\n\/**\n * Gets the minimum facet size for a particular rendering mode.\n *\n * @param String [mode] - The mode for which get the specification.\n * @returns Number\n *\/\nfunction facetSize(mode) = renderMode(mode)[2];\n\n\/**\n * Applies a render mode onto the children modules.\n *\n * @param String [mode] - The mode to apply on the children modules.\n *\/\nmodule applyMode(mode) {\n $fa = facetAngle(mode);\n $fs = facetSize(mode);\n\n children();\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rendering mode.\n *\n * @package core\/mode\n * @author jsconan\n *\/\n\n\/**\n * Specifications for each rendering modes.\n * Each mode is defined this way: [\"name\", value for $fa, value for $fs]\n * @type Vector\n *\/\nMODES = [\n [\"dirty\", 6, 2],\n [\"dev\", 1, 1.5],\n [\"prod\", .5, .5]\n];\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = \"dev\";\n\n\/**\n * Gets the specifications of a particular rendering mode.\n *\n * @param String [mode] - The mode for which get the specifications.\n * @returns Vector\n *\/\nfunction renderMode(mode) = fetch(MODES, or(mode, DEFAULT_MODE));\n\n\/**\n * Gets the minimum facet angle for a particular rendering mode.\n *\n * @param String [mode] - The mode for which get the specification.\n * @returns Number\n *\/\nfunction facetAngle(mode) = renderMode(mode)[1];\n\n\/**\n * Gets the minimum facet size for a particular rendering mode.\n *\n * @param String [mode] - The mode for which get the specification.\n * @returns Number\n *\/\nfunction facetSize(mode) = renderMode(mode)[2];\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a0992153aafef90b8a819da6bdf9d7fe43bce292","subject":"=Deckelnut verkleinert und Kuehlrippen angepasst.","message":"=Deckelnut verkleinert und Kuehlrippen angepasst.\n","repos":"oprobst\/Tauchlampe","old_file":"Video-Lampenkopf.scad","new_file":"Video-Lampenkopf.scad","new_contents":"\/*\n * UW Video Leuchte\n * \n * Breiter Fokus mit viel Lichtleistung\n * M\u00f6glichst modular aufgebaut.\n *\n *\/\n\n\/\/ACHTUNG: Das Glas hat eine Toleranz von \u00b1 0.5mm, was eine Berechnung des \n\/\/ O-Rings und der dazugeh\u00f6rigen Nut erst erm\u00f6glicht, \n\/\/ wenn das Teil genau ausgemessen ist.\n\n\/\/ Aktueller Raum f\u00fcr Elektronik: 48mm Durchmesser, 40mm L\u00e4nge...\n\n\/\/Rendering information\n$fn=100;\n\n\/\/ Variablenblock:\n\n\/\/ max. Gesamtradius des Geh\u00e4uses\ngehaeuseRadius = 44;\nauflageRadiusGlas = 30;\nglasRadius = 35;\ngesamtLaenge = 90;\n\n\/\/M3 DIN 912 Innensechskantschrauben\nkernlochM3 = 1.25;\ndurchfuehrungM3 = 1.6;\nschraubenkopfM3 = 2.85;\nschraubenkopfM3hoehe = 3.0;\n\n\/\/Axiale O-Ringe fuer Scheibe (ID = 60mm, Dicke = 2.5mm)\noRingRadiusInnen = 30.0;\noRingRadiusAussen = oRingRadiusInnen + 2.5;\noRingNutbreite = 3.4;\noRingNutTiefe = 1.9; \/\/(\u00b1 0,06)\noRingNutAussenRadius = gehaeuseRadius - 4 -durchfuehrungM3 - schraubenkopfM3 - kernlochM3;\noRingNutInnenRadius = oRingNutAussenRadius - oRingNutbreite ;\n\nkernlochKabelverschraubung = 7;\n\necho (\"O-Ring Nut Ma\u00dfe: ID= \", oRingNutInnenRadius * 2, \" AD=\", oRingNutAussenRadius *2);\n\n\n\n\/\/Konstruktion der Hauptkomponenten:\n\n\/\/Die Deckelscheibe h\u00e4lt das Glas in der Fassung.\ntranslate ([0, 0, 230]){\n deckelscheibe(auflageRadiusGlas, gehaeuseRadius, 6);\n}\n\n\n\/\/Glasscheibe mit Dichtringen\ntranslate ([0, 0, 200]){ \n frontGlas (oRingRadiusInnen, oRingRadiusAussen);\n}\n\n\/\/Linse vor LED\ntranslate ([0, 0, 160]){\n rotate ([0,0,25]){\n linse ();\n }\n}\n\n\/\/LED\ntranslate ([0,0,140]){ \n rotate ([0,0,25]){\n led (); \n }\n}\n\n\/\/LED Tr\u00e4gerplatte mit Kernlochbohrungen f\u00fcr LED Modul\ndifference (){\n \/\/LED carrier\n translate ([0,0,130]){\n ledCarrier(30, 5);\n }\n\n \/\/ Bohrungen f\u00fcr LED\n rotate ([0,0,25]){\n for (i= [[17,17,130-1],\n [-17,17,130-1],\n [17,-17,130-1],\n [-17,-17, 130-1]]){\n translate (i){\n cylinder (h = 11, r = 1.25);\n }\n }\n }\n}\n\nkorpus (gehaeuseRadius, glasRadius, 30);\n\n\n\n\/\/Konstruktion der Deckelscheibe.\n\/\/ Diese klemmt die Borsilika Scheibe mit zwei O-Ringen.\n\/\/ Sie wird mit 8 Schrauben auf dem Geh\u00e4use befestigt.\nmodule deckelscheibe (innenRadius, aussenRadius, hoehe){\n difference(){\n cylinder (h = hoehe, r = aussenRadius); \n translate ([0, 0, -0.1]){\n cylinder (h = hoehe + 0.2, r = innenRadius);\n }\n\n \/\/ M3 Durchf\u00fchrung, 1mm vom Rand entfernt\n translate ([0, 0, -0.1]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, durchfuehrungM3, 8 , hoehe + 0.2); \n }\n \/\/ Senkung f\u00fcr M3, DIN 912, Innensechskant Schraubenk\u00f6pfe\n translate ([0, 0, hoehe-schraubenkopfM3hoehe]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, \n schraubenkopfM3, 8 , \n schraubenkopfM3hoehe + 0.1);\n }\n\n \/\/Nut f\u00fcr O-Ring \n translate ([0, 0, -1.0]){ \n \/\/ 2 mm vom Kernloch der Verschraubung entfernt:\n ring (oRingNutAussenRadius, \n oRingNutInnenRadius, \n oRingNutTiefe); \/\/ + 1.0 O-Ring klemmt nur und dichtet hier nicht.\n }\n }\n}\n\n\n\n\/\/Konstruktion der Borsilikascheibe mit Dichtringen\nmodule frontGlas (dichtringID, dichtringAD){\n\n \/\/ Borsilika Glas\n \/\/ \u00f8: 70 (\u00b1 0.5) x 12 (\u00b1 0.5)\n \n color(\"LightBlue\"){\n cylinder (h = 12, r = glasRadius);\n } \n\n \/\/O-Ringe\n color(\"Black\"){\n \/\/axial oben (nicht dichtend)\n translate ([0,0, 20]){\n ring ( dichtringAD, dichtringID, dichtringAD-dichtringID);\n }\n\n \/\/axial unten\n translate ([0,0,-10]){\n ring ( dichtringAD, dichtringID, dichtringAD-dichtringID); \n } \n }\n}\n\n \n\/\/ Linse f\u00fcr LED\nmodule linse (){\n color(\"LightSteelBlue\"){\n difference (){ \n sphere (22.0);\n translate ([-25,-25,-23.0]){\n cube ([50,50,23]);\n }\n }\n translate ([-0,-0, -8]){\n cylinder(r=25,h=8); \n }\n }\n}\n\n\n\/\/ Die LED die aufgeschraubt wird\nmodule led(){\n \n color(\"SlateGray\"){\n difference (){ \n cylinder (h = 1.42, r = 28);\n translate ([-20,20,-1.0]){\n cube ( [40, 20, 2.43]);\n }\n translate ([-20,-40,-1]){\n cube ( [40, 20, 3.43]);\n }\n \n for (i=[[17,17,-1],\n [-17,17,-1],\n [17,-17,-1],\n [ -17,-17, -1]]){\n translate (i){\n cylinder (h = 2.430, r= 1.75);\n }\n } \n \n }\n }\n\n color(\"Gray\"){\n difference (){ \n translate ([-20, -20, 1.42]){\n cube ( [40, 40, 2.86]);\n }\n translate ([-20, -20, 1.41]){\n for (i=[[0,40,-1],\n [40,0,-1],\n [0,0,-1],\n [40 ,40 ,-1]]){\n translate (i){ \n cylinder (h = 3.895, r= 10);\n }\n }\n }\n }\n }\n \n color (\"Yellow\"){\n translate ([-10.5, -10.5, 1.43]){\n cube ( [21, 21, 2.88]);\n }\n }\n\n}\n\n\n\/\/Auf diesen Tr\u00e4ger wird die LED geschraubt\nmodule ledCarrier(aussenRadius, hoehe){\n \n difference (){\n \n cylinder (h = hoehe, r = aussenRadius); \n \n \/\/ M3 Durchf\u00fchrung, 1mm vom Rand entfernt\n translate ([0, 0, -0.1]){\n bohrungenAufRadius (aussenRadius - 1 - schraubenkopfM3, durchfuehrungM3 , 8 , hoehe + 0.2); \n }\n \/\/ Senkung f\u00fcr M3, DIN 912, Innensechskant Schraubenk\u00f6pfe\n translate ([0, 0, hoehe-schraubenkopfM3hoehe]){\n bohrungenAufRadius (aussenRadius - 1 - schraubenkopfM3, \n schraubenkopfM3, 8 , \n schraubenkopfM3hoehe + 0.1);\n }\n }\n}\n\n\/\/Der Hauptlampenk\u00f6rper \nmodule korpus(aussenRadius, glasAufnahmeRadius, ledAufnahmeRadius){ \n\n difference(){\n cylinder (h = gesamtLaenge, r = aussenRadius); \n \n \/\/ === Innen\n\n \/\/Glasaufnahme\n translate ([0, 0, gesamtLaenge - 12]){ \n cylinder (h = gesamtLaenge, r = glasAufnahmeRadius + 0.25); \n }\n\n \/\/Bohrungen f\u00fcr Glasplattenhalter\n translate ([0, 0, gesamtLaenge - 20]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, kernlochM3, 8 ,gesamtLaenge ); \n }\n \n \/\/Nut f\u00fcr O-Ring \n translate ([0, 0, gesamtLaenge - 12 - oRingNutTiefe]){ \n \/\/ 2 mm vom Kernloch der Verschraubung entfernt:\n ring (oRingNutAussenRadius, \n oRingNutInnenRadius, \n oRingNutTiefe + 1.0);\n }\n\n \/\/LED Tr\u00e4ger Aufnahme\n translate ([0, 0, gesamtLaenge - 12 - 35]){ \/\/= -glas - ledcarrier\n cylinder (h = gesamtLaenge, r = ledAufnahmeRadius + 0.25); \n }\n\n \/\/Kernlochbohrungen f\u00fcr Tr\u00e4geraufnahme M3\n translate ([0, 0, gesamtLaenge - 12 - 35 - 20]){ \n bohrungenAufRadius (ledAufnahmeRadius - 1 - schraubenkopfM3, kernlochM3, 8 , 150); \n }\n\n \/\/Raum elektronik\n translate ([0, 0, 3]){ \n cylinder (h = gesamtLaenge, r = 24); \n }\n\n \/\/Kabelverschraubung\n translate ([0,0,-.05]){\n cylinder (h = 6.1, r = kernlochKabelverschraubung); \n }\n\n \/\/ === Au\u00dfen\n \n \/\/ Aufnahme f\u00fcr Goodman Befestigung\n translate ([0, 0, gesamtLaenge - 30]){ \n ring (aussenRadius + 3.00, \n aussenRadius - 1.0, \n 10.0);\n }\n\n \/\/ K\u00fchlrippen\n for (i=[22:4:gesamtLaenge - 34]){\n translate ([0, 0, i]){ \n ring (aussenRadius + 3.00, \n ledAufnahmeRadius + 3.0, \n 2.5);\n }\n }\n translate ([0, 0, 10]){ \n ring (aussenRadius + 3.00, \n ledAufnahmeRadius + 11, \/\/rippenl\u00e4nge = 8mm \n 45);\n }\n \n \n translate ([0, 0, -1]){ \n ring (aussenRadius + 3.0, 27, 20); \n } \n }\n\n \/\/Leichte erh\u00f6hung f\u00fcr Gewinde der Kabelverschraubung\n difference(){\n \n cylinder (h = 6, r = kernlochKabelverschraubung *1.6); \n \n \/\/Gewinde f\u00fcr M16 x 1,5 Verschraubung\n translate ([0,0,-.05]){\n cylinder (h = 6.1, r = kernlochKabelverschraubung); \n }\n\n }\n\n \n \n} \n\n\n\/\/ Zeichnet eine Reihe von Zylindern auf einem festgelegtem Radius.\n\/\/ Gut geeignet um auf einem Ring Bohrungen anzubringen.\nmodule bohrungenAufRadius (radius, lochRadius, anzahl, tiefe){\n for ( i = [0 : anzahl] ) {\n rotate( i * 360 \/ anzahl + 1, [0, 0, 1]){\n translate ([radius ,0 , -0.1]){\n cylinder (h = tiefe + 0.1, r = lochRadius); \n } \n } \n }\n}\n\n\n\/\/ Ein einfacher Ring\nmodule ring(aussenRadius, innenRadius, hoehe) {\n difference() {\n cylinder(r = aussenRadius, h = hoehe);\n translate([ 0, 0, -1 ]) cylinder(r = innenRadius, h = hoehe+2);\n }\n}\n","old_contents":"\/*\n * UW Video Leuchte\n * \n * Breiter Fokus mit viel Lichtleistung\n * M\u00f6glichst modular aufgebaut.\n *\n *\/\n\n\/\/ACHTUNG: Das Glas hat eine Toleranz von \u00b1 0.5mm, was eine Berechnung des \n\/\/ O-Rings und der dazugeh\u00f6rigen Nut erst erm\u00f6glicht, \n\/\/ wenn das Teil genau ausgemessen ist.\n\n\/\/ Aktueller Raum f\u00fcr Elektronik: 48mm Durchmesser, 40mm L\u00e4nge...\n\n\/\/Rendering information\n$fn=200;\n\n\/\/ Variablenblock:\n\n\/\/ max. Gesamtradius des Geh\u00e4uses\ngehaeuseRadius = 44;\nauflageRadiusGlas = 30;\nglasRadius = 35;\ngesamtLaenge = 90;\n\n\/\/M3 DIN 912 Innensechskantschrauben\nkernlochM3 = 1.25;\ndurchfuehrungM3 = 1.6;\nschraubenkopfM3 = 2.85;\nschraubenkopfM3hoehe = 3.0;\n\n\/\/Axiale O-Ringe fuer Scheibe (ID = 60mm, Dicke = 2.5mm)\noRingRadiusInnen = 30.0;\noRingRadiusAussen = oRingRadiusInnen + 2.5;\noRingNutbreite = 3.4;\noRingNutTiefe = 1.9; \/\/(\u00b1 0,06)\noRingNutAussenRadius = gehaeuseRadius - 4 -durchfuehrungM3 - schraubenkopfM3 - kernlochM3;\noRingNutInnenRadius = oRingNutAussenRadius - oRingNutbreite ;\n\nkernlochKabelverschraubung = 7;\n\necho (\"O-Ring Nut Ma\u00dfe: ID= \", oRingNutInnenRadius * 2, \" AD=\", oRingNutAussenRadius *2);\n\n\n\n\/\/Konstruktion der Hauptkomponenten:\n\n\/\/Die Deckelscheibe h\u00e4lt das Glas in der Fassung.\ntranslate ([0, 0, 230]){\n deckelscheibe(auflageRadiusGlas, gehaeuseRadius, 6);\n}\n\n\n\/\/Glasscheibe mit Dichtringen\ntranslate ([0, 0, 200]){ \n frontGlas (oRingRadiusInnen, oRingRadiusAussen);\n}\n\n\/\/Linse vor LED\ntranslate ([0, 0, 160]){\n rotate ([0,0,25]){\n linse ();\n }\n}\n\n\/\/LED\ntranslate ([0,0,140]){ \n rotate ([0,0,25]){\n led (); \n }\n}\n\n\/\/LED Tr\u00e4gerplatte mit Kernlochbohrungen f\u00fcr LED Modul\ndifference (){\n \/\/LED carrier\n translate ([0,0,130]){\n ledCarrier(30, 5);\n }\n\n \/\/ Bohrungen f\u00fcr LED\n rotate ([0,0,25]){\n for (i= [[17,17,130-1],\n [-17,17,130-1],\n [17,-17,130-1],\n [-17,-17, 130-1]]){\n translate (i){\n cylinder (h = 11, r = 1.25);\n }\n }\n }\n}\n\nkorpus (gehaeuseRadius, glasRadius, 30);\n\n\n\n\/\/Konstruktion der Deckelscheibe.\n\/\/ Diese klemmt die Borsilika Scheibe mit zwei O-Ringen.\n\/\/ Sie wird mit 8 Schrauben auf dem Geh\u00e4use befestigt.\nmodule deckelscheibe (innenRadius, aussenRadius, hoehe){\n difference(){\n cylinder (h = hoehe, r = aussenRadius); \n translate ([0, 0, -0.1]){\n cylinder (h = hoehe + 0.2, r = innenRadius);\n }\n\n \/\/ M3 Durchf\u00fchrung, 1mm vom Rand entfernt\n translate ([0, 0, -0.1]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, durchfuehrungM3, 8 , hoehe + 0.2); \n }\n \/\/ Senkung f\u00fcr M3, DIN 912, Innensechskant Schraubenk\u00f6pfe\n translate ([0, 0, hoehe-schraubenkopfM3hoehe]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, \n schraubenkopfM3, 8 , \n schraubenkopfM3hoehe + 0.1);\n }\n\n \/\/Nut f\u00fcr O-Ring \n translate ([0, 0, -1.0]){ \n \/\/ 2 mm vom Kernloch der Verschraubung entfernt:\n ring (oRingNutAussenRadius, \n oRingNutInnenRadius, \n oRingNutTiefe + 1.0);\n }\n }\n}\n\n\n\n\/\/Konstruktion der Borsilikascheibe mit Dichtringen\nmodule frontGlas (dichtringID, dichtringAD){\n\n \/\/ Borsilika Glas\n \/\/ \u00f8: 70 (\u00b1 0.5) x 12 (\u00b1 0.5)\n \n color(\"LightBlue\"){\n cylinder (h = 12, r = glasRadius);\n } \n\n \/\/O-Ringe\n color(\"Black\"){\n \/\/axial oben (nicht dichtend)\n translate ([0,0, 20]){\n ring ( dichtringAD, dichtringID, dichtringAD-dichtringID);\n }\n\n \/\/axial unten\n translate ([0,0,-10]){\n ring ( dichtringAD, dichtringID, dichtringAD-dichtringID); \n } \n }\n}\n\n \n\/\/ Linse f\u00fcr LED\nmodule linse (){\n color(\"LightSteelBlue\"){\n difference (){ \n sphere (22.0);\n translate ([-25,-25,-23.0]){\n cube ([50,50,23]);\n }\n }\n translate ([-0,-0, -8]){\n cylinder(r=25,h=8); \n }\n }\n}\n\n\n\/\/ Die LED die aufgeschraubt wird\nmodule led(){\n \n color(\"SlateGray\"){\n difference (){ \n cylinder (h = 1.42, r = 28);\n translate ([-20,20,-1.0]){\n cube ( [40, 20, 2.43]);\n }\n translate ([-20,-40,-1]){\n cube ( [40, 20, 3.43]);\n }\n \n for (i=[[17,17,-1],\n [-17,17,-1],\n [17,-17,-1],\n [ -17,-17, -1]]){\n translate (i){\n cylinder (h = 2.430, r= 1.75);\n }\n } \n \n }\n }\n\n color(\"Gray\"){\n difference (){ \n translate ([-20, -20, 1.42]){\n cube ( [40, 40, 2.86]);\n }\n translate ([-20, -20, 1.41]){\n for (i=[[0,40,-1],\n [40,0,-1],\n [0,0,-1],\n [40 ,40 ,-1]]){\n translate (i){ \n cylinder (h = 3.895, r= 10);\n }\n }\n }\n }\n }\n \n color (\"Yellow\"){\n translate ([-10.5, -10.5, 1.43]){\n cube ( [21, 21, 2.88]);\n }\n }\n\n}\n\n\n\/\/Auf diesen Tr\u00e4ger wird die LED geschraubt\nmodule ledCarrier(aussenRadius, hoehe){\n \n difference (){\n \n cylinder (h = hoehe, r = aussenRadius); \n \n \/\/ M3 Durchf\u00fchrung, 1mm vom Rand entfernt\n translate ([0, 0, -0.1]){\n bohrungenAufRadius (aussenRadius - 1 - schraubenkopfM3, durchfuehrungM3 , 8 , hoehe + 0.2); \n }\n \/\/ Senkung f\u00fcr M3, DIN 912, Innensechskant Schraubenk\u00f6pfe\n translate ([0, 0, hoehe-schraubenkopfM3hoehe]){\n bohrungenAufRadius (aussenRadius - 1 - schraubenkopfM3, \n schraubenkopfM3, 8 , \n schraubenkopfM3hoehe + 0.1);\n }\n }\n}\n\n\/\/Der Hauptlampenk\u00f6rper \nmodule korpus(aussenRadius, glasAufnahmeRadius, ledAufnahmeRadius){ \n\n difference(){\n cylinder (h = gesamtLaenge, r = aussenRadius); \n \n \/\/ === Innen\n\n \/\/Glasaufnahme\n translate ([0, 0, gesamtLaenge - 12]){ \n cylinder (h = gesamtLaenge, r = glasAufnahmeRadius + 0.25); \n }\n\n \/\/Bohrungen f\u00fcr Glasplattenhalter\n translate ([0, 0, gesamtLaenge - 20]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, kernlochM3, 8 ,gesamtLaenge ); \n }\n \n \/\/Nut f\u00fcr O-Ring \n translate ([0, 0, gesamtLaenge - 12 - oRingNutTiefe]){ \n \/\/ 2 mm vom Kernloch der Verschraubung entfernt:\n ring (oRingNutAussenRadius, \n oRingNutInnenRadius, \n oRingNutTiefe + 1.0);\n }\n\n \/\/LED Tr\u00e4ger Aufnahme\n translate ([0, 0, gesamtLaenge - 12 - 35]){ \/\/= -glas - ledcarrier\n cylinder (h = gesamtLaenge, r = ledAufnahmeRadius + 0.25); \n }\n\n \/\/Kernlochbohrungen f\u00fcr Tr\u00e4geraufnahme M3\n translate ([0, 0, gesamtLaenge - 12 - 35 - 20]){ \n bohrungenAufRadius (ledAufnahmeRadius - 1 - schraubenkopfM3, kernlochM3, 8 , 150); \n }\n\n \/\/Raum elektronik\n translate ([0, 0, 3]){ \n cylinder (h = gesamtLaenge, r = 24); \n }\n\n \/\/Kabelverschraubung\n translate ([0,0,-.05]){\n cylinder (h = 6.1, r = kernlochKabelverschraubung); \n }\n\n \/\/ === Au\u00dfen\n \n \/\/ Aufnahme f\u00fcr Goodman Befestigung\n translate ([0, 0, gesamtLaenge - 30]){ \n ring (aussenRadius + 3.00, \n aussenRadius - 1.0, \n 10.0);\n }\n\n \/\/ K\u00fchlrippen\n for (i=[25:4:gesamtLaenge - 34]){\n translate ([0, 0, i]){ \n ring (aussenRadius + 3.00, \n ledAufnahmeRadius + 3.0, \n 2.5);\n }\n }\n translate ([0, 0, 20]){ \n ring (aussenRadius + 3.00, \n ledAufnahmeRadius + 11, \/\/rippenl\u00e4nge = 8mm \n 35);\n }\n \n \n translate ([0, 0, -1]){ \n ring (aussenRadius + 3.0, 27, 25); \n } \n }\n\n \/\/Leichte erh\u00f6hung f\u00fcr Gewinde der Kabelverschraubung\n difference(){\n \n cylinder (h = 6, r = kernlochKabelverschraubung *1.6); \n \n \/\/Gewinde f\u00fcr M16 x 1,5 Verschraubung\n translate ([0,0,-.05]){\n cylinder (h = 6.1, r = kernlochKabelverschraubung); \n }\n\n }\n\n \n \n} \n\n\n\/\/ Zeichnet eine Reihe von Zylindern auf einem festgelegtem Radius.\n\/\/ Gut geeignet um auf einem Ring Bohrungen anzubringen.\nmodule bohrungenAufRadius (radius, lochRadius, anzahl, tiefe){\n for ( i = [0 : anzahl] ) {\n rotate( i * 360 \/ anzahl + 1, [0, 0, 1]){\n translate ([radius ,0 , -0.1]){\n cylinder (h = tiefe + 0.1, r = lochRadius); \n } \n } \n }\n}\n\n\n\/\/ Ein einfacher Ring\nmodule ring(aussenRadius, innenRadius, hoehe) {\n difference() {\n cylinder(r = aussenRadius, h = hoehe);\n translate([ 0, 0, -1 ]) cylinder(r = innenRadius, h = hoehe+2);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"9da175e97deac6aa884b72f15b3c77264138d821","subject":"Moved iotsa board retainer a bit","message":"Moved iotsa board retainer a bit\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"extras\/iotsaCase.scad","new_file":"extras\/iotsaCase.scad","new_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\niotsaBoardXSize = 63.5 - numberOfMMRemoved; \/\/ one dimension of the unmodified board\niotsaBoardYSize = 43.5; \/\/ the other dimension of the board\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nesp12AntennaStickout = 5; \/\/ How many mm the esp12 antenna sticks out of the iotsa board\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([iotsaBoardXSize,iotsaBoardYSize,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-esp12AntennaStickout, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 14; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 1.5;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually) and around connector\n\n\/\/ Computed parameters\ninnerXSize = iotsaBoardXSize + esp12AntennaStickout + 2*leeWay;\ninnerYSize = iotsaBoardYSize + 2*leeWay;\ninnerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n\nouterXSize = innerXSize + boxLeftThickness + boxRightThickness;\nouterYSize = innerYSize + boxFrontThickness + boxBackThickness;\nouterZSize = innerZSize + boxBottomThickness + boxTopThickness;\n\nstrutThickness = 2;\nretainerWidth = 3;\nretainerLength = 6;\n\nmodule box() {\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+boxTopThickness+1]);\n }\n }\n \n module completeBox() {\n translate([-esp12AntennaStickout-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -0.5*boxFrontThickness, outerZSize-boxTopThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n * translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n\n \/\/ front left retainer hole\n translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ front right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n\n \/\/ back left retainer hole\n translate([boxLeftThickness,innerYSize+boxFrontThickness-0.5*boxBackThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxBackThickness, retainerWidth]); \n \/\/ back right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, innerYSize+boxFrontThickness-0.5*boxBackThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxBackThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize+boxFrontThickness-strutThickness, 0])\n cube([outerXSize, boxBackThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n }\n \n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n module rightHoles() {\n \/\/ Holes on the right. Y and Z are relative to iotsa frontright cornet, X should be 2* rightThickness\n * translate([0, 16, 0]) cube([2*boxRightThickness, 9+2*leeWay, 11+2*leeWay]);\n }\n module bottomHoles() {\n \/\/ Holes in the bottom. X and Y are relative to inner box frontleft corner, Z should be 2*bottomThickness\n \/\/ 4 screw holes\n translate([3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n \n \/\/ center hole for wires\n translate([innerXSize\/2, innerYSize\/2, 0]) cylinder(2*boxBottomThickness, d=6, $fn=12);\n }\n \n union() {\n difference() {\n \/\/ The box itself\n completeBox();\n \/\/ The holes in the enclosure\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n \n translate([iotsaBoardXSize+leeWay-0.5*boxRightThickness, 0, 0]) rightHoles();\n \n translate([-esp12AntennaStickout, -leeWay, -(boardThickness+iotsaSolderingHeight+1.5*boxBottomThickness+leeWay)]) bottomHoles();\n \n }\n % iotsaBoard();\n }\n}\n\nmodule lid() {\n translate([-esp12AntennaStickout-leeWay, -boxFrontThickness-leeWay, iotsaComponentHeight + leeWay])\n union() {\n \/\/ The lid itself\n cube([innerXSize, innerYSize+boxFrontThickness, boxTopThickness]);\n \/\/ The left front retainer rod\n translate([0, boxFrontThickness, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([0.5*retainerWidth, 0.75*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n\n \/\/ The right front retainer rod\n translate([innerXSize-retainerWidth, boxFrontThickness, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([innerXSize-0.5*retainerWidth, 0.75*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n\n \/\/ The left back retainer rod\n translate([0, innerYSize+boxFrontThickness-retainerWidth, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([0.5*retainerWidth, innerYSize+boxFrontThickness-0.25*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n\n \/\/ The right back retainer rod\n translate([innerXSize-retainerWidth, innerYSize+boxFrontThickness+-retainerWidth, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([innerXSize-0.5*retainerWidth, innerYSize+boxFrontThickness-0.25*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n \n \/\/ The board locking rod\n translate([41-retainerWidth, innerYSize+boxFrontThickness-retainerWidth, -iotsaComponentHeight]) cube([retainerWidth, retainerWidth, iotsaComponentHeight+boxTopThickness]);\n }\n}\n\nbox();\n% lid();\n\ntranslate([outerXSize-(esp12AntennaStickout+boxLeftThickness+leeWay), 1.2*outerYSize, outerZSize-(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)]) rotate([0, 180, 0]) translate([(esp12AntennaStickout+boxLeftThickness+leeWay), 0, (boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)]) {\n % box();\n lid();\n}\n","old_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\niotsaBoardXSize = 63.5 - numberOfMMRemoved; \/\/ one dimension of the unmodified board\niotsaBoardYSize = 43.5; \/\/ the other dimension of the board\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nesp12AntennaStickout = 5; \/\/ How many mm the esp12 antenna sticks out of the iotsa board\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([iotsaBoardXSize,iotsaBoardYSize,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-esp12AntennaStickout, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 14; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 1.5;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually) and around connector\n\n\/\/ Computed parameters\ninnerXSize = iotsaBoardXSize + esp12AntennaStickout + 2*leeWay;\ninnerYSize = iotsaBoardYSize + 2*leeWay;\ninnerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n\nouterXSize = innerXSize + boxLeftThickness + boxRightThickness;\nouterYSize = innerYSize + boxFrontThickness + boxBackThickness;\nouterZSize = innerZSize + boxBottomThickness + boxTopThickness;\n\nstrutThickness = 2;\nretainerWidth = 3;\nretainerLength = 6;\n\nmodule box() {\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+boxTopThickness+1]);\n }\n }\n \n module completeBox() {\n translate([-esp12AntennaStickout-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -0.5*boxFrontThickness, outerZSize-boxTopThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n * translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n\n \/\/ front left retainer hole\n translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ front right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n\n \/\/ back left retainer hole\n translate([boxLeftThickness,innerYSize+boxFrontThickness-0.5*boxBackThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxBackThickness, retainerWidth]); \n \/\/ back right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, innerYSize+boxFrontThickness-0.5*boxBackThickness, outerZSize-boxTopThickness-retainerLength]) \n cube([retainerWidth, 2*boxBackThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize+boxFrontThickness-strutThickness, 0])\n cube([outerXSize, boxBackThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n }\n \n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n module rightHoles() {\n \/\/ Holes on the right. Y and Z are relative to iotsa frontright cornet, X should be 2* rightThickness\n * translate([0, 16, 0]) cube([2*boxRightThickness, 9+2*leeWay, 11+2*leeWay]);\n }\n module bottomHoles() {\n \/\/ Holes in the bottom. X and Y are relative to inner box frontleft corner, Z should be 2*bottomThickness\n \/\/ 4 screw holes\n translate([3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n \n \/\/ center hole for wires\n translate([innerXSize\/2, innerYSize\/2, 0]) cylinder(2*boxBottomThickness, d=6, $fn=12);\n }\n \n union() {\n difference() {\n \/\/ The box itself\n completeBox();\n \/\/ The holes in the enclosure\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n \n translate([iotsaBoardXSize+leeWay-0.5*boxRightThickness, 0, 0]) rightHoles();\n \n translate([-esp12AntennaStickout, -leeWay, -(boardThickness+iotsaSolderingHeight+1.5*boxBottomThickness+leeWay)]) bottomHoles();\n \n }\n % iotsaBoard();\n }\n}\n\nmodule lid() {\n translate([-esp12AntennaStickout-leeWay, -boxFrontThickness-leeWay, iotsaComponentHeight + leeWay])\n union() {\n \/\/ The lid itself\n cube([innerXSize, innerYSize+boxFrontThickness, boxTopThickness]);\n \/\/ The left front retainer rod\n translate([0, boxFrontThickness, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([0.5*retainerWidth, 0.75*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n\n \/\/ The right front retainer rod\n translate([innerXSize-retainerWidth, boxFrontThickness, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([innerXSize-0.5*retainerWidth, 0.75*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n\n \/\/ The left back retainer rod\n translate([0, innerYSize+boxFrontThickness-retainerWidth, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([0.5*retainerWidth, innerYSize+boxFrontThickness-0.25*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n\n \/\/ The right back retainer rod\n translate([innerXSize-retainerWidth, innerYSize+boxFrontThickness+-retainerWidth, -retainerLength]) cube([retainerWidth, retainerWidth, retainerLength+boxTopThickness]);\n translate([innerXSize-0.5*retainerWidth, innerYSize+boxFrontThickness-0.25*retainerWidth, -retainerLength+0.5*retainerWidth]) sphere(d=retainerWidth, $fn=12);\n \n \/\/ The board locking rod\n translate([31-retainerWidth, innerYSize+boxFrontThickness-retainerWidth, -iotsaComponentHeight]) cube([retainerWidth, retainerWidth, iotsaComponentHeight+boxTopThickness]);\n }\n}\n\nbox();\n% lid();\n\ntranslate([outerXSize-(esp12AntennaStickout+boxLeftThickness+leeWay), 1.2*outerYSize, outerZSize-(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)]) rotate([0, 180, 0]) translate([(esp12AntennaStickout+boxLeftThickness+leeWay), 0, (boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)]) {\n % box();\n lid();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d88285b0802ca1c7fb0057901941706ac2bfec1c","subject":"fixed screw mount part","message":"fixed screw mount part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24.5\/2, h=2.5);\n cylinder(r=16\/2, h=1.5);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-1\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([1.5, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 7]);\n }\n }\n \/\/ screw hole\n screw_box_size=7+0.5;\n translate([-screw_box_size\/2, -screw_box_size\/2, 2.5+1])\n cube([screw_box_size, screw_box_size, 7-1]);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","old_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24.5\/2, h=2.5);\n cylinder(r=16\/2, h=1.5);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-1\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([1, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 7]);\n }\n }\n \/\/ screw hole\n translate([0, 0, 2.5+1])\n cylinder(r=(7+1.5)\/2, h=7-1, $fs=1);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7bdcf4edb79e0ff5163f874486fb2d7ec085690b","subject":"Fixed issue with fan_mount.scad","message":"Fixed issue with fan_mount.scad\n","repos":"twstdpear\/i3_parts","old_file":"bg8\/extruder\/better_clearance_fan_mount.scad","new_file":"bg8\/extruder\/better_clearance_fan_mount.scad","new_contents":"\n\nhot_rad = 30\/2\/cos(30);\nhotend_x=25;\nfan_x = 15+5;\n\nhotend_y=-5;\n\nthickness = 10;\nwall=2;\nslop=.2;\n\nfan_hole = (40-wall-wall)\/2;\nmount_drop = 10;\nfan_z = fan_hole+wall;\n\n\/\/fan_mount();\nbowden_fan();\n\n%cylinder(r=hot_rad, h=20, center=true);\n%translate([-23,0,0]) cylinder(r=hot_rad, h=20, center=true);\n\nm3_cap_rad = 4;\nm3_rad = 2;\nm3_nut_rad = 6.01\/2+.1;\n\nfacets = 6;\n\nmodule fan_mount(){\n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n \/\/fan mount\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n hull() for(i=[0:90:359]) rotate([0,0,i]) {\n #translate([20-wall,20-wall,-wall]) cylinder(r=wall,h=wall*2, $fn=16);\n } \n }\n \n \/\/mounting lugs above fan\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/fan holes\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) for(j=[-16, 16]) {\n #translate([j,i,-.1]) cylinder(r=m3_rad, h=wall+.2, $fn=16);\n translate([j,i,-wall*2-.1]) cylinder(r2=m3_nut_rad, r1=m3_nut_rad+.25, h=wall*2+.2, $fn=6);\n }\n }\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n translate([0,-5+hotend_y\/2,0])cube([100,10,wall]);\n }\n }\n}\n\nduct_angle=-5;\nduct_jut = -5;\n\nmodule bowden_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=38;\n \n mount_height = 46;\n \n offset = -20;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[10,-20,-40]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([5,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule duct(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 90, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n }\n \n translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n #translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n \n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bg8\/extruder\/better_clearance_fan_mount.scad' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"dd4c79611fd1acb62d7c6bba4c9554288a08325a","subject":"Changed all the screw holes to accept 2.2 mm diameter screws.","message":"Changed all the screw holes to accept 2.2 mm diameter screws.\n","repos":"RigacciOrg\/ProTherm,RigacciOrg\/ProTherm,RigacciOrg\/ProTherm","old_file":"case\/scad\/protherm-enclosure.scad","new_file":"case\/scad\/protherm-enclosure.scad","new_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.2;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.25;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n screw_diameter = 2.2;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=(screw_diameter * 0.75 \/ 2), h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Bush-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.2;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n","old_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.2;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.25;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=1, h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Bush-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 3.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.0;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.5;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"00c559c743bc1a6d66465f166b884572fd0ccfb7","subject":"Add demo for the hexagonBox shape and the repeat operator","message":"Add demo for the hexagonBox shape and the repeat operator\n","repos":"jsconan\/camelSCAD","old_file":"samples\/honeycombed.scad","new_file":"samples\/honeycombed.scad","new_contents":"\/**\r\n * Samples using the camelSCAD library.\r\n *\r\n * A parametric honeycombed style box\r\n *\r\n * @author jsconan\r\n * @license CC0-1.0\r\n *\/\r\n\r\n\/\/ As we need to use some shapes, use the right entry point of the library\r\nuse <..\/shapes.scad>\r\n\r\n\/**\r\n * Renders a honeycomb at the origin.\r\n *\r\n * @param Vector|Number size - The outer dimensions of the honeycomb\r\n * @param Number thickness - The thickness of the box walls (default 1). Cannot be greater than 10% of the lowest dimension.\r\n *\/\r\nmodule honeycomb(size, thickness) {\r\n \/\/ Adjust the values to get usable size and thickness\r\n size = vector3D(size);\r\n width = min(size[0], size[1]);\r\n thickness = min(numberOr(thickness, 1), width \/ 10);\r\n adjust = max(size[0], size[1]) - width;\r\n innerWidth = width - thickness * 2;\r\n\r\n difference() {\r\n \/\/ This is the outside of the honeycomb\r\n hexagonBox(l=width, w=width, h=size[2], adjust=adjust);\r\n\r\n \/\/ This is the inside of the honeycomb\r\n translate([0, 0, thickness]) {\r\n hexagonBox(l=innerWidth, w=innerWidth, h=size[2], adjust=adjust);\r\n }\r\n }\r\n\r\n}\r\n\r\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = \"prod\";\r\n\r\n\/\/ Defines the dimensions of the honeycomb\r\nlength = 60;\r\nwidth = 50;\r\nheight = 30;\r\nthickness = 2;\r\n\r\n\/\/ intervals between honeycombs\r\nadjustX = (max(length, width) - min(length, width)) \/ 4;\r\nspaceX = cos(60) * length \/ 2 + thickness - adjustX;\r\nspaceY = cos(30) * width - thickness;\r\n\r\n\/\/ The number of honeycombs to render on both X and Y axis\r\nnbX = 4;\r\nnbY = 4;\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\r\n$fa = facetAngle(renderMode);\r\n$fs = facetSize(renderMode);\r\n\r\n\/\/ The honeycombed box is drawed by rendering several honeycombs using the repeat2D operator\r\nrepeat2D(countX=nbX, countY=nbY, intervalX=[length - spaceX, spaceY \/ 2, 0], intervalY=[0, spaceY, 0]) {\r\n honeycomb(size = [length, width, height], thickness=thickness);\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/honeycombed.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7945d0c7630be83d0835ce765cfc6b6cd2947743","subject":"fixed hole mounts to be located at the center","message":"fixed hole mounts to be located at the center\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/junction_box.scad","new_file":"led_controler_junction_box\/junction_box.scad","new_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [70, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw holes\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center,\n wall+int_size[1]\/2,\n wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-2);\n translate([12\/2\/2*(dx-1), -10\/2, 0])\n cube([12\/2, 10, int_size[2]-2]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-2-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[0]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","old_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [70, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n #translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw drivers\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center, wall+30, wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-2);\n #translate([12\/2\/2*(dx-1), -10\/2, 0])\n cube([12\/2, 10, int_size[2]-2]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-2-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[0]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5489c9bc538cb0dc0ef3aa895a13bef6b1f57b51","subject":"added clearance in case top for solder bumps on header holes","message":"added clearance in case top for solder bumps on header holes\n","repos":"tedyapo\/serial-dmm-adapter","old_file":"hardware\/adapter_case.scad","new_file":"hardware\/adapter_case.scad","new_contents":"\/\/ Serial DMM adapter case\n\/\/ designed to fit an Arduino nano clone and a DB-9 male plug\n\/\/\n\/\/ Copyright (C) 2016 Theodore C. Yapo\n\nlayout = \"printing\";\n\/\/layout = \"exploded\";\n\n\nboard_width = 18.5;\nboard_length = 44.5;\nboard_thickness = 1.85;\nusb_lip = 2;\nusb_height = 4.25;\nusb_width = 8;\nusb_length = 9;\n\nmodule nano_board()\n{\n translate([-board_length\/2, -board_width\/2, 0]){\n color(\"blue\") cube([board_length, board_width, board_thickness]);\n }\n translate([-board_length\/2-2.5, -usb_width\/2, board_thickness]){\n color([0.85, 0.85, 0.85]) cube([usb_length, usb_width, usb_height]);\n }\n}\n\ndb9_hole_spacing = 25;\nmodule db9_profile()\n{\n corner_r = 3;\n top_w = 19.5;\n bottom_w = 17.5;\n height = 9.5;\n length = 7;\n back_length = 9;\n flange_w = 33.5;\n flange_h = 20;\n flange_r = 1;\n flange_thickness = 1.25;\n fn = 13;\n epsilon = 0.1;\n\n \/\/ pin shroud\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([+(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n }\n }\n\n \/\/ back body\n b_corner_r = 3;\n b_top_w = 22;\n b_bottom_w = 19;\n b_height = 12;\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([+(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n }\n }\n\n \/\/ flange\n hull(){\n translate([+(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([+(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n }\n\n\n}\n\nheight = 20;\nlength = 64;\nwidth = 22;\nboard_lip = 2;\nconnector_width = 40;\nconnector_length = 18;\nconnector_recess = 5;\nconnector_height = 13;\nbulge_length = 10;\nbottom_thickness = 3;\nnut_dist = 6;\nscrew_hole_d = 3.25;\nscrew_hole_x = length\/2 - connector_length + 5;\nscrew_hole_y = (connector_width + width) \/ 4;\n\nmodule case_bottom()\n{\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height\/2]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n \/\/ board recess\n translate([-length\/2 + usb_lip,\n -board_width\/2,\n height\/2 - board_thickness]){\n cube([board_length,\n board_width,\n height\/2]);\n }\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n db9_profile();\n }\n }\n }\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n\n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n \/\/ DB connector screw holes\n translate([length\/2 -15, -db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n translate([length\/2 -15, +db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n\n }\n}\n\nmodule case_top()\n{\n epsilon = 1;\n\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, height-connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ DB9 connector bulge trim\n tol = 0.5;\n translate([length\/2 - connector_length - tol,\n -connector_width\/2,\n height-connector_height]){\n cube([connector_length+epsilon+tol, connector_width, connector_height]);\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height - connector_height]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ solder_bump recess\n solder_bump_thickness = 1.25;\n corner_size = 5;\n translate([-length\/2 + usb_lip + corner_size,\n -board_width\/2,\n height\/2 - solder_bump_thickness]){\n cube([board_length - 2*corner_size,\n board_width,\n height\/2]);\n }\n\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, 90]){\n db9_profile();\n }\n }\n }\n\n \/\/ usb slot\n translate([-length\/2-5, -usb_width\/2, height\/2-usb_height]){\n cube([10, usb_width, usb_height+epsilon]);\n }\n\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n \n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n}\n\n\nif (layout == \"exploded\"){ \n exploded_dist = 10;\n \n case_bottom();\n translate([0, 0, 4*exploded_dist]){\n mirror([0, 0, 1]){\n case_top();\n }\n }\n translate([-(length - board_length)\/2 + usb_lip,\n 0,\n height\/2 - board_thickness + exploded_dist]){\n nano_board();\n }\n translate([length\/2-connector_recess + exploded_dist,\n 0,\n height\/2 + exploded_dist]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n color([0.85, 0.85, 0.85]) db9_profile();\n }\n }\n }\n}\n\nif (layout == \"printing\"){\n s = 25;\n\n translate([0, +s, 0]){\n case_bottom();\n }\n translate([0, -s, 0]){\n rotate([0, 0, 180]){\n case_top();\n }\n }\n}\n","old_contents":"\/\/ Serial DMM adapter case\n\/\/ designed to fit an Arduino nano clone and a DB-9 male plug\n\/\/\n\/\/ Copyright (C) 2016 Theodore C. Yapo\n\nlayout = \"printing\";\n\/\/layout = \"exploded\";\n\n\nboard_width = 18.5;\nboard_length = 44.5;\nboard_thickness = 1.85;\nusb_lip = 2;\nusb_height = 4.25;\nusb_width = 8;\nusb_length = 9;\n\nmodule nano_board()\n{\n translate([-board_length\/2, -board_width\/2, 0]){\n color(\"blue\") cube([board_length, board_width, board_thickness]);\n }\n translate([-board_length\/2-2.5, -usb_width\/2, board_thickness]){\n color([0.85, 0.85, 0.85]) cube([usb_length, usb_width, usb_height]);\n }\n}\n\ndb9_hole_spacing = 25;\nmodule db9_profile()\n{\n corner_r = 3;\n top_w = 19.5;\n bottom_w = 17.5;\n height = 9.5;\n length = 7;\n back_length = 9;\n flange_w = 33.5;\n flange_h = 20;\n flange_r = 1;\n flange_thickness = 1.25;\n fn = 13;\n epsilon = 0.1;\n\n \/\/ pin shroud\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([+(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n }\n }\n\n \/\/ back body\n b_corner_r = 3;\n b_top_w = 22;\n b_bottom_w = 19;\n b_height = 12;\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([+(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n }\n }\n\n \/\/ flange\n hull(){\n translate([+(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([+(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n }\n\n\n}\n\nheight = 20;\nlength = 64;\nwidth = 22;\nboard_lip = 2;\nconnector_width = 40;\nconnector_length = 18;\nconnector_recess = 5;\nconnector_height = 13;\nbulge_length = 10;\nbottom_thickness = 3;\nnut_dist = 6;\nscrew_hole_d = 3.25;\nscrew_hole_x = length\/2 - connector_length + 5;\nscrew_hole_y = (connector_width + width) \/ 4;\n\nmodule case_bottom()\n{\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height\/2]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n \/\/ board recess\n translate([-length\/2 + usb_lip,\n -board_width\/2,\n height\/2 - board_thickness]){\n cube([board_length,\n board_width,\n height\/2]);\n }\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n db9_profile();\n }\n }\n }\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n\n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n \/\/ DB connector screw holes\n translate([length\/2 -15, -db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n translate([length\/2 -15, +db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n\n }\n}\n\nmodule case_top()\n{\n epsilon = 1;\n\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, height-connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ DB9 connector bulge trim\n tol = 0.5;\n translate([length\/2 - connector_length - tol,\n -connector_width\/2,\n height-connector_height]){\n cube([connector_length+epsilon+tol, connector_width, connector_height]);\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height - connector_height]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, 90]){\n db9_profile();\n }\n }\n }\n\n \/\/ usb slot\n translate([-length\/2-5, -usb_width\/2, height\/2-usb_height]){\n cube([10, usb_width, usb_height+epsilon]);\n }\n\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n \n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n}\n\n\nif (layout == \"exploded\"){ \n exploded_dist = 10;\n \n case_bottom();\n translate([0, 0, 4*exploded_dist]){\n mirror([0, 0, 1]){\n case_top();\n }\n }\n translate([-(length - board_length)\/2 + usb_lip,\n 0,\n height\/2 - board_thickness + exploded_dist]){\n nano_board();\n }\n translate([length\/2-connector_recess + exploded_dist,\n 0,\n height\/2 + exploded_dist]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n color([0.85, 0.85, 0.85]) db9_profile();\n }\n }\n }\n}\n\nif (layout == \"printing\"){\n s = 25;\n\n translate([0, +s, 0]){\n case_bottom();\n }\n translate([0, -s, 0]){\n rotate([0, 0, 180]){\n case_top();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d780d2f3104f57ee57fcace285aab16cb49699be","subject":"rack updated 4","message":"rack updated 4\n","repos":"rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru","old_file":"org\/lrn\/openscad\/rack.scad","new_file":"org\/lrn\/openscad\/rack.scad","new_contents":"height = 2400;\ndepth = 1400;\nwidth = 1300;\ntube_square_size = 80;\ntube_thickness = 3;\nsheet_thickness = 2;\npin_length = 25+sheet_thickness*2+80;\nbar_height = 2000;\n\nmodule SquareTube(h=height, w=tube_square_size, xyz=[0,0,0]) {\n TT = tube_thickness;\n color([0.5, 0.5, 0.5, 0.5])\n translate(xyz) {\n translate([w\/2, w\/2, 0]) {\n difference () {\n linear_extrude(height=h) \n square([w, w], center=true);\n translate([0, 0, -5])\n linear_extrude(height=h+6)\n square([w-TT, w-TT], center=true);\n }\n }\n }\n}\n\nmodule Frame(h=height, d=depth, w=tube_square_size) {\n SquareTube();\n SquareTube(xyz=[0,d+w,0]);\n rotate([-90]) {\n SquareTube(h=d, xyz=[0,-w,w]);\n SquareTube(h=d, xyz=[0,-h,w]);\n }\n QuadLock();\n}\n\nmodule Pin(len=pin_length) {\n color([0.8, 0.2, 0.1, 0.5])\n translate([0,0,-(len\/2-15)]) \n linear_extrude(height=pin_length)\n circle(d=16);\n}\n\nmodule Lock(sz=240, d=sheet_thickness) {\n color([0.5, 0.5, 0.2, 0.5])\n translate([0,120,120])\n rotate([0,-90]) {\n difference() {\n linear_extrude(d) \n square([sz, sz], center=true);\n translate([125,125,-10])\n rotate([0,0,45]) \n linear_extrude(d+20) \n square([sz, sz], center=true);\n \n }\n }\n}\n\nmodule DoubleLock(w=tube_square_size) {\n Lock();\n translate([tube_square_size+sheet_thickness,0,0]) {\n Lock();\n }\n \/\/ pins\n translate([0,120,120])\n rotate([0,-90]) {\n translate([w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w,-(pin_length\/2)]) { Pin(); }\n translate([-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([w-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w-w,-(pin_length\/2)]) { Pin(); }\n }\n}\n\nmodule PairLock(w=tube_square_size) {\n DoubleLock();\n rotate(180)\n translate([-w,-depth-w*2,0])\n DoubleLock();\n \n}\n\nmodule QuadLock(w=tube_square_size) {\n PairLock();\n translate([0,depth+w*2,height])\n rotate([180,0,0])\n PairLock();\n}\n\nmodule Flank(w=tube_square_size) {\n rotate([0,-90,0]) {\n linear_extrude(sheet_thickness)\n square([240, 80], center=true);\n translate([-w, w-w, (pin_length\/4)]) { Pin(); }\n translate([w, w-w, (pin_length\/4)]) { Pin(); }\n }\n}\n\n\nmodule Horbar(w=tube_square_size, bh=bar_height) {\n translate([w+sheet_thickness, w\/2, bh]) {\n Flank();\n rotate([0,90]) {\n linear_extrude(width-w-sheet_thickness*2)\n circle(16);\n }\n translate([width-w-sheet_thickness*2,0,0])\n rotate([0,180]) {\n Flank();\n }\n }\n}\n\n\nFrame();\ntranslate([width,0,0])\n Frame();\n\nHorbar();\n\ntranslate([-350, 1450, 800]) {\n rotate([0,90]) {\n linear_extrude(2020)\n circle(16);\n }\n}\n\ntranslate([40, depth+78, 770]) {\n rotate([0,0,270]) {\n Flank();\n rotate([0,-90,0]) {\n translate([0, 0, (pin_length\/4)]) { \n color([0.2, 0.2, 0.1, 0.5])\n translate([0,0,-80]) \n linear_extrude(height=190)\n circle(d=28);\n color([0.2, 0.2, 0.1, 0.5])\n translate([-20, -20, -80-sheet_thickness]) { \n linear_extrude(sheet_thickness)\n square(40);\n }\n }\n }\n }\n}\n","old_contents":"height = 2400;\ndepth = 1400;\nwidth = 1300;\ntube_square_size = 80;\ntube_thickness = 3;\nsheet_thickness = 2;\npin_length = 25+sheet_thickness*2+80;\nbar_height = 2000;\n\nmodule SquareTube(h=height, w=tube_square_size, xyz=[0,0,0]) {\n TT = tube_thickness;\n color([0.5, 0.5, 0.5, 0.5])\n translate(xyz) {\n translate([w\/2, w\/2, 0]) {\n difference () {\n linear_extrude(height=h) \n square([w, w], center=true);\n translate([0, 0, -5])\n linear_extrude(height=h+6)\n square([w-TT, w-TT], center=true);\n }\n }\n }\n}\n\nmodule Frame(h=height, d=depth, w=tube_square_size) {\n SquareTube();\n SquareTube(xyz=[0,d+w,0]);\n rotate([-90]) {\n SquareTube(h=d, xyz=[0,-w,w]);\n SquareTube(h=d, xyz=[0,-h,w]);\n }\n QuadLock();\n}\n\nmodule Pin(len=pin_length) {\n color([0.8, 0.2, 0.1, 0.5])\n translate([0,0,-(len\/2-15)]) \n linear_extrude(height=pin_length)\n circle(d=16);\n}\n\nmodule Lock(sz=240, d=sheet_thickness) {\n color([0.5, 0.5, 0.2, 0.5])\n translate([0,120,120])\n rotate([0,-90]) {\n difference() {\n linear_extrude(d) \n square([sz, sz], center=true);\n translate([125,125,-10])\n rotate([0,0,45]) \n linear_extrude(d+20) \n square([sz, sz], center=true);\n \n }\n }\n}\n\nmodule DoubleLock(w=tube_square_size) {\n Lock();\n translate([tube_square_size+sheet_thickness,0,0]) {\n Lock();\n }\n \/\/ pins\n translate([0,120,120])\n rotate([0,-90]) {\n translate([w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w,-(pin_length\/2)]) { Pin(); }\n translate([-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([w-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w-w,-(pin_length\/2)]) { Pin(); }\n }\n}\n\nmodule PairLock(w=tube_square_size) {\n DoubleLock();\n rotate(180)\n translate([-w,-depth-w*2,0])\n DoubleLock();\n \n}\n\nmodule QuadLock(w=tube_square_size) {\n PairLock();\n translate([0,depth+w*2,height])\n rotate([180,0,0])\n PairLock();\n}\n\nmodule flank(w=tube_square_size) {\n rotate([0,-90,0]) {\n linear_extrude(sheet_thickness)\n square([240, 80], center=true);\n translate([-w, w-w, (pin_length\/4)]) { Pin(); }\n translate([w, w-w, (pin_length\/4)]) { Pin(); }\n }\n}\n\n\nmodule horbar(w=tube_square_size, bh=bar_height) {\n translate([w+sheet_thickness, w\/2, bh]) {\n flank();\n rotate([0,90]) {\n linear_extrude(width-w-sheet_thickness*2)\n circle(16);\n }\n translate([width-w-sheet_thickness*2,0,0])\n rotate([0,180]) {\n flank();\n }\n }\n}\n\n\nFrame();\ntranslate([width,0,0])\n Frame();\n\nhorbar();","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f0668aa0cbe09fcbff874bbcde6f099dfc12e6f8","subject":"fixed position of mounting for manupulator","message":"fixed position of mounting for manupulator\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/menu_knob_manipulator.scad","new_file":"lcd_case_for_prusa_i3\/menu_knob_manipulator.scad","new_contents":"module menuKnobManipulator()\n{\n difference()\n {\n \/\/ part's body\n cylinder(r=30\/2, h=10, $fs=1);\n \/\/ hole for encoder's sticking-out part ;)\n translate([0,0,10-6])\n cylinder(r=(6+1)\/2, h=6, $fs=1);\n }\n \/\/ driver part 1\n translate([-(1-0.4)\/2, -1\/2+3, 10-6])\n cube([1-0.2, 1, 6]);\n \/\/ driver part 2\n translate([-(1-0.4)\/2, -1\/2-3, 10-6])\n cube([1-0.2, 1, 6]);\n}\n\nmenuKnobManipulator();","old_contents":"module menuKnobManipulator()\n{\n difference()\n {\n \/\/ part's body\n cylinder(r=30\/2, h=10, $fs=1);\n \/\/ hole for encoder's sticking-out part ;)\n translate([0,0,10-6])\n cylinder(r=(6+1)\/2, h=6, $fs=1);\n }\n \/\/ driver part 1\n translate([-(1-0.4)\/2, -1\/2+2.5, 10-6])\n cube([1-0.2, 1, 6]);\n \/\/ driver part 2\n translate([-(1-0.4)\/2, -1\/2-2.5, 10-6])\n cube([1-0.2, 1, 6]);\n}\n\nmenuKnobManipulator();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5d6ab26bd7b4e64bfe08ccbc8e395169ec2ea362","subject":"Resolve conflict.","message":"Resolve conflict.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9214adaa626ee4e2cbbb71bdfba5e3cdb7ac56c4","subject":"mount extra height param","message":"mount extra height param\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/mount.scad","new_file":"3d\/mount.scad","new_contents":"$fs = 0.25;\n$fa = 8;\n\nuse \nuse \n\n\/\/ horizontal sonar mounting holes\nmodule mount_holes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\n\/\/ sonar mount bracket\nmodule mount(extra = 7) {\n\n top_r = 3;\n bottom_r = 5;\n\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n\n \/\/ front plate\n translate ([1.5, -48\/2, -extra])\n #union() {\n cube(size=[3, 48, 19+extra], center=false);\n translate ([0, top_r, 0]) cube(size=[3, 48-2*top_r, 19+extra+top_r], center=false);\n translate ([0, 48-top_r, 19+extra]) rotate([90, 0, 90]) cylinder(r=top_r, h=3, center=false);\n translate ([0, top_r, 19+extra]) rotate([90, 0, 90]) cylinder(r=top_r, h=3, center=false);\n }\n\n \/\/ hc-sr04 cutouts\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar holes\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtals holes - bot upside and downwards\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n \/\/ center cleanup\n translate ([3, 0, 10]) cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #union() {\n translate ([-3.5, -48\/2, -extra]) cube(size=[10-bottom_r, 48, 5], center=false);\n translate ([-3.5-bottom_r, -48\/2+5, -extra]) cube(size=[10, 48-2*bottom_r, 5], center=false);\n translate ([-3.5, -48\/2+5, -extra]) cylinder(r=bottom_r, h=5, center=false);\n translate ([-3.5, 48\/2-5, -extra]) cylinder(r=bottom_r, h=5, center=false);\n }\n mount_holes();\n }\n }\n}\n\n\/\/ horizantaly mounted sonar\nmodule horizontal_sonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n mount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/\/ horizantaly mounted sonar - mockup\nmodule vertical_sonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount bracket outline\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) mount(); \/\/ std version\ntranslate ([0, 0, 4.5]) rotate([0, 90, 0]) mount(15); \/\/ tall\n","old_contents":"$fs = 0.25;\n$fa = 8;\n\nuse \nuse \n\n\/\/ horizontal sonar mounting holes\nmodule mount_holes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\n\/\/ sonar mount bracket\nmodule mount() {\n\n extra = 7;\n top_r = 3;\n bottom_r = 5;\n\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n\n \/\/ front plate\n translate ([1.5, -48\/2, -extra])\n #union() {\n cube(size=[3, 48, 19+extra], center=false);\n translate ([0, top_r, 0]) cube(size=[3, 48-2*top_r, 19+extra+top_r], center=false);\n translate ([0, 48-top_r, 19+extra]) rotate([90, 0, 90]) cylinder(r=top_r, h=3, center=false);\n translate ([0, top_r, 19+extra]) rotate([90, 0, 90]) cylinder(r=top_r, h=3, center=false);\n }\n\n \/\/ hc-sr04 cutouts\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar holes\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtals holes - bot upside and downwards\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n \/\/ center cleanup\n translate ([3, 0, 10]) cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #union() {\n translate ([-3.5, -48\/2, -extra]) cube(size=[10-bottom_r, 48, 5], center=false);\n translate ([-3.5-bottom_r, -48\/2+5, -extra]) cube(size=[10, 48-2*bottom_r, 5], center=false);\n translate ([-3.5, -48\/2+5, -extra]) cylinder(r=bottom_r, h=5, center=false);\n translate ([-3.5, 48\/2-5, -extra]) cylinder(r=bottom_r, h=5, center=false);\n }\n mount_holes();\n }\n }\n}\n\n\/\/ horizantaly mounted sonar\nmodule horizontal_sonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n mount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/\/ horizantaly mounted sonar - mockup\nmodule vertical_sonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount bracket outline\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\ntranslate ([0, 0, 4.5]) rotate([0, 90, 0]) mount();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ad227c186a02b8f812275c48f98673077dfac8d3","subject":"x\/carriage: Tweak extruder B mount screw hole embed (make thicker)","message":"x\/carriage: Tweak extruder B mount screw hole embed (make thicker)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"70d3023797aab4ebe4ed7c3613fbf23bf1029f01","subject":"stubs for case","message":"stubs for case\n","repos":"beckdac\/zynthian-build","old_file":"zynthian-case.scad","new_file":"zynthian-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\nmodule display() {\n \/\/ screen\n \/\/ board\n \/\/ screen mounts\n \/\/ corner tabs\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n \/\/ encoder base\n}\n\n\/\/ lid with screen and encoders\nmodule lid() {\n \/\/ face plate\n \/\/ screen cutout\n \/\/ encoder cutout\n \/\/ screw holes\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'zynthian-case.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f154688c8649fe27b557d1aaaafd873bee488010","subject":"Add meshBox shape","message":"Add meshBox shape\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/polyhedron.scad","new_file":"shape\/3D\/polyhedron.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polyhedron shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a box.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBox(size, l, w, h) =\n let(\n size = apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2])\n ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @returns Vector - Returns the size vector, as [a, b, w, h].\n *\/\nfunction sizeTrapeziumBox(size, a, b, w, h) =\n let(\n h = uor(h, isNumber(size) ? size : size[3]),\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n divisor(h)\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, h, n].\n *\/\nfunction sizeRegularPolygonBox(size, n, l, w, h, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector3D(2 * divisor(s) \/ (2 * sin(180 \/ n)))\n : apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStarBox(size, core, edges, l, w, h, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? vector2D(size) * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Creates a box at the origin.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule box(size, l, w, h, center) {\n size = sizeBox(size=size, l=l, w=w, h=h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n rectangle(size);\n }\n}\n\n\/**\n * Creates a trapezium box at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule trapeziumBox(size, a, b, w, h, center) {\n size = sizeTrapeziumBox(size=size, a=a, b=b, w=w, h=h);\n linear_extrude(height=size[3], center=center, convexity=10) {\n trapezium(size);\n }\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularPolygonBox(size, n, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=n, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n regularPolygon(size, size[3]);\n }\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule hexagonBox(size, pointy, adjust, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=6, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n hexagon(size=size, pointy=pointy, adjust=adjust);\n }\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width\n * @param Number [h] - The overall height..\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule starBox(size, core, edges, l, w, h, cl, cw, center) {\n size = sizeStarBox(size=size, core=core, edges=edges, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n star(size[0], size[1], size[2]);\n }\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule meshBox(size, count, gap, pointy, linear, even, l, w, h, cx, cy, gx, gy, center) {\n size = apply3D(size, l, w, h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n mesh(size=size, count=count, gap=gap, pointy=pointy, linear=linear, even=even, cx=cx, cy=cy, gx=gx, gy=gy);\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polyhedron shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a box.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBox(size, l, w, h) =\n let(\n size = apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2])\n ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @returns Vector - Returns the size vector, as [a, b, w, h].\n *\/\nfunction sizeTrapeziumBox(size, a, b, w, h) =\n let(\n h = uor(h, isNumber(size) ? size : size[3]),\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n divisor(h)\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, h, n].\n *\/\nfunction sizeRegularPolygonBox(size, n, l, w, h, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector3D(2 * divisor(s) \/ (2 * sin(180 \/ n)))\n : apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStarBox(size, core, edges, l, w, h, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? vector2D(size) * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Creates a box at the origin.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule box(size, l, w, h, center) {\n size = sizeBox(size=size, l=l, w=w, h=h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n rectangle(size);\n }\n}\n\n\/**\n * Creates a trapezium box at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule trapeziumBox(size, a, b, w, h, center) {\n size = sizeTrapeziumBox(size=size, a=a, b=b, w=w, h=h);\n linear_extrude(height=size[3], center=center, convexity=10) {\n trapezium(size);\n }\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularPolygonBox(size, n, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=n, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n regularPolygon(size, size[3]);\n }\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule hexagonBox(size, pointy, adjust, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=6, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n hexagon(size=size, pointy=pointy, adjust=adjust);\n }\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width\n * @param Number [h] - The overall height..\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule starBox(size, core, edges, l, w, h, cl, cw, center) {\n size = sizeStarBox(size=size, core=core, edges=edges, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n star(size[0], size[1], size[2]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6b708ef29be8058d0c0a5618f33a22a1d29371ba","subject":"OY size decreased","message":"OY size decreased\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"heater_support_finish\/heater_support_finish.scad","new_file":"heater_support_finish\/heater_support_finish.scad","new_contents":"spacing = 1.5;\nintX = 30 + 2*spacing;\nintY = 30 + 2*spacing;\n\nextX = 15 + intX + 15;\nextY = 15 + intY + 20;\n\nh = 15;\n\n\nmodule support()\n{\n polyhedron(\n points = [\n [0, 0, 0],\n [extX, 0, 0],\n [extX, extY, 0],\n [0, extY, 0],\n \n [15, 15, 0],\n [15+intX, 15, 0],\n [15+intX, 15+intY, 0],\n [15, 15+intY, 0],\n \n [15, 15, h],\n [15+intX, 15, h],\n [15+intX, 15+intY, h],\n [15, 15+intY, h]\n ],\n\n faces = [\n \/\/ base\n [0, 4, 7],\n [0, 7, 3],\n [4, 0, 1],\n [5, 4, 1],\n [5, 1, 6],\n [6, 1, 2],\n [6, 2, 7],\n [7, 2, 3],\n\n \/\/ side walls\n [8, 0, 3],\n [3, 11, 8],\n [3, 2, 11],\n [2, 10, 11],\n [2, 9, 10],\n [2, 1, 9],\n [1, 0, 8],\n [9, 1, 8],\n\n \/\/ internal walls\n [7, 4, 11],\n [4, 8, 11],\n [6, 7, 11],\n [10, 6, 11],\n [5, 6, 10],\n [9, 5, 10],\n [4, 5, 8],\n [8, 5, 9]\n ]\n );\n}\n\n\/\/ part 1\ndifference()\n{\n support();\n translate([0, extY-20, 0])\n cube([70, 20, 15]);\n}\n\n\n\/\/ part 2\ntranslate([0, 10, 0])\n difference()\n {\n support();\n translate([0, 0, 0])\n cube([70, extY-20, 15]);\n }\n","old_contents":"spacing = 1.5;\nintX = 30 + 2*spacing;\nintY = 32 + 2*spacing;\n\nextX = 15 + intX + 15;\nextY = 15 + intY + 20;\n\nh = 15;\n\n\nmodule support()\n{\n polyhedron(\n points = [\n [0, 0, 0],\n [extX, 0, 0],\n [extX, extY, 0],\n [0, extY, 0],\n \n [15, 15, 0],\n [15+intX, 15, 0],\n [15+intX, 15+intY, 0],\n [15, 15+intY, 0],\n \n [15, 15, h],\n [15+intX, 15, h],\n [15+intX, 15+intY, h],\n [15, 15+intY, h]\n ],\n\n faces = [\n \/\/ base\n [0, 4, 7],\n [0, 7, 3],\n [4, 0, 1],\n [5, 4, 1],\n [5, 1, 6],\n [6, 1, 2],\n [6, 2, 7],\n [7, 2, 3],\n\n \/\/ side walls\n [8, 0, 3],\n [3, 11, 8],\n [3, 2, 11],\n [2, 10, 11],\n [2, 9, 10],\n [2, 1, 9],\n [1, 0, 8],\n [9, 1, 8],\n\n \/\/ internal walls\n [7, 4, 11],\n [4, 8, 11],\n [6, 7, 11],\n [10, 6, 11],\n [5, 6, 10],\n [9, 5, 10],\n [4, 5, 8],\n [8, 5, 9]\n ]\n );\n}\n\n\/\/ part 1\ndifference()\n{\n support();\n translate([0, extY-20, 0])\n cube([70, 20, 15]);\n}\n\n\n\/\/ part 2\ntranslate([0, 10, 0])\n difference()\n {\n support();\n translate([0, 0, 0])\n cube([70, extY-20, 15]);\n }\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b7a80208063946086bc52c0fa32dd8237b378877","subject":"enclosure tweaks","message":"enclosure tweaks\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 2;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 6;\nsocket_int = 15.6;\nstart_socket_x = 6 + shift_x;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 31;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 13;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 3;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ gaika\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 2;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 6;\nsocket_int = 15.6;\nstart_socket_x = 6 + shift_x;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 31;\ndynamic_r = 10;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = shift_y + volume_center_y - volume_w\/2;\nvolume_h = 5;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ gaika\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + th + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b558790dae029f978d95fb1addd0a46a90486022","subject":"Create vinyl-cutter.scad","message":"Create vinyl-cutter.scad\n\nHolder for OLFA rotary cutter - to set it on a linear guide\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad","new_file":"3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad","new_contents":"\/\/ Frame to mount OFLA rotary cutter on a rail and weigh it down\n\/\/ History:\n\/\/ 2020 May 1: JMJ Created original design\n\/\/\nuse <..\/common\/extrusions.scad>\n$fn = 50;\nEPSILON = 0.01;\nLARGE = 100;\nMM = 25.4; \/\/ Inch to mm\nhole_dist = 3.5*MM;\nbase_w = 0.4*MM; \/\/ from hole to edge\nro = 0.5*MM;\nrod_dia = 4; \/\/ To let #10 threaded rod fit\n\n\n\/\/ Back plate\nmodule back_plate() {\n extra_below = 0.5*MM; \/\/ lower part is 1\"\n t = 0.5;\n r = rod_dia\/2;\n hole_y = base_w + extra_below;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=r, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n }\n}\n\n\/\/ Front plate\nmodule front_plate() {\n extra_below = 0.25*MM; \/\/ lower part is 1\"\n big_r = 1.25*MM; \/\/ Arc above\n t = 0.5;\n hole_y = base_w + extra_below;\n big_hole_dia = 1*MM;\n big_hole_h = 1.25*MM;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n translate([base_w + hole_dist\/2, hole_y, 0]) {\n difference() {\n cylinder(r=big_r, h = t);\n translate([-big_r, -2*big_r, -EPSILON])\n cube([2*big_r, 2*big_r, 2*t]);\n }\n }\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n bdd = big_hole_dia;\n translate([base_w + hole_dist\/2 -bdd\/2, hole_y - bdd\/2, -EPSILON])\n oblong(bdd, bdd, bdd\/2, 2*t);\n\n }\n}\n\n\n\/\/wb = 10;\n\/\/hb = 20;\n\/\/ro = 5;\n\n\/\/oblong(wb, hb, ro, t);\n\/\/back_plate();\n\/\/translate([0, 5*base_w, 0])\n front_plate();","old_contents":"","returncode":1,"stderr":"error: pathspec '3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"de075acfc8b6bae6cbc8d455e30ba2a4760e1dc9","subject":"lower diameter is now a parameter of the pot","message":"lower diameter is now a parameter of the pot\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"flowerpot_saucer\/flowerpot_saucer.scad","new_file":"flowerpot_saucer\/flowerpot_saucer.scad","new_contents":"$fs=1;\n$fa=0.5;\n\nmodule saucer(d)\n{\n difference()\n {\n cylinder(h=22, r1=d\/2, r2=(d+20)\/2);\n translate([0, 0, 2])\n cylinder(h=20, r1=(d-2)\/2, r2=(d-2+20)\/2);\n }\n difference()\n {\n for(rz=[0, 45, 90, 135])\n rotate([0, 0, rz])\n translate([-d\/2, -2\/2, 2])\n cube([d, 2, 2]);\n cylinder(r=(d-2*30)\/2, h=5);\n }\n}\n\nsaucer(d=102);\n","old_contents":"$fs=5;\n$fa=0.5;\n\nmodule saucer()\n{\n difference()\n {\n cylinder(h=22, r1=102\/2, r2=122\/2);\n translate([0, 0, 2])\n cylinder(h=20, r1=100\/2, r2=120\/2);\n }\n difference()\n {\n for(rz=[0, 45, 90, 135])\n rotate([0, 0, rz])\n translate([-102\/2, -2\/2, 2])\n cube([102, 2, 2]);\n cylinder(r=(102-2*30)\/2, h=5);\n }\n}\n\nsaucer();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a8f5ea23f8ce92775f0c82b2ba3543560c17ef40","subject":"widened brim for lower shoulder - arm joint","message":"widened brim for lower shoulder - arm joint\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 120;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \nrender()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/render()\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 8;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/ original\n \/\/ armWidth = bearingOD + bearingStep;\n \/\/ testing\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength) {\n rotate([180, 0, 0]) union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 120;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \nrender()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/render()\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength) {\n rotate([180, 0, 0]) union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"015a4bf5b04f582228c65ab0d37efa882dea07fd","subject":"[scad] increase ring tolerance","message":"[scad] increase ring tolerance\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","old_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.1;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5038b0345be7e503565785d7efca8ea589ed8e36","subject":"adjust","message":"adjust\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"IrigMa\/biggerSensorDistanceKeeper.scad","new_file":"IrigMa\/biggerSensorDistanceKeeper.scad","new_contents":"$fn=50;\n\ni=0.95;\n\nmodule holes(s=1) {\n for(j=[-1,1])translate([j*5,0])scale(s)circle(r=i*1.5);\n}\ndifference() {\n square([18,8],center=true);\n holes();\n}\n!difference() {\n hull()holes(s=2);\n holes();\n}\n","old_contents":"$fn=50;\n\ni=0.95;\n\nmodule holes(s=1) {\n for(j=[-1,1])translate([j*5,0])scale(s)circle(r=i*1.5);\n}\ndifference() {\n square([18,8],center=true);\n holes();\n}\n!difference() {\n hull()holes(s=1.6);\n holes();\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"67ae08893e52c8687b356dfdac30868c88b3e465","subject":"closes #21","message":"closes #21\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"9c250eadd566ffbfdf41bb9900f53383259730a7","subject":"Correct measures","message":"Correct measures\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\nusb_type_b_h = 11.5;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\nusb_type_a_h = 8;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_r = bolt_d\/2 + 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=fn, r=stoiki_r, h=top_box_z-th+eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=fn, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\nusb_type_a_h = 7;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_r = bolt_d\/2 + 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\n\/\/ TODO\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\n\/\/ TODO\ntop_bolt_h = 2;\ntop_bolt_r = gaika_w \/ 2 \/ cos(30) + 0.05;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=fn, r=stoiki_r, h=top_box_z-th+eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=fn, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2ff0a917c2d56ed403350ecd7435ffcf4b45ab9f","subject":"rack fix","message":"rack fix\n","repos":"rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru","old_file":"org\/lrn\/openscad\/rack.scad","new_file":"org\/lrn\/openscad\/rack.scad","new_contents":"height = 2400;\ndepth = 1400;\nwidth = 1300;\ntube_square_size = 80;\ntube_thickness = 3;\nsheet_thickness = 2;\npin_length = 25+sheet_thickness*2+80;\nbar_height = 2000;\n\nmodule SquareTube(h=height, w=tube_square_size, xyz=[0,0,0]) {\n TT = tube_thickness;\n color([0.5, 0.5, 0.5, 0.5])\n translate(xyz) {\n translate([w\/2, w\/2, 0]) {\n difference () {\n linear_extrude(height=h) \n square([w, w], center=true);\n translate([0, 0, -5])\n linear_extrude(height=h+6)\n square([w-TT, w-TT], center=true);\n }\n }\n }\n}\n\nmodule Frame(h=height, d=depth, w=tube_square_size) {\n SquareTube();\n SquareTube(xyz=[0,d+w,0]);\n rotate([-90]) {\n SquareTube(h=d, xyz=[0,-w,w]);\n SquareTube(h=d, xyz=[0,-h,w]);\n }\n QuadLock();\n}\n\nmodule Pin(len=pin_length) {\n color([0.8, 0.2, 0.1, 0.5])\n translate([0,0,-(len\/2-15)]) \n linear_extrude(height=pin_length)\n circle(d=16);\n}\n\nmodule Lock(sz=240, d=sheet_thickness) {\n color([0.5, 0.5, 0.2, 0.5])\n polyhedron(\n points=[ [0,0,0],[0,0,320],[0,320,0],\n [-d,0,0],[-d,0,320],[-d,320,0]\n ],\n faces=[[0,1,2],[3,4,5], [0,1,4,3], [1,2,5,4], [2,0,3,5]\n ]\n );\n}\n\nmodule DoubleLock(w=tube_square_size) {\n Lock();\n translate([tube_square_size+sheet_thickness,0,0]) {\n Lock();\n }\n \/\/ pins\n translate([0,120,120])\n rotate([0,-90]) {\n translate([w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w,-(pin_length\/2)]) { Pin(); }\n translate([-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([w-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w-w,-(pin_length\/2)]) { Pin(); }\n }\n}\n\nmodule PairLock(w=tube_square_size) {\n DoubleLock();\n rotate(180)\n translate([-w,-depth-w*2,0])\n DoubleLock();\n \n}\n\nmodule QuadLock(w=tube_square_size) {\n PairLock();\n translate([0,depth+w*2,height])\n rotate([180,0,0])\n PairLock();\n}\n\nmodule Flank(w=tube_square_size) {\n rotate([0,-90,0]) {\n linear_extrude(sheet_thickness)\n square([240, 80], center=true);\n translate([-w, w-w, (pin_length\/4)]) { Pin(); }\n translate([w, w-w, (pin_length\/4)]) { Pin(); }\n }\n}\n\n\nmodule Horbar(w=tube_square_size, bh=bar_height) {\n translate([w+sheet_thickness, w\/2, bh]) {\n Flank();\n rotate([0,90]) {\n linear_extrude(width-w-sheet_thickness*2)\n circle(16);\n }\n translate([width-w-sheet_thickness*2,0,0])\n rotate([0,180]) {\n Flank();\n }\n }\n}\n\nmodule Barbell () {\n translate([-350, 1450, 1000]) {\n rotate([0,90]) {\n linear_extrude(2020)\n circle(16);\n }\n }\n}\n\nmodule Stand() {\n translate([40, depth+78, 970]) {\n rotate([0,0,270]) {\n Flank();\n rotate([0,-90,0]) {\n translate([0, 0, (pin_length\/4)]) { \n color([0.2, 0.2, 0.1, 0.5])\n translate([0,0,-80]) \n linear_extrude(height=190)\n circle(d=28);\n color([0.2, 0.2, 0.1, 0.5])\n translate([-20, -20, -80-sheet_thickness]) { \n linear_extrude(sheet_thickness)\n square(40);\n }\n }\n }\n }\n }\n}\n\nmodule Table() {\n color([0.7, 0.8, 0.3, 0.5])\n translate([tube_square_size,tube_square_size,740])\n linear_extrude(sheet_thickness)\n square([width-tube_square_size, depth]);\n}\n\nmodule Leg(len, rot=[0,0,0], trs=[0,0,0]) {\n translate(trs)\n rotate(rot) \n linear_extrude(len)\n square([20, 20]);\n}\n\n\nmodule Leg1 (d=depth) {\n hh=400;\n Leg(hh, [0,0,0], [550,0,0]);\n Leg(hh, [0,0,0], [550,d,0]);\n Leg(d, [-90,0,0], [550,0,100]);\n Leg(d, [-90,0,0], [550,0,hh]);\n}\n\nmodule Leg2 (d=depth) {\n Leg1(d);\n translate([300,0,0])\n Leg1(d);\n hh=400;\n ww=300;\n dd=550;\n Leg(ww, [0,90,0], [dd,0,hh]);\n Leg(ww, [0,90,0], [dd,d,hh]);\n Leg(ww, [0,90,0], [dd,0,100]);\n Leg(ww, [0,90,0], [dd,d,100]);\n}\nLeg2(depth);\n\n\nFrame();\ntranslate([width,0,0])\n Frame();\nHorbar();\nBarbell();\nStand();\nTable();\n\n\n","old_contents":"height = 2400;\ndepth = 1400;\nwidth = 1300;\ntube_square_size = 80;\ntube_thickness = 3;\nsheet_thickness = 2;\npin_length = 25+sheet_thickness*2+80;\nbar_height = 2000;\n\nmodule SquareTube(h=height, w=tube_square_size, xyz=[0,0,0]) {\n TT = tube_thickness;\n color([0.5, 0.5, 0.5, 0.5])\n translate(xyz) {\n translate([w\/2, w\/2, 0]) {\n difference () {\n linear_extrude(height=h) \n square([w, w], center=true);\n translate([0, 0, -5])\n linear_extrude(height=h+6)\n square([w-TT, w-TT], center=true);\n }\n }\n }\n}\n\nmodule Frame(h=height, d=depth, w=tube_square_size) {\n SquareTube();\n SquareTube(xyz=[0,d+w,0]);\n rotate([-90]) {\n SquareTube(h=d, xyz=[0,-w,w]);\n SquareTube(h=d, xyz=[0,-h,w]);\n }\n QuadLock();\n}\n\nmodule Pin(len=pin_length) {\n color([0.8, 0.2, 0.1, 0.5])\n translate([0,0,-(len\/2-15)]) \n linear_extrude(height=pin_length)\n circle(d=16);\n}\n\nmodule Lock(sz=240, d=sheet_thickness) {\n color([0.5, 0.5, 0.2, 0.5])\n translate([0,120,120])\n rotate([0,-90]) {\n difference() {\n linear_extrude(d) \n square([sz, sz], center=true);\n translate([125,125,-10])\n rotate([0,0,45]) \n linear_extrude(d+20) \n square([sz, sz], center=true);\n \n }\n }\n}\n\nmodule DoubleLock(w=tube_square_size) {\n Lock();\n translate([tube_square_size+sheet_thickness,0,0]) {\n Lock();\n }\n \/\/ pins\n translate([0,120,120])\n rotate([0,-90]) {\n translate([w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w,-(pin_length\/2)]) { Pin(); }\n translate([-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([w-w,-w,-(pin_length\/2)]) { Pin(); }\n translate([-w,w-w,-(pin_length\/2)]) { Pin(); }\n }\n}\n\nmodule PairLock(w=tube_square_size) {\n DoubleLock();\n rotate(180)\n translate([-w,-depth-w*2,0])\n DoubleLock();\n \n}\n\nmodule QuadLock(w=tube_square_size) {\n PairLock();\n translate([0,depth+w*2,height])\n rotate([180,0,0])\n PairLock();\n}\n\nmodule Flank(w=tube_square_size) {\n rotate([0,-90,0]) {\n linear_extrude(sheet_thickness)\n square([240, 80], center=true);\n translate([-w, w-w, (pin_length\/4)]) { Pin(); }\n translate([w, w-w, (pin_length\/4)]) { Pin(); }\n }\n}\n\n\nmodule Horbar(w=tube_square_size, bh=bar_height) {\n translate([w+sheet_thickness, w\/2, bh]) {\n Flank();\n rotate([0,90]) {\n linear_extrude(width-w-sheet_thickness*2)\n circle(16);\n }\n translate([width-w-sheet_thickness*2,0,0])\n rotate([0,180]) {\n Flank();\n }\n }\n}\n\nmodule Barbell () {\n translate([-350, 1450, 1000]) {\n rotate([0,90]) {\n linear_extrude(2020)\n circle(16);\n }\n }\n}\n\nmodule Stand() {\n translate([40, depth+78, 970]) {\n rotate([0,0,270]) {\n Flank();\n rotate([0,-90,0]) {\n translate([0, 0, (pin_length\/4)]) { \n color([0.2, 0.2, 0.1, 0.5])\n translate([0,0,-80]) \n linear_extrude(height=190)\n circle(d=28);\n color([0.2, 0.2, 0.1, 0.5])\n translate([-20, -20, -80-sheet_thickness]) { \n linear_extrude(sheet_thickness)\n square(40);\n }\n }\n }\n }\n }\n}\n\nmodule Table() {\n color([0.7, 0.8, 0.3, 0.5])\n translate([tube_square_size,tube_square_size,740])\n linear_extrude(sheet_thickness)\n square([width-tube_square_size, depth]);\n}\n\nmodule Leg(len, rot=[0,0,0], trs=[0,0,0]) {\n translate(trs)\n rotate(rot) \n linear_extrude(len)\n square([20, 20]);\n}\n\n\nmodule Leg1 (d=depth) {\n hh=400;\n Leg(hh, [0,0,0], [550,0,0]);\n Leg(hh, [0,0,0], [550,d,0]);\n Leg(d, [-90,0,0], [550,0,100]);\n Leg(d, [-90,0,0], [550,0,hh]);\n}\n\nmodule Leg2 (d=depth) {\n Leg1(d);\n translate([300,0,0])\n Leg1(d);\n hh=400;\n ww=300;\n dd=550;\n Leg(ww, [0,90,0], [dd,0,hh]);\n Leg(ww, [0,90,0], [dd,d,hh]);\n Leg(ww, [0,90,0], [dd,0,100]);\n Leg(ww, [0,90,0], [dd,d,100]);\n}\n\nLeg2(depth);\n\n\nFrame();\ntranslate([width,0,0])\n Frame();\nHorbar();\nBarbell();\nStand();\nTable();\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6d332b9d70c8b4461601f5b67596aec05a10aa51","subject":"broke out 6 tooth gear into seperate file from gear library","message":"broke out 6 tooth gear into seperate file from gear library\n","repos":"wyolum\/Celeste,wyolum\/Celeste","old_file":"fabricate\/Parametric_Involute__Bevel_and_Spur_Gears\/parametric_involute_gear_v5.0.scad","new_file":"fabricate\/Parametric_Involute__Bevel_and_Spur_Gears\/parametric_involute_gear_v5.0.scad","new_contents":"\/\/ Parametric Involute Bevel and Spur Gears by GregFrost\n\/\/ It is licensed under the Creative Commons - GNU GPL license.\n\/\/ \u00a9 2010 by GregFrost\n\/\/ http:\/\/www.thingiverse.com\/thing:3575\n\n\/\/ Simple Test:\n\/*\/\/ orig\n gear (circular_pitch=700,\n\tgear_thickness = 12,\n\trim_thickness = 15,\n\thub_thickness = 17,\n\tcircles=8);\n*\/\n\n\/*\ntranslate([225 - 12, 0, 0])\ndifference(){\n cylinder(h=ACRYLIC_THICKNESS, r=12*inch);\n translate([0, 0, -.01])scale([1, 1, 1.1])gear (number_of_teeth=225,\n\tcircular_pitch=PITCH,\n\tgear_thickness = ACRYLIC_THICKNESS,\n\trim_thickness = ACRYLIC_THICKNESS,\n\thub_thickness = ACRYLIC_THICKNESS,\n\tbore_diameter=0. * mm,\n\tcircles=0);\n}\n*\/\n\n\/\/Complex Spur Gear Test:\n\/\/ test_gears ();\n\n\/\/ Meshing Double Helix:\n\/\/meshing_double_helix ();\n\n\/\/ Demonstrate the backlash option for Spur gears.\n\/\/ test_backlash ();\n\n\/\/ Demonstrate how to make meshing bevel gears.\n\/\/ bevel_gear_pair ();\n\npi=3.1415926535897932384626433832795;\n\n\/\/==================================================\n\/\/ Bevel Gears:\n\/\/ Two gears with the same cone distance, circular pitch (measured at the cone distance) \n\/\/ and pressure angle will mesh.\n\nmodule bevel_gear_pair (\n\tgear1_teeth = 41,\n\tgear2_teeth = 7,\n\taxis_angle = 90,\n\toutside_circular_pitch=1000)\n{\n\toutside_pitch_radius1 = gear1_teeth * outside_circular_pitch \/ 360;\n\toutside_pitch_radius2 = gear2_teeth * outside_circular_pitch \/ 360;\n\tpitch_apex1=outside_pitch_radius2 * sin (axis_angle) + \n\t\t(outside_pitch_radius2 * cos (axis_angle) + outside_pitch_radius1) \/ tan (axis_angle);\n\tcone_distance = sqrt (pow (pitch_apex1, 2) + pow (outside_pitch_radius1, 2));\n\tpitch_apex2 = sqrt (pow (cone_distance, 2) - pow (outside_pitch_radius2, 2));\n\techo (\"cone_distance\", cone_distance);\n\tpitch_angle1 = asin (outside_pitch_radius1 \/ cone_distance);\n\tpitch_angle2 = asin (outside_pitch_radius2 \/ cone_distance);\n\techo (\"pitch_angle1, pitch_angle2\", pitch_angle1, pitch_angle2);\n\techo (\"pitch_angle1 + pitch_angle2\", pitch_angle1 + pitch_angle2);\n\n\trotate([0,0,90])\n\ttranslate ([0,0,pitch_apex1+20])\n\t{\n\t\ttranslate([0,0,-pitch_apex1])\n\t\tbevel_gear (\n\t\t\tnumber_of_teeth=gear1_teeth,\n\t\t\tcone_distance=cone_distance,\n\t\t\tpressure_angle=30,\n\t\t\toutside_circular_pitch=outside_circular_pitch);\n\t\n\t\trotate([0,-(pitch_angle1+pitch_angle2),0])\n\t\ttranslate([0,0,-pitch_apex2])\n\t\tbevel_gear (\n\t\t\tnumber_of_teeth=gear2_teeth,\n\t\t\tcone_distance=cone_distance,\n\t\t\tpressure_angle=30,\n\t\t\toutside_circular_pitch=outside_circular_pitch);\n\t}\n}\n\n\/\/Bevel Gear Finishing Options:\nbevel_gear_flat = 0;\nbevel_gear_back_cone = 1;\n\nmodule bevel_gear (\n\tnumber_of_teeth=11,\n\tcone_distance=100,\n\tface_width=20,\n\toutside_circular_pitch=1000,\n\tpressure_angle=30,\n\tclearance = 0.2,\n\tbore_diameter=5,\n\tgear_thickness = 15,\n\tbacklash = 0,\n\tinvolute_facets=0,\n\tfinish = -1)\n{\n\techo (\"bevel_gear\",\n\t\t\"teeth\", number_of_teeth,\n\t\t\"cone distance\", cone_distance,\n\t\tface_width,\n\t\toutside_circular_pitch,\n\t\tpressure_angle,\n\t\tclearance,\n\t\tbore_diameter,\n\t\tinvolute_facets,\n\t\tfinish);\n\n\t\/\/ Pitch diameter: Diameter of pitch circle at the fat end of the gear.\n\toutside_pitch_diameter = number_of_teeth * outside_circular_pitch \/ 180;\n\toutside_pitch_radius = outside_pitch_diameter \/ 2;\n\n\t\/\/ The height of the pitch apex.\n\tpitch_apex = sqrt (pow (cone_distance, 2) - pow (outside_pitch_radius, 2));\n\tpitch_angle = asin (outside_pitch_radius\/cone_distance);\n\n\techo (\"Num Teeth:\", number_of_teeth, \" Pitch Angle:\", pitch_angle);\n\n\tfinish = (finish != -1) ? finish : (pitch_angle < 45) ? bevel_gear_flat : bevel_gear_back_cone;\n\n\tapex_to_apex=cone_distance \/ cos (pitch_angle);\n\tback_cone_radius = apex_to_apex * sin (pitch_angle);\n\n\t\/\/ Calculate and display the pitch angle. This is needed to determine the angle to mount two meshing cone gears.\n\n\t\/\/ Base Circle for forming the involute teeth shape.\n\tbase_radius = back_cone_radius * cos (pressure_angle);\t\n\n\t\/\/ Diametrial pitch: Number of teeth per unit length.\n\tpitch_diametrial = number_of_teeth \/ outside_pitch_diameter;\n\n\t\/\/ Addendum: Radial distance from pitch circle to outside circle.\n\taddendum = 1 \/ pitch_diametrial;\n\t\/\/ Outer Circle\n\touter_radius = back_cone_radius + addendum;\n\n\t\/\/ Dedendum: Radial distance from pitch circle to root diameter\n\tdedendum = addendum + clearance;\n\tdedendum_angle = atan (dedendum \/ cone_distance);\n\troot_angle = pitch_angle - dedendum_angle;\n\n\troot_cone_full_radius = tan (root_angle)*apex_to_apex;\n\tback_cone_full_radius=apex_to_apex \/ tan (pitch_angle);\n\n\tback_cone_end_radius = \n\t\toutside_pitch_radius - \n\t\tdedendum * cos (pitch_angle) - \n\t\tgear_thickness \/ tan (pitch_angle);\n\tback_cone_descent = dedendum * sin (pitch_angle) + gear_thickness;\n\n\t\/\/ Root diameter: Diameter of bottom of tooth spaces.\n\troot_radius = back_cone_radius - dedendum;\n\n\thalf_tooth_thickness = outside_pitch_radius * sin (360 \/ (4 * number_of_teeth)) - backlash \/ 4;\n\thalf_thick_angle = asin (half_tooth_thickness \/ back_cone_radius);\n\n\tface_cone_height = apex_to_apex-face_width \/ cos (pitch_angle);\n\tface_cone_full_radius = face_cone_height \/ tan (pitch_angle);\n\tface_cone_descent = dedendum * sin (pitch_angle);\n\tface_cone_end_radius = \n\t\toutside_pitch_radius -\n\t\tface_width \/ sin (pitch_angle) - \n\t\tface_cone_descent \/ tan (pitch_angle);\n\n\t\/\/ For the bevel_gear_flat finish option, calculate the height of a cube to select the portion of the gear that includes the full pitch face.\n\tbevel_gear_flat_height = pitch_apex - (cone_distance - face_width) * cos (pitch_angle);\n\n\/\/\ttranslate([0,0,-pitch_apex])\n\tdifference ()\n\t{\n\t\tintersection ()\n\t\t{\n\t\t\tunion()\n\t\t\t{\n\t\t\t\trotate (half_thick_angle)\n\t\t\t\ttranslate ([0,0,pitch_apex-apex_to_apex])\n\t\t\t\tcylinder ($fn=number_of_teeth*2, r1=root_cone_full_radius,r2=0,h=apex_to_apex);\n\t\t\t\tfor (i = [1:number_of_teeth])\n\/\/\t\t\t\tfor (i = [1:1])\n\t\t\t\t{\n\t\t\t\t\trotate ([0,0,i*360\/number_of_teeth])\n\t\t\t\t\t{\n\t\t\t\t\t\tinvolute_bevel_gear_tooth (\n\t\t\t\t\t\t\tback_cone_radius = back_cone_radius,\n\t\t\t\t\t\t\troot_radius = root_radius,\n\t\t\t\t\t\t\tbase_radius = base_radius,\n\t\t\t\t\t\t\touter_radius = outer_radius,\n\t\t\t\t\t\t\tpitch_apex = pitch_apex,\n\t\t\t\t\t\t\tcone_distance = cone_distance,\n\t\t\t\t\t\t\thalf_thick_angle = half_thick_angle,\n\t\t\t\t\t\t\tinvolute_facets = involute_facets);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (finish == bevel_gear_back_cone)\n\t\t\t{\n\t\t\t\ttranslate ([0,0,-back_cone_descent])\n\t\t\t\tcylinder (\n\t\t\t\t\t$fn=number_of_teeth*2, \n\t\t\t\t\tr1=back_cone_end_radius,\n\t\t\t\t\tr2=back_cone_full_radius*2,\n\t\t\t\t\th=apex_to_apex + back_cone_descent);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttranslate ([-1.5*outside_pitch_radius,-1.5*outside_pitch_radius,0])\n\t\t\t\tcube ([3*outside_pitch_radius,\n\t\t\t\t\t3*outside_pitch_radius,\n\t\t\t\t\tbevel_gear_flat_height]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (finish == bevel_gear_back_cone)\n\t\t{\n\t\t\ttranslate ([0,0,-face_cone_descent])\n\t\t\tcylinder (\n\t\t\t\tr1=face_cone_end_radius,\n\t\t\t\tr2=face_cone_full_radius * 2,\n\t\t\t\th=face_cone_height + face_cone_descent+pitch_apex);\n\t\t}\n\n\t\ttranslate ([0,0,pitch_apex - apex_to_apex])\n\t\tcylinder (r=bore_diameter\/2,h=apex_to_apex);\n\t}\t\n}\n\nmodule involute_bevel_gear_tooth (\n\tback_cone_radius,\n\troot_radius,\n\tbase_radius,\n\touter_radius,\n\tpitch_apex,\n\tcone_distance,\n\thalf_thick_angle,\n\tinvolute_facets)\n{\n\/\/\techo (\"involute_bevel_gear_tooth\",\n\/\/\t\tback_cone_radius,\n\/\/\t\troot_radius,\n\/\/\t\tbase_radius,\n\/\/\t\touter_radius,\n\/\/\t\tpitch_apex,\n\/\/\t\tcone_distance,\n\/\/\t\thalf_thick_angle);\n\n\tmin_radius = max (base_radius*2,root_radius*2);\n\n\tpitch_point = \n\t\tinvolute (\n\t\t\tbase_radius*2, \n\t\t\tinvolute_intersect_angle (base_radius*2, back_cone_radius*2));\n\tpitch_angle = atan2 (pitch_point[1], pitch_point[0]);\n\tcentre_angle = pitch_angle + half_thick_angle;\n\n\tstart_angle = involute_intersect_angle (base_radius*2, min_radius);\n\tstop_angle = involute_intersect_angle (base_radius*2, outer_radius*2);\n\n\tres=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn\/4;\n\n\ttranslate ([0,0,pitch_apex])\n\trotate ([0,-atan(back_cone_radius\/cone_distance),0])\n\ttranslate ([-back_cone_radius*2,0,-cone_distance*2])\n\tunion ()\n\t{\n\t\tfor (i=[1:res])\n\t\t{\n\t\t\tassign (\n\t\t\t\tpoint1=\n\t\t\t\t\tinvolute (base_radius*2,start_angle+(stop_angle - start_angle)*(i-1)\/res),\n\t\t\t\tpoint2=\n\t\t\t\t\tinvolute (base_radius*2,start_angle+(stop_angle - start_angle)*(i)\/res))\n\t\t\t{\n\t\t\t\tassign (\n\t\t\t\t\tside1_point1 = rotate_point (centre_angle, point1),\n\t\t\t\t\tside1_point2 = rotate_point (centre_angle, point2),\n\t\t\t\t\tside2_point1 = mirror_point (rotate_point (centre_angle, point1)),\n\t\t\t\t\tside2_point2 = mirror_point (rotate_point (centre_angle, point2)))\n\t\t\t\t{\n\t\t\t\t\tpolyhedron (\n\t\t\t\t\t\tpoints=[\n\t\t\t\t\t\t\t[back_cone_radius*2+0.1,0,cone_distance*2],\n\t\t\t\t\t\t\t[side1_point1[0],side1_point1[1],0],\n\t\t\t\t\t\t\t[side1_point2[0],side1_point2[1],0],\n\t\t\t\t\t\t\t[side2_point2[0],side2_point2[1],0],\n\t\t\t\t\t\t\t[side2_point1[0],side2_point1[1],0],\n\t\t\t\t\t\t\t[0.1,0,0]],\n\t\t\t\t\t\ttriangles=[[0,1,2],[0,2,3],[0,3,4],[0,5,1],[1,5,2],[2,5,3],[3,5,4],[0,4,5]]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule gear (\n\tnumber_of_teeth=15,\n\tcircular_pitch=false, diametral_pitch=false,\n\tpressure_angle=28,\n\tclearance = 0.2,\n\tgear_thickness=5,\n\trim_thickness=8,\n\trim_width=5,\n\thub_thickness=10,\n\thub_diameter=15,\n\tbore_diameter=5,\n\tcircles=0,\n\tbacklash=0,\n\ttwist=0,\n\tinvolute_facets=0)\n{\n\tif (circular_pitch==false && diametral_pitch==false) \n\t\techo(\"MCAD ERROR: gear module needs either a diametral_pitch or circular_pitch\");\n\n\t\/\/Convert diametrial pitch to our native circular pitch\n\tcircular_pitch = (circular_pitch!=false?circular_pitch:180\/diametral_pitch);\n\n\t\/\/ Pitch diameter: Diameter of pitch circle.\n\tpitch_diameter = number_of_teeth * circular_pitch \/ 180;\n\tpitch_radius = pitch_diameter\/2;\n\techo (\"Teeth:\", number_of_teeth, \" Pitch radius:\", pitch_radius);\n\n\t\/\/ Base Circle\n\tbase_radius = pitch_radius*cos(pressure_angle);\n\n\t\/\/ Diametrial pitch: Number of teeth per unit length.\n\tpitch_diametrial = number_of_teeth \/ pitch_diameter;\n\n\t\/\/ Addendum: Radial distance from pitch circle to outside circle.\n\taddendum = 1\/pitch_diametrial;\n\n\t\/\/Outer Circle\n\touter_radius = pitch_radius+addendum;\n\n\t\/\/ Dedendum: Radial distance from pitch circle to root diameter\n\tdedendum = addendum + clearance;\n\n\t\/\/ Root diameter: Diameter of bottom of tooth spaces.\n\troot_radius = pitch_radius-dedendum;\n\tbacklash_angle = backlash \/ pitch_radius * 180 \/ pi;\n\thalf_thick_angle = (360 \/ number_of_teeth - backlash_angle) \/ 4;\n\n\t\/\/ Variables controlling the rim.\n\trim_radius = root_radius - rim_width;\n\n\t\/\/ Variables controlling the circular holes in the gear.\n\tcircle_orbit_diameter=hub_diameter\/2+rim_radius;\n\tcircle_orbit_curcumference=pi*circle_orbit_diameter;\n\n\t\/\/ Limit the circle size to 90% of the gear face.\n\tcircle_diameter=\n\t\tmin (\n\t\t\t0.70*circle_orbit_curcumference\/circles,\n\t\t\t(rim_radius-hub_diameter\/2)*0.9);\n\n\tdifference ()\n\t{\n\t\tunion ()\n\t\t{\n\t\t\tdifference ()\n\t\t\t{\n\t\t\t\tlinear_extrude (height=rim_thickness, convexity=10, twist=twist)\n\t\t\t\tgear_shape (\n\t\t\t\t\tnumber_of_teeth,\n\t\t\t\t\tpitch_radius = pitch_radius,\n\t\t\t\t\troot_radius = root_radius,\n\t\t\t\t\tbase_radius = base_radius,\n\t\t\t\t\touter_radius = outer_radius,\n\t\t\t\t\thalf_thick_angle = half_thick_angle,\n\t\t\t\t\tinvolute_facets=involute_facets);\n\n\t\t\t\tif (gear_thickness < rim_thickness)\n\t\t\t\t\ttranslate ([0,0,gear_thickness])\n\t\t\t\t\tcylinder (r=rim_radius,h=rim_thickness-gear_thickness+1);\n\t\t\t}\n\t\t\tif (gear_thickness > rim_thickness)\n\t\t\t\tcylinder (r=rim_radius,h=gear_thickness);\n\t\t\tif (hub_thickness > gear_thickness)\n\t\t\t\ttranslate ([0,0,gear_thickness])\n\t\t\t\tcylinder (r=hub_diameter\/2,h=hub_thickness-gear_thickness);\n\t\t}\n\t\ttranslate ([0,0,-1])\n\t\tcylinder (\n\t\t\tr=bore_diameter\/2,\n\t\t\th=2+max(rim_thickness,hub_thickness,gear_thickness));\n\t\tif (circles>0)\n\t\t{\n\t\t\tfor(i=[0:circles-1])\t\n\t\t\t\trotate([0,0,i*360\/circles])\n\t\t\t\ttranslate([circle_orbit_diameter\/2,0,-1])\n\t\t\t\tcylinder(r=circle_diameter\/2,h=max(gear_thickness,rim_thickness)+3);\n\t\t}\n\t}\n}\n\nmodule gear_shape (\n\tnumber_of_teeth,\n\tpitch_radius,\n\troot_radius,\n\tbase_radius,\n\touter_radius,\n\thalf_thick_angle,\n\tinvolute_facets)\n{\n\tunion()\n\t{\n\t\trotate (half_thick_angle) circle ($fn=number_of_teeth*2, r=root_radius);\n\n\t\tfor (i = [1:number_of_teeth])\n\t\t{\n\t\t\trotate ([0,0,i*360\/number_of_teeth])\n\t\t\t{\n\t\t\t\tinvolute_gear_tooth (\n\t\t\t\t\tpitch_radius = pitch_radius,\n\t\t\t\t\troot_radius = root_radius,\n\t\t\t\t\tbase_radius = base_radius,\n\t\t\t\t\touter_radius = outer_radius,\n\t\t\t\t\thalf_thick_angle = half_thick_angle,\n\t\t\t\t\tinvolute_facets=involute_facets);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule involute_gear_tooth (\n\tpitch_radius,\n\troot_radius,\n\tbase_radius,\n\touter_radius,\n\thalf_thick_angle,\n\tinvolute_facets)\n{\n\tmin_radius = max (base_radius,root_radius);\n\n\tpitch_point = involute (base_radius, involute_intersect_angle (base_radius, pitch_radius));\n\tpitch_angle = atan2 (pitch_point[1], pitch_point[0]);\n\tcentre_angle = pitch_angle + half_thick_angle;\n\n\tstart_angle = involute_intersect_angle (base_radius, min_radius);\n\tstop_angle = involute_intersect_angle (base_radius, outer_radius);\n\n\tres=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn\/4;\n\n\tunion ()\n\t{\n\t\tfor (i=[1:res])\n\t\tassign (\n\t\t\tpoint1=involute (base_radius,start_angle+(stop_angle - start_angle)*(i-1)\/res),\n\t\t\tpoint2=involute (base_radius,start_angle+(stop_angle - start_angle)*i\/res))\n\t\t{\n\t\t\tassign (\n\t\t\t\tside1_point1=rotate_point (centre_angle, point1),\n\t\t\t\tside1_point2=rotate_point (centre_angle, point2),\n\t\t\t\tside2_point1=mirror_point (rotate_point (centre_angle, point1)),\n\t\t\t\tside2_point2=mirror_point (rotate_point (centre_angle, point2)))\n\t\t\t{\n\t\t\t\tpolygon (\n\t\t\t\t\tpoints=[[0,0],side1_point1,side1_point2,side2_point2,side2_point1],\n\t\t\t\t\tpaths=[[0,1,2,3,4,0]]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n\/\/ Mathematical Functions\n\/\/===============\n\n\/\/ Finds the angle of the involute about the base radius at the given distance (radius) from it's center.\n\/\/source: http:\/\/www.mathhelpforum.com\/math-help\/geometry\/136011-circle-involute-solving-y-any-given-x.html\n\nfunction involute_intersect_angle (base_radius, radius) = sqrt (pow (radius\/base_radius, 2) - 1) * 180 \/ pi;\n\n\/\/ Calculate the involute position for a given base radius and involute angle.\n\nfunction rotated_involute (rotate, base_radius, involute_angle) = \n[\n\tcos (rotate) * involute (base_radius, involute_angle)[0] + sin (rotate) * involute (base_radius, involute_angle)[1],\n\tcos (rotate) * involute (base_radius, involute_angle)[1] - sin (rotate) * involute (base_radius, involute_angle)[0]\n];\n\nfunction mirror_point (coord) = \n[\n\tcoord[0], \n\t-coord[1]\n];\n\nfunction rotate_point (rotate, coord) =\n[\n\tcos (rotate) * coord[0] + sin (rotate) * coord[1],\n\tcos (rotate) * coord[1] - sin (rotate) * coord[0]\n];\n\nfunction involute (base_radius, involute_angle) = \n[\n\tbase_radius*(cos (involute_angle) + involute_angle*pi\/180*sin (involute_angle)),\n\tbase_radius*(sin (involute_angle) - involute_angle*pi\/180*cos (involute_angle)),\n];\n\n\n\/\/ Test Cases\n\/\/===============\n\nmodule test_gears()\n{\n\ttranslate([17,-15])\n\t{\n\t\tgear (number_of_teeth=17,\n\t\t\tcircular_pitch=500,\n\t\t\tcircles=8);\n\t\n\t\trotate ([0,0,360*4\/17])\n\t\ttranslate ([39.088888,0,0])\n\t\t{\n\t\t\tgear (number_of_teeth=11,\n\t\t\t\tcircular_pitch=500,\n\t\t\t\thub_diameter=0,\n\t\t\t\trim_width=65);\n\t\t\ttranslate ([0,0,8])\n\t\t\t{\n\t\t\t\tgear (number_of_teeth=6,\n\t\t\t\t\tcircular_pitch=300,\n\t\t\t\t\thub_diameter=0,\n\t\t\t\t\trim_width=5,\n\t\t\t\t\trim_thickness=6,\n\t\t\t\t\tpressure_angle=31);\n\t\t\t\trotate ([0,0,360*5\/6])\n\t\t\t\ttranslate ([22.5,0,1])\n\t\t\t\tgear (number_of_teeth=21,\n\t\t\t\t\tcircular_pitch=300,\n\t\t\t\t\tbore_diameter=2,\n\t\t\t\t\thub_diameter=4,\n\t\t\t\t\trim_width=1,\n\t\t\t\t\thub_thickness=4,\n\t\t\t\t\trim_thickness=4,\n\t\t\t\t\tgear_thickness=3,\n\t\t\t\t\tpressure_angle=31);\n\t\t\t}\n\t\t}\n\n\t\ttranslate ([-61.1111111,0,0])\n\t\t{\n\t\t\tgear (number_of_teeth=27,\n\t\t\t\tcircular_pitch=500,\n\t\t\t\tcircles=5,\n\t\t\t\thub_diameter=2*8.88888889);\n\n\t\t\ttranslate ([0,0,10])\n\t\t\t{\n\t\t\t\tgear (\n\t\t\t\t\tnumber_of_teeth=14,\n\t\t\t\t\tcircular_pitch=200,\n\t\t\t\t\tpressure_angle=5,\n\t\t\t\t\tclearance = 0.2,\n\t\t\t\t\tgear_thickness = 10,\n\t\t\t\t\trim_thickness = 10,\n\t\t\t\t\trim_width = 15,\n\t\t\t\t\tbore_diameter=5,\n\t\t\t\t\tcircles=0);\n\t\t\t\ttranslate ([13.8888888,0,1])\n\t\t\t\tgear (\n\t\t\t\t\tnumber_of_teeth=11,\n\t\t\t\t\tcircular_pitch=200,\n\t\t\t\t\tpressure_angle=5,\n\t\t\t\t\tclearance = 0.2,\n\t\t\t\t\tgear_thickness = 10,\n\t\t\t\t\trim_thickness = 10,\n\t\t\t\t\trim_width = 15,\n\t\t\t\t\thub_thickness = 20,\n\t\t\t\t\thub_diameter=2*7.222222,\n\t\t\t\t\tbore_diameter=5,\n\t\t\t\t\tcircles=0);\n\t\t\t}\n\t\t}\n\t\n\t\trotate ([0,0,360*-5\/17])\n\t\ttranslate ([44.444444444,0,0])\n\t\tgear (number_of_teeth=15,\n\t\t\tcircular_pitch=500,\n\t\t\thub_diameter=10,\n\t\t\trim_width=5,\n\t\t\trim_thickness=5,\n\t\t\tgear_thickness=4,\n\t\t\thub_thickness=6,\n\t\t\tcircles=9);\n\t\n\t\trotate ([0,0,360*-1\/17])\n\t\ttranslate ([30.5555555,0,-1])\n\t\tgear (number_of_teeth=5,\n\t\t\tcircular_pitch=500,\n\t\t\thub_diameter=0,\n\t\t\trim_width=5,\n\t\t\trim_thickness=10);\n\t}\n}\n\nmodule meshing_double_helix ()\n{\n\ttest_double_helix_gear ();\n\t\n\tmirror ([0,1,0])\n\ttranslate ([58.33333333,0,0])\n\ttest_double_helix_gear (teeth=13,circles=6);\n}\n\nmodule test_double_helix_gear (\n\tteeth=17,\n\tcircles=8)\n{\n\t\/\/double helical gear\n\t{\n\t\ttwist=200;\n\t\theight=20;\n\t\tpressure_angle=30;\n\n\t\tgear (number_of_teeth=teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tpressure_angle=pressure_angle,\n\t\t\tclearance = 0.2,\n\t\t\tgear_thickness = height\/2*0.5,\n\t\t\trim_thickness = height\/2,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = height\/2*1.2,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tcircles=circles,\n\t\t\ttwist=twist\/teeth);\n\t\tmirror([0,0,1])\n\t\tgear (number_of_teeth=teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tpressure_angle=pressure_angle,\n\t\t\tclearance = 0.2,\n\t\t\tgear_thickness = height\/2,\n\t\t\trim_thickness = height\/2,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = height\/2,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tcircles=circles,\n\t\t\ttwist=twist\/teeth);\n\t}\n}\n\nmodule test_backlash ()\n{\n\tbacklash = 2;\n\tteeth = 15;\n\n\ttranslate ([-29.166666,0,0])\n\t{\n\t\ttranslate ([58.3333333,0,0])\n\t\trotate ([0,0,-360\/teeth\/4])\n\t\tgear (\n\t\t\tnumber_of_teeth = teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tgear_thickness = 12,\n\t\t\trim_thickness = 15,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = 17,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tbacklash = 2,\n\t\t\tcircles=8);\n\t\t\n\t\trotate ([0,0,360\/teeth\/4])\n\t\tgear (\n\t\t\tnumber_of_teeth = teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tgear_thickness = 12,\n\t\t\trim_thickness = 15,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = 17,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tbacklash = 2,\n\t\t\tcircles=8);\n\t}\n\n\tcolor([0,0,128,0.5])\n\ttranslate([0,0,-5])\n\tcylinder ($fn=20,r=backlash \/ 4,h=25);\n}\n\n","old_contents":"\/\/ Parametric Involute Bevel and Spur Gears by GregFrost\n\/\/ It is licensed under the Creative Commons - GNU GPL license.\n\/\/ \u00a9 2010 by GregFrost\n\/\/ http:\/\/www.thingiverse.com\/thing:3575\n\n$fn=100;\nmm = 1;\ninch = 25.4 * mm;\n\n\/\/ Simple Test:\n\/*\/\/ orig\n gear (circular_pitch=700,\n\tgear_thickness = 12,\n\trim_thickness = 15,\n\thub_thickness = 17,\n\tcircles=8);\n*\/\n\nACRYLIC_THICKNESS = 6 * mm;\nACRYLIC_TOL = .5 * mm;\nPITCH = 400. * 12 \/ 13.333333;\ndifference(){\n union(){\n gear (number_of_teeth=6,\n\t circular_pitch = PITCH,\n\t gear_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL,\n\t rim_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL,\n\t hub_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL,\n\t bore_diameter=0. * mm,\n\t circles=4,\n\t pressure_angle=28\n\t );\n translate([0, 0, -1*mm])cylinder(r=10.5 * mm, h=1*mm);\n translate([0, 0, 6.5*mm])cylinder(r=8.5 * mm, h=1*mm);\n }\n translate([0, 0, -1])cylinder(r=3mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2);\n}\n\n\/*\ntranslate([225 - 12, 0, 0])\ndifference(){\n cylinder(h=ACRYLIC_THICKNESS, r=12*inch);\n translate([0, 0, -.01])scale([1, 1, 1.1])gear (number_of_teeth=225,\n\tcircular_pitch=PITCH,\n\tgear_thickness = ACRYLIC_THICKNESS,\n\trim_thickness = ACRYLIC_THICKNESS,\n\thub_thickness = ACRYLIC_THICKNESS,\n\tbore_diameter=0. * mm,\n\tcircles=0);\n}\n*\/\n\n\/\/Complex Spur Gear Test:\n\/\/ test_gears ();\n\n\/\/ Meshing Double Helix:\n\/\/meshing_double_helix ();\n\n\/\/ Demonstrate the backlash option for Spur gears.\n\/\/ test_backlash ();\n\n\/\/ Demonstrate how to make meshing bevel gears.\n\/\/ bevel_gear_pair ();\n\npi=3.1415926535897932384626433832795;\n\n\/\/==================================================\n\/\/ Bevel Gears:\n\/\/ Two gears with the same cone distance, circular pitch (measured at the cone distance) \n\/\/ and pressure angle will mesh.\n\nmodule bevel_gear_pair (\n\tgear1_teeth = 41,\n\tgear2_teeth = 7,\n\taxis_angle = 90,\n\toutside_circular_pitch=1000)\n{\n\toutside_pitch_radius1 = gear1_teeth * outside_circular_pitch \/ 360;\n\toutside_pitch_radius2 = gear2_teeth * outside_circular_pitch \/ 360;\n\tpitch_apex1=outside_pitch_radius2 * sin (axis_angle) + \n\t\t(outside_pitch_radius2 * cos (axis_angle) + outside_pitch_radius1) \/ tan (axis_angle);\n\tcone_distance = sqrt (pow (pitch_apex1, 2) + pow (outside_pitch_radius1, 2));\n\tpitch_apex2 = sqrt (pow (cone_distance, 2) - pow (outside_pitch_radius2, 2));\n\techo (\"cone_distance\", cone_distance);\n\tpitch_angle1 = asin (outside_pitch_radius1 \/ cone_distance);\n\tpitch_angle2 = asin (outside_pitch_radius2 \/ cone_distance);\n\techo (\"pitch_angle1, pitch_angle2\", pitch_angle1, pitch_angle2);\n\techo (\"pitch_angle1 + pitch_angle2\", pitch_angle1 + pitch_angle2);\n\n\trotate([0,0,90])\n\ttranslate ([0,0,pitch_apex1+20])\n\t{\n\t\ttranslate([0,0,-pitch_apex1])\n\t\tbevel_gear (\n\t\t\tnumber_of_teeth=gear1_teeth,\n\t\t\tcone_distance=cone_distance,\n\t\t\tpressure_angle=30,\n\t\t\toutside_circular_pitch=outside_circular_pitch);\n\t\n\t\trotate([0,-(pitch_angle1+pitch_angle2),0])\n\t\ttranslate([0,0,-pitch_apex2])\n\t\tbevel_gear (\n\t\t\tnumber_of_teeth=gear2_teeth,\n\t\t\tcone_distance=cone_distance,\n\t\t\tpressure_angle=30,\n\t\t\toutside_circular_pitch=outside_circular_pitch);\n\t}\n}\n\n\/\/Bevel Gear Finishing Options:\nbevel_gear_flat = 0;\nbevel_gear_back_cone = 1;\n\nmodule bevel_gear (\n\tnumber_of_teeth=11,\n\tcone_distance=100,\n\tface_width=20,\n\toutside_circular_pitch=1000,\n\tpressure_angle=30,\n\tclearance = 0.2,\n\tbore_diameter=5,\n\tgear_thickness = 15,\n\tbacklash = 0,\n\tinvolute_facets=0,\n\tfinish = -1)\n{\n\techo (\"bevel_gear\",\n\t\t\"teeth\", number_of_teeth,\n\t\t\"cone distance\", cone_distance,\n\t\tface_width,\n\t\toutside_circular_pitch,\n\t\tpressure_angle,\n\t\tclearance,\n\t\tbore_diameter,\n\t\tinvolute_facets,\n\t\tfinish);\n\n\t\/\/ Pitch diameter: Diameter of pitch circle at the fat end of the gear.\n\toutside_pitch_diameter = number_of_teeth * outside_circular_pitch \/ 180;\n\toutside_pitch_radius = outside_pitch_diameter \/ 2;\n\n\t\/\/ The height of the pitch apex.\n\tpitch_apex = sqrt (pow (cone_distance, 2) - pow (outside_pitch_radius, 2));\n\tpitch_angle = asin (outside_pitch_radius\/cone_distance);\n\n\techo (\"Num Teeth:\", number_of_teeth, \" Pitch Angle:\", pitch_angle);\n\n\tfinish = (finish != -1) ? finish : (pitch_angle < 45) ? bevel_gear_flat : bevel_gear_back_cone;\n\n\tapex_to_apex=cone_distance \/ cos (pitch_angle);\n\tback_cone_radius = apex_to_apex * sin (pitch_angle);\n\n\t\/\/ Calculate and display the pitch angle. This is needed to determine the angle to mount two meshing cone gears.\n\n\t\/\/ Base Circle for forming the involute teeth shape.\n\tbase_radius = back_cone_radius * cos (pressure_angle);\t\n\n\t\/\/ Diametrial pitch: Number of teeth per unit length.\n\tpitch_diametrial = number_of_teeth \/ outside_pitch_diameter;\n\n\t\/\/ Addendum: Radial distance from pitch circle to outside circle.\n\taddendum = 1 \/ pitch_diametrial;\n\t\/\/ Outer Circle\n\touter_radius = back_cone_radius + addendum;\n\n\t\/\/ Dedendum: Radial distance from pitch circle to root diameter\n\tdedendum = addendum + clearance;\n\tdedendum_angle = atan (dedendum \/ cone_distance);\n\troot_angle = pitch_angle - dedendum_angle;\n\n\troot_cone_full_radius = tan (root_angle)*apex_to_apex;\n\tback_cone_full_radius=apex_to_apex \/ tan (pitch_angle);\n\n\tback_cone_end_radius = \n\t\toutside_pitch_radius - \n\t\tdedendum * cos (pitch_angle) - \n\t\tgear_thickness \/ tan (pitch_angle);\n\tback_cone_descent = dedendum * sin (pitch_angle) + gear_thickness;\n\n\t\/\/ Root diameter: Diameter of bottom of tooth spaces.\n\troot_radius = back_cone_radius - dedendum;\n\n\thalf_tooth_thickness = outside_pitch_radius * sin (360 \/ (4 * number_of_teeth)) - backlash \/ 4;\n\thalf_thick_angle = asin (half_tooth_thickness \/ back_cone_radius);\n\n\tface_cone_height = apex_to_apex-face_width \/ cos (pitch_angle);\n\tface_cone_full_radius = face_cone_height \/ tan (pitch_angle);\n\tface_cone_descent = dedendum * sin (pitch_angle);\n\tface_cone_end_radius = \n\t\toutside_pitch_radius -\n\t\tface_width \/ sin (pitch_angle) - \n\t\tface_cone_descent \/ tan (pitch_angle);\n\n\t\/\/ For the bevel_gear_flat finish option, calculate the height of a cube to select the portion of the gear that includes the full pitch face.\n\tbevel_gear_flat_height = pitch_apex - (cone_distance - face_width) * cos (pitch_angle);\n\n\/\/\ttranslate([0,0,-pitch_apex])\n\tdifference ()\n\t{\n\t\tintersection ()\n\t\t{\n\t\t\tunion()\n\t\t\t{\n\t\t\t\trotate (half_thick_angle)\n\t\t\t\ttranslate ([0,0,pitch_apex-apex_to_apex])\n\t\t\t\tcylinder ($fn=number_of_teeth*2, r1=root_cone_full_radius,r2=0,h=apex_to_apex);\n\t\t\t\tfor (i = [1:number_of_teeth])\n\/\/\t\t\t\tfor (i = [1:1])\n\t\t\t\t{\n\t\t\t\t\trotate ([0,0,i*360\/number_of_teeth])\n\t\t\t\t\t{\n\t\t\t\t\t\tinvolute_bevel_gear_tooth (\n\t\t\t\t\t\t\tback_cone_radius = back_cone_radius,\n\t\t\t\t\t\t\troot_radius = root_radius,\n\t\t\t\t\t\t\tbase_radius = base_radius,\n\t\t\t\t\t\t\touter_radius = outer_radius,\n\t\t\t\t\t\t\tpitch_apex = pitch_apex,\n\t\t\t\t\t\t\tcone_distance = cone_distance,\n\t\t\t\t\t\t\thalf_thick_angle = half_thick_angle,\n\t\t\t\t\t\t\tinvolute_facets = involute_facets);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (finish == bevel_gear_back_cone)\n\t\t\t{\n\t\t\t\ttranslate ([0,0,-back_cone_descent])\n\t\t\t\tcylinder (\n\t\t\t\t\t$fn=number_of_teeth*2, \n\t\t\t\t\tr1=back_cone_end_radius,\n\t\t\t\t\tr2=back_cone_full_radius*2,\n\t\t\t\t\th=apex_to_apex + back_cone_descent);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttranslate ([-1.5*outside_pitch_radius,-1.5*outside_pitch_radius,0])\n\t\t\t\tcube ([3*outside_pitch_radius,\n\t\t\t\t\t3*outside_pitch_radius,\n\t\t\t\t\tbevel_gear_flat_height]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (finish == bevel_gear_back_cone)\n\t\t{\n\t\t\ttranslate ([0,0,-face_cone_descent])\n\t\t\tcylinder (\n\t\t\t\tr1=face_cone_end_radius,\n\t\t\t\tr2=face_cone_full_radius * 2,\n\t\t\t\th=face_cone_height + face_cone_descent+pitch_apex);\n\t\t}\n\n\t\ttranslate ([0,0,pitch_apex - apex_to_apex])\n\t\tcylinder (r=bore_diameter\/2,h=apex_to_apex);\n\t}\t\n}\n\nmodule involute_bevel_gear_tooth (\n\tback_cone_radius,\n\troot_radius,\n\tbase_radius,\n\touter_radius,\n\tpitch_apex,\n\tcone_distance,\n\thalf_thick_angle,\n\tinvolute_facets)\n{\n\/\/\techo (\"involute_bevel_gear_tooth\",\n\/\/\t\tback_cone_radius,\n\/\/\t\troot_radius,\n\/\/\t\tbase_radius,\n\/\/\t\touter_radius,\n\/\/\t\tpitch_apex,\n\/\/\t\tcone_distance,\n\/\/\t\thalf_thick_angle);\n\n\tmin_radius = max (base_radius*2,root_radius*2);\n\n\tpitch_point = \n\t\tinvolute (\n\t\t\tbase_radius*2, \n\t\t\tinvolute_intersect_angle (base_radius*2, back_cone_radius*2));\n\tpitch_angle = atan2 (pitch_point[1], pitch_point[0]);\n\tcentre_angle = pitch_angle + half_thick_angle;\n\n\tstart_angle = involute_intersect_angle (base_radius*2, min_radius);\n\tstop_angle = involute_intersect_angle (base_radius*2, outer_radius*2);\n\n\tres=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn\/4;\n\n\ttranslate ([0,0,pitch_apex])\n\trotate ([0,-atan(back_cone_radius\/cone_distance),0])\n\ttranslate ([-back_cone_radius*2,0,-cone_distance*2])\n\tunion ()\n\t{\n\t\tfor (i=[1:res])\n\t\t{\n\t\t\tassign (\n\t\t\t\tpoint1=\n\t\t\t\t\tinvolute (base_radius*2,start_angle+(stop_angle - start_angle)*(i-1)\/res),\n\t\t\t\tpoint2=\n\t\t\t\t\tinvolute (base_radius*2,start_angle+(stop_angle - start_angle)*(i)\/res))\n\t\t\t{\n\t\t\t\tassign (\n\t\t\t\t\tside1_point1 = rotate_point (centre_angle, point1),\n\t\t\t\t\tside1_point2 = rotate_point (centre_angle, point2),\n\t\t\t\t\tside2_point1 = mirror_point (rotate_point (centre_angle, point1)),\n\t\t\t\t\tside2_point2 = mirror_point (rotate_point (centre_angle, point2)))\n\t\t\t\t{\n\t\t\t\t\tpolyhedron (\n\t\t\t\t\t\tpoints=[\n\t\t\t\t\t\t\t[back_cone_radius*2+0.1,0,cone_distance*2],\n\t\t\t\t\t\t\t[side1_point1[0],side1_point1[1],0],\n\t\t\t\t\t\t\t[side1_point2[0],side1_point2[1],0],\n\t\t\t\t\t\t\t[side2_point2[0],side2_point2[1],0],\n\t\t\t\t\t\t\t[side2_point1[0],side2_point1[1],0],\n\t\t\t\t\t\t\t[0.1,0,0]],\n\t\t\t\t\t\ttriangles=[[0,1,2],[0,2,3],[0,3,4],[0,5,1],[1,5,2],[2,5,3],[3,5,4],[0,4,5]]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule gear (\n\tnumber_of_teeth=15,\n\tcircular_pitch=false, diametral_pitch=false,\n\tpressure_angle=28,\n\tclearance = 0.2,\n\tgear_thickness=5,\n\trim_thickness=8,\n\trim_width=5,\n\thub_thickness=10,\n\thub_diameter=15,\n\tbore_diameter=5,\n\tcircles=0,\n\tbacklash=0,\n\ttwist=0,\n\tinvolute_facets=0)\n{\n\tif (circular_pitch==false && diametral_pitch==false) \n\t\techo(\"MCAD ERROR: gear module needs either a diametral_pitch or circular_pitch\");\n\n\t\/\/Convert diametrial pitch to our native circular pitch\n\tcircular_pitch = (circular_pitch!=false?circular_pitch:180\/diametral_pitch);\n\n\t\/\/ Pitch diameter: Diameter of pitch circle.\n\tpitch_diameter = number_of_teeth * circular_pitch \/ 180;\n\tpitch_radius = pitch_diameter\/2;\n\techo (\"Teeth:\", number_of_teeth, \" Pitch radius:\", pitch_radius);\n\n\t\/\/ Base Circle\n\tbase_radius = pitch_radius*cos(pressure_angle);\n\n\t\/\/ Diametrial pitch: Number of teeth per unit length.\n\tpitch_diametrial = number_of_teeth \/ pitch_diameter;\n\n\t\/\/ Addendum: Radial distance from pitch circle to outside circle.\n\taddendum = 1\/pitch_diametrial;\n\n\t\/\/Outer Circle\n\touter_radius = pitch_radius+addendum;\n\n\t\/\/ Dedendum: Radial distance from pitch circle to root diameter\n\tdedendum = addendum + clearance;\n\n\t\/\/ Root diameter: Diameter of bottom of tooth spaces.\n\troot_radius = pitch_radius-dedendum;\n\tbacklash_angle = backlash \/ pitch_radius * 180 \/ pi;\n\thalf_thick_angle = (360 \/ number_of_teeth - backlash_angle) \/ 4;\n\n\t\/\/ Variables controlling the rim.\n\trim_radius = root_radius - rim_width;\n\n\t\/\/ Variables controlling the circular holes in the gear.\n\tcircle_orbit_diameter=hub_diameter\/2+rim_radius;\n\tcircle_orbit_curcumference=pi*circle_orbit_diameter;\n\n\t\/\/ Limit the circle size to 90% of the gear face.\n\tcircle_diameter=\n\t\tmin (\n\t\t\t0.70*circle_orbit_curcumference\/circles,\n\t\t\t(rim_radius-hub_diameter\/2)*0.9);\n\n\tdifference ()\n\t{\n\t\tunion ()\n\t\t{\n\t\t\tdifference ()\n\t\t\t{\n\t\t\t\tlinear_extrude (height=rim_thickness, convexity=10, twist=twist)\n\t\t\t\tgear_shape (\n\t\t\t\t\tnumber_of_teeth,\n\t\t\t\t\tpitch_radius = pitch_radius,\n\t\t\t\t\troot_radius = root_radius,\n\t\t\t\t\tbase_radius = base_radius,\n\t\t\t\t\touter_radius = outer_radius,\n\t\t\t\t\thalf_thick_angle = half_thick_angle,\n\t\t\t\t\tinvolute_facets=involute_facets);\n\n\t\t\t\tif (gear_thickness < rim_thickness)\n\t\t\t\t\ttranslate ([0,0,gear_thickness])\n\t\t\t\t\tcylinder (r=rim_radius,h=rim_thickness-gear_thickness+1);\n\t\t\t}\n\t\t\tif (gear_thickness > rim_thickness)\n\t\t\t\tcylinder (r=rim_radius,h=gear_thickness);\n\t\t\tif (hub_thickness > gear_thickness)\n\t\t\t\ttranslate ([0,0,gear_thickness])\n\t\t\t\tcylinder (r=hub_diameter\/2,h=hub_thickness-gear_thickness);\n\t\t}\n\t\ttranslate ([0,0,-1])\n\t\tcylinder (\n\t\t\tr=bore_diameter\/2,\n\t\t\th=2+max(rim_thickness,hub_thickness,gear_thickness));\n\t\tif (circles>0)\n\t\t{\n\t\t\tfor(i=[0:circles-1])\t\n\t\t\t\trotate([0,0,i*360\/circles])\n\t\t\t\ttranslate([circle_orbit_diameter\/2,0,-1])\n\t\t\t\tcylinder(r=circle_diameter\/2,h=max(gear_thickness,rim_thickness)+3);\n\t\t}\n\t}\n}\n\nmodule gear_shape (\n\tnumber_of_teeth,\n\tpitch_radius,\n\troot_radius,\n\tbase_radius,\n\touter_radius,\n\thalf_thick_angle,\n\tinvolute_facets)\n{\n\tunion()\n\t{\n\t\trotate (half_thick_angle) circle ($fn=number_of_teeth*2, r=root_radius);\n\n\t\tfor (i = [1:number_of_teeth])\n\t\t{\n\t\t\trotate ([0,0,i*360\/number_of_teeth])\n\t\t\t{\n\t\t\t\tinvolute_gear_tooth (\n\t\t\t\t\tpitch_radius = pitch_radius,\n\t\t\t\t\troot_radius = root_radius,\n\t\t\t\t\tbase_radius = base_radius,\n\t\t\t\t\touter_radius = outer_radius,\n\t\t\t\t\thalf_thick_angle = half_thick_angle,\n\t\t\t\t\tinvolute_facets=involute_facets);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule involute_gear_tooth (\n\tpitch_radius,\n\troot_radius,\n\tbase_radius,\n\touter_radius,\n\thalf_thick_angle,\n\tinvolute_facets)\n{\n\tmin_radius = max (base_radius,root_radius);\n\n\tpitch_point = involute (base_radius, involute_intersect_angle (base_radius, pitch_radius));\n\tpitch_angle = atan2 (pitch_point[1], pitch_point[0]);\n\tcentre_angle = pitch_angle + half_thick_angle;\n\n\tstart_angle = involute_intersect_angle (base_radius, min_radius);\n\tstop_angle = involute_intersect_angle (base_radius, outer_radius);\n\n\tres=(involute_facets!=0)?involute_facets:($fn==0)?5:$fn\/4;\n\n\tunion ()\n\t{\n\t\tfor (i=[1:res])\n\t\tassign (\n\t\t\tpoint1=involute (base_radius,start_angle+(stop_angle - start_angle)*(i-1)\/res),\n\t\t\tpoint2=involute (base_radius,start_angle+(stop_angle - start_angle)*i\/res))\n\t\t{\n\t\t\tassign (\n\t\t\t\tside1_point1=rotate_point (centre_angle, point1),\n\t\t\t\tside1_point2=rotate_point (centre_angle, point2),\n\t\t\t\tside2_point1=mirror_point (rotate_point (centre_angle, point1)),\n\t\t\t\tside2_point2=mirror_point (rotate_point (centre_angle, point2)))\n\t\t\t{\n\t\t\t\tpolygon (\n\t\t\t\t\tpoints=[[0,0],side1_point1,side1_point2,side2_point2,side2_point1],\n\t\t\t\t\tpaths=[[0,1,2,3,4,0]]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n\/\/ Mathematical Functions\n\/\/===============\n\n\/\/ Finds the angle of the involute about the base radius at the given distance (radius) from it's center.\n\/\/source: http:\/\/www.mathhelpforum.com\/math-help\/geometry\/136011-circle-involute-solving-y-any-given-x.html\n\nfunction involute_intersect_angle (base_radius, radius) = sqrt (pow (radius\/base_radius, 2) - 1) * 180 \/ pi;\n\n\/\/ Calculate the involute position for a given base radius and involute angle.\n\nfunction rotated_involute (rotate, base_radius, involute_angle) = \n[\n\tcos (rotate) * involute (base_radius, involute_angle)[0] + sin (rotate) * involute (base_radius, involute_angle)[1],\n\tcos (rotate) * involute (base_radius, involute_angle)[1] - sin (rotate) * involute (base_radius, involute_angle)[0]\n];\n\nfunction mirror_point (coord) = \n[\n\tcoord[0], \n\t-coord[1]\n];\n\nfunction rotate_point (rotate, coord) =\n[\n\tcos (rotate) * coord[0] + sin (rotate) * coord[1],\n\tcos (rotate) * coord[1] - sin (rotate) * coord[0]\n];\n\nfunction involute (base_radius, involute_angle) = \n[\n\tbase_radius*(cos (involute_angle) + involute_angle*pi\/180*sin (involute_angle)),\n\tbase_radius*(sin (involute_angle) - involute_angle*pi\/180*cos (involute_angle)),\n];\n\n\n\/\/ Test Cases\n\/\/===============\n\nmodule test_gears()\n{\n\ttranslate([17,-15])\n\t{\n\t\tgear (number_of_teeth=17,\n\t\t\tcircular_pitch=500,\n\t\t\tcircles=8);\n\t\n\t\trotate ([0,0,360*4\/17])\n\t\ttranslate ([39.088888,0,0])\n\t\t{\n\t\t\tgear (number_of_teeth=11,\n\t\t\t\tcircular_pitch=500,\n\t\t\t\thub_diameter=0,\n\t\t\t\trim_width=65);\n\t\t\ttranslate ([0,0,8])\n\t\t\t{\n\t\t\t\tgear (number_of_teeth=6,\n\t\t\t\t\tcircular_pitch=300,\n\t\t\t\t\thub_diameter=0,\n\t\t\t\t\trim_width=5,\n\t\t\t\t\trim_thickness=6,\n\t\t\t\t\tpressure_angle=31);\n\t\t\t\trotate ([0,0,360*5\/6])\n\t\t\t\ttranslate ([22.5,0,1])\n\t\t\t\tgear (number_of_teeth=21,\n\t\t\t\t\tcircular_pitch=300,\n\t\t\t\t\tbore_diameter=2,\n\t\t\t\t\thub_diameter=4,\n\t\t\t\t\trim_width=1,\n\t\t\t\t\thub_thickness=4,\n\t\t\t\t\trim_thickness=4,\n\t\t\t\t\tgear_thickness=3,\n\t\t\t\t\tpressure_angle=31);\n\t\t\t}\n\t\t}\n\n\t\ttranslate ([-61.1111111,0,0])\n\t\t{\n\t\t\tgear (number_of_teeth=27,\n\t\t\t\tcircular_pitch=500,\n\t\t\t\tcircles=5,\n\t\t\t\thub_diameter=2*8.88888889);\n\n\t\t\ttranslate ([0,0,10])\n\t\t\t{\n\t\t\t\tgear (\n\t\t\t\t\tnumber_of_teeth=14,\n\t\t\t\t\tcircular_pitch=200,\n\t\t\t\t\tpressure_angle=5,\n\t\t\t\t\tclearance = 0.2,\n\t\t\t\t\tgear_thickness = 10,\n\t\t\t\t\trim_thickness = 10,\n\t\t\t\t\trim_width = 15,\n\t\t\t\t\tbore_diameter=5,\n\t\t\t\t\tcircles=0);\n\t\t\t\ttranslate ([13.8888888,0,1])\n\t\t\t\tgear (\n\t\t\t\t\tnumber_of_teeth=11,\n\t\t\t\t\tcircular_pitch=200,\n\t\t\t\t\tpressure_angle=5,\n\t\t\t\t\tclearance = 0.2,\n\t\t\t\t\tgear_thickness = 10,\n\t\t\t\t\trim_thickness = 10,\n\t\t\t\t\trim_width = 15,\n\t\t\t\t\thub_thickness = 20,\n\t\t\t\t\thub_diameter=2*7.222222,\n\t\t\t\t\tbore_diameter=5,\n\t\t\t\t\tcircles=0);\n\t\t\t}\n\t\t}\n\t\n\t\trotate ([0,0,360*-5\/17])\n\t\ttranslate ([44.444444444,0,0])\n\t\tgear (number_of_teeth=15,\n\t\t\tcircular_pitch=500,\n\t\t\thub_diameter=10,\n\t\t\trim_width=5,\n\t\t\trim_thickness=5,\n\t\t\tgear_thickness=4,\n\t\t\thub_thickness=6,\n\t\t\tcircles=9);\n\t\n\t\trotate ([0,0,360*-1\/17])\n\t\ttranslate ([30.5555555,0,-1])\n\t\tgear (number_of_teeth=5,\n\t\t\tcircular_pitch=500,\n\t\t\thub_diameter=0,\n\t\t\trim_width=5,\n\t\t\trim_thickness=10);\n\t}\n}\n\nmodule meshing_double_helix ()\n{\n\ttest_double_helix_gear ();\n\t\n\tmirror ([0,1,0])\n\ttranslate ([58.33333333,0,0])\n\ttest_double_helix_gear (teeth=13,circles=6);\n}\n\nmodule test_double_helix_gear (\n\tteeth=17,\n\tcircles=8)\n{\n\t\/\/double helical gear\n\t{\n\t\ttwist=200;\n\t\theight=20;\n\t\tpressure_angle=30;\n\n\t\tgear (number_of_teeth=teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tpressure_angle=pressure_angle,\n\t\t\tclearance = 0.2,\n\t\t\tgear_thickness = height\/2*0.5,\n\t\t\trim_thickness = height\/2,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = height\/2*1.2,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tcircles=circles,\n\t\t\ttwist=twist\/teeth);\n\t\tmirror([0,0,1])\n\t\tgear (number_of_teeth=teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tpressure_angle=pressure_angle,\n\t\t\tclearance = 0.2,\n\t\t\tgear_thickness = height\/2,\n\t\t\trim_thickness = height\/2,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = height\/2,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tcircles=circles,\n\t\t\ttwist=twist\/teeth);\n\t}\n}\n\nmodule test_backlash ()\n{\n\tbacklash = 2;\n\tteeth = 15;\n\n\ttranslate ([-29.166666,0,0])\n\t{\n\t\ttranslate ([58.3333333,0,0])\n\t\trotate ([0,0,-360\/teeth\/4])\n\t\tgear (\n\t\t\tnumber_of_teeth = teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tgear_thickness = 12,\n\t\t\trim_thickness = 15,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = 17,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tbacklash = 2,\n\t\t\tcircles=8);\n\t\t\n\t\trotate ([0,0,360\/teeth\/4])\n\t\tgear (\n\t\t\tnumber_of_teeth = teeth,\n\t\t\tcircular_pitch=700,\n\t\t\tgear_thickness = 12,\n\t\t\trim_thickness = 15,\n\t\t\trim_width = 5,\n\t\t\thub_thickness = 17,\n\t\t\thub_diameter=15,\n\t\t\tbore_diameter=5,\n\t\t\tbacklash = 2,\n\t\t\tcircles=8);\n\t}\n\n\tcolor([0,0,128,0.5])\n\ttranslate([0,0,-5])\n\tcylinder ($fn=20,r=backlash \/ 4,h=25);\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a109913af48ac481d2dffbe7141c96cf6d5a2f6f","subject":"encoders are in the lid cutout","message":"encoders are in the lid cutout\n","repos":"beckdac\/zynthian-build","old_file":"case\/zynthian-case.scad","new_file":"case\/zynthian-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n %translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n %translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\nmodule display_mount() {\n \/\/ corner tabs\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2, j * displayBoardHeight\/2, -displayBoardThickness])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2, j * displayBoardHeight\/2, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nmodule lid() {\n display_mount_tabs();\n display_mount();\n difference() {\n \/\/ face plate\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n %for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * encoderWidth, j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n }\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}\n\n\/\/display();\n\/\/encoder();\nlid();","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n %translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n %translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2, j * displayBoardHeight\/2, -displayBoardThickness])\n difference() {\n cube([20, 20, 3], center=true);\n translate([i *2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nmodule lid() {\n difference() {\n \/\/ face plate\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, -displayBoardThickness \/ 2])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, displayScreenThickness \/ .5 ]);\n \/\/ screen cutout\n display() ;\n }\n \/\/ encoder cutout\n \/\/ screw holes\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}\n\n\/\/display();\n\/\/encoder();\nlid();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"334b228683bc765f9d0dcbbf46ae6663876e4140","subject":"Holder for brass nut","message":"Holder for brass nut\n\nFor threaded-rod based linear motion.\n","repos":"josephmjoy\/funstuff","old_file":"models\/jack\/brass-nut-mount.scad","new_file":"models\/jack\/brass-nut-mount.scad","new_contents":"\/\/ Brass Nut Mount for DIY Jack - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\nfunction range(start, stop, step) = [start: step: stop-1];\n\n\/\/module hexagon(base) = [[0,0], [0, base], [base, 0]];\n\nbase_thickness = 3;\nbase_width = 15;\nbase_corner_radius = 3; \/\/ For Minkowski corners\nbolt_hole_dia = 4;\ncylinder_dia = 10;\nhex_bolt_dia = 5; \/\/ from corner to corner\nhex_hole_dia = hex_bolt_dia + 1;\nhex_bolt_height = 5;\nEPSILON = 0.01;\n\n\n\/\/ Create {n} bolt holes in a circle centered on ({x},{y}) and with radius r\n\/\/ Bolt-hole radius is 2*bolt_hole_dia\nmodule bolt_holes(x, y, r) {\n translate([x, y, -EPSILON ]) {\n for (a = range(45, 360, 90)) {\n rotate([0, 0, a]) translate([r, 0, 0])\n cylinder(base_thickness+2*EPSILON, r=bolt_hole_dia\/2);\n\n }\n }\n}\n\n\/\/ base\nmodule base() {\n reduced_width = base_width - 2*base_corner_radius;\n bolt_circle_radius = reduced_width\/2;\n difference() {\n minkowski() {\n \n cube([reduced_width, reduced_width, base_thickness]);\n cylinder(EPSILON\/2, r=base_corner_radius);\n }\n bolt_holes(reduced_width\/2, reduced_width\/2, bolt_circle_radius);\n }\n}\n\n\n\nmodule nut_mount() {\n base();\n \/\/bolt_holes(0, 0, cylinder_dia, 4);\n \/\/cylinder(base_thickness, r=bolt_hole_dia\/2);\n}\n\nnut_mount();\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'models\/jack\/brass-nut-mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b6d4c935f9bf8c2d915377d31178bef0220ecef","subject":"added fill sqare calibration","message":"added fill sqare calibration\n","repos":"bdynamic\/3d_shared","old_file":"calibration\/z_calibration\/fill_square.scad","new_file":"calibration\/z_calibration\/fill_square.scad","new_contents":"first_layer_hight = 0.15; \/\/ first layer hight in mm\nsize = 40; \/\/side length of the layer in mm\n\ncube([size,size,first_layer_hight], center=true);","old_contents":"","returncode":1,"stderr":"error: pathspec 'calibration\/z_calibration\/fill_square.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d05f45ac1edc37d6fa1a9f4a260559b31a775757","subject":"cleanup","message":"cleanup\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/che-thild\/che-thild-coin\/che-thild-coin.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/che-thild\/che-thild-coin\/che-thild-coin.scad","new_contents":"\nuse <..\/che-thild.scad>\n\nxyScale = 0.22;\n\nchildHeight = 2;\n\nzTranslate = (childHeight \/ 2.0) - 0.01;\n\nunion()\n{\n translate([0, 0, zTranslate])\n scale([xyScale, xyScale, 1])\n theChild(height = childHeight);\n\n color(\"blue\")\n cylinder(r=20, h=childHeight, center=true); \n}\n","old_contents":"\nuse <..\/che-thild.scad>\n\nxyScale = 0.22;\n\nchildHeight = 2;\n\nzTranslate = ( (childHeight \/ 2.0) - 0.01 );\n\nunion()\n{\n translate([0, 0, zTranslate])\n scale([xyScale, xyScale, 1])\n theChild(height = childHeight);\n\n color(\"blue\")\n cylinder(r=20, h=childHeight, center=true); \n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f7cd2f0f4d91c6e42f1f7bf2a82388fd0a7497de","subject":"Remove test.scad","message":"Remove test.scad\n","repos":"cameronlai\/sound3d,cameronlai\/sound3d","old_file":"scad\/test.scad","new_file":"scad\/test.scad","new_contents":"","old_contents":"surface(\"test.dat\", convexity = 5);\ntranslate([0,0,-2])\ncube([20,10,2]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2a42abcdf28d728d4f621adf18f5bfe5d57fc87f","subject":"Fix typo in annotation","message":"Fix typo in annotation\n","repos":"jsconan\/camelSCAD","old_file":"core\/line.scad","new_file":"core\/line.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Lines handling.\r\n *\r\n * @package core\/line\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Computes the coordinates of a 2D arc by rotating a vector along the provided angle.\r\n *\r\n * @param Number|Vector r - The number or the vector that defines the radius of the arc (can be ellipse).\r\n * @param Number [a] - The angle to cover.\r\n * @param Vector [o] - The coordinates of the center of the arc.\r\n * @param Number [a1] - The start angle of the arc.\r\n * @param Number [a2] - The end angle of the arc.\r\n * @returns Vector[]\r\n *\/\r\nfunction arc(r, a=DEGREES, o, a1, a2) =\r\n let(\r\n r = vector2D(r),\r\n o = vector2D(o),\r\n a1 = deg(a1),\r\n a2 = a2 != undef ? deg(a2) : a1 + deg(a)\r\n )\r\n !r[0] || !r[1] || (!a1 && !a2) ? []\r\n :let(\r\n start = min(a1, a2),\r\n end = max(a1, a2),\r\n range = end - start,\r\n step = astep(max(r), absdeg(range)),\r\n inc = sign(a2 - a1) * step\r\n )\r\n complete(\r\n \/\/ intermediate points\r\n range <= step ? []\r\n :[ for (a = [a1 + inc : inc : a2]) arcp(r, a) + o ],\r\n \/\/ the start point\r\n arcp(r, a1) + o,\r\n \/\/ the final point\r\n arcp(r, a2) + o\r\n )\r\n;\r\n\r\n\/**\r\n * Computes a sinusoid wave.\r\n * Without angle, the line will be horizontal.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the sinusoid.\r\n * @param Number p - The phase of the sinusoid (the start angle).\r\n * @param Number o - The offset of the sinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction sinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n [\r\n for (x = [0 : step : l])\r\n let( p = sinp(x=x, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a cosinusoid wave.\r\n * Without angle, the line will be vertical.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the cosinusoid.\r\n * @param Number p - The phase of the cosinusoid (the start angle).\r\n * @param Number o - The offset of the cosinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction cosinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n [\r\n for (y = [0 : step : l])\r\n let( p = cosp(y=y, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a line from a path.\r\n *\r\n * A path is composed of commands, each one being a simple array starting by the\r\n * command name. Each command will produce points relative to the last command\r\n * or to the last existing point. When the line starts it will rely on the\r\n * existing points, if any. If no existing points is provided, the line will\r\n * start from the absolute origin ([0, 0]), unless the first command is a point.\r\n *\r\n * The following commands are recognized:\r\n * - P, Point: [\"P\", , ] | [\"P\", ] - Adds a point at the given absolute coordinates.\r\n * - L, Line: [\"L\", , ] | [\"L\", ] - Adds a line from the last point to the given relative coordinates.\r\n * - H, Horizontal line: [\"H\", ] - Adds an horizontal line from the last point with the given length. The sign of the length determines the direction.\r\n * - V, Vertical line: [\"V\", ] - Adds a vertical line from the last point with the given length. The sign of the length determines the direction.\r\n * - I, Intersection: [\"I\", , , ] - Adds a line from the last point, that pass through P1 and intersects with the line defined by P2 and P3.\r\n * - T, Tangent: [\"T\", , , ] | [\"T\", , ] - Adds a line from the last point, that ends at the tangent point with the defined circle. The sign of the radius determines the direction\r\n * - A, Angle: [\"A\", , ] - Adds a leaned line from the last point with the given angle and the given length. The sign of the length determines the direction.\r\n * - C, Circle: [\"C\", , , ] - Adds a circle arc from the last point with the given radius and with the given angle.\r\n * - B, Bezier curve: [\"B\", , , ] - Adds a cubic bezier curve from the last point with the given control points (up to 3, the first beeing the last existing point).\r\n *\r\n * @param Array p - The path from which build the line\r\n * @param Vector[] points - The existing points to start the line from.\r\n * @param Number i - The start index in the path (default: 0)\r\n * @returns Vector[]\r\n *\/\r\nfunction path(p, points, i) =\r\n let(\r\n p = array(p),\r\n i = integer(i),\r\n points = array(points),\r\n length = len(points),\r\n point = vector2D(points[length - 1]),\r\n cur = p[i],\r\n cmd = cur[0],\r\n l = len(cur)\r\n )\r\n i >= len(p) ? points\r\n :let(\r\n values = (\r\n l <= 1 ? [point]\r\n :cmd == \"P\" || cmd == \"p\" ? [isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2])]\r\n :cmd == \"L\" || cmd == \"l\" ? [point, point + (isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2]))]\r\n :cmd == \"H\" || cmd == \"h\" ? [point, point + apply2D(x=cur[1])]\r\n :cmd == \"V\" || cmd == \"v\" ? [point, point + apply2D(y=cur[1])]\r\n :cmd == \"I\" || cmd == \"i\" ? [point, intersect2D(point, cur[1], cur[2], cur[3])]\r\n :cmd == \"T\" || cmd == \"t\" ? let(isv = isVector(cur[1])) [point, tangent2D(point, isv ? cur[1] : apply2D(x=cur[1], y=cur[2]), isv ? cur[2] : cur[3])]\r\n :cmd == \"A\" || cmd == \"a\" ? [point, point + arcPoint(a=cur[1], r=cur[2])]\r\n :cmd == \"C\" || cmd == \"c\" ? arc(r=cur[1], a1=cur[2], a2=cur[3], o=point + arcPoint(a=float(cur[2]) + STRAIGHT, r=cur[1]))\r\n :cmd == \"B\" || cmd == \"b\" ? (\r\n l >= 4 ? concat([point], cubicBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2]), point + vector2D(cur[3])))\r\n :l == 3 ? concat([point], quadraticBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2])))\r\n :[point, point + vector2D(cur[1])]\r\n )\r\n :[]\r\n )\r\n )\r\n path(p=p, points=concat(values[0] == point ? slice(points, 0, -1) : points, values), i=i + 1)\r\n;\r\n\r\n\/**\r\n * Computes the outline of a polygon. The outline can be at a particular distance.\r\n *\r\n * @param Vector[] points - The points defining the polygon to outline.\r\n * @param Number distance - The distance from the polygon for the outline.\r\n * A positive distance will place the outline outside,\r\n * while a negative distance will place it inside.\r\n * @returns Vector[]\r\n *\/\r\nfunction outline(points, distance) =\r\n let(\r\n points = array(points),\r\n l = len(points),\r\n prev = l - 1,\r\n next = 1\r\n )\r\n l >= 3 ? [\r\n for (i = [0 : 1 : l - 1])\r\n vertexOutline2D(\r\n a=points[(i + prev) % l],\r\n v=points[i],\r\n b=points[(i + next) % l],\r\n distance=distance\r\n )\r\n ] : points\r\n;\r\n\r\n\/**\r\n * Adds a value to each point of a line.\r\n *\r\n * @param Vector[] points - The points defining the line.\r\n * @param Number|Vector value - The value to add to the line.\r\n * @returns Vector[]\r\n *\/\r\nfunction lineAdd(points, value) =\r\n let(\r\n l = max(\r\n float(len(value)),\r\n float(len(points[0]))\r\n ),\r\n value = vector3D(value)\r\n )\r\n l > 2 ? [ for (p = points) vector3D(p) + value ]\r\n : [ for (p = points) vector2D(p) + value ]\r\n;\r\n\r\n\/**\r\n * Builds a vector of faces to be used in a polyhedron. The function accepts the\r\n * number of points defining one main face of the polyhedron, then returns the\r\n * faces vector that contains the indices of each face enclosing the solid. This\r\n * only apply on simple polyhedron where two opposite faces share the same\r\n * number of points.\r\n *\r\n * @param Number length - The number of points for one main face of the polyhedron\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronFaces(length) =\r\n let(\r\n length = integer(length)\r\n )\r\n length < 3 ? []\r\n :let(\r\n r1 = 0,\r\n r2 = length - 1,\r\n r3 = length,\r\n r4 = length * 2 - 1\r\n )\r\n concat([\r\n range(r1, r2),\r\n range(r3, r4)\r\n ], [\r\n for (i = [r1 : r2]) [\r\n r1 + i,\r\n (r1 + i + 1) % length,\r\n r3 + (i + 1) % length,\r\n r3 + i\r\n ]\r\n ])\r\n;\r\n\r\n\/**\r\n * Composes a list of points to be used in a simple polyhedron.\r\n *\r\n * @param Vector[] [bottom] - The list of points for the bottom face.\r\n * @param Vector[] [top] - The list of points for the top face.\r\n * @param Vector[] [points] - The list of points for a main face.\r\n * @param Vector [distane] - The distance between two main faces.\r\n * @param Number [x] - The distance between two main faces on the X-axis.\r\n * @param Number [y] - The distance between two main faces on the Y-axis.\r\n * @param Number [z] - The distance between two main faces on the Z-axis.\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronPoints(bottom, top, points, distance, x, y, z) =\r\n let(\r\n distance = apply3D(v=distance, x=x, y=y, z=z)\r\n )\r\n top && bottom ? concat(\r\n [ for (p = bottom) vector3D(p) ],\r\n [ for (p = top) vector3D(p) + distance ]\r\n )\r\n :let(\r\n points = [ for (p = (points ? points : (top ? top : bottom))) vector3D(p) ]\r\n )\r\n concat(\r\n points,\r\n [ for (p = points) p + distance ]\r\n )\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Lines handling.\r\n *\r\n * @package core\/line\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Computes the coordinates of a 2D arc by rotating a vector along the provided angle.\r\n *\r\n * @param Number|Vector r - The number or the vector that defines the radius of the arc (can be ellipse).\r\n * @param Number [a] - The angle to cover.\r\n * @param Vector [o] - The coordinates of the center of the arc.\r\n * @param Number [a1] - The start angle of the arc.\r\n * @param Number [a2] - The end angle of the arc.\r\n * @returns Vector[]\r\n *\/\r\nfunction arc(r, a=DEGREES, o, a1, a2) =\r\n let(\r\n r = vector2D(r),\r\n o = vector2D(o),\r\n a1 = deg(a1),\r\n a2 = a2 != undef ? deg(a2) : a1 + deg(a)\r\n )\r\n !r[0] || !r[1] || (!a1 && !a2) ? []\r\n :let(\r\n start = min(a1, a2),\r\n end = max(a1, a2),\r\n range = end - start,\r\n step = astep(max(r), absdeg(range)),\r\n inc = sign(a2 - a1) * step\r\n )\r\n complete(\r\n \/\/ intermediate points\r\n range <= step ? []\r\n :[ for (a = [a1 + inc : inc : a2]) arcp(r, a) + o ],\r\n \/\/ the start point\r\n arcp(r, a1) + o,\r\n \/\/ the final point\r\n arcp(r, a2) + o\r\n )\r\n;\r\n\r\n\/**\r\n * Computes a sinusoid wave.\r\n * Without angle, the line will be horizontal.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the sinusoid.\r\n * @param Number p - The phase of the sinusoid (the start angle).\r\n * @param Number o - The offset of the sinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction sinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n [\r\n for (x = [0 : step : l])\r\n let( p = sinp(x=x, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a cosinusoid wave.\r\n * Without angle, the line will be vertical.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the cosinusoid.\r\n * @param Number p - The phase of the cosinusoid (the start angle).\r\n * @param Number o - The offset of the cosinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction cosinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n [\r\n for (y = [0 : step : l])\r\n let( p = cosp(y=y, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a line from a path.\r\n *\r\n * A path is composed of commands, each one being a simple array starting by the\r\n * command name. Each command will produce points relative to the last command\r\n * or to the last existing point. When the line starts it will rely on the\r\n * existing points, if any. If no existing points is provided, the line will\r\n * start from the absolute origin ([0, 0]), unless the first command is a point.\r\n *\r\n * The following commands are recognized:\r\n * - P, Point: [\"P\", , ] | [\"P\", ] - Adds a point at the given absolute coordinates.\r\n * - L, Line: [\"L\", , ] | [\"L\", ] - Adds a line from the last point to the given relative coordinates.\r\n * - H, Horizontal line: [\"H\", ] - Adds an horizontal line from the last point with the given length. The sign of the length determines the direction.\r\n * - V, Vertical line: [\"V\", ] - Adds a vertical line from the last point with the given length. The sign of the length determines the direction.\r\n * - I, Intersection: [\"I\", , , ] - Adds a line from the last point, that pass through P1 and intersects with the line defined by P2 and P3.\r\n * - T, Tangent: [\"T\", , , ] | [\"T\", , ] - Adds a line from the last point, that ends at the tangent point with the defined circle. The sign of the radius determines the direction\r\n * - A, Angle: [\"A\", , ] - Adds a leaned line from the last point with the given angle and the given length. The sign of the length determines the direction.\r\n * - C, Circle: [\"C\", , , ] - Adds a circle arc from the last point with the given radius and with the given angle.\r\n * - B, Bezier curve: [\"B\", , , ] - Adds a cubic bezier curve from the last point with the given control points (up to 3, the first beeing the last existing point).\r\n *\r\n * @param Array p - The path from which build the line\r\n * @param Vector[] points - The existing points to start the line from.\r\n * @param Number i - The start index in the path (default: 0)\r\n * @returns Vector[]\r\n *\/\r\nfunction path(p, points, i) =\r\n let(\r\n p = array(p),\r\n i = integer(i),\r\n points = array(points),\r\n length = len(points),\r\n point = vector2D(points[length - 1]),\r\n cur = p[i],\r\n cmd = cur[0],\r\n l = len(cur)\r\n )\r\n i >= len(p) ? points\r\n :let(\r\n values = (\r\n l <= 1 ? [point]\r\n :cmd == \"P\" || cmd == \"p\" ? [isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2])]\r\n :cmd == \"L\" || cmd == \"l\" ? [point, point + (isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2]))]\r\n :cmd == \"H\" || cmd == \"h\" ? [point, point + apply2D(x=cur[1])]\r\n :cmd == \"V\" || cmd == \"v\" ? [point, point + apply2D(y=cur[1])]\r\n :cmd == \"I\" || cmd == \"i\" ? [point, intersect2D(point, cur[1], cur[2], cur[3])]\r\n :cmd == \"T\" || cmd == \"t\" ? let(isv = isVector(cur[1])) [point, tangent2D(point, isv ? cur[1] : apply2D(x=cur[1], y=cur[2]), isv ? cur[2] : cur[3])]\r\n :cmd == \"A\" || cmd == \"a\" ? [point, point + arcPoint(a=cur[1], r=cur[2])]\r\n :cmd == \"C\" || cmd == \"c\" ? arc(r=cur[1], a1=cur[2], a2=cur[3], o=point + arcPoint(a=float(cur[2]) + STRAIGHT, r=cur[1]))\r\n :cmd == \"B\" || cmd == \"b\" ? (\r\n l >= 4 ? concat([point], cubicBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2]), point + vector2D(cur[3])))\r\n :l == 3 ? concat([point], quadraticBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2])))\r\n :[point, point + vector2D(cur[1])]\r\n )\r\n :[]\r\n )\r\n )\r\n path(p=p, points=concat(values[0] == point ? slice(points, 0, -1) : points, values), i=i + 1)\r\n;\r\n\r\n\/**\r\n * Computes the outline of a polygon. The outline can be at a particular distance.\r\n *\r\n * @param Vector[] points - The points defining the polygon to outline.\r\n * @param Number distance - The distance from the polygon for the outline.\r\n * A positive distance will place the outline outside,\r\n * while a negative distance will place it inside.\r\n * @returns Vector[]\r\n *\/\r\nfunction outline(points, distance) =\r\n let(\r\n points = array(points),\r\n l = len(points),\r\n prev = l - 1,\r\n next = 1\r\n )\r\n l >= 3 ? [\r\n for (i = [0 : 1 : l - 1])\r\n vertexOutline2D(\r\n a=points[(i + prev) % l],\r\n v=points[i],\r\n b=points[(i + next) % l],\r\n distance=distance\r\n )\r\n ] : points\r\n;\r\n\r\n\/**\r\n * Adds a value to each point of a line.\r\n *\r\n * @param Vector[] points - The points defining the line.\r\n * @param Number|Vector value - The value to add to the line.\r\n * @returns Vector[]\r\n *\/\r\nfunction lineAdd(points, value) =\r\n let(\r\n l = max(\r\n float(len(value)),\r\n float(len(points[0]))\r\n ),\r\n value = vector3D(value)\r\n )\r\n l > 2 ? [ for (p = points) vector3D(p) + value ]\r\n : [ for (p = points) vector2D(p) + value ]\r\n;\r\n\r\n\/**\r\n * Builds a vector of faces to be used in a polyhedron. The function accepts the\r\n * number of points defining one main face of the polyhedron, then returns the\r\n * faces vector that contains the indices of each face enclosing the solid. This\r\n * only apply on simple polyhedron where two opposite faces share the same\r\n * number of points?.\r\n *\r\n * @param Number length - The number of points for one main face of the polyhedron\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronFaces(length) =\r\n let(\r\n length = integer(length)\r\n )\r\n length < 3 ? []\r\n :let(\r\n r1 = 0,\r\n r2 = length - 1,\r\n r3 = length,\r\n r4 = length * 2 - 1\r\n )\r\n concat([\r\n range(r1, r2),\r\n range(r3, r4)\r\n ], [\r\n for (i = [r1 : r2]) [\r\n r1 + i,\r\n (r1 + i + 1) % length,\r\n r3 + (i + 1) % length,\r\n r3 + i\r\n ]\r\n ])\r\n;\r\n\r\n\/**\r\n * Composes a list of points to be used in a simple polyhedron.\r\n *\r\n * @param Vector[] [bottom] - The list of points for the bottom face.\r\n * @param Vector[] [top] - The list of points for the top face.\r\n * @param Vector[] [points] - The list of points for a main face.\r\n * @param Vector [distane] - The distance between two main faces.\r\n * @param Number [x] - The distance between two main faces on the X-axis.\r\n * @param Number [y] - The distance between two main faces on the Y-axis.\r\n * @param Number [z] - The distance between two main faces on the Z-axis.\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronPoints(bottom, top, points, distance, x, y, z) =\r\n let(\r\n distance = apply3D(v=distance, x=x, y=y, z=z)\r\n )\r\n top && bottom ? concat(\r\n [ for (p = bottom) vector3D(p) ],\r\n [ for (p = top) vector3D(p) + distance ]\r\n )\r\n :let(\r\n points = [ for (p = (points ? points : (top ? top : bottom))) vector3D(p) ]\r\n )\r\n concat(\r\n points,\r\n [ for (p = points) p + distance ]\r\n )\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"290f0dc1caef7f68bc16f253677d6a8f95b18028","subject":"WIP on core element","message":"WIP on core element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/kite_roller.scad","new_file":"kite_roller\/kite_roller.scad","new_contents":"use \n\neps = 0.01;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule screw_head_slot(dh=0)\n{\n screw_head_hex_m8(0.5, 2*0.2+dh);\n}\n\n\nmodule washer(dh=0)\n{\n difference()\n {\n cylinder(d=15.5, h=1.4+dh);\n translate(eps*[0,0,-1])\n cylinder(d=8.5, h=1.4+dh+2*eps);\n }\n}\n\n\n\/\/ slot for ball bearing + 2 washers\nmodule bearing_slot()\n{\n d_spacing = 0.5;\n h_spacing = 0.2;\n cylinder(d=22+d_spacing, h=7+h_spacing, $fn=150);\n\n for(dh=[-1.4, 7+h_spacing])\n translate([0,0,dh])\n washer();\n}\n\nmodule side_block()\n{\n difference()\n {\n \/\/ main element\n cylinder(d1=120, d2=30, h=20, $fn=360);\n \/\/ screw slot\n translate([60\/2, 0, -eps])\n {\n screw_head_slot(0.5);\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n translate([0, 0, 12])\n washer(dh=100);\n }\n }\n}\n\nside_block();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kite_roller\/kite_roller.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"d3c367d72f83062265f9c5fa8bf89b4352e23da4","subject":"Fix top board","message":"Fix top board\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1_board.scad","new_file":"3d\/enclosure_v1_board.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n\tdifference() {\n\t cube([box_x, box_y, board_h + eps], false);\n\t translate([board_w, board_w, -eps]) {\n\t\tcube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n\t }\n\t}\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h + eps]) {\n\tdifference() {\n\t cube([box_x, box_y, board_h], false);\n\t translate([board_w, board_w, -eps]) {\n\t\tcube([box_x - 2*board_w, box_y - 2*board_w, board_h + 2*eps], false);\n\t }\n\t}\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"55e33201dc593f3a56a37bb70653ea477d491f66","subject":"x\/extruder: wip","message":"x\/extruder: wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.7];\nextruder_guidler_mount_off = [.5*mm -guidler_mount_off[1]+hobbed_gear_d_inner\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n \n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n \/*cubea([guidler_screws_mount_d, house_w, house_guidler_screw_h], align=[0,0,0]);*\/\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n cubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n difference()\n {\n hull()\n {\n translate([hobbed_gear_d_inner\/2,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w+1*mm,guidler_bearing[1]*2], align=[1,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w+1*mm, orient=[0,1,0], align=[1,0,0]);\n }\n\n translate(extruder_guidler_mount_off)\n {\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d+.5*mm, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n cubea([10,(guidler_w-guidler_mount_w)\/2+.5*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([guidler_screws_mount_d_offset, y*(guidler_screws_distance), house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1*mm, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ cutout for bearing\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=extruder_hotmount_clamp_nut, h=1000, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -7*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\n\/*if(false)*\/\n{\n %x_carriage(show_bearings=false);\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n {\n extruder_b(show_vitamins=true);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n %extruder_guidler(show_extras=true);\n }\n }\n\n\n %x_extruder_hotend();\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-6*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.7, -guidler_bearing[1]\/1.7];\nextruder_guidler_mount_off = [.5*mm -guidler_mount_off[1]+hobbed_gear_d_inner\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ main house\n extruder_b_size=[10,extruder_filapath_offset,10];\n rcubea(extruder_b_size);\n\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n cubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);\n }\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ hobbed gear (inner)\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w+1*mm,guidler_bearing[1]*2], align=[x,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n \/\/ extruder shaft\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=9;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -3*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nextruder_offset_b = extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0];\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 0;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\n\/*if(false)*\/\n{\n \/*%x_carriage(show_bearings=false);*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n translate(extruder_offset_b)\n {\n extruder_b(show_vitamins=true);\n\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n }\n\n\n %x_extruder_hotend();\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"91dfc7d86e0f91cca062375a98868485475d9043","subject":"xaxis\/carriage: Rewrite extruder_a to part-pattern","message":"xaxis\/carriage: Rewrite extruder_a to part-pattern\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 15*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+4*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR105;\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*45,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=7*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-45,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,45,0])\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_capmount_offset=[35,-7,-41];*\/\nextruder_b_capmount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,50,0];*\/\n\nmodule x_carriage_full()\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n extruder_a(part=\"support\");\n }\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b(with_sensormount=false);*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 15*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+4*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR105;\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*45,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=7*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-45,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,45,0])\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_capmount_offset=[35,-7,-41];*\/\nextruder_b_capmount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,50,0];*\/\n\nmodule x_carriage_full()\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_full(show_vitamins=false);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b(with_sensormount=false);*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6a204d1309bb14546d0f40023afab276bf6b85c1","subject":"xaxis\/carriage: tweaks","message":"xaxis\/carriage: tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z,0], [0,0,0]];\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*#cubea([top_width,xaxis_carriage_bearing_offset_z,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n {\n difference()\n {\n translate([0,0,xaxis_pulley_inner_d\/2])\n cubea([50, xaxis_carriage_teeth_height, 10], align=[0,0,-1]);\n }\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n translate([0,0,-xaxis_pulley_inner_d\/2])\n cubea([500,xaxis_carriage_teeth_height,5], align=[0,0,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);\n\n belt_thickness=1.5;\n for(i=[-1,1])\n translate([i*30,0,0])\n cubea([15,xaxis_carriage_teeth_height,15-belt_thickness], align=[0,0,0]);\n\n \/\/ Cut in the middle for belt\n cubea([7,xaxis_carriage_teeth_height+.1,15], align=[0,0,0]);\n\n translate([0,0,xaxis_pulley_inner_d\/2])\n {\n \/\/ Belt slit\n cubea([500,xaxis_carriage_teeth_height,belt_thickness], align=[0,0,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 2;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);\n }\n }\n\n }\n\n\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),0,0])\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, -xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n \/\/ Extruder mounting holes\n translate([0,0,xaxis_carriage_mount_offset_z])\n for(j=[-1,1])\n for(i=[-1,1])\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])\n {\n screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);\n fncylindera(d=screw_dia, h=100, orient=[0,1,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_holes();\n }\n\n if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([j*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, 0, xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([0, 0, -xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n for(i=[-1,1])\n translate([i*50,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nif(false)\n{\n x_carriage();\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z,0], [0,0,0]];\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*#cubea([top_width,xaxis_carriage_bearing_offset_z,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n {\n difference()\n {\n translate([0,0,xaxis_pulley_inner_d\/2])\n cubea([50, xaxis_carriage_teeth_height, 10], align=[0,0,-1]);\n }\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n translate([0,0,-xaxis_pulley_inner_d\/2])\n cubea([500,xaxis_carriage_teeth_height,5], align=[0,0,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);\n\n belt_thickness=1.5;\n for(i=[-1,1])\n translate([i*30,0,0])\n cubea([15,xaxis_carriage_teeth_height,15-belt_thickness], align=[0,0,0]);\n\n \/\/ Cut in the middle for belt\n cubea([7,xaxis_carriage_teeth_height+.1,15], align=[0,0,0]);\n\n translate([0,0,xaxis_pulley_inner_d\/2])\n {\n \/\/ Belt slit\n cubea([500,xaxis_carriage_teeth_height,belt_thickness], align=[0,0,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 2;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);\n }\n }\n\n for(i=[-1,1])\n translate([i*50,0,0])\n %fncylindera(d=xaxis_pulley_inner_d, h=xaxis_belt_width*1.2, orient=[0,1,0], align=[0,0,0]);\n }\n\n\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),0,0])\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, -xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n \/\/ Extruder mounting holes\n translate([0,0,xaxis_carriage_mount_offset_z])\n for(j=[-1,1])\n for(i=[-1,1])\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])\n {\n screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);\n fncylindera(d=screw_dia, h=100, orient=[0,1,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_holes();\n }\n\n %if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([j*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, 0, xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([0, 0, -xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\n\/*x_carriage();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5758b1e04834d8fad4a71103052a6a0ad2705f3a","subject":"Got the left side (30 degrees) side working","message":"Got the left side (30 degrees) side working\n","repos":"agupta231\/fractal_prints","old_file":"olson_project_30_60_90.scad","new_file":"olson_project_30_60_90.scad","new_contents":"\/\/ https:\/\/www.github.com\/agupta231\n\n\/\/ User set variables\ninit_side_len = 50.8;\nmax_iter = 10;\n\necho(version());\n\nmodule pattern(starting_pos, side_size, rotation_matrix, current_iter) {\n translate(starting_pos) {\n rotate(rotation_matrix) {\n cube(side_size);\n }\n }\n\n echo(cos(30 - rotation_matrix[1]));\n\n if(current_iter <= max_iter) {\n pattern(starting_pos + [side_size * sin(rotation_matrix[1]), 0, side_size * cos(rotation_matrix[1])], side_size * sqrt(3) \/ 2, rotation_matrix + [0, -30, 0], current_iter + 1);\n \/*#pattern(starting_pos + [0, 0, 0], side_size \/ 2, rotation_matrix + [0, 60, 0], current_iter + 1);*\/\n }\n}\n\npattern([0, 0, 0], init_side_len, [0, 30, 0], 1, 0);\n","old_contents":"\/\/ https:\/\/www.github.com\/agupta231\n\n\/\/ User set variables\ninit_side_len = 50.8;\n\necho(version());\n\nmodule pattern() {\n\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1464967bd576011da2bfbab46674afbe57e270cf","subject":"screws\/nut_trap_cut: reduce nut dia","message":"screws\/nut_trap_cut: reduce nut dia\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(XAXIS*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n }\n}\n\nif(false)\n{\n box_w = 40*mm;\n box_h = 10*mm;\n box_d = 10*mm;\n o = 10*mm;\n\n \/*$show_vit = true;*\/\n $fs= 0.2;\n $fa = 4;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n difference()\n {\n \/*rcubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);*\/\n\n \/*screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);*\/\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+.1*mm;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(XAXIS*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n }\n}\n\nif(false)\n{\n box_w = 40*mm;\n box_h = 10*mm;\n box_d = 10*mm;\n o = 10*mm;\n\n \/*$show_vit = true;*\/\n $fs= 0.2;\n $fa = 4;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n difference()\n {\n \/*rcubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);*\/\n\n \/*screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);*\/\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bb578ae0ff39f022862ecb2fa3f34a8759c87449","subject":"rolled back changes, done on a separate branch now","message":"rolled back changes, done on a separate branch now\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"include \n\n\/*\n * configuration\n *\/\nnames = [\"JOHN\", \"JANE\", \"BILLY\"];\nbrushes_count = len(names);\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,55])\n rotate([-90, 90, 0])\n scale([2,1,1])\n write(names[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"include \n\n\/*\n * configuration\n *\/\nnames = [\"LIS\"];\nbrushes_count = len(names);\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10-25])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100-25]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5-25])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5-25])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,45])\n rotate([-90, -90, 0])\n scale([2,1,1])\n write(names[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fa860b2fb0ef5efc59891ca3de01b83f7c642576","subject":"shapes: Extend fncylindera to support orient param","message":"shapes: Extend fncylindera to support orient param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);*\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e224aa33d8c55d795b2ef2cccf34a2c26d7b5536","subject":"'echo's commented out","message":"'echo's commented out\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/Write.scad","new_file":"toothbrush_holder\/Write.scad","new_contents":"\/* \tVersion 3\r\n\tAdded support for font selection (default is Letters.dxf)\r\n\tAdded WriteCube module\r\n\tAdded Rotate for text (rotates on the plane of the text)\r\n\tAdded writesphere\r\n\tAdded space= (spacing between characters in char widths) def=1\r\n\tAdded writecylinder()\r\n\r\n By Harlan Martin\r\n harlan@sutlog.com\r\n January 2012\r\n\r\n (The file TestWrite.scad gives More usage examples)\r\n (This module requires the file Letters.dxf to reside in the same folder)\r\n (The file Letters.dfx was created with inkscape..Each letter is in its own layer)\r\n (This module seperates each letter in the string and imports it from Letters.dfx)\r\n \r\n*\/\r\n\r\n\tpi=3.1415926535897932384626433832795028841971693993751058209;\r\n\tpi2=pi*2;\r\n\r\n\r\n\/\/ These control the default values for write() writesphere() writecube()\r\n\/\/ if the parameters are not included in the call. Feel free to set your own\r\n\/\/ defaults.\r\n\r\n\/\/default settings\r\n\tcenter=false;\r\n\th = 4;\t\t\t \/\/mm letter height\r\n\tt = 1; \t\t\t\/\/mm letter thickness\r\n\tspace =1; \t\t\t\/\/extra space between characters in (character widths)\r\n\trotate=0;\t\t\t\/\/ text rotation (clockwise)\r\n\tfont = \"Letters.dxf\";\t\/\/default for aditional fonts\r\n\r\n\r\n\/\/ write cube defaults\r\n\tface = \"front\";\t \/\/ default face (top,bottom,left,right,back,front)\r\n\tup =0;\t\t \/\/mm up from center on face of cube\r\n\tdown=0;\r\n\tright =0;\t\t \/\/mm left from center on face of cube\r\n\tleft=0;\t\t\r\n\t\r\n\r\n\/\/ write sphere defaults\r\n\trounded=false;\t \/\/default for rounded letters on writesphere\r\n\tnorth=0; \t\t\/\/ intial text position (I suggest leave these 0 defaults)\r\n\tsouth=0;\r\n\teast=0;\r\n\twest=0;\r\n\tspin=0;\r\n\/\/ writecylinder defaults\r\n\tmiddle=0; \/\/(mm toward middle of circle)\r\n\tccw=false; \/\/write on top or bottom in a ccw direction\r\n \tr1=0; \t\/\/(not implimented yet)\r\n\tr2=0;\t \t\/\/(not implimented yet)\r\n\t\r\n\r\n\r\n\/\/ Contact me if your interested in how to make your own font files\r\n\/\/ Its tedious and time consuming, but not very hard\r\n\r\n\r\nmodule writecylinder(text,where,radius,height){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2; \r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360;\r\n\t\/\/angle of half width of text\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\r\n\t\r\n\tif ((face==\"top\")||(face==\"bottom\") ){\r\n\t\tif (face==\"top\" ){\r\n\t\t\tif (center==true){\r\n\t\t\t\twritecircle(text,where+[0,0,height\/2],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}else{\r\n\t\t\t\twritecircle(text,where+[0,0,height],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\trotate(180,[1,0,0])\r\n\t\t\tif (center==true){\r\n\t\t\t\twritecircle(text,where+[0,0,height\/2],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}else{\r\n\t\t\t\twritecircle(text,where+[0,0,0],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t}else{\r\n\/\/\t\tif (radius>0){\r\n\t\t\tif (center==true) {\r\n\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\t\t\t\ttranslate(where)\r\n\t\t\t\twritethecylinder(text,where,radius,height,r1=radius,r2=radius,h=h,\r\n\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\t\t\t} else{\r\n\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\t\t\t\ttranslate(where+[0,0,height\/2])\r\n\t\t\t\t\twritethecylinder(text,where,radius,height,r1=radius,r2=radius,h=h,\r\n\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\t\t\t}\r\n\/\/ the remarked out code is for cone shaped cylinders (not complete)\r\n\/\/\t\t}else{\r\n\/\/\t\t\tif (center==true) {\r\n\/\/\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\/\/\t\t\t\ttranslate(where)\r\n\/\/\t\t\t\twritethecylinder(text,where,radius,height,r1=r1,r2=r2,h=h,\r\n\/\/\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\/\/\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\/\/\t\t\t} else{\r\n\/\/\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\/\/\t\t\t\ttranslate(where+[0,0,height\/2])\r\n\/\/\t\t\t\t\twritethecylinder(text,where,radius,height,r1=r1,r2=r2,h=h,\r\n\/\/\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\/\/\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\/\/\t\t\t}\r\n\/\/\t\t}\r\n\t}\r\n}\r\nmodule writecircle(text,where,radius){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2;\r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360;\r\n\t\/\/angle of half width of text\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\t\r\n\t\r\n\tif (ccw==true){\r\n\t\trotate(-rotate+east-west,[0,0,1]){\r\n\t\t\trotate(-mmangle(radius-middle),[0,0,1]){\r\n\t\t\ttranslate(where)\r\n\t\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\t\trotate(-90+r*NAngle(radius-middle),[0,0,1]) \/\/ bottom out=-270+r \r\n\t\t\t\t\ttranslate([radius-middle,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[1,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[0,1,0])\r\n\t\t\t\t\trotate(-270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\t\t\t\twrite(text[r],center=true,h=h,t=t,font=font);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trotate(-rotate-east+west,[0,0,1]){\r\n\t\t\trotate(mmangle(radius-middle),[0,0,1]){\r\n\t\t\ttranslate(where)\r\n\t\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\t\trotate(90-r*NAngle(radius-middle),[0,0,1]) \/\/ bottom out=-270+r \r\n\t\t\t\t\ttranslate([radius-middle,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[1,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[0,1,0])\r\n\t\t\t\t\trotate(270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\t\t\t\twrite(text[r],center=true,h=h,t=t,font=font);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}\r\n\r\n}\r\nmodule writethecylinder(text,where,radius,height,r1,r2){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2; \r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360*(1-abs(rotate)\/90);\r\n\t\/\/angle of half width of text\r\n\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\r\n\t\t\ttranslate([0,0,up-down])\r\n\t\t\trotate(east-west,[0,0,1])\r\n\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\trotate(-90+(r*NAngle(radius)),[0,0,1])\r\n\t\t\t\ttranslate([radius,0,-r*((rotate)\/90*wid)+(len(text)-1)\/2*((rotate)\/90*wid)])\r\n\t\t\t\trotate(90,[1,0,0])\r\n\t\t\t\trotate(90,[0,1,0])\r\n\t\t\t\twrite(text[r],center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t\/\/echo(\"zloc=\",height\/2-r*((rotate)\/90*wid)+(len(text)-1)\/2*((rotate)\/90*wid));\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\nmodule writesphere(text,where,radius){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2;\r\n\t\r\n\t\/\/echo(\"-----------------\",widall,wid,mmangle(radius));\r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360;\r\n\t\/\/angle of half width of text\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\t\r\n\r\n\trotate(east-west,[0,0,1]){\r\n\trotate(south-north,[1,0,0]){\r\n\trotate(spin,[0,1,0]){\r\n\trotate(-mmangle(radius),[0,0,1]){\r\n\t\tif ( rounded== false ){\r\n\t\t\ttranslate(where)\r\n\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\trotate(-90+r*NAngle(radius),[0,0,1])\r\n\t\t\t\ttranslate([radius,0,0])\r\n\t\t\t\trotate(90,[1,0,0])\r\n\t\t\t\trotate(90,[0,1,0])\r\n\t\t\t\twrite(text[r],center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tdifference(){\r\n\t\t\t\ttranslate(where)\r\n\t\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\t\trotate(-90+r*NAngle(radius),[0,0,1])\r\n\t\t\t\t\ttranslate([radius,0,0])\r\n\t\t\t\t\trotate(90,[1,0,0])\r\n\t\t\t\t\trotate(90,[0,1,0])\r\n\t\t\t\t\twrite(text[r],center=true,h=h,rotate=rotate,t=t*2+h,font=font);\r\n\t\t\t\t}\r\n\t\t\t\tdifference(){ \/\/rounded outside\r\n\t\t\t\t\tsphere(radius+(t*2+h)*2);\r\n\t\t\t\t\tsphere(radius+t\/2);\r\n\t\t\t\t}\r\n\t\t\t\tsphere(radius-t\/2); \/\/ rounded inside for indented text\r\n\t\t\t} \r\n\t\t}\r\n\t}\r\n}}}\r\n}\r\n\r\n\r\nmodule writecube(text,where,size){\r\n\tif (str(size)[0] != \"[\"){ \r\n\t\t\/\/ its a square cube (size was not a matrix so make it one)\r\n\t\twritethecube(text,where,[size,size,size],h=h,rotate=rotate,space=space,\r\n\t\tt=t,font=font,face=face,up=up,down=down,right=right,left=left);\r\n\r\n\t}else{\r\n\t\t\/\/ its not square\r\n\t\twritethecube(text,where,size,h=h,rotate=rotate,space=space,\r\n\t\tt=t,font=font,face=face,up=up,down=down,right=right,left=left);\r\n\t}\r\n}\r\n\/\/ I split the writecube module into 2 pieces.. easier to add features later\r\nmodule writethecube(text,where,size){\r\n\t\tif (face==\"front\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]-size[1]\/2,where[2]+up-down])\r\n\t\t\trotate(90,[1,0,0])\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"back\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]+size[1]\/2,where[2]+up-down])\r\n\t\t\trotate(90,[1,0,0]) \/\/ rotate around the x axis\r\n\t\t\trotate(180,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"left\") {\r\n\t\t\ttranslate([where[0]-size[0]\/2,where[1]-right+left,where[2]+up-down ])\r\n\t\t\trotate(90,[1,0,0]) \/\/ rotate around the x axis\r\n\t\t\trotate(90,[0,-1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"right\") {\r\n\t\t\ttranslate([where[0]+size[0]\/2,where[1]+right-left,where[2] +up-down])\r\n\t\t\trotate(90,[1,0,0]) \/\/ rotate around the x axis\r\n\t\t\trotate(90,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"top\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]+up-down,where[2]+size[2]\/2 ])\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"bottom\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]-up+down,where[2]-size[2]\/2 ])\r\n\t\t\trotate(180,[1,0,0])\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n}\r\n\r\nmodule write(word){\r\n\t\r\n\t\/\/echo (h);\r\n\t\/\/echo (word);\r\n\t\/\/echo (\"There are \" ,len(word) ,\" letters in this string\");\r\n\/\/\techo (\"The second letter is \",word[1]);\r\n\/\/\techo (str(word[0],\"_\"));\r\nrotate(rotate,[0,0,-1]){\r\n\tfor (r = [0:len(word)]){ \/\/ count off each character\r\n\t\t\/\/ if the letter is lower case, add an underscore to the end for file lookup\r\n\t\tif ((word[r] == \"a\" ) || (word[r]== \"b\") || (word[r]== \"c\") \r\n\t \t || (word[r]== \"d\") || (word[r]== \"e\") || (word[r]== \"f\") \r\n\t \t || (word[r]== \"g\") || (word[r]== \"h\") || (word[r]== \"i\") \r\n \t \t || (word[r]== \"j\") || (word[r]== \"k\") || (word[r]== \"l\")\r\n \t \t || (word[r]== \"m\") || (word[r]== \"n\") || (word[r]== \"o\") \r\n \t \t || (word[r]== \"p\") || (word[r]== \"q\") || (word[r]== \"r\") \r\n\t \t || (word[r]== \"s\") || (word[r]== \"t\") || (word[r]== \"u\") \r\n \t \t || (word[r]== \"v\") || (word[r]== \"w\") || (word[r]== \"x\") \r\n \t \t || (word[r]== \"y\" )|| (word[r]== \"z\")){\r\n\t\t\tif (center == true) {\r\n\t\t\t\ttranslate([0,-h\/2,0]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\t\r\n\t\t\t\t\t\ttranslate([ (-len(word)*5.5*space\/2) + (r*5.5*space),0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r],\"_\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\ttranslate([0,0,t\/2]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\t\r\n\t\t\t\t\t\ttranslate([r*5.5*space,0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r],\"_\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif (center == true) {\r\n\t\t\t\ttranslate([0,-h\/2,0]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\r\n\t\t\t\t\t\ttranslate([ (-len(word)*5.5*space\/2) + (r*5.5*space),0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r]));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\ttranslate([0,0,t\/2]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\r\n\t\t\t\t\t\ttranslate([r*5.5*space,0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r]));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n}\r\n\r\n\/*writecylinder test\r\ntranslate([0,0,0])\r\n%cylinder(r=20,h=40,center=true);\r\ncolor([1,0,0])\r\nwritecylinder(\"rotate=90\",[0,0,0],20,40,center=true,down=0,rotate=90);\r\nwritecylinder(\"rotate = 30,east = 90\",[0,0,0],20,40,center=true,down=0,rotate=30,east=90);\r\nwritecylinder(\"ccw = true\",[0,0,0],20,40,center=true,down=0,face=\"top\",ccw=true);\r\nwritecylinder(\"middle = 8\",[0,0,0],20,40,h=3,center=true,down=0,face=\"top\",middle=8);\r\nwritecylinder(\"face = top\",[0,0,0],20,40,center=true,down=0,face=\"top\");\r\nwritecylinder(\"east=90\",[0,0,0],20,40,h=3,center=true,down=0,face=\"top\",east=90);\r\nwritecylinder(\"west=90\",[0,0,0],20,40,h=3,center=true,down=0,face=\"top\",ccw=true,west=90);\r\nwritecylinder(\"face = bottom\",[0,0,0],20,40,center=true,down=0,face=\"bottom\"); \r\n*\/\r\n\/*writesphere test\r\nsphere(20);\r\ncolor([1,0,0])\r\nwritesphere(\"Hello World\",[0,0,0],20,t=1,h=6);\r\n*\/\r\n\/* writecube test\r\ntranslate([30,30,30])\r\ncube([10,15,30],center=true);\r\nwrite(\"hello\",center=true,rotate =30);\r\ncolor([1,0,0])\r\nwritecube( \"front\",[30,30,30],[10,15,30],h=5,rotate=-90);\r\ncolor([0,1,0])\r\nwritecube( \"back\",[30,30,30],size=[10,15,30],h=5,face=\"back\",rotate=90,t=4);\r\ncolor([0,0,1])\r\nwritecube( \"left\",[30,30,30],[10,15,30],h=5,face=\"left\",up=5);\r\ncolor([1,1,0])\r\nwritecube( \"right\",where=[30,30,30],size=[10,15,30],h=5,face=\"right\",rotate=55);\r\ncolor([1,0,1])\r\nwritecube( \"top\",where=[30,30,30],size=[10,15,30],h=5,face=\"top\");\r\ncolor([1,1,1])\r\nwritecube( \"bttm\",where=[30,30,30],size=[10,15,30],h=5,face=\"bottom\",rotate=90);\r\n*\/\r\n\r\n","old_contents":"\/* \tVersion 3\r\n\tAdded support for font selection (default is Letters.dxf)\r\n\tAdded WriteCube module\r\n\tAdded Rotate for text (rotates on the plane of the text)\r\n\tAdded writesphere\r\n\tAdded space= (spacing between characters in char widths) def=1\r\n\tAdded writecylinder()\r\n\r\n By Harlan Martin\r\n harlan@sutlog.com\r\n January 2012\r\n\r\n (The file TestWrite.scad gives More usage examples)\r\n (This module requires the file Letters.dxf to reside in the same folder)\r\n (The file Letters.dfx was created with inkscape..Each letter is in its own layer)\r\n (This module seperates each letter in the string and imports it from Letters.dfx)\r\n \r\n*\/\r\n\r\n\tpi=3.1415926535897932384626433832795028841971693993751058209;\r\n\tpi2=pi*2;\r\n\r\n\r\n\/\/ These control the default values for write() writesphere() writecube()\r\n\/\/ if the parameters are not included in the call. Feel free to set your own\r\n\/\/ defaults.\r\n\r\n\/\/default settings\r\n\tcenter=false;\r\n\th = 4;\t\t\t \/\/mm letter height\r\n\tt = 1; \t\t\t\/\/mm letter thickness\r\n\tspace =1; \t\t\t\/\/extra space between characters in (character widths)\r\n\trotate=0;\t\t\t\/\/ text rotation (clockwise)\r\n\tfont = \"Letters.dxf\";\t\/\/default for aditional fonts\r\n\r\n\r\n\/\/ write cube defaults\r\n\tface = \"front\";\t \/\/ default face (top,bottom,left,right,back,front)\r\n\tup =0;\t\t \/\/mm up from center on face of cube\r\n\tdown=0;\r\n\tright =0;\t\t \/\/mm left from center on face of cube\r\n\tleft=0;\t\t\r\n\t\r\n\r\n\/\/ write sphere defaults\r\n\trounded=false;\t \/\/default for rounded letters on writesphere\r\n\tnorth=0; \t\t\/\/ intial text position (I suggest leave these 0 defaults)\r\n\tsouth=0;\r\n\teast=0;\r\n\twest=0;\r\n\tspin=0;\r\n\/\/ writecylinder defaults\r\n\tmiddle=0; \/\/(mm toward middle of circle)\r\n\tccw=false; \/\/write on top or bottom in a ccw direction\r\n \tr1=0; \t\/\/(not implimented yet)\r\n\tr2=0;\t \t\/\/(not implimented yet)\r\n\t\r\n\r\n\r\n\/\/ Contact me if your interested in how to make your own font files\r\n\/\/ Its tedious and time consuming, but not very hard\r\n\r\n\r\nmodule writecylinder(text,where,radius,height){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2; \r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360;\r\n\t\/\/angle of half width of text\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\r\n\t\r\n\tif ((face==\"top\")||(face==\"bottom\") ){\r\n\t\tif (face==\"top\" ){\r\n\t\t\tif (center==true){\r\n\t\t\t\twritecircle(text,where+[0,0,height\/2],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}else{\r\n\t\t\t\twritecircle(text,where+[0,0,height],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\trotate(180,[1,0,0])\r\n\t\t\tif (center==true){\r\n\t\t\t\twritecircle(text,where+[0,0,height\/2],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}else{\r\n\t\t\t\twritecircle(text,where+[0,0,0],radius-h,rotate=rotate,font=font,h=h,t=t,\r\n\t\t\t\tspace=space,east=east,west=west,middle=middle,ccw=ccw);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t}else{\r\n\/\/\t\tif (radius>0){\r\n\t\t\tif (center==true) {\r\n\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\t\t\t\ttranslate(where)\r\n\t\t\t\twritethecylinder(text,where,radius,height,r1=radius,r2=radius,h=h,\r\n\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\t\t\t} else{\r\n\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\t\t\t\ttranslate(where+[0,0,height\/2])\r\n\t\t\t\t\twritethecylinder(text,where,radius,height,r1=radius,r2=radius,h=h,\r\n\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\t\t\t}\r\n\/\/ the remarked out code is for cone shaped cylinders (not complete)\r\n\/\/\t\t}else{\r\n\/\/\t\t\tif (center==true) {\r\n\/\/\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\/\/\t\t\t\ttranslate(where)\r\n\/\/\t\t\t\twritethecylinder(text,where,radius,height,r1=r1,r2=r2,h=h,\r\n\/\/\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\/\/\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\/\/\t\t\t} else{\r\n\/\/\t\t\t\trotate(-mmangle(radius)*(1-abs(rotate)\/90),[0,0,1])\r\n\/\/\t\t\t\ttranslate(where+[0,0,height\/2])\r\n\/\/\t\t\t\t\twritethecylinder(text,where,radius,height,r1=r1,r2=r2,h=h,\r\n\/\/\t\t\t\t\trotate=rotate,t=t,font=font,face=face,up=up,down=down,\r\n\/\/\t\t\t\t\teast=east,west=west,center=center,space=space,rounded=rounded);\r\n\/\/\t\t\t}\r\n\/\/\t\t}\r\n\t}\r\n}\r\nmodule writecircle(text,where,radius){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2;\r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360;\r\n\t\/\/angle of half width of text\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\t\r\n\t\r\n\tif (ccw==true){\r\n\t\trotate(-rotate+east-west,[0,0,1]){\r\n\t\t\trotate(-mmangle(radius-middle),[0,0,1]){\r\n\t\t\ttranslate(where)\r\n\t\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\t\trotate(-90+r*NAngle(radius-middle),[0,0,1]) \/\/ bottom out=-270+r \r\n\t\t\t\t\ttranslate([radius-middle,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[1,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[0,1,0])\r\n\t\t\t\t\trotate(-270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\t\t\t\twrite(text[r],center=true,h=h,t=t,font=font);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\trotate(-rotate-east+west,[0,0,1]){\r\n\t\t\trotate(mmangle(radius-middle),[0,0,1]){\r\n\t\t\ttranslate(where)\r\n\t\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\t\trotate(90-r*NAngle(radius-middle),[0,0,1]) \/\/ bottom out=-270+r \r\n\t\t\t\t\ttranslate([radius-middle,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[1,0,0])\r\n\t\t\t\t\t\/\/rotate(90,[0,1,0])\r\n\t\t\t\t\trotate(270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\t\t\t\twrite(text[r],center=true,h=h,t=t,font=font);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}\r\n\r\n}\r\nmodule writethecylinder(text,where,radius,height,r1,r2){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2; \r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360*(1-abs(rotate)\/90);\r\n\t\/\/angle of half width of text\r\n\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\r\n\t\t\ttranslate([0,0,up-down])\r\n\t\t\trotate(east-west,[0,0,1])\r\n\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\trotate(-90+(r*NAngle(radius)),[0,0,1])\r\n\t\t\t\ttranslate([radius,0,-r*((rotate)\/90*wid)+(len(text)-1)\/2*((rotate)\/90*wid)])\r\n\t\t\t\trotate(90,[1,0,0])\r\n\t\t\t\trotate(90,[0,1,0])\r\n\t\t\t\twrite(text[r],center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t\/\/echo(\"zloc=\",height\/2-r*((rotate)\/90*wid)+(len(text)-1)\/2*((rotate)\/90*wid));\r\n\t\t\t}\r\n\r\n}\r\n\r\n\r\nmodule writesphere(text,where,radius){\r\n\twid=(.125* h *5.5 * space);\r\n\twidall=wid*(len(text)-1)\/2;\r\n\t\r\n\techo(\"-----------------\",widall,wid,mmangle(radius));\r\n\t\/\/angle that measures width of letters on sphere\r\n\tfunction NAngle(radius)=(wid\/(pi2*radius))*360;\r\n\t\/\/angle of half width of text\r\n\tfunction mmangle(radius)=(widall\/(pi2*radius)*360);\t\r\n\r\n\trotate(east-west,[0,0,1]){\r\n\trotate(south-north,[1,0,0]){\r\n\trotate(spin,[0,1,0]){\r\n\trotate(-mmangle(radius),[0,0,1]){\r\n\t\tif ( rounded== false ){\r\n\t\t\ttranslate(where)\r\n\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\trotate(-90+r*NAngle(radius),[0,0,1])\r\n\t\t\t\ttranslate([radius,0,0])\r\n\t\t\t\trotate(90,[1,0,0])\r\n\t\t\t\trotate(90,[0,1,0])\r\n\t\t\t\twrite(text[r],center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tdifference(){\r\n\t\t\t\ttranslate(where)\r\n\t\t\t\tfor (r=[0:len(text)-1]){\r\n\t\t\t\t\trotate(-90+r*NAngle(radius),[0,0,1])\r\n\t\t\t\t\ttranslate([radius,0,0])\r\n\t\t\t\t\trotate(90,[1,0,0])\r\n\t\t\t\t\trotate(90,[0,1,0])\r\n\t\t\t\t\twrite(text[r],center=true,h=h,rotate=rotate,t=t*2+h,font=font);\r\n\t\t\t\t}\r\n\t\t\t\tdifference(){ \/\/rounded outside\r\n\t\t\t\t\tsphere(radius+(t*2+h)*2);\r\n\t\t\t\t\tsphere(radius+t\/2);\r\n\t\t\t\t}\r\n\t\t\t\tsphere(radius-t\/2); \/\/ rounded inside for indented text\r\n\t\t\t} \r\n\t\t}\r\n\t}\r\n}}}\r\n}\r\n\r\n\r\nmodule writecube(text,where,size){\r\n\tif (str(size)[0] != \"[\"){ \r\n\t\t\/\/ its a square cube (size was not a matrix so make it one)\r\n\t\twritethecube(text,where,[size,size,size],h=h,rotate=rotate,space=space,\r\n\t\tt=t,font=font,face=face,up=up,down=down,right=right,left=left);\r\n\r\n\t}else{\r\n\t\t\/\/ its not square\r\n\t\twritethecube(text,where,size,h=h,rotate=rotate,space=space,\r\n\t\tt=t,font=font,face=face,up=up,down=down,right=right,left=left);\r\n\t}\r\n}\r\n\/\/ I split the writecube module into 2 pieces.. easier to add features later\r\nmodule writethecube(text,where,size){\r\n\t\tif (face==\"front\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]-size[1]\/2,where[2]+up-down])\r\n\t\t\trotate(90,[1,0,0])\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"back\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]+size[1]\/2,where[2]+up-down])\r\n\t\t\trotate(90,[1,0,0]) \/\/ rotate around the x axis\r\n\t\t\trotate(180,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"left\") {\r\n\t\t\ttranslate([where[0]-size[0]\/2,where[1]-right+left,where[2]+up-down ])\r\n\t\t\trotate(90,[1,0,0]) \/\/ rotate around the x axis\r\n\t\t\trotate(90,[0,-1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"right\") {\r\n\t\t\ttranslate([where[0]+size[0]\/2,where[1]+right-left,where[2] +up-down])\r\n\t\t\trotate(90,[1,0,0]) \/\/ rotate around the x axis\r\n\t\t\trotate(90,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"top\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]+up-down,where[2]+size[2]\/2 ])\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n\t\tif (face==\"bottom\") {\r\n\t\t\ttranslate([where[0]+right-left,where[1]-up+down,where[2]-size[2]\/2 ])\r\n\t\t\trotate(180,[1,0,0])\r\n\t\t\twrite(text,center=true,h=h,rotate=rotate,t=t,font=font);\r\n\t\t}\r\n}\r\n\r\nmodule write(word){\r\n\t\r\n\techo (h);\r\n\techo (word);\r\n\techo (\"There are \" ,len(word) ,\" letters in this string\");\r\n\/\/\techo (\"The second letter is \",word[1]);\r\n\/\/\techo (str(word[0],\"_\"));\r\nrotate(rotate,[0,0,-1]){\r\n\tfor (r = [0:len(word)]){ \/\/ count off each character\r\n\t\t\/\/ if the letter is lower case, add an underscore to the end for file lookup\r\n\t\tif ((word[r] == \"a\" ) || (word[r]== \"b\") || (word[r]== \"c\") \r\n\t \t || (word[r]== \"d\") || (word[r]== \"e\") || (word[r]== \"f\") \r\n\t \t || (word[r]== \"g\") || (word[r]== \"h\") || (word[r]== \"i\") \r\n \t \t || (word[r]== \"j\") || (word[r]== \"k\") || (word[r]== \"l\")\r\n \t \t || (word[r]== \"m\") || (word[r]== \"n\") || (word[r]== \"o\") \r\n \t \t || (word[r]== \"p\") || (word[r]== \"q\") || (word[r]== \"r\") \r\n\t \t || (word[r]== \"s\") || (word[r]== \"t\") || (word[r]== \"u\") \r\n \t \t || (word[r]== \"v\") || (word[r]== \"w\") || (word[r]== \"x\") \r\n \t \t || (word[r]== \"y\" )|| (word[r]== \"z\")){\r\n\t\t\tif (center == true) {\r\n\t\t\t\ttranslate([0,-h\/2,0]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\t\r\n\t\t\t\t\t\ttranslate([ (-len(word)*5.5*space\/2) + (r*5.5*space),0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r],\"_\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\ttranslate([0,0,t\/2]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\t\r\n\t\t\t\t\t\ttranslate([r*5.5*space,0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r],\"_\"));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\t\t\tif (center == true) {\r\n\t\t\t\ttranslate([0,-h\/2,0]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\r\n\t\t\t\t\t\ttranslate([ (-len(word)*5.5*space\/2) + (r*5.5*space),0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r]));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\ttranslate([0,0,t\/2]){\r\n\t\t\t\t\tscale([.125*h,.125*h,t]){\r\n\t\t\t\t\t\ttranslate([r*5.5*space,0,0])\r\n\t\t\t\t\t\tlinear_extrude(height=1,convexity=10,center=true){\r\n\t\t\t\t\t\t\timport(file = font,layer=str(word[r]));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n}\r\n\r\n\/*writecylinder test\r\ntranslate([0,0,0])\r\n%cylinder(r=20,h=40,center=true);\r\ncolor([1,0,0])\r\nwritecylinder(\"rotate=90\",[0,0,0],20,40,center=true,down=0,rotate=90);\r\nwritecylinder(\"rotate = 30,east = 90\",[0,0,0],20,40,center=true,down=0,rotate=30,east=90);\r\nwritecylinder(\"ccw = true\",[0,0,0],20,40,center=true,down=0,face=\"top\",ccw=true);\r\nwritecylinder(\"middle = 8\",[0,0,0],20,40,h=3,center=true,down=0,face=\"top\",middle=8);\r\nwritecylinder(\"face = top\",[0,0,0],20,40,center=true,down=0,face=\"top\");\r\nwritecylinder(\"east=90\",[0,0,0],20,40,h=3,center=true,down=0,face=\"top\",east=90);\r\nwritecylinder(\"west=90\",[0,0,0],20,40,h=3,center=true,down=0,face=\"top\",ccw=true,west=90);\r\nwritecylinder(\"face = bottom\",[0,0,0],20,40,center=true,down=0,face=\"bottom\"); \r\n*\/\r\n\/*writesphere test\r\nsphere(20);\r\ncolor([1,0,0])\r\nwritesphere(\"Hello World\",[0,0,0],20,t=1,h=6);\r\n*\/\r\n\/* writecube test\r\ntranslate([30,30,30])\r\ncube([10,15,30],center=true);\r\nwrite(\"hello\",center=true,rotate =30);\r\ncolor([1,0,0])\r\nwritecube( \"front\",[30,30,30],[10,15,30],h=5,rotate=-90);\r\ncolor([0,1,0])\r\nwritecube( \"back\",[30,30,30],size=[10,15,30],h=5,face=\"back\",rotate=90,t=4);\r\ncolor([0,0,1])\r\nwritecube( \"left\",[30,30,30],[10,15,30],h=5,face=\"left\",up=5);\r\ncolor([1,1,0])\r\nwritecube( \"right\",where=[30,30,30],size=[10,15,30],h=5,face=\"right\",rotate=55);\r\ncolor([1,0,1])\r\nwritecube( \"top\",where=[30,30,30],size=[10,15,30],h=5,face=\"top\");\r\ncolor([1,1,1])\r\nwritecube( \"bttm\",where=[30,30,30],size=[10,15,30],h=5,face=\"bottom\",rotate=90);\r\n*\/\r\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"eb45dc78b50dd25a9554f1cf16aa2502f8cfa209","subject":"xcarriage: tweak beltpaths","message":"xcarriage: tweak beltpaths\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a746ad339203b5ef66b4787f8f6dcec287ff2416","subject":"x-carriage: tweaks","message":"x-carriage: tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = 20*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_filapath_offset = [0, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\n\/*explode=[0,0,0];*\/\nexplode=[0,10,0];\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = 20*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_filapath_offset = [0, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 0;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,17*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"836a7821c8213bf2099b832579f6937f3be954ad","subject":"xaxis\/carriage: wip","message":"xaxis\/carriage: wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = 20*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_filapath_offset = [0, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 0;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,17*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"49beea655085bd9880d41abcb5066acf31634398","subject":"x\/carriage: move pulley position","message":"x\/carriage: move pulley position\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 5*mm, 0])\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=x==1);\n \/*xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);*\/\n }\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = -15*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 5*mm, 0])\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=x==1);\n \/*xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);*\/\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"407d24724c062401bd023f1d89ae0ea14d5c2b0e","subject":"added side2","message":"added side2\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/tank.scad","new_file":"resin\/tank\/tank.scad","new_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h], center=true);\n}\n\nmodule side1(width, height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n support_width = 2;\n color([1,0.1,0.0,0.75])\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_width - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side2(width, height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.1,0.0,0.75])\n difference() {\n side1(width, height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\ndepth = 80;\nglass_thickness = 4;\nwall_thickness = 3;\ncut_depth = 1;\n\n\/\/glass(width, depth, glass_thickness);\n\/\/rotate([90,00,0])\n side2(width, 30, wall_thickness, cut_depth, glass_thickness);","old_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h], center=true);\n}\n\nmodule side1(side, wall_thickness, cut_depth, glass_thickness) {\n depth = 30;\n gap_width = side + 2;\n support_width = 2;\n color([1,0.1,0.0,0.75])\n difference() {\n cube([side,depth,wall_thickness], center=true);\n translate([\n -1,\n depth \/ 2 - support_width - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\ndepth = 80;\nglass_thickness = 4;\nwall_thickness = 3;\ncut_depth = 1;\n\n\/\/glass(width, depth, glass_thickness);\n\/\/rotate([90,00,0])\n side1(width, wall_thickness, cut_depth, glass_thickness);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ae7a367a93672dc087dd6a75620e1e1fe7e4a2e0","subject":"rod_clamps: use button head screws","message":"rod_clamps: use button head screws\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","old_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"37a4c6dad9d717154d06d7adb6028b3a81b77c51","subject":"xaxis\/ends: use screw_cut for motor mount","message":"xaxis\/ends: use screw_cut for motor mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1]+1*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\n\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n translate([0,1*mm,0])\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-1*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n translate([0,-1,0])\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*debug=false;*\/\n\/*[>debug=true;<]*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*\/\/ x smooth rods*\/\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*(xaxis_rod_distance\/2)])*\/\n \/*%fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);*\/\n\n \/*xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n\n \/*translate([150,0,0])*\/\n \/*{*\/\n \/*xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n \/*xaxis_end_idlerholder();*\/\n \/*}*\/\n\/*}*\/\n\n\/*print=false;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \n\nmotor_mount_wall_thick = xaxis_pulley[1]+1*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\n\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n translate([0,1*mm,0])\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-1*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, .1, z*screw_dist\/2])\n {\n \/\/ screw\n translate([0,1,0])\n fncylindera(d=lookup(ThreadSize, xaxis_motor_thread), h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ screw head\n translate([0,-motor_mount_wall_thick,0])\n fncylindera(d=lookup(ThreadSize, xaxis_motor_thread)*1.9, h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n translate([0,-1,0])\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*debug=false;*\/\n\/*[>debug=true;<]*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*\/\/ x smooth rods*\/\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*(xaxis_rod_distance\/2)])*\/\n \/*%fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);*\/\n\n \/*xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n\n \/*translate([150,0,0])*\/\n \/*{*\/\n \/*xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n \/*xaxis_end_idlerholder();*\/\n \/*}*\/\n\/*}*\/\n\n\/*print=false;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a5859e3d68c996bd119bf6e6c2d8ae1203359fdb","subject":"x\/carriage: fix warning","message":"x\/carriage: fix warning\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e8f0932d21ccbf7d176bd3fae709db4107600fcb","subject":"x\/carriage: fix hotend cut","message":"x\/carriage: fix hotend cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n\n ty(-hotend_clamp_offset)\n tz(hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[1], hotend_d_h[1][0], hotend_clamp_height], align=Y);\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2+.1])\n rcubea([hotend_clamp_w[1], 1000, hotend_clamp_height+.2], align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part);\n hotend_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n\n ty(-hotend_clamp_offset)\n tz(hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[1], hotend_d_h[1][0], hotend_clamp_height], align=Y);\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2+.1])\n rcubea([hotend_clamp_w[1], 1000, hotend_clamp_height+.2], align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part);\n hotend_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"39de411269b61c21c8720b94334344f2ce9f7107","subject":"x\/carriage\/extruder: tweaks to big gear","message":"x\/carriage\/extruder: tweaks to big gear\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1.5*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e57e295e07c79e7dec57b2adb0b9ee4d410275fa","subject":"rod-clamps: Simplify and comment","message":"rod-clamps: Simplify and comment\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n \/\/ cylinder around rod\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n \/\/ cylinder around rod\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n translate([-rod_d\/2,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([-rod_d\/2,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\/*mount_rod_clamp_full(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n","old_contents":"include \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n translate([-rod_d\/2,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n translate([-rod_d\/2,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\/*mount_rod_clamp_full(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"55dd196910a075bfed1023c8296bd9101570f380","subject":"extruder\/b+c: fix hotend mount cut","message":"extruder\/b+c: fix hotend mount cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(2*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ed963870c5229195bef022a49807f24afc83553c","subject":"Create MountPlate.scad","message":"Create MountPlate.scad","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"MountPlate.scad","new_file":"MountPlate.scad","new_contents":"\/*\nMount plate for CoreXY top profile\n*\/\nmodule MountPlate (){\ndifference (){\n color( \"DarkGray\", 1 ) {\n translate ([1,1,0]) {\n cube ([80,80,2]) ; \n } \n }\n translate ([81,1,-1]) {\n rotate ([0,0,45]) {\n cube ([160,160,4]) ; \n }}\n translate ([60,0,-1]) {\n cube ([60,60,4]) ; \n }\n translate ([0,60,-1]) {\n cube ([60,60,4]) ; \n }\n }\n \n \n\n\n translate ([10,10,5]){\n rotate ([180,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n }\n \n }}\n translate ([30,10,5]){\n rotate ([180,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n }\n \n }}\n translate ([50,10,5]){\n rotate ([180,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n }\n \n }}\n translate ([10,30,5]){\n rotate ([180,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n }\n \n }}\n translate ([10,50,5]){\n rotate ([180,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n }\n \n }}\n}\n\n\n\ntranslate ([0,20,410]) {\n rotate ([270,0,0]) {\nMountPlate ();\n }}\ntranslate ([440,20,410]) {\n rotate ([270,90,0]) {\nMountPlate ();\n }} \n \ntranslate ([0,320,410]) {\n rotate ([90,90,0]) {\nMountPlate ();\n }}\n translate ([440,320,410]) {\n rotate ([270,90,0]) {\nMountPlate ();\n }}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'MountPlate.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0dc9b6a50d0e4c94579fc65fc342a42533840086","subject":"A xyLength parameter was separated into two separate variables.","message":"A xyLength parameter was separated into two separate variables.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/water-pump-filter.scad","new_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/water-pump-filter.scad","new_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule waterPumpFilter(baseHeight = 30,\n\t\t\t\t\t innerRadius = 25)\n{\n\tunion()\n\t{\n\t\tzTranslate = baseHeight \/ 2.0;\n\t\ttranslate([0,0, zTranslate-0.1])\n\t\twaterPumpFilter_connector(innerRadius = innerRadius);\n\n\t\txyLength = (innerRadius * 2) + 4;\n\t\twaterPumpFilter_base(height = baseHeight,\n\t\t\t\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t\t\t\t xLength = xyLength,\n\t\t\t\t\t\t\t yLength = xyLength);\n\t}\n}\n\nmodule waterPumpFilter_connector(innerRadius)\n{\n\topenCylinder(height = 5,\n\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t outerRadius = innerRadius + 2);\n}\n\nmodule waterPumpFilter_base(height,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinnerRadius,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\txLength,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tyLength)\n{\n\tdifference()\n\t{\n\t\t\/\/ this is the outer cube\n\t\tcube([xLength, yLength, height], center = true);\n\n\t\tcolor(\"pink\")\n\t\ttranslate([0,0,10])\n\t\tcylinder(r=innerRadius, h=30, center=true);\n\n\t\tinnerCubeDifference = 4;\n\t\tcolor(\"green\")\n\t\twaterPumpFilter_base_innerCube(xLength - innerCubeDifference, height - innerCubeDifference);\n\n\t\tcutoutHeight = height - 4;\n\n\t\twaterPumpFilter_xCutouts(height = cutoutHeight);\n\n\t\twaterPumpFilter_yCutouts(height = cutoutHeight);\n\t}\n}\n\nmodule waterPumpFilter_base_innerCube(xyLength, height)\n{\n\tcube([xyLength, xyLength, height], center = true);\n}\n\nmodule waterPumpFilter_xCutouts(height)\n{\n\tstep = 5;\n\n\tfor(x = [-20 : step : 20])\n\t{\n\t\ttranslate([x, 0, 0])\n\t\tcube([2, 100, height], center = true);\n\t}\n}\n\nmodule waterPumpFilter_yCutouts(height)\n{\n\tstep = 5;\n\n\tfor(y = [-20 : step : 20])\n\t{\n\t\ttranslate([0, y, 0])\n\t\tcube([100, 2, height], center = true);\n\t}\n}\n","old_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule waterPumpFilter(baseHeight = 30,\n\t\t\t\t\t innerRadius = 25)\n{\n\tunion()\n\t{\n\t\tzTranslate = baseHeight \/ 2.0;\n\t\ttranslate([0,0, zTranslate-0.1])\n\t\twaterPumpFilter_connector(innerRadius = innerRadius);\n\n\t\txyLength = (innerRadius * 2) + 4;\n\t\twaterPumpFilter_base(height = baseHeight,\n\t\t\t\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t\t\t\t xyLength = xyLength);\n\t}\n}\n\nmodule waterPumpFilter_connector(innerRadius)\n{\n\topenCylinder(height = 5,\n\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t outerRadius = innerRadius + 2);\n}\n\nmodule waterPumpFilter_base(height, innerRadius, xyLength)\n{\n\tdifference()\n\t{\n\t\t\/\/ this is the outer cube\n\t\tcube([xyLength, xyLength, height], center = true);\n\n\t\tcolor(\"pink\")\n\t\ttranslate([0,0,10])\n\t\tcylinder(r=innerRadius, h=30, center=true);\n\n\t\tinnerCubeDifference = 4;\n\t\tcolor(\"green\")\n\t\twaterPumpFilter_base_innerCube(xyLength - innerCubeDifference, height - innerCubeDifference);\n\/\/\t\twaterPumpFilter_base_innerCube(xyLength-2, height-2);\n\n\t\tcutoutHeight = height - 4;\n\n\t\twaterPumpFilter_xCutouts(height = cutoutHeight);\n\n\t\twaterPumpFilter_yCutouts(height = cutoutHeight);\n\t}\n}\n\nmodule waterPumpFilter_base_innerCube(xyLength, height)\n\/\/module waterPumpFilter_base_innerCube(xyLength, height)\n{\n\tcube([xyLength, xyLength, height], center = true);\n}\n\nmodule waterPumpFilter_xCutouts(height)\n{\n\tstep = 5;\n\n\tfor(x = [-20 : step : 20])\n\t{\n\t\ttranslate([x, 0, 0])\n\t\tcube([2, 100, height], center = true);\n\t}\n}\n\nmodule waterPumpFilter_yCutouts(height)\n{\n\tstep = 5;\n\n\tfor(y = [-20 : step : 20])\n\t{\n\t\ttranslate([0, y, 0])\n\t\tcube([100, 2, height], center = true);\n\t}\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"39384007bae4af8481e4149b9b83634da44c5004","subject":"transforms: fix mx\/my\/mz","message":"transforms: fix mx\/my\/mz\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(X*(m?1:0))\n children();\n}\n\nmodule my(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(Y*(m?1:0))\n children();\n}\n\nmodule mz(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(Z*(m?1:0))\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule spread(axis=N, dist=0, iter=[-1,1])\n{\n assert(is_list(axis));\n assert(is_num(dist));\n assert(is_list(iter));\n\n for(i=iter)\n translate(i*axis*dist)\n children();\n}\n\nmodule spreadx(dist=0)\n{\n spread(axis=X,dist=dist)\n children();\n}\n\nmodule spready(dist=0)\n{\n spread(axis=Y,dist=dist)\n children();\n}\n\nmodule spreadz(dist=0)\n{\n spread(axis=Z,dist=dist)\n children();\n}\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(is_bool(m));\n mirror(X*m)\n children();\n}\n\nmodule my(m=true)\n{\n assert(is_bool(m));\n mirror(Y*m)\n children();\n}\n\nmodule mz(m=true)\n{\n assert(is_bool(m));\n mirror(Z*m)\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule spread(axis=N, dist=0, iter=[-1,1])\n{\n assert(is_list(axis));\n assert(is_num(dist));\n assert(is_list(iter));\n\n for(i=iter)\n translate(i*axis*dist)\n children();\n}\n\nmodule spreadx(dist=0)\n{\n spread(axis=X,dist=dist)\n children();\n}\n\nmodule spready(dist=0)\n{\n spread(axis=Y,dist=dist)\n children();\n}\n\nmodule spreadz(dist=0)\n{\n spread(axis=Z,dist=dist)\n children();\n}\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"01bc383c9a734e7426782bf94564da2fd43d4214","subject":"dimentions tunned to match brush's hole","message":"dimentions tunned to match brush's hole\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"braun_oral_b_brush_holder\/brush_holder.scad","new_file":"braun_oral_b_brush_holder\/brush_holder.scad","new_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([0, 7, size[2]-6])\n cube([size[0], size[1]-7, 6]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [3,25,18]);\nholder([-20\/2-1,-1,2], [3,25,18]);\n","old_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([0, 7, size[2]-6])\n cube([size[0], size[1]-7, 6]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [4,25,18]);\nholder([-20\/2-1,-1,2], [4,25,18]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5a023c4f235350d1de0d62283529512d81e39444","subject":"Colour and extrude PCB board","message":"Colour and extrude PCB board","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ProMicro.scad","new_file":"hardware\/vitamins\/ProMicro.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro(type = \"mini\") {\n color([26\/255, 90\/255, 160\/255])\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro(type = \"mini\") {\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5c5ec5ae3d02f7d80c97330478965c40626657ee","subject":"x\/carriage: decrease a\/b extruder rod cutout clearance","message":"x\/carriage: decrease a\/b extruder rod cutout clearance\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n ty(xaxis_carriage_beltpath_offset_y)\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n ty(xaxis_carriage_beltpath_offset_y)\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7cc9aa282feae9c0808d0a8e08667a33af9f6756","subject":"Fix issue with strings in vadd(), vsub(), vmin(), vmax(), vpow(), vabs(), vsign()","message":"Fix issue with strings in vadd(), vsub(), vmin(), vmax(), vpow(), vabs(), vsign()\n","repos":"jsconan\/camelSCAD","old_file":"core\/vector.scad","new_file":"core\/vector.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Operations on vectors.\r\n *\r\n * @package core\/vector\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Adds a value on each elements of a vector.\r\n *\r\n * @param Vector v - The vector to add.\r\n * @param Number value - The value to add.\r\n * @returns Vector\r\n *\/\r\nfunction vadd(v, value) =\r\n len(v) ? (\r\n let(\r\n v = array(v),\r\n value = float(value)\r\n )\r\n [ for (i = v) float(i) + value ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Subtracts a value from each elements of a vector.\r\n *\r\n * @param Vector v - The vector to subtract.\r\n * @param Number value - The value to subtract.\r\n * @returns Vector\r\n *\/\r\nfunction vsub(v, value) =\r\n len(v) ? (\r\n let(\r\n v = array(v),\r\n value = float(value)\r\n )\r\n [ for (i = v) float(i) - value ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Multiplies two vectors, elements by elements.\r\n *\r\n * @param Vector a - The first vector to multiply.\r\n * @param Vector b - The second vector to multiply.\r\n * @returns Vector\r\n *\/\r\nfunction vmul(a, b) =\r\n let(\r\n lenA = len(a),\r\n lenB = len(b)\r\n )\r\n lenA && lenB ? [\r\n for (i = [0 : max(lenA, lenB) - 1])\r\n float(a[i]) * float(b[i])\r\n ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Divides two vectors, elements by elements.\r\n *\r\n * @param Vector a - The vector to divide.\r\n * @param Vector b - The vector that will divide.\r\n * @returns Vector\r\n *\/\r\nfunction vdiv(a, b) =\r\n let(\r\n lenA = len(a),\r\n lenB = len(b)\r\n )\r\n lenA && lenB ? [\r\n for (i = [0 : max(lenA, lenB) - 1])\r\n float(a[i]) \/ divisor(b[i])\r\n ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Compares each elements of a vector with a value and keep the smallest.\r\n *\r\n * @param Vector v - The vector to check.\r\n * @param Number value - The minimum value.\r\n * @returns Vector\r\n *\/\r\nfunction vmin(v, value) =\r\n len(v) ? (\r\n let(\r\n v = array(v),\r\n value = float(value)\r\n )\r\n [ for (i = v) min(float(i), value) ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Compares each elements of a vector with a value and keep the biggest.\r\n *\r\n * @param Vector v - The vector to check.\r\n * @param Number value - The maximum value.\r\n * @returns Vector\r\n *\/\r\nfunction vmax(v, value) =\r\n len(v) ? (\r\n let(\r\n v = array(v),\r\n value = float(value)\r\n )\r\n [ for (i = v) max(float(i), value) ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Computes the power of each vector elements.\r\n *\r\n * @param Vector v - The vector to power.\r\n * @param Number [power] - The power value.\r\n * @returns Vector\r\n *\/\r\nfunction vpow(v, power=2) =\r\n len(v) ? (\r\n let(\r\n v = array(v),\r\n power = float(power)\r\n )\r\n [ for (i = v) pow(float(i), power) ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Computes the absolute value of each vector elements.\r\n *\r\n * @param Vector v - The vector to absolute.\r\n * @returns Vector\r\n *\/\r\nfunction vabs(v) =\r\n len(v) ? (\r\n let( v = array(v) )\r\n [ for (i = v) abs(float(i)) ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Computes the sign of each vector elements.\r\n *\r\n * @param Vector v - The vector to sign.\r\n * @returns Vector\r\n *\/\r\nfunction vsign(v) =\r\n len(v) ? (\r\n let( v = array(v) )\r\n [ for (i = v) float(sign(i)) ]\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Computes the sum of all elements from a vector.\r\n *\r\n * @param Vector v - The vector to sum.\r\n * @returns Number\r\n *\/\r\nfunction vsum(v,\r\n \/\/ internal\r\n p, l) =\r\n let(\r\n p = float(p),\r\n l = numberOr(l, float(len(v)))\r\n )\r\n l <= 4 ? (\r\n l <= 1 ? float(v[p])\r\n :float(v[p]) + float(v[p + 1]) + (\r\n l > 2 ? float(v[p + 2]) + (\r\n l > 3 ? float(v[p + 3]) : 0\r\n ) : 0\r\n )\r\n )\r\n :let(\r\n half = floor(l \/ 2)\r\n )\r\n vsum(v, p, half) + vsum(v, p + half, l - half)\r\n;\r\n\r\n\/**\r\n * Computes the average of all elements in a vector.\r\n *\r\n * @param Vector v - The vector to average.\r\n * @returns Number\r\n *\/\r\nfunction vaverage(v) =\r\n let( count = len(v) )\r\n count ? vsum(v) \/ count\r\n : 0\r\n;\r\n\r\n\/**\r\n * Computes the factorial of N and put the result of each iterations in a vector.\r\n *\r\n * @param Number n\r\n * @returns Vector\r\n *\/\r\nfunction vfactorial(n,\r\n \/\/ internal\r\n i=0, fact=1) =\r\n let(\r\n isnum = isNumber(n),\r\n n = isnum ? n : 0,\r\n fact = fact * or(i, 1)\r\n )\r\n !isnum || i > n ? [] : concat([fact], vfactorial(n, i + 1, fact))\r\n;\r\n\r\n\/**\r\n * Converts each vector elements in positive or negative factors.\r\n * Strictly positive values will be replaced by 1, while other values will be replaced by -1.\r\n *\r\n * @param Vector v - The vector to convert.\r\n * @returns Vector\r\n *\/\r\nfunction vfactor(v) =\r\n !isArray(v) ? (v ? 1 : -1)\r\n :len(v) == 0 ? v\r\n :[ for (b = v) b ? 1 : -1 ]\r\n;\r\n\r\n\/**\r\n * Converts each elements of an array into boolean values.\r\n *\r\n * @param Array - The array to convert.\r\n * @param Boolean bool - Whether or not use true boolean values instead of O and 1.\r\n * @returns Array\r\n *\/\r\nfunction vboolean(a, bool) =\r\n let(\r\n t = bool ? true : 1,\r\n f = bool ? false : 0\r\n )\r\n !isArray(a) ? (a ? t : f)\r\n :len(a) == 0 ? a\r\n :[ for (b = a) b ? t : f ]\r\n;\r\n\r\n\/**\r\n * Computes the angle between two vectors.\r\n *\r\n * @param Vector [a] - The first vector\r\n * @param Vector [b] - The second vector\r\n * @returns Number\r\n *\/\r\nfunction vangle(a, b) =\r\n let(\r\n a = a ? a : [0, 0, 0],\r\n b = b ? b : [0, 0, 0]\r\n )\r\n float(acos((a * b) \/ (norm(a) * norm(b))))\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Operations on vectors.\r\n *\r\n * @package core\/vector\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Adds a value on each elements of a vector.\r\n *\r\n * @param Vector v - The vector to add.\r\n * @param Number value - The value to add.\r\n * @returns Vector\r\n *\/\r\nfunction vadd(v, value) =\r\n len(v) ?\r\n let( value = float(value) )\r\n [ for (i = v) float(i) + value ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Subtracts a value from each elements of a vector.\r\n *\r\n * @param Vector v - The vector to subtract.\r\n * @param Number value - The value to subtract.\r\n * @returns Vector\r\n *\/\r\nfunction vsub(v, value) =\r\n len(v) ?\r\n let( value = float(value) )\r\n [ for (i = v) float(i) - value ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Multiplies two vectors, elements by elements.\r\n *\r\n * @param Vector a - The first vector to multiply.\r\n * @param Vector b - The second vector to multiply.\r\n * @returns Vector\r\n *\/\r\nfunction vmul(a, b) =\r\n let(\r\n lenA = len(a),\r\n lenB = len(b)\r\n )\r\n lenA && lenB ? [\r\n for (i = [0 : max(lenA, lenB) - 1])\r\n float(a[i]) * float(b[i])\r\n ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Divides two vectors, elements by elements.\r\n *\r\n * @param Vector a - The vector to divide.\r\n * @param Vector b - The vector that will divide.\r\n * @returns Vector\r\n *\/\r\nfunction vdiv(a, b) =\r\n let(\r\n lenA = len(a),\r\n lenB = len(b)\r\n )\r\n lenA && lenB ? [\r\n for (i = [0 : max(lenA, lenB) - 1])\r\n float(a[i]) \/ divisor(b[i])\r\n ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Compares each elements of a vector with a value and keep the smallest.\r\n *\r\n * @param Vector v - The vector to check.\r\n * @param Number value - The minimum value.\r\n * @returns Vector\r\n *\/\r\nfunction vmin(v, value) =\r\n len(v) ? let( value = float(value) )\r\n [ for (i = v) min(float(i), value) ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Compares each elements of a vector with a value and keep the biggest.\r\n *\r\n * @param Vector v - The vector to check.\r\n * @param Number value - The maximum value.\r\n * @returns Vector\r\n *\/\r\nfunction vmax(v, value) =\r\n len(v) ? let( value = float(value) )\r\n [ for (i = v) max(float(i), value) ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Computes the power of each vector elements.\r\n *\r\n * @param Vector v - The vector to power.\r\n * @param Number [power] - The power value.\r\n * @returns Vector\r\n *\/\r\nfunction vpow(v, power=2) =\r\n len(v) ? let( power = float(power) )\r\n [ for (i = v) pow(float(i), power) ]\r\n :[]\r\n;\r\n\r\n\/**\r\n * Computes the absolute value of each vector elements.\r\n *\r\n * @param Vector v - The vector to absolute.\r\n * @returns Vector\r\n *\/\r\nfunction vabs(v) =\r\n len(v) ? [ for (i = v) abs(float(i)) ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Computes the sign of each vector elements.\r\n *\r\n * @param Vector v - The vector to sign.\r\n * @returns Vector\r\n *\/\r\nfunction vsign(v) =\r\n len(v) ? [ for (i = v) float(sign(i)) ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Computes the sum of all elements from a vector.\r\n *\r\n * @param Vector v - The vector to sum.\r\n * @returns Number\r\n *\/\r\nfunction vsum(v,\r\n \/\/ internal\r\n p, l) =\r\n let(\r\n p = float(p),\r\n l = numberOr(l, float(len(v)))\r\n )\r\n l <= 4 ? (\r\n l <= 1 ? float(v[p])\r\n :float(v[p]) + float(v[p + 1]) + (\r\n l > 2 ? float(v[p + 2]) + (\r\n l > 3 ? float(v[p + 3]) : 0\r\n ) : 0\r\n )\r\n )\r\n :let(\n half = floor(l \/ 2)\n )\n vsum(v, p, half) + vsum(v, p + half, l - half)\r\n;\r\n\r\n\/**\r\n * Computes the average of all elements in a vector.\r\n *\r\n * @param Vector v - The vector to average.\r\n * @returns Number\r\n *\/\r\nfunction vaverage(v) =\r\n let( count = len(v) )\r\n count ? vsum(v) \/ count\r\n : 0\r\n;\r\n\r\n\/**\r\n * Computes the factorial of N and put the result of each iterations in a vector.\r\n *\r\n * @param Number n\r\n * @returns Vector\r\n *\/\r\nfunction vfactorial(n,\r\n \/\/ internal\r\n i=0, fact=1) =\r\n let(\r\n isnum = isNumber(n),\r\n n = isnum ? n : 0,\r\n fact = fact * or(i, 1)\r\n )\r\n !isnum || i > n ? [] : concat([fact], vfactorial(n, i + 1, fact))\r\n;\r\n\r\n\/**\r\n * Converts each vector elements in positive or negative factors.\r\n * Strictly positive values will be replaced by 1, while other values will be replaced by -1.\r\n *\r\n * @param Vector v - The vector to convert.\r\n * @returns Vector\r\n *\/\r\nfunction vfactor(v) =\r\n !isArray(v) ? (v ? 1 : -1)\r\n :len(v) == 0 ? v\r\n :[ for (b = v) b ? 1 : -1 ]\r\n;\r\n\r\n\/**\r\n * Converts each elements of an array into boolean values.\r\n *\r\n * @param Array - The array to convert.\r\n * @param Boolean bool - Whether or not use true boolean values instead of O and 1.\r\n * @returns Array\r\n *\/\r\nfunction vboolean(a, bool) =\r\n let(\r\n t = bool ? true : 1,\r\n f = bool ? false : 0\r\n )\r\n !isArray(a) ? (a ? t : f)\r\n :len(a) == 0 ? a\r\n :[ for (b = a) b ? t : f ]\r\n;\r\n\r\n\/**\r\n * Computes the angle between two vectors.\r\n *\r\n * @param Vector [a] - The first vector\r\n * @param Vector [b] - The second vector\r\n * @returns Number\r\n *\/\r\nfunction vangle(a, b) =\r\n let(\r\n a = a ? a : [0, 0, 0],\r\n b = b ? b : [0, 0, 0]\r\n )\r\n float(acos((a * b) \/ (norm(a) * norm(b))))\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b44ac3dc388afa867571b2ad4663e334d9a089b2","subject":"Radius percentage lowered for appearance advantages","message":"Radius percentage lowered for appearance advantages\n","repos":"btcspry\/3d-wallet-generator","old_file":"scad\/roundCornersCube.scad","new_file":"scad\/roundCornersCube.scad","new_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,$fn = 25,center=true);}\nmodule roundCornersCube(x,y,z)difference(){r=((x+y)\/2)*0.052;cube([x,y,z], center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}\n","old_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,$fn = 25,center=true);}\nmodule roundCornersCube(x,y,z)difference(){r=((x+y)\/2)*0.055;cube([x,y,z], center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"812f8c1d803d8124132ca7a5d4db870056fc4225","subject":"[3d] Decrease case default wall thickness 3.0m -> 2.5mm","message":"[3d] Decrease case default wall thickness 3.0m -> 2.5mm\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \/\/translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 3.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \/\/translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"717b5b1090a0679837a3926d49a34806edd596df","subject":"Mask opening tweak again.","message":"Mask opening tweak again.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 29;\nview_opening_height = 90;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 30;\nview_opening_height = 90;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ba67ef55720646bacaffe97e0c3d584bdfcc09c8","subject":"Tweaks based on latest cut.","message":"Tweaks based on latest cut.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.0;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.0mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, depth\/2-70, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 2.8; \/\/ 2.8mm = 0.110\" (looks good based on cut test piece for hardboard slotting into hardboard)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, depth\/2-70, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f09e667aac63864870c91636d285f10a3cc99c3b","subject":"remove old 3d model","message":"remove old 3d model\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/roof.scad","new_file":"3d\/roof.scad","new_contents":"","old_contents":"a = 150;\nb = 100;\nc = 3;\nscreen_x = 72;\nscreen_y = 27;\nbutton_r = 7;\nshift = c+c\/2;\nleg_r = 1;\ndifference() {\n cube([a,b,c], true);\n translate([0,10,0]) {\n\t cube([screen_x,screen_y,2*c], true);\n }\n\t translate([screen_x\/2,-screen_y,0]) {\n cylinder(h=2*c,r=button_r, $fn=50, center=true);\n }\n translate([-screen_x\/2,-screen_y,0]) {\n cylinder(h=2*c,r=button_r, $fn=50, center=true);\n }\n\nfor (dx = [-(a-shift)\/2, (a-shift)\/2])\n for (dy = [-(b-shift)\/2, (b-shift)\/2]) {\n translate([dx, dy, -c]) {\n cylinder(h=2*c, r=leg_r, $fn=40);\n }\n }\n};\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1524dfe8a67aa97645ee36c019ab825a720c655c","subject":"parameterize values","message":"parameterize values\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/customizer\/lamp-shade-customizer.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/customizer\/lamp-shade-customizer.scad","new_contents":"\nouterRadius = 15;\nsquareLength = 20;\nxScale = 0.5;\n\nuse <..\/lamp-shade.scad>\n\nlampShade(outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale);\n","old_contents":"\nuse <..\/lamp-shade.scad>\n\nlampShade(outerRadius = 15,\n squareLength = 20,\n xScale = 0.5);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"982216fd1f72151d0b9fa3b2ba19653f1ca28ab5","subject":"main\/yaxis: add belt","message":"main\/yaxis: add belt\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n if(!preview_mode)\n {\n belt_path(main_depth-yaxis_motor_offset*2, 6, yaxis_pulley_d, orient=[0,1,0]);\n }\n\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"18462e93c578bc4300c8bfd3d17256f31141b88e","subject":"Updated Sizes","message":"Updated Sizes\n","repos":"holtsoftware\/House,holtsoftware\/House,holtsoftware\/House,holtsoftware\/House","old_file":"OpenSCAD\/Yard\/SolarRoof.scad","new_file":"OpenSCAD\/Yard\/SolarRoof.scad","new_contents":"module solarPanel()\n{\n translate([0,0,1.5]) color(\"blue\") cube([49.5,49.5,4]);\n translate([3.25,3.25,0]) color(\"red\") cube([43,43,5]);\n translate([0,20.5,0]) color(\"orange\") cube([49.5,8,5]);\n}\n\ndifference()\n{\n cube([140,75,5]);\n translate([18,12.25,0]) solarPanel();\n translate([73,12.25,0]) solarPanel();\n}","old_contents":"module solarPanel()\n{\n translate([0,0,1.5]) color(\"blue\") cube([51,51,4]);\n translate([4,4,0]) color(\"red\") cube([43,43,5]);\n translate([0,21.5,0]) color(\"orange\") cube([51,8,5]);\n}\n\ndifference()\n{\n cube([140,75,5]);\n translate([18,12.25,0]) solarPanel();\n translate([73,12.25,0]) solarPanel();\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"5b7ce404c88ea24ec64abf898ff0d2e2e08e549e","subject":"linear-extrusion: add preview_mode","message":"linear-extrusion: add preview_mode\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"linear-extrusion.scad","new_file":"linear-extrusion.scad","new_contents":"include \ninclude \n\nuse \nuse \n\nmodule linear_extrusion(h=10, center=true, align=N, orient=Z)\n{\n size_align(size=[20,20,h], align=align, orient=orient, orient_ref=Z)\n {\n if($preview_mode)\n {\n cubea([20, 20, h]);\n }\n else\n {\n linear_extrude(height = h, center = true, convexity = 10, twist = 0)\n {\n import (file = \"data\/misumi-extrusion\/hfs5-2020-profile.dxf\");\n }\n }\n }\n}\n\nif(false)\n{\n all_axes()\n color($color)\n translate(10*$axis)\n linear_extrusion(h=100, align=$axis, orient=$axis);\n}\n","old_contents":"include \ninclude \n\nuse \nuse \n\nmodule linear_extrusion(h=10, center=true, align=N, orient=Z)\n{\n size_align(size=[20,20,h], align=align, orient=orient, orient_ref=Z)\n {\n linear_extrude(height = h, center = true, convexity = 10, twist = 0)\n {\n import (file = \"data\/misumi-extrusion\/hfs5-2020-profile.dxf\");\n }\n }\n}\n\n\/*include *\/\n\/*include *\/\n\/*include *\/\n\/*for(axis=concat(AXES,-AXES))*\/\n\/*translate(axis*20\/2)*\/\n\/*{*\/\n \/*c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);*\/\n \/*color(c)*\/\n \/*linear_extrusion(h=100, align=axis, orient=axis);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1728564b1174877bf0938499a67ca10b3b80b2e2","subject":"Update MotorshaftFlatThickness to measured value","message":"Update MotorshaftFlatThickness to measured value\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/config\/machine.scad","new_file":"hardware\/config\/machine.scad","new_contents":"\/\/\n\/\/ Machine\n\/\/\n\n\/\/ Coding-style\n\/\/ ------------\n\/\/\n\/\/ Global variables are written in UpperCamelCase.\n\/\/ A logical hierarchy should be indicated using underscores, for example:\n\/\/ StepperMotor_Connections_Axle\n\/\/\n\/\/ Global short-hand references should be kept to a minimum to avoid name-collisions\n\n\n\/\/ Global Settings for Printed Parts\n\/\/\n\nDefaultWall \t= 4*perim;\nThickWall \t\t= 8*perim;\n\n\/\/ short-hand\ndw \t\t\t\t= DefaultWall;\ntw \t\t\t\t= ThickWall;\n\n\n\/\/ Global design parameters\nGroundClearance = 20;\n\n\/\/ Motor references\nMotorOffsetX = -16;\nMotorOffsetZ = 10;\nMotorShaftDiameter = 5;\nMotorShaftFlatThickness = 3;\n\n\/\/ Wheels\n\/\/\n\nWheelDiameter \t= 2*(GroundClearance + MotorOffsetZ);\nWheelRadius \t= WheelDiameter \/ 2;\nWheelThickness \t= dw; \/\/ used to determine the size of slot in the base, clearance factor is added later\n\n\n\/\/ Base\n\/\/\n\nBaseDiameter \t= 140;\nBaseThickness \t= dw;\n\n\n\/\/ Pen\n\/\/\n\nPenHoleDiameter = 25;\n","old_contents":"\/\/\n\/\/ Machine\n\/\/\n\n\/\/ Coding-style\n\/\/ ------------\n\/\/\n\/\/ Global variables are written in UpperCamelCase.\n\/\/ A logical hierarchy should be indicated using underscores, for example:\n\/\/ StepperMotor_Connections_Axle\n\/\/\n\/\/ Global short-hand references should be kept to a minimum to avoid name-collisions\n\n\n\/\/ Global Settings for Printed Parts\n\/\/\n\nDefaultWall \t= 4*perim;\nThickWall \t\t= 8*perim;\n\n\/\/ short-hand\ndw \t\t\t\t= DefaultWall;\ntw \t\t\t\t= ThickWall;\n\n\n\/\/ Global design parameters\nGroundClearance = 20;\n\n\/\/ Motor references\nMotorOffsetX = -16;\nMotorOffsetZ = 10;\nMotorShaftDiameter = 5;\nMotorShaftFlatThickness = 2;\n\n\/\/ Wheels\n\/\/\n\nWheelDiameter \t= 2*(GroundClearance + MotorOffsetZ);\nWheelRadius \t= WheelDiameter \/ 2;\nWheelThickness \t= dw; \/\/ used to determine the size of slot in the base, clearance factor is added later\n\n\n\/\/ Base\n\/\/\n\nBaseDiameter \t= 140;\nBaseThickness \t= dw;\n\n\n\/\/ Pen\n\/\/\n\nPenHoleDiameter = 25;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dad70ed04f6a8c5c2525996a4eb3ab6a921794e5","subject":"Use openscad to replace kokopelli piece to be more standard","message":"Use openscad to replace kokopelli piece to be more standard\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/mobile_support.scad","new_file":"Hardware\/mobile_support.scad","new_contents":"width = 97; \/\/ External width (except clipping mechanism)\nheight = 142; \/\/ External height (except clipping mechanism)\ncorner_radius = 14; \/\/ Round corner at the bottom corners\ntop_width = 114; \/\/ Clipping mechanism width\ntop_height = 20; \/\/ Clipping mechanism height\nthickness = 2*0.7; \/\/ Thickness of clipping mechanism\nclip_height = 12;\n\n\/\/Main pocket\ndifference()\n{\n\tunion(){\n\tcube(size = [width,height,thickness], center = true);\n\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t}\n\tcube(size = [width-20,height-24,thickness], center = true);\n}\n\n\/\/ Existing top clip\n\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\n\nclip_width = width +20;\n\/\/ Top clip support\ntranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\n\/\/ Top clip \ntranslate([-clip_height, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\n\/\/ Bottom clip support\ntranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\n\/\/ Bottom clip\ntranslate([clip_height, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/mobile_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"57ce6388d6eb1923630c1fe20ad169c7997be632","subject":"larger platform tabs, with pilot holes for optional screws","message":"larger platform tabs, with pilot holes for optional screws\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\ntranslate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n%for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.8) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.07) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) difference() {\n tab();\n #translate([0,0,1]) \/\/ pilot hole for plastic screw\n cylinder(r1=PCBhole-.4,r2=PCBhole+.2,h=6,$fn=13);\n }\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n\/\/translate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n\/\/for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=3.6; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=5,r2=4.5,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.8) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.1) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) difference() {\n tab();\n %translate([0,0,2]) \/\/ pilot hole for plastic screw\n cylinder(r1=PCBhole-.5,r2=PCBhole+.2,h=5,$fn=13);\n }\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"08e3e891d4842cd6351f5991ef3f6a6b5662474d","subject":"I lied... 5 iterations all the way","message":"I lied... 5 iterations all the way\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube.scad","new_file":"inverse_cube.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","old_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 4;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"79bff4d6809cfb4f25bf928eee51cb0aaf6cb91f","subject":"A sample for creating pyramids with with the OpenSCAD cylinder() primative, using the $fn variable.","message":"A sample for creating pyramids with with the OpenSCAD cylinder() primative, using the $fn variable.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/basics\/primitives\/cylinder\/pyramid-from-cylinder.scad","new_file":"OpenSCAD\/src\/main\/openscad\/basics\/primitives\/cylinder\/pyramid-from-cylinder.scad","new_contents":"\r\n\/\/ originally from https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/Primitive_Solids#cylinder\r\n\r\ntranslate([-50, 0, 0])\r\ncylinder(20,20,20, $fn=3);\r\n\r\ncolor(\"brown\")\r\ncylinder(20,20,00, $fn=4);\r\n\r\ncolor(\"green\")\r\ntranslate([50, 0, 0])\r\ncylinder(20,20,10, $fn=4);\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/src\/main\/openscad\/basics\/primitives\/cylinder\/pyramid-from-cylinder.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4467c80dcc2e69b3818d08a205a8aa18259a8302","subject":"adjust the outer ring diameter","message":"adjust the outer ring diameter\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_contents":"\nbottomOuterRadius = 52;\n\nouterRadius = 90;\n\/\/outerRadius = 36;\n\nsquareLength = 50; \/\/28;\n\nxScale = 0.1; \/\/ 0.3;\n\nyScale = 0.3; \/\/ 0.7;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\nouterRadius = 36;\n\nsquareLength = 28;\n\nxScale = 0.3;\n\nyScale = 0.7;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(bottomOuterRadius = outerRadius * 2,\n outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b3b9ea4efcaad107e5bd2209a8782845d77fd896","subject":"remove the original version preview","message":"remove the original version preview\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_contents":"\nbottomOuterRadius = 50;\n\nintersection_xTranslate = -58;\n\nouterRadius = 90;\n\nsquareLength = 59;\n\ntop_zTranslate = 1;\n\n\/\/ this narrows the top (and bottom a little)\nxScale = 0.35; \/\/ 0.3;\n\n\/\/ this shortens the height and widens the base\nyScale = 0.7; \/\/ 0.7; \n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ %import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n top_zTranslate = top_zTranslate,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\nbottomOuterRadius = 50;\n\nintersection_xTranslate = -58;\n\nouterRadius = 90;\n\nsquareLength = 59;\n\ntop_zTranslate = 1;\n\n\/\/ this narrows the top (and bottom a little)\nxScale = 0.35; \/\/ 0.3;\n\n\/\/ this shortens the height and widens the base\nyScale = 0.7; \/\/ 0.7; \n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\ntranslate([9, 18, 0])\n%import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n top_zTranslate = top_zTranslate,\n xScale = xScale,\n yScale = yScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f10326ef7b5c888e20a0e8c256fe8dc6e32eef1b","subject":"The parameters were alphabetized.","message":"The parameters were alphabetized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/examples\/on-off-cord-labels\/fan\/fan-cord-label.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/examples\/on-off-cord-labels\/fan\/fan-cord-label.scad","new_contents":"\r\nuse <..\/..\/..\/name-tag.scad>\r\n\r\niconType = \"Fan\";\r\niconXyScale = 0.8;\r\niconHeight = 3;\r\n \r\nnametag(baseHeight = 15,\r\n baseWidth = 80, \r\n bottomText = \"\",\r\n chainLoop = true,\r\n chainLoopPosition = \"top\",\r\n font=\"..\/..\/..\/write\/orbitron.dxf\",\r\n leftIconHeight = iconHeight,\r\n leftIconType = iconType,\r\n leftIconXyScale = iconXyScale,\r\n rightIconHeight = iconHeight,\r\n rightIconType = iconType,\r\n rightIconXyScale = iconXyScale, \r\n topText=\"Fan\",\r\n topTextSize = 12,\r\n xIconOffset = 33,\r\n yIconOffset = 1);","old_contents":"\r\nuse <..\/..\/..\/name-tag.scad>\r\n\r\niconType = \"Fan\";\r\niconXyScale = 0.8;\r\niconHeight = 3;\r\n \r\nnametag(topText=\"Fan\",\r\n topTextSize = 12,\r\n bottomText = \"\",\r\n font=\"..\/..\/..\/write\/orbitron.dxf\",\r\n \r\n leftIconType = iconType,\r\n leftIconHeight = iconHeight,\r\n leftIconXyScale = iconXyScale,\r\n rightIconType = iconType,\r\n rightIconHeight = iconHeight,\r\n rightIconXyScale = iconXyScale,\r\n xIconOffset = 33,\r\n yIconOffset = 1,\r\n \r\n baseWidth = 80,\r\n baseHeight = 15,\r\n\/\/ showBorder = \"No\",\r\n\/\/ showBorder = \"Yes\", \r\n chainLoop = true,\r\n chainLoopPosition = \"top\");\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"454f51ea88f0aba57cc507aa3e4626f139d5d5a3","subject":"xaxis\/carriage: rename beltpath module to prevent error in main","message":"xaxis\/carriage: rename beltpath module to prevent error in main\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height_body], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height_body], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"dd99980daec880096b54b37b776ff6a6d324e474","subject":"shape: fix","message":"shape: fix\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"curve.scad","new_file":"curve.scad","new_contents":"include \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\n\r\n\r\nmodule draw_path(path, r=1) {\r\n for (i=[0:len(path)-2]) {\r\n hull() {\r\n translate(path[i]) sphere(r);\r\n translate(path[i+1]) sphere(r);\r\n }\r\n }\r\n}\r\n\r\nmodule draw_transform(transform, r=1) {\r\n multmatrix(transform) scale(r\/3) frame(10);\r\n}\r\n\r\nmodule draw_transforms(transforms, r=1) {\r\n for (t=transforms) {\r\n draw_transform(t,r);\r\n }\r\n}\r\n\r\nfunction vec_trans(path_t) = [for(t=path_t) translation_part(t)];\r\n\r\nfunction to_delta_trans(path)=\r\n[\r\n let(l=len(path))\r\n for (i=[0:l-1-1])\r\n trajectory(translation=path[i+1]-path[i])\r\n];\r\n\r\nfunction quantize_path(path, step, includestartoffset=1) = let (\r\n \/\/ construct vector of delta translations\r\n path_traj = to_delta_trans(path)\r\n \/\/ quantize evenly along path\r\n , path_q_f = quantize_trajectories(path_traj, step=step, loop=false, start_position=0)\r\n )\r\n includestartoffset == 1 ?\r\n [for(v=path_q_f) path[0]+translation_part(v)]\r\n :\r\n [for(v=path_q_f) translation_part(v)]\r\n;\r\n\r\nfunction step_vec(vec, step, start_offset=0, end_offset=0) =\r\n [start_offset:step:len(vec)-1-end_offset];\r\n\r\nfunction iterate_step_vec(vec, step, start_offset=0, end_offset=0, even=0) =\r\n even==1?\r\n \/\/remainder\r\n let(r = (len(vec)-1) % step)\r\n [for(k=[r\/2+start_offset:step:len(vec)-1-end_offset]) vec[k]]\r\n :\r\n [for(k=[start_offset:step:len(vec)-1-end_offset]) vec[k]]\r\n;\r\n\r\nmodule place(vec_t, debug=0)\r\n{\r\n for(t=vec_t)\r\n {\r\n multmatrix(t)\r\n {\r\n if(debug>=1)\r\n {\r\n {\r\n draw_transforms(t);\r\n }\r\n }\r\n children();\r\n }\r\n }\r\n}\r\n\r\nmodule placealong(vec_t, step, start_offset=0, end_offset=0, even=0, debug=0)\r\n{\r\n vec = iterate_step_vec(vec_t,step,start_offset,end_offset, even);\r\n place(vec, debug)\r\n {\r\n children();\r\n }\r\n}\r\n\r\nfunction c(t, r=[20,20], degrees=360) = [\r\n r[0]*(cos((degrees)*t)),\r\n 0,\r\n r[1]*(sin((degrees)*t)),\r\n];\r\nfunction c_(t, r=[20,20], degrees=360) = [\r\n r[0]*-degrees*(sin((degrees)*t)),\r\n 0,\r\n r[1]*-degrees*(cos((degrees)*t)),\r\n];\r\n\r\nfunction f(t,r,d)=c(t,r,d)-c(0,r,d);\r\n\r\n\/*s = degrees\/4;*\/\r\ns = 10;\r\n\r\ndegrees = s*10;\r\n\r\n\/\/ one step per degree\r\ndegstep = 1;\r\npath_e = [for (t=[0:degstep\/degrees:1-degstep\/degrees]) vec3(f(t,[80,50],degrees)) ];\r\n\r\n\/\/ normal transform path (not evenly distributed points)\r\npath_t = construct_transform_path(path_e);\r\n\r\n\/\/ evenly distributed points, \"acc\" steps per degree\r\nacc = 2;\r\npath_e_q = quantize_path(path_e, step=1\/acc);\r\npath_t_q = construct_transform_path(path_e_q);\r\n\/*accstep = acc * len(path_t)\/len(path_t_q);*\/\r\n\r\nfunction path_sweepalong(path) = [for(k=path) place_mat()*k];\r\nfunction path_placealong(path) = [for(k=path) place_mat()*k*rotation([180,90,0])];\r\n\r\nfunction place_mat() =\r\n translation(N)\r\n *\r\n rotation(N)\r\n ;\r\n\r\nshape_debug = rectangle_profile([0.5,0.5]);\r\n\r\n\r\n\/\/ non-interpolated\r\ntranslate(N)\r\n{\r\n color(\"black\")\r\n {\r\n sweep(shape_debug, path_sweepalong(path_t), false);\r\n }\r\n placealong(path_placealong(path_t), s, even=0, debug=1)\r\n {\r\n color(\"red\")\r\n {\r\n cube([s,5,0.1], true);\r\n }\r\n }\r\n}\r\n\r\n\/\/ interpolated\r\ntranslate([0,10,0])\r\n{\r\n color(\"black\")\r\n {\r\n sweep(shape_debug, path_sweepalong(path_t_q), false);\r\n }\r\n placealong(path_placealong(path_t_q), s*acc, even=0, debug=1)\r\n {\r\n color(\"blue\")\r\n {\r\n cube([s,5,0.1], true);\r\n }\r\n }\r\n}\r\n\r\n","old_contents":"use \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\nuse \n\nmodule draw_path(path, r=1) {\n for (i=[0:len(path)-2]) {\n hull() {\n translate(path[i]) sphere(r);\n translate(path[i+1]) sphere(r);\n }\n }\n}\n\nmodule draw_transform(transform, r=1) {\n multmatrix(transform) scale(r\/3) frame(10);\n}\n\nmodule draw_transforms(transforms, r=1) {\n for (t=transforms) {\n draw_transform(t,r);\n }\n}\n\nfunction vec_trans(path_t) = [for(t=path_t) translation_part(t)];\n\nfunction to_delta_trans(path)=\n[\n let(l=len(path))\n for (i=[0:l-1-1])\n trajectory(translation=path[i+1]-path[i])\n];\n\nfunction quantize_path(path, step, includestartoffset=1) = let (\n \/\/ construct vector of delta translations\n path_traj = to_delta_trans(path)\n \/\/ quantize evenly along path\n , path_q_f = quantize_trajectories(path_traj, step=step, loop=false, start_position=0)\n )\n includestartoffset == 1 ?\n [for(v=path_q_f) path[0]+translation_part(v)]\n :\n [for(v=path_q_f) translation_part(v)]\n;\n\nfunction step_vec(vec, step, start_offset=0, end_offset=0) =\n [start_offset:step:len(vec)-1-end_offset];\n\nfunction iterate_step_vec(vec, step, start_offset=0, end_offset=0, even=0) =\n even==1?\n \/\/remainder\n let(r = (len(vec)-1) % step)\n [for(k=[r\/2+start_offset:step:len(vec)-1-end_offset]) vec[k]]\n :\n [for(k=[start_offset:step:len(vec)-1-end_offset]) vec[k]]\n;\n\nmodule place(vec_t, debug=0)\n{\n for(t=vec_t)\n {\n multmatrix(t)\n {\n if(debug>=1)\n {\n {\n draw_transforms(t);\n }\n }\n children();\n }\n }\n}\n\nmodule placealong(vec_t, step, start_offset=0, end_offset=0, even=0, debug=0)\n{\n vec = iterate_step_vec(vec_t,step,start_offset,end_offset, even);\n place(vec, debug)\n {\n children();\n }\n}\n\nfunction c(t, r=[20,20], degrees=360) = [\n r[0]*(cos((degrees)*t)),\n 0,\n r[1]*(sin((degrees)*t)),\n];\nfunction c_(t, r=[20,20], degrees=360) = [\n r[0]*-degrees*(sin((degrees)*t)),\n 0,\n r[1]*-degrees*(cos((degrees)*t)),\n];\n\nfunction f(t,r,d)=c(t,r,d)-c(0,r,d);\n\n\/*s = degrees\/4;*\/\ns = 10;\n\ndegrees = s*10;\n\n\/\/ one step per degree\ndegstep = 1;\npath_e = [for (t=[0:degstep\/degrees:1-degstep\/degrees]) vec3(f(t,[80,50],degrees)) ];\n\n\/\/ normal transform path (not evenly distributed points)\npath_t = construct_transform_path(path_e);\n\n\/\/ evenly distributed points, \"acc\" steps per degree\nacc = 2;\npath_e_q = quantize_path(path_e, step=1\/acc);\npath_t_q = construct_transform_path(path_e_q);\n\/*accstep = acc * len(path_t)\/len(path_t_q);*\/\n\nfunction path_sweepalong(path) = [for(k=path) place_mat()*k];\nfunction path_placealong(path) = [for(k=path) place_mat()*k*rotation([180,90,0])];\n\nfunction place_mat() =\n translation(N)\n *\n rotation(N)\n ;\n\nshape_debug = rectangle_profile([0.5,0.5]);\n\n\n\/\/ non-interpolated\ntranslate(N)\n{\n color(\"black\")\n {\n sweep(shape_debug, path_sweepalong(path_t), false);\n }\n placealong(path_placealong(path_t), s, even=0, debug=1)\n {\n color(\"red\")\n {\n cube([s,5,0.1], true);\n }\n }\n}\n\n\/\/ interpolated\ntranslate([0,10,0])\n{\n color(\"black\")\n {\n sweep(shape_debug, path_sweepalong(path_t_q), false);\n }\n placealong(path_placealong(path_t_q), s*acc, even=0, debug=1)\n {\n color(\"blue\")\n {\n cube([s,5,0.1], true);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"649acb1efc54c5d31ceb3056650b0eeb18ad9a06","subject":"add the cutout","message":"add the cutout\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n zLength = 4.2; \n\n xTranslate = 30;\n yTranslate = 32.7;\n zTranslate = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n\n halfCirclePhoneStand_cradle_cutout(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30; \/\/ 29.9\n yTranslate = 32.7; \/\/ 32.6\n zTranslate = minkowskiSphereRadius + 0; \/\/ 0.13;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \/\/ 212\n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n zLength = 5;\n\n zTranslate = minkowskiSphereRadius + (height \/ 2.0) - (zLength \/ 2.0);\n\n\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b134b0b3b47d7d579afadbc2b3d049dd3a3d0afa","subject":"change the default x,y location of the bases","message":"change the default x,y location of the bases\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nuse <..\/..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\nuse <..\/..\/..\/external-resources\/cat\/cat.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/bass-clef\/bass-clef.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/l\/luigi-outline.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/m\/mario.scad>\nuse <..\/..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\nuse <..\/..\/..\/external-resources\/thundercats\/thundercats-logo.scad>\nuse <..\/..\/..\/external-resources\/trooper\/scrum-trooper.scad>\nuse <..\/..\/..\/shapes\/crescent-moon\/crescent-moon.scad>\nuse <..\/..\/..\/shapes\/fan\/iso-7000-fan.scad>\nuse <..\/..\/..\/shapes\/fish\/fish.scad>\nuse <..\/..\/..\/shapes\/heart\/heart.scad>\nuse <..\/..\/..\/shapes\/light-bulb\/light-bulb.scad>\nuse <..\/..\/..\/shapes\/minecraft\/creeper\/creeper-face.scad>\nuse <..\/..\/..\/shapes\/spurs\/spurs-a.scad>\nuse <..\/..\/..\/shapes\/weather\/sun\/sun.scad>\n\nmodule halfCirclePhoneStand(base_xTranslate = -1.0,\n base_yTranslate = -1.0,\n\n bed_cutout_zLength = 4.2,\n height = 19.125,\n \n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n icon_zOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5,\n \n stand_top_xTranslate = 9.105,\n stand_top_yTranslate = 9.85,\n stand_connectorBar_xLength = 5)\n{\n halfCirclePhoneStand_cradle(height = height,\n \n bed_cutout_zLength = bed_cutout_zLength,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n stand_connectorBar_xLength = stand_connectorBar_xLength,\n stand_top_xTranslate = stand_top_xTranslate,\n stand_top_yTranslate = stand_top_yTranslate);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n bed_cutout_zLength,\n\n iconColor, iconType, iconXyScale, iconHeight, \n icon_xOffset, icon_yOffset, icon_zOffset,\n \n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate,\n bed_cutout_zLength = bed_cutout_zLength);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset,\n zOffset = icon_zOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate,\n bed_cutout_zLength)\n{\n zLength = bed_cutout_zLength;\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset, zOffset)\n{\n\/\/echo(\"xOffset\", xOffset);\n\n color(iconColor)\n \n translate([xOffset, yOffset, zOffset])\n rotate([0, 90, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=2.19);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbassClefThumbnail(height = 2.7);\n }\n else if(iconType == \"Cat\")\n {\n catThumbnail(height = 2, xyScale = 0.37);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 2.1])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Heart\")\n {\n scale([1, 1, 1.9])\n heartThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumTrooperThumbnail(height = 2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(base_xTranslate,\n base_yTranslate,\n bed_cutout_zLength,\n height,\n minkowskiSphereRadius,\n stand_connectorBar_xLength,\n stand_top_xTranslate,\n stand_top_yTranslate)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xTranslate = stand_top_xTranslate,\n yTranslate = stand_top_yTranslate);\n\n halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength = bed_cutout_zLength,\n bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xLength = stand_connectorBar_xLength);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xTranslate = base_xTranslate,\n yTranslate = base_yTranslate);\n}\n \nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius,\n xTranslate,\n yTranslate)\n{\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength, minkowskiSphereRadius, bedHeight, xLength)\n{\n yLength = 3; \n zLength = bed_cutout_zLength + minkowskiSphereRadius;\n \n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius,\n xTranslate,\n yTranslate)\n{\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9,\n outerRadius = 2.6,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nuse <..\/..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\nuse <..\/..\/..\/external-resources\/cat\/cat.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/bass-clef\/bass-clef.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/l\/luigi-outline.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/m\/mario.scad>\nuse <..\/..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\nuse <..\/..\/..\/external-resources\/thundercats\/thundercats-logo.scad>\nuse <..\/..\/..\/external-resources\/trooper\/scrum-trooper.scad>\nuse <..\/..\/..\/shapes\/crescent-moon\/crescent-moon.scad>\nuse <..\/..\/..\/shapes\/fan\/iso-7000-fan.scad>\nuse <..\/..\/..\/shapes\/fish\/fish.scad>\nuse <..\/..\/..\/shapes\/heart\/heart.scad>\nuse <..\/..\/..\/shapes\/light-bulb\/light-bulb.scad>\nuse <..\/..\/..\/shapes\/minecraft\/creeper\/creeper-face.scad>\nuse <..\/..\/..\/shapes\/spurs\/spurs-a.scad>\nuse <..\/..\/..\/shapes\/weather\/sun\/sun.scad>\n\nmodule halfCirclePhoneStand(base_xTranslate = 0,\n base_yTranslate = 0,\n\n bed_cutout_zLength = 4.2,\n height = 19.125,\n \n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n icon_zOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5,\n \n stand_top_xTranslate = 8.105,\n stand_top_yTranslate = 8.85,\n stand_connectorBar_xLength = 5)\n{\n halfCirclePhoneStand_cradle(height = height,\n \n bed_cutout_zLength = bed_cutout_zLength,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n stand_connectorBar_xLength = stand_connectorBar_xLength,\n stand_top_xTranslate = stand_top_xTranslate,\n stand_top_yTranslate = stand_top_yTranslate);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n bed_cutout_zLength,\n\n iconColor, iconType, iconXyScale, iconHeight, \n icon_xOffset, icon_yOffset, icon_zOffset,\n \n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate,\n bed_cutout_zLength = bed_cutout_zLength);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset,\n zOffset = icon_zOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate,\n bed_cutout_zLength)\n{\n zLength = bed_cutout_zLength;\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset, zOffset)\n{\n\/\/echo(\"xOffset\", xOffset);\n\n color(iconColor)\n \n translate([xOffset, yOffset, zOffset])\n rotate([0, 90, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=2.19);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbassClefThumbnail(height = 2.7);\n }\n else if(iconType == \"Cat\")\n {\n catThumbnail(height = 2, xyScale = 0.37);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 2.1])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Heart\")\n {\n scale([1, 1, 1.9])\n heartThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumTrooperThumbnail(height = 2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(base_xTranslate,\n base_yTranslate,\n bed_cutout_zLength,\n height,\n minkowskiSphereRadius,\n stand_connectorBar_xLength,\n stand_top_xTranslate,\n stand_top_yTranslate)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xTranslate = stand_top_xTranslate,\n yTranslate = stand_top_yTranslate);\n\n halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength = bed_cutout_zLength,\n bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xLength = stand_connectorBar_xLength);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xTranslate = base_xTranslate,\n yTranslate = base_yTranslate);\n}\n \nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius,\n xTranslate,\n yTranslate)\n{\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength, minkowskiSphereRadius, bedHeight, xLength)\n{\n yLength = 3; \n zLength = bed_cutout_zLength + minkowskiSphereRadius;\n \n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius,\n xTranslate,\n yTranslate)\n{\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9,\n outerRadius = 2.6,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b1ffd43656958ca0bf01c330d364366b86272ff8","subject":"Rotated plate for easy printing without rotating in printing software. Added 'Power' text.","message":"Rotated plate for easy printing without rotating in printing software. Added 'Power' text.\n","repos":"ianlee74\/ReflowChateau","old_file":"OpenSCAD\/plate.scad","new_file":"OpenSCAD\/plate.scad","new_contents":"\n$fn = 20;\n\nwidth = 60.4;\nlength = 162.2;\nthickness = 3;\n\nscreenWidth = 50.9;\nscreenLength = 70.6;\n\nscrewD = 2.9;\n\nframeStandoffHorzSep = 48.6;\nframeStandoffVert = [-68.5, -15.2, 75];\n\npcbStandoff = [[12.7, 0],\n\t\t\t [-12.7, 0],\n [12.7, 80], \n\t\t\t [-12.7, 80]];\n\npcbStandoffY = -12;\n\nrotate([0,180,0]) {\n difference(){\n translate([0, 0, 1.5])\n hull(){\n roundedCube([width, length, thickness], 4);\n translate([0, 0, 0.5])\n roundedCube([width-4, length-4, thickness+1], 2);\n }\n \n translate([0, 28.5, 2.5])\n cube([screenWidth, screenLength, 6], center = true);\n\n for (i = frameStandoffVert){\n for (j = [-1, 1]){\n translate([j*frameStandoffHorzSep\/2, i, 0])\n cylinder(r = screwD\/2, h = 3);\n }\n }\n \n translate([-8, -11, thickness - 2.1])\n scale([1, 1, 5])\n text(\"POWER\", 3);\n }\n\n\n for (i = frameStandoffVert){\n for (j = [-1, 1]){\n translate([j*frameStandoffHorzSep\/2, i, 0])\n standoff(6, 5);\n }\n }\n\n translate([0, pcbStandoffY, 0])\n for (i = pcbStandoff){\n translate(i)\n standoff(6, 14.6);\n }\n}\n\nmodule standoff(diameter, height){\n\ttranslate([0, 0, -height])\n\tdifference(){\t\n\t\tcylinder(r = diameter\/2, h = height);\n translate([0, 0, -0.1])\n\t\tcylinder(r = screwD\/2, h = height + 0.1);\n\t}\n}\n\n\n\nmodule roundedCube(size, radius) {\n cube(size - [2*radius,0,0], true);\n cube(size - [0,2*radius,0], true);\n for (x = [radius-size[0]\/2, -radius+size[0]\/2],\n y = [radius-size[1]\/2, -radius+size[1]\/2]) {\n translate([x,y,0]) cylinder(r=radius, h=size[2], center=true);\n }\n}\n","old_contents":"\n$fn = 20;\n\nwidth = 60.4;\nlength = 162.2;\n\nscreenWidth = 50.9;\nscreenLength = 70.6;\n\nscrewD = 2.9;\n\nframeStandoffHorzSep = 48.6;\nframeStandoffVert = [-68.5, -15.2, 75];\n\npcbStandoff = [[12.7, 0],\n\t\t\t [-12.7, 0],\n [12.7, 80], \n\t\t\t [-12.7, 80]];\n\npcbStandoffY = -12;\n\n\ndifference(){\n\ttranslate([0, 0, 1.5])\n\thull(){\n\t\troundedCube([width, length, 3], 4);\n\t\ttranslate([0, 0, 0.5])\n\t\troundedCube([width-4, length-4, 4], 2);\n\t}\n\t\n\ttranslate([0, 28.5, 2.5])\n\tcube([screenWidth, screenLength, 5], center = true);\n\n\tfor (i = frameStandoffVert){\n\t\tfor (j = [-1, 1]){\n\t\t\ttranslate([j*frameStandoffHorzSep\/2, i, 0])\n\t\t\tcylinder(r = screwD\/2, h = 3);\n\t\t}\n\t}\n}\n\n\nfor (i = frameStandoffVert){\n\tfor (j = [-1, 1]){\n\t\ttranslate([j*frameStandoffHorzSep\/2, i, 0])\n\t\tstandoff(6, 5);\n\t}\n}\n\ntranslate([0, pcbStandoffY, 0])\nfor (i = pcbStandoff){\n\ttranslate(i)\n\tstandoff(6, 14.6);\n}\n\n\nmodule standoff(diameter, height){\n\ttranslate([0, 0, -height])\n\tdifference(){\t\n\t\tcylinder(r = diameter\/2, h = height);\n\t\tcylinder(r = screwD\/2, h = height);\n\t}\n}\n\n\n\nmodule roundedCube(size, radius) {\n cube(size - [2*radius,0,0], true);\n cube(size - [0,2*radius,0], true);\n for (x = [radius-size[0]\/2, -radius+size[0]\/2],\n y = [radius-size[1]\/2, -radius+size[1]\/2]) {\n translate([x,y,0]) cylinder(r=radius, h=size[2], center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"4eb62ed4095d2e6cbc918c5a1aa0543997aba028","subject":"added hole for LCD insertion (no drills yet, though)","message":"added hole for LCD insertion (no drills yet, though)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0583a39c0b8407e33dcaaec77c45b27c8abd12be","subject":"Create phosfor_1.scad","message":"Create phosfor_1.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/phosfor_1.scad","new_file":"3D-models\/SCAD\/phosfor_1.scad","new_contents":"z=7; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0444\u043e\u0441\u0444\u043e\u0440\ntranslate ([25,-46,0]) {\ndifference () {\ntranslate ([5,30,0])cube ([10,45,z]);\ntranslate ([-5,125,0]) {\ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\n}\ntranslate([-5,30,-1])cylinder(z+2,20,20,$fn=6);\ntranslate([-5,75,-1])cylinder(z+2,20,20,$fn=6);\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,3.5])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n }\n\/\/\u0432\u044b\u0440\u0435\u0437\u0430\u043d\u0438\u0435 \u0434\u044b\u0440\u043a\u0438 \u0438\u0437 \u0434\u043e\u043f \u0447\u0430\u0441\u0442\u0438 \u043e\u0442 \u0444\u043e\u0441\u0444\u0440\u0430\ndifference () {\ntranslate ([15,30,0])cube ([5,45,z]);\ntranslate ([-5,125,0]) {\ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\n}\ntranslate ([9.7-5,-9+g,0]) {\ntranslate ([4,37.5,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/phosfor_1.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"084e9be15ed40e303c491c267077c6f31b388274","subject":"The URL to the Thingiverse thing was updated.","message":"The URL to the Thingiverse thing was updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad","new_file":"OpenSCAD\/src\/main\/openscad\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad","new_contents":"\/*\n * knurledFinishLib_v2.scad\n * \n * Written by aubenc @ Thingiverse\n *\n * This script is licensed under the Public Domain license.\n *\n * http:\/\/www.thingiverse.com\/thing:32122\n *\n * Derived from knurledFinishLib.scad (also Public Domain license) available at\n *\n * http:\/\/www.thingiverse.com\/thing:9095\n *\n * Usage:\n *\n *\t Drop this script somewhere where OpenSCAD can find it (your current project's\n *\t working directory\/folder or your OpenSCAD libraries directory\/folder).\n *\n *\t Add the line:\n *\n *\t\tuse \n *\n *\t in your OpenSCAD script and call either...\n *\n * knurled_cyl( Knurled cylinder height,\n * Knurled cylinder outer diameter,\n * Knurl polyhedron width,\n * Knurl polyhedron height,\n * Knurl polyhedron depth,\n * Cylinder ends smoothed height,\n * Knurled surface smoothing amount );\n *\n * ...or...\n *\n * knurl();\n *\n *\tIf you use knurled_cyl() module, you need to specify the values for all and\n *\n * Call the module ' help(); ' for a little bit more of detail\n * and\/or take a look to the PDF available at http:\/\/www.thingiverse.com\/thing:9095\n * for a in depth descrition of the knurl properties.\n *\/\n\n\nmodule knurl(\tk_cyl_hg\t= 12,\n\t\t\t\t\tk_cyl_od\t= 25,\n\t\t\t\t\tknurl_wd = 3,\n\t\t\t\t\tknurl_hg = 4,\n\t\t\t\t\tknurl_dp = 1.5,\n\t\t\t\t\te_smooth = 2,\n\t\t\t\t\ts_smooth = 0)\n{\n knurled_cyl(k_cyl_hg, k_cyl_od, \n knurl_wd, knurl_hg, knurl_dp, \n e_smooth, s_smooth);\n}\n\nmodule knurled_cyl(chg, cod, cwd, csh, cdp, fsh, smt)\n{\n cord=(cod+cdp+cdp*smt\/100)\/2;\n cird=cord-cdp;\n cfn=round(2*cird*PI\/cwd);\n clf=360\/cfn;\n crn=ceil(chg\/csh);\n\n\/\/ echo(\"knurled cylinder max diameter: \", 2*cord);\n\/\/ echo(\"knurled cylinder min diameter: \", 2*cird);\n\n\t if( fsh < 0 )\n {\n union()\n {\n shape(fsh, cird+cdp*smt\/100, cord, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else if ( fsh == 0 )\n {\n intersection()\n {\n cylinder(h=chg, r=cord-cdp*smt\/100, $fn=2*cfn, center=false);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else\n {\n intersection()\n {\n shape(fsh, cird, cord-cdp*smt\/100, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n}\n\nmodule shape(hsh, ird, ord, fn4, hg)\n{\n\tx0= 0;\tx1 = hsh > 0 ? ird : ord;\t\tx2 = hsh > 0 ? ord : ird;\n\ty0=-0.1;\ty1=0;\ty2=abs(hsh);\ty3=hg-abs(hsh);\ty4=hg;\ty5=hg+0.1;\n\n\tif ( hsh >= 0 )\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y1],[x1,y1],[x2,y2],[x2,y3],[x1,y4],[x0,y4]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5]\t]);\n\t}\n\telse\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y0],[x1,y0],[x1,y1],[x2,y2],\n\t\t\t\t\t\t\t\t[x2,y3],[x1,y4],[x1,y5],[x0,y5]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5,6,7]\t]);\n\t}\n}\n\nmodule knurled_finish(ord, ird, lf, sh, fn, rn)\n{\n for(j=[0:rn-1])\n assign(h0=sh*j, h1=sh*(j+1\/2), h2=sh*(j+1))\n {\n for(i=[0:fn-1])\n assign(lf0=lf*i, lf1=lf*(i+1\/2), lf2=lf*(i+1))\n {\n polyhedron(\n points=[\n [ 0,0,h0],\n [ ord*cos(lf0), ord*sin(lf0), h0],\n [ ird*cos(lf1), ird*sin(lf1), h0],\n [ ord*cos(lf2), ord*sin(lf2), h0],\n\n [ ird*cos(lf0), ird*sin(lf0), h1],\n [ ord*cos(lf1), ord*sin(lf1), h1],\n [ ird*cos(lf2), ird*sin(lf2), h1],\n\n [ 0,0,h2],\n [ ord*cos(lf0), ord*sin(lf0), h2],\n [ ird*cos(lf1), ird*sin(lf1), h2],\n [ ord*cos(lf2), ord*sin(lf2), h2]\n ],\n triangles=[\n [0,1,2],[2,3,0],\n [1,0,4],[4,0,7],[7,8,4],\n [8,7,9],[10,9,7],\n [10,7,6],[6,7,0],[3,6,0],\n [2,1,4],[3,2,6],[10,6,9],[8,9,4],\n [4,5,2],[2,5,6],[6,5,9],[9,5,4]\n ],\n convexity=5);\n }\n }\n}\n\nmodule knurl_help()\n{\n\techo();\n\techo(\" Knurled Surface Library v2 \");\n echo(\"\");\n\techo(\" Modules: \");\n\techo(\"\");\n\techo(\" knurled_cyl(parameters... ); - Requires a value for each an every expected parameter (see bellow) \");\n\techo(\"\");\n\techo(\" knurl(); - Call to the previous module with a set of default parameters, \");\n\techo(\" values may be changed by adding 'parameter_name=value' i.e. knurl(s_smooth=40); \");\n\techo(\"\");\n\techo(\" Parameters, all of them in mm but the last one. \");\n\techo(\"\");\n\techo(\" k_cyl_hg - [ 12 ] ,, Height for the knurled cylinder \");\n\techo(\" k_cyl_od - [ 25 ] ,, Cylinder's Outer Diameter before applying the knurled surfacefinishing. \");\n\techo(\" knurl_wd - [ 3 ] ,, Knurl's Width. \");\n\techo(\" knurl_hg - [ 4 ] ,, Knurl's Height. \");\n\techo(\" knurl_dp - [ 1.5 ] ,, Knurl's Depth. \");\n\techo(\" e_smooth - [ 2 ] ,, Bevel's Height at the bottom and the top of the cylinder \");\n\techo(\" s_smooth - [ 0 ] ,, Knurl's Surface Smoothing : File donwn the top of the knurl this value, i.e. 40 will snooth it a 40%. \");\n\techo(\"\");\n}\n\n","old_contents":"\/*\n * knurledFinishLib_v2.scad\n * \n * Written by aubenc @ Thingiverse\n *\n * This script is licensed under the Public Domain license.\n *\n * http:\/\/www.thingiverse.com\/thing:31122\n *\n * Derived from knurledFinishLib.scad (also Public Domain license) available at\n *\n * http:\/\/www.thingiverse.com\/thing:9095\n *\n * Usage:\n *\n *\t Drop this script somewhere where OpenSCAD can find it (your current project's\n *\t working directory\/folder or your OpenSCAD libraries directory\/folder).\n *\n *\t Add the line:\n *\n *\t\tuse \n *\n *\t in your OpenSCAD script and call either...\n *\n * knurled_cyl( Knurled cylinder height,\n * Knurled cylinder outer diameter,\n * Knurl polyhedron width,\n * Knurl polyhedron height,\n * Knurl polyhedron depth,\n * Cylinder ends smoothed height,\n * Knurled surface smoothing amount );\n *\n * ...or...\n *\n * knurl();\n *\n *\tIf you use knurled_cyl() module, you need to specify the values for all and\n *\n * Call the module ' help(); ' for a little bit more of detail\n * and\/or take a look to the PDF available at http:\/\/www.thingiverse.com\/thing:9095\n * for a in depth descrition of the knurl properties.\n *\/\n\n\nmodule knurl(\tk_cyl_hg\t= 12,\n\t\t\t\t\tk_cyl_od\t= 25,\n\t\t\t\t\tknurl_wd = 3,\n\t\t\t\t\tknurl_hg = 4,\n\t\t\t\t\tknurl_dp = 1.5,\n\t\t\t\t\te_smooth = 2,\n\t\t\t\t\ts_smooth = 0)\n{\n knurled_cyl(k_cyl_hg, k_cyl_od, \n knurl_wd, knurl_hg, knurl_dp, \n e_smooth, s_smooth);\n}\n\nmodule knurled_cyl(chg, cod, cwd, csh, cdp, fsh, smt)\n{\n cord=(cod+cdp+cdp*smt\/100)\/2;\n cird=cord-cdp;\n cfn=round(2*cird*PI\/cwd);\n clf=360\/cfn;\n crn=ceil(chg\/csh);\n\n\/\/ echo(\"knurled cylinder max diameter: \", 2*cord);\n\/\/ echo(\"knurled cylinder min diameter: \", 2*cird);\n\n\t if( fsh < 0 )\n {\n union()\n {\n shape(fsh, cird+cdp*smt\/100, cord, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else if ( fsh == 0 )\n {\n intersection()\n {\n cylinder(h=chg, r=cord-cdp*smt\/100, $fn=2*cfn, center=false);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else\n {\n intersection()\n {\n shape(fsh, cird, cord-cdp*smt\/100, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n}\n\nmodule shape(hsh, ird, ord, fn4, hg)\n{\n\tx0= 0;\tx1 = hsh > 0 ? ird : ord;\t\tx2 = hsh > 0 ? ord : ird;\n\ty0=-0.1;\ty1=0;\ty2=abs(hsh);\ty3=hg-abs(hsh);\ty4=hg;\ty5=hg+0.1;\n\n\tif ( hsh >= 0 )\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y1],[x1,y1],[x2,y2],[x2,y3],[x1,y4],[x0,y4]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5]\t]);\n\t}\n\telse\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y0],[x1,y0],[x1,y1],[x2,y2],\n\t\t\t\t\t\t\t\t[x2,y3],[x1,y4],[x1,y5],[x0,y5]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5,6,7]\t]);\n\t}\n}\n\nmodule knurled_finish(ord, ird, lf, sh, fn, rn)\n{\n for(j=[0:rn-1])\n assign(h0=sh*j, h1=sh*(j+1\/2), h2=sh*(j+1))\n {\n for(i=[0:fn-1])\n assign(lf0=lf*i, lf1=lf*(i+1\/2), lf2=lf*(i+1))\n {\n polyhedron(\n points=[\n [ 0,0,h0],\n [ ord*cos(lf0), ord*sin(lf0), h0],\n [ ird*cos(lf1), ird*sin(lf1), h0],\n [ ord*cos(lf2), ord*sin(lf2), h0],\n\n [ ird*cos(lf0), ird*sin(lf0), h1],\n [ ord*cos(lf1), ord*sin(lf1), h1],\n [ ird*cos(lf2), ird*sin(lf2), h1],\n\n [ 0,0,h2],\n [ ord*cos(lf0), ord*sin(lf0), h2],\n [ ird*cos(lf1), ird*sin(lf1), h2],\n [ ord*cos(lf2), ord*sin(lf2), h2]\n ],\n triangles=[\n [0,1,2],[2,3,0],\n [1,0,4],[4,0,7],[7,8,4],\n [8,7,9],[10,9,7],\n [10,7,6],[6,7,0],[3,6,0],\n [2,1,4],[3,2,6],[10,6,9],[8,9,4],\n [4,5,2],[2,5,6],[6,5,9],[9,5,4]\n ],\n convexity=5);\n }\n }\n}\n\nmodule knurl_help()\n{\n\techo();\n\techo(\" Knurled Surface Library v2 \");\n echo(\"\");\n\techo(\" Modules: \");\n\techo(\"\");\n\techo(\" knurled_cyl(parameters... ); - Requires a value for each an every expected parameter (see bellow) \");\n\techo(\"\");\n\techo(\" knurl(); - Call to the previous module with a set of default parameters, \");\n\techo(\" values may be changed by adding 'parameter_name=value' i.e. knurl(s_smooth=40); \");\n\techo(\"\");\n\techo(\" Parameters, all of them in mm but the last one. \");\n\techo(\"\");\n\techo(\" k_cyl_hg - [ 12 ] ,, Height for the knurled cylinder \");\n\techo(\" k_cyl_od - [ 25 ] ,, Cylinder's Outer Diameter before applying the knurled surfacefinishing. \");\n\techo(\" knurl_wd - [ 3 ] ,, Knurl's Width. \");\n\techo(\" knurl_hg - [ 4 ] ,, Knurl's Height. \");\n\techo(\" knurl_dp - [ 1.5 ] ,, Knurl's Depth. \");\n\techo(\" e_smooth - [ 2 ] ,, Bevel's Height at the bottom and the top of the cylinder \");\n\techo(\" s_smooth - [ 0 ] ,, Knurl's Surface Smoothing : File donwn the top of the knurl this value, i.e. 40 will snooth it a 40%. \");\n\techo(\"\");\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"462b9f8bde2be37cda01197d9166de4e034aa19f","subject":"Cladding done","message":"Cladding done\n","repos":"bmsleight\/shedshed","old_file":"shedshedshed.scad","new_file":"shedshedshed.scad","new_contents":"shed_length = 5184;\nshed_width = 1981;\nshed_front_height = 2250;\n\/\/shed_back_height = 2030;\n\nwindow_w=1830;\nwindow_h=920; \ndoor_w=858; \/\/ 1981 x 838mm + 20\ndoor_h=1991; \/\/ 1981 x 838mm + 20\nshed_back_height = door_h;\n\nspace_to_window_w=window_w\/2;\nspace_to_window_h=door_h-window_h;\nspace_to_door_w=window_w + 2*space_to_window_w;\n\n\n\nbase_timber_w = 47;\nbase_timber_h = 75;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\ntimber_length_unit=2400;\nbase_sheet_t = 18;\nsheet_width = 1220;\nsheet_length = 2440;\n\nwrap_t = 1;\n\nfirst_layer = base_timber_h+wrap_t+base_sheet_t;\n\n\nopp = shed_front_height-shed_back_height;\nadj = shed_width -timber_construct_h;\nhyp = sqrt(opp*opp+adj*adj);\ntheta = atan(opp\/adj);\nthin_opp = tan(theta) * timber_construct_h;\n\necho(\"Theta \", theta);\n\nmodule cubeI(size,comment=\"\/\/\", center=false)\n{\n if (comment != \"\/\/\")\n echo(comment);\n \/\/ Cube - but will echo dimensions in order of size\n if( (size[0]>size[1]) && (size[1]>=size[2]) )\n echo( size[0], size[1], size[2]);\n if( (size[0]>size[2]) && (size[2]>size[1]) )\n echo( size[0], size[2], size[1]);\n \n if( (size[1]>size[0]) && (size[0]>=size[2]) )\n echo( size[1], size[0], size[2]);\n if( (size[1]>size[2]) && (size[2]>size[0]) )\n echo( size[1], size[2], size[0]);\n \n if( (size[2]>size[0]) && (size[0]>=size[1]) )\n echo( size[2], size[0], size[1]);\n if( (size[2]>size[1]) && (size[1]>size[0]) )\n echo( size[2], size[1], size[0]);\n\n cube(size, center=center);\n}\n\nmodule houseWrapLayer(width,length, overlap=100)\n{\n echo(\"House Wrap\",width+overlap,length+overlap);\n color(\"Black\",0.75)\n {\n cube([width, length, wrap_t]);\n cube([width, wrap_t, overlap]);\n translate([0,length-wrap_t,0]) cube([width, wrap_t, overlap]);\n cube([wrap_t, length, overlap]);\n translate([width-wrap_t,0,0]) cube([wrap_t, length, overlap]);\n }\n}\n\n\nmodule beamsWrap()\n{\n \n translate([0,shed_width,first_layer]) rotate([90,0,0]) houseWrapLayer(shed_length,shed_back_height, overlap=100);\n\n translate([0,-1,first_layer]) rotate([90,0,90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height+timber_construct_h,-opp]) rotate([0,0,-theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n\n translate([shed_length,shed_width-1,first_layer]) rotate([90,0,-90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height-opp,-opp]) rotate([0,0,theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n difference() \n {\n translate([shed_length,-2,first_layer]) rotate([90,0,180]) houseWrapLayer(shed_length,shed_front_height, overlap=100);\n translate([space_to_window_w, -50, space_to_window_h+first_layer]) cube([window_w, 100, window_h]);\n translate([space_to_door_w, -50, first_layer]) cube([door_w, 100, door_h]);\n }\n\n \n}\n\n\nmodule OSB(size,center=false)\n{\n echo(\"OSB\");\n cubeI(size,center=center);\n}\n\n\nmodule floorPanel(width,length)\n{\n\/*\n echo(\"Timber\");\n \/\/Timber supporting base along left side\n cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base along right side\n translate([width-base_timber_w,0,0]) cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base Middle of I\n translate([base_timber_w,(length-base_timber_h)\/2,base_timber_h-base_timber_w]) cubeI([width-base_timber_w*2, base_timber_h, base_timber_w]);\n*\/\n \/\/DuPont Tyvek Housewrap - 100m 1.4m\n translate([0,0,base_timber_h]) houseWrapLayer(width,length,overlap=25);\n\n \/\/OSB Board - although the board is not cut by 1 mm (wrap_t) in each\n \/\/ direction for drawing purposes it is shaved\n translate([wrap_t,wrap_t,base_timber_h+wrap_t]) OSB([width-wrap_t*2,length-wrap_t*2,base_sheet_t]); \n}\n\nmodule floorBeams(width = shed_width, length = shed_length, overlap = 150, cross_beams=5)\n{\n echo(\"floorBeams\");\n \/\/ from one end along the front\n translate([0,0,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, 0, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, base_timber_w, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Again at the back\n \/\/ from one end along the front\n translate([0,width-base_timber_w,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, width-base_timber_w, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, width-base_timber_w*2, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Each end of shed\n translate([0, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n translate([length-base_timber_h, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n\n \/\/ Middle suport\n translate([base_timber_h, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([length-base_timber_h-timber_length_unit, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit+base_timber_h-overlap, (width-base_timber_w)\/2+base_timber_w, 0]) cubeI([length-2*timber_length_unit+overlap, base_timber_w, base_timber_h]);\n\n \/\/ Middle Cross beams0\n translate([(length-base_timber_w)\/2-base_timber_h\/2, base_timber_w*2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2, base_timber_w]);\n translate([(length-base_timber_w)\/2+base_timber_h\/2, base_timber_w*3+(width-3*base_timber_w)\/2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2-2*base_timber_w, base_timber_w]);\n \n}\n\n\nmodule floorPanels(width = shed_width, length = shed_length)\n{\n echo(\"floorPanels\");\n sheet_width_inc_wrap = sheet_width + 2*wrap_t;\n num_width_panels = round(-0.5+length\/sheet_width_inc_wrap);\n for(base_x = [0 : num_width_panels-1])\n {\n translate([base_x*sheet_width_inc_wrap, 0, 0]) floorPanel(sheet_width_inc_wrap,width);\n }\n full_panels_width = sheet_width_inc_wrap*num_width_panels;\n translate([full_panels_width, 0, 0]) floorPanel(length-full_panels_width,width);\n}\n\nmodule verticalStruts(width, height, beams=0, extra_struct=0)\n{\n cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,height-timber_construct_w]) cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n translate([width-timber_construct_w,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n\n if(beams>0 && extra_struct==0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing = middle_height\/(beams+1);\n for(loop=[1:beams])\n {\n translate([timber_construct_w, 0, beam_spacing*loop]) cubeI([width-timber_construct_w*2,timber_construct_h,timber_construct_w]);\n }\n }\n if(beams==0 && extra_struct>0)\n {\n middle_width = width-timber_construct_w*1;\n beam_spacing = middle_width\/(extra_struct+1);\n for(loop=[1:extra_struct])\n {\n translate([beam_spacing*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n }\n }\n if(beams>0 && extra_struct>0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing_h = middle_height\/(beams+1);\n middle_width = width-timber_construct_w*1;\n beam_spacing_w = middle_width\/(extra_struct+1);\n\n \/\/ Wee need to off set, so we divide by mod 2\n \/\/ move the all the beams down by timber_construct_w\n \/\/ but add loop mod 2 * timber_construct_w \n \/\/ (hence odd move up, even remain down\n \n for(loop=[0:extra_struct])\n {\n if (loop>0)\n translate([beam_spacing_w*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n for(loop_b=[1:beams])\n {\n offset = - timber_construct_w + (timber_construct_w * (loop%2));\n translate([timber_construct_w+beam_spacing_w*loop, 0, beam_spacing_h*loop_b+offset]) cubeI([beam_spacing_w-timber_construct_w,timber_construct_h,timber_construct_w]);\n }\n } \n }\n}\n\nmodule backStructs(width = shed_length, height = shed_back_height, structs_sets=3, beams=2, extra_struct=1)\n{\n echo(\"backStructs\");\n translate([wrap_t,shed_width-timber_construct_h-wrap_t,first_layer]) \n {\n struct_set_w = (width-wrap_t*2)\/structs_sets;\n for(structs=[0:structs_sets-1])\n {\n echo(\"backStructs - Section\");\n translate([structs*struct_set_w,0,0]) verticalStruts(struct_set_w, height, beams=beams, extra_struct=extra_struct);\n }\n }\n \n}\n\nmodule sideStructs(width = shed_width, height = shed_back_height, beams=2, extra_struct=2)\n{\n echo(\"SideStructs\");\n translate([timber_construct_h+wrap_t,timber_construct_h,first_layer])\n {\n rotate([0,0,90]) verticalStruts(width-timber_construct_h*2, height, beams=beams, extra_struct=extra_struct);\n } \n}\n\n\nmodule leftSideStructs()\n{\n echo(\"leftSideStructs\");\n sideStructs();\n}\n\n\nmodule rightSideStructs()\n{\n echo(\"rightSideStructs\");\n translate([shed_length-timber_construct_h-wrap_t*2,0,0]) sideStructs();\n}\n\n\nmodule frontStructs()\n{\n echo(\"frontStructs\");\n translate([wrap_t,-wrap_t,first_layer+1]) \n {\n verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=0);\n translate([space_to_window_w,0,0]) verticalStruts(window_w, space_to_window_h, beams=1, extra_struct=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=1);\n translate([space_to_door_w+door_w,0,0]) verticalStruts(shed_length-(space_to_door_w+door_w), door_h, beams=2, extra_struct=0);\n \/\/ top part, which is longer than a standard timber_length_unit \n gap = (space_to_door_w - timber_length_unit)\/2;\n remainder = shed_length - timber_length_unit - gap;\n translate([0,0,door_h]) verticalStruts(gap, shed_front_height-door_h, beams=0, extra_struct=0);\n translate([gap,0,door_h]) verticalStruts(timber_length_unit, shed_front_height-door_h, beams=0, extra_struct=2);\n translate([timber_length_unit + gap,0,door_h]) verticalStruts(remainder, shed_front_height-door_h, beams=0, extra_struct=2);\n }\n}\n\nmodule roof()\n{\n echo(\"roof\");\n \/\/ hyp\n inner_width = hyp+timber_construct_h;\n flat_offset = (sheet_length - inner_width)\/2;\n\n translate([-flat_offset,-wrap_t,shed_front_height+ first_layer +1 +thin_opp ]) rotate([-theta,0,0]) \n {\n frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, left_offset=flat_offset);\n translate([sheet_width*4,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, right_offset=flat_offset, sw= shed_length - sheet_width*4+flat_offset*2);\n\n translate([sheet_width,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*2,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*3,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n }\n}\n\nmodule frameSheet(left_offset=0, right_offset=0, front_offset=0, back_offset=0, sheet_left_offset=0, sheet_right_offset=0, sheet_front_offset=0, sheet_back_offset=0, sw=sheet_width, sl = sheet_length)\n{\n translate([left_offset, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n translate([sw-right_offset-timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n\n beam_l = (sw-left_offset-right_offset-3*timber_construct_h)\/2;\n \n translate([left_offset+beam_l+timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n\n translate([sheet_left_offset, sheet_front_offset, timber_construct_w]) OSB([sw-sheet_back_offset,sl-sheet_right_offset, base_sheet_t]);\n mirror([0,0,1]) translate([sheet_left_offset, sheet_front_offset, -timber_construct_w-base_sheet_t-wrap_t]) \n houseWrapLayer(sw-sheet_back_offset+2*wrap_t,sl-sheet_right_offset+2*wrap_t, overlap=25);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n echo(\"Cladding: \", x, board_height); \n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 34, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall()\n{\n translate([shed_length,shed_width,first_layer]) rotate([0,0,180]) caddings(shed_length, shed_back_height);\n}\n\nmodule claddingLeftWall()\n{\n translate([0,shed_width,first_layer]) rotate([0,0,180+90]) \n difference()\n {\n caddings(shed_width, shed_front_height);\n translate([-opp,-opp,shed_front_height-opp]) rotate([0,-theta,0]) cube([shed_width*2,opp*2, opp*2]);\n }\n}\n\nmodule claddingRightWall()\n{\n translate([shed_length,0,first_layer]) rotate([0,0,180-90]) \n difference()\n {\n caddings(shed_width, shed_front_height);\n translate([-opp,-opp,shed_back_height+opp+base_timber_h]) rotate([0,theta,0]) cube([shed_width*2,opp*2, opp*2]);\n }\n}\n\nmodule claddingFrontWall()\n{\n translate([0,0,first_layer]) rotate([0,0,0]) \n difference()\n {\n caddings(shed_length, shed_front_height);\n translate([space_to_window_w, -50, space_to_window_h]) cube([window_w, 100, window_h]);\n translate([space_to_door_w, -50, 0]) cube([door_w, 100, door_h]);\n }\n}\n\n\nfloorBeams();\n\nfloorPanels();\n\nbackStructs();\n\nleftSideStructs();\nrightSideStructs();\n\nfrontStructs();\nroof();\n\nbeamsWrap();\n\ncladdingBackWall();\ncladdingLeftWall();\ncladdingRightWall();\ncladdingFrontWall();","old_contents":"shed_length = 5184;\nshed_width = 1981;\nshed_front_height = 2250;\n\/\/shed_back_height = 2030;\n\nwindow_w=1830;\nwindow_h=920; \ndoor_w=858; \/\/ 1981 x 838mm + 20\ndoor_h=1991; \/\/ 1981 x 838mm + 20\nshed_back_height = door_h;\n\nspace_to_window_w=window_w\/2;\nspace_to_window_h=door_h-window_h;\nspace_to_door_w=window_w + 2*space_to_window_w;\n\n\n\nbase_timber_w = 47;\nbase_timber_h = 75;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\ntimber_length_unit=2400;\nbase_sheet_t = 18;\nsheet_width = 1220;\nsheet_length = 2440;\n\nwrap_t = 1;\n\nfirst_layer = base_timber_h+wrap_t+base_sheet_t;\n\n\nopp = shed_front_height-shed_back_height;\nadj = shed_width -timber_construct_h;\nhyp = sqrt(opp*opp+adj*adj);\ntheta = atan(opp\/adj);\nthin_opp = tan(theta) * timber_construct_h;\n\necho(\"Theta \", theta);\n\nmodule cubeI(size,comment=\"\/\/\", center=false)\n{\n if (comment != \"\/\/\")\n echo(comment);\n \/\/ Cube - but will echo dimensions in order of size\n if( (size[0]>size[1]) && (size[1]>=size[2]) )\n echo( size[0], size[1], size[2]);\n if( (size[0]>size[2]) && (size[2]>size[1]) )\n echo( size[0], size[2], size[1]);\n \n if( (size[1]>size[0]) && (size[0]>=size[2]) )\n echo( size[1], size[0], size[2]);\n if( (size[1]>size[2]) && (size[2]>size[0]) )\n echo( size[1], size[2], size[0]);\n \n if( (size[2]>size[0]) && (size[0]>=size[1]) )\n echo( size[2], size[0], size[1]);\n if( (size[2]>size[1]) && (size[1]>size[0]) )\n echo( size[2], size[1], size[0]);\n\n cube(size, center=center);\n}\n\nmodule houseWrapLayer(width,length, overlap=100)\n{\n echo(\"House Wrap\",width+overlap,length+overlap);\n color(\"Black\",0.75)\n {\n cube([width, length, wrap_t]);\n cube([width, wrap_t, overlap]);\n translate([0,length-wrap_t,0]) cube([width, wrap_t, overlap]);\n cube([wrap_t, length, overlap]);\n translate([width-wrap_t,0,0]) cube([wrap_t, length, overlap]);\n }\n}\n\n\nmodule beamsWrap()\n{\n \n translate([0,shed_width,first_layer]) rotate([90,0,0]) houseWrapLayer(shed_length,shed_back_height, overlap=100);\n\n translate([0,-1,first_layer]) rotate([90,0,90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height+timber_construct_h,-opp]) rotate([0,0,-theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n\n translate([shed_length,shed_width-1,first_layer]) rotate([90,0,-90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height-opp,-opp]) rotate([0,0,theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n\n}\n\n\nmodule OSB(size,center=false)\n{\n echo(\"OSB\");\n cubeI(size,center=center);\n}\n\n\nmodule floorPanel(width,length)\n{\n\/*\n echo(\"Timber\");\n \/\/Timber supporting base along left side\n cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base along right side\n translate([width-base_timber_w,0,0]) cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base Middle of I\n translate([base_timber_w,(length-base_timber_h)\/2,base_timber_h-base_timber_w]) cubeI([width-base_timber_w*2, base_timber_h, base_timber_w]);\n*\/\n \/\/DuPont Tyvek Housewrap - 100m 1.4m\n translate([0,0,base_timber_h]) houseWrapLayer(width,length,overlap=25);\n\n \/\/OSB Board - although the board is not cut by 1 mm (wrap_t) in each\n \/\/ direction for drawing purposes it is shaved\n translate([wrap_t,wrap_t,base_timber_h+wrap_t]) OSB([width-wrap_t*2,length-wrap_t*2,base_sheet_t]); \n}\n\nmodule floorBeams(width = shed_width, length = shed_length, overlap = 150, cross_beams=5)\n{\n echo(\"floorBeams\");\n \/\/ from one end along the front\n translate([0,0,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, 0, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, base_timber_w, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Again at the back\n \/\/ from one end along the front\n translate([0,width-base_timber_w,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, width-base_timber_w, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, width-base_timber_w*2, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Each end of shed\n translate([0, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n translate([length-base_timber_h, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n\n \/\/ Middle suport\n translate([base_timber_h, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([length-base_timber_h-timber_length_unit, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit+base_timber_h-overlap, (width-base_timber_w)\/2+base_timber_w, 0]) cubeI([length-2*timber_length_unit+overlap, base_timber_w, base_timber_h]);\n\n \/\/ Middle Cross beams0\n translate([(length-base_timber_w)\/2-base_timber_h\/2, base_timber_w*2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2, base_timber_w]);\n translate([(length-base_timber_w)\/2+base_timber_h\/2, base_timber_w*3+(width-3*base_timber_w)\/2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2-2*base_timber_w, base_timber_w]);\n \n}\n\n\nmodule floorPanels(width = shed_width, length = shed_length)\n{\n echo(\"floorPanels\");\n sheet_width_inc_wrap = sheet_width + 2*wrap_t;\n num_width_panels = round(-0.5+length\/sheet_width_inc_wrap);\n for(base_x = [0 : num_width_panels-1])\n {\n translate([base_x*sheet_width_inc_wrap, 0, 0]) floorPanel(sheet_width_inc_wrap,width);\n }\n full_panels_width = sheet_width_inc_wrap*num_width_panels;\n translate([full_panels_width, 0, 0]) floorPanel(length-full_panels_width,width);\n}\n\nmodule verticalStruts(width, height, beams=0, extra_struct=0)\n{\n cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,height-timber_construct_w]) cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n translate([width-timber_construct_w,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n\n if(beams>0 && extra_struct==0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing = middle_height\/(beams+1);\n for(loop=[1:beams])\n {\n translate([timber_construct_w, 0, beam_spacing*loop]) cubeI([width-timber_construct_w*2,timber_construct_h,timber_construct_w]);\n }\n }\n if(beams==0 && extra_struct>0)\n {\n middle_width = width-timber_construct_w*1;\n beam_spacing = middle_width\/(extra_struct+1);\n for(loop=[1:extra_struct])\n {\n translate([beam_spacing*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n }\n }\n if(beams>0 && extra_struct>0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing_h = middle_height\/(beams+1);\n middle_width = width-timber_construct_w*1;\n beam_spacing_w = middle_width\/(extra_struct+1);\n\n \/\/ Wee need to off set, so we divide by mod 2\n \/\/ move the all the beams down by timber_construct_w\n \/\/ but add loop mod 2 * timber_construct_w \n \/\/ (hence odd move up, even remain down\n \n for(loop=[0:extra_struct])\n {\n if (loop>0)\n translate([beam_spacing_w*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n for(loop_b=[1:beams])\n {\n offset = - timber_construct_w + (timber_construct_w * (loop%2));\n translate([timber_construct_w+beam_spacing_w*loop, 0, beam_spacing_h*loop_b+offset]) cubeI([beam_spacing_w-timber_construct_w,timber_construct_h,timber_construct_w]);\n }\n } \n }\n}\n\nmodule backStructs(width = shed_length, height = shed_back_height, structs_sets=3, beams=2, extra_struct=1)\n{\n echo(\"backStructs\");\n translate([wrap_t,shed_width-timber_construct_h-wrap_t,first_layer]) \n {\n struct_set_w = (width-wrap_t*2)\/structs_sets;\n for(structs=[0:structs_sets-1])\n {\n echo(\"backStructs - Section\");\n translate([structs*struct_set_w,0,0]) verticalStruts(struct_set_w, height, beams=beams, extra_struct=extra_struct);\n }\n }\n \n}\n\nmodule sideStructs(width = shed_width, height = shed_back_height, beams=2, extra_struct=2)\n{\n echo(\"SideStructs\");\n translate([timber_construct_h+wrap_t,timber_construct_h,first_layer])\n {\n rotate([0,0,90]) verticalStruts(width-timber_construct_h*2, height, beams=beams, extra_struct=extra_struct);\n } \n}\n\n\nmodule leftSideStructs()\n{\n echo(\"leftSideStructs\");\n sideStructs();\n}\n\n\nmodule rightSideStructs()\n{\n echo(\"rightSideStructs\");\n translate([shed_length-timber_construct_h-wrap_t*2,0,0]) sideStructs();\n}\n\n\nmodule frontStructs()\n{\n echo(\"frontStructs\");\n translate([wrap_t,-wrap_t,first_layer+1]) \n {\n verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=0);\n translate([space_to_window_w,0,0]) verticalStruts(window_w, space_to_window_h, beams=1, extra_struct=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=1);\n translate([space_to_door_w+door_w,0,0]) verticalStruts(shed_length-(space_to_door_w+door_w), door_h, beams=2, extra_struct=0);\n \/\/ top part, which is longer than a standard timber_length_unit \n gap = (space_to_door_w - timber_length_unit)\/2;\n remainder = shed_length - timber_length_unit - gap;\n translate([0,0,door_h]) verticalStruts(gap, shed_front_height-door_h, beams=0, extra_struct=0);\n translate([gap,0,door_h]) verticalStruts(timber_length_unit, shed_front_height-door_h, beams=0, extra_struct=2);\n translate([timber_length_unit + gap,0,door_h]) verticalStruts(remainder, shed_front_height-door_h, beams=0, extra_struct=2);\n }\n}\n\nmodule roof()\n{\n echo(\"roof\");\n \/\/ hyp\n inner_width = hyp+timber_construct_h;\n flat_offset = (sheet_length - inner_width)\/2;\n\n translate([-flat_offset,-wrap_t,shed_front_height+ first_layer +1 +thin_opp ]) rotate([-theta,0,0]) \n {\n frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, left_offset=flat_offset);\n translate([sheet_width*4,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, right_offset=flat_offset, sw= shed_length - sheet_width*4+flat_offset*2);\n\n translate([sheet_width,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*2,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*3,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n echo(\"FlatOffset\", flat_offset);\n }\n}\n\nmodule frameSheet(left_offset=0, right_offset=0, front_offset=0, back_offset=0, sheet_left_offset=0, sheet_right_offset=0, sheet_front_offset=0, sheet_back_offset=0, sw=sheet_width, sl = sheet_length)\n{\n translate([left_offset, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n translate([sw-right_offset-timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n\n beam_l = (sw-left_offset-right_offset-3*timber_construct_h)\/2;\n \n translate([left_offset+beam_l+timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n\n translate([sheet_left_offset, sheet_front_offset, timber_construct_w]) OSB([sw-sheet_back_offset,sl-sheet_right_offset, base_sheet_t]);\n mirror([0,0,1]) translate([sheet_left_offset, sheet_front_offset, -timber_construct_w-base_sheet_t-wrap_t]) \n houseWrapLayer(sw-sheet_back_offset+2*wrap_t,sl-sheet_right_offset+2*wrap_t, overlap=25);\n}\n\n\n\nfloorBeams();\n\nfloorPanels();\n\nbackStructs();\n\nleftSideStructs();\nrightSideStructs();\n\nfrontStructs();\nroof();\n\nbeamsWrap();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"83184c3ef538beabeadcada6ab46291ea0a9dbba","subject":"cross will probably be a better tool","message":"cross will probably be a better tool\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"center_print_test\/center.scad","new_file":"center_print_test\/center.scad","new_contents":"cube([10,1,1], center=true);\nrotate([0,0,90])\n cube([10,1,1], center=true);\n","old_contents":"cylinder(r=2, h=1, center=true, $fs=0.1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c7f2e079acd8ecd55c42395555251e74b1fd5b72","subject":"parameterize the x,y scale","message":"parameterize the x,y scale\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/customizer\/half-circle-phone-stand-customizer.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/customizer\/half-circle-phone-stand-customizer.scad","new_contents":"\nbase_xTranslate = 0; \/\/ [-10: 0.1 :10]\n\nbase_yTranslate = 0; \/\/ [-10: 0.1 :10]\n\nstand_connectorBar_xLength = 8; \/\/ [-10: 0.1 :10]\n\nstand_top_xTranslate = 8.105; \/\/ [-10: 0.1 :10]\n\nstand_top_yTranslate = 8.85; \/\/ [-10: 0.1 :10]\n\niconType = \"Mario\"; \/\/ [Aqua Dude, Bass Clef, Cat, Creeper, Fan, Fish, Heart, Light Bulb, Luigi, Mario, Moon, Rebel, Spur, Sun, Thundercat, Treble Clef, Trooper]\n\niconColor = \"blue\"; \/\/ [pink, red, black, white, yellow, blue, green]\n\nicon_xOffset = -9; \/\/ [-30:30]\n\nicon_yOffset = 34; \/\/ [-10:200]\n\nicon_zOffset = 19; \/\/ [-30:30]\n\niconXyScale = 1.0; \/\/ [-1: 0.1 :10]\n\nbed_cutout_zLength = 10; \/\/ [4.2 : 15]\n\nheight = 40; \/\/ [19.125 : 60]\n\n\/* [Hidden] *\/\n\nuse <..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n iconColor = iconColor,\n icon_xOffset = icon_xOffset,\n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n iconXyScale = iconXyScale,\n iconType = iconType,\n stand_connectorBar_xLength = stand_connectorBar_xLength,\n stand_top_xTranslate = stand_top_xTranslate,\n stand_top_yTranslate = stand_top_yTranslate);\n\n","old_contents":"\nbase_xTranslate = 0; \/\/ [-10: 0.1 :10]\n\nbase_yTranslate = 0; \/\/ [-10: 0.1 :10]\n\nstand_connectorBar_xLength = 8; \/\/ [-10: 0.1 :10]\n\nstand_top_xTranslate = 8.105; \/\/ [-10: 0.1 :10]\n\nstand_top_yTranslate = 8.85; \/\/ [-10: 0.1 :10]\n\niconType = \"Mario\"; \/\/ [Aqua Dude, Bass Clef, Cat, Creeper, Fan, Fish, Heart, Light Bulb, Luigi, Mario, Moon, Rebel, Spur, Sun, Thundercat, Treble Clef, Trooper]\n\niconColor = \"blue\"; \/\/ [pink, red, black, white, yellow, blue, green]\n\nicon_xOffset = -9; \/\/ [-30:30]\n\nicon_yOffset = 34; \/\/ [-10:200]\n\nicon_zOffset = 19; \/\/ [-30:30]\n\nbed_cutout_zLength = 10; \/\/ [4.2 : 15]\n\nheight = 40; \/\/ [19.125 : 60]\n\n\/* [Hidden] *\/\n\nuse <..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n iconColor = iconColor,\n icon_xOffset = icon_xOffset,\n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n iconType = iconType,\n stand_connectorBar_xLength = stand_connectorBar_xLength,\n stand_top_xTranslate = stand_top_xTranslate,\n stand_top_yTranslate = stand_top_yTranslate);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3dbce3a24f9bca5b60ae4e13cfdd03091e4aa40c","subject":"added pentagon core for player","message":"added pentagon core for player\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n pentagon_core();\n}\n\ncase();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nmodule case() {\n \/\/spoke_lid();\n string_lid();\n}\n\ncase();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c433bbed4e9db210b378d1c44fe22f66835b59e4","subject":"for a demo","message":"for a demo\n","repos":"luoyi\/RpiPlayer","old_file":"RpiPlayer.scad","new_file":"RpiPlayer.scad","new_contents":"$fn=100;\nmodule round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\nmodule gong_bang(all_x, side_x, mid_w, side_y, h) {\n cube([all_x, mid_w, h], center=true);\n translate([(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, side_y\/2,0])\n cylinder(r=side_x, h=h, center=true);\n translate([-(all_x-side_x)\/2, -side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n translate([(all_x-side_x)\/2, -side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n translate([(all_x-side_x)\/2, side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n}\n\n\nshrink=0.1;\nmodule gong_bang_shrink(all_x, side_x, mid_w, side_y, h) {\n gong_bang(all_x-shrink, side_x-shrink, mid_w-shrink, \n side_y-shrink, h);\n}\n\n\/\/gong_bang(80, 2, 2, 10, 40);\n\n\n\nout_x=46;\nout_y=26;\nall_z=20;\nall_r=4;\n\nlr_width=3;\nf_width=3;\nb_width=10;\nbottom_h=3;\n\ngb_x=out_x-2*all_r;\ngb_sx=1;\ngb_mw=2;\ngb_sy=6;\n\ntop_z=bottom_h;\n\n\n\n\ndifference () {\nround_cube(out_x,out_y,all_z,all_r); \ntranslate([0,(f_width-b_width)\/2,bottom_h]) round_cube(out_x-2*lr_width,out_y-f_width-b_width,all_z,all_r);\ncolor([1,0,0]) \ntranslate([0, (out_y - b_width)\/2 + all_r, 2])\ngong_bang(gb_x, gb_sx, gb_mw, gb_sy, all_z);\ntranslate([0, out_y\/2, bottom_h]) \n cube([gb_x-gb_sx-4, out_y, all_z], center=true);\n}\n\n\n\/\/union() {\n\/\/round_cube(out_x,out_y,top_z,bottom_h); \ntranslate([-100, 0,all_z])\nunion() {\nround_cube(out_x,out_y,bottom_h,all_r); \n translate([0,0,bottom_h])\n difference() {\ncolor([1,0,0]) \ntranslate([0,(f_width-b_width)\/2,0]) round_cube(out_x-2*lr_width,out_y-f_width-b_width,bottom_h,all_r); \ntranslate([0,(f_width-b_width)\/2,1]) round_cube(out_x-4*lr_width,out_y-f_width-b_width-4,bottom_h,all_r); }\ncolor([0,0,1])\ntranslate([0, (out_y - b_width)\/2 + all_r, all_z\/2-1])\ngong_bang(gb_x, gb_sx, gb_mw, gb_sy, all_z);\n\/\/color([0,1,0]) \n\/\/translate([0,(f_width-b_width)\/2,-(top_z)]) round_cube(out_x-4*lr_width,out_y-f_width-b_width-10,bottom_h+1,all_r); \n }\n\/\/}\n\n\n","old_contents":"module round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\nmodule gong_bang(all_x, side_x, mid_w, side_y, h) {\n cube([all_x, mid_w, h], center=true);\n translate([(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n}\n\ngong_bang(80, 2, 2, 10, 40);\n\n\n\/*\ncolor([0.5,0.5,0.99]) \ndifference () {\nround_cube(80+6,60+6,40,4); \ntranslate([0,-2,3]) round_cube(80,58,40,4);\n\/\/translate([0,20,3]) round_cube(70,3,20,4);\ntranslate([0,33.5,2]) cube([70,3,40],center=true);\n}\n*\/\n\n","returncode":0,"stderr":"","license":"artistic-2.0","lang":"OpenSCAD"} {"commit":"1e505396581649e42545aae915fb252c956437c2","subject":"Added rim.","message":"Added rim.\n","repos":"chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella","old_file":"cad\/mezzanine.scad","new_file":"cad\/mezzanine.scad","new_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes a well for a breadboard and\n\/\/ rivet holes for a battery.\nthickness = 4;\nwide_y = 26; \/\/ The length of the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = 86; \/\/ Greatest extent of the plate\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nnarrow_x= 45; \/\/ 1\/2 width of the battery holder\nbreadboard_x = 52; \/\/ Chopped\nbreadboard_y = 26; \/\/ Chopped\nbreadboard_z = 10;\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = 30; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\nrivet1_x = 54;\nrivet2_x = 60;\nrivet_y = 8;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the GPIO pins.\n\/\/ This object cannot be translated once created.\n\/\/ y is negative towards us. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n \/\/ place 4 circles in the corners, with the rounding radius\n translate([-wide_x+round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,-wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,-wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate.\n\/\/ There should be no rim where the hulls join\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, -wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, -wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, -full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth,-full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\nbase(thickness);\ntranslate([0,0,thickness\/2])\ndifference() {\n base(thickness);\n base_cutout(thickness,rim);\n }","old_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes a well for a breadboard and\n\/\/ rivet holes for a battery.\nthickness = 4;\nwide_y = 26; \/\/ The length of the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = 86; \/\/ Greatest extent of the plate\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nnarrow_x= 45; \/\/ 1\/2 width of the battery holder\nbreadboard_x = 52; \/\/ Chopped\nbreadboard_y = 26; \/\/ Chopped\nbreadboard_z = 10;\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = 30; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\nrivet1_x = 54;\nrivet2_x = 60;\nrivet_y = 8;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the GPIO pins.\n\/\/ This object cannot be translated once created.\n\/\/ y is negative towards us. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n \/\/ place 8 circles in the corners, with the rounding radius\n translate([-wide_x+round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,-wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,-wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate.\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n \/\/ place 8 circles in the corners, with the rounding radius\n translate([-wide_x+round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n } \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\nbase(thickness);\ntranslate([0,0,thickness\/2])\ndifference() {\n base(thickness);\n base_cutout(thickness,rim);\n }","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"57e124593762a56e5f2360e06f6e20d4da36c2ec","subject":"A\u00f1adidas casillas finales","message":"A\u00f1adidas casillas finales\n","repos":"jalcaldea\/Empotrados","old_file":"modelos\/casilla.scad","new_file":"modelos\/casilla.scad","new_contents":"module arandela(interior,total,altura)\n{\n\t\tdifference() {\n\t\t\tcylinder(h= altura, r=total,$fa=1,$fs=0.1);\n\t\t\ttranslate([0,0,-1]){\n\t\t\t\tcylinder(h=altura+2, r=interior,$fa=1,$fs=0.1);\n\t\t\t}\n\t\t}\n}\n\nmodule base(alto,ancho,largo,anc){\n\tdifference() {\n\t\tcylinder(h=alto, r=ancho+largo,$fa=1,$fs=0.1);\n\t\ttranslate([0,0,-1]){\n\t\t\tdifference() {\n\t\t\t\tcylinder(h=alto-anc, r=ancho+largo+1,$fa=1,$fs=0.1);\n\t\t\t\ttranslate([0,0,-1]){\n\t\t\t\t\tcylinder(h=alto-anc+2, r=ancho,$fa=1,$fs=0.1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule led(ancho1, profundo1, ancho2){\ntranslate([0,0,ha+1]){\nrotate([180,0,0]){\n\tcylinder(h=profundo1, r=ancho1,$fa=1,$fs=0.1);\n\tdifference(){\n\t\thull(){\n\t\ttranslate([ancho1\/2,0,0]){\n\t\tcylinder(h=ha+2,r=ancho2,$fa=1,$fs=0.1);\n\t\t}\n\t\ttranslate([-(ancho1\/2),0,0]){\n\t\tcylinder(h=ha+2,r=ancho2,$fa=1,$fs=0.1);\n\t\t}}\n\t\tcube(size = [1,2,ha+100], center = true);\n\t}\n}}\n}\n\nmodule toSubstract(){\n\t\tarandela(8.5,15.4,3.9);\n\t\tarandela(3.5,7,2.2);\n}\n\nmodule base_arandelas(a,ab,b){\n\ntranslate([0,0,ha+0.1]){\nrotate([180,0,0]){\ndifference(){\n\ntranslate([0,0,ha+0.1]){\nrotate([180,0,0]){\n\t\tbase(ha,a,ab,b);\n}\n}\n\t\ttoSubstract();\n\t}\n}}}\n\nmodule cable(dist){\ntranslate([dist,0,-3]){\ncylinder(h=ha, r=1,$fa=1,$fs=0.1);\ntranslate([0,0,ha]){\nsphere(2, $fa=1, $fs=0.1);\n}\n}\n}\n\nmodule cable2(dist){\ntranslate([-dist,0,-1.5]){\ncylinder(h=ha, r=1,$fa=1,$fs=0.1);\ntranslate([0,0,ha]){\nsphere(1.5, $fa=1, $fs=0.1);\n}\n}\n}\n\n\nha=20;\na=17;\nab=2;\nb=1;\n\n\ndifference(){\nbase_arandelas(a,ab,b);\nled(3.1,8,1);\ncable(12.25);\ncable2(5.25);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'modelos\/casilla.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7a07eec63c92c9caee2ff7c0fd064fa654d2455a","subject":"misc: add array_header_col_{add,subtract}","message":"misc: add array_header_col_{add,subtract}\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"915bac61cedd75a8736f4bbab87e5ed4a6cbd7b5","subject":"timing_belts: Add","message":"timing_belts: Add\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"timing-belts.scad","new_file":"timing-belts.scad","new_contents":"\/*Parametric belting section generator \n * types GT2 2mm T2.5 T5 T10 MXL\n *\n * (c) ALJ_rprp\n *\n * Derived from http:\/\/www.thingiverse.com\/\n * thing:19758 By The DoomMeister\n * thing:16627 by Droftarts\n *\n * licence GPL 2.1 or later\n *\n * deal properly with ends\n * allow circular segments\n * length is given in mm not nb of teeth\n * belt is centered at z=0 and extend along x\n * \n * TODO : add ofset for cosmetic teeth liaisons between segments\n *\n * usage :\n * belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90,fn=128)\n * belt_len (prf = tT2_5, belt_width = 6, len = 10)\n *\/\n\n\n\/\/ profiles\ntGT2_2=0;\ntT2_5=1;\ntT5=2;\ntT10=3;\ntMXL=4;\n\n\/*test_belt();*\/\n\nmodule test_belt() {\n translate([-00.5,0,5.5])cube([1,40,1]);\n\n belt_len(profile = tT10, belt_width = 10, len = 100);\n translate([0,0,-20])color(\"red\")belt_len(profile = tT5, belt_width = 10, len = 100);\n translate([0,0,-40])color(\"green\")belt_len(profile = tT2_5, belt_width = 10, len = 80);\n translate([0,0,-60])color(\"blue\")belt_len(profile = tGT2_2, belt_width = 10, len = 100);\n translate([0,0,-80])color(\"orange\")belt_len(profile = tMXL, belt_width = 10, len = 100);\n\n translate([0,0,-0]) belt_angle(tT10,20,10,180);\n translate([0,0,-20]) belt_angle(tT5,15,10,90);\n translate([0,0,-40]) belt_angle(tT2_5,25,10,120);\n translate([0,0,-60]) belt_angle(tGT2_2,30,10,40);\n translate([0,0,-80]) belt_angle(tMXL,30,10,40);\n\n\n translate([0,0,-100])color(\"aquamarine\") {\n belt_len(tT2_5,10, 50);\n translate([50,30,0]) rotate([0,0,180]) belt_len(tT2_5,10,50);\n translate([ 0,30,0]) rotate([0,0,180]) belt_angle(tT2_5,15,10,180);\n translate([50,0,0]) rotate([0,0,0]) belt_angle(tT2_5,15,10,180);\n }\n}\n\n\/* there is no partial rotate extrude in scad, hence the workaround\n * note that the pie slice will silently drop angles > 360 *\/\nmodule p_slice(radius, angle,height,back_t=0.6) {\n pt_slc = [[0,radius],\n [0 ,-back_t],\n [radius,-back_t],\n [radius+back_t,radius],\n [radius+back_t,radius*2],\n [0,radius*2+back_t],\n [-radius-back_t,radius*2+back_t],\n [-radius-back_t,radius],\n [-radius-back_t,-back_t],\n [(radius+back_t)*sin(angle),(radius+back_t)*(1-cos(angle))-back_t]];\n\n if (angle<=90) {\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,9]]);\n }else if (angle<=180){\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,3,4,9]]);\n }else if (angle<=270){\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,3,4,5,6,9]]);\n }else if (angle<360) {\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,3,4,5,6,7,8,9]]);\n }\n}\n\ndp=5;\n\nmodule belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90,fn=128) {\n av=360\/2\/rad\/3.14159*tpitch[prf];\n bk=bk_thick[prf];\n\n nn=ceil(angle\/av);\n ang=av*nn;\n intersection(){\n p_slice(rad,angle,bwdth,bk_thick[prf]);\n union () {\n for( i = [0:nn]){\n translate ([0,rad,-bwdth\/2])rotate ([0,0,av*i])translate ([0,-rad,0])\n draw_tooth(prf,0,bwdth);\n }\n translate ([0,rad,-bwdth\/2]) rotate_extrude(angle = 90, $fn=fn)\n polygon([[rad,0],[rad+bk,0],[rad+bk,bwdth],[rad,bwdth]]);\n }\n }\n}\n\n\/\/Outer Module\nmodule belt_len(profile = tT2_5, belt_width = 6, len = 10){\n if ( profile == tT2_5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT10 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tMXL )\t{ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tGT2_2 ){ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n}\n\n\/\/inner module\nmodule _belt_len(prf = -1, len = 10, bwdth = 5) {\n\n n=ceil(len\/tpitch[prf]);\n\n translate ([0,0,-bwdth\/2]) intersection() {\n union(){\n for( i = [0:n]) {\n draw_tooth(prf,i,bwdth);\n }\n translate([-1,-bk_thick[prf],0])cube([len+1,bk_thick[prf],bwdth]);\n }\n translate([0,-bk_thick[prf],0])cube([len,max_h[prf]+bk_thick[prf],bwdth]);\n }\n}\n\nmodule draw_tooth(prf,i,bwdth) {\n if ( prf == tT2_5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T2_5);}\n if ( prf == tT5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T5);}\n if ( prf == tT10 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T10);}\n if ( prf == tMXL ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_MXL);}\n if ( prf == tGT2_2 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_GT2_2);}\n}\n\n\/************************************\n *\t\t\t\tDATA TABLES\t\t\t\t\t*\n ************************************\/\n tpitch = [2,2.5,5,10,2.032];\n bk_thick=[0.6,0.6,1,2,0.64];\n max_h=[0.76447, 0.699911, 1.189895, 2.499784, 0.508035];\n\n pf_GT2_2= [[ 0.747183,-0.5 ],[ 0.747183, 0 ],[ 0.647876, 0.037218],\n [ 0.598311, 0.130528],[ 0.578556, 0.238423],[ 0.547158, 0.343077],\n [ 0.504649, 0.443762],[ 0.451556, 0.53975 ],[ 0.358229, 0.636924],\n [ 0.2484 , 0.707276],[ 0.127259, 0.750044],[ 0 , 0.76447 ],\n [-0.127259, 0.750044],[-0.2484 , 0.707276],[-0.358229, 0.636924],\n [-0.451556, 0.53975 ],[-0.504797, 0.443762],[-0.547291, 0.343077],\n [-0.578605, 0.238423],[-0.598311, 0.130528],[-0.648009, 0.037218],\n [-0.747183, 0 ],[-0.747183,-0.5]];\npf_T2_5= [[-0.839258,-0.5 ],[-0.839258, 0 ],[-0.770246, 0.021652],\n [-0.726369, 0.079022],[-0.529167, 0.620889],[-0.485025, 0.67826 ],\n [-0.416278, 0.699911],[ 0.416278, 0.699911],[ 0.484849, 0.67826 ],\n [ 0.528814, 0.620889],[ 0.726369, 0.079022],[ 0.770114, 0.021652],\n [ 0.839258, 0 ],[ 0.839258,-0.5]];\npf_T5= \t [[-1.632126,-0.5 ],[-1.632126, 0 ],[-1.568549, 0.004939],\n [-1.507539, 0.019367],[-1.450023, 0.042686],[-1.396912, 0.074224],\n [-1.349125, 0.113379],[-1.307581, 0.159508],[-1.273186, 0.211991],\n [-1.246868, 0.270192],[-1.009802, 0.920362],[-0.983414, 0.978433],\n [-0.949018, 1.030788],[-0.907524, 1.076798],[-0.859829, 1.115847],\n [-0.80682 , 1.147314],[-0.749402, 1.170562],[-0.688471, 1.184956],\n [-0.624921, 1.189895],[ 0.624971, 1.189895],[ 0.688622, 1.184956],\n [ 0.749607, 1.170562],[ 0.807043, 1.147314],[ 0.860055, 1.115847],\n [ 0.907754, 1.076798],[ 0.949269, 1.030788],[ 0.9837 , 0.978433],\n [ 1.010193, 0.920362],[ 1.246907, 0.270192],[ 1.273295, 0.211991],\n [ 1.307726, 0.159508],[ 1.349276, 0.113379],[ 1.397039, 0.074224],\n [ 1.450111, 0.042686],[ 1.507589, 0.019367],[ 1.568563, 0.004939],\n [ 1.632126, 0 ],[ 1.632126,-0.5]];\npf_T10= [[-3.06511 ,-1 ],[-3.06511 , 0 ],[-2.971998, 0.007239],\n [-2.882718, 0.028344],[-2.79859 , 0.062396],[-2.720931, 0.108479],\n [-2.651061, 0.165675],[-2.590298, 0.233065],[-2.539962, 0.309732],\n [-2.501371, 0.394759],[-1.879071, 2.105025],[-1.840363, 2.190052],\n [-1.789939, 2.266719],[-1.729114, 2.334109],[-1.659202, 2.391304],\n [-1.581518, 2.437387],[-1.497376, 2.47144 ],[-1.408092, 2.492545],\n [-1.314979, 2.499784],[ 1.314979, 2.499784],[ 1.408091, 2.492545],\n [ 1.497371, 2.47144 ],[ 1.581499, 2.437387],[ 1.659158, 2.391304],\n [ 1.729028, 2.334109],[ 1.789791, 2.266719],[ 1.840127, 2.190052],\n [ 1.878718, 2.105025],[ 2.501018, 0.394759],[ 2.539726, 0.309732],\n [ 2.59015 , 0.233065],[ 2.650975, 0.165675],[ 2.720887, 0.108479],\n [ 2.798571, 0.062396],[ 2.882713, 0.028344],[ 2.971997, 0.007239],\n [ 3.06511 , 0 ],[ 3.06511 ,-1]];\npf_MXL= [[-0.660421,-0.5 ],[-0.660421, 0 ],[-0.621898, 0.006033],\n [-0.587714, 0.023037],[-0.560056, 0.049424],[-0.541182, 0.083609],\n [-0.417357, 0.424392],[-0.398413, 0.458752],[-0.370649, 0.48514 ],\n [-0.336324, 0.502074],[-0.297744, 0.508035],[ 0.297744, 0.508035],\n [ 0.336268, 0.502074],[ 0.370452, 0.48514 ],[ 0.39811 , 0.458752],\n [ 0.416983, 0.424392],[ 0.540808, 0.083609],[ 0.559752, 0.049424],\n [ 0.587516, 0.023037],[ 0.621841, 0.006033],[ 0.660421, 0 ],\n [ 0.660421,-0.5]];\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'timing-belts.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"870801bb343adeabf6b64a1ec988f8e37b3252e4","subject":"bulachGlas prototype","message":"bulachGlas prototype\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"bulachGlas.scad","new_file":"bulachGlas.scad","new_contents":"$fn=100;\nradius=57;\nhClosed=35.5;\ndLid=5.3;\nradius2=50.5;\n\nmodule ring() {\n rotate_extrude()translate([57\/2-5.3\/2,0])circle(d=5.3);\n}\nmodule assembly() {\n translate([0,0,hClosed-dLid\/2])difference() {\n hull()ring();\n translate([0,0,dLid\/2])rotate([90,0,0])cylinder(h=radius,r=dLid,center=true);\n }\n difference() {\n cylinder(h=hClosed-dLid\/2,r=radius\/2);\n translate([0,0,hClosed])rotate([90,0,0])cylinder(h=radius,r=dLid,center=true);\n }\n translate([0,0,-20])cylinder(r=radius2\/2,h=20);\n}\n\ndifference() {\n translate([32.5\/2,0,20])cube([32.5,65,60],center=true);\n assembly();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'bulachGlas.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b1e2f5273e3b4fa1bbb3215d3c845dc5aa82cea1","subject":"y\/carriage-bearing-mount: fix use of linear_bearing_mount","message":"y\/carriage-bearing-mount: fix use of linear_bearing_mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-carriage-bearing-mount.scad","new_file":"y-carriage-bearing-mount.scad","new_contents":"include \ninclude \ninclude \ninclude \nuse \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [N, Z];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+get(LinearBearingOuterDiameter,yaxis_bearing)\/2], Z];\n\nmodule yaxis_carriage_bearing_mount(part)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n bearing_OD = get(LinearBearingOuterDiameter, yaxis_bearing);\n depth = max(bearing_OD, screw_dx+carriage_plate_thread_d*2);\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n if(part==U)\n {\n difference()\n {\n yaxis_carriage_bearing_mount(part=\"pos\");\n yaxis_carriage_bearing_mount(part=\"neg\");\n }\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n rcubea ([width, depth, height], align=Z);\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n for(y=[-1,1])\n translate ([x*screw_dx\/2, y*screw_dy\/2, -1]) \n cylindera(d=carriage_plate_thread_d, h=height+2, align=Z);\n\n }\n else if(part==\"vit\")\n {\n }\n\n translate([0,0,bearing_OD\/2+yaxis_carriage_bearing_mount_bottom_thick])\n linear_bearing_mount(\n part=part,\n bearing=yaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Y,\n ziptie_dist=4,\n mount_dir_align=Z\n );\n}\n\nmodule part_y_carriage_bearing_mount()\n{\n c1=[N,Z];\n attach(c1,yaxis_carriage_bearing_mount_conn_bottom)\n {\n yaxis_carriage_bearing_mount();\n }\n}\n","old_contents":"include \ninclude \ninclude \ninclude \nuse \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [N, Z];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+get(LinearBearingOuterDiameter,yaxis_bearing)\/2], Z];\n\nmodule yaxis_carriage_bearing_mount(part)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n bearing_OD = get(LinearBearingOuterDiameter, yaxis_bearing);\n depth = max(bearing_OD, screw_dx+carriage_plate_thread_d*2);\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n if(part==U)\n {\n difference()\n {\n yaxis_carriage_bearing_mount(part=\"pos\");\n yaxis_carriage_bearing_mount(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea ([width, depth, height], align=Z);\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n for(y=[-1,1])\n translate ([x*screw_dx\/2, y*screw_dy\/2, -1]) \n cylindera(d=carriage_plate_thread_d, h=height+2, align=Z);\n\n translate([0,0,bearing_OD\/2+yaxis_carriage_bearing_mount_bottom_thick])\n linear_bearing_mount(\n bearing=yaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Y,\n ziptie_dist=4\n );\n }\n else if(part==\"vit\")\n {\n translate([0,0,bearing_OD\/2+yaxis_carriage_bearing_mount_bottom_thick])\n linear_bearing(yaxis_bearing, orient=Y);\n }\n}\n\nmodule part_y_carriage_bearing_mount()\n{\n c1=[N,Z];\n attach(c1,yaxis_carriage_bearing_mount_conn_bottom)\n {\n yaxis_carriage_bearing_mount();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"524640e719fb779fca39c68c875078c628d9a686","subject":"x\/end: WIP start to use new linear_bearing","message":"x\/end: WIP start to use new linear_bearing\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+10*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nxaxis_z_bearing_mount_dir = X;\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=X, align=[-1,0,0]);\n\n \/\/ endstops mount support\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ z axis bearing support\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n intersection()\n {\n rcylindera(h=h, d=d, orient=Z, align=N);\n rcubea(size=[d,d,h], orient=Z, align=xaxis_z_bearing_mount_dir);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n rcubea(size=[d,d,h], orient=Z, align=-xaxis_z_bearing_mount_dir);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=Z, align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n\n if(show_bearings)\n {\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*xaxis_rod_distance\/2])*\/\n \/*translate([0, -xaxis_zaxis_distance_y, 0])*\/\n \/*bearing(zaxis_bearing);*\/\n\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate(-Z*xaxis_end_wz\/2)\n {\n linear_bearing(bearing=LinearBearingLMH12L, align=Z, offset_flange=true);\n }\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+5*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nxaxis_z_bearing_mount_dir = X;\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=X, align=[-1,0,0]);\n\n \/\/ endstops mount support\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n intersection()\n {\n rcylindera(h=h, d=d, orient=Z, align=N);\n rcubea(size=[d,d,h], orient=Z, align=xaxis_z_bearing_mount_dir);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n rcubea(size=[d,d,h], orient=Z, align=-xaxis_z_bearing_mount_dir);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=Z, align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e8b704eedf5cd75d9f6057aad226c5ca6561596c","subject":"This is an enclosure prototype.","message":"This is an enclosure prototype.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad","new_contents":"\r\ngt","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8f24435f6bf8bf93351d1ae8ebbcec6533bae332","subject":"z-motor-mount: fix nut trap cuts for clamp","message":"z-motor-mount: fix nut trap cuts for clamp\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-motor-mount.scad","new_file":"z-motor-mount.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\nuse \n\n\nmodule zaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n zaxis_motor_mount(part=\"pos\");\n zaxis_motor_mount(part=\"neg\");\n }\n if($show_vit)\n zaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ top plate\n rcubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n rcubea([gantry_connector_thickness+5, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=X-Z, extra_size=[0,0,2], extra_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=X+Z);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=X+Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=X-Z);\n }\n\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=-Z);\n\n \/\/ screw holes top\n for(y=[-1,1])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ screw hole bottom\n for(y=[0])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size-main_lower_dist_z)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n translate([zmotor_mount_rod_offset_x+1, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n nut_trap_cut(nut=zmotor_mount_clamp_nut, trap_h=20, cut_screw=false, trap_axis=-Z, orient=-X, align=X);\n\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n else if(part==\"vit\")\n {\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nmodule part_z_motor_mount_clamp()\n{\n translate([0,0,zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n}\n\nif(false)\nzaxis_motor_mount();\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\nuse \n\n\nmodule zaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n zaxis_motor_mount(part=\"pos\");\n zaxis_motor_mount(part=\"neg\");\n }\n if($show_vit)\n zaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ top plate\n rcubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n rcubea([gantry_connector_thickness+5, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=X-Z, extra_size=[0,0,2], extra_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=X+Z);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=X+Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=X-Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=-Z);\n\n \/\/ screw holes top\n for(y=[-1,1])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ screw hole bottom\n for(y=[0])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size-main_lower_dist_z)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-5, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n nut_trap_cut(nut=zmotor_mount_clamp_nut, trap_h=10, trap_axis=-Z, orient=X, align=N);\n }\n }\n\n }\n else if(part==\"vit\")\n {\n }\n\n attach([[get(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n motor_mount(part=part, model=zaxis_motor, thickness=zmotor_mount_thickness_h);\n }\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nmodule part_z_motor_mount_clamp()\n{\n translate([0,0,zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n}\n\nif(false)\nzaxis_motor_mount();\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"377478b6ad0b614089b973973e166a82da49cacc","subject":"The inlined code was updated.","message":"The inlined code was updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/customizer\/inlined\/customizable-rainmaker.scad-inlined.scad","new_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/customizer\/inlined\/customizable-rainmaker.scad-inlined.scad","new_contents":"\n\n\n\/* [Shell] *\/\n\nheight = 380; \/\/ [140 : 380]\n\ninnerRadius = 20; \/\/ [30 : 40]\n\nouterRadius = 24; \/\/ [34 : 46]\n\nshellDecoration = \"none\"; \/\/ [none, bumps]\n\n\/* [Rungs] *\/\n\nrungsPerLevel = 2; \/\/ [1 : 4]\n\nstepRadius = 1; \/\/ [1 : 5]\n\nzDistanceBetweenRungs = 5; \/\/ [1:150]\n\nzRotateAngle = 25; \/\/ [5 : 180]\n\n\/* [Endcap] *\/\n\ngenerateEndcap = true; \/\/ [false:true]\n\n\/* [Hidden] *\/\n\ni = 3; \/\/ [1:100]\n\nrainmaker(height = height,\n outerRadius = outerRadius,\n innerRadius = innerRadius,\n\t\t rungsPerLevel = rungsPerLevel,\n\t\t shellDecoration = shellDecoration,\n\t \t stepRadius = stepRadius,\n\t \t zDistanceBetweenRungs = zDistanceBetweenRungs,\n\t \t zRotateAngle = zRotateAngle);\n\nif(generateEndcap)\n{\n\txTranslate = outerRadius * 2 + 10;\n\n\tendcapHeight = 6;\n\n\tendcapOuterRadius = outerRadius + 4;\n\n\ttranslate([xTranslate, 0, 0])\n\tendcap(height = endcapHeight,\n\t\t\tinnerRadius = outerRadius,\n\t\t\touterRadius = endcapOuterRadius);\n\n}\n\n\nmodule endcap(height = 10,\n\t\t\t\tinnerRadius = 20,\n\t\t\t\touterRadius = 24,\n\t\t\t\tendThickness = 3)\n{\n\tunion()\n\t{\n\t\topenCylinder(innerRadius = innerRadius,\n\t\t\t\t\t\theight = height, \n\t\t\t\t\t\touterRadius = outerRadius);\n\n\t\tendcap_end(height = endThickness,\n\t\t\t\t\touterRadius = outerRadius);\n\t}\n}\n\n\/\/ support moduiles follow\n\nmodule endcap_end(height, outerRadius)\n{\n\tcylinder(h = height,\n\t\t\t\tr = outerRadius);\n}\n\n\nmodule rainmaker(height = 140,\n innerRadius = 30,\n outerRadius = 34,\n\t\t\t\t rungsPerLevel = 1,\n\t\t\t\t shellDecoration = \"none\",\n\t\t\t\t showShell = \"yes\",\n\t\t\t \t stepRadius = 2,\n\t\t\t\t zDistanceBetweenRungs = 5,\n\t\t\t \t zRotateAngle = 25)\n{\n union()\n {\n \/\/ the main shell\n\t\tif(showShell == \"yes\")\n\t\t{\n \t\t#\n\t openCylinder(height = height,\n\t innerRadius = innerRadius,\n\t outerRadius = outerRadius);\n\t\t}\n\n bottomZ = 5;\n\n \/\/ the steps\n zStart = bottomZ;\n step_xLength = (innerRadius * 2) + 1;\n rainmaker_steps(height = height,\n\t\t\t\t\t\touterRadius = outerRadius,\n\t\t\t\t\t\trungsPerLevel = rungsPerLevel,\n\t\t\t\t\t\tshellDecoration = shellDecoration,\n\t\t\t\t\t\tstepRadius = stepRadius,\n\t\t\t\t\t\tstep_xLength = step_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs = zDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle = zRotateAngle,\n zStart = zStart);\n\n \/\/ the bottom\n cylinder(r=outerRadius, h=bottomZ);\n }\n}\n\n\/\/ suport modules follow\n\nmodule rainmaker_steps(height,\n\t\t\t\t\t\touterRadius,\n\t\t\t\t\t\trungsPerLevel,\n\t\t\t\t\t\tshellDecoration,\n\t\t\t\t\t\tstepRadius,\n\t\t\t\t\t\tstep_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle,\n\t\t\t\t\t\tzStart)\n{\n\tzEnd = height - zDistanceBetweenRungs - stepRadius;\n\n for(z = [zStart : zDistanceBetweenRungs : zEnd])\n {\n\t\txTranslate = 0;\n zTranslate = zStart + z;\n\n\t\trotate([0, 0, zRotateAngle * z])\n\t\tunion()\n\t\t{\n\t\t\tfor(s = [1 : 1 : rungsPerLevel])\n\t\t\t{\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\tstepColor = s == 1 ? \"yellow\" :\n\t\t\t\t\t\t\t\t s == 2 ? \"green\" :\n\t\t\t\t\t\t\t\t s == 3 ? \"orange\" :\n\t\t\t\t\t\t\t\t s == 4 ? \"blue\" :\n\t\t\t\t\t\t\t\t \"pink\";\n\n\t\t\t\t\tangleDivision = 360.0 \/ rungsPerLevel;\n\t\t\t\t zRotate = (angleDivision * (s-1) ) \/ 2;\n\n\t\t\t\t\tcolor(stepColor)\n\t\t\t translate([xTranslate, 0, zTranslate])\n\t\t\t\t\trotate([0, 90, zRotate])\n\t\t\t cylinder(r = stepRadius,\n\t\t\t\t\t\t\t\th = step_xLength,\n\t\t\t\t\t\t\t\tcenter = true);\n\n\t\t\t\t\tif(shellDecoration == \"bumps\")\n\t\t\t\t\t{\n\/\/ The commented code below is to help debug why rotaion is not working for the bump.\n\/\/ And it will be removed hopefully soon.\t\t\t\t\t\t\n\/\/\t\t\t\t\t\tbumpsRotate = (angleDivision * s) \/ s;\n\/\/\t\t\t\t\t\tbumpsRotate = zRotate \/ s;\n\t\t\t\t\t\tbumpsRotate = zRotate;\n\/\/\t\t\t\t\t\tbumpsRotate = s + 30;\n\/\/\t\t\t\t\t\tbumpsRotate = 0;\n\n\/\/\t\t\t\t\t\techo(\"bumps\", s, bumpsRotate);\n\n\t\t\t\t\t\tcolor(stepColor)\n\t\t\t\t\t\ttranslate([outerRadius, 0, zTranslate])\n\/\/rotate([bumpsRotate, 0, 0])\n\/\/rotate([0, 90, bumpsRotate])\n\t\t\t\t\t\tsphere(r=3);\n\n\/\/ this is the bump on the 'other' end\n\t\t\t\t\t\tcolor(stepColor)\n\t\t\t\t\t\ttranslate([-outerRadius, 0, zTranslate])\n\/\/\t\t\t\t\t\trotate([0, 90, bumpsRotate * s])\n\t\t\t\t\t\tsphere(r=3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}\n\n\/\/ TODO: Lower this to 50.\nmodule openCylinder(height = 3,\n outerRadius = 7,\n innerRadius = 4.5,\n fn = 100)\n{\n $fn = fn;\n\n difference()\n {\n cylinder(r=outerRadius,\n h=height);\n\n translate([0, 0, -1])\n cylinder(r=innerRadius,\n h=height+1.01);\n }\n}\n\n\/\/ TODO: Lower this to 50.\nmodule openCylinder(height = 3,\n outerRadius = 7,\n innerRadius = 4.5,\n fn = 100)\n{\n $fn = fn;\n\n difference()\n {\n cylinder(r=outerRadius,\n h=height);\n\n translate([0, 0, -1])\n cylinder(r=innerRadius,\n h=height+1.01);\n }\n}","old_contents":"\n\n\n\/* [Shell] *\/\n\nheight = 380; \/\/ [140 : 380]\n\ninnerRadius = 20; \/\/ [30 : 40]\n\nouterRadius = 24; \/\/ [34 : 46]\n\n\/* [Rungs] *\/\n\nrungsPerLevel = 2; \/\/ [1 : 4]\n\nstepRadius = 1; \/\/ [1 : 5]\n\nzDistanceBetweenRungs = 5; \/\/ [1:150]\n\n\/* [Endcap] *\/\n\ngenerateEndcap = true; \/\/ [false:true]\n\n\/* [Hidden] *\/\n\ni = 3; \/\/ [1:100]\n\nrainmaker(height = height,\n outerRadius = outerRadius,\n innerRadius = innerRadius,\n\t\t rungsPerLevel = rungsPerLevel,\n\t \t stepRadius = stepRadius,\n\t \t zDistanceBetweenRungs = zDistanceBetweenRungs);\n\nif(generateEndcap)\n{\n\txTranslate = outerRadius * 2 + 10;\n\n\tendcapHeight = 6;\n\n\tendcapOuterRadius = outerRadius + 4;\n\n\ttranslate([xTranslate, 0, 0])\n\tendcap(height = endcapHeight,\n\t\t\tinnerRadius = outerRadius,\n\t\t\touterRadius = endcapOuterRadius);\n\n}\n\n\nmodule endcap(height = 10,\n\t\t\t\tinnerRadius = 20,\n\t\t\t\touterRadius = 24,\n\t\t\t\tendThickness = 3)\n{\n\tunion()\n\t{\n\t\topenCylinder(innerRadius = innerRadius,\n\t\t\t\t\t\theight = height, \n\t\t\t\t\t\touterRadius = outerRadius);\n\n\t\tendcap_end(height = endThickness,\n\t\t\t\t\touterRadius = outerRadius);\n\t}\n}\n\n\/\/ support moduiles follow\n\nmodule endcap_end(height, outerRadius)\n{\n\tcylinder(h = height,\n\t\t\t\tr = outerRadius);\n}\n\n\nmodule rainmaker(height = 140,\n innerRadius = 30,\n outerRadius = 34,\n\t\t\t\t rungsPerLevel = 1,\n\t\t\t \t stepRadius = 2,\n\t\t\t\t zDistanceBetweenRungs = 5,\n\t\t\t \t zRotateAngle = 25)\n{\n union()\n {\n \/\/ the main shell\n \t%\n openCylinder(height = height,\n innerRadius = innerRadius,\n outerRadius = outerRadius);\n\n bottomZ = 5;\n\n \/\/ the steps\n zStart = bottomZ;\n step_xLength = (innerRadius * 2) + 1;\n rainmaker_steps(height = height,\n\t\t\t\t\t\trungsPerLevel = rungsPerLevel,\n\t\t\t\t\t\tstepRadius = stepRadius,\n\t\t\t\t\t\tstep_xLength = step_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs = zDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle = zRotateAngle,\n zStart = zStart);\n\n \/\/ the bottom\n cylinder(r=outerRadius, h=bottomZ);\n }\n}\n\nmodule rainmaker_steps(height,\n\t\t\t\t\t\trungsPerLevel,\n\t\t\t\t\t\tstepRadius,\n\t\t\t\t\t\tstep_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle,\n\t\t\t\t\t\tzStart)\n{\n\tzEnd = height - zDistanceBetweenRungs - stepRadius;\n\n for(z = [zStart : zDistanceBetweenRungs : zEnd])\n {\n\t\txTranslate = 0;\n zTranslate = zStart + z;\n\n\t\trotate([0, 0, zRotateAngle * z])\n\t\tunion()\n\t\t{\n\t\t\tfor(s = [1 : 1 : rungsPerLevel])\n\t\t\t{\n\t\t\t\tstepColor = s == 1 ? \"yellow\" :\n\t\t\t\t\t\t\t s == 2 ? \"green\" :\n\t\t\t\t\t\t\t s == 3 ? \"orange\" :\n\t\t\t\t\t\t\t s == 4 ? \"blue\" :\n\t\t\t\t\t\t\t \"pink\";\n\n\t\t\t\tangleDivision = 360.0 \/ rungsPerLevel;\n\t\t\t zRotate = (angleDivision * (s-1) ) \/ 2;\n\n\t\t\t\tcolor(stepColor)\n\t\t translate([xTranslate, 0, zTranslate])\n\t\t\t\trotate([0, 90, zRotate])\n\t\t cylinder(r = stepRadius,\n\t\t\t\t\t\t\th = step_xLength,\n\t\t\t\t\t\t\tcenter = true);\n\t\t\t}\n\t\t}\n }\n}\n\n\/\/ TODO: Lower this to 50.\nmodule openCylinder(height = 3,\n outerRadius = 7,\n innerRadius = 4.5,\n fn = 100)\n{\n $fn = fn;\n\n difference()\n {\n cylinder(r=outerRadius,\n h=height);\n\n translate([0, 0, -1])\n cylinder(r=innerRadius,\n h=height+1.01);\n }\n}\n\n\/\/ TODO: Lower this to 50.\nmodule openCylinder(height = 3,\n outerRadius = 7,\n innerRadius = 4.5,\n fn = 100)\n{\n $fn = fn;\n\n difference()\n {\n cylinder(r=outerRadius,\n h=height);\n\n translate([0, 0, -1])\n cylinder(r=innerRadius,\n h=height+1.01);\n }\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4a90940f7385994069073f9c285d0c1d05458695","subject":"complete module","message":"complete module\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"heater_handle\/heater_support.scad","new_file":"heater_handle\/heater_support.scad","new_contents":"span=172;\ndia=18;\nh=60+dia;\n$fn=100;\n\nmodule _handle_main()\n{\n difference()\n {\n union()\n {\n \/\/ side blocks\n for(dx=[0, span])\n translate(dx*[1,0,0])\n cube([dia, h, dia\/2]);\n \/\/ top holder\n translate([dia, h, 0])\n cube([span-dia, dia, dia\/2]);\n \/\/ rounded edges\n for(dx=[0, span-dia])\n translate([dia+dx, h,0])\n cylinder(r=dia, h=dia\/2);\n }\n for(dx=[0, span-3*dia])\n translate([2*dia+dx, h-dia, -1])\n cylinder(r=dia, h=dia\/2+2);\n }\n}\n\nmodule _hole()\n{\n hull()\n for(dx=[-0.5, 0.5])\n translate([dx, 0, -1])\n cylinder(r=3.8+0.5\/2, h=dia\/2+2, $fn=20);\n}\n\n\nmodule _handle()\n{\n difference()\n {\n _handle_main();\n \/\/ left cut in\n translate([0, 0, -1])\n rotate(-45*[0, 0, 1])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ right cut it\n translate([span+dia, 0, dia+1])\n rotate([0, 180, 45])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ screw holes\n for(dx=[0, span])\n translate([dx+dia\/2, dia, 0])\n _hole();\n }\n}\n\n_handle();\n\/\/_hole();\n","old_contents":"span=172;\ndia=18;\n$fn=100;\n\nmodule _handle()\n{\n difference()\n {\n union()\n {\n \/\/ side blocks\n for(dx=[0, span])\n translate(dx*[1,0,0])\n cube([dia, 60, dia]);\n \/\/ top holder\n translate([dia, 60, 0])\n cube([span-dia, dia, dia]);\n \/\/ rounded edges\n for(dx=[0, span-dia])\n translate([dia+dx, 60,0])\n cylinder(r=dia, h=dia);\n }\n for(dx=[0, span-3*dia])\n translate([2*dia+dx, 60-dia, -1])\n cylinder(r=dia, h=dia+2);\n }\n}\n\n_handle();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"329ba0f9b16d28de7bdca44539972a3b34eac73d","subject":"bearing\/linear\/mount: fixes, open cut missing etc","message":"bearing\/linear\/mount: fixes, open cut missing etc\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part=part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=X, mount_style=\"open\")\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part=part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=X, mount_style=\"closed\")\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n D_=D+2*support_wall_thickness;\n h_ = h+flange_offset;\n rcylindera(h=h_, d=D_, orient=Z, align=Z);\n rcubea(size=[D_,D_,h_], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n D_=D+2*support_wall_thickness;\n h_ = h+flange_offset;\n rcylindera(h=h_, d=D_, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"04ba7512268062bc9b89a43e9d5028f8a39e8a09","subject":"y-carriage\/bearing_mount: rewrite for MK52 bed","message":"y-carriage\/bearing_mount: rewrite for MK52 bed\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-carriage-bearing-mount.scad","new_file":"y-carriage-bearing-mount.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [N, Z];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+get(LinearBearingOuterDiameter,yaxis_bearing)\/2], Z];\n\nmodule yaxis_carriage_bearing_mount(part)\n{\n \/\/ x distance of holes\n screw_dx=20;\n \/\/ y distance of holes\n screw_dy=0;\n\n carriage_plate_thread=ThreadM3;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2.5;\n bearing_OD = get(LinearBearingOuterDiameter, yaxis_bearing);\n bearing_L = get(LinearBearingLength, yaxis_bearing);\n depth = max(bearing_L+2*mm, screw_dx+carriage_plate_thread_d*2);\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n if(part==U)\n {\n difference()\n {\n yaxis_carriage_bearing_mount(part=\"pos\");\n yaxis_carriage_bearing_mount(part=\"neg\");\n }\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n rcubea([width, depth, height], align=Z);\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*screw_dx\/2)\n ty(y*screw_dy\/2)\n tz(-3*mm) \n screw_cut(thread=carriage_plate_thread, head=\"button\", head_embed=true, h=10*mm, align=Z, orient=-Z);\n\n \/*cylindera(d=carriage_plate_thread_d, h=height+2, align=Z);*\/\n\n }\n else if(part==\"vit\")\n {\n }\n\n translate([0,0,bearing_OD\/2+yaxis_carriage_bearing_mount_bottom_thick])\n linear_bearing_mount(\n part=part,\n bearing=yaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Y,\n mount_dir_align=Z\n );\n}\n\nmodule part_y_carriage_bearing_mount()\n{\n c1=[N,Z];\n attach(c1,yaxis_carriage_bearing_mount_conn_bottom)\n {\n yaxis_carriage_bearing_mount();\n }\n}\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \nuse \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [N, Z];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+get(LinearBearingOuterDiameter,yaxis_bearing)\/2], Z];\n\nmodule yaxis_carriage_bearing_mount(part)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n bearing_OD = get(LinearBearingOuterDiameter, yaxis_bearing);\n depth = max(bearing_OD, screw_dx+carriage_plate_thread_d*2);\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n if(part==U)\n {\n difference()\n {\n yaxis_carriage_bearing_mount(part=\"pos\");\n yaxis_carriage_bearing_mount(part=\"neg\");\n }\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n rcubea ([width, depth, height], align=Z);\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n for(y=[-1,1])\n translate ([x*screw_dx\/2, y*screw_dy\/2, -1]) \n cylindera(d=carriage_plate_thread_d, h=height+2, align=Z);\n\n }\n else if(part==\"vit\")\n {\n }\n\n translate([0,0,bearing_OD\/2+yaxis_carriage_bearing_mount_bottom_thick])\n linear_bearing_mount(\n part=part,\n bearing=yaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Y,\n ziptie_dist=4,\n mount_dir_align=Z\n );\n}\n\nmodule part_y_carriage_bearing_mount()\n{\n c1=[N,Z];\n attach(c1,yaxis_carriage_bearing_mount_conn_bottom)\n {\n yaxis_carriage_bearing_mount();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3be1f173e47ddb8559f625c5b96ff5efdfe1eeb0","subject":"starting elements from [0,0,0] (just to make it look pretty)","message":"starting elements from [0,0,0] (just to make it look pretty)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"cable_support\/cable_support.scad","new_file":"cable_support\/cable_support.scad","new_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\nN=4;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[1:N])\n translate([0, (i-1)*12, 0])\n element();\n","old_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\nN=4;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[1:N])\n translate([0, i*12, 0])\n element();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3bdaf55eb410a91d3b4b646bcb4faea8e130e17e","subject":"Centralize , fix window_thickness issue w\/ sides.","message":"Centralize , fix window_thickness issue w\/ sides.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a899343a6a19e40c0d0947a9cdb2535df608aa7f","subject":"More corn","message":"More corn\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 18;\nhead_angle = 45;\n\nhorn_length = 18;\nhorn_radius = 3;\n\nneck_radius = 2;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3;\n\nbody_x = 15;\nbody_z = 28;\nbody_radius = 15;\nbody_back_radius = 13;\nbody_length = 33;\n\nleg_length = 28 + body_radius;\nleg_radius = 4;\n\ncute_leg_first_ratio = 0.65;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\nleg(theta=5, sideways=3);\ncute_leg(theta=-5, sideways=-3, downwards=3);\nleg(lengthwards = body_length, sideways=2, theta=15);\nleg(lengthwards = body_length, sideways=-2, theta=-15);\n","old_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 18;\nhead_angle = 30;\n\nhorn_length = 18;\nhorn_radius = 3;\n\nneck_angle = 30;\nneck_radius = 4;\nneck_length = 5;\n\nbody_x = 15;\nbody_z = 27;\nbody_radius = 15;\nbody_length = 32;\n\nleg_length = 26 + body_radius;\nleg_radius = 4;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n sphere(r = body_radius);\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\nleg(theta=10);\ncolor(\"red\") cute_leg(theta=-10);\nleg(lengthwards = body_length, theta=20);\nleg(lengthwards = body_length, theta=-20);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a5a6d8a781cb53f4d5e940246a677bd829668b2d","subject":"x\/carriage: minor fix for preview\/debug setup","message":"x\/carriage: minor fix for preview\/debug setup\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n {\n rcubea([hotend_clamp_w[1], hotend_d_h[1][0], hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2+.1])\n {\n rcubea([hotend_clamp_w[1], 1000, hotend_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part);\n hotend_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotend_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n translate(-X*guidler_bearing[1]\/2)\n cylindera(d=filament_d, h=1000*mm);\n\n translate(guidler_bearing_pos)\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n translate([0, 0, hotend_d_h[1][1]\/2])\n translate([0, 0, 0+hotend_d_h[0][1]+hotend_d_h[1][1]\/2])\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n {\n rcubea([hotend_clamp_w[1], hotend_d_h[1][0], hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2+.1])\n {\n rcubea([hotend_clamp_w[1], 1000, hotend_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part);\n hotend_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotend_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n translate(-X*guidler_bearing[1]\/2)\n cylindera(d=filament_d, h=1000*mm);\n\n translate(guidler_bearing_pos)\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n translate([0, 0, hotend_d_h[1][1]\/2])\n translate([0, 0, 0+hotend_d_h[0][1]+hotend_d_h[1][1]\/2])\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"514a1deae4e6063718580113d5f25d5343aeafd8","subject":"rod-clamps: don't include rod as vitamin","message":"rod-clamps: don't include rod as vitamin\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","old_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n %size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f142b16e528e7333278651491d561ccefece1030","subject":"rod-clamps: Tweaks","message":"rod-clamps: Tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n translate([-rod_d\/2,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n translate([-rod_d\/2,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\/*mount_rod_clamp_full(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n","old_contents":"include \ninclude \n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4)\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick=thick_*1.5;\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n cubea([base_thick, screw_dist_+thread_dia*2, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4)\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick=thick_*1.5;\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n translate([-rod_d\/2,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n translate([-rod_d\/2,0,0])\n cubea([base_thick, screw_dist_+thread_dia*2, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\/*mount_rod_clamp_full(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fb66d9b555ad7191d9a907f87f135041c206b953","subject":"proper drawings for 25x37x7 bearings on B-axle","message":"proper drawings for 25x37x7 bearings on B-axle\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([2,0,0]) barEnd1();\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([DE-2,0,0]) barEnd1();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6a75797fbc41cd3a5e87b01b92a48567fd22908e","subject":"move to channelFork on hip","message":"move to channelFork on hip\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([2,0,0]) barEnd1();\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([DE-2,0,0]) barEnd1();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([8,0,0]) barEnd1();\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([DE-8,0,0]) barEnd1();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-110,0,0]) cylinder(r=.8,h=14.4);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"8b804235c096cbbf75611d6a38afb8ea8d16fb2e","subject":"[scad] use support + ring for fixing the magnet","message":"[scad] use support + ring for fixing the magnet\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.04; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.1;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"scaling vector\", kube_s);\necho(\"magnet diameter\", magnet_r*2);\necho(\"flk width\", flk_w);\necho(\"kube width\", outer_w);\necho(\"support diameter\", support_r*2);\necho(\"support height\", support_h);\necho(\"ring height\", ring_h);\necho(\"ring inner diameter\", ring_inner_r*2);\necho(\"ring outer diameter\", ring_outer_r*2);\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(flk_w, flk_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","old_contents":"$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1.04;\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 13.5 + magnet_t;\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_r = 5;\nsupport_h = outer_w - wall_w - flk_h;\n\necho(\"scaling vector\", kube_s);\necho(\"magnet diameter\", magnet_r*2);\necho(\"flk width\", flk_w);\necho(\"kube width\", outer_w);\necho(\"support height\", support_h);\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(flk_w, flk_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\t\tcylinder(r=magnet_r, h=magnet_h);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nscale(kube_s) kube();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3fc1448338c8d914596eda6cbac9e47764f14794","subject":"transforms: add all_axes","message":"transforms: add all_axes\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"include \nuse \n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis==U?0:v_rotate(90, axis))\n children();\n}\n\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient(axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient(Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient(Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\nif(false)\n{\n for(a=concat(AXES,-AXES))\n translate(5*a)\n {\n c= v_abs(a*.3 + v_clamp(v_sign(a),0,1)*.7);\n color(c)\n proj_extrude_axis(axis=a)\n {\n translate(20*a)\n sphere(d=10);\n }\n }\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","old_contents":"include \nuse \n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis==U?0:v_rotate(90, axis))\n children();\n}\n\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient(axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient(Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient(Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n for(a=concat(AXES,-AXES))\n translate(5*a)\n {\n c= v_abs(a*.3 + v_clamp(v_sign(a),0,1)*.7);\n color(c)\n proj_extrude_axis(axis=a)\n {\n translate(20*a)\n sphere(d=10);\n }\n }\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b3e72bfa4170273854dac1ac2d9e7f5ad4dad267","subject":"config: Add some belt variables","message":"config: Add some belt variables\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c63976825b968b74cddc1396eaedf971cfb09a61","subject":"bearing-linear: increase default tolerance","message":"bearing-linear: increase default tolerance\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.4*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n ziptie_dist_ = v_fallback(ziptie_dist, [clip_dist\/2, ziptie_width*2<(h\/3+2*mm) ? h \/ 3 : U]);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(ziptie_dist_ != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[h+.1*mm,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(ziptie_dist_ != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n material(Mat_Ziptie)\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.2*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n ziptie_dist_ = v_fallback(ziptie_dist, [clip_dist\/2, ziptie_width*2<(h\/3+2*mm) ? h \/ 3 : U]);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(ziptie_dist_ != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(ziptie_dist_ != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n material(Mat_Ziptie)\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d1ac571e648735ccaa1744bcf40897e54a226910","subject":"xaxis\/ends: Misc fixes","message":"xaxis\/ends: Misc fixes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+5*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-3*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, trap_axis=[1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+5*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-3*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, trap_axis=[1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=100, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5cae7c262a9185c84142078135c79ee9b1815f7e","subject":"x\/carriage: fix proper calc of hotend tip offset","message":"x\/carriage: fix proper calc of hotend tip offset\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ae0821ede4b24dca9572d6598f64cb5d0cc3ea31","subject":"Small changes and added minimal top plate","message":"Small changes and added minimal top plate\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/limit-switches\/limit-switch-large.scad","new_file":"openscad\/limit-switches\/limit-switch-large.scad","new_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, specifically this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100;\nEPSILON = 0.1;\n\n\nmodule switch_cover() {\n base_thick = 3; \/\/ Thickness of \"base\" plate\n base_ro = 2; \/\/ Outer radii of base plate\n \n \/\/ Switch dimensions\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10.2 + 0.8; \/\/ + space for sticky tape or wire\n \n \/\/ Nominal offset in y and x of the lower-left-corner\n \/\/ of the switch well.\n switch_off_d0 = 8;\n switch_off_w = 12;\n \n switch_r = 3; \/\/ inner radius of switch well \n top_gap_w = 18.5; \/\/ width of gap on the top, from LHS\n top_gap_d = 3; \/\/ was 5; \/\/ depth (in y) of the top gap, from the top\n top_wall_thick = 3.5; \/\/ thickness (y) of top wall\n top_wall_z_pad = 2; \/\/ small wall where there is a cutaway\n right_wall_thick = 3; \/\/ thickness (x) of right wall\n \n bottom_gap_w = 14; \/\/ width of bottom gap, from RHS\n bottom_gap_d = 11; \/\/ depth (in y) of bottom gap, from bottom\n\n \/\/ These are for screw holes\n hole_dist_x = 16; \/\/Distance of screw holes in x == Tetrix spacing\n hole_dist_y = 8; \/\/ Distance of scew holes in y == Lego spacing\n hole_wall_thick = 3; \/\/ Min thickness of walls around a hole\n hole_r = 2.05; \/\/ Just enough for 3\/32 (imperial) screws to slip through easily\n \n \/\/ Extension to the right for lugs & wire strain relief\n strain_r = 2;\n strain_w = 20; \/\/ x\n strain_d = 13; \/\/\/ y\n strain_h = base_thick + 1; \/\/ z. Extends slightly above base to be closer to lugs\n\n \/\/ These are minimum distances to check against when computing\n \/\/ how much deep (in y) to start the well for the switch - so that there is\n \/\/ enough space around each hole in the y-direction\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n\n top_gap_end_x = switch_off_w + top_gap_w;\n bottom_gap_end_x = switch_off_w + bottom_gap_w;\n bottom_gap_end_y = switch_off_d + bottom_gap_d;\n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_h;\n hole_x = hole_wall_thick + hole_r;\n hole_y = hole_wall_thick + hole_r;\n base_w = switch_off_w + switch_w + right_wall_thick; \/\/ thickness of base\n \n\n difference() {\n oblong(base_w, base_d, base_ro, tot_thick); \/\/ Starting block\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE); \/\/ remove switch well\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick + top_wall_z_pad])\n cube([top_gap_end_x+EPSILON, LARGE, LARGE]); \/\/ remove top gap\n translate([bottom_gap_end_x, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_end_y + 2*EPSILON, LARGE]); \/\/ remove bottom gap\n translate([hole_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 1\n translate([hole_x, hole_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 2\n translate([hole_x + hole_dist_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 3\n }\n \n \/\/ Add the strain relief extension\n strain_off_x = base_w - strain_r;\n strain_off_y = switch_off_d + (switch_d - strain_d)\/2;\n translate([strain_off_x, strain_off_y, 0])\n rotate([90, 0, 90]) oblong(strain_d, strain_h, strain_r, strain_w);\n}\n\n\n\/\/ Smallest possible top plate - that exactly overlaps\n\/\/ the base. This is a HACK. Need to re-factor code so that we can\n\/\/ use a common set of parameters and then to add a lip to narrow the opening\n\/\/ through which the metal switch lever protrudes.\nmodule minimal_top_plate() {\n plate_w = 30; \/\/ roughly = to top_gap_w + switch_off_w\n linear_extrude(height = 3)\n difference() {\n projection(cut=true) switch_cover();\n translate([plate_w, 0]) square([LARGE, LARGE]);\n }\n\n}\n\n\nmodule trial1() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([LARGE, 18, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\nmodule trial2() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([30, LARGE, LARGE]);\n translate([35, -EPSILON, -EPSILON]) cube([35, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\nswitch_cover();\n\/\/translate([60, 0, 0]) trial1();\n\/\/translate([80, 0, 0]) trial2();\ntranslate([70, 0, 0]) minimal_top_plate();","old_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, specifically this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100;\nEPSILON = 0.1;\n\n\nmodule switch_cover() {\n base_thick = 3; \/\/ Thickness of \"base\" plate\n base_ro = 2; \/\/ Outer radii of base plate\n \n \/\/ Switch dimensions\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10.2 + 0.8; \/\/ + space for sticky tape or wire\n \n \/\/ Nominal offset in y and x of the lower-left-corner\n \/\/ of the switch well.\n switch_off_d0 = 8;\n switch_off_w = 12;\n \n switch_r = 3; \/\/ inner radius of switch well \n top_gap_w = 18.5; \/\/ width of gap on the top, from LHS\n top_gap_d = 5; \/\/ depth (in y) of the top gap, from the top\n top_wall_thick = 3.5; \/\/ thickness (y) of top wall\n right_wall_thick = 3; \/\/ thickness (x) of right wall\n \n bottom_gap_w = 14; \/\/ width of bottom gap, from RHS\n bottom_gap_d = 11; \/\/ depth (in y) of bottom gap, from bottom\n\n \/\/ These are for screw holes\n hole_dist_x = 16; \/\/Distance of screw holes in x == Tetrix spacing\n hole_dist_y = 8; \/\/ Distance of scew holes in y == Lego spacing\n hole_wall_thick = 3; \/\/ Min thickness of walls around a hole\n hole_r = 2.05; \/\/ Just enough for 3\/32 (imperial) screws to slip through easily\n \n \/\/ Extension to the right for lugs & wire strain relief\n strain_r = 2;\n strain_w = 20; \/\/ x\n strain_d = 13; \/\/\/ y\n strain_h = base_thick + 1; \/\/ z. Extends slightly above base to be closer to lugs\n\n \/\/ These are minimum distances to check against when computing\n \/\/ how much deep (in y) to start the well for the switch - so that there is\n \/\/ enough space around each hole in the y-direction\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n\n top_gap_end_x = switch_off_w + top_gap_w;\n bottom_gap_end_x = switch_off_w + bottom_gap_w;\n bottom_gap_end_y = switch_off_d + bottom_gap_d;\n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_h;\n hole_x = hole_wall_thick + hole_r;\n hole_y = hole_wall_thick + hole_r;\n base_w = switch_off_w + switch_w + right_wall_thick; \/\/ thickness of base\n \n\n difference() {\n oblong(base_w, base_d, base_ro, tot_thick); \/\/ Starting block\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE); \/\/ remove switch well\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_end_x+EPSILON, LARGE, LARGE]); \/\/ remove top gap\n translate([bottom_gap_end_x, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_end_y + 2*EPSILON, LARGE]); \/\/ remove bottom gap\n translate([hole_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 1\n translate([hole_x, hole_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 2\n translate([hole_x + hole_dist_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 3\n }\n \n \/\/ Add the strain relief extension\n strain_off_x = base_w - strain_r;\n strain_off_y = switch_off_d + (switch_d - strain_d)\/2;\n translate([strain_off_x, strain_off_y, 0])\n rotate([90, 0, 90]) oblong(strain_d, strain_h, strain_r, strain_w);\n}\n\nmodule trial1() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([LARGE, 18, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\nmodule trial2() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([30, LARGE, LARGE]);\n translate([35, -EPSILON, -EPSILON]) cube([35, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\nswitch_cover();\n\/\/translate([60, 0, 0]) trial1();\n\/\/translate([80, 0, 0]) trial2();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"a87a4eefef3ad112e75992530b6841e09e3e7b5b","subject":"added spacer and eccentric spacer","message":"added spacer and eccentric spacer\n","repos":"fponticelli\/smallbridges","old_file":"scad\/ob_spacer.scad","new_file":"scad\/ob_spacer.scad","new_contents":"include \ninclude \nuse ;\n\nmodule ob_spacer(length = 1) {\n bom(str(\"ob-alu-spacer-\",length), str(\"Aluminum Spacer (\", length,\")\"), [\"hardware\"]);\n color(Aluminum)\n difference() {\n cylinder(length, 5, 5);\n translate([0, 0, -length\/2])\n cylinder(length*2, 2.55, 2.55);\n }\n}\n\nmodule ob_eccentric_spacer() {\n bom(\"ob-eccentric-spacer\", \"Eccentric Spacer\", [\"hardware\"]);\n length = 6.35;\n length2 = 2.5;\n lengtht = length + length2;\n m5 = 5;\n diam = 7.11;\n center_offset = 0.79;\n color(Steel)\n difference() {\n union() {\n translate([0,0,length\/2])\n scale([1,1,length])\n hexagon(5.774);\n translate([0,0,-length2])\n cylinder(length2,diam\/2,diam\/2);\n }\n translate([center_offset,0,-lengtht])\n cylinder(lengtht*2,m5\/2,m5\/2);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/ob_spacer.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"421035907d8f15fcdb705b46840381c33c58a50f","subject":"tweaked spacings around F698 bearings a bit.","message":"tweaked spacings around F698 bearings a bit.\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([8,0,0]) barEnd1();\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([DE-8,0,0]) barEnd1();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-110,0,0]) cylinder(r=.8,h=14.4);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.4);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2.2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.9])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.3]) rotate([180,0,0]) F698();\n translate([0,0,2.24]) F698();\n translate([0,0,6.74]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([8,0,0]) barEnd1();\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([DE-8,0,0]) barEnd1();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-110,0,0]) cylinder(r=.8,h=14.4);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=1,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .36]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.36]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c3fa6033638876c559143bee977bd310c1a2bebd","subject":"[3d] Extend USB pillar reinforcements top to bottom and make ends 1mm wider","message":"[3d] Extend USB pillar reinforcements top to bottom and make ends 1mm wider\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.0*1.41; \/\/ thickness of side walls (*1.41 so rounded corners are this width)\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\necho(\"WALL is \", wall);\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=wall, top=wall\/2, bottom=wall\/2, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex+1, 2, h_b]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex+1, 2.5, h_b]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex+1, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex+1, 3, h_b]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips() {\n translate([wall, wall, probe_centerline+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ right guide lip\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n hm43_bottom_lips();\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.0*1.41; \/\/ thickness of side walls (*1.41 so rounded corners are this width)\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\necho(\"WALL is \", wall);\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=wall, top=wall\/2, bottom=wall\/2, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex, 2, 20.8]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex, 2.5, 20.8]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, 20.8]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex, 3, 20.8]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips() {\n translate([wall, wall, probe_centerline+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ right guide lip\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n hm43_bottom_lips();\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5b9c55a604f940f71a7c1d29cb520e5a750309a9","subject":"Baseplate is now compatible with any motor bracket","message":"Baseplate is now compatible with any motor bracket","repos":"pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey","old_file":"hardware\/Robot.scad","new_file":"hardware\/Robot.scad","new_contents":"\/\/Make passage for cables larger\nRobotY = 220;\nRobotX = 80;\nRobotZ = 5;\nBodyHoleR = 20;\nBodyHoleSpace = 55;\n\nplateX = 150;\nplateZ = 3;\nplateY = RobotX;\ncablePassageWidht = 8;\nplateanchorX = RobotZ;\nplateanchorY = 15;\nholeradius = 3;\nholespace = 3 * holeradius;\nborderZ = 30;\nborder = 8;\nT = 0.3;\n$fs = 0.01;\n\nstepperSupportHeight = 70;\n\nborder = holespace + ((plateX) \/ holespace - floor((plateX) \/ holespace)) \/ 2;\ninclude < TextGenerator.scad > ;\n\nmodule put_pilogo(mt) {\n fn = \"raspberrypi_logo.dxf\";\n \/\/ calculate the scale and which offset to use\n\n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\n\nmodule put_Alogo(mt) {\n fn = \"arduino.dxf\";\n \/\/ calculate the scale and which offset to use\n\n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\nmodule put_OAlogo(mt) {\n fn = \"ohw-logo.dxf\";\n \/\/ calculate the scale and which offset to use \n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\n\nmodule SUB_batteryAnchor() {\n\n}\n\nmodule arduinoLogo(h, r) {\n\n scale([0.9, .7, 1]) union() {\n difference() {\n cylinder(h = h, r = r);\n cylinder(h = h, r = r - .25 * r);\n }\n translate([1.8 * r, 0, 0]) difference() {\n cylinder(h = h, r = r);\n cylinder(h = h, r = r - .25 * r);\n }\n\n }\n translate([0, 0, h \/ 2]) cube([0.6 * r, 0.2 * r, h], center = true);\n translate([2 * r - 0.4 * r, 0, h \/ 2]) {\n cube([0.6 * r, 0.2 * r, h], center = true);\n rotate([0, 0, 90]) cube([0.6 * r, 0.2 * r, h], center = true);\n }\n}\n\nmodule plate(plateX, plateY, plateZ, borderZ, holes, baseF, baseB, text) {\n difference() {\n linear_extrude(plateZ, center = true, convexity = 0, twist = 0)\n\n difference() {\n\n union() {\n square([plateX, plateY], center = true);\n\n translate([-plateX \/ 2 - plateanchorX, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n mirror([0, 1, 0]) translate([-plateX \/ 2 - plateanchorX, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n\n translate([+plateX \/ 2, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n mirror([0, 1, 0]) translate([+plateX \/ 2, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n }\n\n \/\/punchholes at the bottom of the plate\n if (holes == \"True\") {\n for (j = [border: holespace: plateY - border]) {\n for (i = [border: holespace: plateX - 2 * border]) {\n translate([i + border - plateX \/ 2 - holeradius \/ 2, j - plateY \/ 2, 0]) circle(holeradius);\n }\n }\n\n }\n }\n\n \/\/Passage for cables\n translate([-plateX \/ 2 + cablePassageWidht, j + border - plateY \/ 2, 0]) cube([cablePassageWidht, 0.5 * plateY, plateZ], center = true);\n translate([plateX \/ 2 - cablePassageWidht, j + border - plateY \/ 2, 0]) cube([cablePassageWidht, 0.5 * plateY, plateZ], center = true);\n\n }\n if (baseF == \"True\")\n translate([-plateX \/ 2, plateY \/ 2 - plateZ, -plateZ \/ 2]) cube([plateX, plateZ, borderZ]);\n if (baseB == \"True\")\n translate([-plateX \/ 2, -plateY \/ 2, -plateZ \/ 2]) cube([plateX, plateZ, borderZ]);\n\n translate([-plateX \/ 2, -plateY \/ 2, 5]) rotate(90, [1, 0, 0]) scale([2, 2, 1]) drawtext(text);\n\n}\n\nmodule SensorsPlate() {\n IRLedD = 3;\n\n plate(plateX, plateY, plateZ, borderZ, \"True\", \"True\", \"false\", \"\");\n difference() {\n translate([0, -plateY \/ 2 + 10, borderZ - plateZ \/ 2])\n rotate([180, 0, 0]) difference() {\n scale(v = [1, 0.30, 1]) difference() {\n cylinder(r = plateX \/ 2, h = borderZ, center = false);\n cylinder(r = plateX \/ 2 - 2 * plateZ, h = borderZ, center = false);\n }\n\n\n translate([-plateX \/ 2, -plateY \/ 2 + 10, 0]) cube([plateX, 0.35 * plateX \/ 2, plateY \/ 2]);\n }\n \/\/hole for the IR sensor\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, -30]) translate([6, -3.48, 0]) cube([6, 6.95, 10]);\n translate([-8, -plateY \/ 2 - 10, borderZ \/ 4]) rotate([100, 0, 0]) translate([6, -3.48, 0]) cube([6, 6.95, 10]);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, 30]) translate([-12, -3.48, 0]) cube([6, 6.95, 10]);\n\n \/\/holes for sonars and slots for sensors\n translate([0 + 28, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(r = 16.8 \/ 2, h = 8);\n translate([0 - 28, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(r = 16.8 \/ 2, h = 8);\n translate([0, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cube([3, 1, 5]);\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 2]) rotate([90, 0, -30]) cube([3, 1, 5]);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 2]) rotate([90, 0, 30]) cube([3, 1, 5]);\n\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, -30]) cylinder(r = 1.5 + IRLedD, h = 10);\n translate([-8, -plateY \/ 2 - 10, borderZ \/ 4]) rotate([100, 0, 0]) cylinder(r = 1.5 + IRLedD, h = 10);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, 30]) cylinder(r = 1.5 + IRLedD, h = 10);\n }\n\n \/\/Tubes to focus the IR beams\n translate([-plateX \/ 2, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n translate([-plateX \/ 2 + 15, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n translate([-plateX \/ 2 + 30, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n \/\/\ttranslate([-8,-plateY\/2-10,borderZ\/4]) rotate([100,0,0])difference (){cylinder(r=1.2*IRLedD,h=8); cylinder(r=IRLedD,h=10);}\n \/\/\ttranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/4]) rotate([100,0,30])difference (){cylinder(r=1.2*IRLedD,h=10); cylinder(r=IRLedD,h=8);}\n}\n\nmodule Powerplate() {\n\n difference() {\n plate(plateX, plateY, plateZ, borderZ, \"True\", \"True\", \"True\", \"Power\");\n \/\/fix for batteries\n translate([plateX \/ 2 - 15, plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([-plateX \/ 2 + 15, plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([plateX \/ 2 - 15, -plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([-plateX \/ 2 + 15, -plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n\n }\n\n translate([plateX \/ 2 - 15, plateY \/ 2 + 4, borderZ \/ 2])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([-plateX \/ 2 + 15, plateY \/ 2 + 4, borderZ \/ 2])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([plateX \/ 2 - 15, -plateY \/ 2 - 1, borderZ \/ 2]) rotate([0, 0, 180])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([-plateX \/ 2 + 15, -plateY \/ 2 - 1, borderZ \/ 2]) rotate([0, 0, 180])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n\n\n \/\/mid section\n difference() {\n translate([-plateX \/ 2, 0, 0]) cube([plateX, plateZ, borderZ]);\n for (i = [1: plateX \/ 4: plateX]) {\n translate([i + (-plateX \/ 2) + borderZ \/ 2, 10, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(20, r = 0.8 * borderZ \/ 2);\n\n }\n\n\n }\n\n\n}\n\nmodule BrainPlate() {\n plate(plateX, plateY, plateZ, borderZ, \"False\", \"True\", \"True\", \"\");\n translate([-plateX \/ 2, -plateY \/ 2, borderZ \/ 2]) {\n color(\"green\") rotate([90, 0, 0])\n translate([120, -2, 0]) scale(0.3) arduinoLogo(5, 30);\n translate([5, -12, 0]) scale(0.1) put_pilogo(1.5 \/ 0.1);\n translate([80, -2, 0]) scale(0.1) put_OAlogo(1.5 \/ 0.1);\n }\n}\n\n\nmodule MotorBody() {\n difference() {\n linear_extrude(RobotZ, center = true, convexity = 0, twist = 0) {\n difference() {\n \/\/eed to redefine the motorbody as a fixed lenght \t\t\t\n union() {\n translate([0, RobotX \/ 2, 0]) square([RobotX, 220 - RobotX - 15]);\n translate([RobotX \/ 2, 40, 0]) circle(RobotX \/ 2);\n }\n translate([RobotX \/ 2, 40, 0]) circle(26 \/ 2);\n translate([RobotX \/ 2, 40, 0]) circle(3);\n\n \/\/Motor holes\n translate([RobotX \/ 2, 40, 0]) {\n for (i = [0: 4]) {\n rotate((i * 360 \/ 4) + 45)\n \/\/datasheet provides distance between holes, we need the radius from the shaft\n translate([21.92, 0, 0])\n circle(3);\n }\n }\n \/\/Modules\n for (i = [112: BodyHoleSpace: RobotY]) {\n translate([RobotX \/ 2, i, 0]) circle(BodyHoleR);\n \/\/Slots for plates\n translate([RobotX \/ 8, i - BodyHoleR - 5, 0]) square([1.15 * plateanchorY, 1.15 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, i - BodyHoleR - 5, 0]) square([plateanchorY, plateZ]);\n translate([RobotX \/ 2, i - 25 - plateZ, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([7 * RobotX \/ 8, i, 0]) circle(3);\n }\n }\n\n }\n \/\/Connection with body extension\n translate([0, 220 - RobotX + 2, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, 3 * BodyHoleSpace - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, 3 * BodyHoleSpace - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n }\n}\n\n\nmodule BodyExtension() {\n difference() {\n linear_extrude(RobotZ, center = true, convexity = 0, twist = 0) {\n difference() {\n square([RobotX, RobotY]);\n for (i = [0: BodyHoleSpace: RobotY]) {\n translate([RobotX \/ 2, i, 0]) circle(BodyHoleR);\n translate([RobotX \/ 8, i - BodyHoleR - 5, 0]) square([1.15 * plateanchorY, 1.15 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, i - BodyHoleR - 5, 0]) square([plateanchorY, plateZ]);\n translate([RobotX \/ 2, i - 25 - plateZ, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([7 * RobotX \/ 8, i, 0]) circle(3);\n\n }\n\n translate([RobotX \/ 8, 0, 0]) square([1.05 * plateanchorY, 1.05 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, 0, 0]) square([plateanchorY, plateZ]);\n }\n\n }\n\n \/\/creates attachment for other vertical modules\n translate([0, RobotY - 25, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, RobotY - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, RobotY - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n\n translate([0, 0, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n }\n\n\n\n}\n\n\n\nmodule PCBSupport(PCBHoleR) {\n difference() {\n cylinder(h = plateZ + 5, r = holeradius - .2);\n cylinder(h = plateZ + 2, r = holeradius \/ 2);\n cube([10, 1, 8], center = true);\n }\n translate([0, 0, plateZ + 5]) cylinder(h = 6, r = PCBHoleR);\n\n}\n\nmodule PCBSupportHole(PCBHoleR, Height) {\n difference() {\n cylinder(h = plateZ + Height, r = holeradius - T);\n cylinder(h = plateZ - 5, r = holeradius \/ 2);\n }\n translate([0, 0, plateZ + Height]) cylinder(h = 6, r = PCBHoleR);\n\n}\n\n\/\/Draw a prism based on a \n\/\/right angled triangle\n\/\/l - length of prism\n\/\/w - width of triangle\n\/\/h - height of triangle\nmodule prism(l, w, h, he) {\n translate([0, l, 0]) rotate(a = [90, 0, 0])\n linear_extrude(height = he) polygon(points = [\n [0, 0],\n [w, 0],\n [0, h]\n ], paths = [\n [0, 1, 2, 0]\n ]);\n}\n\n module SUB_nemaMountingPlateHoles() {\n translate([-(3\/5)*plateY\/2, plateY \/ 2, 0]) {\n hull(){\n translate([0, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([(1\/5)*plateY, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n }\n \n hull(){\n translate([(3\/5)*plateY, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([(3\/5)*plateY-(1\/5)*plateY, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n }\n hull(){\n translate([0, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([(1\/5)*plateY, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n }\n hull(){\n translate([(3\/5)*plateY, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([(3\/5)*plateY-(1\/5)*plateY, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n }\n }\n }\n \/\/creates attachment for other vertical modules\nmodule base() {\n {\n translate([0, 0, 0]) {\n difference() {\n translate([0, plateY, 25 \/ 2]) cube([RobotX, RobotZ \/ 2, 25], center = true);\n translate([BodyHoleSpace \/ 2 - 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n translate([-BodyHoleSpace \/ 2 + 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n }\n }\n mirror([0, 1, 0]) {\n difference() {\n translate([0, plateY, 25 \/ 2]) cube([RobotX, RobotZ \/ 2, 25], center = true);\n translate([BodyHoleSpace \/ 2 - 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n translate([-BodyHoleSpace \/ 2 + 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n }\n\n\n\n }\n\n }\n\n\n difference() {\n translate([0, 0, 0]) {\n \/\/Bottomo of the baseplate\n cube([RobotX, 2 * (RobotX + RobotZ \/ 4), 6], center = true);\n\n }\n\n translate([-plateY \/ 2, 0, 0]) {\n \/\/ \"35\/4\" because of the distance of the hole in the bracket for the stepper NEMA\n\n\n for (i = [-plateX \/ 5 - 1.5: 2 * holeradius + 3: plateX \/ 5 + 1.5]) {\n translate([border, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([border + 2 * holeradius + 3, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n translate([plateY - border, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([plateY - border - (2 * holeradius + 3), i, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n }\n\n }\n\n SUB_nemaMountingPlateHoles();\n mirror([0, 1, 0]) SUB_nemaMountingPlateHoles();\n\n translate([0, 0, 0]) cylinder(h = 15, r = plateX \/ 10, center = true);\n\n }\n\n}\n\n\nmodule batteryPlate() {\n translate([0, 0, plateZ \/ 2])\n plate(plateX, 103 + 2 * plateZ, plateZ, plateZ + 5, \"True\", \"True\", \"True\", \"\");\n translate([-plateanchorY \/ 2, (103 + 2 * plateZ) \/ 2, 0])\n difference() {\n\n cube([plateanchorY, 1.5 * plateanchorX, plateZ], center = \"True\");\n translate([0, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n translate([plateanchorY, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n }\n mirror([0, 1, 0]) translate([-plateanchorY \/ 2, (103 + 2 * plateZ) \/ 2, 0])\n difference() {\n\n cube([plateanchorY, 1.5 * plateanchorX, plateZ], center = \"True\");\n translate([0, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n translate([plateanchorY, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n }\n\n}\n\n\n\nmodule stepperDriverSupport() {\n\n difference() {\n translate([RobotX \/ 2, (0 + BodyHoleSpace \/ 2), 0]) {\n\n cube([RobotX, 1.6 * BodyHoleSpace, RobotZ \/ 2], center = true);\n translate([0, 1.6 * BodyHoleSpace \/ 2, 30 \/ 2 - RobotZ \/ 2 \/ 2]) cube([RobotX, RobotZ \/ 2, 30], center = true);\n\n }\n\n for (i = [-8: BodyHoleSpace: BodyHoleSpace]) {\n translate([RobotX \/ 8, i, 0]) cylinder(r = 3, h = 10, center = true);\n translate([7 * RobotX \/ 8, i, 0]) cylinder(r = 3, h = 10, center = true);\n }\n translate([RobotX \/ 2, 1.4 * BodyHoleSpace, 20]) rotate([90, 0, 0]) cylinder(r = 3, h = 50, center = true);\n\n translate([RobotX \/ 2, 0, 0])\n hull() {\n \/\/translate([0,-BodyHoleR,0])cylinder(r=BodyHoleR,h=RobotZ\/2,center=true);\t\t\n translate([0, 5, 0]) cube([2 * BodyHoleR, 15, 20], center = true);\n translate([0, BodyHoleSpace - RobotZ \/ 2 - 8, 0]) cylinder(r = BodyHoleR, h = RobotZ \/ 2, center = true);\n }\n translate([RobotX \/ 2, -3 * RobotZ + 3, 0]) cylinder(r = 3, h = 10, center = true);\n }\n\n}\n\nbase();\n\/\/stepperDriverSupport();\n\/\/translate([-plateY\/2,-plateX\/2,0])rotate([90,0,0])BodyExtension();","old_contents":"\/\/Make passage for cables larger\nRobotY = 220;\nRobotX = 80;\nRobotZ = 5;\nBodyHoleR = 20;\nBodyHoleSpace = 55;\n\nplateX = 150;\nplateZ = 3;\nplateY = RobotX;\ncablePassageWidht = 8;\nplateanchorX = RobotZ;\nplateanchorY = 15;\nholeradius = 3;\nholespace = 3 * holeradius;\nborderZ = 30;\nborder = 8;\nT = 0.3;\n$fs = 0.01;\n\nstepperSupportHeight = 70;\n\nborder = holespace + ((plateX) \/ holespace - floor((plateX) \/ holespace)) \/ 2;\ninclude < TextGenerator.scad > ;\n\nmodule put_pilogo(mt) {\n fn = \"raspberrypi_logo.dxf\";\n \/\/ calculate the scale and which offset to use\n\n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\n\nmodule put_Alogo(mt) {\n fn = \"arduino.dxf\";\n \/\/ calculate the scale and which offset to use\n\n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\nmodule put_OAlogo(mt) {\n fn = \"ohw-logo.dxf\";\n \/\/ calculate the scale and which offset to use \n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\n\nmodule SUB_batteryAnchor() {\n\n}\n\nmodule arduinoLogo(h, r) {\n\n scale([0.9, .7, 1]) union() {\n difference() {\n cylinder(h = h, r = r);\n cylinder(h = h, r = r - .25 * r);\n }\n translate([1.8 * r, 0, 0]) difference() {\n cylinder(h = h, r = r);\n cylinder(h = h, r = r - .25 * r);\n }\n\n }\n translate([0, 0, h \/ 2]) cube([0.6 * r, 0.2 * r, h], center = true);\n translate([2 * r - 0.4 * r, 0, h \/ 2]) {\n cube([0.6 * r, 0.2 * r, h], center = true);\n rotate([0, 0, 90]) cube([0.6 * r, 0.2 * r, h], center = true);\n }\n}\n\nmodule plate(plateX, plateY, plateZ, borderZ, holes, baseF, baseB, text) {\n difference() {\n linear_extrude(plateZ, center = true, convexity = 0, twist = 0)\n\n difference() {\n\n union() {\n square([plateX, plateY], center = true);\n\n translate([-plateX \/ 2 - plateanchorX, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n mirror([0, 1, 0]) translate([-plateX \/ 2 - plateanchorX, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n\n translate([+plateX \/ 2, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n mirror([0, 1, 0]) translate([+plateX \/ 2, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n }\n\n \/\/punchholes at the bottom of the plate\n if (holes == \"True\") {\n for (j = [border: holespace: plateY - border]) {\n for (i = [border: holespace: plateX - 2 * border]) {\n translate([i + border - plateX \/ 2 - holeradius \/ 2, j - plateY \/ 2, 0]) circle(holeradius);\n }\n }\n\n }\n }\n\n \/\/Passage for cables\n translate([-plateX \/ 2 + cablePassageWidht, j + border - plateY \/ 2, 0]) cube([cablePassageWidht, 0.5 * plateY, plateZ], center = true);\n translate([plateX \/ 2 - cablePassageWidht, j + border - plateY \/ 2, 0]) cube([cablePassageWidht, 0.5 * plateY, plateZ], center = true);\n\n }\n if (baseF == \"True\")\n translate([-plateX \/ 2, plateY \/ 2 - plateZ, -plateZ \/ 2]) cube([plateX, plateZ, borderZ]);\n if (baseB == \"True\")\n translate([-plateX \/ 2, -plateY \/ 2, -plateZ \/ 2]) cube([plateX, plateZ, borderZ]);\n\n translate([-plateX \/ 2, -plateY \/ 2, 5]) rotate(90, [1, 0, 0]) scale([2, 2, 1]) drawtext(text);\n\n}\n\nmodule SensorsPlate() {\n IRLedD = 3;\n\n plate(plateX, plateY, plateZ, borderZ, \"True\", \"True\", \"false\", \"\");\n difference() {\n translate([0, -plateY \/ 2 + 10, borderZ - plateZ \/ 2])\n rotate([180, 0, 0]) difference() {\n scale(v = [1, 0.30, 1]) difference() {\n cylinder(r = plateX \/ 2, h = borderZ, center = false);\n cylinder(r = plateX \/ 2 - 2 * plateZ, h = borderZ, center = false);\n }\n\n\n translate([-plateX \/ 2, -plateY \/ 2 + 10, 0]) cube([plateX, 0.35 * plateX \/ 2, plateY \/ 2]);\n }\n \/\/hole for the IR sensor\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, -30]) translate([6, -3.48, 0]) cube([6, 6.95, 10]);\n translate([-8, -plateY \/ 2 - 10, borderZ \/ 4]) rotate([100, 0, 0]) translate([6, -3.48, 0]) cube([6, 6.95, 10]);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, 30]) translate([-12, -3.48, 0]) cube([6, 6.95, 10]);\n\n \/\/holes for sonars and slots for sensors\n translate([0 + 28, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(r = 16.8 \/ 2, h = 8);\n translate([0 - 28, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(r = 16.8 \/ 2, h = 8);\n translate([0, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cube([3, 1, 5]);\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 2]) rotate([90, 0, -30]) cube([3, 1, 5]);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 2]) rotate([90, 0, 30]) cube([3, 1, 5]);\n\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, -30]) cylinder(r = 1.5 + IRLedD, h = 10);\n translate([-8, -plateY \/ 2 - 10, borderZ \/ 4]) rotate([100, 0, 0]) cylinder(r = 1.5 + IRLedD, h = 10);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, 30]) cylinder(r = 1.5 + IRLedD, h = 10);\n }\n\n \/\/Tubes to focus the IR beams\n translate([-plateX \/ 2, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n translate([-plateX \/ 2 + 15, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n translate([-plateX \/ 2 + 30, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n \/\/\ttranslate([-8,-plateY\/2-10,borderZ\/4]) rotate([100,0,0])difference (){cylinder(r=1.2*IRLedD,h=8); cylinder(r=IRLedD,h=10);}\n \/\/\ttranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/4]) rotate([100,0,30])difference (){cylinder(r=1.2*IRLedD,h=10); cylinder(r=IRLedD,h=8);}\n}\n\nmodule Powerplate() {\n\n difference() {\n plate(plateX, plateY, plateZ, borderZ, \"True\", \"True\", \"True\", \"Power\");\n \/\/fix for batteries\n translate([plateX \/ 2 - 15, plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([-plateX \/ 2 + 15, plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([plateX \/ 2 - 15, -plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([-plateX \/ 2 + 15, -plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n\n }\n\n translate([plateX \/ 2 - 15, plateY \/ 2 + 4, borderZ \/ 2])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([-plateX \/ 2 + 15, plateY \/ 2 + 4, borderZ \/ 2])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([plateX \/ 2 - 15, -plateY \/ 2 - 1, borderZ \/ 2]) rotate([0, 0, 180])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([-plateX \/ 2 + 15, -plateY \/ 2 - 1, borderZ \/ 2]) rotate([0, 0, 180])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n\n\n \/\/mid section\n difference() {\n translate([-plateX \/ 2, 0, 0]) cube([plateX, plateZ, borderZ]);\n for (i = [1: plateX \/ 4: plateX]) {\n translate([i + (-plateX \/ 2) + borderZ \/ 2, 10, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(20, r = 0.8 * borderZ \/ 2);\n\n }\n\n\n }\n\n\n}\n\nmodule BrainPlate() {\n plate(plateX, plateY, plateZ, borderZ, \"False\", \"True\", \"True\", \"\");\n translate([-plateX \/ 2, -plateY \/ 2, borderZ \/ 2]) {\n color(\"green\") rotate([90, 0, 0])\n translate([120, -2, 0]) scale(0.3) arduinoLogo(5, 30);\n translate([5, -12, 0]) scale(0.1) put_pilogo(1.5 \/ 0.1);\n translate([80, -2, 0]) scale(0.1) put_OAlogo(1.5 \/ 0.1);\n }\n}\n\n\nmodule MotorBody() {\n difference() {\n linear_extrude(RobotZ, center = true, convexity = 0, twist = 0) {\n difference() {\n \/\/eed to redefine the motorbody as a fixed lenght \t\t\t\n union() {\n translate([0, RobotX \/ 2, 0]) square([RobotX, 220 - RobotX - 15]);\n translate([RobotX \/ 2, 40, 0]) circle(RobotX \/ 2);\n }\n translate([RobotX \/ 2, 40, 0]) circle(26 \/ 2);\n translate([RobotX \/ 2, 40, 0]) circle(3);\n\n \/\/Motor holes\n translate([RobotX \/ 2, 40, 0]) {\n for (i = [0: 4]) {\n rotate((i * 360 \/ 4) + 45)\n \/\/datasheet provides distance between holes, we need the radius from the shaft\n translate([21.92, 0, 0])\n circle(3);\n }\n }\n \/\/Modules\n for (i = [112: BodyHoleSpace: RobotY]) {\n translate([RobotX \/ 2, i, 0]) circle(BodyHoleR);\n \/\/Slots for plates\n translate([RobotX \/ 8, i - BodyHoleR - 5, 0]) square([1.15 * plateanchorY, 1.15 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, i - BodyHoleR - 5, 0]) square([plateanchorY, plateZ]);\n translate([RobotX \/ 2, i - 25 - plateZ, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([7 * RobotX \/ 8, i, 0]) circle(3);\n }\n }\n\n }\n \/\/Connection with body extension\n translate([0, 220 - RobotX + 2, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, 3 * BodyHoleSpace - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, 3 * BodyHoleSpace - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n }\n}\n\n\nmodule BodyExtension() {\n difference() {\n linear_extrude(RobotZ, center = true, convexity = 0, twist = 0) {\n difference() {\n square([RobotX, RobotY]);\n for (i = [0: BodyHoleSpace: RobotY]) {\n translate([RobotX \/ 2, i, 0]) circle(BodyHoleR);\n translate([RobotX \/ 8, i - BodyHoleR - 5, 0]) square([1.15 * plateanchorY, 1.15 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, i - BodyHoleR - 5, 0]) square([plateanchorY, plateZ]);\n translate([RobotX \/ 2, i - 25 - plateZ, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([7 * RobotX \/ 8, i, 0]) circle(3);\n\n }\n\n translate([RobotX \/ 8, 0, 0]) square([1.05 * plateanchorY, 1.05 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, 0, 0]) square([plateanchorY, plateZ]);\n }\n\n }\n\n \/\/creates attachment for other vertical modules\n translate([0, RobotY - 25, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, RobotY - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, RobotY - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n\n translate([0, 0, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n }\n\n\n\n}\n\n\n\nmodule PCBSupport(PCBHoleR) {\n difference() {\n cylinder(h = plateZ + 5, r = holeradius - .2);\n cylinder(h = plateZ + 2, r = holeradius \/ 2);\n cube([10, 1, 8], center = true);\n }\n translate([0, 0, plateZ + 5]) cylinder(h = 6, r = PCBHoleR);\n\n}\n\nmodule PCBSupportHole(PCBHoleR, Height) {\n difference() {\n cylinder(h = plateZ + Height, r = holeradius - T);\n cylinder(h = plateZ - 5, r = holeradius \/ 2);\n }\n translate([0, 0, plateZ + Height]) cylinder(h = 6, r = PCBHoleR);\n\n}\n\n\/\/Draw a prism based on a \n\/\/right angled triangle\n\/\/l - length of prism\n\/\/w - width of triangle\n\/\/h - height of triangle\nmodule prism(l, w, h, he) {\n translate([0, l, 0]) rotate(a = [90, 0, 0])\n linear_extrude(height = he) polygon(points = [\n [0, 0],\n [w, 0],\n [0, h]\n ], paths = [\n [0, 1, 2, 0]\n ]);\n}\n\n\nmodule SUB_nemaMountingPlateHoles() {\n translate([-35 \/ 2, plateY \/ 2, 0]) {\n translate([0, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([35, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([0, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([35, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n }\n }\n \/\/creates attachment for other vertical modules\nmodule base() {\n {\n translate([0, 0, 0]) {\n difference() {\n translate([0, plateY, 25 \/ 2]) cube([RobotX, RobotZ \/ 2, 25], center = true);\n translate([BodyHoleSpace \/ 2 - 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n translate([-BodyHoleSpace \/ 2 + 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n }\n }\n mirror([0, 1, 0]) {\n difference() {\n translate([0, plateY, 25 \/ 2]) cube([RobotX, RobotZ \/ 2, 25], center = true);\n translate([BodyHoleSpace \/ 2 - 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n translate([-BodyHoleSpace \/ 2 + 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n }\n\n\n\n }\n\n }\n\n\n difference() {\n translate([0, 0, 0]) {\n \/\/Bottomo of the baseplate\n cube([RobotX, 2 * (RobotX + RobotZ \/ 4), 6], center = true);\n\n }\n\n translate([-plateY \/ 2, 0, 0]) {\n \/\/ \"35\/4\" because of the distance of the hole in the bracket for the stepper NEMA\n\n\n for (i = [-plateX \/ 5 - 1.5: 2 * holeradius + 3: plateX \/ 5 + 1.5]) {\n translate([border, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([border + 2 * holeradius + 3, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n translate([plateY - border, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([plateY - border - (2 * holeradius + 3), i, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n }\n\n }\n\n SUB_nemaMountingPlateHoles();\n mirror([0, 1, 0]) SUB_nemaMountingPlateHoles();\n\n translate([0, 0, 0]) cylinder(h = 15, r = plateX \/ 10, center = true);\n\n }\n\n}\n\n\nmodule batteryPlate() {\n translate([0, 0, plateZ \/ 2])\n plate(plateX, 103 + 2 * plateZ, plateZ, plateZ + 5, \"True\", \"True\", \"True\", \"\");\n translate([-plateanchorY \/ 2, (103 + 2 * plateZ) \/ 2, 0])\n difference() {\n\n cube([plateanchorY, 1.5 * plateanchorX, plateZ], center = \"True\");\n translate([0, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n translate([plateanchorY, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n }\n mirror([0, 1, 0]) translate([-plateanchorY \/ 2, (103 + 2 * plateZ) \/ 2, 0])\n difference() {\n\n cube([plateanchorY, 1.5 * plateanchorX, plateZ], center = \"True\");\n translate([0, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n translate([plateanchorY, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n }\n\n}\n\n\n\nmodule stepperDriverSupport() {\n\n difference() {\n translate([RobotX \/ 2, (0 + BodyHoleSpace \/ 2), 0]) {\n\n cube([RobotX, 1.6 * BodyHoleSpace, RobotZ \/ 2], center = true);\n translate([0, 1.6 * BodyHoleSpace \/ 2, 30 \/ 2 - RobotZ \/ 2 \/ 2]) cube([RobotX, RobotZ \/ 2, 30], center = true);\n\n }\n\n for (i = [-8: BodyHoleSpace: BodyHoleSpace]) {\n translate([RobotX \/ 8, i, 0]) cylinder(r = 3, h = 10, center = true);\n translate([7 * RobotX \/ 8, i, 0]) cylinder(r = 3, h = 10, center = true);\n }\n translate([RobotX \/ 2, 1.4 * BodyHoleSpace, 20]) rotate([90, 0, 0]) cylinder(r = 3, h = 50, center = true);\n\n translate([RobotX \/ 2, 0, 0])\n hull() {\n \/\/translate([0,-BodyHoleR,0])cylinder(r=BodyHoleR,h=RobotZ\/2,center=true);\t\t\n translate([0, 5, 0]) cube([2 * BodyHoleR, 15, 20], center = true);\n translate([0, BodyHoleSpace - RobotZ \/ 2 - 8, 0]) cylinder(r = BodyHoleR, h = RobotZ \/ 2, center = true);\n }\n translate([RobotX \/ 2, -3 * RobotZ + 3, 0]) cylinder(r = 3, h = 10, center = true);\n }\n\n}\n\nbase();\n\/\/stepperDriverSupport();\n\/\/translate([-plateY\/2,-plateX\/2,0])rotate([90,0,0])BodyExtension();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"785ea7c0bea8246b97e769edbe7d717a87f65686","subject":"Create StepperMount.scad","message":"Create StepperMount.scad","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"StepperMount.scad","new_file":"StepperMount.scad","new_contents":"\/*\nStepper steel mount\n*\/\nmodule StepperMount (){\ncolor( \"Black\", 1 ) {\nunion (){\ndifference (){\n \n cube ([50,52,53.5]) ; \n \n \/\/ difference starts here \n translate ([-1,3,3]) \n cube ([52,52,53.5]) ; \n hull() {\n translate ([8,3,13]) rotate ([90,0,0])\n cylinder(d=4.2,h=10, center = true);\n translate ([8,3,42]) rotate ([90,0,0])\n cylinder(d=4.2,h=10, center = true);\n }\n hull() {\n translate ([42,3,13]) rotate ([90,0,0])\n cylinder(d=4.2,h=10, center = true);\n translate ([42,3,42]) rotate ([90,0,0])\n cylinder(d=4.2,h=10, center = true);\n }\n translate ([25,31,-1])\n cylinder(d=22,h=10, center = true);\n translate ([10,46,-1])\n cylinder(d=3.5,h=10, center = true);\n translate ([10,15,-1])\n cylinder(d=3.5,h=10, center = true);\n translate ([41,15,-1])\n cylinder(d=3.5,h=10, center = true);\n translate ([41,46,-1])\n cylinder(d=3.5,h=10, center = true);\n\n}\ndifference (){\n translate ([0,3,3])\n cube ([3,20,15]) ; \n translate ([4,3,18]) rotate ([127,0,180])\n cube ([5,20,30]) ; \n}\ndifference (){\n translate ([47,3,3])\n cube ([3,20,15]) ; \n translate ([51,3,18]) rotate ([127,0,180])\n cube ([5,20,30]) ; \n}\n}\n}\n}\n\/\/ Place the stepper mounts\ntranslate ([13,320 ,56]) rotate ([0,180,180])\nStepperMount ();\n\ntranslate ([377,320 ,56]) rotate ([0,180,180])\nStepperMount ();\n\n\/\/ the CoreXY drive shafts\ncolor( \"Silver\", 1 ) {\ntranslate ([38,289 ,66]) rotate ([0,0,180])\ncylinder(d=8,h=270, center = false);\ntranslate ([402,289 ,66]) rotate ([0,0,180])\ncylinder(d=8,h=270, center = false);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'StepperMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"2715fbd1c792207f680c7744362d196694b3b471","subject":"made B node on BH a little fatter","message":"made B node on BH a little fatter\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ PART=\"motor\" to show motor-mount assembly\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"FootA\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight-.2;\nacH1 = acH0+1.5;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + 1.5*HoleFuzz; \/\/ standoff countersink radius\n\n difference() {\n union() {\n pulley2(AC+5.5,ph,sr,0); \/\/ make with radius for standoff\n translate([0,0,0.1])\n cylinder(r=sr+1,h=ph-0.7,$fn=12); \/\/ fill back in for rod hole\n }\n\n translate([0,0,-1]) cylinder(r=rad4,h=ph+4,$fn=17); \/\/ drill hole for central rod\n for (y=[-1,1]) translate([0,AC*y,-1])\n cylinder(r=3,h=ph,$fn=36); \/\/ screw pass-through for crank arm\n }\n\n\/*\nsd=.8; \/\/ standoff countersink distance \n\n \/\/ countersink main pulley for standoffs a bit.\n difference() {\n union() {\n pulley(18,ph,rad4,0);\n \/\/ pulley hub was 1.3 mm higher than outher thickness. a little more for countersink\n cylinder(r1=5,r2=4,h=ph+1.5,$fn=36); \/\/ give pulley a wider hub\n }\n\n translate([0,0,-1]) {\n cylinder(r=rad4,h=ph+3,$fn=17); \/\/ main threaded rod hole\n \/\/cylinder(r=sr,h=1+sd+.2,$fn=28); \/\/ a little extra on bridged standoff depth\n }\n translate([0,0,ph+1.5-sd-.5]) cylinder(r=sr,h=3,$fn=28);\n }\n*\/\n\n}\n\n\/\/module motorPulley() pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz);\nmodule motorPulley() pulley2(8,4,1.5+dHoleFuzz,1+dHoleFuzz);\n\nuse \nmodule motorMountDemo() {\npo=8; \/\/ main pulley offset\n translate([0,-Ay,0]) mainBar(Bx,Ay);\n translate([0,-Ay,22]) rotate([0,180,0]) mainBar(Bx,Ay);\n translate([0,-Ay-5.4,4]) rotate([0,180,0]) motorMount();\n translate([0,0,po]) mainPulley();\n #translate([0,0,po-12.7 ]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n #translate([0,0,po+6.6-.6]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n translate([0,-38.5,8]) motorPulley();\n translate([0,0,26.7]) rotate([0,0,90]) crankArmAC();\n}\n\nmodule crankArmAC() crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+2.5,BradFree+.2,3,Hrad+2.5,rad4);\nelse if (PART==\"AC\" ) crankArmAC(); \nelse if (PART==\"pulley\") { mainPulley(); }\nelse if (PART==\"drivePulley\") { motorPulley(); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad+.1); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\nelse if (PART==\"motor\") { motorMountDemo(); }\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n %translate([0,Ay,20]) mainPulley();\n translate([0,-50,0]) motorPulley();\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArmAC(); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n\n\n\/\/else if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7); translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\n\/\/else if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15); translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ PART=\"motor\" to show motor-mount assembly\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"mainBar\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight-.2;\nacH1 = acH0+1.5;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + 1.5*HoleFuzz; \/\/ standoff countersink radius\n\n difference() {\n union() {\n pulley2(AC+5.5,ph,sr,0); \/\/ make with radius for standoff\n translate([0,0,0.1])\n cylinder(r=sr+1,h=ph-0.7,$fn=12); \/\/ fill back in for rod hole\n }\n\n translate([0,0,-1]) cylinder(r=rad4,h=ph+4,$fn=17); \/\/ drill hole for central rod\n for (y=[-1,1]) translate([0,AC*y,-1])\n cylinder(r=3,h=ph,$fn=36); \/\/ screw pass-through for crank arm\n }\n\n\/*\nsd=.8; \/\/ standoff countersink distance \n\n \/\/ countersink main pulley for standoffs a bit.\n difference() {\n union() {\n pulley(18,ph,rad4,0);\n \/\/ pulley hub was 1.3 mm higher than outher thickness. a little more for countersink\n cylinder(r1=5,r2=4,h=ph+1.5,$fn=36); \/\/ give pulley a wider hub\n }\n\n translate([0,0,-1]) {\n cylinder(r=rad4,h=ph+3,$fn=17); \/\/ main threaded rod hole\n \/\/cylinder(r=sr,h=1+sd+.2,$fn=28); \/\/ a little extra on bridged standoff depth\n }\n translate([0,0,ph+1.5-sd-.5]) cylinder(r=sr,h=3,$fn=28);\n }\n*\/\n\n}\n\n\/\/module motorPulley() pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz);\nmodule motorPulley() pulley2(8,4,1.5+dHoleFuzz,1+dHoleFuzz);\n\nuse \nmodule motorMountDemo() {\npo=8; \/\/ main pulley offset\n translate([0,-Ay,0]) mainBar(Bx,Ay);\n translate([0,-Ay,22]) rotate([0,180,0]) mainBar(Bx,Ay);\n translate([0,-Ay-5.4,4]) rotate([0,180,0]) motorMount();\n translate([0,0,po]) mainPulley();\n #translate([0,0,po-12.7 ]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n #translate([0,0,po+6.6-.6]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n translate([0,-38.5,8]) motorPulley();\n translate([0,0,26.7]) rotate([0,0,90]) crankArmAC();\n}\n\nmodule crankArmAC() crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+2,BradFree+.2,3,Hrad+2.5,rad4);\nelse if (PART==\"AC\" ) crankArmAC(); \nelse if (PART==\"pulley\") { mainPulley(); }\nelse if (PART==\"drivePulley\") { motorPulley(); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad+.1); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\nelse if (PART==\"motor\") { motorMountDemo(); }\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n %translate([0,Ay,20]) mainPulley();\n translate([0,-50,0]) motorPulley();\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArmAC(); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n\n\n\/\/else if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7); translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\n\/\/else if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15); translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"db38976e6ff7ad6865aeedfdc24e687d65924213","subject":"fixed cuts' span","message":"fixed cuts' span\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_door_blocker\/blocker.scad","new_file":"closet_door_blocker\/blocker.scad","new_contents":"\/\/ closing nails' parameters\nnail_thickness = 1;\nnail_head = 3.5;\nnail_span = 43;\nnail_outstand = 3;\n\n\nmodule cut(height, length, span_up, span_down)\n{\n up_offset = (span_down-span_up)\/2;\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [ up_offset, length, 0], \/\/ 1\n [ up_offset+span_up, length, 0], \/\/ 2\n [ span_down, 0, 0], \/\/ 3\n [ 0, 0, height], \/\/ 4\n [ up_offset, length, height], \/\/ 5\n [ up_offset+span_up, length, height], \/\/ 6\n [ span_down, 0, height] \/\/ 7\n ],\n faces = [\n \/\/ bottom\n [4,5,7],\n [5,6,7],\n \/\/ top\n [2,1,0],\n [0,3,2],\n \/\/ upper wall\n [1,2,5],\n [6,5,2],\n \/\/ lower wall\n [4,3,0],\n [3,4,7],\n \/\/ left wall\n [0,1,4],\n [5,4,1],\n \/\/ right wall\n [2,3,7],\n [7,6,2]\n ]\n );\n}\n\n\nspacing = 2;\ntop = 1.5*nail_thickness;\nbottom = 2*nail_head;\ncut_h = (nail_head - nail_thickness)*8;\nh = cut_h + 2*spacing;\nl = nail_span + bottom\/2*2 + 2*spacing;\nthick = nail_outstand\/2;\n\ndifference()\n{\n cube([l, h, thick]);\n for(dx = [spacing, l-spacing-bottom])\n translate([dx, (h-cut_h)\/2, 0])\n cut(thick, cut_h, top, bottom);\n}","old_contents":"\/\/ closing nails' parameters\nnail_thickness = 1;\nnail_head = 3.5;\nnail_span = 43;\nnail_outstand = 3;\n\n\nmodule cut(height, length, span_up, span_down)\n{\n up_offset = (span_down-span_up)\/2;\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [ up_offset, length, 0], \/\/ 1\n [ up_offset+span_up, length, 0], \/\/ 2\n [ span_down, 0, 0], \/\/ 3\n [ 0, 0, height], \/\/ 4\n [ up_offset, length, height], \/\/ 5\n [ up_offset+span_up, length, height], \/\/ 6\n [ span_down, 0, height] \/\/ 7\n ],\n faces = [\n \/\/ bottom\n [4,5,7],\n [5,6,7],\n \/\/ top\n [2,1,0],\n [0,3,2],\n \/\/ upper wall\n [1,2,5],\n [6,5,2],\n \/\/ lower wall\n [4,3,0],\n [3,4,7],\n \/\/ left wall\n [0,1,4],\n [5,4,1],\n \/\/ right wall\n [2,3,7],\n [7,6,2]\n ]\n );\n}\n\n\nspacing = 2;\ntop = 1.5*nail_thickness;\nbottom = 2*nail_head;\ncut_h = (nail_head-nail_thickness)*8;\nh = cut_h + 2*spacing;\nl = nail_span + bottom\/2*2 + 2*5;\nthick = nail_outstand\/2;\n\ndifference()\n{\n cube([l, h, thick]);\n for(dx = [spacing, l-spacing-bottom])\n translate([dx, (h-cut_h)\/2, 0])\n cut(thick, cut_h, top, bottom);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dc7873f268567e3271525a4ef85ba286acab5ebb","subject":"WIP SN04 sensor mount","message":"WIP SN04 sensor mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e7786dfe1ea8c0e115dcf8a8babaf376a76e7468","subject":"Colors were added to the outer rings.","message":"Colors were added to the outer rings.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/coins\/coins-pendants-ornaments.scad","new_file":"OpenSCAD\/coins\/coins-pendants-ornaments.scad","new_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/ \n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\nuse ;\n\n$fn=100;\n\nornament();\n\nmodule ornament(height = 3,\n includeGimbal = \"yes\" \/\/ [yes, no]\n )\n{\n {\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n }\n\n difference()\n {\n color(\"blue\") \n pattern(height);\n \n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule pattern(height)\n{\n coinScale = 0.2;\/\/0.199248\n \n union()\n {\n \tscale([coinScale, -coinScale, 1]) \n \t{\n \t\tunion() \n \t\t{\n \t\t coin(height=height);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n\t color(\"pink\")\n \tcylinder(r=19.35, h=height, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t color(\"grey\")\n\t\tcylinder(r=15.95, h=height, center=true);\n\t\t\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}","old_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/ \n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\nuse ;\n\n$fn=100;\n\nornament();\n\nmodule ornament(height = 3,\n includeGimbal = \"yes\" \/\/ [yes, no]\n )\n{\n {\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n }\n\n difference()\n {\n color(\"blue\") \n pattern(height);\n \n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule pattern(height)\n{\n coinScale = 0.2;\/\/0.199248\n \n union()\n {\n \tscale([coinScale, -coinScale, 1]) \n \t{\n \t\tunion() \n \t\t{\n \t\t coin(height=height);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n \tcylinder(r=19.35, h=height, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=15.95, h=height, center=true);\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b3c696740b58b8e7176ebc3ac7b8637b013d6010","subject":"Use donutSector instead of custom work","message":"Use donutSector instead of custom work\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 8;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 5;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\trotate([0, 0, (180 - wrapAngle) \/ 2])\n\t\tdonutSector(outr, outr - thickness, wrapAngle);\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0]) \n\trotate([0, 0, microSwitchAngle]) {\n\n\t\t\/\/ Springy bits\n\t\ttranslate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Rear support lozenge with pin hole\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0, 0, dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n","old_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 8;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 5;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate([0, 0, wrapAngle\/2])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate([0, 0, -wrapAngle\/2])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0]) \n\trotate([0, 0, microSwitchAngle]) {\n\n\t\t\/\/ Springy bits\n\t\ttranslate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Rear support lozenge with pin hole\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0, 0, dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a0351bc7bb9211e7cb8d977f5e5edd67beb4405c","subject":"Increased size of bumper bumpstop","message":"Increased size of bumper bumpstop\n\nTo make bumper\/microswitch easier and more tolerant to being bent out\nof alignment\u2026 might also avoid need for bumper stabiliser - subject to\ntesting\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"\/* Pins required -\n\npintack(side=true, h=7.8+2+2.5+6*layers, bh=2);\n\n*\/\n\n\/\/ TODO: The locations of these connectors are just horrible and too \"magic\"\nBumper_Con_LeftMicroSwitch =\n[\n\tzr3Vect( [(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightMicroSwitch =\n[\n\t[ -zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[0],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[1],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nBumper_Con_LeftPin =\n[\n\tzr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightPin =\n[\n\t[ -zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[0],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[1],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t view(t=[0,0,0], r=[58,0,225], d=681);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) {\n\t\t\tconnector(Bumper_Con_LeftMicroSwitch);\n\t\t\tconnector(Bumper_Con_RightMicroSwitch);\n\t\t\tconnector(Bumper_Con_LeftPin);\n\t\t\tconnector(Bumper_Con_RightPin);\n\t\t}\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 12;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 7;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius of the bumper\n\n \/\/ Bumper flange\n\trotate([0, 0, (180 - wrapAngle) \/ 2])\n difference() {\n linear_extrude(thickness*2)\n donutSector(outr, outr-thickness*2, wrapAngle, $fn=128);\n\n translate([0,0,thickness*2])\n rotate_extrude(convexity = 10, $fn=128)\n translate([outr-thickness*2,0,0])\n circle(r=thickness, $fn=24);\n }\n\n\t\/\/ Bumper arc\n\tdifference() {\n\t\tlinear_extrude(height)\n\t\t\trotate([0, 0, (180 - wrapAngle) \/ 2])\n\t\t\tdonutSector(outr, outr - thickness, wrapAngle, $fn=128);\n\n\t\t\/\/ trim off the back of the bumper to save plastic and look cool\n\t\ttranslate([0,0,3])\n\t\t\trotate([15,0,0])\n\t\t\ttranslate([-outr,0,0])\n\t\t\tcube([2*outr, 100,50]);\n\t}\n\n\t\/\/ text\n\ts = \"LOGOBOT\";\n\tlw = 10; \/\/ letter width\n\tfor (i=[0:len(s)-1])\n\t\trotate([0,0,-21 + i*7 + (i==0 ? 2 : 0)])\n\t\ttranslate([5, outr-1.5, (height-10)\/2 ])\n\t\trotate([90,0,180])\n\t\tlinear_extrude(2)\n\t\ttext(s[i], size=10);\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\t {\n\n\t\t\/\/ Springy bits\n\t\tMicroSwitchSpring();\n\n\t\t\/\/ old Springy bits\n\t\t*translate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([-bumpstopWidth + 8, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 16, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\n\nmodule MicroSwitchSpring() {\n\t\/\/ generate a spring along a bezier curve :)\n\n\t\/\/ number of steps in curve\n\tsteps = 50;\n\n\t\/\/ control points\n\tcp1 = [7, BaseDiameter\/2]; \/\/ start\n\tcp4 = [3, BaseDiameter\/2 - 24]; \/\/ end\n\tcp2 = [ cp1[0] + 40, cp1[1]-30 ]; \/\/ handle 1\n\tcp3 = [ cp4[0] + 20, cp4[1]-20 ]; \/\/ handle 2\n\n\t\/\/ debug control points\n\t*color(\"red\") {\n\t\ttranslate(cp1) cylinder(r=0.2, h=30);\n\t\ttranslate(cp2) cylinder(r=0.2, h=30);\n\t\ttranslate(cp3) cylinder(r=0.2, h=30);\n\t\ttranslate(cp4) cylinder(r=0.2, h=30);\n\t}\n\n\t\/\/ generate the actual curve\n\tlinear_extrude(5)\n\t\tunion() \/\/ union lots of little \"pill\" shapes for each segment of the curve\n\t\tfor (i=[0:steps-2]) {\n\t\t\t\/\/ curve time parameters for this step and next\n\t\t\tu1 = i \/ (steps-1);\n\t\t\tu2 = (i+1) \/ (steps-1);\n\n\t\t\t\/\/ 2D points for this step and next\n\t\t\tp1 = PtOnBez2D(cp1, cp2, cp3, cp4, u1);\n\t\t\tp2 = PtOnBez2D(cp1, cp2, cp3, cp4, u2);\n\n\t\t\t\/\/ hull together circles at this the position of this step and next\n\t\t\thull($fn=8) {\n\t\t\t\ttranslate(p1) circle(perim);\n\t\t\t\ttranslate(p2) circle(perim);\n\t\t\t}\n\t\t}\n}\n\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 0.5 + 2*dw;\n\tbase_width = ms_width + 6.5;\n\n\t\/\/ Base\n\tcube([base_length, base_width, dw]);\n\t\/\/ Microswitch surround\n\tcube([dw, base_width, dw + 3]);\n\ttranslate([base_length - dw, 0, 0])\n\t\tcube([dw, base_width, dw + 3]);\n\ttranslate([0, 4, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\n\t\/\/ Rear support lozenge with pin hole\n\tlozenge_height = dw + ms_height;\n\n\ttranslate([0, -7, 0])\n\tdifference() {\n\t\tlinear_extrude(lozenge_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([15.7, 2.65, lozenge_height + dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n\n\/\/ Rotate a 3vector v = [x,y,z] about the origin by ang degrees\nfunction zr3Vect(v, ang) =\n[\n\tv[0] * cos(ang) - v[1] * sin(ang),\n\tv[0] * sin(ang) + v[1] * cos(ang),\n\tv[2]\n];\n","old_contents":"\/* Pins required -\n\npintack(side=true, h=7.8+2+2.5+6*layers, bh=2);\n\n*\/\n\n\/\/ TODO: The locations of these connectors are just horrible and too \"magic\"\nBumper_Con_LeftMicroSwitch =\n[\n\tzr3Vect( [(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightMicroSwitch =\n[\n\t[ -zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[0],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[1],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nBumper_Con_LeftPin =\n[\n\tzr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightPin =\n[\n\t[ -zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[0],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[1],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t view(t=[0,0,0], r=[58,0,225], d=681);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) {\n\t\t\tconnector(Bumper_Con_LeftMicroSwitch);\n\t\t\tconnector(Bumper_Con_RightMicroSwitch);\n\t\t\tconnector(Bumper_Con_LeftPin);\n\t\t\tconnector(Bumper_Con_RightPin);\n\t\t}\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 8;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 5;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius of the bumper\n\n \/\/ Bumper flange\n\trotate([0, 0, (180 - wrapAngle) \/ 2])\n difference() {\n linear_extrude(thickness*2)\n donutSector(outr, outr-thickness*2, wrapAngle, $fn=128);\n\n translate([0,0,thickness*2])\n rotate_extrude(convexity = 10, $fn=128)\n translate([outr-thickness*2,0,0])\n circle(r=thickness, $fn=24);\n }\n\n\t\/\/ Bumper arc\n\tdifference() {\n\t\tlinear_extrude(height)\n\t\t\trotate([0, 0, (180 - wrapAngle) \/ 2])\n\t\t\tdonutSector(outr, outr - thickness, wrapAngle, $fn=128);\n\n\t\t\/\/ trim off the back of the bumper to save plastic and look cool\n\t\ttranslate([0,0,3])\n\t\t\trotate([15,0,0])\n\t\t\ttranslate([-outr,0,0])\n\t\t\tcube([2*outr, 100,50]);\n\t}\n\n\t\/\/ text\n\ts = \"LOGOBOT\";\n\tlw = 10; \/\/ letter width\n\tfor (i=[0:len(s)-1])\n\t\trotate([0,0,-21 + i*7 + (i==0 ? 2 : 0)])\n\t\ttranslate([5, outr-1.5, (height-10)\/2 ])\n\t\trotate([90,0,180])\n\t\tlinear_extrude(2)\n\t\ttext(s[i], size=10);\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\t {\n\n\t\t\/\/ Springy bits\n\t\tMicroSwitchSpring();\n\n\t\t\/\/ old Springy bits\n\t\t*translate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 16, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\n\nmodule MicroSwitchSpring() {\n\t\/\/ generate a spring along a bezier curve :)\n\n\t\/\/ number of steps in curve\n\tsteps = 50;\n\n\t\/\/ control points\n\tcp1 = [7, BaseDiameter\/2]; \/\/ start\n\tcp4 = [3, BaseDiameter\/2 - 24]; \/\/ end\n\tcp2 = [ cp1[0] + 40, cp1[1]-30 ]; \/\/ handle 1\n\tcp3 = [ cp4[0] + 20, cp4[1]-20 ]; \/\/ handle 2\n\n\t\/\/ debug control points\n\t*color(\"red\") {\n\t\ttranslate(cp1) cylinder(r=0.2, h=30);\n\t\ttranslate(cp2) cylinder(r=0.2, h=30);\n\t\ttranslate(cp3) cylinder(r=0.2, h=30);\n\t\ttranslate(cp4) cylinder(r=0.2, h=30);\n\t}\n\n\t\/\/ generate the actual curve\n\tlinear_extrude(5)\n\t\tunion() \/\/ union lots of little \"pill\" shapes for each segment of the curve\n\t\tfor (i=[0:steps-2]) {\n\t\t\t\/\/ curve time parameters for this step and next\n\t\t\tu1 = i \/ (steps-1);\n\t\t\tu2 = (i+1) \/ (steps-1);\n\n\t\t\t\/\/ 2D points for this step and next\n\t\t\tp1 = PtOnBez2D(cp1, cp2, cp3, cp4, u1);\n\t\t\tp2 = PtOnBez2D(cp1, cp2, cp3, cp4, u2);\n\n\t\t\t\/\/ hull together circles at this the position of this step and next\n\t\t\thull($fn=8) {\n\t\t\t\ttranslate(p1) circle(perim);\n\t\t\t\ttranslate(p2) circle(perim);\n\t\t\t}\n\t\t}\n}\n\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 0.5 + 2*dw;\n\tbase_width = ms_width + 6.5;\n\n\t\/\/ Base\n\tcube([base_length, base_width, dw]);\n\t\/\/ Microswitch surround\n\tcube([dw, base_width, dw + 3]);\n\ttranslate([base_length - dw, 0, 0])\n\t\tcube([dw, base_width, dw + 3]);\n\ttranslate([0, 4, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\n\t\/\/ Rear support lozenge with pin hole\n\tlozenge_height = dw + ms_height;\n\n\ttranslate([0, -7, 0])\n\tdifference() {\n\t\tlinear_extrude(lozenge_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([15.7, 2.65, lozenge_height + dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n\n\/\/ Rotate a 3vector v = [x,y,z] about the origin by ang degrees\nfunction zr3Vect(v, ang) =\n[\n\tv[0] * cos(ang) - v[1] * sin(ang),\n\tv[0] * sin(ang) + v[1] * cos(ang),\n\tv[2]\n];\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9dd53789b37447a6f182b97dc8e0e71d2ca53de4","subject":"Prepared the program for laser cutting","message":"Prepared the program for laser cutting\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 15;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 6;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n next_square_center = corner + ev_mult(translation_vectors[i], [connector_size \/ sqrt(2), connector_size \/ sqrt(2)]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n\n if(i == 0) {\n pattern(next_square_center, \"bottom_left\", current_iteration + 1);\n }\n else if(i == 1) {\n pattern(next_square_center, \"top_right\", current_iteration + 1);\n }\n else if(i == 2) {\n pattern(next_square_center, \"bottom_right\", current_iteration + 1);\n }\n else if(i == 3){\n pattern(next_square_center, \"top_left\", current_iteration + 1);\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n center_pos = [0,0] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n center_pos = [current_size \/ 2, current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n center_pos = [-current_size \/ 2, current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 2], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n center_pos = [current_size \/ 2, -current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n center_pos = [-current_size \/ 2, -current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([1, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n}\n\nunion() {\n pattern([0, 0], \"center\", 1);\n}\n","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 20;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 8;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n next_square_center = corner + ev_mult(translation_vectors[i], [connector_size \/ sqrt(2), connector_size \/ sqrt(2)]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n\n if(i == 0) {\n pattern(next_square_center, \"bottom_left\", current_iteration + 1);\n }\n else if(i == 1) {\n pattern(next_square_center, \"top_right\", current_iteration + 1);\n }\n else if(i == 2) {\n pattern(next_square_center, \"bottom_right\", current_iteration + 1);\n }\n else if(i == 3){\n pattern(next_square_center, \"top_left\", current_iteration + 1);\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n center_pos = [0,0] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n center_pos = [current_size \/ 2, current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n center_pos = [-current_size \/ 2, current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 2], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n center_pos = [current_size \/ 2, -current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n center_pos = [-current_size \/ 2, -current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([1, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"69a454a7ed5f8437e88bcf23f6ca3df872db8a05","subject":"marker holder element","message":"marker holder element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"marker_holder\/marker_holder.scad","new_file":"marker_holder\/marker_holder.scad","new_contents":"holderDiameter = 25 + 2*1.5;\ncubeLen = 7+8\/2 + 0 + holderDiameter\/2;\n\ndifference()\n{\n union()\n {\n \/\/ mounting rod\n cube([7,8,20]);\n translate([7,8\/2,0])\n cylinder(r=8\/2, h=20, $fs=0.1);\n \n \/\/ connecting bar\n translate([0, 0, 20])\n cube([cubeLen, 8, 4]);\n \n \/\/ marker holder - main part\n translate([cubeLen, -holderDiameter\/2+8, 0])\n cylinder(r=(holderDiameter)\/2, h=50);\n }\n \/\/ marker holder drill\n translate([cubeLen, -holderDiameter\/2+8, 0])\n translate([0, 0, 1.5])\n cylinder(r=25\/2, h=50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'marker_holder\/marker_holder.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"db43ce2339f66b7a04e238b747d10a499d729f26","subject":"progress on lid and oled display","message":"progress on lid and oled display\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\nOLEDWidth = 27.3;\nOLEDDisplayHeight = 19;\nOLEDScrewWidth = 20.7;\nOLEDScrewHeight = 23.2;\nOLEDScrewDiameter = 3;\nOLEDDepth = 1;\nOLEDDisplayDepth = 1;\nmodule display() {\n difference() {\n union() {\n cube([OLEDWidth, OLEDWidth, OLEDDepth]);\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, 1])\n cube([OLEDWidth, OLEDDisplayHeight, OLEDDisplayDepth]);\n }\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule pentagon_lid() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n translate([-OLEDWidth \/ 2, 0, 0]) rotate([0, 0, -18]) {\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, -.1])\n cube([OLEDWidth, OLEDDisplayHeight, boxThickness + .2]);\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n for (i = [3:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n #cylinder(h=10, d=boxScrewDiameter);\n }\n\/\/ display();\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/translate([0, 0, boxHeight + boxThickness]) spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n \/\/pentagon_core();\n \/\/translate([0, 0, boxHeight + boxThickness]) \n pentagon_lid();\n \/\/display();\n}\n\ncase();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n pentagon_core();\n}\n\ncase();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d30ab1bf5f7066b8feb7eabe8749a730f04a6ae2","subject":"Updating lasercut.scad - change the way the 2d is generated (neater\/less clutter)","message":"Updating lasercut.scad - change the way the 2d is generated (neater\/less clutter)\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n\tscrew_tabs=[], screw_tab_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n\tscrew_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n\tscrew_tabs=[], screw_tab_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n\tscrew_tabs=[], screw_tab_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n\tscrew_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n\tscrew_tabs=[], screw_tab_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness = \",thickness,\", \\n \n points = \",points,\", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n bumpy_finger_joints = \",bumpy_finger_joints,\", \\n\n screw_tabs = \",screw_tabs,\", \\n\n screw_tab_holes = \",screw_tab_holes,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\", \\n\n cutouts = \",cutouts,\", \\n\n flat_adjust = \",flat_adjust,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"84231ebfe0c7c2a5f68770287c28ecc3050650b8","subject":"simplified build a bit, using square tubes instead of additional forks","message":"simplified build a bit, using square tubes instead of additional forks\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\nwithBrace=0; \/\/ use wobble braces at knee as fork\n\n \/\/ FG (shin)\n if (withBrace) {\n hull() { \/\/ FG (shin)\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true); \/\/ foot\n }\n } else {\n \/\/ knee end fork cut out of square tube\n difference() {\n hull() {\n cube([4,2.54,2.54],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.54,$fn=24,center=true); \/\/ foot\n }\n\n #cylinder(r=.4,h=4,$fn=17,center=true);\n translate([-.5,.2,0]) cube([4,2.54,2.1],center=true);\n }\n }\n\n \/\/ knee braces\/fork\n *%color([0,1,1,.2])\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for (z=[-.3]) hull() {\n translate([ 3 , 1 ,]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() {\n translate([FGleft+4.5,FGperp-4,6]) barEnd1();\n translate([7,4.4,0]) barEnd1();\n }\n\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\nsquareTop=1; \/\/ 1==let top tube be square, no additional fork pieces\n\n if (squareTop) {\n \/\/ crank link width with flange bearings is a little over 1\"\n \/\/ so go with 1.25\" square top tube\n *difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,1.25*2.54,1.25*2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,3.2,2.8],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,3.2,2.8],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n \/\/ Even though , technically, the crank link hits the\n \/\/ edge with a 1\" top tube, I think there is enough slop\n \/\/ with the heim joint to use a 1\" top tube anyway.\n \/\/ also... if needed, we can shift the top tube\n \/\/ up or down 1\/8\" depending in which side we are, and make it work.\n \/\/ have slightly uneven spacers at F, and we are fine\n difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,2.54,2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,2.6,2.2],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,2.6,2.2],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n } else {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n }\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n if (squareTop==0) {\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for (z=[-.3]) hull() {\n translate([ 3 , 1 ,]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() {\n translate([FGleft+4.5,FGperp-4,6]) barEnd1();\n translate([7,4.4,0]) barEnd1();\n }\n\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c208fed321c3197a60151f45a0d803079346ab75","subject":"Element-wise vector multiplication now works","message":"Element-wise vector multiplication now works\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n echo(ev_mult(translation_vectors[i], [size \/ (2 * sqrt(2)), size \/ (2 * sqrt(2))]));\n\n translate(translation_vectors[i] * [size \/ (2 * sqrt(2)), size \/ (2 * sqrt(2))] + starting_pos) {\n rotate(rotation_vectors[i] * [0, 45, 45]) {\n #square([connector_thickness, size], center = true);\n }\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n if(len(vec1) != len(vec2)) {\n echo(\"Vectors not the same dimensions\");\n break;\n =\n}\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n echo(translation_vectors[i] );\n \n translate(translation_vectors[i] * [size \/ (2 * sqrt(2)), size \/ (2 * sqrt(2))] + starting_pos) {\n rotate(rotation_vectors[i] * [0, 45, 45]) {\n #square([connector_thickness, size], center = true);\n }\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false; \n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"565f35c3ed62b6c264b36e0789e345e7e83404d3","subject":"stub of the front panel moved to outside of the back module","message":"stub of the front panel moved to outside of the back module\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/back.scad","new_file":"lcd_case_for_prusa_i3\/back.scad","new_contents":"use \ninclude \n\nmodule back()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [0, 0, 0], [boxSize[0]-16, 0, 0], [boxSize[0]-70, 0, 0] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 0])\n cube([18, 20, 7]);\n \/\/ upper beam, mounting all legs together\n translate([0, 40+13, 0])\n cube([boxSize[0], 5+5, 7]);\n \/\/ both upper holdings\n for(offsetOX = [0, 29])\n translate([offsetOX, 40+13+5+5, 0])\n cube([10, boxSize[1]-(40+13+5+5), 7]);\n \/\/ bridge between holdings\n translate([10, 40+13+5+5+50, 0])\n cube([29-10, 7, 7]);\n \/\/ knob back holding (if screw would not fit in properly)\n translate([10+(29-10-8)\/2, 40+13+5+5+50+7, 0])\n cube([8, 20, 7]);\n }\n\n \/\/ SD card cable hole\n translate(sdCardOffset - [6, 0, 7])\n cube([8, 31+2, 7]);\n \/\/ reset button hole\n translate(resetButtonOffset - [0, 0, 10])\n cylinder(r=16\/2+1, h=30);\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n}\n\n\/\/ front stub\n%translate([0, 0, 7])\n front();\n\n\/\/rotate([180, 0, 0])\n back();\n","old_contents":"use \ninclude \n\nmodule back()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [0, 0, 0], [boxSize[0]-16, 0, 0], [boxSize[0]-70, 0, 0] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 0])\n cube([18, 20, 7]);\n \/\/ upper beam, mounting all legs together\n translate([0, 40+13, 0])\n cube([boxSize[0], 5+5, 7]);\n \/\/ both upper holdings\n for(offsetOX = [0, 29])\n translate([offsetOX, 40+13+5+5, 0])\n cube([10, boxSize[1]-(40+13+5+5), 7]);\n \/\/ bridge between holdings\n translate([10, 40+13+5+5+50, 0])\n cube([29-10, 7, 7]);\n \/\/ knob back holding (if screw would not fit in properly)\n translate([10+(29-10-8)\/2, 40+13+5+5+50+7, 0])\n cube([8, 20, 7]);\n }\n\n \/\/ SD card cable hole\n translate(sdCardOffset - [6, 0, 7])\n cube([8, 31+2, 7]);\n \/\/ reset button hole\n translate(resetButtonOffset - [0, 0, 10])\n cylinder(r=16\/2+1, h=30);\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ front stub\n %translate([0, 0, 7])\n front();\n}\n\n\/\/rotate([180, 0, 0])\n back();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fd038f85f547a42c2f1fc9e06a641f3b683455eb","subject":"Show cross section of LED and clips","message":"Show cross section of LED and clips\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/LEDClipDev.scad","new_file":"hardware\/sandbox\/LEDClipDev.scad","new_contents":"\/*\n\n Playground for developing the vitamins\/LEDClip.scad library\n\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ include the LEDClip.scad library\ninclude <..\/vitamins\/LEDClip.scad>\n\n\/\/ include the LED.scad library\ninclude <..\/vitamins\/LED.scad>\n\nmodule LEDClip_Layout_Sandbox()\n{\n \/\/ normal recessed clip for 5mm LED\n LEDClip();\n \/\/ show with LED\n translate([0, 0, 3 - 8.6])\n LED(LED_5mm);\n\n \/\/ closed (with diffuser) for 5mm LED\n color(\"white\") {\n translate([12, 0, 0])\n LEDClip(LEDClip_Closed);\n }\n \/\/ show with LED\n translate([12, 0, 2 - 8.6])\n LED(LED_5mm);\n}\n\n\/\/ show cross section of LED Clips\nsection() {\n LEDClip_Layout_Sandbox();\n}\n","old_contents":"\/*\n\n\tPlayground for developing the vitamins\/LEDClip.scad library\n\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ include the LEDClip.scad library\ninclude <..\/vitamins\/LEDClip.scad>\n\n\/\/ include the LED.scad library\ninclude <..\/vitamins\/LED.scad>\n\nmodule LEDClip_Layout_Sandbox()\n{\n \/\/ normal recessed clip for 5mm LED\n LEDClip();\n \/\/ show with LED\n translate([0, 0, 3 - 8.6])\n LED(LED_5mm);\n\n \/\/ closed (with diffuser) for 5mm LED\n color(\"white\", 0.6) {\n translate([12, 0, 0])\n LEDClip(LEDClip_Closed);\n }\n \/\/ show with LED\n translate([12, 0, 2 - 8.6])\n LED(LED_5mm);\n\n}\n\nLEDClip_Layout_Sandbox();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dae485fb5bdb515e1dcc838bf780ecbb86e6d840","subject":"Delete LifeLoggingCameraV4.scad","message":"Delete LifeLoggingCameraV4.scad","repos":"vllstudy16\/vllstudy16","old_file":"LifeLoggingCameraV4.scad","new_file":"LifeLoggingCameraV4.scad","new_contents":"","old_contents":"$fs = 0.1; \/\/ smoothness of curves in render\n$fa = 0.1;\n\n\/* Box *\/\n{\n thickness = 2; \/\/wall thickness\n extraThickness = 0.1; \/\/ required for proper rendering when $fs is large\n curve = 4; \/\/ curve on the edges of the box, must be > thickness\n internalDimensions = [65, 65, 32]; \/\/internal dimensions\n externalDimensions = [internalDimensions[0] + (thickness * 2), internalDimensions[1] + (thickness * 2), internalDimensions[2] + (thickness * 2)];\n bottomHeight = 30; \/\/ height of the bottom half of the box\n topHeight = internalDimensions[2] - bottomHeight; \/\/ height of the top half of the box\n FR4Thickness = 1.7;\n overlap = 3;\n}\n\/\/\n\ncameraHolePos = [externalDimensions[0] \/ 2, externalDimensions[1] \/ 2];\nledHolePos = [externalDimensions[2] \/ 2, externalDimensions[1] - (externalDimensions[2] \/ 2)];\nusbHolePos = [-0.01, 31.25 + curve, thickness + FR4Thickness];\nsdHolePos = [-0.01, 6.5 + curve, thickness + FR4Thickness];\nresetHolePos = [externalDimensions[2] \/ 2, externalDimensions[1] - (thickness \/ 2), externalDimensions[2] \/ 2];\npowerHolePos = [externalDimensions[0] * ((sqrt(5) - 1) \/ 2), externalDimensions[1] - (thickness \/ 2) - 0.5, externalDimensions[2] \/ 2];\nusbSize = [21.5, 36, 7.2];\nsdSize = [25, 31, 3.55];\nresetHoleSize = 6;\npowerHoleSize = [6.5, thickness + extraThickness + 1, 3.5];\nledHoleRad = 2.5;\ncameraHoleRad = 3.7;\ncameraStandoffHeight = 4;\n\n{\n \/*\nloc = [\n [externalDimensions[0] + 3 , 0, 0],\n [externalDimensions[0] + 3 , 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0], 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0], 0, 22 + (thickness * 2)],\n [externalDimensions[0], 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0] + 3 , 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0] + 3 , 0, 0],\n [externalDimensions[0] + 3 , 0, 0]\n ];\n\nfunction xyz(t,i) = \n lookup(t, [\n [0\/len(loc),loc[0][i]],\n [1\/len(loc),loc[1][i]],\n [2\/len(loc),loc[2][i]],\n [3\/len(loc),loc[3][i]],\n [4\/len(loc),loc[4][i]],\n [5\/len(loc),loc[5][i]],\n [6\/len(loc),loc[6][i]],\n [7\/len(loc),loc[7][i]],\n\n]);\n\nloc2 = [\n [0, 0, 0],\n [0, 0, 0],\n [0, -180, 0],\n [0, -180, 0],\n [0, -180, 0],\n [0, 0, 0],\n [0, 0, 0],\n [0, 0, 0]\n ];\n\nfunction xyz2(t,i) = \n lookup(t, [\n [0\/len(loc2),loc2[0][i]],\n [1\/len(loc2),loc2[1][i]],\n [2\/len(loc2),loc2[2][i]],\n [3\/len(loc2),loc2[3][i]],\n [4\/len(loc2),loc2[4][i]],\n [5\/len(loc2),loc2[5][i]],\n [6\/len(loc2),loc2[6][i]],\n [7\/len(loc2),loc2[7][i]],\n\n]);\n\nloc3 = [\n [0, 0, 0],\n [0, 0, 90],\n [0, 0, 180],\n [0, 0, 270],\n [0, 0, 360],\n [0, 0, 180],\n [0, 0, 0],\n [0, 0, 0]\n ];\n\nfunction xyz3(t,i) = \n lookup(t, [\n [0\/len(loc3),loc3[0][i]],\n [1\/len(loc3),loc3[1][i]],\n [2\/len(loc3),loc3[2][i]],\n [3\/len(loc3),loc3[3][i]],\n [4\/len(loc3),loc3[4][i]],\n [5\/len(loc3),loc3[5][i]],\n [6\/len(loc3),loc3[6][i]],\n [7\/len(loc3),loc3[7][i]],\n\n]);\n*\/\n}\n\/\/\n\nmodule cylinderHull(a, r)\n{\n hull()\n {\n cylinder(r = r, h = a[2]);\n translate([a[0], 0, 0]) \n cylinder(r = r, h = a[2]);\n translate([0, a[1], 0]) \n cylinder(r = r, h = a[2]);\n translate([a[0], a[1], 0]) \n cylinder(r = r, h = a[2]);\n }\n}\n\/\/\n\nmodule box(height, lip)\n{\n \/\/ 0 = outer lip, 1 = inner lip\n translate([curve, curve, 0]) difference() \n {\n union()\n {\n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), height + thickness], curve);\n if(lip == 1)\n {\n translate([0, 0, thickness]) \n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), height + overlap],curve - (thickness \/ 2));\n }\n }\n {\n translate([0, 0, thickness]) \n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), height + thickness + overlap], curve - thickness);\n if(lip == 0)\n {\n translate([0, 0, height + thickness - overlap]) \n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), 0.01 + overlap], curve - (thickness \/ 2));\n }\n }\n }\n}\n\/\/\n\nmodule bottom(height)\n{\n difference()\n {\n union()\n {\n box(height, 0);\n if(thickness < 3)\n {\n translate([externalDimensions[0] * ((sqrt(5) - 1) \/ 2) - 9.5, externalDimensions[1] - 3, thickness]) \n cube([19, 3 - thickness, height - overlap]);\/\/power switch extra thickness\n }\n translate([usbHolePos[0] + thickness, usbHolePos[1] - ((usbSize[0] - 11) \/ 2), thickness])\n {\n translate([2.6, usbSize[0] - 2.6, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n translate([2.6, 2.6, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n translate([usbSize[1] - 2.25, usbSize[0] - 2 - 2.25, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n translate([usbSize[1] - 2.25, 2 + 2.25, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n }\n translate([sdHolePos[0] + thickness, sdHolePos[1] - ((sdSize[0] - 14) \/ 2) - 1, thickness])\n {\n translate([2.575, sdSize[0] - 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n translate([2.575, 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n translate([sdSize[1] - 5.6 - 2.575, sdSize[0] - 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n translate([sdSize[1] - 5.6 - 2.575, 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n }\n translate([powerHolePos[0], powerHolePos[1], powerHolePos[2]])\n {\n translate([-7.5, 0, 0])\n rotate([90, 0, 0])\n cylinder(h = 3, r = 0.8);\n translate([7.5, 0, 0])\n rotate([90, 0, 0])\n cylinder(h = 3, r = 0.8);\n }\n }\n {\n translate([usbHolePos[0], usbHolePos[1], usbHolePos[2]]) \n cube([thickness + extraThickness, 11, 6]);\/\/usb hole\n translate([sdHolePos[0], sdHolePos[1], sdHolePos[2]]) \n cube([thickness + extraThickness, 14, 4]);\/\/sd hole\n translate([resetHolePos[0], resetHolePos[1], resetHolePos[2]]) \n cube([resetHoleSize, thickness + extraThickness, resetHoleSize], center = true);\/\/reset switch hole\n translate([powerHolePos[0], powerHolePos[1], powerHolePos[2]]) \n cube([powerHoleSize[0], powerHoleSize[1], powerHoleSize[2]], center = true);\/\/power switch hole\n hull () \n {\n translate([sdHolePos[0], sdHolePos[1] + (thickness \/ 2), sdHolePos[2]]) sphere(r = thickness \/ 2, center = true);\n translate([sdHolePos[0], sdHolePos[1] + 14 - (thickness \/ 2), sdHolePos[2]]) sphere(r = thickness \/ 2, center = true);\n }\n hull () \n {\n translate([sdHolePos[0], sdHolePos[1] + (thickness \/ 2), sdHolePos[2] + 4]) sphere(r = thickness \/ 2, center = true);\n translate([sdHolePos[0], sdHolePos[1] + 14 - (thickness \/ 2), sdHolePos[2] + 4]) sphere(r = thickness \/ 2, center = true);\n }\n translate([0, 61 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([0, 54 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([65 + thickness, 61 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([65 + thickness, 54 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([usbHolePos[0] + thickness, usbHolePos[1] - ((usbSize[0] - 11) \/ 2), 0])\n {\n translate([7, usbSize[0] - 2.6, 0])\n {\n cylinder(h = usbSize[2], r = 1.5);\n }\n translate([7, 2.6, 0])\n {\n cylinder(h = usbSize[2], r = 1.5);\n }\n translate([usbSize[1] - 2.25, usbSize[0] - 2 - 2.25 + 4, 0])\n {\n cylinder(h = usbSize[2], r = 1.5);\n }\n }\n }\n }\n}\n\/\/\n\nmodule top(height)\n{\n difference()\n {\n union()\n {\n box(height, 1);\n translate([cameraHolePos[0], cameraHolePos[1], thickness]) \n {\n translate([-8.5, 19.9, 0])\/\/ Top L\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n translate([8.5, 19.9, 0])\/\/ Top R\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n translate([-8.5, -5.5, 0])\/\/ Bottom L\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n translate([8.5, -5.5, 0])\/\/ Bottom R\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n }\n }\n {\n translate([cameraHolePos[0], cameraHolePos[1], -0.01]) \n cylinder(r = cameraHoleRad, h = thickness + extraThickness);\/\/camera hole\n translate([ledHolePos[0], ledHolePos[1], -0.01])\n cylinder(r = ledHoleRad, h = thickness + extraThickness);\/\/led hole\n }\n }\n}\n\/\/\n\nbottom(bottomHeight);\n\n\/\/top(topHeight);\n\n\/\/translate([externalDimensions[0], 0, 22 + 2 + (thickness * 2)]) rotate([0,180,0]) top(topHeight);\n\n\/\/translate([xyz($t,0),xyz($t,1),xyz($t,2)]) rotate([xyz2($t,0),xyz2($t,1),xyz2($t,2)]) top(topHeight);\n \n\/\/translate([2, 4, 3]) cube([31, 25, 3.55]);\/\/sd\n\/\/translate([2, 30, 3]) cube([36, 21.5, 7.2]);\/\/usb\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"cfe52d362dd91088e0380a27867d92adb4a414a5","subject":"Rotator: added 3D print OpenSCAD design #30","message":"Rotator: added 3D print OpenSCAD design #30\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modules\/Action\/Rotator\/LegoShaft\/LegoShaft.scad","new_file":"Modules\/Action\/Rotator\/LegoShaft\/LegoShaft.scad","new_contents":"\/*\n\n Basic Lego brick builder module for OpenScad by Jorg Janssen 2013 (CC BY-NC 3.0) \n To use this in your own projects add:\n\n use \n brick (length, width, height [,smooth]);\n\n Length and width are in standard lego brick dimensions. \n Height is in flat brick heights, so for a normal lego brick height = 3.\n Add optional smooth = true for a brick without studs. \n Use height = 0 to just put studs\/knobs on top of other things.\n\n *\/\n$fn = 150;\n \n \/\/ this is it:\nbrick(2,2,1);\n\n\n\/\/ and this is how it's done:\n\nFLU = 1.6; \/\/ Fundamental Lego Unit = 1.6 mm\n\nBRICK_WIDTH = 5*FLU; \/\/ basic brick width\nBRICK_HEIGHT = 6*FLU; \/\/ basic brick height\nPLATE_HEIGHT = 2*FLU; \/\/ basic plate height\nWALL_THICKNESS = FLU; \/\/ outer wall of the brick\nSTUD_RADIUS = 1.5*FLU; \/\/ studs are the small cylinders on top of the brick with the lego logo ('nopje' in Dutch)\nSTUD_HEIGHT = FLU; \nANTI_STUD_RADIUS = 0.5*4.07*FLU; \/\/ an anti stud is the hollow cylinder inside bricks that have length > 1 and width > 1\nPIN_RADIUS = FLU; \/\/ a pin is the small cylinder inside bricks that have length = 1 or width = 1\nSUPPORT_THICKNESS = 0.254; \/\/ support is the thin surface between anti studs, pins and walls, your printer might not print this thin, try thicker!\nEDGE = 0.254; \/\/ this is the width and height of the bottom line edge of smooth bricks\nCORRECTION = 0.1; \/\/ addition to each size, to make sure all parts connect by moving them a little inside each other\n\nmodule brick(length = 4, width = 2, height = 3, smooth = false){\n\n\t\/\/ brick shell\n\tdifference(){\n\t\tcube(size = [length*BRICK_WIDTH,width*BRICK_WIDTH,height*PLATE_HEIGHT]);\n translate([length*BRICK_WIDTH\/2,width*BRICK_WIDTH\/2, -1])\n cylinder(h=6, r=0.7);\n translate([length*BRICK_WIDTH\/2,width*BRICK_WIDTH\/2, -0.1])\n cylinder(h=1, r=2.75);\n translate([length*BRICK_WIDTH\/2,width*BRICK_WIDTH\/2, 2.3])\n cylinder(h=2, r=1.75);\n\n\t\ttranslate([WALL_THICKNESS,WALL_THICKNESS,-WALL_THICKNESS])\n\t\tunion(){\n\t\t\t \n\t\t\t\/\/ stud inner holes, radius = pin radius\n\n\n\t\t\t\n\t\t}\n\n\t}\n\t\/\/ Studs\n\tif(!smooth){\n\t\ttranslate([STUD_RADIUS+WALL_THICKNESS,STUD_RADIUS+WALL_THICKNESS,height*PLATE_HEIGHT])\n\t\tfor (y = [0:width-1]){\n\t\t\tfor (x = [0:length-1]){\n\t\t\t\ttranslate ([x*BRICK_WIDTH,y*BRICK_WIDTH,-CORRECTION])\n\t\t\t\tdifference(){\n\t\t\t\t\tcylinder(h=STUD_HEIGHT+CORRECTION, r=STUD_RADIUS);\n\t\t\t\t\t\/\/ Stud inner holes\n\t\t\t\t\ttranslate([0,0,-CORRECTION])\n\t\t\t\t\tcylinder(h=0.5*STUD_HEIGHT+CORRECTION,r=PIN_RADIUS);\n\n\t\t\t\t}\n\t\t\t\t\/\/ tech logo - disable this if your printer isn't capable of printing this small\n\t\t\t\tif ( length > width){\n\t\t\t\t\ttranslate([x*BRICK_WIDTH+0.8,y*BRICK_WIDTH-1.9,STUD_HEIGHT-CORRECTION])\n\t\t\t\t\tresize([1.2*1.7,2.2*1.7,0.254+CORRECTION])\n\t\t\t\t\trotate(a=[0,0,90])\n\t\t\t\t\timport(\"tech.stl\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttranslate([x*BRICK_WIDTH-1.9,y*BRICK_WIDTH-0.8,STUD_HEIGHT-CORRECTION])\n\t\t\t\t\tresize([2.2*1.7,1.2*1.7,0.254+CORRECTION])\n\t\t\t\t\timport(\"tech.stl\");\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\/* \n\t\t\t\t\/\/ Alternative 2-square logo\n\t\t\t\ttranslate ([x*BRICK_WIDTH+CORRECTION,y*BRICK_WIDTH-CORRECTION,STUD_HEIGHT-CORRECTION])\t\t\n\t\t\t\tcube([1,1,2*CORRECTION]);\n\t\t\t\ttranslate ([x*BRICK_WIDTH-0.9,y*BRICK_WIDTH-0.9,STUD_HEIGHT-CORRECTION])\t\t\n\t\t\t\tcube([1,1,0.3]);\n\t\t\t\t*\/\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n}\n\t","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/Action\/Rotator\/LegoShaft\/LegoShaft.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"05968ae59b8b50a6d45ea0aa58d85e50330a2e6c","subject":"handle bar added as a separate print","message":"handle bar added as a separate print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/kite_handle_bar.scad","new_file":"kite_roller\/kite_handle_bar.scad","new_contents":"use \n\neps = 0.01;\nd_rod = 8+0.5;\nd_hand = 20;\nh_hand = 110;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule screw_head() { screw_head_hex_m8(); }\n\nmodule washer(dh=0)\n{\n difference()\n {\n cylinder(d=15.5, h=1.4+dh);\n translate(eps*[0,0,-1])\n cylinder(d=8.5, h=1.4+dh+2*eps);\n }\n}\n\n\n\/\/ slot for ball bearing + 2 washers\nmodule bearing_slot()\n{\n d_spacing = 0.5;\n h_spacing = 0.2;\n screw_head_hex_m8(d_spacing, h_spacing);\n\n for(dh=[-1.4, 7+h_spacing])\n translate([0, 0, dh])\n washer();\n}\n\n\nmodule bearing_mount()\n{\n $fn=90;\n wall = 5;\n d_ext = 22+2*wall;\n\n \/\/ bottom bearing hold\n difference()\n {\n cylinder(d=d_ext, h=7);\n translate([0,0,-eps])\n cylinder(d=22+0.5, h=7+2*eps, $fn=180);\n }\n %bearing();\n\n translate([0, 0, 7])\n {\n \/\/ connecting element\n difference()\n {\n cylinder(d1=d_ext, d2=d_hand, h=(d_ext-d_hand)\/2);\n cylinder(d1=d_ext-2*wall+0.5, d2=d_rod, h=(d_ext-d_hand)\/2);\n }\n \n \/\/ main e\n }\n}\n\n\nmodule handle()\n{\n h_bm = 13;\n \/\/ bottom bearing mount\n bearing_mount();\n translate([0, 0, h_bm])\n {\n \/\/ center rod\n difference()\n {\n cylinder(d=d_hand, h=h_hand, $fn=100);\n cylinder(d=d_rod, h=h_hand, $fn=100);\n }\n \/\/ top bearing mount\n translate([0, 0, h_hand])\n translate([0, 0, h_bm])\n mirror([0,0,1])\n bearing_mount();\n }\n}\n\n\nfor(i=[0:1])\n translate(i*[35,0,0])\n handle();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kite_roller\/kite_handle_bar.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"68031b151e9c8785a5467f078acdd0ae04b0cc49","subject":"dimensions of the top enclosure","message":"dimensions of the top enclosure\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\nstoiki_r = 4;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps+pcb_up\/2]) {\n cylinder(r=stoiki_r, h=pcb_up, center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_h = top_box_z - th;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n \/\/cube(size=[under_pcb, under_pcb, stoiki_h + eps], center=true);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - 18-speaker_hole_d\/2, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n \n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y, -eps]) {\n cube([th + 2*eps, usb_type_a_w+eps, usb_type_a_h+2*eps]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\n\/\/TODO\nshift_x = 4;\nshift_y = th + 1;\n\n\/\/TODO\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\n\/\/ TODO\nusb_type_b_w = 15.2;\nusb_type_b_h = 11.5;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\n\/\/ TODO\nusb_type_a_w = 17.3;\nusb_type_a_h = 8;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\nstoiki_r = 4;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps+pcb_up\/2]) {\n cylinder(r=stoiki_r, h=pcb_up, center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_h = top_box_z - th;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n \/\/cube(size=[under_pcb, under_pcb, stoiki_h + eps], center=true);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"79faa160e2deefe120b7988af49135a80a7850ae","subject":"WIP base","message":"WIP base\n","repos":"DamCB\/mush","old_file":"scad\/openscad\/base.scad","new_file":"scad\/openscad\/base.scad","new_contents":"use ;\nuse ;\n\n$fn=60;\nsphere_phi_out = 72;\nrail_phi = 100;\nsphere_phi_in = 62;\nstand_width = 12;\nlatitude = 30;\n\n\n\nmodule ring(h, d_in, d_out){\n difference(){\n cylinder(d=d_out, h=h);\n translate([0, 0, -1])\n cylinder(d=d_in, h=h+2);\n }\n}\n\nmodule slider(){\n translate([0, -sphere_phi_out\/2+5-3, 0]) rotate([90, 0, 0]) union(){\n cylinder(d=6, h=10, center=true);\n translate([0, 0, -5]) cylinder(d=10, h=1, center=true);\n\n }\n translate([0, 0, -stand_width\/2]) difference(){\n cylinder(h=stand_width, d=rail_phi);\n translate([0, 100-sphere_phi_out\/2-3, 0]) cube([200, 200, 200], center=true);\n translate([70, 0, 0]) cube(100, center=true);\n translate([-70, 0, 0]) cube(100, center=true);\n union(){\n translate([0, 0, stand_width\/2+2]) ring(h=6, d_in=rail_phi-4, d_out=rail_phi+2);\n translate([0, 0, -stand_width\/2+2]) ring(h=6, d_in=rail_phi-4, d_out=rail_phi+2);\n }\n }\n}\n\nmodule sliders(){\n slider();\n rotate([0, 0, 180]) slider();\n}\n\nmodule rail(){\n difference(){\n translate([0, 0, -stand_width\/2]) ring(h=stand_width, d_in=rail_phi-2, d_out=rail_phi+8);\n translate([0, 0, -stand_width\/2+2]) ring(h=stand_width-4, d_in=rail_phi-3, d_out=rail_phi+4);\n }\n\n}\n\n\nsliders();\nrotate([0, latitude, 0]) detection();\nrail();\n","old_contents":"use ;\n$fn=120;\nsphere_phi_out = 72;\nsphere_phi_in = 62;\nstand_width = 12;\n\nmodule rotation_ring(){\n translate([0, 0, -stand_width\/2]) difference(){\n cylinder(d=sphere_phi_out+2*stand_width, h=stand_width);\n translate([0, 0, -1])\n cylinder(d=sphere_phi_out+2, h=stand_width+2);\n }\n}\nrotation_ring();\ndetection($fn=120);\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"25647123ec5f41c63c3561dc5fd9f38cbc3436cf","subject":"added profiled bearings holders","message":"added profiled bearings holders\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filament_spool_holder\/cone.scad","new_file":"filament_spool_holder\/cone.scad","new_contents":"difference()\n{\n cylinder(h=20, r1=120\/2, r2=40\/2); \/\/ main hull\n cylinder(h=20, r=(22-1)\/2); \/\/ center rod\n \/\/ bearing holdings\n for(offset = [ [0,0,0], [0,0,20-(7+1)] ])\n translate(offset)\n cylinder(h=7+1, r=(22+1)\/2);\n}\n","old_contents":"difference()\n{\n cylinder(h=20, r1=120\/2, r2=40\/2); \/\/ main hull\n cylinder(h=20, r=(22+1)\/2); \/\/ center rod & bearings holding\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e431d0eea2831e933a43fc497e4c0d2143e45f95","subject":"Fix the unit tests of core\/line (missing and )","message":"Fix the unit tests of core\/line (missing and )\n","repos":"jsconan\/camelSCAD","old_file":"test\/core\/line.scad","new_file":"test\/core\/line.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\nuse <..\/..\/full.scad>\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Unit tests: Lines handling.\r\n *\r\n * @package test\/core\/line\r\n * @author jsconan\r\n *\/\r\nmodule testCoreLine() {\r\n testPackage(\"core\/line.scad\", 3) {\r\n \/\/ test core\/line\/arc()\r\n testModule(\"arc()\", 7) {\r\n testUnit(\"no parameter\", 1) {\r\n assertEqual(arc(), [], \"Cannot build an arc without parameters, should return an empty array\");\r\n }\r\n testUnit(\"wrong type\", 3) {\r\n assertEqual(arc(\"1\", \"1\"), [], \"Cannot build an arc using strings, should return an empty array\");\r\n assertEqual(arc(true, true), [], \"Cannot build an arc using booleans, should return an empty array\");\r\n assertEqual(arc(1, [1]), [], \"Cannot build an arc using vector angle, should return an empty array\");\r\n }\r\n testUnit(\"empty\", 6) {\r\n assertEqual(arc(0), [], \"Cannot build a circle arc with a null radius, should return an empty array\");\r\n assertEqual(arc([0, 0]), [], \"Cannot build an ellipse arc with a null radius, should return an empty array\");\r\n assertEqual(arc([0, 1]), [], \"Cannot build an ellipse arc if one of the radius is 0 (x), should return an empty array\");\r\n assertEqual(arc([1, 0]), [], \"Cannot build an ellipse arc if one of the radius is 0 (y), should return an empty array\");\r\n assertEqual(arc(1, 0), [], \"Cannot build a 0\u00b0 circle arc, should return an empty array\");\r\n assertEqual(arc([1, 1], 0), [], \"Cannot build a 0\u00b0 ellipse arc, should return an empty array\");\r\n }\r\n testUnit(\"circle\", 4) {\r\n assertEqual(arc(1, $fn=3), [ for (a = [360\/3 : 360\/3 : 360]) 1 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 3 facets (triangle)\");\r\n assertEqual(arc(1, $fn=4), [ for (a = [360\/4 : 360\/4 : 360]) 1 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 4 facets (square)\");\r\n assertEqual(arc(1, $fn=6), [ for (a = [360\/6 : 360\/6 : 360]) 1 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 6 facets (hexagon)\");\r\n assertEqual(arc(5, $fa=12, $fs=2), [ for (a = [astep(5, $fa=12, $fs=2) : astep(5, $fa=12, $fs=2) : 360]) 5 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 16 facets\");\r\n }\r\n testUnit(\"ellipse\", 4) {\r\n assertEqual(arc([1, 2], $fn=3), [ for (a = [360\/3 : 360\/3 : 360]) [cos(a)*1, sin(a)*2] ], \"Should return a list of points to draw an ellipse with a radius of [1, 2] and 3 facets (triangle)\");\r\n assertEqual(arc([1, 2], $fn=4), [ for (a = [360\/4 : 360\/4 : 360]) [cos(a)*1, sin(a)*2] ], \"Should return a list of points to draw an ellipse with a radius of [1, 2] and 4 facets (square)\");\r\n assertEqual(arc([1, 2], $fn=6), [ for (a = [360\/6 : 360\/6 : 360]) [cos(a)*1, sin(a)*2] ], \"Should return a list of points to draw an ellipse with a radius of [1, 2] and 6 facets (hexagon)\");\r\n assertEqual(arc([5, 6], $fa=12, $fs=2), [ for (a = [0 : astep(6, $fa=12, $fs=2) : 360]) [cos(a)*5, sin(a)*6] ], \"Should return a list of points to draw an ellipse with a radius of [5, 6] and 20 facets\");\r\n }\r\n testUnit(\"circle arc\", 8) {\r\n assertEqual(arc(1, a=30, $fn=3), [ for (a = [0 : 30 : 30]) [cos(a), sin(a)] ], \"Should return a list of points to draw a 30\u00b0 arc with a radius of 1 and 3 facets (triangle)\");\r\n assertEqual(arc(1, a=140, $fn=3), concat([ for (a = [0 : 120 : 140]) [cos(a), sin(a)] ], [[cos(140), sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of 1 and 3 facets (triangle)\");\r\n assertEqual(arc(1, a=140, $fn=4), concat([ for (a = [0 : 90 : 140]) [cos(a), sin(a)] ], [[cos(140), sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of 1 and 4 facets (square)\");\r\n assertEqual(arc(1, a=200, $fn=4), concat([ for (a = [0 : 90 : 200]) [cos(a), sin(a)] ], [[cos(200), sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of 1 and 4 facets (square)\");\r\n assertEqual(arc(1, a=140, $fn=6), concat([ for (a = [0 : 60 : 140]) [cos(a), sin(a)] ], [[cos(140), sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of 1 and 6 facets (hexagon)\");\r\n assertEqual(arc(1, a=200, $fn=6), concat([ for (a = [0 : 60 : 200]) [cos(a), sin(a)] ], [[cos(200), sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of 1 and 6 facets (hexagon)\");\r\n assertEqual(arc(5, a=80, $fa=12, $fs=2), concat([ for (a = [0 : astep(5, $fa=12, $fs=2) : 80]) 5 * [cos(a), sin(a)] ], [5 * [cos(80), sin(80)]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of 1 and 16 facets\");\r\n assertEqual(arc(5, a=160, $fa=12, $fs=2), concat([ for (a = [0 : astep(5, $fa=12, $fs=2) : 160]) 5 * [cos(a), sin(a)] ], [5 * [cos(160), sin(160)]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of 1 and 16 facets\");\r\n }\r\n testUnit(\"ellipse arc\", 8) {\r\n assertEqual(arc([1, 2], a=30, $fn=3), [ for (a = [0 : 30 : 30]) [cos(a), 2 * sin(a)] ], \"Should return a list of points to draw a 30\u00b0 arc with a radius of [1, 2] and 3 facets (triangle)\");\r\n assertEqual(arc([1, 2], a=140, $fn=3), concat([ for (a = [0 : 120 : 140]) [cos(a), 2 * sin(a)] ], [[cos(140), 2 * sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of [1, 2] and 3 facets (triangle)\");\r\n assertEqual(arc([1, 2], a=140, $fn=4), concat([ for (a = [0 : 90 : 140]) [cos(a), 2 * sin(a)] ], [[cos(140), 2 * sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of [1, 2] and 4 facets (square)\");\r\n assertEqual(arc([1, 2], a=200, $fn=4), concat([ for (a = [0 : 90 : 200]) [cos(a), 2 * sin(a)] ], [[cos(200), 2 * sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of [1, 2] and 4 facets (square)\");\r\n assertEqual(arc([1, 2], a=140, $fn=6), concat([ for (a = [0 : 60 : 140]) [cos(a), 2 * sin(a)] ], [[cos(140), 2 * sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of [1, 2] and 6 facets (hexagon)\");\r\n assertEqual(arc([1, 2], a=200, $fn=6), concat([ for (a = [0 : 60 : 200]) [cos(a), 2 * sin(a)] ], [[cos(200), 2 * sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of [1, 2] and 6 facets (hexagon)\");\r\n assertEqual(arc([5, 6], a=80, $fa=12, $fs=2), concat([ for (a = [0 : astep(6, $fa=12, $fs=2) : 80]) [cos(a) * 5, sin(a) * 6] ], [[cos(80) * 5, sin(80) * 6]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of [5, 6] and 16 facets\");\r\n assertEqual(arc([5, 6], a=160, $fa=12, $fs=2), concat([ for (a = [0 : astep(6, $fa=12, $fs=2) : 160]) [cos(a) * 5, sin(a) * 6] ], [[cos(160) * 5, sin(160) * 6]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of [5, 6] and 16 facets\");\r\n }\r\n }\r\n \/\/ test core\/line\/sinusoid()\r\n testModule(\"sinusoid()\", 4) {\r\n testUnit(\"no parameter\", 1) {\r\n assertEqual(sinusoid(), [], \"Cannot build a sinusoid without parameters, should return an empty array\");\r\n }\r\n testUnit(\"wrong type\", 3) {\r\n assertEqual(sinusoid(\"1\", \"1\"), [], \"Cannot build a sinusoid using strings, should return an empty array\");\r\n assertEqual(sinusoid(true, true), [], \"Cannot build a sinusoid using booleans, should return an empty array\");\r\n assertEqual(sinusoid([1], [1]), [], \"Cannot build a sinusoid using vectors, should return an empty array\");\r\n }\r\n testUnit(\"straight\", 5) {\r\n assertEqual(sinusoid(1, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, sin(360 * a)] ], \"Should build a simple sinusoid with a length of 1 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, sin(360 * a \/ 2)] ], \"Should build a simple sinusoid with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, 4, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, 4 * sin(360 * a \/ 2)] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, 4, 6, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, 4 * sin(360 * a \/ 2 + 6)] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, 4, 6, 8, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, 4 * sin(360 * a \/ 2 + 6) + 8] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n testUnit(\"rotated\", 5) {\r\n assertEqual(sinusoid(3, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, sin(360 * a)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, sin(360 * a \/ 2)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, 4, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, 4 * sin(360 * a \/ 2)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, 4, 6, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, 4 * sin(360 * a \/ 2 + 6)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, 4, 6, 8, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, 4 * sin(360 * a \/ 2 + 6) + 8], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n }\r\n \/\/ test core\/line\/cosinusoid()\r\n testModule(\"cosinusoid()\", 4) {\r\n testUnit(\"no parameter\", 1) {\r\n assertEqual(cosinusoid(), [], \"Cannot build a sinusoid without parameters, should return an empty array\");\r\n }\r\n testUnit(\"wrong type\", 3) {\r\n assertEqual(cosinusoid(\"1\", \"1\"), [], \"Cannot build a sinusoid using strings, should return an empty array\");\r\n assertEqual(cosinusoid(true, true), [], \"Cannot build a sinusoid using booleans, should return an empty array\");\r\n assertEqual(cosinusoid([1], [1]), [], \"Cannot build a sinusoid using vectors, should return an empty array\");\r\n }\r\n testUnit(\"straight\", 5) {\r\n assertEqual(cosinusoid(1, $fn=6), [ for (a = [0 : 1\/6 : 1]) [cos(360 * a), a] ], \"Should build a simple sinusoid with a length of 1 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, $fn=6), [ for (a = [0 : 1\/6 : 1]) [cos(360 * a \/ 2), a] ], \"Should build a simple sinusoid with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, 4, $fn=6), [ for (a = [0 : 1\/6 : 1]) [4 * cos(360 * a \/ 2), a] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, 4, 6, $fn=6), [ for (a = [0 : 1\/6 : 1]) [4 * cos(360 * a \/ 2 + 6), a] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, 4, 6, 8, $fn=6), [ for (a = [0 : 1\/6 : 1]) [4 * cos(360 * a \/ 2 + 6) + 8, a] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n testUnit(\"rotated\", 5) {\r\n assertEqual(cosinusoid(3, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([cos(360 * a), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([cos(360 * a \/ 2), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, 4, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([4 * cos(360 * a \/ 2), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, 4, 6, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([4 * cos(360 * a \/ 2 + 6), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, 4, 6, 8, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([4 * cos(360 * a \/ 2 + 6) + 8, a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n }\r\n\r\n }\r\n function _rot2(v, a) = [\r\n v[0] * cos(a) - v[1] * sin(a),\r\n v[1] * cos(a) + v[0] * sin(a)\r\n ];\r\n}\r\n\r\ntestCoreLine();\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\nuse <..\/..\/full.scad>\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Unit tests: Lines handling.\r\n *\r\n * @package test\/core\/line\r\n * @author jsconan\r\n *\/\r\nmodule testCoreLine() {\r\n testPackage(\"core\/line.scad\", 3) {\r\n \/\/ test core\/line\/arc()\r\n testModule(\"arc()\", 7) {\r\n testUnit(\"no parameter\", 1) {\r\n assertEqual(arc(), [], \"Cannot build an arc without parameters, should return an empty array\");\r\n }\r\n testUnit(\"wrong type\", 3) {\r\n assertEqual(arc(\"1\", \"1\"), [], \"Cannot build an arc using strings, should return an empty array\");\r\n assertEqual(arc(true, true), [], \"Cannot build an arc using booleans, should return an empty array\");\r\n assertEqual(arc(1, [1]), [], \"Cannot build an arc using vector angle, should return an empty array\");\r\n }\r\n testUnit(\"empty\", 6) {\r\n assertEqual(arc(0), [], \"Cannot build a circle arc with a null radius, should return an empty array\");\r\n assertEqual(arc([0, 0]), [], \"Cannot build an ellipse arc with a null radius, should return an empty array\");\r\n assertEqual(arc([0, 1]), [], \"Cannot build an ellipse arc if one of the radius is 0 (x), should return an empty array\");\r\n assertEqual(arc([1, 0]), [], \"Cannot build an ellipse arc if one of the radius is 0 (y), should return an empty array\");\r\n assertEqual(arc(1, 0), [], \"Cannot build a 0\u00b0 circle arc, should return an empty array\");\r\n assertEqual(arc([1, 1], 0), [], \"Cannot build a 0\u00b0 ellipse arc, should return an empty array\");\r\n }\r\n testUnit(\"circle\", 4) {\r\n assertEqual(arc(1, $fn=3), [ for (a = [360\/3 : 360\/3 : 360]) 1 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 3 facets (triangle)\");\r\n assertEqual(arc(1, $fn=4), [ for (a = [360\/4 : 360\/4 : 360]) 1 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 4 facets (square)\");\r\n assertEqual(arc(1, $fn=6), [ for (a = [360\/6 : 360\/6 : 360]) 1 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 6 facets (hexagon)\");\r\n assertEqual(arc(5, $fa=12, $fs=2), [ for (a = [astep(5) : astep(5) : 360]) 5 * [cos(a), sin(a)] ], \"Should return a list of points to draw a circle with a radius of 1 and 16 facets\");\r\n }\r\n testUnit(\"ellipse\", 4) {\r\n assertEqual(arc([1, 2], $fn=3), [ for (a = [360\/3 : 360\/3 : 360]) [cos(a)*1, sin(a)*2] ], \"Should return a list of points to draw an ellipse with a radius of [1, 2] and 3 facets (triangle)\");\r\n assertEqual(arc([1, 2], $fn=4), [ for (a = [360\/4 : 360\/4 : 360]) [cos(a)*1, sin(a)*2] ], \"Should return a list of points to draw an ellipse with a radius of [1, 2] and 4 facets (square)\");\r\n assertEqual(arc([1, 2], $fn=6), [ for (a = [360\/6 : 360\/6 : 360]) [cos(a)*1, sin(a)*2] ], \"Should return a list of points to draw an ellipse with a radius of [1, 2] and 6 facets (hexagon)\");\r\n assertEqual(arc([5, 6], $fa=12, $fs=2), [ for (a = [0 : astep(6) : 360]) [cos(a)*5, sin(a)*6] ], \"Should return a list of points to draw an ellipse with a radius of [5, 6] and 20 facets\");\r\n }\r\n testUnit(\"circle arc\", 8) {\r\n assertEqual(arc(1, a=30, $fn=3), [ for (a = [0 : 30 : 30]) [cos(a), sin(a)] ], \"Should return a list of points to draw a 30\u00b0 arc with a radius of 1 and 3 facets (triangle)\");\r\n assertEqual(arc(1, a=140, $fn=3), concat([ for (a = [0 : 120 : 140]) [cos(a), sin(a)] ], [[cos(140), sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of 1 and 3 facets (triangle)\");\r\n assertEqual(arc(1, a=140, $fn=4), concat([ for (a = [0 : 90 : 140]) [cos(a), sin(a)] ], [[cos(140), sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of 1 and 4 facets (square)\");\r\n assertEqual(arc(1, a=200, $fn=4), concat([ for (a = [0 : 90 : 200]) [cos(a), sin(a)] ], [[cos(200), sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of 1 and 4 facets (square)\");\r\n assertEqual(arc(1, a=140, $fn=6), concat([ for (a = [0 : 60 : 140]) [cos(a), sin(a)] ], [[cos(140), sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of 1 and 6 facets (hexagon)\");\r\n assertEqual(arc(1, a=200, $fn=6), concat([ for (a = [0 : 60 : 200]) [cos(a), sin(a)] ], [[cos(200), sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of 1 and 6 facets (hexagon)\");\r\n assertEqual(arc(5, a=80, $fa=12, $fs=2), concat([ for (a = [0 : astep(5) : 80]) 5 * [cos(a), sin(a)] ], [5 * [cos(80), sin(80)]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of 1 and 16 facets\");\r\n assertEqual(arc(5, a=160, $fa=12, $fs=2), concat([ for (a = [0 : astep(5) : 160]) 5 * [cos(a), sin(a)] ], [5 * [cos(160), sin(160)]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of 1 and 16 facets\");\r\n }\r\n testUnit(\"ellipse arc\", 8) {\r\n assertEqual(arc([1, 2], a=30, $fn=3), [ for (a = [0 : 30 : 30]) [cos(a), 2 * sin(a)] ], \"Should return a list of points to draw a 30\u00b0 arc with a radius of [1, 2] and 3 facets (triangle)\");\r\n assertEqual(arc([1, 2], a=140, $fn=3), concat([ for (a = [0 : 120 : 140]) [cos(a), 2 * sin(a)] ], [[cos(140), 2 * sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of [1, 2] and 3 facets (triangle)\");\r\n assertEqual(arc([1, 2], a=140, $fn=4), concat([ for (a = [0 : 90 : 140]) [cos(a), 2 * sin(a)] ], [[cos(140), 2 * sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of [1, 2] and 4 facets (square)\");\r\n assertEqual(arc([1, 2], a=200, $fn=4), concat([ for (a = [0 : 90 : 200]) [cos(a), 2 * sin(a)] ], [[cos(200), 2 * sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of [1, 2] and 4 facets (square)\");\r\n assertEqual(arc([1, 2], a=140, $fn=6), concat([ for (a = [0 : 60 : 140]) [cos(a), 2 * sin(a)] ], [[cos(140), 2 * sin(140)]]), \"Should return a list of points to draw a 140\u00b0 arc with a radius of [1, 2] and 6 facets (hexagon)\");\r\n assertEqual(arc([1, 2], a=200, $fn=6), concat([ for (a = [0 : 60 : 200]) [cos(a), 2 * sin(a)] ], [[cos(200), 2 * sin(200)]]), \"Should return a list of points to draw a 200\u00b0 arc with a radius of [1, 2] and 6 facets (hexagon)\");\r\n assertEqual(arc([5, 6], a=80, $fa=12, $fs=2), concat([ for (a = [0 : astep(6) : 80]) [cos(a) * 5, sin(a) * 6] ], [[cos(80) * 5, sin(80) * 6]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of [5, 6] and 16 facets\");\r\n assertEqual(arc([5, 6], a=160, $fa=12, $fs=2), concat([ for (a = [0 : astep(6) : 160]) [cos(a) * 5, sin(a) * 6] ], [[cos(160) * 5, sin(160) * 6]]), \"Should return a list of points to draw a 30\u00b0 arc with a radius of [5, 6] and 16 facets\");\r\n }\r\n }\r\n \/\/ test core\/line\/sinusoid()\r\n testModule(\"sinusoid()\", 4) {\r\n testUnit(\"no parameter\", 1) {\r\n assertEqual(sinusoid(), [], \"Cannot build a sinusoid without parameters, should return an empty array\");\r\n }\r\n testUnit(\"wrong type\", 3) {\r\n assertEqual(sinusoid(\"1\", \"1\"), [], \"Cannot build a sinusoid using strings, should return an empty array\");\r\n assertEqual(sinusoid(true, true), [], \"Cannot build a sinusoid using booleans, should return an empty array\");\r\n assertEqual(sinusoid([1], [1]), [], \"Cannot build a sinusoid using vectors, should return an empty array\");\r\n }\r\n testUnit(\"straight\", 5) {\r\n assertEqual(sinusoid(1, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, sin(360 * a)] ], \"Should build a simple sinusoid with a length of 1 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, sin(360 * a \/ 2)] ], \"Should build a simple sinusoid with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, 4, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, 4 * sin(360 * a \/ 2)] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, 4, 6, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, 4 * sin(360 * a \/ 2 + 6)] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(sinusoid(1, 2, 4, 6, 8, $fn=6), [ for (a = [0 : 1\/6 : 1]) [a, 4 * sin(360 * a \/ 2 + 6) + 8] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n testUnit(\"rotated\", 5) {\r\n assertEqual(sinusoid(3, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, sin(360 * a)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, sin(360 * a \/ 2)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, 4, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, 4 * sin(360 * a \/ 2)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, 4, 6, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, 4 * sin(360 * a \/ 2 + 6)], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(sinusoid(3, 2, 4, 6, 8, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([a, 4 * sin(360 * a \/ 2 + 6) + 8], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n }\r\n \/\/ test core\/line\/cosinusoid()\r\n testModule(\"cosinusoid()\", 4) {\r\n testUnit(\"no parameter\", 1) {\r\n assertEqual(cosinusoid(), [], \"Cannot build a sinusoid without parameters, should return an empty array\");\r\n }\r\n testUnit(\"wrong type\", 3) {\r\n assertEqual(cosinusoid(\"1\", \"1\"), [], \"Cannot build a sinusoid using strings, should return an empty array\");\r\n assertEqual(cosinusoid(true, true), [], \"Cannot build a sinusoid using booleans, should return an empty array\");\r\n assertEqual(cosinusoid([1], [1]), [], \"Cannot build a sinusoid using vectors, should return an empty array\");\r\n }\r\n testUnit(\"straight\", 5) {\r\n assertEqual(cosinusoid(1, $fn=6), [ for (a = [0 : 1\/6 : 1]) [cos(360 * a), a] ], \"Should build a simple sinusoid with a length of 1 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, $fn=6), [ for (a = [0 : 1\/6 : 1]) [cos(360 * a \/ 2), a] ], \"Should build a simple sinusoid with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, 4, $fn=6), [ for (a = [0 : 1\/6 : 1]) [4 * cos(360 * a \/ 2), a] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, 4, 6, $fn=6), [ for (a = [0 : 1\/6 : 1]) [4 * cos(360 * a \/ 2 + 6), a] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(cosinusoid(1, 2, 4, 6, 8, $fn=6), [ for (a = [0 : 1\/6 : 1]) [4 * cos(360 * a \/ 2 + 6) + 8, a] ], \"Should build a simple sinusoid with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n testUnit(\"rotated\", 5) {\r\n assertEqual(cosinusoid(3, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([cos(360 * a), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([cos(360 * a \/ 2), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, 4, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([4 * cos(360 * a \/ 2), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, 4, 6, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([4 * cos(360 * a \/ 2 + 6), a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6 and 6 segments\");\r\n assertEqual(cosinusoid(3, 2, 4, 6, 8, a=70, $fn=8), [ for (a = [0 : 3\/8 : 3]) _rot2([4 * cos(360 * a \/ 2 + 6) + 8, a], 70) ], \"Should build a sinusoid rotated by 70\u00b0 with a length of 1, a period of 2, an amplitude of 4, a delay of 6, an offset of 8 and 6 segments\");\r\n }\r\n }\r\n\r\n }\r\n function _rot2(v, a) = [\r\n v[0] * cos(a) - v[1] * sin(a),\r\n v[1] * cos(a) + v[0] * sin(a)\r\n ];\r\n}\r\n\r\ntestCoreLine();\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a8a3bd15b4088670fcef3da5a71d9fd8852eb3ab","subject":"Flip the alternate batteries","message":"Flip the alternate batteries\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/BatteryPack.scad","new_file":"hardware\/vitamins\/BatteryPack.scad","new_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\/\/ len includes the positive-end button\nBattery_dia = 14.5;\nBattery_len = 50.5;\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery() {\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n\n}\n\nmodule battery_pack_linear(battery_sep, battery_count) {\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n if(i % 2 == 1) {\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery();\n } else {\n battery();\n }\n }\n}\n\nmodule battery_pack_double(battery_sep, battery_count) {\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery();\n }\n}\n\n*battery_pack_linear(2,4);\n*battery_pack_double(2, 4);\n","old_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\/\/ len includes the positive-end button\nBattery_dia = 14.5;\nBattery_len = 50.5;\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery() {\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n \n\n\n}\n\nmodule battery_pack_linear(battery_sep, battery_count) {\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n }\n}\n\nmodule battery_pack_double(battery_sep, battery_count) {\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n battery();\n }\n}\n\n*battery_pack_linear(2,4);\n*battery_pack_double(2, 4);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"61d8afa28e7adbecc49b985b864ac64db947f571","subject":"Add programming constructs tutorial","message":"Add programming constructs tutorial\n\nTODO: Add more functionality. e.g. matrix and vector maths, more\ndetail on variables and scope, lookup & search.\n","repos":"usedbytes\/openscad_tut","old_file":"tut4_programming.scad","new_file":"tut4_programming.scad","new_contents":"\/* Tutorial 4 - Programming Constructs *\/\n\n\/* Modules are somewhat like functions, but they \"return\" objects *\/\nmodule bit(type = \"sphere\", size = 10) {\n\tif (type == \"sphere\") {\n\t\tsphere(r = size \/ 2, center = true);\n\t} else if (type == \"cube\") {\n\t\tcube(size = size, center = true);\n\t} else {\n\t\t\/* Echo just prints to the output window *\/\n\t\techo(\"Unkown type: \", type);\n\t}\n}\n\n\/* There are functions too; they return values, not objects. Values can\n * be vectors, matrices, strings... *\/\nfunction quarter_circles(n) = 90 * n;\n\n\/* This will use the default arguments, type = \"sphere\" and size = 10 *\/\nbit();\n\nn_bits = 3;\narc_angle = quarter_circles(4);\n\n\/* For loops are pretty useful. Multiple conditions act like nested loops *\/\nfor (i = [0 : (arc_angle \/ n_bits) : arc_angle]) {\n\trotate([0, 0, i]) translate([20, 0, 0]) bit(\"cube\", 20);\n}\n\nfreq = 5;\namplitude = 20;\n\n\/* Add in some trigonomic functions for fun *\/\nfor (i = [0 : 1 : arc_angle \/ 2]) {\n\ttranslate([0, i, amplitude * sin(freq * i)])\n\t\tbit(\"sphere\", 5, $fn = 18);\n}\n\n\/* intersection_for() is a special case, it gives the intersection of all\n * of the objects inside the loop - NB: only where *all* of them intersect *\/\ncolor(\"red\") translate([0, 0, 25]) {\n\tintersection_for(i = [0 : 60 : 360]) {\n\t\trotate([0, 90, i]) cylinder(r = 10, h = 10, center = true);\n\t}\n}\n\n\/* Notice the difference with an intersection() and a for() *\/\ncolor(\"orange\") translate([0, 0, 50]) {\n\tintersection() {\n\t\tfor(i = [0 : 60 : 360]) {\n\t\t\trotate([0, 90, i]) cylinder(r = 10, h = 10, center = true);\n\t\t}\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tut4_programming.scad' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"b39b778b0f2fd0e243900b9622669cd698d4b720","subject":"[3d] Increase effective nut ingress width, locklip_p has inset, LCD block taper","message":"[3d] Increase effective nut ingress width, locklip_p has inset, LCD block taper\n\n-- Nut ingress is now a sideways trapezoid so it starts wider and tapers\nin.\n-- Ingress width lowered 5.8->5.7mm\n-- Nut recess no longer offset 0.4mm, elongated the points 0.2mm each\nside\n-- Locklip_p now default inset is 0, only the insert is inset now to\nallow the base to extend all the way to the wall.\n-- Fix microsd being slightly off-center since the case was enlarged\nlast rev\n-- The top of the LCD block is now fileted\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/* [Advanced] *\/\n\/\/ Thickness of side walls\nwall = 3.0;\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.0;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/* [Advanced] *\/\n\/\/ Thickness of side walls\nwall = 3;\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t]) cube([w,17,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34-wall+1);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ad8d1b291307f8e8eda3051430c83e1c9f8cdaea","subject":"fix error in DXF generation","message":"fix error in DXF generation\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/BubbleCopter,DanNixon\/Multirotors","old_file":"Suika\/parts\/fpv_camera_mount.scad","new_file":"Suika\/parts\/fpv_camera_mount.scad","new_contents":"include <..\/config.scad>;\n\nmodule FPVCameraMount()\n{\n cam_angle_rotate_2d = [\n [cos(FPV_CAMERA_ANGLE), -sin(FPV_CAMERA_ANGLE)],\n [sin(FPV_CAMERA_ANGLE), cos(FPV_CAMERA_ANGLE)]\n ];\n\n fpv_cam_pos_2d = [-FPV_CAMERA_POSITON[1], FPV_CAMERA_POSITON[2]];\n\n bracket_points = [\n [-CAMERA_BRACKET_TAB_OFFSET - CAMERA_BRACKET_TAB_WIDTH, 0],\n [-CAMERA_BRACKET_TAB_OFFSET - CAMERA_BRACKET_TAB_WIDTH, -MATERIAL_THICKNESS],\n [-CAMERA_BRACKET_TAB_OFFSET, -MATERIAL_THICKNESS],\n [-CAMERA_BRACKET_TAB_OFFSET, 0],\n [-CAMERA_BRACKET_LENGTH * 0.5, 0],\n [-CAMERA_BRACKET_LENGTH * 0.4, CAMERA_BRACKET_BASE_HEIGHT],\n ([0, CAMERA_BRACKET_LOW_CAM_POS] * cam_angle_rotate_2d) + fpv_cam_pos_2d,\n ([0, CAMERA_BRACKET_HIGH_CAM_POS] * cam_angle_rotate_2d) + fpv_cam_pos_2d,\n [CAMERA_BRACKET_LENGTH * 0.4, CAMERA_BRACKET_BASE_HEIGHT],\n [CAMERA_BRACKET_LENGTH * 0.5, 0],\n [CAMERA_BRACKET_TAB_OFFSET, 0],\n [CAMERA_BRACKET_TAB_OFFSET, -MATERIAL_THICKNESS],\n [CAMERA_BRACKET_TAB_OFFSET + CAMERA_BRACKET_TAB_WIDTH, -MATERIAL_THICKNESS],\n [CAMERA_BRACKET_TAB_OFFSET + CAMERA_BRACKET_TAB_WIDTH, 0],\n ];\n\n echo(\"Camera bracket points\", bracket_points);\n\n difference()\n {\n union()\n {\n translate([0, 0.01])\n polygon(points=bracket_points, paths=[[0, 1, 2, 3, 10, 11, 12, 13]]);\n\n minkowski()\n {\n circle(r=1, $fn=32);\n\n offset(r=-1)\n polygon(points=bracket_points, paths=[[4, 5, 6, 7, 8, 9]]);\n }\n }\n\n union()\n {\n scale(0.6)\n polygon(points=bracket_points, paths=[[4, 5, 8, 9, 10]]);\n\n \/* Mounting solts for FPV camera back panel *\/\n translate(fpv_cam_pos_2d - [0, HALF_MATERIAL_THICKNESS])\n rotate([0, 0, 90 - FPV_CAMERA_ANGLE])\n translate([0, -CAMERA_BRACKET_PANEL_OFFSET])\n square([CAMERA_BRACKET_PANEL_TAB_WIDTH + MACHINE_TOLERANCE, MATERIAL_THICKNESS + MACHINE_TOLERANCE], center=true);\n\n \/* Hole for access to the set button on the Eachine FPV camera *\/\n translate(fpv_cam_pos_2d)\n rotate([0, 0, -FPV_CAMERA_ANGLE])\n translate([-1, -7.5])\n circle(d=2, $fn=16);\n }\n }\n}\n\nFPVCameraMount();\n","old_contents":"include <..\/config.scad>;\n\nmodule FPVCameraMount()\n{\n cam_angle_rotate_2d = [\n [cos(FPV_CAMERA_ANGLE), -sin(FPV_CAMERA_ANGLE)],\n [sin(FPV_CAMERA_ANGLE), cos(FPV_CAMERA_ANGLE)]\n ];\n\n fpv_cam_pos_2d = [-FPV_CAMERA_POSITON[1], FPV_CAMERA_POSITON[2]];\n\n bracket_points = [\n [-CAMERA_BRACKET_TAB_OFFSET - CAMERA_BRACKET_TAB_WIDTH, 0],\n [-CAMERA_BRACKET_TAB_OFFSET - CAMERA_BRACKET_TAB_WIDTH, -MATERIAL_THICKNESS],\n [-CAMERA_BRACKET_TAB_OFFSET, -MATERIAL_THICKNESS],\n [-CAMERA_BRACKET_TAB_OFFSET, 0],\n [-CAMERA_BRACKET_LENGTH * 0.5, 0],\n [-CAMERA_BRACKET_LENGTH * 0.4, CAMERA_BRACKET_BASE_HEIGHT],\n ([0, CAMERA_BRACKET_LOW_CAM_POS] * cam_angle_rotate_2d) + fpv_cam_pos_2d,\n ([0, CAMERA_BRACKET_HIGH_CAM_POS] * cam_angle_rotate_2d) + fpv_cam_pos_2d,\n [CAMERA_BRACKET_LENGTH * 0.4, CAMERA_BRACKET_BASE_HEIGHT],\n [CAMERA_BRACKET_LENGTH * 0.5, 0],\n [CAMERA_BRACKET_TAB_OFFSET, 0],\n [CAMERA_BRACKET_TAB_OFFSET, -MATERIAL_THICKNESS],\n [CAMERA_BRACKET_TAB_OFFSET + CAMERA_BRACKET_TAB_WIDTH, -MATERIAL_THICKNESS],\n [CAMERA_BRACKET_TAB_OFFSET + CAMERA_BRACKET_TAB_WIDTH, 0],\n ];\n\n echo(\"Camera bracket points\", bracket_points);\n\n difference()\n {\n union()\n {\n polygon(points=bracket_points, paths=[[0, 1, 2, 3, 4, 9, 10, 11, 12, 13]]);\n\n minkowski()\n {\n circle(r=1, $fn=32);\n\n offset(r=-1)\n polygon(points=bracket_points, paths=[[4, 5, 6, 7, 8, 9]]);\n }\n }\n\n union()\n {\n scale(0.6)\n polygon(points=bracket_points, paths=[[4, 5, 8, 9, 10]]);\n\n \/* Mounting solts for FPV camera back panel *\/\n translate(fpv_cam_pos_2d - [0, HALF_MATERIAL_THICKNESS])\n rotate([0, 0, 90 - FPV_CAMERA_ANGLE])\n translate([0, -CAMERA_BRACKET_PANEL_OFFSET])\n square([CAMERA_BRACKET_PANEL_TAB_WIDTH + MACHINE_TOLERANCE, MATERIAL_THICKNESS + MACHINE_TOLERANCE], center=true);\n\n \/* Hole for access to the set button on the Eachine FPV camera *\/\n translate(fpv_cam_pos_2d)\n rotate([0, 0, -FPV_CAMERA_ANGLE])\n translate([-1, -7.5])\n circle(d=2, $fn=16);\n }\n }\n}\n\nFPVCameraMount();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"7754760dc0fa062b43d26126031136d8594e68db","subject":"main: z axis range depends on hotend height","message":"main: z axis range depends on hotend height\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[1]\/2-30*mm;\naxis_range_z=[-20+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6cd7e09c9b0a9c5253fa1fa30053a7ef24ec89d9","subject":"jumper wire position","message":"jumper wire position\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t \n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\t\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[0, 12, 0],[0,0,-1], -90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-20, 16, 3],[0,0,1],180,0,0];\nLogoBot_Con_RightMotorDriver = [[20, 16, 3],[0,0,1],180,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false ) {\n\n Assembly(\"LogoBot\");\n\n\ttranslate([0, 0, GroundClearance]) {\n\t\n\t\t\/\/ Default Design Elements\n\t\t\/\/ -----------------------\n\t\n\t\t\/\/ Base\n\t\tLogoBotBase_STL();\n\n step(1, \n \"Connect the breadboard assembly to the underside of the base\", \n \"400 300 0 17 12 112 0 222 513\")\n\t\t attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n\t\t BreadboardAssembly();\n\t\n\t\t\/\/ Bumper assemblies (x2)\n\t\tstep(2, \"Connect the two bumper assemblies\", \"400 300 -6 7 19 64 1 212 625\" )\n\t\t for (x=[0,1], y=[0,1])\n\t\t\tmirror([0,y,0])\n\t\t\tmirror([x,0,0])\n\t\t\ttranslate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n\t\t\trotate([0,0,-30])\n\t\t\tMicroSwitch();\n\t\n\t\t\/\/ Motor + Wheel assemblies (x2)\n\t\tstep(3, \"Connect the two wheel assemblies\", \"400 300 -4 6 47 66 0 190 740\")\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n\t\t\n\t\tstep(4, \"Push the two motor drivers onto the mounting posts\", \"400 300 -6 7 19 64 1 212 625\") {\n\t\t \/\/ Left Motor Driver\n\t\t attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t}\n\t\t\n\t\t\/\/ Connect jumper wires\n\t\tstep(5, \n\t\t \"Connect the jumper wires between the motor drivers and the Arduino\", \n\t\t \"400 300 9 26 54 38 0 161 766\")\n\t\t {\n\t\t \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[34,43,10], [0,0,-1], 0,0,0],\n con2 = [[11.5,31.5, -6], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0.5,-1,0]\n );\n \n \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[-31.5,43,10], [0,0,-1], 0,0,0],\n con2 = [[-9,31.5, -6], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0,0,-1]\n );\n\t\t \n\t\t }\n\t\n\t\t\/\/ Battery assembly\n\t\tstep(6, \"Clip in the battery pack\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-25, -45, 12])\n\t\t\trotate([90, 0, 90])\n\t\t\tbattery_pack_double(2, 4);\n\t\n\t\t\/\/ Power Switch\n\t\n\t\t\/\/ LED\n\t\tstep(7, \"Clip the LED into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([0, -10, BaseDiameter\/2]) \n\t\t\tLED();\n\t\t\n\t\t\/\/ Piezo\n\t\tstep(8, \"Clip the piezo sounder into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-37, -32, 10])\n\t\t\tmurata_7BB_12_9();\n\t\n\t\n\t\t\/\/ Caster\n\t\t\/\/ Example of using attach\n\t\t\/\/ TODO: Correct ground clearance!\n\t\tstep(9, \"Push the caster assembly into the base so that it snaps into place\", \n\t\t \"400 300 -6 7 19 115 1 26 625\")\n\t\t attach(LogoBot_Con_Caster, MarbleCastor_Con_Default, Explode=Explode, ExplodeSpacing=15)\n\t\t\tMarbleCasterAssembly();\n\t\t\n\t\t\t\n\t\t\/\/ Conditional Design Elements\n\t\t\/\/ ---------------------------\n\t\t\t\n\t\t\/\/ PenLift\n\t\t\/\/ Placeholder of a micro servo to illustrate having conditional design elements\n\t\tif (PenLift) {\n\t\t\t\/\/ TODO: wrap into a PenLift sub-assembly\n\t\t\tstep(10, \"Fit the pen lift assembly\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t\t attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n\t\t\t\tMicroServo();\n\t\t}\n\t\t\n\t\t\n\t\t\/\/ Shell + fixings\n\t\tstep(PenLift ? 11 : 10, \n\t\t \"Push the shell down onto the base and twist to lock into place\", \n\t\t \"400 400 11 -23 65 66 0 217 1171\")\n\t attach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t BasicShell_STL();\n\t}\n\t\n\tEnd(\"LogoBot\");\n}\n\n\n\n\/*\n\tSTL: LogoBotBase_STL\n\t\n\tThe printable base plate for the robot.\n\t\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\t\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\nmodule LogoBotBase_STL() {\n\n STL(\"LogoBotBase\");\n \n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\t\n\t\/\/ Color it as a printed plastic part\n\tcolor(PlasticColor)\n\t if (UseSTL) {\n\t import(str(STLPath, \"LogoBotBase.stl\"));\n\t } else {\n\t union() {\n\t \/\/ Start with an extruded base plate, with all the relevant holes punched in it\n linear_extrude(BaseThickness)\n difference() {\n \/\/ Union together all the bits to make the plate\n union() {\n \/\/ Base plate\n circle(r=BaseDiameter\/2);\n }\n \n \/\/ hole for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170))\n difference() {\n translate([2,2,0])\n square([Breadboard_Width(Breadboard_170)-4, Breadboard_Depth(Breadboard_170)-4]);\n \n \/\/ attach mounting points, has the effect of not differencing them\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n rotate([0,0,180])\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n }\n \n \/\/ mounting holes for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170)) {\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n }\n \n \/\/ weight loss holes under the motor drivers\n attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft))\n roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight))\n\t\t\t roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\n \/\/ slots for wheels\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n rotate([-90, 0, 90]) {\n translate([-1,0,0])\n roundedSquare([WheelThickness + tw, WheelDiameter + tw], (WheelThickness + tw)\/2, center=true);\n }\n \n \/\/ weight loss under battery pack\n translate([-57\/2, -45])\n roundedSquare([57, 30], tw);\n \n \/\/ Centre hole for pen\n circle(r=PenHoleDiameter\/2);\n \n \/\/ Chevron at the front so we're clear where the front is!\n translate([0, BaseDiameter\/2 - 10, 0])\n Chevron(width=10, height=6, thickness=3);\n \n \/\/ Caster\n \/\/ Example of using attach to punch an appropriate fixing hole\n attach(LogoBot_Con_Caster, PlasticCastor_Con_Default)\n circle(r = connector_bore(PlasticCastor_Con_Default) \/ 2);\n \n \n \n \/\/ A load of fixing holes around the edge... just as an example of how to do it\n \/\/ NB: This is one of the examples we discussed during the wk1 session\n \/\/ TODO: Decide if we want these back...\n *for (i=[0:9])\n rotate([0, 0, i * 360\/10])\n translate([BaseDiameter\/2 - 5, 0, 0])\n circle(r=4.3\/2); \/\/ M4 fixing holes\n \n \/\/ Remove shell fittings\n Shell_TwistLockCutouts();\n }\n \n \/\/ Now union on any other bits (i.e. sticky-up bits!)\n \n \/\/ clips for the motors\n LogoBotBase_MotorClips();\n \n LogoBotBase_MotorDriverPosts();\n \n \n }\n }\n}\n\nmodule LogoBotBase_STL_View() {\n echo(\"400 300 0 0 0 58 0 225 681\");\n}\n\n\nmodule LogoBotBase_MotorClips() {\n \/\/ TODO: feed these local variables from the motor vitamin global vars\n mbr = 28\/2; \/\/ motor body radius\n mao = 8; \/\/ motor axle offset from centre of motor body\n mth = 7; \/\/ motor tab height\n\n \/\/ clips\n for (i=[0:1], j=[0,1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX - 6 - j*12, 0, MotorOffsetZ + mao])\n rotate([-90, 0, 90])\n rotate([0,0, 0])\n linear_extrude(5) {\n difference() {\n union() {\n \n difference() { \n hull() {\n \/\/ main circle\n circle(r=mbr + dw);\n \n \/\/ extension to correctly union to the base plate\n translate([-(mbr * 1.5)\/2, MotorOffsetZ + mao -1,0])\n square([mbr * 1.5, 1]);\n }\n \n \/\/ trim the top off\n rotate([0,0,180 + 30])\n sector2D(r=mbr+30, a=120);\n }\n\n \/\/ welcoming hands\n for (k=[0,1])\n mirror([k,0,0])\n rotate([0,0,180+30])\n translate([mbr, -dw, 0])\n polygon([[1.5,0],[4,5],[3,5],[0,dw]],4);\n }\n \n \/\/ hollow for the motor\n circle(r=mbr);\n \n }\n }\n}\n\nmodule LogoBotBase_MotorDriverPosts() {\n \/\/ mounting posts for motor drivers\n \/\/ left driver example\n \/\/ TODO: Replace this with a loop\n \/\/ using a mirror because the layout is symmetrical\n for (i=[0,1])\n mirror([i,0,0])\n attach(\n offsetConnector(invertConnector(LogoBot_Con_LeftMotorDriver), [0,0, -LogoBot_Con_LeftMotorDriver[0][2]]), \n ULN2003DriverBoard_Con_UpperLeft) \n {\n \/\/ Now we're inside the driver boards local coordinate system, which is relative to the LowerLeft mount point.\n \/\/ To position things relative to the local frame, we need to \"reverse\" attach them by swapping the order\n \/\/ of the connectors.\n attach(ULN2003DriverBoard_Con_UpperLeft, ULN2003DriverBoard_Con_LowerLeft)\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_UpperRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_LowerRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n \/\/ the lower left post doesn't need translating\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n }\n}\n\nmodule LogoBotBase_MountingPost(r1=5\/2, h1=3, r2=3\/2, h2=3) {\n cylinder(r=r1, h=h1);\n translate([0,0,h1-eta])\n cylinder(r1=r2, r2=r2 * 0.7, h=h2 +eta);\n}","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t \n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\t\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[0, 12, 0],[0,0,-1], -90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-20, 16, 3],[0,0,1],180,0,0];\nLogoBot_Con_RightMotorDriver = [[20, 16, 3],[0,0,1],180,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false ) {\n\n Assembly(\"LogoBot\");\n\n\ttranslate([0, 0, GroundClearance]) {\n\t\n\t\t\/\/ Default Design Elements\n\t\t\/\/ -----------------------\n\t\n\t\t\/\/ Base\n\t\tLogoBotBase_STL();\n\n step(1, \n \"Connect the breadboard assembly to the underside of the base\", \n \"400 300 0 17 12 112 0 222 513\")\n\t\t attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n\t\t BreadboardAssembly();\n\t\n\t\t\/\/ Bumper assemblies (x2)\n\t\tstep(2, \"Connect the two bumper assemblies\", \"400 300 -6 7 19 64 1 212 625\" )\n\t\t for (x=[0,1], y=[0,1])\n\t\t\tmirror([0,y,0])\n\t\t\tmirror([x,0,0])\n\t\t\ttranslate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n\t\t\trotate([0,0,-30])\n\t\t\tMicroSwitch();\n\t\n\t\t\/\/ Motor + Wheel assemblies (x2)\n\t\tstep(3, \"Connect the two wheel assemblies\", \"400 300 -4 6 47 66 0 190 740\")\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n\t\t\n\t\tstep(4, \"Push the two motor drivers onto the mounting posts\", \"400 300 -6 7 19 64 1 212 625\") {\n\t\t \/\/ Left Motor Driver\n\t\t attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t}\n\t\t\n\t\t\/\/ Connect jumper wires\n\t\tstep(5, \n\t\t \"Connect the jumper wires between the motor drivers and the Arduino\", \n\t\t \"400 300 9 26 54 38 0 161 766\")\n\t\t {\n\t\t \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[34,43,10], [0,0,-1], 0,0,0],\n con2 = [[11.5,31.5, -8], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0.5,-1,0]\n );\n \n \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[-31.5,43,10], [0,0,-1], 0,0,0],\n con2 = [[-9,31.5, -8], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0,0,-1]\n );\n\t\t \n\t\t }\n\t\n\t\t\/\/ Battery assembly\n\t\tstep(6, \"Clip in the battery pack\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-25, -45, 12])\n\t\t\trotate([90, 0, 90])\n\t\t\tbattery_pack_double(2, 4);\n\t\n\t\t\/\/ Power Switch\n\t\n\t\t\/\/ LED\n\t\tstep(7, \"Clip the LED into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([0, -10, BaseDiameter\/2]) \n\t\t\tLED();\n\t\t\n\t\t\/\/ Piezo\n\t\tstep(8, \"Clip the piezo sounder into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-37, -32, 10])\n\t\t\tmurata_7BB_12_9();\n\t\n\t\n\t\t\/\/ Caster\n\t\t\/\/ Example of using attach\n\t\t\/\/ TODO: Correct ground clearance!\n\t\tstep(9, \"Push the caster assembly into the base so that it snaps into place\", \n\t\t \"400 300 -6 7 19 115 1 26 625\")\n\t\t attach(LogoBot_Con_Caster, MarbleCastor_Con_Default, Explode=Explode, ExplodeSpacing=15)\n\t\t\tMarbleCasterAssembly();\n\t\t\n\t\t\t\n\t\t\/\/ Conditional Design Elements\n\t\t\/\/ ---------------------------\n\t\t\t\n\t\t\/\/ PenLift\n\t\t\/\/ Placeholder of a micro servo to illustrate having conditional design elements\n\t\tif (PenLift) {\n\t\t\t\/\/ TODO: wrap into a PenLift sub-assembly\n\t\t\tstep(10, \"Fit the pen lift assembly\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t\t attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n\t\t\t\tMicroServo();\n\t\t}\n\t\t\n\t\t\n\t\t\/\/ Shell + fixings\n\t\tstep(PenLift ? 11 : 10, \n\t\t \"Push the shell down onto the base and twist to lock into place\", \n\t\t \"400 400 11 -23 65 66 0 217 1171\")\n\t attach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t BasicShell_STL();\n\t}\n\t\n\tEnd(\"LogoBot\");\n}\n\n\n\n\/*\n\tSTL: LogoBotBase_STL\n\t\n\tThe printable base plate for the robot.\n\t\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\t\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\nmodule LogoBotBase_STL() {\n\n STL(\"LogoBotBase\");\n \n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\t\n\t\/\/ Color it as a printed plastic part\n\tcolor(PlasticColor)\n\t if (UseSTL) {\n\t import(str(STLPath, \"LogoBotBase.stl\"));\n\t } else {\n\t union() {\n\t \/\/ Start with an extruded base plate, with all the relevant holes punched in it\n linear_extrude(BaseThickness)\n difference() {\n \/\/ Union together all the bits to make the plate\n union() {\n \/\/ Base plate\n circle(r=BaseDiameter\/2);\n }\n \n \/\/ hole for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170))\n difference() {\n translate([2,2,0])\n square([Breadboard_Width(Breadboard_170)-4, Breadboard_Depth(Breadboard_170)-4]);\n \n \/\/ attach mounting points, has the effect of not differencing them\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n rotate([0,0,180])\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n }\n \n \/\/ mounting holes for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170)) {\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n }\n \n \/\/ weight loss holes under the motor drivers\n attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft))\n roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight))\n\t\t\t roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\n \/\/ slots for wheels\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n rotate([-90, 0, 90]) {\n translate([-1,0,0])\n roundedSquare([WheelThickness + tw, WheelDiameter + tw], (WheelThickness + tw)\/2, center=true);\n }\n \n \/\/ weight loss under battery pack\n translate([-57\/2, -45])\n roundedSquare([57, 30], tw);\n \n \/\/ Centre hole for pen\n circle(r=PenHoleDiameter\/2);\n \n \/\/ Chevron at the front so we're clear where the front is!\n translate([0, BaseDiameter\/2 - 10, 0])\n Chevron(width=10, height=6, thickness=3);\n \n \/\/ Caster\n \/\/ Example of using attach to punch an appropriate fixing hole\n attach(LogoBot_Con_Caster, PlasticCastor_Con_Default)\n circle(r = connector_bore(PlasticCastor_Con_Default) \/ 2);\n \n \n \n \/\/ A load of fixing holes around the edge... just as an example of how to do it\n \/\/ NB: This is one of the examples we discussed during the wk1 session\n \/\/ TODO: Decide if we want these back...\n *for (i=[0:9])\n rotate([0, 0, i * 360\/10])\n translate([BaseDiameter\/2 - 5, 0, 0])\n circle(r=4.3\/2); \/\/ M4 fixing holes\n \n \/\/ Remove shell fittings\n Shell_TwistLockCutouts();\n }\n \n \/\/ Now union on any other bits (i.e. sticky-up bits!)\n \n \/\/ clips for the motors\n LogoBotBase_MotorClips();\n \n LogoBotBase_MotorDriverPosts();\n \n \n }\n }\n}\n\nmodule LogoBotBase_STL_View() {\n echo(\"400 300 0 0 0 58 0 225 681\");\n}\n\n\nmodule LogoBotBase_MotorClips() {\n \/\/ TODO: feed these local variables from the motor vitamin global vars\n mbr = 28\/2; \/\/ motor body radius\n mao = 8; \/\/ motor axle offset from centre of motor body\n mth = 7; \/\/ motor tab height\n\n \/\/ clips\n for (i=[0:1], j=[0,1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX - 6 - j*12, 0, MotorOffsetZ + mao])\n rotate([-90, 0, 90])\n rotate([0,0, 0])\n linear_extrude(5) {\n difference() {\n union() {\n \n difference() { \n hull() {\n \/\/ main circle\n circle(r=mbr + dw);\n \n \/\/ extension to correctly union to the base plate\n translate([-(mbr * 1.5)\/2, MotorOffsetZ + mao -1,0])\n square([mbr * 1.5, 1]);\n }\n \n \/\/ trim the top off\n rotate([0,0,180 + 30])\n sector2D(r=mbr+30, a=120);\n }\n\n \/\/ welcoming hands\n for (k=[0,1])\n mirror([k,0,0])\n rotate([0,0,180+30])\n translate([mbr, -dw, 0])\n polygon([[1.5,0],[4,5],[3,5],[0,dw]],4);\n }\n \n \/\/ hollow for the motor\n circle(r=mbr);\n \n }\n }\n}\n\nmodule LogoBotBase_MotorDriverPosts() {\n \/\/ mounting posts for motor drivers\n \/\/ left driver example\n \/\/ TODO: Replace this with a loop\n \/\/ using a mirror because the layout is symmetrical\n for (i=[0,1])\n mirror([i,0,0])\n attach(\n offsetConnector(invertConnector(LogoBot_Con_LeftMotorDriver), [0,0, -LogoBot_Con_LeftMotorDriver[0][2]]), \n ULN2003DriverBoard_Con_UpperLeft) \n {\n \/\/ Now we're inside the driver boards local coordinate system, which is relative to the LowerLeft mount point.\n \/\/ To position things relative to the local frame, we need to \"reverse\" attach them by swapping the order\n \/\/ of the connectors.\n attach(ULN2003DriverBoard_Con_UpperLeft, ULN2003DriverBoard_Con_LowerLeft)\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_UpperRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_LowerRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n \/\/ the lower left post doesn't need translating\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n }\n}\n\nmodule LogoBotBase_MountingPost(r1=5\/2, h1=3, r2=3\/2, h2=3) {\n cylinder(r=r1, h=h1);\n translate([0,0,h1-eta])\n cylinder(r1=r2, r2=r2 * 0.7, h=h2 +eta);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a0ee163db1670c3e95912ac448a0ad203ce56ce2","subject":"Add a basic OpenSCAD file.","message":"Add a basic OpenSCAD file.\n","repos":"cnelsonsic\/moro,cnelsonsic\/moro,cnelsonsic\/moro","old_file":"moro.scad","new_file":"moro.scad","new_contents":"\/\/All units are in cm\n\nmodule usb_port ()\n{\n\tdifference() {\n\t\tcube([0.65, 1.4, .5], center=true);\n\t\tcube([0.45, 1.2, .6], center=true);\n\t}\n}\n\nmodule female_header ()\n{\n\tdifference() {\n\t\tcube([0.3, 0.3, 0.9], center=true);\n\t\tcube([0.1, 0.1, 1], center=true);\n\t}\n}\n\nmodule console_body()\n{\n\tdifference() {\n\t\tunion() {\n\t\t\tdifference() {\n\t\t\t\tdifference() {\n\t\t\t\t\t\/\/ The main body, hollow\n\t\t\t\t\tcube([12, 12, 8], center=true);\n\t\t\t\t\tcube([11.5, 11.5, 7.5], center=true);\n\t\t\t\t}\n\n\t\t\t\t\/\/ Slot cutout\n\t\t\t\ttranslate([0, 3, 3.1]) {\n\t\t\t\t\tcube([10, 2, 2.1], center=true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdifference() {\n\t\t\t\t\/\/ The physical Slot (the part that collects dust and soda)\n\t\t\t\ttranslate([0, 3, 3.1]) {\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\ttranslate([0, 0, -.1]) {\n\t\t\t\t\t\t\tcube([10.75, 2.75, 2], center=true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcube([10, 2, 2], center=true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\/\/ Cutouts for Slot USB in physical slot\n\t\t\t\tfor(i=[-1, 1]) {\n\t\t\t\t\ttranslate([3.8*i, 3, 2]){\n\t\t\t\t\t\tcube([0.75, 1.5, 0.7], center=true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\/\/ Front USB cutouts\n\t\tfor(i=[-1, 1]) {\n\t\t\ttranslate([3.8*i, -6, 0]){\n\t\t\t\trotate([90, 90, 0]) {\n\t\t\t\t\tcube([0.75, 1.5, 0.7], center=true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule console()\n{\n\t\/\/ Console Shell\n\tconsole_body();\n\n\t\/\/ USB ports on front\n\ttranslate([0, -5.75, 0]) {\n\t\trotate([90, 0, 0]) {\n\t\t\tfor(i=[-1, 1]) {\n\t\t\t\ttranslate([3.8*i, 0, 0]) {\n\t\t\t\t\trotate([0, 0, 90]) {\n\t\t\t\t\t\tusb_port();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tcube([8, 8, 10], center=true);\n\n\t\/\/ USB ports in Slot\n\tfor(i=[-1, 1]) {\n\t\ttranslate([3.8*i, 3, 3-.6]) {\n\t\t\tusb_port();\n\t\t}\n\t}\n\n\t\/\/ GPIO\n\ttranslate([-((13*0.254)\/2), 3, 2]){\n\t\tfor(i = [0:13]) {\n\t\t\tfor(j=[-1, 1]) {\n\t\t\t\ttranslate([i*0.254, (0.254\/2)*j, 0]) {\n\t\t\t\t\tfemale_header();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t\/\/ The following are not specified because the specification doesn't care.\n\t\/\/ TODO: HDMI Jack\n\t\/\/ TODO: Power Jack\n\t\/\/ TODO: Ethernet Jack\n\t\/\/ TODO: RCA Video Jack\n\t\/\/ TODO: 3.5mm Phono Jack\n\n}\n\nconsole();\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'moro.scad' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"79ece1ebaadfe38f11099f4c40297c4b10cbbd30","subject":"main: print build area Z","message":"main: print build area Z\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"54488e396057d7022f50b2795de808de9118bb75","subject":"Extruder top mount for Kossel","message":"Extruder top mount for Kossel\n","repos":"ksuszka\/3d-projects","old_file":"kossel\/kossel_extruder_top_mount.scad","new_file":"kossel\/kossel_extruder_top_mount.scad","new_contents":"beam_size = 15;\n\nmodule beam(length) {\n cube([beam_size, beam_size, length], true);\n}\n\nlong_beam_distance = 383;\nlong_beam_length = 750;\nshort_beam_length = 360;\nshort_beam_offset = 16.8; \/\/ ???\n\nmodule frame() {\n half_beam_size = beam_size \/ 2;\n module long_beam() {\n translate([0, 0, long_beam_length \/ 2])\n beam(long_beam_length);\n }\n \n module short_beam() {\n translate([0, 0, half_beam_size])\n rotate([0, 90, 0])\n beam(short_beam_length);\n }\n \n module side() {\n translate([0, -short_beam_offset, 0])\n short_beam();\n translate([0, -short_beam_offset, beam_size * 2])\n short_beam();\n translate([0, -short_beam_offset, long_beam_length - beam_size]) \n short_beam();\n }\n translate([0,-long_beam_distance*sqrt(3)\/3,0]) {\n long_beam();\n rotate([0, 0, 60])\n translate([long_beam_distance, 0, 0])\n rotate([0, 0, 60])\n long_beam();\n rotate([0, 0, 120])\n translate([long_beam_distance, 0, 0])\n rotate([0, 0, 120])\n long_beam();\n \n rotate([0, 0, 60])\n translate([long_beam_distance\/2, 0, 0])\n side();\n \n rotate([0, 0, 300])\n translate([-long_beam_distance\/2, 0, 0])\n side();\n \n rotate([0, 0, 60])\n translate([long_beam_distance, 0, 0])\n rotate([0, 0, 120])\n translate([long_beam_distance\/2, 0, 0])\n side();\n }\n}\n\nmodule bed() {\n bed_diameter = 250;\n translate([0, 0, beam_size * 3 + 4])\n cylinder(r = bed_diameter \/ 2, h = 3);\n}\n\nframe();\nbed();\n\nmodule one_third() {\n short_wall_distance = 20;\n long_wall_distance = 43;\n short_wall_width = 120;\n long_wall_width = 380;\n\n \/\/short_wall_distance = 7;\n \/\/long_wall_distance = 50;\n \/\/short_wall_width = 153;\n \/\/long_wall_width = 329;\n \n \/\/short_wall_distance = 5;\n \/\/long_wall_distance = 50;\n \/\/short_wall_width = 155.9;\n \/\/long_wall_width = 324.75;\n \n \/\/short_wall_distance = 7.35;\n \/\/long_wall_distance = 50;\n \/\/short_wall_width = 153;\n \/\/long_wall_width = 330;\n wall_ext=3.3;\n color(\"red\") {\n translate([0,-35.62 -7.5,750+ 3])\n cube([15,356,6],true);\n }\n color(\"blue\") {\n translate([0,356\/2+25-35.62 -7.5,750+ 3])\n cube([15,50,6],true);\n }\n wall_height = 720;\n #translate([0,-long_beam_distance*sqrt(3)\/3 -9-short_wall_distance,750\/2+15]) {\n color(\"Green\") cube([short_wall_width,3,wall_height], true);\n color(\"PaleGreen\") cube([short_wall_width+wall_ext,0.05,wall_height], true);\n }\n #rotate([0,0,60]) translate([0,-(356\/2-35.62 -7.5+1.5+long_wall_distance),750\/2+15]) {\n color(\"Green\") cube([long_wall_width,3,wall_height], true);\n color(\"PaleGreen\") cube([long_wall_width+wall_ext,0.05,wall_height], true);\n }\n\n \n\/\/ xx = 260;\n\/\/ yy = 90;\n\/\/ translate([xx,yy,0]) color(\"green\") cube([2,2,10000],true);\n\/\/ translate([-xx,-yy,0])\n\/\/ rotate([0,0,60]) translate([0,-(356\/2-35.62 -7.5+1.5+long_wall_distance),750\/2+15]) {\n\/\/ color(\"Green\") cube([long_wall_width,3,wall_height], true);\n\/\/ color(\"PaleGreen\") cube([long_wall_width+wall_ext,0.05,wall_height], true);\n\/\/ }\n\n}\n\n\/\/one_third();\n\/\/rotate([0,0,120]) one_third();\n\/\/rotate([0,0,-120]) one_third();\n\n\nmodule extruder_holder(part=\"all\") {\n brace_wall_thickness = 4;\n rotor_r = 18;\n clamp_h = 22;\n clamp_thickness = 7;\n offset_y = -25;\n height = 152.5;\n \n module brace_negative() {\n difference() {\n union() {\n translate([0,0,500+beam_size\/2])cube([1000,1000,1000],true);\n translate([0,500+beam_size\/2,0])cube([1000,1000,1000],true);\n translate([0,500-beam_size\/2,500-beam_size\/2])cube([1000,1000,1000],true);\n }\n translate([0,0,-beam_size\/2]) cube([1000+1, 3, 5],true);\n translate([0,-beam_size\/2,0]) cube([1000+1, 5, 3],true);\n }\n }\n\n module brace(length = 50) {\n difference() {\n cube([length, beam_size + brace_wall_thickness*2, beam_size + brace_wall_thickness*2],true);\n brace_negative();\n }\n }\n \n module brace_screw_mold() {\n cylinder(d=3, h=1000, center=true, $fn=60);\n translate([0,0,-500- beam_size\/2-brace_wall_thickness]) cylinder(d=6, h=1000, center=true, $fn=60);\n translate([0,0,500- beam_size\/2]) cylinder(d=7, h=1000, center=true, $fn=60);\n }\n\n module clamp_hole() {\n cylinder(r=rotor_r, h=clamp_h+1, center=true);\n }\n \n module screw_mold(length=8, head_length=100) {\n cylinder(d=3, h=length+head_length*2, center=true, $fn=60);\n translate([0,0,head_length\/2+length\/2]) cylinder(d=6.2, h=head_length, center=true, $fn=6);\n translate([0,0,-head_length\/2-length\/2]) cylinder(d=6, h=head_length, center=true, $fn=60);\n }\n\n module clamp_screws_mold() {\n module clamp_screw_mold() {\n rotate([0,90,0]) translate([0,0,-3]) screw_mold(16);\n }\n screw_offset_y = rotor_r + clamp_thickness+5;\n screw_offset_z = 6;\n translate([0,screw_offset_y,screw_offset_z]) clamp_screw_mold();\n translate([0,screw_offset_y,-screw_offset_z]) clamp_screw_mold();\n translate([0,-screw_offset_y,screw_offset_z]) clamp_screw_mold();\n translate([0,-screw_offset_y,-screw_offset_z]) clamp_screw_mold();\n }\n module clamp() {\n difference() {\n union() {\n cylinder(r=rotor_r+clamp_thickness, h=clamp_h, center=true);\n cube([16,(rotor_r + clamp_thickness+10)*2,clamp_h],true);\n }\n clamp_hole();\n \/\/clamp_screws_mold();\n }\n }\n\n module extruder_holder_arms() {\n base_x_offset = (offset_y + (long_beam_distance + short_beam_offset*2*sqrt(3))*sqrt(3)\/3)\/sqrt(3);\n module arms() {\n difference() {\n union() {\n translate([base_x_offset,0,0]) rotate([0,0,-120]) brace(60);\n arm_w = 10;\n translate([0,clamp_h\/2,0]) rotate([90,0,0]) linear_extrude(height=clamp_h) {\n polygon([[base_x_offset+arm_w, -arm_w],\n [+arm_w+10, -arm_w-height-5],\n [-arm_w+10, +arm_w-height-5],\n [base_x_offset-arm_w, +arm_w]]);\n };\n translate([0,0,-height+20]) cube([60,clamp_h,20],true);\n translate([0,0,-height+30]) cube([16,clamp_h,30],true);\n }\n translate([base_x_offset,0,0]) rotate([0,0,-120]) brace_negative();\n translate([0,0,-height]) rotate([90,0,0]) clamp_hole();\n\/\/ translate([0,0,-height]) rotate([90,0,0]) clamp_screws_mold();\n translate([0,-500-clamp_h\/2,0]) cube([1000,1000,1000],true);\n \n translate([base_x_offset,0,0]) rotate([0,0,-120]) {\n translate([-5,0,0]) brace_screw_mold();\n translate([10,0,0]) rotate([-90,0,0]) brace_screw_mold();\n translate([-20,0,0]) rotate([-90,0,0]) brace_screw_mold();\n }\n \n translate([120,0,-20]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([110,0,-20]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([120,0,-30]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([110,0,-30]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([100,0,-30]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([110,0,-40]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([100,0,-40]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([100,0,-50]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([90,0,-50]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([90,0,-60]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([80,0,-60]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([80,0,-70]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([70,0,-70]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([70,0,-80]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([60,0,-80]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([70,0,-90]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([60,0,-90]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([60,0,-100]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([50,0,-100]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([50,0,-110]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([40,0,-110]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([40,0,-120]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n translate([40,0,-130]) rotate([90,0,0]) cylinder(d=3,h=1000,center=true);\n }\n }\n translate([0,offset_y,0]) {\n difference() {\n union() {\n translate([0,0,-height]) rotate([90,90,0]) clamp();\n arms();\n mirror([1,0,0]) arms();\n }\n translate([0,0,-height]) rotate([90,90,0]) clamp_screws_mold();\n translate([0,6,-height+37]) rotate([0,90,0]) screw_mold(10,10);\n translate([0,-6,-height+37]) rotate([0,90,0]) screw_mold(10,10);\n \n }\n }\n }\n\n if (part == \"left\") {\n intersection() {\n extruder_holder_arms(); \n translate([500,0,500-height]) cube([1000,1000,1000],true);\n }\n } else if (part == \"right\") {\n intersection() {\n extruder_holder_arms(); \n translate([-500,0,500-height]) cube([1000,1000,1000],true);\n }\n } else if (part == \"bottom\") {\n intersection() {\n extruder_holder_arms(); \n translate([0,0,-500-height]) cube([1000,1000,1000],true);\n }\n } else {\n extruder_holder_arms();\n }\n}\n\n!translate([0,0,long_beam_length-beam_size\/2]) extruder_holder(\"all\");\ntranslate([0,0,260+beam_size * 3 + 7]) color(\"red\") cube([4,4,520],true);","old_contents":"","returncode":1,"stderr":"error: pathspec 'kossel\/kossel_extruder_top_mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9316908e0ab773f983b7eab26e60a890716368ca","subject":"The tabs for Thingiverse Customizer were corrected.","message":"The tabs for Thingiverse Customizer were corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/arcade\/space-invaders\/space-invaders-scenes-CUSTOMIZER.scad","new_file":"OpenSCAD\/arcade\/space-invaders\/space-invaders-scenes-CUSTOMIZER.scad","new_contents":"\r\n\/\/ preview[view:south, tilt:top]\r\n\r\n\/* [Mystery Ship] *\/\r\nmysteryShipX = 80; \/\/ [5:120]\r\n\r\n\/* [Invaders] *\/\r\nfirstRowInvaderType = \"1b\"; \/\/ [1, 1b, 2, 2b, 3, 3b] \r\nsecondRowInvaderType = \"2b\"; \/\/ [1, 1b, 2, 2b, 3, 3b]\r\nthirdRowInvaderType = \"3\"; \/\/ [1, 1b, 2, 2b, 3, 3b]\r\n\r\nmissle1X = 28; \/\/ [5:120]\r\nmissle2X = 100; \/\/ [5:120]\r\n\r\n\/* [Shields] *\/\r\nshieldOneType = 1; \/\/ [1, 2, 3, 4]\r\nshieldTwoType = 2; \/\/ [1, 2, 3, 4]\r\nshieldThreeType = 3; \/\/ [1, 2, 3, 4]\r\nshieldFourType = 4; \/\/ [1, 2, 3, 4]\r\n\r\n\/* [Player] *\/\r\nplayerX = 60; \/\/ [5:120]\r\nplayerShotX = 62; \/\/ [5:120]\r\n\r\n\/* [Hidden] *\/\r\n\r\ncornerRadius = 8;\r\n\r\ninvaderColumns = 7;\r\n\r\nalienColors = [\"green\", \"purple\", \"blue\"];\r\n\r\nboardHeight = 1;\r\nboardLength = 130;\r\nboardSize = [boardLength, boardLength, boardHeight];\r\n\r\ninvaderScene(playerShotX = playerShotX);\r\n\r\n\/**\r\n * draws one row of invaders\r\n *\/\r\n module invaderRow(invaderType)\r\n {\r\n if( str(invaderType) == \"1\") \/\/ thingiverse customizer was treating this like a numeric value, so str() is used to overcome\r\n {\r\n \tinvaders_v2_1();\r\n }\r\n else if(invaderType == \"1b\")\r\n {\r\n \tinvaders_v2_1b();\r\n }\r\n else if(str(invaderType) == \"2\")\r\n {\r\n \tinvaders_v2_2();\r\n }\r\n else if(invaderType == \"2b\")\r\n {\r\n \tinvaders_v2_2b();\r\n }\r\n else if(str(invaderType) == \"3\")\r\n {\r\n \tinvaders_v2_3();\r\n }\r\n else if(invaderType == \"3b\")\r\n {\r\n \tinvaders_v2_3b();\r\n } \t\r\n }\r\n\r\n\/**\r\n * This module loops over rows and columns for the invaders.\r\n *\/\r\nmodule invaders()\r\n{\r\n columnSpacing = 18;\r\n columnLeftOffset = 9;\r\n for(r = [0 : 2])\r\n {\r\n color(alienColors[r])\r\n for ( c = [0 : invaderColumns-1] )\r\n {\r\n x = c * columnSpacing + columnLeftOffset;\r\n translate([x, boardLength - (r*15+24), 0])\r\n scale([0.5, 0.5, 0.5])\r\n if(r == 0)\r\n {\r\n \tinvaderRow(firstRowInvaderType);\r\n }\r\n else if(r == 1)\r\n {\r\n \tinvaderRow(secondRowInvaderType);\r\n }\r\n else if(r == 2)\r\n {\r\n \tinvaderRow(thirdRowInvaderType);\r\n } \r\n }\r\n }\r\n}\r\n\r\n\/**\r\n * This is the main method of the scipt. Call this to generate a Space Invader\r\n * scene.\r\n *\/\r\nmodule invaderScene(playerShotX)\r\n{\r\n union()\r\n {\r\n \/\/ background layer\r\n roundedCube(boardSize, cornerRadius, sides=20, sidesOnly=true);\r\n\r\n mysteryShip();\r\n\r\n invaders();\r\n \r\n missiles(playerShotX);\r\n\r\n shields();\r\n \r\n player();\r\n }\r\n}\r\n\r\n\/**\r\n * These are the missile shot by the \r\n * @return \r\n *\/\r\nmodule missiles(playerShotX)\r\n{ \r\n \/\/ invader missle 1\r\n color(\"blue\")\r\n translate([missle1X, 60, 0])\r\n scale([0.5, 0.5, 0.5])\r\n\tinvaders_v2_missle1();\r\n \r\n \/\/ invader missle 2\r\n color(\"purple\")\r\n translate([missle2X, 40, 0])\r\n scale([0.5, 0.5, 0.5])\r\n invaders_v2_missle2(); \r\n\r\n\t\/\/ player missle \r\n color(\"green\") \r\n translate([playerShotX, 40, 0])\r\n scale([0.5, 0.5, 0.5])\r\n\tinvaders_v2_missle3();\r\n}\r\n\r\n\/**\r\n * This module adds the mystery ship at the top of the screen.\r\n * \r\n * originally invaders_v2_ship.stl \r\n *\/\r\nmodule mysteryShip()\r\n{\t\r\n x = mysteryShipX;\r\n y = boardLength - 5;\r\n z = 0;\r\n \r\n color(\"orange\")\r\n translate([x, y, z])\r\n scale([0.5, 0.5, 0.5])\r\n invaders_v2_ship();\r\n}\r\n\r\nmodule oneShield(shieldType)\r\n{\r\n\tif(shieldType == 1)\r\n\t{\r\n\t\tinvaders_v2_sheild1();\r\n\t}\r\n\telse if(shieldType == 2)\r\n\t{\r\n\t\tinvaders_v2_sheild2();\r\n\t}\r\n\telse if( shieldType ==3)\r\n\t{\r\n\t\tinvaders_v2_sheild3();\r\n\t}\r\n\telse if(shieldType == 4)\r\n\t{\r\n\t\tinvaders_v2_sheild4();\t\t\r\n\t}\r\n}\r\n\r\n\/**\r\n * originally invaders_v2_canon.stl \r\n *\/\r\nmodule player()\r\n{\r\n color(\"green\")\r\n translate([playerX, 0, 0])\r\n scale([0.5, 0.5, 0.5])\r\n invaders_v2_canon();\r\n}\r\n\r\nmodule shields()\r\n{\r\n for(c = [0:3])\r\n {\r\n columnLeftOffset = 10;\r\n columnSpacing = 35;\r\n \r\n x = c * columnSpacing + columnLeftOffset;\r\n y = boardLength * 0.15;\r\n \r\n color(\"brown\")\r\n translate([x, y, 0])\r\n scale([0.5, 0.5, 0.5])\r\n if(c == 0)\r\n {\r\n \toneShield(shieldOneType);\r\n }\r\n else if(c == 1)\r\n {\r\n \toneShield(shieldTwoType);\r\n }\r\n else if(c == 2)\r\n {\r\n \toneShield(shieldThreeType);\r\n }\r\n else if(c == 3)\r\n {\r\n \toneShield(shieldFourType);\r\n }\r\n }\r\n}\r\n\r\n\/\/ Below are modules borrowed from other parts of this project. They are copied here the Thingiverse Customizer only works with\r\n\/\/ one file with no importing or 'use' keywords.\r\n\/**\r\n * originally use <..\/..\/basics\/rounded-cube.scad> \r\n * makes a rounded cube\r\n *\/\r\nmodule roundedCube(size, cornerRadius, sides=30, sidesOnly=false)\r\n{\r\n\t$fn=sides;\r\n\t\r\n\tx = size[0] - cornerRadius\/2;\r\n\ty = size[1] - cornerRadius\/2;\r\n\tz = size[2];\r\n\t\r\n\tminkowski(size, cornerRadius)\r\n\t{\r\n\t cube(size=[x,y,z]);\r\n\t \r\n\t if(sidesOnly)\r\n\t {\r\n\t \tcylinder(r=cornerRadius);\r\n\t }\r\n\t else\r\n\t {\r\n\t \tsphere(r=cornerRadius);\r\n\t \t\r\n \t}\r\n\t}\t\r\n}\r\n \r\n\r\n\/\/ below are .stl files converted to OpenSCAD code\r\nmodule invaders_v2_canon() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[17.32853, -10.57798, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 10.57798, 0.0],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -10.57798, 10.03544]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_ship() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-2.661523, -6.549835, 10.03545],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 5.125999e-06],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[-7.942975, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[-7.942975, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661523, -6.549835, 10.03545],\r\n\t\t\t[-2.661523, -6.549835, 10.03545],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 10.03546]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_1() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -5.281656, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_1b()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[-2.58908, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[-2.58908, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[5.348594, 0.08991051, 10.03546]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_2() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[1.557999, -8.006418, 5.245209e-06],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[1.557999, -10.62473, 10.03545],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[1.557999, -8.006418, 5.245209e-06],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[-1.557995, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[1.557999, -10.62473, 10.03545],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[1.557999, -10.62473, 10.03545],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[1.557999, -8.006418, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_2b()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_3()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_3b()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[-5.227128, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[-5.227128, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-5.227128, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.596024, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.888025, -0.05978942, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_missle1()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-1.872952, 10.96362, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 10.96362, 10.04818],\r\n\t\t\t[-1.872952, 10.96362, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[-1.872952, 10.96362, 10.04818]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_missle2()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[4.134062, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[4.134062, 9.873108, 10.04818],\r\n\t\t\t[4.134062, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[4.134062, 9.873108, 10.04818]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_missle3() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, 10.64385, 10.04818]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild1() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-16.90716, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild2() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-15.44597, 22.54837, 2.7233],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[18.31425, 20.66701, 2.229968],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[18.31425, 20.66701, 2.229968],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[18.31425, 20.66701, 2.229968],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-15.44597, 22.54837, 2.7233],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-15.44597, 22.54837, 2.7233],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[-0.6231963, 18.23877, 12.029]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild3() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[-16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815],\r\n\t\t\t[816, 817, 818],\r\n\t\t\t[819, 820, 821],\r\n\t\t\t[822, 823, 824],\r\n\t\t\t[825, 826, 827],\r\n\t\t\t[828, 829, 830],\r\n\t\t\t[831, 832, 833],\r\n\t\t\t[834, 835, 836],\r\n\t\t\t[837, 838, 839],\r\n\t\t\t[840, 841, 842],\r\n\t\t\t[843, 844, 845],\r\n\t\t\t[846, 847, 848],\r\n\t\t\t[849, 850, 851],\r\n\t\t\t[852, 853, 854],\r\n\t\t\t[855, 856, 857],\r\n\t\t\t[858, 859, 860],\r\n\t\t\t[861, 862, 863],\r\n\t\t\t[864, 865, 866],\r\n\t\t\t[867, 868, 869],\r\n\t\t\t[870, 871, 872],\r\n\t\t\t[873, 874, 875],\r\n\t\t\t[876, 877, 878],\r\n\t\t\t[879, 880, 881],\r\n\t\t\t[882, 883, 884],\r\n\t\t\t[885, 886, 887],\r\n\t\t\t[888, 889, 890],\r\n\t\t\t[891, 892, 893],\r\n\t\t\t[894, 895, 896],\r\n\t\t\t[897, 898, 899],\r\n\t\t\t[900, 901, 902],\r\n\t\t\t[903, 904, 905],\r\n\t\t\t[906, 907, 908],\r\n\t\t\t[909, 910, 911],\r\n\t\t\t[912, 913, 914],\r\n\t\t\t[915, 916, 917],\r\n\t\t\t[918, 919, 920],\r\n\t\t\t[921, 922, 923],\r\n\t\t\t[924, 925, 926],\r\n\t\t\t[927, 928, 929],\r\n\t\t\t[930, 931, 932],\r\n\t\t\t[933, 934, 935],\r\n\t\t\t[936, 937, 938],\r\n\t\t\t[939, 940, 941],\r\n\t\t\t[942, 943, 944],\r\n\t\t\t[945, 946, 947],\r\n\t\t\t[948, 949, 950],\r\n\t\t\t[951, 952, 953],\r\n\t\t\t[954, 955, 956],\r\n\t\t\t[957, 958, 959],\r\n\t\t\t[960, 961, 962],\r\n\t\t\t[963, 964, 965],\r\n\t\t\t[966, 967, 968],\r\n\t\t\t[969, 970, 971],\r\n\t\t\t[972, 973, 974],\r\n\t\t\t[975, 976, 977],\r\n\t\t\t[978, 979, 980],\r\n\t\t\t[981, 982, 983],\r\n\t\t\t[984, 985, 986],\r\n\t\t\t[987, 988, 989],\r\n\t\t\t[990, 991, 992],\r\n\t\t\t[993, 994, 995],\r\n\t\t\t[996, 997, 998],\r\n\t\t\t[999, 1000, 1001],\r\n\t\t\t[1002, 1003, 1004],\r\n\t\t\t[1005, 1006, 1007],\r\n\t\t\t[1008, 1009, 1010],\r\n\t\t\t[1011, 1012, 1013],\r\n\t\t\t[1014, 1015, 1016],\r\n\t\t\t[1017, 1018, 1019],\r\n\t\t\t[1020, 1021, 1022],\r\n\t\t\t[1023, 1024, 1025],\r\n\t\t\t[1026, 1027, 1028],\r\n\t\t\t[1029, 1030, 1031],\r\n\t\t\t[1032, 1033, 1034],\r\n\t\t\t[1035, 1036, 1037],\r\n\t\t\t[1038, 1039, 1040],\r\n\t\t\t[1041, 1042, 1043],\r\n\t\t\t[1044, 1045, 1046],\r\n\t\t\t[1047, 1048, 1049],\r\n\t\t\t[1050, 1051, 1052],\r\n\t\t\t[1053, 1054, 1055],\r\n\t\t\t[1056, 1057, 1058],\r\n\t\t\t[1059, 1060, 1061],\r\n\t\t\t[1062, 1063, 1064],\r\n\t\t\t[1065, 1066, 1067],\r\n\t\t\t[1068, 1069, 1070],\r\n\t\t\t[1071, 1072, 1073],\r\n\t\t\t[1074, 1075, 1076],\r\n\t\t\t[1077, 1078, 1079],\r\n\t\t\t[1080, 1081, 1082],\r\n\t\t\t[1083, 1084, 1085],\r\n\t\t\t[1086, 1087, 1088],\r\n\t\t\t[1089, 1090, 1091]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild4() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815],\r\n\t\t\t[816, 817, 818],\r\n\t\t\t[819, 820, 821],\r\n\t\t\t[822, 823, 824],\r\n\t\t\t[825, 826, 827]\r\n\t\t]\r\n\t);\r\n}\r\n","old_contents":"\r\n\/\/ preview[view:south, tilt:top]\r\n\r\n\/* Mystery Ship *\/\r\nmysteryShipX = 80; \/\/ [5:120]\r\n\r\n\/* Invaders *\/\r\nfirstRowInvaderType = \"1b\"; \/\/ [1, 1b, 2, 2b, 3, 3b] \r\nsecondRowInvaderType = \"2b\"; \/\/ [1, 1b, 2, 2b, 3, 3b]\r\nthirdRowInvaderType = \"3\"; \/\/ [1, 1b, 2, 2b, 3, 3b]\r\n\r\nmissle1X = 28; \/\/ [5:120]\r\nmissle2X = 100; \/\/ [5:120]\r\n\r\n\/* Shields *\/\r\nshieldOneType = 1; \/\/ [1, 2, 3, 4]\r\nshieldTwoType = 2; \/\/ [1, 2, 3, 4]\r\nshieldThreeType = 3; \/\/ [1, 2, 3, 4]\r\nshieldFourType = 4; \/\/ [1, 2, 3, 4]\r\n\r\n\/* Player *\/\r\nplayerX = 60; \/\/ [5:120]\r\nplayerShotX = 62; \/\/ [5:120]\r\n\r\n\/* [Hidden] *\/\r\n\r\ncornerRadius = 8;\r\n\r\ninvaderColumns = 7;\r\n\r\nalienColors = [\"green\", \"purple\", \"blue\"];\r\n\r\nboardHeight = 1;\r\nboardLength = 130;\r\nboardSize = [boardLength, boardLength, boardHeight];\r\n\r\ninvaderScene(playerShotX = playerShotX);\r\n\r\n\/**\r\n * draws one row of invaders\r\n *\/\r\n module invaderRow(invaderType)\r\n {\r\n if( str(invaderType) == \"1\") \/\/ thingiverse customizer was treating this like a numeric value, so str() is used to overcome\r\n {\r\n \tinvaders_v2_1();\r\n }\r\n else if(invaderType == \"1b\")\r\n {\r\n \tinvaders_v2_1b();\r\n }\r\n else if(str(invaderType) == \"2\")\r\n {\r\n \tinvaders_v2_2();\r\n }\r\n else if(invaderType == \"2b\")\r\n {\r\n \tinvaders_v2_2b();\r\n }\r\n else if(str(invaderType) == \"3\")\r\n {\r\n \tinvaders_v2_3();\r\n }\r\n else if(invaderType == \"3b\")\r\n {\r\n \tinvaders_v2_3b();\r\n } \t\r\n }\r\n\r\n\/**\r\n * This module loops over rows and columns for the invaders.\r\n *\/\r\nmodule invaders()\r\n{\r\n columnSpacing = 18;\r\n columnLeftOffset = 9;\r\n for(r = [0 : 2])\r\n {\r\n color(alienColors[r])\r\n for ( c = [0 : invaderColumns-1] )\r\n {\r\n x = c * columnSpacing + columnLeftOffset;\r\n translate([x, boardLength - (r*15+24), 0])\r\n scale([0.5, 0.5, 0.5])\r\n if(r == 0)\r\n {\r\n \tinvaderRow(firstRowInvaderType);\r\n }\r\n else if(r == 1)\r\n {\r\n \tinvaderRow(secondRowInvaderType);\r\n }\r\n else if(r == 2)\r\n {\r\n \tinvaderRow(thirdRowInvaderType);\r\n } \r\n }\r\n }\r\n}\r\n\r\n\/**\r\n * This is the main method of the scipt. Call this to generate a Space Invader\r\n * scene.\r\n *\/\r\nmodule invaderScene(playerShotX)\r\n{\r\n union()\r\n {\r\n \/\/ background layer\r\n roundedCube(boardSize, cornerRadius, sides=20, sidesOnly=true);\r\n\r\n mysteryShip();\r\n\r\n invaders();\r\n \r\n missiles(playerShotX);\r\n\r\n shields();\r\n \r\n player();\r\n }\r\n}\r\n\r\n\/**\r\n * These are the missile shot by the \r\n * @return \r\n *\/\r\nmodule missiles(playerShotX)\r\n{ \r\n \/\/ invader missle 1\r\n color(\"blue\")\r\n translate([missle1X, 60, 0])\r\n scale([0.5, 0.5, 0.5])\r\n\tinvaders_v2_missle1();\r\n \r\n \/\/ invader missle 2\r\n color(\"purple\")\r\n translate([missle2X, 40, 0])\r\n scale([0.5, 0.5, 0.5])\r\n invaders_v2_missle2(); \r\n\r\n\t\/\/ player missle \r\n color(\"green\") \r\n translate([playerShotX, 40, 0])\r\n scale([0.5, 0.5, 0.5])\r\n\tinvaders_v2_missle3();\r\n}\r\n\r\n\/**\r\n * This module adds the mystery ship at the top of the screen.\r\n * \r\n * originally invaders_v2_ship.stl \r\n *\/\r\nmodule mysteryShip()\r\n{\t\r\n x = mysteryShipX;\r\n y = boardLength - 5;\r\n z = 0;\r\n \r\n color(\"orange\")\r\n translate([x, y, z])\r\n scale([0.5, 0.5, 0.5])\r\n invaders_v2_ship();\r\n}\r\n\r\nmodule oneShield(shieldType)\r\n{\r\n\tif(shieldType == 1)\r\n\t{\r\n\t\tinvaders_v2_sheild1();\r\n\t}\r\n\telse if(shieldType == 2)\r\n\t{\r\n\t\tinvaders_v2_sheild2();\r\n\t}\r\n\telse if( shieldType ==3)\r\n\t{\r\n\t\tinvaders_v2_sheild3();\r\n\t}\r\n\telse if(shieldType == 4)\r\n\t{\r\n\t\tinvaders_v2_sheild4();\t\t\r\n\t}\r\n}\r\n\r\n\/**\r\n * originally invaders_v2_canon.stl \r\n *\/\r\nmodule player()\r\n{\r\n color(\"green\")\r\n translate([playerX, 0, 0])\r\n scale([0.5, 0.5, 0.5])\r\n invaders_v2_canon();\r\n}\r\n\r\nmodule shields()\r\n{\r\n for(c = [0:3])\r\n {\r\n columnLeftOffset = 10;\r\n columnSpacing = 35;\r\n \r\n x = c * columnSpacing + columnLeftOffset;\r\n y = boardLength * 0.15;\r\n \r\n color(\"brown\")\r\n translate([x, y, 0])\r\n scale([0.5, 0.5, 0.5])\r\n if(c == 0)\r\n {\r\n \toneShield(shieldOneType);\r\n }\r\n else if(c == 1)\r\n {\r\n \toneShield(shieldTwoType);\r\n }\r\n else if(c == 2)\r\n {\r\n \toneShield(shieldThreeType);\r\n }\r\n else if(c == 3)\r\n {\r\n \toneShield(shieldFourType);\r\n }\r\n }\r\n}\r\n\r\n\/\/ Below are modules borrowed from other parts of this project. They are copied here the Thingiverse Customizer only works with\r\n\/\/ one file with no importing or 'use' keywords.\r\n\/**\r\n * originally use <..\/..\/basics\/rounded-cube.scad> \r\n * makes a rounded cube\r\n *\/\r\nmodule roundedCube(size, cornerRadius, sides=30, sidesOnly=false)\r\n{\r\n\t$fn=sides;\r\n\t\r\n\tx = size[0] - cornerRadius\/2;\r\n\ty = size[1] - cornerRadius\/2;\r\n\tz = size[2];\r\n\t\r\n\tminkowski(size, cornerRadius)\r\n\t{\r\n\t cube(size=[x,y,z]);\r\n\t \r\n\t if(sidesOnly)\r\n\t {\r\n\t \tcylinder(r=cornerRadius);\r\n\t }\r\n\t else\r\n\t {\r\n\t \tsphere(r=cornerRadius);\r\n\t \t\r\n \t}\r\n\t}\t\r\n}\r\n \r\n\r\n\/\/ below are .stl files converted to OpenSCAD code\r\nmodule invaders_v2_canon() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[17.32853, -10.57798, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-1.387962, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 7.844114, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-4.079773, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, 2.544603, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-14.67878, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -0.1051502, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 10.03544],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[-17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[0.0, -10.57798, 1.332268e-15],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[-1.387962, 10.57798, 0.0],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[0.0, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 10.57798, 0.0],\r\n\t\t\t[-1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 10.57798, 0.0],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 10.57798, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[1.387962, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[1.387962, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 7.844114, 2.220446e-16],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 7.844114, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[4.079773, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[4.079773, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[14.67878, 2.544603, 4.440892e-16],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, 2.544603, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[14.67878, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[14.67878, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -0.1051502, 6.661338e-16],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -10.57798, 1.332268e-15],\r\n\t\t\t[17.32853, -0.1051502, 10.03544],\r\n\t\t\t[17.32853, -10.57798, 10.03544]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_ship() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-2.661523, -6.549835, 10.03545],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, -1.273861, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-5.355711, 1.391655, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[-2.701987, 1.391655, 10.03545],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[-2.703086, -1.273861, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 5.125999e-06],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-5.355711, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[-5.355711, 1.391655, 1.037121e-05],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[-2.701985, 1.391655, 0.0],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[-7.942975, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[9.536743e-07, 9.252937, 5.125999e-06],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[-9.536743e-07, 9.252937, 10.03545],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[-7.942975, 9.252937, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-7.942975, 9.252937, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-7.942975, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 6.591419, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-13.26601, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 3.929897, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 5.125999e-06],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-15.88595, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 0.0],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, 1.226791, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-18.58906, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 2.220446e-16],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -1.434727, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 2.220446e-16],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-21.1674, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -3.929901, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-15.92753, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -6.633011, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-13.18284, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -9.252937, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-10.68767, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -6.549835, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-7.942975, -3.929901, 10.03545],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.661521, -3.929901, 5.125999e-06],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.661523, -3.929901, 10.03545],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-2.661523, -6.549835, 10.03545],\r\n\t\t\t[-2.661523, -6.549835, 10.03545],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[-2.661521, -6.549835, 5.125999e-06],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[-9.536743e-07, -6.549835, 10.03545],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[9.536743e-07, -6.549835, 5.125999e-06],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-10.66256, 1.391655, 0.0],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-10.66256, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-10.66366, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[-10.66366, -1.273861, 10.03545],\r\n\t\t\t[-13.31628, 1.391655, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, -1.273861, 1.037121e-05],\r\n\t\t\t[-13.31628, 1.391655, 10.03545],\r\n\t\t\t[-13.31628, -1.273861, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, -1.273861, 1.549721e-05],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[5.355711, 1.391655, 10.03546],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[5.355711, 1.391655, 1.549721e-05],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.701985, 1.391655, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.701985, 1.391655, 0.0],\r\n\t\t\t[2.703084, -1.273861, 10.03545],\r\n\t\t\t[2.703084, -1.273861, 1.037121e-05],\r\n\t\t\t[7.942974, 9.252937, 1.037121e-05],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 9.252937, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[7.942974, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[7.942974, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 6.591419, 1.037121e-05],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 6.591419, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[13.26602, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[13.26602, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 3.929897, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 3.929897, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[15.88595, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[15.88595, 1.226791, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[18.58906, 1.226791, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, 1.226791, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[18.58906, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[18.58906, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -1.434727, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -1.434727, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[21.1674, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[21.1674, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -3.929901, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -3.929901, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[15.92754, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[15.92754, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -6.633011, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -6.633011, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[13.18284, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[13.18284, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -9.252937, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -9.252937, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[10.68767, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[10.68767, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -6.549835, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -6.549835, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[7.942974, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[7.942974, -3.929901, 10.03546],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -3.929901, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -6.549835, 1.037121e-05],\r\n\t\t\t[2.661521, -3.929901, 10.03545],\r\n\t\t\t[2.661521, -6.549835, 10.03545],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[10.66256, 1.391655, 5.125999e-06],\r\n\t\t\t[10.66256, 1.391655, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 10.03546],\r\n\t\t\t[10.66366, -1.273861, 1.549721e-05],\r\n\t\t\t[10.66366, -1.273861, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.31628, 1.391655, 10.03546],\r\n\t\t\t[13.31628, -1.273861, 1.549721e-05],\r\n\t\t\t[13.31628, -1.273861, 10.03546]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_1() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -5.281656, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[5.038818, 7.952849, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[7.740364, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[10.35083, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[10.35083, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[10.38119, -5.281656, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.770708, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[5.129888, -10.62404, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[5.129888, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[5.099529, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[2.458701, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[3.308058e-06, -5.281656, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -5.736979, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.129888, -7.588597, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-5.129888, -10.62404, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.770716, -10.62403, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-10.38119, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-7.770716, -7.922484, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-7.75174, -7.588589, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-10.38119, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.75174, -5.736971, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-7.745432, -5.281649, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-10.35084, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-10.35084, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.740365, 5.281678, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.038819, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-2.397991, 10.62404, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[3.308058e-06, 10.62404, 5.245209e-06],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-7.745432, -2.610469, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[7.770708, -7.922492, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[7.751732, -7.588597, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[10.38119, -7.922492, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.751732, -5.736979, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[7.745431, -5.281656, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[7.745431, -2.610477, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[7.740364, 2.671186, 1.049042e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 2.710617, 1.573563e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[5.038818, 5.28167, 1.049042e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[5.099529, -2.67118, 1.049042e-05],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[5.080359, 0.0450995, 1.573563e-05],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.458701, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[-2.397991, 7.952849, 5.245209e-06],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-7.740365, 2.671194, 5.245209e-06],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.099529, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-5.08036, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.458702, -2.67118, 5.245209e-06],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-2.427733, 0.0450995, 1.049042e-05],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[2.426633, 2.710617, 0.0],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[-2.426634, 2.710617, 0.0],\r\n\t\t\t[-5.08036, 2.710617, 1.049042e-05],\r\n\t\t\t[-5.038819, 5.28167, 5.245209e-06],\r\n\t\t\t[2.458701, -5.281656, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[5.099529, -5.736979, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.129888, -7.588597, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[5.129888, -10.62404, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.770708, -10.62404, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[10.38119, -7.922492, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[7.770708, -7.922492, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[7.751732, -7.588597, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[10.38119, -5.281656, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[7.751732, -5.736979, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[7.745431, -5.281656, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[10.35083, -2.610477, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[10.35083, 2.671186, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.740364, 5.28167, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.038818, 7.952849, 10.03546],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.397991, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[3.308058e-06, 10.62404, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-7.740365, 5.281678, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-10.35084, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-10.35084, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-10.38119, -5.281649, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.770716, -10.62403, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-5.129888, -10.62404, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-5.129888, -7.588597, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-5.099529, -5.736979, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-2.458702, -5.281656, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[3.308058e-06, -5.281656, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[7.745431, -2.610477, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[-7.770716, -7.922484, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.75174, -7.588589, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-10.38119, -7.922484, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.75174, -5.736971, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-7.745432, -5.281649, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-7.745432, -2.610469, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[7.740364, 2.671186, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.099529, -2.67118, 10.03546],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[5.080359, 0.0450995, 10.03546],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.458701, -2.67118, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[5.080359, 2.710617, 10.03546],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[5.038818, 5.28167, 10.03546],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[2.397991, 7.952849, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-2.397991, 7.952849, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-7.740365, 2.671194, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-5.08036, 2.710617, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-5.038819, 5.28167, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-5.099529, -2.67118, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-5.08036, 0.0450995, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.458702, -2.67118, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545],\r\n\t\t\t[2.426633, 2.710617, 10.03545],\r\n\t\t\t[-2.426634, 2.710617, 10.03545],\r\n\t\t\t[-2.427733, 0.0450995, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_1b()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -5.274351, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-5.348595, -7.939871, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.695971, -7.939871, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694871, -5.274351, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.348595, -5.274351, 1.037121e-05],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-5.348595, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.695969, -7.939871, 1.037121e-05],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.694869, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[-2.58908, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[-2.58908, 10.61154, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 10.61154, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-2.58908, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 7.883512, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-5.3171, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 5.247969, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-7.906407, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, 2.612425, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-10.58819, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -2.612421, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-5.270863, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -4.921896, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-7.906407, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -7.929758, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-10.58819, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -10.5653, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-7.943222, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -8.276869, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-5.409575, -10.61154, 10.03545],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681555, -10.61154, 5.125999e-06],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681557, -10.61154, 10.03545],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-2.681557, -8.251883, 10.03545],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-2.681555, -8.251883, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[-1.66893e-06, -8.251883, 5.125999e-06],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-2.635319, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-2.63532, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.694869, 2.75543, 0.0],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-2.694871, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-2.695969, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[-2.695971, 0.08991051, 10.03545],\r\n\t\t\t[-5.348595, 2.75543, 1.037121e-05],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 0.08991051, 1.037121e-05],\r\n\t\t\t[-5.348595, 2.75543, 10.03545],\r\n\t\t\t[-5.348595, 0.08991051, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -7.939871, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -7.939871, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 10.03546],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[5.348594, -5.274351, 1.549721e-05],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.694868, -5.274351, 6.661338e-16],\r\n\t\t\t[2.695968, -7.939871, 10.03545],\r\n\t\t\t[2.695968, -7.939871, 1.037121e-05],\r\n\t\t\t[2.58908, 10.61154, 1.037121e-05],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 10.61154, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[2.58908, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[2.58908, 7.883512, 10.03545],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[5.317099, 7.883512, 1.037121e-05],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 7.883512, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[5.317099, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[5.317099, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 5.247969, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 5.247969, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[7.906405, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[7.906405, 2.612425, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[10.58819, 2.612425, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, 2.612425, 10.03546],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[10.58819, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[10.58819, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -2.612421, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -2.612421, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[5.270862, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[5.270862, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -4.921896, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -4.921896, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[7.906405, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[7.906405, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -7.929758, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -7.929758, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[10.58819, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[10.58819, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -10.5653, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -10.5653, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[7.943221, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[7.943221, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -8.276869, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -8.276869, 10.03546],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[5.409574, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[5.409574, -10.61154, 10.03546],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[2.681553, -10.61154, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.681553, -8.251883, 1.037121e-05],\r\n\t\t\t[2.681553, -10.61154, 10.03545],\r\n\t\t\t[2.681553, -8.251883, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[-1.66893e-06, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.635319, -4.932856, 5.125999e-06],\r\n\t\t\t[-2.63532, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -4.932856, 1.037121e-05],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.635317, -4.932856, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[2.635317, -2.56772, 1.037121e-05],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[-1.66893e-06, -2.56772, 5.125999e-06],\r\n\t\t\t[2.635317, -2.56772, 10.03545],\r\n\t\t\t[-1.66893e-06, -2.56772, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[2.694868, 2.75543, 0.0],\r\n\t\t\t[2.694868, 2.75543, 10.03545],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 10.03546],\r\n\t\t\t[2.695968, 0.08991051, 1.037121e-05],\r\n\t\t\t[2.695968, 0.08991051, 10.03545],\r\n\t\t\t[5.348594, 2.75543, 1.549721e-05],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.348594, 2.75543, 10.03546],\r\n\t\t\t[5.348594, 0.08991051, 1.549721e-05],\r\n\t\t\t[5.348594, 0.08991051, 10.03546]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_2() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[1.557999, -8.006418, 5.245209e-06],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[1.557999, -10.62473, 10.03545],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[4.19796, 7.919868, 5.245209e-06],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[6.238686, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[9.477867, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[9.477867, 10.62473, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[7.09758, 7.984783, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[6.238686, 7.919868, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[9.477867, 5.279907, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[12.16109, 2.639957, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[14.77941, -0.04327393, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.18273, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[14.77941, -7.919863, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.18273, -2.618313, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[12.16109, -0.04327393, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.456219, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[6.881191, -10.62473, 1.037121e-05],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[1.557999, -8.006418, 5.245209e-06],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[5.636776, -8.006418, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[6.881191, -7.9415, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[-1.557995, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-6.881184, -10.62473, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-5.636768, -8.006418, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-9.456219, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-6.881184, -7.9415, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-12.18273, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-14.77941, -7.919863, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-14.77941, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.18273, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-12.16109, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-12.16109, -0.04327393, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.477863, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-9.477863, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-9.477863, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-6.238689, 10.62473, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-7.097576, 7.984783, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-6.238689, 7.919868, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[9.456219, -2.618313, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[9.477867, 2.639957, 1.037121e-05],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[6.848053, 0.02210236, 1.561642e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[5.636776, -5.258268, 1.037121e-05],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[7.09758, 5.279907, 1.037121e-05],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[6.848053, 2.68762, 1.561642e-05],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[4.19796, 5.279907, 5.245209e-06],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[4.194332, 2.68762, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[4.195435, 0.02210236, 1.561642e-05],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-5.636768, -5.258268, 5.245209e-06],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-9.456219, -2.618313, 5.245209e-06],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-6.848057, 0.02210236, 1.037121e-05],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-9.477863, 2.639957, 5.245209e-06],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-7.097576, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-6.848057, 2.68762, 1.037121e-05],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-4.197956, 5.279907, 5.245209e-06],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[-3.814697e-06, -5.258268, 5.245209e-06],\r\n\t\t\t[-4.195431, 0.02210236, 1.037121e-05],\r\n\t\t\t[-4.194324, 2.68762, 0.0],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[1.557999, -10.62473, 10.03545],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[1.557999, -10.62473, 10.03545],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[6.881191, -10.62473, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[5.636776, -8.006418, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[9.456219, -7.9415, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[6.881191, -7.9415, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[12.18273, -7.919863, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[14.77941, -7.919863, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[14.77941, -0.04327393, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[12.18273, -2.618313, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[12.16109, 2.639957, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[12.16109, -0.04327393, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.477867, 5.279907, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[9.477867, 7.984783, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[9.477867, 10.62473, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[6.238686, 10.62473, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[7.09758, 7.984783, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[6.238686, 7.919868, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[-4.197956, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-6.238689, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-9.477863, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-9.477863, 10.62473, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-7.097576, 7.984783, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-6.238689, 7.919868, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 5.279907, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-12.16109, 2.639957, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-14.77941, -0.04327393, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.18273, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-14.77941, -7.919863, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.18273, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-12.16109, -0.04327393, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-9.456219, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-6.881184, -10.62473, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-5.636768, -8.006418, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-6.881184, -7.9415, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[9.456219, -2.618313, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[9.477867, 2.639957, 10.03546],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[5.636776, -5.258268, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[7.09758, 5.279907, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[6.848053, 2.68762, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.19796, 5.279907, 10.03546],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[4.194332, 2.68762, 10.03546],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[4.195435, 0.02210236, 10.03546],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-3.814697e-06, 5.279907, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-5.636768, -5.258268, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-4.195431, 0.02210236, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-9.456219, -2.618313, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-6.848057, 0.02210236, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-9.477863, 2.639957, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-7.097576, 5.279907, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-6.848057, 2.68762, 10.03545],\r\n\t\t\t[-4.194324, 2.68762, 10.03545],\r\n\t\t\t[-4.197956, 5.279907, 10.03545],\r\n\t\t\t[-1.557995, -8.006418, 5.245209e-06],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -10.62473, 5.245209e-06],\r\n\t\t\t[-1.557995, -8.006418, 10.03545],\r\n\t\t\t[-1.557995, -10.62473, 10.03545],\r\n\t\t\t[1.557999, -8.006418, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[1.557999, -8.006418, 10.03545],\r\n\t\t\t[1.557999, -10.62473, 5.245209e-06],\r\n\t\t\t[1.557999, -10.62473, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_2b()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.544758, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[5.482523, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[8.765716, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[8.765716, 10.62053, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[6.512461, 7.927623, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[5.482523, 7.872661, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[8.765716, 5.152268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[11.54107, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[14.09659, 7.872661, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[14.09659, -2.651692, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.54107, 2.569268, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[11.40367, -5.289653, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[11.43115, -7.982572, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.848153, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[11.43115, -10.62053, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.848153, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[6.210193, -8.740329, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[8.793196, -7.982572, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[-6.210196, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-8.848155, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-11.43115, -10.62053, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-11.43115, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.848155, -8.740329, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-8.793198, -7.982572, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-11.40368, -5.289653, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-14.09659, -2.651692, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.54107, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-14.09659, 7.872661, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-11.54107, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-8.765718, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.765718, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-8.765718, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-5.482523, 10.62053, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-6.512463, 7.927623, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-3.544758, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-5.482523, 7.872661, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[11.40367, -2.651692, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.793196, -5.289653, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[8.765716, 2.569268, 1.037121e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.512461, 5.152268, 1.037121e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[6.15315, 2.644155, 1.549721e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[3.544758, 5.234704, 1.037121e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[6.210193, -5.317132, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[6.15315, -0.02136326, 1.549721e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[-11.40368, -2.651692, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.793198, -5.289653, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-8.765718, 2.569268, 5.125999e-06],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.512463, 5.152268, 5.125999e-06],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-6.153152, 2.644155, 1.037121e-05],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-6.210196, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-6.153152, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, -5.317132, 5.125999e-06],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[3.500523, -0.02136326, 1.549721e-05],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[3.499424, 2.644155, 5.125999e-06],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.500525, -0.02136326, 1.037121e-05],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-1.907349e-06, 5.234704, 5.125999e-06],\r\n\t\t\t[-3.499426, 2.644155, 0.0],\r\n\t\t\t[-3.544758, 5.234704, 5.125999e-06],\r\n\t\t\t[6.210193, -8.740329, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.848153, -10.62053, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[11.43115, -10.62053, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[11.43115, -7.982572, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[8.848153, -8.740329, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.793196, -7.982572, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[11.40367, -5.289653, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[14.09659, -2.651692, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.54107, 7.872661, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[14.09659, 7.872661, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[11.54107, 2.569268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[8.765716, 5.152268, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[8.765716, 7.927623, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[8.765716, 10.62053, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[5.482523, 10.62053, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[6.512461, 7.927623, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[3.544758, 7.872661, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[5.482523, 7.872661, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[-3.544758, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-5.482523, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-8.765718, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-8.765718, 10.62053, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-6.512463, 7.927623, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-5.482523, 7.872661, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-8.765718, 5.152268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-11.54107, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-14.09659, 7.872661, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-14.09659, -2.651692, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.54107, 2.569268, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-11.40368, -5.289653, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-11.43115, -7.982572, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.848155, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-11.43115, -10.62053, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.848155, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-6.210196, -8.740329, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-8.793198, -7.982572, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[11.40367, -2.651692, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.793196, -5.289653, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[8.765716, 2.569268, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.512461, 5.152268, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[6.15315, 2.644155, 10.03546],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[6.210193, -5.317132, 10.03546],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[6.15315, -0.02136326, 10.03546],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[3.544758, 5.234704, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[-11.40368, -2.651692, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-8.793198, -5.289653, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-8.765718, 2.569268, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-6.512463, 5.152268, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-6.153152, 2.644155, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.544758, 5.234704, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-6.210196, -5.317132, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-6.153152, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, -5.317132, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[3.500523, -0.02136326, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[3.499424, 2.644155, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545],\r\n\t\t\t[-1.907349e-06, 5.234704, 10.03545],\r\n\t\t\t[-3.499426, 2.644155, 10.03545],\r\n\t\t\t[-3.500525, -0.02136326, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_3()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[-12.96432, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-15.62921, 5.239746, 10.03544],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-15.62921, -2.610869, 10.03544],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-12.96432, 5.239746, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-12.96432, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-12.96432, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.29943, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-5.113695, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-5.113695, -10.60553, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-10.29943, -7.976657, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-7.778589, -8.012669, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-10.26342, -5.455817, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-2.448809, -8.012669, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[5.722046e-06, -8.012669, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -4.921153, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[5.722046e-06, -4.921153, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[2.41197, -2.378253, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-7.710535, 2.458877, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-5.005663, 7.904635, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[-2.380884, 2.5329, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[5.722046e-06, -2.378253, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.380884, -0.1319245, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-10.26342, -2.610869, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-7.710535, -0.1319245, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-2.448809, -5.275758, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[-2.411966, -4.921153, 10.03545],\r\n\t\t\t[-2.411966, -2.378253, 10.03545],\r\n\t\t\t[-7.778589, -5.275758, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[5.722046e-06, -8.012669, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[-5.113695, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-5.113695, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-10.29943, -10.60553, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-7.778589, -8.012669, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-12.96432, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-12.96432, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.29943, -7.976657, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-10.26342, -5.455817, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-15.62921, -2.610869, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-15.62921, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-12.96432, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-12.96432, 5.239746, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[2.41197, -4.921153, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[5.722046e-06, -4.921153, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[2.41197, -2.378253, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.710535, 2.458877, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-5.005663, 7.904635, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[-2.380884, 2.5329, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[5.722046e-06, -2.378251, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.380884, -0.1319245, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-10.26342, -2.610869, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-7.710535, -0.1319245, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-2.448809, -5.275758, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-2.411966, -2.378253, 0.0],\r\n\t\t\t[-2.411966, -4.921153, 0.0],\r\n\t\t\t[-7.778589, -5.275758, 0.0],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[5.722046e-06, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 0.0],\r\n\t\t\t[-5.005663, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 10.60553, 4.768372e-06],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 10.60553, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[5.005667, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[5.005667, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 7.904634, 4.768372e-06],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 7.904634, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[12.96432, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[12.96432, 5.239745, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[15.62921, 5.239745, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, 5.239745, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[15.62921, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[15.62921, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -2.610871, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -2.610871, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[10.26341, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[10.26341, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -5.455819, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[12.96432, -5.455819, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[12.96432, -7.976659, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[12.96432, -7.976659, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -7.976657, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -7.976657, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[10.29942, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[10.29942, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -10.60553, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -10.60553, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[5.113699, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[5.113699, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -8.012671, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.778585, -8.012671, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[7.778585, -5.275758, 4.768372e-06],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[7.778585, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -5.275758, 0.0],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[2.448812, -8.012669, 0.0],\r\n\t\t\t[2.448812, -5.275758, 10.03545],\r\n\t\t\t[2.448812, -8.012669, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[7.710527, 2.458877, 4.768372e-06],\r\n\t\t\t[7.710527, 2.458877, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, 2.5329, 0.0],\r\n\t\t\t[2.380888, 2.5329, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 4.768372e-06],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[7.710527, -0.1319255, 10.03545],\r\n\t\t\t[2.380888, -0.1319255, 0.0],\r\n\t\t\t[2.380888, -0.1319255, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_3b()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[-5.227128, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[-5.227128, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[-5.227128, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[-13.1906, 7.858232, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-15.85679, 5.227129, 10.03544],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-15.85679, -2.631102, 10.03544],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-10.52441, -5.437615, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-15.85679, -7.963471, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.62966, -10.5595, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-15.85679, -10.5595, 10.03544],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.62966, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-10.52441, -7.963473, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-7.823151, -5.437615, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[-2.384186e-06, 10.5595, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[-5.227128, 7.858232, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, 2.606297, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[2.579451, -5.014457, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.384186e-06, -5.014457, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[2.579451, -2.371966, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.384186e-06, -2.38338, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.626643, -0.05978751, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-2.579455, -5.014457, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-2.579455, -2.371966, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-5.297291, -5.297288, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.823151, -2.631102, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-7.888027, -0.05978751, 10.03545],\r\n\t\t\t[-7.888027, 2.606297, 10.03545],\r\n\t\t\t[-13.1906, 5.227129, 10.03545],\r\n\t\t\t[-5.297291, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-10.62966, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-15.85679, -10.5595, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-15.85679, -7.963471, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.62966, -8.489693, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-10.52441, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-10.52441, -7.963473, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-7.823151, -5.437615, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-15.85679, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-15.85679, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-13.1906, 7.858232, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-5.227128, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.596024, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 10.03545],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-5.227128, 7.858232, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.384186e-06, 10.5595, 5.125999e-06],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[-2.626641, 2.606297, 0.0],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-7.888027, 2.606297, 0.0],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-13.1906, 5.227129, 5.125999e-06],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.888027, -0.05978751, 0.0],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-7.823151, -2.631102, 5.125999e-06],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-5.297291, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.596024, -5.297288, 5.125999e-06],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.579453, -5.014457, 4.440892e-16],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.384186e-06, -5.014457, 5.125999e-06],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[-2.626641, -0.05978751, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[-2.579453, -2.371966, 2.220446e-16],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -2.38338, 5.125999e-06],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[2.579451, -5.014457, 4.440892e-16],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[2.579451, -2.371966, 2.220446e-16],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[5.227125, 10.5595, 1.037121e-05],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 10.5595, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[5.227125, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[5.227125, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 7.858231, 1.037121e-05],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 7.858231, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[13.1906, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[13.1906, 5.227127, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[15.85679, 5.227127, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[15.85679, 5.227127, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[15.85679, -2.631104, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[15.85679, -2.631104, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -2.631102, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -2.631102, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[7.823148, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[7.823148, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -5.437615, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -5.437615, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[10.52441, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[10.52441, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -7.963475, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -7.963475, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[15.85679, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[15.85679, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -10.5595, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -10.5595, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[10.62966, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[10.62966, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -8.489693, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -8.489693, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[5.297288, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[5.297288, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -5.297288, 1.037121e-05],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[2.596023, -5.297288, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[2.596023, -7.963475, 1.037121e-05],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[2.596023, -7.963475, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[-2.384186e-06, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 10.03545],\r\n\t\t\t[-2.596024, -7.963473, 5.125999e-06],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[2.626638, 2.606296, 0.0],\r\n\t\t\t[2.626638, 2.606296, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 10.03545],\r\n\t\t\t[2.626638, -0.05978751, 0.0],\r\n\t\t\t[2.626638, -0.05978751, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 5.125999e-06],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, 2.606296, 10.03545],\r\n\t\t\t[7.888025, -0.05978942, 5.125999e-06],\r\n\t\t\t[7.888025, -0.05978942, 10.03545]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_missle1()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-1.872952, 10.96362, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 10.96362, 10.04818],\r\n\t\t\t[-1.872952, 10.96362, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-1.872952, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 2.220446e-16],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 5.024995, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-4.979313, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 4.440892e-16],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, 1.370454, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 8.881784e-16],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-1.781582, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 8.881784e-16],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -4.294086, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-5.070675, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 1.110223e-15],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -7.674536, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 1.332268e-15],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[-1.964314, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 1.332268e-15],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -10.96362, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[5.070675, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 8.881784e-16],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -6.760901, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 6.661338e-16],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[2.055683, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 6.661338e-16],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, -1.461816, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[5.070675, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 4.440892e-16],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 2.284089, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 0.0],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[1.507504, 10.87226, 10.04818],\r\n\t\t\t[-1.872952, 10.96362, 0.0],\r\n\t\t\t[-1.872952, 10.96362, 10.04818]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_missle2()\r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[4.134062, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[4.134062, 9.873108, 10.04818],\r\n\t\t\t[4.134062, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 0.0],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 9.873108, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[1.118631, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 0.0],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 7.246761, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 2.220446e-16],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-1.896803, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 2.220446e-16],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 4.814964, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-4.620417, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 4.440892e-16],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, 1.118629, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[-2.480433, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -1.410446, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 6.661338e-16],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[0.7295437, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 6.661338e-16],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -3.550426, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 8.881784e-16],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-1.896803, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 8.881784e-16],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -6.176769, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-4.814962, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 1.110223e-15],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -9.873108, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[-1.313169, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -7.344036, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 8.881784e-16],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[1.799536, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 8.881784e-16],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -4.814964, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[4.814962, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 6.661338e-16],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[2.577711, -1.118626, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[2.577711, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 4.440892e-16],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 1.604988, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[-0.2431774, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 3.744972, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 2.220446e-16],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[1.994078, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 2.220446e-16],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 5.982227, 10.04818],\r\n\t\t\t[4.134062, 9.873108, 0.0],\r\n\t\t\t[4.134062, 9.873108, 10.04818]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_missle3() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[-1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 1.110223e-15],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, -10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[1.735909, 10.64385, 10.04818],\r\n\t\t\t[-1.735909, 10.64385, 0.0],\r\n\t\t\t[-1.735909, 10.64385, 10.04818]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild1() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-16.90716, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 18.53771, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-19.57126, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 15.7996, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-22.23536, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 13.1355, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-24.89947, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, 10.3974, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-27.56356, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -21.12781, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-14.39106, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -15.7996, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-11.57896, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -13.13549, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[-8.840849, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-11.57896, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-14.39106, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-14.39106, -15.7996, 2.220446e-15],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-11.57896, -13.13549, 1.998401e-15],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-24.89947, 13.1355, 4.440892e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-22.23536, 15.7996, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-19.57126, 18.53771, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-16.90716, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[-24.89947, 10.3974, 6.661338e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[-22.23536, 13.1355, 4.440892e-16],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-5.722046e-06, -10.39739, 1.998401e-15],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[-8.840849, -10.39739, 1.998401e-15],\r\n\t\t\t[-19.57126, 15.7996, 2.220446e-16],\r\n\t\t\t[-16.90716, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[-5.722046e-06, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 21.12781, 0.0],\r\n\t\t\t[-16.90716, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 21.12781, 0.0],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 21.12781, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[16.90715, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[16.90715, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 18.53771, 2.220446e-16],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 18.53771, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[19.57125, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[19.57125, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 15.7996, 2.220446e-16],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 15.7996, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[22.23535, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[22.23535, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 13.1355, 4.440892e-16],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 13.1355, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[24.89946, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[24.89946, 10.3974, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[27.56356, 10.3974, 6.661338e-16],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, 10.3974, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[27.56356, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[27.56356, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -21.12781, 2.442491e-15],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -21.12781, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[14.39105, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[14.39105, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -15.7996, 2.220446e-15],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -15.7996, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[11.57895, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[11.57895, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -13.13549, 1.998401e-15],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -10.39739, 1.998401e-15],\r\n\t\t\t[8.840845, -13.13549, 10.03544],\r\n\t\t\t[8.840845, -10.39739, 10.03544]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild2() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-15.44597, 22.54837, 2.7233],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[18.31425, 20.66701, 2.229968],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[18.31425, 20.66701, 2.229968],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[-3.214152, 18.85932, 2.394501],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[-3.037051, 21.85686, 2.54197],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[18.31425, 20.66701, 2.229968],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[20.8283, 17.93577, 2.063941],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[23.334, 15.05694, 1.890649],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[25.84387, 12.25191, 1.72099],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[28.34957, 9.37307, 1.547698],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[26.57495, -22.06584, 0.0],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[13.42352, -21.33295, 0.1921795],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[10.91586, -15.86287, 0.4947891],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[13.72346, -16.01933, 0.4537621],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[8.332091, -13.05371, 0.6655284],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[11.06582, -13.20605, 0.6255808],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-15.44597, 22.54837, 2.7233],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-11.45013, 22.3257, 2.664909],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-11.62358, 19.25276, 2.513634],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-14.31902, 16.84628, 2.425452],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-14.17515, 19.39495, 2.55092],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-14.54639, 14.15187, 2.2937],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-13.72389, 14.60252, 2.306454],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-13.62066, 16.43138, 2.396487],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-11.0214, 16.28653, 2.358504],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-8.948092, 14.63717, 2.251675],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-6.701323, 13.09619, 2.148201],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-3.849568, 12.93727, 2.106529],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-3.426824, 13.75779, 2.142467],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-3.295654, 16.08158, 2.256864],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[25.68973, 9.521295, 1.586566],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-17.02069, 16.99684, 2.464931],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-17.17302, 14.29824, 2.332083],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-14.69026, 11.6032, 2.168232],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-11.1077, 14.75752, 2.283233],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-11.96799, 14.50467, 2.280796],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-12.13979, 11.46107, 2.130963],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-9.128356, 11.44365, 2.094462],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-6.801921, 11.314, 2.060466],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-3.95863, 11.00515, 2.011413],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[23.18403, 12.40013, 1.759858],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[20.67416, 15.20516, 1.929517],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-1.332004, 10.85878, 1.973031],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-1.175446, 13.63233, 2.109569],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-0.8941798, 15.94775, 2.221773],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-0.737622, 18.72131, 2.358312],\r\n\t\t\t[1.434143, 21.60769, 2.476634],\r\n\t\t\t[18.16845, 18.084, 2.102809],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-0.340478, -9.831216, 0.9289358],\r\n\t\t\t[8.486225, -10.3231, 0.7999527],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-9.167189, -9.339328, 1.057919],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-9.321322, -12.06993, 0.9234946],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-12.05505, -11.91759, 0.9634421],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-12.20502, -14.57441, 0.8326504],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-15.01262, -14.41795, 0.8736775],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-15.31256, -19.73156, 0.6120948],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-28.46399, -18.99867, 0.8042744],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-26.68937, 12.44024, 2.351972],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-24.02953, 12.29201, 2.313105],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-23.8754, 15.02262, 2.447529],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-21.21556, 14.8744, 2.408661],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-21.06559, 17.53121, 2.539453],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-18.40575, 17.38298, 2.500585],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-18.25162, 20.11359, 2.635009],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-15.44597, 22.54837, 2.7233],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.59177, 19.96537, 2.596142],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-11.50916, 18.77022, 12.18432],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-11.3357, 21.84316, 12.33559],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-15.33155, 22.06584, 12.39399],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-18.13719, 19.63106, 12.3057],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-20.95117, 17.04867, 12.21014],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-23.76097, 14.54009, 12.11821],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-26.57495, 11.95771, 12.02266],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-28.34957, -19.4812, 10.47496],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-15.19813, -20.2141, 10.28278],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-12.09059, -15.05694, 10.50334],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-14.8982, -14.90048, 10.54436],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-9.206897, -12.55247, 10.59418],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-11.94062, -12.40013, 10.63413],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[8.446517, -13.53625, 10.33621],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[11.03028, -16.3454, 10.16547],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[13.53795, -21.81548, 9.862865],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[26.68937, -22.54837, 9.670686],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[28.46399, 8.890535, 11.21838],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[13.83788, -16.50186, 10.12445],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[11.18025, -13.68859, 10.29627],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[25.95829, 11.76937, 11.39168],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[23.44842, 14.5744, 11.56133],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[20.94272, 17.45324, 11.73463],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[18.42867, 20.18447, 11.90065],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-3.099726, 18.37678, 12.06519],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[-2.922625, 21.37432, 12.21266],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[-3.181229, 15.59905, 11.92755],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-3.312399, 13.27526, 11.81315],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-3.735142, 12.45474, 11.77721],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-6.586897, 12.61366, 11.81889],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-8.833666, 14.15463, 11.92236],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-10.90697, 15.80399, 12.02919],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-13.50623, 15.94884, 12.06717],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-13.60946, 14.11998, 11.97714],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-14.43197, 13.66933, 11.96438],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.20459, 16.36375, 12.09614],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-14.06073, 18.91242, 12.2216],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-15.47735, 19.48283, 12.26683],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-23.9151, 11.80948, 11.98379],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[25.80416, 9.038761, 11.25725],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-16.90626, 16.51431, 12.13562],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-18.29132, 16.90045, 12.17127],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-21.10114, 14.39186, 12.07935],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-17.05859, 13.81571, 12.00277],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-14.57583, 11.12066, 11.83892],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-9.052763, -9.821862, 10.7286],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-10.99328, 14.27498, 11.95392],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-11.85356, 14.02213, 11.95148],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-12.02536, 10.97853, 11.80165],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-9.01393, 10.96111, 11.76515],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-6.687496, 10.83147, 11.73115],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-3.844204, 10.52262, 11.6821],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-0.2260523, -10.31375, 10.59962],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[8.600651, -10.80564, 10.47064],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[23.29846, 11.9176, 11.43054],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[20.78859, 14.72263, 11.6002],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[-1.217578, 10.37624, 11.64372],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[-1.06102, 13.1498, 11.78025],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[-0.7797541, 15.46522, 11.89246],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[-0.6231963, 18.23877, 12.029],\r\n\t\t\t[18.28287, 17.60147, 11.7735],\r\n\t\t\t[1.548568, 21.12516, 12.14732],\r\n\t\t\t[-0.6231963, 18.23877, 12.029]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild3() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-15.23335, 15.46059, 9.683384],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-17.95873, 15.53231, 9.68339],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-17.95873, 13.02209, 9.683384],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-15.23335, 13.02209, 9.683384],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[-16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-16.9081, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 18.53874, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-19.57235, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 15.80049, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-22.23661, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 13.13624, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-24.90086, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, 10.39798, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-27.5651, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -21.12899, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-14.39187, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -15.80049, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-11.5796, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -13.13623, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-11.5796, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-11.5796, -13.13623, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-19.57235, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[-22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-15.23335, 15.46059, 0.0],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-17.95873, 15.53231, 0.0],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-19.57235, 15.80049, 5.602837e-06],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-17.95873, 13.02209, 1.110223e-16],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-15.23335, 13.02209, 1.110223e-16],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[7.629395e-06, -10.39798, 5.602837e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-16.9081, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06],\r\n\t\t\t[-16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[16.9081, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[16.9081, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 18.53874, 5.602837e-06],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 18.53874, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[19.57236, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[19.57236, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 15.80049, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 15.80049, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[22.23661, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[22.23661, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 13.13624, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 13.13624, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[24.90086, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[24.90086, 10.39798, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[27.5651, 10.39798, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, 10.39798, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[27.5651, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[27.5651, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -21.12899, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -21.12899, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[14.39187, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[14.39187, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -15.80049, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -15.80049, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[11.57961, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[11.57961, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -13.13623, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -10.39798, 5.602837e-06],\r\n\t\t\t[8.841347, -13.13623, 9.683396],\r\n\t\t\t[8.841347, -10.39798, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[16.9081, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[16.9081, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[2.042961, 21.12899, 9.683396],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 19.38104, 9.683394],\r\n\t\t\t[2.042961, 21.12899, 5.602837e-06],\r\n\t\t\t[2.042961, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 19.38104, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 19.38104, 4.649162e-06],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[4.667503, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[4.667503, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 17.15018, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 17.15018, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[7.554497, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[7.554497, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 15.05055, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 15.05055, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[3.439735, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[3.439735, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 17.41263, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 17.41263, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[1.077644, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[1.077644, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 13.86727, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 13.86727, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[4.667503, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[4.667503, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 9.407779, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 9.407779, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[7.292046, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[7.292046, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 6.783233, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 6.783233, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[4.929955, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[4.929955, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 3.502555, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 3.502555, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[7.16082, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[7.16082, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 2.059058, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 2.059058, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[4.798729, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[4.798729, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 3.76501, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 3.76501, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[1.78051, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[1.78051, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 1.665378, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 1.665378, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-1.106483, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-1.106483, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 3.76501, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 3.76501, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-3.46859, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-3.46859, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 1.534152, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 1.534152, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-6.355583, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-6.355583, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 4.6836, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 4.6836, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-8.586449, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-8.586449, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 6.652011, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 6.652011, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-5.685844, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-5.685844, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 9.276549, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 9.276549, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-3.191429, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-3.191429, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 12.83601, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 12.83601, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-5.553505, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-5.553505, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.046822, 15.05055, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.046822, 15.05055, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-8.063347, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-8.063347, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.52865, 17.26307, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-10.52865, 17.26307, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.54125, 14.52564, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-10.54125, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 14.52564, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 14.52564, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.310402, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-8.310402, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 12.03232, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 12.03232, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-5.554619, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-5.554619, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 9.801459, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 9.801459, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-8.717674, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-8.717674, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 12.03232, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 12.03232, 4.649162e-06],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-10.94852, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-10.94852, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 14.52564, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 14.52564, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-13.70431, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-13.70431, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 17.28141, 9.683394],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 17.28141, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-11.07975, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-11.07975, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 19.77472, 9.683394],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 21.12899, 9.683396],\r\n\t\t\t[-8.455208, 19.77472, 4.649162e-06],\r\n\t\t\t[-8.455208, 21.12899, 5.602837e-06]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815],\r\n\t\t\t[816, 817, 818],\r\n\t\t\t[819, 820, 821],\r\n\t\t\t[822, 823, 824],\r\n\t\t\t[825, 826, 827],\r\n\t\t\t[828, 829, 830],\r\n\t\t\t[831, 832, 833],\r\n\t\t\t[834, 835, 836],\r\n\t\t\t[837, 838, 839],\r\n\t\t\t[840, 841, 842],\r\n\t\t\t[843, 844, 845],\r\n\t\t\t[846, 847, 848],\r\n\t\t\t[849, 850, 851],\r\n\t\t\t[852, 853, 854],\r\n\t\t\t[855, 856, 857],\r\n\t\t\t[858, 859, 860],\r\n\t\t\t[861, 862, 863],\r\n\t\t\t[864, 865, 866],\r\n\t\t\t[867, 868, 869],\r\n\t\t\t[870, 871, 872],\r\n\t\t\t[873, 874, 875],\r\n\t\t\t[876, 877, 878],\r\n\t\t\t[879, 880, 881],\r\n\t\t\t[882, 883, 884],\r\n\t\t\t[885, 886, 887],\r\n\t\t\t[888, 889, 890],\r\n\t\t\t[891, 892, 893],\r\n\t\t\t[894, 895, 896],\r\n\t\t\t[897, 898, 899],\r\n\t\t\t[900, 901, 902],\r\n\t\t\t[903, 904, 905],\r\n\t\t\t[906, 907, 908],\r\n\t\t\t[909, 910, 911],\r\n\t\t\t[912, 913, 914],\r\n\t\t\t[915, 916, 917],\r\n\t\t\t[918, 919, 920],\r\n\t\t\t[921, 922, 923],\r\n\t\t\t[924, 925, 926],\r\n\t\t\t[927, 928, 929],\r\n\t\t\t[930, 931, 932],\r\n\t\t\t[933, 934, 935],\r\n\t\t\t[936, 937, 938],\r\n\t\t\t[939, 940, 941],\r\n\t\t\t[942, 943, 944],\r\n\t\t\t[945, 946, 947],\r\n\t\t\t[948, 949, 950],\r\n\t\t\t[951, 952, 953],\r\n\t\t\t[954, 955, 956],\r\n\t\t\t[957, 958, 959],\r\n\t\t\t[960, 961, 962],\r\n\t\t\t[963, 964, 965],\r\n\t\t\t[966, 967, 968],\r\n\t\t\t[969, 970, 971],\r\n\t\t\t[972, 973, 974],\r\n\t\t\t[975, 976, 977],\r\n\t\t\t[978, 979, 980],\r\n\t\t\t[981, 982, 983],\r\n\t\t\t[984, 985, 986],\r\n\t\t\t[987, 988, 989],\r\n\t\t\t[990, 991, 992],\r\n\t\t\t[993, 994, 995],\r\n\t\t\t[996, 997, 998],\r\n\t\t\t[999, 1000, 1001],\r\n\t\t\t[1002, 1003, 1004],\r\n\t\t\t[1005, 1006, 1007],\r\n\t\t\t[1008, 1009, 1010],\r\n\t\t\t[1011, 1012, 1013],\r\n\t\t\t[1014, 1015, 1016],\r\n\t\t\t[1017, 1018, 1019],\r\n\t\t\t[1020, 1021, 1022],\r\n\t\t\t[1023, 1024, 1025],\r\n\t\t\t[1026, 1027, 1028],\r\n\t\t\t[1029, 1030, 1031],\r\n\t\t\t[1032, 1033, 1034],\r\n\t\t\t[1035, 1036, 1037],\r\n\t\t\t[1038, 1039, 1040],\r\n\t\t\t[1041, 1042, 1043],\r\n\t\t\t[1044, 1045, 1046],\r\n\t\t\t[1047, 1048, 1049],\r\n\t\t\t[1050, 1051, 1052],\r\n\t\t\t[1053, 1054, 1055],\r\n\t\t\t[1056, 1057, 1058],\r\n\t\t\t[1059, 1060, 1061],\r\n\t\t\t[1062, 1063, 1064],\r\n\t\t\t[1065, 1066, 1067],\r\n\t\t\t[1068, 1069, 1070],\r\n\t\t\t[1071, 1072, 1073],\r\n\t\t\t[1074, 1075, 1076],\r\n\t\t\t[1077, 1078, 1079],\r\n\t\t\t[1080, 1081, 1082],\r\n\t\t\t[1083, 1084, 1085],\r\n\t\t\t[1086, 1087, 1088],\r\n\t\t\t[1089, 1090, 1091]\r\n\t\t]\r\n\t);\r\n}\r\n\r\nmodule invaders_v2_sheild4() \r\n{\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[13.80537, 14.15449, 4.440892e-16],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[13.80537, 11.27239, 5.551115e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[11.02855, 8.842235, 6.661338e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[8.372421, 6.306842, 8.881784e-16],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[9.075607, 6.186107, 8.881784e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[11.97319, 3.409247, 9.992007e-16],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[11.97319, 6.186107, 8.881784e-16],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.804977, 3.409247, 9.992007e-16],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.804977, 1.644248, 1.110223e-15],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[9.075607, 3.288516, 9.992007e-16],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[9.075607, 0.994586, 1.221245e-15],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[11.49025, 0.994586, 1.221245e-15],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[11.49025, -1.903005, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[12.44484, -1.661538, 1.332268e-15],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[14.51848, -1.661538, 1.332268e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[17.41609, -1.29934, 1.332268e-15],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[18.87621, -1.29934, 1.332268e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[20.33232, -1.661538, 1.332268e-15],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[20.33232, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[20.21159, 4.133647, 9.992007e-16],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[20.21159, 6.186107, 8.881784e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.34395, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[23.35063, 6.186107, 8.881784e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[23.2299, 4.133647, 9.992007e-16],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[23.2299, 0.8738546, 1.221245e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[23.2299, -1.661538, 1.332268e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[14.39189, -21.12899, 2.553513e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[23.2299, -4.438397, 1.554312e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[14.39189, -15.80049, 2.220446e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[18.87621, -4.438397, 1.554312e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[17.41609, -3.834733, 1.44329e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[14.51848, -3.834733, 1.44329e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[12.44484, -4.317666, 1.554312e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[8.841354, -13.13623, 2.109424e-15],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[11.02855, 21.12899, 0.0],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[9.075607, -1.29934, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[9.43779, -1.903005, 1.332268e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[9.43779, -4.317666, 1.554312e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[5.35408, -1.29934, 1.332268e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[5.35408, 1.644248, 1.110223e-15],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[5.837021, 3.288516, 9.992007e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[5.837021, 6.306842, 8.881784e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[8.372421, 8.842235, 6.661338e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[11.02855, 11.2569, 5.551115e-16],\r\n\t\t\t[0.0, 21.12899, 0.0],\r\n\t\t\t[11.02855, 14.15449, 4.440892e-16],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 1.887379e-15],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 1.887379e-15],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 2.109424e-15],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 2.109424e-15],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 2.220446e-15],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 2.220446e-15],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 2.553513e-15],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 2.553513e-15],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 6.661338e-16],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 6.661338e-16],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 4.440892e-16],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 4.440892e-16],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 3.330669e-16],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 3.330669e-16],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 1.110223e-16],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-16.9081, 21.12899, 0.0],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 1.110223e-16],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[11.02855, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[-16.9081, 21.12899, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[-19.57234, 18.53874, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-22.2366, 15.80049, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-24.90086, 13.13624, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-27.56511, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-27.56511, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-14.39186, -21.12899, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-11.57961, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-14.39186, -15.80049, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-8.841339, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-11.57961, -13.13623, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[8.841354, -13.13623, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[11.57961, -15.80049, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[14.39189, -21.12899, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[27.56511, 10.39798, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[24.90086, 13.13624, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[23.34395, 13.13624, 9.683392],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[24.90086, 10.39798, 9.683392],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[20.21159, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[20.21159, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.35063, 6.186107, 9.683389],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[23.2299, 4.133647, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[20.33232, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[20.33232, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, 0.8738546, 9.683389],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[23.2299, -1.661538, 9.683389],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[27.56511, -21.12899, 9.683392],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[23.2299, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[14.39189, -15.80049, 9.683392],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[11.57961, -13.13623, 9.683392],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[18.87621, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[17.41609, -1.29934, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[18.87621, -4.438397, 9.683389],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[17.41609, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[14.51848, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[12.44484, -1.661538, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[14.51848, -3.834733, 9.683389],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[12.44484, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[11.49025, -1.903005, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[11.49025, 0.994586, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.075607, 0.994586, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.804977, 1.644248, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[11.97319, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[11.97319, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.075607, 6.186107, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.804977, 3.409247, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[9.075607, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[8.372421, 6.306842, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[11.02855, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[13.80537, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[13.80537, 11.27239, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[8.841354, -10.39798, 9.683392],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[-24.90086, 10.39798, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-22.2366, 13.13624, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-19.57234, 15.80049, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-16.9081, 18.53874, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[0.0, 21.12899, 9.683392],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[9.075607, -1.29934, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[9.43779, -1.903005, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[9.43779, -4.317666, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[0.0, -10.39798, 9.683392],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[11.02855, 11.2569, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[5.837021, 3.288516, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.35408, -1.29934, 9.683389],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[8.372421, 8.842235, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[11.02855, 14.15449, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[5.837021, 6.306842, 9.683389],\r\n\t\t\t[-8.841339, -10.39798, 9.683392],\r\n\t\t\t[5.35408, 1.644248, 9.683389],\r\n\t\t\t[5.837021, 6.306842, 9.683389]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815],\r\n\t\t\t[816, 817, 818],\r\n\t\t\t[819, 820, 821],\r\n\t\t\t[822, 823, 824],\r\n\t\t\t[825, 826, 827]\r\n\t\t]\r\n\t);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a96927bff77f3694e4012a58b1094fd3aa6a415b","subject":"Add support bar only for length greater than 1","message":"Add support bar only for length greater than 1\n","repos":"cameronlai\/font3d,cameronlai\/font3d","old_file":"font3d-scad\/font3d.scad","new_file":"font3d-scad\/font3d.scad","new_contents":"\/*\n* font3d\n* (C) Copyright 2014 Cameron Lai\n*\n* All rights reserved. This program and the accompanying materials\n* are made available under the terms of the GNU Lesser General Public License\n* (LGPL) version 3.0 which accompanies this distribution, and is available at\n* https:\/\/www.gnu.org\/licenses\/lgpl-3.0.txt\n*\n* font3d is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n* Lesser General Public License for more details.\n*\n*\/\n\ninclude\ninclude\n\nfont3d(\"AB\", \"basic\");\n\nmodule font3d(inputString, fontType)\n{\n\tnumChar = len(inputString);\n\t\/\/ Loop around characters\n\tfor (i=[0:numChar-1])\n\t{\n\t\t\/\/ Pick corresponding font\n\t\ttranslate([i*xdim,0,0])\n\t\tif (fontType==\"basic\") basic(inputString[i]);\n\t\telse\n\t\t{\n\t\t echo(\"Font type not recognized\");\n\t\t}\n\t}\n\t\/\/ Add support bar\n\tif (numChar>1) support_bar(len(inputString));\n}\n","old_contents":"\/*\n* font3d\n* (C) Copyright 2014 Cameron Lai\n*\n* All rights reserved. This program and the accompanying materials\n* are made available under the terms of the GNU Lesser General Public License\n* (LGPL) version 3.0 which accompanies this distribution, and is available at\n* https:\/\/www.gnu.org\/licenses\/lgpl-3.0.txt\n*\n* font3d is distributed in the hope that it will be useful,\n* but WITHOUT ANY WARRANTY; without even the implied warranty of\n* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n* Lesser General Public License for more details.\n*\n*\/\n\ninclude\ninclude\n\nmodule font3d(inputString, fontType)\n{\n\t\/\/ Loop around characters\n\tfor (i=[0:len(inputString)-1])\n\t{\n\t\t\/\/ Pick corresponding font\n\t\ttranslate([i*xdim,0,0])\n\t\tif (fontType==\"basic\") basic(inputString[i]);\n\t\telse\n\t\t{\n\t\t echo(\"Font type not recognized\");\n\t\t}\n\t}\n\t\/\/ Add support bar\n\tsupport_bar(len(inputString));\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5fbd3710514785d01df8509ae7e65b1f0789c937","subject":"feat: rework the visual test operators, move the title to the top-left corder, center the tested elements, and display the axis","message":"feat: rework the visual test operators, move the title to the top-left corder, center the tested elements, and display the axis\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Renders a test element. If no children is given, a cube with an arrow on top is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [angle] - The angle of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", angle=0, size=1, center=false) {\n color(c) {\n rotate(angle) {\n if ($children) {\n children();\n } else let(\n size = vector3D(size),\n half = size \/ 2,\n quarter = size \/ 4,\n offset = center ? -half : vector3D()\n ) {\n translate(offset) {\n linear_extrude(height=size.z, convexity=10) {\n polygon(\n points = path([\n [\"P\", half.x, size.y],\n [\"L\", half.x, -half.y],\n [\"H\", -quarter.x],\n [\"V\", -half.y],\n [\"H\", -half.x],\n [\"V\", half.y],\n [\"H\", -quarter.x],\n ]),\n convexity = 10\n );\n }\n translateZ(quarter.z) {\n cube(size=[size.x, size.y, half.z]);\n }\n }\n }\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * A testbed is shown, unless the global variable `TESTBED_SHOW` is set to `false`.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0) {\n title = str(title, \" \", index);\n fontSize = min(length, width) \/ len(title);\n margin = vector2D(margin);\n height = (length + width) \/ 2;\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = [length, width, 0] \/ 2;\n testPosition = [(length + margin.x) * x, (width + margin.y) * y, 0] + offset;\n titlePosition = [length * .1, width * .9, 0] - offset;\n\n translate(testPosition) {\n \/\/ test area\n if (TESTBED_SHOW) {\n \/\/ Plate\n testbedExtrude(.1) {\n square([length, width], center=true);\n }\n \/\/ Z-axis\n rotateY(90) {\n testbedExtrude(.5) {\n square([height, TESTBED_THICKNESS], center=true);\n }\n }\n testbedExtrude(.5) {\n \/\/ X-axis\n square([length, TESTBED_THICKNESS], center=true);\n \/\/ Y-axis\n square([TESTBED_THICKNESS, width], center=true);\n }\n \/\/ Title\n translate(titlePosition) {\n testbedExtrude(1) {\n text(title, size=fontSize, font=\"Liberation Sans\", valign=\"top\", halign=\"left\");\n }\n }\n }\n\n \/\/ tested elements\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `TESTBED_SELECT`.\n * A subset of the tests can be selected thanks to the global variable `TESTBED_RANGE`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false) {\n margin = vector2D(margin);\n count = $children;\n TESTBED_RANGE = is_num(TESTBED_SELECT) && TESTBED_SELECT >= 0 ? [TESTBED_SELECT, TESTBED_SELECT] : TESTBED_RANGE;\n start = max(min(TESTBED_RANGE), 0);\n end = min(max(TESTBED_RANGE), count - 1);\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols\n ) {\n children(i);\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element. If no children is given, a cube with an arrow on top is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [angle] - The angle of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", angle=0, size=1, center=false) {\n color(c) {\n rotate(angle) {\n if ($children) {\n children();\n } else let(\n size = vector3D(size),\n half = size \/ 2,\n quarter = size \/ 4,\n offset = center ? -half : vector3D()\n ) {\n translate(offset) {\n linear_extrude(height=size.z, convexity=10) {\n polygon(\n points = path([\n [\"P\", half.x, size.y],\n [\"L\", half.x, -half.y],\n [\"H\", -quarter.x],\n [\"V\", -half.y],\n [\"H\", -half.x],\n [\"V\", half.y],\n [\"H\", -quarter.x],\n ]),\n convexity = 10\n );\n }\n translateZ(quarter.z) {\n cube(size=[size.x, size.y, half.z]);\n }\n }\n }\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * A testbed is shown, unless the global variable `TESTBED_SHOW` is set to `false`.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n if (TESTBED_SHOW) {\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `TESTBED_SELECT`.\n * A subset of the tests can be selected thanks to the global variable `TESTBED_RANGE`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n TESTBED_RANGE = is_num(TESTBED_SELECT) && TESTBED_SELECT >= 0 ? [TESTBED_SELECT, TESTBED_SELECT] : TESTBED_RANGE;\n start = max(min(TESTBED_RANGE), 0);\n end = min(max(TESTBED_RANGE), count - 1);\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4345330222be58c608b964aab4140ac8948e68e3","subject":"base wall element, with smooth edges","message":"base wall element, with smooth edges\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"brown_oral_b_brush_holder\/brush_holder.scad","new_file":"brown_oral_b_brush_holder\/brush_holder.scad","new_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=10;\n\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t=[ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ])\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);","old_contents":"","returncode":1,"stderr":"error: pathspec 'brown_oral_b_brush_holder\/brush_holder.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"2c29998f8b61d8975f3e3988eab6d524233f6fb3","subject":"shapes: use is_list (not old is_array)","message":"shapes: use is_list (not old is_array)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_array(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d3304ab8c11ab6d60ecc679b9a21f5fb34264791","subject":"fixed basin support depth","message":"fixed basin support depth\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 40 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 60 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1980ba5bf97c2ae363120793bd6a9089019bee7e","subject":"Add a simple skeleton to quickly start new samples","message":"Add a simple skeleton to quickly start new samples\n","repos":"jsconan\/camelSCAD","old_file":"samples\/skeleton.scad","new_file":"samples\/skeleton.scad","new_contents":"\/**\r\n * Samples using the camelSCAD library.\r\n *\r\n * A base skeleton\r\n *\r\n * @author jsconan\r\n * @license CC0-1.0\r\n *\/\r\n\r\n\/\/ As we need to use some shapes, use the right entry point of the library\r\nuse <..\/shapes.scad>\r\ninclude <..\/core\/constants.scad>\r\n\r\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = MODE_PROD;\r\n\r\n\/\/ Defines the constraints of the print\r\nprintResolution = 0.2;\r\n\r\n\/\/ Defines the constraints of the object\r\n\r\n\r\n\/\/ Defines the dimensions of the object\r\n\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\r\n\/\/ Displays a build box visualization to preview the printer area.\r\nbuildBox(mode=renderMode) {\r\n\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/skeleton.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1fb9abbcd12ea152e567498e37f2ba1393b36b8f","subject":"fixes after 2nd test print of hmount()","message":"fixes after 2nd test print of hmount()\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n polygon([\n [-50,-35], [50,-35],\n [50,-30], [60,-15],[60,15], [50,30],\n [50,35], [-50,35],\n [-50,30], [-55,20],[-55,-20], [-50,-30]\n ])\n\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n translate ([-45, 35, 0]) circle(r=7.5, center=true);\n translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n }\n square(size=[162,120], center=true);\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front\n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/ cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n \/\/translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n \/\/translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n\n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n\n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30) hbaseholes(center=true);\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 47]) cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 47+5]) cube(size=[20, 63, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 47+5]) cube(size=[20, 20, 10], center=true);\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = false)\n{\n translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (!center) {\n translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n }\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n\n translate ([10, -23, 35]) esc();\n\/\/ translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n\n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar();\n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar();\n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n\n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar();\n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) children();\n translate ([45, 45, 57]) rotate([0, 0, a]) children();\n translate ([45, -45, 57]) rotate([0, 0, -a]) children();\n\n translate ([0, 52.5, 42]) rotate([180, 0, 2*a]) children();\n translate ([0, -52.5, 42]) rotate([180, 0, -2*a]) children();\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\n\/\/platform();\n\n\/*\nintersection() {\nplatform();\n#translate ([80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([45-2.5, 30, 0]) cube(size=[20, 20, 400], center=true);\n}\n*\/\n\n\/\/fullb();\n\ntranslate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n polygon([\n [-50,-35], [50,-35],\n [50,-30], [60,-15],[60,15], [50,30],\n [50,35], [-50,35],\n [-50,30], [-55,20],[-55,-20], [-50,-30]\n ])\n\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n translate ([-45, 35, 0]) circle(r=7.5, center=true);\n translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n }\n square(size=[162,120], center=true);\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front\n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/ cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n \/\/translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n \/\/translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n\n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n\n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30) hbaseholes(center=true);\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 47]) cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 47+5]) cube(size=[20, 63, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 47+5]) cube(size=[20, 20, 10], center=true);\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = false)\n{\n translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n if (!center) {\n translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n }\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 23], center=false);\n translate ([0, 43, 23]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n translate ([0, 5, 23]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([16\/2+1,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([16\/2+27+1,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n translate([45\/2-3.25,20-4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5); }\n\n \/\/ screws\n translate([ 1.5, 1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.5, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.5, 1.5, 4.5-0.5]) screw2x6bore();\n translate([ 1.5, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n\n translate ([10, -23, 35]) esc();\n\/\/ translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n\n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar();\n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar();\n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n\n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar();\n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) children();\n translate ([45, 45, 57]) rotate([0, 0, a]) children();\n translate ([45, -45, 57]) rotate([0, 0, -a]) children();\n\n translate ([0, 52.5, 42]) rotate([180, 0, 2*a]) children();\n translate ([0, -52.5, 42]) rotate([180, 0, -2*a]) children();\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\nplatform();\n\n\/*\nintersection() {\nplatform();\n#translate ([80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([45-2.5, 30, 0]) cube(size=[20, 20, 400], center=true);\n}\n*\/\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c5ef9db511d034d071b4835c5e833573eaa31c54","subject":"main: fix carriage preview","message":"main: fix carriage preview\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1* axis_range_x_,-1*axis_range_x_+x_carriage_w];\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5e23e31159ab132f797e5e48f62d79bde84fae84","subject":"main: Move main declaration","message":"main: Move main declaration\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,10,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n rotate([90,0,180])\n x_carriage(show_bearings=true);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2+10, -1, -17], [0,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n\n\nmain();\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,10,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n rotate([90,0,180])\n x_carriage(show_bearings=true);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2+10, -1, -17], [0,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"89ca0c60bba7650c174972910a1ee14fd3aeb35a","subject":"y\/motor-mount: fix vitamins rendered in output","message":"y\/motor-mount: fix vitamins rendered in output\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-motor-mount.scad","new_file":"y-motor-mount.scad","new_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=-Z);\n\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=-Z);\n t([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=-Z);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=-Z, orient=Z);\n}\n\nmodule yaxis_motor_mount(part)\n{\n width = ymotor_w+ymotor_mount_thickness;\n depth = ymotor_w+ymotor_mount_thickness*2;\n height = ymotor_mount_thickness_h;\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n motor_pos =\n + Z * yaxis_motor_offset_z\n + Z * extrusion_size\/2\n + X * ymotor_mount_thickness\n + X * ymotor_w\/2;\n\n\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n if($show_vit)\n yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n t(motor_pos)\n motor_mount(part=part, model=yaxis_motor, size=NemaMedium, thickness=ymotor_mount_thickness_h, extra_size=[ymotor_mount_thickness, ymotor_mount_thickness*2]);\n\n tz(yaxis_motor_offset_z)\n {\n \/\/ reinforcement plate between motor and extrusion\n tz(extrusion_size\/2)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=X-Z, extra_size=[0,0,ymotor_mount_thickness_h], extra_align=Z);\n\n \/\/ side triangles\n tz(extrusion_size\/2)\n for(y=[-1,1])\n ty(y*((ymotor_w\/2)+ymotor_mount_thickness\/2))\n {\n tx(ymotor_mount_thickness)\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=X-Z,\n orient=X\n );\n\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=X-Z);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n t(motor_pos)\n motor_mount(part=part, model=yaxis_motor, size=NemaMedium, thickness=ymotor_mount_thickness_h, extra_size=[ymotor_mount_thickness, ymotor_mount_thickness*2]);\n\n \/\/ cutout for belt path\n t(motor_pos)\n {\n cylindera(d=ymotor_round_d+1*mm, h=ymotor_mount_thickness_h+1, orient=Z, align=Z, extra_h=1, extra_align=-Z);\n cubea([depth\/2, ymotor_round_d+1*mm, ymotor_mount_thickness_h+1], align=X+Z, extra_size=1*Z, extra_align=-Z);\n }\n\n \/\/ cutout for motor cables\n tz(-20*mm)\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=-Z);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n t(motor_pos)\n {\n motor_mount(part=part, model=yaxis_motor, size=NemaMedium, thickness=ymotor_mount_thickness_h, extra_size=[ymotor_mount_thickness, ymotor_mount_thickness*2]);\n\n tz(7*mm)\n rotate(180*X)\n pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","old_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=-Z);\n\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=-Z);\n t([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=-Z);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=-Z, orient=Z);\n}\n\nmodule yaxis_motor_mount(part)\n{\n width = ymotor_w+ymotor_mount_thickness;\n depth = ymotor_w+ymotor_mount_thickness*2;\n height = ymotor_mount_thickness_h;\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n motor_pos =\n + Z * yaxis_motor_offset_z\n + Z * extrusion_size\/2\n + X * ymotor_mount_thickness\n + X * ymotor_w\/2;\n\n\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n t(motor_pos)\n motor_mount(part=part, model=yaxis_motor, size=NemaMedium, thickness=ymotor_mount_thickness_h, extra_size=[ymotor_mount_thickness, ymotor_mount_thickness*2]);\n\n tz(yaxis_motor_offset_z)\n {\n \/\/ reinforcement plate between motor and extrusion\n tz(extrusion_size\/2)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=X-Z, extra_size=[0,0,ymotor_mount_thickness_h], extra_align=Z);\n\n \/\/ side triangles\n tz(extrusion_size\/2)\n for(y=[-1,1])\n ty(y*((ymotor_w\/2)+ymotor_mount_thickness\/2))\n {\n tx(ymotor_mount_thickness)\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=X-Z,\n orient=X\n );\n\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=X-Z);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n t(motor_pos)\n motor_mount(part=part, model=yaxis_motor, size=NemaMedium, thickness=ymotor_mount_thickness_h, extra_size=[ymotor_mount_thickness, ymotor_mount_thickness*2]);\n\n \/\/ cutout for belt path\n t(motor_pos)\n {\n cylindera(d=ymotor_round_d+1*mm, h=ymotor_mount_thickness_h+1, orient=Z, align=Z, extra_h=1, extra_align=-Z);\n cubea([depth\/2, ymotor_round_d+1*mm, ymotor_mount_thickness_h+1], align=X+Z, extra_size=1*Z, extra_align=-Z);\n }\n\n \/\/ cutout for motor cables\n tz(-20*mm)\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=-Z);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n t(motor_pos)\n {\n motor_mount(part=part, model=yaxis_motor, size=NemaMedium, thickness=ymotor_mount_thickness_h, extra_size=[ymotor_mount_thickness, ymotor_mount_thickness*2]);\n\n tz(7*mm)\n rotate(180*X)\n pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c045bdb84436b84696bff8def9601e5866b06e69","subject":"z\/motor-mount: use material system","message":"z\/motor-mount: use material system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-motor-mount.scad","new_file":"z-motor-mount.scad","new_contents":"include \n\ninclude \n\nuse \nuse \n\nmodule zaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n material(Mat_Plastic)\n union()\n {\n \/\/ top plate\n rcubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n rcubea([gantry_connector_thickness+5, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=[1,0,-1], extrasize=[0,0,2], extrasize_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=X);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=N, orient=X);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_mount_screw_offset_x, 0, 0])\n translate([0,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-5, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n nut_trap_cut(nut=zmotor_mount_clamp_nut, h=10, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=Z, orient=X, align=N);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nmodule part_z_motor_mount_clamp()\n{\n translate([0,0,zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n}\n\n","old_contents":"include \n\nuse \nuse \n\nmodule zaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n rcubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n rcubea([gantry_connector_thickness+5, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=[1,0,-1], extrasize=[0,0,2], extrasize_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=X);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=N, orient=X);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_mount_screw_offset_x, 0, 0])\n translate([0,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-5, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n nut_trap_cut(nut=zmotor_mount_clamp_nut, h=10, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=Z, orient=X, align=N);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nmodule part_z_motor_mount_clamp()\n{\n translate([0,0,zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c69f4faa8bd02e5e86464a13ce6c2512ec43b56b","subject":"Allow different thickness for window panel.","message":"Allow different thickness for window panel.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n }\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\n\/\/thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n difference() {\n cube([thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7f23e1ff37f3b381b4cd86710c6edd22fc5e1222","subject":"transform: add txy, txz etc and asserts","message":"transform: add txy, txz etc and asserts\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(Z*dist)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d415379a600ea40996d0257fb088f671060fe2cb","subject":"seems to work OK on kebab skewers. might need larger for proper 3\/16\" diameter rod or tube","message":"seems to work OK on kebab skewers. might need larger for proper 3\/16\" diameter rod or tube\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/pinchCap.scad","new_file":"Drawings\/pinchCap.scad","new_contents":"%cylinder(r=4.9\/2,h=6.05,$fn=32);\n\nskewerCap();\n\n\n\/\/ this one is pretty good for kebab skewer, which seems to be slightly\n\/\/ less than 3\/16\" diameter. May need a little wider at top for 3\/16\" machine rod\nmodule skewerCap() difference() {\n cylinder(r1=5,r2=4,h=6,$fn=32);\n\n for(a=[0:60:359]) rotate([0,0,a]) hull() { \/\/cube([6,2.2,18],center=true);\n \/\/translate([2.2,0,-.2]) cylinder(r1=1.2,r2=0.8,h=7,$fn=6);\n \/\/translate([0 ,0,-.2])#cylinder(r1=2.4,r2=0.8,h=7,$fn=4);\n\n \/\/ lower\n #translate([3.5,0,0]) cube([.1,1.4,.2],center=true);\n #translate([1.5,0,0]) cube([.1,3.6,.2],center=true);\n\n \/\/ upper\n #translate([2.8,0,6]) cube([.1,0.8,.2],center=true);\n \/\/%translate([1 ,0,6]) cube([.1,2 ,.2],center=true);\n #translate([1.4,0,6]) cube([.1,2 ,.2],center=true);\n }\n translate([0,0,-.4]) cylinder(r1=5\/2,r2=1.8,h=7,$fn=12);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Drawings\/pinchCap.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"5b909c1d87a7d00f393dc37fc51bf9a32c2eae95","subject":"Tweak holes, add LED holes, make PCB transparent.","message":"Tweak holes, add LED holes, make PCB transparent.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/RaspberryPi_v15.scad","new_file":"designs\/RaspberryPi_v15.scad","new_contents":"\/\/ Raspberry Pi Case\n\/\/ Hans Harder 2012\n\/\/\n\/\/ Warning: this is based on the Beta board dimensions...\n\/\/ so production models can be slightly different\n\/\/ for instance SD card holder height and USB socket dimensions\n\/\/\n\/\/ Since all connectors stick out, case is split on HDMI height\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\n\/\/\n\/\/ v2: Adapted version after some suggestions from David...\n\/\/ removed feet, made both surface flat\n\/\/ v3: Added fliptop option and smooth the corners of the box\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\n\/\/ Looks strange but it fits...\n\/\/ Added frame mode (so no bottom and top deck)\n\/\/ Moved screw locations due to split and added some support structures\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\n\/\/ v5 relocated a lot of code in modules\n\/\/ SDslot location was not calculated correctly\n\/\/ v6 Added pcb drawing\n\/\/ Added colors\n\/\/ Cut out better so there is no debris around\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\n\/\/ Make a low as possible case, let USB stick out\n\/\/ v7 PCB options\n\/\/ Low level case optimisations\n\/\/ SD card location alterations\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\n\/\/ adapted support studs, moved some due to component location\n\/\/ components locations adapted\n\/\/ v9 Added logo in seperate dxf file\n\/\/ Option added to put logo in middle or using whole deck\n\/\/ beautified code, kr style\n\/\/ v10 Added logosunken and bottomsupport structures\n\/\/ Bottom supports are located where no components are located\n\/\/ so the pcb is not only supported from the sides\n\/\/ Well got my case, so based on what I see I changed:\n\/\/ case split level changed, should be better when printed on a reprap\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\n\/\/ Made frontstud a little thicker\n\/\/ v11 Different splitlevel (more simple) on back\n\/\/ keep a little margin on back split, so that top and bottom always fit\n\/\/ added openlogo option\n\/\/ v12 Different component locations\/sizes\n\/\/ keep a little margin on component holes\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\n\/\/ v13 skip this one.... :)\n\/\/ v14 Production board measurements...\n\/\/\t small differences, sometimes components are soldered differently\n\/\/ keep more space\n\/\/ should fit like a glove...\n\/\/ v15 moved the rca and snd a bit to get them more centered\n\/\/ Thanks to lincomatic at Thingiverse\n\/\/ Added option for GPIO side hole in bottom or top\n\/\/ Added showing GPIO pins with component drawing\n\/\/\n\/\/ All parts are draw as default just disable the ones you don't want\nDRAWfull = 0;\nDRAWtop = 1;\nDRAWbottom = 1;\nDRAWpcb = 0;\n\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\nGPIOsize = 2; \/\/ define height of gpiohole\n\n\/\/ select how the case should look like\ntopframe = false; \/\/ if false, underneath values determines how\ntopholes = true;\nledholes = true;\n\/\/ ---- holes sizes\nholeofs=6;\nholesiz=3;\nholestep=8;\nnoholes=7;\nholelen=30;\ntopmiddle = false;\n\nbottomframe = false; \/\/ if false, underneath values determines how\nbottomholes = false;\nbottomscrew = false;\nbottomsupport = false; \/\/ Added extra support locations for pcb\nbottomclick = true;\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\n\nbox_thickness = 2.0; \/\/ minimum = 1.0\ninside_h = 12.5; \/\/ 12.1 = lowprofile 16.5 is full height\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\n\n\/\/ just some colors to see the difference\nCASEcolor=\"Maroon\";\nCONNcolor=\"Silver\";\n\n\/\/ Define Raspberry Pi pcb dimensions in mm\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\ninside_w = 57.2; \/\/56.17 is largest width reported, so a bit room on each side\npcb_thickness = 1.7;\n\n\/\/ Coordinates based on RJ45 corner = 0,0,0\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\n\n\/\/ Connectors\nCrj45_x=2.0;\t\t\t \/\/2.0\nCrj45_y=-1;\nCrj45_w=16.4;\t\t\t\/\/ 15.4\nCrj45_d=21.5; \/\/21.8\nCrj45_h=13.8;\n\nCusb_x=24.5; \/\/ 23.9\nCusb_y=-7.7;\nCusb_w=13.9; \/\/ 13.3\nCusb_d=19.0;\t\t\t\/\/ 17.2\nCusb_h=16.0;\n\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\nCpwr_y=80.9;\nCpwr_w=8.8;\t\t\t\t\/\/ 7.8 7.6\nCpwr_d=5.6;\nCpwr_h=2.6;\n\nCsd_x=16.7;\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\nCsd_w=27.8;\nCsd_d=29.0;\nCsd_h=3.4; \/\/ under pcb\n\nChdmi_x=-1.2;\nChdmi_y=32.0; \/\/ 32.4 if 15.1\nChdmi_w=11.4;\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\nChdmi_h=6.4;\n\nCsnd_x=inside_w - 11.4;\nCsnd_y=16.0;\nCsnd_w=11.4;\nCsnd_d=10.0;\nCsnd_h=10.5;\nCsnd_r=6.7;\nCsnd_z=3.0;\nCsnd_l=3.4;\n\nCrca_x=inside_w - 10.0 - 2.1;\nCrca_y=34.2; \/\/ 34.6 was 35.2\nCrca_w=10.0;\nCrca_d=10.4; \/\/ 9.8\nCrca_h=13.0;\nCrca_r=8.6;\nCrca_z=4;\nCrca_l=10; \/\/ wild guess\n\n\n\npcb_c = pcb_h + pcb_thickness; \/\/ component height\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\necho(\"casesplit=\",casesplit);\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\n\n\/\/ side stud sizes for supporting pcb\nstud_w = 2;\nstud_l = 4;\n\n\/\/ calculate box size\nbox_l = inside_l + (box_thickness * 2);\nbox_w = inside_w + (box_thickness * 2);\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\nbox_w1 = box_thickness;\nbox_w2 = box_w - box_thickness;\nbox_l1 = box_thickness;\nbox_l2 = box_l - box_thickness;\nbox_wc = box_w \/ 2; \/\/ center width\nbox_lc = box_l \/ 2; \/\/ center length\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\nmiddle = true;\n\/\/ rounded corners\ncorner_radius = box_thickness*2;\n\n\n\n\/\/ count no of items to draw\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom;\n\n\/\/ ====================================================== DRAW items\n\/\/ if one draw it centered\nif (DRAWtotal == 1) {\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\n if (DRAWfull ) {\n draw_case(0,1);\n translate(v=[0,0,0.2]) draw_case(1,0);\n }\n if (DRAWtop ) {\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\n }\n if (DRAWbottom) draw_case(1,0);\n }\n} else {\n\/\/ draw each one on there one location\n if (DRAWfull) {\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\n draw_case(1,0);\n translate(v=[0,0,0.2]) draw_case(0,1);\n }\n }\n if (DRAWbottom) {\n translate(v = [ 5, 5, 0]) draw_case(1,0);\n }\n if (DRAWtop) {\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\n }\n}\n\n\/\/ ======================================================= END of draw\n\/\/ Module sections\n\nmodule make_deckholes(no,w,d,step) {\nfor ( i = [0 : 1 : no - 1] ) {\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) cube([w,d, box_thickness+18], center=true);\n }\n}\n\n\n\/\/ create a deck or insert\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\n ofs1=4;\n ofs2=w - ofs1 - hole_w;\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\n color(CASEcolor) {\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\n difference() {\n cube([w, d, box_thickness], center = false);\n if (top && holes && hole_size>0) {\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n }\n if (screwholes) {\n \/\/ --- 2x screw holes in bottom for mounting\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\n \/\/ 2nd screw hole\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\n if (!holes) {\n \/\/ middle screw hole\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\n }\n }\n if (holes && !top) {\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep);\n }\n if (top && ledholes) {\n\t\t\t\t\t\ttranslate([w-8,3,-0.1])\n\t cube([5,11,20]);\n }\n }\n color(CASEcolor) {\n if (top && holes) {\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\n }\n if (middle) {\n \/\/ --- solid area for sticker\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\n cube([20,20, box_thickness], center = false);\n }\n }\n }\n }\n }\n}\n\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\n translate(v = [x, y, -1]) {\n difference() {\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\n }\n }\n}\n\n\nmodule make_topcomponents(alpha=1) {\n color(CONNcolor, alpha=alpha) translate(v=[box_w1,box_l1,pcb_c]) {\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\n\n \/\/SND\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\n\n \/\/RCA\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\n }\n for ( i = [0 : 1 : 12] ) {\n color(\"black\", alpha=alpha) translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\n color(\"Gainsboro\", alpha=alpha) translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n color(\"Gainsboro\", alpha=alpha) translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n\n }\n}\n\nmodule make_connholes() {\n \/\/ =================================== cut outs, offset from 0,0\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\n\n \/\/power: 3.4mm offset, 8mm width, 3mm height\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\n if (pcb_h >= (Csd_h+1.5) ) {\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\n } else {\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\n }\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\n\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\n\n \/\/ RCA: 35mm offset, 10mm width 10mm height\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\n }\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\n cube([5,Crca_r+2,Crca_r\/2+1]);\n }\n}\n\nmodule make_pcb(alpha=1) {\n translate(v=[box_w1,box_l1,pcb_h]) {\n color(\"darkgreen\", alpha=alpha) cube([inside_w,inside_l,pcb_thickness], center=false);\n }\n color(CONNcolor, alpha=alpha) {\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\n }\n make_topcomponents(alpha=alpha);\n}\n\n\/\/ put extra supports on free spaces, used beta board image\nmodule make_supports() {\n if (!bottomframe) {\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n }\n}\n\n\/\/ width,depth,height,boxthickness,ledgethickness\nmodule make_case(w,d,h,bt,lt) {\n dt=bt+lt; \/\/ box+ledge thickness\n bt2=bt+bt; \/\/ 2x box thickness\n \/\/ Now we just substract the shape we have created in the four corners\n color(CASEcolor) difference() {\n cube([w,d,h], center=false);\n if (rounded) {\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\n }\n \/\/ empty inside, but keep a ledge for strength\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\n \/\/ remove bottom and top deck\n translate(v = [box_thickness+2, box_thickness+5,-2]) {\n cube([inside_w-4, inside_l-10, box_h+4], center = false);\n }\n }\n if (!topframe) {\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes, ledholes=ledholes, middle=topmiddle,screwholes=false,top=true);\n }\n if (!bottomframe) {\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,screwholes=bottomscrew,middle=false,top=false);\n if (bottomsupport) {\n make_supports();\n }\n }\n}\n\nmodule make_stud(x,y,z,w,h,l) {\n translate(v = [x, y, z]) cube([w, l, h], center = false);\n}\n\nmodule set_cutout(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\n}\n\nmodule set_cutoutv(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\n}\n\nmodule draw_pcbhold() {\n if (bottomclick) {\n color(CASEcolor) {\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\n difference() {\n cube([1, 3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\n difference() {\n cube([1,3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1, 3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1,3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n }\n }\n}\n\nmodule split_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w1+Csd_x - 12; \/\/ min 16.5+28\n split4=box_w2 - 7;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\n}\n\nmodule remove_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12;\n possd1=box_w1 + Csd_x - 0.3;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\n \/\/ back on 3 different levels\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\n if (bottompcb) {\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\n }\n}\n\nmodule remove_bottom() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12.1;\n possd1=box_w1 + Csd_x - 0.2;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\n}\n\nmodule draw_case(bottom, top) {\n difference() {\n union() {\n \/\/ make empty case\n difference() {\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\n if (top != 0 && bottom == 0) remove_bottom();\n if (top == 0 && bottom != 0) remove_top();\n }\n color(CASEcolor) {\n if (bottom != 0 ) {\n \/\/ add bottom studs for pcb\n \/\/ add bottom studs for pcb\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\n\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\n\n\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n\n draw_pcbhold();\n }\n\n if (top != 0) {\n \/\/ --- screw connection plates\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\n }\n translate(v = [box_w2-15, box_l2 - 1.5, casesplit - 5.4]) {\n cube([8, 1.5, box_h-(casesplit-5.4)], center = false);\n }\n \/\/ extra support for shell\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\n\t\t\t\t\t }\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\n cube([stud_w,10, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n }\n } \/\/ color\n } \/\/ end union\n \/\/ conn plate hole\n color(CASEcolor) {\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n if (GPIOHOLE == 1 && bottom != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \n }\n if (GPIOHOLE == 2 && top != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \n }\n }\n if (bottom != 0) {\n if (top == 0) {\n remove_top();\n } else {\n split_top();\n }\n }\n make_connholes();\n }\n if (bottom) {\n draw_pcbhold();\n if (DRAWpcb == 1) make_pcb(alpha=0.5);\n }\n} \/\/ end module\n","old_contents":"\/\/ Raspberry Pi Case\n\/\/ Hans Harder 2012\n\/\/\n\/\/ Warning: this is based on the Beta board dimensions...\n\/\/ so production models can be slightly different\n\/\/ for instance SD card holder height and USB socket dimensions\n\/\/\n\/\/ Since all connectors stick out, case is split on HDMI height\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\n\/\/\n\/\/ v2: Adapted version after some suggestions from David...\n\/\/ removed feet, made both surface flat\n\/\/ v3: Added fliptop option and smooth the corners of the box\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\n\/\/ Looks strange but it fits...\n\/\/ Added frame mode (so no bottom and top deck)\n\/\/ Moved screw locations due to split and added some support structures\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\n\/\/ v5 relocated a lot of code in modules\n\/\/ SDslot location was not calculated correctly\n\/\/ v6 Added pcb drawing\n\/\/ Added colors\n\/\/ Cut out better so there is no debris around\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\n\/\/ Make a low as possible case, let USB stick out\n\/\/ v7 PCB options\n\/\/ Low level case optimisations\n\/\/ SD card location alterations\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\n\/\/ adapted support studs, moved some due to component location\n\/\/ components locations adapted\n\/\/ v9 Added logo in seperate dxf file\n\/\/ Option added to put logo in middle or using whole deck\n\/\/ beautified code, kr style\n\/\/ v10 Added logosunken and bottomsupport structures\n\/\/ Bottom supports are located where no components are located\n\/\/ so the pcb is not only supported from the sides\n\/\/ Well got my case, so based on what I see I changed:\n\/\/ case split level changed, should be better when printed on a reprap\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\n\/\/ Made frontstud a little thicker\n\/\/ v11 Different splitlevel (more simple) on back\n\/\/ keep a little margin on back split, so that top and bottom always fit\n\/\/ added openlogo option\n\/\/ v12 Different component locations\/sizes\n\/\/ keep a little margin on component holes\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\n\/\/ v13 skip this one.... :)\n\/\/ v14 Production board measurements...\n\/\/\t small differences, sometimes components are soldered differently\n\/\/ keep more space\n\/\/ should fit like a glove...\n\/\/ v15 moved the rca and snd a bit to get them more centered\n\/\/ Thanks to lincomatic at Thingiverse\n\/\/ Added option for GPIO side hole in bottom or top\n\/\/ Added showing GPIO pins with component drawing\n\/\/\n\/\/ All parts are draw as default just disable the ones you don't want\nDRAWfull = 0;\nDRAWtop = 1;\nDRAWbottom = 1;\nDRAWpcb = 0;\n\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\nGPIOsize = 2; \/\/ define height of gpiohole\n\n\/\/ select how the case should look like\ntopframe = false; \/\/ if false, underneath values determines how\ntopholes = true;\n\/\/ ---- holes sizes\nholeofs=2;\nholesiz=3;\nholestep=10;\nnoholes=6;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\nholelen=24;\ntopmiddle = false;\n\nbottomframe = false; \/\/ if false, underneath values determines how\nbottomholes = false;\nbottomscrew = false;\nbottomsupport = false; \/\/ Added extra support locations for pcb\nbottomclick = true;\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\n\nbox_thickness = 2.0; \/\/ minimum = 1.0\ninside_h = 12.5; \/\/ 12.1 = lowprofile 16.5 is full height\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\n\n\/\/ just some colors to see the difference\nCASEcolor=\"Maroon\";\nCONNcolor=\"Silver\";\n\n\/\/ Define Raspberry Pi pcb dimensions in mm\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\ninside_w = 57.2; \/\/56.17 is largest width reported, so a bit room on each side\npcb_thickness = 1.7;\n\n\/\/ Coordinates based on RJ45 corner = 0,0,0\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\n\n\/\/ Connectors\nCrj45_x=2.0;\t\t\t \/\/2.0\nCrj45_y=-1;\nCrj45_w=16.4;\t\t\t\/\/ 15.4\nCrj45_d=21.5; \/\/21.8\nCrj45_h=13.8;\n\nCusb_x=24.5; \/\/ 23.9\nCusb_y=-7.7;\nCusb_w=13.9; \/\/ 13.3\nCusb_d=19.0;\t\t\t\/\/ 17.2\nCusb_h=16.0;\n\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\nCpwr_y=80.9;\nCpwr_w=8.8;\t\t\t\t\/\/ 7.8 7.6\nCpwr_d=5.6;\nCpwr_h=2.6;\n\nCsd_x=16.7;\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\nCsd_w=27.8;\nCsd_d=29.0;\nCsd_h=3.4; \/\/ under pcb\n\nChdmi_x=-1.2;\nChdmi_y=32.0; \/\/ 32.4 if 15.1\nChdmi_w=11.4;\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\nChdmi_h=6.4;\n\nCsnd_x=inside_w - 11.4;\nCsnd_y=16.0;\nCsnd_w=11.4;\nCsnd_d=10.0;\nCsnd_h=10.5;\nCsnd_r=6.7;\nCsnd_z=3.0;\nCsnd_l=3.4;\n\nCrca_x=inside_w - 10.0 - 2.1;\nCrca_y=34.2; \/\/ 34.6 was 35.2\nCrca_w=10.0;\nCrca_d=10.4; \/\/ 9.8\nCrca_h=13.0;\nCrca_r=8.6;\nCrca_z=4;\nCrca_l=10; \/\/ wild guess\n\n\n\npcb_c = pcb_h + pcb_thickness; \/\/ component height\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\necho(\"casesplit=\",casesplit);\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\n\n\/\/ side stud sizes for supporting pcb\nstud_w = 2;\nstud_l = 4;\n\n\/\/ calculate box size\nbox_l = inside_l + (box_thickness * 2);\nbox_w = inside_w + (box_thickness * 2);\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\nbox_w1 = box_thickness;\nbox_w2 = box_w - box_thickness;\nbox_l1 = box_thickness;\nbox_l2 = box_l - box_thickness;\nbox_wc = box_w \/ 2; \/\/ center width\nbox_lc = box_l \/ 2; \/\/ center length\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\nmiddle = true;\n\/\/ rounded corners\ncorner_radius = box_thickness*2;\n\n\n\n\/\/ count no of items to draw\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom;\n\n\/\/ ====================================================== DRAW items\n\/\/ if one draw it centered\nif (DRAWtotal == 1) {\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\n if (DRAWfull ) {\n draw_case(0,1);\n translate(v=[0,0,0.2]) draw_case(1,0);\n }\n if (DRAWtop ) {\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\n }\n if (DRAWbottom) draw_case(1,0);\n }\n} else {\n\/\/ draw each one on there one location\n if (DRAWfull) {\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\n draw_case(1,0);\n translate(v=[0,0,0.2]) draw_case(0,1);\n }\n }\n if (DRAWbottom) {\n translate(v = [ 5, 5, 0]) draw_case(1,0);\n }\n if (DRAWtop) {\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\n }\n}\n\n\/\/ ======================================================= END of draw\n\/\/ Module sections\n\nmodule make_deckholes(no,w,d,step) {\nfor ( i = [0 : 1 : no - 1] ) {\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) cube([w,d, box_thickness+18], center=true);\n }\n}\n\n\n\/\/ create a deck or insert\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\n ofs1=4;\n ofs2=w - ofs1 - hole_w;\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\n color(CASEcolor) {\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\n difference() {\n cube([w, d, box_thickness], center = false);\n if (top && holes && hole_size>0) {\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n }\n if (screwholes) {\n \/\/ --- 2x screw holes in bottom for mounting\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\n \/\/ 2nd screw hole\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\n if (!holes) {\n \/\/ middle screw hole\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\n }\n }\n if (holes && !top) {\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep);\n }\n }\n color(CASEcolor) {\n if (top && holes) {\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\n }\n if (middle) {\n \/\/ --- solid area for sticker\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\n cube([20,20, box_thickness], center = false);\n }\n }\n }\n }\n }\n}\n\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\n translate(v = [x, y, -1]) {\n difference() {\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\n }\n }\n}\n\n\nmodule make_topcomponents() {\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\n\n \/\/SND\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\n\n \/\/RCA\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\n }\n for ( i = [0 : 1 : 12] ) {\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n\n }\n}\n\nmodule make_connholes() {\n \/\/ =================================== cut outs, offset from 0,0\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\n\n \/\/power: 3.4mm offset, 8mm width, 3mm height\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\n if (pcb_h >= (Csd_h+1.5) ) {\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\n } else {\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\n }\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\n\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\n\n \/\/ RCA: 35mm offset, 10mm width 10mm height\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\n }\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\n cube([5,Crca_r+2,Crca_r\/2+1]);\n }\n}\n\nmodule make_pcb() {\n translate(v=[box_w1,box_l1,pcb_h]) {\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\n }\n color(CONNcolor) {\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\n }\n make_topcomponents();\n}\n\n\/\/ put extra supports on free spaces, used beta board image\nmodule make_supports() {\n if (!bottomframe) {\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n }\n}\n\n\/\/ width,depth,height,boxthickness,ledgethickness\nmodule make_case(w,d,h,bt,lt) {\n dt=bt+lt; \/\/ box+ledge thickness\n bt2=bt+bt; \/\/ 2x box thickness\n \/\/ Now we just substract the shape we have created in the four corners\n color(CASEcolor) difference() {\n cube([w,d,h], center=false);\n if (rounded) {\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\n }\n \/\/ empty inside, but keep a ledge for strength\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\n \/\/ remove bottom and top deck\n translate(v = [box_thickness+2, box_thickness+5,-2]) {\n cube([inside_w-4, inside_l-10, box_h+4], center = false);\n }\n }\n if (!topframe) {\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,middle=topmiddle,screwholes=false,top=true);\n }\n if (!bottomframe) {\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,screwholes=bottomscrew,middle=false,top=false);\n if (bottomsupport) {\n make_supports();\n }\n }\n}\n\nmodule make_stud(x,y,z,w,h,l) {\n translate(v = [x, y, z]) cube([w, l, h], center = false);\n}\n\nmodule set_cutout(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\n}\n\nmodule set_cutoutv(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\n}\n\nmodule draw_pcbhold() {\n if (bottomclick) {\n color(CASEcolor) {\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\n difference() {\n cube([1, 3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\n difference() {\n cube([1,3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1, 3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1,3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n }\n }\n}\n\nmodule split_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w1+Csd_x - 12; \/\/ min 16.5+28\n split4=box_w2 - 7;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\n}\n\nmodule remove_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12;\n possd1=box_w1 + Csd_x - 0.3;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\n \/\/ back on 3 different levels\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\n if (bottompcb) {\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\n }\n}\n\nmodule remove_bottom() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12.1;\n possd1=box_w1 + Csd_x - 0.2;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\n}\n\nmodule draw_case(bottom, top) {\n difference() {\n union() {\n \/\/ make empty case\n difference() {\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\n if (top != 0 && bottom == 0) remove_bottom();\n if (top == 0 && bottom != 0) remove_top();\n }\n color(CASEcolor) {\n if (bottom != 0 ) {\n \/\/ add bottom studs for pcb\n \/\/ add bottom studs for pcb\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\n\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\n\n\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n\n draw_pcbhold();\n }\n\n if (top != 0) {\n \/\/ --- screw connection plates\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\n }\n translate(v = [box_w2-15, box_l2 - 1.5, casesplit - 5.4]) {\n cube([8, 1.5, box_h-(casesplit-5.4)], center = false);\n }\n \/\/ extra support for shell\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\n\t\t\t\t\t }\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\n cube([stud_w,10, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n }\n } \/\/ color\n } \/\/ end union\n \/\/ conn plate hole\n color(CASEcolor) {\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n if (GPIOHOLE == 1 && bottom != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \n }\n if (GPIOHOLE == 2 && top != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \n }\n }\n if (bottom != 0) {\n if (top == 0) {\n remove_top();\n } else {\n split_top();\n }\n }\n make_connholes();\n }\n if (bottom) {\n draw_pcbhold();\n if (DRAWpcb == 1) make_pcb();\n }\n} \/\/ end module\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b5a03d7ea02860ce64b68d5b1a139dfe6cf97430","subject":"Mask panel improvements.","message":"Mask panel improvements.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ x-position of mask piece inside box\nmask_offset = 74;\nmask_loc = width - mask_offset - thickness\/2; \/\/ accounting for thickness of panel\n\/\/ dimensions for mask view opening\nview_opening_right = 80;\nview_opening_bottom = 28;\nview_opening_width = 190;\nview_opening_height = 91;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n \/\/vert_face(x=0); \/\/ \"near face, transparent for monitor\n \/\/vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n \/\/side(y=0);\n side(y=depth);\n tank_base();\n\/*\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n*\/\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_right+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, thickness, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ x-position of mask piece inside box\nmask_offset = 74;\nmask_loc = width - mask_offset - thickness\/2; \/\/ accounting for thickness of panel\n\/\/ dimensions for mask view opening\nview_opening_right = 80;\nview_opening_bottom = 28;\nview_opening_width = 190;\nview_opening_height = 91;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n \/\/vert_face(x=0); \/\/ \"near face, transparent for monitor\n \/\/vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n \/\/side(y=0);\n side(y=depth);\n tank_base();\n\/*\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n*\/\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=outset, bottom_offset=base_height+thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_right+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, thickness, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1b5f7c6cff95e38a06aa911950d9226cfd4213b1","subject":"[3d] Remove a bit extra from the top of the probe holster","message":"[3d] Remove a bit extra from the top of the probe holster\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/probewrap.scad","new_file":"3d\/probewrap.scad","new_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.5;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 0.75;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rotate_extrude(angle=180, $fn=45) translate([center_w\/2,0,0]) lip_poly(is_end, height);\n translate([0,(center_d-center_w)\/2,0]) \n rotate_extrude(angle=180, $fn=45) translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.15;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.12;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","old_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.45;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2-wall, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2-wall, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rotate_extrude(angle=180, $fn=45) translate([center_w\/2,0,0]) lip_poly(is_end, height);\n translate([0,(center_d-center_w)\/2,0]) \n rotate_extrude(angle=180, $fn=45) translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.15;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.12;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"28ace78078755a5d4352b4f57a5c2035a6f0a805","subject":"add a parameter for the number of sides in the pyramid","message":"add a parameter for the number of sides in the pyramid\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad","new_file":"openscad\/models\/src\/main\/openscad\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad","new_contents":"\r\n\/**\r\n * \r\n *\/\r\nmodule roundedPyramid(h, \r\n\t\t\t\t\t r1, \r\n\t\t\t\t\t r2, \r\n\t\t\t\t\t cornerRadius,\r\n\/\/TODO: clarify this parameter\r\n\t\t\t\t\t cylinderFn = 4,\t\t\t\t\t \r\n\t\t\t\t\t sides=30, \r\n\t\t\t\t\t sidesOnly=false)\r\n{\r\n\/\/TODO: clarify this parameter\r\n\t$fn=sides;\r\n\t\r\n\tminkowski()\r\n\t{\r\n\t\tcylinder(h=h, r1=r1, r2=r2, $fn=cylinderFn);\r\n\t \r\n\t if(sidesOnly)\r\n\t {\r\n\t \tcylinder(r=cornerRadius);\r\n\t }\r\n\t else\r\n\t {\r\n\t \tsphere(r=cornerRadius);\r\n\t \t\r\n \t}\r\n\t}\t\r\n}\r\n","old_contents":"\r\n\/**\r\n * \r\n *\/\r\nmodule roundedPyramid(h, r1, r2, cornerRadius, sides=30, sidesOnly=false)\r\n\/\/module roundedPyramid(size, cornerRadius, sides=30, sidesOnly=false)\r\n{\r\n\t$fn=sides;\r\n\t\r\n\tminkowski()\/\/size, cornerRadius)\r\n\t{\r\n\t\tcylinder(h=h, r1=r1, r2=r2, $fn=4);\r\n\t \r\n\t if(sidesOnly)\r\n\t {\r\n\t \tcylinder(r=cornerRadius);\r\n\t }\r\n\t else\r\n\t {\r\n\t \tsphere(r=cornerRadius);\r\n\t \t\r\n \t}\r\n\t}\t\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2537296eb2ad8c3a99a7c44c4e302ddb37300b92","subject":"make the cutout go all the way through","message":"make the cutout go all the way through\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/circle-attachement\/water-pump-filter.scad","new_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/circle-attachement\/water-pump-filter.scad","new_contents":"\nuse <..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule waterPumpFilter(baseHeight = 30,\n\t\t\t\t\t innerRadius = 25,\n\t\t\t\t\t snorkel = false,\n\t\t\t\t\t snorkelHeight = 40,\n\t\t\t\t\t snorkelOuterRadius = 7,\n\t\t\t\t\t xLength = 54)\n{\n\tunion()\n\t{\n\t\tzTranslate = baseHeight \/ 2.0;\n\t\ttranslate([0,0, zTranslate-0.1])\n\t\twaterPumpFilter_connector(innerRadius = innerRadius);\n\n\n\t\tyLength = (innerRadius * 2) + 4;\n\t\twaterPumpFilter_base(height = baseHeight,\n\t\t\t\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t\t\t\t snorkel = snorkel,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius,\n\t\t\t\t\t\t\t xLength = xLength,\n\t\t\t\t\t\t\t yLength = yLength);\n\t}\n}\n\nmodule waterPumpFilter_connector(innerRadius)\n{\n\topenCylinder(height = 5,\n\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t outerRadius = innerRadius + 2);\n}\n\nmodule waterPumpFilter_base(height,\n\t\t\t\t\t\t\tinnerRadius,\n\t\t\t\t\t\t\tsnorkel,\n\t\t\t\t\t\t\tsnorkelOuterRadius,\n\t\t\t\t\t\t\txLength,\n\t\t\t\t\t\t\tyLength)\n{\n\tdifference()\n\t{\n\t\t\/\/ this is the outer cube\n\t\tcube([xLength, yLength, height], center = true);\n\n\t\tcolor(\"pink\")\n\t\ttranslate([0,0,10])\n\t\tcylinder(r=innerRadius, h=30, center=true);\n\n\t\tinnerCubeDifference = 4;\n\t\tcolor(\"green\")\n\t\twaterPumpFilter_base_innerCube(xLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t yLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t height - innerCubeDifference);\n\n\t\tcutoutHeight = height - 4;\n\n\t\twaterPumpFilter_xCutouts(height = cutoutHeight,\n\t\t\t\t\t\t\t\t length = xLength - 8);\n\n\t\twaterPumpFilter_yCutouts(height = cutoutHeight);\n\n\t\tif(snorkel == true)\n\t\t{\n\t\t\twaterPump_snorkel(filter_baseHeight = height,\n\t\t\t\t\t\t\t filter_xLength = xLength,\n\t\t\t\t\t\t\t filter_yLength = yLength,\n\t\t\t\t\t\t\t height = 20,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius);\n\t\t}\n\t}\n}\n\nmodule waterPumpFilter_base_innerCube(xyLength, yLength, height)\n{\n\tcube([xyLength, yLength, height], center = true);\n}\n\nmodule waterPump_snorkel(filter_baseHeight,\n\t\t\t\t\t\t filter_xLength,\n\t\t\t\t\t\t filter_yLength,\n\t\t\t\t\t\t height,\n\t\t\t\t\t\t snorkelOuterRadius)\n{\n\txTranslate = (filter_xLength \/ 2.0) - snorkelOuterRadius - 2;\n\tyTranslate = (filter_yLength \/ 2.0) - snorkelOuterRadius -2;\n\tzTranslate = (filter_baseHeight \/ 2.0) - 4;\n\n\n\tcolor(\"green\")\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\tcylinder(h = height, r = snorkelOuterRadius, fn = 50);\n\n\ttranslate([-xTranslate, -yTranslate, zTranslate])\n\t\t\t cylinder(h = height, r = snorkelOuterRadius, $fn = 100);\n}\n\nmodule waterPumpFilter_xCutouts(height, length)\n{\n\tstep = 5;\n\n\tfor(x = [-length : step : length])\n\t{\n\t\ttranslate([x, 0, 0])\n\t\tcube([2, 100, height], center = true);\n\t}\n}\n\nmodule waterPumpFilter_yCutouts(height = 10, length = 20)\n{\n\tstep = 5;\n\n\tfor(y = [-length : step : length])\n\t{\n\t\ttranslate([0, y, 0])\n\t\tcube([101, 2, height], center = true);\n\t}\n}\n","old_contents":"\nuse <..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule waterPumpFilter(baseHeight = 30,\n\t\t\t\t\t innerRadius = 25,\n\t\t\t\t\t snorkel = false,\n\t\t\t\t\t snorkelHeight = 40,\n\t\t\t\t\t snorkelOuterRadius = 7,\n\t\t\t\t\t xLength = 54)\n{\n\tunion()\n\t{\n\t\tzTranslate = baseHeight \/ 2.0;\n\t\ttranslate([0,0, zTranslate-0.1])\n\t\twaterPumpFilter_connector(innerRadius = innerRadius);\n\n\n\t\tyLength = (innerRadius * 2) + 4;\n\t\twaterPumpFilter_base(height = baseHeight,\n\t\t\t\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t\t\t\t snorkel = snorkel,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius,\n\t\t\t\t\t\t\t xLength = xLength,\n\t\t\t\t\t\t\t yLength = yLength);\n\t}\n}\n\nmodule waterPumpFilter_connector(innerRadius)\n{\n\topenCylinder(height = 5,\n\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t outerRadius = innerRadius + 2);\n}\n\nmodule waterPumpFilter_base(height,\n\t\t\t\t\t\t\tinnerRadius,\n\t\t\t\t\t\t\tsnorkel,\n\t\t\t\t\t\t\tsnorkelOuterRadius,\n\t\t\t\t\t\t\txLength,\n\t\t\t\t\t\t\tyLength)\n{\n\tdifference()\n\t{\n\t\t\/\/ this is the outer cube\n\t\tcube([xLength, yLength, height], center = true);\n\n\t\tcolor(\"pink\")\n\t\ttranslate([0,0,10])\n\t\tcylinder(r=innerRadius, h=30, center=true);\n\n\t\tinnerCubeDifference = 4;\n\t\tcolor(\"green\")\n\t\twaterPumpFilter_base_innerCube(xLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t yLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t height - innerCubeDifference);\n\n\t\tcutoutHeight = height - 4;\n\n\t\twaterPumpFilter_xCutouts(height = cutoutHeight,\n\t\t\t\t\t\t\t\t length = xLength - 8);\n\n\t\twaterPumpFilter_yCutouts(height = cutoutHeight);\n\n\t\tif(snorkel == true)\n\t\t{\n\t\t\twaterPump_snorkel(filter_baseHeight = height,\n\t\t\t\t\t\t\t filter_xLength = xLength,\n\t\t\t\t\t\t\t filter_yLength = yLength,\n\t\t\t\t\t\t\t height = 20,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius);\n\t\t}\n\t}\n}\n\nmodule waterPumpFilter_base_innerCube(xyLength, yLength, height)\n{\n\tcube([xyLength, yLength, height], center = true);\n}\n\nmodule waterPump_snorkel(filter_baseHeight,\n\t\t\t\t\t\t filter_xLength,\n\t\t\t\t\t\t filter_yLength,\n\t\t\t\t\t\t height,\n\t\t\t\t\t\t snorkelOuterRadius)\n{\n\txTranslate = (filter_xLength \/ 2.0) - snorkelOuterRadius - 2;\n\tyTranslate = (filter_yLength \/ 2.0) - snorkelOuterRadius -2;\n\tzTranslate = (filter_baseHeight \/ 2.0) - 4;\n\n\n\tcolor(\"green\")\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\tcylinder(h = height, r = snorkelOuterRadius, fn = 50);\n\n\ttranslate([-xTranslate, -yTranslate, zTranslate])\n\t\t\t cylinder(h = height, r = snorkelOuterRadius, $fn = 100);\n}\n\nmodule waterPumpFilter_xCutouts(height, length)\n{\n\tstep = 5;\n\n\tfor(x = [-length : step : length])\n\t{\n\t\ttranslate([x, 0, 0])\n\t\tcube([2, 100, height], center = true);\n\t}\n}\n\nmodule waterPumpFilter_yCutouts(height = 10, length = 20)\n{\n\tstep = 5;\n\n\tfor(y = [-length : step : length])\n\t{\n\t\ttranslate([0, y, 0])\n\t\tcube([100, 2, height], center = true);\n\t}\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f7929d4a6c7bd4cb202607c090d58860cebdaceb","subject":"x\/carriage\/extruder\/guidler: use tx,ty,tz","message":"x\/carriage\/extruder\/guidler: use tx,ty,tz\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n ty(guidler_mount_off[1]-guidler_mount_d\/2)\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n ty(guidler_mount_off[1]-guidler_mount_d\/2)\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n ty(guidler_mount_off[1])\n tz(guidler_mount_off[2])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n ty(guidler_mount_off[1]-guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(x=[-1,1])\n tx(x*(guidler_screws_distance))\n ty(guidler_mount_off[1]-guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n ty(guidler_mount_off[1]-guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(x=[-1,1])\n tx(x*(guidler_screws_distance))\n ty(guidler_mount_off[1]-guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n ty(-7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n ty(guidler_mount_off[1])\n tz(guidler_mount_off[2])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n tx(-guidler_w\/2)\n ty(guidler_mount_off[1])\n tz(guidler_mount_off[1])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e1769ec9d6af68a0583553dea950169f4cb33a2e","subject":"x\/carriage: echo screw length","message":"x\/carriage: echo screw length\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1b0579093e174bb4ffc8b15ee8dca2052d549760","subject":"initial commit","message":"initial commit\n","repos":"kintel\/OpenSCAD-models","old_file":"horn.scad","new_file":"horn.scad","new_contents":"INCHES = 25.4;\n\nNUMBER = 2;\nDIAMETER = 60;\nHEIGHT = 120;\nTWIST = 0.5;\nDISTANCE = 0.4;\nHOLLOW = false;\nSCALE = 6\/8;\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST*360, scale=[SCALE, SCALE], convexity=3) child();\n}\n\nmodule part(item) {\n color(COLORS[(item+1)%NUM_COLORS]) extrudepart() newbase(item);\n}\n\nmodule inside() {\n color(COLORS[0]) extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\nif (!HOLLOW) inside();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'horn.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"d85a978763ac1bf82d138107a0a05133a62ace31","subject":"enclosure: add enclosure","message":"enclosure: add enclosure\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \n\ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n zmotor_mount_rod_clamp();\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n zmotor_mount_rod_clamp();\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount_rod_clamp()\n{\n difference()\n {\n union()\n {\n \/*cubea([zaxis_rod_d, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);*\/\n difference()\n {\n fncylindera(d=zaxis_rod_d*2, h=zmotor_mount_thickness_h, orient=[0,0,1], align=[0,0,0]);\n cubea([zaxis_rod_d+1, zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*2, zmotor_mount_thickness_h+1], align=[-1,0,0]);\n }\n cubea([zaxis_rod_d\/2, zmotor_mount_clamp_width, zmotor_mount_thickness_h], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*zmotor_mount_clamp_dist\/2, 0])\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=zmotor_mount_thickness*3, orient=[1,0,0]);\n\n \/\/ cut zrod\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmain();\n\n%enclosure();\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2-main_lower_dist_z-extrusion_size*2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \n\ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n zmotor_mount_rod_clamp();\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n zmotor_mount_rod_clamp();\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount_rod_clamp()\n{\n difference()\n {\n union()\n {\n \/*cubea([zaxis_rod_d, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);*\/\n difference()\n {\n fncylindera(d=zaxis_rod_d*2, h=zmotor_mount_thickness_h, orient=[0,0,1], align=[0,0,0]);\n cubea([zaxis_rod_d+1, zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*2, zmotor_mount_thickness_h+1], align=[-1,0,0]);\n }\n cubea([zaxis_rod_d\/2, zmotor_mount_clamp_width, zmotor_mount_thickness_h], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*zmotor_mount_clamp_dist\/2, 0])\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=zmotor_mount_thickness*3, orient=[1,0,0]);\n\n \/\/ cut zrod\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmain();\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b03fc89c6a9b3179f52ef39b28184ad43b54e85d","subject":"main\/y-axis: Add y-axis rod clamps","message":"main\/y-axis: Add y-axis rod clamps\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"aa4d3b39a1764343bf699e0dcd1b26d4630e5432","subject":"misc: add v_filter and tests","message":"misc: add v_filter and tests\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\nfunction v_filter(vec,val=U) = filter(vec,val);\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(filter(v, U), [0,1,2]);\n assert_v(filter(v, 1), [0,2]);\n}\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"13516379a22827114f6a3b17454e4ba210c9beb5","subject":"misc: add v_mul","message":"misc: add v_mul\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"235ca7aab31aede240ef05abfc4913982cdec225","subject":"This is code cleanup.","message":"This is code cleanup.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"javascad\/src\/main\/generated-openscad\/org\/onebeartoe\/modeling\/javascad\/light\/signals\/heart\/heart-light-signal-test-compiles.scad","new_file":"javascad\/src\/main\/generated-openscad\/org\/onebeartoe\/modeling\/javascad\/light\/signals\/heart\/heart-light-signal-test-compiles.scad","new_contents":"","old_contents":"use <..\/light-signal-test.scad>\n\n\/\/difference()\n{\n union() \n {\n translate([0,0,-1])\n\/\/ openCylinder();\n\n color([0,1,0])\n cylinder(h=2, r=18.6, center=true);\n }\n\n cube([5,5,5],center=true);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6be238750c553408331b1db2b80dda642aa52ec7","subject":"Code cleanup","message":"Code cleanup\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/pantilt.scad","new_file":"hardware\/pantilt.scad","new_contents":"\/\/$fn = 100;\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\ninclude < rpi.scad > ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nscrewDiam = 3;\nscrewLenght = 10;\nscrewTolerance = 0.2;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLenght = Pilength + mik + 3;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\n\n\n\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n \/\/translate([10,0,-thickness])\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n }\n }\n\n\/\/Baseplate for pan mechanism\nmodule base(servo) {\n difference() {\n\n {\n minkowski() {\n cylinder(r = R + mik, h = supportBaseHeight);\n rotate([90, 0, 0]) cylinder(r = mik, h = 1);\n }\n\n \/\/This to create a anchorign mechanism with the pan base\n \/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n }\n if (servo == true) translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n }\n }\n \/\/-------------------------\n\n\nmodule supportSection() {\n intersection() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n translate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n }\n }\n \/\/-------------------------\n\nmodule tiltSupport()\n \/\/This creates the supporting pillar for the camera shell\n {\n union() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n translate([-gimballWidth, 0, 0]) cube([2 * gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n\n hull() {\n translate([0, 0, -5]) supportSection();\n translate([0, 0, -supportZ]) supportSection();\n }\n }\n\n }\n\n\nmodule servoTiltSupport(xPos) {\n \/\/Need to center the servo shaft, the seconf figure is the distance form border\n supportPosition = xPos;\n eccentricity = 22.2 \/ 2 - 5;\n servoBodySupport = 20;\n \/\/Need to adjust the clearance to account for the Xpos\n servoClerance = 31 - 16 - servoHornThickness;\n supportCurvature = 30;\n\n rotate([-0, 0, 0]) difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 15]) {\n cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n }\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 15]) cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\n\n \/\/The size of the sphere governs where the servo support will be cut. Need to add tolerance if you wnat to print as one piece with the shell.\n sphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n }\n\n }\n\n translate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n }\n\n }\n }\n\n \/\/This is the slot in the servo arm\n translate([servoClerance + 10, 0, eccentricity]) {\n\n cube([20 + 1, 12, 32.2 + 1], center = true);\n translate([-31 \/ 2, 0, 0]) cube([31 + 1, 12, 22.2 + 1], center = true);\n\n }\n }\n\n\n translate([0, 0, 0])\n difference() {\n translate([3, 0, +RatX(xPos) - 10])\n difference() {\n cube([20, 20, 20], center = true);\n translate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20);\n }\n\n difference() {\n sphere(RatX(gimballWidth \/ 2) + 10 * shellThickness + tolerance);\n\n sphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n }\n }\n\n }\n \/\/-------------------------\nmodule cameraSupport() {\n difference() {\n difference() {\n sphere(R);\n sphere(R - shellThickness);\n }\n\n translate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n translate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n \/\/Creates camera support\n translate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n translate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n \/\/Slot for camera wires\n translate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n \/\/Hole for the camera\n translate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + tolerance, 10, PIcameraDiam + tolerance], center = true);\n }\n\n \/\/Need to hardwire the servo dimensions\n\n {\n servoTiltSupport(gimballWidth \/ 2);\n\n\n }\n \/\/pivot mechanism\n translate([-gimballWidth \/ 2, 0, 0]) {\n difference() {\n rotate([0, 90, 0]) cylinder(r = panSupport, h = shellThickness);\n gimballPivot(1);\n rotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n }\n gimballPivot(1);\n }\n }\n \/\/-------------------------\n\nmodule servoHorn(type) {\n cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n if (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n }\n \/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n rotate([0, 90, 0])\n difference() {\n cylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n cylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n }\n }\n \/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance) \/ R;\n\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n SUB_servocableDuct();\n }\n\n \/\/Need to cut holes in the base for servo and camera cables and the screws\n translate([0, 0, -supportBaseHeight \/ 2])\n difference() {\n\n {\n color(\"blue\", 0.5) translate([0, 0, -supportZ - supportBaseHeight]) base(true);\n SUB_cameracableDuct();\n SUB_servocableDuct();\n translate([0, 0, +supportBaseHeight \/ 2]) mirror([1, 0, 0]) tiltSupport();\n SUB_mountedPillarScrewHoles();\n }\n\n }\n}\n\nmodule mountedPillar() {\n \/\/Pillar for camera. This one needs to be mounted separately\n difference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n SUB_mountedPillarScrewHoles();\n }\n\n }\n}\n\nmodule SUB_screw(tolerance) {\n cylinder(r = screwDiam \/ 2 + tolerance, h = screwLenght);\n translate([0, 0, -3]) cylinder(r = 2 * screwDiam \/ 2 + screwTolerance, h = 3);\n}\n\nmodule SUB_mountedPillarScrewHoles() {\n color(\"blue\", 0.5) translate([-R + supportX \/ 2 + 2, 0, -supportZ - screwLenght \/ 2]) {\n translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n mirror([0, 1, 0]) translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n }\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n translate([+gimballWidth \/ 2 + supportX \/ 4 + 2, -supportX \/ 3, -3]) {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 4, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 4, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 170]) cylinder(r = supportX \/ 4, h = 0.8 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct() {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n }\n \/\/---------------------------\n\n\n\n\nmodule connectionSocket() {\n\n cylinder(r = 3, h = 5);\n translate([-9, -3 \/ 2, 0]) cube([10, 3, 5]);\n\n}\n\nmodule mhole() {\n cylinder(r = 3 \/ 2 - 0.2, h = 2 * Piheight + 8, $fs = 0.1);\n}\n\n\n\nmodule case () {\n translate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n difference() {\n minkowski() {\n box(boxLength, boxDepth, boxHeight, shellThickness - mik, \"PI\");\n \/\/sphere(r = mik);\n cylinder(r = mik, h = 2);\n }\n translate([R - 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([R - 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([0, 0, -boxHeight \/ 2 - 5 \/ 2]) cylinder(r = 3, h = 5);\n\n\n translate([-Pilength \/ 2, -Piwidth \/ 2, -boxHeight \/ 2 + 5 + shellThickness]) {\n rpi();\n }\n }\n translate([-Pilength \/ 2, -Piwidth \/ 2, -boxHeight \/ 2 + 5 + shellThickness]) {\n translate([25.5, 18, -(+5 + shellThickness)]) mhole();\n translate([length - 5, width - 12.5, -(+5 + shellThickness)]) mhole();\n\n }\n }\n}\n\n\n\/\/mountedPillar();\n\/\/mirror([1, 0, 0])tiltSupport();\n\/\/SUB_mountedPillarScrewHoles();\n\/\/servoTiltSupport(15);\n\/\/cameraSupport();\n\n\/\/translate([-10, 0, 0])\n\/\/support();\n\n\ntopCoverHeight = 15;\ndifference() {\n {\n translate([0, 0, -supportZ - supportBaseHeight - topCoverHeight \/ 2]) cube([boxLenght + mik, boxDepth, topCoverHeight], center = true);\n translate([0, 0, -supportZ - supportBaseHeight]) {\n base(\"false\");\n scale([0.8, 0.8, 30]) base(\"false\");\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/pantilt.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"93bdf34d406fb97466a604264f19da519d97ef4e","subject":"Add shape link","message":"Add shape link\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/rounded.scad","new_file":"shape\/3D\/rounded.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2019 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rounded shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a 3D rounded shape.\n *\n * @param Number|Vector [r] - The radius of the rounded part or a vector that contains radius for each dimensions.\n * @param Number|Vector [d] - The diameter of the rounded part or a vector that contains diameters for each dimensions.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns the radius vector.\n *\/\nfunction sizeRounded3D(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n d[0] && !rx ? d[0] \/ 2 : r[0],\n d[1] && !ry ? d[1] \/ 2 : r[1],\n d[2] && !rz ? d[2] \/ 2 : r[2]\n ]\n;\n\n\/**\n * Computes the size of an arch box.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeArchBox(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1]),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a stadium shape.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeSlot(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a cushion shape.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeCushion(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n radius = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1])\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n radius = [\n min(max(size[0], size[1]) \/ 2, c[0]),\n min(size[2] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n verRadius = size[2] \/ 2,\n radius = [\n min(max(size[0], size[1]) \/ 2, or(c[0], verRadius)),\n verRadius\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the points that draw the sketch of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] - radius[1]\n ],\n points = arc(r=radius, o=center, a=RIGHT)\n )\n complete(points, [radius[0], 0], [0, 0])\n;\n\n\/**\n * Computes the points that draw the sketch of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] \/ 2 - radius[1]\n ]\n )\n center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :concat(\n arc(r=radius, o=-center, a=RIGHT, a1=-RIGHT),\n arc(r=radius, o=center, a=RIGHT)\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n right = max(size[0], size[1]) \/ 2,\n top = size[2] \/ 2,\n center = [\n right - radius[0],\n top - radius[1]\n ]\n )\n radius == [0, 0] ? [ [right, top], [0, top], [0, -top], [right, -top] ]\n :center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :complete(\n concat(\n arc(r=radius, o=[center[0], -center[1]], a1=QUADRANT_3, a2=QUADRANT_4),\n arc(r=radius, o=center, a1=0, a2=QUADRANT_1)\n ),\n [0, -top],\n [0, top]\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n max(size[0], size[1]) \/ 2 - radius[0], 0\n ],\n points = arc(r=radius, o=center, a1=-RIGHT, a2=RIGHT)\n )\n center == [0, 0] ? points\n :complete(points, -[0, radius[1]], [0, radius[1]])\n;\n\n\/**\n * Creates an arch box at the origin.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule archBox(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeArchBox(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n arch(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a slot shape at the origin.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule slot(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeSlot(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n stadium(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a cushion shape at the origin.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule cushion(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeCushion(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n roundedRectangle(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a bullet shape at the origin.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule bullet(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawBullet(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a pill shape at the origin.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pill(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPill(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a peg shape at the origin.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule peg(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPeg(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a plate shape at the origin.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule plate(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPlate(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a rounded corner wedge at the origin.\n * For now the function can only handle square corner.\n *\n * @param Number [size] - The size of the corner.\n * @param Number [r] - The radius of the round.\n * @param Number [h] - The height of the solid.\n * @param Number [d] - The diameter of the round.\n * @param String|Vector [p] - The position of the corner, as a cardinal point (default: \"ne\", aka North East).\n * @param Boolean [convex] - Whether makes a convex corner (default: false).\n * @param Number [adjust] - An adjust value added to the size in order to fix wall alignment issue.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule roundedCornerWedge(size, r, h, d, p, convex, adjust, center) {\n linear_extrude(height=divisor(h), center=center, convexity=10) {\n roundedCorner(size=size, r=r, d=d, p=p, convex=convex, adjust=adjust);\n }\n}\n\n\/**\n * Draws a link.\n * @param Vector|Number neck - The size of the link neck.\n * @param Vector|Number bulk - The size of the link bulb.\n * @param Number Height - The thickness of the link.\n * @param Number [w] - The width of the neck.\n * @param Number [h] - The height of the neck.\n * @param Number [rx] - The horizontal radius of the bulb.\n * @param Number [ry] - The vertical radius of the bulb.\n * @param Number [dx] - The horizontal diameter of the bulb.\n * @param Number [dy] - The vertical diameter of the bulb.\n * @param Number [distance] - An additional distance added to the outline of the profile.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule link(neck, bulb, height, w, h, rx, ry, dx, dy, distance = 0, center=false) {\n linear_extrude(height=height, center=center, convexity=10) {\n linkProfile(\n neck = neck,\n bulb = bulb,\n w = w,\n h = h,\n rx = rx,\n ry = ry,\n dx = dx,\n dy = dy,\n distance = distance\n );\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2019 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rounded shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a 3D rounded shape.\n *\n * @param Number|Vector [r] - The radius of the rounded part or a vector that contains radius for each dimensions.\n * @param Number|Vector [d] - The diameter of the rounded part or a vector that contains diameters for each dimensions.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns the radius vector.\n *\/\nfunction sizeRounded3D(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n d[0] && !rx ? d[0] \/ 2 : r[0],\n d[1] && !ry ? d[1] \/ 2 : r[1],\n d[2] && !rz ? d[2] \/ 2 : r[2]\n ]\n;\n\n\/**\n * Computes the size of an arch box.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeArchBox(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1]),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a stadium shape.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeSlot(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a cushion shape.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeCushion(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n radius = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1])\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n radius = [\n min(max(size[0], size[1]) \/ 2, c[0]),\n min(size[2] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n verRadius = size[2] \/ 2,\n radius = [\n min(max(size[0], size[1]) \/ 2, or(c[0], verRadius)),\n verRadius\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the points that draw the sketch of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] - radius[1]\n ],\n points = arc(r=radius, o=center, a=RIGHT)\n )\n complete(points, [radius[0], 0], [0, 0])\n;\n\n\/**\n * Computes the points that draw the sketch of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] \/ 2 - radius[1]\n ]\n )\n center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :concat(\n arc(r=radius, o=-center, a=RIGHT, a1=-RIGHT),\n arc(r=radius, o=center, a=RIGHT)\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n right = max(size[0], size[1]) \/ 2,\n top = size[2] \/ 2,\n center = [\n right - radius[0],\n top - radius[1]\n ]\n )\n radius == [0, 0] ? [ [right, top], [0, top], [0, -top], [right, -top] ]\n :center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :complete(\n concat(\n arc(r=radius, o=[center[0], -center[1]], a1=QUADRANT_3, a2=QUADRANT_4),\n arc(r=radius, o=center, a1=0, a2=QUADRANT_1)\n ),\n [0, -top],\n [0, top]\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n max(size[0], size[1]) \/ 2 - radius[0], 0\n ],\n points = arc(r=radius, o=center, a1=-RIGHT, a2=RIGHT)\n )\n center == [0, 0] ? points\n :complete(points, -[0, radius[1]], [0, radius[1]])\n;\n\n\/**\n * Creates an arch box at the origin.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule archBox(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeArchBox(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n arch(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a slot shape at the origin.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule slot(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeSlot(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n stadium(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a cushion shape at the origin.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule cushion(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeCushion(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n roundedRectangle(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a bullet shape at the origin.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule bullet(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawBullet(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a pill shape at the origin.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pill(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPill(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a peg shape at the origin.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule peg(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPeg(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a plate shape at the origin.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule plate(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPlate(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a rounded corner wedge at the origin.\n * For now the function can only handle square corner.\n *\n * @param Number [size] - The size of the corner.\n * @param Number [r] - The radius of the round.\n * @param Number [h] - The height of the solid.\n * @param Number [d] - The diameter of the round.\n * @param String|Vector [p] - The position of the corner, as a cardinal point (default: \"ne\", aka North East).\n * @param Boolean [convex] - Whether makes a convex corner (default: false).\n * @param Number [adjust] - An adjust value added to the size in order to fix wall alignment issue.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule roundedCornerWedge(size, r, h, d, p, convex, adjust, center) {\n linear_extrude(height=divisor(h), center=center, convexity=10) {\n roundedCorner(size=size, r=r, d=d, p=p, convex=convex, adjust=adjust);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fdaa509df2f736556350d1bc95b4872452c04237","subject":"added spacer test","message":"added spacer test\n","repos":"fponticelli\/smallbridges","old_file":"scad\/ob_spacer.scad","new_file":"scad\/ob_spacer.scad","new_contents":"include \nuse ;\nuse ;\n\nmodule ob_spacer(length = 1) {\n bom(str(\"ob-alu-spacer-\",length), str(\"Aluminum Spacer (\", length,\")\"), [\"hardware\"]);\n color(Aluminum)\n difference() {\n cylinder(length, 5, 5);\n translate([0, 0, -length\/2])\n cylinder(length*2, 2.55, 2.55);\n }\n}\n\nmodule ob_eccentric_spacer() {\n bom(\"ob-eccentric-spacer\", \"Eccentric Spacer\", [\"hardware\"]);\n length = 6.35;\n length2 = 2.5;\n lengtht = length + length2;\n m5 = 5;\n diam = 7.11;\n center_offset = 0.79;\n color(Steel)\n difference() {\n union() {\n translate([0,0,length\/2])\n scale([1,1,length])\n hexagon(5.774);\n translate([0,0,-length2])\n cylinder(length2,diam\/2,diam\/2);\n }\n translate([center_offset,0,-lengtht])\n cylinder(lengtht*2,m5\/2,m5\/2);\n }\n}\n\nmodule ob_spacer_test() {\n ob_spacer(6);\n translate([30, 0, 0])\n ob_eccentric_spacer();\n}\n\nob_spacer_test();","old_contents":"include \ninclude \nuse ;\n\nmodule ob_spacer(length = 1) {\n bom(str(\"ob-alu-spacer-\",length), str(\"Aluminum Spacer (\", length,\")\"), [\"hardware\"]);\n color(Aluminum)\n difference() {\n cylinder(length, 5, 5);\n translate([0, 0, -length\/2])\n cylinder(length*2, 2.55, 2.55);\n }\n}\n\nmodule ob_eccentric_spacer() {\n bom(\"ob-eccentric-spacer\", \"Eccentric Spacer\", [\"hardware\"]);\n length = 6.35;\n length2 = 2.5;\n lengtht = length + length2;\n m5 = 5;\n diam = 7.11;\n center_offset = 0.79;\n color(Steel)\n difference() {\n union() {\n translate([0,0,length\/2])\n scale([1,1,length])\n hexagon(5.774);\n translate([0,0,-length2])\n cylinder(length2,diam\/2,diam\/2);\n }\n translate([center_offset,0,-lengtht])\n cylinder(lengtht*2,m5\/2,m5\/2);\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f21b98da4bb143f4ccba84b0777d99f9ca672c2e","subject":"shapes\/rcylinder: fix radius error","message":"shapes\/rcylinder: fix radius error\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r\/2, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"55feab422ad48da739a4ba1dcf5090cd9ca1e668","subject":"increased support disk size a bit, to make it more rigid","message":"increased support disk size a bit, to make it more rigid\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roll_handle\/kite_roll_handle.scad","new_file":"kite_roll_handle\/kite_roll_handle.scad","new_contents":"$fn=120;\n\nmodule main_handle_()\n{\n cylinder(r=18\/2, h=120);\n translate([0, 0, 120])\n {\n translate([0, 0, -10])\n cylinder(r1=18\/2, r2=30\/2, h=10);\n difference()\n {\n cylinder(r=(8.5-0.5)\/2, h=22+2+10);\n translate([-5, 0, 22+2+5.5])\n rotate([0, 90, 0])\n cylinder(r=(3+0.5)\/2, h=10);\n }\n }\n}\n\nmodule nut_(h)\n{\n block_size=[3.5, 5.5, h];\n n=3;\n hull()\n for(i=[0:n-1])\n rotate(i*[0, 0, 360\/n\/2])\n translate([block_size[0], block_size[1], 0]*-1\/2)\n cube(block_size);\n}\n\nmodule nut_space_()\n{\n scale([1.2, 1.2, 1.2])\n nut_(2.5);\n}\n\nmodule block_()\n{\n difference()\n {\n union()\n {\n cylinder(r=30\/2, h=1);\n cylinder(r=15\/2, h=10);\n }\n cylinder(r=8.5\/2, h=20);\n translate([0, 0, 5.5])\n rotate([0, 90, 0])\n {\n translate([0, 0, 5])\n nut_space_();\n translate([0, 0, -10])\n cylinder(r=3.5\/2, h=20);\n }\n }\n}\n\nfor(i=[0:1])\n translate(i*[0, 35, 0])\n {\n main_handle_();\n translate([27, 0, 0])\n block_();\n }\n","old_contents":"$fn=120;\n\nmodule main_handle_()\n{\n cylinder(r=18\/2, h=120);\n translate([0, 0, 120])\n {\n translate([0, 0, -10])\n cylinder(r1=18\/2, r2=30\/2, h=10);\n difference()\n {\n cylinder(r=(8.5-0.5)\/2, h=22+2+10);\n translate([-5, 0, 22+2+5])\n rotate([0, 90, 0])\n cylinder(r=(3+0.5)\/2, h=10);\n }\n }\n}\n\nmodule nut_(h)\n{\n block_size=[3.5, 5.5, h];\n n=3;\n hull()\n for(i=[0:n-1])\n rotate(i*[0, 0, 360\/n\/2])\n translate([block_size[0], block_size[1], 0]*-1\/2)\n cube(block_size);\n}\n\nmodule nut_space_()\n{\n scale([1.2, 1.2, 1.2])\n nut_(2.5);\n}\n\nmodule block_()\n{\n difference()\n {\n union()\n {\n cylinder(r=30\/2, h=0.6);\n cylinder(r=15\/2, h=10);\n }\n cylinder(r=8.5\/2, h=20);\n translate([0, 0, 5])\n rotate([0, 90, 0])\n {\n translate([0, 0, 5])\n nut_space_();\n translate([0, 0, -10])\n cylinder(r=3.5\/2, h=20);\n }\n }\n}\n\nfor(i=[0:1])\n translate(i*[0, 35, 0])\n {\n main_handle_();\n translate([27, 0, 0])\n block_();\n }\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"41cc8973b015b4426b04329e00ca473529583a7c","subject":"added routes for wires","message":"added routes for wires\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 6.5;\nphotoresistorLength = 6.5;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 8;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth + stringWallThickness * 2], center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth + stringWallThickness * 2], center=false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 2;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5;\nphotoresistorLength = 4;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6;\nledLaserLength = 10;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,stringWallThickness + .1])\n cylinder(h = stringRecess + stringWallThickness + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,stringWallThickness + .1])\n cylinder(h = ledLaserLength + stringWallThickness + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9cdc50910858c700b9102d186e587003a4505aed","subject":"fixup! zaxis\/motor_mount: fix bug where z rods were not aligned correctly","message":"fixup! zaxis\/motor_mount: fix bug where z rods were not aligned correctly\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"267ede94fd40253e1facac6c94eac2375a9e9ec8","subject":"nipple central","message":"nipple central\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/nipple.scad","new_file":"class1\/exercise\/refactor\/nipple.scad","new_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\n\nmodule shoulder_top_little()\n{\n position_ring = [0,0,-BORDER_NIPPLE];\n \n posicion_circle_x = radius(DIAMETER_NIPPLE)-BORDER_NIPPLE;\n position_circle = [posicion_circle_x, 0, 0];\n \n color(GREY)\n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\n\nmodule body_central()\n{\n position_z = BORDER_NIPPLE - HEIGHT_NIPPLE;\n position = [0,0,position_z];\n \n height = HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE);\n \n color(GREY)\n translate(position)\n cylinder(\n h = height,\n d = DIAMETER_NIPPLE,\n $fn = FINE); \n}\n\nmodule nipple()\n{\n top_little();\n shoulder_top_little();\n body_central();\n\n \n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = FINE);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n \n} \n\nnipple();\n","old_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\n\nmodule shoulder_top_little()\n{\n position_ring = [0,0,-BORDER_NIPPLE];\n \n posicion_circle_x = radius(DIAMETER_NIPPLE)-BORDER_NIPPLE;\n position_circle = [posicion_circle_x, 0, 0];\n \n color(GREY)\n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\n\n\nmodule nipple()\n{\n top_little();\n shoulder_top_little();\n \n\n \n \n\/\/Main nipple cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = FINE);\n\n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = FINE);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n \n} \n\nnipple();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e950b676986f1df7d955f605ff5439893b68f0a1","subject":"[Case]: Move holes higher so it's hopefully not necessary to use file","message":"[Case]: Move holes higher so it's hopefully not necessary to use file\n","repos":"nenadalm\/diy","old_file":"raspicam\/case\/raspicam.scad","new_file":"raspicam\/case\/raspicam.scad","new_contents":"$fn = 32;\n\nthickness = 2.5;\n\n\/\/ raspberry pi\ncase_width = 85;\ncase_height = 56;\ncase_radius = 3;\ncase_hole_d = 2.75;\ncase_hole_d2 = 6.2;\nraspi_thickness = 1.3;\ncase_depth = 22;\ncase_margin = 10;\n\nbox();\n\/\/bottom_part_print();\n\/\/right_part_print();\n\/\/front_part_print();\n\/\/left_part_print();\n\/\/rear_part_print();\n\/\/top_part_print();\n\/\/cam_holder();\n\nmodule cam_holder() {\n\tdepth = 3;\n\twidth = 14.15;\n\theight = 14.15;\n\thole_d = 7.45;\n\thole_r = hole_d \/ 2;\n\n\tlens_width = 7.9;\n\tlens_height = 7.9;\n\tlens_depth = 5.25;\n\n\tdifference() {\n\t\tcube([width, height, lens_depth]);\n\t\ttranslate([width \/ 2 - lens_width \/ 2, height \/ 2 - lens_height \/ 2, 0])\n\t\t\tcube([lens_width, lens_height, lens_depth]);\n\t}\n}\n\nmodule box() {\n\trear_part();\n\tfront_part();\n\tright_part();\n\tleft_part();\n\tbottom_part();\n\ttop_part();\n}\n\nmodule top_part_print() {\n\ttranslate([0, 0, -case_depth - thickness])\n\t\ttop_part();\n}\n\nmodule rear_part_print() {\n\ttranslate([0, 0, case_width + thickness])\n\t\trotate([0, 90, 0])\n\t\t\tdifference() {\n\t\t\t\trear_part();\n\t\t\t\tleft_part();\n\t\t\t\tright_part();\n\t\t\t}\n}\n\nmodule left_part_print() {\n\ttranslate([0, 0, thickness])\n\t\trotate([90, 0, 0])\n\t\t\tdifference() {\n\t\t\t\tleft_part();\n\t\t\t\tbottom_part();\n\t\t\t\ttop_part();\n\t\t\t}\n}\n\nmodule right_part_print() {\n\ttranslate([0, 0, case_height + thickness])\n\t\trotate([-90, 0, 0])\n\t\tdifference() {\n\t\t\tright_part();\n\t\t\tbottom_part();\n\t\t\ttop_part();\n\t\t}\n}\n\nmodule front_part_print() {\n\ttranslate([0, 0, thickness])\n\trotate([0, -90, 0])\n\t\tdifference() {\n\t\t\tfront_part();\n\t\t\tright_part();\n\t\t\ttranslate([0, -case_height - thickness,0])\n\t\t\t\tright_part();\n\t\t}\n}\n\nmodule bottom_part_print() {\n\tbottom_part();\n}\n\nmodule rear_part() {\n\theight = 5;\n\ttranslate([case_width, -2 * thickness, -thickness])\n\t\trotate([90, 0, 90]) {\n\t\t\tdifference() {\n\t\t\t\tround_cube([case_height + 4 * thickness, case_depth + 4 * thickness, thickness], case_radius);\n\t\t\t\ttranslate([0, case_depth - height \/ 4 - height, 0]) {\n\t\t\t\t\ttranslate([thickness + case_height + thickness, 2 * thickness, 0])\n\t\t\t\t\t\tcube([thickness, height \/ 4 + 2, thickness]);\n\t\t\t\t\ttranslate([thickness, 2 * thickness, 0])\n\t\t\t\t\t\tcube([thickness, height \/ 4, thickness + 10]);\n\t\t\t\t}\n\t\t\t\ttranslate([2 * thickness + ((case_height - 52) \/ 2), 2 * thickness + 2.2, -2])\n\t\t\t\t\tcube([52.5, 16, thickness + 4]);\n translate([2 * thickness + ((case_height - 52) \/ 2) + 52.5 - 33, 2 * thickness + 2.2 + 16, 0])\n cube([33 ,4, thickness]);\n\t\t\t}\n\t\t}\n}\n\nmodule front_part() {\n\ttranslate([-thickness, -2 * thickness, -thickness])\n\t\trotate([90, 0, 90]) {\n\t\t\tdifference() {\n\t\t\t\tround_cube([case_height + 4 * thickness, case_depth + 4 * thickness, thickness], case_radius);\n\t\t\t\ttranslate([2 * thickness + case_height \/ 2 - 10, 2 * thickness- 0.7, 0])\n\t\t\t\t\tcube([20, 2.9, 3.5]);\n\t\t\t\ttranslate([2 * thickness + 1.15, 2 * thickness + 8, 0])\n\t\t\t\t\tcube([20, 2.2, 3.5]);\n\t\t\t}\n\t\t}\n}\n\nmodule top_part() {\n\twidth = 20;\n\toffset = 10;\n\n\tswitcher_width = 45;\n\tswitcher_height = 42;\n\tswitcher_board_thickness = 1.6;\n\tswitcher_margin_bottom = 2.2;\n\tparts_depth = 9;\n\n\ttranslate ([0, 0, case_depth + thickness]) {\n\t\tdifference() {\n\t\t\tround_cube([case_width, case_height, thickness], case_radius);\n\t\t\ttranslate([11, switcher_height + 2 * thickness, 0]) {\n union() {\n translate([0, 2.8, 0])\n cube([23.7, 2.8, thickness]);\n cube([switcher_width + 2 * thickness, 4, thickness]);\n }\n }\n\t\t}\n\n\t\ttranslate([offset, - thickness, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\t\ttranslate([case_width - width - offset, - thickness, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\t\ttranslate([offset, - thickness + case_height, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\t\ttranslate([case_width - width - offset, - thickness + case_height, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\n\t\ttranslate([11, 0, thickness]) {\n\t\t\tdifference() {\n\t\t\t\tcube([2 * thickness + switcher_width, 2 * thickness + switcher_height, switcher_margin_bottom + switcher_board_thickness]);\n\t\t\t\ttranslate([thickness, thickness, 0])\n\t\t\t\t\tcube([switcher_width, switcher_height, switcher_margin_bottom + switcher_board_thickness]);\n\t\t\t}\n\n\t\t\ttranslate([thickness, thickness, 0]) {\n\t\t\t\tlinear_extrude(thickness) {\n\t\t\t\t\tpolygon([[0, 0], [0, 5], [5, 0]]);\n\t\t\t\t\tpolygon([[0, switcher_height], [0, switcher_height - 5], [5, switcher_height]]);\n\t\t\t\t\tpolygon([[switcher_width, 0], [switcher_width, 5], [switcher_width - 5, 0]]);\n\t\t\t\t\tpolygon([[switcher_width, switcher_height], [switcher_width - 5, switcher_height], [switcher_width, switcher_height - 5]]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule left_part() {\n\twidth = 10;\n\theight = 5;\n\toffset = 5;\n\tradius = 2.5;\n\n\ttranslate([0, 0, -thickness])\n\t\trotate([90, 0, 0]) {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tround_cube([case_width, case_depth + thickness * 4, thickness], case_radius);\n\t\t\t\t\ttranslate([-width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([-width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttranslate([case_width -width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -height \/ 5, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t\ttranslate([6, 2 * thickness + 2.2 + raspi_thickness, 0])\n\t\t\t\t\tcube([case_width - 25 - 6, 7, thickness]);\n translate([6 - 0.3, 2 * thickness + 2.2 + raspi_thickness - 0.3, 0])\n\t\t\t\t\tcube([8, 3, thickness]);\n\t\t\t\ttranslate([-width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -width, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset - height \/ 5, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\nmodule right_part() {\n\twidth = 10;\n\theight = 5;\n\toffset = 5;\n\tradius = 2.5;\n\n\ttranslate([0, case_height + thickness, -thickness])\n\t\trotate([90, 0, 0]) {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tround_cube([case_width, case_depth + thickness * 4, thickness], case_radius);\n\t\t\t\t\ttranslate([-width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([-width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttranslate([-width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -width, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset - height \/ 5, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t\ttranslate([case_width -width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -height \/ 5, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\nmodule bottom_part() {\n\tround_cube([case_width, case_height, thickness], case_radius);\n\n\twidth = 20;\n\toffset = 10;\n\ttranslate([offset, - thickness, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\ttranslate([case_width - width - offset, - thickness, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\ttranslate([offset, - thickness + case_height, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\ttranslate([case_width - width - offset, - thickness + case_height, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\n\ttranslate([3.5, 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\ttranslate([3.5, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\ttranslate([3.5 + 58, 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\ttranslate([3.5 + 58, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\n\ttranslate([3.5, 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n\ttranslate([3.5, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n\ttranslate([3.5 + 58, 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n\ttranslate([3.5 + 58, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n}\n\nmodule round_cube(dimensions, radius) {\n\t\/\/ todo: doesn't work for smaller parts where d < x || d < y\n\tdiameter = 2 * radius;\n\tif (dimensions[0] < diameter || dimensions[1] < diameter) {\n\t\techo(\"[warning]: Round cubes with dimension lower than diameter doesn't works properly.\");\n\t}\n\n\thull() {\n\t\ttranslate([radius, radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t translate([dimensions[0] - radius, radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t\ttranslate([radius, dimensions[1] - radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t\ttranslate([dimensions[0] - radius, dimensions[1] - radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t\t}\n}","old_contents":"$fn = 32;\n\nthickness = 2.5;\n\n\/\/ raspberry pi\ncase_width = 85;\ncase_height = 56;\ncase_radius = 3;\ncase_hole_d = 2.75;\ncase_hole_d2 = 6.2;\nraspi_thickness = 1.3;\ncase_depth = 22;\ncase_margin = 10;\n\nbox();\n\/\/bottom_part_print();\n\/\/right_part_print();\n\/\/front_part_print();\n\/\/left_part_print();\n\/\/rear_part_print();\n\/\/top_part_print();\n\/\/cam_holder();\n\nmodule cam_holder() {\n\tdepth = 3;\n\twidth = 14.15;\n\theight = 14.15;\n\thole_d = 7.45;\n\thole_r = hole_d \/ 2;\n\n\tlens_width = 7.9;\n\tlens_height = 7.9;\n\tlens_depth = 5.25;\n\n\tdifference() {\n\t\tcube([width, height, lens_depth]);\n\t\ttranslate([width \/ 2 - lens_width \/ 2, height \/ 2 - lens_height \/ 2, 0])\n\t\t\tcube([lens_width, lens_height, lens_depth]);\n\t}\n}\n\nmodule box() {\n\trear_part();\n\tfront_part();\n\tright_part();\n\tleft_part();\n\tbottom_part();\n\ttop_part();\n}\n\nmodule top_part_print() {\n\ttranslate([0, 0, -case_depth - thickness])\n\t\ttop_part();\n}\n\nmodule rear_part_print() {\n\ttranslate([0, 0, case_width + thickness])\n\t\trotate([0, 90, 0])\n\t\t\tdifference() {\n\t\t\t\trear_part();\n\t\t\t\tleft_part();\n\t\t\t\tright_part();\n\t\t\t}\n}\n\nmodule left_part_print() {\n\ttranslate([0, 0, thickness])\n\t\trotate([90, 0, 0])\n\t\t\tdifference() {\n\t\t\t\tleft_part();\n\t\t\t\tbottom_part();\n\t\t\t\ttop_part();\n\t\t\t}\n}\n\nmodule right_part_print() {\n\ttranslate([0, 0, case_height + thickness])\n\t\trotate([-90, 0, 0])\n\t\tdifference() {\n\t\t\tright_part();\n\t\t\tbottom_part();\n\t\t\ttop_part();\n\t\t}\n}\n\nmodule front_part_print() {\n\ttranslate([0, 0, thickness])\n\trotate([0, -90, 0])\n\t\tdifference() {\n\t\t\tfront_part();\n\t\t\tright_part();\n\t\t\ttranslate([0, -case_height - thickness,0])\n\t\t\t\tright_part();\n\t\t}\n}\n\nmodule bottom_part_print() {\n\tbottom_part();\n}\n\nmodule rear_part() {\n\theight = 5;\n\ttranslate([case_width, -2 * thickness, -thickness])\n\t\trotate([90, 0, 90]) {\n\t\t\tdifference() {\n\t\t\t\tround_cube([case_height + 4 * thickness, case_depth + 4 * thickness, thickness], case_radius);\n\t\t\t\ttranslate([0, case_depth - height \/ 4 - height, 0]) {\n\t\t\t\t\ttranslate([thickness + case_height + thickness, 2 * thickness, 0])\n\t\t\t\t\t\tcube([thickness, height \/ 4 + 2, thickness]);\n\t\t\t\t\ttranslate([thickness, 2 * thickness, 0])\n\t\t\t\t\t\tcube([thickness, height \/ 4, thickness + 10]);\n\t\t\t\t}\n\t\t\t\ttranslate([2 * thickness + ((case_height - 52) \/ 2), 2 * thickness + 2.2, -2])\n\t\t\t\t\tcube([52, 16, thickness + 4]);\n\t\t\t}\n\t\t}\n}\n\nmodule front_part() {\n\ttranslate([-thickness, -2 * thickness, -thickness])\n\t\trotate([90, 0, 90]) {\n\t\t\tdifference() {\n\t\t\t\tround_cube([case_height + 4 * thickness, case_depth + 4 * thickness, thickness], case_radius);\n\t\t\t\ttranslate([2 * thickness + case_height \/ 2 - 10, 2 * thickness, 0])\n\t\t\t\t\tcube([20, 2.2, 3.5]);\n\t\t\t\ttranslate([2 * thickness + 1.15, 2 * thickness + 8, 0])\n\t\t\t\t\tcube([20, 2.2, 3.5]);\n\t\t\t}\n\t\t}\n}\n\nmodule top_part() {\n\twidth = 20;\n\toffset = 10;\n\n\tswitcher_width = 45;\n\tswitcher_height = 42;\n\tswitcher_board_thickness = 1.6;\n\tswitcher_margin_bottom = 2.2;\n\tparts_depth = 9;\n\n\ttranslate ([0, 0, case_depth + thickness]) {\n\t\tdifference() {\n\t\t\tround_cube([case_width, case_height, thickness], case_radius);\n\t\t\ttranslate([11, switcher_height + 2 * thickness, 0])\n\t\t\t\tcube([switcher_width + 2 * thickness, 4, thickness]);\n\t\t}\n\n\t\ttranslate([offset, - thickness, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\t\ttranslate([case_width - width - offset, - thickness, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\t\ttranslate([offset, - thickness + case_height, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\t\ttranslate([case_width - width - offset, - thickness + case_height, 0])\n\t\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\n\t\ttranslate([11, 0, thickness]) {\n\t\t\tdifference() {\n\t\t\t\tcube([2 * thickness + switcher_width, 2 * thickness + switcher_height, switcher_margin_bottom + switcher_board_thickness]);\n\t\t\t\ttranslate([thickness, thickness, 0])\n\t\t\t\t\tcube([switcher_width, switcher_height, switcher_margin_bottom + switcher_board_thickness]);\n\t\t\t}\n\n\t\t\ttranslate([thickness, thickness, 0]) {\n\t\t\t\tlinear_extrude(thickness) {\n\t\t\t\t\tpolygon([[0, 0], [0, 5], [5, 0]]);\n\t\t\t\t\tpolygon([[0, switcher_height], [0, switcher_height - 5], [5, switcher_height]]);\n\t\t\t\t\tpolygon([[switcher_width, 0], [switcher_width, 5], [switcher_width - 5, 0]]);\n\t\t\t\t\tpolygon([[switcher_width, switcher_height], [switcher_width - 5, switcher_height], [switcher_width, switcher_height - 5]]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule left_part() {\n\twidth = 10;\n\theight = 5;\n\toffset = 5;\n\tradius = 2.5;\n\n\ttranslate([0, 0, -thickness])\n\t\trotate([90, 0, 0]) {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tround_cube([case_width, case_depth + thickness * 4, thickness], case_radius);\n\t\t\t\t\ttranslate([-width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([-width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttranslate([case_width -width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -height \/ 5, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t\ttranslate([6, 2 * thickness + 2.2 + raspi_thickness, 0])\n\t\t\t\t\tcube([case_width - 25 - 6, 7, thickness]);\n\t\t\t\ttranslate([-width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -width, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset - height \/ 5, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\nmodule right_part() {\n\twidth = 10;\n\theight = 5;\n\toffset = 5;\n\tradius = 2.5;\n\n\ttranslate([0, case_height + thickness, -thickness])\n\t\trotate([90, 0, 0]) {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tround_cube([case_width, case_depth + thickness * 4, thickness], case_radius);\n\t\t\t\t\ttranslate([-width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, 0, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([-width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2 - thickness, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t\ttranslate([case_width -width \/ 2, case_depth + thickness * 2 - offset, 0])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tround_cube([width, height, thickness], radius);\n\t\t\t\t\t\t\ttranslate([width \/ 2, height - height \/ 4, 0])\n\t\t\t\t\t\t\t\tcube([thickness, height \/ 4, thickness]);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttranslate([-width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -width, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset - height \/ 5, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t\ttranslate([case_width -width \/ 2, offset, 0]) {\n\t\t\t\t\ttranslate([0, height \/ 2.5, 0])\n\t\t\t\t\t\tcube([width, height \/ 5, thickness]);\n\t\t\t\t\trotate([0, 0, 90])\n\t\t\t\t\t\ttranslate([1 - height \/ 2 - offset + 3 * (height \/ 5), -height \/ 5, 0])\n\t\t\t\t\t\t\tcube([-1 + height \/ 2 + offset, height \/ 5, thickness]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n\nmodule bottom_part() {\n\tround_cube([case_width, case_height, thickness], case_radius);\n\n\twidth = 20;\n\toffset = 10;\n\ttranslate([offset, - thickness, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\ttranslate([case_width - width - offset, - thickness, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\ttranslate([offset, - thickness + case_height, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\ttranslate([case_width - width - offset, - thickness + case_height, 0])\n\t\tround_cube([width, thickness * 2, thickness], case_radius);\n\n\ttranslate([3.5, 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\ttranslate([3.5, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\ttranslate([3.5 + 58, 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\ttranslate([3.5 + 58, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2, d = case_hole_d2);\n\n\ttranslate([3.5, 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n\ttranslate([3.5, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n\ttranslate([3.5 + 58, 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n\ttranslate([3.5 + 58, case_height - 3.5, 0])\n\t\tcylinder(thickness + 2.2 + raspi_thickness, d = case_hole_d);\n}\n\nmodule round_cube(dimensions, radius) {\n\t\/\/ todo: doesn't work for smaller parts where d < x || d < y\n\tdiameter = 2 * radius;\n\tif (dimensions[0] < diameter || dimensions[1] < diameter) {\n\t\techo(\"[warning]: Round cubes with dimension lower than diameter doesn't works properly.\");\n\t}\n\n\thull() {\n\t\ttranslate([radius, radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t translate([dimensions[0] - radius, radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t\ttranslate([radius, dimensions[1] - radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t\ttranslate([dimensions[0] - radius, dimensions[1] - radius, 0])\n\t\t\tcylinder(dimensions[2], radius, radius);\n\t\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b469353397b2a0355a5d4988d940db014b1f89f6","subject":"fixed screw mounts locations","message":"fixed screw mounts locations\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/controller.scad","new_file":"led_controler_junction_box\/controller.scad","new_contents":"module controller()\n{\n difference()\n {\n \/\/ body\n union()\n {\n difference()\n {\n union()\n {\n translate([0,0,24])\n cube([88, 86, 13]);\n translate([15, 10, 0])\n cube([59, 66, 24]);\n }\n translate([15+2, 10, 0])\n cube([55, 16, 25]);\n }\n \/\/ power cord mounts\n translate([(88-20)\/2, 10+2, 24-10])\n cube([20, 8, 10]);\n \/\/ screw hole frame\n for(dx = [15, 88-15])\n translate([dx, 43, 24-3])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=10.5\/2, h=3);\n }\n }\n\n \/\/ screw mounts\n for(dx = [15, 88-15])\n translate([dx, 43, 0])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=10.5\/2, h=24-3);\n }\n\n \/\/ screw holes\n for(dx = [15, 88-15+3\/2\/2])\n translate([dx, 43, 24-3])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=3\/2, h=3, $fs=0.01);\n }\n }\n}\n\n%controller();\n","old_contents":"module controller()\n{\n difference()\n {\n \/\/ body\n union()\n {\n difference()\n {\n union()\n {\n translate([0,0,24])\n cube([88, 86, 13]);\n translate([15, 10, 0])\n cube([59, 66, 24]);\n }\n translate([15+2, 10, 0])\n cube([55, 16, 25]);\n }\n \/\/ power cord mounts\n translate([(88-20)\/2, 10+2, 24-10])\n cube([20, 8, 10]);\n \/\/ screw hole frame\n for(dx = [15, 88-15])\n translate([dx, 43-13\/2, 24-3])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=10.5\/2, h=3);\n }\n }\n\n \/\/ screw mounts\n for(dx = [15, 88-15])\n translate([dx, 43-13\/2, 0])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=10.5\/2, h=24-3);\n }\n\n \/\/ screw holes\n #for(dx = [15, 88-15+3\/2\/2])\n translate([dx, 43-13\/2, 24-3])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=3\/2, h=3, $fs=0.01);\n }\n }\n}\n\n%controller();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5b8dbc09ed6ebc81c9ffdb65d6381889ee32b685","subject":"base mount for rod","message":"base mount for rod\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/guide_rod_mount.scad","new_file":"water_rocket_launcher\/guide_rod_mount.scad","new_contents":"eps = 0.01;\nrod_d = 5;\nmount_h = 40;\n\nmodule rod_mount()\n{\n base_h = 4;\n base_d = 35;\n \/\/ base\n difference()\n {\n cylinder(d=base_d, h=base_h);\n n=5;\n for(i=[0:n-1])\n rotate([0, 0, 1]*(i\/n*360))\n translate([base_d\/2-5, 0, -eps])\n cylinder(d=3.5, h=base_h+2*eps, $fn=30);\n }\n \/\/ main block\n translate([0, 0, base_h])\n difference()\n {\n cylinder(d=rod_d+1.5, h=mount_h, $fn=30);\n cylinder(d=rod_d, h=mount_h+eps, $fn=100);\n }\n}\n\n\nrod_mount();\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b6c87651119ad7b2468c3c35f7c2f32a7e5440b8","subject":"knob draft ready","message":"knob draft ready\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/menu_knob.scad","new_file":"lcd_case_for_prusa_i3\/menu_knob.scad","new_contents":"module menuKnob()\n{\n \/\/ main body\n cube([14,12,6]);\n \/\/ pins\n for(offset = [\n [-2, 2, -(12-4-4)],\n [-2, 12-2-2, -(12-4-4)],\n [12+2, 12-2-2, -(12-4-4)],\n ])\n {\n translate(offset)\n cube([2,2,12-4]);\n }\n \/\/ cap holder\n translate([14\/2, 12\/2, 6])\n cylinder(r=7\/2, h=10, $fs=1);\n \/\/ push button distance\n translate([14\/2, 12\/2, 6+10])\n cylinder(r=(6-2*1)\/2, h=1, $fs=1);\n \/\/ knob mounting\n difference()\n {\n translate([14\/2, 12\/2, 6+10+1])\n cylinder(r=6\/2, h=6, $fs=1);\n translate([14\/2-6\/2, 12\/2-1\/2, 6+10+1+1])\n cube([6,1,5]);\n }\n}\n\nmenuKnob();","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"12f3dd92281be433150c51ef584d9850efb59e74","subject":"Add minkowski sum to get rounded corners","message":"Add minkowski sum to get rounded corners\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/support_arm.scad","new_file":"Hardware\/support_arm.scad","new_contents":"use \nuse \nuse \n\n\nmodule support_arm()\n{\n\tthickness = 5;\n\t\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\tarm();\n\t\t\tminkowski()\n\t\t\t{\n\t\t\t\tcylinder(r=5, h=thickness\/3.0);\n\t\t\t\ttranslate([20,0,0]) cube(size=[50,150,thickness\/3.0], center=true);\n\t\t\t}\t\t\n\t\t}\n\t\ttranslate([20,-45,0]) nano_connector_footprint(2*thickness);\n\t\ttranslate([20,5,0]) 9V_battery();\n\t\ttranslate([0,5,0]) cube(size=[3,12,2*thickness], center=true);\n\t\ttranslate([40,5,0]) cube(size=[3,12,2*thickness], center=true);\n\t\ttranslate([0,-45,0]) cube(size=[3,12,2*thickness], center=true);\n\t\ttranslate([40,-45,0]) cube(size=[3,12,2*thickness], center=true);\n\t}\n}\nprojection() support_arm();\n\n","old_contents":"use \nuse \nuse \n\nthickness = 5;\n\ndifference()\n{\n\tunion()\n\t{\n\t\tarm();\n\t\ttranslate([20,0,0]) cube(size=[50,150,thickness], center=true);\n\t}\n\ttranslate([20,-45,0]) nano_connector_footprint(2*thickness);\n\ttranslate([20,5,0]) 9V_battery();\n\ttranslate([0,5,0]) cube(size=[3,12,2*thickness], center=true);\n\ttranslate([40,5,0]) cube(size=[3,12,2*thickness], center=true);\n\ttranslate([0,-45,0]) cube(size=[3,12,2*thickness], center=true);\n\ttranslate([40,-45,0]) cube(size=[3,12,2*thickness], center=true);\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d27a2b187d83b247213dace9d7a5f2b14483df2d","subject":"Fix strap\/retainer. Add version imprint to base","message":"Fix strap\/retainer. Add version imprint to base\n","repos":"kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot","old_file":"Prototype-UR2\/assets\/3d\/enclosure.scad","new_file":"Prototype-UR2\/assets\/3d\/enclosure.scad","new_contents":"use ;\nmodel_version=\"UR2 v1.0\";\nwidth=40;\nhalf_w=width\/2;\nlength=66;\nhalf_l=length\/2;\nheight=17.5;\nlid_height=8;\nwall=1;\nradius_xy=wall*4;\nradius_z=wall*2;\ninset=0.75;\nstrap_height=13;\n\n\/\/ debug: check all objects sit on the bed platform\n\/\/projection(cut=true) {\ntranslate([width\/3,0,-1]) %cube([width*4, length+20, 2], center=true);\nunion() {\n offset_x=5;\n enclosure_base([-1*(width\/2+offset_x),0,height\/2+wall\/2]);\n enclosure_lid([width\/2+offset_x,0,lid_height\/2+wall\/2]);\n enclosure_straps([width+offset_x*2+20,0,0.75]);\n}\n\/\/}\n\n\/\/ the base\nmodule enclosure_base(offsets) {\n translate(offsets) {\n difference() {\n union() {\n hinged_box(width, length, height, 1);\n \/\/ lanyard attach point\n translate([0,-0.5*length-6, -0.5*(height+wall)+2.5]) {\n difference() {\n cylinder(r=9, h=5, center=true);\n union() {\n cylinder(r=5, h=5, center=true);\n translate([0, 8.5, 0]) cube([18, 5, 5], center=true);\n }\n }\n }\n \/\/ lip\n union() {\n lip_w=wall*1.5;\n lip_h=6;\n translate([half_w-lip_w\/2,-half_l+20,wall+height\/2-1]) cube([lip_w, 10, lip_h], center=true);\n translate([-half_w+lip_w\/2,-half_l+20,wall+height\/2-1]) cube([lip_w, 10, lip_h], [0,2,0], center=true);\n translate([half_w-lip_w\/2,-half_l+56,wall+height\/2-1]) cube([lip_w, 10, lip_h], center=true);\n translate([-half_w+lip_w\/2,-half_l+56,wall+height\/2-1]) cube([lip_w, 10, lip_h], center=true);\n }\n }\n union() {\n \/\/ version stamp\n translate([0,0,-height\/2+wall-0\/0.25]) {\n #linear_extrude(height=1, center=true)\n text(model_version, size=4, valign=\"center\", halign=\"center\");\n }\n \n \/\/ aperture for the usb port\n translate([-width\/2-wall, -length\/2+39.5, height\/2-1]) {\n rotate(90) charge_port(10, 7, wall*2);\n }\n *translate([width\/2+wall-1, -length\/2+32, height\/2-5]) {\n #cube(5);\n }\n \/\/ aperture for the battery port\n translate([width\/2+wall-1, -length\/2+32, height\/2-1]) {\n rotate(90) #charge_port(10, 7, wall*2);\n }\n \/\/ latch push\n translate([0, length\/2+width\/4-1.25, width\/4-2]) rotate([90,0,0]) #cylinder(r=7, h=inset*2, center=true);\n }\n }\n }\n}\n\n\/\/ the lid\nmodule enclosure_lid(offsets) {\n translate(offsets) rotate([0,180,0]) {\n difference() {\n union() {\n hinged_box(width, length, lid_height, -1);\n }\n #translate([0,12,lid_height\/2]) rotate(180) button(10,36,wall*2);\n }\n\n }\n}\n\nmodule enclosure_straps(offsets) {\n \/\/ the strap\n length=60;\n translate(offsets) {\n union() {\n translate([0,0,0]) cube([8, length, 1.5], center=true);\n #translate([0,-length\/2+20,0.75]) cube([width-3, 1.5, 1.5], center=true);\n translate([0,-length\/2+22,0]) cube([width, 8, 1.5], center=true);\n translate([0,length\/2-4,0]) cube([width, 8, 1.5], center=true);\n translate([0,length\/2-0.75,1]) cube([width, 1.5, 3], center=true);\n }\n }\n}\n\nmodule retainer(dims, center=false) {\n xdim=dims[0];\n ydim=dims[1];\n zdim=dims[2];\n half_z=zdim\/2;\n translate([0, 0, center? half_z\/2 : 0]) {\n cube([xdim, ydim, half_z], center=center);\n translate([0,0,half_z]) {\n if (center) {\n cube([xdim-zdim*2, ydim, half_z], center=center);\n }\n else {\n translate([zdim, 0, half_z]) cube([xdim-zdim*2, ydim, half_z], center=center);\n }\n }\n }\n\n}\n\nmodule outer_ridges(radius, length, bounds) {\n translate([-1*(bounds[0]\/2+radius\/2), 0]) {\n rotate([180,0,0]) ridge(radius, length, 1);\n }\n translate([bounds[0]\/2+radius\/2, 0]) {\n rotate([180,0,0]) ridge(radius, length, -1);\n }\n}\nmodule ridge(radius, length, orient=1) {\n rotate([0,0,orient<0?0:180])\n translate([-radius\/2, 0, radius\/2]) difference() {\n rotate([90,0,0]) cylinder(r=radius, h=length, center=true, $fn=12);\n union() {\n translate([0,0,radius\/2]) cube([radius*2, length, radius], center=true);\n translate([-radius\/2,0,0]) cube([radius, length, radius*2], center=true);\n }\n }\n}\n\nmodule hinged_oval_box(width, length, height, orient) {\n \/\/ WIP\/not in use\n hull() {\n translate([0, -length\/2+5, 2]) {\n resize(newsize=[width, width\/2, height]) sphere(d=width, center=true);\n }\n translate([0, +length\/2-5, 2]) {\n resize(newsize=[width*1.25, width\/2, height]) sphere(d=width, center=true);\n }\n }\n}\nmodule hinged_box(width, length, height, orient) {\n hinge_radius=4;\n hinge_y_offset=length\/2+radius_xy+hinge_radius\/2;\n difference() {\n union() {\n difference() {\n shell(width, length, height, orient);\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[0,90,0]) translate([0,0,0.25]) {\n \/\/ add clearance for opposite hinge barrels\n #cylinder(r=hinge_radius,\n h=width*.66+orient*-hinge_radius*2,\n center=true);\n }\n }\n\n }\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[90,180,0]) translate([0,0,0.25]) {\n _pin_hinge(width*.66, hinge_radius, orient>0?0:1);\n }\n }\n \/\/ the latch\n translate([0,length\/2+8.5,orient*(height\/2-3)]) {\n translate([0,-1.5,0]) cube([20, wall, 6], center=true);\n }\n if (orient > 0) {\n translate([0,length\/2+7.25,height\/2+4.5]) {\n translate([0,-1,-4.5]) cube([10, wall*1.5, 10], center=true);\n rotate([90, 90, 0]) ridge(1, 10, 1);\n }\n }\n }\n union() {\n if (orient < 0) {\n \/\/ lid latch receiver\n translate([0,length\/2+7.25,height\/2-3]) {\n difference() {\n translate([0,0,-1.5]) #cube([10, wall*1.5, 2], center=true);\n *translate([0,-1,-4.5]) cube([10, wall*1.5, 10], center=true);\n }\n }\n }\n }\n }\n}\n\nmodule _pin_hinge(h, radius, is_top=0, clearance=0) {\n fingers=5;\n pin_radius=1.5;\n gap=0.25;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n rotate([-90,0,0]) rotate([0,90,0]) translate([0,-radius,-1*(h\/2)+unit_h\/2]) {\n for(i=[0:fingers-1]) {\n if (i%2>0 && is_top) {\n translate([-0.5,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i, gap);\n translate([radius,radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n if (i%2==0 && !is_top) {\n translate([0.5,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i);\n translate([-1*(radius),radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n }\n }\n}\n\nmodule shell(width, length, height, orient=1) {\n difference() {\n union() {\n \/\/cube([2,length, 2], center=true);\n hull() {\n linear_extrude(height=height+wall, center=true) {\n offset(radius_xy) square([width-radius_xy*2+wall*2, length], center=true);\n }\n translate([0,length\/2-wall,0]) {\n difference() {\n resize([width, width\/2, height]) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4,0]) cube([width, width\/2, height], center=true);\n }\n }\n }\n }\n translate([0,0,orient*wall]) {\n translate([0,length\/2-inset, orient*wall]) {\n difference() {\n resize([width-wall, width\/2-wall*4, height+2*wall], auto=true) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4+wall*2,0]) cube([width-wall, width\/2-wall*4, height], center=true);\n }\n }\n cube([width, length, height], center=true);\n }\n }\n translate([0,length\/2+wall,0]) {\n #cube([width*0.66, wall*2, height], center=true);\n }\n}\n\nmodule radiused_cube(dims, radii, center=true) {\n \/\/ radiused box sized to *outer* dimensions\n \/\/ flatten the radii to 1\/2 height\n rad_x=radii[0];\n rad_y=radii[1];\n rad_z=radii[2];\n w=dims[0]; l=dims[1]; h=dims[2];\n\n translate([-w\/2,-l\/2,-h\/2]) hull() {\n for(z=[0:1]) {\n translate([rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n }\n }\n}\n\nmodule button(radius, length, depth) {\n gap=1;\n difference() {\n linear_extrude(height=depth, twist=0, center=true) {\n difference() {\n offset(r=radius_xy+gap) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n offset(r=radius_xy) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n }\n }\n translate([0, radius*2.5, 0]) cube([radius*2, radius_xy+gap, depth], center=true);\n }\n}\n\nmodule charge_port(width, height, wall) {\n radius=height\/2;\n translate([0, -wall\/2, 0]) rotate([90, 0, 0]) hull() {\n linear_extrude(height=wall, center=true) {\n offset(r=2) square([width-4, height-2], center=true);\n }\n }\n}\n\n\n","old_contents":"use ;\nwidth=40;\nlength=66;\nheight=17.5;\nlid_height=8;\nwall=1;\nradius_xy=wall*4;\nradius_z=wall*2;\ninset=0.75;\nstrap_height=13;\n\n\/\/ debug: check all objects sit on the bed platform\n\/\/projection(cut=true) {\ntranslate([width\/3,0,-1]) %cube([width*4, length+20, 2], center=true);\nunion() {\n offset_x=5;\n enclosure_base([-1*(width\/2+offset_x),0,height\/2+wall\/2]);\n enclosure_lid([width\/2+offset_x,0,lid_height\/2+wall\/2]);\n enclosure_straps([width+offset_x*2+20,0,0]);\n}\n\/\/}\n\n\/\/ the base\nmodule enclosure_base(offsets) {\n translate(offsets) {\n difference() {\n union() {\n hinged_box(width, length, height, 1);\n\n \/\/ lanyard attach point\n translate([0,-0.5*length-6, -0.5*(height+wall)+2.5]) {\n difference() {\n cylinder(r=9, h=5, center=true);\n union() {\n cylinder(r=5, h=5, center=true);\n translate([0, 8.5, 0]) cube([18, 5, 5], center=true);\n }\n }\n }\n \/\/ lip\n union() {\n translate([width\/2-wall+0.25,-length\/2+12,wall+height\/2]) cube([wall, 16, 8], center=true);\n #translate([-width\/2+0.25,-length\/2+18,wall+height\/2]) cube([wall, 16, 8], [0,2,0], center=true);\n translate([width\/2-wall+0.25,-length\/2+52,wall+height\/2]) cube([wall, 10, 8], center=true);\n translate([-width\/2+0.25,-length\/2+50,wall+height\/2]) #cube([wall, 10, 8], center=true);\n }\n }\n union() {\n \/\/ aperture for the usb port\n translate([-width\/2-wall, -length\/2+37, height\/2-1]) {\n rotate(90) charge_port(10, 5, wall*2);\n }\n *translate([width\/2+wall-1, -length\/2+32, height\/2-5]) {\n #cube(5);\n }\n translate([width\/2+wall-1, -length\/2+32, height\/2-1]) {\n rotate(90) #charge_port(10, 5, wall*2);\n }\n \/\/ latch push\n translate([0, length\/2+width\/4-1.25, width\/4-2]) rotate([90,0,0]) #cylinder(r=7, h=inset*2, center=true);\n }\n }\n }\n}\n\n\/\/ the lid\nmodule enclosure_lid(offsets) {\n translate(offsets) rotate([0,180,0]) {\n difference() {\n union() {\n hinged_box(width, length, lid_height, -1);\n }\n #translate([0,12,lid_height\/2]) rotate(180) button(10,36,wall*2);\n }\n\n }\n}\n\nmodule enclosure_straps(offsets) {\n \/\/ the strap\n length=60;\n translate(offsets) {\n union() {\n translate([0,0,0]) cube([8, length, 1.5], center=true);\n #translate([0,-length\/2+20,0.75]) cube([width-3, 1.5, 1.5], center=true);\n translate([0,-length\/2+22,0]) cube([width, 8, 1.5], center=true);\n translate([0,length\/2-4,0]) cube([width, 8, 1.5], center=true);\n translate([0,length\/2-0.75,1]) cube([width, 1.5, 3], center=true);\n }\n }\n}\n\nmodule retainer(dims, center=false) {\n xdim=dims[0];\n ydim=dims[1];\n zdim=dims[2];\n half_z=zdim\/2;\n translate([0, 0, center? half_z\/2 : 0]) {\n cube([xdim, ydim, half_z], center=center);\n translate([0,0,half_z]) {\n if (center) {\n cube([xdim-zdim*2, ydim, half_z], center=center);\n }\n else {\n translate([zdim, 0, half_z]) cube([xdim-zdim*2, ydim, half_z], center=center);\n }\n }\n }\n\n}\n\nmodule outer_ridges(radius, length, bounds) {\n translate([-1*(bounds[0]\/2+radius\/2), 0]) {\n rotate([180,0,0]) ridge(radius, length, 1);\n }\n translate([bounds[0]\/2+radius\/2, 0]) {\n rotate([180,0,0]) ridge(radius, length, -1);\n }\n}\nmodule ridge(radius, length, orient=1) {\n rotate([0,0,orient<0?0:180])\n translate([-radius\/2, 0, radius\/2]) difference() {\n rotate([90,0,0]) cylinder(r=radius, h=length, center=true, $fn=12);\n union() {\n translate([0,0,radius\/2]) cube([radius*2, length, radius], center=true);\n translate([-radius\/2,0,0]) cube([radius, length, radius*2], center=true);\n }\n }\n}\n\nmodule hinged_oval_box(width, length, height, orient) {\n \/\/ WIP\/not in use\n hull() {\n translate([0, -length\/2+5, 2]) {\n resize(newsize=[width, width\/2, height]) sphere(d=width, center=true);\n }\n translate([0, +length\/2-5, 2]) {\n resize(newsize=[width*1.25, width\/2, height]) sphere(d=width, center=true);\n }\n }\n}\nmodule hinged_box(width, length, height, orient) {\n hinge_radius=4;\n hinge_y_offset=length\/2+radius_xy+hinge_radius\/2;\n difference() {\n union() {\n difference() {\n shell(width, length, height, orient);\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[0,90,0]) translate([0,0,0.25]) {\n \/\/ add clearance for opposite hinge barrels\n #cylinder(r=hinge_radius,\n h=width*.66+orient*-hinge_radius*2,\n center=true);\n }\n }\n\n }\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[90,180,0]) translate([0,0,0.25]) {\n _pin_hinge(width*.66, hinge_radius, orient>0?0:1);\n }\n }\n \/\/ the latch\n translate([0,length\/2+8.5,orient*(height\/2-3)]) {\n translate([0,-1.5,0]) cube([20, wall, 6], center=true);\n }\n if (orient > 0) {\n translate([0,length\/2+7.25,height\/2+4.5]) {\n translate([0,-1,-4.5]) cube([10, wall*1.5, 10], center=true);\n rotate([90, 90, 0]) ridge(1, 10, 1);\n }\n }\n }\n union() {\n if (orient < 0) {\n \/\/ lid latch receiver\n translate([0,length\/2+7.25,height\/2-3]) {\n difference() {\n translate([0,0,-1.5]) #cube([10, wall*1.5, 2], center=true);\n *translate([0,-1,-4.5]) cube([10, wall*1.5, 10], center=true);\n }\n }\n }\n }\n }\n}\n\nmodule _pin_hinge(h, radius, is_top=0, clearance=0) {\n fingers=5;\n pin_radius=1.5;\n gap=0.25;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n rotate([-90,0,0]) rotate([0,90,0]) translate([0,-radius,-1*(h\/2)+unit_h\/2]) {\n for(i=[0:fingers-1]) {\n if (i%2>0 && is_top) {\n translate([-0.5,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i, gap);\n translate([radius,radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n if (i%2==0 && !is_top) {\n translate([0.5,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i);\n translate([-1*(radius),radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n }\n }\n}\n\nmodule shell(width, length, height, orient=1) {\n difference() {\n union() {\n \/\/cube([2,length, 2], center=true);\n hull() {\n linear_extrude(height=height+wall, center=true) {\n offset(radius_xy) square([width-radius_xy*2+wall*2, length], center=true);\n }\n translate([0,length\/2-wall,0]) {\n difference() {\n resize([width, width\/2, height]) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4,0]) cube([width, width\/2, height], center=true);\n }\n }\n }\n }\n translate([0,0,orient*wall]) {\n translate([0,length\/2-inset, orient*wall]) {\n difference() {\n resize([width-wall, width\/2-wall*4, height+2*wall], auto=true) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4+wall*2,0]) cube([width-wall, width\/2-wall*4, height], center=true);\n }\n }\n cube([width, length, height], center=true);\n }\n }\n translate([0,length\/2+wall,0]) {\n #cube([width*0.66, wall*2, height], center=true);\n }\n}\n\nmodule radiused_cube(dims, radii, center=true) {\n \/\/ radiused box sized to *outer* dimensions\n \/\/ flatten the radii to 1\/2 height\n rad_x=radii[0];\n rad_y=radii[1];\n rad_z=radii[2];\n w=dims[0]; l=dims[1]; h=dims[2];\n\n translate([-w\/2,-l\/2,-h\/2]) hull() {\n for(z=[0:1]) {\n translate([rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n }\n }\n}\n\nmodule button(radius, length, depth) {\n gap=1;\n difference() {\n linear_extrude(height=depth, twist=0, center=true) {\n difference() {\n offset(r=radius_xy+gap) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n offset(r=radius_xy) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n }\n }\n translate([0, radius*2.5, 0]) cube([radius*2, radius_xy+gap, depth], center=true);\n }\n}\n\nmodule charge_port(width, height, wall) {\n radius=height\/2;\n translate([0, -wall\/2, 0]) rotate([90, 0, 0]) hull() {\n linear_extrude(height=wall, center=true) {\n offset(r=2) square([width-4, height-2], center=true);\n }\n }\n}\n\n\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"d9b64a862d34928b9397f69640c4693fe50824da","subject":"shoulder spacers compelete","message":"shoulder spacers compelete\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n } \n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 6), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\n\/\/color([.7, .7, 1]) \n %shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\n\/\/color([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n %shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n render() union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 6), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 6), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"8247266e311b806fc09f1cc211aa185feb6a5b72","subject":"shapes: add hull_pairwise","message":"shapes: add hull_pairwise\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef)\n{\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate([ dist*i, 0, 0 ]) children(i);\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef)\n{\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate([ dist*i, 0, 0 ]) children(i);\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c4fdbdaf253fdd4fce28add5dec2613599522e7c","subject":"rod protection cylinder","message":"rod protection cylinder\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"buggy_troley_mount\/rod_protection.scad","new_file":"buggy_troley_mount\/rod_protection.scad","new_contents":"h=15;\neps=0.01;\n$fn=120;\n\n\nmodule rod_protection()\n{\n difference()\n {\n cylinder(r=10.5\/2, h=h);\n translate([0,0,-eps])\n cylinder(r=8.5\/2, h=h+2*eps);\n }\n}\n\n\nfor(dx=[0:1])\n for(dy=[0:2])\n translate(12*[dx, dy, 0])\n rod_protection();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buggy_troley_mount\/rod_protection.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"87be787ef761a31f5e10f5d644df5b5ae0a00441","subject":"y\/carriage\/bearingmount: define part","message":"y\/carriage\/bearingmount: define part\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-carriage-bearing-mount.scad","new_file":"y-axis-carriage-bearing-mount.scad","new_contents":"use \ninclude \ninclude \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule yaxis_carriage_bearing_mount(show_bearing=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick;*\/\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n rcubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing_mount_holes(\n bearing_type=yaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,1,0],\n ziptie_dist=4\n );\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\nmodule part_y_carriage_bearing_mount()\n{\n c1=[[0,0,0],[0,0,1]];\n attach(c1,yaxis_carriage_bearing_mount_conn_bottom)\n {\n yaxis_carriage_bearing_mount();\n }\n}\n","old_contents":"use \ninclude \ninclude \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule yaxis_carriage_bearing_mount(show_bearing=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick;*\/\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n rcubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing_mount_holes(\n bearing_type=yaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,1,0],\n ziptie_dist=4\n );\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\nif(false)\n{\n c1=[[0,0,0],[0,0,1]];\n attach(c1,yaxis_carriage_bearing_mount_conn_bottom)\n {\n yaxis_carriage_bearing_mount();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"511e8957f65392868ba4b7def643f6be4d49f891","subject":"bearing: fix align bug when override_h used","message":"bearing: fix align bug when override_h used\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],bearing_type[2]], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"aafa2ecf9d6af99be8fe953c085990865f1ae9b5","subject":"Split top into two parts in DXF.","message":"Split top into two parts in DXF.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.2;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.2mm for just a smidge more...\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 180 + thickness; \/\/ z = 18cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover(spacing=1);\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover(spacing=0) {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Grey\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n \/\/ spacing added to make separate pieces for laser cutting\n translate([spacing,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n\/*\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n*\/\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\n\/\/ [Currently unused -- 2016-02-26]\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.2;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.2mm for just a smidge more...\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 180 + thickness; \/\/ z = 18cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Grey\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n translate([0,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n\/*\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n*\/\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\n\/\/ [Currently unused -- 2016-02-26]\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7bf019366ec01c38c912ec63beff075fadfe3e50","subject":"WIP of the troley mount","message":"WIP of the troley mount\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"buggy_troley_mount\/buggy_troley_mount.scad","new_file":"buggy_troley_mount\/buggy_troley_mount.scad","new_contents":"r_mount=(28.8+2*2.1)\/2;\nh=20;\neps=0.01;\n\nmodule mount_rod_space()\n{\n translate([0, 0, -eps])\n cylinder(r=r_mount, h=h+2*eps, $fn=180);\n}\n\n\nmodule body_core()\n{\n \/\/ holes rod\n rotate([0, 0, 180-30])\n hull()\n for(dx=[0, 90])\n translate([dx, 0, 0])\n cylinder(r=30\/2, h=h);\n \/\/ rod_slot\n cylinder(r=30\/2, h=h);\n translate([-35, -40, 0])\n cube([50, 40, h]);\n \/\/ stubbing hole, between two elements\n translate([-35, 0, 0])\n cube([20, 10, h]);\n}\n\n\nmodule buggy_troley_mount()\n{\n difference()\n {\n body_core();\n translate([-20\/2, -20, 0])\n mount_rod_space();\n }\n}\n\n\nbuggy_troley_mount();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buggy_troley_mount\/buggy_troley_mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"4fac753ddb89b02a014f789fd9e4eaf02c67de0a","subject":"more relative distances","message":"more relative distances\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module pair(d, h)\n {\n translate([0, 0, 11-h+eps])\n {\n cylinder(d=d, h=h);\n translate([0, 9, 0])\n cylinder(d=d, h=h+10);\n }\n translate([5+0.6*d, 0, 0])\n children();\n }\n\n difference()\n {\n cube([35, 20, 11]);\n translate([5, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","old_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module pair(d, h)\n {\n translate([0, 0, 11-h+eps])\n {\n cylinder(d=d, h=h);\n translate([0, 9, 0])\n cylinder(d=d, h=h+10);\n }\n translate([1.5*d, 0, 0])\n children();\n }\n\n difference()\n {\n cube([35, 20, 11]);\n translate([5, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a190d6f0585413d854ae0f3e63f6f48296759b60","subject":"cable guide hole element","message":"cable guide hole element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/cable_guide.scad","new_file":"lcd_case_for_prusa_i3\/cable_guide.scad","new_contents":"module cableGuide()\n{\n hull()\n {\n \/\/ upper baund\n translate([0, 20, 0])\n cube([75, 1, 6+7]);\n \/\/ lower baund\n translate([(75-40)\/2, 0, 0])\n cube([40, 1, 6+7]);\n }\n}\n\ncableGuide();","old_contents":"","returncode":1,"stderr":"error: pathspec 'lcd_case_for_prusa_i3\/cable_guide.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"109ab1016b1dd460a0e605b6fba82b0cc8191012","subject":"config: yaxis also sf1 bushing","message":"config: yaxis also sf1 bushing\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fb20feae9ae460ceb9548f55a62307bc49173c8e","subject":"config: increase preview res a bit","message":"config: increase preview res a bit\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1.4;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"48618950fcef043140b081aeb45f7562fb10e26c","subject":"config: fix xaxis_zaxis_distance_y","message":"config: fix xaxis_zaxis_distance_y\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*zaxis_bearing=bearing_sf1_1212;*\/\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*zaxis_bearing=bearing_sf1_1212;*\/\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"19a8119c6cc6b8a39d5e4e680445e2ee4340858f","subject":"Correct hole diameter in button box","message":"Correct hole diameter in button box\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 14.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a2a7c75b7d6b59ad2bdd577b98a5fdf3da94f069","subject":"The path was corrected.","message":"The path was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/circle-attachement\/water-pump-filter.scad","new_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/circle-attachement\/water-pump-filter.scad","new_contents":"\nuse <..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule waterPumpFilter(baseHeight = 30,\n\t\t\t\t\t innerRadius = 25,\n\t\t\t\t\t snorkel = false,\n\t\t\t\t\t snorkelHeight = 40,\n\t\t\t\t\t snorkelOuterRadius = 7,\n\t\t\t\t\t xLength = 54)\n{\n\tunion()\n\t{\n\/\/\t\tif(snorkel == true)\n\t\/\/\t{\n\t\t\/\/\twaterPump_snorkel(filter_baseHeight = baseHeight,\n\t\t\t\/\/\t \t\t\t filter_xLength = xLength,\n\t\t\t\t\/\/\t\t\t filter_yLength = yLength,\n\t\t\t\t\t\/\/\t\t height = snorkelHeight,\n\t\t\t\t\t\t\/\/\t snorkelOuterRadius = snorkelOuterRadius);\n\/\/\t\t}\n\n\t\tzTranslate = baseHeight \/ 2.0;\n\t\ttranslate([0,0, zTranslate-0.1])\n\t\twaterPumpFilter_connector(innerRadius = innerRadius);\n\n\n\t\tyLength = (innerRadius * 2) + 4;\n\t\twaterPumpFilter_base(height = baseHeight,\n\t\t\t\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t\t\t\t snorkel = snorkel,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius,\n\t\t\t\t\t\t\t xLength = xLength,\n\t\t\t\t\t\t\t yLength = yLength);\n\t}\n}\n\nmodule waterPumpFilter_connector(innerRadius)\n{\n\topenCylinder(height = 5,\n\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t outerRadius = innerRadius + 2);\n}\n\nmodule waterPumpFilter_base(height,\n\t\t\t\t\t\t\tinnerRadius,\n\t\t\t\t\t\t\tsnorkel,\n\t\t\t\t\t\t\tsnorkelOuterRadius,\n\t\t\t\t\t\t\txLength,\n\t\t\t\t\t\t\tyLength)\n{\n\tdifference()\n\t{\n\t\t\/\/ this is the outer cube\n\t\tcube([xLength, yLength, height], center = true);\n\n\t\tcolor(\"pink\")\n\t\ttranslate([0,0,10])\n\t\tcylinder(r=innerRadius, h=30, center=true);\n\n\t\tinnerCubeDifference = 4;\n\t\tcolor(\"green\")\n\t\twaterPumpFilter_base_innerCube(xLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t yLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t height - innerCubeDifference);\n\n\t\tcutoutHeight = height - 4;\n\n\t\twaterPumpFilter_xCutouts(height = cutoutHeight,\n\t\t\t\t\t\t\t\t length = xLength - 8);\n\n\t\twaterPumpFilter_yCutouts(height = cutoutHeight);\n\n\t\tif(snorkel == true)\n\t\t{\n\t\t\twaterPump_snorkel(filter_baseHeight = height,\n\t\t\t\t\t\t\t filter_xLength = xLength,\n\t\t\t\t\t\t\t filter_yLength = yLength,\n\t\t\t\t\t\t\t height = 20,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius);\n\t\t}\n\t}\n}\n\nmodule waterPumpFilter_base_innerCube(xyLength, yLength, height)\n{\n\tcube([xyLength, yLength, height], center = true);\n}\n\nmodule waterPump_snorkel(filter_baseHeight,\n\t\t\t\t\t\t filter_xLength,\n\t\t\t\t\t\t filter_yLength,\n\t\t\t\t\t\t height,\n\t\t\t\t\t\t snorkelOuterRadius)\n{\n\txTranslate = (filter_xLength \/ 2.0) - snorkelOuterRadius - 2;\n\tyTranslate = (filter_yLength \/ 2.0) - snorkelOuterRadius -2;\n\tzTranslate = (filter_baseHeight \/ 2.0) - 4;\n\n\n\tcolor(\"green\")\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\tcylinder(h = height, r = snorkelOuterRadius, fn = 50);\n\/\/\topenCylinder(height = height,\n\t\/\/\t\t\t innerRadius = snorkelOuterRadius - 2,\n\t\t\/\/\t\t outerRadius = snorkelOuterRadius);\n\n\ttranslate([-xTranslate, -yTranslate, zTranslate])\n\/\/ \topenCylinder(height = height,\n \t\/\/\t\t\t innerRadius = snorkelOuterRadius - 2,\n \t\t\/\/\t\t outerRadius = snorkelOuterRadius);\n\t\t\t cylinder(h = height, r = snorkelOuterRadius, $fn = 100);\n}\n\nmodule waterPumpFilter_xCutouts(height, length)\n{\n\tstep = 5;\n\n\tfor(x = [-length : step : length])\n\t{\n\t\ttranslate([x, 0, 0])\n\t\tcube([2, 100, height], center = true);\n\t}\n}\n\nmodule waterPumpFilter_yCutouts(height)\n{\n\tstep = 5;\n\n\tfor(y = [-20 : step : 20])\n\t{\n\t\ttranslate([0, y, 0])\n\t\tcube([100, 2, height], center = true);\n\t}\n}\n","old_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule waterPumpFilter(baseHeight = 30,\n\t\t\t\t\t innerRadius = 25,\n\t\t\t\t\t snorkel = false,\n\t\t\t\t\t snorkelHeight = 40,\n\t\t\t\t\t snorkelOuterRadius = 7,\n\t\t\t\t\t xLength = 54)\n{\n\tunion()\n\t{\n\/\/\t\tif(snorkel == true)\n\t\/\/\t{\n\t\t\/\/\twaterPump_snorkel(filter_baseHeight = baseHeight,\n\t\t\t\/\/\t \t\t\t filter_xLength = xLength,\n\t\t\t\t\/\/\t\t\t filter_yLength = yLength,\n\t\t\t\t\t\/\/\t\t height = snorkelHeight,\n\t\t\t\t\t\t\/\/\t snorkelOuterRadius = snorkelOuterRadius);\n\/\/\t\t}\n\n\t\tzTranslate = baseHeight \/ 2.0;\n\t\ttranslate([0,0, zTranslate-0.1])\n\t\twaterPumpFilter_connector(innerRadius = innerRadius);\n\n\n\t\tyLength = (innerRadius * 2) + 4;\n\t\twaterPumpFilter_base(height = baseHeight,\n\t\t\t\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t\t\t\t snorkel = snorkel,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius,\n\t\t\t\t\t\t\t xLength = xLength,\n\t\t\t\t\t\t\t yLength = yLength);\n\t}\n}\n\nmodule waterPumpFilter_connector(innerRadius)\n{\n\topenCylinder(height = 5,\n\t\t\t\t innerRadius = innerRadius,\n\t\t\t\t outerRadius = innerRadius + 2);\n}\n\nmodule waterPumpFilter_base(height,\n\t\t\t\t\t\t\tinnerRadius,\n\t\t\t\t\t\t\tsnorkel,\n\t\t\t\t\t\t\tsnorkelOuterRadius,\n\t\t\t\t\t\t\txLength,\n\t\t\t\t\t\t\tyLength)\n{\n\tdifference()\n\t{\n\t\t\/\/ this is the outer cube\n\t\tcube([xLength, yLength, height], center = true);\n\n\t\tcolor(\"pink\")\n\t\ttranslate([0,0,10])\n\t\tcylinder(r=innerRadius, h=30, center=true);\n\n\t\tinnerCubeDifference = 4;\n\t\tcolor(\"green\")\n\t\twaterPumpFilter_base_innerCube(xLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t yLength - innerCubeDifference,\n\t\t\t\t\t\t\t\t\t height - innerCubeDifference);\n\n\t\tcutoutHeight = height - 4;\n\n\t\twaterPumpFilter_xCutouts(height = cutoutHeight,\n\t\t\t\t\t\t\t\t length = xLength - 8);\n\n\t\twaterPumpFilter_yCutouts(height = cutoutHeight);\n\n\t\tif(snorkel == true)\n\t\t{\n\t\t\twaterPump_snorkel(filter_baseHeight = height,\n\t\t\t\t\t\t\t filter_xLength = xLength,\n\t\t\t\t\t\t\t filter_yLength = yLength,\n\t\t\t\t\t\t\t height = 20,\n\t\t\t\t\t\t\t snorkelOuterRadius = snorkelOuterRadius);\n\t\t}\n\t}\n}\n\nmodule waterPumpFilter_base_innerCube(xyLength, yLength, height)\n{\n\tcube([xyLength, yLength, height], center = true);\n}\n\nmodule waterPump_snorkel(filter_baseHeight,\n\t\t\t\t\t\t filter_xLength,\n\t\t\t\t\t\t filter_yLength,\n\t\t\t\t\t\t height,\n\t\t\t\t\t\t snorkelOuterRadius)\n{\n\txTranslate = (filter_xLength \/ 2.0) - snorkelOuterRadius - 2;\n\tyTranslate = (filter_yLength \/ 2.0) - snorkelOuterRadius -2;\n\tzTranslate = (filter_baseHeight \/ 2.0) - 4;\n\n\n\tcolor(\"green\")\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\tcylinder(h = height, r = snorkelOuterRadius, fn = 50);\n\/\/\topenCylinder(height = height,\n\t\/\/\t\t\t innerRadius = snorkelOuterRadius - 2,\n\t\t\/\/\t\t outerRadius = snorkelOuterRadius);\n\n\ttranslate([-xTranslate, -yTranslate, zTranslate])\n\/\/ \topenCylinder(height = height,\n \t\/\/\t\t\t innerRadius = snorkelOuterRadius - 2,\n \t\t\/\/\t\t outerRadius = snorkelOuterRadius);\n\t\t\t cylinder(h = height, r = snorkelOuterRadius, $fn = 100);\n}\n\nmodule waterPumpFilter_xCutouts(height, length)\n{\n\tstep = 5;\n\n\tfor(x = [-length : step : length])\n\t{\n\t\ttranslate([x, 0, 0])\n\t\tcube([2, 100, height], center = true);\n\t}\n}\n\nmodule waterPumpFilter_yCutouts(height)\n{\n\tstep = 5;\n\n\tfor(y = [-20 : step : 20])\n\t{\n\t\ttranslate([0, y, 0])\n\t\tcube([100, 2, height], center = true);\n\t}\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"92e01beaba20c0edb4abe8c5d68fc6d73807e634","subject":"config\/xaxis: Switch back to 10mm rods\/bearings","message":"config\/xaxis: Switch back to 10mm rods\/bearings\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1.4;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingKH1026;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1.4;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 11.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingKH1228;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ce90ef0ec9c3687e89c5b5c91ddc71bb31a9231c","subject":"properly display sample objects","message":"properly display sample objects\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/common\/extrusions.scad","new_file":"openscad\/common\/extrusions.scad","new_contents":"\/\/\n\/\/ Common extrusions\n\/\/ Author: Joseph M. Joy FTC 12598 mentor\n\/\/\nEPSILON = 0.01; \/\/ For moving things to properly punch out holes\n\n\/\/ Makes a flat (horizontal) \"T\":\n\/\/\n\/\/ --------------\n\/\/ |wtXht --|\n\/\/ ----\\ \/---\n\/\/ |wbX|\n\/\/ |hb |\n\/\/ -----\n\/\/\n\/\/\n\/\/ It could also be an inverted L shape\n\/\/ if the lower (vertical) bar is wide enough to extend beyond the right \n\/\/ hand side of the upper (horizontal) bar.\n\/\/\n\/\/ {xoff} is horizontal distance to the start of the bar.\n\/\/ {ro} curve of convex corners (not shown above)\n\/\/ {ri} is the radius of two concave curves\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/\n\/\/ WARNING: If {ro} and {ri} are too large it will generate sharp\n\/\/ extrusion artifacts because the straight surfaces are not large to accomodate\n\/\/ the inner-radius curves.\n\/\/ \nmodule T_channelOld(wb, hb, wt, ht, xoff, r, t) {\n ow = 2*wt; \/\/ wide enough to \n oh = 2*(hb+ht); \/\/ high enough to descend below the shape\n\n difference() {\n cube([wt, hb+ht, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n }\n}\n\n\nmodule T_channel(wb, hb, wt, ht, xoff, ro, ri, t) {\n \n \/\/ ow and oh are used to create cutout patterns\n ow = 2*wt; \/\/ wide enough to extend to the left and right of shape\n oh = 2*(hb+ht); \/\/ high enough to descend below the shape\n \n \/\/ Dimensions of the plate that will be cut out - it is just\n \/\/ big enough so that the inner-radii can be cut out, no more.\n wp = wb + 2*ri + 2*EPSILON; \/\/ dimensions of plate to be cut out\n hp = max(ro, ri) + 2*EPSILON;\n xoffp = xoff - ri - EPSILON;\n yoffp = hb - max(ro, ri) - EPSILON;\n difference() {\n translate([xoffp, yoffp, 0]) cube([wp, hp, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, ri, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, ri, t+2*EPSILON);\n }\n translate([xoff, 0, 0]) oblong(wb, hb, ro, t);\n translate([0, hb, 0]) oblong(wt, ht, ro, t);\n}\n\n\n\/\/ Makes a flat (horizontal) \"O\":\n\/\/\n\/\/ \/-------------\\\n\/\/ | |\n\/\/ | \/--------\\ |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | \\ \/ |\n\/\/ | --------- |\n\/\/ \\------------\/\n\/\/\n\/\/\n\/\/ It could also be a U or L\n\/\/ if the oblong hole extends outside the outer\n\/\/ boundary.\n\/\/\n\/\/ ({xoff},{yoff} is origin of bounding-rectangle of the oblong hole\n\/\/ {(wo}, {ho}) is the bounding box of the outer oblong.\n\/\/ {(wi}, {hi}) is the bounding box of the inner (hole) oblong.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule O_channel(wo, ho, wi, hi, xoff, yoff, ro, ri, t) {\n difference() {\n oblong(wo, ho, ro, t);\n translate([xoff, yoff, -EPSILON]) oblong(wi, hi, ri, t+2*EPSILON);\n }\n}\n\n\n\/\/ A rectangular prism that fits within {w} x {h} and\n\/\/ has rounded corners with radius {r} on all 4 sides.\n\/\/ The actual radius may be reduced so keep the oblong\n\/\/ viable. {t} is the thickness (in z).\nmodule oblong(w, h, r, t) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON);\n translate([r, r, 0])\n linear_extrude(height = t, center = false, convexity = 10) {\n offset(r = r) square([w-2*r, h-2*r]);\n }\n}\n\n\/\/ A cube that fits within ({w}, {h}, {d}) and has\n\/\/ all corners rounded with radius r.\nmodule rounded_cube(w, h, d, r) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON, d\/2-EPSILON);\n di = 2*r;\n translate([r, r, r]) {\n minkowski() {\n echo(di);\n cube([w-di, h-di, d-di]);\n sphere(r=r);\n }\n }\n}\n\n\/\/\n\/\/ Example code\n\/\/\nwb = 10;\nhb = 20;\nwt = 40;\nht = 30;\nt = 5;\nro = 5;\nri = 2;\nxoff = 10;\nmove = 30;\n$fn = 50;\noblong(wb, hb, ro, t);\ntranslate([0, move, 0]) rounded_cube(wb, hb, t, ro);\/\/, $fn=100);\ntranslate([move, 0, 0]) T_channel(wb, hb, wt, ht, xoff, 5, 1, t);\ntranslate([move, 2*move, 0]) O_channel(wt, hb+ht, wb, 10*hb, xoff, xoff, ro, ri, t);\n\n\n","old_contents":"\/\/\n\/\/ Common extrusions\n\/\/ Author: Joseph M. Joy FTC 12598 mentor\n\/\/\nEPSILON = 0.01; \/\/ For moving things to properly punch out holes\n\n\/\/ Makes a flat (horizontal) \"T\":\n\/\/\n\/\/ --------------\n\/\/ |wtXht --|\n\/\/ ----\\ \/---\n\/\/ |wbX|\n\/\/ |hb |\n\/\/ -----\n\/\/\n\/\/\n\/\/ It could also be an inverted L shape\n\/\/ if the lower (vertical) bar is wide enough to extend beyond the right \n\/\/ hand side of the upper (horizontal) bar.\n\/\/\n\/\/ {xoff} is horizontal distance to the start of the bar.\n\/\/ {ro} curve of convex corners (not shown above)\n\/\/ {ri} is the radius of two concave curves\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/\n\/\/ WARNING: If {ro} and {ri} are too large it will generate sharp\n\/\/ extrusion artifacts because the straight surfaces are not large to accomodate\n\/\/ the inner-radius curves.\n\/\/ \nmodule T_channelOld(wb, hb, wt, ht, xoff, r, t) {\n ow = 2*wt; \/\/ wide enough to \n oh = 2*(hb+ht); \/\/ high enough to descend below the shape\n\n difference() {\n cube([wt, hb+ht, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n }\n}\n\n\nmodule T_channel(wb, hb, wt, ht, xoff, ro, ri, t) {\n \n \/\/ ow and oh are used to create cutout patterns\n ow = 2*wt; \/\/ wide enough to extend to the left and right of shape\n oh = 2*(hb+ht); \/\/ high enough to descend below the shape\n \n \/\/ Dimensions of the plate that will be cut out - it is just\n \/\/ big enough so that the inner-radii can be cut out, no more.\n wp = wb + 2*ri + 2*EPSILON; \/\/ dimensions of plate to be cut out\n hp = max(ro, ri) + 2*EPSILON;\n xoffp = xoff - ri - EPSILON;\n yoffp = hb - max(ro, ri) - EPSILON;\n difference() {\n translate([xoffp, yoffp, 0]) cube([wp, hp, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, ri, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, ri, t+2*EPSILON);\n }\n translate([xoff, 0, 0]) oblong(wb, hb, ro, t);\n translate([0, hb, 0]) oblong(wt, ht, ro, t);\n}\n\n\n\/\/ Makes a flat (horizontal) \"O\":\n\/\/\n\/\/ \/-------------\\\n\/\/ | |\n\/\/ | \/--------\\ |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | \\ \/ |\n\/\/ | --------- |\n\/\/ \\------------\/\n\/\/\n\/\/\n\/\/ It could also be a U or L\n\/\/ if the oblong hole extends outside the outer\n\/\/ boundary.\n\/\/\n\/\/ ({xoff},{yoff} is origin of bounding-rectangle of the oblong hole\n\/\/ {(wo}, {ho}) is the bounding box of the outer oblong.\n\/\/ {(wi}, {hi}) is the bounding box of the inner (hole) oblong.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule O_channel(wo, ho, wi, hi, xoff, yoff, ro, ri, t) {\n difference() {\n oblong(wo, ho, ro, t);\n translate([xoff, yoff, -EPSILON]) oblong(wi, hi, ri, t+2*EPSILON);\n }\n}\n\n\n\/\/ A rectangular prism that fits within {w} x {h} and\n\/\/ has rounded corners with radius {r} on all 4 sides.\n\/\/ The actual radius may be reduced so keep the oblong\n\/\/ viable. {t} is the thickness (in z).\nmodule oblong(w, h, r, t) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON);\n translate([r, r, 0])\n linear_extrude(height = t, center = false, convexity = 10) {\n offset(r = r) square([w-2*r, h-2*r]);\n }\n}\n\n\/\/ A cube that fits within ({w}, {h}, {d}) and has\n\/\/ all corners rounded with radius r.\nmodule rounded_cube(w, h, d, r) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON, d\/2-EPSILON);\n di = 2*r;\n translate([r, r, r]) {\n minkowski() {\n echo(di);\n cube([w-di, h-di, d-di]);\n sphere(r=r);\n }\n }\n}\n\n\/\/\n\/\/ Example code\n\/\/\nwb = 10;\nhb = 20;\nwt = 40;\nht = 30;\nt = 5;\nro = 5;\nri = 2;\nxoff = 10;\nmove = 30;\noblong(wb, hb, ro, t);\n!translate([0, move, 0]) rounded_cube(wb, hb, t, 0);\/\/, $fn=100);\ntranslate([move, 0, 0]) T_channel(wb, hb, wt, ht, xoff, 5, 1, t);\ntranslate([move, 2*move, 0]) O_channel(wt, hb+ht, wb, 10*hb, xoff, xoff, ro, ri, t);\n\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"910d814e6749ad009d088fc8fe2f86866dd0d6df","subject":"config: fix ziptie width","message":"config: fix ziptie width\n\nWas hacked to wrong width due to bug in hollow_cylinder\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\n$preview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+1*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\n$preview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+1*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"99551f6fb59a7f22f9718e57d42341566fb4ee54","subject":"inverted base orientation","message":"inverted base orientation\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 400;\n display_projection = false;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+30])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-30])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 3;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 3);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 60 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - 210])\n rotate([90,90,0])\n profile(3, 140);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 500;\n base_depth = 360;\n display_projection = false;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n profile_height = sections * 20;\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 3;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n base(width, base_depth, middle_sections);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width + 20 - offset * 2;\n plate_depth = base_depth - 20 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + middle_sections * 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - 210])\n rotate([90,90,0])\n profile(3, 140);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1689594b18a3fdfbd857a81a6091eee21585eebd","subject":"Added washer to toggle switch","message":"Added washer to toggle switch\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/MiniToggleSwitch.scad","new_file":"hardware\/vitamins\/MiniToggleSwitch.scad","new_contents":"\/*\n Vitamin: Mini Toggle Switch\n\n Local Frame:\n Switch is centred in XY\n Toggle is pointing up Z+\n Mounting face lies in XY plane at Z=0\n*\/\n\n\n\/\/ Type Getters\nfunction MiniToggleSwitch_TypeSuffix(t) = t[0];\nfunction MiniToggleSwitch_BodyWidth(t) = t[1];\nfunction MiniToggleSwitch_BodyDepth(t) = t[2];\nfunction MiniToggleSwitch_BodyHeight(t) = t[3];\nfunction MiniToggleSwitch_BarrelOD(t) = t[4];\nfunction MiniToggleSwitch_BarrelLength(t) = t[5];\nfunction MiniToggleSwitch_WasherOD(t) = t[6];\n\n\/\/ Type table\n\/\/ TypeSuffix BodyW BodyD BodyH BarrelOD BarrelL WasherOD\nMiniToggleSwitch_SPST6A = [\"SPST6A\", 12.5, 8, 10, 5, 9, 12 ];\n\n\n\/\/ Type collection\nMiniToggleSwitch_Types = [\n MiniToggleSwitch_SPST6A\n];\n\n\n\/\/ Vitamin catalogue\nmodule MiniToggleSwitch_Catalogue() {\n for (t = MiniToggleSwitch_Types) MiniToggleSwitch(t);\n}\n\n\n\/\/ Connectors\n\nMiniToggleSwitch_Con_Def\t\t\t\t= [ [0,0,0], [0,0,1], 0, 0, 0];\n\n\n\nmodule MiniToggleSwitch(type=MiniToggleSwitch_SPST6A, showWasher=true, washerOffset=3) {\n\n ts = MiniToggleSwitch_TypeSuffix(type);\n\n vitamin(\n \"vitamins\/MiniToggleSwitch.scad\",\n str(ts,\"Mini Toggle Switch\"),\n str(\"MiniToggleSwitch(\",ts,\")\")\n ) {\n view(t=[6.9, 13.6, 10.3], r=[72,0,33], d=280);\n\n if (DebugCoordinateFrames) frame();\n if (DebugConnectors) {\n connector(MiniToggleSwitch_Con_Def);\n }\n\n \/\/ parts\n MiniToggleSwitch_Body(type, showWasher, washerOffset);\n }\n}\n\nmodule MiniToggleSwitch_Body(t, showWasher=true, washerOffset=3) {\n ts = MiniToggleSwitch_TypeSuffix(t);\n\n \/\/ local shortcuts\n bw = MiniToggleSwitch_BodyWidth(t);\n bd = MiniToggleSwitch_BodyDepth(t);\n bh = MiniToggleSwitch_BodyHeight(t);\n bod = MiniToggleSwitch_BarrelOD(t);\n bl = MiniToggleSwitch_BarrelLength(t);\n wod = MiniToggleSwitch_WasherOD(t);\n\n \/\/ light metal bits\n color([0.8, 0.8, 0.8]) {\n \/\/ toggle\n \/\/ Assume half the barrel OD, and same length\n translate([0,0,bl- bod\/2])\n rotate([0,15,0])\n cylinder(r=bod\/4, h=bl+ bod\/2);\n\n\n \/\/ threaded barrel\n cylinder(r=bod\/2, h=bl);\n\n \/\/ body\n translate([-bw\/2, -bd\/2, -0.5])\n cube([bw,bd,0.5]);\n translate([-(bw-2)\/2, -(bd+0.5)\/2, -bh\/2])\n cube([(bw-2),(bd+0.5), bh\/2]);\n\n \/\/ terminals\n \/\/ TODO: parameterise this to account for diff terminal layouts\/sizes\n for (i=[-1,0])\n translate([i* 4, -bd\/6, -bh-4])\n cube([0.5, bd\/3, 4]);\n\n if (showWasher) {\n \/\/ washer\n translate([0,0,washerOffset])\n tube(wod\/2, bod\/2, 1, center=false);\n\n \/\/ nut\n translate([0,0,washerOffset + 1])\n cylinder(r=bod\/2 + 2, h=1.5, $fn=6);\n }\n\n }\n\n \/\/ plastic bits\n color([0.2, 0.6, 1]) {\n \/\/ body\n translate([-bw\/2, -bd\/2, -bh])\n cube([bw,bd,bh-0.5]);\n }\n}\n","old_contents":"\/*\n Vitamin: Mini Toggle Switch\n\n Local Frame:\n Switch is centred in XY\n Toggle is pointing up Z+\n Mounting face lies in XY plane at Z=0\n*\/\n\n\n\/\/ Type Getters\nfunction MiniToggleSwitch_TypeSuffix(t) = t[0];\nfunction MiniToggleSwitch_BodyWidth(t) = t[1];\nfunction MiniToggleSwitch_BodyDepth(t) = t[2];\nfunction MiniToggleSwitch_BodyHeight(t) = t[3];\nfunction MiniToggleSwitch_BarrelOD(t) = t[4];\nfunction MiniToggleSwitch_BarrelLength(t) = t[5];\n\n\/\/ Type table\n\/\/ TypeSuffix BodyW BodyD BodyH BarrelOD BarrelL\nMiniToggleSwitch_SPST6A = [\"SPST6A\", 12.5, 8, 10, 5, 9 ];\n\n\n\/\/ Type collection\nMiniToggleSwitch_Types = [\n MiniToggleSwitch_SPST6A\n];\n\n\n\/\/ Vitamin catalogue\nmodule MiniToggleSwitch_Catalogue() {\n for (t = MiniToggleSwitch_Types) MiniToggleSwitch(t);\n}\n\n\n\/\/ Connectors\n\nMiniToggleSwitch_Con_Def\t\t\t\t= [ [0,0,0], [0,0,1], 0, 0, 0];\n\n\n\nmodule MiniToggleSwitch(type=MiniToggleSwitch_SPST6A) {\n\n ts = MiniToggleSwitch_TypeSuffix(type);\n\n vitamin(\n \"vitamins\/MiniToggleSwitch.scad\",\n str(ts,\"Mini Toggle Switch\"),\n str(\"MiniToggleSwitch(\",ts,\")\")\n ) {\n view(t=[6.9, 13.6, 10.3], r=[72,0,33], d=280);\n\n if (DebugCoordinateFrames) frame();\n if (DebugConnectors) {\n connector(MiniToggleSwitch_Con_Def);\n }\n\n \/\/ parts\n MiniToggleSwitch_Body(type);\n }\n}\n\nmodule MiniToggleSwitch_Body(t) {\n ts = MiniToggleSwitch_TypeSuffix(t);\n\n \/\/ local shortcuts\n bw = MiniToggleSwitch_BodyWidth(t);\n bd = MiniToggleSwitch_BodyDepth(t);\n bh = MiniToggleSwitch_BodyHeight(t);\n bod = MiniToggleSwitch_BarrelOD(t);\n bl = MiniToggleSwitch_BarrelLength(t);\n\n \/\/ light metal bits\n color([0.8, 0.8, 0.8]) {\n \/\/ toggle\n \/\/ Assume half the barrel OD, and same length\n translate([0,0,bl- bod\/2])\n rotate([0,15,0])\n cylinder(r=bod\/4, h=bl+ bod\/2);\n\n\n \/\/ threaded barrel\n cylinder(r=bod\/2, h=bl);\n\n \/\/ body\n translate([-bw\/2, -bd\/2, -0.5])\n cube([bw,bd,0.5]);\n translate([-(bw-2)\/2, -(bd+0.5)\/2, -bh\/2])\n cube([(bw-2),(bd+0.5), bh\/2]);\n\n \/\/ terminals\n \/\/ TODO: parameterise this to account for diff terminal layouts\/sizes\n for (i=[-1,0])\n translate([i* 4, -bd\/6, -bh-4])\n cube([0.5, bd\/3, 4]);\n\n }\n\n \/\/ plastic bits\n color([0.2, 0.6, 1]) {\n \/\/ body\n translate([-bw\/2, -bd\/2, -bh])\n cube([bw,bd,bh-0.5]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c3d41a2df9bfc3871a86b7b90e76607f797cb410","subject":"The floating border issue was corrected.","message":"The floating border issue was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/square\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6,\r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n\t\t\t chaneLoopCutoutAxis = \"x\",\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n\t\t\t chainLoopType = \"square\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\",\r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText = \"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Helvetica\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor = baseColor,\r\n\t\t\t\tbaseHeight = baseHeight,\r\n baseThickness = baseThickness,\r\n\t\t\t\tbaseWidth = baseWidth,\r\n borderColor = borderColor,\r\n borderdistance = 5,\r\n borderHeight = borderHeight,\r\n borderradius = 8,\r\n\t\t\t\tbottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n\t\t\t\tchainLoop = chainLoop,\r\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\t\t\tchainLoopType = chainLoopType,\r\n letterThickness = letterThickness,\r\n\t\t\t\troundedCorners = roundedCorners,\r\n\t\t\t\tshowBorder = showBorder,\r\n topText = topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n topTextOffsetY = topTextOffsetY,\r\n\t\t\t\ttextSize = topTextSize);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight,\r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset,\r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n }\r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n\t\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n\t\t\t\t\t\tbaseWidth,\r\n borderColor,\r\n\t\t\t\t\t\tborderdistance,\r\n borderHeight,\r\n\t\t\t\t\t\tborderradius,\r\n\t\t\t\t\t\tbottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n\t\t\t\t\t\tchainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n letterThickness,\r\n\t\t\t\t\t\troundedCorners,\r\n\t\t\t\t\t\tshowBorder,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY)\r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText,\r\n textSize = textSize,\r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\r\n \/\/ Having the assignments in the method call caused an issue.\r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n borderHeight,\r\n\t\t\t\t\t borderradius,\r\n letterThickness,\r\n roundedCorners);\r\n }\r\n\r\n if (holes==2)\r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n if (holes==4)\r\n {\r\n base4holes(baseColor, baseWidth, baseHeight,\r\n\t\t\t\t\t chainLoop,\r\n\t\t\t\t\t chainLoopPosition,\r\n\t\t\t\t\t chainLoopType,\r\n\t\t\t\t\t borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n\t\t\techo(\"ccb\");\r\n nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t\t\tbaseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail();\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=5);\r\n\/\/ \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n\t\t\t\t\tbaseThickness,\r\n\t\t\t\t\tbaseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType,\r\n leftIconXyScale,\r\n rightIconXyScale,\r\n leftIconHeight,\r\n rightIconHeight,\r\n xOffset,\r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n\r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t baseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n size = [baseWidth, baseHeight, baseThickness];\r\n\techo(\"ntbbb:size\");\r\n\techo(size);\r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8,\r\n sides=30,\r\n sidesOnly=true,\r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n\r\n xTranslate = -x \/ 2.0;\r\n\r\n\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\r\n yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n\r\n\t\tif(chainLoopType == \"square\")\r\n\t\t{\r\n\t translate([xTranslate, yTranslate, 0])\r\n\t chainLoop(cutoutAxis = chaneLoopCutoutAxis,\r\n\t\t\t\t\t xLength = x,\r\n\t yLength = y,\r\n\t yPercentage = chainLoopLengthPercentageY,\r\n\t zLength = chainLoopLengthZ,\r\n\t zPercentage = chainLoopLengthPercentageZ);\r\n\t }\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n\t\t\t\t\t borderHeight,\r\n borderradius,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n\tcolor(\"pink\")\r\n translate([0,0,baseThickness\/2])\r\n\/\/ translate([0,0,baseThickness+letterThickness\/2])\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection()\r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\n\/\/module trebleClefScaledDown(h)\r\n\/\/{\r\n\/\/ scale([25.4\/90, -25.4\/90, 1]) union()\r\n\/\/ {\r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ linear_extrude(height=h)\r\n\/\/ polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/square\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6,\r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n\t\t\t chaneLoopCutoutAxis = \"x\",\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n\t\t\t chainLoopType = \"square\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\",\r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText = \"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Helvetica\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor = baseColor,\r\n\t\t\t\tbaseHeight = baseHeight,\r\n baseThickness = baseThickness,\r\n\t\t\t\tbaseWidth = baseWidth,\r\n borderColor = borderColor,\r\n borderdistance = 5,\r\n borderHeight = borderHeight,\r\n borderradius = 8,\r\n\t\t\t\tbottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n\t\t\t\tchainLoop = chainLoop,\r\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\t\t\tchainLoopType = chainLoopType,\r\n letterThickness = letterThickness,\r\n\t\t\t\troundedCorners = roundedCorners,\r\n\t\t\t\tshowBorder = showBorder,\r\n topText = topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n topTextOffsetY = topTextOffsetY,\r\n\t\t\t\ttextSize = topTextSize);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight,\r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset,\r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n }\r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n\t\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n\t\t\t\t\t\tbaseWidth,\r\n borderColor,\r\n\t\t\t\t\t\tborderdistance,\r\n borderHeight,\r\n\t\t\t\t\t\tborderradius,\r\n\t\t\t\t\t\tbottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n\t\t\t\t\t\tchainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n letterThickness,\r\n\t\t\t\t\t\troundedCorners,\r\n\t\t\t\t\t\tshowBorder,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY)\r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText,\r\n textSize = textSize,\r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\r\n \/\/ Having the assignments in the method call caused an issue.\r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n borderHeight,\r\n\t\t\t\t\t borderradius,\r\n letterThickness,\r\n roundedCorners);\r\n }\r\n\r\n if (holes==2)\r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n if (holes==4)\r\n {\r\n base4holes(baseColor, baseWidth, baseHeight,\r\n\t\t\t\t\t chainLoop,\r\n\t\t\t\t\t chainLoopPosition,\r\n\t\t\t\t\t chainLoopType,\r\n\t\t\t\t\t borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n\t\t\techo(\"ccb\");\r\n nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t\t\tbaseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail();\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=5);\r\n\/\/ \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n\t\t\t\t\tbaseThickness,\r\n\t\t\t\t\tbaseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType,\r\n leftIconXyScale,\r\n rightIconXyScale,\r\n leftIconHeight,\r\n rightIconHeight,\r\n xOffset,\r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n\r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t baseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n size = [baseWidth, baseHeight, baseThickness];\r\n\techo(\"ntbbb:size\");\r\n\techo(size);\r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8,\r\n sides=30,\r\n sidesOnly=true,\r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n\r\n xTranslate = -x \/ 2.0;\r\n\r\n\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\r\n yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n\r\n\t\tif(chainLoopType == \"square\")\r\n\t\t{\r\n\t translate([xTranslate, yTranslate, 0])\r\n\t chainLoop(cutoutAxis = chaneLoopCutoutAxis,\r\n\t\t\t\t\t xLength = x,\r\n\t yLength = y,\r\n\t yPercentage = chainLoopLengthPercentageY,\r\n\t zLength = chainLoopLengthZ,\r\n\t zPercentage = chainLoopLengthPercentageZ);\r\n\t }\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n\t\t\t\t\t borderHeight,\r\n borderradius,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection()\r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\n\/\/module trebleClefScaledDown(h)\r\n\/\/{\r\n\/\/ scale([25.4\/90, -25.4\/90, 1]) union()\r\n\/\/ {\r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ linear_extrude(height=h)\r\n\/\/ polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f6d446a9f6992b4386c6c60bb78cc00a4857b90f","subject":"bearings: add align param","message":"bearings: add align param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"bearings.scad","new_file":"bearings.scad","new_contents":"use ;\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR115 = [5,11,4];\nbearing_MR105 = [5,10,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\nmodule bearing(bearing_type, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[bearing_type[1],bearing_type[1],bearing_type[2]], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_dist_ = ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist;\n orient(orient)\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[0,0,1]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[0,0,1]);\n }\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n %if(show_zips)\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_thickness, orient=[0,0,1]);\n }\n }\n}\n","old_contents":"use ;\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR115 = [5,11,4];\nbearing_MR105 = [5,10,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\nmodule bearing(bearing_type, orient=[0,0,1])\n{\n orient(orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_dist_ = ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist;\n orient(orient)\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[0,0,1]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[0,0,1]);\n }\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n %if(show_zips)\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_thickness, orient=[0,0,1]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5f56d02114b24f6e27557e85db988661ee34d94a","subject":"pulley: misc","message":"pulley: misc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"pulley.scad","new_file":"pulley.scad","new_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?undef:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n fncylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n fncylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\nif(false)\n{\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);*\/\n pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,-1], flip=false);\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n}\n","old_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?undef:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n fncylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n fncylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\n\/*debug = true;*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,0], orient=[0,0,1]);*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,1], flip=false);*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"668ea95f42bd66aebfd84bd1b1a19f98cc1a25f3","subject":"extended 2d library","message":"extended 2d library\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library2d.scad","new_file":"library2d.scad","new_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Holowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\n","old_contents":"module ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x) {\n\tfor(i=[0:3])rotate(a=[0,0,90*i])translate([x,0])children();\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"026184abe3da569ba3582f2f709c3d41f5fb04ca","subject":"Start a redo of the switch mount in openscad","message":"Start a redo of the switch mount in openscad\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"$fn=100;\n\nbutton_radius = 49;\nhole_radius = 14.5;\ntable_padding = 40;\nextra_padding = 2;\nbottom_padding = 30;\n\nwall_thickness = 4;\n\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n\n\/\/ difference() {\n\/\/ cube(size=[mount_width, mount_height, mount_depth]);\n\n\/\/ translate([wall_thickness, wall_thickness, wall_thickness])\n\/\/ cube(size=[mount_width - (wall_thickness*2), mount_height, mount_depth]);\n\/\/ }\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\n\nmodule bottom() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nbottom();\nsides();\n\ntranslate([0, 0, mount_depth + 15])\ncover();","old_contents":"","returncode":1,"stderr":"error: pathspec 'models\/switch-mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"26078200c7c0fe79a6e44e326c72518190b9a1da","subject":"screws\/screw_nut: fix thread cut","message":"screws\/screw_nut: fix thread cut\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n difference()\n {\n union()\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=\"pos\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n }\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=\"neg\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"button\")\n {\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"set\")\n {\n if(drive == \"hex\")\n {\n \/\/ set head uses -1*mm smaller hex\n tz(-head_h)\n cylindera(d = fn_radius(threadsize-1, 6), h = 1000, $fn = 6, align=Z);\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n difference()\n {\n union()\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=\"pos\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n }\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=\"neg\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"button\")\n {\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"set\")\n {\n if(drive == \"hex\")\n {\n \/\/ set head uses -1*mm smaller hex\n tz(-head_h)\n cylindera(d = fn_radius(threadsize-1, 6), h = 1000, $fn = 6, align=Z);\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"98e7958b8add20c7f429b022d736d12911911c2b","subject":"initial model","message":"initial model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"rollup_string_fix\/rollup_string_fix.scad","new_file":"rollup_string_fix\/rollup_string_fix.scad","new_contents":"r=(3+2)\/2;\n\ndifference()\n{\n \/\/ main element\n cube([17, 6, 3]);\n \/\/ spherical holes\n for(offset = [0.5, 17-2*r-0.5])\n translate([r+offset, 6\/2, 3])\n sphere(r=r, $fs=0.001);\n \/\/ string entry\/exit points\n for(offset = [-0.5, 17-2+0.5])\n translate([offset, 0, 0] + [0, 6\/2, 6\/2])\n rotate([0, 90, 0])\n cylinder(r=(1+0.5)\/2, h=2, $fs=0.001);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rollup_string_fix\/rollup_string_fix.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"55369cf665c8ea42846df574293a8f861562962c","subject":"rcylinder: fix round_radius error","message":"rcylinder: fix round_radius error\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2)\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2)\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/4, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9fb30acb5faf5ec0adc437195e33bc9c1d3dd23b","subject":"added 2nd element (optimized for dual-element printing + fixed centering","message":"added 2nd element (optimized for dual-element printing + fixed centering\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pen_shelf\/pen_shelf.scad","new_file":"pen_shelf\/pen_shelf.scad","new_contents":"$fn=30;\n\nmodule part()\n{\n \/\/ bottom part\n cube([250, 2*5+70+14-10\/2, 5]);\n \/\/ rounder corners\n hull()\n for(i=[0,1])\n translate([i*(250-10)+10\/2, 2*5+70+14-10\/2, 0])\n cylinder(r=10\/2, h=5);\n \/\/ mounts\n for(dx=[20, (250-30\/2)\/2 , 250-20-30\/2])\n {\n difference()\n {\n \/\/ towers\n union()\n {\n for(dy=[0, 14+5])\n translate([dx, dy, 0])\n cube([15, 5, 30]);\n }\n \/\/ drill holes\n translate([dx+15\/2, -1, 30-15\/2])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, 28);\n }\n }\n}\n\npart();\ntranslate([250, -5, 0])\n rotate([0, 0, 180])\n part();\n","old_contents":"$fn=30;\n\nmodule part()\n{\n \/\/ bottom part\n cube([250, 2*5+70+14-10\/2, 5]);\n \/\/ rounder corners\n hull()\n for(i=[0,1])\n translate([i*(250-10)+10\/2, 2*5+70+14-10\/2, 0])\n cylinder(r=10\/2, h=5);\n \/\/ mounts\n for(dx=[20, (250-30)\/2 , 250-20-30])\n {\n difference()\n {\n \/\/ towers\n union()\n {\n for(dy=[0, 14+5])\n translate([dx, dy, 0])\n cube([15, 5, 30]);\n }\n \/\/ drill holes\n translate([dx+15\/2, -1, 30-15\/2])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, 28);\n }\n }\n}\n\npart();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4923e4404f12a005b8597d7686da94b8469c0c3d","subject":"yaxis\/motor_mount: add cutout for belt path","message":"yaxis\/motor_mount: add cutout for belt path\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis.scad","new_file":"y-axis.scad","new_contents":"include \ninclude \n\nuse \ninclude \ninclude \n\nycarriage_bearing_mount_bottom_thick = 3;\nycarriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nycarriage_bearing_mount_conn_bearing = [[0,0,ycarriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule ycarriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick;*\/\n height = 5+ycarriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,ycarriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*ycarriage_bearing_mount();*\/\n \/*#connector(ycarriage_bearing_mount_conn);*\/\n\/*}*\/\n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n translate([ymotor_w\/2,0,0])\n difference()\n {\n cubea([ymotor_w+ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_mount_thickness_h], align=[0,0,1]);\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n fncylindera(d=ymotor_round_d, h=ymotor_mount_thickness_h*2, orient=[0,0,1]);\n translate([0, 0,-1])\n cubea([1000, ymotor_round_d, ymotor_mount_thickness_h*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(ymotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness\/2, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=yaxis_motor_pulley_h, orient=[0,0,1]);\n }\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \ninclude \ninclude \n\nycarriage_bearing_mount_bottom_thick = 3;\nycarriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nycarriage_bearing_mount_conn_bearing = [[0,0,ycarriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule ycarriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick;*\/\n height = 5+ycarriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,ycarriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*ycarriage_bearing_mount();*\/\n \/*#connector(ycarriage_bearing_mount_conn);*\/\n\/*}*\/\n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n difference()\n {\n cubea([ymotor_w+ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_mount_thickness_h], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([ymotor_w\/2,0,-1])\n linear_extrude(ymotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=yaxis_motor_pulley_h, orient=[0,0,1]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1c20d7e4fdb9035675dab7424e8cf822e363291a","subject":"update for full test print of platform()","message":"update for full test print of platform()\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n polygon([\n [-50,-35], [50,-35],\n [50,-30], [60,-15],[60,15], [50,30],\n [50,35], [-50,35],\n [-50,30], [-55,20],[-55,-20], [-50,-30]\n ])\n\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n translate ([-45, 35, 0]) circle(r=7.5, center=true);\n translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n }\n square(size=[162,120], center=true);\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front\n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/ cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n \/\/translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n \/\/translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n\n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n\n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30) \n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=0, left=1);\n }\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 47]) cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 47+5]) cube(size=[20, 63, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 47+5]) cube(size=[20, 20, 10], center=true);\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n\n translate ([10, -23, 35]) esc();\n\/\/ translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n\n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar();\n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar();\n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n\n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar();\n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 45, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([0, 52.5, 42]) rotate([180, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -45, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([0, -52.5, 42]) rotate([180, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\nplatform();\n\n\/*\nintersection() {\nplatform();\n#translate ([80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([45-2.5, 30, 0]) cube(size=[20, 20, 400], center=true);\n}\n*\/\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n polygon([\n [-50,-35], [50,-35],\n [50,-30], [60,-15],[60,15], [50,30],\n [50,35], [-50,35],\n [-50,30], [-55,20],[-55,-20], [-50,-30]\n ])\n\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n translate ([-45, 35, 0]) circle(r=7.5, center=true);\n translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n }\n square(size=[162,120], center=true);\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front\n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/ cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n \/\/translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n \/\/translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n\n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n\n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30) hbaseholes(center=true);\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 47]) cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 47+5]) cube(size=[20, 63, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 47+5]) cube(size=[20, 20, 10], center=true);\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = false)\n{\n translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (!center) {\n translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n }\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n\n translate ([10, -23, 35]) esc();\n\/\/ translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n\n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar();\n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar();\n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n\n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar();\n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) children();\n translate ([45, 45, 57]) rotate([0, 0, a]) children();\n translate ([45, -45, 57]) rotate([0, 0, -a]) children();\n\n translate ([0, 52.5, 42]) rotate([180, 0, 2*a]) children();\n translate ([0, -52.5, 42]) rotate([180, 0, -2*a]) children();\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\n\/\/platform();\n\n\/*\nintersection() {\nplatform();\n#translate ([80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([45-2.5, 30, 0]) cube(size=[20, 20, 400], center=true);\n}\n*\/\n\n\/\/fullb();\n\ntranslate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"150260b4361cb7187944ed494e55d1377b6d6a71","subject":"bearing\/linear: fix cut for linear rods in open mount style","message":"bearing\/linear: fix cut for linear rods in open mount style\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"\ninclude \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U && clip_groove != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z*Z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n hole_dist = get(LinearBearingFlangeCutMountHoleDist, bearing);\n hole_dist_side = get(LinearBearingFlangeCutMountHoleDistSide, bearing);\n if(!is_undef(hole_dist) && !is_undef(hole_dist_side))\n {\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*hole_dist\/2)\n translate(x*X*hole_dist_side\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.4*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n\n assert(h>0);\n\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n ziptie_dist_ = v_fallback(ziptie_dist, [clip_dist\/2, ziptie_width*2<(h\/3+2*mm) ? h \/ 3 : U]);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(ziptie_dist_ != U && clip_groove != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z*Z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n hole_dist = get(LinearBearingFlangeCutMountHoleDist, bearing);\n hole_dist_side = get(LinearBearingFlangeCutMountHoleDistSide, bearing);\n if(!is_undef(hole_dist) && !is_undef(hole_dist_side))\n {\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*hole_dist\/2)\n translate(x*X*hole_dist_side\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[h+.1*mm,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n if(mount_style==\"open\")\n {\n hull()\n {\n cylindera(d=d+2*mm, h=1000, orient=Z);\n ty(1000)\n cylindera(d=d+2*mm, h=1000, orient=Z);\n }\n }\n else\n {\n cylindera(d=d+2*mm, h=1000, orient=Z);\n }\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(ziptie_dist_ != U && clip_groove != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z*Z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n \/\/\n hole_dist = get(LinearBearingFlangeCutMountHoleDist, bearing);\n hole_dist_side = get(LinearBearingFlangeCutMountHoleDistSide, bearing);\n if(!is_undef(hole_dist) && !is_undef(hole_dist_side))\n {\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*hole_dist\/2)\n translate(x*X*hole_dist_side\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n material(Mat_Ziptie)\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z, mount_dir_align=Y);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"\ninclude \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U && clip_groove != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z*Z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n hole_dist = get(LinearBearingFlangeCutMountHoleDist, bearing);\n hole_dist_side = get(LinearBearingFlangeCutMountHoleDistSide, bearing);\n if(!is_undef(hole_dist) && !is_undef(hole_dist_side))\n {\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*hole_dist\/2)\n translate(x*X*hole_dist_side\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.4*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n\n assert(h>0);\n\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n ziptie_dist_ = v_fallback(ziptie_dist, [clip_dist\/2, ziptie_width*2<(h\/3+2*mm) ? h \/ 3 : U]);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n material(Mat_Aluminium)\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(ziptie_dist_ != U && clip_groove != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z*Z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n hole_dist = get(LinearBearingFlangeCutMountHoleDist, bearing);\n hole_dist_side = get(LinearBearingFlangeCutMountHoleDistSide, bearing);\n if(!is_undef(hole_dist) && !is_undef(hole_dist_side))\n {\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*hole_dist\/2)\n translate(x*X*hole_dist_side\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[h+.1*mm,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(ziptie_dist_ != U && clip_groove != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z*Z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n \/\/\n hole_dist = get(LinearBearingFlangeCutMountHoleDist, bearing);\n hole_dist_side = get(LinearBearingFlangeCutMountHoleDistSide, bearing);\n if(!is_undef(hole_dist) && !is_undef(hole_dist_side))\n {\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*hole_dist\/2)\n translate(x*X*hole_dist_side\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n material(Mat_Ziptie)\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2fd3508de90ec35e20aafb0af67969adaf90130a","subject":"lcd2004: simplify gantry\/test code","message":"lcd2004: simplify gantry\/test code\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"lcd2004.scad","new_file":"lcd2004.scad","new_contents":"include \ninclude \n\ninclude \n\nuse \nuse \nuse \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=Z, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror(Y)\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=Z);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=Z);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=Z);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=Z, align=N)\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s, rounding_radius=3);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=Z, orient=Z);\n }\n}\n\nlcd2004_offset = [0, -34.2*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\nmodule part_lcd2004_mount()\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\nif(false)\n{\n mount_lcd2004(show_gantry=true);\n}\n","old_contents":"include \ninclude \n\ninclude \n\nuse \nuse \nuse \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=Z, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror(Y)\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=Z);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=Z);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=Z);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=Y);\n }\n }\n }\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=Z, align=N)\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s, rounding_radius=3);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=Z, orient=Z);\n }\n}\n\nlcd2004_offset = [0, -34.2*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\nmodule part_lcd2004_mount()\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\nif(false)\n{\n mount_lcd2004(show_gantry=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d68c5141d0a8c52b3c4153d6fe5440e998196a13","subject":"add an inlined version","message":"add an inlined version\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/microcontrollers\/adafruit\/trellis\/face-plate-with-icons\/cusomizer\/inlined\/face-plate-with-icons-customizer.scad-inlined.scad","new_file":"openscad\/models\/src\/main\/openscad\/microcontrollers\/adafruit\/trellis\/face-plate-with-icons\/cusomizer\/inlined\/face-plate-with-icons-customizer.scad-inlined.scad","new_contents":"\niconColor = \"green\"; \/\/ [pink, red, black, white, yellow, blue, green]\n\nleftTileOn = \"Yes\"; \/\/ [Yes, No]\n\nleftTileIcon = \"Mario\"; \/\/ [Autobot, Decepticon, Luigi, Mario, Rebel, Trooper]\n\nrightTileOn = \"Yes\"; \/\/ [Yes, No]\n\nrightTileIcon = \"Luigi\"; \/\/ [Autobot, Decepticon, Luigi, Mario, Rebel, Trooper]\n\n\/* [Hidden] *\/\n\n\nfacePlateWithIcons(iconColor = iconColor,\n leftTileIcon = leftTileIcon,\n leftTileOn = leftTileOn,\n rightTileIcon = rightTileIcon,\n rightTileOn = rightTileOn);\n\n\nmodule facePlateWithIcons(boardWidth = 77,\n iconColor = \"green\",\n leftTileIcon = \"None\",\n leftTileOn = \"No\",\n plateHeight = 1,\n rightTileOn = \"No\",\n rightTileIcon = \"None\")\n{\n\/\/ difference()\n {\n\/\/ import (\"\/home\/roberto\/Versioning\/world\/betoland\/electronics\/adafruit\/trellis\/Trellis_Soundboard\/sfxb-top.stl\");\n\/\/ import(\"\/Users\/lando\/Versioning\/world\/betoland-world\/electronics\/adafruit\/trellis\/Trellis_Soundboard\/sfxb-top.stl\");\n\n difference()\n {\n union()\n {\n xTranslate = -boardWidth;\n zTranslate = 0.5;\n\n if(leftTileOn == \"Yes\")\n {\n translate([xTranslate, 0, zTranslate])\n facePlateWithIcons_sideTile(boardWidth = boardWidth,\n iconColor = iconColor,\n tileIcon = leftTileIcon,\n plateHeight = plateHeight);\n }\n\n facePlateWithIcons_centerTile(boardWidth = boardWidth, plateHeight = plateHeight);\n\n if(rightTileOn == \"Yes\")\n {\n translate([-xTranslate, 0, zTranslate])\n facePlateWithIcons_sideTile(boardWidth = boardWidth,\n iconColor = iconColor,\n tileIcon = rightTileIcon,\n plateHeight = plateHeight);\n }\n }\n\n facePlateWithIcons_centerTile_cutouts_screws();\n }\n }\n}\n\nmodule facePlateWithIcons_centerTile(boardWidth, plateHeight)\n{\n difference()\n {\n color(\"green\")\n\n translate([0, 0, 0.5])\n roundedCube(cubeCentered = true,\n size = [boardWidth, boardWidth, plateHeight],\n sidesOnly = true);\n\n spacing = 31.1;\n\n translate([spacing, spacing, 0])\n facePlateWithIcons_centerTile_cutouts_buttons();\n\n\n }\n}\n\nmodule facePlateWithIcons_centerTile_cutouts_buttons()\n{\n boardWidth = 6.3;\n\n step = 1;\n\n yStart = 1;\n yEnd = 4;\n\n zStart = 1;\n zEnd = 4;\n\n for(x = [yStart : step : yEnd],\n \ty = [zStart : step : zEnd])\n {\n spacing = 15;\n\n xTranslate = boardWidth + (-x * spacing);\n yTranslate = boardWidth + (-y * spacing);\n\n translate([xTranslate, yTranslate, 0.5])\n roundedCube(cubeCentered = true,\n size = [boardWidth, boardWidth, 5],\n sidesOnly = true);\n }\n}\n\nmodule facePlateWithIcons_centerTile_cutouts_screws()\n{\n radius = 2;\n translateXY = 35;\n\n translate([translateXY, translateXY, 0])\n cylinder(r=radius, h=30, center=true, $fn = 20);\n\n translate([translateXY, -translateXY, 0])\n cylinder(r=radius, h=30, center=true, $fn = 20);\n\n translate([-translateXY, translateXY, 0])\n cylinder(r=radius, h=30, center=true, $fn = 20);\n\n translate([-translateXY, -translateXY, 0])\n cylinder(r=radius, h=30, center=true, $fn = 20);\n}\n\nmodule facePlateWithIcons_sideTile(boardWidth, iconColor, tileIcon, plateHeight)\n{\n \/\/ icon\n xTranslate = 35;\n zTranslate = plateHeight * 2;\n\n color(iconColor)\n translate([0, 0, 1])\n if(tileIcon == \"Decepticon\")\n {\n xyScale = 0.3;\n color(\"purple\")\n\n scale([xyScale, xyScale, 2])\n plbogen_deceopticonStamp();\n }\n else if(tileIcon == \"Luigi\")\n {\n xyScale = 2.3;\n scale([xyScale, xyScale, 1])\n luigiThumbnail();\n }\n else if(tileIcon == \"Mario\")\n {\n xyScale = 2.3;\n scale([xyScale, xyScale, 1])\n marioThumbnail();\n }\n else if(tileIcon == \"Rebel\")\n {\n xyScale = 2.1;\n scale([xyScale, xyScale, 1])\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(tileIcon == \"Trooper\")\n {\n xyScale = 1.7;\n scale([xyScale, xyScale, 1])\n scrumtrooper(2);\n }\n else\n {\n echo(\"drawing no icon\");\n cube([1,1,1]);\n }\n\n\n\n \/\/ tile\n roundedCube(cubeCentered = true,\n size = [boardWidth, boardWidth, plateHeight],\n sidesOnly = true);\n}\n\n\/**\n *\n * some parts of this software were inspired by\n *\n * \t http:\/\/www.thingiverse.com\/thing:9347\n *\n *\/\n\n\/**\n * makes a rounded cube\n *\/\nmodule roundedCube(cornerRadius=4,\n\t\t\t\t cubeCentered=false,\n\t\t\t\t sides=30,\n\t\t\t\t sidesOnly=false,\n\t\t\t\t size=[20,20,2])\n{\n $fn=sides;\n\n x = size[0] - cornerRadius\/2;\n y = size[1] - cornerRadius\/2;\n z = size[2];\n\n minkowski()\n {\n cube(size=[x,y,z], center=cubeCentered);\n\n if(sidesOnly)\n {\n cylinder(r=cornerRadius);\n }\n else\n {\n sphere(r=cornerRadius);\n }\n };\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule luigi(h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\n }\n }\n}\n\nmodule luigiThumbnail(h=2)\n{\n\txyScale = 0.084;\n\tscale([xyScale, xyScale, 1])\n\tluigi(h=h);\n}\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule mario(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\n }\n }\n}\n\nmodule marioThumbnail(h = 2)\n{\n xyScale = 0.164;\n scale([xyScale, xyScale, 1])\n mario(h = h);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule rebelAlliance(h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\n }\n}\n\nmodule rebelAllianceThumbnail(height = 1)\n{\n xyScale = .044;\n scale([xyScale, xyScale, 1])\n rebelAlliance(height);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\n\n\/\/plbogen_deceopticonStamp();\n\nmodule plbogen_deceopticonStamp(fudge = 0.1, h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-349.187500,-332.640645],[-300.781200,-33.671895],[0.000001,331.984345],[300.781301,-33.671895],[349.187501,-332.640645],[271.968801,-228.265645],[121.000001,-184.109395],[103.718801,-115.484395],[252.375001,-159.640695],[246.625001,-143.671895],[96.812501,-99.484395],[85.281301,-55.296895],[248.937501,-105.140695],[247.781301,-90.078195],[80.687501,-39.328195],[0.000001,28.359305],[-80.656199,-39.328195],[-247.781199,-90.078195],[-248.937499,-105.140695],[-85.281199,-55.296895],[-96.812499,-99.484395],[-246.624999,-143.671895],[-251.218699,-159.640695],[-103.718699,-115.484395],[-120.999999,-184.109395],[-271.968699,-228.265645],[-349.187500,-332.640645]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-229.343700,-20.515695],[-25.343700,43.390605],[-65.687500,119.546805],[-229.343700,-20.515695]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[229.343800,-20.515695],[65.687500,119.546805],[25.343800,43.390605],[229.343800,-20.515695]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[-121.000000,-328.390645],[-63.375000,-50.140695],[0.000000,5.328105],[63.375000,-50.140695],[121.000000,-328.390645],[29.968800,-205.234395],[0.000000,-205.234395],[-29.968700,-205.234395],[-121.000000,-328.390645]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-23.062500,-150.734395],[0.000000,-150.734395],[23.062500,-150.734395],[0.000000,-81.171895],[-23.062500,-150.734395]]);\n }\n linear_extrude(height=h)\n polygon([[-292.500001,0.890605],[-255.187500,230.921805],[-18.562500,332.640645],[-292.500000,0.890605]]);\n linear_extrude(height=h)\n polygon([[292.500000,0.890605],[18.562500,332.640645],[255.187500,230.921805],[292.500000,0.890605]]);\n }\n}\n\n\n\n\/* [Hidden] *\/\n\nresolution=50; \t\/\/ Use 20 for draft, 100 for nice\n\nborderWidth = 2;\/\/5;\n\nholediameter=3;\ncountersink=2;\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\n\nfudge = 0.1;\n\n\/\/ ************* Nametag Modules *************\n\nmodule nametag(baseColor = \"black\",\n baseHeight = 54,\n baseThickness = 2,\n baseWidth = 200,\n borderColor = \"yellow\",\n borderHeight = 6,\n bottomText = \"Love Lots\",\n bottomTextFont = \"Arial\",\n bottomTextOffsetX = 0,\n bottomTextOffsetY = 0,\n bottomTextSize = 9,\n chainLoop = true,\n\t chaneLoopCutoutAxis = \"x\",\n chainLoopLengthPercentageY = 0.75,\n chainLoopLengthPercentageZ = 0.65,\n chainLoopLengthZ = 10,\n chainLoopPosition = \"bottom\",\n\t\t\t chainLoopType = \"square\",\n iconColor = \"white\",\n leftIconHeight = 1.5,\n leftIconType = \"Light Bulb\",\n leftIconXyScale = 1.0,\n letterThickness = 3,\n rightIconHeight = 1.5,\n rightIconOffsetY = 0,\n rightIconType = \"Light Bulb\",\n rightIconXyScale = 1.7,\n roundedCorners = true,\n showBorder = \"No\",\n topText = \"Love is the Answer\",\n topTextColor = \"white\",\n topTextFont = \"Helvetica\",\n topTextSize = 5,\n topTextOffsetY = 0,\n xIconOffset = 87,\n yIconOffset = 87)\n{\n union()\n {\n nametag_assembly(baseColor = baseColor,\n\t\t\t\tbaseHeight = baseHeight,\n baseThickness = baseThickness,\n\t\t\t\tbaseWidth = baseWidth,\n borderColor = borderColor,\n borderdistance = 5,\n borderHeight = borderHeight,\n borderradius = 8,\n\t\t\t\tbottomText = bottomText,\n bottomTextFont = bottomTextFont,\n bottomTextOffsetX = bottomTextOffsetX,\n bottomTextOffsetY = bottomTextOffsetY,\n bottomTextSize = bottomTextSize,\n\t\t\t\tchainLoop = chainLoop,\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\n chainLoopLengthZ = chainLoopLengthZ,\n chainLoopPosition = chainLoopPosition,\n\t\t\t\tchainLoopType = chainLoopType,\n letterThickness = letterThickness,\n\t\t\t\troundedCorners = roundedCorners,\n\t\t\t\tshowBorder = showBorder,\n topText = topText,\n topTextColor = topTextColor,\n topTextFont = topTextFont,\n topTextOffsetY = topTextOffsetY,\n\t\t\t\ttextSize = topTextSize);\n\n icons(iconColor = iconColor,\n leftIconType = leftIconType,\n leftIconXyScale = leftIconXyScale,\n leftIconHeight = leftIconHeight,\n rightIconType = rightIconType,\n rightIconHeight = rightIconHeight,\n rightIconXyScale = rightIconXyScale,\n xOffset = xIconOffset,\n yOffset = yIconOffset,\n yRightOffset = rightIconOffsetY);\n }\n}\n\nmodule nametag_assembly(baseColor,\n\t\t\t\t\t\tbaseHeight,\n baseThickness,\n\t\t\t\t\t\tbaseWidth,\n borderColor,\n\t\t\t\t\t\tborderdistance,\n borderHeight,\n\t\t\t\t\t\tborderradius,\n\t\t\t\t\t\tbottomText,\n bottomTextFont,\n bottomTextOffsetX,\n bottomTextOffsetY,\n bottomTextSize,\n\t\t\t\t\t\tchainLoop,\n\t\t\t\t\t\tchaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t\t\tchainLoopType,\n letterThickness,\n\t\t\t\t\t\troundedCorners,\n\t\t\t\t\t\tshowBorder,\n topText,\n topTextColor,\n topTextFont,\n textSize,\n topTextOffsetY)\n{\n \/\/ top text\n color(topTextColor)\n translate([0, topTextOffsetY, 0])\n textExtrude(text=topText,\n textSize = textSize,\n font = topTextFont,\n height = 5);\n\n \/\/ bottom text\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\n textExtrude(text = bottomText,\n textSize=bottomTextSize,\n font = bottomTextFont,\n height = 5);\n\n if(showBorder == \"Yes\")\n {\n color(borderColor)\n \/\/ Having the assignments in the method call caused an issue.\n \/\/ So the assigments are left out.\n nametagBorder(baseHeight,\n\t\t\t\t\t baseThickness,\n baseWidth,\n\t\t\t\t\t borderdistance,\n borderHeight,\n\t\t\t\t\t borderradius,\n letterThickness,\n roundedCorners);\n }\n\n if (holes==2)\n {\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\n }\n else\n {\n if (holes==4)\n {\n base4holes(baseColor, baseWidth, baseHeight,\n\t\t\t\t\t chainLoop,\n\t\t\t\t\t chainLoopPosition,\n\t\t\t\t\t chainLoopType,\n\t\t\t\t\t borderdistance, roundedCorners);\n }\n else\n {\n nametagBase(baseColor,\n baseHeight,\n\t\t\t\t\t\tbaseThickness,\n baseWidth,\n chainLoop,\n\t\t\t\t\t\tchaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t\t\tchainLoopType,\n roundedCorners);\n }\n }\n}\n\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\n{\n color(iconColor)\n translate([xOffset, yOffset, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=1.6);\n\/\/ aquaman(4);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbaseclef15scale(1.8);\n\/\/ \tbaseclef15scale(4);\n }\n else if(iconType == \"Cat\")\n {\n cat(1.8);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 1.6])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumtrooper(2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule base2holes(baseColor,\n baseThickness,\n baseWidth,\n baseHeight,\n chainLoop,\n\t\t\t\t chaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t chainLoopType,\n borderdistance,\n roundedCorners)\n{\n\tdifference()\n\t{\n\t\tnametagBase(baseColor,\n\t\t\t\t\tbaseHeight,\n baseThickness,\n baseWidth,\n\t\t\t\t\tborderdistance,\n chainLoop,\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t\t\t\tchainLoopType,\n roundedCorners);\n\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\n\t\t\tnametagHole(baseThickness);\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\n\t\t\tnametagHole(baseThickness);\n\t}\n}\n\n\/\/TODO: whitespace format this module\nmodule base4holes(baseColor,\n\t\t\t\t\tbaseHeight,\n\t\t\t\t\tbaseThickness,\n\t\t\t\t\tbaseWidth,\n\t\t\t\t\tborderdistance,\n chainLoop,\n\t\t\t\t chaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t chainLoopType,\n roundedCorners)\n{\n\tdifference()\n\t{\n\t\tnametagBase(baseColor,\n\t\t\t\t\tbaseHeight,\n baseThickness,\n baseWidth,\n\t\t\t\t\tborderdistance,\n chainLoop,\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t\t\t\tchainLoopType,\n roundedCorners);\n\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\n nametagHole(baseThickness);\n\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\n nametagHole(baseThickness);\n\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\n nametagHole(baseThickness);\n\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\n nametagHole(baseThickness);\n\t}\n}\n\nmodule icons(iconColor,\n leftIconType,\n leftIconXyScale,\n rightIconXyScale,\n leftIconHeight,\n rightIconHeight,\n xOffset,\n yOffset,\n xRightOffset,\n yRightOffset)\n{\n \/\/ left icon\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\n\n \/\/ right icon\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\n}\n\nmodule nametagBase(baseColor,\n baseHeight,\n\t\t\t\t baseThickness,\n baseWidth,\n chainLoop,\n\t\t\t\t chaneLoopCutoutAxis,\n chainLoopLengthPercentageY,\n chainLoopLengthPercentageZ,\n chainLoopLengthZ,\n chainLoopPosition,\n\t\t\t\t chainLoopType,\n roundedCorners)\n{\n size = [baseWidth, baseHeight, baseThickness];\n\n\tcornerRadius = 8;\n\n color(baseColor)\n translate([0,0,baseThickness\/2])\n if(roundedCorners)\n {\n roundedCube(size=size,\n cornerRadius = cornerRadius,\n sides=30,\n sidesOnly=true,\n cubeCentered=true);\n }\n else\n {\n cube(size = size, center = true);\n }\n\n if(chainLoop)\n {\n \t\tif(chainLoopType == \"square\")\n \t\t{\n\t\t\t x = 21;\n\t y = 8;\n\n\t xTranslate = -x \/ 2.0;\n\n\t\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\n\t yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\n\t yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\n\n\t\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\n\t yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\n\n\t translate([xTranslate, yTranslate, 0])\n\t chainLoop(cutoutAxis = chaneLoopCutoutAxis,\n\t\t\t\t\t xLength = x,\n\t yLength = y,\n\t yPercentage = chainLoopLengthPercentageY,\n\t zLength = chainLoopLengthZ,\n\t zPercentage = chainLoopLengthPercentageZ);\n }\n \t\t else if(chainLoopType == \"rounded\")\n \t\t {\n \t\t\touterRadius = 10;\n\n \t\t\txTranslate = 0;\n \t\t\tyTranslate = \/\/outerRadius * 2\n \/\/\t\t\t \t\t\t baseHeight - outerRadius - cornerRadius\n \t\t\t \t\t\t (outerRadius) + (cornerRadius \/ 2.0) + (baseHeight \/ 2.0);\n\n \t\t\ttranslate([xTranslate, yTranslate, 0])\n \t\t\troundedChainLoop(height = 5,\n \t\t\t\t\t\t\t outerRadius = outerRadius);\n\t\t }\n }\n}\n\nmodule nametagBorder(baseHeight,\n\t\t\t\t\t baseThickness,\n baseWidth,\n\t\t\t\t\t borderdistance,\n\t\t\t\t\t borderHeight,\n borderradius,\n letterThickness,\n roundedCorners)\n{\n\tcolor(\"pink\")\n translate([0,0,baseThickness\/2])\n\/\/ this next commented line was causing the 'floating' border issue\n\/\/ translate([0,0,baseThickness+letterThickness\/2])\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\n {\n translate([0,baseHeight\/2-borderdistance,0])\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\n\n translate([0,-(baseHeight\/2-borderdistance),0])\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\n\n translate([baseWidth\/2-borderdistance,0,0])\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\n\n translate([-(baseWidth\/2-borderdistance),0,0])\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\n\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\n rotate(a=[0,0,0])\n nametagQuarter(baseWidth, borderradius);\n\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\n rotate(a=[0,0,180])\n nametagQuarter(baseWidth, borderradius);\n\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\n rotate(a=[0,0,90])\n nametagQuarter(baseWidth, borderradius);\n\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\n rotate(a=[0,0,270])\n nametagQuarter(baseWidth, borderradius);\n }\n}\n\nmodule nametagQuarter(baseWidth, borderradius)\n{\n\tintersection()\n\t{\n\t\tdifference()\n\t\t{\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\n\t\t}\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\n\t}\n}\n\nmodule nametagHole(baseThickness)\n{\n\ttranslate([0,0,baseThickness\/2])\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\n\ttranslate([0,0,baseThickness-countersink])\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\n}\n\n\/\/ ************* External Modules *************\n\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\nmodule baseclef15scale(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\n linear_extrude(height=h)\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\n linear_extrude(height=h)\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\n }\n}\n\nmodule scrumtrooper_poly_Selection(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\n linear_extrude(height=h)\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\n difference()\n {\n linear_extrude(height=h)\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\n }\n linear_extrude(height=h)\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\n }\n}\n\nmodule scrumtrooper(h)\n{\n scrumtrooper_poly_Selection(h);\n}\n\nmodule cat(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\n }\n}\n\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \n\/\/\n\/\/ https:\/\/www.thingiverse.com\/thing:269405\n\/\/\n\/\/ Programmed by Fryns - March 2014\n\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\n\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \n\n\/**\n *\n * some parts of this software were inspired by\n *\n * \t http:\/\/www.thingiverse.com\/thing:9347\n *\n *\/\n\n\/**\n * makes a rounded cube\n *\/\nmodule roundedCube(cornerRadius=4,\n\t\t\t\t cubeCentered=false,\n\t\t\t\t sides=30,\n\t\t\t\t sidesOnly=false,\n\t\t\t\t size=[20,20,2])\n{\n $fn=sides;\n\n x = size[0] - cornerRadius\/2;\n y = size[1] - cornerRadius\/2;\n z = size[2];\n\n minkowski()\n {\n cube(size=[x,y,z], center=cubeCentered);\n\n if(sidesOnly)\n {\n cylinder(r=cornerRadius);\n }\n else\n {\n sphere(r=cornerRadius);\n }\n };\n}\n\n\/**\n * \n * @param \n * @param valign valid values are \"top\", \"center\", \"baseline\" and \"bottom\". Default is \"baseline\".\n * @return \n *\/\nmodule textExtrude(text, textSize=6, valign = \"center\", font, height=4)\n{\n linear_extrude(height=height)\n text(text, \n font = font, \n size=textSize, \n valign = valign,\n halign = \"center\");\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule trebleClefScaledDown(h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\n }\n }\n}\n\nmodule trebleClefScaledDownThumbnail(h)\n{\n\txyScale = 0.18;\n\tscale([xyScale, xyScale, 1])\n\ttrebleClefScaledDown(h=h);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\nmodule aquaman(height=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) \n union()\n {\n linear_extrude(height=height)\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\n }\n}\n\nmodule aquamanThumbnail(height=1)\n{\n xyScale = 0.233;\n \n scale([xyScale, xyScale, 1])\n aquaman(height=height);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule luigi(h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\n }\n }\n}\n\nmodule luigiThumbnail(h=2)\n{\n\txyScale = 0.084;\n\tscale([xyScale, xyScale, 1])\n\tluigi(h=h);\n}\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule mario(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\n }\n }\n}\n\nmodule marioThumbnail(h = 2)\n{\n xyScale = 0.164;\n scale([xyScale, xyScale, 1])\n mario(h = h);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule rebelAlliance(h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\n }\n}\n\nmodule rebelAllianceThumbnail(height = 1)\n{\n xyScale = .044;\n scale([xyScale, xyScale, 1])\n rebelAlliance(height);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule thundercatsLogo(h=1)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\n }\n }\n}\n\nmodule thundercatsLogoThumbnail(height = 1)\n{\n\txyScale = 0.1592;\n\tscale([xyScale, xyScale, 1])\n\tthundercatsLogo(h = height);\n}\n\n\nmodule roundedChainLoop(height = 1,\n\t outerRadius = 10)\n{\n\tdifference()\n\t{\n\t\topenCylinder(height = height,\n\t \t\t\t \t outerRadius = outerRadius);\n\n\t\t\/\/ top cutout\n\t\tradius = outerRadius * 0.95;\n\t\tzTranslate = height * 2.1;\n\t\tcolor(\"green\")\n\t\ttranslate([0, 0, zTranslate])\n\t\tsphere(r = radius);\n\n\t\t\/\/ bottom cutout\n\t\tcolor(\"blue\")\n\t\ttranslate([0, 0, -zTranslate + height])\n\t\tsphere(r = radius);\n \t}\n}\n\n\/**\n * This is the square variety of chainloop.\n *\/\nmodule chainLoop(cutoutAxis = \"x\",\n\t\t\t\t xLength = 19,\n\t\t\t\t xPercentage = 0.70,\n yLength = 12,\n yPercentage = 0.75,\n zLength = 10,\n zPercentage = 0.65)\n{\n difference()\n {\n color(\"green\")\n cube([xLength, yLength, zLength]);\n\n cutout(cutoutAxis,\n\t\t\t\txLength,\n\t\t\t\txPercentage,\n\t\t\t\tyLength,\n\t\t\t\tyPercentage,\n\t\t\t\tzLength,\n\t\t\t\tzPercentage);\n }\n}\n\n\/**\n * This module takes the cubic lengths of the chain loop and calculates the\n * dimensions of the cot out protion based on the percentages given.\n *\n * The percentages are expected to be of type float with 1 being 100%.\n *\/\nmodule cutout(cutoutAxis = \"x\",\n\t\t\t xLength = 5,\n\t\t\t xPercentage = 0.2,\n yLength,\n yPercentage,\n zLength,\n zPercentage)\n{\n\tif(cutoutAxis == \"x\")\n\t{\n\t\tzCutoutLength = zLength * zPercentage;\n\t zTranslate = (zLength\/2.0) - (zCutoutLength \/ 2.0);\n\n\t yCutoutLength = yLength * yPercentage;\n\t yTranslate = (yLength \/ 2.0) - (yCutoutLength \/ 2.0);\n\n\t translate([-1, yTranslate, zTranslate])\n\t cube([xLength+3, yCutoutLength, zCutoutLength]);\n\t}\n\telse if(cutoutAxis == \"z\")\n\t{\n\t yCutoutLength = yLength * yPercentage;\n\t yTranslate = (yLength \/ 2.0) - (yCutoutLength \/ 2.0);\n\n\t\txCoutoutLength = xLength * xPercentage;\n\t\txTranslate = (xLength \/ 2.0) - (xCoutoutLength \/ 2.0);\n\n\t\ttranslate([xTranslate, yTranslate, -1])\n\t cube([xCoutoutLength, yCutoutLength, zLength+3]);\n\t}\n}\n\nmodule crescentMoon(height = 2)\n{\n $fn = 100;\n\n difference()\n {\n cylinder(r=7, h=height);\n\n xyTranslate = 1.7;\n radius = 5.5;\n translate([xyTranslate, xyTranslate, -1])\n cylinder(r=radius, h=height+2);\n }\n}\n\nmodule crescentMoonThumbnail()\n{\n xyScale = 1.7;\n\n scale([xyScale, xyScale, 1])\n crescentMoon();\n}\n\n\/**\n https:\/\/blog.adafruit.com\/2017\/04\/21\/view-all-the-iso-7000-iec-60417-graphical-symbols-for-use-on-equipment\/\n\n https:\/\/www.iso.org\/obp\/ui\/#iso:pub:PUB400008:en\n\n https:\/\/www.iso.org\/obp\/ui\/#iso:grs:7000:0089\n*\/\n\nmodule fan(height=1)\n{\n linear_extrude(height=height)\n fan2D();\n}\n\nmodule fan2D()\n{\n union()\n {\n fanHub();\n \n fanBlades();\n }\n}\n\nmodule fanBlade()\n{\n difference()\n {\n fanBladePartA();\n\n translate([0, 4.5, 0])\n fanBladePartB();\n }\n}\n\nmodule fanBlades()\n{\n for(i = [0 : 3])\n {\n\/\/ echo(i);\n \n rotate([0,0,i*90])\n translate([7,0,0])\n \n fanBlade();\n }\n}\n\n\/**\n * This is the first part of the fan blade. it only has circle with the main 'u' \n * shape cut out.\n *\/\nmodule fanBladePartA()\n{\n difference()\n { \n circle(r=5, $fn=30);\n \n translate([-3, -8,0])\n circle(r = 8, $fn=30);\n } \n}\n\n\/**\n * This part is the cutout for the right side round end\n *\/\nmodule fanBladePartB()\n{\n difference()\n {\n translate([2, -10, 0])\n square([3,5]);\n\n translate([3.2, -5, 0])\n circle(r=1.8, $fn=30);\n } \n}\n\nmodule fanHub()\n{\n difference()\n {\n circle(r=3, $fn=30);\n \n circle(r=2, $fn=30);\n }\n}\n\nmodule fanThumbnail()\n{\n fan(height=1);\n}\n\n\n\/**\n * This a fish. I used the following thing as an example of how to do the main fish\n * body:\n *\n * https:\/\/www.thingiverse.com\/thing:844015\n *\n *\/\nmodule fish(bodyRadius = 7, height = 1)\n{\n\trotate([0, 0, 135])\n\tunion()\n\t{\n\t\t\/\/ body\n\t\tcylinder(height,bodyRadius,bodyRadius);\n\n\t\t\/\/ head end\n\t\ttranslate([-bodyRadius,-bodyRadius,0])\n\t\t{\n\t\t\tcube([bodyRadius,bodyRadius,height]);\n\t\t}\n\n\t\t\/\/ back end\n\t\tcube([bodyRadius,bodyRadius,height]);\n\n\t\t\/\/ tail\n\t\tsize = 6.00015;\n\t\txTranslate = bodyRadius + 3;\n\t\tyTranslate = bodyRadius + 2;\/\/radius * 2 + 1;\n\t\ttranslate([xTranslate, yTranslate, 0])\n\t\ttriangle(size= size, height = height);\n\t}\n}\n\nmodule fishThumbnail()\n{\n\ttranslate([5, 0, 0])\n\tfish();\n}\n\n\/** Support functions and modules follow **\/\n\nmodule fish_tail(radius)\n{\n\n}\n\n\/\/lightBulb2D();\n\nmodule lightBulb(height=8)\n{\n linear_extrude(height=height)\n {\n lightBulb2D();\n }\n}\n\nmodule lightBulb2D()\n{\n union()\n { \n lightBulbTop();\n\n lightBulbBottom();\n }\n}\n\nmodule lightBulbBottom()\n{\n width = 7;\n height = 1;\n threadSpacing = 2.5;\n \n xTranslate = -width\/2.0;\n yTranslate = -13;\n \n translate([xTranslate, yTranslate, 0])\n square(size=[width, height]);\n \n translate([xTranslate, yTranslate - (threadSpacing * 1), 0])\n square(size=[width, height]);\n\n p = 0.79;\n\/\/ color(\"blue\")\n translate([xTranslate*p, yTranslate - (threadSpacing * 2), 0])\n square(size=[width*p, height]);\n}\n\nmodule lightBulbTop()\n{\n width = 10;\n\n\/\/ linear_extrude(height=4) \n {\n rotate([0, 0, 225])\n union()\n {\n\/\/ linear_extrude(height=4)\n {\n\/\/ cylinder(r = width);\n circle(r = width);\n }\n \n\/\/ linear_extrude(height=4)\n difference()\n {\n \n\/\/ linear_extrude(height=4)\n square(size=[width, width]);\n\n\/\/ linear_extrude(height=4)\n translate([width, width\/2, 0])\n rotate([0, 0, 45]) \n square(size=20); \n }\n } \n }\n}\n\nmodule lightBulbThumbnail()\n{\n xyScale = 0.8;\n \n scale([xyScale, xyScale, 0.2])\n lightBulb();\n}\n\n\/\/ This OpenSCAD code originally came from:\n\/\/ https:\/\/github.com\/onebeartoe\/imaging\/blob\/master\/graphics\/samples\/creeper-face\/creeper-face.scad\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\nmodule creeperface(height)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=height)\n polygon([[-100.000000,-300.000000],[-100.000000,-100.000000],[100.000000,-100.000000],[100.000000,-300.000000],[300.000000,-300.000000],[300.000000,-100.000000],[100.000000,-100.000000],[100.000000,0.000000],[200.000000,0.000000],[200.000000,300.000000],[100.000000,300.000000],[100.000000,200.000000],[-100.000000,200.000000],[-100.000000,300.000000],[-200.000000,300.000000],[-200.000000,0.000000],[-100.000000,0.000000],[-100.000000,-100.000000],[-300.000000,-100.000000],[-300.000000,-300.000000],[-100.000000,-300.000000]]);\n }\n}\n\nmodule creeperFaceThumbnail(height = 1)\n{\n xyScale = 0.116;\n \n scale([xyScale, xyScale, 1])\n creeperface(height);\n}\n\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\nmodule spur(zLength)\n{\n scale([25.4\/90, -25.4\/90, 2])\n translate([0, 0, -2])\n\/\/ union()\n {\n linear_extrude(height = zLength)\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\n }\n}\n\nmodule spurThumbnail(height = 1)\n{\n xyScale = 0.164;\n translate([0,0,4])\n scale([xyScale, xyScale, 1])\n spur(zLength = height);\n}\n\n\nmodule sun(height = 2)\n{\n difference()\n {\n sunSegments(height = height);\n \n translate([0, 0, -0.01])\n cylinder($fn=30,\n h = height,\n r=4.19);\n }\n}\n\nmodule sunThumbnail(height = 1)\n{\n xyScale = 1.63;\n \n scale([xyScale, xyScale, 1])\n sun(height = height);\n}\n\nmodule sunSegments(height)\n{ \n segments = 8;\n arch = 360.0 \/ segments;\n for(i = [1:segments]) \n {\n angle = i * arch;\n rotate ([0, 0, angle])\n translate ([0, 5,0])\n triangle(size=2.25, height = height);\n }\n}\n\n\/\/ TODO: Lower this to 50.\nmodule openCylinder(height = 3,\n outerRadius = 7,\n innerRadius = 4.5,\n fn = 100)\n{\n $fn = fn;\n\n difference()\n {\n cylinder(r=outerRadius,\n h=height);\n\n translate([0, 0, -1])\n cylinder(r=innerRadius,\n h=height+1.01);\n }\n}\n\nmodule oval(height = 3,\n\t\t\tradius = 20,\n xScale = 1.2,\n yScale = 1.4,\n\t\t\tfn = 30)\n{\n\t$fn = fn;\n\t\n scale (v=[xScale, yScale, 1])\n cylinder(h = height, r=radius);\n}\n\nmodule triangle(size=1, height=1)\n{\n rotate([0, 0, 90])\n cylinder(r=size, \n $fn=3,\n h=height);\n}\n\nmodule triangle(size=1, height=1)\n{\n rotate([0, 0, 90])\n cylinder(r=size, \n $fn=3,\n h=height);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/models\/src\/main\/openscad\/microcontrollers\/adafruit\/trellis\/face-plate-with-icons\/cusomizer\/inlined\/face-plate-with-icons-customizer.scad-inlined.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7b3f4ded35a0f3902f71fae098cd1510173805da","subject":"5in display model","message":"5in display model\n","repos":"beckdac\/zynthian-build","old_file":"zynthian-case.scad","new_file":"zynthian-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n %translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n %translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n \/\/ screen mounts\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2, j * displayBoardHeight\/2, -displayBoardThickness])\n difference() {\n cube([20, 20, 3], center=true);\n translate([i *2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n \/\/ encoder base\n}\n\n\/\/ lid with screen and encoders\nmodule lid() {\n \/\/ face plate\n \/\/ screen cutout\n \/\/ encoder cutout\n \/\/ screw holes\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}\n\ndisplay();","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\nmodule display() {\n \/\/ screen\n \/\/ board\n \/\/ screen mounts\n \/\/ corner tabs\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n \/\/ encoder base\n}\n\n\/\/ lid with screen and encoders\nmodule lid() {\n \/\/ face plate\n \/\/ screen cutout\n \/\/ encoder cutout\n \/\/ screw holes\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"06eadfac8263fad4cce279c46de7a61bec03aaab","subject":"Fix typo in unit test","message":"Fix typo in unit test\n","repos":"jsconan\/camelSCAD","old_file":"test\/core\/vector-2d.scad","new_file":"test\/core\/vector-2d.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\nuse <..\/..\/full.scad>\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit tests: 2D vectors handling.\n *\n * @package test\/core\/vector\n * @author jsconan\n *\/\nmodule testCoreVector2D() {\n testPackage(\"core\/vector-2d.scad\", 24) {\n \/\/ test core\/vector-2d\/vector2D()\n testModule(\"vector2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(vector2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(vector2D(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(vector2D(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(vector2D(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(vector2D([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(vector2D([\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(vector2D([1]), [1, 0], \"Should complete incomplete 2D vector\");\n assertEqual(vector2D([1, 2]), [1, 2], \"Should keep correct and complete 2D vector\");\n assertEqual(vector2D([1, 2, 3]), [1, 2], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/divisor2D()\n testModule(\"divisor2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(divisor2D(), [1, 1], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 6) {\n assertEqual(divisor2D(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(divisor2D(true), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D(false), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D(\"2\"), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D([\"3\"]), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D([\"4\", 3]), [1, 3], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 4) {\n assertEqual(divisor2D([2]), [2, 1], \"Should complete incomplete 2D vector\");\n assertEqual(divisor2D([0, 0]), [1, 1], \"Should correct 0 2D vector\");\n assertEqual(divisor2D([1, 2]), [1, 2], \"Should keep correct and complete 2D vector\");\n assertEqual(divisor2D([1, 2, 3]), [1, 2], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/apply2D()\n testModule(\"apply2D()\", 4) {\n testUnit(\"no parameter\", 1) {\n assertEqual(apply2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 15) {\n assertEqual(apply2D(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(apply2D(1, 2), [2, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(apply2D(1, 2, 3), [2, 3], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(apply2D(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(true, 1), [1, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(true, 1, 2), [1, 2], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(\"1\", 1), [1, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(\"1\", 1, 2), [1, 2], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\"], 1), [1, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\"], 1, 2), [1, 2], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong\");\n assertEqual(apply2D([\"1\", 1], 1), [1, 1], \"Should produce a corrected 2D vector if input is wrong\");\n assertEqual(apply2D([\"1\", 1], 1, 2), [1, 2], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 10) {\n assertEqual(apply2D([1]), [1, 0], \"Should complete incomplete 2D vector\");\n assertEqual(apply2D([1], y=2), [1, 2], \"Should complete incomplete 2D vector\");\n assertEqual(apply2D([1], 2, 3), [2, 3], \"Should complete incomplete 2D vector\");\n assertEqual(apply2D([1, 2]), [1, 2], \"Should keep correct and complete 2D vector\");\n assertEqual(apply2D([1, 2], 3, 4), [3, 4], \"Should keep correct and complete 2D vector\");\n assertEqual(apply2D([1, 2, 3]), [1, 2], \"Should truncate too big vector\");\n assertEqual(apply2D([1, 2, 3], 5, 6), [5, 6], \"Should truncate too big vector\");\n assertEqual(apply2D(x=5), [5, 0], \"Should create the vector from the provided X coordinate\");\n assertEqual(apply2D(y=6), [0, 6], \"Should create the vector from the provided Y coordinate)\");\n assertEqual(apply2D(x=5, y=6), [5, 6], \"Should create the vector from the provided coordinates\");\n }\n testUnit(\"circle\", 6) {\n assertEqual(apply2D([1, 2], r=3), [6, 6], \"Should apply the radius as coordinates of the 2D vector\");\n assertEqual(apply2D([1, 2], d=3), [3, 3], \"Should apply the diameter as coordinates of the 2D vector\");\n assertEqual(apply2D([1, 2], x=4, r=3), [4, 6], \"Should apply the radius as coordinates of the 2D vector, but the X\");\n assertEqual(apply2D([1, 2], y=5, d=3), [3, 5], \"Should apply the diameter as coordinates of the 2D vector, but the Y\");\n assertEqual(apply2D(r=5), [10, 10], \"Should create the vector from the provided radius\");\n assertEqual(apply2D(d=6), [6, 6], \"Should create the vector from the provided diameter\");\n }\n }\n \/\/ test core\/vector-2d\/norm2D()\n testModule(\"norm2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(norm2D(), 0, \"Cannot compute the length if no vector is provided, should return 0\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(norm2D(3), sqrt(18), \"Should translate a number into a 2D vector, then compute the length\");\n assertEqual(norm2D(true), 0, \"Cannot compute the length if no vector is provided (boolean given), should return 0\");\n assertEqual(norm2D(\"1\"), 0, \"Cannot compute the length if no vector is provided (string given), should return 0\");\n assertEqual(norm2D([\"1\"]), 0, \"Cannot compute the length if no vector is provided (array of strings given), should return 0\");\n assertEqual(norm2D([\"1\", 1]), 1, \"Cannot compute the length if no vector is provided (array given), should return 0\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(norm2D([1]), 1, \"Should complete incomplete 2D vector\");\n assertEqual(norm2D([1, 2]), sqrt(5), \"Should return an orthogonal 2D vector\");\n assertEqual(norm2D([1, 2, 3]), sqrt(5), \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/unit2D()\n testModule(\"unit2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(unit2D(), [0, 0], \"Should always produce a normalized 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 6) {\n assertEqual(unit2D(1), [1, 1] \/ norm2D([1, 1]), \"Should produce a normalized 2D vector with the input number as a coordinate\");\n assertEqual(unit2D(true), [0, 0], \"Should produce a normalized 2D vector filled with 0 if input is wrong\");\n assertEqual(unit2D(\"1\"), [0, 0], \"Should produce a normalized 2D vector filled with 0 if input is wrong\");\n assertEqual(unit2D([\"1\"]), [0, 0], \"Should produce a normalized 2D vector filled with 0 if input is wrong\");\n assertEqual(unit2D([\"1\", 1]), [0, 1] \/ norm2D([0, 1]), \"Should produce a normalized corrected 2D vector if input is wrong\");\n assertEqual(unit2D([\"1\", 1, 1]), [0, 1] \/ norm2D([0, 1]), \"Should produce a normalized corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(unit2D([1]), [1, 0] \/ norm2D([1, 0]), \"Should complete incomplete 2D vector and returns a normalized 2D vector\");\n assertEqual(unit2D([1, 2]), [1, 2] \/ norm2D([1, 2]), \"Should return a normalized 2D vector\");\n assertEqual(unit2D([1, 2, 3]), [1, 2] \/ norm2D([1, 2]), \"Should truncate too big vector and returns a normalized 2D vector\");\n }\n }\n \/\/ test core\/vector-2d\/normal()\n testModule(\"normal()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(normal(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(normal(1), [1, -1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(normal(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(normal(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(normal([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(normal([\"1\", 1]), [1, 0], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(normal([1]), [0, -1], \"Should complete incomplete 2D vector\");\n assertEqual(normal([1, 2]), [2, -1], \"Should return an orthogonal 2D vector\");\n assertEqual(normal([1, 2, 3]), [2, -1], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/flip()\n testModule(\"flip()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(flip(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(flip(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(flip(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(flip(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(flip([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(flip([\"1\", 1]), [1, 0], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(flip([1]), [0, 1], \"Should complete incomplete 2D vector\");\n assertEqual(flip([1, 2]), [2, 1], \"Should return an orthogonal 2D vector\");\n assertEqual(flip([1, 2, 3]), [2, 1], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/middle2D()\n testModule(\"middle2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(middle2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 12) {\n assertEqual(middle2D(a=1), [0.5, 0.5], \"If the second point is missing, assume its the origin\");\n assertEqual(middle2D(b=1), [0.5, 0.5], \"If the first point is missing, assume its the origin\");\n assertEqual(middle2D(a=[1], b=1), [1, 0.5], \"Should complete the first point if incomplete, should translate the second point to vector if number given\");\n assertEqual(middle2D(a=1, b=[1]), [1, 0.5], \"Should translate the first point to vector if number given, should complete the second point if incomplete\");\n assertEqual(middle2D(a=true), [0, 0], \"Should produce a 2D vector filled with 0 if first point is boolean\");\n assertEqual(middle2D(b=true), [0, 0], \"Should produce a 2D vector filled with 0 if second point is boolean\");\n assertEqual(middle2D(a=\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if first point is string\");\n assertEqual(middle2D(b=\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if second point is string\");\n assertEqual(middle2D(a=[\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if first point is array of strings\");\n assertEqual(middle2D(b=[\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if second point is array of strings\");\n assertEqual(middle2D(a=[\"1\", 1]), [0, .5], \"Should produce a corrected 2D vector if first point is wrong\");\n assertEqual(middle2D(b=[\"1\", 1]), [0, .5], \"Should produce a corrected 2D vector if second point is wrong\");\n }\n testUnit(\"vector\", 6) {\n assertEqual(middle2D([1]), [.5, 0], \"Should complete incomplete 2D vector, assume missing point to origin\");\n assertEqual(middle2D([1], [2]), [1.5, 0], \"Should complete incomplete 2D vector\");\n assertEqual(middle2D([1, 2]), [0.5, 1], \"Should returns a 2D vector, assume missing point to origin\");\n assertEqual(middle2D([1, 2], [2, 3]), [1.5, 2.5], \"Should returns a 2D vector\");\n assertEqual(middle2D([1, 2, 3]), [0.5, 1], \"Should truncate too big vector, assume missing point to origin\");\n assertEqual(middle2D([1, 2, 3], [4, 5, 6]), [2.5, 3.5], \"Should truncate too big vectors\");\n }\n }\n \/\/ test core\/vector-2d\/move2D()\n testModule(\"move2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(move2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 15) {\n assertEqual(move2D(1), [1, 1], \"Should translate number to 2D vector (no direction vector)\");\n assertEqual(move2D(1, 1), [1, 1], \"Should translate number to 2D vector (direction vector but not distance)\");\n assertEqual(move2D(1, 1, 1), [1, 1] + [1, 1] \/ norm2D([1, 1]), \"Should translate number to 2D vector (direction vector and distance)\");\n\n assertEqual(move2D(true), [0, 0], \"Should produce a default 2D vector if input is boolean (no direction vector)\");\n assertEqual(move2D(true, true), [0, 0], \"Should produce a default 2D vector if input is boolean (direction vector but not distance)\");\n assertEqual(move2D(true, true, true), [0, 0], \"Should produce a default 2D vector if input is boolean (direction vector and distance)\");\n\n assertEqual(move2D(\"1\"), [0, 0], \"Should produce a default 2D vector if input is string (no direction vector)\");\n assertEqual(move2D(\"1\", \"1\"), [0, 0], \"Should produce a default 2D vector if input is string (direction vector but not distance)\");\n assertEqual(move2D(\"1\", \"1\", \"1\"), [0, 0], \"Should produce a default 2D vector if input is string (direction vector and distance)\");\n\n assertEqual(move2D([\"1\"]), [0, 0], \"Should produce a default 2D vector if input is array (no direction vector)\");\n assertEqual(move2D([\"1\"], [\"1\"]), [0, 0], \"Should produce a default 2D vector if input is array (direction vector but not distance)\");\n assertEqual(move2D([\"1\"], [\"1\"], [\"1\"]), [0, 0], \"Should produce a default 2D vector if input is array (direction vector and distance)\");\n\n assertEqual(move2D([\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong (no direction vector)\");\n assertEqual(move2D([\"1\", 1], [\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong (direction vector but not distance)\");\n assertEqual(move2D([\"1\", 1], [\"1\", 1], 1), [0, 2], \"Should produce a corrected 2D vector if input is wrong (direction vector and distance)\");\n }\n testUnit(\"vector\", 9) {\n assertEqual(move2D([1]), [1, 0], \"Should complete incomplete 2D vector (no direction vector)\");\n assertEqual(move2D([1], [1]), [1, 0], \"Should complete incomplete 2D vector (direction vector but not distance)\");\n assertEqual(move2D([1], [1], 1), [2, 0], \"Should complete incomplete 2D vector (direction vector and distance)\");\n assertEqual(move2D([1, 2]), [1, 2], \"Should return the provided 2D vector (no direction vector)\");\n assertEqual(move2D([1, 2], [1, 2]), [1, 2], \"Should return the provided 2D vector (direction vector but not distance)\");\n assertEqual(move2D([1, 2], [1, 2], 1), [1, 2] + [1, 2] \/ norm2D([1, 2]), \"Should return a 2D vector (direction vector and distance)\");\n assertEqual(move2D([1, 2, 3]), [1, 2], \"Should truncate too big vector and returns a 2D vector (no direction vector)\");\n assertEqual(move2D([1, 2, 3], [1, 2, 3]), [1, 2], \"Should truncate too big vector and returns a 2D vector (direction vector but not distance)\");\n assertEqual(move2D([1, 2, 3], [1, 2, 3], 1), [1, 2] + [1, 2] \/ norm2D([1, 2]), \"Should truncate too big vector and returns a 2D vector (direction vector and distance)\");\n }\n }\n \/\/ test core\/vector-2d\/center2D()\n testModule(\"center2D()\", 4) {\n testUnit(\"no parameter\", 1) {\n assertEqual(center2D(), [0, 0], \"Without parameter the function should return the origin\");\n }\n testUnit(\"wrong type\", 5) {\n assertEqual(center2D(\"10\", \"10\", \"10\"), [0, 0], \"Cannot compute center of strings, should return the origin\");\n assertEqual(center2D(true, true, true), [0, 0], \"Cannot compute center of boolean, should return the origin\");\n assertEqual(center2D([], [], []), [0, 0], \"Cannot compute center of empty arrays, should return the origin\");\n assertEqual(center2D([\"1\"], [\"2\"], [\"3\"]), [0, 0], \"Cannot compute center of arrays, should return the origin\");\n assertEqual(center2D([1, 1], [2, 2], [2]), [2, 1], \"Cannot compute center with a vector radius, should return the point at the middle\");\n }\n testUnit(\"positive\", 5) {\n assertEqual(center2D(1, 2, 1), [2, 1], \"Numbers should be converted to vectors\");\n assertEqual(center2D([10, 20], [8, 16], 10), [9, 18] + ([-4, 2] \/ norm([-4, 2])) * sqrt(100 - pow(norm([-2, -4]) \/ 2, 2)), \"Should compute the center of the circle\");\n assertEqual(center2D([10], [8], 10), [9, 0] + ([0, 2] \/ norm([0, 2])) * sqrt(100 - pow(norm([2, 0]) \/ 2, 2)), \"Should accept vector smaller than 2D, then upscale them and compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20, 30], [8, 16, 32], 10), [9, 18] + ([-4, 2] \/ norm([-4, 2])) * sqrt(100 - pow(norm([-2, -4]) \/ 2, 2)), \"Should accept vector bigger than 2D, but should only compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20], [8, 16], 1), [9, 18], \"Cannot compute the center if the radius is smaller than the distance between the points, should return the point at the middle\");\n }\n testUnit(\"negative\", 5) {\n assertEqual(center2D(1, 2, 1, true), [1, 2], \"Numbers should be converted to vectors\");\n assertEqual(center2D([10, 20], [8, 16], 10, true), [9, 18] + ([4, -2] \/ norm([4, -2])) * sqrt(100 - pow(norm([2, 4]) \/ 2, 2)), \"Should compute the center of the circle\");\n assertEqual(center2D([10], [8], 10, true), [9, 0] + ([0, -2] \/ norm([0, -2])) * sqrt(100 - pow(norm([-2, 0]) \/ 2, 2)), \"Should accept vector smaller than 2D, then upscale them and compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20, 30], [8, 16, 32], 10, true), [9, 18] + ([4, -2] \/ norm([4, -2])) * sqrt(100 - pow(norm([2, 4]) \/ 2, 2)), \"Should accept vector bigger than 2D, but should only compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20], [8, 16], 1, true), [9, 18], \"Cannot compute the center if the radius is smaller than the distance between the points, should return the point at the middle\");\n }\n }\n \/\/ test core\/vector-2d\/angle2D()\n testModule(\"angle2D()\", 2) {\n testUnit(\"default value\", 3) {\n assertEqual(angle2D(), 0, \"Should return 0 if no vector was provided\");\n assertEqual(angle2D(\"1\", \"2\"), 0, \"Cannot compute angle of strings\");\n assertEqual(angle2D(true, true), 0, \"Cannot compute angle of booleans\");\n }\n testUnit(\"compute angle\", 5) {\n assertEqual(round(angle2D(1, 2)), 0, \"When single numbers are provided, they should be translated to vector. Vectors with same direction does not have angle.\");\n assertEqual(angle2D([1, 0], [0, 1]), 90, \"Orthogonal vectors have an angle of 90\u00b0\");\n assertEqual(angle2D([1, 0], [0, -1]), 90, \"Orthogonal vectors have an angle of 90\u00b0, whatever their direction\");\n assertEqual(angle2D([1, 0], [-1, 0]), 180, \"Vectors with opposite direction have an angle of 180\u00b0\");\n assertEqual(round(angle2D([1, 2], rotp([1, 2], 75))), 75, \"Should have an angle of 75\u00b0\");\n }\n }\n \/\/ test core\/vector-2d\/sinp()\n testModule(\"sinp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(sinp(), [0, 0], \"Should return [0, 0]\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(sinp(\"1\", \"2\", \"3\", \"4\", \"5\"), [0, 0], \"Cannot use strings to build the point, should return [0, 0]\");\n assertEqual(sinp([1], [2], [3], [4], [5]), [0, 0], \"Cannot use vectors to build the point, should return [0, 0]\");\n assertEqual(sinp(true, true, true, true, true), [0, 0], \"Cannot use booleans to build the point, should return [0, 0]\");\n }\n testUnit(\"number\", 5) {\n assertEqual(sinp(1), [1, 0], \"Should return [1, 0]\");\n assertEqual(sinp(0.1, 2), [0.1, sin(18)], \"Should return [0.1, sin(18)]\");\n assertEqual(sinp(0.2, 2, 6), [0.2, 6 * sin(36)], \"Should return [0.2, 6 * sin(36)]\");\n assertEqual(sinp(0.5, 2, 6, 10), [0.5, 6 * sin(100)], \"Should return [0.5, 6 * sin(100)]\");\n assertEqual(sinp(0.8, 2, 6, 10, 15), [0.8, 15 + 6 * sin(154)], \"Should return [0.8, 15 + 6 * sin(100)]\");\n }\n }\n \/\/ test core\/vector-2d\/cosp()\n testModule(\"cosp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(cosp(), [1, 0], \"Should return [1, 0]\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(cosp(\"1\", \"2\", \"3\", \"4\", \"5\"), [1, 0], \"Cannot use strings to build the point, should return [1, 0]\");\n assertEqual(cosp([1], [2], [3], [4], [5]), [1, 0], \"Cannot use vectors to build the point, should return [1, 0]\");\n assertEqual(cosp(true, true, true, true, true), [1, 0], \"Cannot use booleans to build the point, should return [1, 0]\");\n }\n testUnit(\"number\", 5) {\n assertEqual(cosp(1), [1, 1], \"Should return [1, 1]\");\n assertEqual(cosp(0.1, 2), [cos(18), 0.1], \"Should return [cos(18), 0.1]\");\n assertEqual(cosp(0.2, 2, 6), [6 * cos(36), 0.2], \"Should return [6 * cos(36), 0.2]\");\n assertEqual(cosp(0.5, 2, 6, 10), [6 * cos(100), 0.5], \"Should return [6 * cos(100), 0.5]\");\n assertEqual(cosp(0.8, 2, 6, 10, 15), [15 + 6 * cos(154), 0.8], \"Should return [15 + 6 * cos(100), 0.8]\");\n }\n }\n \/\/ test core\/vector-2d\/rotp()\n testModule(\"rotp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(rotp(), [undef, undef], \"Cannot compute rotation if no parameter is provided\");\n }\n testUnit(\"wrong types\", 5) {\n assertEqual(rotp(\"1\", \"2\"), [undef, undef], \"Cannot compute rotation from strings\");\n assertEqual(rotp(1, 2), [undef, undef], \"Cannot compute rotation from number\");\n assertEqual(rotp([1], [2]), [undef, undef], \"Cannot compute rotation from arrays\");\n assertEqual(rotp([1], 90), [undef, undef], \"Cannot compute rotation from incomplete vector\");\n assertEqual(rotp(true, true), [undef, undef], \"Cannot compute rotation from booleans\");\n }\n testUnit(\"vector and angle\", 4) {\n assertEqual(rotp([23, 67], 0), [23, 67], \"Should return [23, 67]\");\n assertEqual(rotp([23, 67], 290), _rot2([23, 67], 290), \"Should return [23, 67] rotated by 290\u00b0\");\n assertEqual(rotp([23, 67], -76), _rot2([23, 67], -76), \"Should return [23, 67] rotated by -76\u00b0\");\n assertEqual(rotp([23, 67], 464), _rot2([23, 67], 104), \"Should return [23, 67] rotated by 104\u00b0\");\n }\n }\n \/\/ test core\/vector-2d\/mirp()\n testModule(\"mirp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(mirp(), [undef, undef], \"Cannot compute mirror if no parameter is provided\");\n }\n testUnit(\"wrong types\", 5) {\n assertEqual(mirp(\"1\", \"2\"), [undef, undef], \"Cannot compute mirror from strings\");\n assertEqual(mirp(1, 2), [undef, undef], \"Cannot compute mirror from number\");\n assertEqual(mirp([1], [2]), [undef, undef], \"Cannot compute mirror from arrays\");\n assertEqual(mirp([1], 90), [undef, undef], \"Cannot compute mirror from incomplete vector\");\n assertEqual(mirp(true, true), [undef, undef], \"Cannot compute mirror from booleans\");\n }\n testUnit(\"vector and axis\", 3) {\n assertApproxEqual(mirp([23, 67], [1, 0]), [23, -67], \"Should return [23, 67] mirrored around X\");\n assertApproxEqual(mirp([23, 67], [0, 1]), [-23, 67], \"Should return [23, 67] mirrored around Y\");\n assertApproxEqual(mirp([23, 67], [1, 1]), [67, 23], \"Should return [23, 67] mirrored around XY\");\n }\n }\n \/\/ test core\/vector-2d\/arcp()\n testModule(\"arcp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(arcp(), [undef, undef], \"Cannot compute the point if no parameter is provided\");\n }\n testUnit(\"wrong types\", 4) {\n assertEqual(arcp(\"1\", \"2\"), [undef, undef], \"Cannot compute the point from strings\");\n assertEqual(arcp(1, 1), [undef, undef], \"Cannot compute the point from numbers\");\n assertEqual(arcp(true, true), [undef, undef], \"Cannot compute the point from booleans\");\n assertEqual(arcp([\"1\", \"2\"]), [undef, undef], \"Cannot compute the point from arrays\");\n }\n testUnit(\"vector\", 6) {\n assertEqual(arcp([]), [undef, undef], \"Cannot compute the point from empty vector\");\n assertEqual(arcp([], 30), [undef, undef], \"Cannot compute the point from empty vector, event if angle is provided\");\n assertEqual(arcp([10, 10]), [undef, undef], \"Cannot compute the point without angle\");\n assertEqual(arcp([10, 10], 45), [cos(45)*10, sin(45)*10], \"Angle of 45 degrees\");\n assertEqual(arcp([20, 10], 30), [cos(30)*20, sin(30)*10], \"Angle of 30 degrees\");\n assertEqual(arcp([10, 20], 60), [cos(60)*10, sin(60)*20], \"Angle of 60 degrees\");\n }\n }\n \/\/ test core\/vector-2d\/arcPoint()\n testModule(\"arcPoint()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(arcPoint(), [0, 0], \"Should return [0, 0]\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(arcPoint(\"1\", \"2\"), [0, 0], \"Strings are not valids, the function should return [0, 0]\");\n assertEqual(arcPoint(true, true), [0, 0], \"Booleans are not valids, the function should return [0, 0]\");\n assertEqual(arcPoint([\"1\", \"2\"], [\"1\"]), [0, 0], \"Arrays are not valids, the function should return [0, 0]\");\n }\n testUnit(\"vector\", 12) {\n assertEqual(arcPoint([]), [0, 0], \"An empty vector should produce [0, 0]\");\n assertEqual(arcPoint([], 30), [0, 0], \"An empty vector should produce [0, 0], whatever the angle is\");\n assertEqual(arcPoint(10), [10, 0], \"A single number should be converted to vector\");\n assertEqual(arcPoint([10, 10]), [10, 0], \"Without angle, the vector should be projected on the X axis\");\n assertEqual(arcPoint([10, 10], 45), [cos(45)*10, sin(45)*10], \"Angle of 45 degrees\");\n assertEqual(arcPoint([20, 10], 30), [cos(30)*20, sin(30)*10], \"Angle of 30 degrees\");\n assertEqual(arcPoint([10, 20], 60), [cos(60)*10, sin(60)*20], \"Angle of 60 degrees\");\n assertEqual(arcPoint([10, 20], 60, 30, 50), [cos(60)*30, sin(60)*50], \"The X and Y parameters should replace the vector's coordinates\");\n assertEqual(arcPoint(a=60, x=30, y=50), [cos(60)*30, sin(60)*50], \"Should accept the radius as separated coordinates\");\n assertEqual(arcPoint([10, 20], 360), [cos(0)*10, sin(0)*20], \"Angle of 360 degrees should be equal to 0 degrees\");\n assertEqual(arcPoint([10, 20], 420), [cos(60)*10, sin(60)*20], \"Angle of 420 degrees should be equal to 60 degrees\");\n assertEqual(arcPoint([10, 20], -20), [cos(340)*10, sin(340)*20], \"Angle of -20 degrees should be equal to 340 degrees\");\n }\n }\n \/\/ test core\/vector-2d\/rotate2D()\n testModule(\"rotate2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(rotate2D(), \"Cannot rotate an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(rotate2D(\"1\", \"2\"), [[0, 0]], \"Cannot rotate a string\");\n assertEmptyArray(rotate2D(1, 1), [], \"Cannot rotate a number\");\n assertEmptyArray(rotate2D(true, true), [], \"Cannot rotate a boolean\");\n }\n testUnit(\"points\", 6) {\n assertEqual(rotate2D([23, 67]), [[23, 23], [67, 67]], \"Should upscale the numbers to vector 2D\");\n assertEqual(rotate2D([23, 67], 290), [_rot2([23, 23], 290), _rot2([67, 67], 290)], \"Should upscale the numbers to vector 2D and rotate them by 290\u00b0\");\n\n assertEqual(rotate2D([[23, 67], [12, 9]]), [[23, 67], [12, 9]], \"Should return [[23, 67], [12, 9]]\");\n assertEqual(rotate2D([[23, 67], [12, 9]], 290), [_rot2([23, 67], 290), _rot2([12, 9], 290)], \"Should return [[23, 67], [12, 9]] rotated by 290\u00b0\");\n assertEqual(rotate2D([[23, 67], [12, 9]], -76), [_rot2([23, 67], -76), _rot2([12, 9], -76)], \"Should return [[23, 67], [12, 9]] rotated by -76\u00b0\");\n assertEqual(rotate2D([[23, 67], [12, 9]], 464), [_rot2([23, 67], 104), _rot2([12, 9], 104)], \"Should return [[23, 67], [12, 9]] rotated by 104\u00b0\");\n }\n }\n \/\/ test core\/vector-2d\/scale2D()\n testModule(\"scale2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(scale2D(), \"Should return an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(scale2D(\"1\", \"2\"), [[0, 0]], \"Cannot scale strings\");\n assertEqual(scale2D([1], [2]), [[0, 0]], \"Incomplete vectors should be adjusted\");\n assertEqual(scale2D(true, true), [], \"Cannot scale booleans\");\n }\n testUnit(\"points\", 4) {\n assertEqual(scale2D([[1, 1], [2, 2]]), [[1, 1], [2, 2]], \"A default scale factor should be utilized if none is provided\");\n assertEqual(scale2D([[1, 2], [5, 9]], 2), [[2, 4], [10, 18]], \"When the scale factor is a single number it should be applied to all elements\");\n assertEqual(scale2D([[3, 1.5], [2.3, 7]], [0.6, 1.5]), [[3*0.6, 1.5*1.5], [2.3*0.6, 7*1.5]], \"When the scale factor is a vector its elements are applied respectively to each elements of the listed points\");\n assertEqual(scale2D([[1], [8]], 3), [[3, 0], [24, 0]], \"Incomplete vectors should be adjusted\");\n }\n }\n \/\/ test core\/vector-2d\/resize2D()\n testModule(\"resize2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(resize2D(), \"Should return an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(resize2D(\"1\", \"2\"), [[0, 0]], \"Cannot resize strings\");\n assertEqual(resize2D([1], [2]), [[0, 0]], \"Incomplete vectors should be adjusted\");\n assertEqual(resize2D(true, true), [], \"Cannot resize booleans\");\n }\n testUnit(\"points\", 4) {\n assertEqual(resize2D([[1, 3], [5, 9]]), [[1, 3], [5, 9]], \"No change will be made if no size is provided\");\n assertEqual(resize2D([[1, 3], [5, 9]], 2), [[1*2\/4, 3*2\/6], [5*2\/4, 9*2\/6]], \"When the size is a single number it should be applied to all elements\");\n assertEqual(resize2D([[1, 3], [5, 9]], [2, 3]), [[1*2\/4, 3*3\/6], [5*2\/4, 9*3\/6]], \"When the size is a vector its elements are applied respectively to each elements of the listed points\");\n assertEqual(resize2D([[1], [8]], 3), [[1*3\/7, 0], [8*3\/7, 0]], \"Incomplete vectors should be adjusted\");\n }\n }\n \/\/ test core\/vector-2d\/mirror2D()\n testModule(\"mirror2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(mirror2D(), \"Should return an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(mirror2D(\"1\", \"2\"), [[0, 0]], \"Cannot mirror strings\");\n assertApproxEqual(mirror2D([1]), [[-1, 1]], \"Incomplete vectors should be adjusted\");\n assertEmptyArray(mirror2D(true, true), \"Cannot mirror booleans\");\n }\n testUnit(\"points\", 6) {\n assertApproxEqual(mirror2D([[5, 9]]), [[-5, 9]], \"Should mirror the points around the Y axis (default)\");\n assertApproxEqual(mirror2D([[5, 9]], [1, 0]), [[5, -9]], \"Should mirror the points around the X axis\");\n assertApproxEqual(mirror2D([[3, 4]], [1, 1]), [[4, 3]], \"Should mirror the points around the diagonal XY axis\");\n\n assertApproxEqual(mirror2D([[1, 3], [5, 9]]), [[-1, 3], [-5, 9]], \"Should mirror the points around the Y axis (default)\");\n assertApproxEqual(mirror2D([[1, 3], [5, 9]], [1, 0]), [[1, -3], [5, -9]], \"Should mirror the points around the X axis\");\n assertApproxEqual(mirror2D([[1, 3], [5, 9]], [1, 1]), [[3, 1], [9, 5]], \"Should mirror the points around the XY axis\");\n }\n }\n \/\/ test core\/vector-2d\/scaleFactor2D()\n testModule(\"scaleFactor2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(scaleFactor2D(), [1, 1], \"If no list nor size are provided, should return a neutral scale factor\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(scaleFactor2D(\"1\", \"2\"), [1, 1], \"Cannot resize strings, should return a neutral scale factor\");\n assertEqual(scaleFactor2D([1], [2]), [2, 1], \"Incomplete vectors should be adjusted, should return a neutral scale factor\");\n assertEqual(scaleFactor2D(true, true), [1, 1], \"Cannot resize booleans, should return a neutral scale factor\");\n }\n testUnit(\"vectors\", 9) {\n assertEqual(scaleFactor2D([[1], [5]]), [1, 1], \"Should return a default scale factor if no size is provided, incomplete vectors should be completed\");\n assertEqual(scaleFactor2D([[1, 2, 3], [5, 9, 2]]), [1, 1], \"Should return a default scale factor if no size is provided, 2D vectors should be supported\");\n assertEqual(scaleFactor2D([[1, 2, 3, 4], [5, 9, 2, -3]]), [1, 1], \"Should return a default scale factor if no size is provided, too big vectors should be truncated\");\n\n assertEqual(scaleFactor2D([[1], [5]], 2), [2\/4, 2], \"When the size is a single number it should be applied to all elements, incomplete vectors should be completed\");\n assertEqual(scaleFactor2D([[1, 2, 3], [5, 9, 2]], 2), [2\/4, 2\/7], \"When the size is a single number it should be applied to all elements, 2D vectors should be supported\");\n assertEqual(scaleFactor2D([[1, 2, 3, 4], [5, 9, 2, 7]], 2), [2\/4, 2\/7], \"When the size is a single number it should be applied to all elements, too big vectors should be truncated\");\n\n assertEqual(scaleFactor2D([[1], [5]], [2]), [2\/4, 1], \"When the size is a vector its elements are applied respectively to each elements of the listed points, incomplete vectors should be completed\");\n assertEqual(scaleFactor2D([[1, 2], [5, 9]], [2, 3]), [2\/4, 3\/7], \"When the size is a vector its elements are applied respectively to each elements of the listed points, 2D vectors should be supported\");\n assertEqual(scaleFactor2D([[1, 2, 3, 4], [5, 9, 2, 7]], [2, 3, 4]), [2\/4, 3\/7], \"When the size is a vector its elements are applied respectively to each elements of the listed points, too big vectors should be truncated\");\n }\n }\n \/\/ test core\/vector-2d\/dimensions2D()\n testModule(\"dimensions2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(dimensions2D(), [0, 0], \"Cannot get dimensions if the list is missing\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(dimensions2D(\"2\"), [0, 0], \"Cannot get dimensions from string\");\n assertEqual(dimensions2D(2), [0, 0], \"Cannot get dimensions from single number\");\n assertEqual(dimensions2D(true), [0, 0], \"Cannot get dimensions from boolean\");\n }\n testUnit(\"vectors\", 9) {\n assertEqual(dimensions2D([[1]]), [0, 0], \"A single point has no dimensions, incomplete vectors should be completed\");\n assertEqual(dimensions2D([[1, 2]]), [0, 0], \"A single point has no dimensions, 2D vectors should be supported\");\n assertEqual(dimensions2D([[1, 2, 3, 4]]), [0, 0], \"A single point has no dimensions, too big vectors should be truncated\");\n\n assertEqual(dimensions2D([[1], [5]]), [4, 0], \"Should return a the dimensions if at least 2 points are provided, incomplete vectors should be completed\");\n assertEqual(dimensions2D([[1, 2, 3], [5, 9, -2]]), [4, 7], \"Should return a the dimensions if at least 2 points are provided, 2D vectors should be supported\");\n assertEqual(dimensions2D([[1, 2, 3], [5, 9, -2]]), [4, 7], \"Should return a the dimensions if at least 2 points are provided, too big vectors should be truncated\");\n\n assertEqual(dimensions2D([[1], [5], [3], [-2]]), [7, 0], \"Should return a the dimensions with respect to all points, incomplete vectors should be completed\");\n assertEqual(dimensions2D([[1, 2, 3], [5, 9], [3, 2], [-2, -6]]), [7, 15], \"Should return a the dimensions with respect to all points, 2D vectors should be supported\");\n assertEqual(dimensions2D([[1, 2, 3, 4], [5, 9, -2, -5], [3, 2, 7, 8], [-2, -6, 0, 3]]), [7, 15], \"Should return a the dimensions with respect to all points, too big vectors should be truncated\");\n }\n }\n \/\/ test core\/vector-2d\/boundaries2D()\n testModule(\"boundaries2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(boundaries2D(), [[0, 0], [0, 0]], \"Cannot get boundaries if the list is missing\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(boundaries2D(\"2\"), [[0, 0], [0, 0]], \"Cannot get boundaries from string\");\n assertEqual(boundaries2D(2), [[0, 0], [0, 0]], \"Cannot get boundaries from single number\");\n assertEqual(boundaries2D(true), [[0, 0], [0, 0]], \"Cannot get boundaries from boolean\");\n }\n testUnit(\"vectors\", 9) {\n assertEqual(boundaries2D([[1]]), [[1, 0], [1, 0]], \"A single point is its own boundaries, incomplete vectors should be completed\");\n assertEqual(boundaries2D([[1, 2]]), [[1, 2], [1, 2]], \"A single point is its own boundaries, 2D vectors should be supported\");\n assertEqual(boundaries2D([[1, 2, 3, 4]]), [[1, 2], [1, 2]], \"A single point is its own boundaries, too big vectors should be truncated\");\n\n assertEqual(boundaries2D([[1], [5]]), [[1, 0], [5, 0]], \"Boundaries of 2 points, incomplete vectors should be completed\");\n assertEqual(boundaries2D([[1, 2], [5, 9]]), [[1, 2], [5, 9]], \"Boundaries of 2 points, 2D vectors should be supported\");\n assertEqual(boundaries2D([[1, 2, 3, 4], [5, 9, -2, 8]]), [[1, 2], [5, 9]], \"Boundaries of 2 points, too big vectors should be truncated\");\n\n assertEqual(boundaries2D([[1], [5], [3], [-2]]), [[-2, 0], [5, 0]], \"Boundaries of several points, incomplete vectors should be completed\");\n assertEqual(boundaries2D([[1, 2], [5, 9], [3, 2], [-2, -6]]), [[-2, -6], [5, 9]], \"Boundaries of several points, 2D vectors should be supported\");\n assertEqual(boundaries2D([[1, 2, 3, 4], [5, 9, -2, 8], [3, 2, 7, 5], [-2, -6, 0, 1]]), [[-2, -6], [5, 9]], \"Boundaries of several points, too big vectors should be truncated\");\n }\n }\n }\n function _rot2(v, a) = [\n v[0] * cos(a) - v[1] * sin(a),\n v[1] * cos(a) + v[0] * sin(a)\n ];\n}\n\ntestCoreVector2D();\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\nuse <..\/..\/full.scad>\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit tests: 2D vectors handling.\n *\n * @package test\/core\/vector\n * @author jsconan\n *\/\nmodule testCoreVector2D() {\n testPackage(\"core\/vector-2d.scad\", 24) {\n \/\/ test core\/vector-2d\/vector2D()\n testModule(\"vector2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(vector2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(vector2D(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(vector2D(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(vector2D(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(vector2D([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(vector2D([\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(vector2D([1]), [1, 0], \"Should complete incomplete 2D vector\");\n assertEqual(vector2D([1, 2]), [1, 2], \"Should keep correct and complete 2D vector\");\n assertEqual(vector2D([1, 2, 3]), [1, 2], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/divisor2D()\n testModule(\"divisor2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(divisor2D(), [1, 1], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 6) {\n assertEqual(divisor2D(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(divisor2D(true), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D(false), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D(\"2\"), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D([\"3\"]), [1, 1], \"Should produce a 2D vector filled with 1 if input is wrong\");\n assertEqual(divisor2D([\"4\", 3]), [1, 3], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 4) {\n assertEqual(divisor2D([2]), [2, 1], \"Should complete incomplete 2D vector\");\n assertEqual(divisor2D([0, 0]), [1, 1], \"Should correct 0 2D vector\");\n assertEqual(divisor2D([1, 2]), [1, 2], \"Should keep correct and complete 2D vector\");\n assertEqual(divisor2D([1, 2, 3]), [1, 2], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/apply2D()\n testModule(\"apply2D()\", 4) {\n testUnit(\"no parameter\", 1) {\n assertEqual(apply2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 15) {\n assertEqual(apply2D(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(apply2D(1, 2), [2, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(apply2D(1, 2, 3), [2, 3], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(apply2D(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(true, 1), [1, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(true, 1, 2), [1, 2], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(\"1\", 1), [1, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D(\"1\", 1, 2), [1, 2], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\"], 1), [1, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\"], 1, 2), [1, 2], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(apply2D([\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong\");\n assertEqual(apply2D([\"1\", 1], 1), [1, 1], \"Should produce a corrected 2D vector if input is wrong\");\n assertEqual(apply2D([\"1\", 1], 1, 2), [1, 2], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 10) {\n assertEqual(apply2D([1]), [1, 0], \"Should complete incomplete 2D vector\");\n assertEqual(apply2D([1], y=2), [1, 2], \"Should complete incomplete 2D vector\");\n assertEqual(apply2D([1], 2, 3), [2, 3], \"Should complete incomplete 2D vector\");\n assertEqual(apply2D([1, 2]), [1, 2], \"Should keep correct and complete 2D vector\");\n assertEqual(apply2D([1, 2], 3, 4), [3, 4], \"Should keep correct and complete 2D vector\");\n assertEqual(apply2D([1, 2, 3]), [1, 2], \"Should truncate too big vector\");\n assertEqual(apply2D([1, 2, 3], 5, 6), [5, 6], \"Should truncate too big vector\");\n assertEqual(apply2D(x=5), [5, 0], \"Should create the vector from the provided X coordinate\");\n assertEqual(apply2D(y=6), [0, 6], \"Should create the vector from the provided Y coordinate)\");\n assertEqual(apply2D(x=5, y=6), [5, 6], \"Should create the vector from the provided coordinates\");\n }\n testUnit(\"circle\", 6) {\n assertEqual(apply2D([1, 2], r=3), [6, 6], \"Should apply the radius as coordinates of the 2D vector\");\n assertEqual(apply2D([1, 2], d=3), [3, 3], \"Should apply the diameter as coordinates of the 2D vector\");\n assertEqual(apply2D([1, 2], x=4, r=3), [4, 6], \"Should apply the radius as coordinates of the 2D vector, but the X\");\n assertEqual(apply2D([1, 2], y=5, d=3), [3, 5], \"Should apply the diameter as coordinates of the 2D vector, but the Y\");\n assertEqual(apply2D(r=5), [10, 10], \"Should create the vector from the provided radius\");\n assertEqual(apply2D(d=6), [6, 6], \"Should create the vector from the provided diameter\");\n }\n }\n \/\/ test core\/vector-2d\/norm2D()\n testModule(\"norm2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(norm2D(), 0, \"Cannot compute the length if no vector is provided, should return 0\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(norm2D(3), sqrt(18), \"Should translate a number into a 2D vector, then compute the length\");\n assertEqual(norm2D(true), 0, \"Cannot compute the length if no vector is provided (boolean given), should return 0\");\n assertEqual(norm2D(\"1\"), 0, \"Cannot compute the length if no vector is provided (string given), should return 0\");\n assertEqual(norm2D([\"1\"]), 0, \"Cannot compute the length if no vector is provided (array of strings given), should return 0\");\n assertEqual(norm2D([\"1\", 1]), 1, \"Cannot compute the length if no vector is provided (array given), should return 0\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(norm2D([1]), 1, \"Should complete incomplete 2D vector\");\n assertEqual(norm2D([1, 2]), sqrt(5), \"Should return an orthogonal 2D vector\");\n assertEqual(norm2D([1, 2, 3]), sqrt(5), \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/unit2D()\n testModule(\"unit2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(unit2D(), [0, 0], \"Should always produce a normalized 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 6) {\n assertEqual(unit2D(1), [1, 1] \/ norm2D([1, 1]), \"Should produce a normalized 2D vector with the input number as a coordinate\");\n assertEqual(unit2D(true), [0, 0], \"Should produce a normalized 2D vector filled with 0 if input is wrong\");\n assertEqual(unit2D(\"1\"), [0, 0], \"Should produce a normalized 2D vector filled with 0 if input is wrong\");\n assertEqual(unit2D([\"1\"]), [0, 0], \"Should produce a normalized 2D vector filled with 0 if input is wrong\");\n assertEqual(unit2D([\"1\", 1]), [0, 1] \/ norm2D([0, 1]), \"Should produce a normalized corrected 2D vector if input is wrong\");\n assertEqual(unit2D([\"1\", 1, 1]), [0, 1] \/ norm2D([0, 1]), \"Should produce a normalized corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(unit2D([1]), [1, 0] \/ norm2D([1, 0]), \"Should complete incomplete 2D vector and returns a normalized 2D vector\");\n assertEqual(unit2D([1, 2]), [1, 2] \/ norm2D([1, 2]), \"Should return a normalized 2D vector\");\n assertEqual(unit2D([1, 2, 3]), [1, 2] \/ norm2D([1, 2]), \"Should truncate too big vector and returns a normalized 2D vector\");\n }\n }\n \/\/ test core\/vector-2d\/normal()\n testModule(\"normal()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(normal(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(normal(1), [1, -1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(normal(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(normal(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(normal([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(normal([\"1\", 1]), [1, 0], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(normal([1]), [0, -1], \"Should complete incomplete 2D vector\");\n assertEqual(normal([1, 2]), [2, -1], \"Should return an orthogonal 2D vector\");\n assertEqual(normal([1, 2, 3]), [2, -1], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/flip()\n testModule(\"flip()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(flip(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 5) {\n assertEqual(flip(1), [1, 1], \"Should produce a 2D vector with the input number as a coordinate\");\n assertEqual(flip(true), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(flip(\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(flip([\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if input is wrong\");\n assertEqual(flip([\"1\", 1]), [1, 0], \"Should produce a corrected 2D vector if input is wrong\");\n }\n testUnit(\"vector\", 3) {\n assertEqual(flip([1]), [0, 1], \"Should complete incomplete 2D vector\");\n assertEqual(flip([1, 2]), [2, 1], \"Should return an orthogonal 2D vector\");\n assertEqual(flip([1, 2, 3]), [2, 1], \"Should truncate too big vector\");\n }\n }\n \/\/ test core\/vector-2d\/middle2D()\n testModule(\"middle2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(middle2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 12) {\n assertEqual(middle2D(a=1), [0.5, 0.5], \"If the second point is missing, assume its the origin\");\n assertEqual(middle2D(b=1), [0.5, 0.5], \"If the first point is missing, assume its the origin\");\n assertEqual(middle2D(a=[1], b=1), [1, 0.5], \"Should complete the first point if incomplete, should translate the second point to vector if number given\");\n assertEqual(middle2D(a=1, b=[1]), [1, 0.5], \"Should translate the first point to vector if number given, should complete the second point if incomplete\");\n assertEqual(middle2D(a=true), [0, 0], \"Should produce a 2D vector filled with 0 if first point is boolean\");\n assertEqual(middle2D(b=true), [0, 0], \"Should produce a 2D vector filled with 0 if second point is boolean\");\n assertEqual(middle2D(a=\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if first point is string\");\n assertEqual(middle2D(b=\"1\"), [0, 0], \"Should produce a 2D vector filled with 0 if second point is string\");\n assertEqual(middle2D(a=[\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if first point is array of strings\");\n assertEqual(middle2D(b=[\"1\"]), [0, 0], \"Should produce a 2D vector filled with 0 if second point is array of strings\");\n assertEqual(middle2D(a=[\"1\", 1]), [0, .5], \"Should produce a corrected 2D vector if first point is wrong\");\n assertEqual(middle2D(b=[\"1\", 1]), [0, .5], \"Should produce a corrected 2D vector if second point is wrong\");\n }\n testUnit(\"vector\", 6) {\n assertEqual(middle2D([1]), [.5, 0], \"Should complete incomplete 2D vector, assume missing point to origin\");\n assertEqual(middle2D([1], [2]), [1.5, 0], \"Should complete incomplete 2D vector\");\n assertEqual(middle2D([1, 2]), [0.5, 1], \"Should returns a 2D vector, assume missing point to origin\");\n assertEqual(middle2D([1, 2], [2, 3]), [1.5, 2.5], \"Should returns a 2D vector\");\n assertEqual(middle2D([1, 2, 3]), [0.5, 1], \"Should truncate too big vector, assume missing point to origin\");\n assertEqual(middle2D([1, 2, 3], [4, 5, 6]), [2.5, 3.5], \"Should truncate too big vectors\");\n }\n }\n \/\/ test core\/vector-2d\/move2D()\n testModule(\"move2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(move2D(), [0, 0], \"Should always produce a 2D vector, even if input is wrong\");\n }\n testUnit(\"not vector\", 15) {\n assertEqual(move2D(1), [1, 1], \"Should translate number to 2D vector (no direction vector)\");\n assertEqual(move2D(1, 1), [1, 1], \"Should translate number to 2D vector (direction vector but not distance)\");\n assertEqual(move2D(1, 1, 1), [1, 1] + [1, 1] \/ norm2D([1, 1]), \"Should translate number to 2D vector (direction vector and distance)\");\n\n assertEqual(move2D(true), [0, 0], \"Should produce a default 2D vector if input is boolean (no direction vector)\");\n assertEqual(move2D(true, true), [0, 0], \"Should produce a default 2D vector if input is boolean (direction vector but not distance)\");\n assertEqual(move2D(true, true, true), [0, 0], \"Should produce a default 2D vector if input is boolean (direction vector and distance)\");\n\n assertEqual(move2D(\"1\"), [0, 0], \"Should produce a default 2D vector if input is string (no direction vector)\");\n assertEqual(move2D(\"1\", \"1\"), [0, 0], \"Should produce a default 2D vector if input is string (direction vector but not distance)\");\n assertEqual(move2D(\"1\", \"1\", \"1\"), [0, 0], \"Should produce a default 2D vector if input is string (direction vector and distance)\");\n\n assertEqual(move2D([\"1\"]), [0, 0], \"Should produce a default 2D vector if input is array (no direction vector)\");\n assertEqual(move2D([\"1\"], [\"1\"]), [0, 0], \"Should produce a default 2D vector if input is array (direction vector but not distance)\");\n assertEqual(move2D([\"1\"], [\"1\"], [\"1\"]), [0, 0], \"Should produce a default 2D vector if input is array (direction vector and distance)\");\n\n assertEqual(move2D([\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong (no direction vector)\");\n assertEqual(move2D([\"1\", 1], [\"1\", 1]), [0, 1], \"Should produce a corrected 2D vector if input is wrong (direction vector but not distance)\");\n assertEqual(move2D([\"1\", 1], [\"1\", 1], 1), [0, 2], \"Should produce a corrected 2D vector if input is wrong (direction vector and distance)\");\n }\n testUnit(\"vector\", 9) {\n assertEqual(move2D([1]), [1, 0], \"Should complete incomplete 2D vector (no direction vector)\");\n assertEqual(move2D([1], [1]), [1, 0], \"Should complete incomplete 2D vector (direction vector but not distance)\");\n assertEqual(move2D([1], [1], 1), [2, 0], \"Should complete incomplete 2D vector (direction vector and distance)\");\n assertEqual(move2D([1, 2]), [1, 2], \"Should return the provided 2D vector (no direction vector)\");\n assertEqual(move2D([1, 2], [1, 2]), [1, 2], \"Should return the provided 2D vector (direction vector but not distance)\");\n assertEqual(move2D([1, 2], [1, 2], 1), [1, 2] + [1, 2] \/ norm2D([1, 2]), \"Should return a 2D vector (direction vector and distance)\");\n assertEqual(move2D([1, 2, 3]), [1, 2], \"Should truncate too big vector and returns a 2D vector (no direction vector)\");\n assertEqual(move2D([1, 2, 3], [1, 2, 3]), [1, 2], \"Should truncate too big vector and returns a 2D vector (direction vector but not distance)\");\n assertEqual(move2D([1, 2, 3], [1, 2, 3], 1), [1, 2] + [1, 2] \/ norm2D([1, 2]), \"Should truncate too big vector and returns a 2D vector (direction vector and distance)\");\n }\n }\n \/\/ test core\/vector-2d\/center2D()\n testModule(\"center2D()\", 4) {\n testUnit(\"no parameter\", 1) {\n assertEqual(center2D(), [0, 0], \"Without parameter the function should return the origin\");\n }\n testUnit(\"wrong type\", 5) {\n assertEqual(center2D(\"10\", \"10\", \"10\"), [0, 0], \"Cannot compute center of strings, should return the origin\");\n assertEqual(center2D(true, true, true), [0, 0], \"Cannot compute center of boolean, should return the origin\");\n assertEqual(center2D([], [], []), [0, 0], \"Cannot compute center of empty arrays, should return the origin\");\n assertEqual(center2D([\"1\"], [\"2\"], [\"3\"]), [0, 0], \"Cannot compute center of arrays, should return the origin\");\n assertEqual(center2D([1, 1], [2, 2], [2]), [2, 1], \"Cannot compute center with a vector radius, should return the point at the middle\");\n }\n testUnit(\"positive\", 5) {\n assertEqual(center2D(1, 2, 1), [2, 1], \"Numbers should be converted to vectors\");\n assertEqual(center2D([10, 20], [8, 16], 10), [9, 18] + ([-4, 2] \/ norm([-4, 2])) * sqrt(100 - pow(norm([-2, -4]) \/ 2, 2)), \"Should compute the center of the circle\");\n assertEqual(center2D([10], [8], 10), [9, 0] + ([0, 2] \/ norm([0, 2])) * sqrt(100 - pow(norm([2, 0]) \/ 2, 2)), \"Should accept vector smaller than 2D, then upscale them and compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20, 30], [8, 16, 32], 10), [9, 18] + ([-4, 2] \/ norm([-4, 2])) * sqrt(100 - pow(norm([-2, -4]) \/ 2, 2)), \"Should accept vector bigger than 2D, but should only compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20], [8, 16], 1), [9, 18], \"Cannot compute the center if the radius is smaller than the distance between the points, should return the point at the middle\");\n }\n testUnit(\"negative\", 5) {\n assertEqual(center2D(1, 2, 1, true), [1, 2], \"Numbers should be converted to vectors\");\n assertEqual(center2D([10, 20], [8, 16], 10, true), [9, 18] + ([4, -2] \/ norm([4, -2])) * sqrt(100 - pow(norm([2, 4]) \/ 2, 2)), \"Should compute the center of the circle\");\n assertEqual(center2D([10], [8], 10, true), [9, 0] + ([0, -2] \/ norm([0, -2])) * sqrt(100 - pow(norm([-2, 0]) \/ 2, 2)), \"Should accept vector smaller than 2D, then upscale them and compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20, 30], [8, 16, 32], 10, true), [9, 18] + ([4, -2] \/ norm([4, -2])) * sqrt(100 - pow(norm([2, 4]) \/ 2, 2)), \"Should accept vector bigger than 2D, but should only compute the center of the circle using 2D\");\n assertEqual(center2D([10, 20], [8, 16], 1, true), [9, 18], \"Cannot compute the center if the radius is smaller than the distance between the points, should return the point at the middle\");\n }\n }\n \/\/ test core\/vector-2d\/angle2D()\n testModule(\"angle2D()\", 2) {\n testUnit(\"default value\", 3) {\n assertEqual(angle2D(), 0, \"Should return 0 if no vector was provided\");\n assertEqual(angle2D(\"1\", \"2\"), 0, \"Cannot compute angle of strings\");\n assertEqual(angle2D(true, true), 0, \"Cannot compute angle of booleans\");\n }\n testUnit(\"compute angle\", 5) {\n assertEqual(round(angle2D(1, 2)), 0, \"When single numbers are provided, they should be translated to vector. Vectors with same direction does not have angle.\");\n assertEqual(angle2D([1, 0], [0, 1]), 90, \"Orthogonal vectors have an angle of 90\u00b0\");\n assertEqual(angle2D([1, 0], [0, -1]), 90, \"Orthogonal vectors have an angle of 90\u00b0, whatever their direction\");\n assertEqual(angle2D([1, 0], [-1, 0]), 180, \"Vectors with opposite direction have an angle of 180\u00b0\");\n assertEqual(round(angle2D([1, 2], rotp([1, 2], 75))), 75, \"Should have an angle of 75\u00b0\");\n }\n }\n \/\/ test core\/vector-2d\/sinp()\n testModule(\"sinp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(sinp(), [0, 0], \"Should return [0, 0]\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(sinp(\"1\", \"2\", \"3\", \"4\", \"5\"), [0, 0], \"Cannot use strings to build the point, should return [0, 0]\");\n assertEqual(sinp([1], [2], [3], [4], [5]), [0, 0], \"Cannot use vectors to build the point, should return [0, 0]\");\n assertEqual(sinp(true, true, true, true, true), [0, 0], \"Cannot use booleans to build the point, should return [0, 0]\");\n }\n testUnit(\"number\", 5) {\n assertEqual(sinp(1), [1, 0], \"Should return [1, 0]\");\n assertEqual(sinp(0.1, 2), [0.1, sin(18)], \"Should return [0.1, sin(18)]\");\n assertEqual(sinp(0.2, 2, 6), [0.2, 6 * sin(36)], \"Should return [0.2, 6 * sin(36)]\");\n assertEqual(sinp(0.5, 2, 6, 10), [0.5, 6 * sin(100)], \"Should return [0.5, 6 * sin(100)]\");\n assertEqual(sinp(0.8, 2, 6, 10, 15), [0.8, 15 + 6 * sin(154)], \"Should return [0.8, 15 + 6 * sin(100)]\");\n }\n }\n \/\/ test core\/vector-2d\/cosp()\n testModule(\"cosp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(cosp(), [1, 0], \"Should return [1, 0]\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(cosp(\"1\", \"2\", \"3\", \"4\", \"5\"), [1, 0], \"Cannot use strings to build the point, should return [1, 0]\");\n assertEqual(cosp([1], [2], [3], [4], [5]), [1, 0], \"Cannot use vectors to build the point, should return [1, 0]\");\n assertEqual(cosp(true, true, true, true, true), [1, 0], \"Cannot use booleans to build the point, should return [1, 0]\");\n }\n testUnit(\"number\", 5) {\n assertEqual(cosp(1), [1, 1], \"Should return [1, 1]\");\n assertEqual(cosp(0.1, 2), [cos(18), 0.1], \"Should return [cos(18), 0.1]\");\n assertEqual(cosp(0.2, 2, 6), [6 * cos(36), 0.2], \"Should return [6 * cos(36), 0.2]\");\n assertEqual(cosp(0.5, 2, 6, 10), [6 * cos(100), 0.5], \"Should return [6 * cos(100), 0.5]\");\n assertEqual(cosp(0.8, 2, 6, 10, 15), [15 + 6 * cos(154), 0.8], \"Should return [15 + 6 * cos(100), 0.8]\");\n }\n }\n \/\/ test core\/vector-2d\/rotp()\n testModule(\"rotp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(rotp(), [undef, undef], \"Cannot compute rotation if no parameter is provided\");\n }\n testUnit(\"wrong types\", 5) {\n assertEqual(rotp(\"1\", \"2\"), [undef, undef], \"Cannot compute rotation from strings\");\n assertEqual(rotp(1, 2), [undef, undef], \"Cannot compute rotation from number\");\n assertEqual(rotp([1], [2]), [undef, undef], \"Cannot compute rotation from arrays\");\n assertEqual(rotp([1], 90), [undef, undef], \"Cannot compute rotation from incomplete vector\");\n assertEqual(rotp(true, true), [undef, undef], \"Cannot compute rotation from booleans\");\n }\n testUnit(\"vector and angle\", 4) {\n assertEqual(rotp([23, 67], 0), [23, 67], \"Should return [23, 67]\");\n assertEqual(rotp([23, 67], 290), _rot2([23, 67], 290), \"Should return [23, 67] rotated by 290\u00b0\");\n assertEqual(rotp([23, 67], -76), _rot2([23, 67], -76), \"Should return [23, 67] rotated by -76\u00b0\");\n assertEqual(rotp([23, 67], 464), _rot2([23, 67], 104), \"Should return [23, 67] rotated by 104\u00b0\");\n }\n }\n \/\/ test core\/vector-2d\/mirp()\n testModule(\"mirp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(mirp(), [undef, undef], \"Cannot compute mirror if no parameter is provided\");\n }\n testUnit(\"wrong types\", 5) {\n assertEqual(mirp(\"1\", \"2\"), [undef, undef], \"Cannot compute mirror from strings\");\n assertEqual(mirp(1, 2), [undef, undef], \"Cannot compute mirror from number\");\n assertEqual(mirp([1], [2]), [undef, undef], \"Cannot compute mirror from arrays\");\n assertEqual(mirp([1], 90), [undef, undef], \"Cannot compute mirror from incomplete vector\");\n assertEqual(mirp(true, true), [undef, undef], \"Cannot compute mirror from booleans\");\n }\n testUnit(\"vector and axis\", 3) {\n assertApproxEqual(mirp([23, 67], [1, 0]), [23, -67], \"Should return [23, 67] mirrored around X\");\n assertApproxEqual(mirp([23, 67], [0, 1]), [-23, 67], \"Should return [23, 67] mirrored around Y\");\n assertApproxEqual(mirp([23, 67], [1, 1]), [67, 23], \"Should return [23, 67] mirrored around XY\");\n }\n }\n \/\/ test core\/vector-2d\/arcp()\n testModule(\"arcp()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(arcp(), [undef, undef], \"Cannot compute the point if no parameter is provided\");\n }\n testUnit(\"wrong types\", 4) {\n assertEqual(arcp(\"1\", \"2\"), [undef, undef], \"Cannot compute the point from strings\");\n assertEqual(arcp(1, 1), [undef, undef], \"Cannot compute the point from numbers\");\n assertEqual(arcp(true, true), [undef, undef], \"Cannot compute the point from booleans\");\n assertEqual(arcp([\"1\", \"2\"]), [undef, undef], \"Cannot compute the point from arrays\");\n }\n testUnit(\"vector\", 6) {\n assertEqual(arcp([]), [undef, undef], \"Cannot compute the point from empty vector\");\n assertEqual(arcp([], 30), [undef, undef], \"Cannot compute the point from empty vector, event if angle is provided\");\n assertEqual(arcp([10, 10]), [undef, undef], \"Cannot compute the point without angle\");\n assertEqual(arcp([10, 10], 45), [cos(45)*10, sin(45)*10], \"Angle of 45 degrees\");\n assertEqual(arcp([20, 10], 30), [cos(30)*20, sin(30)*10], \"Angle of 30 degrees\");\n assertEqual(arcp([10, 20], 60), [cos(60)*10, sin(60)*20], \"Angle of 60 degrees\");\n }\n }\n \/\/ test core\/vector-2d\/arcPoint()\n testModule(\"arcPoint()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(arcPoint(), [0, 0], \"Should return [0, 0]\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(arcPoint(\"1\", \"2\"), [0, 0], \"Strings are not valids, the function should return [0, 0]\");\n assertEqual(arcPoint(true, true), [0, 0], \"Booleans are not valids, the function should return [0, 0]\");\n assertEqual(arcPoint([\"1\", \"2\"], [\"1\"]), [0, 0], \"Arrays are not valids, the function should return [0, 0]\");\n }\n testUnit(\"vector\", 12) {\n assertEqual(arcPoint([]), [0, 0], \"An empty vector should produce [0, 0]\");\n assertEqual(arcPoint([], 30), [0, 0], \"An empty vector should produce [0, 0], whatever the angle is\");\n assertEqual(arcPoint(10), [10, 0], \"A single number should be converted to vector\");\n assertEqual(arcPoint([10, 10]), [10, 0], \"Without angle, the vector should be arcPoint on the X axis\");\n assertEqual(arcPoint([10, 10], 45), [cos(45)*10, sin(45)*10], \"Angle of 45 degrees\");\n assertEqual(arcPoint([20, 10], 30), [cos(30)*20, sin(30)*10], \"Angle of 30 degrees\");\n assertEqual(arcPoint([10, 20], 60), [cos(60)*10, sin(60)*20], \"Angle of 60 degrees\");\n assertEqual(arcPoint([10, 20], 60, 30, 50), [cos(60)*30, sin(60)*50], \"The X and Y parameters should replace the vector's coordinates\");\n assertEqual(arcPoint(a=60, x=30, y=50), [cos(60)*30, sin(60)*50], \"Should accept the radius as separated coordinates\");\n assertEqual(arcPoint([10, 20], 360), [cos(0)*10, sin(0)*20], \"Angle of 360 degrees should be equal to 0 degrees\");\n assertEqual(arcPoint([10, 20], 420), [cos(60)*10, sin(60)*20], \"Angle of 420 degrees should be equal to 60 degrees\");\n assertEqual(arcPoint([10, 20], -20), [cos(340)*10, sin(340)*20], \"Angle of -20 degrees should be equal to 340 degrees\");\n }\n }\n \/\/ test core\/vector-2d\/rotate2D()\n testModule(\"rotate2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(rotate2D(), \"Cannot rotate an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(rotate2D(\"1\", \"2\"), [[0, 0]], \"Cannot rotate a string\");\n assertEmptyArray(rotate2D(1, 1), [], \"Cannot rotate a number\");\n assertEmptyArray(rotate2D(true, true), [], \"Cannot rotate a boolean\");\n }\n testUnit(\"points\", 6) {\n assertEqual(rotate2D([23, 67]), [[23, 23], [67, 67]], \"Should upscale the numbers to vector 2D\");\n assertEqual(rotate2D([23, 67], 290), [_rot2([23, 23], 290), _rot2([67, 67], 290)], \"Should upscale the numbers to vector 2D and rotate them by 290\u00b0\");\n\n assertEqual(rotate2D([[23, 67], [12, 9]]), [[23, 67], [12, 9]], \"Should return [[23, 67], [12, 9]]\");\n assertEqual(rotate2D([[23, 67], [12, 9]], 290), [_rot2([23, 67], 290), _rot2([12, 9], 290)], \"Should return [[23, 67], [12, 9]] rotated by 290\u00b0\");\n assertEqual(rotate2D([[23, 67], [12, 9]], -76), [_rot2([23, 67], -76), _rot2([12, 9], -76)], \"Should return [[23, 67], [12, 9]] rotated by -76\u00b0\");\n assertEqual(rotate2D([[23, 67], [12, 9]], 464), [_rot2([23, 67], 104), _rot2([12, 9], 104)], \"Should return [[23, 67], [12, 9]] rotated by 104\u00b0\");\n }\n }\n \/\/ test core\/vector-2d\/scale2D()\n testModule(\"scale2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(scale2D(), \"Should return an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(scale2D(\"1\", \"2\"), [[0, 0]], \"Cannot scale strings\");\n assertEqual(scale2D([1], [2]), [[0, 0]], \"Incomplete vectors should be adjusted\");\n assertEqual(scale2D(true, true), [], \"Cannot scale booleans\");\n }\n testUnit(\"points\", 4) {\n assertEqual(scale2D([[1, 1], [2, 2]]), [[1, 1], [2, 2]], \"A default scale factor should be utilized if none is provided\");\n assertEqual(scale2D([[1, 2], [5, 9]], 2), [[2, 4], [10, 18]], \"When the scale factor is a single number it should be applied to all elements\");\n assertEqual(scale2D([[3, 1.5], [2.3, 7]], [0.6, 1.5]), [[3*0.6, 1.5*1.5], [2.3*0.6, 7*1.5]], \"When the scale factor is a vector its elements are applied respectively to each elements of the listed points\");\n assertEqual(scale2D([[1], [8]], 3), [[3, 0], [24, 0]], \"Incomplete vectors should be adjusted\");\n }\n }\n \/\/ test core\/vector-2d\/resize2D()\n testModule(\"resize2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(resize2D(), \"Should return an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(resize2D(\"1\", \"2\"), [[0, 0]], \"Cannot resize strings\");\n assertEqual(resize2D([1], [2]), [[0, 0]], \"Incomplete vectors should be adjusted\");\n assertEqual(resize2D(true, true), [], \"Cannot resize booleans\");\n }\n testUnit(\"points\", 4) {\n assertEqual(resize2D([[1, 3], [5, 9]]), [[1, 3], [5, 9]], \"No change will be made if no size is provided\");\n assertEqual(resize2D([[1, 3], [5, 9]], 2), [[1*2\/4, 3*2\/6], [5*2\/4, 9*2\/6]], \"When the size is a single number it should be applied to all elements\");\n assertEqual(resize2D([[1, 3], [5, 9]], [2, 3]), [[1*2\/4, 3*3\/6], [5*2\/4, 9*3\/6]], \"When the size is a vector its elements are applied respectively to each elements of the listed points\");\n assertEqual(resize2D([[1], [8]], 3), [[1*3\/7, 0], [8*3\/7, 0]], \"Incomplete vectors should be adjusted\");\n }\n }\n \/\/ test core\/vector-2d\/mirror2D()\n testModule(\"mirror2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEmptyArray(mirror2D(), \"Should return an empty list of points\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(mirror2D(\"1\", \"2\"), [[0, 0]], \"Cannot mirror strings\");\n assertApproxEqual(mirror2D([1]), [[-1, 1]], \"Incomplete vectors should be adjusted\");\n assertEmptyArray(mirror2D(true, true), \"Cannot mirror booleans\");\n }\n testUnit(\"points\", 6) {\n assertApproxEqual(mirror2D([[5, 9]]), [[-5, 9]], \"Should mirror the points around the Y axis (default)\");\n assertApproxEqual(mirror2D([[5, 9]], [1, 0]), [[5, -9]], \"Should mirror the points around the X axis\");\n assertApproxEqual(mirror2D([[3, 4]], [1, 1]), [[4, 3]], \"Should mirror the points around the diagonal XY axis\");\n\n assertApproxEqual(mirror2D([[1, 3], [5, 9]]), [[-1, 3], [-5, 9]], \"Should mirror the points around the Y axis (default)\");\n assertApproxEqual(mirror2D([[1, 3], [5, 9]], [1, 0]), [[1, -3], [5, -9]], \"Should mirror the points around the X axis\");\n assertApproxEqual(mirror2D([[1, 3], [5, 9]], [1, 1]), [[3, 1], [9, 5]], \"Should mirror the points around the XY axis\");\n }\n }\n \/\/ test core\/vector-2d\/scaleFactor2D()\n testModule(\"scaleFactor2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(scaleFactor2D(), [1, 1], \"If no list nor size are provided, should return a neutral scale factor\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(scaleFactor2D(\"1\", \"2\"), [1, 1], \"Cannot resize strings, should return a neutral scale factor\");\n assertEqual(scaleFactor2D([1], [2]), [2, 1], \"Incomplete vectors should be adjusted, should return a neutral scale factor\");\n assertEqual(scaleFactor2D(true, true), [1, 1], \"Cannot resize booleans, should return a neutral scale factor\");\n }\n testUnit(\"vectors\", 9) {\n assertEqual(scaleFactor2D([[1], [5]]), [1, 1], \"Should return a default scale factor if no size is provided, incomplete vectors should be completed\");\n assertEqual(scaleFactor2D([[1, 2, 3], [5, 9, 2]]), [1, 1], \"Should return a default scale factor if no size is provided, 2D vectors should be supported\");\n assertEqual(scaleFactor2D([[1, 2, 3, 4], [5, 9, 2, -3]]), [1, 1], \"Should return a default scale factor if no size is provided, too big vectors should be truncated\");\n\n assertEqual(scaleFactor2D([[1], [5]], 2), [2\/4, 2], \"When the size is a single number it should be applied to all elements, incomplete vectors should be completed\");\n assertEqual(scaleFactor2D([[1, 2, 3], [5, 9, 2]], 2), [2\/4, 2\/7], \"When the size is a single number it should be applied to all elements, 2D vectors should be supported\");\n assertEqual(scaleFactor2D([[1, 2, 3, 4], [5, 9, 2, 7]], 2), [2\/4, 2\/7], \"When the size is a single number it should be applied to all elements, too big vectors should be truncated\");\n\n assertEqual(scaleFactor2D([[1], [5]], [2]), [2\/4, 1], \"When the size is a vector its elements are applied respectively to each elements of the listed points, incomplete vectors should be completed\");\n assertEqual(scaleFactor2D([[1, 2], [5, 9]], [2, 3]), [2\/4, 3\/7], \"When the size is a vector its elements are applied respectively to each elements of the listed points, 2D vectors should be supported\");\n assertEqual(scaleFactor2D([[1, 2, 3, 4], [5, 9, 2, 7]], [2, 3, 4]), [2\/4, 3\/7], \"When the size is a vector its elements are applied respectively to each elements of the listed points, too big vectors should be truncated\");\n }\n }\n \/\/ test core\/vector-2d\/dimensions2D()\n testModule(\"dimensions2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(dimensions2D(), [0, 0], \"Cannot get dimensions if the list is missing\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(dimensions2D(\"2\"), [0, 0], \"Cannot get dimensions from string\");\n assertEqual(dimensions2D(2), [0, 0], \"Cannot get dimensions from single number\");\n assertEqual(dimensions2D(true), [0, 0], \"Cannot get dimensions from boolean\");\n }\n testUnit(\"vectors\", 9) {\n assertEqual(dimensions2D([[1]]), [0, 0], \"A single point has no dimensions, incomplete vectors should be completed\");\n assertEqual(dimensions2D([[1, 2]]), [0, 0], \"A single point has no dimensions, 2D vectors should be supported\");\n assertEqual(dimensions2D([[1, 2, 3, 4]]), [0, 0], \"A single point has no dimensions, too big vectors should be truncated\");\n\n assertEqual(dimensions2D([[1], [5]]), [4, 0], \"Should return a the dimensions if at least 2 points are provided, incomplete vectors should be completed\");\n assertEqual(dimensions2D([[1, 2, 3], [5, 9, -2]]), [4, 7], \"Should return a the dimensions if at least 2 points are provided, 2D vectors should be supported\");\n assertEqual(dimensions2D([[1, 2, 3], [5, 9, -2]]), [4, 7], \"Should return a the dimensions if at least 2 points are provided, too big vectors should be truncated\");\n\n assertEqual(dimensions2D([[1], [5], [3], [-2]]), [7, 0], \"Should return a the dimensions with respect to all points, incomplete vectors should be completed\");\n assertEqual(dimensions2D([[1, 2, 3], [5, 9], [3, 2], [-2, -6]]), [7, 15], \"Should return a the dimensions with respect to all points, 2D vectors should be supported\");\n assertEqual(dimensions2D([[1, 2, 3, 4], [5, 9, -2, -5], [3, 2, 7, 8], [-2, -6, 0, 3]]), [7, 15], \"Should return a the dimensions with respect to all points, too big vectors should be truncated\");\n }\n }\n \/\/ test core\/vector-2d\/boundaries2D()\n testModule(\"boundaries2D()\", 3) {\n testUnit(\"no parameter\", 1) {\n assertEqual(boundaries2D(), [[0, 0], [0, 0]], \"Cannot get boundaries if the list is missing\");\n }\n testUnit(\"wrong types\", 3) {\n assertEqual(boundaries2D(\"2\"), [[0, 0], [0, 0]], \"Cannot get boundaries from string\");\n assertEqual(boundaries2D(2), [[0, 0], [0, 0]], \"Cannot get boundaries from single number\");\n assertEqual(boundaries2D(true), [[0, 0], [0, 0]], \"Cannot get boundaries from boolean\");\n }\n testUnit(\"vectors\", 9) {\n assertEqual(boundaries2D([[1]]), [[1, 0], [1, 0]], \"A single point is its own boundaries, incomplete vectors should be completed\");\n assertEqual(boundaries2D([[1, 2]]), [[1, 2], [1, 2]], \"A single point is its own boundaries, 2D vectors should be supported\");\n assertEqual(boundaries2D([[1, 2, 3, 4]]), [[1, 2], [1, 2]], \"A single point is its own boundaries, too big vectors should be truncated\");\n\n assertEqual(boundaries2D([[1], [5]]), [[1, 0], [5, 0]], \"Boundaries of 2 points, incomplete vectors should be completed\");\n assertEqual(boundaries2D([[1, 2], [5, 9]]), [[1, 2], [5, 9]], \"Boundaries of 2 points, 2D vectors should be supported\");\n assertEqual(boundaries2D([[1, 2, 3, 4], [5, 9, -2, 8]]), [[1, 2], [5, 9]], \"Boundaries of 2 points, too big vectors should be truncated\");\n\n assertEqual(boundaries2D([[1], [5], [3], [-2]]), [[-2, 0], [5, 0]], \"Boundaries of several points, incomplete vectors should be completed\");\n assertEqual(boundaries2D([[1, 2], [5, 9], [3, 2], [-2, -6]]), [[-2, -6], [5, 9]], \"Boundaries of several points, 2D vectors should be supported\");\n assertEqual(boundaries2D([[1, 2, 3, 4], [5, 9, -2, 8], [3, 2, 7, 5], [-2, -6, 0, 1]]), [[-2, -6], [5, 9]], \"Boundaries of several points, too big vectors should be truncated\");\n }\n }\n }\n function _rot2(v, a) = [\n v[0] * cos(a) - v[1] * sin(a),\n v[1] * cos(a) + v[0] * sin(a)\n ];\n}\n\ntestCoreVector2D();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1520c36a2d94bbe66596e14882547dddc9c353b6","subject":"Re-organized code to factor out lug and switch into separate modules","message":"Re-organized code to factor out lug and switch into separate modules\n\nMuch cleaner...\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 30; \/\/ width - x\n wall_h = 20; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 30; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n\n base_w = switch_w + 2*thick;\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d); \n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 10; \/\/ width - x \n lug_h = 5; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 10; \/\/ depth - y - of lug\n lug_off = 5; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","old_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n \n\/\/ Switch strain relief\nmodule switch_sr() {\n\n LARGE = 1000;\n switch_w = 30;\n switch_h = 20;\n switch_d = 30;\n wall_t = 2;\n base_w = switch_w + 2*wall_t;\n base_t = 3;\n ext_w = 10;\n ext_off = 5;\n base_d = switch_d;\n ext_d = 10;\n base_r = 5;\n \/\/ Base\n T_channel(ext_w, ext_d, base_w, base_d, ext_off, base_r, base_t);\n \n wall_h = 15;\n\n \/\/ Switch walls\n ro = 3;\n ri = 0;\n translate([0, ext_d+base_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+base_t, switch_w, LARGE, wall_t, base_t, ro, ri,base_d);\n \n \/\/ Lug support\n \/*\n lug_h = 10;\n lug_gap = 5;\n lug_pad = 1;\n translate([ext_off, ext_d, 0]) rotate([90, 0, 0])\n O_channel(ext_w, lug_h+base_t, lug_gap, LARGE, ext_off\/2, lug_pad+base_t, 0, ro, ext_d);\n *\/\n lug_h = 5;\n lug_center_w = 5;\n lug_r = 2;\n lug_pad_h = 0.5;\n lug_gap_d = 0.5;\n translate([ext_off+ext_w, ext_d-lug_gap_d, lug_h+base_t+lug_pad_h]) rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, ext_w, base_t+lug_pad_h, \n ext_off-lug_center_w\/2, lug_r, ext_d-lug_gap_d);\n}\n\n\n\nswitch_sr();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"f9acfbfdffbe573cb285e85e38600b13a58ddf02","subject":"height decreased + resotred flat-print (rotated gives bad precision in crucial place","message":"height decreased + resotred flat-print (rotated gives bad precision in crucial place\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"module wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\nmodule support()\n{\n h=4;\n w=119;\n s=21;\n\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n}\n\nsupport();\n\ntranslate([-5, 0, 0])\n rotate([0, -90, 0])\n support();","old_contents":"module wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\nmodule support()\n{\n h=4.5;\n w=119;\n s=21;\n\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n}\n\n\/\/support();\n\ntranslate([-5, 0, 0])\n rotate([0, -90, 0])\n support();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2edea7d4d9f8f443b5443e01cfe55b505de3fdad","subject":"Fix typo in samples","message":"Fix typo in samples\n","repos":"jsconan\/camelSCAD","old_file":"samples\/render-modes.scad","new_file":"samples\/render-modes.scad","new_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * Rendering mode.\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ Only include the core of the library as only the render mode helpers are needed\nuse <..\/core.scad>\ninclude <..\/core\/constants.scad>\n\n\/\/ Defines the list of shapes sizes\nDEMO_RANGE = [1 : 10];\n\n\/\/ The space between each shape on the same line\nDEMO_STEP = 5;\n\n\/\/ The start offset of a line\nDEMO_OFFSET_X = 20;\n\n\/\/ The space between two lines\nDEMO_OFFSET_Y = 30;\n\n\/\/ The size of the displayed text (the name of illustrated render mode)\nDEMO_FONT_SIZE = 10;\n\n\/\/ The list of render modes to illustrate\nDEMO_MODES = [\n [undef, undef], \/\/ MODE_DEFAULT\n [[.5, 0, 0], MODE_DIRTY],\n [[0, .5, 0], MODE_DEV],\n [[0, 0, .5], MODE_PROD],\n];\n\n\/**\n * Will illustrate the current render mode by drawing some shapes\n * @param String mode\n *\/\nmodule demo(mode) {\n \/\/ Draw some shapes\n applyMode(mode) {\n for(i = DEMO_RANGE) {\n translate([DEMO_OFFSET_X + DEMO_STEP * i, 0, 0]) {\n sphere(i);\n }\n }\n }\n\n \/\/ Display the mode name\n text(or(mode, \"default\"), DEMO_FONT_SIZE, halign=\"center\", valign=\"center\");\n}\n\n\/**\n * Will apply each render mode and will illustrate them by drawing some shapes\n *\/\nfor (i = [0 : len(DEMO_MODES) - 1]) {\n translate([DEMO_OFFSET_X, (i + .5) * DEMO_OFFSET_Y, 0]) {\n color(DEMO_MODES[i][0]) {\n demo(DEMO_MODES[i][1]);\n }\n }\n}\n","old_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * Rendering mode.\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ Only include the core of the library as only the render mode helpers are needed\nuse <..\/core.scad>\ninclude <..\/core\/constants.scad>\n\n\/\/ Defines the list of shapes sizes\nDEMO_RANGE = [1 : 10];\n\n\/\/ The space between each shape on the same line\nDEMO_STEP = 5;\n\n\/\/ The start offset of a line\nDEMO_OFFSET_X = 20;\n\n\/\/ The space between two lines\nDEMO_OFFSET_Y = 30;\n\n\/\/ The size of the displayed text (the name of illustrated render mode)\nDEMO_FONT_SIZE = 10;\n\n\/\/ The list of render modes to illustrate\nDEMO_MODES = [\n [null, null], \/\/ MODE_DEFAULT\n [[.5, 0, 0], MODE_DIRTY],\n [[0, .5, 0], MODE_DEV],\n [[0, 0, .5], MODE_PROD],\n];\n\n\/**\n * Will illustrate the current render mode by drawing some shapes\n * @param String mode\n *\/\nmodule demo(mode) {\n \/\/ Draw some shapes\n applyMode(mode) {\n for(i = DEMO_RANGE) {\n translate([DEMO_OFFSET_X + DEMO_STEP * i, 0, 0]) {\n sphere(i);\n }\n }\n }\n\n \/\/ Display the mode name\n text(or(mode, \"default\"), DEMO_FONT_SIZE, halign=\"center\", valign=\"center\");\n}\n\n\/**\n * Will apply each render mode and will illustrate them by drawing some shapes\n *\/\nfor (i = [0 : len(DEMO_MODES) - 1]) {\n translate([DEMO_OFFSET_X, (i + .5) * DEMO_OFFSET_Y, 0]) {\n color(DEMO_MODES[i][0]) {\n demo(DEMO_MODES[i][1]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"09cbe164d8d13224c69d2d399b211f2ac8bd6d6f","subject":"nipple position_base","message":"nipple position_base\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/nipple.scad","new_file":"class1\/exercise\/refactor\/nipple.scad","new_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\n\nmodule shoulder_top_little()\n{\n position_ring = [0,0,-BORDER_NIPPLE];\n \n posicion_circle_x = radius(DIAMETER_NIPPLE)-BORDER_NIPPLE;\n position_circle = [posicion_circle_x, 0, 0];\n \n color(GREY)\n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\n\nmodule body_central_little()\n{\n position_z = BORDER_NIPPLE - HEIGHT_NIPPLE;\n position = [0,0,position_z];\n \n height = HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE);\n \n color(GREY)\n translate(position)\n cylinder(\n h = height,\n d = DIAMETER_NIPPLE,\n $fn = FINE); \n}\n\nmodule milling_nipple()\n{\n position_nipple_z = BORDER_NIPPLE - HEIGHT_NIPPLE;\n position_nipple = [0, 0, position_nipple_z];\n position_nipple_border = [radius(DIAMETER_NIPPLE), 0, 0];\n \n translate(position_nipple)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_nipple_border)\n square(BORDER_NIPPLE,BORDER_NIPPLE);\n \n}\n\nmodule milling_base()\n{\n position_nipple_z = (2 * BORDER_NIPPLE) - HEIGHT_NIPPLE;\n position_nipple = [0, 0, position_nipple_z];\n \n position_border_x = radius(DIAMETER_NIPPLE) + BORDER_NIPPLE;\n position_border = [position_border_x, 0, 0];\n translate(position_nipple)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_border)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\nmodule milling_nipple_base()\n{\n color(GREY)\n difference()\n {\n milling_nipple();\n milling_base();\n }\n}\nfunction position_base() = [0,0,-HEIGHT_NIPPLE];\nmodule base_cylinder()\n{\n diameter = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE);\n color(GREY)\n translate(position_base())\n cylinder(\n h = BORDER_NIPPLE,\n d = diameter,\n $fn = FINE);\n}\nmodule base_border()\n{\n color(GREY)\n translate(position_base())\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\nmodule nipple()\n{\n top_little();\n shoulder_top_little();\n body_central_little();\n milling_nipple_base();\n base_cylinder();\n base_border(); \n} \n\nnipple();\n","old_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\n\nmodule shoulder_top_little()\n{\n position_ring = [0,0,-BORDER_NIPPLE];\n \n posicion_circle_x = radius(DIAMETER_NIPPLE)-BORDER_NIPPLE;\n position_circle = [posicion_circle_x, 0, 0];\n \n color(GREY)\n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\n\nmodule body_central_little()\n{\n position_z = BORDER_NIPPLE - HEIGHT_NIPPLE;\n position = [0,0,position_z];\n \n height = HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE);\n \n color(GREY)\n translate(position)\n cylinder(\n h = height,\n d = DIAMETER_NIPPLE,\n $fn = FINE); \n}\n\nmodule milling_nipple()\n{\n position_nipple_z = BORDER_NIPPLE - HEIGHT_NIPPLE;\n position_nipple = [0, 0, position_nipple_z];\n position_nipple_border = [radius(DIAMETER_NIPPLE), 0, 0];\n \n translate(position_nipple)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_nipple_border)\n square(BORDER_NIPPLE,BORDER_NIPPLE);\n \n}\n\nmodule milling_base()\n{\n position_nipple_z = (2 * BORDER_NIPPLE) - HEIGHT_NIPPLE;\n position_nipple = [0, 0, position_nipple_z];\n \n position_border_x = radius(DIAMETER_NIPPLE) + BORDER_NIPPLE;\n position_border = [position_border_x, 0, 0];\n translate(position_nipple)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_border)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\nmodule milling_nipple_base()\n{\n color(GREY)\n difference()\n {\n milling_nipple();\n milling_base();\n }\n}\n\nmodule base_cylinder()\n{\n position_z = -HEIGHT_NIPPLE;\n position = [0, 0, position_z];\n diameter = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE);\n color(GREY)\n translate(position)\n cylinder(\n h = BORDER_NIPPLE,\n d = diameter,\n $fn = FINE);\n}\nmodule nipple()\n{\n top_little();\n shoulder_top_little();\n body_central_little();\n milling_nipple_base();\n base_cylinder();\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n \n} \n\nnipple();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3799b010378633d27a439c5be4078b84cf66b910","subject":"The z-translate was moved down a little bit.","message":"The z-translate was moved down a little bit.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/shapes\/spurs\/spurs-a.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/shapes\/spurs\/spurs-a.scad","new_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule spur(zLength)\r\n{\r\n scale([25.4\/90, -25.4\/90, 2])\r\n translate([0, 0, -2])\r\n\/\/ union()\r\n {\r\n linear_extrude(height = zLength)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule spur(zLength)\r\n{\r\n scale([25.4\/90, -25.4\/90, 2])\r\n translate([0, 0, -1])\r\n\/\/ union()\r\n {\r\n linear_extrude(height = zLength)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"da50f6c7df8e538382e102bef3479f0e349d72cc","subject":"element should be 9mm shorter to fit perfectly","message":"element should be 9mm shorter to fit perfectly\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"car_flap_extension\/car_flap_extension.scad","new_file":"car_flap_extension\/car_flap_extension.scad","new_contents":"h=2;\ncount=3;\n\nmodule extension()\n{\n cube([16,10,h]);\n translate([16,5,0])\n cylinder(h=h, r=5, $fs=0.1);\n}\n\nfor(x=[0:2])\n translate([0, x*13, 0])\n extension();\n","old_contents":"h=2;\ncount=3;\n\nmodule extension()\n{\n cube([25,10,h]);\n translate([25,5,0])\n cylinder(h=h, r=5, $fs=0.1);\n}\n\nfor(x=[0:2])\n translate([0, x*13, 0])\n extension();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7f8fd888f65efdaef9a9897eb00739fc21f67a61","subject":"Improved light bar opening to allow sliding out of the way.","message":"Improved light bar opening to allow sliding out of the way.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*3;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1cb6deb7e0a772aff2c4e2665f2cde08c91fda6b","subject":"new model ADENIN","message":"new model ADENIN","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Adenin.scad","new_file":"3D-models\/SCAD\/Adenin.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=18.5; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, -1]) cube([42, 24, 9]); \/\/space\n } \n } \n}\ndifference() {\n\n translate([39, -9.5, -4.29]) cube([11.92, 19, 8.55]);\n rotate([0, 90, 0]) translate([0, -5, 47.92]) cylinder(5, 2.67, 2.67);\n rotate([0, 90, 0]) translate([0, 5, 47.92]) cylinder(5, 2.67, 2.67);\n }\n rotate([90, 0, 0]) translate([1.05, 0, -9.5]) cylinder(19, 4.29, 4.29);\n rotate([90, 0, 0]) translate([40, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\/\/difference() {\n\/\/ translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n\/\/ #rotate([0, 90, 0]) translate([0, 0, -15]) cylinder(8, 2.67, 2.67);\n\n\/\/}\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n #color() translate ([3, 0, 0]) cube ([x+7, y, z], center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -10.5, 2]) cube([50, 21, 5]);\n } \n\n }\n #rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(6, 2.67, 2.67);\n translate([-13, -10.5, -1]) cube([39, 21, 5]);\n } \n } \n}\ndifference() {\n\n #translate([39, -10.5, -3.45]) cube([13, 21, 7]);\n #rotate([0, 90, 0]) translate([0, -5, 48.5]) cylinder(5, 2.67, 2.67);\n #rotate([0, 90, 0]) translate([0, 5, 48.5]) cylinder(5, 2.67, 2.67);\n }\n #rotate([90, 0, 0]) translate([-4, 0, -10.5]) cylinder(21, 3.5, 3.5);\n #rotate([90, 0, 0]) translate([36, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ba1ab88655e091a877d9e80596df920ed04cb13f","subject":"iglo-style version","message":"iglo-style version\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_contents":"use \n\nmodule shell(extra_size)\n{\n cube_size=100;\n\n difference()\n {\n resize([60, 60, 70] + extra_size*[1,1,1])\n sphere(r=25);\n \/\/ front cut\n translate(cube_size*[-1\/2, -1, -1\/2] + [0, -20, 0])\n cube(cube_size*[1,1,1]);\n \/\/ bottom cut\n translate(cube_size*[-1\/2, -1\/2, -1])\n cube(cube_size*[1,1,1]);\n }\n}\n\n\nmodule cover()\n{\n difference()\n {\n shell(3);\n shell(0);\n }\n}\n\n\n%translate([-21\/2, -41\/2, 0])\n closet_hinge();\ncover();","old_contents":"use ;\n\n%closet_hinge();\ncube(); \/\/ TODO...","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1dc9fec7b91908909619877bb6ba9cea9f9d7dd2","subject":"Removed 'simple tabs' from lasercutoutBox() as they clash with changes to finger tabs","message":"Removed 'simple tabs' from lasercutoutBox() as they clash with changes to finger tabs\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.15;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n\t\/*\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n\t\t*\/\n\t\tst=[];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n\t\/*\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n\t\t*\/\n\t\tst=[];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"c36956d79751be113a4f103dd956182ef922d68d","subject":"Updating lasercut.scad - part of clip","message":"Updating lasercut.scad - part of clip\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n}\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"fc2dc8bdbebad3d223770d6e16e1c31194a493b6","subject":"Changed position of the bridge","message":"Changed position of the bridge\n","repos":"mhct\/droneuaw","old_file":"support-design\/support-rocket-m5-rpi.scad","new_file":"support-design\/support-rocket-m5-rpi.scad","new_contents":"\nmodule holefixer() {\n \/\/produces a holefixer (with space for a 3 mm screw)\n \/\/ it has 13 mm heigh\n \/\/ the center of the hole is at x=12,y=12\n difference() {\n union() {\n tickness = 3;\n cube([12, 10, tickness], center=true);\n translate([0,0,-15]) cylinder(h=16, r=3, center=false, $fn=100); \n } \n translate([0,0,-20]) cylinder(h=30, r=2, center=false, $fn=100);\n \n }\n\n}\n\nmodule bridge(covered = false) {\n color([1,1,1],1) {\n translate([0,0,0]) rotate([0,-90,0]) union() {\n cube([37, 24, 3]);\n translate([0,6,0]) cube([15, 12, 5]);\n }\n \n translate([76,0,0]) rotate([0,-90,0]) union() {\n cube([37, 24, 3]);\n translate([0,6,-2]) cube([15, 12, 5]);\n }\n if (covered == true) {\n translate([-3, 0, 37]) cube([79,24,3]); \n }\n }\n}\n\n$fn=100;\ndifference() {\n union() {\n tickness = 3;\n cube([73, 107, tickness]);\n \/\/translate([0,13,0]) bridge(true);\n \/\/translate([0,60,0]) bridge(true);\n \n translate([-6,40,1.5]) holefixer();\n translate([-2,35,1.5]) cube([6, 10, 3], center=false); \/\/support to make outside wings stronger\n translate([79,40,1.5]) holefixer();\n translate([69,35,1.5]) cube([6, 10, 3], center=false); \/\/support to make outside wings stronger\n \n\n translate([31.5, 44, 0]) cube([10, 4, 10], center=false);\n translate([26.5, 103, 0]) cube([20, 4, 10], center=false);\n translate([66, 74.5, 0]) cube([4, 10, 10], center=false);\n }\n\n\n translate([5.5, 7.5, 0]) cylinder(h=16, r=1.6, center=true);\n translate([14.1, -1, -1]) cube([18,16,7], center=false); \/\/ hole for ethernet card \n translate([64, 50, -1]) cube([6,18,7], center=false); \/\/hole for firmware pins\n\n translate([66.3, 7.5, 0]) cylinder(h=16, r=1.6, center=true);\n\n translate([37, 75, 0]) cylinder(h=16, r=24, center=true);\n\/\/ translate([37, 20, 0]) cylinder(h=16, r=16, center=true);\n\n}\n\ntranslate([0,160,-13.5]) rotate([90,0,0]) bridge(true);\ntranslate([10,130,10.5]) rotate([-90,0,0]) bridge(true);\n\nmodule measureCheck() {\n color([1.0,0,0], 1) {\n rotate([0,90,0]) cylinder(h=85, r=1, center=false);\n }\n}\n\n\/\/translate([-6,40,0]) measureCheck();","old_contents":"\nmodule holefixer() {\n \/\/produces a holefixer (with space for a 3 mm screw)\n \/\/ it has 13 mm heigh\n \/\/ the center of the hole is at x=12,y=12\n difference() {\n union() {\n tickness = 3;\n cube([12, 10, tickness], center=true);\n translate([0,0,-15]) cylinder(h=16, r=3, center=false, $fn=100); \n } \n translate([0,0,-20]) cylinder(h=30, r=2, center=false, $fn=100);\n \n }\n\n}\n\nmodule bridge(covered = false) {\n color([1,1,1],1) {\n translate([0,0,0]) rotate([0,-90,0]) union() {\n cube([37, 24, 3]);\n translate([0,6,0]) cube([15, 12, 5]);\n }\n \n translate([76,0,0]) rotate([0,-90,0]) union() {\n cube([37, 24, 3]);\n translate([0,6,-2]) cube([15, 12, 5]);\n }\n if (covered == true) {\n translate([-3, 0, 37]) cube([79,24,3]); \n }\n }\n}\n\n$fn=100;\ndifference() {\n union() {\n tickness = 3;\n cube([73, 107, tickness]);\n \/\/translate([0,13,0]) bridge(true);\n \/\/translate([0,60,0]) bridge(true);\n \n translate([-6,40,1.5]) holefixer();\n translate([-2,35,1.5]) cube([6, 10, 3], center=false); \/\/support to make outside wings stronger\n translate([79,40,1.5]) holefixer();\n translate([69,35,1.5]) cube([6, 10, 3], center=false); \/\/support to make outside wings stronger\n \n\n translate([31.5, 44, 0]) cube([10, 4, 10], center=false);\n translate([26.5, 103, 0]) cube([20, 4, 10], center=false);\n translate([66, 74.5, 0]) cube([4, 10, 10], center=false);\n }\n\n\n translate([5.5, 7.5, 0]) cylinder(h=16, r=1.6, center=true);\n translate([14.1, -1, -1]) cube([18,16,7], center=false); \/\/ hole for ethernet card \n translate([64, 50, -1]) cube([6,18,7], center=false); \/\/hole for firmware pins\n\n translate([66.3, 7.5, 0]) cylinder(h=16, r=1.6, center=true);\n\n translate([37, 75, 0]) cylinder(h=16, r=24, center=true);\n\/\/ translate([37, 20, 0]) cylinder(h=16, r=16, center=true);\n\n}\n\ntranslate([0,160,0]) rotate([90,0,0]) bridge(true);\ntranslate([10,130,24]) rotate([-90,0,0]) bridge(true);\n\nmodule measureCheck() {\n color([1.0,0,0], 1) {\n rotate([0,90,0]) cylinder(h=85, r=1, center=false);\n }\n}\n\n\/\/translate([-6,40,0]) measureCheck();","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"754d3892c94bb6813e51a2dae966bed0d4fe966d","subject":"main: fix includes","message":"main: fix includes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"40a52b3372de51e3b7ef3763c6d8fb3a1839d8bc","subject":"xaxis\/ends\/xaxis_end_body: rewrite to part system","message":"xaxis\/ends\/xaxis_end_body: rewrite to part system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n\n \/\/ cut away some of nut mount support\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4aec95414f5c04c7d801b893270d1bf20f653a30","subject":"y\/idler: use material system","message":"y\/idler: use material system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extrasize=Z*yaxis_idler_mount_thickness,\n extrasize_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,0,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head_embed=false, h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extrasize=[20*mm,0,0], extrasize_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"include \n\nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extrasize=Z*yaxis_idler_mount_thickness,\n extrasize_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,0,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head_embed=false, h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extrasize=[20*mm,0,0], extrasize_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"27820365eb77a3a3250d61d46a83cfc31e8111e9","subject":"try fixing the cutout sizes","message":"try fixing the cutout sizes\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1.scad","new_file":"3d\/enclosure_v1.scad","new_contents":"tol = 0.5;\nscreen_tol = 1;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.6;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 29.15;\nscreen_start_y = shift_y + 39.1;\nscreen_length_x = 72;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n\t cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.6;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 25;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n\t cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x, screen_start_y, top_box_z - th - eps]) {\n cube([screen_length_x, screen_length_y + tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y, -eps]) {\n cube([th + 2*eps, usb_type_a_w+eps, usb_type_a_h+2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4edd7b656f0ce1afed1e552bf5bc868d56a4759a","subject":"Typeatron's buttons now much more deeply inset; this should make the device easier to grasp while typing.","message":"Typeatron's buttons now much more deeply inset; this should make the device easier to grasp while typing.\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo","old_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 5;\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = thumbNotchDepth * 2\/3;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + buttonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + buttonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1.0001]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\nmodule fingerButtonWell(length) {\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6353349a30bfa2426264be3153ef52418b1ce93c","subject":"fixed up the rpi3 mounts","message":"fixed up the rpi3 mounts\n","repos":"beckdac\/zynthian-build","old_file":"case\/zynthian-case.scad","new_file":"case\/zynthian-case.scad","new_contents":"$fn = 64;\n\nuse \n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 119;\ndisplayScreenHeight = 72;\ndisplayScreenThickness = 3;\ndisplayScreenYOffset = 3.5;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 79;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2 + displayScreenYOffset, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\ndisplayMountThickness = displayBoardThickness;\ndisplayMountScrewOffset = 2;\nmodule display_mount() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayMountThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness])\n cylinder(h=2 * displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d * 2);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule lid() {\n \/\/display_mount_tabs();\n \n difference() {\n \/\/ face plate\n union() {\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n display_mount();\n }\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * (encoderWidth * 1.1), j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=20, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\nmcp23017BoardWidth = 40;\nmcp23017BoardLength = 60;\nmcp23017BoardHeight = 1.4;\nmcp23017BoardScrewDiameter = 2;\nmcp23017BoardScrewInset = 1.7;\nheader40PinWidth = 4.8;\nheader40PinLength = 51;\nheader40PinHeight = 11;\nheader40pinInsetL = 4.5;\nheader40pinInsetW = 4.5;\nmcpToHifiOffset = 10.2;\nhifiBoardWidth = 56;\nhifiBoardLength = 65.3;\nhifiBoardHeight = 1.4;\nhifiBoardCutoutWidth = lidThickness * 3;\nhifiBoardCutoutLength = 46;\nhifiBoardCutoutHeight = 14.5;\nhifiBoardScrewDiameter = 4;\nhifiBoardScrewInset = 3.7;\nhifiMcpWidth = mcp23017BoardWidth - mcpToHifiOffset + hifiBoardWidth;\nhigiMcpLength = hifiBoardLength;\nmodule hifi_mcp23017_board_mount() {\n difference() {\n union() {\n \/\/ mcp board\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset * 2, 0, 0])\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n translate([0, mcp23017BoardLength - mcp23017BoardScrewInset * 2, 0])\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset * 2, mcp23017BoardLength - mcp23017BoardScrewInset * 2, 0])\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n \/\/ hifi board\n translate([-hifiBoardWidth + mcpToHifiOffset, 0, 0])\n cube([hifiBoardScrewInset * 2, hifiBoardScrewInset * 2, mcp23017BoardHeight + header40PinHeight + hifiMcpSpacer]);\n translate([-hifiBoardWidth + mcpToHifiOffset, hifiBoardLength - hifiBoardScrewInset * 2, 0])\n cube([hifiBoardScrewInset * 2, hifiBoardScrewInset * 2, mcp23017BoardHeight + header40PinHeight + hifiMcpSpacer]);\n }\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([-hifiBoardWidth + mcpToHifiOffset + hifiBoardScrewInset, hifiBoardScrewInset, mcp23017BoardHeight + header40PinHeight - 10])\n cylinder(d=hifiBoardScrewDiameter, h=20);\n translate([-hifiBoardWidth + mcpToHifiOffset + hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset * 2 + hifiBoardScrewInset, mcp23017BoardHeight + header40PinHeight - 10])\n cylinder(d=hifiBoardScrewDiameter, h=20);\n }\n}\nmodule hifi_mcp23017_boards() {\n \/\/ mcp23017 protoboard\n color(\"limegreen\")\n difference() {\n \/\/ board\n cube([mcp23017BoardWidth, mcp23017BoardLength, mcp23017BoardHeight]);\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n }\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n \/\/ sainsmart pifi dac board\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset, 0, mcp23017BoardHeight + header40PinHeight])\n difference() {\n \/\/ board\n cube([hifiBoardWidth, hifiBoardLength, hifiBoardHeight]);\n \/\/ screw holes\n translate([hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n }\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset - hifiBoardCutoutWidth \/ 2, hifiBoardLength \/ 2 - hifiBoardCutoutLength \/ 2, mcp23017BoardHeight + header40PinHeight])\n cube([hifiBoardCutoutWidth, hifiBoardCutoutLength, hifiBoardCutoutHeight]);\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight + header40PinHeight + hifiBoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n\n}\n\nanker7PortHubHeight = 44.5;\nanker7PortHubLength = 110;\nanker7PortHubWidth = 23;\nanker7PortHubPowerDiameter = 10.5;\nanker7PortHubPowerHeight = 31;\nanker7PortHubPowerLength = 5;\nanker7PortHubPowerWidth = 10.4;\nanker7PortHubUSBH = 9;\nanker7PortHubUSBW = 11;\nanker7PortHubUSBHeight = 14.5;\nanker7PortHubUSBLength = 5;\nanker7PortHubUSBWidth = 9;\nmodule anker_7port_usb_hub() {\n difference() {\n color(\"black\")\n translate([0, 0, boxThickness])\n cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight]);\n translate([anker7PortHubPowerWidth, anker7PortHubPowerLength, anker7PortHubPowerHeight])\n rotate([90, 0, 0])\n cylinder(h=20, d=anker7PortHubPowerDiameter);\n translate([anker7PortHubUSBWidth - anker7PortHubUSBW \/ 2, anker7PortHubUSBLength, anker7PortHubUSBHeight - anker7PortHubUSBH\/2])\n rotate([90, 0, 0])\n cube([anker7PortHubUSBW, anker7PortHubUSBH, 20]);\n }\n}\n\n\/\/ box with pi mounts and holes\nrPi3BottomSpacer = 6;\nrPi3Length = 85;\nrpi3Width = 56;\nboxHeight = 80;\nboxThickness = lidThickness;\nhifiMcpSpacer = 6;\nscrewTabDim = 10;\nrpi3USBPowerCordHoleHeight = 7;\nrpi3USBPowerCordDiameter = 11;\nrpi3USBPowerCordZipDiameter = 3;\nrpi3USBPowerCordZipOffset = 9;\nmodule pi3_mounts() {\n difference() {\n union() { \n translate([-85\/2+3.5,-49\/2, 0]) cylinder(r=3, h=rPi3BottomSpacer);\n translate([-85\/2+3.5, 49\/2, 0]) cylinder(r=3, h=rPi3BottomSpacer);\n translate([58-85\/2+3.5,-49\/2,0]) cylinder(r=3, h=rPi3BottomSpacer);\n translate([58-85\/2+3.5, 49\/2, 0]) cylinder(r=3, h=rPi3BottomSpacer);\n }\n translate([-85\/2+3.5,-49\/2,-1]) cylinder(d=2.75, h=20);\n translate([-85\/2+3.5, 49\/2,-1]) cylinder(d=2.75, h=20);\n translate([58-85\/2+3.5,-49\/2,-1]) cylinder(d=2.75, h=20);\n translate([58-85\/2+3.5, 49\/2,-1]) cylinder(d=2.75, h=20);\n }\n}\nmodule box(renderPi3=true, renderMcpHifi=true) {\n difference() {\n union() {\n \/\/ bottom\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, boxThickness]);\n \/\/ sides\n for (i = [-1, 1])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -i * (displayBoardHeight * 1.25 + encoderLength)\/2 - (i == -1 ? boxThickness : 0), 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, boxThickness, boxHeight]);\n for (i = [-1, 1])\n translate([-i * (displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - (i == -1 ? boxThickness : 0), -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([boxThickness, displayBoardHeight * 1.25 + encoderLength, boxHeight]);\n \/\/ screw tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, boxHeight \/ 2])\n cube([screwTabDim, screwTabDim, boxHeight], center = true);\n }\n }\n \/\/ hifi audio out board with mcp23017 board\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, -(displayBoardHeight * 1.25 + encoderLength \/ 2) + hifiBoardLength \/ 2, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ pi usb \/ ethernet cutout\n rotate([0, 0, 270])\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 81, -30, boxThickness + rPi3BottomSpacer])\n pi3();\n \/\/ hub port\n\/\/ translate([-20, (displayBoardHeight * 1.25 + encoderLength) \/2 + 10, boxThickness])\n\/\/ rotate([0, 0, 270])\n\/\/ translate([0, 0, boxThickness * 2])\n\/\/ cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight - boxThickness]);\n \/\/ screw holes\n translate([0, 0, boxHeight - 50])\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=60, d=lidScrewDiameter + iFitAdjust_d);\n }\n \/\/ power cord hole and zip hole\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 1, 15, 0])\n rotate([0, 90, 0])\n translate([-rpi3USBPowerCordHoleHeight - boxThickness, 0, 0]) {\n translate([0, 0, 0])\n cylinder(h=boxThickness * 2, d=rpi3USBPowerCordDiameter);\n translate([-rpi3USBPowerCordZipOffset, 0, 0])\n cylinder(h=boxThickness * 2, d=rpi3USBPowerCordZipDiameter);\n }\n }\n \/\/ pi usb \/ ethernet cutou\n \/\/ pi mount holes\n if (renderPi3)\n rotate([0, 0, 270])\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 83, -30, boxThickness + rPi3BottomSpacer])\n pi3();\n rotate([0, 0, 270])\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 83, -30, boxThickness])\n pi3_mounts();\n \/\/ hifi audio out board with mcp23017 board\n if (renderMcpHifi)\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, -(displayBoardHeight * 1.25 + encoderLength \/ 2) + hifiBoardLength \/ 2, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ mounts for hifi\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, -(displayBoardHeight * 1.25 + encoderLength \/ 2) + hifiBoardLength \/ 2, boxThickness])\n hifi_mcp23017_board_mount();\n \/\/ anker usb power hub\n\/\/ translate([-20, (displayBoardHeight * 1.25 + encoderLength) \/2 - boxThickness, boxThickness])\n\/\/ rotate([0, 0, 270])\n\/\/ anker_7port_usb_hub();\n \/\/ translate([0,0,boxHeight + 2])\n \/\/ lid();\n}\n\n\/\/display();\n\/\/encoder();\n\/\/lid();\n\/\/display_mount_tabs();\n\/\/box();\nbox(renderPi3=false, renderMcpHifi=false);","old_contents":"$fn = 64;\n\nuse \n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 119;\ndisplayScreenHeight = 72;\ndisplayScreenThickness = 3;\ndisplayScreenYOffset = 3.5;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 79;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2 + displayScreenYOffset, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\ndisplayMountThickness = displayBoardThickness;\ndisplayMountScrewOffset = 2;\nmodule display_mount() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayMountThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness])\n cylinder(h=2 * displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d * 2);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule lid() {\n \/\/display_mount_tabs();\n \n difference() {\n \/\/ face plate\n union() {\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n display_mount();\n }\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * (encoderWidth * 1.1), j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=20, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\nmcp23017BoardWidth = 40;\nmcp23017BoardLength = 60;\nmcp23017BoardHeight = 1.4;\nmcp23017BoardScrewDiameter = 2;\nmcp23017BoardScrewInset = 1.7;\nheader40PinWidth = 4.8;\nheader40PinLength = 51;\nheader40PinHeight = 11;\nheader40pinInsetL = 4.5;\nheader40pinInsetW = 4.5;\nmcpToHifiOffset = 10.2;\nhifiBoardWidth = 56;\nhifiBoardLength = 65.3;\nhifiBoardHeight = 1.4;\nhifiBoardCutoutWidth = lidThickness * 3;\nhifiBoardCutoutLength = 46;\nhifiBoardCutoutHeight = 14.5;\nhifiBoardScrewDiameter = 4;\nhifiBoardScrewInset = 3.7;\nhifiMcpWidth = mcp23017BoardWidth - mcpToHifiOffset + hifiBoardWidth;\nhigiMcpLength = hifiBoardLength;\nmodule hifi_mcp23017_board_mount() {\n difference() {\n union() {\n \/\/ mcp board\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset * 2, 0, 0])\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n translate([0, mcp23017BoardLength - mcp23017BoardScrewInset * 2, 0])\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset * 2, mcp23017BoardLength - mcp23017BoardScrewInset * 2, 0])\n cube([mcp23017BoardScrewInset * 2, mcp23017BoardScrewInset * 2, hifiMcpSpacer]);\n \/\/ hifi board\n translate([-hifiBoardWidth + mcpToHifiOffset, 0, 0])\n cube([hifiBoardScrewInset * 2, hifiBoardScrewInset * 2, mcp23017BoardHeight + header40PinHeight + hifiMcpSpacer]);\n translate([-hifiBoardWidth + mcpToHifiOffset, hifiBoardLength - hifiBoardScrewInset * 2, 0])\n cube([hifiBoardScrewInset * 2, hifiBoardScrewInset * 2, mcp23017BoardHeight + header40PinHeight + hifiMcpSpacer]);\n }\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=20);\n translate([-hifiBoardWidth + mcpToHifiOffset + hifiBoardScrewInset, hifiBoardScrewInset, mcp23017BoardHeight + header40PinHeight - 10])\n cylinder(d=hifiBoardScrewDiameter, h=20);\n translate([-hifiBoardWidth + mcpToHifiOffset + hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset * 2 + hifiBoardScrewInset, mcp23017BoardHeight + header40PinHeight - 10])\n cylinder(d=hifiBoardScrewDiameter, h=20);\n }\n}\nmodule hifi_mcp23017_boards() {\n \/\/ mcp23017 protoboard\n color(\"limegreen\")\n difference() {\n \/\/ board\n cube([mcp23017BoardWidth, mcp23017BoardLength, mcp23017BoardHeight]);\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n }\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n \/\/ sainsmart pifi dac board\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset, 0, mcp23017BoardHeight + header40PinHeight])\n difference() {\n \/\/ board\n cube([hifiBoardWidth, hifiBoardLength, hifiBoardHeight]);\n \/\/ screw holes\n translate([hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n }\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset - hifiBoardCutoutWidth \/ 2, hifiBoardLength \/ 2 - hifiBoardCutoutLength \/ 2, mcp23017BoardHeight + header40PinHeight])\n cube([hifiBoardCutoutWidth, hifiBoardCutoutLength, hifiBoardCutoutHeight]);\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight + header40PinHeight + hifiBoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n\n}\n\nanker7PortHubHeight = 44.5;\nanker7PortHubLength = 110;\nanker7PortHubWidth = 23;\nanker7PortHubPowerDiameter = 10.5;\nanker7PortHubPowerHeight = 31;\nanker7PortHubPowerLength = 5;\nanker7PortHubPowerWidth = 10.4;\nanker7PortHubUSBH = 9;\nanker7PortHubUSBW = 11;\nanker7PortHubUSBHeight = 14.5;\nanker7PortHubUSBLength = 5;\nanker7PortHubUSBWidth = 9;\nmodule anker_7port_usb_hub() {\n difference() {\n color(\"black\")\n translate([0, 0, boxThickness])\n cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight]);\n translate([anker7PortHubPowerWidth, anker7PortHubPowerLength, anker7PortHubPowerHeight])\n rotate([90, 0, 0])\n cylinder(h=20, d=anker7PortHubPowerDiameter);\n translate([anker7PortHubUSBWidth - anker7PortHubUSBW \/ 2, anker7PortHubUSBLength, anker7PortHubUSBHeight - anker7PortHubUSBH\/2])\n rotate([90, 0, 0])\n cube([anker7PortHubUSBW, anker7PortHubUSBH, 20]);\n }\n}\n\n\/\/ box with pi mounts and holes\nrPi3BottomSpacer = 6;\nrPi3Length = 85;\nrpi3Width = 56;\nboxHeight = 80;\nboxThickness = lidThickness;\nhifiMcpSpacer = 6;\nscrewTabDim = 10;\nmodule pi3_mounts() {\n difference() {\n union() {\n \n translate([-(85-6)\/2,-(56-6)\/2,0]) cylinder(r=3, h=rPi3BottomSpacer);\n translate([-(85-6)\/2, (56-6)\/2,0]) cylinder(r=3, h=rPi3BottomSpacer);\n translate([ (85-6)\/2,-(56-6)\/2,0]) cylinder(r=3, h=rPi3BottomSpacer);\n translate([ (85-6)\/2, (56-6)\/2,0]) cylinder(r=3, h=rPi3BottomSpacer);\n\n }\n translate([-85\/2+3.5,-49\/2,-1]) cylinder(d=2.75, h=20);\n translate([-85\/2+3.5, 49\/2,-1]) cylinder(d=2.75, h=20);\n translate([58-85\/2+3.5,-49\/2,-1]) cylinder(d=2.75, h=20);\n translate([58-85\/2+3.5, 49\/2,-1]) cylinder(d=2.75, h=20);\n }\n}\nmodule box(renderPi3=true, renderMcpHifi=true) {\n difference() {\n union() {\n \/\/ bottom\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, boxThickness]);\n \/\/ sides\n for (i = [-1, 1])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -i * (displayBoardHeight * 1.25 + encoderLength)\/2 - (i == -1 ? boxThickness : 0), 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, boxThickness, boxHeight]);\n for (i = [-1, 1])\n translate([-i * (displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - (i == -1 ? boxThickness : 0), -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([boxThickness, displayBoardHeight * 1.25 + encoderLength, boxHeight]);\n \/\/ screw tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, boxHeight \/ 2])\n cube([screwTabDim, screwTabDim, boxHeight], center = true);\n }\n }\n \/\/ hifi audio out board with mcp23017 board\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, -(displayBoardHeight * 1.25 + encoderLength \/ 2) + hifiBoardLength \/ 2, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ pi usb \/ ethernet cutout\n rotate([0, 0, 270])\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 81, -30, boxThickness + rPi3BottomSpacer])\n pi3();\n \/\/ hub port\n\/\/ translate([-20, (displayBoardHeight * 1.25 + encoderLength) \/2 + 10, boxThickness])\n\/\/ rotate([0, 0, 270])\n\/\/ translate([0, 0, boxThickness * 2])\n\/\/ cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight - boxThickness]);\n \/\/ screw holes\n translate([0, 0, boxHeight - 50])\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=60, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n \/\/ pi usb \/ ethernet cutou\n \/\/ pi mount holes\n if (renderPi3)\n rotate([0, 0, 270])\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 83, -30, boxThickness + rPi3BottomSpacer])\n pi3();\n rotate([0, 0, 270])\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - 83, -30, boxThickness])\n pi3_mounts();\n \/\/ hifi audio out board with mcp23017 board\n if (renderMcpHifi)\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, -(displayBoardHeight * 1.25 + encoderLength \/ 2) + hifiBoardLength \/ 2, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ mounts for hifi\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, -(displayBoardHeight * 1.25 + encoderLength \/ 2) + hifiBoardLength \/ 2, boxThickness])\n hifi_mcp23017_board_mount();\n \/\/ anker usb power hub\n\/\/ translate([-20, (displayBoardHeight * 1.25 + encoderLength) \/2 - boxThickness, boxThickness])\n\/\/ rotate([0, 0, 270])\n\/\/ anker_7port_usb_hub();\n \/\/ translate([0,0,boxHeight + 2])\n \/\/ lid();\n}\n\n\/\/display();\n\/\/encoder();\n\/\/lid();\n\/\/display_mount_tabs();\nbox();\n\/\/box(renderPi3=false, renderMcpHifi=false);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1b47d361b97ff95318a1bad4752595d436539f36","subject":"Added (colored) screws at approximate positions","message":"Added (colored) screws at approximate positions\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/ScintillatorBackplates.scad","new_file":"DetectorMockup\/ScintillatorBackplates.scad","new_contents":"\/\/ Scintillator backplate\n\n\/\/ Basic length variables\nCenterSzintillator = [459\/2, 380 - 80 - 172\/2, 0];\nscrewheight = 20;\nscrewradius = 3;\n\n\/\/ Toshiba Szintillator\nSizeToshiba = [236, 172, 20];\ncolor (\"black\", 1) {\n translate(CenterSzintillator+SizeToshiba\/2+[screwradius+2,-20,-SizeToshiba[2]]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator+SizeToshiba\/2+[screwradius+2,-SizeToshiba[1]+20,-13]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeToshiba\/2-[screwradius+2,-20,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeToshiba\/2-[screwradius+2,-SizeToshiba[1]+20,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeToshiba\/2-[-20,-SizeToshiba[1]-screwradius,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeToshiba\/2-[-SizeToshiba[0]+20,-SizeToshiba[1]-screwradius,0]){\n cylinder(h = screwheight , r=3);\n }\n}\ndifference(){\n cube([459, 380, 6]);\n translate(CenterSzintillator-SizeToshiba\/2){\n cube(SizeToshiba);\n }\n}\n\n\/\/ Pingseng Szintillator\nSizePinseng = [200, 200, 20];\ntranslate([500,0,0]){\n color (\"black\", 1) {\n translate(CenterSzintillator+SizePinseng\/2+[screwradius+2,-20,-20]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator+SizePinseng\/2+[screwradius+2,-SizePinseng[1]+20,-SizePinseng[2]]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizePinseng\/2-[screwradius+2,-20,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizePinseng\/2-[screwradius+2,-SizePinseng[1]+20,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizePinseng\/2-[-20,-SizePinseng[1]-screwradius,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizePinseng\/2-[-SizePinseng[0]+20,-SizePinseng[1]-screwradius,0]){\n cylinder(h = screwheight , r=3);\n }\n }\n difference(){\n cube([459, 380, 6]);\n translate(CenterSzintillator-SizePinseng\/2){\n cube(SizePinseng);\n }\n }\n}\n\n\/\/ Applied Scintillation Technologies Szintillator\nSizeAppScinTech = [106, 106, 20];\ntranslate([1000,0,0]){\n color (\"black\", 1) {\n translate(CenterSzintillator+SizeAppScinTech\/2+[screwradius+2,-20,-20]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator+SizeAppScinTech\/2+[screwradius+2,-SizeAppScinTech[1]+20,-SizeAppScinTech[2]]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeAppScinTech\/2-[screwradius+2,-20,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeAppScinTech\/2-[screwradius+2,-SizeAppScinTech[1]+20,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeAppScinTech\/2-[-20,-SizeAppScinTech[1]-screwradius,0]){\n cylinder(h = screwheight , r=3);\n }\n translate(CenterSzintillator-SizeAppScinTech\/2-[-SizeAppScinTech[0]+20,-SizeAppScinTech[1]-screwradius, 0]){\n cylinder(h = screwheight , r=3);\n }\n }\n difference(){\n cube([459, 380, 6]);\n translate(CenterSzintillator-SizeAppScinTech\/2){\n cube(SizeAppScinTech);\n }\n }\n}\n","old_contents":"\/\/ Scintillator backplate\n\n\/\/ Basic length variables\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\nCenterSzintillator = [459\/2, 380 - 80 - 172\/2, 0];\n\n\/\/ Toshiba Szintillator\nSizeToshiba = [236, 172, 100];\ndifference(){\n\tcube([459, 380, 6]);\n\ttranslate(CenterSzintillator-SizeToshiba\/2){\n\t\tcube(SizeToshiba);\n\t}\n}\n\n\/\/ Pingseng Szintillator\nSizePinseng = [200, 200, 100];\ntranslate([500,0,0]){\n\tdifference(){\n\t\tcube([459, 380, 6]);\n\t\ttranslate(CenterSzintillator-SizePinseng\/2){\n\t\t\tcube(SizePinseng);\n\t\t}\n\t}\n}\n\n\/\/ Applied Scintillation Technologies Szintillator\nSizeAppScinTech = [106, 106, 100];\ntranslate([1000,0,0]){\n\tdifference(){\n\t\tcube([459, 380, 6]);\n\t\ttranslate(CenterSzintillator-SizeAppScinTech\/2){\n\t\t\tcube(SizeAppScinTech);\n\t\t}\n\t}\n}","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"f16d29bc9d5eb83d0435b40c85646b980b5f8acb","subject":"transforms\/orient: fix roll","message":"transforms\/orient: fix roll\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"use \n\n\/\/ translate children\nmodule linup(arr=undef)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef, axis=[0,0,1])\n{\n if($children>0)\n {\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule orient(axis=[0,0,1], axis_ref=[0,0,1], roll=0)\n{\n rotate(axis_ref==undef?0:_orient_angles(axis_ref))\n rotate(axis==undef?0:roll*axis)\n rotate(axis==undef?0:_orient_angles(axis))\n children();\n}\n\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=[0,0,0], align=[0,0,0], extra_align=[0,0,0], orient=[0,0,1], orient_ref=[0,0,1], roll=0)\n{\n t = orient==undef?[0,0,0]:_orient_t(orient, align, size);\n \/*t_ = orient_ref==undef?[0,0,0]:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==undef||extra_size==undef)?[0,0,0]:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\n","old_contents":"use \n\n\/\/ translate children\nmodule linup(arr=undef)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef, axis=[0,0,1])\n{\n if($children>0)\n {\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule orient(axis=[0,0,1], axis_ref=[0,0,1], roll=0)\n{\n rotate(axis_ref==undef?0:_orient_angles(axis_ref))\n rotate(axis==undef?0:_orient_angles(axis))\n rotate(axis==undef?0:roll*axis)\n children();\n}\n\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=[0,0,0], align=[0,0,0], extra_align=[0,0,0], orient=[0,0,1], orient_ref=[0,0,1], roll=0)\n{\n t = orient==undef?[0,0,0]:_orient_t(orient, align, size);\n \/*t_ = orient_ref==undef?[0,0,0]:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==undef||extra_size==undef)?[0,0,0]:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"245431892f538127ae02b37c7242dcd1b610cee5","subject":"Position Microswitches correctly in main model","message":"Position Microswitches correctly in main model\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-45, 16, 8],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[45, 16, 8],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false, Shell=true ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies\" ) {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\t\t\t\t\tfor (i=[0,1])\n\t\t\t\t\ttranslate([0, 0, -8])\n\t\t\t\t\tmirror([0,i,0])\n\t\t\t\t\t{\n\t\t\t\t\t\tBumper_STL();\n\t\n\t\t\t\t\t\tfor(i=[0,1])\n\t\t\t\t\t\tmirror([i, 0, 0])\n\t\t\t\t\t\trotate([0, 0, 43.5])\n\t\t\t\t\t\ttranslate([-10, BaseDiameter\/2 - 21, 0])\n\t\t\t\t\t\ttranslate([dw + .5\/2, 11.5, 0])\n\t\t\t\t\t\ttranslate([9.6, 1.25, 2])\n\t\t\t\t\t\t\tMicroSwitch();\n\t\t\t\t\t}\n }\n\n step(3, \"Push the two motor drivers onto the mounting posts\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \/\/ Left Motor Driver\n attach(LogoBot_Con_LeftMotorDriver, ULN2003DriverBoard_Con_UpperLeft, ExplodeSpacing=20)\n ULN2003DriverBoard();\n\n \/\/ Right Motor Driver\n attach(LogoBot_Con_RightMotorDriver, ULN2003DriverBoard_Con_UpperRight, ExplodeSpacing=20)\n ULN2003DriverBoard();\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=6, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=10, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ Power Switch\n step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ LED\n step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ Piezo\n step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n step(10, \"Push the caster assembly into the base so that it snaps into place\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n }\n\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n \/\/ TODO: wrap into a PenLift sub-assembly\n step(11, \"Fit the pen lift assembly\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n MicroServo();\n }\n }\n\n\n \/\/ Shell + fixings\n\t\t\tif (Shell) {\n\t\t\t\tstep(PenLift ? 12 : 11,\n\t\t\t\t\t\"Push the shell down onto the base and twist to lock into place\") {\n\t\t\t\t\tview(t=[11,-23,65], r=[66,0,217], d=1171);\n\n\t\t\t\t\tattach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t\t\t\t\t\tBasicShell_STL();\n\t\t\t\t}\n }\n }\n\n\t}\n}\n","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-45, 16, 8],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[45, 16, 8],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false, Shell=true ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies\" ) {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\t\t\t\t\tfor (i=[0,1])\n\t\t\t\t\ttranslate([0, 0, -8])\n\t\t\t\t\tmirror([0,i,0])\n\t\t\t\t\t{\n\t\t\t\t\t\tBumper_STL();\n\t\n\t\t\t\t\t\tfor(i=[0,1])\n\t\t\t\t\t\tmirror([i, 0, 0])\n\t\t\t\t\t\trotate([0, 0, 43.5])\n\t\t\t\t\t\ttranslate([-10, BaseDiameter\/2 - 16, 0])\n\t\t\t\t\t\ttranslate([dw + .5\/2, 10, 0])\n\t\t\t\t\t\ttranslate([9.6, 1.25, 2])\n\t\t\t\t\t\t\tMicroSwitch();\n\t\t\t\t\t}\n }\n\n step(3, \"Push the two motor drivers onto the mounting posts\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \/\/ Left Motor Driver\n attach(LogoBot_Con_LeftMotorDriver, ULN2003DriverBoard_Con_UpperLeft, ExplodeSpacing=20)\n ULN2003DriverBoard();\n\n \/\/ Right Motor Driver\n attach(LogoBot_Con_RightMotorDriver, ULN2003DriverBoard_Con_UpperRight, ExplodeSpacing=20)\n ULN2003DriverBoard();\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=6, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=10, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ Power Switch\n step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ LED\n step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ Piezo\n step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n step(10, \"Push the caster assembly into the base so that it snaps into place\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n }\n\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n \/\/ TODO: wrap into a PenLift sub-assembly\n step(11, \"Fit the pen lift assembly\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n MicroServo();\n }\n }\n\n\n \/\/ Shell + fixings\n\t\t\tif (Shell) {\n\t\t\t\tstep(PenLift ? 12 : 11,\n\t\t\t\t\t\"Push the shell down onto the base and twist to lock into place\") {\n\t\t\t\t\tview(t=[11,-23,65], r=[66,0,217], d=1171);\n\n\t\t\t\t\tattach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t\t\t\t\t\tBasicShell_STL();\n\t\t\t\t}\n }\n }\n\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1f99347f397c17cd6497aa48e5b27a3920967435","subject":"added way more space for rod - it should not touch internal walls for the handle, in general","message":"added way more space for rod - it should not touch internal walls for the handle, in general\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/kite_handle_bar.scad","new_file":"kite_roller\/kite_handle_bar.scad","new_contents":"eps = 0.01;\nd_rod = 8+2*1; \/\/ need a lot of space, for a smooth move\nd_hand = 20;\nh_hand = 110;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule bearing_mount()\n{\n $fn=90;\n wall = 5;\n d_ext = 22+2*wall;\n\n \/\/ bottom bearing hold\n difference()\n {\n cylinder(d=d_ext, h=7);\n translate([0,0,-eps])\n cylinder(d=22+0.5, h=7+2*eps, $fn=180);\n }\n %bearing();\n\n \/\/ connecting element\n translate([0, 0, 7])\n difference()\n {\n cylinder(d1=d_ext, d2=d_hand, h=(d_ext-d_hand)\/2);\n cylinder(d1=d_ext-2*wall+0.5, d2=d_rod, h=(d_ext-d_hand)\/2);\n }\n}\n\n\nmodule handle()\n{\n h_bm = 13;\n \/\/ bottom bearing mount\n bearing_mount();\n translate([0, 0, h_bm])\n {\n \/\/ center rod\n difference()\n {\n cylinder(d=d_hand, h=h_hand, $fn=100);\n cylinder(d=d_rod, h=h_hand, $fn=100);\n }\n \/\/ top bearing mount\n translate([0, 0, h_hand])\n translate([0, 0, h_bm])\n mirror([0,0,1])\n bearing_mount();\n }\n}\n\n\nfor(i=[0:1])\n translate(i*[35,0,0])\n handle();\n","old_contents":"eps = 0.01;\nd_rod = 8+0.5;\nd_hand = 20;\nh_hand = 110;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule bearing_mount()\n{\n $fn=90;\n wall = 5;\n d_ext = 22+2*wall;\n\n \/\/ bottom bearing hold\n difference()\n {\n cylinder(d=d_ext, h=7);\n translate([0,0,-eps])\n cylinder(d=22+0.5, h=7+2*eps, $fn=180);\n }\n %bearing();\n\n \/\/ connecting element\n translate([0, 0, 7])\n difference()\n {\n cylinder(d1=d_ext, d2=d_hand, h=(d_ext-d_hand)\/2);\n cylinder(d1=d_ext-2*wall+0.5, d2=d_rod, h=(d_ext-d_hand)\/2);\n }\n}\n\n\nmodule handle()\n{\n h_bm = 13;\n \/\/ bottom bearing mount\n bearing_mount();\n translate([0, 0, h_bm])\n {\n \/\/ center rod\n difference()\n {\n cylinder(d=d_hand, h=h_hand, $fn=100);\n cylinder(d=d_rod, h=h_hand, $fn=100);\n }\n \/\/ top bearing mount\n translate([0, 0, h_hand])\n translate([0, 0, h_bm])\n mirror([0,0,1])\n bearing_mount();\n }\n}\n\n\nfor(i=[0:1])\n translate(i*[35,0,0])\n handle();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"44f25243de0334cd6853acf4c718a77599543275","subject":"Set milling_bit size for CNC machines, (only on finger joints at the moment","message":"Set milling_bit size for CNC machines, (only on finger joints at the moment\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,thickness,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + kerfSize + bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([-bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,thickness,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + kerfSize + bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n translate([-bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=4,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=4,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"11294996d38508625d1a134ea536a2d838912e76","subject":"adjust the layout","message":"adjust the layout\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius)\n{\n xTranslate = 30; \/\/ 29.9\n yTranslate = 32.7; \/\/ 32.6\n zTranslate = minkowskiSphereRadius + 0; \/\/ 0.13;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \/\/ 212\n roundedRectangularArc(angle = 150,\n\n\/\/TODO: fix\/remove the height adjustment\nheight = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = 36, \/\/ 36\n radiusExtension = 1.5); \/\/ 1.3\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius)\n{\n zTranslate = minkowskiSphereRadius + 0; \/\/ 0.13;\n color(\"pink\")\n translate([28.2, 31.2, zTranslate])\n rotate([0, 0, 211])\n roundedRectangularArc(angle = 156,\n\n\/\/TODO: fix\/remove the height adjustment\nheight = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = 34.89,\n radiusExtension = 0.8);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e8dc981eaf489e688389556dcf9db1cce38be4a4","subject":"transforms: add position module","message":"transforms: add position module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"462b656c22e45e5f1a4002f2209c0f1f87dc6e62","subject":"x\/carriage: increase width\/bearing dist","message":"x\/carriage: increase width\/bearing dist\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+5,0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/2;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"accc708ce629d3ed03d6730dfb8bc246f5d48702","subject":"right number of cuts in flat view","message":"right number of cuts in flat view\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/flat.scad","new_file":"resin\/tank\/flat.scad","new_contents":"include ;\n\noffset = 12;\ndist = (wall_height + offset) \/ 2;\n\ntranslate([0,0,wall_thickness\/2]) {\n translate([0,-dist,0])\n sideA();\n translate([0,-dist - wall_height - offset])\n sideA();\n translate([0, dist,0])\n sideB();\n translate([0, dist + wall_height + offset,0])\n sideB();\n}\n\n\/\/cube([12 * inch, 25 * inch, 1], center = true);","old_contents":"include ;\n\ndist = 20;\n\ntranslate([0,0,wall_thickness\/2]) {\n translate([0,-dist,0])\n sideA();\n translate([0, dist,0])\n sideB();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f9634baebed4c8815b1b9c436de35bd52903bd88","subject":"rodclamps: make tighter\/clamp more","message":"rodclamps: make tighter\/clamp more\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n union()\n {\n \/\/ cylinder around rod\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n base_cut = -rod_d\/2 + clamp_tolerance;\n union()\n {\n \/\/ cylinder around rod\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n translate([base_cut,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([base_cut,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","old_contents":"include \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n \/\/ cylinder around rod\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n union()\n {\n \/\/ cylinder around rod\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n translate([-rod_d\/2,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([-rod_d\/2,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"12a8cf0891731c51f5d155bf2fe58573d47da43e","subject":"box + bruses","message":"box + bruses\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/junction_box.scad","new_file":"led_controler_junction_box\/junction_box.scad","new_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [70, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n #translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw drivers\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center, wall+30, wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-2);\n #translate([12\/2\/2*(dx-1), -10\/2, 0])\n cube([12\/2, 10, int_size[2]-2]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-2-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[0]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","old_contents":"use \n\nmodule junction_box()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [70, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n #translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw drivers\n dist_from_center = 59\/2;\n translate([-20, 0, 0]) \n for(dx = [-dist_from_center, +dist_from_center])\n {\n translate([(int_size[0]+2*wall)\/2+dx, wall+30, wall])\n difference()\n {\n cylinder(r=9\/2, h=int_size[2]-2);\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n #hull()\n {\n cube([9, 6, 3]);\n }\n }\n \n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cad6ea04c63edcf544f772558b9566c6dcef84f0","subject":"added the genericScaledPlanet to explain the argument mapping","message":"added the genericScaledPlanet to explain the argument mapping","repos":"htho\/scadlib","old_file":"lib\/testlib\/planets.scad","new_file":"lib\/testlib\/planets.scad","new_contents":"\/** This file defines all the entities needed to create a solar system.\n *\n * @filename planets.scad\n *\/\n\n\n\/**\n * The scale of this solarSystem.\n *\/\nglobalScale = 10;\n\n\/**\n * A generic planet.\n *\n * @param distance The distance from the center.\n * @param diameter The diameter of the planet.\n * @show a Planet.\n * @function-dependency r_from_dia Calculate radius from diameter.\n *\/\nmodule genericPlanet(distance, diameter){\n translate([distance,0,0]) sphere(r=r_from_dia(diameter));\n}\n\n\/**\n * A generic scaled planet.\n * This planet already is scaled according to global Scale.\n *\n * @param distance The distance from the center.\n * @param diameter The diameter of the planet.\n * @show a Planet.\n * @module-dependency genericPlanet A generic planet.\n *\/\nmodule genericScaledPlanet(distance, diameter){\n genericPlanet(distance*globalScale, diameter*globalScale);\n}\n\n\/**\n * Calculates the radius from the given diameter.\n *\n * @param dia a diameter.\n * @return the radius.\n *\n *\/\nfunction r_from_dia(dia) = dia \/ 2;\n\n\/**\n * The Sun.\n * @module-dependency: genericPlanet\n * @variable-dependency: globalScale\n *\/\nmodule sunPlanet(){\n diameter = 200*globalScale;\n genericPlanet(0,diameter);\n }\n\n\/**\n * The first Planet.\n * @module-dependency: genericPlanet\n * @variable-dependency: globalScale\n *\/\nmodule firstPlanet(){\n diameter = 20*globalScale;\n distanceFromSun = 500*globalScale;\n genericPlanet(distanceFromSun,(diameter));\n }\n\n\/**\n * The second Planet.\n * @module-dependency: genericPlanet\n * @variable-dependency: globalScale\n *\/\nmodule secondPlanet(){\n diameter = 80*globalScale;\n distanceFromSun = 800*globalScale;\n genericPlanet(distanceFromSun,(diameter));\n }\n","old_contents":"\/** This file defines all the entities needed to create a solar system.\n *\n * @filename planets.scad\n *\/\n\n\n\/**\n * The scale of this solarSystem.\n *\/\nglobalScale = 10;\n\n\/**\n * A generic planet.\n *\n * @param distance The distance from the center.\n * @param diameter The diameter of the planet.\n * @show a Planet.\n * @function-dependency r_from_dia Calculate radius from diameter.\n * @variable-dependency globalScale Scale of the solar system.\n *\/\nmodule genericPlanet(distance, diameter){\n translate([distance,0,0]) sphere(r=r_from_dia(diameter));\n}\n\n\/**\n * Calculates the radius from the given diameter.\n *\n * @param dia a diameter.\n * @return the radius.\n *\n *\/\nfunction r_from_dia(dia) = dia \/ 2;\n\n\/**\n * The Sun.\n * @module-dependency: genericPlanet\n * @variable-dependency: globalScale\n *\/\nmodule sunPlanet(){\n diameter = 200*globalScale;\n genericPlanet(0,diameter);\n }\n\n\/**\n * The first Planet.\n * @module-dependency: genericPlanet\n * @variable-dependency: globalScale\n *\/\nmodule firstPlanet(){\n diameter = 20*globalScale;\n distanceFromSun = 500*globalScale;\n genericPlanet(distanceFromSun,(diameter));\n }\n\n\/**\n * The second Planet.\n * @module-dependency: genericPlanet\n * @variable-dependency: globalScale\n *\/\nmodule secondPlanet(){\n diameter = 80*globalScale;\n distanceFromSun = 800*globalScale;\n genericPlanet(distanceFromSun,(diameter));\n }","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3f62054ff7410a912e2428681ea31ae9a6330c06","subject":"Added kerf correction to Finger Joins (as global), Fixed issue with missing last Finger Join tab, and fixed issue with thickness not working correctly in lasercutbox()","message":"Added kerf correction to Finger Joins (as global), Fixed issue with missing last Finger Join tab, and fixed issue with thickness not working correctly in lasercutbox()\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n\t\n\t\/*\n\t\tif(start_up == 1) \n\t\t{\n\t\t\n\t\t\ttranslate([range_min,0,0]) \n\t\t\t{\n\t\t\t\tcube([ (range_max-range_min)\/(fingers*2) + kerf\/4, thickness*2, thickness]);\n\t\t\t\tif(bumps == true)\n\t\t\t\t{\n\t\t\t\t\ttranslate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\n\t\t\ttranslate([(range_max-range_min)\/(fingers*2),0,0]) \n\t\t\t{\n\t\t\t\tcube([ (range_max-range_min)\/(fingers*2)+ kerf\/4, thickness*2, thickness]);\n\t\t\t\tif(bumps == true)\n\t\t\t\t{\n\t\t\t\t\tif (i < (range_max - (range_max-range_min)\/fingers ))\n\t\t\t\t\t{\n\t\t\t\t\t\ttranslate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t*\/\n \/\/ for ( i = [range_min + ((range_max-range_min)\/fingers) : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"23b26d36384074b7da4720acb6ae90e1f2f4a17a","subject":"adjust the width of the shade","message":"adjust the width of the shade\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_contents":"\nbottomOuterRadius = 52;\n\nintersection_xTranslate = -51;\n\nouterRadius = 90;\n\/\/outerRadius = 36;\n\nsquareLength = 59; \/\/28;\n\nxScale = 0.2; \/\/ 0.3;\n\nyScale = 0.7; \/\/ 0.7;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ %import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\nbottomOuterRadius = 52;\n\nintersection_xTranslate = -20;\n\nouterRadius = 90;\n\/\/outerRadius = 36;\n\nsquareLength = 50; \/\/28;\n\nxScale = 0.1; \/\/ 0.3;\n\nyScale = 0.3; \/\/ 0.7;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f84a8a8244e31ec10daea6b77b4f7fcb92c5b0a7","subject":"transforms: refactoring","message":"transforms: refactoring\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"use \n\n\/\/ translate children\nmodule linup(arr=undef)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef, axis=[0,0,1])\n{\n if($children>0)\n {\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n t = _orient_t(orient, align, size);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef)\n{\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate([ dist*i, 0, 0 ]) children(i);\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6744e2196107db91339157e16a4e1fa8211c14fd","subject":"splitted frontal part of rally chassis","message":"splitted frontal part of rally chassis\n","repos":"dviejo\/freeSlotTrackDesigner","old_file":"chasis\/rally.scad","new_file":"chasis\/rally.scad","new_contents":"\/**\n * rally.scad\n * \n * Created by Diego Viejo\n * \n * 11\/Dic\/2015\n * \n * This is my attemp on creating a chassis for a rally slot car\n * \n *\/\n\n\/\/guide arm's holder\n\/\/work in progress: checking all sizes is still needed\nnumSlots = 1;\nguideWidth = 32;\nguideInternalWidth = 21.5;\nguideHeight = 7;\nguideHoleHeight = 2.5;\nguideSupportLength = 7;\nguideLength = 32; \/\/guideSupportLength + numSlots*4- 2;\nengineHolderHoleSep = 20;\n\n\/\/front axle\naxleLength = 27;\nbearingDiam = 5;\naxleHeight = 6.75;\n\n\nmodule guide(chassisLink=1)\ndifference()\n{\n union()\n {\n cube([guideWidth, guideLength, guideHeight], center=true);\n translate([0, -guideLength\/2 + axleLength, 0]) hull()\n {\n cube([guideWidth, bearingDiam*2.5, guideHeight], center = true);\n translate([0, 0, axleHeight+1]) cube([guideWidth, bearingDiam*1.85, 2], center=true);\n }\n }\n \n \/\/main holes\n translate([0, guideSupportLength-1.5, 0]) cube([guideInternalWidth, guideLength, guideHeight*2], center=true);\n translate([0, 0, 3.25]) cube([guideInternalWidth, guideLength+2, guideHeight], center=true);\n translate([0, -(guideLength-6)\/2-0.25, 3.25]) cube([25, 6, guideHeight], center=true);\n translate([0, guideSupportLength+6, 0]) cube([guideWidth - 2*2.5, guideLength, guideHeight*3], center=true);\n \n for(i=[1:numSlots])\n {\n translate([-guideWidth\/2-1, -guideLength\/2 + guideSupportLength +i*4-4, -guideHeight\/2+guideHoleHeight])\n rotate([0, 90, 0]) cylinder(d=2, h=guideWidth+2);\n }\n \n if(chassisLink==1)\n for(i=[-1,1])\n {\n translate([i*engineHolderHoleSep\/2, (guideSupportLength-guideLength)\/2-0.75, -guideHeight\/2-1+guideHeight\/4+1.5+0.3]) cylinder(d=2.5, h=guideHeight\/2+2);\n translate([i*engineHolderHoleSep\/2, (guideSupportLength-guideLength)\/2-0.75, -guideHeight\/2-1]) cylinder(d=5, h=guideHeight\/4+1.5);\n }\n \n translate([0, -guideLength\/2 + axleLength, axleHeight-bearingDiam\/2]) \n {\n translate([0, 0, guideHeight\/2]) cube([guideWidth+2, bearingDiam*0.8, guideHeight], center = true);\n translate([0, 0, -0.5]) cube([guideWidth+2, 1.5, guideHeight], center = true);\n rotate([0, 90, 0]) hull()\n {\n cylinder(d=bearingDiam, h=guideWidth+2, center=true, $fn=20);\n translate([-1.75, 0, 0]) cylinder(d=bearingDiam, h=guideWidth+2, center=true, $fn=20);\n }\n }\n}\n\nmodule lateral(side=-1)\ndifference()\n{\n guide();\n translate([side*2.5, 0, 0]) cube([guideWidth, guideLength+6, guideHeight*3], center=true);\n}\n\ntranslate([0, 0, guideHeight\/2])\ndifference()\n{\n guide();\n translate([guideWidth\/2-2.51, -30, -10]) cube([10, 60, 30]);\n translate([-guideWidth\/2-0.005, -30, -10]) cube([2.51, 60, 30]);\n}\n\ntranslate([30, 0, 2.5\/2]) \n rotate([0, 90, 0]) translate([-(guideWidth-2.5)\/2, 0, 0]) lateral();\ntranslate([-30, 0, 2.5\/2]) \n rotate([0, -90, 0]) translate([(guideWidth-2.5)\/2, 0, 0]) lateral(side=1);\n\ndifference()\n{\n translate([-guideWidth\/2, 0, 0]) cube([guideWidth, 6, 2.0]);\n translate([-guideInternalWidth\/2+1.5, 6\/2, -1]) cylinder(d=2, h=4);\n translate([guideInternalWidth\/2-1.5, 6\/2, -1]) cylinder(d=2, h=4);\n}","old_contents":"\/**\n * rally.scad\n * \n * Created by Diego Viejo\n * \n * 11\/Dic\/2015\n * \n * This is my attemp on creating a chassis for a rally slot car\n * \n *\/\n\n\/\/guide arm's holder\n\/\/work in progress: checking all sizes is still needed\nnumSlots = 1;\nguideWidth = 32;\nguideInternalWidth = 21.5;\nguideHeight = 7;\nguideHoleHeight = 2.5;\nguideSupportLength = 7;\nguideLength = 32; \/\/guideSupportLength + numSlots*4- 2;\nengineHolderHoleSep = 20;\n\n\/\/front axle\naxleLength = 27;\nbearingDiam = 5;\naxleHeight = 6.75;\n\n\nmodule guide(chassisLink=1)\ndifference()\n{\n union()\n {\n cube([guideWidth, guideLength, guideHeight], center=true);\n translate([0, -guideLength\/2 + axleLength, 0]) hull()\n {\n cube([guideWidth, bearingDiam*2.5, guideHeight], center = true);\n translate([0, 0, axleHeight+1]) cube([guideWidth, bearingDiam*1.85, 2], center=true);\n }\n }\n \n \/\/main holes\n translate([0, guideSupportLength-1.5, 0]) cube([guideInternalWidth, guideLength, guideHeight*2], center=true);\n translate([0, 0, 3.25]) cube([guideInternalWidth, guideLength+2, guideHeight], center=true);\n translate([0, -(guideLength-6)\/2-0.25, 3.25]) cube([25, 6, guideHeight], center=true);\n translate([0, guideSupportLength+6, 0]) cube([guideWidth - 2*2.5, guideLength, guideHeight*3], center=true);\n \n for(i=[1:numSlots])\n {\n translate([-guideWidth\/2-1, -guideLength\/2 + guideSupportLength +i*4-4, -guideHeight\/2+guideHoleHeight])\n rotate([0, 90, 0]) cylinder(d=2, h=guideWidth+2);\n }\n \n if(chassisLink==1)\n for(i=[-1,1])\n {\n translate([i*engineHolderHoleSep\/2, (guideSupportLength-guideLength)\/2-0.75, -guideHeight\/2-1+guideHeight\/4+1.5+0.3]) cylinder(d=2.5, h=guideHeight\/2+2);\n translate([i*engineHolderHoleSep\/2, (guideSupportLength-guideLength)\/2-0.75, -guideHeight\/2-1]) cylinder(d=5, h=guideHeight\/4+1.5);\n }\n \n translate([0, -guideLength\/2 + axleLength, axleHeight-bearingDiam\/2]) \n {\n translate([0, 0, guideHeight\/2]) cube([guideWidth+2, bearingDiam*0.8, guideHeight], center = true);\n translate([0, 0, -0.5]) cube([guideWidth+2, 1.5, guideHeight], center = true);\n rotate([0, 90, 0]) hull()\n {\n cylinder(d=bearingDiam, h=guideWidth+2, center=true, $fn=20);\n translate([-1.75, 0, 0]) cylinder(d=bearingDiam, h=guideWidth+2, center=true, $fn=20);\n }\n }\n}\n\nguide();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c1f0a0bebb9c57e6d04ca9c2400d8f73be79435e","subject":"Update case lid","message":"Update case lid\n","repos":"DevLoL\/super-mario-count","old_file":"case.scad","new_file":"case.scad","new_contents":"\/\/ Generic case and lid - Improved\n\/\/ http:\/\/www.thingiverse.com\/thing:643264\n\/\/ Printbus, November 2016\n\n\/\/ Originally remixed from dandmpye's Generic case (box and lid) http:\/\/www.thingiverse.com\/thing:28608\n\/\/ Revised dimensioning for improved scalability\n\/\/ Reformatted and labels revised for readability\n\/\/ Added provision for mounting tabs\n\/\/ Rev A incorporates several improvements in the design and with openSCAD utilization\n\/\/ Reduced interdependency between parameters through individual parameters that can be tailored\n\/\/ Box wall thickness, base thickness, mounting tab thickness, lid thickness, lid lip height\n\/\/ Added table of reference data for hardware dimensions\n\/\/ Improved mesh overlap to reduce \"ghosting\" in rendering view \n\/\/ Added informative echo outputs to openSCAD console\n\/\/ Revised path for custom function library\n\/\/ Added sample code for sidewall teardrop and round holes\n\/\/ Added sample code for board mounting standoffs\n\/\/\n\/\/ To keep the design manageable...\n\/\/ The diameter of the lid corner posts is factored from the screw hole in the post\n\/\/ The radius of the box corners is set to match the lid corner posts\n\/\/ The inside edge of the straight portions of lid lip is aligned with center of corner screw holes\n\/\/ This means the lip width will reduce as the box side wall thickness increases\n\/\/\n\/\/ Hint: To minimize infill artifacts on box sidewalls, try to adjust box_wt and slicer number of \n\/\/ solid perimeters so that no sidewall infill is required for your extrusion width\n\n\/\/\/\/\/\/\/\/\/\/ REVISION HISTORY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ YYMMDD date code\n\/\/ 150119 - initial publish\n\/\/ 161104 - revA\n\/\/\n\n\/\/\/\/\/\/\/\/\/\/ INCLUDE AND USE \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ NOTE: openSCAD version 2014.03 or newer required for MCAD library\n\n\/\/ EXTERNAL FUNCTIONS USED\nuse \n\/\/ Get roundCornersCube.scad from http:\/\/www.thingiverse.com\/thing:8812\n\/\/ Revise path location to the custom openSCAD function if not in standard custom library location\n\/\/ roundCornersCube (x,y,z,r) gives cube of size xyz with corner radius r\n\/\/ Note that cube center parameter is fixed at true, and the corner $fn is fixed at 25\n\/\/ MCAD roundedBox is not used - those results seem imperfect and doesn't set corner $fn \nuse \n\/\/ Requires openSCAD MCAD library to be installed (openSCAD 2014.03 or later)\n\/\/ polyhole(h,d) provides improved size control on small holes\n\/\/ cylinder center parameter defaults to false; $fn intentionally varies with size of hole\nuse \n\/\/ Requires openSCAD MCAD library to be installed (openSCAD 2014.03 or later)\n\/\/ teardrop(radius, length, angle) provides a sidewall hole more printable than round hole\n\/\/ Angle parameter of 90 degrees gives teardrop shape; unclear when another value would be used\n\/\/ Consists of a round lobe and a right angle at the teardrop point\n\/\/ radius refers to the radius of the round lobe\n\/\/ $fn on round lobe is forced to 30\n\/\/ length is really the thickness of the teardrop formed in the x-axis\n\/\/ overall size of the teardrop is radius * (1 + 1\/sin(45)), or radius*2.414\n\/\/ For angle=90, round lobe will center at x,y,z=0. Teardrop builds on x-axis for length parameter\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ PARAMETERS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ All dimensions are millimeter\n\/\/ Case parameters for tailoring \nbox_sx = 104; \/\/ box outside size in X axis, not including mounting tabs\nbox_sy = 70; \/\/ box outside size in Y axis\nbox_sz = 27; \/\/ box outside size in Z axis, including the lid thickness\nbox_wt = 2.0; \/\/ box wall thickness (keep less than box_cp_hid)\nbox_bt = 2.0; \/\/ box base or bottom thickness (should be a multiple of printed layer height)\n\n\/\/ Lid parameters for tailoring\nlid_sz = 2.0; \/\/ lid size in Z axis or lid thickness (should be a multiple of printed layer height)\nlip_h = 1.60; \/\/ lid lip height (should be a multiple of layer height)\nfit_tol = 0.40; \/\/ fit tolerance or clearance between box and lid\n\n\/\/ Mounting tab parameters for tailoring\ntab_use = true; \/\/ true or false for mounting tab on x-axis yes\/no\ntab_sz = box_bt; \/\/ tab size in z-axis or height (typically set same as box base thickness)\ntab_sx = 8; \/\/ mounting tab size in x-axis (the amount tab extends from box) \ntab_hoy = 7; \/\/ tab hole offset in y axis from edge of tab\n\n\/\/ Fastener and hardware component hole sizing\n\/*==================================================== \nStandard hardware dimension reference data\nThese are a reference point only; adjustment may be necessary due to nozzle size, etc.\nAlso note that MCAD polyhole does better at actual diameters than circle\/cylinder\n\nSIZE THREAD CLEAR NUT AFD NUT OD NUT HEAD HEAD WASHER FLAT \n HOLE HOLE WRENCH @fn=6 HEIGHT OD HEIGHT HEIGHT OD \n----------- ------ ------ ------- ------- ------ ------ ------ ------ ----- \nM2 x 0.4 1.75mm 2.20mm 4.0mm 4.62mm 1.6mm 4.0mm 2.0mm 0.3mm 5.5mm\nM2.5 x 0.45 2.20mm 2.75mm 5.0mm 5.77mm 2.0mm 5.0mm 2.5mm 0.3mm 6.0mm\nM3 x 0.5 2.70mm 3.30mm 5.5mm 6.35mm 2.4mm 6.0mm 3.0mm 0.5mm 7.0mm \nM4 x 0.7 3.50mm 4.40mm 7.0mm 8.08mm 3.2mm 8.0mm 4.0mm 0.8mm 9.0mm\nM5 x 0.8 4.50mm 5.50mm 8.0mm 9.24mm 4.7mm 10.0mm 5.0mm 1.0mm 10.0mm\nM6 x 1.0 5.50mm 6.60mm 10.0mm 11.55mm 5.2mm 12.0mm 6.0mm 1.6mm 12.0mm\nM8 x 1.25 7.20mm 8.80mm 13.0mm 15.01mm 6.8mm 16.0mm 8.0mm 2.0mm 17.0mm\n#2-56 1.85mm 2.44mm 4.76mm 5.50mm 1.59mm 4.60mm 2.18mm 0.91mm 6.35mm\n#3-56 2.26mm 2.79mm 4.76mm 5.50mm 1.59mm 5.28mm 2.51mm 0.91mm 7.94mm\n#4-40 2.44mm 3.26mm 6.35mm 7.33mm 2.38mm 5.97mm 2.85mm 1.14mm 9.53mm\n#6-32 2.95mm 3.80mm 7.94mm 9.17mm 2.78mm 7.37mm 3.51mm 1.14mm 11.11mm\n#8-32 3.66mm 4.50mm 8.73mm 10.08mm 3.18mm 8.74mm 4.17mm 1.14mm 12.7mm\n#10-24 4.09mm 5.11mm 9.53mm 11.00mm 3.18mm 10.13mm 4.83mm 1.14mm 14.29mm\n#10-32 4.31mm 5.11mm 9.53mm 11.00mm 3.18mm 10.13mm 4.83mm 1.14mm 14.29mm\n1\/4-20 5.56MM 6.76MM 11.11mm 12.83mm 4.76mm 13.03mm 6.35mm 1.80mm 18.65\nNotes: 1,2 2,3 4 5 6 7,8 8,9 8,10 8,11\n----------------------------------------------------------------------------------------\nNote 1: Thread hole is for tap or self thread of machine screw in soft material\nNote 2: Hole dimensions are from littlemachineshop.com Tap Drill - 50% Thread column data\nNote 3: Clearance hole data is littlemachineshop.com Clearance Drill - Standard Fit column data\nNote 4: Nut Across Flat Diameter (AFD) metric data is ISO, inch is boltdepot.com US Nut Size table\nNote 5: Nut round OD is the openSCAD circle diameter required to achieve a nut size at $fn=6 \n Nut OD is calculated as = (NUT AFD)\/cos(30)\nNote 6: Nut height is for standard hex nut; jam nuts are less, lock nuts are more\n Metric data is ISO 4032, SAE data from boltdepot.com US Nut Size tables\nNote 7: Head diameter varies with the head style; value shown is max across all except truss head\nNote 8: Data from http:\/\/www.numberfactory.com\/nf_metric.html or http:\/\/www.numberfactory.com\/nf_inch.html \nNote 9: Head height varies with head style; value shown is max across all styles\nNote 10: Standard washer height or thickness\nNote 11: Flat washer outer diameter\n****************************************************************************************\/\n\/\/ Tailor fastener sizing and fit adjustments here\n\/\/ All screw holes are implemented with MCAD polyhole - more accurate than hole by cylinder\n\/\/ Dimensions shown were determined with Simplify3D as slicer, inside perimeters printed first\n\/\/ Tolerance added to nominal corrects for extrusion width and other printer variations\n\n\/\/ Box and lid screw hole parameters for tailoring\nbox_cp_hid = 2.44 + 0.1; \/\/ corner post hole inside diameter for screw threading (2.44 nominal for #4)\nbox_cp_hd = 10.0; \/\/ corner post hole depth must be less than (box_sz - lid_sz)\nlid_hid = 3.26 + 0.1; \/\/ lid screw clearance hole inside diameter (3.26 nominal for #4) \nlid_rid = 6.0 + 0.1; \/\/ lid screw head recess inside diameter (6.0 nominal for #4)\nlid_rd = 0.0; \/\/ depth of lid head recess (lid_sz must be able to accomodate the recess)\ntab_hid = 3.26 +0.1; \/\/ inside diameter of the mounting tab clearance holes (3.26 nominal for #4)\n\n\/\/\/\/\/\/\/\/\/\/ NON-USER PARAMETERS AND CALCULATIONS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Parameters beyond this point are normally not altered in basic tailoring\n\/\/ Modify at your own risk\n\n\/\/ Geometry mesh factors \nMF = 0.01; \/\/ Mesh Factor is the amount of overlap on geometries for proper mesh\nMSA = MF; \/\/ Mesh Single Adjustment factor (translate ends; size adjustment on single ended mesh)\nMDA = 2*MF; \/\/ Mesh Double Adjustment (size adjustment on double ended mesh like boring holes)\n\n\/\/ calculated parameters \nbox_cp_od = box_cp_hid * 3 ; \/\/ set outer diameter of the corner standoff post to 3*hole diameter\nbox_cp_or = box_cp_od \/ 2 ; \/\/ outer radius of the corner standoff post\nlip_w = box_cp_or - box_wt - fit_tol; \/\/ lid lip width set so inside of lip aligns lid hole centers\nlip_arc_or = box_cp_od - box_wt; \/\/ outside radius of the corner arc on the lid lip\nlip_arc_od = 2 * lip_arc_or; \/\/ outside diameter of the corner arc on the lid lip\nbox_r = (3 * box_cp_hid) \/ 2; \/\/ radius of the box corners automatically based on screw size\n\n\/\/ Define matrix of lid hole locations\n\/\/ Matrix starts with hole closest to x,y=0 and goes CCW around box\nlid_hole_centers = [[ box_cp_or , box_cp_or , 0 ], \n\t\t\t\t\t[ box_sx - box_cp_or , box_cp_or , 0 ],\n\t\t\t\t\t[ box_sx - box_cp_or , box_sy - box_cp_or , 0 ], \n\t\t\t\t\t[ box_cp_or , box_sy - box_cp_or , 0 ]];\n\n\/\/ Define matrix of mounting tab hole locations\n\/\/ Matrix starts with hold closest to x,y=0 and goes CCW around box\ntab_hole_centers = [[ -tab_sx\/2 , tab_hoy , 0 ],\n [ box_sx + tab_sx\/2 , tab_hoy , 0 ],\n [ box_sx + tab_sx\/2 , box_sy - tab_hoy , 0 ],\n [ -tab_sx\/2 , box_sy - tab_hoy , 0 ]];\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Top level geometry\n\/\/ Edit true or false for obtaining box and lid respectively\ndifference() {\n rounded_cube_case(generate_box=true, generate_lid=true);\n}\n\n\/\/----------------------------------------------------------\nmodule standoff( post_od , post_id , post_h , hole_depth) {\n \/\/ Generates a standoff for mounting lid or circuit board\n \/\/ post_od: outer diamter of the standoff post\n \/\/ post_id: diameter of the inner hole in the standoff post\n \/\/ post_h: height of the standoff post\n \/\/ hole_depth: depth of the inner hole in the standoff post\n difference() {\n \/\/ start with a solid post\n \/\/ set $fn=25 to match what roundCornersCube does\n cylinder( d = post_od , h = post_h , center = false, $fn = 25); \n \n \/\/ remove the hole for the screw\n translate([ 0, 0, post_h - hole_depth ])\n polyhole( hole_depth + MSA, post_id ); \n } \/\/ end difference\n} \/\/ end module standoff\n\n\/\/----------------------------------------------------------\nmodule cylindrical_lip( l_od , l_h , l_w ) {\t\n \/\/ Generate a quarter circle arc for use as a lip\n \/\/ l_od: outer diameter of the lip arc\n \/\/ l_h: height of the lip arc\n \/\/ l_w: width of the lip arc\n l_r = l_od \/ 2; \/\/ calculate radius of the lip arc\n difference() {\n \/\/ start with a solid cylinder\n cylinder( r = l_r, h = l_h, center=false, $fs=0.01);\n \n \/\/ hollow it out to form a ring\n translate([ 0, 0, -MSA ]) \/\/ -MSA to offset oversized cylinder being removed\n cylinder( r = l_r - l_w, h = l_h + MDA, center=false, $fs=0.01 ); \/\/ +MDA on h to ensure removal\n \n \/\/ remove all but a quarter of the ring\n translate([ -l_r, 0, -MSA ]) \/\/ -MSA to offset oversized cube being removed\n cube([ l_od + MSA , l_r, l_h + MDA ]); \/\/ oversize by +MSA or +MDA to ensure complete removal \n translate([ 0, -l_r, -MSA ]) \/\/ -MSA to offset oversized cube being removed\n cube([ l_od + MSA, l_r + MSA, l_h + MDA ]);\/\/ oversize by +MSA or +MDA to ensure complete removal\n \n } \/\/ end difference\n} \/\/ end module cylindrical_lip\n\n\/\/----------------------------------------------------------\nmodule rounded_cube_case (generate_box, generate_lid) {\n \/\/ generate_box: true or false flag\n \/\/ generate_lid: true or false flag\n\n \/\/ Design rendering of box starts at x=0, y=0, z=0 \n \/\/ When present, mounting tabs are always added as extensions on X axis\n \/\/ left-right-forward-rear references are with respect to axis in default view (+x to right, +y to rear)\n \/\/ If both box and lid are being generated, lid will be offset in Y to place it rearward of box\n\n if (generate_box == true) { \/\/ we need to create the box part\n echo(str(\"Box outer size is x:\",box_sx,\"mm, y:\",box_sy,\"mm, z:\",box_sz,\"mm (with lid)\"));\n echo(str(\"Available clearance between corner posts is x:\",box_sx - 2*box_cp_od,\"mm, y:\",box_sy - 2*box_cp_od));\n echo(str(\"Available height inside closed box is \",box_sz - box_bt - lid_sz,\"mm\"));\n \n union() {\n difference() {\n union() {\n \/\/ Start with a solid cube with rounded corners\n \/\/ Z-axis height of box is reduced by lid thickness\n translate([ box_sx\/2, box_sy\/2, (box_sz - lid_sz)\/2 ])\n roundCornersCube( box_sx, box_sy, box_sz - lid_sz, box_r );\n \/\/ Extend base for the mounting tabs if present\n if ( tab_use == true ) {\n echo(str(\"Mounting tabs of \",tab_sx,\"mm increase x-axis size to \",box_sx + 2*tab_sx,\"mm\"));\n echo(str(\"Tab mounting hole spacing is x:\",box_sx+tab_sx,\"mm, y:\",box_sy-2*tab_hoy,\"mm\"));\n difference () {\n \/\/ start with the plate for the mounting tabs\n translate ([ box_sx\/2, box_sy\/2, tab_sz\/2 ])\n roundCornersCube ( box_sx + (tab_sx*2), box_sy, tab_sz - MSA, box_r );\n\n \/\/ now remove the mounting holes in the mounting tabs\n for(j = tab_hole_centers) { \/\/ for each hole in the mounting tab\n translate([ 0, 0, -MSA ]) \/\/ shift Z to ensure complete removal of hole\n translate(j)\n polyhole ( tab_sz + MDA, tab_hid ); \/\/ oversize height to ensure complete removal\n } \/\/ end for loop on mounting tab holes\n } \/\/ end difference\n } \/\/ end if tab_use\n } \/\/ end union\n \n \/\/ Hollow out the box volume, leaving box_bt at bottom and box_wt at sides\n translate([ box_sx\/2, box_sy\/2, (box_sz - lid_sz)\/2 + box_bt ]) \n roundCornersCube( box_sx - (box_wt*2), box_sy - (box_wt*2), box_sz, box_r - box_wt); \n\n \/\/ Define any holes in the box walls here\n \/\/ Sample teardrop holes with bottom of round lobe at floor of box - uncomment and tailor as desired\n\n \/\/ hole for USB power plug\n translate([ -MDA, box_sy\/2 - 5, 9 + box_bt ]) \/\/ left sidewall\n cube([box_bt + 2 * MDA, 11, 6]);\n \n\/\/*\/ \n\n \/\/ Sample round holes centered on available wall height - uncomment and tailor as desired\n\/*\n hole_r = 2;\n translate([ box_sx*2\/3, box_wt\/2, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ forward sidewall\n rotate([90, 0, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n translate([ box_sx - box_wt\/2, box_sy*2\/3, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ right sidewall\n rotate([0, 90, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n translate([ box_sx*2\/3, box_sy - box_wt\/2, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ forward sidewall\n rotate([90, 0, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n translate([ box_wt\/2, box_sy*2\/3, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ left sidewall\n rotate([0, 90, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n\/\/*\/\n\n } \/\/ end difference\n\t\t\t\n \/\/ Add the corner standoff posts for the lid screws \n for(i = lid_hole_centers) {\n translate([ 0, 0, box_bt - MSA ]) \/\/ raise up to the inside of the box\n translate(i) \/\/ locate a corner\n standoff( box_cp_od, box_cp_hid, box_sz - box_bt - lid_sz + MSA, box_cp_hd );\n } \/\/ end for loop on standoff posts\n\n \/\/ Add any mounting standoff posts on the box bottom here\n \/\/ Sample mounting posts for small board centered in box - uncomment and tailor as desired\n\n bd_hsp_x = 91; \/\/ board hole spacing in x axis\n bd_hsp_y = 45; \/\/ board hole spacing in y axis\n bd_post_od = 6; \/\/ diameter of the board mounting post\n bd_post_id = 2.7; \/\/ hole diameter in the mounting post (2.7 for threading M3)\n bd_post_h = 4; \/\/ height of the board mounting posts\n echo(str(\"Available height above board posts is \",box_sz - box_bt - lid_sz - bd_post_h,\"mm\"));\n translate([ box_sx\/2 - bd_hsp_x\/2, box_sy\/2 - bd_hsp_y\/2, box_wt - MSA ]) \/\/ forward left corner\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n translate([ box_sx\/2 + bd_hsp_x\/2, box_sy\/2 - bd_hsp_y\/2, box_wt - MSA ]) \/\/ forward right\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n translate([ box_sx\/2 + bd_hsp_x\/2, box_sy\/2 + bd_hsp_y\/2, box_wt - MSA ]) \/\/ right rear\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n translate([ box_sx\/2 - bd_hsp_x\/2, box_sy\/2 + bd_hsp_y\/2, box_wt - MSA ]) \/\/ left rear\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n\/\/*\/ \n } \/\/ End union \n\n } \/\/ end if generate_box\n\n y_offset = generate_box ? box_sy+10 : 0; \/\/ offset lid Y by box_sy+10 if we are also doing box\n if ( generate_lid == true ) { \/\/ we need to create the lid part\n translate([ 0, y_offset, 0]) { \n difference() {\n \/\/ create the base solids for the lid\n union() {\n \/\/ Start with a solid plate with rounded corners to match the box part\n translate([ box_sx\/2, box_sy\/2, lid_sz\/2 ])\n roundCornersCube( box_sx, box_sy, lid_sz, box_r );\n \n \/\/ Add a reinforcement lip to the lid, starting with the straight portions \n \/\/ increase lip width by MSA to ensure mesh with quarter circle lip added below\n translate([ box_cp_od + fit_tol, box_wt + fit_tol, lid_sz ]) \n cube([box_sx - (box_cp_od*2) - (fit_tol*2), lip_w + MSA, lip_h ]); \n translate([box_wt + fit_tol, box_cp_od + fit_tol, lid_sz]) \n cube([ lip_w + MSA, box_sy - (box_cp_od*2) - (fit_tol*2), lip_h ]);\n translate([box_sx - box_cp_or - fit_tol, box_cp_od + fit_tol, lid_sz ]) \n cube([lip_w + MSA, box_sy - (box_cp_od*2) - (fit_tol*2), lip_h ]);\t\n translate([box_cp_od + fit_tol, box_sy - box_cp_or - fit_tol, lid_sz]) \n cube([box_sx - (box_cp_od*2) - (fit_tol*2), lip_w + MSA, lip_h]);\n\t\t\t\t\t\n \/\/ Fit a quarter circle lip around the corner mounting posts\n translate([ 0, 0, lid_sz]) \n translate( lid_hole_centers[0] ) \n rotate(180) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n translate([ 0, 0, lid_sz ])\n translate( lid_hole_centers [1] )\n rotate(270) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n translate([ 0, 0, lid_sz ])\n translate( lid_hole_centers [2] ) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n translate([ 0, 0, lid_sz ])\n translate( lid_hole_centers [3] )\n rotate(90) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n } \/\/ end union of the base solids for the lid\n\n for (i = lid_hole_centers) { \/\/ for each corner in the lid\n \/\/ remove the material for the corner screw hole \n translate([ 0, 0, -MSA ]) \/\/ shift Z to ensure complete removal of hole\n translate(i) \n polyhole( lid_sz + MDA, lid_hid ); \/\/ height is +MDA to ensure complete removal\n if ( lid_rd > 0 ) { \/\/ we need to countersink the screw head\n \/\/ remove the material for the screw head recess \n translate([ 0, 0, -MSA ]) \/\/ -MSA to offset oversize hole being removed\n translate(i) \n polyhole( lid_rd + MSA, lid_rid ); \/\/ oversize +MSA to ensure complete removal \n } \/\/ end if lid_rd\n } \/\/ end for loop on lid holes\n\n \/\/ Add removal of any holes in the lid here\n \/\/ Sample square hole centered in lid - uncomment and tailor as desired\n\n \/\/ holes for buttons\n translate([ 20, box_sy*0.3, lid_sz\/2 ])\n cube([ 19, 19, lid_sz + MDA], center=true );\n translate([ 20, box_sy*0.7, lid_sz\/2 ])\n cube([ 19, 19, lid_sz + MDA], center=true );\n\n\n \/\/ hole for display\n translate([ 55, box_sy*0.5, lid_sz\/2 ])\n cube([ 24, 15, lid_sz + MDA], center=true );\n\n\/\/*\/\n } \/\/ end difference for lid\n } \/\/ end translate to move away from box if it is also being made\n } \/\/ end if generate_lid\n \n echo(str(\"Maximum lid screw length is \", box_cp_hd + lid_sz - lid_rd,\"mm\"));\n\n} \/\/ end module rounded_cube_case\n\n\n","old_contents":"\/\/ Generic case and lid - Improved\n\/\/ http:\/\/www.thingiverse.com\/thing:643264\n\/\/ Printbus, November 2016\n\n\/\/ Originally remixed from dandmpye's Generic case (box and lid) http:\/\/www.thingiverse.com\/thing:28608\n\/\/ Revised dimensioning for improved scalability\n\/\/ Reformatted and labels revised for readability\n\/\/ Added provision for mounting tabs\n\/\/ Rev A incorporates several improvements in the design and with openSCAD utilization\n\/\/ Reduced interdependency between parameters through individual parameters that can be tailored\n\/\/ Box wall thickness, base thickness, mounting tab thickness, lid thickness, lid lip height\n\/\/ Added table of reference data for hardware dimensions\n\/\/ Improved mesh overlap to reduce \"ghosting\" in rendering view \n\/\/ Added informative echo outputs to openSCAD console\n\/\/ Revised path for custom function library\n\/\/ Added sample code for sidewall teardrop and round holes\n\/\/ Added sample code for board mounting standoffs\n\/\/\n\/\/ To keep the design manageable...\n\/\/ The diameter of the lid corner posts is factored from the screw hole in the post\n\/\/ The radius of the box corners is set to match the lid corner posts\n\/\/ The inside edge of the straight portions of lid lip is aligned with center of corner screw holes\n\/\/ This means the lip width will reduce as the box side wall thickness increases\n\/\/\n\/\/ Hint: To minimize infill artifacts on box sidewalls, try to adjust box_wt and slicer number of \n\/\/ solid perimeters so that no sidewall infill is required for your extrusion width\n\n\/\/\/\/\/\/\/\/\/\/ REVISION HISTORY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ YYMMDD date code\n\/\/ 150119 - initial publish\n\/\/ 161104 - revA\n\/\/\n\n\/\/\/\/\/\/\/\/\/\/ INCLUDE AND USE \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ NOTE: openSCAD version 2014.03 or newer required for MCAD library\n\n\/\/ EXTERNAL FUNCTIONS USED\nuse \n\/\/ Get roundCornersCube.scad from http:\/\/www.thingiverse.com\/thing:8812\n\/\/ Revise path location to the custom openSCAD function if not in standard custom library location\n\/\/ roundCornersCube (x,y,z,r) gives cube of size xyz with corner radius r\n\/\/ Note that cube center parameter is fixed at true, and the corner $fn is fixed at 25\n\/\/ MCAD roundedBox is not used - those results seem imperfect and doesn't set corner $fn \nuse \n\/\/ Requires openSCAD MCAD library to be installed (openSCAD 2014.03 or later)\n\/\/ polyhole(h,d) provides improved size control on small holes\n\/\/ cylinder center parameter defaults to false; $fn intentionally varies with size of hole\nuse \n\/\/ Requires openSCAD MCAD library to be installed (openSCAD 2014.03 or later)\n\/\/ teardrop(radius, length, angle) provides a sidewall hole more printable than round hole\n\/\/ Angle parameter of 90 degrees gives teardrop shape; unclear when another value would be used\n\/\/ Consists of a round lobe and a right angle at the teardrop point\n\/\/ radius refers to the radius of the round lobe\n\/\/ $fn on round lobe is forced to 30\n\/\/ length is really the thickness of the teardrop formed in the x-axis\n\/\/ overall size of the teardrop is radius * (1 + 1\/sin(45)), or radius*2.414\n\/\/ For angle=90, round lobe will center at x,y,z=0. Teardrop builds on x-axis for length parameter\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ PARAMETERS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ All dimensions are millimeter\n\/\/ Case parameters for tailoring \nbox_sx = 104; \/\/ box outside size in X axis, not including mounting tabs\nbox_sy = 70; \/\/ box outside size in Y axis\nbox_sz = 27; \/\/ box outside size in Z axis, including the lid thickness\nbox_wt = 2.0; \/\/ box wall thickness (keep less than box_cp_hid)\nbox_bt = 2.0; \/\/ box base or bottom thickness (should be a multiple of printed layer height)\n\n\/\/ Lid parameters for tailoring\nlid_sz = 2.0; \/\/ lid size in Z axis or lid thickness (should be a multiple of printed layer height)\nlip_h = 1.60; \/\/ lid lip height (should be a multiple of layer height)\nfit_tol = 0.40; \/\/ fit tolerance or clearance between box and lid\n\n\/\/ Mounting tab parameters for tailoring\ntab_use = true; \/\/ true or false for mounting tab on x-axis yes\/no\ntab_sz = box_bt; \/\/ tab size in z-axis or height (typically set same as box base thickness)\ntab_sx = 8; \/\/ mounting tab size in x-axis (the amount tab extends from box) \ntab_hoy = 7; \/\/ tab hole offset in y axis from edge of tab\n\n\/\/ Fastener and hardware component hole sizing\n\/*==================================================== \nStandard hardware dimension reference data\nThese are a reference point only; adjustment may be necessary due to nozzle size, etc.\nAlso note that MCAD polyhole does better at actual diameters than circle\/cylinder\n\nSIZE THREAD CLEAR NUT AFD NUT OD NUT HEAD HEAD WASHER FLAT \n HOLE HOLE WRENCH @fn=6 HEIGHT OD HEIGHT HEIGHT OD \n----------- ------ ------ ------- ------- ------ ------ ------ ------ ----- \nM2 x 0.4 1.75mm 2.20mm 4.0mm 4.62mm 1.6mm 4.0mm 2.0mm 0.3mm 5.5mm\nM2.5 x 0.45 2.20mm 2.75mm 5.0mm 5.77mm 2.0mm 5.0mm 2.5mm 0.3mm 6.0mm\nM3 x 0.5 2.70mm 3.30mm 5.5mm 6.35mm 2.4mm 6.0mm 3.0mm 0.5mm 7.0mm \nM4 x 0.7 3.50mm 4.40mm 7.0mm 8.08mm 3.2mm 8.0mm 4.0mm 0.8mm 9.0mm\nM5 x 0.8 4.50mm 5.50mm 8.0mm 9.24mm 4.7mm 10.0mm 5.0mm 1.0mm 10.0mm\nM6 x 1.0 5.50mm 6.60mm 10.0mm 11.55mm 5.2mm 12.0mm 6.0mm 1.6mm 12.0mm\nM8 x 1.25 7.20mm 8.80mm 13.0mm 15.01mm 6.8mm 16.0mm 8.0mm 2.0mm 17.0mm\n#2-56 1.85mm 2.44mm 4.76mm 5.50mm 1.59mm 4.60mm 2.18mm 0.91mm 6.35mm\n#3-56 2.26mm 2.79mm 4.76mm 5.50mm 1.59mm 5.28mm 2.51mm 0.91mm 7.94mm\n#4-40 2.44mm 3.26mm 6.35mm 7.33mm 2.38mm 5.97mm 2.85mm 1.14mm 9.53mm\n#6-32 2.95mm 3.80mm 7.94mm 9.17mm 2.78mm 7.37mm 3.51mm 1.14mm 11.11mm\n#8-32 3.66mm 4.50mm 8.73mm 10.08mm 3.18mm 8.74mm 4.17mm 1.14mm 12.7mm\n#10-24 4.09mm 5.11mm 9.53mm 11.00mm 3.18mm 10.13mm 4.83mm 1.14mm 14.29mm\n#10-32 4.31mm 5.11mm 9.53mm 11.00mm 3.18mm 10.13mm 4.83mm 1.14mm 14.29mm\n1\/4-20 5.56MM 6.76MM 11.11mm 12.83mm 4.76mm 13.03mm 6.35mm 1.80mm 18.65\nNotes: 1,2 2,3 4 5 6 7,8 8,9 8,10 8,11\n----------------------------------------------------------------------------------------\nNote 1: Thread hole is for tap or self thread of machine screw in soft material\nNote 2: Hole dimensions are from littlemachineshop.com Tap Drill - 50% Thread column data\nNote 3: Clearance hole data is littlemachineshop.com Clearance Drill - Standard Fit column data\nNote 4: Nut Across Flat Diameter (AFD) metric data is ISO, inch is boltdepot.com US Nut Size table\nNote 5: Nut round OD is the openSCAD circle diameter required to achieve a nut size at $fn=6 \n Nut OD is calculated as = (NUT AFD)\/cos(30)\nNote 6: Nut height is for standard hex nut; jam nuts are less, lock nuts are more\n Metric data is ISO 4032, SAE data from boltdepot.com US Nut Size tables\nNote 7: Head diameter varies with the head style; value shown is max across all except truss head\nNote 8: Data from http:\/\/www.numberfactory.com\/nf_metric.html or http:\/\/www.numberfactory.com\/nf_inch.html \nNote 9: Head height varies with head style; value shown is max across all styles\nNote 10: Standard washer height or thickness\nNote 11: Flat washer outer diameter\n****************************************************************************************\/\n\/\/ Tailor fastener sizing and fit adjustments here\n\/\/ All screw holes are implemented with MCAD polyhole - more accurate than hole by cylinder\n\/\/ Dimensions shown were determined with Simplify3D as slicer, inside perimeters printed first\n\/\/ Tolerance added to nominal corrects for extrusion width and other printer variations\n\n\/\/ Box and lid screw hole parameters for tailoring\nbox_cp_hid = 2.44 + 0.1; \/\/ corner post hole inside diameter for screw threading (2.44 nominal for #4)\nbox_cp_hd = 10.0; \/\/ corner post hole depth must be less than (box_sz - lid_sz)\nlid_hid = 3.26 + 0.1; \/\/ lid screw clearance hole inside diameter (3.26 nominal for #4) \nlid_rid = 6.0 + 0.1; \/\/ lid screw head recess inside diameter (6.0 nominal for #4)\nlid_rd = 0.0; \/\/ depth of lid head recess (lid_sz must be able to accomodate the recess)\ntab_hid = 3.26 +0.1; \/\/ inside diameter of the mounting tab clearance holes (3.26 nominal for #4)\n\n\/\/\/\/\/\/\/\/\/\/ NON-USER PARAMETERS AND CALCULATIONS \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Parameters beyond this point are normally not altered in basic tailoring\n\/\/ Modify at your own risk\n\n\/\/ Geometry mesh factors \nMF = 0.01; \/\/ Mesh Factor is the amount of overlap on geometries for proper mesh\nMSA = MF; \/\/ Mesh Single Adjustment factor (translate ends; size adjustment on single ended mesh)\nMDA = 2*MF; \/\/ Mesh Double Adjustment (size adjustment on double ended mesh like boring holes)\n\n\/\/ calculated parameters \nbox_cp_od = box_cp_hid * 3 ; \/\/ set outer diameter of the corner standoff post to 3*hole diameter\nbox_cp_or = box_cp_od \/ 2 ; \/\/ outer radius of the corner standoff post\nlip_w = box_cp_or - box_wt - fit_tol; \/\/ lid lip width set so inside of lip aligns lid hole centers\nlip_arc_or = box_cp_od - box_wt; \/\/ outside radius of the corner arc on the lid lip\nlip_arc_od = 2 * lip_arc_or; \/\/ outside diameter of the corner arc on the lid lip\nbox_r = (3 * box_cp_hid) \/ 2; \/\/ radius of the box corners automatically based on screw size\n\n\/\/ Define matrix of lid hole locations\n\/\/ Matrix starts with hole closest to x,y=0 and goes CCW around box\nlid_hole_centers = [[ box_cp_or , box_cp_or , 0 ], \n\t\t\t\t\t[ box_sx - box_cp_or , box_cp_or , 0 ],\n\t\t\t\t\t[ box_sx - box_cp_or , box_sy - box_cp_or , 0 ], \n\t\t\t\t\t[ box_cp_or , box_sy - box_cp_or , 0 ]];\n\n\/\/ Define matrix of mounting tab hole locations\n\/\/ Matrix starts with hold closest to x,y=0 and goes CCW around box\ntab_hole_centers = [[ -tab_sx\/2 , tab_hoy , 0 ],\n [ box_sx + tab_sx\/2 , tab_hoy , 0 ],\n [ box_sx + tab_sx\/2 , box_sy - tab_hoy , 0 ],\n [ -tab_sx\/2 , box_sy - tab_hoy , 0 ]];\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Top level geometry\n\/\/ Edit true or false for obtaining box and lid respectively\ndifference() {\n rounded_cube_case(generate_box=true, generate_lid=true);\n}\n\n\/\/----------------------------------------------------------\nmodule standoff( post_od , post_id , post_h , hole_depth) {\n \/\/ Generates a standoff for mounting lid or circuit board\n \/\/ post_od: outer diamter of the standoff post\n \/\/ post_id: diameter of the inner hole in the standoff post\n \/\/ post_h: height of the standoff post\n \/\/ hole_depth: depth of the inner hole in the standoff post\n difference() {\n \/\/ start with a solid post\n \/\/ set $fn=25 to match what roundCornersCube does\n cylinder( d = post_od , h = post_h , center = false, $fn = 25); \n \n \/\/ remove the hole for the screw\n translate([ 0, 0, post_h - hole_depth ])\n polyhole( hole_depth + MSA, post_id ); \n } \/\/ end difference\n} \/\/ end module standoff\n\n\/\/----------------------------------------------------------\nmodule cylindrical_lip( l_od , l_h , l_w ) {\t\n \/\/ Generate a quarter circle arc for use as a lip\n \/\/ l_od: outer diameter of the lip arc\n \/\/ l_h: height of the lip arc\n \/\/ l_w: width of the lip arc\n l_r = l_od \/ 2; \/\/ calculate radius of the lip arc\n difference() {\n \/\/ start with a solid cylinder\n cylinder( r = l_r, h = l_h, center=false, $fs=0.01);\n \n \/\/ hollow it out to form a ring\n translate([ 0, 0, -MSA ]) \/\/ -MSA to offset oversized cylinder being removed\n cylinder( r = l_r - l_w, h = l_h + MDA, center=false, $fs=0.01 ); \/\/ +MDA on h to ensure removal\n \n \/\/ remove all but a quarter of the ring\n translate([ -l_r, 0, -MSA ]) \/\/ -MSA to offset oversized cube being removed\n cube([ l_od + MSA , l_r, l_h + MDA ]); \/\/ oversize by +MSA or +MDA to ensure complete removal \n translate([ 0, -l_r, -MSA ]) \/\/ -MSA to offset oversized cube being removed\n cube([ l_od + MSA, l_r + MSA, l_h + MDA ]);\/\/ oversize by +MSA or +MDA to ensure complete removal\n \n } \/\/ end difference\n} \/\/ end module cylindrical_lip\n\n\/\/----------------------------------------------------------\nmodule rounded_cube_case (generate_box, generate_lid) {\n \/\/ generate_box: true or false flag\n \/\/ generate_lid: true or false flag\n\n \/\/ Design rendering of box starts at x=0, y=0, z=0 \n \/\/ When present, mounting tabs are always added as extensions on X axis\n \/\/ left-right-forward-rear references are with respect to axis in default view (+x to right, +y to rear)\n \/\/ If both box and lid are being generated, lid will be offset in Y to place it rearward of box\n\n if (generate_box == true) { \/\/ we need to create the box part\n echo(str(\"Box outer size is x:\",box_sx,\"mm, y:\",box_sy,\"mm, z:\",box_sz,\"mm (with lid)\"));\n echo(str(\"Available clearance between corner posts is x:\",box_sx - 2*box_cp_od,\"mm, y:\",box_sy - 2*box_cp_od));\n echo(str(\"Available height inside closed box is \",box_sz - box_bt - lid_sz,\"mm\"));\n \n union() {\n difference() {\n union() {\n \/\/ Start with a solid cube with rounded corners\n \/\/ Z-axis height of box is reduced by lid thickness\n translate([ box_sx\/2, box_sy\/2, (box_sz - lid_sz)\/2 ])\n roundCornersCube( box_sx, box_sy, box_sz - lid_sz, box_r );\n \/\/ Extend base for the mounting tabs if present\n if ( tab_use == true ) {\n echo(str(\"Mounting tabs of \",tab_sx,\"mm increase x-axis size to \",box_sx + 2*tab_sx,\"mm\"));\n echo(str(\"Tab mounting hole spacing is x:\",box_sx+tab_sx,\"mm, y:\",box_sy-2*tab_hoy,\"mm\"));\n difference () {\n \/\/ start with the plate for the mounting tabs\n translate ([ box_sx\/2, box_sy\/2, tab_sz\/2 ])\n roundCornersCube ( box_sx + (tab_sx*2), box_sy, tab_sz - MSA, box_r );\n\n \/\/ now remove the mounting holes in the mounting tabs\n for(j = tab_hole_centers) { \/\/ for each hole in the mounting tab\n translate([ 0, 0, -MSA ]) \/\/ shift Z to ensure complete removal of hole\n translate(j)\n polyhole ( tab_sz + MDA, tab_hid ); \/\/ oversize height to ensure complete removal\n } \/\/ end for loop on mounting tab holes\n } \/\/ end difference\n } \/\/ end if tab_use\n } \/\/ end union\n \n \/\/ Hollow out the box volume, leaving box_bt at bottom and box_wt at sides\n translate([ box_sx\/2, box_sy\/2, (box_sz - lid_sz)\/2 + box_bt ]) \n roundCornersCube( box_sx - (box_wt*2), box_sy - (box_wt*2), box_sz, box_r - box_wt); \n\n \/\/ Define any holes in the box walls here\n \/\/ Sample teardrop holes with bottom of round lobe at floor of box - uncomment and tailor as desired\n\n teardrop_r = 3.5; \/\/ radius for round end of teardrop\n translate([ -MDA, box_sy\/2 - 5, 9 + box_bt ]) \/\/ left sidewall\n cube([box_bt + 2 * MDA, 11, 6]);\n \n\/\/*\/ \n\n \/\/ Sample round holes centered on available wall height - uncomment and tailor as desired\n\/*\n hole_r = 2;\n translate([ box_sx*2\/3, box_wt\/2, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ forward sidewall\n rotate([90, 0, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n translate([ box_sx - box_wt\/2, box_sy*2\/3, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ right sidewall\n rotate([0, 90, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n translate([ box_sx*2\/3, box_sy - box_wt\/2, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ forward sidewall\n rotate([90, 0, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n translate([ box_wt\/2, box_sy*2\/3, (box_sz-lid_sz-box_bt)\/2 + box_bt ]) \/\/ left sidewall\n rotate([0, 90, 0])\n cylinder( h=box_wt + MDA, r=hole_r, center=true, $fn=30 );\n\/\/*\/\n\n } \/\/ end difference\n\t\t\t\n \/\/ Add the corner standoff posts for the lid screws \n for(i = lid_hole_centers) {\n translate([ 0, 0, box_bt - MSA ]) \/\/ raise up to the inside of the box\n translate(i) \/\/ locate a corner\n standoff( box_cp_od, box_cp_hid, box_sz - box_bt - lid_sz + MSA, box_cp_hd );\n } \/\/ end for loop on standoff posts\n\n \/\/ Add any mounting standoff posts on the box bottom here\n \/\/ Sample mounting posts for small board centered in box - uncomment and tailor as desired\n\n bd_hsp_x = 91; \/\/ board hole spacing in x axis\n bd_hsp_y = 45; \/\/ board hole spacing in y axis\n bd_post_od = 6; \/\/ diameter of the board mounting post\n bd_post_id = 2.7; \/\/ hole diameter in the mounting post (2.7 for threading M3)\n bd_post_h = 4; \/\/ height of the board mounting posts\n echo(str(\"Available height above board posts is \",box_sz - box_bt - lid_sz - bd_post_h,\"mm\"));\n translate([ box_sx\/2 - bd_hsp_x\/2, box_sy\/2 - bd_hsp_y\/2, box_wt - MSA ]) \/\/ forward left corner\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n translate([ box_sx\/2 + bd_hsp_x\/2, box_sy\/2 - bd_hsp_y\/2, box_wt - MSA ]) \/\/ forward right\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n translate([ box_sx\/2 + bd_hsp_x\/2, box_sy\/2 + bd_hsp_y\/2, box_wt - MSA ]) \/\/ right rear\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n translate([ box_sx\/2 - bd_hsp_x\/2, box_sy\/2 + bd_hsp_y\/2, box_wt - MSA ]) \/\/ left rear\n standoff( post_od = bd_post_od, post_id=bd_post_id , post_h=bd_post_h , hole_depth=4); \/\/ for M3\n\/\/*\/ \n } \/\/ End union \n\n } \/\/ end if generate_box\n\n y_offset = generate_box ? box_sy+10 : 0; \/\/ offset lid Y by box_sy+10 if we are also doing box\n if ( generate_lid == true ) { \/\/ we need to create the lid part\n translate([ 0, y_offset, 0]) { \n difference() {\n \/\/ create the base solids for the lid\n union() {\n \/\/ Start with a solid plate with rounded corners to match the box part\n translate([ box_sx\/2, box_sy\/2, lid_sz\/2 ])\n roundCornersCube( box_sx, box_sy, lid_sz, box_r );\n \n \/\/ Add a reinforcement lip to the lid, starting with the straight portions \n \/\/ increase lip width by MSA to ensure mesh with quarter circle lip added below\n translate([ box_cp_od + fit_tol, box_wt + fit_tol, lid_sz ]) \n cube([box_sx - (box_cp_od*2) - (fit_tol*2), lip_w + MSA, lip_h ]); \n translate([box_wt + fit_tol, box_cp_od + fit_tol, lid_sz]) \n cube([ lip_w + MSA, box_sy - (box_cp_od*2) - (fit_tol*2), lip_h ]);\n translate([box_sx - box_cp_or - fit_tol, box_cp_od + fit_tol, lid_sz ]) \n cube([lip_w + MSA, box_sy - (box_cp_od*2) - (fit_tol*2), lip_h ]);\t\n translate([box_cp_od + fit_tol, box_sy - box_cp_or - fit_tol, lid_sz]) \n cube([box_sx - (box_cp_od*2) - (fit_tol*2), lip_w + MSA, lip_h]);\n\t\t\t\t\t\n \/\/ Fit a quarter circle lip around the corner mounting posts\n translate([ 0, 0, lid_sz]) \n translate( lid_hole_centers[0] ) \n rotate(180) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n translate([ 0, 0, lid_sz ])\n translate( lid_hole_centers [1] )\n rotate(270) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n translate([ 0, 0, lid_sz ])\n translate( lid_hole_centers [2] ) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n translate([ 0, 0, lid_sz ])\n translate( lid_hole_centers [3] )\n rotate(90) \n cylindrical_lip( lip_arc_od, lip_h, lip_w );\n } \/\/ end union of the base solids for the lid\n\n for (i = lid_hole_centers) { \/\/ for each corner in the lid\n \/\/ remove the material for the corner screw hole \n translate([ 0, 0, -MSA ]) \/\/ shift Z to ensure complete removal of hole\n translate(i) \n polyhole( lid_sz + MDA, lid_hid ); \/\/ height is +MDA to ensure complete removal\n if ( lid_rd > 0 ) { \/\/ we need to countersink the screw head\n \/\/ remove the material for the screw head recess \n translate([ 0, 0, -MSA ]) \/\/ -MSA to offset oversize hole being removed\n translate(i) \n polyhole( lid_rd + MSA, lid_rid ); \/\/ oversize +MSA to ensure complete removal \n } \/\/ end if lid_rd\n } \/\/ end for loop on lid holes\n\n \/\/ Add removal of any holes in the lid here\n \/\/ Sample square hole centered in lid - uncomment and tailor as desired\n\n translate([ 20, box_sy*0.3, lid_sz\/2 ])\n cube([ 14, 14, lid_sz + MDA], center=true );\n translate([ 20 + 14, box_sy*0.3, lid_sz\/8 ])\n cube([ 6, 2, lid_sz], center=true );\n\n translate([ 20, box_sy*0.7, lid_sz\/2 ])\n cube([ 14, 14, lid_sz + MDA], center=true );\n translate([ 20 + 14, box_sy*0.7, lid_sz\/8 ])\n cube([ 6, 2, lid_sz], center=true );\n translate([ 20 + 14, box_sy*0.7, lid_sz\/8 ])\n cube([ 2, 6, lid_sz], center=true );\n\n translate([ 60, box_sy*0.5, lid_sz\/2 ])\n cube([ 24, 15, lid_sz + MDA], center=true );\n\n } \/\/ end difference for lid\n } \/\/ end translate to move away from box if it is also being made\n } \/\/ end if generate_lid\n \n echo(str(\"Maximum lid screw length is \", box_cp_hd + lid_sz - lid_rd,\"mm\"));\n\n} \/\/ end module rounded_cube_case\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3293ac6bca7cb53d7c82af6a58c1b0b01ece3b5b","subject":"increase the $fn value","message":"increase the $fn value\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/geometry\/arc\/chickenchuck040\/arc.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/geometry\/arc\/chickenchuck040\/arc.scad","new_contents":"\n\/\/ This arc module is from this thing on Thingiverse:\n\/\/\t\thttps:\/\/www.thingiverse.com\/thing:1092611\n\nmodule arc(radius, thick, angle)\n{\n\tintersection()\n\t{\n\t\tunion()\n\t\t{\n\t\t\trights = floor(angle\/90);\n\t\t\tremain = angle-rights*90;\n\t\t\tif(angle > 90)\n\t\t\t{\n\t\t\t\tfor(i = [0:rights-1]){\n\t\t\t\t\trotate(i*90-(rights-1)*90\/2){\n\t\t\t\t\t\tpolygon([[0, 0], [radius+thick, (radius+thick)*tan(90\/2)], [radius+thick, -(radius+thick)*tan(90\/2)]]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trotate(-(rights)*90\/2)\n\t\t\t\t\tpolygon([[0, 0], [radius+thick, 0], [radius+thick, -(radius+thick)*tan(remain\/2)]]);\n\t\t\t\trotate((rights)*90\/2)\n\t\t\t\t\tpolygon([[0, 0], [radius+thick, (radius+thick)*tan(remain\/2)], [radius+thick, 0]]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpolygon([[0, 0], [radius+thick, (radius+thick)*tan(angle\/2)], [radius+thick, -(radius+thick)*tan(angle\/2)]]);\n\t\t\t}\n\t\t}\n\t\tdifference(){\n\t\t\tcircle(radius+thick, $fn = 40);\n\t\t\tcircle(radius, $fn = 40);\n\t\t}\n\t}\n}\n\n\/\/arc(10, 3, 300);","old_contents":"\n\/\/ This arc module is from this thing on Thingiverse:\n\/\/\t\thttps:\/\/www.thingiverse.com\/thing:1092611\n\nmodule arc(radius, thick, angle)\n{\n\tintersection()\n\t{\n\t\tunion()\n\t\t{\n\t\t\trights = floor(angle\/90);\n\t\t\tremain = angle-rights*90;\n\t\t\tif(angle > 90)\n\t\t\t{\n\t\t\t\tfor(i = [0:rights-1]){\n\t\t\t\t\trotate(i*90-(rights-1)*90\/2){\n\t\t\t\t\t\tpolygon([[0, 0], [radius+thick, (radius+thick)*tan(90\/2)], [radius+thick, -(radius+thick)*tan(90\/2)]]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trotate(-(rights)*90\/2)\n\t\t\t\t\tpolygon([[0, 0], [radius+thick, 0], [radius+thick, -(radius+thick)*tan(remain\/2)]]);\n\t\t\t\trotate((rights)*90\/2)\n\t\t\t\t\tpolygon([[0, 0], [radius+thick, (radius+thick)*tan(remain\/2)], [radius+thick, 0]]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tpolygon([[0, 0], [radius+thick, (radius+thick)*tan(angle\/2)], [radius+thick, -(radius+thick)*tan(angle\/2)]]);\n\t\t\t}\n\t\t}\n\t\tdifference(){\n\t\t\tcircle(radius+thick);\n\t\t\tcircle(radius);\n\t\t}\n\t}\n}\n\n\/\/arc(10, 3, 300);","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b9beeb4a18536d8503636ba29bd82470347cdc14","subject":"Mask opening tweaks.","message":"Mask opening tweaks.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 30;\nview_opening_height = 90;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 78;\nview_opening_bottom = 28;\nview_opening_width = 190;\nview_opening_height = 91;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c00d0e540e81199850af27425a72883e5a478fe0","subject":"Fix bug in rounded hanging supports.","message":"Fix bug in rounded hanging supports.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=inner_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"713ab3db7fc8cc0c810a96f8281656e11e900374","subject":"Update Citosyne.scad","message":"Update Citosyne.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([2, 0, 2.55]) cube ([x+3, y, z+3], center=true); \ncolor(\"lime\") translate ([-27, y\/200000, -4]) cylinder (z+9, y\/2, y\/2); \n \n } \nrotate([0, 90, 0]) translate([-0.5,0,-18.9]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-27.9, -11, 5.1]) cube([53.5, 22, 8]); \/\/\u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([15, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 38.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 38.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n","old_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([2, 0, 2.55]) cube ([x+3, y, z+3], center=true); \ncolor(\"lime\") translate ([-27, y\/200000, -4]) cylinder (z+9, y\/2, y\/2); \n \n } \nrotate([0, 90, 0]) translate([-0.5,0,-18.9]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-27.9, -11, 5.1]) cube([53.5, 22, 8]); \/\/\u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([15, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 38.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 38.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n #translate([1, 3, 0]) cube([2, 4.5, 2]);\n \n \n \n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5430428c1ab14095e58632fd39911bd06309f355","subject":"widen the shade","message":"widen the shade\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_contents":"\nbottomOuterRadius = 50;\n\nintersection_xTranslate = -58;\n\nouterRadius = 90;\n\nsquareLength = 59;\n\ntop_zTranslate = 1;\n\n\/\/ this narrows the top (and bottom a little)\nxScale = 0.35; \/\/ 0.3;\n\n\/\/ this shortens the height and widens the base\nyScale = 0.7; \/\/ 0.7; \n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\ntranslate([9, 18, 0])\n%import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n top_zTranslate = top_zTranslate,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\nbottomOuterRadius = 52;\n\nintersection_xTranslate = -58;\n\nouterRadius = 90;\n\nsquareLength = 59;\n\ntop_zTranslate = 1;\n\nxScale = 0.2; \n\nyScale = 0.7; \n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ %import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n top_zTranslate = top_zTranslate,\n xScale = xScale,\n yScale = yScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8b11095586cf5ad0da9a6e90e8a14c750c7bb291","subject":"right wall is a mirror of the left one","message":"right wall is a mirror of the left one\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"navibot_sr8980_docking_station_walls\/rightWall.scad","new_file":"navibot_sr8980_docking_station_walls\/rightWall.scad","new_contents":"use \n\nmodule rightWall()\n{\n mirror([0,1,0])\n leftWall();\n}\n\nrightWall();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'navibot_sr8980_docking_station_walls\/rightWall.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f252fb89e1a666d05a37b5d482b887ec81e58eee","subject":"bottle adapter is no longer needed, as the 25mm hose fits perfectly","message":"bottle adapter is no longer needed, as the 25mm hose fits perfectly\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/bottle_adapter.scad","new_file":"pop_rocket\/bottle_adapter.scad","new_contents":"","old_contents":"eps=0.01;\nwall=1;\nhose_phi=6;\nbottle_screw_phi=27.4 + 0.6;\nbottle_screw_h=9;\nnarrowing_h=10;\n\nmodule adapter()\n{\n \/\/ bottom ring\n difference()\n {\n $fn=200;\n cylinder(d=bottle_screw_phi+2*wall, h=bottle_screw_h);\n translate([0,0,-eps])\n cylinder(d=bottle_screw_phi, h=bottle_screw_h+2*eps);\n }\n translate([0, 0, bottle_screw_h])\n {\n \/\/ adapter\n difference()\n {\n $fn=100;\n cylinder(d2=hose_phi, d1=bottle_screw_phi+2*wall, h=10);\n translate([0,0,-eps])\n cylinder(d2=hose_phi-2*wall, d1=bottle_screw_phi, h=10+eps);\n }\n \/\/ top connector\n translate([0, 0, narrowing_h])\n difference()\n {\n $fn=100;\n cylinder(d=hose_phi, h=10);\n translate([0,0,-eps])\n cylinder(d=hose_phi-2*wall, h=10+2*eps);\n }\n }\n}\n\nadapter();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bec98a6543784b4968aab52c26dc3b871b93080d","subject":"porch checkpoint","message":"porch checkpoint\n","repos":"chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella","old_file":"cad\/porch.scad","new_file":"cad\/porch.scad","new_contents":"\/\/ OpenSCAD for a \"porch\" extension for a Turtlebot3 burger\n\/\/ It includes a lampholder.\nthickness = 4;\nlampholder_thickness = 3; \/\/ Must be smaller than distance between nubs\nbulb_width = 25;\nporch_center_y = 36; \/\/ The length of the rectangular portion\nporch_x = 96;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\ntab_x = 78; \/\/ center-center\ntab_y = 7; \/\/ edge to center of holes\ntabr_x = 22.25; \/\/ center-to-center of relay board\ntabr_y = -19; \/\/ center to center of relay board\nrim = 3; \/\/ Width of rim\nhex_offset = 12; \/\/ Center-to-center of hex connection\nhex_radius = 2.5; \/\/ Radius for hex nuts\npost_offset = 24; \/\/ Center-to-center of post cutout\n\n\/\/ This is the basic plate. Y argument is the protrusion (2\/3 of the\n\/\/ porch extent). This object cannot be translated once created.\nmodule base(x,y,z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n hull() {\n \/\/ place 6 circles in the corners, with the rounding radius\n translate([(-x\/2)+(round_radius\/2), -y+(round_radius\/2), 0])\n circle(r=round_radius);\n \n translate([(x\/2)-(round_radius\/2), -y+(round_radius\/2), 0])\n circle(r=round_radius);\n\n translate([(x\/2)-(round_radius\/2), 0-(round_radius\/2), 0])\n circle(r=round_radius);\n \n translate([x\/2-y+(round_radius\/2), y\/2-(round_radius\/2), 0])\n circle(r=round_radius);\n\n translate([(-x\/2)+y-(round_radius\/2),y\/2-(round_radius\/2), 0])\n circle(r=round_radius);\n \n translate([(-x\/2)+(round_radius\/2), 0+(round_radius\/2), 0])\n circle(r=round_radius);\n }\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate.\nmodule base_cutout(x,y,z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n hull() {\n \/\/ place 6 circles in the corners, with the rounding radius\n translate([(-x\/2)+(round_radius\/2)+rwidth, -y+(round_radius\/2)+rwidth, 0])\n circle(r=round_radius);\n \n translate([(x\/2)-(round_radius\/2)-rwidth, -y+(round_radius\/2)+rwidth, 0])\n circle(r=round_radius);\n\n translate([(x\/2)-(round_radius\/2)-rwidth, 0-(round_radius\/2)-rwidth\/2, 0])\n circle(r=round_radius);\n \n translate([x\/2-y+(round_radius\/2), y\/2-(round_radius\/2)-rwidth, 0])\n circle(r=round_radius);\n\n translate([(-x\/2)+y-(round_radius\/2),y\/2-(round_radius\/2)-rwidth, 0])\n circle(r=round_radius);\n \n translate([(-x\/2)+(round_radius\/2)+rwidth, 0+(round_radius\/2)-rwidth\/2, 0])\n circle(r=round_radius);\n }\n }\n}\n\n\/\/ x - center to between holes\n\/\/ y - baseline to center of hole\n\/\/ z - thickness\nmodule holes(x,y,z) {\n pad = 0.5;\n \/\/ These are rivet holes for the tab pieces\n for(i=[[x+rivet_radius+pad,y],[x-rivet_radius-pad,y],\n [-x+rivet_radius+pad,y],[-x-rivet_radius-pad,y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\n\/\/ x - center of board\n\/\/ y - center of board\n\/\/ z - thickness\nmodule relay_holes(x,y,z) {\n dx = 14; \/\/ center of board to center of hole\n dy = 10; \/\/ center of board to center of hole\n \/\/ These are rivet holes for the relay board\n for(i=[[x+dx,y+dy],[x-dx,y-dy],\n [x+dx,y-dy],[x-dx,y+dy]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\n\n\/\/ Protrusions to allow screws to main platform\nmodule connector(z) {\n difference() {\n rotate(22.5,0,0)\n cylinder(h=z,r1=5,r2=5,$fn=8,center=true);\n cylinder(h=z,r1=2,r2=2,center=true);\n translate([0,0,z\/2])\n cylinder(height=z\/2,r1=2.5,r2=2.5,$fn=8);\n }\n}\n\/\/ Subtract this from the base platform\n\/\/ These are the cutouts for the fastening nuts\nmodule connector_housing(z) {\n linear_extrude(height=z,center=true) {\n rotate(22.5,0,0)\n circle(r=5,$fn=8);\n }\n}\n\/\/ Subtract this from the base platform\n\/\/ This also works for the cutout for posts.\nmodule post_housing(z) {\n linear_extrude(height=z,center=true) {\n rotate(22.5,0,0)\n circle(r=6,$fn=8);\n }\n}\n\/\/ width - radius of the bulb opening\n\/\/ z - thickness of the holder\nmodule lampholder(width,z) {\n bulb_tail_radius = 8;\n notch_radius = 1;\n difference() {\n union() {\n translate([0,-width\/4,0])\n cube([width,width\/2,z],center=true);\n translate([0,-width\/2,-z\/2])\n cylinder(r=width\/2,h=z);\n }\n translate([0,-width\/2,-z\/2])\n cylinder(r=bulb_tail_radius,h=z);\n translate([0,-width\/2-bulb_tail_radius-notch_radius\/2,-z\/2])\n cylinder(r=notch_radius,h=z);\n }\n}\n\/\/ Cutout to account for flare of lamp. 15mm->28mm in 5mm\nmodule lamp_flare() {\n cylinder(h=6,r1=14,r2=7.5,center=true);\n}\n\n\/\/ Support between the lampholders.\nmodule support(x,y,z) {\n height=6;\n cube([x,y,height],center=true);\n}\n \n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,thickness\/2])\ndifference() {\n base(porch_x,porch_center_y,thickness);\n translate([0,-porch_center_y,0])\n holes(tab_x\/2,tab_y,thickness);\n relay_holes(tabr_x,tabr_y,thickness);\n translate([-hex_offset,-porch_center_y-(hex_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([hex_offset,-porch_center_y-(hex_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([post_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n post_housing(2*thickness);\n translate([-post_offset,-porch_center_y-(round_radius\/2),thickness])\n post_housing(2*thickness);\n}\n\/\/ Rim\ntranslate([0,0,-thickness\/2]) {\n difference() {\n base(porch_x,porch_center_y,thickness);\n base_cutout(porch_x,porch_center_y,thickness,rim);\n translate([hex_offset,-porch_center_y-(hex_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([-hex_offset,-porch_center_y-(hex_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([post_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n post_housing(2*thickness);\n translate([-post_offset,-porch_center_y-(round_radius\/2),thickness])\n post_housing(2*thickness);\n }\n}\n\/\/ Lampholders\n\/\/ Inner distance between holders = 6mm\ntranslate([0,0,thickness\/2])\n rotate(90,[1,0,0]) \n lampholder(bulb_width,lampholder_thickness);\ntranslate([0,6+lampholder_thickness+thickness\/2,thickness\/2])\n rotate(90,[1,0,0]) \n lampholder(bulb_width,thickness);\n\n\n \ntranslate([bulb_width\/2-rim\/2,porch_center_y\/4,0])\n support(rim,porch_center_y\/2,6);\ntranslate([-bulb_width\/2+rim\/2,porch_center_y\/4,0])\n support(rim,porch_center_y\/2,6);\n\/\/ These are the two protrusions for fastening to the robot.\ntranslate([hex_offset,-porch_center_y-hex_radius\/2,thickness])\n rotate(180,[0,1,0])\n connector(thickness);\ntranslate([-hex_offset,-porch_center_y-hex_radius\/2,0])\n connector(thickness);\n intersection() { \n translate([0,6+2*lampholder_thickness+thickness,-bulb_width\/2+3])\n rotate(90,[1,0,0]) \n lamp_flare();\n }","old_contents":"\/\/ OpenSCAD for a \"porch\" extension for a Turtlebot3 burger\n\/\/ It includes a lampholder.\nthickness = 4;\nlampholder_thickness = 3; \/\/ Must be smaller than distance between nubs\nbulb_width = 25;\nporch_center_y = 36; \/\/ The length of the rectangular portion\nporch_x = 90;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\ntab_x = 66; \/\/ center-center\ntab_y = 9; \/\/ edge to center of holes\ntabr_x = 22.25; \/\/ center-to-center of relay board\ntabr_y = -17; \/\/ center to center of relay board\nrim = 3; \/\/ Width of rim\nhex_offset = 12; \/\/ Center-to-center of hex connection\npost_offset = 24; \/\/ Center-to-center of post cutout\n\n\/\/ This is the basic plate. Y argument is the protrusion (2\/3 of the\n\/\/ porch extent). This object cannot be translated once created.\nmodule base(x,y,z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n hull() {\n \/\/ place 6 circles in the corners, with the rounding radius\n translate([(-x\/2)+(round_radius\/2), -y+(round_radius\/2), 0])\n circle(r=round_radius);\n \n translate([(x\/2)-(round_radius\/2), -y+(round_radius\/2), 0])\n circle(r=round_radius);\n\n translate([(x\/2)-(round_radius\/2), 0-(round_radius\/2), 0])\n circle(r=round_radius);\n \n translate([x\/2-y+(round_radius\/2), y\/2-(round_radius\/2), 0])\n circle(r=round_radius);\n\n translate([(-x\/2)+y-(round_radius\/2),y\/2-(round_radius\/2), 0])\n circle(r=round_radius);\n \n translate([(-x\/2)+(round_radius\/2), 0+(round_radius\/2), 0])\n circle(r=round_radius);\n }\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate.\nmodule base_cutout(x,y,z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n hull() {\n \/\/ place 6 circles in the corners, with the rounding radius\n translate([(-x\/2)+(round_radius\/2)+rwidth, -y+(round_radius\/2)+rwidth, 0])\n circle(r=round_radius);\n \n translate([(x\/2)-(round_radius\/2)-rwidth, -y+(round_radius\/2)+rwidth, 0])\n circle(r=round_radius);\n\n translate([(x\/2)-(round_radius\/2)-rwidth, 0-(round_radius\/2)-rwidth\/2, 0])\n circle(r=round_radius);\n \n translate([x\/2-y+(round_radius\/2), y\/2-(round_radius\/2)-rwidth, 0])\n circle(r=round_radius);\n\n translate([(-x\/2)+y-(round_radius\/2),y\/2-(round_radius\/2)-rwidth, 0])\n circle(r=round_radius);\n \n translate([(-x\/2)+(round_radius\/2)+rwidth, 0+(round_radius\/2)-rwidth\/2, 0])\n circle(r=round_radius);\n }\n }\n}\n\n\/\/ x - center to between holes\n\/\/ y - baseline to center of hole\n\/\/ z - thickness\nmodule holes(x,y,z) {\n pad = 0.5;\n \/\/ These are rivet holes for the tab pieces\n for(i=[[x+rivet_radius+pad,y],[x-rivet_radius-pad,y],\n [-x+rivet_radius+pad,y],[-x-rivet_radius-pad,y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\n\/\/ x - center of board\n\/\/ y - center of board\n\/\/ z - thickness\nmodule relay_holes(x,y,z) {\n dx = 14; \/\/ center of board to center of hole\n dy = 10; \/\/ center of board to center of hole\n \/\/ These are rivet holes for the relay board\n for(i=[[x+dx,y+dy],[x-dx,y-dy],\n [x+dx,y-dy],[x-dx,y+dy]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\n\n\/\/ This allows screws to main platform\nmodule connector(z) {\n difference() {\n cylinder(h=z,r1=5,r2=5,$fn=6,center=true);\n cylinder(h=z,r1=2,r2=2,center=true);\n translate([0,0,z\/2])\n cylinder(height=z\/2,r1=2.5,r2=2.5,$fn=6);\n }\n}\n\/\/ Subtract this from the base platform\n\/\/ This also works for the cutout for posts.\nmodule connector_housing(z) {\n linear_extrude(height=z,center=true) {\n circle(r=5,$fn=6);\n }\n}\n\/\/ width - radius of the bulb opening\n\/\/ z - thickness of the holder\nmodule lampholder(width,z) {\n bulb_tail_radius = 8;\n notch_radius = 1;\n difference() {\n union() {\n translate([0,-width\/4,0])\n cube([width,width\/2,z],center=true);\n translate([0,-width\/2,-z\/2])\n cylinder(r=width\/2,h=z);\n }\n translate([0,-width\/2,-z\/2])\n cylinder(r=bulb_tail_radius,h=z);\n translate([0,-width\/2-bulb_tail_radius-notch_radius\/2,-z\/2])\n cylinder(r=notch_radius,h=z);\n }\n}\n\n\/\/ Support between the lampholders.\nmodule support(x,y,z) {\n height=6;\n cube([x,y,height],center=true);\n}\n \n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,thickness\/2])\ndifference() {\n base(porch_x,porch_center_y,thickness);\n translate([0,-porch_center_y,0])\n holes(tab_x\/2,tab_y,thickness);\n relay_holes(tabr_x,tabr_y,thickness);\n translate([-hex_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([hex_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([post_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([-post_offset,-porch_center_y-(round_radius\/2),thickness])\n connector_housing(2*thickness);\n}\n\/\/ Rim\ntranslate([0,0,-thickness\/2]) {\n difference() {\n base(porch_x,porch_center_y,thickness);\n base_cutout(porch_x,porch_center_y,thickness,rim);\n translate([hex_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([-hex_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([post_offset,-porch_center_y-(round_radius\/2),thickness\/2])\n connector_housing(2*thickness);\n translate([-post_offset,-porch_center_y-(round_radius\/2),thickness])\n connector_housing(2*thickness);\n }\n}\n\/\/ Lampholders\n\/\/ Inner distance between holders = 6mm\ntranslate([0,0,thickness\/2])\n rotate(90,[1,0,0]) \n lampholder(bulb_width,lampholder_thickness);\ntranslate([0,6+lampholder_thickness+thickness\/2,thickness\/2])\n rotate(90,[1,0,0]) \n lampholder(bulb_width,thickness);\n \ntranslate([bulb_width\/2-rim\/2,porch_center_y\/4,0])\n support(rim,porch_center_y\/2,6);\ntranslate([-bulb_width\/2+rim\/2,porch_center_y\/4,0])\n support(rim,porch_center_y\/2,6);\ntranslate([hex_offset,-porch_center_y,thickness])\n rotate(180,[0,1,0])\n connector(thickness);\ntranslate([-hex_offset,-porch_center_y,0])\n connector(thickness);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"54822194481e7181db6eaae81ff810d6495cfaa9","subject":"c&p AAA version","message":"c&p AAA version\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_dispenser\/dispenser_aaa.scad","new_file":"battery_dispenser\/dispenser_aaa.scad","new_contents":"use \n\nsurround = 15;\nheight = 150;\nwall = 2;\nbatteryDiameter = 15;\nbatteryLength = 49;\n\nmodule channel(h)\n{\n \/\/ side\n cube([2*wall+batteryDiameter, h, wall]);\n \/\/ back wall\n cube([wall, h, batteryLength\/2]);\n \/\/ front holding\n translate([wall+batteryDiameter, 0, 0])\n cube([wall, h, surround]);\n}\n\nmodule wing()\n{\n difference()\n {\n \/\/ main channel part\n union()\n {\n channel(height);\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n channel(2*batteryDiameter);\n }\n \/\/ removal of unnecessary elements\n translate([wall, 0, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n rotate([0,0,60])\n translate([wall, -2*batteryDiameter, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n \/\/ removal of part from which battery will be extracted\n rotate([0,0,60])\n translate([3*wall, -2*batteryDiameter+wall, wall])\n cube([batteryDiameter, batteryDiameter, surround]);\n }\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n cube([2*wall+batteryDiameter, wall, surround]);\n}\n\n\nfor(m = [0,1])\n{\n mirror([m,0,0])\n {\n translate([5,0,0])\n wing();\n %translate([28, -3, wall+1])\n batteryAAA();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'battery_dispenser\/dispenser_aaa.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"54b5ab32b5d402102d1fad74ed41bf924bbb50ff","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"604367d99c86943c776e47f7b3f694bf093d4364","subject":"deleting orginal file","message":"deleting orginal file\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/motor.scad","new_file":"hardware\/vitamins\/motor.scad","new_contents":"","old_contents":"motor_shaft_r=5;\r\nmotor_shaft_h=8;\r\nmotor_flange_h = 1;\r\nmotor_flange_r = 9.20;\r\nMotor_body_r = 28.00;\r\nMotor_body_h = 19.30;\r\n\r\n\t\/\/\/rotate object around to Y access\r\n\trotate([90,0,0]){\r\n\t\/\/ shaft\r\n\t\tcolor(\"grey\")\r\n\tcylinder(r=motor_shaft_r, h=motor_shaft_h, center=true);\r\n\t\t\/\/flange\r\n\t\ttranslate([0,0,motor_shaft_h\/2]) \r\n\t\t\tcolor(\"yellow\")\r\n\t\t\tcylinder(r=motor_flange_r, h=motor_flange_h, center=true);\r\n\t\t\t\/\/ Main Body\r\n\t\t\t\ttranslate([0,-15,14])\/\/\/don't understand this \r\n\t\t\t\t\tcolor(\"silver\")\r\n\t\t\tcylinder(r=Motor_body_r, h=Motor_body_h, center=true);\r\n\t\t\t\t\/\/Flanges\r\n\t\t\t\t\ttranslate([35,-15,4.5]){\/\/\/don't understand this \r\n\t\t\t\t\t\r\n\t\t\t\t\tcylinder(r=7, h=1);\r\n\t\t\t\t\t\t\ttranslate([-14,-7,0]){\r\n\t\t\t\t\t\t\t\tcube([14.5,14,1]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\tcolor(\"white\")\r\n\t\t\t\t\tcylinder(r=4, h=1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttranslate([-35,-15,4.5]){\/\/\/don't understand this \r\n\t\t\t\t\t\r\n\t\t\t\t\tcylinder(r=7, h=1);\r\n\t\t\t\t\t\ttranslate([0,-7,0]){\r\n\t\t\t\t\t\t\t\tcube([14.5,14,1]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcolor(\"white\")\r\n\t\t\t\t\tcylinder(r=4, h=1);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t \/\/bottom\r\n\t\t\t\tcolor(\"blue\")\r\n\t\t\t\t translate([0-7,-46,4]) \r\n\t\t\t\t\t cube([14.5,5.5,Motor_body_h]); \r\n\r\n}\r\n ","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c58e3d01eb23cbef1f29f536f8856e046f162fce","subject":"helper modlues for visualization purposes","message":"helper modlues for visualization purposes\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/all.scad","new_file":"tablet_toilet_mount\/all.scad","new_contents":"use \nuse \n\nmodule bothElements()\n{\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n%openPosition();\n\n\/\/bothElements();\n","old_contents":"use \nuse \n\n\/\/support();\n\/\/wallMount();\n\n%wallMount();\n%translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"024f8215ede40ff9f9a87e3d0cdf630caea2bc4a","subject":"added scad library","message":"added scad library\n","repos":"makerbot\/Miracle-Grue,makerbot\/Miracle-Grue,makerbot\/Miracle-Grue,makerbot\/Miracle-Grue,makerbot\/Miracle-Grue","old_file":"test_cases\/modelReaderTestCase\/output\/tube.scad","new_file":"test_cases\/modelReaderTestCase\/output\/tube.scad","new_contents":"\/*This helper library was originally created by davidIvann and \ncan be found in his Parametric Space Truss http:\/\/www.thingiverse.com\/thing:10642\nIt allows you to join two points on a plane and add rounded corners\n*\/\nmodule tube(x1, y1, z1, x2, y2, z2, diameter, faces, thickness_over_width)\n{\n\t\n\tlength = sqrt( pow(x1 - x2, 2) + pow(y1 - y2, 2) + pow(z1 - z2, 2) );\n\talpha = ( (y2 - y1 != 0) ? atan( (z2 - z1) \/ (y2 - y1) ) : 0 );\n\tbeta = 90 - ( (x2 - x1 != 0) ? atan( (z2 - z1) \/ (x2 - x1) ) : 0 );\n\tgamma = ( (x2 - x1 != 0) ? atan( (y2 - y1) \/ (x2 - x1) ) : ( (y2 - y1 >= 0) ? 90 : -90 ) ) + ( (x2 - x1 >= 0) ? 0 : -180 );\n\t\/\/ echo(Length = length, Alpha = alpha, Beta = beta, Gamma = gamma);\t\n\ttranslate([x1, y1, z1])\n\trotate([ 0, beta, gamma])\n\t\tscale([thickness_over_width,1,1])\n\t\t\trotate([0,0,90]) cylinder(h = length, r = diameter\/2, center = false, $fn = faces );\n}\n\nmodule corner(x, y, z, diameter){\n\ttranslate([x, y, z])\n\tsphere( r = diameter\/2 );\n}\nd = 0.35; \/\/ tube diameter\nf = 6;\nt = 0.6;\ntube(0,0,0,1,0,0, d,f,t);","old_contents":"","returncode":1,"stderr":"error: pathspec 'test_cases\/modelReaderTestCase\/output\/tube.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8a0495790e83c3414c8a097d2e34c942408e3dfc","subject":"removed dead code and simplified orunder_*surface_() helpers","message":"removed dead code and simplified orunder_*surface_() helpers\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"module rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*3); \/\/ TODO: r*10!\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\n\n\/\/ element for holding a single brush\nmodule holder(size)\n{\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n}\n\n\nmodule whole_holder(names)\n{\n translate([0, 5+1, -5])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([36, 35], 3);\n cube([36, 5, 3*2]);\n }\n rounded_half_surface_([36, 50], 5);\n translate(1\/2*[36, 50, 0]) \/\/ TODO: temporary\n {\n for(dx=[-1, +1])\n translate([dx*20\/2-1, -1, 2])\n holder([3,25,18]);\n }\n}\n\n\nwhole_holder([\"John\", \"Jane\"]);\n\/\/rounded_surface_([36, 5, 30], 3\/2);\n\n\n\/\/rounded_surface_([30, 20], 3);\n\/\/rounded_half_surface_([30, 20], 5);\n","old_contents":"names=[\"John\", \"Jane\"];\n\n\nmodule rounded_surface_(size)\n{\n r=size[2]\/2;\n translate([0, 0, r])\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, 0])\n sphere(r=r, $fn=r*10); \/\/ TODO: r*20!\n}\n\nmodule rounded_half_surface_(size)\n{\n translate([0, 0, -size[2]\/2])\n difference()\n {\n rounded_surface_(size);\n translate(size[2]\/2*[0,0,-1])\n cube(size);\n }\n}\n\n\n\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(size)\n{\n hull()\n difference()\n {\n #for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(size)\n{\n translate([0, 0, size[1]\/2])\n rotate([90,0,0])\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(size)\n{\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n}\n\n\nmodule brush_holder()\n{\n translate([0, -23.25, 0])\n rotate([90, 0, 0])\n rounded_surface_([36-2*2, 29, 2]);\n translate(1\/2*[36, 50, 0]) \/\/ TODO: temporary\n {\n translate(-1\/2*[36,50, 0]) \/\/ TODO: to be removed\n rounded_half_surface_([36, 50, 5]);\n\n for(dx=[-1, +1])\n translate([dx*20\/2-1, -1, 2])\n holder([3,25,18]);\n }\n}\n\n\nbrush_holder();\n\n\n\/\/rounded_surface_([20,30,5]);\n\/\/rounded_half_surface_([20,30,5]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1fa66ee916822cfe9e6ca5dc424a4e30b06d8c3d","subject":"shapes\/fncylindera: fix extra_align","message":"shapes\/fncylindera: fix extra_align\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r_*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1c85ed00b62aa4a1852f0d2e652c42c8fb8bd59f","subject":"ADENIN","message":"ADENIN","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Adenin.scad","new_file":"3D-models\/SCAD\/Adenin.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=18.5; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, -1]) cube([42, 24, 9]); \/\/space\n } \n } \n}\ndifference() {\n\n #translate([39, -9.5, -4.29]) cube([12.5, 19, 8.55]);\n rotate([0, 90, 0]) translate([0, -5, 47.12]) cylinder(5, 2.67, 2.67);\n rotate([0, 90, 0]) translate([0, 5, 47.12]) cylinder(5, 2.67, 2.67);\n }\n rotate([90, 0, 0]) translate([1.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n rotate([90, 0, 0]) translate([40.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=18.5; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, -1]) cube([42, 24, 9]); \/\/space\n } \n } \n}\ndifference() {\n\n translate([39, -9.5, -4.29]) cube([11.92, 19, 8.55]);\n rotate([0, 90, 0]) translate([0, -5, 47.92]) cylinder(5, 2.67, 2.67);\n rotate([0, 90, 0]) translate([0, 5, 47.92]) cylinder(5, 2.67, 2.67);\n }\n rotate([90, 0, 0]) translate([1.05, 0, -9.5]) cylinder(19, 4.29, 4.29);\n rotate([90, 0, 0]) translate([40, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\/\/difference() {\n\/\/ translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n\/\/ #rotate([0, 90, 0]) translate([0, 0, -15]) cylinder(8, 2.67, 2.67);\n\n\/\/}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a5475ee7ef59899e1abde6594c71d68c0d830007","subject":"furniture support element","message":"furniture support element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"furniture_corner_support\/furniture_corner_support.scad","new_file":"furniture_corner_support\/furniture_corner_support.scad","new_contents":"$fn=30;\n\nmodule screw()\n{\n translate([0,0,31.2])\n cylinder(r=8\/2, h=4);\n cylinder(r=3.5\/2, h=31.2);\n}\n\nmodule body()\n{\n difference()\n {\n cube([20, 40, 40]);\n rotate([45,0,0])\n translate([-1, 0, 0])\n cube([20+2, 60, 30]);\n }\n}\n\nmodule screw_hole()\n{\n translate([0,0,21])\n cylinder(r=(8+1)\/2, h=5+10);\n cylinder(r=(3.5+0.5)\/2, h=21);\n}\n\n\nmodule main()\n{\n difference()\n {\n body();\n translate([20\/2, 30, 0])\n screw_hole();\n }\n}\n\n\nmain();\n%translate([20\/2, 30, -10+0.2])\n screw();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'furniture_corner_support\/furniture_corner_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"24224d2c97d6dd99f009dc92eae1afdc894d8b58","subject":"liked snap-on upper platform so much, changed lower to use a similar platform","message":"liked snap-on upper platform so much, changed lower to use a similar platform\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\ntranslate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n%for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.8) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.07) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) difference() {\n tab();\n #translate([0,0,1]) \/\/ pilot hole for plastic screw\n cylinder(r1=PCBhole-.4,r2=PCBhole+.2,h=6,$fn=13);\n }\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6526b01d6952a8cd357b05b4635f09e5ae4a4164","subject":"misc: add v_cumsum","message":"misc: add v_cumsum\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) sum_vec(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2132d5eb3152932bb57423d5221a83fcd2ef366f","subject":"mods to make it a little more useful once full size","message":"mods to make it a little more useful once full size\n","repos":"ajfisher\/snowflakemaker","old_file":"snowflake.scad","new_file":"snowflake.scad","new_contents":"el = 46.1; \/\/ edge length at max radius\nft = 2; \/\/ flake thickness\ncmt = el \/ 4; \/\/ crystal max thickness\nxw = 3; \/\/ extrude width\nnc = 18; \/\/ number of crystals\nbw = 4; \/\/ backbone width\n\npn = \"Test\"; \/\/ person name\n\nmake_2d = true; \/\/ set to true for 2d output (e.g. DXF)\n\n\/\/rs = floor(rands(0,pow(10,6),1)[0]); \/\/ random number seed.\n\/\/rs = 1416261; \/\/ Uncomment to get a consistent snowflake\nrs = 78278400;\n\necho(\"Random number seed: \", rs);\necho(\"Name: \", pn);\necho(\"Edge length: \", el);\n\ncit = xw; \/\/ crystal min thickness\nth = sqrt(3) * el\/2; \/\/ triangle height\n\n\/\/ random vector (x, y, length, direction, thickness)\nrv = rands(0,1,nc*5, seed_value = rs);\n\n\/\/ the idea on how to do this is loosely based on origami snowflakes as at:\n\/\/ http:\/\/www.marthastewart.com\/276331\/how-to-make-paper-snowflakes\n\/\/ combined with Wilson Bentley's observations of snowflakes\n\/\/ http:\/\/en.wikipedia.org\/wiki\/Wilson_Bentley\n\nmodule flake_part(){\n\trotate([0,0,30]) translate([0,-el\/2,0])\n\t\tsquare([bw,el], center = true);\n\tfor(i = [0:nc-1]){\n\t\tassign(yr = sqrt(rv[i*4]),\n\t\t xr = rv[i*4+1] * sqrt(rv[i*4]),\n\t\t rt = (rv[i*4+2]<(1\/3))?0:(rv[i*4+2]<(2\/3))?60:120,\n\t\t sl = rv[i*4+3],\n\t\t ct = (rv[i*4+4])*(rv[i*4+4])){\n\t\t\tif(((rt != 120) || (yr + sl\/2 < 1)) && (sl*el\/2 > xw)){\n\t\t\t\ttranslate([xr*el\/2, -yr*th,0]) rotate(rt)\n\t\t\t\t\tsquare([sl*el\/2, cit + max(0,cmt*ct\/2-cit)], \n\t\t\t\t\t center = true, $fa = 60);\n\t\t\t}\n\t\t}\n\t}\n}\n\nif(make_2d){\n translate([el, el]) {\n for(ri = [0:60:300]){\n rotate([0,0,ri]) flake_part();\n rotate([0,180,ri]) flake_part();\n }\n translate ([el, el]) {\n text(pn, size=1.5);\n }\n }\n} else {\n\tlinear_extrude(height=ft){\n\t\tfor(ri = [0:60:300]){\n\t\t\trotate([0,0,ri]) flake_part();\n\t\t\trotate([0,180,ri]) flake_part();\n\t\t}\n\t}\n}\n\necho(\"Done!\");","old_contents":"el = 46.1; \/\/ edge length at max radius\nft = 2; \/\/ flake thickness\ncmt = el \/ 5; \/\/ crystal max thickness\nxw = 2; \/\/ extrude width\nnc = 18; \/\/ number of crystals\nbw = 2; \/\/ backbone width\n\npn = \"Test\"; \/\/ person name\n\nmake_2d = true; \/\/ set to true for 2d output (e.g. DXF)\n\n\/\/rs = floor(rands(0,pow(10,6),1)[0]); \/\/ random number seed.\n\/\/rs = 1416261; \/\/ Uncomment to get a consistent snowflake\nrs = 16120121;\n\necho(\"Random number seed: \", rs);\necho(\"Name: \", pn);\necho(\"Edge length: \", el);\n\ncit = xw; \/\/ crystal min thickness\nth = sqrt(3) * el\/2; \/\/ triangle height\n\n\/\/ random vector (x, y, length, direction, thickness)\nrv = rands(0,1,nc*5, seed_value = rs);\n\n\/\/ the idea on how to do this is loosely based on origami snowflakes as at:\n\/\/ http:\/\/www.marthastewart.com\/276331\/how-to-make-paper-snowflakes\n\/\/ combined with Wilson Bentley's observations of snowflakes\n\/\/ http:\/\/en.wikipedia.org\/wiki\/Wilson_Bentley\n\nmodule flake_part(){\n\trotate([0,0,30]) translate([0,-el\/2,0])\n\t\tsquare([bw,el], center = true);\n\tfor(i = [0:nc-1]){\n\t\tassign(yr = sqrt(rv[i*4]),\n\t\t xr = rv[i*4+1] * sqrt(rv[i*4]),\n\t\t rt = (rv[i*4+2]<(1\/3))?0:(rv[i*4+2]<(2\/3))?60:120,\n\t\t sl = rv[i*4+3],\n\t\t ct = (rv[i*4+4])*(rv[i*4+4])){\n\t\t\tif(((rt != 120) || (yr + sl\/2 < 1)) && (sl*el\/2 > xw)){\n\t\t\t\ttranslate([xr*el\/2, -yr*th,0]) rotate(rt)\n\t\t\t\t\tsquare([sl*el\/2, cit + max(0,cmt*ct\/2-cit)], \n\t\t\t\t\t center = true, $fa = 60);\n\t\t\t}\n\t\t}\n\t}\n}\n\nif(make_2d){\n translate([el, el]) {\n for(ri = [0:60:300]){\n rotate([0,0,ri]) flake_part();\n rotate([0,180,ri]) flake_part();\n }\n translate ([el, el]) {\n text(pn, size=1.5);\n }\n }\n} else {\n\tlinear_extrude(height=ft){\n\t\tfor(ri = [0:60:300]){\n\t\t\trotate([0,0,ri]) flake_part();\n\t\t\trotate([0,180,ri]) flake_part();\n\t\t}\n\t}\n}\n\necho(\"Done!\");","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e51d5a656e31239726e82f73f7557d8eb6696546","subject":"added mounting panels on sides","message":"added mounting panels on sides\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_contents":"use \n\nmodule cover_shape()\n{\n h1=5;\n polyhedron(\n points = [\n [55, 0, 0], \/\/ 0\n [55, 0, h1], \/\/ 1\n [55, 45, h1], \/\/ 2\n [55, 45, 0], \/\/ 3\n [ 0, 45, h1], \/\/ 4\n [ 0, 45, 0], \/\/ 5\n [ 0, 0, 0], \/\/ 6\n [ 0, 0, h1], \/\/ 7\n [55\/2,0, 30], \/\/ 8\n [55\/2,40,30] \/\/ 9\n ], \n faces = [\n [0,1,2],\n [0,2,3],\n [5,2,4],\n [2,5,3],\n [7,6,4],\n [5,4,6],\n [4,8,7],\n [9,8,4],\n [4,2,9],\n [1,8,9],\n [1,9,2],\n ]\n );\n}\n\nmodule cover()\n{\n extra_size = 2;\n difference()\n {\n minkowski()\n {\n cube(extra_size*[1,1,1]);\n cover_shape();\n }\n \/\/ cut for the regulation screw\n translate([21, 25, 0])\n cube([15, 15, 50]);\n }\n \/\/ side mounting panels\n for(offsetOX = [-10+2, 55+2-2])\n translate([offsetOX, 0, 0])\n cube([10, 20, 2]);\n \/\/ back mounting panel\n translate([(55+2-20)\/2, 45, 0])\n cube([20, 10, 2]);\n}\n\n%translate([18, 0, 0])\n closet_hinge();\ncover();","old_contents":"use \n\nmodule cover_shape()\n{\n h1=5;\n polyhedron(\n points = [\n [55, 0, 0], \/\/ 0\n [55, 0, h1], \/\/ 1\n [55, 45, h1], \/\/ 2\n [55, 45, 0], \/\/ 3\n [ 0, 45, h1], \/\/ 4\n [ 0, 45, 0], \/\/ 5\n [ 0, 0, 0], \/\/ 6\n [ 0, 0, h1], \/\/ 7\n [55\/2,0, 30], \/\/ 8\n [55\/2,40,30] \/\/ 9\n ], \n faces = [\n [0,1,2],\n [0,2,3],\n [5,2,4],\n [2,5,3],\n [7,6,4],\n [5,4,6],\n [4,8,7],\n [9,8,4],\n [4,2,9],\n [1,8,9],\n [1,9,2],\n ]\n );\n}\n\nmodule cover()\n{\n extra_size = 2;\n difference()\n {\n minkowski()\n {\n cube(extra_size*[1,1,1]);\n cover_shape();\n }\n \/\/ cut for the regulation screw\n translate([21, 25, 0])\n cube([15, 15, 50]);\n }\n}\n\n%translate([18, 0, 0])\n closet_hinge();\ncover();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3b0ca66a5b7177cfee1e483eb8aec4005a05582a","subject":"xaxis\/ends: fix bug, used wrong bearing","message":"xaxis\/ends: fix bug, used wrong bearing\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n cylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n \/*translate([0,5,0])*\/\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n \/*translate([0,-1*mm,0])*\/\n \/*pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);*\/\n \/*motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);*\/\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n \/*cubea([xaxis_end_beltpath_length, xaxis_beltpath_width, xaxis_beltpath_height+diag\/2]);*\/\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=false, nut_top=false, show_nut=true, show_rods=true);\n\n translate([150,0,0])\n {\n xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n xaxis_end_idlerholder();\n }\n}\n\nif(false)\n{\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=true, show_nut=false);*\/\n\n translate([100,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=false, show_nut=false);\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n cylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n \/*translate([0,5,0])*\/\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n \/*translate([0,-1*mm,0])*\/\n \/*pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);*\/\n \/*motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);*\/\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n \/*cubea([xaxis_end_beltpath_length, xaxis_beltpath_width, xaxis_beltpath_height+diag\/2]);*\/\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=false, nut_top=false, show_nut=true, show_rods=true);\n\n translate([150,0,0])\n {\n xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n xaxis_end_idlerholder();\n }\n}\n\nif(false)\n{\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=true, show_nut=false);*\/\n\n translate([100,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=false, show_nut=false);\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d9245c9df1e26399fb98ab9204328d7bca69bec2","subject":"xaxis\/ends\/debug: fix idlerholder position","message":"xaxis\/ends\/debug: fix idlerholder position\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"87a2d4727018f18dd2ca816a992729e9a6a88e78","subject":"new frame scoop","message":"new frame scoop\n","repos":"JoeSuber\/QuickerPicker","old_file":"ringpusher.scad","new_file":"ringpusher.scad","new_contents":"cardthick= 41.18\/134;\necho(\"one card thickness (mm) =\", cardthick);\ncardsize=\t[88.05, 63.19, cardthick];\ncardcorner= 5;\nscoopheight=29;\ncardcenter=\tcardsize\/2;\ncardedge=\t[cardsize[0]-cardcorner, cardsize[1]-cardcorner];\necho(\"cardedge =\",cardedge);\n\nmodule singlecard(){\n\tminkowski(){\n\t\tsquare(cardedge, center=true);\n\t\tcircle(cardcorner\/2, $fn=36);\n\t}\n}\n\nmodule squaremm(size, border=3, ht=scoopheight){\n\tdifference(){\n\t\tcube([size, size*cardsize[1]\/cardsize[0], ht], center=true);\n\t\tcube([size-border, size*cardsize[1]\/cardsize[0]-border, ht+.1], center=true);\n\t\techo(\"measurement frame outside is = \",[size,size]);\n\t\techo(\"thickness of walls of frame: \", border\/2); \n\t\techo(\"measurement frame inside is = \",[size-border, size-border]);\n\t\techo(\"height is = \", ht);\n\t}\n}\n\nmodule tray(floorthk=0, scaledif=.05, sideslope=1.4, scooph=scoopheight){\n\ttranslate([0,0,0])\n\tdifference(){\n\t\tunion(){\n\t\t\tlinear_extrude (height=scooph, center=true, convexity=10, twist=0, scale=sideslope){\n\t\t\t\tscale([1+scaledif,1+scaledif,1])\n\t\t\t\t\tsinglecard();\n\t\t\t}\n\t\t\tfor (i=[-cardedge[0]\/2, cardedge[0]\/2]){\n\t\t\t\ttranslate([i,0,0])\n\t\t\t\t\tcube([scooph*(sideslope+scaledif) - scooph*sideslope, \n\t\t\t\t\t\tsideslope*cardsize[1]*(1+scaledif),\n\t\t\t\t\t\tscooph], center=true);\n\t\t\t}\n\t\t}\n\t\ttranslate([0,0,floorthk])\n\t\t\tlinear_extrude (height=scooph*(1+scaledif)+.01, \n\t\t\t\t\t\t\tcenter=true, \n\t\t\t\t\t\t\tconvexity=10,\n\t\t\t\t\t\t\ttwist=0, scale=sideslope){\n\t\t\t\tscale([1,1,1])\n\t\t\t\t\tsinglecard();\n\t\t\t}\n\t\t\/\/singlecard();\t\n\t}\n}\n\n\ntranslate([0,0,-scoopheight\/2]) squaremm(cardsize[0]);\ntray();\n\n\t\t\n\t","old_contents":"","returncode":1,"stderr":"error: pathspec 'ringpusher.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0237a917c40d255f3ed13c0cdafc4a2cd3081e37","subject":"screws\/nut_trap_cut: fix orientation and add cut_screw_close","message":"screws\/nut_trap_cut: fix orientation and add cut_screw_close\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n assert(h>0);\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, cut_screw_close=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n screw_min_nut_dist = 2*mm;\n assert(screw_l+screw_offset >= trap_offset, \"nut_trap_cut: screw_l+screw_offset < trap_offset\");\n assert(screw_offset-trap_offset <= -screw_min_nut_dist, \"nut_trap_cut: screw_offset-trap_offset > -screw_min_nut_dist\");\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n if(cut_screw_close)\n {\n tz(-nut_h\/2)\n tz(-screw_min_nut_dist)\n tz(trap_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n else\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nif(false)\n{\n nut1 = NutHexM5;\n stack(dist=10,axis=X)\n {\n $show_vit=true;\n $preview_mode=true;\n #screw(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=false, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=true, orient=-Z, align=-Z);\n #screw(nut=nut1, h=20, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=25, screw_offset=-5, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, cut_screw_close=true, orient=-Z, align=-Z);\n }\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n assert(h>0);\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n tz(trap_offset)\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"fb6c8a8c297bc8de03e55d02976582c2ad77f293","subject":"Fixing hanging supports; other minor tweaks.","message":"Fixing hanging supports; other minor tweaks.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, depth\/2-70, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.0;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.0mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, depth\/2-70, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"35717452c9aec46f582826b7479d4710840eebaf","subject":"xaxis\/xends: more work, rounding etc","message":"xaxis\/xends: more work, rounding etc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \n\nmotor_mount_wall_thick = 11*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\n\nmodule xaxis_end(with_motor=false, show_motor=false, show_nut=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n union()\n {\n \/*cubea([wx_, xaxis_rod_d*2, wz], align=[with_motor?1:-1,0,0]);*\/\n\n translate([0,-xaxis_zaxis_distance_y,0])\n cuberounda(size=[wx_, zaxis_bearing[1]*2, wz], rounding_radius=3, align=[with_motor?1:-1,0,0], extrasize=[0,motor_mount_wall_thick\/2,0], extrasize_align=[0,1,0]);\n\n \/\/ nut mount\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2])\n {\n union()\n {\n fncylindera(h=wz, d=zaxis_nut[1], align=[0,0,1]);\n translate([-1*x_side*zaxis_nut[1]\/2,0,0])\n {\n cubea([zaxis_nut[1]\/2,zaxis_nut[1],wz],align=[x_side,0,1]);\n cubea([zaxis_nut[1],zaxis_nut[1]\/2,wz],align=[x_side,1,1]);\n }\n }\n }\n }\n\n beltpath_height = xaxis_pulley_inner_d+5*mm;\n beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\n \/\/ belt path\n beltpath_length = 1000;\n cubea([beltpath_length,beltpath_width, beltpath_height]);\n\n diag = pythag_hyp(beltpath_width,beltpath_width)\/2;\n\n for(z=[-1,1])\n translate([0,0,z*beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([beltpath_length, diag, diag]);\n\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(zaxis_bearing, orient=[0,0,1], show_zips=false);\n\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n fncylindera(d=lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick+xaxis_pulley[2]+5*mm, orient=[0,1,0], align=[0,1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, .1, z*screw_dist\/2])\n {\n \/\/ screw\n fncylindera(d=lookup(NemaMountingHoleDiameter, xaxis_motor), h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ screw head\n translate([0,-7,0])\n fncylindera(d=lookup(NemaMountingHoleDiameter, xaxis_motor)*1.9, h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n fncylindera(h=wz+1, d=zaxis_nut[2]*1.2, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n translate([0,-7,0])\n pulley(pulley_2GT_20T, align, orient=[0,1,0], align=[0,-1,0]);\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ndebug=false;\nif(debug)\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=true, show_nut=true);\n\n translate([150,0,0])\n xaxis_end(with_motor=false, show_motor=true, show_nut=true);\n}\n\n\/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\/*translate([100,-10,0])*\/\n\/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n","old_contents":"include \ninclude \n\ninclude \ninclude \n\nmotor_mount_wall_thick = 10*mm;\nwz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\nwy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,0,0];\n\nmodule xaxis_end(with_motor=false, show_motor=false, show_nut=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n union()\n {\n cubea([wx_, xaxis_rod_d*2, wz], align=[with_motor?1:-1,0,0]);\n\n translate([0,-xaxis_zaxis_distance_y,0])\n cubea([wx_, zaxis_bearing[1]*2, wz], align=[with_motor?1:-1,0,0]);\n\n if(with_motor)\n {\n translate(xaxis_end_motor_offset)\n cubea([xaxis_end_motorsize, motor_mount_wall_thick, wz], align=[0,1,0]);\n }\n \/\/ nut mount\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2])\n {\n union()\n {\n fncylindera(h=wz, d=zaxis_nut[1], align=[0,0,1]);\n translate([-1*x_side*zaxis_nut[1]\/2,0,0])\n {\n cubea([zaxis_nut[1]\/2,zaxis_nut[1],wz],align=[x_side,0,1]);\n cubea([zaxis_nut[1],zaxis_nut[1]\/2,wz],align=[x_side,1,1]);\n }\n }\n }\n }\n\n beltpath_height = xaxis_pulley_inner_d+5*mm;\n beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\n \/\/ belt path\n beltpath_length = 1000;\n cubea([beltpath_length,beltpath_width, beltpath_height]);\n\n diag = pythag_hyp(beltpath_width,beltpath_width)\/2;\n\n for(z=[-1,1])\n translate([0,0,z*beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([beltpath_length, diag, diag]);\n\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(zaxis_bearing, orient=[0,0,1], show_zips=false);\n\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n translate(xaxis_end_motor_offset)\n translate([0,motor_mount_wall_thick+.1,0])\n fncylindera(d=lookup(NemaMountingHoleDiameter, xaxis_motor), h=wy, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-motor_mount_wall_thick,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n translate(xaxis_end_motor_offset)\n translate([0,motor_mount_wall_thick+.1,0])\n fncylindera(d=lookup(NemaMountingHoleDiameter, xaxis_motor)*1.9, h=wy, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ nut mount\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n fncylindera(h=wz+1, d=zaxis_nut[2]*1.2, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n pulley(pulley_2GT_20T, align, orient=[0,1,0]);\n\n translate([0,motor_mount_wall_thick+.1,0])\n translate(xaxis_end_motor_offset)\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n\n %if(show_nut)\n {\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ndebug=false;\nif(debug)\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=true, show_nut=true);\n\n translate([150,0,0])\n xaxis_end(with_motor=false, show_motor=true, show_nut=true);\n}\n\nxaxis_end(with_motor=true, show_motor=false, show_nut=false);\ntranslate([100,-10,0])\nxaxis_end(with_motor=false, show_motor=false, show_nut=false);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ad79140431d1e446fef5c32a51cb5ccac71ae1c8","subject":"x\/carriage: increase bearing dist","message":"x\/carriage: increase bearing dist\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/2;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_filapath_offset = [0, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\n\/*explode=[0,0,0];*\/\nexplode=[0,10,0];\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = 20*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_filapath_offset = [0, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\n\/*explode=[0,0,0];*\/\nexplode=[0,10,0];\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c2228aada43bb166149e1ad3ad38d1386b0578f7","subject":"metric-screw: reduce head cut dia to 1.5x","message":"metric-screw: reduce head cut dia to 1.5x\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 1.5 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=1.25, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=1.25, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7c9c7b39f9caa8624c229aeb9871f8a9194238e6","subject":"support redesigned for 24.5mm screws, instead of 34.5mm ones","message":"support redesigned for 24.5mm screws, instead of 34.5mm ones\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"furniture_corner_support\/furniture_corner_support.scad","new_file":"furniture_corner_support\/furniture_corner_support.scad","new_contents":"$fn=30;\n\nmodule screw()\n{\n translate([0, 0, 20.5])\n cylinder(r=8\/2, h=4);\n cylinder(r=3.5\/2, h=24.5);\n}\n\nmodule body()\n{\n difference()\n {\n cube([15, 25, 25]);\n rotate([45,0,0])\n translate([-1, 0, 0])\n cube([15+2, 40, 30]);\n }\n}\n\nmodule screw_hole()\n{\n translate([0,0,20.5-10])\n cylinder(r=(8+1)\/2, h=5+10);\n cylinder(r=(3.5+0.5)\/2, h=20.5-10);\n}\n\n\nmodule main()\n{\n difference()\n {\n body();\n translate([15\/2, 17, 0])\n screw_hole();\n }\n}\n\n\nmain();\n%translate([15\/2, 17, -10+0.5])\n screw();\n","old_contents":"$fn=30;\n\nmodule screw()\n{\n translate([0,0,31.2])\n cylinder(r=8\/2, h=4);\n cylinder(r=3.5\/2, h=31.2);\n}\n\nmodule body()\n{\n difference()\n {\n cube([20, 40, 40]);\n rotate([45,0,0])\n translate([-1, 0, 0])\n cube([20+2, 60, 30]);\n }\n}\n\nmodule screw_hole()\n{\n translate([0,0,21])\n cylinder(r=(8+1)\/2, h=5+10);\n cylinder(r=(3.5+0.5)\/2, h=21);\n}\n\n\nmodule main()\n{\n difference()\n {\n body();\n translate([20\/2, 30, 0])\n screw_hole();\n }\n}\n\n\nmain();\n%translate([20\/2, 30, -10+0.2])\n screw();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c4557cf2db3292b17c8d1f8ad1d7133a4bcf777b","subject":"main: Tweak extruder positions","message":"main: Tweak extruder positions\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*148,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*30,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n \/*x_carriage_extruder(show_vitamins=true);*\/\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e9bf68140e03ed4d22488512e4523b79ccc03864","subject":"added CAD for cc3200-based remote case","message":"added CAD for cc3200-based remote case\n","repos":"dronus\/VisSynthWeb,dronus\/VisSynthWeb,dronus\/VisSynthWeb","old_file":"remote_case.scad","new_file":"remote_case.scad","new_contents":"$fs=1;\n$fa=1;\n\n\ndisplay_w=85.5;\ndisplay_h=28.5;\n\nborder=10;\nw=display_w+2*10;\nl=display_h+2*10+2*14;\n\nmainboard_w=94;\nmainboard_l=58.4;\n\nwall=2;\n\n\/\/ TODO bei dieser H\u00f6he muss Akku \/ Mainboard neben den UI-Einheiten liegen?\nh=15;\n\nencoder_d=7;\n\n\nmodule aa_cell()\n{\n\trotate(90,[1,0,0]) color([.3,.3,.7]){\n\t\tcylinder(h=49,r=14\/2,center=true);\n\t\ttranslate([0,0,-49\/2-1\/2]) cylinder(h=1,r=2,center=true);\n\t}\n}\n\nmodule bevel_cube(size,bevel)\n{\n\thull()\n\t{\n\t\tcube(size-[0,bevel,bevel],center=true);\n\t\tcube(size-[bevel,bevel,0],center=true);\n\t\tcube(size-[bevel,0,bevel],center=true);\n\t}\n}\n\nmodule mainboard()\n{\n\tcolor([.7,.3,0]) cube([mainboard_w,mainboard_l,2],center=true);\n}\n\nmodule knobs_and_display(inner_only)\n{\n\ttranslate([0,0,-2.5+0.1-(inner_only ? wall : 0)]) {\n\t\tcolor([.4,.4,.4]) cube([display_w,display_h,5],center=true);\n\t\tif(!inner_only) color([.2,1.,.2]) translate([0,0,5\/2]) cube([display_w*.9,display_h*.9,.1],center=true);\n\t}\n\t\n\tfor(x=[-1,1])\n\t for(y=[-1,1])\n\t translate([x*display_w\/4,y*(display_h\/2+24\/2),-wall])\n\t\t color([.4,.4,.4]) union(){\n\t\t\t\tif(!inner_only) cylinder(r=encoder_d\/2,h=15);\n\t\t\t\ttranslate([0,0,-3]) cube([14,14,6],center=true);\n\t\t\t}\n}\n\n\n\nmodule meld()\n{\n\thull() intersection() \n {\n\t\tchild(0);\n\t\tfor (a = [1:$children-1]) child(a);\n\t}\n\tfor (a = [1:$children-1]) child(a);\n}\n\n\nmodule inner_right()\n{\n y=-8;\n\tcell_y=-0;\n\ttranslate([0,0,y-1]) mainboard();\n\tknobs_and_display(true);\t\n}\n\n\nmodule inner_left()\n{\n y=-8;\n\tcell_y=-0;\n\ttranslate([-w\/2-3.1,0,y+cell_y]) aa_cell();\n\ttranslate([-w\/2-18,0,y+cell_y]) aa_cell();\n}\n\n\nmodule inner_hull()\n{\n y=-8;\n\tcell_y=-0;\n\n meld() {\n\t\ttranslate([-55,0,0]) cube([60,100,40],center=true);\n\t\thull() inner_left();\n\t\thull() inner_right();\n\t}\n}\n\nmodule inner()\n{\n\tinner_left();\n\tinner_right();\n}\n\n\nknobs_and_display(false);\n\ninner();\n\n%difference()\n{\t\n\tminkowski()\n\t{\n\t\tbevel_cube([wall*2,wall*2,wall*2],wall);\n\t\tinner_hull();\n\t}\n\tminkowski() \n\t{\n\t\tknobs_and_display(false);\n\t\tcube([.2,.2,.2],center=true);\n\t}\n}\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'remote_case.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"dfd80576824ea9a1594397ceccc46cf09bdbc466","subject":"fanduct: wip tweaks","message":"fanduct: wip tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"fanduct.scad","new_file":"fanduct.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 25, ss.x\/2, ss.y, 60, 00, .01],\n [ 2.5+ss.x\/4, -21, 21, 5+ss.x\/2, ss.y, 60, 00, .1 ],\n \/*[ 15, -18, 30, 11, 20, 13, 0, .4 ],*\/\n \/*[ 17, -8, 20, 11, 17, 11, -10, .5 ],*\/\n [ 16, -10, 15, 17, 20, 30, -15, .7 ],\n [ 15, -4, 10, 11, 19, 20, -30, .7 ],\n [ 12, 0, 5, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($debug_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, $debug_mode=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n rz(180)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n rz(180)\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nif(false)\n{\n $debug_mode=true;\n fanduct();\n}\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($debug_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n \/*showcontrols(A);*\/\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nif(false)\n{\n $debug_mode=true;\n fanduct();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"437b0b3cb9122269b59ad1aeb1517a08215b35d7","subject":"some constant","message":"some constant\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/AAACell-refactor.scad","new_file":"class1\/exercise\/AAACell-refactor.scad","new_contents":"HEIGHT = 44.5;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\n\nDIAMETER_BASE = 6;\nBORDER_RADIUS_BASE = 0.3;\n\n\nmodule RenderCell()\n{\n\nnippleHeight = 0.8; \/\/Height from spec (Min: 0.8)\nnippleDia = 3; \/\/Diameter from spec (Max: 3.8)\nnippleFilletRad = 0.2;\nnippleShoulderDia = 6;\n\nlabelThickness = 0.005; \/\/Thickness of plastic\n\n\/\/Top face of nipple\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleFilletRad])\n cylinder(\n h = nippleFilletRad, \n d = (nippleDia - (2 * nippleFilletRad)),\n $fn = 100);\n \n\/\/First shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleFilletRad])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleDia\/2)-nippleFilletRad, 0, 0])\n circle(r = nippleFilletRad, $fn = 100);\n\n\/\/Main nipple cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-(nippleHeight - nippleFilletRad)])\n cylinder(\n h = (nippleHeight - (nippleFilletRad + nippleFilletRad)),\n d = nippleDia,\n $fn = 100);\n\n\/\/Main nipple cylinder; base fillet\ncolor(\"LightGrey\")\ndifference()\n{\n translate([0,0,nippleFilletRad - nippleHeight])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleDia\/2), 0, 0])\n square((nippleFilletRad),(nippleFilletRad));\n\n translate([0,0,(2 * nippleFilletRad) - nippleHeight])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleDia\/2)+ nippleFilletRad, 0, 0])\n circle(r = nippleFilletRad, $fn = 100);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleHeight])\n cylinder(\n h = nippleFilletRad,\n d = nippleShoulderDia - (2 * nippleFilletRad),\n $fn = 100);\n \n\/\/Nipple base shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleHeight])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleShoulderDia\/2)-nippleFilletRad, 0, 0])\n circle(r = nippleFilletRad, $fn = 100);\n\n\/\/Top face of main body\ntranslate([0,0,-(nippleHeight + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n \n\/\/Body top shoulder\ntranslate([0,0,-(nippleHeight + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (nippleHeight + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = 100);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n\n\/\/Base cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-(HEIGHT_BODY + BORDER_RADIUS_BASE)])\n cylinder(\n h = BORDER_RADIUS_BASE, \n d = (DIAMETER_BASE - (2 * BORDER_RADIUS_BASE)),\n $fn = 100);\n\n\/\/Base shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-(HEIGHT_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE\/2)-BORDER_RADIUS_BASE, 0, 0])\n circle(r = BORDER_RADIUS_BASE, $fn = 100);\n}\nRenderCell();","old_contents":"\/\/ AAA cell\n\/\/ https:\/\/github.com\/Mechabotix\/OpenSCAD\n\nmodule RenderCell()\n{\n\/\/Top of cell is origin\ntotalHeight = 44.5; \/\/Height of cell from spec (Max: 44.5 Min 43.3)\n\nbodyDia = 10.4; \/\/Diameter from spec (Max: 10.5 not including label)\nbodyChamferRad = 0.5;\nbaseDia = 6;\nbaseFilletRad = 0.3;\n\nnippleHeight = 0.8; \/\/Height from spec (Min: 0.8)\nnippleDia = 3; \/\/Diameter from spec (Max: 3.8)\nnippleFilletRad = 0.2;\nnippleShoulderDia = 6;\n\nlabelThickness = 0.005; \/\/Thickness of plastic\n\n\/\/Top face of nipple\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleFilletRad])\n cylinder(\n h = nippleFilletRad, \n d = (nippleDia - (2 * nippleFilletRad)),\n $fn = 100);\n \n\/\/First shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleFilletRad])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleDia\/2)-nippleFilletRad, 0, 0])\n circle(r = nippleFilletRad, $fn = 100);\n\n\/\/Main nipple cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-(nippleHeight - nippleFilletRad)])\n cylinder(\n h = (nippleHeight - (nippleFilletRad + nippleFilletRad)),\n d = nippleDia,\n $fn = 100);\n\n\/\/Main nipple cylinder; base fillet\ncolor(\"LightGrey\")\ndifference()\n{\n translate([0,0,nippleFilletRad - nippleHeight])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleDia\/2), 0, 0])\n square((nippleFilletRad),(nippleFilletRad));\n\n translate([0,0,(2 * nippleFilletRad) - nippleHeight])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleDia\/2)+ nippleFilletRad, 0, 0])\n circle(r = nippleFilletRad, $fn = 100);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleHeight])\n cylinder(\n h = nippleFilletRad,\n d = nippleShoulderDia - (2 * nippleFilletRad),\n $fn = 100);\n \n\/\/Nipple base shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-nippleHeight])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(nippleShoulderDia\/2)-nippleFilletRad, 0, 0])\n circle(r = nippleFilletRad, $fn = 100);\n\n\/\/Top face of main body\ntranslate([0,0,-(nippleHeight + bodyChamferRad)])\n cylinder(\n h = bodyChamferRad, \n d = (bodyDia - (2 * bodyChamferRad)),\n $fn = 100);\n \n\/\/Body top shoulder\ntranslate([0,0,-(nippleHeight + bodyChamferRad)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(bodyDia\/2)-bodyChamferRad, 0, 0])\n circle(r = bodyChamferRad, $fn = 100);\n\n\/\/Main body cylinder\ntranslate([0,0,-(totalHeight - bodyChamferRad)])\n cylinder(\n h = (totalHeight - (nippleHeight + (2* bodyChamferRad))),\n d = bodyDia,\n $fn = 100);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(totalHeight - bodyChamferRad)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(bodyDia\/2)-bodyChamferRad, 0, 0])\n circle(r = bodyChamferRad, $fn = 100);\n \n\/\/Bottom face of body\ntranslate([0,0,-(totalHeight)])\n cylinder(\n h = bodyChamferRad, \n d = (bodyDia - (2 * bodyChamferRad)),\n $fn = 100);\n\n\/\/Base cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-(totalHeight + baseFilletRad)])\n cylinder(\n h = baseFilletRad, \n d = (baseDia - (2 * baseFilletRad)),\n $fn = 100);\n\n\/\/Base shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-(totalHeight)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(baseDia\/2)-baseFilletRad, 0, 0])\n circle(r = baseFilletRad, $fn = 100);\n}\nRenderCell();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"441dc13a637540bbf1eb016f5356bbe58b30cad0","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"303bdc1e5a75286bcd2101269ced46c1ec790f11","subject":"misc: add v_{mod,cross,dot,unitv,anglev} functions","message":"misc: add v_{mod,cross,dot,unitv,anglev} functions\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a117e66c57c908e0a582dd9f86fab7e9ea4f5d53","subject":"misc: Add v_itrlen()","message":"misc: Add v_itrlen()\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position iV\nfunction sum_vec(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position iV\nfunction sum_vec(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1d6dd0e5d2d939aeda69c2dcbc2756dffae39d83","subject":"x\/carriage: minor reorganize of modules","message":"x\/carriage: minor reorganize of modules\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n \/*x_carriage_extruder(with_sensormount=x<0);*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fb0c72c746e6f0cfe027cc33779b562731b1f536","subject":"x\/carriage: use shorthand transforms for beltpath","message":"x\/carriage: use shorthand transforms for beltpath\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n ty(xaxis_carriage_beltpath_offset_y)\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n ty(xaxis_carriage_beltpath_offset_y)\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"28b1fcac75455069bb95bf9312554ea0466f0d36","subject":"removed dead code","message":"removed dead code\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/bottle_adapter.scad","new_file":"pop_rocket\/bottle_adapter.scad","new_contents":"eps=0.01;\nwall=1;\nhose_phi=6;\nbottle_screw_phi=27.4 + 0.6;\nbottle_screw_h=9;\nnarrowing_h=10;\n\nmodule adapter()\n{\n \/\/ bottom ring\n difference()\n {\n $fn=200;\n cylinder(d=bottle_screw_phi+2*wall, h=bottle_screw_h);\n translate([0,0,-eps])\n cylinder(d=bottle_screw_phi, h=bottle_screw_h+2*eps);\n }\n translate([0, 0, bottle_screw_h])\n {\n \/\/ adapter\n difference()\n {\n $fn=100;\n cylinder(d2=hose_phi, d1=bottle_screw_phi+2*wall, h=10);\n translate([0,0,-eps])\n cylinder(d2=hose_phi-2*wall, d1=bottle_screw_phi, h=10+eps);\n }\n \/\/ top connector\n translate([0, 0, narrowing_h])\n difference()\n {\n $fn=100;\n cylinder(d=hose_phi, h=10);\n translate([0,0,-eps])\n cylinder(d=hose_phi-2*wall, h=10+2*eps);\n }\n }\n}\n\nadapter();\n","old_contents":"eps=0.01;\nwall=1;\nhose_phi=6;\nbottle_screw_phi=27.4 + 0.6;\nbottle_screw_h=9;\nnarrowing_h=10;\n\nmodule adapter()\n{\n \/\/ bottom ring\n\/\/ if(0)\n difference()\n {\n $fn=200;\n cylinder(d=bottle_screw_phi+2*wall, h=bottle_screw_h);\n translate([0,0,-eps])\n cylinder(d=bottle_screw_phi, h=bottle_screw_h+2*eps);\n }\n translate([0, 0, bottle_screw_h])\n {\n \/\/ adapter\n difference()\n {\n $fn=100;\n cylinder(d2=hose_phi, d1=bottle_screw_phi+2*wall, h=10);\n translate([0,0,-eps])\n cylinder(d2=hose_phi-2*wall, d1=bottle_screw_phi, h=10+eps);\n }\n \/\/ top connector\n\/\/ if(0)\n translate([0, 0, narrowing_h])\n difference()\n {\n $fn=100;\n cylinder(d=hose_phi, h=10);\n translate([0,0,-eps])\n cylinder(d=hose_phi-2*wall, h=10+2*eps);\n }\n }\n}\n\nadapter();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6143366c86a3dd476c2b18a8ca90ee58bd5ec715","subject":"on-door wall mounting","message":"on-door wall mounting\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/mount.scad","new_file":"tablet_toilet_mount\/mount.scad","new_contents":"module mount()\n{\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [ 0, 7, 0], \/\/ 1\n [20, 7, 0], \/\/ 2\n [20, 0, 0], \/\/ 3\n [20, 0, 45], \/\/ 4\n [ 0, 0, 45] \/\/ 5\n ],\n faces = [\n \/\/ side walls\n [0,1,5],\n [2,3,4],\n \/\/ floor\n [2,1,0],\n [3,2,0],\n \/\/back wall\n [4,3,0],\n [5,4,0],\n \/\/ front wall\n [1,2,5],\n [2,4,5]\n ]\n );\n}\n\n\nrotate([90, 0, 0])\n{\n mount();\n cube([20, 33+5+2, 3]);\n translate([0, 33+5, 0])\n cube([20, 2, 10]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tablet_toilet_mount\/mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"284506a3349cade40ed170ea48ce76881b2e2902","subject":"Clearance tweaks based on recent print.","message":"Clearance tweaks based on recent print.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/piCameraEnclosure.scad","new_file":"designs\/piCameraEnclosure.scad","new_contents":"\/\/ Modified from: https:\/\/github.com\/luisibanez\/ShapesFor3DPrinting\/tree\/master\/OpenSCA\n\nmodule piCameraEnclosure() \n{\n\n\tmodule piCameraBackCoverBevel(width, height, clearance) {\n\t\tc = clearance;\n\t\thh = height \/ 2;\n\t\thw = ( width \/ 2 ) + c;\n\t\the = hw + 1.5 + c;\n\t\tpolyhedron(\n\t\t\tpoints = [\n\t\t\t\t[ hw, -15-c, -hh-c ],\n\t\t\t\t[ hw, 15+c, -hh-c ], \n\t\t\t\t[ hw, 15+c, hh ], \n\t\t\t\t[ hw, -15-c, hh ],\n\t\t\t\t[ he, -15-c, -hh-c ],\n\t\t\t\t[ he, 15+c, -hh-c ] \n\t\t\t\t], \n\t\t\tfaces = [\n\t\t\t\t[ 5, 1, 0, 4],\n\t\t\t\t[ 4, 0, 3 ],\n\t\t\t\t[ 2, 1, 5 ],\n\t\t\t\t[ 5, 4, 3, 2],\n\t\t\t\t[ 0, 1, 2, 3],\n\t\t\t]\n\t\t);\n\t}\n\n\tmodule piCameraBackCoverBevels(width, height, clearance) {\n\t\tunion() {\n\t\t\tpiCameraBackCoverBevel(width, height, clearance);\n\t\t\tmirror([1,0,0])\n\t\t\t\tpiCameraBackCoverBevel(width, height, clearance);\n\t\t}\n\t}\n\n\tmodule piCameraBackCover(width, height, clearance=0, indent=true) {\n\t\tc = 2*clearance;\n\t\ttranslate([0,-5.5,10-height\/2])\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tpiCameraBackCoverBevels(width, height, clearance);\n\t\t\t\t\tcube(size=[width+c,30+c,height+c],center=true);\n\t\t\t\t}\n\t\t\t\ttranslate([0,12,0])\n\t\t\t\t\tcube(size=[width-5-c,7,height+c],center=true);\n\t\t\t\tif (indent)\n\t\t\t\t\ttranslate([0,-12,height\/2])\n\t\t\t\t\trotate([0,90,0])\n\t\t\t\t\t\tcylinder(r=1, h=width-0.5, center=true, $fn=20);\n\t\t\t}\n\t}\n\n\tmodule cableOpening() {\n\t\ttranslate([0,14,8.1])\n\t\t\tcube(size=[17,12,4],center=true);\n\t}\n\n\tmodule chipOpening() {\n\t\tclearance = 0.5;\n\t\tc = 2 * clearance;\n\t\ttranslate([0,-9.5,5])\n\t\t\tcube(size=[8+c,10+c,4],center=true);\n\t}\n\n\tmodule lensOpening() {\n\t\tclearance = 0.5;\n\t\tc = 2 * clearance;\n\t\ttranslate([0,0,2.5])\n\t\t\tcube(size=[8+c,8+c,5+c], center=true);\n\t}\n\n\tmodule boardOpening() {\n\t\tclearance = 0.3;\n\t\tc = 2 * clearance;\n\t\ttranslate([0,-3,7.5])\n\t\t\tcube(size=[25+c,24+c,5+clearance], center=true);\n\t}\n\n\tmodule cameraFrame() {\n\t\ttranslate([0,-0.5,5])\n\t\t\tcube(size=[40,40,10], center=true);\n\t}\n\n\tmodule roundedCorner(radius) {\n\t\ttranslate([-radius, -radius, 0])\n\t\tdifference() {\n\t\t\ttranslate([0,0,-50])\n\t\t\t\tcube(size=[radius+0.1,radius+0.1,100]);\n\t\t\tcylinder(h=100, r=radius, $fn=50, center=true);\n\t\t}\n }\n\n module cornerRounding(radius) {\n\t\t\/\/ vertical corners\n\t\ttranslate([20,19.5,0])\n\t\t\troundedCorner(radius);\n\t\ttranslate([-20,19.5,0])\n\t\trotate([0,0,90])\n\t\t\troundedCorner(radius);\n\t\ttranslate([-20,-20.5,0])\n\t\trotate([0,0,180])\n\t\t\troundedCorner(radius);\n\t\ttranslate([20,-20.5,0])\n\t\trotate([0,0,-90])\n\t\t\troundedCorner(radius);\n\n\t\t\/\/ top corners\n\t\ttranslate([-20,0,10])\n\t\trotate([0,-90,0])\n\t\trotate([90,0,0])\n\t\t\troundedCorner(radius\/2);\n\t\ttranslate([20,0,10])\n\t\trotate([90,0,0])\n\t\t\troundedCorner(radius\/2);\n }\n\n\tmodule piCameraAdapter() {\n\t\tdifference() {\n\t\t\tcameraFrame();\n\t\t\tboardOpening();\n\t\t\tchipOpening();\n\t\t\tcableOpening();\n\t\t\tlensOpening();\n\t\t\tcornerRounding(radius=8);\n\t\t\tpiCameraBackCover(width=27, height=2, clearance=0.3, indent=false);\n\t\t}\n\t}\n\n\tunion() {\n\t\tpiCameraAdapter();\n\t\t\/\/ Comment out translate to see\n\t\t\/\/ back cover in place.\n\t\ttranslate([40,5,-8])\n\t\t\tpiCameraBackCover(width=27, height=2);\n\t}\n}\n\npiCameraEnclosure();\n","old_contents":"\/\/ Modified from: https:\/\/github.com\/luisibanez\/ShapesFor3DPrinting\/tree\/master\/OpenSCA\r\n\r\nmodule piCameraEnclosure() \r\n{\r\n\r\n\tmodule piCameraBackCoverBevel(clearance) {\r\n\t\tc = clearance;\r\n\t\thw = ( 25 \/ 2 ) + c;\r\n\t\the = hw + 1.5 + c;\r\n\t\tpolyhedron(\r\n\t\t\tpoints = [\r\n\t\t\t\t[ hw, -15-c, -1-c ],\r\n\t\t\t\t[ hw, 15+c, -1-c ], \r\n\t\t\t\t[ hw, 15+c, 1 ], \r\n\t\t\t\t[ hw, -15-c, 1 ],\r\n\t\t\t\t[ he, -15-c, -1-c ],\r\n\t\t\t\t[ he, 15+c, -1-c ] \r\n\t\t\t\t], \r\n\t\t\tfaces = [\r\n\t\t\t\t[ 5, 1, 0, 4],\r\n\t\t\t\t[ 4, 0, 3 ],\r\n\t\t\t\t[ 2, 1, 5 ],\r\n\t\t\t\t[ 5, 4, 3, 2],\r\n\t\t\t\t[ 0, 1, 2, 3],\r\n\t\t\t]\r\n\t\t);\r\n\t}\r\n\r\n\tmodule piCameraBackCoverBevels(clearance) {\r\n\t\tunion() {\r\n\t\t\tpiCameraBackCoverBevel(clearance);\r\n\t\t\tmirror([1,0,0])\r\n\t\t\t\tpiCameraBackCoverBevel(clearance);\r\n\t\t}\r\n\t}\r\n\r\n\tmodule piCameraBackCover(clearance=0, indent=true) {\r\n\t\tc = 2*clearance;\r\n\t\ttranslate([0,-5.5,9])\r\n\t\t\tdifference() {\r\n\t\t\t\tunion() {\r\n\t\t\t\t\tpiCameraBackCoverBevels(clearance);\r\n\t\t\t\t\tcube(size=[25+c,30+c,2+c],center=true);\r\n\t\t\t\t}\r\n\t\t\t\ttranslate([0,12,0])\r\n\t\t\t\t\tcube(size=[20.5-c,7,3],center=true);\r\n\t\t\t\tif (indent)\r\n\t\t\t\t\ttranslate([0,-12,1.5])\r\n\t\t\t\t\trotate([0,90,0])\r\n\t\t\t\t\t\tcylinder(r=1, h=40, center=true, $fn=20);\r\n\t\t\t}\r\n\t}\r\n\r\n\tmodule cableOpening() {\r\n\t\ttranslate([0,14,8.1])\r\n\t\t\tcube(size=[17,12,4],center=true);\r\n\t}\r\n\r\n\tmodule chipOpening() {\r\n\t\tclearance = 0.5;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,-9.5,5])\r\n\t\t\tcube(size=[8+c,10+c,4],center=true);\r\n\t}\r\n\r\n\tmodule lensOpening() {\r\n\t\tclearance = 0.5;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,0,2.5])\r\n\t\t\tcube(size=[8+c,8+c,5+c], center=true);\r\n\t}\r\n\r\n\tmodule boardOpening() {\r\n\t\tclearance = 0.2;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,-3,7.5])\r\n\t\t\tcube(size=[25+c,24+c,5+clearance], center=true);\r\n\t}\r\n\r\n\tmodule cameraFrame() {\r\n\t\ttranslate([0,-0.5,5])\r\n\t\t\tcube(size=[40,40,10], center=true);\r\n\t}\r\n\r\n\tmodule roundedCorner(radius) {\r\n\t\ttranslate([-radius, -radius, 0])\r\n\t\tdifference() {\r\n\t\t\ttranslate([0,0,-50])\r\n\t\t\t\tcube(size=[radius+0.1,radius+0.1,100]);\r\n\t\t\tcylinder(h=100, r=radius, $fn=50, center=true);\r\n\t\t}\r\n }\r\n\r\n module cornerRounding(radius) {\r\n\t\t\/\/ vertical corners\r\n\t\ttranslate([20,19.5,0])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([-20,19.5,0])\r\n\t\trotate([0,0,90])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([-20,-20.5,0])\r\n\t\trotate([0,0,180])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([20,-20.5,0])\r\n\t\trotate([0,0,-90])\r\n\t\t\troundedCorner(radius);\r\n\r\n\t\t\/\/ top corners\r\n\t\ttranslate([-20,0,10])\r\n\t\trotate([0,-90,0])\r\n\t\trotate([90,0,0])\r\n\t\t\troundedCorner(radius\/2);\r\n\t\ttranslate([20,0,10])\r\n\t\trotate([90,0,0])\r\n\t\t\troundedCorner(radius\/2);\r\n }\r\n\r\n\tmodule piCameraAdapter() {\r\n\t\tdifference() {\r\n\t\t\tcameraFrame();\r\n\t\t\tboardOpening();\r\n\t\t\tchipOpening();\r\n\t\t\tcableOpening();\r\n\t\t\tlensOpening();\r\n\t\t\tcornerRounding(radius=8);\r\n\t\t\tpiCameraBackCover(clearance=0.3, indent=false);\r\n\t\t}\r\n\t}\r\n\r\n\tunion() {\r\n\t\tpiCameraAdapter();\r\n\t\t\/\/ Comment out translate to see\r\n\t\t\/\/ back cover in place.\r\n\t\ttranslate([40,5,-8])\r\n\t\t\tpiCameraBackCover();\r\n\t}\r\n}\r\n\r\npiCameraEnclosure();\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"34fcb6227ae5941813942e8536122e13b5e47f37","subject":"add sturdy box here for now","message":"add sturdy box here for now\n","repos":"kak-bo-che\/zen_toolworks_quelab","old_file":"src\/sturdy_box\/sturdy_box.scad","new_file":"src\/sturdy_box\/sturdy_box.scad","new_contents":"$fn=20;\n\ncase_length=300;\ncase_width=300;\nmin_height=40;\npanel_thickness=3.1; \/\/3.1, 1.55, 5.7 ?\n\ncorner_pieces = floor(min_height\/panel_thickness);\ncase_height=corner_pieces*panel_thickness;\ncorner_radius=10;\nlength_slots=13;\nwidth_slots=13;\n\nhole_size=3.2;\npart_separation=10;\n\nmodule corner_stack(hex_hole=false){\n hex_hole_size=5.4;\n radius = corner_radius;\n difference() {\n circle(r=radius);\n translate([radius, 0]) square([radius, panel_thickness], center=true);\n rotate(90) translate([radius, 0]) square([radius, panel_thickness], center=true);\n if (hex_hole){\n circle(d=hex_hole_size, $fn=6);\n } else {\n circle(d=hole_size);\n }\n }\n}\n\nmodule make_slots(length, slot_count, panel_thickness, reverse=false, slop=0){\n\n slot_size=length\/slot_count;\n offset= reverse?slot_size:0;\n odd= (slot_count%2) == 1?1:0;\n extra = odd && !reverse?1:0;\n\n for(x=[0:floor((slot_count + extra)\/2) - 1]){\n translate([2*x*slot_size + offset -slop\/2, 0]) square([slot_size + slop, panel_thickness]);\n }\n}\n\nmodule rounded_square(width, height, radius){\n hull(){\n translate([radius, radius]) circle(r=radius);\n translate([width - radius, radius]) circle(r=radius);\n translate([radius, height - radius]) circle(r=radius);\n translate([width - radius, height - radius]) circle(r=radius);\n }\n}\n\nmodule rounded_square_clamping_holes(length, width, radius, hole_size){\n translate([radius, radius]) circle(d=hole_size);\n translate([length - radius, radius]) circle(d=hole_size);\n translate([radius, width - radius]) circle(d=hole_size);\n translate([length - radius, width - radius]) circle(d=hole_size);\n}\n\nmodule width_side(){\n plate_height = case_height;\n plate_width = case_width - 3*corner_radius;\n union(){\n square([plate_height, plate_width]);\n translate([plate_height + panel_thickness -0.0001, 0]) rotate(90) make_slots(case_width - 3*corner_radius, width_slots, panel_thickness, true);\n rotate(90) make_slots(case_width - 3*corner_radius, width_slots, panel_thickness, true);\n }\n}\n\nmodule length_side(){\n plate_height = case_height;\n plate_width = case_length - 3*corner_radius;\n standoff_height=5;\n centered_board_offset = (case_length - 2*corner_radius - board_widths)\/2;\n union(){\n square([plate_width, plate_height]);\n translate([0, plate_height]) make_slots(case_length - 3*corner_radius, length_slots, panel_thickness, true);\n translate([0, - panel_thickness ]) make_slots(case_length - 3*corner_radius, length_slots, panel_thickness, true);\n }\n}\n\nmodule base(){\n difference() {\n rounded_square(case_length, case_width, corner_radius);\n translate([1.5*corner_radius, corner_radius - panel_thickness\/2 ]) make_slots(case_length - 3*corner_radius, length_slots, panel_thickness, true);\n translate([1.5*corner_radius, case_width -corner_radius - panel_thickness\/2 ]) make_slots(case_length - 3*corner_radius, length_slots, panel_thickness, true);\n translate([corner_radius + panel_thickness\/2, 1.5*corner_radius]) rotate(90) make_slots(case_width - 3*corner_radius, width_slots, panel_thickness, true);\n translate([case_length - corner_radius + panel_thickness\/2, 1.5*corner_radius]) rotate(90) make_slots(case_width - 3*corner_radius, width_slots, panel_thickness, true);\n rounded_square_clamping_holes(case_length, case_width, corner_radius);\n }\n}\n\ntranslate([-case_length\/2, -case_width\/2]) base();\ntranslate([-case_length\/2, case_width\/2 + 2*part_separation + case_height]) base();\n\ntranslate([1.5*corner_radius -case_length\/2, +case_width\/2 + part_separation]) length_side();\ntranslate([1.5*corner_radius -case_length\/2, -case_width\/2 - case_height - part_separation]) length_side();\n\ntranslate([-case_length\/2 - part_separation - case_height, -case_width\/2 + 1.5*corner_radius]) width_side();\ntranslate([+case_length\/2 + part_separation, -case_width\/2 + 1.5*corner_radius]) width_side();\n\ntranslate([-case_length\/2 + corner_radius, -case_width\/2 - 2*case_height - part_separation]){\n corner_pieces_per_base=floor(case_length\/(2*corner_radius + part_separation));\n rows = floor(corner_pieces*4\/corner_pieces_per_base);\n for(y=[0:rows]){\n for(x=[0:corner_pieces_per_base]){\n translate([2*x*corner_radius + x*part_separation\/2, -(2*corner_radius*y + y*part_separation)]) corner_stack();\n }\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/sturdy_box\/sturdy_box.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"94157b400681f5be0e00cfac75915ea7cc261462","subject":"feat: add an arrow on top and bottom of the test element to better see its direction when rotated or mirrored","message":"feat: add an arrow on top and bottom of the test element to better see its direction when rotated or mirrored\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element. If no children is given, a cube with an arrow on top is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [angle] - The angle of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", angle=0, size=1, center=false) {\n color(c) {\n rotate(angle) {\n if ($children) {\n children();\n } else let(\n size = vector3D(size),\n half = size \/ 2,\n quarter = size \/ 4,\n offset = center ? -half : vector3D()\n ) {\n translate(offset) {\n linear_extrude(height=size.z, convexity=10) {\n polygon(\n points = path([\n [\"P\", half.x, size.y],\n [\"L\", half.x, -half.y],\n [\"H\", -quarter.x],\n [\"V\", -half.y],\n [\"H\", -half.x],\n [\"V\", half.y],\n [\"H\", -quarter.x],\n ]),\n convexity = 10\n );\n }\n translateZ(quarter.z) {\n cube(size=[size.x, size.y, half.z]);\n }\n }\n }\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * A testbed is shown, unless the global variable `SELECT_TEST` is set to `false`.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n if (SHOW_TESTBED) {\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `SELECT_TEST`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n SELECT_TEST = is_undef(SELECT_TEST) ? undef : min(max(0, SELECT_TEST), count - 1);\n start = is_undef(SELECT_TEST) ? 0 : SELECT_TEST;\n end = is_undef(SELECT_TEST) ? count - 1 : SELECT_TEST;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element. If no children is given, a cube is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", size=1, center=false) {\n color(c) {\n if ($children) {\n children();\n } else {\n cube(size=size, center=center);\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * A testbed is shown, unless the global variable `SELECT_TEST` is set to `false`.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n if (SHOW_TESTBED) {\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `SELECT_TEST`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n SELECT_TEST = is_undef(SELECT_TEST) ? undef : min(max(0, SELECT_TEST), count - 1);\n start = is_undef(SELECT_TEST) ? 0 : SELECT_TEST;\n end = is_undef(SELECT_TEST) ? count - 1 : SELECT_TEST;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c051374054f320420be6e5f89c0c10c44c1e5c5c","subject":"added some extra space to squeeze root element in smoothly","message":"added some extra space to squeeze root element in smoothly\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"sink_pipe_support\/holder.scad","new_file":"sink_pipe_support\/holder.scad","new_contents":"module holder()\n{\n cylinder(h=5, r=50);\n d=30+2*2;\n e=d+4;\n h=5+40;\n difference()\n {\n translate([-e\/2, -e\/2, 0])\n cube([e, e, h]);\n translate([-d\/2, -d\/2, 0])\n cube([d, d, h]);\n translate([-h\/2, 0, h-10])\n rotate([0, 90, 0])\n cylinder(r=5+1, h=h);\n }\n}\n\nholder();","old_contents":"module holder()\n{\n cylinder(h=5, r=50);\n d=30;\n e=d+4;\n h=5+40;\n difference()\n {\n translate([-e\/2, -e\/2, 0])\n cube([e, e, h]);\n translate([-d\/2, -d\/2, 0])\n cube([d, d, h]);\n translate([-h\/2, 0, h-10])\n rotate([0, 90, 0])\n cylinder(r=5+1, h=h);\n }\n}\n\nholder();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"39411bf4828fd012b7013ad4b003f754a1843536","subject":"refactor","message":"refactor\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = 4.2; \n\n xTranslate = bed_xTranslate;\n yTranslate = bed_yTranslate;\n zTranslate = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n zLength = 4.2; \n\n xTranslate = 30;\n yTranslate = 32.7;\n zTranslate = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c320a0fe1db7dc92dac7f11571938941a006bf80","subject":"screw\/screw_cut: add with_head param","message":"screw\/screw_cut: add with_head param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = override_h==undef?head_h:override_h);\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=override_h==undef?head_h:override_h, align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n translate([0,0,h\/2+.01])\n {\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = override_h==undef?head_h:override_h);\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=override_h==undef?head_h:override_h, align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"07ebd1e83decaf934070cf388634deea4f0ad971","subject":"Clip for openbeam to hold bed isolation","message":"Clip for openbeam to hold bed isolation\n","repos":"ksuszka\/3d-projects","old_file":"kossel\/bed_isolation_clip.scad","new_file":"kossel\/bed_isolation_clip.scad","new_contents":"\/\/ render with wall 1.5\nbeam_size = 15;\nbeam_size_half = beam_size\/2;\n\n$fn=50;\n\/\/ dependency: https:\/\/cdn.thingiverse.com\/assets\/95\/99\/30\/ae\/e4\/TL-400-0101-001CLR_-_OpenBeam_1515_Extrusion_Clear_Anodized.STL\n\/\/color(\"green\") translate([-beam_size_half,-beam_size,-1000]) import(\"TL-400-0101-001CLR_-_OpenBeam_1515_Extrusion_Clear_Anodized.stl\");\n\nopening = 0.4;\n\nmodule negative() {\n module half() {\n offset(r=+0.5) offset(delta=-0.5) polygon([[10,0],[1.6,0],[1.6,1.4],[10,1.4]]);\n polygon([[2,1],[10,20],[10,1]]);\n polygon([[0,0],[opening,0],[0.6,1.7],[8.6,20.7],[0,20]]);\n offset(r=-0.5) offset(delta=0.5) polygon([[2.9,0],[2.9,4],[0,4.9],[0,20],[10,20],[10,0]]);\n }\n \n linear_extrude(height=1000, center=true) {\n half();\n mirror() half();\n polygon([[-opening,0],[opening,0],[0.7,-2],[0,-2]]);\n }\n}\n\nmodule clip(clip_width = 20) {\n module positive() {\n linear_extrude(height=clip_width, center=true) {\n polygon([[-beam_size_half,-2],[-beam_size_half,10],[beam_size_half,10],[beam_size_half,-2]]);\n \n translate([-1.5,-20]) square([1.5,20]);\n translate([0,-20]) rotate([0,0,-7]) translate([-1.5,0]) square([1.5,20]);\n }\n }\n difference() {\n positive();\n negative();\n }\n}\n\nmodule clips(count=6, clip_width=20) {\n for(a=[0:1:count-1]) {\n x = a * 7 + 1*(a%2);\n y = -a*3 + 30*(a%2);\n translate([x,y,0]) rotate([0,0,180+180 * (a % 2)]) clip();\n }\n}\n\nclips(1);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kossel\/bed_isolation_clip.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1a32fad8b2e253789b3b509c5447cd612296a4f5","subject":"Some documentation was added.","message":"Some documentation was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/shapes\/fish\/fish.scad","new_file":"openscad\/models\/src\/main\/openscad\/shapes\/fish\/fish.scad","new_contents":"\nuse <..\/oval\/oval.scad>\nuse <..\/triangle\/triangle.scad>\n\n\/**\n * This a fish. I used the following thing as an example of how to do the main fish\n * body: \n *\n * https:\/\/www.thingiverse.com\/thing:844015\n *\n *\/\nmodule fish(bodyRadius = 7, height = 1)\n{\n\trotate([0, 0, 135])\n\tunion()\n\t{\n\t\t\/\/ body\n\t\tcylinder(height,bodyRadius,bodyRadius);\n\n\t\t\/\/ head end\n\t\ttranslate([-bodyRadius,-bodyRadius,0])\n\t\t{\n\t\t\tcube([bodyRadius,bodyRadius,height]);\n\t\t}\n\n\t\t\/\/ back end\n\t\tcube([bodyRadius,bodyRadius,height]);\n\n\t\t\/\/ tail\n\t\tsize = 6.00015;\n\t\txTranslate = bodyRadius + 3;\n\t\tyTranslate = bodyRadius + 2;\/\/radius * 2 + 1;\n\t\ttranslate([xTranslate, yTranslate, 0])\n\t\ttriangle(size= size, height=2);\n\t}\n}\n\nmodule fishThumbnail()\n{\n\tfish();\n}\n\n\/** Support functions and modules follow **\/\n\nmodule fish_tail(radius)\n{\n\n}\n","old_contents":"\nuse <..\/oval\/oval.scad>\nuse <..\/triangle\/triangle.scad>\n\nmodule fish(bodyRadius = 7, height = 1)\n{\n\trotate([0, 0, 135])\n\tunion()\n\t{\n\t\t\/\/ body\n\t\tcylinder(height,bodyRadius,bodyRadius);\n\n\t\t\/\/ head end\n\t\ttranslate([-bodyRadius,-bodyRadius,0])\n\t\t{\n\t\t\tcube([bodyRadius,bodyRadius,height]);\n\t\t}\n\n\t\t\/\/ back end\n\t\tcube([bodyRadius,bodyRadius,height]);\n\n\t\t\/\/ tail\n\t\tsize = 6.00015;\n\t\txTranslate = bodyRadius + 3;\n\t\tyTranslate = bodyRadius + 2;\/\/radius * 2 + 1;\n\t\ttranslate([xTranslate, yTranslate, 0])\n\t\ttriangle(size= size, height=2);\n\t}\n}\n\nmodule fishThumbnail()\n{\n\tfish();\n}\n\n\/** Support functions and modules follow **\/\n\nmodule fish_tail(radius)\n{\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d5fac682a7d71375dc3e8d41cc34e0a9601e029a","subject":"new line added","message":"new line added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_dispenser\/battery.scad","new_file":"battery_dispenser\/battery.scad","new_contents":"module batteryAA()\n{\n cylinder(h=48.5, r=14.5\/2, $fs=0.1);\n translate([0,0, 48.5])\n cylinder(h=2, r=5.5\/2, $fs=0.1);\n}\n\nmodule batteryAAA()\n{\n cylinder(h=42.5, r=10.5\/2, $fs=0.1);\n translate([0,0, 42.5])\n cylinder(h=1.5, r=4\/2, $fs=0.1);\n}\n\n\/\/ just an exhibition - not used directly\ntranslate([20,0,0])\n batteryAA();\ntranslate([0,0,0])\n batteryAAA();\n","old_contents":"module batteryAA()\n{\n cylinder(h=48.5, r=14.5\/2, $fs=0.1);\n translate([0,0, 48.5])\n cylinder(h=2, r=5.5\/2, $fs=0.1);\n}\n\nmodule batteryAAA()\n{\n cylinder(h=42.5, r=10.5\/2, $fs=0.1);\n translate([0,0, 42.5])\n cylinder(h=1.5, r=4\/2, $fs=0.1);\n}\n\n\/\/ just an exhibition - not used directly\ntranslate([20,0,0])\n batteryAA();\ntranslate([0,0,0])\n batteryAAA();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"81f4e7e16f8065b87220b435f9d12f352121c989","subject":"Delete LifeLoggingCameraV6.scad","message":"Delete LifeLoggingCameraV6.scad","repos":"vllstudy16\/vllstudy16","old_file":"LifeLoggingCameraV6.scad","new_file":"LifeLoggingCameraV6.scad","new_contents":"","old_contents":"$fs = 0.1; \/\/ smoothness of curves in render\n$fa = 0.1;\n\n\/* Box *\/\n{\n thickness = 2; \/\/wall thickness\n extraThickness = 0.1; \/\/ required for proper rendering when $fs is large\n curve = 4; \/\/ curve on the edges of the box, must be > thickness\n internalDimensions = [65, 65, 30]; \/\/internal dimensions\n externalDimensions = [internalDimensions[0] + (thickness * 2), internalDimensions[1] + (thickness * 2), internalDimensions[2] + (thickness * 2)];\n bottomHeight = 28; \/\/ height of the bottom half of the box\n topHeight = internalDimensions[2] - bottomHeight; \/\/ height of the top half of the box\n FR4Thickness = 1.7;\n overlap = 3;\n}\n\/\/\n\ncameraHolePos = [externalDimensions[0] \/ 2, externalDimensions[1] \/ 2];\nledHolePos = [externalDimensions[2] \/ 2, externalDimensions[1] - (externalDimensions[2] \/ 2)];\nusbHolePos = [-0.01, 31.25 + curve, thickness + FR4Thickness];\nsdHolePos = [-0.01, 6.5 + curve, thickness + FR4Thickness];\nresetHolePos = [externalDimensions[2] \/ 2, externalDimensions[1] - (thickness \/ 2), externalDimensions[2] \/ 3];\npowerHolePos = [externalDimensions[0] * ((sqrt(5) - 1) \/ 2), externalDimensions[1] - (thickness \/ 2) - 0.5, externalDimensions[2] \/ 3];\nusbSize = [21.5, 36, 7.2];\nsdSize = [25, 31, 3.55];\nresetHoleSize = 6;\npowerHoleSize = [6.5, thickness + extraThickness + 1, 3.5];\nledHoleRad = 2.5;\ncameraHoleRad = 3.7;\ncameraStandoffHeight = 4;\n\n{\n \/*\nloc = [\n [externalDimensions[0] + 3 , 0, 0],\n [externalDimensions[0] + 3 , 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0], 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0], 0, 22 + (thickness * 2)],\n [externalDimensions[0], 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0] + 3 , 0, 22 + 5 + (thickness * 2)],\n [externalDimensions[0] + 3 , 0, 0],\n [externalDimensions[0] + 3 , 0, 0]\n ];\n\nfunction xyz(t,i) = \n lookup(t, [\n [0\/len(loc),loc[0][i]],\n [1\/len(loc),loc[1][i]],\n [2\/len(loc),loc[2][i]],\n [3\/len(loc),loc[3][i]],\n [4\/len(loc),loc[4][i]],\n [5\/len(loc),loc[5][i]],\n [6\/len(loc),loc[6][i]],\n [7\/len(loc),loc[7][i]],\n\n]);\n\nloc2 = [\n [0, 0, 0],\n [0, 0, 0],\n [0, -180, 0],\n [0, -180, 0],\n [0, -180, 0],\n [0, 0, 0],\n [0, 0, 0],\n [0, 0, 0]\n ];\n\nfunction xyz2(t,i) = \n lookup(t, [\n [0\/len(loc2),loc2[0][i]],\n [1\/len(loc2),loc2[1][i]],\n [2\/len(loc2),loc2[2][i]],\n [3\/len(loc2),loc2[3][i]],\n [4\/len(loc2),loc2[4][i]],\n [5\/len(loc2),loc2[5][i]],\n [6\/len(loc2),loc2[6][i]],\n [7\/len(loc2),loc2[7][i]],\n\n]);\n\nloc3 = [\n [0, 0, 0],\n [0, 0, 90],\n [0, 0, 180],\n [0, 0, 270],\n [0, 0, 360],\n [0, 0, 180],\n [0, 0, 0],\n [0, 0, 0]\n ];\n\nfunction xyz3(t,i) = \n lookup(t, [\n [0\/len(loc3),loc3[0][i]],\n [1\/len(loc3),loc3[1][i]],\n [2\/len(loc3),loc3[2][i]],\n [3\/len(loc3),loc3[3][i]],\n [4\/len(loc3),loc3[4][i]],\n [5\/len(loc3),loc3[5][i]],\n [6\/len(loc3),loc3[6][i]],\n [7\/len(loc3),loc3[7][i]],\n\n]);\n*\/\n}\n\/\/\n\nmodule cylinderHull(a, r)\n{\n hull()\n {\n cylinder(r = r, h = a[2]);\n translate([a[0], 0, 0]) \n cylinder(r = r, h = a[2]);\n translate([0, a[1], 0]) \n cylinder(r = r, h = a[2]);\n translate([a[0], a[1], 0]) \n cylinder(r = r, h = a[2]);\n }\n}\n\/\/\n\nmodule box(height, lip)\n{\n \/\/ 0 = outer lip, 1 = inner lip\n translate([curve, curve, 0]) difference() \n {\n union()\n {\n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), height + thickness], curve);\n if(lip == 1)\n {\n translate([0, 0, thickness]) \n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), height + overlap],curve - (thickness \/ 2));\n }\n }\n {\n translate([0, 0, thickness]) \n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), height + thickness + overlap], curve - thickness);\n if(lip == 0)\n {\n translate([0, 0, height + thickness - overlap]) \n cylinderHull([externalDimensions[0] - (curve * 2), externalDimensions[1] - (curve * 2), 0.01 + overlap], curve - (thickness \/ 2));\n }\n }\n }\n}\n\/\/\n\nmodule bottom(height)\n{\n difference()\n {\n union()\n {\n box(height, 0);\n if(thickness < 3)\n {\n translate([externalDimensions[0] * ((sqrt(5) - 1) \/ 2) - 9.5, externalDimensions[1] - 3, thickness]) \n cube([19, 3 - thickness, height - overlap]);\/\/power switch extra thickness\n }\n translate([usbHolePos[0] + thickness, usbHolePos[1] - ((usbSize[0] - 11) \/ 2), thickness])\n {\n translate([2.6, usbSize[0] - 2.6, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n translate([2.6, 2.6, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n translate([usbSize[1] - 2.25, usbSize[0] - 2 - 2.25, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n translate([usbSize[1] - 2.25, 2 + 2.25, 0])\n {\n cylinder(h = usbSize[2] - FR4Thickness, r = 2);\n cylinder(h = usbSize[2], r = 1);\n }\n }\n translate([sdHolePos[0] + thickness, sdHolePos[1] - ((sdSize[0] - 14) \/ 2) - 1, thickness])\n {\n translate([2.575, sdSize[0] - 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n translate([2.575, 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n translate([sdSize[1] - 5.6 - 2.575, sdSize[0] - 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n translate([sdSize[1] - 5.6 - 2.575, 2.575, 0])\n cylinder(h = FR4Thickness, r = 0.8);\n }\n translate([powerHolePos[0], powerHolePos[1], powerHolePos[2]])\n {\n translate([-7.5, 0, 0])\n rotate([90, 0, 0])\n cylinder(h = 3, r = 0.8);\n translate([7.5, 0, 0])\n rotate([90, 0, 0])\n cylinder(h = 3, r = 0.8);\n }\n }\n {\n translate([usbHolePos[0], usbHolePos[1], usbHolePos[2]]) \n cube([thickness + extraThickness, 11, 6]);\/\/usb hole\n translate([sdHolePos[0], sdHolePos[1], sdHolePos[2]]) \n cube([thickness + extraThickness, 14, 4]);\/\/sd hole\n translate([resetHolePos[0], resetHolePos[1], resetHolePos[2]]) \n cube([resetHoleSize, thickness + extraThickness, resetHoleSize], center = true);\/\/reset switch hole\n translate([powerHolePos[0], powerHolePos[1], powerHolePos[2]]) \n cube([powerHoleSize[0], powerHoleSize[1], powerHoleSize[2]], center = true);\/\/power switch hole\n hull () \n {\n translate([sdHolePos[0], sdHolePos[1] + (thickness \/ 2), sdHolePos[2]]) sphere(r = thickness \/ 2, center = true);\n translate([sdHolePos[0], sdHolePos[1] + 14 - (thickness \/ 2), sdHolePos[2]]) sphere(r = thickness \/ 2, center = true);\n }\n hull () \n {\n translate([sdHolePos[0], sdHolePos[1] + (thickness \/ 2), sdHolePos[2] + 4]) sphere(r = thickness \/ 2, center = true);\n translate([sdHolePos[0], sdHolePos[1] + 14 - (thickness \/ 2), sdHolePos[2] + 4]) sphere(r = thickness \/ 2, center = true);\n }\n translate([0, 61 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([0, 54 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([65 + thickness, 61 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([65 + thickness, 54 + thickness, 15 + thickness])\n rotate([0, 90, 0])\n cylinderHull([10, 0, thickness + extraThickness], 1);\n translate([usbHolePos[0] + thickness, usbHolePos[1] - ((usbSize[0] - 11) \/ 2), 0])\n {\n translate([7, usbSize[0] - 2.6, 0])\n {\n cylinder(h = usbSize[2], r = 1.5);\n }\n translate([7, 2.6, 0])\n {\n cylinder(h = usbSize[2], r = 1.5);\n }\n translate([usbSize[1] - 2.25, usbSize[0] - 2 - 2.25 + 4, 0])\n {\n cylinder(h = usbSize[2], r = 1.5);\n }\n }\n }\n }\n}\n\/\/\n\nmodule top(height)\n{\n difference()\n {\n union()\n {\n box(height, 1);\n translate([cameraHolePos[0], cameraHolePos[1], thickness]) \n {\n translate([-8.5, 19.9, 0])\/\/ Top L\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n translate([8.5, 19.9, 0])\/\/ Top R\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n translate([-8.5, -5.5, 0])\/\/ Bottom L\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n translate([8.5, -5.5, 0])\/\/ Bottom R\n {\n cylinder(h = cameraStandoffHeight, r = 1.5);\n cylinder(h = cameraStandoffHeight + FR4Thickness, r = 0.6);\n }\n }\n }\n {\n translate([cameraHolePos[0], cameraHolePos[1], -0.01]) \n cylinder(r = cameraHoleRad, h = thickness + extraThickness);\/\/camera hole\n translate([ledHolePos[0], ledHolePos[1], -0.01])\n cylinder(r = ledHoleRad, h = thickness + extraThickness);\/\/led hole\n }\n }\n}\n\/\/\n\nbottom(bottomHeight);\n\n\/\/top(topHeight);\n\n\/\/translate([externalDimensions[0], 0, 22 + 2 + (thickness * 2)]) rotate([0,180,0]) top(topHeight);\n\n\/\/translate([xyz($t,0),xyz($t,1),xyz($t,2)]) rotate([xyz2($t,0),xyz2($t,1),xyz2($t,2)]) top(topHeight);\n \n\/\/translate([2, 4, 3]) cube([31, 25, 3.55]);\/\/sd\n\/\/translate([2, 30, 3]) cube([36, 21.5, 7.2]);\/\/usb\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0caf6ce10b5ed040216b59659ff8d03fece1464c","subject":"main: show xaxis idler holders","message":"main: show xaxis idler holders\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*148,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*25, 0, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*148,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ab78b70083743b19316c3d5b7fd4efc90a4d073a","subject":"mount itself","message":"mount itself\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"table_top_to_cabinet_mounting\/mount.scad","new_file":"table_top_to_cabinet_mounting\/mount.scad","new_contents":"polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [ 0, 60, 0], \/\/ 1\n [30, 60, 0], \/\/ 2\n [30, 0, 0], \/\/ 3\n [30, 0, 20], \/\/ 4\n [ 0, 0, 20] \/\/ 5\n ],\n faces = [\n \/\/ side walls\n [0,1,5],\n [2,3,4],\n \/\/ floor\n [2,1,0],\n [3,2,0],\n \/\/back wall\n [4,3,0],\n [5,4,0],\n \/\/ front wall\n [1,2,5],\n [2,4,5]\n ]\n);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'table_top_to_cabinet_mounting\/mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"10e17456bf892e5877117b7e6601fd7856a6d76c","subject":"Added bracket for dc inverter for AS","message":"Added bracket for dc inverter for AS\n","repos":"ksuszka\/3d-projects","old_file":"small\/dc_inverter_bracket.scad","new_file":"small\/dc_inverter_bracket.scad","new_contents":"\nFFF=[false,false,false];FFT=[false,false,true];\nFTF=[false,true,false];FTT=[false,true,true];\nTFF=[true,false,false];TFT=[true,false,true];\nTTF=[true,true,false];TTT=[true,true,true];\nmodule cube2(size, center) {\n translate([\n center[0] ? -size[0]\/2 : 0,\n center[1] ? -size[1]\/2 : 0,\n center[2] ? -size[2]\/2 : 0]) cube(size);\n}\nmodule mirror_x() {\n for(a=[0,1])mirror([a,0,0])children();\n}\nmodule mirror_y() {\n for(a=[0,1])mirror([0,a,0])children();\n}\nmodule mirror_z() {\n for(a=[0,1])mirror([0,0,a])children();\n}\n\n\nholes_x=180;\nholes_y=32;\nholed_d=6.2;\ndifference() {\n union() mirror_y() {\n for(a=[0,1])translate([holes_x*a+10,holes_y\/2]) cylinder(d=16,h=9);\n cube2([36,50,17],FTF);\n cube2([45,50,9],FTF);\n translate([50,94\/2])cube2([130,10,9],FTF);\n translate([holes_x+10,0])cube2([16,50,9],TTF);\n hull() {\n translate([170,94\/2+4])cube2([16,1,9],FFF);\n translate([holes_x+10,24])cube2([16,1,9],TTF);\n }\n hull() {\n translate([50,94\/2+4])cube2([16,1,9],FFF);\n translate([36,24])cube2([16,1,9],TTF);\n }\n }\n mirror_y() {\n for(a=[0,1])translate([holes_x*a+10,holes_y\/2]) {\n cylinder(d=6.2,h=30,center=true,$fn=24);\n translate([0,0,4])rotate([0,0,30])cylinder(d=10*2\/sqrt(3),h=30,$fn=6);\n }\n translate([0,94\/2,6])cube2([500,5,10],TTF);\n for(a=[62,171])translate([a,0]) {\n cube2([5,200,4],TTT);\n translate([0,0,7])cube2([5,200,4],TTF);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/dc_inverter_bracket.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c0845ff7b61f8449444004ea3cf2ca1e00e78171","subject":"Update 3D_printed_parts\/threads.scad","message":"Update 3D_printed_parts\/threads.scad\n","repos":"teuler\/Grundig60,teuler\/Grundig60","old_file":"3D_printed_parts\/threads.scad","new_file":"3D_printed_parts\/threads.scad","new_contents":"\/*\n * Dan Kirshner - dan_kirshner@yahoo.com\n *\n * You are welcome to make free use of this software. Retention of my \n * authorship credit would be appreciated.\n *\n * Version 1.3. 2013-12-01 Correct loop over turns -- don't have early cut-off\n * Version 1.2. 2012-09-09 Use discrete polyhedra rather than linear_extrude()\n * Version 1.1. 2012-09-07 Corrected to right-hand threads!\n *\/\n\n\/\/ Examples:\n\/\/metric_thread(8, 1, 10);\n\/\/english_thread(1\/4, 20, 1);\n\n\/\/ Rohloff hub thread:\n\/\/metric_thread(34, 1, 10, internal=true, n_starts=6);\n\n\n\n\/\/metric_thread(8, 2, 4);\n\n\n\n\/\/ ----------------------------------------------------------------------------\npi = 3.14159265;\n\n\n\/\/ ----------------------------------------------------------------------------\nfunction segments(diameter) = min(50, ceil(diameter*6));\n\n\n\/\/ ----------------------------------------------------------------------------\n\/\/ internal - true = clearances for internal thread (e.g., a nut).\n\/\/ false = clearances for external thread (e.g., a bolt).\n\/\/ (Internal threads should be \"cut out\" from a solid using\n\/\/ difference()).\n\/\/ n_starts - Number of thread starts (e.g., DNA, a \"double helix,\" has\n\/\/ n_starts=2). See wikipedia Screw_thread.\nmodule metric_thread(diameter=8, pitch=1, length=1, internal=false, n_starts=1)\n{\n \/\/ Number of turns needed.\n n_turns = floor(length\/pitch);\n n_segments = segments(diameter);\n h = pitch * cos(30);\n\n union() {\n intersection() {\n \/\/ Start one below z = 0. Gives an extra turn at each end.\n for (i=[-1*n_starts : n_turns+1]) {\n translate([0, 0, i*pitch]) {\n metric_thread_turn(diameter, pitch, internal, n_starts);\n }\n }\n\n \/\/ Cut to length.\n translate([0, 0, length\/2]) {\n cube([diameter*1.1, diameter*1.1, length], center=true);\n }\n }\n\n \/\/ Solid center, including Dmin truncation.\n if (internal) {\n cylinder(r=diameter\/2 - h*5\/8, h=length, $fn=n_segments);\n } else {\n\n \/\/ External thread includes additional relief.\n cylinder(r=diameter\/2 - h*5.3\/8, h=length, $fn=n_segments);\n }\n }\n}\n\n\n\/\/ ----------------------------------------------------------------------------\n\/\/ Input units in inches.\n\/\/ Note: units of measure in drawing are mm!\nmodule english_thread(diameter=0.25, threads_per_inch=20, length=1,\n internal=false, n_starts=1)\n{\n \/\/ Convert to mm.\n mm_diameter = diameter*25.4;\n mm_pitch = (1.0\/threads_per_inch)*25.4;\n mm_length = length*25.4;\n\n echo(str(\"mm_diameter: \", mm_diameter));\n echo(str(\"mm_pitch: \", mm_pitch));\n echo(str(\"mm_length: \", mm_length));\n metric_thread(mm_diameter, mm_pitch, mm_length, internal, n_starts);\n}\n\n\n\/\/ ----------------------------------------------------------------------------\nmodule metric_thread_turn(diameter, pitch, internal, n_starts)\n{\n n_segments = segments(diameter);\n fraction_circle = 1.0\/n_segments;\n for (i=[0 : n_segments-1]) {\n rotate([0, 0, i*360*fraction_circle]) {\n translate([0, 0, i*n_starts*pitch*fraction_circle]) {\n thread_polyhedron(diameter\/2, pitch, internal, n_starts);\n }\n }\n }\n}\n\n\n\/\/ ----------------------------------------------------------------------------\n\/\/ z (see diagram) as function of current radius.\n\/\/ (Only good for first half-pitch.)\nfunction z_fct(current_radius, radius, pitch)\n = 0.5*(current_radius - (radius - 0.875*pitch*cos(30)))\n \/cos(30);\n\n\/\/ ----------------------------------------------------------------------------\nmodule thread_polyhedron(radius, pitch, internal, n_starts)\n{\n n_segments = segments(radius*2);\n fraction_circle = 1.0\/n_segments;\n\n h = pitch * cos(30);\n outer_r = radius + (internal ? h\/20 : 0); \/\/ Adds internal relief.\n \/\/echo(str(\"outer_r: \", outer_r));\n\n\n inner_r = radius - 0.875*h; \/\/ Does NOT do Dmin_truncation - do later with\n \/\/ cylinder.\n\n \/\/ Make these just slightly bigger (keep in proportion) so polyhedra will\n \/\/ overlap.\n x_incr_outer = outer_r * fraction_circle * 2 * pi * 1.005;\n x_incr_inner = inner_r * fraction_circle * 2 * pi * 1.005;\n z_incr = n_starts * pitch * fraction_circle * 1.005;\n\n \/* \n (angles x0 and x3 inner are actually 60 deg)\n\n \/\\ (x2_inner, z2_inner) [2]\n \/ \\\n (x3_inner, z3_inner) \/ \\\n [3] \\ \\\n |\\ \\ (x2_outer, z2_outer) [6]\n | \\ \/\n | \\ \/|\n z | \\\/ \/ (x1_outer, z1_outer) [5]\n | | | \/\n | x | |\/\n | \/ | \/ (x0_outer, z0_outer) [4]\n | \/ | \/ (behind: (x1_inner, z1_inner) [1]\n |\/ | \/\n y________| |\/\n (r) \/ (x0_inner, z0_inner) [0]\n\n *\/\n\n x1_outer = outer_r * fraction_circle * 2 * pi;\n\n z0_outer = z_fct(outer_r, radius, pitch);\n \/\/echo(str(\"z0_outer: \", z0_outer));\n\n \/\/polygon([[inner_r, 0], [outer_r, z0_outer], \n \/\/ [outer_r, 0.5*pitch], [inner_r, 0.5*pitch]]);\n z1_outer = z0_outer + z_incr;\n\n \/\/ Rule for triangle ordering: look at polyhedron from outside: points must\n \/\/ be in clockwise order.\n polyhedron(\n points = [\n [-x_incr_inner\/2, -inner_r, 0], \/\/ [0]\n [x_incr_inner\/2, -inner_r, z_incr], \/\/ [1]\n [x_incr_inner\/2, -inner_r, pitch + z_incr], \/\/ [2]\n [-x_incr_inner\/2, -inner_r, pitch], \/\/ [3]\n\n [-x_incr_outer\/2, -outer_r, z0_outer], \/\/ [4]\n [x_incr_outer\/2, -outer_r, z0_outer + z_incr], \/\/ [5]\n [x_incr_outer\/2, -outer_r, pitch - z0_outer + z_incr], \/\/ [6]\n [-x_incr_outer\/2, -outer_r, pitch - z0_outer] \/\/ [7]\n ],\n\n triangles = [\n [0, 3, 4], \/\/ This-side trapezoid, bottom\n [3, 7, 4], \/\/ This-side trapezoid, top\n\n [1, 5, 2], \/\/ Back-side trapezoid, bottom\n [2, 5, 6], \/\/ Back-side trapezoid, top\n\n [0, 1, 2], \/\/ Inner rectangle, bottom\n [0, 2, 3], \/\/ Inner rectangle, top\n\n [4, 6, 5], \/\/ Outer rectangle, bottom\n [4, 7, 6], \/\/ Outer rectangle, top\n\n [7, 2, 6], \/\/ Upper rectangle, bottom\n [7, 3, 2], \/\/ Upper rectangle, top\n\n [0, 5, 1], \/\/ Lower rectangle, bottom\n [0, 4, 5] \/\/ Lower rectangle, top\n ]\n );\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D_printed_parts\/threads.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1c2e2f7119d76ff4906206b9e03cc56d6434c23d","subject":"Add endstop definition.","message":"Add endstop definition.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"makerslide-endstop\/endstop.scad","new_file":"makerslide-endstop\/endstop.scad","new_contents":"\/\/ To use, print 2x and use with a switch like D2F-L or D2F-FL.\n\/\/ Holes are sized for M2 or smaller machine screw (#2 wood screw does not fit\n\/\/ through microswitch holes). For use with Grbl shield, wire up X,Y,Z to pins\n\/\/ D9-D11. TODO figure out which of normally open or normally closed works\n\/\/ with firmware. Note that X and Y use different lengths, see end of file.\n\n\/\/ TODOS\n\/\/ * make h= var do something useful\n\/\/ * slightly enlarge so it fits snugly and doesn't move around\n\/\/ * figure out why the hole doesn't go all the way through\n\/\/ * come up with a plate that has both types\n\/\/ * document sizing of hole (2.2mm) vs size of screw (down to M1.4)\n\/\/ * templatize based on something (hopefully total distance + trigger from datasheet)\n\/\/ * split out profile, so I can use it for other things. Note that this is 20x20 extrusion.\n\n\/\/ * cable clip, for if you want to run in the channel\n\/\/ * version with a tuning fork sort of shape, so a screw can tighten the\n\/\/ spacer area (tried something like this once, and it didn't print well --\n\/\/ was brittle).\n\ngPlateRows = 1;\ngPlateCols = 2;\n\ne = 0.01;\n\nh = 18;\nrail_thick = 2.5;\n\n\/\/ Set this to 10 if you only want the internal tips trimmed, 40 if you want the outside part to line up too.\ntip_trim = 40;\n\nmodule main() {\n union() {\n difference() {\n bulk();\n \/\/ trim exposed part\n translate([-40\/2-1,0,0]) cube([40,40,h+2], center=true);\n \/\/ mounting hole\n \/\/translate([5,0,h\/2-5]) rotate([0,90,0]) cylinder(r1=5.1\/2, r2=4\/2, h=13, center=true, $fn=30);\n }\n \/\/ part the endstop attaches to\n difference() {\n translate([-4\/2-e,0,-4]) cube([4,14,10], center=true);\n \/\/ mounting holes\n translate([0,7\/2,-4]) rotate([0,90,0]) rotate([0,0,180]) cylinder(r=2.2\/2, h=30, $fn=3, center=true);\n translate([0,-7\/2,-4]) rotate([0,90,0]) rotate([0,0,180]) cylinder(r=2.2\/2, h=30, $fn=3, center=true);\n }\n }\n}\n\n\/\/ This is intentionally untrimmed on the \"top\" part, so the caller can adjust\n\/\/ height.\nmodule bulk() {\n difference() {\n translate([-8.5,0,0]) rotate([0,0,45]) cube([25, 25, h], center=true);\n \/\/ trim bottom\n translate([24\/2+6,0,0]) cube([24, 24, h+2], center=true);\n\n \/\/ trim top (this aligns the left edge with the center line)\n translate([rail_thick\/2,12.5,0]) cube([rail_thick,20,h+2], center=true);\n \/\/ trim bottom\n translate([rail_thick\/2,-12.5,0]) cube([rail_thick,20,h+2], center=true);\n\n \/\/ trim one tip\n translate([5,10,0]) cube([tip_trim,10,h+2], center=true);\n \/\/ trim other tip\n translate([5,-10,0]) cube([tip_trim,10,h+2], center=true);\n }\n}\n\ndifference() {\n union() {\n \/\/ place on z=0\n translate([0,0,10])\n for(i = [0:gPlateRows-1]) {\n for(j = [0:gPlateCols-1]) {\n translate([i*20,j*20,0]) main();\n }\n }\n }\n \/\/ Trim length of stop varies depending on use (on a Shapeoko):\n \/\/ 100\/2+15 for y stops\n \/\/ 100\/2+22 for x stops\n translate([0,0,100\/2+22]) cube([100,100,100], center=true);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'makerslide-endstop\/endstop.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"db15afe61ae412eefc5130f9c9c1149625f4d45c","subject":"enclosure: minor adjustments","message":"enclosure: minor adjustments\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1.scad","new_file":"3d\/enclosure_v1.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.6;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 25;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n\t cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x, screen_start_y, top_box_z - th - eps]) {\n cube([screen_length_x, screen_length_y + tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y, -eps]) {\n cube([th + 2*eps, usb_type_a_w+eps, usb_type_a_h+2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.6;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 25;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n\t cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x, screen_start_y, top_box_z - th - eps]) {\n cube([screen_length_x, screen_length_y + tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y, -eps]) {\n cube([th + 2*eps, usb_type_a_w+eps, usb_type_a_h+2*eps]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"aa14891fe79891e32e90a8189d0b753433be2e0a","subject":"minor","message":"minor\n","repos":"fponticelli\/smallbridges","old_file":"resin\/structure.scad","new_file":"resin\/structure.scad","new_contents":"include ;\n\n$fn = 12; \/\/ 36\n$detailed = false; \/\/ true\n$display_projection = false;\n\nrotate([90,0,0]) {\n printer(2);\n}","old_contents":"include ;\n\n$fn = 12; \/\/ 36\n$detailed = false; \/\/ true\n$display_projection = true;\n\nrotate([90,0,0]) {\n printer(2);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c9cebd66c35a822322ec4447655e21fb0aa7a9d8","subject":"xaxis\/ends: tweaks","message":"xaxis\/ends: tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n fncylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n \/*translate([0,5,0])*\/\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n \/*translate([0,-1*mm,0])*\/\n \/*pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);*\/\n \/*motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);*\/\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n \/*cubea([xaxis_end_beltpath_length, xaxis_end_beltpath_width, xaxis_end_beltpath_height+diag\/2]);*\/\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=false, nut_top=false, show_nut=true, show_rods=true);\n\n translate([150,0,0])\n {\n xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n xaxis_end_idlerholder();\n }\n}\n\nif(false)\n{\n translate([0,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=true, show_motor=true, show_nut=false);\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -1*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n \/*translate([0,5,0])*\/\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n \/*translate([0,-1*mm,0])*\/\n \/*pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);*\/\n \/*motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);*\/\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*if(false)*\/\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=false, nut_top=false, show_nut=true, show_rods=true);\n\n translate([150,0,0])\n {\n xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n xaxis_end_idlerholder();\n }\n}\n\nif(false)\n{\n translate([0,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=true, show_motor=true, show_nut=false);\n\n translate([100,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=false, show_nut=false);\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b3fef9776c1b998d6a35872c052046786a0b5731","subject":"x\/carriage: fix pos for old fan duct stuff","message":"x\/carriage: fix pos for old fan duct stuff\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1.5*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1.5*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"846596fc5b565b06deb62551b9cd660e0489f5e7","subject":"x\/carriage\/extruder\/b: use material for drive gear","message":"x\/carriage\/extruder\/b: use material for drive gear\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n material(Mat_Aluminium)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"96eca3301074a693815905e360fbd66d4136059f","subject":"x\/carriage: fix endstop bumper","message":"x\/carriage: fix endstop bumper\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \nuse \ninclude \n\nuse \n\nmodule x_extruder_hotend(side=-1, new=true)\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n\n mx(side>=1)\n tx(-16)\n tz(-29)\n rz(-90)\n rx(-90)\n tx(-123)\n ty(-123)\n import(\"stl\/thing_43783214\/30mm_clip_with_venturi_v3_50_by_thed0ct0r_.stl\");\n\n mx(side>=1)\n tx(-26)\n ty(-4.1)\n tz(-30)\n rz(10)\n fan(orient=X, align=-X);\n\n mx(side>=1)\n tz(-76.4)\n ty(-112.8)\n rx(-90)\n rz(180)\n import(\"stl\/thing_3316685\/e3d_v6_30mm_to_40mm_adapter.stl\");\n\n if(new)\n {\n tx(-13)\n ty(129)\n tz(-178)\n rz(180)\n ry(-90)\n import(\"stl\/thing_43783214\/Clip_with_sliding_guide_and_screw_slot_rev2.stl\");\n\n tx(-161.2)\n ty(-147.9)\n tz(71)\n rx(-90)\n rx(45)\n import(\"stl\/thing_43783214\/5015_sloped_layer_cooling.stl\");\n\n tx(-150.5)\n ty(-163.5)\n tz(-65.5)\n import(\"stl\/thing_43783214\/Prusa_like_nozzle_duct1.stl\");\n\n tx(-17)\n ty(-49)\n tz(-38)\n rx(-45)\n rz(-90)\n fan_5015S();\n }\n else\n {\n tx(-113.5)\n ty(-22.1)\n tz(-148)\n rz(-90)\n ry(-90)\n import(\"stl\/thing_2769783\/5015_layer_cooling_adapter_-_for_prusa_cooler_v1_2_-_rotated.stl\");\n\n tx(17)\n ty(-30)\n tz(-25)\n rz(180)\n rx(-90)\n rz(-90)\n fan_5015S();\n\n tx(-1)\n ty(13)\n tz(-4)\n rz(180)\n import(\"stl\/thing_2769783\/prusa_nozzle_fan_converted_2_v3_5L3.stl\");\n\n }\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n \/\/ turns out this is not needed because extruder a part already hits endstop\n \/*translate([-x_carriage_w\/2,xaxis_carriage_thickness\/2,-8*mm])*\/\n \/*rcubea(size=[5,12,10], align=X+Y, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=Y);*\/\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1*mm, orient=Y, align=-Y, extra_h=.1*mm, extra_align=Y);\n\n \/\/ cut out for shaft (so we can attach a knob)\n cylindera(d=extruder_b_bearing[0]+1*mm, h=1000, orient=Y, align=N);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=true, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, head_embed=true, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n sensormount_clamp(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-15*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n tz(-10*mm)\n rcubea(size=[18*mm,4*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(side)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n mx(side==1)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n mx(side==1)\n extruder_b();\n\n mx(side==1)\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n mx(side==1)\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend(side);\n\n mx(side==1)\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*187*mm:-129*mm)\n {\n mx(x==1)\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(x);\n\n mx(x==1)\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*270,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \nuse \ninclude \n\nuse \n\nmodule x_extruder_hotend(side=-1, new=true)\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n\n mx(side>=1)\n tx(-16)\n tz(-29)\n rz(-90)\n rx(-90)\n tx(-123)\n ty(-123)\n import(\"stl\/thing_43783214\/30mm_clip_with_venturi_v3_50_by_thed0ct0r_.stl\");\n\n mx(side>=1)\n tx(-26)\n ty(-4.1)\n tz(-30)\n rz(10)\n fan(orient=X, align=-X);\n\n mx(side>=1)\n tz(-76.4)\n ty(-112.8)\n rx(-90)\n rz(180)\n import(\"stl\/thing_3316685\/e3d_v6_30mm_to_40mm_adapter.stl\");\n\n if(new)\n {\n tx(-13)\n ty(129)\n tz(-178)\n rz(180)\n ry(-90)\n import(\"stl\/thing_43783214\/Clip_with_sliding_guide_and_screw_slot_rev2.stl\");\n\n tx(-161.2)\n ty(-147.9)\n tz(71)\n rx(-90)\n rx(45)\n import(\"stl\/thing_43783214\/5015_sloped_layer_cooling.stl\");\n\n tx(-150.5)\n ty(-163.5)\n tz(-65.5)\n import(\"stl\/thing_43783214\/Prusa_like_nozzle_duct1.stl\");\n\n tx(-17)\n ty(-49)\n tz(-38)\n rx(-45)\n rz(-90)\n fan_5015S();\n }\n else\n {\n tx(-113.5)\n ty(-22.1)\n tz(-148)\n rz(-90)\n ry(-90)\n import(\"stl\/thing_2769783\/5015_layer_cooling_adapter_-_for_prusa_cooler_v1_2_-_rotated.stl\");\n\n tx(17)\n ty(-30)\n tz(-25)\n rz(180)\n rx(-90)\n rz(-90)\n fan_5015S();\n\n tx(-1)\n ty(13)\n tz(-4)\n rz(180)\n import(\"stl\/thing_2769783\/prusa_nozzle_fan_converted_2_v3_5L3.stl\");\n\n }\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,xaxis_carriage_thickness\/2,-8*mm])\n rcubea(size=[5,12,10], align=X+Y, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1*mm, orient=Y, align=-Y, extra_h=.1*mm, extra_align=Y);\n\n \/\/ cut out for shaft (so we can attach a knob)\n cylindera(d=extruder_b_bearing[0]+1*mm, h=1000, orient=Y, align=N);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=true, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, head_embed=true, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n sensormount_clamp(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-15*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n tz(-10*mm)\n rcubea(size=[18*mm,4*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(side)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n mx(side==1)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n mx(side==1)\n extruder_b();\n\n mx(side==1)\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n mx(side==1)\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend(side);\n\n mx(side==1)\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*187*mm:-129*mm)\n {\n mx(x==1)\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(x);\n\n mx(x==1)\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*270,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c8cfdb38af5a05f5d11bdddec53e54a6215da462","subject":"parameterize the intersection x translate value","message":"parameterize the intersection x translate value\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/lamp-shade.scad","new_contents":"\nmodule lampShade(fn = 160,\n intersection_xTranslate = -20,\n outerRadius = 10,\n squareLength = 10,\n xScale = 1.0,\n yScale = 1.0)\n{\n $fn = fn;\n\n innerRadius = outerRadius - 2.0;\n\n rotate_extrude(angle = 360)\n translate([intersection_xTranslate, 0, 0])\n intersection()\n {\n difference()\n {\n scale([xScale, yScale, 1])\n circle(r = outerRadius, $fn = fn);\n\n scale([xScale, yScale, 1])\n circle(r = innerRadius, $fn = fn);\n }\n\n \/\/ use a value of of 0 to invert the shade (widder top)\n translate([0, -squareLength, 0])\n square([squareLength, squareLength]);\n }\n}\n","old_contents":"\nmodule lampShade(fn = 160,\n outerRadius = 10,\n squareLength = 10,\n xScale = 1.0,\n yScale = 1.0)\n{\n $fn = fn;\n\n innerRadius = outerRadius - 2.0;\n\n rotate_extrude(angle = 360)\n translate([-20, 0, 0])\n intersection()\n {\n difference()\n {\n scale([xScale, yScale, 1])\n circle(r = outerRadius, $fn = fn);\n\n scale([xScale, yScale, 1])\n circle(r = innerRadius, $fn = fn);\n }\n\n \/\/ use a value of of 0 to invert the shade (widder top)\n translate([0, -squareLength, 0])\n square([squareLength, squareLength]);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6f0a488c3f8563659daf2e9e314f89d4c766a113","subject":"The module name wad refactored.","message":"The module name wad refactored.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/2d-to-3d\/frida-kahlo\/18-frida-kahlo-book-lede.w1200.h630.scad","new_file":"OpenSCAD\/2d-to-3d\/frida-kahlo\/18-frida-kahlo-book-lede.w1200.h630.scad","new_contents":"\r\nmodule fridaKalohBrow(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-41.812656,21.152012],[-45.803359,20.878887],[-50.510781,19.898887],[-61.147656,16.519512],[-80.812656,8.992012],[-105.812656,2.632012],[-121.812656,0.192012],[-138.812656,-4.437988],[-145.940625,-5.083770],[-155.808906,-5.171738],[-165.679062,-4.695332],[-169.759082,-4.243437],[-172.812656,-3.647988],[-176.281621,-2.429023],[-179.114375,-0.890020],[-181.424707,0.953438],[-183.326406,3.085762],[-184.933262,5.491367],[-186.359062,8.154668],[-189.122656,14.192012],[-192.867656,22.478262],[-195.532656,31.192012],[-196.930625,35.366699],[-197.897441,37.538770],[-199.088906,39.539512],[-200.539590,41.198066],[-202.284062,42.343574],[-204.356895,42.805176],[-206.792656,42.412012],[-208.545059,41.609570],[-209.865625,40.556230],[-210.811895,39.291719],[-211.441406,37.855762],[-211.980312,34.628418],[-211.942656,31.192012],[-211.613594,24.246699],[-211.072656,18.049512],[-209.864219,11.923574],[-207.532656,5.192012],[-203.804375,-3.141582],[-199.343906,-11.204238],[-196.728652,-14.956719],[-193.797812,-18.428770],[-190.507207,-21.549492],[-186.812656,-24.247988],[-170.812656,-31.157988],[-164.232656,-34.664082],[-157.352656,-37.846738],[-150.202656,-40.300020],[-146.535781,-41.126289],[-142.812656,-41.617988],[-140.245586,-41.636562],[-137.532969,-41.339082],[-131.857656,-40.151738],[-126.159844,-38.767520],[-120.812656,-37.897988],[-86.812656,-35.637988],[-49.812656,-28.387988],[-17.852656,-20.417988],[-16.177129,-20.695488],[-14.477812,-21.512988],[-11.081406,-24.227988],[-7.810625,-27.482988],[-4.812656,-30.197988],[0.339063,-33.401582],[5.666094,-35.621738],[11.253750,-37.135020],[17.187344,-38.217988],[49.187344,-41.027988],[57.187344,-41.027988],[81.187344,-42.437988],[91.088125,-42.805176],[101.698594,-42.772988],[112.303437,-42.373301],[122.187344,-41.637988],[139.187344,-39.097988],[144.486562,-38.642988],[149.518594,-38.367988],[154.635000,-37.747988],[160.187344,-36.257988],[165.503438,-33.784863],[170.968594,-30.415488],[181.187344,-23.327988],[189.943594,-17.874238],[193.859063,-14.886270],[197.657344,-10.807988],[200.250781,-6.983457],[201.994844,-3.454238],[205.057344,4.192012],[208.938594,11.368262],[210.849688,15.069355],[211.897344,18.192012],[211.980313,19.958750],[211.702344,21.625293],[211.094375,23.141133],[210.187344,24.455762],[209.012188,25.518672],[207.599844,26.279355],[205.981250,26.687305],[204.187344,26.692012],[201.685469,25.980293],[199.044844,24.643262],[194.187344,21.642012],[182.187344,15.722012],[174.820781,10.794199],[167.744844,5.519512],[160.140156,0.301074],[155.883477,-2.161074],[151.187344,-4.457988],[144.912813,-6.734863],[138.431094,-8.227988],[131.827500,-9.121113],[125.187344,-9.597988],[121.078281,-9.397207],[116.247344,-8.674238],[107.187344,-7.097988],[95.097344,-5.935488],[89.077656,-5.087051],[83.187344,-3.557988],[72.187344,1.562012],[62.187344,3.202012],[47.187344,6.932012],[28.187344,9.492012],[25.541035,10.086816],[23.417500,10.824824],[19.991094,12.437012],[16.412813,13.741699],[14.099434,14.095332],[11.187344,14.152012],[7.993965,13.779727],[5.093438,12.975605],[-0.161406,10.508262],[-5.241875,7.622793],[-7.924434,6.296016],[-10.812656,5.192012],[-13.142598,8.906387],[-16.231562,12.101387],[-19.920762,14.791074],[-24.051406,16.989512],[-28.464707,18.710762],[-33.001875,19.968887],[-37.504121,20.777949],[-41.812656,21.152012]]);\r\n }\r\n}\r\n\r\nfridaKalohBrow(5);\r\n","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-41.812656,21.152012],[-45.803359,20.878887],[-50.510781,19.898887],[-61.147656,16.519512],[-80.812656,8.992012],[-105.812656,2.632012],[-121.812656,0.192012],[-138.812656,-4.437988],[-145.940625,-5.083770],[-155.808906,-5.171738],[-165.679062,-4.695332],[-169.759082,-4.243437],[-172.812656,-3.647988],[-176.281621,-2.429023],[-179.114375,-0.890020],[-181.424707,0.953438],[-183.326406,3.085762],[-184.933262,5.491367],[-186.359062,8.154668],[-189.122656,14.192012],[-192.867656,22.478262],[-195.532656,31.192012],[-196.930625,35.366699],[-197.897441,37.538770],[-199.088906,39.539512],[-200.539590,41.198066],[-202.284062,42.343574],[-204.356895,42.805176],[-206.792656,42.412012],[-208.545059,41.609570],[-209.865625,40.556230],[-210.811895,39.291719],[-211.441406,37.855762],[-211.980312,34.628418],[-211.942656,31.192012],[-211.613594,24.246699],[-211.072656,18.049512],[-209.864219,11.923574],[-207.532656,5.192012],[-203.804375,-3.141582],[-199.343906,-11.204238],[-196.728652,-14.956719],[-193.797812,-18.428770],[-190.507207,-21.549492],[-186.812656,-24.247988],[-170.812656,-31.157988],[-164.232656,-34.664082],[-157.352656,-37.846738],[-150.202656,-40.300020],[-146.535781,-41.126289],[-142.812656,-41.617988],[-140.245586,-41.636562],[-137.532969,-41.339082],[-131.857656,-40.151738],[-126.159844,-38.767520],[-120.812656,-37.897988],[-86.812656,-35.637988],[-49.812656,-28.387988],[-17.852656,-20.417988],[-16.177129,-20.695488],[-14.477812,-21.512988],[-11.081406,-24.227988],[-7.810625,-27.482988],[-4.812656,-30.197988],[0.339063,-33.401582],[5.666094,-35.621738],[11.253750,-37.135020],[17.187344,-38.217988],[49.187344,-41.027988],[57.187344,-41.027988],[81.187344,-42.437988],[91.088125,-42.805176],[101.698594,-42.772988],[112.303437,-42.373301],[122.187344,-41.637988],[139.187344,-39.097988],[144.486562,-38.642988],[149.518594,-38.367988],[154.635000,-37.747988],[160.187344,-36.257988],[165.503438,-33.784863],[170.968594,-30.415488],[181.187344,-23.327988],[189.943594,-17.874238],[193.859063,-14.886270],[197.657344,-10.807988],[200.250781,-6.983457],[201.994844,-3.454238],[205.057344,4.192012],[208.938594,11.368262],[210.849688,15.069355],[211.897344,18.192012],[211.980313,19.958750],[211.702344,21.625293],[211.094375,23.141133],[210.187344,24.455762],[209.012188,25.518672],[207.599844,26.279355],[205.981250,26.687305],[204.187344,26.692012],[201.685469,25.980293],[199.044844,24.643262],[194.187344,21.642012],[182.187344,15.722012],[174.820781,10.794199],[167.744844,5.519512],[160.140156,0.301074],[155.883477,-2.161074],[151.187344,-4.457988],[144.912813,-6.734863],[138.431094,-8.227988],[131.827500,-9.121113],[125.187344,-9.597988],[121.078281,-9.397207],[116.247344,-8.674238],[107.187344,-7.097988],[95.097344,-5.935488],[89.077656,-5.087051],[83.187344,-3.557988],[72.187344,1.562012],[62.187344,3.202012],[47.187344,6.932012],[28.187344,9.492012],[25.541035,10.086816],[23.417500,10.824824],[19.991094,12.437012],[16.412813,13.741699],[14.099434,14.095332],[11.187344,14.152012],[7.993965,13.779727],[5.093438,12.975605],[-0.161406,10.508262],[-5.241875,7.622793],[-7.924434,6.296016],[-10.812656,5.192012],[-13.142598,8.906387],[-16.231562,12.101387],[-19.920762,14.791074],[-24.051406,16.989512],[-28.464707,18.710762],[-33.001875,19.968887],[-37.504121,20.777949],[-41.812656,21.152012]]);\r\n }\r\n}\r\n\r\nmodule 18fridakahlobookledew1200h630(h)\r\n{\r\n\r\npoly_Selection(h);\r\n}\r\n\r\n18fridakahlobookledew1200h630(5);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"acbbfb4d7d725250c7a8f7d0d84e5e817df84042","subject":"x\/carriage: use rcylindera","message":"x\/carriage: use rcylindera\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n {\n hull()\n {\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n \/*rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);*\/\n }\n }\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])*\/\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0]);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n {\n hull()\n {\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n \/*rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);*\/\n }\n }\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])*\/\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"aedb9737bf2268062dc27b429554f98d72ab9b6d","subject":"metric-screw: use fallback func","message":"metric-screw: use fallback func\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = override_h==undef?head_h:override_h);\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=override_h==undef?head_h:override_h, align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"76181c77ba693c1f533cb622c41f65890975e1bc","subject":"Update knurled cap M5 demo","message":"Update knurled cap M5 demo\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"knurled-cap\/demo_cap_m5.scad","new_file":"knurled-cap\/demo_cap_m5.scad","new_contents":"include ;\n\n\/\/ Note that I get a very strange behavior with F5 mode, a fixed polygon covers\n\/\/ half my screen and some of the tee part is missing. When rendering in F6\n\/\/ mode, everying behaves.\n\nM5_head = 8.8\/2;\nM5_tall = 5;\nM5_pegrad = 4\/2;\n\nnum_caps = 1;\n\nunion() {\n for(i=[1:num_caps]) {\n translate([i*40, 0, 0])\n Knob(outerRad=M5_head*1.65, pegRad=M5_pegrad, capRad=M5_head,\n chamfer=0.9, $fn=100);\n }\n}\n\n\/\/ vim: ft=c sw=2 sts=2 ts=2 et\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'knurled-cap\/demo_cap_m5.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"95813ecd0d536e4be30fa1e397f0212d7af7f369","subject":"Got the enclosure and the struts working","message":"Got the enclosure and the struts working\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube_with_enclosure.scad","new_file":"inverse_cube_with_enclosure.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\nhull_width = 7;\nstrut_width = 3;\n\necho(version());\necho(\"Total Size: ---------\");\necho(((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size);\necho(\"---------------------\");\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nmodule struts(total_length) {\n strut_length = total_length * sqrt(3) + hull_width \/ 2;\n \n for(i = [[35, 0, -45], [35, 0, 45], [-35, 0, 45], [-35, 0, -45]]) {\n rotate(i) {\n cube([strut_width, strut_length, strut_width], center = true);\n }\n }\n}\n\nmodule enclosure() {\n total_length = ((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size;\n \n union() {\n difference() {\n cube(total_length + hull_width, center = true);\n \n for(i = [[hull_width + 1, 0, 0], [0, hull_width + 1, 0], [0, 0, hull_width + 1], [-hull_width - 1, 0, 0], [0, -hull_width - 1, 0], [0, 0, -hull_width - 1]]) {\n translate(i) {\n cube(total_length, center = true);\n }\n }\n }\n \n struts(total_length);\n }\n}\n\nunion() {\n \/\/cube(init_size, center = true);\n \/\/saux_cubes(1, [0, 0, 0]);\n \n enclosure();\n \n}","old_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5e748466604c34b92d4481533940111ce645852b","subject":"fixed colusion of LCD mounting with cable guide drill","message":"fixed colusion of LCD mounting with cable guide drill\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+10, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d6b17c06c86c8e6ec355651c87e18912bbaf49e7","subject":"feat: add an operator to animate a mirroring","message":"feat: add an operator to animate a mirroring\n","repos":"jsconan\/camelSCAD","old_file":"operator\/animate\/mirror.scad","new_file":"operator\/animate\/mirror.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that animate child modules with respect to particular rules.\n *\n * @package operator\/animate\n * @author jsconan\n *\/\n\n\/**\n * Mirrors the child modules, interpolating the axis with respect to the `$t` variable.\n *\n * @param Vector [from] - The axis from where starts the interpolation.\n * @param Vector [to] - The axis to where ends the interpolation.\n * @param Number [start] - The start threshold under what the from-axis will persist and above what it will be interpolated.\n * @param Number [end] - The end threshold above what the to-axis will persist and under what it will be interpolated.\n * @param Number [domain] - The percentage domain used to compute the thresholds (default: 100).\n * @param Vector [values] - A list of axis composing the range to interpolate.\n * @param Vector [range] - A pre-built interpolation range. If missing, it will be built from the parameters `from`, `to`, `start`, `end`, `domain`.\n * @returns Number\n *\/\nmodule mirrorAnimate(from, to, start, end, domain, values, range) {\n mirror(interpolateStep3D(step=$t, low=from, high=to, start=start, end=end, domain=domain, values=values, range=range)) {\n children();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'operator\/animate\/mirror.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b64440c81f158e5c763213c48d89508e1dfdfdb4","subject":"[3d] Remove mousears, add configurable body chamfer and walls now full 3mm","message":"[3d] Remove mousears, add configurable body chamfer and walls now full 3mm\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/* [Advanced] *\/\n\/\/ Thickness of side walls\nwall = 3;\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t,lcd_mount_t,lcd_mount_t,lcd_mount_t]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex+1, 2, h_b]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex+1, 2.5, h_b]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex+1, 3, h_b]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34-wall+1);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.0*1.41; \/\/ thickness of side walls (*1.41 so rounded corners are this width)\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\necho(\"WALL is \", wall);\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=4, top=1.5, bottom=1.5, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t,lcd_mount_t,lcd_mount_t,lcd_mount_t]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex+1, 2, h_b]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex+1, 2.5, h_b]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex+1, 3, h_b]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34-wall+1);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1fd071be03cb6d60ba2927d95393996c1052edd5","subject":"yaxis\/idler: tweaks to pulley block","message":"yaxis\/idler: tweaks to pulley block\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-idler.scad","new_file":"y-axis-idler.scad","new_contents":"use \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = yaxis_pulley_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, MHexNutM4);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, MHexNutM4);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*2;\n union()\n {\n translate([0,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size+yaxis_idler_mount_thickness*2, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1]);\n }\n\n hull()\n {\n translate([0,0,extrusion_size\/2])\n {\n translate([0,0,yaxis_belt_path_offset_z])\n fncylindera(\n h=extrusion_size+yaxis_idler_mount_thickness*2,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size+yaxis_idler_mount_thickness*2, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1]);\n }\n }\n }\n\n translate([0,0,extrusion_size\/2])\n {\n for(i=[-1,1])\n translate([0, i*mount_screw_dist\/2, 0])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[0,0,1]);\n\n \/\/ cutout tighten screw\n translate([0,0,yaxis_belt_path_offset_z])\n fncylindera(h=extrusion_size+yaxis_idler_mount_thickness*2+1, d=yaxis_idler_mount_tightscrew_dia, orient=[1,0,0], align=[0,0,0]);\n\n \/\/ cutout tighten screw\n translate([-extrusion_size\/2-yaxis_idler_mount_thickness-.1,0,yaxis_belt_path_offset_z])\n fncylindera(h=extrusion_size,d=yaxis_idler_mount_tightscrew_dia*2, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/*difference()*\/\n \/*{*\/\n \/*cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[1,0,0]);*\/\n\n \/*for(i=[-1,1])*\/\n \/*translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])*\/\n \/*fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[1,0,0]);*\/\n \/*}*\/\n\n \/*\/\/ bottom mount plate*\/\n \/*translate([0,0,-main_lower_dist_z])*\/\n \/*{*\/\n \/*difference()*\/\n \/*{*\/\n \/*cubea([yaxis_idler_mount_thickness, yidler_w, extrusion_size], align=[1,0,0]);*\/\n\n \/*for(i=[0])*\/\n \/*translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])*\/\n \/*fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);*\/\n \/*}*\/\n \/*}*\/\n\n }\n\n }\n}\n\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_pulley_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley_idler_2GT2_20T();\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*fncylindera(d=yaxis_pulley_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n cubea([yaxis_idler_pulleyblock_supportsize, yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_pulley_d, yaxis_pulley_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_pulley_d, yaxis_pulley_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,yaxis_idler_pulley_h\/2+1])\n {\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n }\n\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n translate([-15*mm+yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len-.1, 0, 0])\n {\n fncylindera(fn=6, d=yaxis_idler_mount_tightscrew_hexnut_dia*1.01, h=yaxis_idler_pulley_tight_len+.1, orient=[1,0,0], align=[1,0,0]);\n\n translate([yaxis_idler_mount_tightscrew_hexnut_thick,0,0])\n fncylindera(d=yaxis_idler_mount_tightscrew_hexnut_dia*1.2, h=yaxis_idler_pulley_tight_len+.1, orient=[1,0,0], align=[1,0,0]);\n }\n\n fncylindera(d=yaxis_idler_mount_tightscrew_dia, h=yaxis_idler_pulleyblock_lenfrompulley+.1, orient=[1,0,0], align=[-1,0,0]);\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*print_yaxis_idler();*\/\n\/*yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"use \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = yaxis_pulley_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, MHexNutM4);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, MHexNutM4);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*2;\n union()\n {\n translate([0,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size+yaxis_idler_mount_thickness*2, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1]);\n }\n\n hull()\n {\n translate([0,0,extrusion_size\/2])\n {\n translate([0,0,yaxis_belt_path_offset_z])\n fncylindera(\n h=extrusion_size+yaxis_idler_mount_thickness*2,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size+yaxis_idler_mount_thickness*2, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1]);\n }\n }\n }\n\n translate([0,0,extrusion_size\/2])\n {\n for(i=[-1,1])\n translate([0, i*mount_screw_dist\/2, 0])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[0,0,1]);\n\n \/\/ cutout tighten screw\n translate([0,0,yaxis_belt_path_offset_z])\n fncylindera(h=extrusion_size+yaxis_idler_mount_thickness*2+1, d=yaxis_idler_mount_tightscrew_dia, orient=[1,0,0], align=[0,0,0]);\n\n \/\/ cutout tighten screw\n translate([-extrusion_size\/2-yaxis_idler_mount_thickness-.1,0,yaxis_belt_path_offset_z])\n fncylindera(h=extrusion_size,d=yaxis_idler_mount_tightscrew_dia*2, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/*difference()*\/\n \/*{*\/\n \/*cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[1,0,0]);*\/\n\n \/*for(i=[-1,1])*\/\n \/*translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])*\/\n \/*fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[1,0,0]);*\/\n \/*}*\/\n\n \/*\/\/ bottom mount plate*\/\n \/*translate([0,0,-main_lower_dist_z])*\/\n \/*{*\/\n \/*difference()*\/\n \/*{*\/\n \/*cubea([yaxis_idler_mount_thickness, yidler_w, extrusion_size], align=[1,0,0]);*\/\n\n \/*for(i=[0])*\/\n \/*translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])*\/\n \/*fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);*\/\n \/*}*\/\n \/*}*\/\n\n }\n\n }\n}\n\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_pulley_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley_idler_2GT2_20T();\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*fncylindera(d=yaxis_pulley_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n cubea([yaxis_idler_pulleyblock_supportsize, yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_pulley_d, yaxis_pulley_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_pulley_d, yaxis_pulley_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,yaxis_idler_pulley_h\/2+1])\n {\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n }\n\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n translate([8*mm-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len-.1, 0, 0])\n {\n fncylindera(fn=6, d=yaxis_idler_mount_tightscrew_hexnut_dia*1.01, h=yaxis_idler_pulley_tight_len+.1, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=yaxis_idler_mount_tightscrew_hexnut_dia*1.2, h=yaxis_idler_pulley_tight_len+.1, orient=[1,0,0], align=[1,0,0]);\n }\n\n fncylindera(d=yaxis_idler_mount_tightscrew_dia, h=yaxis_idler_pulleyblock_lenfrompulley+.1, orient=[1,0,0], align=[-1,0,0]);\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*print_yaxis_idler();*\/\n\/*yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d0a30f53dd884faf6b03c961b7ef80367604314d","subject":"Fix typo","message":"Fix typo\n","repos":"jsconan\/camelSCAD","old_file":"shape\/context\/build-box.scad","new_file":"shape\/context\/build-box.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Build box visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of the build plate.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBuildPlate(size, cell, l, w, cl, cw) =\n let(\n size = apply2D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w),\n cell = apply2D(uor(cell, DEFAULT_BUILD_PLATE_CELL), cl, cw),\n nb = [\n cell[0] ? floor(size[0] \/ cell[0]) : 0,\n cell[1] ? floor(size[1] \/ cell[1]) : 0\n ],\n count = [\n nb[0] + 1,\n nb[1] + 1\n ],\n offset = [\n cell[0] ? -nb[0] * cell[0] \/ 2 : 0,\n cell[1] ? -nb[1] * cell[1] \/ 2 : 0\n ]\n )\n [ size, cell, count, offset ]\n;\n\n\/**\n * Creates a build plate visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n *\/\nmodule buildPlate(size=DEFAULT_BUILD_PLATE_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, cl, cw) {\n size = sizeBuildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n plateSize = size[0];\n cellSize = size[1];\n cellCount = size[2];\n cellOffset = size[3];\n\n plateHeight = 1;\n lineWidth = .5;\n\n %color([1, 1, 1, .2]) {\n negativeExtrude(height=-plateHeight, direction=0) {\n rectangle(plateSize);\n }\n negativeExtrude(height=-plateHeight, direction=2) {\n translateX(cellOffset[0]) {\n repeat(count=cellCount[0], intervalX=cellSize[0]) {\n rectangle([lineWidth, plateSize[1]]);\n }\n }\n translateY(cellOffset[1]) {\n repeat(count=cellCount[1], intervalY=cellSize[1]) {\n rectangle([plateSize[0], lineWidth]);\n }\n }\n }\n }\n}\n\n\/**\n * Creates a build volume visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build box.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n *\/\nmodule buildVolume(size=DEFAULT_BUILD_VOLUME_SIZE, l, w, h) {\n %color([1, 1, 1, .1]) {\n box(size=size, l=l, w=w, h=w);\n }\n}\n\n\/**\n * Creates a build box visualization at the origin.\n * A build box contains visualizations for a build plate and a build volume.\n * It also applies a render mode.\n * @param String [mode] - The mode to apply on the children modules.\n * @param Number|Vector [size] - The size of the build volume.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n *\/\nmodule buildBox(size, cell, mode, l, w, h, cl, cw) {\n size = apply3D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w, h);\n\n buildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n buildVolume(size=size, l=l, w=w, h=h);\n\n applyMode(mode) {\n children();\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Build box visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of the build plate.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBuildPlate(size, cell, l, w, cl, cw) =\n let(\n size = apply2D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w),\n cell = apply2D(uor(cell, DEFAULT_BUILD_PLATE_CELL), cl, cw),\n nb = [\n cell[0] ? floor(size[0] \/ cell[0]) : 0,\n cell[1] ? floor(size[1] \/ cell[1]) : 0\n ],\n count = [\n nb[0] + 1,\n nb[1] + 1\n ],\n offset = [\n cell[0] ? -nb[0] * cell[0] \/ 2 : 0,\n cell[1] ? -nb[1] * cell[1] \/ 2 : 0\n ]\n )\n [ size, cell, count, offset ]\n;\n\n\/**\n * Creates a build plate vizualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n *\/\nmodule buildPlate(size=DEFAULT_BUILD_PLATE_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, cl, cw) {\n size = sizeBuildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n plateSize = size[0];\n cellSize = size[1];\n cellCount = size[2];\n cellOffset = size[3];\n\n plateHeight = 1;\n lineWidth = .5;\n\n %color([1, 1, 1, .2]) {\n negativeExtrude(height=-plateHeight, direction=0) {\n rectangle(plateSize);\n }\n negativeExtrude(height=-plateHeight, direction=2) {\n translateX(cellOffset[0]) {\n repeat(count=cellCount[0], intervalX=cellSize[0]) {\n rectangle([lineWidth, plateSize[1]]);\n }\n }\n translateY(cellOffset[1]) {\n repeat(count=cellCount[1], intervalY=cellSize[1]) {\n rectangle([plateSize[0], lineWidth]);\n }\n }\n }\n }\n}\n\n\/**\n * Creates a build volume vizualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build box.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n *\/\nmodule buildVolume(size=DEFAULT_BUILD_VOLUME_SIZE, l, w, h) {\n %color([1, 1, 1, .1]) {\n box(size=size, l=l, w=w, h=w);\n }\n}\n\n\/**\n * Creates a build box vizualization at the origin.\n * A build box contains vizualizations for a build plate and a build volume.\n * It also applies a render mode.\n * @param String [mode] - The mode to apply on the children modules.\n * @param Number|Vector [size] - The size of the build volume.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n *\/\nmodule buildBox(size, cell, mode, l, w, h, cl, cw) {\n size = apply3D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w, h);\n\n buildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n buildVolume(size=size, l=l, w=w, h=h);\n\n applyMode(mode) {\n children();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5bb6bea74a68f3386e97ded4a087532c3fe0849e","subject":"box draft is ready","message":"box draft is ready\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"usb_power_relay\/box\/usb_power_relay_box.scad","new_file":"usb_power_relay\/box\/usb_power_relay_box.scad","new_contents":"$fa=1;\n$fs=0.5;\nwall=1.5;\n\nmodule bottom()\n{\n translate(wall*[1, 1, 1])\n cube([45, 60, wall]);\n cube([45+2*wall, 60+2*wall, wall]);\n}\n\nmodule cover()\n{\n translate([0, 0, 25+2*wall])\n rotate([180, 0, 0])\n difference()\n {\n cube([45+2*wall, 60+2*wall, 25+2*wall]);\n translate(wall*[1,1,0])\n cube([45, 60, 25+wall]);\n translate([-5, 8\/2+wall+3, wall+8])\n hull()\n for(dz=[0, -10])\n translate([0, 0, dz-8\/2])\n rotate([0, 90, 0])\n cylinder(r=8\/2, h=60);\n translate([(45+2*wall)\/2, 60, wall+3])\n hull()\n for(dz=[0, -10])\n translate([0, 0, dz-3\/2])\n rotate([-90, 0, 0])\n cylinder(r=3\/2, h=4*wall);\n }\n}\n\n\nbottom();\ntranslate([0, -5, 0])\n cover();\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b529e8198ae7662b9eab66c74d3b26e76fb47b6e","subject":"Updated description.","message":"Updated description.\n","repos":"mseminatore\/mdsSpurGear","old_file":"mdsSpurGear.scad","new_file":"mdsSpurGear.scad","new_contents":"\/\/===================================================================================\n\/\/ Parametric Involute Spur Gear OpenSCAD script\n\/\/\n\/\/ Based on Boston Gear design rules https:\/\/www.bostongear.com\/pdf\/gear_theory.pdf\n\/\/\n\/\/ Copyright (c) 2016 Mark David Seminatore\n\/\/\n\/\/ Refer to included LICENSE.txt for usage rights and restrictions\n\/\/===================================================================================\n\/\/\n\nuse \n\n$fs = 0.01;\n\n\/\/ Create an example gear with all default options\nmdsSpurGear(smooth_teeth = true);\n\n\/\/\n\/\/\n\/\/\nmodule mdsSpurGear(\n teeth = 24, \n diametral_pitch = 24, \n pressure_angle = 20, \n shaft_dia = 0.125, \n thickness = 0.125, \n major_holes = true, \n minor_holes = true, \n num_holes = 4, \n smooth_teeth = false, \n hub_thickness_ratio = 1,\n debug_echo = false\n ) \n{\n \/\/ calculate some of the basic basic gear parameters\n pitch_dia = pitchDiameter(teeth, diametral_pitch);\n pitch_radius = pitch_dia \/ 2;\n \n addendum = 1 \/ diametral_pitch;\n \n outer_dia = pitch_dia + 2 * addendum;\n outer_radius = outer_dia \/ 2;\n \n whole_depth = 2.2 \/ diametral_pitch + 0.002;\n dedendum = whole_depth - addendum;\n \n root_dia = pitch_dia - 2 * dedendum;\n root_radius = root_dia \/ 2;\n \n base_dia = pitch_dia * cos(pressure_angle);\n base_radius = base_dia \/ 2;\n \n r_mid_point = root_radius \/ 2 + shaft_dia \/ 4;\n \n if (debug_echo) {\n echo(root_dia = root_dia, base_dia = base_dia, pitch_dia = pitch_dia, outer_dia = outer_dia, whole_depth = whole_depth, addendum = addendum, dedendum = dedendum);\n echo(r_mid_point = r_mid_point);\n }\n \n \/\/ draw rim if present\n linear_extrude(height = hub_thickness_ratio * thickness)\n union() {\n difference() {\n circle($fn = teeth * 3, d = root_dia);\n circle($fn = teeth * 3, d = 0.9 * root_dia);\n }\n \n pitch_to_base_angle = involuteIntersectionAngle( base_radius, pitch_radius );\n outer_to_base_angle = involuteIntersectionAngle( base_radius, outer_radius );\n \n half_angle = 360 \/ (4 * teeth);\n \n base_angle = pitch_to_base_angle + half_angle;\n \n if (debug_echo)\n echo(half_angle=half_angle,pitch_to_base_angle=pitch_to_base_angle,base_angle=base_angle);\n\n \/\/ draw teeth\n for (i = [1 : teeth]) {\n \n \/\/ coordinates of tooth base\n b1 = fromPolar(root_radius, base_angle);\n b2 = fromPolar(root_radius, -base_angle);\n\n \/\/ coordinates of tooth at pitch diameter\n p1 = b1 + fromPolar(dedendum, pitch_to_base_angle);\n p2 = b2 + fromPolar(dedendum, -pitch_to_base_angle);\n\n \/\/ TODO - dp _should_ equal t here, figure out error\n\/\/ t = toothThickness();\n\/\/ dp = p1 - p2;\n\/\/ echo(t=t, dp = dp);\n \n \/\/ coordinates of tooth at outer diameter\n o1 = p1 + fromPolar(addendum, -pressure_angle);\n o2 = p2 + fromPolar(addendum, pressure_angle);\n \n rotate([0, 0, i * 360 \/ teeth]) {\n if (smooth_teeth) {\n \/\/ eight seems to work best in most cases\n pointCount = 8;\n \n curve1 = bezierCurve(b1, p1, o1, n = pointCount);\n curve2 = bezierCurve(b2, p2, o2, n = pointCount);\n \n \/\/ join the two curves into a tooth profile\n points = concat(curve1, curve2);\n \n \/\/ create indices for the two tooth \n seq1 = sequence(0, pointCount);\n seq2 = sequence(2 * pointCount + 1, pointCount + 1);\n\n path = concat(seq1, seq2);\n polygon(points, paths=[path], convexity=10);\n } else\n {\n p = [b1, p1, o1, o2, p2, b2];\n polygon(p);\n }\n }\n } \n }\n \n \/\/ draw the main disc\n translate([0, 0, (hub_thickness_ratio * thickness - thickness)\/2])\n linear_extrude(height = thickness)\n union() {\n \n difference() {\n \/\/ draw root circle\n circle($fn = teeth*3, d = root_dia);\n \n \/\/ subtract shaft\n circle(d = shaft_dia);\n \n \/\/ draw major holes\n if (major_holes && r_mid_point >= 0.125) {\n if (debug_echo)\n echo(\"Draw major holes\");\n \n angle_inc = 360 \/ num_holes;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc])\n translate([r_mid_point, 0, 0])\n circle(d = 0.85 * r_mid_point);\n }\n }\n \n \/\/ draw minor hollows\n if (minor_holes && r_mid_point >= 0.25) {\n if (debug_echo) \n echo(\"Draw minor holes\");\n \n angle_inc = 360 \/ num_holes;\n\n inner_minor_dia = r_mid_point \/ 4;\n inner_minor_ctr = r_mid_point \/ 3;\n outer_minor_dia = r_mid_point \/ 2;\n outer_minor_ctr = r_mid_point * 1.2;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc + angle_inc \/ 2]) {\n \/\/ selectively draw inner minor holes\n if (inner_minor_ctr - inner_minor_dia \/ 2 > shaft_dia \/ 2 + 0.125)\n {\n translate([inner_minor_ctr, 0, 0])\n circle(d = inner_minor_dia);\n } \n \n \/\/ selectively draw outer minor holes\n translate([outer_minor_ctr, 0, 0])\n circle(d = outer_minor_dia);\n }\n }\n }\n }\n }\n}\n","old_contents":"\/\/===================================================================================\n\/\/ Parameteric Spur Gear OpenSCAD script\n\/\/\n\/\/ Based on Boston Gear design rules https:\/\/www.bostongear.com\/pdf\/gear_theory.pdf\n\/\/\n\/\/ Copyright (c) 2016 Mark David Seminatore\n\/\/\n\/\/ Refer to included LICENSE.txt for usage rights and restrictions\n\/\/===================================================================================\n\/\/\n\nuse \n\n$fs = 0.01;\n\n\/\/ Create an example gear with all default options\nmdsSpurGear(smooth_teeth = true);\n\n\/\/\n\/\/\n\/\/\nmodule mdsSpurGear(\n teeth = 24, \n diametral_pitch = 24, \n pressure_angle = 20, \n shaft_dia = 0.125, \n thickness = 0.125, \n major_holes = true, \n minor_holes = true, \n num_holes = 4, \n smooth_teeth = false, \n hub_thickness_ratio = 1,\n debug_echo = false\n ) \n{\n \/\/ calculate some of the basic basic gear parameters\n pitch_dia = pitchDiameter(teeth, diametral_pitch);\n pitch_radius = pitch_dia \/ 2;\n \n addendum = 1 \/ diametral_pitch;\n \n outer_dia = pitch_dia + 2 * addendum;\n outer_radius = outer_dia \/ 2;\n \n whole_depth = 2.2 \/ diametral_pitch + 0.002;\n dedendum = whole_depth - addendum;\n \n root_dia = pitch_dia - 2 * dedendum;\n root_radius = root_dia \/ 2;\n \n base_dia = pitch_dia * cos(pressure_angle);\n base_radius = base_dia \/ 2;\n \n r_mid_point = root_radius \/ 2 + shaft_dia \/ 4;\n \n if (debug_echo) {\n echo(root_dia = root_dia, base_dia = base_dia, pitch_dia = pitch_dia, outer_dia = outer_dia, whole_depth = whole_depth, addendum = addendum, dedendum = dedendum);\n echo(r_mid_point = r_mid_point);\n }\n \n \/\/ draw rim if present\n linear_extrude(height = hub_thickness_ratio * thickness)\n union() {\n difference() {\n circle($fn = teeth*3, d = root_dia);\n circle($fn = teeth*3, d = 0.9 * root_dia);\n }\n \n pitch_to_base_angle = involuteIntersectionAngle( base_radius, pitch_radius );\n outer_to_base_angle = involuteIntersectionAngle( base_radius, outer_radius );\n \n half_angle = 360 \/ (4 * teeth);\n \n base_angle = pitch_to_base_angle + half_angle;\n \n if (debug_echo)\n echo(half_angle=half_angle,pitch_to_base_angle=pitch_to_base_angle,base_angle=base_angle);\n\n \/\/ draw teeth\n for (i = [1 : teeth]) {\n \n \/\/ coordinates of tooth base\n b1 = fromPolar(root_radius, base_angle);\n b2 = fromPolar(root_radius, -base_angle);\n\n \/\/ coordinates of tooth at pitch diameter\n p1 = b1 + fromPolar(dedendum, pitch_to_base_angle);\n p2 = b2 + fromPolar(dedendum, -pitch_to_base_angle);\n\n \/\/ TODO - dp _should_ equal t here, figure out error\n\/\/ t = toothThickness();\n\/\/ dp = p1 - p2;\n\/\/ echo(t=t, dp = dp);\n \n \/\/ coordinates of tooth at outer diameter\n o1 = p1 + fromPolar(addendum, -pressure_angle);\n o2 = p2 + fromPolar(addendum, pressure_angle);\n \n rotate([0, 0, i * 360 \/ teeth]) {\n if (smooth_teeth) {\n \/\/ eight seems to work best in most cases\n pointCount = 8;\n \n curve1 = bezierCurve(b1, p1, o1, n = pointCount);\n curve2 = bezierCurve(b2, p2, o2, n = pointCount);\n \n \/\/ join the two curves into a tooth profile\n points = concat(curve1, curve2);\n \n \/\/ create indices for the two tooth \n seq1 = sequence(0, pointCount);\n seq2 = sequence(2 * pointCount + 1, pointCount + 1);\n\n path = concat(seq1, seq2);\n\n polygon(points, paths=[path], convexity=10);\n } else\n {\n p = [b1, p1, o1, o2, p2, b2];\n polygon(p);\n }\n }\n } \n }\n \n \/\/ draw the main disc\n translate([0, 0, (hub_thickness_ratio * thickness - thickness)\/2])\n linear_extrude(height = thickness)\n union() {\n \n difference() {\n \/\/ draw root circle\n circle($fn = teeth*3, d = root_dia);\n \n \/\/ subtract shaft\n circle(d = shaft_dia);\n \n \/\/ draw major holes\n if (major_holes && r_mid_point >= 0.125) {\n if (debug_echo)\n echo(\"Draw major holes\");\n \n angle_inc = 360 \/ num_holes;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc])\n translate([r_mid_point, 0, 0])\n circle(d = 0.85 * r_mid_point);\n }\n }\n \n \/\/ draw minor hollows\n if (minor_holes && r_mid_point >= 0.25) {\n if (debug_echo) \n echo(\"Draw minor holes\");\n \n angle_inc = 360 \/ num_holes;\n\n inner_minor_dia = r_mid_point \/ 4;\n inner_minor_ctr = r_mid_point \/ 3;\n outer_minor_dia = r_mid_point \/ 2;\n outer_minor_ctr = r_mid_point * 1.2;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc + angle_inc \/ 2]) {\n \/\/ selectively draw inner minor holes\n if (inner_minor_ctr - inner_minor_dia \/ 2 > shaft_dia \/ 2 + 0.125)\n {\n translate([inner_minor_ctr, 0, 0])\n circle(d = inner_minor_dia);\n } \n \n \/\/ selectively draw outer minor holes\n translate([outer_minor_ctr, 0, 0])\n circle(d = outer_minor_dia);\n }\n }\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b42250e2cb22b76d56b96d87bfc2650d3fa2a498","subject":"typos","message":"typos\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"TubeCollector\/TubeCollector.scad","new_file":"TubeCollector\/TubeCollector.scad","new_contents":"\/\/TubeCollector\n\n\/\/Parameters\n$fn=50;\ninnerDiameter = 40;\nouterDiameter = 45;\nhoseDiameter = 10;\ntubeLenght = 3000;\n\n\/\/Seal\nmodule bottomSeal() {\n difference() {\n circle(d=outerDiameter+5);\n circle(d=hoseDiameter);\n }\n}\nmodule topSeal() {\n difference() {\n circle(d=innerDiameter);\n circle(d=hoseDiameter);\n }\n}\nmodule assemblySeal() {\n extrude()bottomSeal();\n translate([0,0,5])extrude()topSeal();\n}\n\/\/Sealed Pipe\nmodule sealedPipe() {\n rotate(a=[90,0,0])translate([0,0,-tubeLenght\/2]){\n extrude(h=tubeLenght)difference() {\n circle(d=outerDiameter);\n circle(d=innerDiameter);\n }\n translate([0,0,-5])assemblySeal();\n translate([0,0,tubeLenght+5])mirror([0,0,1])assemblySeal();\n }\n}\n\/\/Pipe Holder\nmodule pipeHolder() {\n difference() {\n square([60,250],center=true);\n for(i=[0:3])translate([0,i*(outerDiameter+10)-82.5]){\n hull(){\n circle(d=outerDiameter);\n translate([outerDiameter\/2+10,0])square([1,outerDiameter],center=true);\n }\n for(i=[0,1])mirror([0,i,0])translate([-outerDiameter\/2,(outerDiameter+5)\/2])square(5,center=true);\n }\n }\n}\n\/\/Assembly\nmodule assembly() {\n for(i=[0:3])translate([0,0,i*(outerDiameter+10)-82.5])sealedPipe();\n for(i=[-3:3])translate([0,i*(tubeLenght\/6-5),0])rotate([90,0,0])extrude()pipeHolder();\n}\nassembly();\n\n\/\/Helper Modules\nmodule extrude(h=5) {\n linear_extrude(height=h)children();\n}","old_contents":"\/\/TubeCollector\n\n\/\/Parameters\n$fn=50;\ninnerDiameter = 40;\nouterDiameter = 45;\nhoseDiameter = 10;\ntubeLenght = 3000;\n\n\/\/Seal\nmodule bottomSeal() {\n difference() {\n circle(d=outerDiameter+5);\n circle(d=hoseDiameter);\n }\n}\nmodule topSeal() {\n difference() {\n circle(d=innerDiameter);\n circle(d=hoseDiameter);\n }\n}\nmodule assemblySeal() {\n extrude()bottomSeal();\n translate([0,0,5])extrude()topSeal();\n}\n\/\/Sealed Pipe\nmodule sealedPipe() {\n rotate(a=[90,0,0])translate([0,0,-tubeLenght\/2]){\n extrude(h=tubeLenght)difference() {\n circle(d=outerDiameter);\n circle(d=innerDiameter);\n }\n translate([0,0,-5])assemblySeal();\n translate([0,0,tubeLenght+5])mirror([0,0,1])assemblySeal();\n }\n}\n\/\/Pipe Holder\nmodule pipeHolder() {\n difference() {\n square([60,250],center=true);\n for(i=[0:3])translate([0,i*(outerDiameter+10)-82.5]){\n hull(){\n circle(d=outerDiameter);\n translate([outerDiameter\/2+10,0])square([1,outerDiameter],center=true);\n }\n for(i=[0,1])mirror([0,i,0])translate([-outerDiameter\/2,(outerDiameter+5)\/2])square(5,center=true);\n }\n }\n}\nmodule assembly() {\n for(i=[0:3])translate([0,0,i*(outerDiameter+10)-82.5])sealedPipe();\n for(i=[-3:3])translate([0,i*(tubeLenght\/6-5),0])rotate([90,0,0])extrude()pipeHolder();\n}\nassembly();\n\/\/Heleper Modules\nmodule extrude(h=5) {\n linear_extrude(height=h)children();\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ff4375b200052ae5b009e65388a195f0094c288c","subject":"Added Module for Screen Driver","message":"Added Module for Screen Driver\n","repos":"holtsoftware\/House,holtsoftware\/House,holtsoftware\/House,holtsoftware\/House","old_file":"OpenSCAD\/Thermastat\/ScreenDriverHolder.scad","new_file":"OpenSCAD\/Thermastat\/ScreenDriverHolder.scad","new_contents":"$fn=1000;\n\nmodule driverPole()\n{\n cylinder(d=5.25,h=12);\n}\n\nmodule driverHole()\n{\n cylinder(d=2.4,h=12);\n}\n\ndifference()\n{\n union()\n {\n cube([65.05,56.31,3]);\n translate([3.25,3.25,0]) driverPole();\n translate([61.8,3.25,0]) driverPole();\n translate([3.25,53.06,0]) driverPole();\n translate([61.8,53.06,0]) driverPole();\n }\n translate([3.25,3.25,0]) driverHole();\n translate([61.8,3.25,0]) driverHole();\n translate([3.25,53.06,0]) driverHole();\n translate([61.8,53.06,0]) driverHole();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/Thermastat\/ScreenDriverHolder.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0ef182a6b241839e91b97eeaf56263c541fc5bd3","subject":"updated Bowden parameters","message":"updated Bowden parameters\n","repos":"phidiasllc\/athena","old_file":"scad\/athena.scad","new_file":"scad\/athena.scad","new_contents":"\/************************************************************************************\n\nathena.scad - structural and tool objects required to build an Athena delta platform\nCopyright 2015 Jerry Anzalone\nAuthor: Jerry Anzalone \n\nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program. If not, see .\n\n************************************************************************************\/\n\n\/\/ requires the common delta modules\ninclude \n\necho_dims = false; \/\/ set to true to echo pertinent dimensions - will repeat some\n\n\/************ layer_height is important - set it to the intended print layer height ************\/\nlayer_height = 0.33; \/\/ layer height that the print will be produced with\n\n\/\/ [w, l, t] = [y, x, z]\n$fn = 48;\npi = 3.1415926535897932384626433832795;\n\n\/\/ bar clamp dims\nt_bar_clamp = 8;\nh_bar_clamp = 10;\n\n\/\/ the following sets the spacing of the linking board mounts on motor\/idler ends\ncc_idler_mounts = 120; \/\/ c-c of mounts on idler end - large to maximize x-y translation when in fixed tool mode and minimizes material use for bases\ncc_motor_mounts = 75; \/\/ c-c of mounts on idler end\n\n\/\/ printer dims\nr_printer = 175; \/\/ radius of the printer - typically 175\nl_tie_rod = 250; \/\/ length of the tie rods - typically 250\nl_guide_rods = 595; \/\/ length of the guide rods - only used for assembly\n\n\/\/ belt, pulley and idler dims\nidler = bearing_608;\nw_belt = 6; \/\/ width of the belt (not used)\npulley_cogs = 16; \/\/ number of cogs on the pulley\nbelt = GT2; \/\/ the type of drive belt to be used\nh_idler_washer = h_M8_washer; \/\/ idler bearing shaft washer\nd_idler_shaft_head = d_M8_nut; \/\/ idler bearing shaft head diameter\nh_idler_shaft_head = h_M8_nut; \/\/ idler bearing shaft head height - sets nut pocket depth\n\n\/\/ the diameter of the pulley isn't the whole story - the belt rides on the pulley at it's root radius\n\/\/ but on the idler bearing, it rides on the tips of the cogs, pushing its pitch radius outwards\nod_idler = idler[0]; \/\/ idler OD\nid_idler = idler[1]; \/\/ idler id\nh_idler = h_608; \/\/ thickness of idler\nn_idlers = 2; \/\/ number of idler bearings\nd_pulley = pulley_cogs * belt[0] \/ pi - (belt[1] - belt[2]); \/\/ diameter of the pulley (used to center idler)\noffset_idler = (od_idler - d_pulley) \/ 2 + belt[2]; \/\/ amount to offset idler bearing so belt stays parallel with guide rods\n\n\/\/ guide rod and clamp dims\ncc_guides = 60; \/\/ center-to-center of the guide rods\nd_guides = 8.3;\/\/8.5; \/\/ diameter of the guide rods\npad_clamp = 8; \/\/ additional material around guide rods\ngap_clamp = 2; \/\/ opening for clamp\n\n\/\/ following for tabs on either side of clamp to which linking boards are attached\n\/\/ the radius of the delta measured from the center of the guide rods to the center of the triangle\n\/\/ as drawn here, the tangent is parallel to the x-axis and the guide rod centers lie on y=0\n\/\/cc_mount = 75; \/\/ center to center distance of linking board mount pivot points standard = 75\nh_apex = 1.5 * 25.4; \/\/ height of the portion of motor and idler ends mating with linking board\nw_mount = 12; \/\/ thickness of the tabs the boards making up the triangle sides will attach to\nl_mount = 40; \/\/ length of said tabs\ncc_mount_holes = 16;\nl_base_mount = l_mount;\nw_base_mount = 14.1;\nt_base_mount = 9.0;\nr_base_mount = 3;\nl_mount_slot = 2; \/\/ length of the slot for mounting screw holes\n\ncc_v_board_mounts = 2 * (cc_guides \/ 2 - pad_clamp + d_M3_screw \/ 2); \/\/ c-c mounts for vertical boards\n\nl_idler_relief = cc_guides - d_guides - pad_clamp - 1.5; \/\/ with guide rod clamp design, the length needs to be smaller so there are walls for bridging\nw_idler_relief = n_idlers * h_idler + 2 * h_idler_washer;\nr_idler_relief = 2; \/\/ radius of the relief inside the apex\nl_clamp = cc_guides + d_guides + pad_clamp;\nw_clamp = w_idler_relief + pad_clamp + 8;\nh_clamp = l_NEMA17;\n\n\/\/ magnetic ball joint dims\nd_ball_bearing = 3 * 25.4 \/ 8;\nid_magnet = 15 * 25.4 \/ 64;\nod_magnet = 3 * 25.4 \/ 8;\nh_magnet = 25.4 \/ 8;\nr_bearing_seated = pow(pow(d_ball_bearing \/ 2, 2) - pow(id_magnet \/ 2, 2), 0.5); \/\/ depth ball bearing sinks into magnet id\nh_carriage_magnet_mount = 9;\nh_effector_magnet_mount = 10;\nr_pad_carriage_magnet_mount = 2;\nr_pad_effector_magnet_mount = 2;\n\n\/\/ effector dims\nl_effector = 60; \/\/ this needs to be played with to keep the fan from hitting the tie rods\nh_effector = equilateral_height_from_base(l_effector);\nr_effector = l_effector * tan(30) \/ 2 + 11;\nt_effector = 6;\nh_triangle_inner = h_effector + 12;\nr_triangle_middle = equilateral_base_from_height(h_triangle_inner) * tan(30) \/ 2;\n\n\/\/ for the small tool end effector:\nd_small_effector_tool_mount = 30; \/\/ diameter of the opening in the end effector that the tool will pass through\nd_small_effector_tool_magnet_mount = 1 + d_small_effector_tool_mount + od_magnet + 2 * r_pad_effector_magnet_mount; \/\/ ring diameter of the effector tool magnet mounts\n\n\/\/ for the large tool end effector:\nd_large_effector_tool_mount = 50;\nd_large_effector_tool_magnet_mount = h_triangle_inner;\n\n\/\/ Bowden sheath dims\nd_175_sheath = 4.8;\n175_bowden = [d_M4_nut, h_M4_nut, d_175_sheath];\nd_300_sheath = 6.55;\n300_bowden = [d_M6_nut, h_M6_nut, d_300_sheath];\n\nbowden = 175_bowden; \/\/ set to the diameter of the Bowden sheath desired, defined above\n\n\/\/ Bowden sheath quick release fitting dims\nd_quickrelease_threads = 6.4; \/\/ M6 threads, but this gives best fit\nl_quickrelease_threads = 5; \/\/ length of threads on quick release\npitch_quickrelease_threads = 1;\nd_quickrelease = 12; \/\/ diamter of the hex portion for counter-sinking quick release into hot end tool\ncountersink_quickrelease = 6; \/\/ depth to contersink quick release fitting into hot end tool\n\n\/\/ hot end dims\npad_jhead = 8; \/\/ this is added to the diameter of the cage to permit clearance for the hotend\npad_e3d = 14;\nt_hotend_cage = t_heat_x_jhead - h_groove_jhead - h_groove_offset_jhead;\nd_hotend_side = d_large_jhead + pad_jhead;\nz_offset_retainer = t_hotend_cage - t_effector \/ 2 - 3; \/\/ need an additional 3mm to clear the interior of the cage\na_fan_mount = 15;\nl_fan = 39.5;\nr_flare = 6;\nh_retainer_body = h_groove_jhead + h_groove_offset_jhead + 4;\nr1_retainer_body = d_hotend_side \/ 2 + r_flare * 3 \/ t_hotend_cage;\nr2_retainer_body = r1_retainer_body - r_flare * h_retainer_body \/ t_hotend_cage;\nr2_opening = (d_hotend_side - 5 ) \/ 2 + r_flare * (t_hotend_cage - 6 - t_effector + 3.0) \/ (t_hotend_cage - 6);\/\/r1_opening - r_flare * (t_effector + 1.5) \/ t_hotend_cage;\nr1_opening = r2_opening - 1.5;\nd_retainer_screw = d_M2_screw;\n\n\/\/ carriage dims:\nw_carriage_web = 4;\nh_carriage = l_lm8uu + 4;\ncarriage_offset = 18.6; \/\/ distance from center of guide rods to center of ball mount pivot\ny_web = - od_lm8uu \/ 2 - (3 - w_carriage_web \/ 2);\nstage_mount_pad = 2.2;\n\n\/\/ limit switch dims\nl_limit_switch = 24;\nw_limit_switch = 6;\nt_limit_switch = 14;\ncc_limit_mounts = 9.5;\nlimit_x_offset = 11; \/\/ 11 places limit switch at guide rod, otherwise center at cc_guides \/ 2 - 8\nlimit_y_offset = d_M3_screw - carriage_offset;\n\n\/\/ center-to-center of tie rod pivots\ntie_rod_angle = acos((r_printer - r_effector - carriage_offset) \/ l_tie_rod);\n\n\/\/ tool mount member dims\nw_member = 25.4; \/\/ narrow dimension of member\nl_member = 3 * 25.4; \/\/ wide dimension of member\n\n\/\/ aluminum member dims\nl_vertical_board = 3 * 25.4; \/\/ long dimension of rectangular tube making vertical board\nw_vertical_board = 25.4; \/\/ short dimention of rectangular tube making vertical board\nl_linking_board = 38.6;\nw_linking_board = 3 * 25.4 \/ 4;\n\n\/\/ BBB dims; origin at corner w\/ power jack, starting from hole nearest power jack, going counter clockwise\nbbb_hole0 = [14.61, 3.18];\nbbb_hole1 = [14.61 + 66.5, 6.35];\nbbb_hole2 = [14.61 + 66.5, 6.35 + 42.6];\nbbb_hole3 = [14.61, 3.18 + 48.39];\nbbb_holes = [bbb_hole0, bbb_hole1, bbb_hole2, bbb_hole3];\n\nif (echo_dims) {\n\techo(str(\"Printer radius = \", r_printer));\n\techo(str(\"Effector offset = \", r_effector, \"mm\"));\n\techo(str(\"Carriage offset = \", carriage_offset, \"mm\"));\n\techo(str(\"Printer effective radius = \", r_printer - r_effector - carriage_offset));\n\techo(str(\"Radius of base plate = \", ceil(r_printer - d_guides \/ 2 - 1), \"mm\"));\n\techo(str(\"Tie rod angle at (0, 0, 0) = \", tie_rod_angle));\n\techo(str(\"Effector tie rod c-c = \", l_effector, \" mm\"));\n\techo(str(\"Vertical board mount c-c = \", cc_v_board_mounts));\n\techo(str(\"Vertical board offset = \", 8 - h_clamp \/ 2 + 3));\n\techo(str(\"offset_idler = \", offset_idler));\n}\n\n\/\/ athena_end_idler is the structural component to which idler bearings and guide rods are attached\nmodule athena_end_idler(z_offset_guides = 8) {\n\tid_wire_retainer = 10; \/\/ the id of the hull forming the wire retainer\n\tunion() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tround_box(\n\t\t\t\t\tl_clamp,\n\t\t\t\t\tw_clamp,\n\t\t\t\t\th_clamp\n\t\t\t\t);\n\n\t\t\t\ttranslate([0, 0, (h_apex - h_clamp) \/ 2])\n\t\t\t\t\tapex(\n\t\t\t\t\t\tl_slot = l_mount_slot,\n\t\t\t\t\t\theight = h_apex,\n\t\t\t\t\t\tcc_mount = cc_idler_mounts,\n\t\t\t\t\t\tbase_mount = false,\n\t\t\t\t\t\techo = echo_dims\n\t\t\t\t\t);\n\n\t\t\t\t\/\/ mount points for the top ring must be at least 8mm thick to accomodate 3\/4\" screws and 1\/2\" plywood\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * (l_clamp \/ 2 + 5), w_clamp \/ 2 - 7, -h_clamp \/ 2 + 4.5]) {\n\t\t\t\t\t\tround_box(27, 14, 9);\n\n\t\t\t\t\t\t\/\/ a wire retainer\n\t\t\t\t\t\ttranslate([i * -6, 11 \/ 2, 9 \/ 2])\n\t\t\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\t\t\t\t\ttranslate([j * 3, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\t\tcylinder(r = id_wire_retainer \/ 2 + 3, h = 3, center = true);\n\n\t\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\t\t\t\t\ttranslate([j * 3, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\t\tcylinder(r = id_wire_retainer \/ 2, h = 4, center = true);\n\n\t\t\t\t\t\t\t\t\ttranslate([0, -id_wire_retainer, 0])\n\t\t\t\t\t\t\t\t\t\tcube([id_wire_retainer * 3, id_wire_retainer * 2 - 1, 4], center = true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t\/\/ place the idler shaft such that the belt is parallel with the pulley - the belt connection will be on the right looking down the vertical axis\n\t\t\ttranslate([-offset_idler, 0, 0]) \/\/ update 09212014\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tunion() {\n\t\t\t\t\t\tcylinder(r = id_idler \/ 2, h = w_clamp + 2, center = true);\n\n\t\t\t\t\t\ttranslate([0, 0, -w_clamp \/ 2])\n\t\t\t\t\t\t\tcylinder(r = d_idler_shaft_head \/ 2, h = 2 * h_idler_shaft_head, center = true, $fn = 6);\n\t\t\t\t\t}\n\n\t\t\t\/\/ idler will be two bearing thick plus two washers\n\t\t\tround_box(\n\t\t\t\tlength = l_idler_relief,\n\t\t\t\twidth = w_idler_relief,\n\t\t\t\theight = h_clamp + 2,\n\t\t\t\tradius = r_idler_relief\n\t\t\t);\n\n\t\t\t\/\/ limit switch mount\n\t\t\ttranslate([l_clamp \/ 2 - 28.5, -w_clamp \/ 2, h_clamp \/ 2 - 6]) {\n\t\t\t\tcube([l_limit_switch, w_limit_switch, t_limit_switch], center = true);\n\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * 9.5 \/ 2, 0, -8])\n\t\t\t\t\t\t\tcylinder(r = 0.85, h = 12, center = true);\n\t\t\t}\n\n\t\t\t\/\/ guide rod and clamp pockets\n\t\t\tbar_clamp_relief(z_offset_guides = z_offset_guides);\n\n\t\t\t\/\/ holes for mounting top ring\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * (l_clamp \/ 2 + 13), 12, -h_clamp \/ 2 + 5])\n\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = 11, center = true);\n\n\t\t\t\/\/ relief for vertical boards\n\t\t\ttranslate([0, 0, z_offset_guides - h_clamp \/ 2 + 3])\n\t\t\t\tvertical_board_relief();\n\n\t\t\t\/\/ holes to reduce plastic and wire passage\n\t\t\tfor (i = [-1,1])\n\t\t\t\ttranslate([i * (cc_idler_mounts \/ 2 - 12), 0, 0])\n\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\thull()\n\t\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\t\ttranslate([0, j * h_apex \/ 8, 0])\n\t\t\t\t\t\t\t\t\tcylinder(r = 4, h = 13, center = true);\n\n\t\t\t\/\/ wire passage\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * (cc_idler_mounts \/ 2 + 30), -w_clamp - 5, -h_clamp \/ 2 + 2.5])\n\t\t\t\t\trotate_extrude(convexity = 10)\n\t\t\t\t\t\ttranslate([42, 0, 0])\n\t\t\t\t\t\t\tcircle(r = 2);\n\t\t}\n\n\t\t\/\/ floor for guide rod pockets\n\t\tfor (i = [-1, 1])\n\t\t\ttranslate([i * cc_guides \/ 2, 0, h_bar_clamp \/ 2 + layer_height])\n\t\t\t\tcylinder(r = d_guides \/ 2 + 1, h = layer_height);\n\t}\n}\n\n\/\/ athena_end_motor is the structural component to which motors and guide rods are attached\nmodule athena_end_motor(z_offset_guides = 8) {\n\th_brace = 8; \/\/ height of cross brace triangle\n\tb_brace = equilateral_base_from_height(h_brace);\n\tr_wire_guide = 12.75;\n\th_wire_guide = 5;\n\tdifference() {\n\t\tunion() {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tround_box(\n\t\t\t\t\t\tl_clamp,\n\t\t\t\t\t\tw_clamp,\n\t\t\t\t\t\th_clamp\n\t\t\t\t\t);\n\n\t\t\t\t\ttranslate([0, 0, (h_apex - h_clamp) \/ 2])\n\t\t\t\t\t\tapex(\n\t\t\t\t\t\t\tl_slot = l_mount_slot,\n\t\t\t\t\t\t\theight = h_apex,\n\t\t\t\t\t\t\tcc_mount = cc_motor_mounts,\n\t\t\t\t\t\t\tbase_mount = true,\n\t\t\t\t\t\t\techo = echo_dims\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\/\/ wire guide\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * l_clamp \/ 2, w_clamp \/ 2 - r_wire_guide, (h_wire_guide - h_clamp) \/ 2])\n\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\tfor (j = [-i * 1, i * 0.4])\n\t\t\t\t\t\t\t\t\t\ttranslate([j * 4, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\tcylinder(r = r_wire_guide, h = h_wire_guide, center = true);\n\n\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\tfor (j = [-i * 1, i * 0.4])\n\t\t\t\t\t\t\t\t\t\ttranslate([j * 4, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\tcylinder(r = r_wire_guide - 3, h = h_wire_guide + 1, center = true);\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttranslate([0, 0, (l_NEMA17 - h_clamp) \/ 2])\n\t\t\t\t\tround_box(\n\t\t\t\t\t\tlength = l_idler_relief,\n\t\t\t\t\t\twidth = w_idler_relief,\n\t\t\t\t\t\theight = l_NEMA17 + 2,\n\t\t\t\t\t\tradius = r_idler_relief\n\t\t\t\t\t);\n\n\n\t\t\t\t\/\/ motor mount\n\t\t\t\ttranslate([0, 0, (l_NEMA17 - h_clamp) \/ 2])\n\t\t\t\t\trotate([90, 0, 0]) {\n\t\t\t\t\t\tNEMA_parallel_mount(\n\t\t\t\t\t\t\theight = w_clamp + 2,\n\t\t\t\t\t\t\tl_slot = 0,\n\t\t\t\t\t\t\tmotor = NEMA17);\n\n\t\t\t\t\t\/\/ tear drop motor opening to improve printing\n\t\t\t\t\thull() {\n\t\t\t\t\t\tcylinder(r = NEMA17[1] \/ 2, h = w_clamp + 2, center = true);\n\n\t\t\t\t\t\ttranslate([0, h_clamp \/ 2 - 8, 0])\n\t\t\t\t\t\t\tcylinder(r = 1, h = w_clamp + 2, center = true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\/\/ set screw access - access from bottom of printer\n\t\t\t\ttranslate([-2.5, -w_clamp \/ 2 - 1, d_NEMA17_collar \/ 2 + 0.5])\n\t\t\t\t\tcube([5, w_clamp \/ 2, (h_clamp - d_NEMA17_collar) \/ 2]);\n\n\t\t\t\t\/\/ guide rod and clamp pockets\n\t\t\t\tbar_clamp_relief(z_offset_guides = -z_offset_guides);\n\n\t\t\t\t\/\/ relief for vertical boards\n\t\t\t\ttranslate([0, 0, h_clamp \/ 2 - z_offset_guides - 3])\n\t\t\t\t\tvertical_board_relief();\n\n\t\t\t\t\/\/ wire passage\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * (cc_guides \/ 2 + 30), -w_clamp - 5, -h_clamp \/ 2 + 10])\n\t\t\t\t\t\trotate_extrude(convexity = 10)\n\t\t\t\t\t\t\ttranslate([40, 0, 0])\n\t\t\t\t\t\t\t\tscale([0.75, 1, 1])\n\t\t\t\t\t\t\t\t\tcircle(r = 5);\n\t\t\t}\n\n\t\t\t\/\/ cross bracing to minimize motor torquing into box\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * (b_brace + 5) \/ 2, 0, h_clamp \/ 2 - h_brace])\n\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\tlinear_extrude(height = w_clamp - 2, center = true)\n\t\t\t\t\t\t\tequilateral(h_brace);\n\n\t\t\t\/\/ floor for guide rod pockets\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_guides \/ 2, 0, h_bar_clamp \/ 2 + layer_height])\n\t\t\t\t\tcylinder(r = d_guides \/ 2 + 1, h = 0.3);\n\t\t}\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing are belt terminators used on the Athena platform\n**********\/\n\n\/\/ Athena uses GT2 belts, make belt terminators that fit properly:\nmodule athena_fixed_belt_terminator() {\n\tterminator(l_pass = 10, w_pass = 2.0, flag = false, mount = true, magnet = false); \/\/ narrowed the passage for a thinner GT2 belt\n}\n\nmodule athena_free_belt_terminator() {\n\tterminator(l_pass = 10, w_pass = 2.0, flag = false, mount = 0, magnet = false);\n}\n\nmodule athena_belt_terminators() {\n\tathena_fixed_belt_terminator();\n\n\ttranslate([11, 0, 0])\n\t\tathena_free_belt_terminator();\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing are carriages for the Athena\n\t\t\t\t\t\t\tone is simple and does not permit fixed tool mode operation\n\t\t\t\t\t\t\tthe other is convertible, permitting use in both mobile and fixed tool modes\n**********\/\n\n\/\/ athena_basic_carriage does not have magnet mounts required for fixed tool mode\nmodule athena_basic_carriage() {\n\tunion() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tcarriage_body();\n\n\t\t\t\t\/\/ magnet mounts\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * l_effector \/ 2, -carriage_offset, -4])\n\t\t\t\t\t\trotate([90 - tie_rod_angle, 0, 0])\n\t\t\t\t\t\t\tmagnet_mount(r_pad = r_pad_carriage_magnet_mount, h_pad = h_carriage_magnet_mount);\n\t\t\t}\n\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_guides \/ 2, 0, 0])\n\t\t\t\t\tcarriage_wire_tie_relief();\n\n\t\t\tcarriage_bearing_relief();\n\n\t\t\t\/\/ belt terminator mount\n\t\t\ttranslate([d_pulley \/ 2, y_web, h_carriage \/ 2 - d_M3_screw \/ 2 - 5])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = w_carriage_web + 2, center = true);\n\n\t\t\t\/\/ flatten the bottom\n\t\t\ttranslate([0, 0, -h_carriage])\n\t\t\t\tcube([2 * cc_guides, 4 * (od_lm8uu + 6), h_carriage], center = true);\n\t\t}\n\n\t\/\/ floor for rod opening\n\tfor (i = [-1, 1])\n\t\ttranslate([i * cc_guides \/ 2, -0.35, (l_lm8uu + layer_height) \/ 2])\n\t\t\tcube([od_lm8uu, id_lm8uu, layer_height], center = true);\n\t}\n}\n\n\/\/ athena_convertible_carriage is required if the platform will be used in fixed tool mode\nmodule athena_convertible_carriage() {\n\tunion() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tcarriage_body();\n\n\t\t\t\t\/\/ magnet mounts\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * l_effector \/ 2, -carriage_offset, stage_mount_pad + h_carriage_magnet_mount \/ sin(tie_rod_angle)])\n\t\t\t\t\t\trotate([90 - tie_rod_angle, 0, 0])\n\t\t\t\t\t\t\tmagnet_mount(r_pad = r_pad_carriage_magnet_mount, h_pad = h_carriage_magnet_mount);\n\n\t\t\t\tmirror([0, 0, 1])\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * l_effector \/ 2, -carriage_offset, stage_mount_pad + h_carriage_magnet_mount \/ sin(tie_rod_angle)])\n\t\t\t\t\t\t\trotate([90 - tie_rod_angle, 0, 0]) {\n\t\t\t\t\t\t\t\tmagnet_mount(r_pad = r_pad_carriage_magnet_mount, h_pad = h_carriage_magnet_mount);\n\n\t\t\t\t\t\t\t\t\/\/ support for printing the mounts\n\t\t\t\t\t\t\t\ttranslate([0, 0, (h_magnet + h_carriage_magnet_mount) \/ 2 - r_bearing_seated + 0.25])\n\t\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\t\tcylinder(r = od_magnet \/ 2 + r_pad_carriage_magnet_mount, h = h_magnet + h_carriage_magnet_mount, center = true);\n\n\t\t\t\t\t\t\t\t\t\tcylinder(r = od_magnet \/ 2, h = h_magnet + h_carriage_magnet_mount, center = true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\/\/ add a protrusion for making the vertical board-mounted directional limit switch\n\t\t\t\ttranslate([d_pulley \/ 2 + x_pass \/ 2 + 5, y_web - 7.5, 0]) \/\/ offset it from the belt terminator mount point\n\t\t\t\t\trotate([0, 90, 0])\n\t\t\t\t\t\tintersection() {\n\t\t\t\t\t\t\tcylinder(r = h_carriage \/ 2, h = 7, center = true);\n\n\t\t\t\t\t\t\ttranslate([0, h_carriage \/ 2 - y_web - 2, 0])\n\t\t\t\t\t\t\t\tcube([h_carriage, h_carriage, 11], center = true);\n\t\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_guides \/ 2, 0, 0])\n\t\t\t\t\tcarriage_wire_tie_relief();\n\n\t\t\tcarriage_bearing_relief();\n\n\t\t\t\/\/ belt terminator mount\n\t\t\ttranslate([d_pulley \/ 2, y_web, h_carriage \/ 2 - d_M3_screw \/ 2 - 5])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = w_carriage_web + 2, center = true);\n\n\t\t\t\/\/ flatten the bottom\n\t\t\ttranslate([0, 0, -h_carriage])\n\t\t\t\tcube([2 * cc_guides, 4 * (od_lm8uu + 6), h_carriage], center = true);\n\t\t}\n\n\t\/\/ floor for rod opening\n\tfor (i = [-1, 1])\n\t\ttranslate([i * cc_guides \/ 2, -0.35, (l_lm8uu + layer_height) \/ 2])\n\t\t\tcube([od_lm8uu, id_lm8uu, layer_height], center = true);\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing for the limit switch required for fixed tool mode operation\n\t\t\t\t\t\t\tit is not necessary if the platform does not have a fixed tool mount\n**********\/\n\n\/\/ central_limit_switch permits mounting a switch on the interior of vertical boards\nmodule central_limit_switch() {\n\tl_switch_mount = 20;\n\tw_switch_mount = 10;\n\th_switch_mount = 20;\n\n\tdifference() {\n\t\tcube([l_switch_mount, w_switch_mount, h_switch_mount], center = true);\n\n\t\ttranslate([-5, 3.5, 0])\n\t\t\tcube([l_switch_mount, w_switch_mount, h_switch_mount + 1], center = true);\n\n\t\t\/\/ limit switch mounts\n\t\ttranslate([l_switch_mount \/ 2, 2, 0])\n\t\t\trotate([0, 90, 0])\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * cc_limit_mounts \/ 2, 0, 0])\n\t\t\t\t\t\tcylinder(r = 0.8, h = 14, center = true);\n\n\t\tfor (i = [-1, 1])\n\t\t\ttranslate([-2.5, 0, i * 5])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\thull()\n\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\ttranslate([j * 2.5, 0, 0])\n\t\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 + 0.25, h = 13, center = true);\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing for mounting controller boards to the base of the platform\n\t\t\t\t\t\t\trender and print necessary holders\n**********\/\n\n\/\/ BBB_mount is for mounting a Beaglebone Black to the base of the platform\nmodule BBB_mount(\n\tbbb_standoff = 6,\n\tmount_offset = 14) {\n\t\/\/ standoff is the total height of the mount\n\t\/\/ offset is the location of the mounting holes for mounting to whatever, in the case of Athena, the underside of the base\n\tslope0_2 = (bbb_hole2[1] - bbb_hole0[1]) \/ (bbb_hole2[0] - bbb_hole0[0]);\n\n\tdifference() {\n\t\tunion() {\n\t\t\ttranslate([0, 0, -bbb_standoff \/ 2 + 1]) {\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [0, 2])\n\t\t\t\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 0])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 + 3, h = 2, center = true);\n\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [1, 3])\n\t\t\t\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 0])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 + 3, h = 2, center = true);\n\t\t\t}\n\n\t\t\tfor (i = [0:3])\n\t\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 0])\n\t\t\t\t\t\t\tcylinder(r1 = d_M3_screw \/ 2 + 3, r2 = d_M3_screw \/ 2 + 1, h = bbb_standoff, center = true);\n\t\t}\n\n\t\tfor (i = [0:3])\n\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 1])\n\t\t\t\tcylinder(r = d_M3_screw \/ 2 - 0.25, h = bbb_standoff, center = true);\n\n\t\ttranslate([bbb_hole0[0] + mount_offset, bbb_hole0[1] + mount_offset * slope0_2, 0])\n\t\t\tcylinder(r = d_M3_screw \/ 2, h = bbb_standoff + 1, center = true);\n\n\t\ttranslate([bbb_hole2[0] - mount_offset, bbb_hole2[1] - mount_offset * slope0_2, 0])\n\t\t\tcylinder(r = d_M3_screw \/ 2, h = bbb_standoff + 1, center = true);\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing are various holders for convenience, not necessary for construction of platform\n**********\/\n\n\/\/ athena_tool_holder is an object to be mounted on a vertical board for holding effector tools\nmodule athena_tool_holder(wood_mount = false) {\n\t\/\/ a tool holder for the side of the printer\n\tl_mount = 2 * d_small_effector_tool_magnet_mount * cos(60);\n\tw_mount = 16;\n\th_mount = 20;\n\n\tmirror([0, 0, (wood_mount) ? 0 : 1]) \/\/ want to flip it over if aluminum mounting\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tif (wood_mount)\n\t\t\t\t\t\/\/ fits over the vertical board and covers wires\n\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount * sin(60) \/ 2 + 6, (h_mount - t_effector) \/ 2])\n\t\t\t\t\t\t12mm_board_mount(\n\t\t\t\t\t\t\theight = h_mount,\n\t\t\t\t\t\t\tlength = l_mount,\n\t\t\t\t\t\t\twidth = w_mount\n\t\t\t\t\t\t\t);\n\t\t\t\telse\n\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount * sin(60) \/ 2, 0])\n\t\t\t\t\t\thull() {\n\t\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\t\ttranslate([i * 10, 10, 0])\n\t\t\t\t\t\t\t\t\tcylinder(r = d_M3_nut \/ 2, h = t_effector, center = true);\n\n\t\t\t\t\t\t\t\tcube([20 + d_M3_nut, 4, t_effector], center = true);\n\t\t\t\t\t\t}\n\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [0:2])\n\t\t\t\t\t\trotate([0, 0, i * 120 + 60])\n\t\t\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount \/ 2, 0])\n\t\t\t\t\t\t\t\tcylinder(r = od_magnet \/ 2 + r_pad_effector_magnet_mount, h = t_effector, center = true);\n\t\t\t}\n\n\t\t\tif (!wood_mount)\n\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount * sin(60) \/ 2, 0])\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * 10, 10, 0])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = t_effector + 1, center = true);\n\n\t\t\tcylinder(r = d_small_effector_tool_mount \/ 2, h = h_effector + 1, center = true);\n\n\t\t\tfor (i = [0:2])\n\t\t\t\trotate([0, 0, i * 120 + 60])\n\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount \/ 2, -t_effector \/ 2])\n\t\t\t\t\t\tcylinder(r1 = od_magnet \/ 2, r2 = od_magnet \/ 2 + 0.5, h = h_magnet + 2, center = true);\n\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * l_mount \/ 4, d_small_effector_tool_magnet_mount * sin(60) \/ 2, h_mount - 8])\n\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = 5, center = true);\n\t\t}\n}\n\nmodule athena_spool_holder(\n\trender_mount = false,\n\trender_holder = false,\n\tmount_wood = false) {\n\t\/\/ spool holder to mount to vertical board\n\tl_mount = 28;\n\tw_mount = 24;\n\th_mount = (mount_wood) ? 25 : 8;\n\tl_holder = 110;\n\tw_holder = 20;\n\th_holder = 12;\n\td_pivot = 14;\n\th_pivot = 6;\n\td_retainer = 2.75;\n\n\tif (render_mount)\n\t\ttranslate([0, 0, h_mount \/ 2])\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tif (mount_wood)\n\t\t\t\t\t\tmirror([0, 0, 1])\n\t\t\t\t\t\t\t12mm_board_mount(\n\t\t\t\t\t\t\t\theight = h_mount,\n\t\t\t\t\t\t\t\tlength = l_mount,\n\t\t\t\t\t\t\t\twidth = w_mount,\n\t\t\t\t\t\t\t\td_wire_guide = 12.2,\n\t\t\t\t\t\t\t\twire_guide_offset = 5);\n\t\t\t\t\telse\n\t\t\t\t\t\tcube([l_mount, w_mount, h_mount], center = true);\n\n\t\t\t\t\ttranslate([-1, 3, (h_pivot + h_mount) \/ 2 + 0.5])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tcylinder(r = d_pivot \/ 2, h = h_pivot + 1, center = true);\n\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 - 0.2, h = h_pivot + 12, center = true);\n\/\/\t\t\t\t\t\t\trotate_extrude(convexity = 10)\n\/\/\t\t\t\t\t\t\t\ttranslate([d_pivot \/ 2, 0, 0])\n\/\/\t\t\t\t\t\t\t\t\tcircle(r = d_retainer \/ 2);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttranslate([-1, 3, h_mount \/ 2 - 5])\n\t\t\t\t\tintersection() {\n\t\t\t\t\t\trotate_extrude(convexity = 10)\n\t\t\t\t\t\t\ttranslate([9, 0, 0])\n\t\t\t\t\t\t\t\tsquare([7, 6]);\n\n\t\t\t\t\t\trotate([0, 0, 20])\n\t\t\t\t\t\t\ttranslate([-l_mount \/ 2, w_mount \/ 2, 5])\n\t\t\t\t\t\t\t\tcube([35, 17, 10], center = true);\n\t\t\t\t\t}\n\n\t\t\t\tif (mount_wood)\n\t\t\t\t\ttranslate([0, w_mount \/ 2, -h_mount \/ 2 + 5])\n\t\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\t\ttranslate([0, 0, 2])\n\t\t\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\t\t\ttranslate([i * 8, 0, 0])\n\t\t\t\t\t\t\t\t\t\tcylinder(r = 2, h = 10, center = true);\n\/\/\t\t\t\telse {\n\/\/\t\t\t\t\ttranslate([-0.5, 0, h_mount \/ 2 ]) {\n\/\/\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = h_mount + h_pivot + 3, center = true);\n\n\/\/\t\t\t\t\t\ttranslate([0, 0, h_pivot])\n\/\/\t\t\t\t\t\t\tcylinder(r = d_M3_cap \/ 2, h = h_M3_cap + 1, center = true);\n\/\/\t\t\t\t\t}\n\/\/\t\t\t\t}\n\t\t\t}\n\n\tif (render_holder)\n\t\ttranslate([0, (render_mount) ? (w_mount + h_holder) \/ 2 + 2 : 0, 0]) {\n\t\t\ttranslate([0, 0, w_holder \/ 2])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tunion() {\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\t\t\ttranslate([i * (l_holder - w_holder) \/ 2, 0, 0])\n\t\t\t\t\t\t\t\t\t\tcylinder(r = w_holder \/ 2 \/ cos(30), h = h_holder, center = true, $fn = 6);\n\n\t\t\t\t\t\t\ttranslate([(l_holder - w_holder) \/ 2, 0, (h_holder - h_pivot ) \/ 2]) {\n\t\t\t\t\t\t\t\tcylinder(r = d_pivot \/ 2 + 0.25, h = h_pivot + 1, center = true);\n\n\t\t\t\t\t\t\t\ttranslate([0, 0, -h_holder + 3])\n\t\t\t\t\t\t\t\t\tcylinder(r1 = d_pivot \/ 2 + 3, r2 = d_pivot \/ 2 + 0.25, h = h_holder - h_pivot);\n\n\t\/\/\t\t\t\t\t\t\trotate_extrude(convexity = 10)\n\t\/\/\t\t\t\t\t\t\t\ttranslate([d_pivot \/ 2, 0, 0])\n\t\/\/\t\t\t\t\t\t\t\t\tcircle(r = d_retainer \/ 2);\n\n\t\/\/\t\t\t\t\t\t\ttranslate([-d_pivot \/ 2, 7, 0])\n\t\/\/\t\t\t\t\t\t\t\trotate([90, 0, 0])\n\t\/\/\t\t\t\t\t\t\t\t\tcylinder(r = d_retainer \/ 2, h = 12, center = true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttranslate([-10, 0, h_holder \/ 2 + 2.75])\n\t\t\t\t\t\t\t\trotate([0, -5, 0])\n\t\t\t\t\t\t\t\t\tcube([l_holder, w_holder + 1, h_holder], center = true);\n\n\t\t\t\t\t\t\ttranslate([-10, 14, 0])\n\t\t\t\t\t\t\t\trotate([0, 0, 7])\n\t\t\t\t\t\t\t\t\tcube([l_holder \/ 1.5, w_holder, h_holder + 1], center = true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttranslate([l_holder \/ 2 - 23, (4 - w_holder) \/ 2, 7])\n\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\tcube([10, 4, 10], center = true);\n\n\t\t\t\t\t\t\t\ttranslate([-10, 0, h_holder \/ 2 + 3])\n\t\t\t\t\t\t\t\t\trotate([0, -7, 0])\n\t\t\t\t\t\t\t\t\t\tcube([l_holder, w_holder + 1, h_holder], center = true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\ttranslate([0, 20, 0])\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\tcylinder(r1 = d_pivot \/ 2 + 0.25, r2 = d_pivot \/ 2 + 3, h = h_holder - h_pivot);\n\n\t\t\t\t\t\ttranslate([0, 0, -1])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = h_holder);\n\n\t\t\t\t\t\ttranslate([0, 0, h_holder - h_pivot - h_M3_cap])\n\t\t\t\t\t\t\tcylinder(r = d_M3_cap \/ 2, h = h_M3_cap + 1);\n\t\t\t\t\t}\n\t\t}\n}\n\n\/\/ athena_hand_tool_holder is an object to mount to a vertical board that wires can be tucked underneath and drivers can be hung on\n\/\/ sonicare model E toothbrush ends have nice magnets in them, good for holding scraper\nmodule athena_hand_tool_holder(\n\twood_mount = false,\n\tsonicare_magnet = false\n) {\n\tl_mount = 30;\n\tw_mount = 22;\n\th_mount = (sonicare_magnet) ? 50 : 30;\n\tdifference() {\n\t\tunion() {\n\t\t\tif (wood_mount)\n\t\t\t\ttranslate([5, 0, l_mount \/ 2])\n\t\t\t\t\trotate([0, 90, 0])\n\t\t\t\t\t\t12mm_board_mount(\n\t\t\t\t\t\t\theight = h_mount,\n\t\t\t\t\t\t\tlength = l_mount,\n\t\t\t\t\t\t\twidth = w_mount\n\t\t\t\t\t\t\t);\n\t\t\telse\n\t\t\t\ttranslate([0, 0, l_mount \/ 2])\n\t\t\t\t\thull()\n\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\ttranslate([i * l_mount \/ 2, 0, 0])\n\t\t\t\t\t\t\t\tcylinder(r = d_M3_nut \/ 2, h = h_mount, center = true);\n\n\t\t\ttranslate([30 - h_mount \/ 2, -13 - w_mount \/ 2, 2.5])\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * 30, 0, 0])\n\t\t\t\t\t\t\tcylinder(r = 15, h = 5, center = true);\n\t\t}\n\n\t\ttranslate([-h_mount \/ 2, -13 - w_mount \/ 2, 2.5])\n\t\t\tfor (i = [0:4])\n\t\t\t\ttranslate([i * 15, 0, 0])\n\t\t\t\t\tcylinder(r = 3, h = 6, center = true);\n\n\t\tfor (i = [0, 1])\n\t\ttranslate([14, -w_mount \/ 2, i * 15 + 10])\n\t\t\trotate([90, 0, 0]) {\n\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = 20, center = true);\n\n\t\t\t\tcylinder(r = 4, h = 5, center = true);\n\t\t\t}\n\n\t\t\/\/ magnet relief for sonicar magnets\n\t\tif (sonicare_magnet) {\n\t\t\ttranslate([1, 2.7 - w_mount \/ 2, h_mount \/ 3])\n\t\t\t\trotate([90, 0, 0]) {\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * (3.7 + 5.2) \/ 2, 0, 0])\n\t\t\t\t\t\t\tcube([5.2, 10.2, 6], center = true);\n\n\t\t\t\t\ttranslate([0, 0, -3 \/ 2])\n\t\t\t\t\t\tcube([19, 17, 2], center = true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule hotend_effector(\n\tquickrelease = true,\n\tdalekify = false\n) {\n\tdifference() {\n\t\tunion() {\n\t\t\thotend_mount(dalekify = dalekify, quickrelease = quickrelease);\n\n\t\t\teffector_base(large = false);\n\t\t}\n\n\t\tcylinder(r1 = r1_opening, r2 = r2_opening, h = 7, center = true);\n\t}\n}\n\nmodule glass_holddown() {\n\tdifference() {\n\t\thull()\n\t\t\tfor (i = [-1,1])\n\t\t\t\ttranslate([i * 1, 0, 0])\n\t\t\t\t\tcylinder(r = 6, h = 12, center = true);\n\n\t\ttranslate([4, 0, 0]) {\n\t\t\tcylinder(r = 2, h = 13, center = true);\n\t\t}\n\n\t\ttranslate([0, 0, -4])\n\t\t\tcube([20, 20, 8], center = true);\n\n\t\ttranslate([-152, 0, 0])\n\t\t\tcylinder(r = 152, h = 3, center = true);\n\t}\n}\n\nmodule template_fixed_tool_mount() {\n\tcc_arm_mounts = 50;\n\tv_offset_arm_mount = 20; \/\/ offset from the top of the printer vertical\n\ty_third_hole = pow(pow(cc_arm_mounts, 2) - pow(cc_arm_mounts \/ 2, 2), 0.5);\n\tl_al_spacer = 80; \/\/ length of the aluminum 1\" x 3\" spacer between the two verticals\n\toffset_arm_mount = l_al_spacer - v_offset_arm_mount - y_third_hole;\n\tarm_mount = true; \/\/ set to true to generate template for the second vertical (part that arm attaches to)\n\n\tdifference() {\n\t\ttranslate([0, (v_offset_arm_mount - cc_arm_mounts) \/ 2 + 3, 0])\n\t\t\tcube([l_member + 6, cc_arm_mounts + v_offset_arm_mount, 3], center = true);\n\n\t\ttranslate([0, (arm_mount) ? v_offset_arm_mount - offset_arm_mount : 0, 0]) {\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_arm_mounts \/ 2, (arm_mount) ? -y_third_hole : 0, 0])\n\t\t\t\t\tcylinder(r = 1.5, h = 5, center = true);\n\n\t\t\ttranslate([0, (arm_mount) ? 0 : -y_third_hole, 0])\n\t\t\t\tcylinder(r = 1.5, h = 5, center = true);\n\t\t}\n\n\t\ttranslate([0, (v_offset_arm_mount - cc_arm_mounts) \/ 2 - 5, 1])\n\t\t\tcube([l_member + 1, cc_arm_mounts + v_offset_arm_mount + 10, 3], center = true);\n\t}\n}\n\nmodule thumbscrew_quickrelease() {\n\thex = 10.2; \/\/ size of hex head, mm\n\tr_hex = hex \/ 2 \/ cos(30); \/\/ radius of hex\n\tpoints = 6; \/\/ points in closed end thumbscrew\n\th_wrench = 7; \/\/ thickness of the thumbscrew, mm\n\n\tdifference() {\n\t\tunion() {\n\t\t\tcylinder(r = r_hex + 5, h = h_wrench, center = true, $fn = 6);\n\n\t\t\tfor (i = [0:5])\n\t\t\t\trotate([0, 0, i * 360 \/ 6])\n\t\t\t\t\ttranslate([r_hex + 3.5, 0, 0])\n\t\t\t\t\t\tcylinder(r = 2.5, h = h_wrench, center = true, $fn = 16);\n\t\t}\n\n\t\tcylinder(r = r_hex, h = h_wrench + 1, center = true, $fn = points);\n\t}\n}\n","old_contents":"\/************************************************************************************\n\nathena.scad - structural and tool objects required to build an Athena delta platform\nCopyright 2015 Jerry Anzalone\nAuthor: Jerry Anzalone \n\nThis program is free software: you can redistribute it and\/or modify\nit under the terms of the GNU Affero General Public License as\npublished by the Free Software Foundation, either version 3 of the\nLicense, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program. If not, see .\n\n************************************************************************************\/\n\n\/\/ requires the common delta modules\ninclude \n\necho_dims = false; \/\/ set to true to echo pertinent dimensions - will repeat some\n\n\/************ layer_height is important - set it to the intended print layer height ************\/\nlayer_height = 0.33; \/\/ layer height that the print will be produced with\n\n\/\/ [w, l, t] = [y, x, z]\n$fn = 48;\npi = 3.1415926535897932384626433832795;\n\n\/\/ bar clamp dims\nt_bar_clamp = 8;\nh_bar_clamp = 10;\n\n\/\/ the following sets the spacing of the linking board mounts on motor\/idler ends\ncc_idler_mounts = 120; \/\/ c-c of mounts on idler end - large to maximize x-y translation when in fixed tool mode and minimizes material use for bases\ncc_motor_mounts = 75; \/\/ c-c of mounts on idler end\n\n\/\/ printer dims\nr_printer = 175; \/\/ radius of the printer - typically 175\nl_tie_rod = 250; \/\/ length of the tie rods - typically 250\nl_guide_rods = 595; \/\/ length of the guide rods - only used for assembly\n\n\/\/ belt, pulley and idler dims\nidler = bearing_608;\nw_belt = 6; \/\/ width of the belt (not used)\npulley_cogs = 16; \/\/ number of cogs on the pulley\nbelt = GT2; \/\/ the type of drive belt to be used\nh_idler_washer = h_M8_washer; \/\/ idler bearing shaft washer\nd_idler_shaft_head = d_M8_nut; \/\/ idler bearing shaft head diameter\nh_idler_shaft_head = h_M8_nut; \/\/ idler bearing shaft head height - sets nut pocket depth\n\n\/\/ the diameter of the pulley isn't the whole story - the belt rides on the pulley at it's root radius\n\/\/ but on the idler bearing, it rides on the tips of the cogs, pushing its pitch radius outwards\nod_idler = idler[0]; \/\/ idler OD\nid_idler = idler[1]; \/\/ idler id\nh_idler = h_608; \/\/ thickness of idler\nn_idlers = 2; \/\/ number of idler bearings\nd_pulley = pulley_cogs * belt[0] \/ pi - (belt[1] - belt[2]); \/\/ diameter of the pulley (used to center idler)\noffset_idler = (od_idler - d_pulley) \/ 2 + belt[2]; \/\/ amount to offset idler bearing so belt stays parallel with guide rods\n\n\/\/ guide rod and clamp dims\ncc_guides = 60; \/\/ center-to-center of the guide rods\nd_guides = 8.3;\/\/8.5; \/\/ diameter of the guide rods\npad_clamp = 8; \/\/ additional material around guide rods\ngap_clamp = 2; \/\/ opening for clamp\n\n\/\/ following for tabs on either side of clamp to which linking boards are attached\n\/\/ the radius of the delta measured from the center of the guide rods to the center of the triangle\n\/\/ as drawn here, the tangent is parallel to the x-axis and the guide rod centers lie on y=0\n\/\/cc_mount = 75; \/\/ center to center distance of linking board mount pivot points standard = 75\nh_apex = 1.5 * 25.4; \/\/ height of the portion of motor and idler ends mating with linking board\nw_mount = 12; \/\/ thickness of the tabs the boards making up the triangle sides will attach to\nl_mount = 40; \/\/ length of said tabs\ncc_mount_holes = 16;\nl_base_mount = l_mount;\nw_base_mount = 14.1;\nt_base_mount = 9.0;\nr_base_mount = 3;\nl_mount_slot = 2; \/\/ length of the slot for mounting screw holes\n\ncc_v_board_mounts = 2 * (cc_guides \/ 2 - pad_clamp + d_M3_screw \/ 2); \/\/ c-c mounts for vertical boards\n\nl_idler_relief = cc_guides - d_guides - pad_clamp - 1.5; \/\/ with guide rod clamp design, the length needs to be smaller so there are walls for bridging\nw_idler_relief = n_idlers * h_idler + 2 * h_idler_washer;\nr_idler_relief = 2; \/\/ radius of the relief inside the apex\nl_clamp = cc_guides + d_guides + pad_clamp;\nw_clamp = w_idler_relief + pad_clamp + 8;\nh_clamp = l_NEMA17;\n\n\/\/ magnetic ball joint dims\nd_ball_bearing = 3 * 25.4 \/ 8;\nid_magnet = 15 * 25.4 \/ 64;\nod_magnet = 3 * 25.4 \/ 8;\nh_magnet = 25.4 \/ 8;\nr_bearing_seated = pow(pow(d_ball_bearing \/ 2, 2) - pow(id_magnet \/ 2, 2), 0.5); \/\/ depth ball bearing sinks into magnet id\nh_carriage_magnet_mount = 9;\nh_effector_magnet_mount = 10;\nr_pad_carriage_magnet_mount = 2;\nr_pad_effector_magnet_mount = 2;\n\n\/\/ effector dims\nl_effector = 60; \/\/ this needs to be played with to keep the fan from hitting the tie rods\nh_effector = equilateral_height_from_base(l_effector);\nr_effector = l_effector * tan(30) \/ 2 + 11;\nt_effector = 6;\nh_triangle_inner = h_effector + 12;\nr_triangle_middle = equilateral_base_from_height(h_triangle_inner) * tan(30) \/ 2;\n\n\/\/ for the small tool end effector:\nd_small_effector_tool_mount = 30; \/\/ diameter of the opening in the end effector that the tool will pass through\nd_small_effector_tool_magnet_mount = 1 + d_small_effector_tool_mount + od_magnet + 2 * r_pad_effector_magnet_mount; \/\/ ring diameter of the effector tool magnet mounts\n\n\/\/ for the large tool end effector:\nd_large_effector_tool_mount = 50;\nd_large_effector_tool_magnet_mount = h_triangle_inner;\n\n\/\/ Bowden sheath dims\nd_175_sheath = 4.8;\n175_bowden = [d_M4_nut, h_M4_nut, d_175_sheath];\n\n\/\/ Bowden sheath quick release fitting dims\nd_quickrelease_threads = 6.4; \/\/ M6 threads, but this gives best fit\nl_quickrelease_threads = 5; \/\/ length of threads on quick release\npitch_quickrelease_threads = 1;\nd_quickrelease = 12; \/\/ diamter of the hex portion for counter-sinking quick release into hot end tool\ncountersink_quickrelease = 6; \/\/ depth to contersink quick release fitting into hot end tool\n\n\/\/ hot end dims\npad_jhead = 8; \/\/ this is added to the diameter of the cage to permit clearance for the hotend\npad_e3d = 14;\nt_hotend_cage = t_heat_x_jhead - h_groove_jhead - h_groove_offset_jhead;\nd_hotend_side = d_large_jhead + pad_jhead;\nz_offset_retainer = t_hotend_cage - t_effector \/ 2 - 3; \/\/ need an additional 3mm to clear the interior of the cage\na_fan_mount = 15;\nl_fan = 39.5;\nr_flare = 6;\nh_retainer_body = h_groove_jhead + h_groove_offset_jhead + 4;\nr1_retainer_body = d_hotend_side \/ 2 + r_flare * 3 \/ t_hotend_cage;\nr2_retainer_body = r1_retainer_body - r_flare * h_retainer_body \/ t_hotend_cage;\nr2_opening = (d_hotend_side - 5 ) \/ 2 + r_flare * (t_hotend_cage - 6 - t_effector + 3.0) \/ (t_hotend_cage - 6);\/\/r1_opening - r_flare * (t_effector + 1.5) \/ t_hotend_cage;\nr1_opening = r2_opening - 1.5;\nd_retainer_screw = d_M2_screw;\n\n\/\/ carriage dims:\nw_carriage_web = 4;\nh_carriage = l_lm8uu + 4;\ncarriage_offset = 18.6; \/\/ distance from center of guide rods to center of ball mount pivot\ny_web = - od_lm8uu \/ 2 - (3 - w_carriage_web \/ 2);\nstage_mount_pad = 2.2;\n\n\/\/ limit switch dims\nl_limit_switch = 24;\nw_limit_switch = 6;\nt_limit_switch = 14;\ncc_limit_mounts = 9.5;\nlimit_x_offset = 11; \/\/ 11 places limit switch at guide rod, otherwise center at cc_guides \/ 2 - 8\nlimit_y_offset = d_M3_screw - carriage_offset;\n\n\/\/ center-to-center of tie rod pivots\ntie_rod_angle = acos((r_printer - r_effector - carriage_offset) \/ l_tie_rod);\n\n\/\/ tool mount member dims\nw_member = 25.4; \/\/ narrow dimension of member\nl_member = 3 * 25.4; \/\/ wide dimension of member\n\n\/\/ aluminum member dims\nl_vertical_board = 3 * 25.4; \/\/ long dimension of rectangular tube making vertical board\nw_vertical_board = 25.4; \/\/ short dimention of rectangular tube making vertical board\nl_linking_board = 38.6;\nw_linking_board = 3 * 25.4 \/ 4;\n\n\/\/ BBB dims; origin at corner w\/ power jack, starting from hole nearest power jack, going counter clockwise\nbbb_hole0 = [14.61, 3.18];\nbbb_hole1 = [14.61 + 66.5, 6.35];\nbbb_hole2 = [14.61 + 66.5, 6.35 + 42.6];\nbbb_hole3 = [14.61, 3.18 + 48.39];\nbbb_holes = [bbb_hole0, bbb_hole1, bbb_hole2, bbb_hole3];\n\nif (echo_dims) {\n\techo(str(\"Printer radius = \", r_printer));\n\techo(str(\"Effector offset = \", r_effector, \"mm\"));\n\techo(str(\"Carriage offset = \", carriage_offset, \"mm\"));\n\techo(str(\"Printer effective radius = \", r_printer - r_effector - carriage_offset));\n\techo(str(\"Radius of base plate = \", ceil(r_printer - d_guides \/ 2 - 1), \"mm\"));\n\techo(str(\"Tie rod angle at (0, 0, 0) = \", tie_rod_angle));\n\techo(str(\"Effector tie rod c-c = \", l_effector, \" mm\"));\n\techo(str(\"Vertical board mount c-c = \", cc_v_board_mounts));\n\techo(str(\"Vertical board offset = \", 8 - h_clamp \/ 2 + 3));\n\techo(str(\"offset_idler = \", offset_idler));\n}\n\n\/\/ athena_end_idler is the structural component to which idler bearings and guide rods are attached\nmodule athena_end_idler(z_offset_guides = 8) {\n\tid_wire_retainer = 10; \/\/ the id of the hull forming the wire retainer\n\tunion() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tround_box(\n\t\t\t\t\tl_clamp,\n\t\t\t\t\tw_clamp,\n\t\t\t\t\th_clamp\n\t\t\t\t);\n\n\t\t\t\ttranslate([0, 0, (h_apex - h_clamp) \/ 2])\n\t\t\t\t\tapex(\n\t\t\t\t\t\tl_slot = l_mount_slot,\n\t\t\t\t\t\theight = h_apex,\n\t\t\t\t\t\tcc_mount = cc_idler_mounts,\n\t\t\t\t\t\tbase_mount = false,\n\t\t\t\t\t\techo = echo_dims\n\t\t\t\t\t);\n\n\t\t\t\t\/\/ mount points for the top ring must be at least 8mm thick to accomodate 3\/4\" screws and 1\/2\" plywood\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * (l_clamp \/ 2 + 5), w_clamp \/ 2 - 7, -h_clamp \/ 2 + 4.5]) {\n\t\t\t\t\t\tround_box(27, 14, 9);\n\n\t\t\t\t\t\t\/\/ a wire retainer\n\t\t\t\t\t\ttranslate([i * -6, 11 \/ 2, 9 \/ 2])\n\t\t\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\t\t\t\t\ttranslate([j * 3, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\t\tcylinder(r = id_wire_retainer \/ 2 + 3, h = 3, center = true);\n\n\t\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\t\t\t\t\ttranslate([j * 3, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\t\tcylinder(r = id_wire_retainer \/ 2, h = 4, center = true);\n\n\t\t\t\t\t\t\t\t\ttranslate([0, -id_wire_retainer, 0])\n\t\t\t\t\t\t\t\t\t\tcube([id_wire_retainer * 3, id_wire_retainer * 2 - 1, 4], center = true);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\t\/\/ place the idler shaft such that the belt is parallel with the pulley - the belt connection will be on the right looking down the vertical axis\n\t\t\ttranslate([-offset_idler, 0, 0]) \/\/ update 09212014\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tunion() {\n\t\t\t\t\t\tcylinder(r = id_idler \/ 2, h = w_clamp + 2, center = true);\n\n\t\t\t\t\t\ttranslate([0, 0, -w_clamp \/ 2])\n\t\t\t\t\t\t\tcylinder(r = d_idler_shaft_head \/ 2, h = 2 * h_idler_shaft_head, center = true, $fn = 6);\n\t\t\t\t\t}\n\n\t\t\t\/\/ idler will be two bearing thick plus two washers\n\t\t\tround_box(\n\t\t\t\tlength = l_idler_relief,\n\t\t\t\twidth = w_idler_relief,\n\t\t\t\theight = h_clamp + 2,\n\t\t\t\tradius = r_idler_relief\n\t\t\t);\n\n\t\t\t\/\/ limit switch mount\n\t\t\ttranslate([l_clamp \/ 2 - 28.5, -w_clamp \/ 2, h_clamp \/ 2 - 6]) {\n\t\t\t\tcube([l_limit_switch, w_limit_switch, t_limit_switch], center = true);\n\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * 9.5 \/ 2, 0, -8])\n\t\t\t\t\t\t\tcylinder(r = 0.85, h = 12, center = true);\n\t\t\t}\n\n\t\t\t\/\/ guide rod and clamp pockets\n\t\t\tbar_clamp_relief(z_offset_guides = z_offset_guides);\n\n\t\t\t\/\/ holes for mounting top ring\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * (l_clamp \/ 2 + 13), 12, -h_clamp \/ 2 + 5])\n\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = 11, center = true);\n\n\t\t\t\/\/ relief for vertical boards\n\t\t\ttranslate([0, 0, z_offset_guides - h_clamp \/ 2 + 3])\n\t\t\t\tvertical_board_relief();\n\n\t\t\t\/\/ holes to reduce plastic and wire passage\n\t\t\tfor (i = [-1,1])\n\t\t\t\ttranslate([i * (cc_idler_mounts \/ 2 - 12), 0, 0])\n\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\thull()\n\t\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\t\ttranslate([0, j * h_apex \/ 8, 0])\n\t\t\t\t\t\t\t\t\tcylinder(r = 4, h = 13, center = true);\n\n\t\t\t\/\/ wire passage\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * (cc_idler_mounts \/ 2 + 30), -w_clamp - 5, -h_clamp \/ 2 + 2.5])\n\t\t\t\t\trotate_extrude(convexity = 10)\n\t\t\t\t\t\ttranslate([42, 0, 0])\n\t\t\t\t\t\t\tcircle(r = 2);\n\t\t}\n\n\t\t\/\/ floor for guide rod pockets\n\t\tfor (i = [-1, 1])\n\t\t\ttranslate([i * cc_guides \/ 2, 0, h_bar_clamp \/ 2 + layer_height])\n\t\t\t\tcylinder(r = d_guides \/ 2 + 1, h = layer_height);\n\t}\n}\n\n\/\/ athena_end_motor is the structural component to which motors and guide rods are attached\nmodule athena_end_motor(z_offset_guides = 8) {\n\th_brace = 8; \/\/ height of cross brace triangle\n\tb_brace = equilateral_base_from_height(h_brace);\n\tr_wire_guide = 12.75;\n\th_wire_guide = 5;\n\tdifference() {\n\t\tunion() {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tround_box(\n\t\t\t\t\t\tl_clamp,\n\t\t\t\t\t\tw_clamp,\n\t\t\t\t\t\th_clamp\n\t\t\t\t\t);\n\n\t\t\t\t\ttranslate([0, 0, (h_apex - h_clamp) \/ 2])\n\t\t\t\t\t\tapex(\n\t\t\t\t\t\t\tl_slot = l_mount_slot,\n\t\t\t\t\t\t\theight = h_apex,\n\t\t\t\t\t\t\tcc_mount = cc_motor_mounts,\n\t\t\t\t\t\t\tbase_mount = true,\n\t\t\t\t\t\t\techo = echo_dims\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\/\/ wire guide\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * l_clamp \/ 2, w_clamp \/ 2 - r_wire_guide, (h_wire_guide - h_clamp) \/ 2])\n\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\tfor (j = [-i * 1, i * 0.4])\n\t\t\t\t\t\t\t\t\t\ttranslate([j * 4, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\tcylinder(r = r_wire_guide, h = h_wire_guide, center = true);\n\n\t\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\t\tfor (j = [-i * 1, i * 0.4])\n\t\t\t\t\t\t\t\t\t\ttranslate([j * 4, 0, 0])\n\t\t\t\t\t\t\t\t\t\t\tcylinder(r = r_wire_guide - 3, h = h_wire_guide + 1, center = true);\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttranslate([0, 0, (l_NEMA17 - h_clamp) \/ 2])\n\t\t\t\t\tround_box(\n\t\t\t\t\t\tlength = l_idler_relief,\n\t\t\t\t\t\twidth = w_idler_relief,\n\t\t\t\t\t\theight = l_NEMA17 + 2,\n\t\t\t\t\t\tradius = r_idler_relief\n\t\t\t\t\t);\n\n\n\t\t\t\t\/\/ motor mount\n\t\t\t\ttranslate([0, 0, (l_NEMA17 - h_clamp) \/ 2])\n\t\t\t\t\trotate([90, 0, 0]) {\n\t\t\t\t\t\tNEMA_parallel_mount(\n\t\t\t\t\t\t\theight = w_clamp + 2,\n\t\t\t\t\t\t\tl_slot = 0,\n\t\t\t\t\t\t\tmotor = NEMA17);\n\n\t\t\t\t\t\/\/ tear drop motor opening to improve printing\n\t\t\t\t\thull() {\n\t\t\t\t\t\tcylinder(r = NEMA17[1] \/ 2, h = w_clamp + 2, center = true);\n\n\t\t\t\t\t\ttranslate([0, h_clamp \/ 2 - 8, 0])\n\t\t\t\t\t\t\tcylinder(r = 1, h = w_clamp + 2, center = true);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t\/\/ set screw access - access from bottom of printer\n\t\t\t\ttranslate([-2.5, -w_clamp \/ 2 - 1, d_NEMA17_collar \/ 2 + 0.5])\n\t\t\t\t\tcube([5, w_clamp \/ 2, (h_clamp - d_NEMA17_collar) \/ 2]);\n\n\t\t\t\t\/\/ guide rod and clamp pockets\n\t\t\t\tbar_clamp_relief(z_offset_guides = -z_offset_guides);\n\n\t\t\t\t\/\/ relief for vertical boards\n\t\t\t\ttranslate([0, 0, h_clamp \/ 2 - z_offset_guides - 3])\n\t\t\t\t\tvertical_board_relief();\n\n\t\t\t\t\/\/ wire passage\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * (cc_guides \/ 2 + 30), -w_clamp - 5, -h_clamp \/ 2 + 10])\n\t\t\t\t\t\trotate_extrude(convexity = 10)\n\t\t\t\t\t\t\ttranslate([40, 0, 0])\n\t\t\t\t\t\t\t\tscale([0.75, 1, 1])\n\t\t\t\t\t\t\t\t\tcircle(r = 5);\n\t\t\t}\n\n\t\t\t\/\/ cross bracing to minimize motor torquing into box\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * (b_brace + 5) \/ 2, 0, h_clamp \/ 2 - h_brace])\n\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\tlinear_extrude(height = w_clamp - 2, center = true)\n\t\t\t\t\t\t\tequilateral(h_brace);\n\n\t\t\t\/\/ floor for guide rod pockets\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_guides \/ 2, 0, h_bar_clamp \/ 2 + layer_height])\n\t\t\t\t\tcylinder(r = d_guides \/ 2 + 1, h = 0.3);\n\t\t}\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing are belt terminators used on the Athena platform\n**********\/\n\n\/\/ Athena uses GT2 belts, make belt terminators that fit properly:\nmodule athena_fixed_belt_terminator() {\n\tterminator(l_pass = 10, w_pass = 2.0, flag = false, mount = true, magnet = false); \/\/ narrowed the passage for a thinner GT2 belt\n}\n\nmodule athena_free_belt_terminator() {\n\tterminator(l_pass = 10, w_pass = 2.0, flag = false, mount = 0, magnet = false);\n}\n\nmodule athena_belt_terminators() {\n\tathena_fixed_belt_terminator();\n\n\ttranslate([11, 0, 0])\n\t\tathena_free_belt_terminator();\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing are carriages for the Athena\n\t\t\t\t\t\t\tone is simple and does not permit fixed tool mode operation\n\t\t\t\t\t\t\tthe other is convertible, permitting use in both mobile and fixed tool modes\n**********\/\n\n\/\/ athena_basic_carriage does not have magnet mounts required for fixed tool mode\nmodule athena_basic_carriage() {\n\tunion() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tcarriage_body();\n\n\t\t\t\t\/\/ magnet mounts\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * l_effector \/ 2, -carriage_offset, -4])\n\t\t\t\t\t\trotate([90 - tie_rod_angle, 0, 0])\n\t\t\t\t\t\t\tmagnet_mount(r_pad = r_pad_carriage_magnet_mount, h_pad = h_carriage_magnet_mount);\n\t\t\t}\n\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_guides \/ 2, 0, 0])\n\t\t\t\t\tcarriage_wire_tie_relief();\n\n\t\t\tcarriage_bearing_relief();\n\n\t\t\t\/\/ belt terminator mount\n\t\t\ttranslate([d_pulley \/ 2, y_web, h_carriage \/ 2 - d_M3_screw \/ 2 - 5])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = w_carriage_web + 2, center = true);\n\n\t\t\t\/\/ flatten the bottom\n\t\t\ttranslate([0, 0, -h_carriage])\n\t\t\t\tcube([2 * cc_guides, 4 * (od_lm8uu + 6), h_carriage], center = true);\n\t\t}\n\n\t\/\/ floor for rod opening\n\tfor (i = [-1, 1])\n\t\ttranslate([i * cc_guides \/ 2, -0.35, (l_lm8uu + layer_height) \/ 2])\n\t\t\tcube([od_lm8uu, id_lm8uu, layer_height], center = true);\n\t}\n}\n\n\/\/ athena_convertible_carriage is required if the platform will be used in fixed tool mode\nmodule athena_convertible_carriage() {\n\tunion() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tcarriage_body();\n\n\t\t\t\t\/\/ magnet mounts\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * l_effector \/ 2, -carriage_offset, stage_mount_pad + h_carriage_magnet_mount \/ sin(tie_rod_angle)])\n\t\t\t\t\t\trotate([90 - tie_rod_angle, 0, 0])\n\t\t\t\t\t\t\tmagnet_mount(r_pad = r_pad_carriage_magnet_mount, h_pad = h_carriage_magnet_mount);\n\n\t\t\t\tmirror([0, 0, 1])\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * l_effector \/ 2, -carriage_offset, stage_mount_pad + h_carriage_magnet_mount \/ sin(tie_rod_angle)])\n\t\t\t\t\t\t\trotate([90 - tie_rod_angle, 0, 0]) {\n\t\t\t\t\t\t\t\tmagnet_mount(r_pad = r_pad_carriage_magnet_mount, h_pad = h_carriage_magnet_mount);\n\n\t\t\t\t\t\t\t\t\/\/ support for printing the mounts\n\t\t\t\t\t\t\t\ttranslate([0, 0, (h_magnet + h_carriage_magnet_mount) \/ 2 - r_bearing_seated + 0.25])\n\t\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\t\tcylinder(r = od_magnet \/ 2 + r_pad_carriage_magnet_mount, h = h_magnet + h_carriage_magnet_mount, center = true);\n\n\t\t\t\t\t\t\t\t\t\tcylinder(r = od_magnet \/ 2, h = h_magnet + h_carriage_magnet_mount, center = true);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\/\/ add a protrusion for making the vertical board-mounted directional limit switch\n\t\t\t\ttranslate([d_pulley \/ 2 + x_pass \/ 2 + 5, y_web - 7.5, 0]) \/\/ offset it from the belt terminator mount point\n\t\t\t\t\trotate([0, 90, 0])\n\t\t\t\t\t\tintersection() {\n\t\t\t\t\t\t\tcylinder(r = h_carriage \/ 2, h = 7, center = true);\n\n\t\t\t\t\t\t\ttranslate([0, h_carriage \/ 2 - y_web - 2, 0])\n\t\t\t\t\t\t\t\tcube([h_carriage, h_carriage, 11], center = true);\n\t\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_guides \/ 2, 0, 0])\n\t\t\t\t\tcarriage_wire_tie_relief();\n\n\t\t\tcarriage_bearing_relief();\n\n\t\t\t\/\/ belt terminator mount\n\t\t\ttranslate([d_pulley \/ 2, y_web, h_carriage \/ 2 - d_M3_screw \/ 2 - 5])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = w_carriage_web + 2, center = true);\n\n\t\t\t\/\/ flatten the bottom\n\t\t\ttranslate([0, 0, -h_carriage])\n\t\t\t\tcube([2 * cc_guides, 4 * (od_lm8uu + 6), h_carriage], center = true);\n\t\t}\n\n\t\/\/ floor for rod opening\n\tfor (i = [-1, 1])\n\t\ttranslate([i * cc_guides \/ 2, -0.35, (l_lm8uu + layer_height) \/ 2])\n\t\t\tcube([od_lm8uu, id_lm8uu, layer_height], center = true);\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing for the limit switch required for fixed tool mode operation\n\t\t\t\t\t\t\tit is not necessary if the platform does not have a fixed tool mount\n**********\/\n\n\/\/ central_limit_switch permits mounting a switch on the interior of vertical boards\nmodule central_limit_switch() {\n\tl_switch_mount = 20;\n\tw_switch_mount = 10;\n\th_switch_mount = 20;\n\n\tdifference() {\n\t\tcube([l_switch_mount, w_switch_mount, h_switch_mount], center = true);\n\n\t\ttranslate([-5, 3.5, 0])\n\t\t\tcube([l_switch_mount, w_switch_mount, h_switch_mount + 1], center = true);\n\n\t\t\/\/ limit switch mounts\n\t\ttranslate([l_switch_mount \/ 2, 2, 0])\n\t\t\trotate([0, 90, 0])\n\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\ttranslate([i * cc_limit_mounts \/ 2, 0, 0])\n\t\t\t\t\t\tcylinder(r = 0.8, h = 14, center = true);\n\n\t\tfor (i = [-1, 1])\n\t\t\ttranslate([-2.5, 0, i * 5])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\thull()\n\t\t\t\t\t\tfor (j = [-1, 1])\n\t\t\t\t\t\t\ttranslate([j * 2.5, 0, 0])\n\t\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 + 0.25, h = 13, center = true);\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing for mounting controller boards to the base of the platform\n\t\t\t\t\t\t\trender and print necessary holders\n**********\/\n\n\/\/ BBB_mount is for mounting a Beaglebone Black to the base of the platform\nmodule BBB_mount(\n\tbbb_standoff = 6,\n\tmount_offset = 14) {\n\t\/\/ standoff is the total height of the mount\n\t\/\/ offset is the location of the mounting holes for mounting to whatever, in the case of Athena, the underside of the base\n\tslope0_2 = (bbb_hole2[1] - bbb_hole0[1]) \/ (bbb_hole2[0] - bbb_hole0[0]);\n\n\tdifference() {\n\t\tunion() {\n\t\t\ttranslate([0, 0, -bbb_standoff \/ 2 + 1]) {\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [0, 2])\n\t\t\t\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 0])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 + 3, h = 2, center = true);\n\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [1, 3])\n\t\t\t\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 0])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 + 3, h = 2, center = true);\n\t\t\t}\n\n\t\t\tfor (i = [0:3])\n\t\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 0])\n\t\t\t\t\t\t\tcylinder(r1 = d_M3_screw \/ 2 + 3, r2 = d_M3_screw \/ 2 + 1, h = bbb_standoff, center = true);\n\t\t}\n\n\t\tfor (i = [0:3])\n\t\t\ttranslate([bbb_holes[i][0], bbb_holes[i][1], 1])\n\t\t\t\tcylinder(r = d_M3_screw \/ 2 - 0.25, h = bbb_standoff, center = true);\n\n\t\ttranslate([bbb_hole0[0] + mount_offset, bbb_hole0[1] + mount_offset * slope0_2, 0])\n\t\t\tcylinder(r = d_M3_screw \/ 2, h = bbb_standoff + 1, center = true);\n\n\t\ttranslate([bbb_hole2[0] - mount_offset, bbb_hole2[1] - mount_offset * slope0_2, 0])\n\t\t\tcylinder(r = d_M3_screw \/ 2, h = bbb_standoff + 1, center = true);\n\t}\n}\n\n\/**********\n\t\t\t\t\t\t\tfollowing are various holders for convenience, not necessary for construction of platform\n**********\/\n\n\/\/ athena_tool_holder is an object to be mounted on a vertical board for holding effector tools\nmodule athena_tool_holder(wood_mount = false) {\n\t\/\/ a tool holder for the side of the printer\n\tl_mount = 2 * d_small_effector_tool_magnet_mount * cos(60);\n\tw_mount = 16;\n\th_mount = 20;\n\n\tmirror([0, 0, (wood_mount) ? 0 : 1]) \/\/ want to flip it over if aluminum mounting\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\tif (wood_mount)\n\t\t\t\t\t\/\/ fits over the vertical board and covers wires\n\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount * sin(60) \/ 2 + 6, (h_mount - t_effector) \/ 2])\n\t\t\t\t\t\t12mm_board_mount(\n\t\t\t\t\t\t\theight = h_mount,\n\t\t\t\t\t\t\tlength = l_mount,\n\t\t\t\t\t\t\twidth = w_mount\n\t\t\t\t\t\t\t);\n\t\t\t\telse\n\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount * sin(60) \/ 2, 0])\n\t\t\t\t\t\thull() {\n\t\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\t\ttranslate([i * 10, 10, 0])\n\t\t\t\t\t\t\t\t\tcylinder(r = d_M3_nut \/ 2, h = t_effector, center = true);\n\n\t\t\t\t\t\t\t\tcube([20 + d_M3_nut, 4, t_effector], center = true);\n\t\t\t\t\t\t}\n\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [0:2])\n\t\t\t\t\t\trotate([0, 0, i * 120 + 60])\n\t\t\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount \/ 2, 0])\n\t\t\t\t\t\t\t\tcylinder(r = od_magnet \/ 2 + r_pad_effector_magnet_mount, h = t_effector, center = true);\n\t\t\t}\n\n\t\t\tif (!wood_mount)\n\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount * sin(60) \/ 2, 0])\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * 10, 10, 0])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = t_effector + 1, center = true);\n\n\t\t\tcylinder(r = d_small_effector_tool_mount \/ 2, h = h_effector + 1, center = true);\n\n\t\t\tfor (i = [0:2])\n\t\t\t\trotate([0, 0, i * 120 + 60])\n\t\t\t\t\ttranslate([0, d_small_effector_tool_magnet_mount \/ 2, -t_effector \/ 2])\n\t\t\t\t\t\tcylinder(r1 = od_magnet \/ 2, r2 = od_magnet \/ 2 + 0.5, h = h_magnet + 2, center = true);\n\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * l_mount \/ 4, d_small_effector_tool_magnet_mount * sin(60) \/ 2, h_mount - 8])\n\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = 5, center = true);\n\t\t}\n}\n\nmodule athena_spool_holder(\n\trender_mount = false,\n\trender_holder = false,\n\tmount_wood = false) {\n\t\/\/ spool holder to mount to vertical board\n\tl_mount = 28;\n\tw_mount = 24;\n\th_mount = (mount_wood) ? 25 : 8;\n\tl_holder = 110;\n\tw_holder = 20;\n\th_holder = 12;\n\td_pivot = 14;\n\th_pivot = 6;\n\td_retainer = 2.75;\n\n\tif (render_mount)\n\t\ttranslate([0, 0, h_mount \/ 2])\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\t\t\t\t\tif (mount_wood)\n\t\t\t\t\t\tmirror([0, 0, 1])\n\t\t\t\t\t\t\t12mm_board_mount(\n\t\t\t\t\t\t\t\theight = h_mount,\n\t\t\t\t\t\t\t\tlength = l_mount,\n\t\t\t\t\t\t\t\twidth = w_mount,\n\t\t\t\t\t\t\t\td_wire_guide = 12.2,\n\t\t\t\t\t\t\t\twire_guide_offset = 5);\n\t\t\t\t\telse\n\t\t\t\t\t\tcube([l_mount, w_mount, h_mount], center = true);\n\n\t\t\t\t\ttranslate([-1, 3, (h_pivot + h_mount) \/ 2 + 0.5])\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\tcylinder(r = d_pivot \/ 2, h = h_pivot + 1, center = true);\n\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2 - 0.2, h = h_pivot + 12, center = true);\n\/\/\t\t\t\t\t\t\trotate_extrude(convexity = 10)\n\/\/\t\t\t\t\t\t\t\ttranslate([d_pivot \/ 2, 0, 0])\n\/\/\t\t\t\t\t\t\t\t\tcircle(r = d_retainer \/ 2);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttranslate([-1, 3, h_mount \/ 2 - 5])\n\t\t\t\t\tintersection() {\n\t\t\t\t\t\trotate_extrude(convexity = 10)\n\t\t\t\t\t\t\ttranslate([9, 0, 0])\n\t\t\t\t\t\t\t\tsquare([7, 6]);\n\n\t\t\t\t\t\trotate([0, 0, 20])\n\t\t\t\t\t\t\ttranslate([-l_mount \/ 2, w_mount \/ 2, 5])\n\t\t\t\t\t\t\t\tcube([35, 17, 10], center = true);\n\t\t\t\t\t}\n\n\t\t\t\tif (mount_wood)\n\t\t\t\t\ttranslate([0, w_mount \/ 2, -h_mount \/ 2 + 5])\n\t\t\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\t\t\ttranslate([0, 0, 2])\n\t\t\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\t\t\ttranslate([i * 8, 0, 0])\n\t\t\t\t\t\t\t\t\t\tcylinder(r = 2, h = 10, center = true);\n\/\/\t\t\t\telse {\n\/\/\t\t\t\t\ttranslate([-0.5, 0, h_mount \/ 2 ]) {\n\/\/\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = h_mount + h_pivot + 3, center = true);\n\n\/\/\t\t\t\t\t\ttranslate([0, 0, h_pivot])\n\/\/\t\t\t\t\t\t\tcylinder(r = d_M3_cap \/ 2, h = h_M3_cap + 1, center = true);\n\/\/\t\t\t\t\t}\n\/\/\t\t\t\t}\n\t\t\t}\n\n\tif (render_holder)\n\t\ttranslate([0, (render_mount) ? (w_mount + h_holder) \/ 2 + 2 : 0, 0]) {\n\t\t\ttranslate([0, 0, w_holder \/ 2])\n\t\t\t\trotate([90, 0, 0])\n\t\t\t\t\tunion() {\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\thull()\n\t\t\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\t\t\ttranslate([i * (l_holder - w_holder) \/ 2, 0, 0])\n\t\t\t\t\t\t\t\t\t\tcylinder(r = w_holder \/ 2 \/ cos(30), h = h_holder, center = true, $fn = 6);\n\n\t\t\t\t\t\t\ttranslate([(l_holder - w_holder) \/ 2, 0, (h_holder - h_pivot ) \/ 2]) {\n\t\t\t\t\t\t\t\tcylinder(r = d_pivot \/ 2 + 0.25, h = h_pivot + 1, center = true);\n\n\t\t\t\t\t\t\t\ttranslate([0, 0, -h_holder + 3])\n\t\t\t\t\t\t\t\t\tcylinder(r1 = d_pivot \/ 2 + 3, r2 = d_pivot \/ 2 + 0.25, h = h_holder - h_pivot);\n\n\t\/\/\t\t\t\t\t\t\trotate_extrude(convexity = 10)\n\t\/\/\t\t\t\t\t\t\t\ttranslate([d_pivot \/ 2, 0, 0])\n\t\/\/\t\t\t\t\t\t\t\t\tcircle(r = d_retainer \/ 2);\n\n\t\/\/\t\t\t\t\t\t\ttranslate([-d_pivot \/ 2, 7, 0])\n\t\/\/\t\t\t\t\t\t\t\trotate([90, 0, 0])\n\t\/\/\t\t\t\t\t\t\t\t\tcylinder(r = d_retainer \/ 2, h = 12, center = true);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\ttranslate([-10, 0, h_holder \/ 2 + 2.75])\n\t\t\t\t\t\t\t\trotate([0, -5, 0])\n\t\t\t\t\t\t\t\t\tcube([l_holder, w_holder + 1, h_holder], center = true);\n\n\t\t\t\t\t\t\ttranslate([-10, 14, 0])\n\t\t\t\t\t\t\t\trotate([0, 0, 7])\n\t\t\t\t\t\t\t\t\tcube([l_holder \/ 1.5, w_holder, h_holder + 1], center = true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttranslate([l_holder \/ 2 - 23, (4 - w_holder) \/ 2, 7])\n\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\tcube([10, 4, 10], center = true);\n\n\t\t\t\t\t\t\t\ttranslate([-10, 0, h_holder \/ 2 + 3])\n\t\t\t\t\t\t\t\t\trotate([0, -7, 0])\n\t\t\t\t\t\t\t\t\t\tcube([l_holder, w_holder + 1, h_holder], center = true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\ttranslate([0, 20, 0])\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\tcylinder(r1 = d_pivot \/ 2 + 0.25, r2 = d_pivot \/ 2 + 3, h = h_holder - h_pivot);\n\n\t\t\t\t\t\ttranslate([0, 0, -1])\n\t\t\t\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = h_holder);\n\n\t\t\t\t\t\ttranslate([0, 0, h_holder - h_pivot - h_M3_cap])\n\t\t\t\t\t\t\tcylinder(r = d_M3_cap \/ 2, h = h_M3_cap + 1);\n\t\t\t\t\t}\n\t\t}\n}\n\n\/\/ athena_hand_tool_holder is an object to mount to a vertical board that wires can be tucked underneath and drivers can be hung on\n\/\/ sonicare model E toothbrush ends have nice magnets in them, good for holding scraper\nmodule athena_hand_tool_holder(\n\twood_mount = false,\n\tsonicare_magnet = false\n) {\n\tl_mount = 30;\n\tw_mount = 22;\n\th_mount = (sonicare_magnet) ? 50 : 30;\n\tdifference() {\n\t\tunion() {\n\t\t\tif (wood_mount)\n\t\t\t\ttranslate([5, 0, l_mount \/ 2])\n\t\t\t\t\trotate([0, 90, 0])\n\t\t\t\t\t\t12mm_board_mount(\n\t\t\t\t\t\t\theight = h_mount,\n\t\t\t\t\t\t\tlength = l_mount,\n\t\t\t\t\t\t\twidth = w_mount\n\t\t\t\t\t\t\t);\n\t\t\telse\n\t\t\t\ttranslate([0, 0, l_mount \/ 2])\n\t\t\t\t\thull()\n\t\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\t\ttranslate([i * l_mount \/ 2, 0, 0])\n\t\t\t\t\t\t\t\tcylinder(r = d_M3_nut \/ 2, h = h_mount, center = true);\n\n\t\t\ttranslate([30 - h_mount \/ 2, -13 - w_mount \/ 2, 2.5])\n\t\t\t\thull()\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * 30, 0, 0])\n\t\t\t\t\t\t\tcylinder(r = 15, h = 5, center = true);\n\t\t}\n\n\t\ttranslate([-h_mount \/ 2, -13 - w_mount \/ 2, 2.5])\n\t\t\tfor (i = [0:4])\n\t\t\t\ttranslate([i * 15, 0, 0])\n\t\t\t\t\tcylinder(r = 3, h = 6, center = true);\n\n\t\tfor (i = [0, 1])\n\t\ttranslate([14, -w_mount \/ 2, i * 15 + 10])\n\t\t\trotate([90, 0, 0]) {\n\t\t\t\tcylinder(r = d_M3_screw \/ 2, h = 20, center = true);\n\n\t\t\t\tcylinder(r = 4, h = 5, center = true);\n\t\t\t}\n\n\t\t\/\/ magnet relief for sonicar magnets\n\t\tif (sonicare_magnet) {\n\t\t\ttranslate([1, 2.7 - w_mount \/ 2, h_mount \/ 3])\n\t\t\t\trotate([90, 0, 0]) {\n\t\t\t\t\tfor (i = [-1, 1])\n\t\t\t\t\t\ttranslate([i * (3.7 + 5.2) \/ 2, 0, 0])\n\t\t\t\t\t\t\tcube([5.2, 10.2, 6], center = true);\n\n\t\t\t\t\ttranslate([0, 0, -3 \/ 2])\n\t\t\t\t\t\tcube([19, 17, 2], center = true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule hotend_effector(\n\tquickrelease = true,\n\tdalekify = false\n) {\n\tdifference() {\n\t\tunion() {\n\t\t\thotend_mount(dalekify = dalekify, quickrelease = quickrelease);\n\n\t\t\teffector_base(large = false);\n\t\t}\n\n\t\tcylinder(r1 = r1_opening, r2 = r2_opening, h = 7, center = true);\n\t}\n}\n\nmodule glass_holddown() {\n\tdifference() {\n\t\thull()\n\t\t\tfor (i = [-1,1])\n\t\t\t\ttranslate([i * 1, 0, 0])\n\t\t\t\t\tcylinder(r = 6, h = 12, center = true);\n\n\t\ttranslate([4, 0, 0]) {\n\t\t\tcylinder(r = 2, h = 13, center = true);\n\t\t}\n\n\t\ttranslate([0, 0, -4])\n\t\t\tcube([20, 20, 8], center = true);\n\n\t\ttranslate([-152, 0, 0])\n\t\t\tcylinder(r = 152, h = 3, center = true);\n\t}\n}\n\nmodule template_fixed_tool_mount() {\n\tcc_arm_mounts = 50;\n\tv_offset_arm_mount = 20; \/\/ offset from the top of the printer vertical\n\ty_third_hole = pow(pow(cc_arm_mounts, 2) - pow(cc_arm_mounts \/ 2, 2), 0.5);\n\tl_al_spacer = 80; \/\/ length of the aluminum 1\" x 3\" spacer between the two verticals\n\toffset_arm_mount = l_al_spacer - v_offset_arm_mount - y_third_hole;\n\tarm_mount = true; \/\/ set to true to generate template for the second vertical (part that arm attaches to)\n\n\tdifference() {\n\t\ttranslate([0, (v_offset_arm_mount - cc_arm_mounts) \/ 2 + 3, 0])\n\t\t\tcube([l_member + 6, cc_arm_mounts + v_offset_arm_mount, 3], center = true);\n\n\t\ttranslate([0, (arm_mount) ? v_offset_arm_mount - offset_arm_mount : 0, 0]) {\n\t\t\tfor (i = [-1, 1])\n\t\t\t\ttranslate([i * cc_arm_mounts \/ 2, (arm_mount) ? -y_third_hole : 0, 0])\n\t\t\t\t\tcylinder(r = 1.5, h = 5, center = true);\n\n\t\t\ttranslate([0, (arm_mount) ? 0 : -y_third_hole, 0])\n\t\t\t\tcylinder(r = 1.5, h = 5, center = true);\n\t\t}\n\n\t\ttranslate([0, (v_offset_arm_mount - cc_arm_mounts) \/ 2 - 5, 1])\n\t\t\tcube([l_member + 1, cc_arm_mounts + v_offset_arm_mount + 10, 3], center = true);\n\t}\n}\n\nmodule thumbscrew_quickrelease() {\n\thex = 10.2; \/\/ size of hex head, mm\n\tr_hex = hex \/ 2 \/ cos(30); \/\/ radius of hex\n\tpoints = 6; \/\/ points in closed end thumbscrew\n\th_wrench = 7; \/\/ thickness of the thumbscrew, mm\n\n\tdifference() {\n\t\tunion() {\n\t\t\tcylinder(r = r_hex + 5, h = h_wrench, center = true, $fn = 6);\n\n\t\t\tfor (i = [0:5])\n\t\t\t\trotate([0, 0, i * 360 \/ 6])\n\t\t\t\t\ttranslate([r_hex + 3.5, 0, 0])\n\t\t\t\t\t\tcylinder(r = 2.5, h = h_wrench, center = true, $fn = 16);\n\t\t}\n\n\t\tcylinder(r = r_hex, h = h_wrench + 1, center = true, $fn = points);\n\t}\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"17f1ed4fb9d28888adab28a716c2f852178554ca","subject":"The path was corrected.","message":"The path was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/toys\/treasure-troll\/test\/treasure-troll-test.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/toys\/treasure-troll\/test\/treasure-troll-test.scad","new_contents":"\r\nuse <..\/treasure-troll.scad>\r\n\r\n\/\/ This next commented STL slowed OpenSCAD too much. So the Blender decimate too was used to reduce the number of faces.\r\n\/\/stlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\troll-doll-planter-1.stl\";\r\nstlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\treasure-troll-stl-to-openscad-via-blender-and-back-to-stl-2.stl\";\r\nstlPath = \"treasure-troll-stl-to-openscad-via-blender-and-back-to-stl-2.stl\";\r\n\r\nshowOriginal = 0;\r\nshowHeadless = 0;\r\nshowHeadOnly = 1;\r\nshowTwoHeaded = 1;\r\n\r\nif(showOriginal == 1)\r\n{\r\n originalTroll(stlPath);\r\n}\r\n\r\nif(showHeadless == 1)\r\n{\r\n headlessTroll(stlPath);\r\n}\r\n\r\nif(showHeadOnly == 1)\r\n{\r\n trollHead(stlPath);\r\n}\r\n\r\nif(showTwoHeaded == 1)\r\n{\r\n twoHeadedTroll(stlPath);\r\n}\r\n","old_contents":"\r\nuse <..\/treasure-troll.scad>\r\n\r\n\/\/ This next commented STL slowed OpenSCAD too much. So the Blender decimate too was used to reduce the number of faces.\r\n\/\/stlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\troll-doll-planter-1.stl\";\r\nstlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\treasure-troll-stl-to-openscad-via-blender-and-back-to-stl-2.stl\";\r\n\r\nshowOriginal = 0;\r\nshowHeadless = 0;\r\nshowHeadOnly = 1;\r\nshowTwoHeaded = 1;\r\n\r\nif(showOriginal == 1)\r\n{\r\n originalTroll(stlPath);\r\n}\r\n\r\nif(showHeadless == 1)\r\n{\r\n headlessTroll(stlPath);\r\n}\r\n\r\nif(showHeadOnly == 1)\r\n{\r\n trollHead(stlPath);\r\n}\r\n\r\nif(showTwoHeaded == 1)\r\n{\r\n twoHeadedTroll(stlPath);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f1046a1b9c088b2aa2d71a09ae73995801f15fec","subject":"Added PiHolder","message":"Added PiHolder\n","repos":"holtsoftware\/House,holtsoftware\/House,holtsoftware\/House,holtsoftware\/House","old_file":"OpenSCAD\/Thermastat\/PiHolder.scad","new_file":"OpenSCAD\/Thermastat\/PiHolder.scad","new_contents":"$fn=1000;\n\/\/$fn=20;\n\nmodule driverPole()\n{\n cylinder(d=5.25,h=7);\n}\n\nmodule driverHole()\n{\n cylinder(d=2.4,h=7);\n}\n\ndifference()\n{\n union()\n {\n cube([85.15,56.25,3]);\n translate([3.25,3.25,0]) driverPole();\n translate([61.25,3.25,0]) driverPole();\n translate([3.25,53,0]) driverPole();\n translate([61.25,53,0]) driverPole();\n }\n translate([3.25,3.25,0]) driverHole();\n translate([61.25,3.25,0]) driverHole();\n translate([3.25,53,0]) driverHole();\n translate([61.25,53,0]) driverHole();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/Thermastat\/PiHolder.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"2f5f3e42691689acd5322829be87b3ddada3535e","subject":"Wheel, make rubber band depression shallower - now 0.5mm","message":"Wheel, make rubber band depression shallower - now 0.5mm\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Wheel.scad","new_file":"hardware\/printedparts\/Wheel.scad","new_contents":"module Wheel_STL() {\n\n\tprintedPart(\"printedparts\/Wheel.scad\", \"Wheel\", \"Wheel_STL()\") {\n\t\n\t view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Wheel.stl\"));\n } else {\n\t\t\t\tWheelModel();\n }\n }\n\t}\n}\n\n\nmodule WheelModel()\n{\n\trimThickness = 4;\n\tspokeThickness = 5;\n\thubDiameter = 10;\n\n \/\/ Outer Rim\n rotate_extrude($fn=100)\n translate ([(WheelDiameter \/ 2) - rimThickness, 0, 0])\n difference()\n {\n square([rimThickness, WheelThickness]);\n\n translate([rimThickness + 0.5 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n }\n\t\n\t\/\/ Spokes\n\tlinear_extrude(WheelThickness)\n\tdifference() {\n\t\tunion() {\n\t\t\t\/\/ Cool, curvey spokes\n\t\t\tfor (i = [0, 120, 240])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([WheelDiameter \/ 4 - 1, 0 ])\n\t\t\t\tdifference() {\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2);\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2 - spokeThickness\/2);\n\t\t\t\t}\n\n\t\t\t\/\/ Boring straight spokes\t\n\t\t\t*for (i = [0, 90, 180, 270])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([hubDiameter \/ 2 - 1, -spokeThickness \/ 2, 0 ])\n\t\t\t\t\tsquare([(WheelDiameter \/ 2) - (hubDiameter \/ 2 - 1) - (rimThickness - 1), spokeThickness]);\n\t\t}\n\n\t\t\/\/ Chop out center where hub will go\n\t\ttranslate([0,0,-eta])\n\t\t\tcircle(r=hubDiameter\/2 - eta);\n\t}\n\n\t\/\/ Hub\n\trender()\n\tdifference() {\n\t\tlinear_extrude(6) \/\/ = motor_shaft_h - a bit?\n\t\tdifference() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\tMotorShaftSlot();\n\t\t}\n\n\t\t\/\/ Grub screw hole\n\t\ttranslate([0, 0, 3.5])\n\t\trotate(a=90, v=[0, 1, 0])\n\t\t\tcylinder(r=1.5, h=hubDiameter\/2 + eta);\n\n\t}\n}\n\nmodule MotorShaftSlot()\n{\n\tdifference() {\n\t\tcircle(r = 5\/2); \/\/ = motor_shaft_r \/ 2\n\n\t\tfor(i = [0:1])\n\t\t\tmirror([i, 0, 0])\t\t\n\t\t\ttranslate([MotorShaftFlatThickness \/ 2, -MotorShaftDiameter \/ 2, 0])\n\t\t\t\tsquare([MotorShaftDiameter \/ 2, MotorShaftDiameter]);\n\t}\n}\n\nmodule Tyre_STL()\n{\n\ttyreThickness = 1.5;\n\tstretchAmount = 2; \/\/ Make tyre dia this much less than wheel so it is stretch to fit\n\n\tcolor(Grey80)\n\trotate_extrude($fn=100)\n\ttranslate ([(WheelDiameter - stretchAmount) \/ 2, 0, 0]) {\n square([tyreThickness, WheelThickness]);\n\n translate([0 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n\t}\n}","old_contents":"module Wheel_STL() {\n\n\tprintedPart(\"printedparts\/Wheel.scad\", \"Wheel\", \"Wheel_STL()\") {\n\t\n\t view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Wheel.stl\"));\n } else {\n\t\t\t\tWheelModel();\n }\n }\n\t}\n}\n\n\nmodule WheelModel()\n{\n\trimThickness = 4;\n\tspokeThickness = 5;\n\thubDiameter = 10;\n\n \/\/ Outer Rim\n rotate_extrude($fn=100)\n translate ([(WheelDiameter \/ 2) - rimThickness, 0, 0])\n difference()\n {\n square([rimThickness, WheelThickness]);\n\n translate([rimThickness , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n }\n\t\n\t\/\/ Spokes\n\tlinear_extrude(WheelThickness)\n\tdifference() {\n\t\tunion() {\n\t\t\t\/\/ Cool, curvey spokes\n\t\t\tfor (i = [0, 120, 240])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([WheelDiameter \/ 4 - 1, 0 ])\n\t\t\t\tdifference() {\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2);\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2 - spokeThickness\/2);\n\t\t\t\t}\n\n\t\t\t\/\/ Boring straight spokes\t\n\t\t\t*for (i = [0, 90, 180, 270])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([hubDiameter \/ 2 - 1, -spokeThickness \/ 2, 0 ])\n\t\t\t\t\tsquare([(WheelDiameter \/ 2) - (hubDiameter \/ 2 - 1) - (rimThickness - 1), spokeThickness]);\n\t\t}\n\n\t\t\/\/ Chop out center where hub will go\n\t\ttranslate([0,0,-eta])\n\t\t\tcircle(r=hubDiameter\/2 - eta);\n\t}\n\n\t\/\/ Hub\n\trender()\n\tdifference() {\n\t\tlinear_extrude(6) \/\/ = motor_shaft_h - a bit?\n\t\tdifference() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\tMotorShaftSlot();\n\t\t}\n\n\t\t\/\/ Grub screw hole\n\t\ttranslate([0, 0, 3.5])\n\t\trotate(a=90, v=[0, 1, 0])\n\t\t\tcylinder(r=1.5, h=hubDiameter\/2 + eta);\n\n\t}\n}\n\nmodule MotorShaftSlot()\n{\n\tdifference() {\n\t\tcircle(r = 5\/2); \/\/ = motor_shaft_r \/ 2\n\n\t\tfor(i = [0:1])\n\t\t\tmirror([i, 0, 0])\t\t\n\t\t\ttranslate([MotorShaftFlatThickness \/ 2, -MotorShaftDiameter \/ 2, 0])\n\t\t\t\tsquare([MotorShaftDiameter \/ 2, MotorShaftDiameter]);\n\t}\n}\n\nmodule Tyre_STL()\n{\n\ttyreThickness = 1.5;\n\tstretchAmount = 2; \/\/ Make tyre dia this much less than wheel so it is stretch to fit\n\n\tcolor(Grey80)\n\trotate_extrude($fn=100)\n\ttranslate ([(WheelDiameter - stretchAmount) \/ 2, 0, 0]) {\n square([tyreThickness, WheelThickness]);\n\n translate([0 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b67a8a74c52563c06edd7eceb9b7992611a8d69e","subject":"add the cradle bed","message":"add the cradle bed\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius)\n{\n zTranslate = minkowskiSphereRadius + 0; \/\/ 0.13;\n color(\"pink\")\n translate([28.2, 31.2, zTranslate])\n rotate([0, 0, 211])\n roundedRectangularArc(angle = 156,\n\n\/\/TODO: fix\/remove the height adjustment\nheight = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = 34.89,\n radiusExtension = 0.8);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5)\n{\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3c5ce09ae9dd8952bdc2b95e1470afb705b7bb7b","subject":"refactor: use array notation instead of dot notation","message":"refactor: use array notation instead of dot notation\n","repos":"jsconan\/camelSCAD","old_file":"operator\/extrude\/negative.scad","new_file":"operator\/extrude\/negative.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that extrude children modules with respect to particular rules.\n *\n * @package operator\/extrude\n * @author jsconan\n *\/\n\n\/**\n * Extrudes linearly the children modules, and applies a wall adjustment to ensure\n * the final object will not produce artifacts after a `difference()` operation.\n *\n * @param Number [height] - The height of the extrusion. If the value is negative,\n * the extrusion will be made top to bottom (below the origin).\n * @param Number|String [direction] - Tells on what sides adjust the height to make sure\n * the difference won't produce dummy walls.\n * @param Boolean [center] - Whether or not center the extrusion on the vertical axis.\n * @param Number [convexity] - If the extrusion fails for a non-trivial 2D shape,\n * try setting the convexity parameter.\n * @param Number [twist] - The number of degrees of through which the shape is extruded.\n * @param Number [slices] - Defines the number of intermediate points along the Z axis\n * of the extrusion.\n * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of\n * the extrusion.\n *\/\nmodule negativeExtrude(height, direction, center, convexity, twist, slices, scale) {\n center = boolean(center);\n convexity = numberOr(convexity, 10);\n height = align(value=height, direction=direction, center=center);\n\n translateZ(height[1]) {\n linear_extrude(height=height[0], center=center, convexity=convexity, twist=twist, slices=slices, scale=scale) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that extrude children modules with respect to particular rules.\n *\n * @package operator\/extrude\n * @author jsconan\n *\/\n\n\/**\n * Extrudes linearly the children modules, and applies a wall adjustment to ensure\n * the final object will not produce artifacts after a `difference()` operation.\n *\n * @param Number [height] - The height of the extrusion. If the value is negative,\n * the extrusion will be made top to bottom (below the origin).\n * @param Number|String [direction] - Tells on what sides adjust the height to make sure\n * the difference won't produce dummy walls.\n * @param Boolean [center] - Whether or not center the extrusion on the vertical axis.\n * @param Number [convexity] - If the extrusion fails for a non-trivial 2D shape,\n * try setting the convexity parameter.\n * @param Number [twist] - The number of degrees of through which the shape is extruded.\n * @param Number [slices] - Defines the number of intermediate points along the Z axis\n * of the extrusion.\n * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of\n * the extrusion.\n *\/\nmodule negativeExtrude(height, direction, center, convexity, twist, slices, scale) {\n center = boolean(center);\n convexity = numberOr(convexity, 10);\n height = align(value=height, direction=direction, center=center);\n\n translateZ(height.y) {\n linear_extrude(height=height.x, center=center, convexity=convexity, twist=twist, slices=slices, scale=scale) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b5283d9529c6d01460597f9175beca694db1e681","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1517be1083b29b4014a4e2eeddfde1c8a70ec25d","subject":"x\/carriage: add x smooth rods preview in debug","message":"x\/carriage: add x smooth rods preview in debug\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n ty(xaxis_carriage_beltpath_offset_y)\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n \/*ty(-xaxis_carriage_beltpath_offset_y)*\/\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n ty(xaxis_carriage_beltpath_offset_y)\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"51aedd49a17bbefdada90a3695263b7e7f5a9ba8","subject":"Make PCB hole diameter a default parameter","message":"Make PCB hole diameter a default parameter","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_Hole_Space = 2.54; \/\/ spacing of the holes\nArduinoPro_Hole_Inset = ArduinoPro_Hole_Space\/2; \/\/ Inset from board edge\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255];\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n height = 2.7;\n area = [7.7, 5.2];\n colour = [220\/255, 220\/255, 220\/255];\n move_x = ArduinoPro_PCB_Width\/2 - ArduinoPro_Hole_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space;\n move_z = ArduinoPro_PCB_Height;\n\n color(colour)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square(size = area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole(d = 1.25) {\n \/\/ Standard PCB hole\n circle(d = d);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_Hole_Space : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_Hole_Inset : ArduinoPro_Hole_Space : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_Hole_Diam = 1.25; \/\/ hole diameter\nArduinoPro_Hole_Space = 2.54; \/\/ spacing of the holes\nArduinoPro_Hole_Inset = ArduinoPro_Hole_Space\/2; \/\/ Inset from board edge\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255];\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n height = 2.7;\n area = [7.7, 5.2];\n colour = [220\/255, 220\/255, 220\/255];\n move_x = ArduinoPro_PCB_Width\/2 - ArduinoPro_Hole_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space;\n move_z = ArduinoPro_PCB_Height;\n\n color(colour)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square(size = area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n circle(r = ArduinoPro_Hole_Diam\/2);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_Hole_Space : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_Hole_Inset : ArduinoPro_Hole_Space : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\nArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5898de2ff979145fe5b2cb8b21d2df3a28cbcd24","subject":"shapes\/vectorz: bugfix","message":"shapes\/vectorz: bugfix\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fa=$fa) = [for (i=[0:fa-1]) [r*sin(i*360\/fa), r*cos(i*360\/fa)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(1)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fa=$fa) = [for (i=[0:fa-1]) [r*sin(i*360\/fa), r*cos(i*360\/fa)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c0ea5d7a54be4705a94939bbcab0ecb222c1b9ba","subject":"A module was added for the httm backlit capacitive touch switches.","message":"A module was added for the httm backlit capacitive touch switches.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/switch-mounting-holes\/httm-backlit-capacitive-switch\/httm-backlit-capacitive-switch.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/switch-mounting-holes\/httm-backlit-capacitive-switch\/httm-backlit-capacitive-switch.scad","new_contents":"\r\n\/**\r\n * Mike Hall showed and gave me afew of one day at work.\r\n *\r\n * The height of the board with cap touch plat is listed as 3mm.\r\n\r\n *\t\thttp:\/\/www.cnx-software.com\/2017\/07\/27\/httm-backlit-capacitive-touch-switch-button-sells-for-about-one-dollar\/\r\n *\r\n * From the link:\r\n\t\t\t\t HTTM button specifications:\r\n\r\n\t\t\t\t Voltage input range: + 2.7v to + 6v\r\n\t\t\t\t Signal output \u2013 Voltage: + 3.3v; Current up to 500 mA\r\n\t\t\t\t Header \u2013 3-pin with GND, VCC, and OUT\r\n\t\t\t\t Backlight color \u2013 red, blue (cyan), or yellow\r\n\t\t\t\t Dimensions \u2013 20.4 x 16.6 mm\r\n\t\t\t\t Operating temperature range: -30 \u2103 to + 70 \u2103\r\n\r\n\t https:\/\/www.aliexpress.com\/item\/10-pcs-red-color-HTTM-Series-2-7V-6V-Capacitive-Touch-Switch-Module-Strong-anti-interference\/32814839036.html\r\n\r\n\t\t From aliexpress:\r\n\r\n\t\t\t Working voltage: + 2.7 ~ 6V\r\n\t\t\t Working temperature: 30 ~ +70 \u00b0\r\n\t\t\t OUT pin Output voltage: + 3.3V \u00b1 0.1V\r\n\t\t\t OUTPin maximum output current:500mA\r\n *\/\r\n\r\nmodule httmBacklitCapacitiveTouchSwitchMountingHole(zLength = 3.0)\r\n{\r\n\txLength = 20.4;\r\n\tyLength = 16.6\r\n\r\n\tcube([xLength, yLength, zLength]);\r\n}\r\n","old_contents":"\r\n\/**\r\n * Mike Hall showed and gave me afew of one day at work.\r\n *\r\n *\t\thttp:\/\/www.cnx-software.com\/2017\/07\/27\/httm-backlit-capacitive-touch-switch-button-sells-for-about-one-dollar\/\r\n *\r\n * From the link:\r\n\t\t\t\t HTTM button specifications:\r\n\r\n\t\t\t\t Voltage input range: + 2.7v to + 6v\r\n\t\t\t\t Signal output \u2013 Voltage: + 3.3v; Current up to 500 mA\r\n\t\t\t\t Header \u2013 3-pin with GND, VCC, and OUT\r\n\t\t\t\t Backlight color \u2013 red, blue (cyan), or yellow\r\n\t\t\t\t Dimensions \u2013 20.4 x 16.6 mm\r\n\t\t\t\t Operating temperature range: -30 \u2103 to + 70 \u2103\r\n\r\n\t https:\/\/www.aliexpress.com\/item\/10-pcs-red-color-HTTM-Series-2-7V-6V-Capacitive-Touch-Switch-Module-Strong-anti-interference\/32814839036.html\r\n\r\n\t\t From aliexpress:\r\n\r\n\t\t\t Working voltage: + 2.7 ~ 6V\r\n\t\t\t Working temperature: 30 ~ +70 \u00b0\r\n\t\t\t OUT pin Output voltage: + 3.3V \u00b1 0.1V\r\n\t\t\t OUTPin maximum output current:500mA\r\n *\/\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c72cc63c681c61e6bed0c5d3b27508dc62e3bee6","subject":"buttons","message":"buttons\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\n\/\/total_height = 22;\ntotal_height = 19;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\n\/\/cap_r = 4.5;\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 4.5 + th;\nborder_h = 3;\nborder_r = cap_r + 2;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 19;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 4.5 + th;\nborder_h = 3;\nborder_r = cap_r + 2;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9c0e43998cf6ed6d3c9bb4a3d61d06d6e1489173","subject":"shapes: add circle_profile","message":"shapes: add circle_profile\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction rounded_rectangle_profile(size=[1,1],r=[1,1],fn=$fn) = [\nfor (index = [0:fn-1])\nlet(a = index\/fn*360)\n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X*(size.x\/2-r.x)\n+ sign_y(index, fn) * Y*(size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction rounded_rectangle_profile(size=[1,1],r=[1,1],fn=$fn) = [\nfor (index = [0:fn-1])\nlet(a = index\/fn*360)\n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X*(size.x\/2-r.x)\n+ sign_y(index, fn) * Y*(size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ccf85c1cad53b4799cb53a27d9d50332cbd2682a","subject":"shapes\/rcube: rename cuberound* to rcube","message":"shapes\/rcube: rename cuberound* to rcube\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef)\n{\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate([ dist*i, 0, 0 ]) children(i);\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef)\n{\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate([ dist*i, 0, 0 ]) children(i);\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f6a2d0c924accc691a82be3172591aa1e7962cd2","subject":"Add constant for right angle","message":"Add constant for right angle\n","repos":"jsconan\/camelSCAD","old_file":"core\/constants.scad","new_file":"core\/constants.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = 90;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = 180;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = 270;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = 360;\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = 90;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = 180;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = 270;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = 360;\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f5834f44ee9ca63101e8f98056feeb7a70accd01","subject":"Improve raspicam4pibow.","message":"Improve raspicam4pibow.\n","repos":"jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets","old_file":"openscad\/raspicam.scad","new_file":"openscad\/raspicam.scad","new_contents":"\/\/ Raspicam for Pibow\n\/\/ A raspicam support for the Pibow case (Pimoroni).\n\n\/\/ Copyright (c) 2014 J\u00e9r\u00e9mie DECOCK \n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {\n difference() {\n union() {\n difference() {\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n\n #union() {\n translate([-board_width\/2 + 10, 0, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([board_width\/2 - camera_screw_holes_spacing_x\/2 - 10, 0, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n translate([-camera_screw_holes_spacing_x\/2, 0, 0]){\n body_camera_holes(camera_holes_width, screw_hole_depth);\n }\n }\n\n body_board_round_corner_mask(radius=board_corner_radius, spacing_x=board_width-2*board_corner_radius, spacing_y=board_height-2*board_corner_radius, depth=screw_hole_depth);\n }\n }\n translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n #translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n cube([hinge_radius_out * 2 + 2, hinge_slot_length, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n cube([width, height, depth], center=true);\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([i*spacing, 0, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_holes(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\nmodule body_board_round_corner_mask(radius, spacing_x, spacing_y, depth) {\n translate([ spacing_x\/2, spacing_y\/2, 0]) mirror([1,1,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([ spacing_x\/2, -spacing_y\/2, 0]) mirror([1,0,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n}\n\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n\n translate([15, 0, 0]) {\n difference() {\n cylinder(r=head_radius, h=head_length, $fn=8);\n #translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n }\n }\n}\n\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {\n difference() {\n feet_main_board(board_width, board_height, board_depth, board_corner_radius);\n #feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);\n #feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);\n #feet_board_round_corner_mask(radius=board_corner_radius, spacing_x=board_width-2*board_corner_radius, spacing_y=board_height-2*board_corner_radius, depth=screw_hole_depth);\n }\n\n translate([board_width\/2 + hinge_shelf_width\/2, 0, 0]) {\n cube([hinge_shelf_width, hinge_length, board_depth], center=true);\n }\n\n translate([board_width\/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);\n }\n }\n}\n\nmodule feet_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule feet_ventilation_holes(radius, depth) {\n\t$fn=50;\n\t\n translate([-33, 17, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n\n translate([33, -17, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n\n translate([8, 0, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n\n translate([-8, 0, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n}\n\nmodule feet_main_board(width, height, depth, radius) {\n\t$fn=50;\n cube([width, height, depth], center=true);\n}\n\nmodule feet_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\nmodule feet_board_round_corner_mask(radius, spacing_x, spacing_y, depth) {\n translate([-spacing_x\/2, spacing_y\/2, 0]) mirror([0,1,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([-spacing_x\/2, -spacing_y\/2, 0]) mirror([0,0,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([ spacing_x\/2, spacing_y\/2, 0]) mirror([1,1,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([ spacing_x\/2, -spacing_y\/2, 0]) mirror([1,0,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n}\n\n\/\/ COMMON \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule round_corner_mask(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n difference() {\n cube([2*radius+1, 2*radius+1, depth], center=true);\n union() {\n cylinder(r=radius, h=depth+2, center=true);\n translate([(radius+2)\/2, 0, 0]) cube([radius+2, 2*radius+2, depth+2], center=true);\n translate([0, (radius+2)\/2, 0]) cube([2*radius+2, radius+2, depth+2], center=true);\n }\n }\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nassign(feet_board_width=98,\n feet_board_height=65,\n feet_board_depth=3,\n feet_board_corner_radius=5, \/\/ TODO\n feet_screw_holes_radius=1, \/\/ TODO\n feet_screw_holes_spacing_x=89, \/\/ TODO\n feet_screw_holes_spacing_y=56, \/\/ TODO\n feet_screw_hole_depth=10,\n feet_hinge_shelf_width=20,\n feet_ventilation_holes_radius=2.5,\n body_board_width=100,\n body_board_height=40,\n body_board_depth=3,\n body_board_corner_radius=3,\n body_screw_hole_radius=1.5,\n body_screw_hole_spacing=5,\n body_screw_hole_depth=10,\n body_num_screw_holes=9,\n body_camera_screw_holes_radius=1,\n body_camera_screw_holes_spacing_x=12,\n body_camera_screw_holes_spacing_y=20,\n body_camera_holes_width=8,\n hinge_radius=1.5,\n hinge_head_radius=4.6,\n hinge_head_length=5) {\n\n color([0,0,1]) {\n translate([0, 50, body_board_depth\/2]) {\n body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_slot_length=body_board_height \/ 3 + 1);\n }\n }\n\n color([1,0,0]) {\n translate([0, -50, feet_board_depth\/2]) {\n feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height\/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);\n }\n }\n\n color([0,1,0]) {\n translate([-50, 0, 0]) {\n hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);\n }\n }\n}\n\n","old_contents":"\/\/ Raspicam\n\n\/\/ Copyright (c) 2014, J\u00e9r\u00e9mie Decock (jd.jdhp@gmail.com)\n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {\n difference() {\n union() {\n difference() {\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n\n #union() {\n translate([-board_width\/2 + 10, 0, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([board_width\/2 - camera_screw_holes_spacing_x\/2 - 10, 0, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n translate([-camera_screw_holes_spacing_x\/2, 0, 0]){\n body_camera_holes(camera_holes_width, screw_hole_depth);\n }\n }\n }\n }\n translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n #translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n cube([hinge_radius_out * 2 + 2, hinge_slot_length, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n \/\/\tcylinder(r=radius, h=depth, center=true);\n \/\/}\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([i*spacing, 0, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_holes(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n\n translate([15, 0, 0]) {\n difference() {\n cylinder(r=head_radius, h=head_length, $fn=8);\n #translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n }\n }\n}\n\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {\n difference() {\n feet_main_board(board_width, board_height, board_depth, board_corner_radius);\n #feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);\n #feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);\n }\n\n translate([board_width\/2 + hinge_shelf_width\/2, 0, 0]) {\n cube([hinge_shelf_width, hinge_length, board_depth], center=true);\n }\n\n translate([board_width\/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);\n }\n }\n}\n\nmodule feet_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule feet_ventilation_holes(radius, depth) {\n\t$fn=50;\n\t\n translate([0, 0, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n}\n\nmodule feet_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n\t\/\/\tcylinder(r=radius, h=depth, center=true);\n\t\/\/}\n}\n\nmodule feet_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nassign(feet_board_width=98,\n feet_board_height=65,\n feet_board_depth=3,\n feet_board_corner_radius=3,\n feet_screw_holes_radius=1.5,\n feet_screw_holes_spacing_x=70,\n feet_screw_holes_spacing_y=30,\n feet_screw_hole_depth=10,\n feet_hinge_shelf_width=20,\n feet_ventilation_holes_radius=3,\n body_board_width=100,\n body_board_height=40,\n body_board_depth=3,\n body_board_corner_radius=3,\n body_screw_hole_radius=1.5,\n body_screw_hole_spacing=5,\n body_screw_hole_depth=10,\n body_num_screw_holes=9,\n body_camera_screw_holes_radius=1,\n body_camera_screw_holes_spacing_x=12,\n body_camera_screw_holes_spacing_y=20,\n body_camera_holes_width=8,\n hinge_radius=1.5,\n hinge_head_radius=4.6,\n hinge_head_length=5) {\n\n color([0,0,1]) {\n translate([0, 50, body_board_depth\/2]) {\n body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_slot_length=body_board_height \/ 3 + 1);\n }\n }\n\n color([1,0,0]) {\n translate([0, -50, feet_board_depth\/2]) {\n feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height\/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);\n }\n }\n\n color([0,1,0]) {\n translate([-50, 0, 0]) {\n hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"08bac1d194e5895dfa925c7db21f2294e73c8164","subject":"Added round corners module for SCAD","message":"Added round corners module for SCAD\n","repos":"btcspry\/3d-wallet-generator","old_file":"scad\/roundCornersCube.scad","new_file":"scad\/roundCornersCube.scad","new_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,$fn = 25,center=true);}\nmodule roundCornersCube(x,y,z)difference(){r=((x+y)\/2)*0.055;cube([x,y,z], center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/roundCornersCube.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a0089c6bca12df6d04dcf1bb80b0843d86c25c43","subject":"[hm] Default wall=2.0mm, wall_t=1.45mm","message":"[hm] Default wall=2.0mm, wall_t=1.45mm\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+2.0), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+2.0), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"471771705c0b71473a87d3f0cf0b3ada723fdec8","subject":"parameterize the x,y location of the stand top","message":"parameterize the x,y location of the stand top\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"30fda1e1e97f9f0eb2f47fcdf0fcdb26d140aeab","subject":"Changed iterations number to prepare for printing","message":"Changed iterations number to prepare for printing\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube_half.scad","new_file":"inverse_cube_half.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\n\necho(version());\n\ntotal_size = ((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size;\n\necho(\"Total Size: ---------\");\necho(total_size);\necho(\"---------------------\");\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\ndifference() {\n union() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n }\n\n translate([0, 0, -total_size \/ 2]) {\n cube(total_size, center = true);\n }\n}","old_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 4;\n\necho(version());\n\ntotal_size = ((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size;\n\necho(\"Total Size: ---------\");\necho(total_size);\necho(\"---------------------\");\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\ndifference() {\n union() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n }\n\n translate([0, 0, -total_size \/ 2]) {\n cube(total_size, center = true);\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"51a7d5ef64430f8ddbf345fe71f34fc7febd69b1","subject":"The x translate values was set to 0, so that clients can adjust as necessary.","message":"The x translate values was set to 0, so that clients can adjust as necessary.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/switch-mounting-holes\/keyboard-switch-mounting-holes.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/switch-mounting-holes\/keyboard-switch-mounting-holes.scad","new_contents":"\r\n\/**\r\n * buttonSide - the length of the side of the rectangular cutout for the button\/key\r\n *\/\r\nmodule keyboardSwitchMountingHoles(buttonCount = 4,\r\n\t\t\t buttonSide = 5,\r\n\t\t \t panelHeight = 1)\r\n{\r\n\tx = 0;\r\n\tstartY = 0;\r\n\r\n\tySpacing = 3;\r\n\tyIncrement = buttonSide + ySpacing;\r\n\r\n\tfor(i = [0 : buttonCount-1])\r\n\t{\r\n\t\ty = startY + (i * yIncrement);\r\n\r\n\t\tzLength = 2 * panelHeight + 0.2;\r\n\r\n\t\tcolor(\"green\")\r\n\t\ttranslate([x, y, -0.1])\r\n\t\tcube([buttonSide, buttonSide, zLength]);\r\n\t}\r\n}\r\n","old_contents":"\r\n\/**\r\n * buttonSide - the length of the side of the rectangular cutout for the button\/key\r\n *\/\r\nmodule keyboardSwitchMountingHoles(buttonCount = 4,\r\n\t\t\t buttonSide = 5,\r\n\t\t \t panelHeight = 1)\r\n{\r\n\tx = 16;\r\n\tstartY = 0;\r\n\r\n\tySpacing = 3;\r\n\tyIncrement = buttonSide + ySpacing;\r\n\r\n\tfor(i = [0 : buttonCount-1])\r\n\t{\r\n\t\ty = startY + (i * yIncrement);\r\n\r\n\t\tzLength = 2 * panelHeight + 0.2;\r\n\r\n\t\tcolor(\"green\")\r\n\t\ttranslate([x, y, -0.1])\r\n\t\tcube([buttonSide, buttonSide, zLength]);\r\n\t}\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"766390c7ce8d99030dfa831ca2693f9c952d6053","subject":"Bottom model with low fence","message":"Bottom model with low fence\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 1;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 37.4;\ncontrast_start_y = shift_y + 26.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 6;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n translate([volume_start_x, volume_start_y, -eps]) {\n cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"a = 15;\nb = 10;\nc = 2;\nt = 0.25;\nsocket_h = 1;\nsocket_w = 1;\nsocket_n = 4;\nsocket_int = 1;\neps = 1e-3;\nusb_type_b_w = 0.75;\nusb_type_b_h = 1;\nusb_type_a_w = 1.25;\nusb_type_a_h = 0.5;\nstart_socket = (a-(socket_w+socket_int)*socket_n+socket_w)\/2;\n\ndifference() {\n cube([a,b,c], false);\n translate([t,t,t]) {\n cube([a-2*t+eps, b-2*t+eps, c-t+eps], false);\n }\n for (i = [0:1:socket_n-1]) {\n translate([start_socket+i*(socket_w+socket_int), -eps, -eps]) {\n cube(size=[socket_w, t+2*eps, socket_h]);\n }\n }\n \n translate([-eps, 2, -eps]) {\n cube(size=[t+2*eps, usb_type_b_w, usb_type_b_h]);\n }\n translate([-eps, 6, 0.5]) {\n cube(size=[t+2*eps, usb_type_a_w, usb_type_a_h]);\n }\n};\n\nleg_r = t;\nshift = t\/2+leg_r;\nfor (dx = [shift, a-shift])\n for (dy = [shift, b-shift]) {\n translate([dx, dy, 0]) {\n cylinder(h=c, r=leg_r, $fn=40);\n }\n }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"613a6d222a3d6b854b579281e68321aa8a62c137","subject":"Init OpenScad file","message":"Init OpenScad file\n","repos":"luoyi\/RpiPlayer","old_file":"RpiPlayer.scad","new_file":"RpiPlayer.scad","new_contents":"module round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\n\n\ncolor([0.5,0.5,0.99]) \ndifference () {\nround_cube(80+6,60+6,40,4); \ntranslate([0,-2,3]) round_cube(80,58,40,4);\n\/\/translate([0,20,3]) round_cube(70,3,20,4);\ntranslate([0,33.5,2]) cube([70,3,40],center=true);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'RpiPlayer.scad' did not match any file(s) known to git\n","license":"artistic-2.0","lang":"OpenSCAD"} {"commit":"f3bf9111e006eeea45cbb0d35a29746ecf573991","subject":"attach: add rollaxis param","message":"attach: add rollaxis param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"attach.scad","new_file":"attach.scad","new_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, center=true);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=rollaxis==U?v:rollaxis) rotate(a=ang, v=raxis_)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","old_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, center=true);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis_)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"55b976e8454bf58f82deb9c7658471deafaf51ef","subject":"correct the inner cutout","message":"correct the inner cutout\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/samples\/heart\/heart-sine-vase.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/samples\/heart\/heart-sine-vase.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f712631b8a9d99178e5520f23ebe9ee4585e1bfc","subject":"add a narrow heart sample","message":"add a narrow heart sample\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/narrow\/heart\/narrow-heart-half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/narrow\/heart\/narrow-heart-half-circle-phone-stand.scad","new_contents":"\/* [Hidden] *\/\n\nuse <..\/..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = -1.0,\n base_yTranslate = -1.0,\n iconType = \"Heart\",\n iconColor = \"blue\",\n icon_xOffset = -9,\n icon_yOffset = 34,\n icon_zOffset = 9.8,\n iconXyScale = 0.64,\n bed_cutout_zLength = 10,\n\/\/ height = 40,\n stand_connectorBar_xLength = 8,\n stand_top_xTranslate = 9.105,\n stand_top_yTranslate = 9.85);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/narrow\/heart\/narrow-heart-half-circle-phone-stand.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1a041a8e4978e8525171fe08177e402a8067c01f","subject":"added elements for print and moved visualization aside","message":"added elements for print and moved visualization aside\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_case\/holder_aa.scad","new_file":"battery_case\/holder_aa.scad","new_contents":"use \nuse \nuse \ninclude \n\n\/\/ actual elements\nbottomAA();\ntranslate([0, sizeOY+5, 0])\n topAA();\n\n\/\/ visualization only:\n%translate([0, -sizeOY-40, 0])\n{\n bottomAA();\n translate([sizeOX, 0, sizeOZ])\n mirror([1,0,0])\n mirror([0,0,1])\n topAA();\n %translate([0, 1, 0])\n batteriesPack();\n}\n","old_contents":"use \nuse \nuse \ninclude \n\n\/\/ actual elements\n\/\/bottomAA();\n\/\/translate()\n\/\/ topAA();\n\n\/\/ visualization only:\nbottomAA();\ntranslate([sizeOX, 0, sizeOZ])\n mirror([1,0,0])\n mirror([0,0,1])\n topAA();\n%batteriesPack();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e856f5685fca536d69ff6ef8d87c43f59c8801b7","subject":"correct the stand offsets","message":"correct the stand offsets\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/customizer\/half-circle-phone-stand-customizer.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/customizer\/half-circle-phone-stand-customizer.scad","new_contents":"\nbase_xTranslate = -1; \/\/ [-10: 0.1 :10]\n\nbase_yTranslate = -1; \/\/ [-10: 0.1 :10]\n\nstand_connectorBar_xLength = 8; \/\/ [-10: 0.1 :10]\n\nstand_top_xTranslate = 9.105; \/\/ [-10: 0.1 :10]\n\nstand_top_yTranslate = 9.85; \/\/ [-10: 0.1 :10]\n\niconType = \"Mario\"; \/\/ [Aqua Dude, Bass Clef, Cat, Creeper, Fan, Fish, Heart, Light Bulb, Luigi, Mario, Moon, Rebel, Spur, Sun, Thundercat, Treble Clef, Trooper]\n\niconColor = \"blue\"; \/\/ [pink, red, black, white, yellow, blue, green]\n\nicon_xOffset = -9; \/\/ [-30:30]\n\nicon_yOffset = 34; \/\/ [-10:200]\n\nicon_zOffset = 19; \/\/ [-30:30]\n\niconXyScale = 1.0; \/\/ [-1: 0.1 :10]\n\nbed_cutout_zLength = 10; \/\/ [4.2 : 15]\n\nheight = 40; \/\/ [19.125 : 60]\n\n\/* [Hidden] *\/\n\nuse <..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n iconColor = iconColor,\n icon_xOffset = icon_xOffset,\n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n iconXyScale = iconXyScale,\n iconType = iconType,\n stand_connectorBar_xLength = stand_connectorBar_xLength,\n stand_top_xTranslate = stand_top_xTranslate,\n stand_top_yTranslate = stand_top_yTranslate);\n\n","old_contents":"\nbase_xTranslate = 0; \/\/ [-10: 0.1 :10]\n\nbase_yTranslate = 0; \/\/ [-10: 0.1 :10]\n\nstand_connectorBar_xLength = 8; \/\/ [-10: 0.1 :10]\n\nstand_top_xTranslate = 8.105; \/\/ [-10: 0.1 :10]\n\nstand_top_yTranslate = 8.85; \/\/ [-10: 0.1 :10]\n\niconType = \"Mario\"; \/\/ [Aqua Dude, Bass Clef, Cat, Creeper, Fan, Fish, Heart, Light Bulb, Luigi, Mario, Moon, Rebel, Spur, Sun, Thundercat, Treble Clef, Trooper]\n\niconColor = \"blue\"; \/\/ [pink, red, black, white, yellow, blue, green]\n\nicon_xOffset = -9; \/\/ [-30:30]\n\nicon_yOffset = 34; \/\/ [-10:200]\n\nicon_zOffset = 19; \/\/ [-30:30]\n\niconXyScale = 1.0; \/\/ [-1: 0.1 :10]\n\nbed_cutout_zLength = 10; \/\/ [4.2 : 15]\n\nheight = 40; \/\/ [19.125 : 60]\n\n\/* [Hidden] *\/\n\nuse <..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n iconColor = iconColor,\n icon_xOffset = icon_xOffset,\n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n iconXyScale = iconXyScale,\n iconType = iconType,\n stand_connectorBar_xLength = stand_connectorBar_xLength,\n stand_top_xTranslate = stand_top_xTranslate,\n stand_top_yTranslate = stand_top_yTranslate);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6cee377b0c83f4ab5419d0c0a979cb42b3b1d5e3","subject":"box implemented","message":"box implemented\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"small_psu_stub\/small_psu_stub.scad","new_file":"small_psu_stub\/small_psu_stub.scad","new_contents":"use \n\neps = 0.01;\nwall = 2*0.4;\nbox_size = [60, 25, 20];\nroundings = 2;\nsplit_h = 5;\nint_size = box_size - 2*wall*[1,1,1];\n\nmodule box_main()\n{\n difference()\n {\n \n rounded_cube(box_size, roundings, $fn=30);\n \/\/ empty interior\n translate(wall*[1,1,1])\n rounded_cube(int_size, roundings-wall, $fn=30);\n \/\/ holes for cable\n translate([-eps, box_size[1]\/2, 3.25\/2+roundings])\n rotate([0, 90, 0])\n hull()\n for(dy=[-1, +1])\n translate([0, dy*(5.5-2*3.5\/2)\/2, 0])\n cylinder(d=3.5, h=box_size[0]+2*eps, $fn=20);\n }\n}\n\nmodule box_bottom()\n{\n intersection()\n {\n box_main();\n cube(box_size - [0, 0, split_h]);\n }\n}\n\nmodule box_top()\n{\n \/\/ cover\n intersection()\n {\n translate([0, box_size[1], box_size[2]])\n rotate([180, 0 , 0])\n box_main();\n cube([box_size[0], box_size[1], split_h]);\n }\n \/\/ side walls for glueing\n translate(wall*[1,1,1])\n {\n difference()\n {\n cube([int_size[0], int_size[1], split_h+3]);\n \/\/ just keep walls\n translate(0.5*[1,1,0])\n cube(int_size-2*0.5*[1,1,1]);\n \/\/ corners removed for more flexibility\n for(dx=[0,1])\n for(dy=[0,1])\n translate([dx*int_size[0], dy*int_size[1], 0])\n translate(-10\/2*[1,1,0])\n cube([10, 10, int_size[2]]);\n \/\/ minimize size of side walls\n translate([box_size[0]\/2 - int_size[0]\/3\/2 - wall, -eps, 0])\n cube([int_size[0]\/3, box_size[1], int_size[2]]);\n }\n }\n}\n\nbox_top();\ntranslate([0, -28, 0])\n box_bottom();\n","old_contents":"use \n\nwall = 2*0.4;\nbox_size = [60, 25, 20];\nroundings = 2;\n\nmodule box_main()\n{\n difference()\n {\n \n rounded_cube(box_size, roundings, $fn=30);\n translate(wall*[1,1,1])\n rounded_cube(box_size - 2*wall*[1,1,1], roundings-wall, $fn=30);\n }\n}\n\nintersection()\n{\n box_main();\n cube([30, 30, 30]);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"041119a31712c16f88c9f109b1d3f702599d691e","subject":"add modules","message":"add modules\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/christmas-story-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/christmas-story-lamp-shade.scad","new_contents":"\nuse <..\/..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nuse <..\/..\/lamp-shade.scad>\n\nouterRadius = 10;\n\ntranslate([-120, 0, 0])\nimport(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nunion()\n{\n legLamp_shade_top();\n\n legLamp_shade_bottom();\n}\n\nmodule legLamp_shade_bottom()\n{\n openCylinder(height = 100,\n outerRadius = outerRadius);\n}\n\nmodule legLamp_shade_top()\n{\n translate([0, 0, 25])\n rotate([180, 0, 0])\n lampShade(outerRadius = 36,\n squareLength = 28,\n xScale = 0.3,\n yScale = 0.7);\n}","old_contents":"\nuse <..\/..\/lamp-shade.scad>\n\nlampShade(outerRadius = 36,\n squareLength = 28,\n xScale = 0.3,\n yScale = 0.7);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ac20d18d19c93b4c63dc43bf6bc48f21198e53cd","subject":"toda todo","message":"toda todo\n","repos":"JoeSuber\/QuickerPicker","old_file":"simons.scad","new_file":"simons.scad","new_contents":"\necho(\"a box with holes in it for Simon\");\n\/\/ todo: get rid of hard-coded '28' in walls_of_box\n\nbigbox = 80;\t\t\t\t\t\t\/\/ old box was 70?\nbigboxht = 55;\t\t\t\t\t\t\/\/ up from 50\nfatten_for_lid_cut=.0;\t\t\t\t\/\/ test fit lids: if more than .6 needed, bad geometry or print\nsides = 2;\t\t\t\t\t\t\t\/\/ skinny, assumes some further light-stopping material\/paint\nledhole=15;\t\nholeside=ledhole + sides*2 + 10;\t\/\/ accomodate lense assembly\ncornerad=4;\t\t\t\t\t\t\/\/ used with minkowski(), cornerad*2 + 4-flat-sides = perimeter\nsmall_chamber = 1\/3;\t\t\t\t\/\/ total of chambers' ratios should == 1\nbig_chamber = 2\/3;\t\t\t\t\/\/ chambers can be swapped\nslit_width = 5;\t\t\t\t\t\t\/\/ mm\ncuvtt_inside = 12;\t\t\t\t\t\/\/ put cuvette into a lid, slide detector around it, put other lid on.\nlid_lad = 7;\t\t\t\t\t\t\/\/ basic lid thickness\nlid_puff = 4;\t\t\t\t\t\t\/\/ rounded-ness for lid\n\n\nmodule walls_of_box(\n\t\t\tfattener=fatten_for_lid_cut,\n\t\t\tlongside=bigbox, \n\t\t\tbigboxht=bigboxht, \n\t\t\twallthick=sides,\n\t\t\tledhole=ledhole,\n\t\t\tcornerad=cornerad,\n\t\t\tholeside=holeside,\n\t\t\tinsiders_x=bigbox - sides*3 - cornerad*2,\n\t\t\tinsiders_y=ledhole - cornerad,\t\t\/\/ inner-wall corner radius is hard-coded at 1\/2 of outer\n\t\t\t){\n\techo(\"longside = \", longside);\n\techo(\"insiders_x = \", insiders_x);\n\techo(\"insiders_y = \", insiders_y);\n\tdifference(){\n\t\tminkowski(){\n\t\t\tsquare([longside - cornerad*2, holeside - cornerad*2], center=true);\n\t\t\tcircle(r=cornerad-fattener, $fn=36);\n\t\t}\n\t\tfor(block=[[small_chamber*insiders_x - fattener*2, fattener\/2], \n\t\t\t\t\t[big_chamber*insiders_x - fattener*2, 28-fattener\/2]]){\n\t\t\techo(\"block[0] = \", block[0]);\n\t\t\ttranslate([-longside\/2+(wallthick+fattener\/2)*2+block[0]\/2 + block[1], 0, 0]){\n\t\t\t\tminkowski(){\n\t\t\t\t\tsquare([block[0], holeside - cornerad - sides*2 - fattener*2], center=true);\n\t\t\t\t\tcircle(r=cornerad\/2, $fn=36);\n\t\t\t\t}\n\t\t\t\t\/\/ this square is just here to show the light-path\n\t\t\t\t#square([block[0], slit_width], center=true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule growbox(to_height=bigboxht, slit_width=slit_width, fatboy=0){\n\tdifference(){\n\t\tlinear_extrude(height = to_height, center = true, convexity = 10, twist = 0, slices = to_height*2, scale = 1){\n\t\t\twalls_of_box(fattener=fatboy);\n\t\t}\n\t\tcube([bigbox-sides*2-cornerad, slit_width, to_height - 10], center=true);\n\t\tfor (i=[-bigbox\/2, bigbox\/2]){\n\t\t\ttranslate([i,0,0]) rotate([0,90,0])\n\t\t\t#cylinder(r=ledhole\/2, h=sides*3, center=true, $fn=128);\n\t\t}\n\t}\n}\n\nmodule lids_on_it (overhang=lid_puff, basethick=lid_lad, with_cuvt=1){\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube([bigbox, holeside, basethick], center=true);\n\t\t\tsphere(r=overhang\/2, center=true, $fn=64);\n\t\t}\n\t\t\/\/ imprint the base of the walls and cuvette on a lid-like-structure\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tgrowbox(fatboy=.2);\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([cuvtt_inside+.5, cuvtt_inside+.5, bigboxht], center=true);\n\t\t\/\/ an extra cut to ensure the lid doesn't obscure the cuvett:\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([bigbox-sides*4, slit_width-.1, bigboxht], center=true);\n\t}\n}\n\n\ntranslate([0,holeside+lid_puff+2,(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=1);\ntranslate([0,-(holeside+lid_puff+2),(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=0);\ntranslate([0,0,bigboxht\/2])\n\tgrowbox();\n\n\n\n\n","old_contents":"bigbox = 80;\t\t\t\t\t\t\/\/ old box was 70?\nbigboxht = 55;\t\t\t\t\t\t\/\/ up from 50\nfatten_for_lid_cut=.0;\t\t\t\t\/\/ test fit lids: if more than .6 needed, bad geometry or print\nsides = 2;\t\t\t\t\t\t\t\/\/ skinny, assumes some further light-stopping material\/paint\nledhole=15;\t\nholeside=ledhole + sides*2 + 10;\t\/\/ accomodate lense assembly\ncornerad=4;\t\t\t\t\t\t\/\/ used with minkowski(), cornerad*2 + 4-flat-sides = perimeter\nsmall_chamber = 1\/3;\t\t\t\t\/\/ total of chambers' ratios should == 1\nbig_chamber = 2\/3;\t\t\t\t\/\/ chambers can be swapped\nslit_width = 5;\t\t\t\t\t\t\/\/ mm\ncuvtt_inside = 12;\nlid_lad = 7;\nlid_puff = 4;\n\n\nmodule walls_of_box(\n\t\t\tfattener=fatten_for_lid_cut,\n\t\t\tlongside=bigbox, \n\t\t\tbigboxht=bigboxht, \n\t\t\twallthick=sides,\n\t\t\tledhole=ledhole,\n\t\t\tcornerad=cornerad,\n\t\t\tholeside=holeside,\n\t\t\tinsiders_x=bigbox - sides*3 - cornerad*2,\n\t\t\tinsiders_y=ledhole - cornerad,\t\t\/\/ inner-wall corner radius is hard-coded at 1\/2 of outer\n\t\t\t){\n\techo(\"longside = \", longside);\n\techo(\"insiders_x = \", insiders_x);\n\techo(\"insiders_y = \", insiders_y);\n\tdifference(){\n\t\tminkowski(){\n\t\t\tsquare([longside - cornerad*2, holeside - cornerad*2], center=true);\n\t\t\tcircle(r=cornerad-fattener, $fn=36);\n\t\t}\n\t\tfor(block=[[small_chamber*insiders_x - fattener*2, fattener\/2], \n\t\t\t\t\t[big_chamber*insiders_x - fattener*2, 28-fattener\/2]]){\n\t\t\techo(\"block[0] = \", block[0]);\n\t\t\ttranslate([-longside\/2+(wallthick+fattener\/2)*2+block[0]\/2 + block[1], 0, 0]){\n\t\t\t\tminkowski(){\n\t\t\t\t\tsquare([block[0], holeside - cornerad - sides*2 - fattener*2], center=true);\n\t\t\t\t\tcircle(r=cornerad\/2, $fn=36);\n\t\t\t\t}\n\t\t\t\t\/\/ this square is just here to show the light-path\n\t\t\t\t#square([block[0], slit_width], center=true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule growbox(to_height=bigboxht, slit_width=slit_width, fatboy=0){\n\tdifference(){\n\t\tlinear_extrude(height = to_height, center = true, convexity = 10, twist = 0, slices = to_height*2, scale = 1){\n\t\t\twalls_of_box(fattener=fatboy);\n\t\t}\n\t\tcube([bigbox-sides*2-cornerad, slit_width, to_height - 10], center=true);\n\t\tfor (i=[-bigbox\/2, bigbox\/2]){\n\t\t\ttranslate([i,0,0]) rotate([0,90,0])\n\t\t\t#cylinder(r=ledhole\/2, h=sides*3, center=true, $fn=128);\n\t\t}\n\t}\n}\n\nmodule lids_on_it (overhang=lid_puff, basethick=lid_lad, with_cuvt=1){\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube([bigbox, holeside, basethick], center=true);\n\t\t\tsphere(r=overhang\/2, center=true, $fn=64);\n\t\t}\n\t\t\/\/ imprint the base of the walls and cuvette on a lid-like-structure\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tgrowbox(fatboy=.2);\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([cuvtt_inside+.5, cuvtt_inside+.5, bigboxht], center=true);\n\t\t\/\/ an extra cut to ensure the lid doesn't obscure the cuvett:\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([bigbox-sides*4, slit_width-.1, bigboxht], center=true);\n\t}\n}\n\n\ntranslate([0,holeside+lid_puff+2,(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=1);\ntranslate([0,-(holeside+lid_puff+2),(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=0);\ntranslate([0,0,bigboxht\/2])\n\tgrowbox();\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3d7b7eeb33935e4f8c09c0939bd35f057314647f","subject":"added edge to kite roller, so that string does not snap on edges of fins","message":"added edge to kite roller, so that string does not snap on edges of fins\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/detail\/kite_roller.scad","new_file":"kite_roller\/detail\/kite_roller.scad","new_contents":"use <..\/m3d\/screw_head_hex.scad>\n\neps = 0.01;\n\nmodule screw_head() { screw_head_hex_m8(); }\nmodule screw_head_slot(dh=0) { screw_head_hex_m8(0.5, 2*0.2+dh); }\n\n\nmodule side_block(left)\n{\n module fin()\n {\n translate(-0.5*[1, 2, 0])\n hull()\n {\n cube([1, 2, 5]);\n for(dx=[-1,+1])\n translate(dx*(120\/2-1\/2)*[1,0,0])\n cube([1, 2, 2]);\n }\n }\n\n direction = left ? -1 : +1;\n dx_offset = direction * 80\/2;\n module core_body()\n {\n \/\/ bottom part + edge around it\n difference()\n {\n $fn=360;\n cylinder(d=120+0.1, h=5+3);\n translate([0,0,5])\n cylinder(d=120-1.5, h=5);\n }\n cylinder(d=30, h=5+25, $fn=100);\n \/\/ spherical slot around screw head\n translate([dx_offset, 0, 5])\n intersection()\n {\n scale([1,1,0.5])\n sphere(d=30, $fn=100);\n translate([-20, -20, 0])\n cube([40, 40, 6]);\n }\n \/\/ fins\n translate([0,0,5])\n for(r=[0:20:180])\n rotate([0, 0, r])\n fin();\n }\n\n difference()\n {\n core_body();\n \/\/ screw slot\n translate([dx_offset, 0, -eps])\n {\n translate([0,0,5])\n {\n screw_head_slot(0.5);\n %screw_head();\n }\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n }\n \/\/ screw holes in the center block part\n {\n offset = 7;\n h = 10;\n \/\/ top\n translate([0, offset, -eps])\n {\n cylinder(d1=10, d2=7, h=h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n \/\/ bottom\n translate([0, -offset, -eps])\n {\n screw_head_hex_m3(0.5, h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n }\n\n \/\/ asymetric cut, to connect 2 parts with friction\n translate([-20, 0, 5+25-10+eps])\n cube([40, 40, 10]);\n }\n}\n\n\nside_block(left=false);\n","old_contents":"use <..\/m3d\/screw_head_hex.scad>\n\neps = 0.01;\n\nmodule screw_head() { screw_head_hex_m8(); }\nmodule screw_head_slot(dh=0) { screw_head_hex_m8(0.5, 2*0.2+dh); }\n\n\nmodule side_block(left)\n{\n module fin()\n {\n translate(-0.5*[1, 2, 0])\n hull()\n {\n cube([1, 2, 5]);\n for(dx=[-1,+1])\n translate(dx*(120\/2-1\/2)*[1,0,0])\n cube([1, 2, 2]);\n }\n }\n\n direction = left ? -1 : +1;\n dx_offset = direction * 80\/2;\n module core_body()\n {\n cylinder(d=120, h=5, $fn=360);\n cylinder(d=30, h=5+25, $fn=100);\n \/\/ spherical slot around screw head\n translate([dx_offset, 0, 5])\n intersection()\n {\n scale([1,1,0.5])\n sphere(d=30, $fn=100);\n translate([-20, -20, 0])\n cube([40, 40, 6]);\n }\n \/\/ fins\n translate([0,0,5])\n for(r=[0:20:180])\n rotate([0, 0, r])\n fin();\n }\n\n difference()\n {\n core_body();\n \/\/ screw slot\n translate([dx_offset, 0, -eps])\n {\n translate([0,0,5])\n {\n screw_head_slot(0.5);\n %screw_head();\n }\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n }\n \/\/ screw holes in the center block part\n {\n offset = 7;\n h = 10;\n \/\/ top\n translate([0, offset, -eps])\n {\n cylinder(d1=10, d2=7, h=h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n \/\/ bottom\n translate([0, -offset, -eps])\n {\n screw_head_hex_m3(0.5, h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n }\n\n \/\/ asymetric cut, to connect 2 parts with friction\n translate([-20, 0, 5+25-10+eps])\n cube([40, 40, 10]);\n }\n}\n\n\nside_block(left=false);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dc4058af1b79b6f15c601e70658be994af7a9953","subject":"Updating the new effector for better integration of blowing fans and heat sink fans","message":"Updating the new effector for better integration of blowing fans and heat sink fans\n","repos":"tigertooth4\/Kossel-XL,tigertooth4\/Kossel-XL,tigertooth4\/Kossel-XL","old_file":"EffectorNew\/effectorNew.scad","new_file":"EffectorNew\/effectorNew.scad","new_contents":"\/\/use \n\/\/use \n\n\n$fn = 50;\nsqrt3 = 1.7321;\nroundness = 4;\nlongEdge = 62;\nshortEdge = longEdge * .4;\n\n\nm25ScrewRadius = 1.25;\nm25ScrewHeadRadius= 2.5;\n\nm4ScrewRadius = 2.0; \/\/for M4 bolt\nm4ScrewHeadRadius = 4.0; \nm4NutRadius = 4.3;\n\nm5NutRadius = 8\/sqrt3+0.2;\n\nm3ScrewRadius = 1.5; \/\/for M3 bolt\nm3ScrewHeadRadius = 3.0; \nm3NutRadius = 3.5; \/\/\n\nm2ScrewRadius = 1.0; \/\/for M4 bolt\nm2ScrewHeadRadius = 2.0; \nm2NutRadius = 2.3;\n\n\ncylinderMaxRadius = 7; \/\/ enough\ncylinderMinRadius = 3;\ncylinderHeight = 7.0;\n\n\nballSeperateDistance = 48.0;\nmountingHoleDistance = ballSeperateDistance - 30;\nballScrewRadius = 2.0;\nballJointAngle = 30;\nballJointRadius = 5;\nballBaseRadius = 3.5;\n\nbaseShapeRadius =(2*shortEdge + longEdge)\/3*sqrt3-roundness*2;\n\nupperScaleFactor=0.8;\nunderScaleFactor = 0.9;\nupperHeight = (1-upperScaleFactor)*longEdge\/sqrt3;\ndownHeight = (1-underScaleFactor)*longEdge\/sqrt(2);\nmiddleHeight = 2;\n\n\ngrooveHoleRadius = 18.5;\ngrooveMountScrewRadius = 13;\n\n\nmicroSwitchHolesDistance = 9.5;\n\n\npivotRadius = 7.5;\npivotFarback = -20;\ninnerPivotWidth = 0.3 * longEdge;\nouterPivotWidth = 0.15 * longEdge;\n\nerr = 0.4;\n\nmodule triangleShape (){\n minkowski(){\n\tintersection(){\n\t circle(r= baseShapeRadius,$fn=3); \/\/small one, 2\/3 shortEdge, 1\/3 longEdge \n\t rotate([0,0,180]) circle(r=(2*longEdge + shortEdge)\/3*sqrt3-roundness*2, $fn=3);\n\t}\n\tcircle( r= roundness);\t\n }\n}\n\nmodule pillar(){\n hull(){\n\ttranslate([0,0,5])cylinder(r= ballBaseRadius, h=1, center = true, $fn=20);\n\tcylinder (r=ballBaseRadius+1,h=1,center =true, $fn=20);\n }\n}\n\n\nmodule grooveShape(){\n difference(){\n\tcylinder(r=grooveHoleRadius, h=40, center = true);\n\ttranslate([-grooveHoleRadius+4-5, 0,0]) cube([10,grooveHoleRadius*2,40], center=true);}\n}\n\nRadiatorRadius = 20;\nRadiatorHeight = 30;\nGrooveMountRadius = 8;\n\nV6SinkHeight = 25;\nV6SinkRadius = 22.3\/2;\nproxSensor_x = 17.5;\nproxSensor_y = 17.5;\nproxSensor_z = 35;\n\n\nmodule V6Profile()\n{\n cylinder(r= V6SinkRadius+3, h=26);\n cylinder(r= 8, h= 34);\n cylinder(r= 6-0.1, h= 40);\n translate([0,0,39])cylinder(r= 8, h=6);\n \n}\n\n\nmodule lowerLayerShape(){\n difference(){\n\tunion(){\n\t \/\/lower Shape\n\t union(){\n\t\t\/\/ Draw the basic profile\n\t\tlinear_extrude(height= upperHeight,center = false,convexity=10,scale=upperScaleFactor\/1.05)\n\t\tscale([1.07,1.07,1])triangleShape();\n\t\t\n\t\ttranslate([0,0,-middleHeight]) linear_extrude(height= middleHeight,center = false)\n\t\tscale([1.07,1.07,1])\ttriangleShape();\n\t\t\n\t\ttranslate([0,0,-middleHeight]) rotate([180,0,0]) \n\t\tlinear_extrude(height=downHeight, center = false, scale=underScaleFactor*1.05)\n\t\tscale([1.07,1.07,1])\ttriangleShape();\n\t\t\n\t }\n\n\t \/\/ Draw Pillars for Ball Joints\n\t for (i=[30:120:270])\n\t for (j=[-1,1])\n\t translate ([j*cos(i)*ballSeperateDistance\/2, j*sin(i)*ballSeperateDistance\/2,0])\n\t translate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\t rotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) pillar(); \n\t \n\t}\n\t\/\/ screw holes\n\t\n\tfor (i=[30:120:270])\n\tfor (j=[-1,1])\n\ttranslate ([j*cos(i)*ballSeperateDistance\/2, j*sin(i)*ballSeperateDistance\/2,0])\n\ttranslate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\trotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) \n\t{\n\t cylinder(r=m4ScrewRadius, h=20, center = true);\n\t translate([0,0,-6]) cylinder(r=m4ScrewHeadRadius, h=12, center=true);\n\t}\n\t\n\t\/\/ Central Hole\n\ttranslate([0,0,-20 ])linear_extrude(height= 30) scale([0.67,0.67,1]) triangleShape();\n\t\n }\n \n}\n\nmodule upperPart_v2(){\n \n \/\/basic shape\n difference(){\n\tunion(){\n\t hull(){\n\t\tlinear_extrude(height= 2) scale([0.76, 0.76, 1])triangleShape();\n\t\tminkowski(){\n\t\t intersection(){\n\t\t\ttranslate([0,0, V6SinkHeight-5]) linear_extrude(height=3)\n\t\t\tscale([0.25, 0.25,1]) triangleShape();\n\t\t }\n\t\t cylinder(r=4, h=1,center=true);\n\t\t}\n\t\t\/\/ front screw support for holding the upper part\n\t\t\/\/ using two m2 screws\n\t\tfor(i=[-1,1])\n\t\ttranslate([25,i*14,0]) cylinder(r1=2, r2=1.6, h=5);\n\t }\n\t \/\/ print fans holding supports\n\t \/\/ print fans holding screws (m2)\n\n\t for(i=[-1])\n\t translate([3,-i*13.2,-5])\n\t rotate([0,0,i*8])\n\t rotate([i*5,0,0])\n\t translate([15,0,15])rotate([i*90,0,0])cylinder(r1=3, r2=2,h=5,center=true);\n\n\t}\n\t\n\t\n\t\/\/ prox sensor mount\n\ttranslate([V6SinkRadius + 3 + proxSensor_x\/2, 0, -10])\n\tminkowski(){\n\t cube([proxSensor_x, proxSensor_y, proxSensor_z], center=true);\n\t \/\/cylinder(r=2,h=5,center=true);\n\t sphere(r=1.5);\n\t}\n\t\n\t\/\/ Heat sink cooling fan\n\ttranslate([-18,0,12])\n\t\/\/rotate([0,90,0])\n\tminkowski(){\n\t hull(){\n\t\tcube([21,21,1],center=true);\n\t\ttranslate([-10,0,-20]) cube([35,31,1],center=true);\n\t }\n\t sphere(r=2);\n\t}\n\t\n\t\/\/ Print fans\n\tfor(i=[-1,1])\n\ttranslate([3,-i*19,-8])\n\trotate([0,0,i*8])\n\trotate([i*5,0,0])\n\tminkowski(){\n\t hull(){\n\t\tcube([32,1,40],center=true);\n\t\ttranslate([-4,-i*15,0]) cube([40,1,40], center=true);\n\t }\n\t sphere(r=3);\n\t}\n\t\n\t\/\/ Heat sink mount\n\ttranslate([0,0,-15])\tV6Profile();\n\n\n\t\n\t\/\/ m3 Screws\n\t\/\/ rare hold screw\n\ttranslate([-10, 0, 19])rotate([90,0,0])cylinder(r=m3ScrewRadius, h=40, center=true);\n\ttranslate([-10,16.5, 19])rotate([90,0,0])cylinder(r=m3NutRadius, h=5, center=true, $fn=6);\n\ttranslate([-10,-16.5,19])rotate([90,0,0])cylinder(r=m3ScrewHeadRadius, h=5,center=true);\n\t\n\t\/\/ front hold screw\n\ttranslate([11, 0, 19])rotate([90,0,0])cylinder(r=m3ScrewRadius, h=40, center=true);\n\ttranslate([11,12, 19])rotate([90,0,0])cylinder(r=m3NutRadius, h=5, center=true, $fn=6);\n\ttranslate([11,-12,19])rotate([90,0,0])cylinder(r=m3ScrewHeadRadius, h=5,center=true);\n\n\t\/\/ m2Screws to mount upper part to lower Basement\n\t\/\/ rare\n\tfor(i=[-1,1])\n\ttranslate([-20,i*20,0])\n\t{\n\t cylinder(r=m2ScrewRadius, h=40,center=true);\n\t translate([0,0,12])cylinder(r=m2ScrewHeadRadius, h=10, center=true);\n\t}\n\n\t\/\/ front\n\tfor(i=[-1,1])\n\ttranslate([25,i*14,0])\n\t{\n\t cylinder(r=m2ScrewRadius, h=40,center=true);\n\t translate([0,0,10])cylinder(r=m2ScrewHeadRadius, h=10, center=true);\n\t}\n\n\t\/\/ print fans holding screws (m2)\n\tfor(i=[-1,1])\n\ttranslate([3,-i*15,-5])\n\trotate([0,0,i*8])\n\trotate([i*5,0,0])\n\tfor(j=[-1,1])\n\ttranslate([15*j,0,15])rotate([90,0,0])cylinder(r=m2ScrewRadius,h=30,center=true);\n\n }\n\n \/\/ Sink cooling fan holding supports\n for(i=[-1,1])\n difference(){\n\ttranslate([-9,i*11,11])\n\trotate([0,90,0])\n\t\/\/ support thing\n\tminkowski(){\n\t cube([6,5,8],center=true);\n\t cylinder(r=2,h=2,center=true);\n\t}\n\t\/\/ screw holes\n\ttranslate([-15, i*10, 10])\n\trotate([0,90,0])\n\tcylinder(r=m2ScrewRadius, h= 20, center=true);\n\n\n\t\/\/ avoid the m2 screw for printing fans\n\tfor(j=[-1,1])\n\ttranslate([3,j*(-15),-5])\n\trotate([0,0,j*8])\n\trotate([j*5,0,0])\n\ttranslate([-15,0,15])rotate([90,0,0])cylinder(r=m2ScrewRadius,h=20, center=true);\n\n\t\/\/ avoid the heat sink\n\ttranslate([0,0,-15])\tV6Profile();\n\n\n }\n\n \/\/ Heat sink fan\n \n %translate([-20,0,0])\n minkowski(){\n\tcube([8,21,21],center=true);\n\trotate([0,90,0])\n\tcylinder(r=2, h=1, center=true);\n }\n \n \/\/ print fans\n \n %for(i=[-1,1])\n translate([3,-i*21,-5])\n rotate([0,0,i*8])\n rotate([i*5,0,0])\n minkowski(){\n\tcube([31,8,31], center= true);\n\trotate([90,0,0]) cylinder(r=2, h=1, center=true);\n }\n\n \/\/ for better adhesion\n for(i=[-1,1])\n translate([32,-i*10,0])cylinder(r=5,h=0.4);\n\n}\n\n\nmodule lowerPart_v2(){\n difference(){\n\tunion(){\n\t difference(){\n\t\tunion(){\n\t\t lowerLayerShape();\n\n\t\t \/\/ wind hole cover\n\t\t hull(){\n\t\t\tfor(i=[-1,2])\n\t\t\ttranslate([-25,i*8-4.5,1.5])\n\t\t\ttranslate([0,0,0])rotate([0,90,0])cylinder(r=4.5,h=17,center=true);\n\t\t\t\/\/ translate([0,0,-3.5])rotate([0,90,0])cylinder(r=2,h=20,center=true);\n\t\t }\n\n\t\t \/\/ side wind hole\n\t\t for(j=[-1,1])\n\t\t translate([10,0,0])\n\t\t intersection(){\n\t\t\thull(){\n\t\t\t for(i=[-2,1])\n\t\t\t translate([i*6,j*25,3])\n\t\t\t translate([0,0,-2.5])rotate([0,0,-j*15])rotate([90,0,0])\n\t\t\t cylinder(r=4.5,h=40,center=true);\n\t\t\t}\n\t\t\tcylinder(r1=62,r2=55, h=20,center=true, $fn=3);\n\t\t\tcylinder(r1=55,r2=62, h=20,center=true, $fn=3);\n\t\t\t\n\t\t }\n\n\n\t\t}\n\n\t\t\/\/ Central Hole\n\t\ttranslate([0,0,-20 ])linear_extrude(height= 30) scale([0.67,0.67,1]) triangleShape();\n\n\t\t\/\/ Heat sink fan\n\t\t\n\t\ttranslate([-20,0,0])\n\t\tminkowski(){\n\t\t cube([8,21,21],center=true);\n\t\t rotate([0,90,0])\n\t\t cylinder(r=3, h=3, center=true);\n\t\t}\n\t \n\t\t\/\/ print fans\n\t\t\n\t\tfor(i=[-1,1])\n\t\ttranslate([3,-i*18,-5])\n\t\trotate([0,0,i*8])\n\t\trotate([i*5,0,0])\n\t\tminkowski(){\n\t\t cube([33,12,31], center= true);\n\t\t \/\/rotate([90,0,0]) cylinder(r=3, h=3, center=true);\n\t\t sphere(r=2);\n\t\t}\n\t \n\t\t\/\/ prox sensor\n\t\ttranslate([V6SinkRadius + 4 + proxSensor_x\/2, 0, -10])\n\t\tminkowski(){\n\t\t cube([proxSensor_x, proxSensor_y, proxSensor_z], center=true);\n\t\t \/\/cylinder(r=2,h=5,center=true);\n\t\t sphere(r=1);\n\t\t}\n\n\n\t\t\/\/ wind holes\n\t\thull(){\n\t\t for(i=[-1,2])\n\t\t translate([-25,i*8-4.5,1.5])\n\t\t translate([0,0,0])rotate([0,90,0])cylinder(r=3,h=20,center=true);\n\t\t\/\/ translate([0,0,-3.5])rotate([0,90,0])cylinder(r=2,h=20,center=true);\n\t\t}\n\n\t\t\/\/ side holes\n\t\tfor(j=[-1,1])\n\t\ttranslate([10,0,0])\n\t\thull(){\n\t\t for(i=[-2,1])\n\t\t translate([i*6,j*25,3])\n\t\t translate([0,0,-2.5])rotate([0,0,-j*15])rotate([90,0,0])cylinder(r=3,h=35,center=true);\n\/\/\t\t translate([0,0,-3.5])rotate([90,0,-j*5])cylinder(r=1.5,h=35,center=true);\n\t\t}\n\n\t \n\t }\n\t\n\t \/\/ rare screw places for holding the upper part\n\t \/\/ use m2 screws\n\t for(i=[-1,1])\n\t translate([-20,i*20,4.565])\n\t cylinder(r1=2.5, r2=4, h=upperHeight-2, center=true);\n\t}\n\n\t\/\/ rare screw places for holding the upper part\n\t\/\/ use m2 screws\n\tfor(i=[-1,1])\n\ttranslate([-20,i*20,0])\n\t{\n\t cylinder(r=m2ScrewRadius, h=20, center=true);\n\t translate([0,0,-3])cylinder(r=m2NutRadius, h=10, center=true, $fn=6);\n\t}\n\n\t\/\/ front screw places for holding the upper part\n\t\/\/ use m2 screws\n\tfor(i=[-1,1])\n\ttranslate([25,i*14,0])\n\t{\n\t cylinder(r=m2ScrewRadius, h=40,center=true);\n\t translate([0,0,-3])cylinder(r=m2NutRadius, h=10, center=true, $fn=6);\n\t}\n\n\n } \n}\n\nmodule body()\n{\n difference(){\n\tunion(){\n\t lowerPart_v2();\n translate([0,0,upperHeight]) upperPart_v2();\n\t}\n }\n}\n\n\nmodule l_upperPart_v2(){\n intersection(){\n\tupperPart_v2();\n\ttranslate([0,40,0])cube([80,80,60],center=true);\n }\n}\n\n\nmodule r_upperPart_v2(){\n intersection(){\n\tupperPart_v2();\n\ttranslate([0,-40,0])cube([80,80,60],center=true);\n }\n}\n\n\/\/body();\n\/\/lowerPart_v2();\n\/\/translate([0,0,7])upperPart_v2();\n\n\/\/l_upperPart_v2();\n\nr_upperPart_v2();\n\n\/\/color(\"silver\") translate([-2,0,-27]) rotate([0,0,0])import(\".\/e3d-v6.stl\");\n\n\n","old_contents":"\/\/use \n\/\/use \n\n\n$fn = 50;\nsqrt3 = 1.7321;\nroundness = 4;\nlongEdge = 62;\nshortEdge = longEdge * .4;\n\n\nm25ScrewRadius = 1.25; \n\nm4ScrewRadius = 2.0; \/\/for M4 bolt\nm4ScrewHeadRadius = 4.0; \nm4NutRadius = 4.3;\n\nm5NutRadius = 8\/sqrt3+0.2;\n\nm3ScrewRadius = 1.5; \/\/for M3 bolt\nm3ScrewHeadRadius = 3.0; \nm3NutRadius = 3.5; \/\/\ncylinderMaxRadius = 7; \/\/ enough\ncylinderMinRadius = 3;\ncylinderHeight = 7.0;\n\n\nballSeperateDistance = 48.0;\nmountingHoleDistance = ballSeperateDistance - 30;\nballScrewRadius = 2.0;\nballJointAngle = 30;\nballJointRadius = 5;\nballBaseRadius = 3.5;\n\nbaseShapeRadius =(2*shortEdge + longEdge)\/3*sqrt3-roundness*2;\n\nupperScaleFactor=0.8;\nunderScaleFactor = 0.9;\nupperHeight = (1-upperScaleFactor)*longEdge\/sqrt3;\ndownHeight = (1-underScaleFactor)*longEdge\/sqrt(2);\nmiddleHeight = 2;\n\n\ngrooveHoleRadius = 18.5;\ngrooveMountScrewRadius = 13;\n\n\nmicroSwitchHolesDistance = 9.5;\n\n\npivotRadius = 7.5;\npivotFarback = -20;\ninnerPivotWidth = 0.3 * longEdge;\nouterPivotWidth = 0.15 * longEdge;\n\nerr = 0.4;\n\nmodule triangleShape (){\n minkowski(){\n\tintersection(){\n\t circle(r= baseShapeRadius,$fn=3); \/\/small one, 2\/3 shortEdge, 1\/3 longEdge \n\t rotate([0,0,180]) circle(r=(2*longEdge + shortEdge)\/3*sqrt3-roundness*2, $fn=3);\n\t}\n\tcircle( r= roundness);\t\n }\n}\n\nmodule pillar(){\n hull(){\n\ttranslate([0,0,5])cylinder(r= ballBaseRadius, h=1, center = true, $fn=20);\n\tcylinder (r=ballBaseRadius+1,h=1,center =true, $fn=20);\n }\n}\n\n\nmodule grooveShape(){\n difference(){\n\tcylinder(r=grooveHoleRadius, h=40, center = true);\n\ttranslate([-grooveHoleRadius+4-5, 0,0]) cube([10,grooveHoleRadius*2,40], center=true);}\n}\n\n\n\/\/ ----------------------------deprecated------------------------------------------\nmodule baseShape(){\n difference(){\n\tunion(){\n\t difference(){\n\t\tunion(){\n\t\t \/\/ Draw the basic profile\n\t\t linear_extrude(height= upperHeight,center = false,convexity=10,scale=upperScaleFactor) triangleShape();\n\t\t translate([0,0,-middleHeight]) linear_extrude(height= middleHeight,center = false) triangleShape();\n\t\t translate([0,0,-middleHeight]) rotate([180,0,0]) \n\t\t linear_extrude(height=downHeight, center = false, scale=underScaleFactor) triangleShape();\n\t\t}\n\t\t\/\/ then dig a shallow channel for pivot\n\t\ttranslate([-18,0,upperHeight+ pivotRadius -1]) \n\t\trotate([90,0,0]) cylinder(r=pivotRadius+2, h=innerPivotWidth+2*outerPivotWidth + 5, center=true); \n\t\t\n\t }\n\t \/\/ Draw the base pivots:\n\t translate([pivotFarback, -innerPivotWidth\/2, upperHeight+ pivotRadius-1]) \n\t rotate([90,0,0]) \n\t difference()\t{\n\t\thull(){\n\t\t cylinder(r= pivotRadius, h=outerPivotWidth, center=true);\n\t\t translate([-2,-pivotRadius-2,0]) \n\t\t cube([pivotRadius*2,2, outerPivotWidth], center = true);\n\t\t}\n\t\t\/\/ dig a m4 screw hole in the center\n\t\tcylinder(r= m3ScrewRadius, h=30, center = true);\n\t };\n\t \n\t translate([pivotFarback,innerPivotWidth\/2,upperHeight+ pivotRadius-1]) \n\t rotate([90,0,0]) \n\t difference()\t{\n\t\thull(){\n\t\t cylinder(r= pivotRadius, h=outerPivotWidth, center=true);\n\t\t translate([-2,-pivotRadius-2,0]) \n\t\t cube([pivotRadius*2,2, outerPivotWidth], center = true);\n\t\t}\n\t\t\/\/ dig a m4 screw hole in the center\n\t\tcylinder(r= m3ScrewRadius, h=30, center = true);\n\t };\n\t \n\t \/\/ Draw the pillar\n\t for (i=[30:120:270]) {\n\t\ttranslate ([cos(i)*ballSeperateDistance\/2, sin(i)*ballSeperateDistance\/2,0])\n\t\ttranslate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\t\trotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) pillar(); \n\t\t\n\t\ttranslate ([-cos(i)*ballSeperateDistance\/2, -sin(i)*ballSeperateDistance\/2,0])\n\t\ttranslate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\t\trotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) pillar();\n\t }\n\t \n\t \n\t \n\t}\n\t\/\/ Minus screw holes\n\t\n\tfor (i=[30:120:270]) {\n\t translate ([cos(i)*ballSeperateDistance\/2, sin(i)*ballSeperateDistance\/2,0])\n\t translate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\t rotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) \n\t union() {\n\t\tcylinder(r=m4ScrewRadius, h=20, center = true);\n\t\ttranslate([0,0,-6]) cylinder(r=m4ScrewHeadRadius, h=12, center=true);\n\t }\n\t \n\t \n\t translate ([-cos(i)*ballSeperateDistance\/2, -sin(i)*ballSeperateDistance\/2,0])\n\t translate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\t rotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) \t\t\t\t\t\t\n\t union() {\n\t\tcylinder(r=m4ScrewRadius, h=20, center = true);\n\t\ttranslate([0,0,-6]) cylinder(r=m4ScrewHeadRadius, h=12, center=true);\n\t }\n\t}\n\t\n\t\/\/ Minus groove HOLES\n\tscale([1.1,1.1,1])grooveShape();\n\t\n\t\/\/ Minus micro switch mount place\n\t\n\ttranslate([grooveHoleRadius +2,0, 0]) cube([8,24,upperHeight+middleHeight+downHeight+3],center=true);\n\t\/\/ Minus two holes for m2.5 screws\n\ttranslate([grooveHoleRadius +2, -microSwitchHolesDistance\/2, -2.3]) rotate([0,90,0]) cylinder(r=m25ScrewRadius, h=30,center=true);\n\ttranslate([grooveHoleRadius +2, microSwitchHolesDistance\/2, -2.3]) rotate([0,90,0]) cylinder(r=m25ScrewRadius, h=30,center=true);\n\ttranslate([grooveHoleRadius + 3, 0, -3.3]) rotate([0,0,90]) %microswitch();\n\t\n\t\/\/ Minus a pulling screw hole\n\ttranslate([longEdge*sqrt3\/3-7,0,-4]) cylinder(r=3.5, h=4,center=true);\n\ttranslate([longEdge*sqrt3\/3-7,0,0]) roundedBox([m3ScrewRadius*4, m3ScrewRadius*2.5,100], m3ScrewRadius, center=true);\n\t\n\t\n\t\/\/ Minus some preset holes for wires pass through\n\ttranslate([-longEdge*sqrt3\/3+10,0,0]) rotate([0,35,0]) roundedBox([m3ScrewRadius*3+1, m3ScrewRadius*5.5+1, 100], m3ScrewRadius, center=true);\n\t\n\t\/\/ Minus an inner channel to let the wire pass through for microSwitch\n\ttranslate([-2,0,-1]) difference() {\n\t cylinder(r=grooveHoleRadius + 7.5, h= 4,center=true);\n\t cylinder(r=grooveHoleRadius + 5, h=4, center=true);\n\t translate([50,0,0]) cube([100,20,5],center=true);\n\t}\n\ttranslate([-2,0,-2]) for (i=[45:45:315]) {\n\t rotate([0,0,-i]) translate([grooveHoleRadius+6.5,0,0]) cube([m3ScrewRadius*2.5, m3ScrewRadius*3, 6], center=true);}\n\t\n\t\/\/ Leave fans Mounting holes\n\t\n\tfor (i=[30:120:260]) {\n\t translate ([cos(i)*mountingHoleDistance\/2, sin(i)*mountingHoleDistance\/2,0])\n\t translate ([sin(i)*(ballSeperateDistance\/2+3), -cos(i)*(ballSeperateDistance\/2+3),0]) \n\t rotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) cylinder(r=m25ScrewRadius, h=30,center=true); \n\t \n\t translate ([-cos(i)*mountingHoleDistance\/2, -sin(i)*mountingHoleDistance\/2,0])\n\t translate ([sin(i)*(ballSeperateDistance\/2+3), -cos(i)*(ballSeperateDistance\/2+3),0]) \n\t rotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) cylinder(r=m25ScrewRadius, h=30,center=true); \n\t \n\t}\n\t\n\t\n\t\n\t\n\t\n }\n echo (\"Base Height =\", upperHeight+middleHeight+downHeight);\n}\n\n\nmodule fanCone(){\n difference(){\n\t\/\/ outer profile\n\thull(){\n\t minkowski(){\n\t\tcube([25-roundness*2,25-roundness*2,5],center=true);\n\t\tcylinder(r=roundness,h=1,center=true);\n\t }\n\t translate([0,10,-25])\n\t rotate([5,0,0])\n\t minkowski(){\n\t\tcube([24-roundness,15-roundness,1],center=true);\n\t\tcylinder(r=roundness\/2,h=1,center=true);\n\t }\n\t}\n }\n}\n\nmodule fanConeInner(){\n \/\/ inner profile\n hull(){\n\tminkowski(){\n\t cube([20-roundness*2,20-roundness*2,6],center=true);\n\t cylinder(r=roundness,h=1,center=true);\n\t}\n\ttranslate([0,10,-26])\n\trotate([5,0,0])\n\tminkowski(){\n\t cube([18-roundness,10-roundness,1],center=true);\n\t cylinder(r=roundness\/2,h=1,center=true);\n\t}\n }\n}\n\n\n\n\n\/\/**************************************** New **************************************************\nRadiatorRadius = 20;\nRadiatorHeight = 30;\nGrooveMountRadius = 8;\n\nV6SinkHeight = 25;\nV6SinkRadius = 22.3\/2;\nproxSensor_x = 17.5;\nproxSensor_y = 17.5;\nproxSensor_z = 35;\n\n\nmodule lowerLayerShape()\n{\n union(){\n\t\/\/ Draw the basic profile\n\tlinear_extrude(height= upperHeight,center = false,convexity=10,scale=upperScaleFactor)\n\ttriangleShape();\n\t\n\ttranslate([0,0,-middleHeight]) linear_extrude(height= middleHeight,center = false)\n\ttriangleShape();\n\t\n\ttranslate([0,0,-middleHeight]) rotate([180,0,0]) \n\tlinear_extrude(height=downHeight, center = false, scale=underScaleFactor)\n\ttriangleShape();\n\n }\n\n}\n \n\nmodule lowerLayer(){\n difference(){\n\tunion(){\n\t \/\/hull(){ \n\t\tlowerLayerShape();\n\t\t\/\/for(i=[0,1])mirror([0,i,0])rotate([0,0,-30])translate([0,baseShapeRadius*sqrt3\/3-10,0])rotate([70,0,0])\n\t\t\/\/cube([25,10,25],center=true);\n\t \/\/}\n\t \n\t \/\/ Draw Pillars for Ball Joints\n\t for (i=[30:120:270])\n\t for (j=[-1,1])\n\t translate ([j*cos(i)*ballSeperateDistance\/2, j*sin(i)*ballSeperateDistance\/2,0])\n\t translate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\t rotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) pillar(); \n\t \n\t}\n\t\/\/ screw holes\n\t\n\tfor (i=[30:120:270])\n\tfor (j=[-1,1])\n\ttranslate ([j*cos(i)*ballSeperateDistance\/2, j*sin(i)*ballSeperateDistance\/2,0])\n\ttranslate ([sin(i)*(baseShapeRadius\/2-roundness\/2), -cos(i)*(baseShapeRadius\/2-roundness\/2),0]) \n\trotate([cos(i)*ballJointAngle, sin(i)*ballJointAngle,0]) \n\t{\n\t cylinder(r=m4ScrewRadius, h=20, center = true);\n\t translate([0,0,-6]) cylinder(r=m4ScrewHeadRadius, h=12, center=true);\n\t}\n\n\t\/\/ Central Hole\n\ttranslate([0,0,-20 ])linear_extrude(height= 30) scale([0.67,0.67,1]) triangleShape();\n\n }\n\n}\n\n\n\n\nmodule V6Profile()\n{\n cylinder(r= V6SinkRadius+1.5, h=26);\n cylinder(r= 8, h= 34);\n cylinder(r= 6, h= 40);\n translate([0,0,39])cylinder(r= 8, h=6);\n \n}\n \nmodule upperLayer()\n{\n difference(){\n\t\/\/ Basic shape\n\tminkowski(){\n\t union(){\n\t\t\/\/ Heat Sink mount\n\t\ttranslate([0,0,8])\n\t\trotate([0,0,0])\n\t\tlinear_extrude(height=V6SinkHeight-10, scale=0.6) scale([0.35, 0.35, 1]) triangleShape();\n\t\t\n\t\t\n\t\tfor(i=[0:120:240])\n\t\trotate([0,0,i])\n\t\ttranslate([V6SinkRadius,0,0])\n\t\t{\n\t\t translate([0,0, V6SinkHeight\/3-2])cube([V6SinkRadius, V6SinkRadius*.7, V6SinkHeight\/3],center=true);\n\t\t hull(){\n\t\t\ttranslate([V6SinkRadius*0.5,0, V6SinkHeight\/3-2])cube([1, V6SinkRadius*.7, V6SinkHeight\/3],center=true);\n\t\t\ttranslate([18,0,.5]) cube([2, V6SinkRadius*.8, 1],center=true);\n\t\t }\n\t\t}\n\t\t\n\t }\n\t \n\t \/\/ smooth the profile\n\t cylinder( r=3.5, h=3);\n\t}\n\ttranslate([0,0,-14]) V6Profile();\n\n\t\/\/ Heat sink cooling fan\n\t\n }\n \n}\n\n\nmodule upperPart(){\n\n \/\/ prox sensor mount\n #translate([V6SinkRadius + proxSensor_x\/2, 0, -13])\n cube([proxSensor_x, proxSensor_y, proxSensor_z], center=true);\n\n difference(){\n\timport(\".\/upperLayer.stl\");\n\t\/\/ Heat sink cooling fan\n\t#translate([-16,0,-1])\n\trotate([0,90,0])\n\tminkowski(){\n\t cube([21,21,8],center=true);\n\t cylinder(r=2, h=1, center=true);\n\t}\n\n\t\/\/ Print fans\n\tfor(i=[-1,1])\n\t#rotate([0,0,i*120])\n\ttranslate([-30,0,-5])\n\trotate([0,75,0])\/\/-i*15])\n\tminkowski(){\n\t cube([31,31,8], center=true);\n\t cylinder(r=2, h=1, center=true);\n\t}\n }\n \n}\n \n\nmodule body()\n{\n difference(){\n\tunion(){\n\t lowerLayer();\n translate([0,0,upperHeight-4]) upperPart();\n\n\/\/\t for(i=[0,1])mirror([0,i,0])rotate([0,0,30])\n\/\/\t translate([0,-(baseShapeRadius+4)*sqrt3\/3,3])\n\/\/\t rotate([10,0,0])\n\/\/\t fanCone();\n\t}\n\n\n\t\/\/translate([0,0,-27.5])cylinder(r=grooveHoleRadius+5, h= 70, center=true);\n\t\/\/%translate([0,0,5])cylinder(r=10, h= 70, center=true);\n\t\n\n\/\/\ttranslate([-35,0,12])rotate([0,0,0]) \/\/fanCone();\n\/\/\tminkowski(){\n\/\/\t cube([50,25-roundness*2,25-roundness*2],center=true);\n\/\/\t rotate([0,90,0])cylinder(r=roundness, h=1,center=true);\n\/\/\t}\n\t\/\/ wind holes\n\t\/\/translate([18,0,25])\n\/\/\tfor(i=[-10:5:10])\n\/\/\ttranslate([25,i,12])\n\/\/\thull(){\n\/\/\t rotate([0,90,0])cylinder(r=1.1, h=40,center=true);\n\/\/\t translate([0,0,8-i*i*.03]) rotate([0,90,0])cylinder(r=1.1, h=40, center=true);\n\/\/\t}\n\t\n\/\/\tfor(i=[0,1])mirror([0,i,0])rotate([0,0,30])\n\/\/\ttranslate([0,-(baseShapeRadius+4)*sqrt3\/3,3])\n\/\/\trotate([10,0,0])\n\/\/\tfanConeInner();\n\n }\n}\n\n\n\/\/color(\"grey\")\n body();\n!upperLayer();\n\ncolor(\"silver\") translate([-2,0,-29]) rotate([0,0,0])import(\".\/e3d-v6.stl\");\n\n\/\/translate([100,0,0])\n\/\/baseShape();\n\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"c7a6dc6a558102ff97b681aeeef92392ca683b13","subject":"cleanup and mount extension by 1mm","message":"cleanup and mount extension by 1mm\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\n\/\/ model wheel\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\n\/\/ car base plate outline\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ base car\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer than rear\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) \/\/ extra lip around base\n difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft assembly\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ main gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks and tower\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks and tower\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\n\/\/ 3d printed platform to be attached to shock towers\nmodule platform() {\n\n color(\"black\") difference()\n {\n translate ([0, 0, 12+32+4])\n difference()\n {\n union()\n {\n\n \/\/ basic plate\n #linear_extrude(height = 3)\n difference()\n {\n intersection()\n {\n offset(-10) offset(30) offset(-20) \/\/ rounded corners\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n square(size=[162,200], center=true); \/\/ cut off extra length\n }\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) \/\/ rounded corners\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel around [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel around [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel around [45,35],\n [-31, 37], [-45, 20] \/\/ bevel around [-45,35]\n ]);\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) circle(d=5);\n #translate ([-45, 45, 0]) circle(d=5);\n #translate ([-35, -45, 0]) circle(d=5);\n #translate ([-35, 45, 0]) circle(d=5);\n }\n\n intersection()\n {\n #union()\n { \/\/ shock tower mount points\n\n \/\/ rear\n translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n\n translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }\n translate ([0, 0, 100]) cube(size=[200,200,200], center=true); \/\/ cut off bottom parts from all cylynders\n }\n }\n\n \/\/ local positioned cutouts\n\n \/\/ esc power wires\n #hull()\n {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull()\n {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull()\n {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.5, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.5, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \/\/ top thru hole\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \/\/ bottom hole for pins? or unused\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \/\/ top thru hole\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \/\/ bottom hole for pins? or unused\n }\n\n \/\/ global positioned coutouts\n\n \/\/ sonar mount hole cutouts\n #arrange(30)\n {\n mount_holes(center=true, right=1, left=1);\n mount_holes(center=true, right=0, left=1);\n mount_holes(center=true, right=0, left=1);\n mount_holes(center=true, right=1, left=0);\n mount_holes(center=true, right=1, left=0);\n }\n\n \/\/ cage hole cutout\n #cage(mode=1\/*cut*\/);\n\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n}\n\n\/\/ horizontal sonar mounting holes\nmodule mount_holes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\n\/\/ sonar mount bracket\nmodule mount() {\n\n extra = 7;\n top_r = 3;\n bottom_r = 5;\n\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n\n \/\/ front plate\n translate ([1.5, -48\/2, -extra])\n #union() {\n cube(size=[3, 48, 19+extra], center=false);\n translate ([0, top_r, 0]) cube(size=[3, 48-2*top_r, 19+extra+top_r], center=false);\n translate ([0, 48-top_r, 19+extra]) rotate([90, 0, 90]) cylinder(r=top_r, h=3, center=false);\n translate ([0, top_r, 19+extra]) rotate([90, 0, 90]) cylinder(r=top_r, h=3, center=false);\n }\n\n \/\/ hc-sr04 cutouts\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar holes\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtals holes - bot upside and downwards\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n \/\/ center cleanup\n translate ([3, 0, 10]) cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #union() {\n translate ([-3.5, -48\/2, -extra]) cube(size=[10-bottom_r, 48, 5], center=false);\n translate ([-3.5-bottom_r, -48\/2+5, -extra]) cube(size=[10, 48-2*bottom_r, 5], center=false);\n translate ([-3.5, -48\/2+5, -extra]) cylinder(r=bottom_r, h=5, center=false);\n translate ([-3.5, 48\/2-5, -extra]) cylinder(r=bottom_r, h=5, center=false);\n }\n mount_holes();\n }\n }\n}\n\n\/\/ horizantaly mounted sonar\nmodule horizontal_sonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n mount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/\/ horizantaly mounted sonar - mockup\nmodule vertical_sonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount bracket outline\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/\/ rounded box from p1 to p2, size (~diameter) s, rounding radius r\nmodule rounded_box(p1, p2, s=1, r=1) {\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n\n l1 = l+s-2*r;\n\n c = cross([0,0,1], b);\n\n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n\n o = s\/2-r;\n s1 = s-2*r;\n\n translate(p1)\n rotate([0, 0, -az])\n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l1], center=true);\n cube(size=[s, s1, l1], center=true);\n\n for (x=[o, -o])\n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l1, center=true);\n for (z=[l1\/2, -l1\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l1\/2, -l1\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true);\n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n\n }\n}\n\n\/\/ rounded cylindrical rod p1 to p2, diameter s\nmodule rod(p1, p2, s=1) {\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n\n c = cross([0,0,1], b);\n\n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n\n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n\n translate(p1)\n rotate([0, 0, -az])\n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\n\/\/ 8 balls of radius r, arranged in bounding box for rounded cybe of size s centered on p\nmodule ball8(p, s=1, r=1) {\n\n o = s\/2-r;\n\n translate(p)\n for (x=[o, -o])\n for (y=[o, -o])\n for (z=[o, -o])\n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\n\/\/ cage leg, from base p1 to top p2, size s, base size base_s, rounding radius s, mode - simple=2 or full otherwise\nmodule cage_leg(p1, p2, s, base_s, r, mode)\n{\n if (mode == 2 \/*simple*\/) {\n rod(p1, p2, s);\n }\n else {\n hull() {\n ball8(p2, s, r);\n translate([0, 0, -d\/2]) translate(p1) difference() { \/\/ halfsphere of d = base_s\n sphere(d=base_s, center=true);\n translate([0, 0, -base_s\/2]) cube(size=[base_s, base_s, base_s], center=true);\n }\n }\n }\n}\n\n\/\/ cage mount pin, from base p1 to below p1, size d (bit larger for cuts), pin diameter pd, pin heigh ph, mode - 1 for cutout\nmodule cage_pin(p1, p2, d, pd, ph, mode)\n{\n if (mode == 1 \/*cut*\/)\n {\n rod(p1, p2, d+0.5); \/\/ extra spacing\n }\n else \/\/ full or simple mode\n difference() {\n rod(p1, p2, d);\n\n #translate ([0,0,-ph])\n translate (p1)\n rotate([0,90,0])\n cylinder(d=pd, h=2*d, center=true); \/\/ pin hole\n }\n}\n\n\/\/ lcd mount bracket for cage\nmodule lcd_mount(p, x1, x2)\n{\n translate(p) difference() {\n #translate([(x1-x2)\/2,0,-1-0.5\/2]) cube(size=[x1+x2, 6, 2.5], center=true);\n #translate([0,0,-0.5]) screw2x6bore();\n }\n}\n\n\/\/ cage\nmodule cage(mode = 0)\n{\n \/\/ mode 0 - full, mode 1 - cutout for platform, 2 - simple full\n\n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements\n top = 82;\n\n top_side = 30;\n\n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front+26\/*esc size*\/;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n\n bottom = 51\/*platform top*\/+d\/2;\n\n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n\n mid = (top+bottom)\/2;\n mid_side = 15;\n mid_front = top_esc+10;\n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n mid_front_left = [mid_front, mid_side, mid];\n mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n\n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n\n \/\/ cage bars\n if (mode != 1 \/*cut*\/)\n {\n rounded_box(top_front_left, top_front_right, d, r1);\n rounded_box(top_rear_left, top_rear_right, d, r1);\n rounded_box(top_esc_left, top_rear_left, d, r1);\n rounded_box(top_esc_right, top_rear_right, d, r1);\n\n rounded_box(top_esc_left, top_esc_right, d, r1);\n rounded_box(top_lcd_left, top_lcd_right, d, r1);\n\n rod(mid_front_left, top_esc_left, d);\n rod(mid_front_right, top_esc_right, d);\n\n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5-0.5, 23.5\/2, top+d\/2], 2, 4);\n lcd_mount([top_rear+d\/2+2.5-0.5, -23.5\/2, top+d\/2], 2, 4);\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1, mode);\n cage_leg(bottom_front_right, top_front_right, d, db, r1, mode);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1, mode);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1, mode);\n\n \/\/ lcd lead protector\n translate([top_lcd+1,0,top-3]) cube(size=[2, 12, 6], center=true);\n translate([top_lcd+1,0,top-5]) cube(size=[2, 16, 2], center=true);\n }\n\n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, mode);\n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, mode);\n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, mode);\n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, mode);\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\n\/\/ arange sonars (or mount holes)\nmodule arrange(a) {\n translate ([68, 0, 58]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 58]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 58]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 58]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 58]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\n\/\/ whole car\nmodule car()\n{\n base();\n platform();\n board();\n arrange(30) horizontal_sonar();\n color(\"white\") cage(mode=2\/*simple*\/);\n translate ([33, -8, 79]) rotate([0, 0, 90]) esc();\n lcd();\n}\n\n\/\/car();\n\/\/cage();\n\/\/board();\n\/\/platform();\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) mount();\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/translate([0,0,90]) rotate([180,0,0]) cage();\n","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n #arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/ cage holes\n #cage(mode=1\/*cut*\/);\n\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule barbox(p1, p2, s=1, r=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n l1 = l+s-2*r;\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n o = s\/2-r;\n s1 = s-2*r;\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l1], center=true);\n cube(size=[s, s1, l1], center=true);\n\n for (x=[o, -o]) \n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l1, center=true);\n for (z=[l1\/2, -l1\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l1\/2, -l1\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true); \n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n \n }\n}\n\nmodule bar(p1, p2, s=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\nmodule ball8(p1, s=1, r=1) {\n\n o = s\/2-r;\n \n translate(p1) \n for (x=[o, -o]) \n for (y=[o, -o])\n for (z=[o, -o]) \n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\nmodule skew(p1, p2) { \/\/ TODO - not working\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n b = [a[0]\/a[2], a[1]\/a[2]];\n \n matrix = [\n [ 1, 0, b[1], 0 ],\n [ 0, 1, b[2], 0 ],\n [ 0, 0, 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n translate(p1) \n multmatrix(matrix) \n children();\n}\n\nmodule cage_leg(p1, p2, d, db, r, mode)\n{\n if (mode == 2) {\n bar(p1, p2, d); \n }\n else { \n hull() {\n ball8(p2, d, r);\n translate([0, 0, -d\/2]) translate(p1) difference() {\n sphere(d=db, center=true);\n translate([0, 0, -db\/2]) cube(size=[db, db, db], center=true);\n }\n }\n }\n}\n\nmodule cage_pin(p1, p2, d, pd, ph, mode)\n{\n extra = mode == 1 \/*cut*\/ ? 0.5 : 0;\n\n if (mode == 1)\n {\n bar(p1, p2, d+extra); \n }\n else\n difference() {\n bar(p1, p2, d+extra); \n \n #translate ([0,0,-ph])\n translate (p1) \n rotate([0,90,0])\n cylinder(d=pd, h=2*d, center=true);\n } \n}\n\nmodule lcd_mount(p1, x1, x2)\n{\n translate(p1) difference() {\n #translate([(x1-x2)\/2,0,-1-0.5\/2]) cube(size=[x1+x2, 6, 2.5], center=true);\n #translate([0,0,-0.5]) screw2x6bore(); \n } \n}\n\nmodule cage(mode = 0)\n{\n \/\/ mode 0 - full, mode 1 - cutout for platform, 2 - simple full\n \n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements \n top = 82;\n \n top_side = 30;\n \n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front+26\/*esc size*\/;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n \n bottom = 51\/*platform top*\/+d\/2;\n \n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n \n mid = (top+bottom)\/2;\n mid_side = 15;\n mid_front = top_esc+10; \n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n mid_front_left = [mid_front, mid_side, mid];\n mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n \n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n \n \/\/ bars\n if (mode != 1 \/*cut*\/)\n {\n barbox(top_front_left, top_front_right, d, r1); \n barbox(top_rear_left, top_rear_right, d, r1); \n barbox(top_esc_left, top_rear_left, d, r1); \n barbox(top_esc_right, top_rear_right, d, r1); \n\n barbox(top_esc_left, top_esc_right, d, r1); \n barbox(top_lcd_left, top_lcd_right, d, r1);\n\n bar(mid_front_left, top_esc_left, d);\n bar(mid_front_right, top_esc_right, d);\n \n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5-0.5, 23.5\/2, top+d\/2], 2, 4);\n lcd_mount([top_rear+d\/2+2.5-0.5, -23.5\/2, top+d\/2], 2, 4);\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1, mode);\n cage_leg(bottom_front_right, top_front_right, d, db, r1, mode);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1, mode);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1, mode);\n \n \/\/ lcd lead protector\n translate([top_lcd+1,0,top-3]) cube(size=[2, 12, 6], center=true); \n translate([top_lcd+1,0,top-5]) cube(size=[2, 16, 2], center=true); \n }\n \n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, mode); \n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, mode); \n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, mode); \n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, mode); \n}\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage(mode=2\/*simple*\/);\n translate ([33, -8, 79]) rotate([0, 0, 90]) esc();\n lcd();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\nmodule full() {\n car();\n arrangebottom(30) hsonar();\n\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\nfull();\n\n\n\/\/barbox([0,0,0], [0,0,50], 10, 3);\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\n\/\/translate([0,0,90]) rotate([180,0,0]) cage();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"94bcd9dac0a9a92db1e672e063760e835f1ffae9","subject":"bigger rudders","message":"bigger rudders\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/Multirotors,DanNixon\/BubbleCopter","old_file":"Komachi\/config.scad","new_file":"Komachi\/config.scad","new_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0; \/\/For the JAS laser at Maker Space\n\/* MACHINE_TOLERANCE = 0.1; \/\/For most other lasers *\/\n\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* General *\/\nCORNER = 1;\nHALF_CORNER = CORNER \/ 2;\nSPACER_TAB_WIDTH_FACTOR = 0.35;\n\n\/* Base plate *\/\nBASE_DIMENSIONS = [180, 240];\nBASE_FRONT_CORNER_RADIUS = BASE_DIMENSIONS[0] \/ 2;\nBASE_REAR_CORNER_RADIUS = 30;\n\n\/* Lift fan duct mount *\/\nLIFT_FAN_DUCT_DIMENSIONS = [71, 28]; \/\/ [diameter, length]\nLIFT_FAN_DUCT_MOUNT_PADDING = 30;\nLIFT_FAN_DUCT_POSITION = [0, (BASE_DIMENSIONS[1] \/ 2) - LIFT_FAN_DUCT_DIMENSIONS[0]];\nLIFT_FAN_DUCT_MOUNT_SPACING = 18;\nLIFT_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\n\n\/* Thrust fan duct mount *\/\nTHRUST_FAN_DUCT_DIMENSIONS = [74.5, 48]; \/\/ [diameter, length]\nTHRUST_FAN_DUCT_HEIGHT = 60;\nTHRUST_FAN_DUCT_MOUNT_PADDING = 30;\nTHRUST_FAN_DUCT_MOUNT_POSITION = [0, -40];\nTHRUST_FAN_DUCT_MOUNT_SPACING = THRUST_FAN_DUCT_DIMENSIONS[1] - 8;\nTHRUST_FAN_DUCT_MOUNT_WIDTH = BASE_DIMENSIONS[0] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\nTHRUST_FAN_DUCT_MOUNT_TAB_POSITIONS = [-THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4, 0, THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4];\nTHRUST_FAN_DUCT_MOUNT_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_DIM = [25, THRUST_FAN_DUCT_HEIGHT * 0.95];\nTHRUST_FAN_DUCT_MOUNT_BRACE_SPACING = THRUST_FAN_DUCT_MOUNT_WIDTH * 0.7;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[1] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_WIDTH = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.75;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.5;\n\n\/* Rudder *\/\nRUDDER_DIMENSIONS = [40, THRUST_FAN_DUCT_DIMENSIONS[0] * 0.9];\nRUDDER_CORNER_RADIUS = 2;\nRUDDER_PIVOT_LENGTH = 10;\nRUDDER_SPACING = THRUST_FAN_DUCT_DIMENSIONS[0] * 0.6;\nRUDDER_ARM_HOLE_POSITION = [-4, -RUDDER_DIMENSIONS[1] * 0.45];\nRUDDER_ARM_HOLE_DIAM = 2;\n\n\/* Rudder mount *\/\nRUDDER_MOUNT_DIMENSIONS = [THRUST_FAN_DUCT_DIMENSIONS[0] * 0.8, 10];\nRUDDER_MOUNT_CORNER_RADIUS = 5;\nRUDDER_MOUNT_OFFSET = (RUDDER_DIMENSIONS[1] \/ 2) + MATERIAL_THICKNESS;\nRUDDER_MOUNT_TAB_WIDTH = 5;\nRUDDER_MOUNT_TAB_OFFSET = (RUDDER_MOUNT_DIMENSIONS[0] - RUDDER_MOUNT_TAB_WIDTH) \/ 2;\nRUDDER_MOUNT_TAB_LENGTH = MATERIAL_THICKNESS + 6;\n\n\/* Skirt clamp *\/\nSKIRT_CLAMP_PADDING = 10;\nSKIRT_CLAMP_HOLE_DIAM = 3;\n\n\/* Lower skirt mount *\/\nLOWER_SKIRT_MOUNT_SCALE = 0.6;\n","old_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0; \/\/For the JAS laser at Maker Space\n\/* MACHINE_TOLERANCE = 0.1; \/\/For most other lasers *\/\n\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* General *\/\nCORNER = 1;\nHALF_CORNER = CORNER \/ 2;\nSPACER_TAB_WIDTH_FACTOR = 0.35;\n\n\/* Base plate *\/\nBASE_DIMENSIONS = [180, 240];\nBASE_FRONT_CORNER_RADIUS = BASE_DIMENSIONS[0] \/ 2;\nBASE_REAR_CORNER_RADIUS = 30;\n\n\/* Lift fan duct mount *\/\nLIFT_FAN_DUCT_DIMENSIONS = [71, 28]; \/\/ [diameter, length]\nLIFT_FAN_DUCT_MOUNT_PADDING = 30;\nLIFT_FAN_DUCT_POSITION = [0, (BASE_DIMENSIONS[1] \/ 2) - LIFT_FAN_DUCT_DIMENSIONS[0]];\nLIFT_FAN_DUCT_MOUNT_SPACING = 18;\nLIFT_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\n\n\/* Thrust fan duct mount *\/\nTHRUST_FAN_DUCT_DIMENSIONS = [74.5, 48]; \/\/ [diameter, length]\nTHRUST_FAN_DUCT_HEIGHT = 60;\nTHRUST_FAN_DUCT_MOUNT_PADDING = 30;\nTHRUST_FAN_DUCT_MOUNT_POSITION = [0, -40];\nTHRUST_FAN_DUCT_MOUNT_SPACING = THRUST_FAN_DUCT_DIMENSIONS[1] - 8;\nTHRUST_FAN_DUCT_MOUNT_WIDTH = BASE_DIMENSIONS[0] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\nTHRUST_FAN_DUCT_MOUNT_TAB_POSITIONS = [-THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4, 0, THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4];\nTHRUST_FAN_DUCT_MOUNT_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_DIM = [25, THRUST_FAN_DUCT_HEIGHT * 0.95];\nTHRUST_FAN_DUCT_MOUNT_BRACE_SPACING = THRUST_FAN_DUCT_MOUNT_WIDTH * 0.7;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[1] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_WIDTH = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.75;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.5;\n\n\/* Rudder *\/\nRUDDER_DIMENSIONS = [30, THRUST_FAN_DUCT_DIMENSIONS[0] * 0.9];\nRUDDER_CORNER_RADIUS = 2;\nRUDDER_PIVOT_LENGTH = 10;\nRUDDER_SPACING = THRUST_FAN_DUCT_DIMENSIONS[0] * 0.475;\nRUDDER_ARM_HOLE_POSITION = [RUDDER_DIMENSIONS[0] * 0.2, -RUDDER_DIMENSIONS[1] * 0.45];\nRUDDER_ARM_HOLE_DIAM = 2;\n\n\/* Rudder mount *\/\nRUDDER_MOUNT_DIMENSIONS = [THRUST_FAN_DUCT_DIMENSIONS[0] * 0.8, 10];\nRUDDER_MOUNT_CORNER_RADIUS = 5;\nRUDDER_MOUNT_OFFSET = (RUDDER_DIMENSIONS[1] \/ 2) + MATERIAL_THICKNESS;\nRUDDER_MOUNT_TAB_WIDTH = 5;\nRUDDER_MOUNT_TAB_OFFSET = (RUDDER_MOUNT_DIMENSIONS[0] - RUDDER_MOUNT_TAB_WIDTH) \/ 2;\nRUDDER_MOUNT_TAB_LENGTH = MATERIAL_THICKNESS + 6;\n\n\/* Skirt clamp *\/\nSKIRT_CLAMP_PADDING = 10;\nSKIRT_CLAMP_HOLE_DIAM = 3;\n\n\/* Lower skirt mount *\/\nLOWER_SKIRT_MOUNT_SCALE = 0.6;\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"df3e4c60402820350ea09c018142e82bb2c2b74c","subject":"gantry\/lower\/connector: fix front screw position","message":"gantry\/lower\/connector: fix front screw position\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"gantry-lower-connector.scad","new_file":"gantry-lower-connector.scad","new_contents":"include \ninclude \ninclude \n\nmodule gantry_lower_connector()\n{\n thick = gantry_connector_thickness;\n width = extrusion_size+thick;\n depth = extrusion_size*2;\n height = main_lower_dist_z+extrusion_size;\n translate([thick,0,0])\n difference()\n {\n material(Mat_Plastic)\n union()\n {\n \/\/ top\/bottom\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n rcubea([width,extrusion_size*2,thick], align=[-1,0,z], extra_size=[0,thick,0], extra_align=[0,-1,0]);\n\n \/\/ side\n rcubea([thick,depth,height+thick], align=[-1,0,0], extra_size=[0,thick,0], extra_align=[0,-1,0]);\n\n \/\/ front\n translate([0,-depth\/2,0])\n rcubea([width,thick,height+thick], align=[-1,-1,0]);\n\n }\n\n \/\/ side nuts\n for(z=[-1,1])\n translate([0,extrusion_size\/2,z*main_lower_dist_z\/2])\n screw_cut(nut=extrusion_nut, head=\"button\", h=thick+.1, with_nut=false, orient=[-1,0,0], align=[-1,0,0]);\n\n \/\/ side end nuts\n for(z=[-1,1])\n translate([0,-extrusion_size\/2,z*main_lower_dist_z\/2])\n screw_cut(nut=extrusion_end_nut, head=\"button\", h=thick+.1, with_nut=false, orient=[-1,0,0], align=[-1,0,0]);\n\n \/\/ front nuts\n for(z=[-1,1])\n translate([-width\/2-thick\/2,-extrusion_size-thick,z*main_lower_dist_z\/2])\n screw_cut(nut=extrusion_nut, head=\"button\", h=thick+.1, with_nut=false, orient=Y, align=Y);\n }\n}\n\nmodule part_gantry_lower_connector()\n{\n \/*rotate([0,90,0])*\/\n rotate([90,0,0])\n gantry_lower_connector();\n}\n\n\/*gantry_lower_connector();*\/\n","old_contents":"include \ninclude \ninclude \n\nmodule gantry_lower_connector()\n{\n thick = gantry_connector_thickness;\n width = extrusion_size+thick;\n depth = extrusion_size*2;\n height = main_lower_dist_z+extrusion_size;\n translate([thick,0,0])\n difference()\n {\n material(Mat_Plastic)\n union()\n {\n \/\/ top\/bottom\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n rcubea([width,extrusion_size*2,thick], align=[-1,0,z], extra_size=[0,thick,0], extra_align=[0,-1,0]);\n\n \/\/ side\n rcubea([thick,depth,height+thick], align=[-1,0,0], extra_size=[0,thick,0], extra_align=[0,-1,0]);\n\n \/\/ front\n translate([0,-depth\/2,0])\n rcubea([width,thick,height+thick], align=[-1,-1,0]);\n\n }\n\n \/\/ side nuts\n for(z=[-1,1])\n translate([0,extrusion_size\/2,z*main_lower_dist_z\/2])\n screw_cut(nut=extrusion_nut, head=\"button\", h=thick+.1, with_nut=false, orient=[-1,0,0], align=[-1,0,0]);\n\n \/\/ side end nuts\n for(z=[-1,1])\n translate([0,-extrusion_size\/2,z*main_lower_dist_z\/2])\n screw_cut(nut=extrusion_end_nut, head=\"button\", h=thick+.1, with_nut=false, orient=[-1,0,0], align=[-1,0,0]);\n\n \/\/ front nuts\n for(z=[-1,1])\n translate([-width\/2-thick,-extrusion_size-thick,z*main_lower_dist_z\/2])\n screw_cut(nut=extrusion_nut, head=\"button\", h=thick+.1, with_nut=false, orient=Y, align=Y);\n }\n}\n\nmodule part_gantry_lower_connector()\n{\n \/*rotate([0,90,0])*\/\n rotate([90,0,0])\n gantry_lower_connector();\n}\n\n\/*gantry_lower_connector();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e727f8444021868488814e7ec0cb048a1183c736","subject":"Add some pieces to attach to the lines","message":"Add some pieces to attach to the lines\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/mobile_support.scad","new_file":"Hardware\/mobile_support.scad","new_contents":"width = 97; \/\/ External width (except clipping mechanism)\nheight = 146; \/\/ External height (except clipping mechanism)\ncorner_radius = 14; \/\/ Round corner at the bottom corners\ntop_width = 114; \/\/ Clipping mechanism width\ntop_height = 20; \/\/ Clipping mechanism height\nthickness = 5; \/\/ Thickness\nclip_height = 14;\n\n\/\/Main pocket\ndifference()\n{\n\tunion(){\n\t\tcube(size = [width,height,thickness], center = true);\n\t\tdifference(){\n\t\t\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n\t\t}\n\t\tdifference(){\n\t\t\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([width\/2+5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([width\/2+1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n}\n\t}\n\tcube(size = [width-20,height-24,thickness], center = true);\n}\n\n\/\/ Existing top clip\n\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\n\nclip_width = width +20;\n\/\/ Top clip support\ndifference(){\n\ttranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Top clip\ndifference()\n{\n\ttranslate([-clip_height\/2-1, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([-clip_height\/2-1, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([-clip_height\/2-1, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Bottom clip support\ndifference(){\n\ttranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\/\/ Bottom clip\ndifference(){\n translate([clip_height\/2+1, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([clip_height\/2+1, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([clip_height\/2+1, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\nmodule tender()\n{\ndifference(){\n\tcube(size=[20, 40, thickness], center=true);\n\ttranslate([2, 0, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, 1, 0]) rotate([0,0, -20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0+2, 12, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, 12+1, 0]) rotate([0,0, -20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0+2, -12, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, -12-1, 0]) rotate([0,0, 20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0-5, -6, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\n\t}\n}\ntranslate([clip_width\/4-2,clip_width\/4,0]) tender();\ntranslate([clip_width\/4-2,-clip_width\/4,0]) tender();\ntranslate([-clip_width\/4+2,-clip_width\/4,0]) tender();\ntranslate([-clip_width\/4+2,clip_width\/4,0]) tender();\n\n\n\n","old_contents":"width = 97; \/\/ External width (except clipping mechanism)\nheight = 146; \/\/ External height (except clipping mechanism)\ncorner_radius = 14; \/\/ Round corner at the bottom corners\ntop_width = 114; \/\/ Clipping mechanism width\ntop_height = 20; \/\/ Clipping mechanism height\nthickness = 5; \/\/ Thickness\nclip_height = 14;\n\n\/\/Main pocket\ndifference()\n{\n\tunion(){\n\t\tcube(size = [width,height,thickness], center = true);\n\t\tdifference(){\n\t\t\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n\t\t}\n\t\tdifference(){\n\t\t\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([width\/2+5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([width\/2+1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n}\n\t}\n\tcube(size = [width-20,height-24,thickness], center = true);\n}\n\n\/\/ Existing top clip\n\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\n\nclip_width = width +20;\n\/\/ Top clip support\ndifference(){\n\ttranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Top clip\ndifference()\n{\n\ttranslate([-clip_height, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([-clip_height, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([-clip_height, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Bottom clip support\ndifference(){\n\ttranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\/\/ Bottom clip\ndifference(){\n translate([clip_height, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([clip_height, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([clip_height, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"efc749db35666271e72547ba32f7b246bb6a2bd7","subject":"y\/motor-mount: use material system","message":"y\/motor-mount: use material system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-motor-mount.scad","new_file":"y-motor-mount.scad","new_contents":"use \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n cylindera(h=height, d=3*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=Z);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=X);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=X);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=N, orient=X);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,8*mm])\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount(show_motor=false);\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","old_contents":"use \nuse \nuse \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n cylindera(h=height, d=3*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=Z);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=X);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=X);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=N, orient=X);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,8*mm])\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount(show_motor=false);\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e75a7d6371b52642c384fa0d78f0de66465eb5f8","subject":"New shape for screw_hole_cap() module.","message":"New shape for screw_hole_cap() module.\n","repos":"RigacciOrg\/ProTherm,RigacciOrg\/ProTherm,RigacciOrg\/ProTherm","old_file":"case\/scad\/protherm-enclosure.scad","new_file":"case\/scad\/protherm-enclosure.scad","new_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.2;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.25;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=1, h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Bush-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 3.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.0;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.5;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n","old_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.2;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.25;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=1, h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular cable grommet with chamfer.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([-cut_length, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([-cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n pin_radius = thick * 1;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n size = (d * 4) + (pin_radius * 2);\n translate([-size + d + (pin_radius * 2), -d - (pin_radius * 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) {\n rounded_cube(size, size, thick, thick);\n }\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size - pin_radius, size - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners and required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Bush-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Add mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 3.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(h) {\n diameter = 6.5;\n screw_diameter = 2.5;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, h, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, h, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, h, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, h, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(h) {\n diameter = 6.0;\n screw_diameter = 2.0;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, h, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, h, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, h, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, h, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.5;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b44f7dc55ca4f4524ac39b0a78e62a8af30878d3","subject":"pulley: use material module","message":"pulley: use material module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"pulley.scad","new_file":"pulley.scad","new_contents":"include \ninclude \nuse \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, U, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nfunction pulley_height(pulley) = pulley[1]==U?pulley[0]:pulley[1];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=N, orient = Z)\n{\n is_idler = pulley[1] == U;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?U:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=N, orient = Z)\n{\n material(Mat_Aluminium)\n size_align(size=[outer_d, outer_d, full_h==U?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==U?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n cylindera(d = outer_d, h = walls, align=Z, orient=Z);\n\n translate(N)\n cylindera(d = inner_d, h = h, align=Z, orient=Z);\n\n translate([0,0,h-walls])\n cylindera(d = outer_d, h = walls, align=Z, orient=Z);\n\n translate([0,0,h])\n if(!is_idler)\n {\n cylindera(d = outer_d, h = full_h-h, align=Z, orient=Z);\n }\n }\n translate([0,0,-.1])\n cylindera(d = bore, h = full_h+.2, align=Z, orient=Z);\n }\n }\n}\n\nif(false)\n{\n \/*pulley(pulley_2GT_20T_idler, align=Z, orient=Z);*\/\n pulley(pulley_2GT_20T, align=Z, orient=-Z, flip=false);\n \/*pulley(pulley_2GT_20T, align=-Z, orient=Z, flip=false);*\/\n}\n","old_contents":"include \nuse \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, U, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nfunction pulley_height(pulley) = pulley[1]==U?pulley[0]:pulley[1];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=N, orient = Z)\n{\n is_idler = pulley[1] == U;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?U:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=N, orient = Z)\n{\n size_align(size=[outer_d, outer_d, full_h==U?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==U?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n cylindera(d = outer_d, h = walls, align=Z, orient=Z);\n\n translate(N)\n cylindera(d = inner_d, h = h, align=Z, orient=Z);\n\n translate([0,0,h-walls])\n cylindera(d = outer_d, h = walls, align=Z, orient=Z);\n\n translate([0,0,h])\n if(!is_idler)\n {\n cylindera(d = outer_d, h = full_h-h, align=Z, orient=Z);\n }\n }\n translate([0,0,-.1])\n cylindera(d = bore, h = full_h+.2, align=Z, orient=Z);\n }\n }\n}\n\nif(false)\n{\n \/*pulley(pulley_2GT_20T_idler, align=Z, orient=Z);*\/\n pulley(pulley_2GT_20T, align=Z, orient=-Z, flip=false);\n \/*pulley(pulley_2GT_20T, align=-Z, orient=Z, flip=false);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9c4e26718d3f70c752538797d30e5e77b0627715","subject":"The beginning of support for iPhone 6 plus...","message":"The beginning of support for iPhone 6 plus...\n","repos":"oscarxie\/tapsterbot,jackskalitzky\/tapsterbot,hugs\/tapsterbot,jackskalitzky\/tapsterbot","old_file":"hardware\/tapster-2-plus\/scad\/base.scad","new_file":"hardware\/tapster-2-plus\/scad\/base.scad","new_contents":"\/\/ Description: Tapster Base Plate - plus sized for iPhone and Note 4\n\/\/ Project home: http:\/\/tapsterbot.com\n\nbeam_width = 8;\nhole_diameter = 5.2;\nhole_radius = hole_diameter \/ 2;\n\nmodule beam(number_of_holes) {\n beam_length = number_of_holes * 8;\n for (x=[beam_width\/2 : beam_width*1 : beam_length]) {\n translate([x-4,beam_width\/2-4,-2])\n cylinder(r=hole_radius, h=12, $fn=30);\n }\n}\n\nmodule joint(){\n translate([-20.5,-85-13,-4])\n cube([5,9.1,12]);\n\n translate([15.5,-85-13,-4])\n cube([5,9.1,12]);\n\n translate([0,-beam_width*11.5,-10])\n cylinder(r=hole_radius, h=25, $fn=30);\n}\n\n\/\/ Uncomment 'projection' to create 2D (DXF-able) version\nprojection(cut=true, center=true) {\ndifference(){\n cylinder(r=beam_width*14, h=4, $fn=6);\n \/\/cylinder(r=beam_width*11+2, h=4, $fn=30);\n\n joint();\n\t\n rotate(120)\n joint();\n\n rotate(240)\n joint();\n\n box();\n}\n}\n\nmodule box(){\n translate([-beam_width*5,-beam_width*10+4,-2])\n beam(11);\n\n translate([-beam_width*5,beam_width*11+4,-2])\n beam(11);\n\n rotate(90)\n translate([-beam_width*9+4,beam_width*6,-2])\n beam(20);\n\n rotate(90)\n translate([-beam_width*9+4,-beam_width*6,-2])\n beam(20);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/tapster-2-plus\/scad\/base.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"a8131cdbb08e4debf7e0dae238d6afbfe31a732a","subject":"Reverting ideas from #22","message":"Reverting ideas from #22\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n tslots=[], tslot_holes=[], \n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n tslots=tslots, tslot_holes=tslot_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n tslots=[], tslot_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(tslots != undef) for (t = [0:1:len(tslots)-1]) \n {\n tslot(tslots[t][0], tslots[t][1], tslots[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(tslot_holes != undef) for (t = [0:1:len(tslot_holes)-1]) \n {\n tslotHoles(tslot_holes[t][0], tslot_holes[t][1], tslot_holes[t][2], thickness);\n }\n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(tslots)\n echo(str(\"[LC] , tslots = \", tslots));\n if(tslot_holes)\n echo(str(\"[LC] , tslot_holes = \", tslot_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule tslotHoles(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x-thickness*2,y-thickness,0]) rotate([0,0,0]) translate([0-thickness,0+thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2-thickness,-thickness+thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n {\n \n kerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n kerfMove = (p > 0) ? kerf\/4 : 0;\n \n i=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n \n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n {\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\n\/\/ tslot(tslots[t][0], tslots[t][1], tslots[t][2], thickness);\nmodule tslot(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness*3\/2,0,0]) \n union ()\n { \n difference ()\n {\n\t\t\tcube([thickness*3, thickness*3, thickness]); \n\t\t\ttranslate([thickness, thickness, -thickness]) cube([thickness, thickness, thickness*3]); \n\t\t}\n }\n}\n\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"bf2fb7beeb04662b3964786036254da33de48363","subject":"bearings\/linear: add linear_bearing_mount (zip ties)","message":"bearings\/linear: add linear_bearing_mount (zip ties)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule linear_bearing(bearing, part, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n t = offset_flange ? -Z*flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(bearing=bearing, part=\"pos\", align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(bearing=bearing, part=\"neg\", align=align, orient=orient, offset_flange=offset_flange);\n }\n\n }\n else if(part==\"pos\")\n translate(t)\n size_align(size=s, align=align, orient=orient)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n translate(t)\n size_align(size=s, align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, align=N, orient=Z, ziptie_dist=U, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n bearing_ID = get(LinearBearingInnerDiameter, bearing);\n bearing_OD = get(LinearBearingOuterDiameter, bearing);\n bearing_L = get(LinearBearingLength, bearing);\n\n h = fallback(override_h, bearing_L) + extra_h;\n size_align(size=[bearing_OD,bearing_OD,h], align=align ,orient=orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_L*tolerance, d=bearing_OD*tolerance, orient=Z);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_OD+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_ID+2*mm, h=100, orient=Z);\n\n if($show_vit)\n {\n %linear_bearing(bearing=bearing);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_OD+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule linear_bearing(bearing, part, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n t = offset_flange ? -Z*flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(bearing=bearing, part=\"pos\", align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(bearing=bearing, part=\"neg\", align=align, orient=orient, offset_flange=offset_flange);\n }\n\n }\n else if(part==\"pos\")\n translate(t)\n size_align(size=s, align=align, orient=orient)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n translate(t)\n size_align(size=s, align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n }\n }\n}\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n linear_bearing(bearing=bearing, align=Z);\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"378ae8ae7468710215dda49ae0efcde79b088807","subject":"removed read code and added 2x elements printing at once","message":"removed read code and added 2x elements printing at once\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/kite_roller.scad","new_file":"kite_roller\/kite_roller.scad","new_contents":"use \n\neps = 0.01;\n\nmodule screw_head() { screw_head_hex_m8(); }\nmodule screw_head_slot(dh=0) { screw_head_hex_m8(0.5, 2*0.2+dh); }\n\n\nmodule side_block()\n{\n module fin()\n {\n translate(-0.5*[1, 2, 0])\n hull()\n {\n cube([1, 2, 5]);\n for(dx=[-1,+1])\n translate(dx*(120\/2-1\/2)*[1,0,0])\n cube([1, 2, 2]);\n }\n }\n\n dx_offset = 80\/2;\n module core_body()\n {\n cylinder(d=120, h=5, $fn=360);\n cylinder(d=30, h=5+25, $fn=100);\n \/\/ spherical slot around screw head\n translate([dx_offset, 0, 5])\n intersection()\n {\n scale([1,1,0.5])\n sphere(d=30, $fn=100);\n translate([-20, -20, 0])\n cube([40, 40, 6]);\n }\n \/\/ fins\n translate([0,0,5])\n for(r=[0:20:180])\n rotate([0, 0, r])\n fin();\n }\n\n difference()\n {\n core_body();\n \/\/ screw slot\n translate([dx_offset, 0, -eps])\n {\n translate([0,0,5])\n {\n screw_head_slot(0.5);\n %screw_head();\n }\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n }\n \/\/ screw holes in the center block part\n {\n offset = 7;\n h = 10;\n \/\/ top\n translate([0, offset, -eps])\n {\n cylinder(d1=10, d2=7, h=h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n \/\/ bottom\n translate([0, -offset, -eps])\n {\n screw_head_hex_m3(0.5, h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n\n }\n\n \/\/ asymetric cut, to connect 2 parts with friction\n translate([-20, 0, 5+25-10+eps])\n cube([40, 40, 10]);\n }\n}\n\n\nfor(i=[0:1])\n translate(i*[125, 0, 0])\n side_block();\n","old_contents":"use \n\neps = 0.01;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule screw_head() { screw_head_hex_m8(); }\nmodule screw_head_slot(dh=0) { screw_head_hex_m8(0.5, 2*0.2+dh); }\n\n\nmodule washer(dh=0)\n{\n difference()\n {\n cylinder(d=15.5, h=1.4+dh);\n translate(eps*[0,0,-1])\n cylinder(d=8.5, h=1.4+dh+2*eps);\n }\n}\n\n\n\/\/ slot for ball bearing + 2 washers\nmodule bearing_slot()\n{\n d_spacing = 0.5;\n h_spacing = 0.2;\n cylinder(d=22+d_spacing, h=7+h_spacing, $fn=150);\n\n for(dh=[-1.4, 7+h_spacing])\n translate([0,0,dh])\n washer();\n}\n\n\nmodule side_block()\n{\n module fin()\n {\n translate(-0.5*[1, 2, 0])\n hull()\n {\n cube([1, 2, 5]);\n for(dx=[-1,+1])\n translate(dx*(120\/2-1\/2)*[1,0,0])\n cube([1, 2, 2]);\n }\n }\n\n dx_offset = 80\/2;\n module core_body()\n {\n cylinder(d=120, h=5, $fn=360);\n cylinder(d=30, h=5+25, $fn=100);\n \/\/ spherical slot around screw head\n translate([dx_offset, 0, 5])\n intersection()\n {\n scale([1,1,0.5])\n sphere(d=30, $fn=100);\n translate([-20, -20, 0])\n cube([40, 40, 6]);\n }\n \/\/ fins\n translate([0,0,5])\n for(r=[0:20:180])\n rotate([0, 0, r])\n fin();\n }\n\n difference()\n {\n core_body();\n \/\/ screw slot\n translate([dx_offset, 0, -eps])\n {\n translate([0,0,5])\n {\n screw_head_slot(0.5);\n %screw_head();\n }\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n }\n \/\/ screw holes in the center block part\n {\n offset = 7;\n h = 10;\n \/\/ top\n translate([0, offset, -eps])\n {\n cylinder(d1=10, d2=7, h=h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n \/\/ bottom\n translate([0, -offset, -eps])\n {\n screw_head_hex_m3(0.5, h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n\n }\n\n \/\/ asymetric cut, to connect 2 parts with friction\n translate([-20, 0, 5+25-10+eps])\n cube([40, 40, 10]);\n }\n}\n\n\nside_block();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"40b6e48cc41210c0f41563d2bde9aaa9b57be907","subject":"extruder: Remove echo","message":"extruder: Remove echo\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"extruder-direct.scad","new_file":"extruder-direct.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 5*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 22*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -9*mm;\nmotor_offset_y = 38*mm;\nmotor_offset_z = -pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-2,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 5*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 22*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -9*mm;\nmotor_offset_y = 38*mm;\nmotor_offset_z = -pythag_leg(motor_offset_y,gears_distance);\necho(motor_offset_z);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-2,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7f33aa67cd1662d9148fe1356f3ec8dcfbcb6017","subject":"[3d] USB pillars fix for interferrence with Pi PCB, locklip_p thickness increase, others","message":"[3d] USB pillars fix for interferrence with Pi PCB, locklip_p thickness increase, others\n\n-- Pi PCB was interferring with the USB pillar reinforcements on the\nbottom\n-- Increase locklip_p bar thickness to WALL to allow a more solid fill\n-- Reduce top negative body inset chamfer, this didn't seem to make any\ndifference in warping and takes longer \/ more material to print.\n-- Add vertical internal body corner fillets to the top two corners to\nlet them get filled while printing. Bottom two need to be square still.\n-- Reduce length of front guide lip to prevent possible interference\nwith mcu socket if overextruded.\n\nBody is 0.5mm deeper now (d = d + 0.5)\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/* [Advanced] *\/\n\/\/ Thickness of side walls\nwall = 3;\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t]) cube([w,17,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34-wall+1);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/* [Advanced] *\/\n\/\/ Thickness of side walls\nwall = 3;\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t,lcd_mount_t,lcd_mount_t,lcd_mount_t]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex+1, 2, h_b]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex+1, 2.5, h_b]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex+1, 3, h_b]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34-wall+1);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"158381cf7c28a1cf6cd942ea32757fdc3904fabf","subject":"[3d] Increase led_fudge 0.3 -> 0.4","message":"[3d] Increase led_fudge 0.3 -> 0.4\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Probe mono jack type (MJ1 is the smaller new one for 4.3.6)\nThermistorJack = 1; \/\/ [0:MJ-2508N,1:MJ1-2503A]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 2; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 2.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3+([0, 3.0][ThermistorJack]); \/\/ case is split along probe centerline on the probe side\ncase_split = 12.3; \/\/ and the case split on the other 3 sides (12.4 ideal?)\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.4; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1-([0, 3.0][ThermistorJack])]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Probe mono jack type (MJ1 is the smaller new one for 4.3.6)\nThermistorJack = 1; \/\/ [0:MJ-2508N,1:MJ1-2503A]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 2; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 2.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3+([0, 3.0][ThermistorJack]); \/\/ case is split along probe centerline on the probe side\ncase_split = 12.3; \/\/ and the case split on the other 3 sides (12.4 ideal?)\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1-([0, 3.0][ThermistorJack])]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ee5d56986b170050a424cf5eb8e79c730bc5b812","subject":"x\/carriage: Tweak extruder a cutouts","message":"x\/carriage: Tweak extruder a cutouts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3749c3942aade5c4c72f9a94a1564620381e3795","subject":"xaxis\/carriage: increase shaft cut dia","message":"xaxis\/carriage: increase shaft cut dia\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/2;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \ninclude \ninclude \n\ninclude \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/2;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=[0,1,-z]);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"937bb63143904efb16b413d61bb2d92e50c2f94a","subject":"x\/carriage: define parts","message":"x\/carriage: define parts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 22*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n \/*for(z=[-1,1])*\/\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*rotate([90,0,0])*\/\n \/*belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 22*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n \/*rotate([90,0,0])*\/\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n \/*for(z=[-1,1])*\/\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*rotate([90,0,0])*\/\n \/*belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ce39bc457bcc6b49cc1e396394de884053753076","subject":"misc: fix v_sum, add v_abs","message":"misc: fix v_sum, add v_abs\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b2112ecf5962ea6d7b8fc1006129b3baa6142d0a","subject":"todo: arm spacers and elbow screw holes","message":"todo: arm spacers and elbow screw holes\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"0ff8e3ec45630c48b51b85f6177a6a5861937a86","subject":"[scad] parameterize kube dimensions","message":"[scad] parameterize kube dimensions\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n*\/\n\nmagnet_h = 5;\nmagnet_r = 13.5;\nmagnet_t = 0.2;\n\nflk_h = 23.5;\nflk_w = 30.5;\nflk_t = 0.5;\n\nwall_w = 2;\n\nsupport_r = 5;\nsupport_h = outer_w - wall_w - flk_h;\n\ninner_w = flk_w + flk_t;\nouter_w = inner_w + 2*wall_w;\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(inner_w, inner_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\t\tcylinder(r=magnet_r + magnet_t, h=magnet_h);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nkube();","old_contents":"module kube()\n{\n\tdifference() {\n\t\tcube(35, 35, 35);\n\t\ttranslate([2, 2, 7]) {\n\t\t\tcube(31, 31, 28);\n\t\t}\n\t\ttranslate([17.5, 17.5, 2]) {\n\t\t\tcylinder(r=13.7, h=5);\t\/* r(magnet) = 13.5 *\/\n\t\t}\n\t}\n\n\ttranslate([17.5, 17.5, 2]) {\n\t\tcylinder(r=5, h=9.5);\n\t}\n}\n\nkube();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d5ea5bf00ab6391de81bc5d4e07443344dd0cc5e","subject":"finalized gantry cart big size","message":"finalized gantry cart big size\n","repos":"fponticelli\/smallbridges","old_file":"resin\/gantry_cart.scad","new_file":"resin\/gantry_cart.scad","new_contents":"include <..\/scad\/vslot_gantry_plate.scad>\ninclude <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\nuse <..\/scad\/shim.scad>\n\ngantry_cart_wheel_mid = 15.5;\n\nmodule gantry_cart_big(sections = 1, wheelstop = 2, wheelsbottom = 2) {\n wheels_top = [\n [],\n [[], [10], [ 9,11], [ 9,10,11]],\n [[], [ 7], [ 6, 8], [ 6, 7, 8]],\n [[], [ 4], [ 3, 5], [ 3, 4, 5]],\n [[], [ 1], [ 0, 2], [ 0, 1, 2]]\n ];\n wheels_bottom = [\n [],\n [[], [22], [21,23], [21,22,23]],\n [[], [19], [18,20], [18,19,20]],\n [[], [16], [15,17], [15,16,17]],\n [[], [13], [12,14], [12,13,14]]\n ];\n translate([0,0,vslot_gantry_plate_height\/2])\n vslot_gantry_plate_big(sections, wheelstop, wheelsbottom);\n translate([0,0,vslot_gantry_plate_height]) {\n for(s = wheels_top[sections][wheelstop]) {\n translate(vslot_gantry_plate_holes_big[s]) {\n ob_eccentric_spacer();\n translate([0,0,6.85]) {\n precision_shim_10x5x1();\n translate([0,0,ob_wheel_half_width])\n ob_solid_wheel();\n }\n }\n }\n for(s = wheels_bottom[sections][wheelsbottom]) {\n translate(vslot_gantry_plate_holes_big[s]) {\n ob_spacer(6.35);\n translate([0,0,6.85]) {\n precision_shim_10x5x1();\n translate([0,0,ob_wheel_half_width])\n ob_solid_wheel();\n }\n }\n }\n }\n}","old_contents":"include <..\/scad\/or_gantry_plate.scad>\ninclude <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\nuse <..\/scad\/shim.scad>\n\nmodule gantry_cart(mod = 1) {\n translate([0,0,or_gantry_plate_height\/2])\n or_gantry_plate(mod);\n eccentric_spacers = [[],[2,10]];\n spacers = [[],[1,9]];\n translate([0,0,or_gantry_plate_height]) {\n for(s = eccentric_spacers[mod])\n translate(or_gantry_plate_holes[mod][s][0]) {\n ob_eccentric_spacer();\n translate([0,0,6.85]) {\n precision_shim_10x5x1();\n translate([0,0,ob_wheel_half_width])\n ob_solid_wheel();\n }\n }\n for(s = spacers[mod])\n translate(or_gantry_plate_holes[mod][s][0]) {\n ob_spacer(6.35);\n translate([0,0,6.85]) {\n precision_shim_10x5x1();\n translate([0,0,ob_wheel_half_width])\n ob_solid_wheel();\n }\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"24e72cbc9a4bd15ad9435b4c3b139320ed7f7251","subject":"power_panel: define part","message":"power_panel: define part\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"power-panel-iec320.scad","new_file":"power-panel-iec320.scad","new_contents":"include \ninclude \ninclude \ninclude \n\/\/use \nuse \n\/*use *\/\n\n\/\/3 Pin IEC320 C14 Inlet Male Power Socket w Fuse Switch 10A 250V\n\/\/http:\/\/www.amazon.com\/IEC320-Inlet-Power-Socket-Switch\/dp\/B00511QVVK\n\/\/http:\/\/www.uxcell.com\/pin-iec320-c14-inlet-male-power-socket-fuse-switch-10a-250v-p-104813.html\n\n\/\/position X\/Y offset\nIEC_offset = [0,0];\n\n\/\/mounting width of IEC switch\/fuse\/socket\nIEC_width = 47*mm + .2*mm;\n\n\/\/mounting height of IEC switch\/fuse\/socket\nIEC_height = 27*mm + .2*mm;\n\n\/\/mounting flange depth of IEC switch\/fuse\/socket\nIEC_depth = 1;\n\n\/\/width of flange before returning to full panel thickness\nIEC_rim = 1.5;\n\n\/\/side length of the corner cutout on the IEC connect end of the power module\nIEC_corner = 6-.5;\n\npower_panel_iec320_width = IEC_width+15*mm;\npower_panel_iec320_height = main_lower_dist_z+extrusion_size;\npower_panel_iec320_thickness = 3.8*mm;\n\n\/\/horizontal distance from edge to mounting hole\npower_panel_iec320_hole_hedge_w = 5*mm;\n\n\/\/vertical spacing of mounting holes\npower_panel_iec320_hole_vspace = main_lower_dist_z;\n\nmount_hole_d = 5*mm;\n\nmodule power_panel_iec320(align=[0,0,0], orient=[0,0,-1])\n{\n s = [power_panel_iec320_width,power_panel_iec320_height,power_panel_iec320_thickness];\n size_align(size=s, align=align, orient=orient, orient_ref=[0,0,-1])\n rotate ([180,0,180])\n difference ()\n {\n \/\/power_panel_iec320\n rcubea(size=s);\n\n \/\/socket\n translate(v = [IEC_offset[0], IEC_offset[1], 0])\n difference()\n {\n union()\n {\n translate(v = [0, 0, -IEC_depth])\n cube(size = [IEC_width,IEC_height+IEC_rim*2,power_panel_iec320_thickness], center = true );\n cube(size = [IEC_width,IEC_height,power_panel_iec320_thickness+1], center = true);\n }\n for (x = [-1:2:1])\n translate([(IEC_width-IEC_corner)\/2, x*(IEC_height-IEC_corner)\/2,0])\n\n rotate([0,0,x*45])\n translate([0,-(IEC_width+IEC_height)\/2,-(power_panel_iec320_thickness+1)\/2])\n cube([IEC_width+IEC_height,IEC_width+IEC_height,power_panel_iec320_thickness+1]);\n }\n\n \/\/ extrusion mounting holes\n for (x = [-1,1])\n for (y = [-1,1])\n translate([x*(power_panel_iec320_width\/2-power_panel_iec320_hole_hedge_w-mount_hole_d\/2), y*(power_panel_iec320_hole_vspace\/2), -s[2]\/2])\n screw_cut(nut=extrusion_nut, screw_l=12*mm, with_nut=false, align=[0,0,1], orient=[0,0,1]);\n }\n}\n\nmodule part_power_panel_iec320()\n{\n power_panel_iec320() ;\n}\n\nif(false)\n{\n power_panel_iec320() ;\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\/\/use \nuse \n\/*use *\/\n\n\/\/3 Pin IEC320 C14 Inlet Male Power Socket w Fuse Switch 10A 250V\n\/\/http:\/\/www.amazon.com\/IEC320-Inlet-Power-Socket-Switch\/dp\/B00511QVVK\n\/\/http:\/\/www.uxcell.com\/pin-iec320-c14-inlet-male-power-socket-fuse-switch-10a-250v-p-104813.html\n\n\/\/position X\/Y offset\nIEC_offset = [0,0];\n\n\/\/mounting width of IEC switch\/fuse\/socket\nIEC_width = 47*mm + .2*mm;\n\n\/\/mounting height of IEC switch\/fuse\/socket\nIEC_height = 27*mm + .2*mm;\n\n\/\/mounting flange depth of IEC switch\/fuse\/socket\nIEC_depth = 1;\n\n\/\/width of flange before returning to full panel thickness\nIEC_rim = 1.5;\n\n\/\/side length of the corner cutout on the IEC connect end of the power module\nIEC_corner = 6-.5;\n\npower_panel_iec320_width = IEC_width+15*mm;\npower_panel_iec320_height = main_lower_dist_z+extrusion_size;\npower_panel_iec320_thickness = 3.8*mm;\n\n\/\/horizontal distance from edge to mounting hole\npower_panel_iec320_hole_hedge_w = 5*mm;\n\n\/\/vertical spacing of mounting holes\npower_panel_iec320_hole_vspace = main_lower_dist_z;\n\nmount_hole_d = 5*mm;\n\nmodule power_panel_iec320(align=[0,0,0], orient=[0,0,-1])\n{\n s = [power_panel_iec320_width,power_panel_iec320_height,power_panel_iec320_thickness];\n size_align(size=s, align=align, orient=orient, orient_ref=[0,0,-1])\n rotate ([180,0,180])\n difference ()\n {\n \/\/power_panel_iec320\n rcubea(size=s);\n\n \/\/socket\n translate(v = [IEC_offset[0], IEC_offset[1], 0])\n difference()\n {\n union()\n {\n translate(v = [0, 0, -IEC_depth])\n cube(size = [IEC_width,IEC_height+IEC_rim*2,power_panel_iec320_thickness], center = true );\n cube(size = [IEC_width,IEC_height,power_panel_iec320_thickness+1], center = true);\n }\n for (x = [-1:2:1])\n translate([(IEC_width-IEC_corner)\/2, x*(IEC_height-IEC_corner)\/2,0])\n\n rotate([0,0,x*45])\n translate([0,-(IEC_width+IEC_height)\/2,-(power_panel_iec320_thickness+1)\/2])\n cube([IEC_width+IEC_height,IEC_width+IEC_height,power_panel_iec320_thickness+1]);\n }\n\n \/\/ extrusion mounting holes\n for (x = [-1,1])\n for (y = [-1,1])\n translate([x*(power_panel_iec320_width\/2-power_panel_iec320_hole_hedge_w-mount_hole_d\/2), y*(power_panel_iec320_hole_vspace\/2), -s[2]\/2])\n screw_cut(nut=extrusion_nut, screw_l=12*mm, with_nut=false, align=[0,0,1], orient=[0,0,1]);\n }\n}\n\nif(false)\n{\n power_panel_iec320() ;\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4f07bdc9c21dd6d70f38304998dcf6f7dbe70368","subject":"stepper: add motor_outline","message":"stepper: add motor_outline\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"stepper.scad","new_file":"stepper.scad","new_contents":" \/\/ Some code from MCAD\/stepper.scad\n \/\/ Originally by Hans H\u00e4ggstr\u00f6m, 2010.\n \/\/ Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later\n\ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \n\n\/*test2();*\/\n\nmodule test()\n{\n for (size = AllNemaSizes)\n {\n ty(size*100)\n stack(axis=X, dist=100)\n {\n motor(model=Nema34, size=size, dual_axis=true);\n motor(model=Nema23, size=size, dual_axis=true);\n motor(model=Nema17, size=size, dual_axis=true);\n motor(model=Nema14, size=size, dual_axis=true);\n motor(model=Nema11, size=size, dual_axis=true);\n motor(model=Nema08, size=size, dual_axis=true);\n }\n }\n}\n\nmodule test2()\n{\n $show_vit=true;\n model = Nema17;\n size = NemaMedium;\n all_axes()\n color($color)\n translate(100*$axis)\n motor_mount(model=model, size=size, thickness=6*mm, dual_axis=true, orient=$axis);\n \/*motor(model=model, size=size, thickness=6*mm, dual_axis=true, orient=$axis);*\/\n}\n\nfunction motorWidth(model) = get(NemaSideSize, model);\nfunction motorLength(model, size=NemaMedium) = get(size, model);\n\nmodule motor_mount(part=U, model, thickness, size=NemaMedium, extra_size=U, dual_axis=false, orient=Z, align=N)\n{\n assert(model!=U, \"motor_mount(): model==U\");\n assert(thickness!=U, \"motor_mount(): thickness==U\");\n assert(size!=U, \"motor_mount(): size==U\");\n\n length = get(size, model);\n side = get(NemaSideSize, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n s=[side+fallback(extra_size.x,0), side+fallback(extra_size.y,0), length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n material(Mat_Plastic)\n render()\n difference()\n {\n motor_mount(part=\"pos\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n motor_mount(part=\"neg\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n\n if($show_vit)\n motor_mount(part=\"vit\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n else if(part==\"pos\")\n {\n rcubea([s.x,s.y,thickness], align=Z);\n }\n else if(part==\"neg\")\n {\n cylindera(h=thickness+.1, r=extrRad, align=Z, extra_h=.1, extra_align=-Z);\n\n \/\/ main motor\n tz(-s.z)\n cubea(size=[side+.3*mm,side+.3*mm,length], align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=thickness+.1, r=holeRadius, align=Z, extra_h=.1, extra_align=-Z);\n\n }\n else if(part==\"vit\")\n {\n motor(model=model, size=size, dual_axis=dual_axis);\n }\n}\n\nmodule motor_outline(part=U, model, length=5*mm, extra_side=0, orient=Z, align=N)\n{\n assert(model!=U, \"model == U\");\n assert(length!=U, \"length == U\");\n side = get(NemaSideSize, model) + extra_side;\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n roundR = get(NemaEdgeRoundingRadius, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n s=[side, side, length];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==U)\n {\n difference()\n {\n motor_outline(part=\"pos\", model=model, length=length, extra_side=extra_side);\n motor_outline(part=\"neg\", model=model, length=length, extra_side=extra_side);\n }\n motor_outline(part=\"vit\", model=model, length=length, extra_side=extra_side);\n }\n if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n \/*tz(-s.z)*\/\n cubea(s, align=N);\n }\n else if(part==\"neg\")\n {\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=N);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=N, extra_size=.1*N, extra_align=-N);\n }\n}\n\nmodule motor(part=U, model, size=NemaMedium, dual_axis=false, orient=Z, align=N)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n side = get(NemaSideSize, model);\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n holeDepth = get(NemaMountingHoleDepth, model);\n\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n s=[side, side, length];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==U)\n {\n difference()\n {\n motor(part=\"pos\", model=model, size=size, dual_axis=dual_axis);\n motor(part=\"neg\", model=model, size=size, dual_axis=dual_axis);\n }\n motor(part=\"vit\", model=model, size=size, dual_axis=dual_axis);\n\n motor_axle(model=model, size=size, dual_axis=dual_axis);\n }\n if(part==\"echo\")\n {\n echo(str(\" Motor: Nema\",get(NemaModel, model),\", length= \",length,\"mm, dual axis=\",dual_axis));\n }\n else if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n tz(-s.z)\n cubea(s, align=Z, extra_size=Z*extrSize, extra_align=Z);\n }\n else if(part==\"neg\")\n {\n \/\/ Axle hole\n material(Mat_Aluminium)\n cylindera(r=axleRadius+.2*mm, h=1000);\n\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=Z);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=Z, extra_size=.1*Z, extra_align=-Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=holeDepth+.1*mm, r=holeRadius, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ Grinded flat\n material(Mat_BlackPaint)\n difference()\n {\n cubea(size=[side+.1, side+.1, extrSize+.1], align=Z);\n cylindera(h=extrSize, r=extrRad, align=Z);\n }\n }\n}\n\nmodule motor_axle(model=Nema23, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n axleLengthFront = get(NemaFrontAxleLength, model);\n axleLengthBack = get(NemaBackAxleLength, model);\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n axleFlatDepth = get(NemaAxleFlatDepth, model);\n axleFlatLengthFront = get(NemaAxleFlatLengthFront, model);\n axleFlatLengthBack = get(NemaAxleFlatLengthBack, model);\n\n material(Mat_Steel)\n render()\n intersection()\n {\n material(Mat_Aluminium)\n tz(-length)\n cylindera(r=axleRadius, h=length+extrSize+axleLengthFront, align=Z, extra_h=dual_axis?axleLengthBack:0, extra_align=-Z);\n\n material(Mat_Aluminium)\n union()\n {\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthFront], align=Z);\n\n cubea(size=[2*axleRadius, 2*axleRadius, length+.4*mm], align=-Z, extra_size=Z*(extrSize+.4*mm), extra_align=Z);\n\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n tz(-length)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthBack], align=-Z);\n }\n }\n}\n\n","old_contents":" \/\/ Some code from MCAD\/stepper.scad\n \/\/ Originally by Hans H\u00e4ggstr\u00f6m, 2010.\n \/\/ Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later\n\ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \n\n\/*test2();*\/\n\nmodule test()\n{\n for (size = AllNemaSizes)\n {\n ty(size*100)\n stack(axis=X, dist=100)\n {\n motor(model=Nema34, size=size, dual_axis=true);\n motor(model=Nema23, size=size, dual_axis=true);\n motor(model=Nema17, size=size, dual_axis=true);\n motor(model=Nema14, size=size, dual_axis=true);\n motor(model=Nema11, size=size, dual_axis=true);\n motor(model=Nema08, size=size, dual_axis=true);\n }\n }\n}\n\nmodule test2()\n{\n $show_vit=true;\n model = Nema17;\n size = NemaMedium;\n all_axes()\n color($color)\n translate(100*$axis)\n motor_mount(model=model, size=size, thickness=6*mm, dual_axis=true, orient=$axis);\n \/*motor(model=model, size=size, thickness=6*mm, dual_axis=true, orient=$axis);*\/\n}\n\nfunction motorWidth(model) = get(NemaSideSize, model);\nfunction motorLength(model, size=NemaMedium) = get(size, model);\n\nmodule motor_mount(part=U, model, thickness, size=NemaMedium, extra_size=U, dual_axis=false, orient=Z, align=N)\n{\n assert(model!=U, \"motor_mount(): model==U\");\n assert(thickness!=U, \"motor_mount(): thickness==U\");\n assert(size!=U, \"motor_mount(): size==U\");\n\n length = get(size, model);\n side = get(NemaSideSize, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n s=[side+fallback(extra_size.x,0), side+fallback(extra_size.y,0), length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n material(Mat_Plastic)\n render()\n difference()\n {\n motor_mount(part=\"pos\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n motor_mount(part=\"neg\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n\n if($show_vit)\n motor_mount(part=\"vit\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n else if(part==\"pos\")\n {\n rcubea([s.x,s.y,thickness], align=Z);\n }\n else if(part==\"neg\")\n {\n cylindera(h=thickness+.1, r=extrRad, align=Z, extra_h=.1, extra_align=-Z);\n\n \/\/ main motor\n tz(-s.z)\n cubea(size=[side+.3*mm,side+.3*mm,length], align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=thickness+.1, r=holeRadius, align=Z, extra_h=.1, extra_align=-Z);\n\n }\n else if(part==\"vit\")\n {\n motor(model=model, size=size, dual_axis=dual_axis);\n }\n}\n\nmodule motor(part=U, model, size=NemaMedium, dual_axis=false, orient=Z, align=N)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n side = get(NemaSideSize, model);\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n holeDepth = get(NemaMountingHoleDepth, model);\n\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n mid = side \/ 2;\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n s=[side, side, length];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==U)\n {\n difference()\n {\n motor(part=\"pos\", model=model, size=size, dual_axis=dual_axis);\n motor(part=\"neg\", model=model, size=size, dual_axis=dual_axis);\n }\n motor(part=\"vit\", model=model, size=size, dual_axis=dual_axis);\n\n motor_axle(model=model, size=size, dual_axis=dual_axis);\n }\n if(part==\"echo\")\n {\n echo(str(\" Motor: Nema\",get(NemaModel, model),\", length= \",length,\"mm, dual axis=\",dual_axis));\n }\n else if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n tz(-s.z)\n cubea(s, align=Z, extra_size=Z*extrSize, extra_align=Z);\n }\n else if(part==\"neg\")\n {\n \/\/ Axle hole\n material(Mat_Aluminium)\n cylindera(r=axleRadius+.2*mm, h=1000);\n\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=Z);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=Z, extra_size=.1*Z, extra_align=-Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=holeDepth+.1*mm, r=holeRadius, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ Grinded flat\n material(Mat_BlackPaint)\n difference()\n {\n cubea(size=[side+.1, side+.1, extrSize+.1], align=Z);\n cylindera(h=extrSize, r=extrRad, align=Z);\n }\n }\n}\n\nmodule motor_axle(model=Nema23, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n axleLengthFront = get(NemaFrontAxleLength, model);\n axleLengthBack = get(NemaBackAxleLength, model);\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n axleFlatDepth = get(NemaAxleFlatDepth, model);\n axleFlatLengthFront = get(NemaAxleFlatLengthFront, model);\n axleFlatLengthBack = get(NemaAxleFlatLengthBack, model);\n\n material(Mat_Steel)\n render()\n intersection()\n {\n material(Mat_Aluminium)\n tz(-length)\n cylindera(r=axleRadius, h=length+extrSize+axleLengthFront, align=Z, extra_h=dual_axis?axleLengthBack:0, extra_align=-Z);\n\n material(Mat_Aluminium)\n union()\n {\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthFront], align=Z);\n\n cubea(size=[2*axleRadius, 2*axleRadius, length+.4*mm], align=-Z, extra_size=Z*(extrSize+.4*mm), extra_align=Z);\n\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n tz(-length)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthBack], align=-Z);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"23e3fd96e1f94b0593603fc62f69c99c4aad3d46","subject":"Getting started on a 3D model of a box for iotsa","message":"Getting started on a 3D model of a box for iotsa\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"extras\/iotsaCase.scad","new_file":"extras\/iotsaCase.scad","new_contents":"module iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n translate([0, 0, 2])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n union() {\n \/\/ The board\n difference() {\n cube([63,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-5, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\niotsaBoard();","old_contents":"","returncode":1,"stderr":"error: pathspec 'extras\/iotsaCase.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"270c68d11a15ebf324c82040892062884fcdc14c","subject":"x-ends: tweak bearing dist","message":"x-ends: tweak bearing dist\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"17c754dcc313dd22ab6bc167b29370155b67872e","subject":"pen holder part (shelf)","message":"pen holder part (shelf)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pen_shelf\/pen_shelf.scad","new_file":"pen_shelf\/pen_shelf.scad","new_contents":"$fn=30;\n\nmodule part()\n{\n \/\/ bottom part\n cube([250, 2*5+70+14-10\/2, 5]);\n \/\/ rounder corners\n hull()\n for(i=[0,1])\n translate([i*(250-10)+10\/2, 2*5+70+14-10\/2, 0])\n cylinder(r=10\/2, h=5);\n \/\/ mounts\n for(dx=[20, (250-30)\/2 , 250-20-30])\n {\n difference()\n {\n \/\/ towers\n union()\n {\n for(dy=[0, 14+5])\n translate([dx, dy, 0])\n cube([15, 5, 30]);\n }\n \/\/ drill holes\n translate([dx+15\/2, -1, 30-15\/2])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, 28);\n }\n }\n}\n\npart();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pen_shelf\/pen_shelf.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"3c2e61fab764cb591a0dd49c29a28b1f6d11f073","subject":"inner and outer pipes separated - need to process the connectors still","message":"inner and outer pipes separated - need to process the connectors still\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/launcher.scad","new_file":"pop_rocket\/launcher.scad","new_contents":"eps = 0.01;\nwall = 1.3;\n\nlaunch_side = 22;\nlaunch_h = 180;\n\nconn_phi = 25;\nconn_h = 20;\n\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangle_2d_int(side)\n{\n offset(r=-wall)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h, $fn=200)\n{\n cylinder(d=d, h=h);\n}\n\n\nmodule outer_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h)\n triangle_2d(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi, 20);\n \/\/ interconenction of both\n translate([-conn_phi\/2, -conn_phi, 0])\n cube([conn_phi, conn_phi, dz]);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h+2*eps)\n triangle_2d_int(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 20+eps);\n \/\/ interconenction of both\n \/*\n hull()\n {\n rotate([90, 0, 0])\n triangular_prism(launch_side, 0.1);\n translate([0, 0, dz])\n for(r=[0:5:40])\n rotate([r, 0, 0])\n translate([0, -conn_phi\/2, 0])\n pipe_connector(conn_phi-r\/5, 0.1, $fn=50);\n }\n *\/\n}\n\n\nmodule launcher()\n{\n difference()\n {\n\/\/ outer_pipe();\n inner_pipe();\n }\n \/\/ TODO screw holes :P\n}\n\nlauncher();\n","old_contents":"eps = 0.01;\nphi = 25;\nwall = 1.3;\nside = 22;\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangular_prism(side, height)\n{\n linear_extrude(height=height)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h)\n{\n cylinder(d=d, h=h, $fn=200);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n ph = 180;\n translate([0, ph, 0])\n rotate([90, 0, 0])\n triangular_prism(side, ph);\n \/\/ rubber pipe side\n dz = side * sin(60);\n translate([0, -phi\/2, dz])\n pipe_connector(phi, 20);\n \/\/ interconenction of both\n hull()\n {\n rotate([90, 0, 0])\n triangular_prism(side, 0.1);\n translate([0, 0, dz])\n for(r=[0:5:40])\n rotate([r, 0, 0])\n translate([0, -phi\/2, 0])\n pipe_connector(phi-r\/5, 0.1, $fn=50);\n }\n}\n\n\nmodule launcher()\n{\n inner_pipe();\n}\n\nlauncher();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8a1c29bd50aea01752044ec5aaf7560bc79dd220","subject":"fanduct: fix compile warnings\/errors","message":"fanduct: fix compile warnings\/errors\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"fanduct.scad","new_file":"fanduct.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nassert(N > 1)\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"Rz\", \"r\"],\n [ ss.x\/4, -27, 25, ss.x\/2, ss.y, 60, 00, 00, .01],\n [ 2.5+ss.x\/4, -21, 21, 5+ss.x\/2, ss.y, 60, 00, 00, .1 ],\n \/*[ 15, -18, 30, 11, 20, 13, 0, 00, .4 ],*\/\n \/*[ 17, -8, 20, 11, 17, 11, -10, 00, .5 ],*\/\n [ 16, -10, 15, 17, 20, 30, -15, 00, .7 ],\n [ 15, -4, 10, 11, 19, 20, -30, 00, .7 ],\n [ 12, 0, 5, 6, 13, 0, -45, 00, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V, N=100)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(v=to_3d(circle_profile(r=.5)))\n let(dat = R_(R.x, R.y, R.z, v))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(v=to_3d(shape_profile(size=S,r=r)))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=v))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true, N=100)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($debug_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n \/*$fn=is_build?$fn:48;*\/\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, $debug_mode=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n rz(180)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n rz(180)\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nif(false)\n{\n $debug_mode=true;\n fanduct();\n}\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"Rz\", \"r\"],\n [ ss.x\/4, -27, 25, ss.x\/2, ss.y, 60, 00, 00, .01],\n [ 2.5+ss.x\/4, -21, 21, 5+ss.x\/2, ss.y, 60, 00, 00, .1 ],\n \/*[ 15, -18, 30, 11, 20, 13, 0, 00, .4 ],*\/\n \/*[ 17, -8, 20, 11, 17, 11, -10, 00, .5 ],*\/\n [ 16, -10, 15, 17, 20, 30, -15, 00, .7 ],\n [ 15, -4, 10, 11, 19, 20, -30, 00, .7 ],\n [ 12, 0, 5, 6, 13, 0, -45, 00, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(v=to_3d(circle_profile(r=.5)))\n let(dat = R_(R.x, R.y, R.z, v))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(v=to_3d(shape_profile(size=S,r=r)))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=v))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($debug_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, $debug_mode=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n rz(180)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n rz(180)\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nif(false)\n{\n $debug_mode=true;\n fanduct();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"984251daf39bbfeebed5482314204478d12e74de","subject":"cylinder -> cone","message":"cylinder -> cone\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bed_foot\/bed_foot.scad","new_file":"bed_foot\/bed_foot.scad","new_contents":"eps=0.01;\n\nmodule bed_foot()\n{\n h=60;\n d=52;\n difference()\n {\n cylinder(d1=d+10, d2=d, h=h, $fn=200);\n {\n $fn=50;\n \/\/ screw drill\n translate(-eps*[0,0,1])\n cylinder(d=4.5, h=h+2*eps);\n \/\/ screw guide\n translate(10*[0,0,1])\n cylinder(d1=10, d2=30, h=h);\n }\n }\n}\n\n\nbed_foot();\n","old_contents":"eps=0.01;\n\nmodule bed_foot()\n{\n h=60;\n d=52;\n difference()\n {\n cylinder(d=d, h=h, $fn=200);\n {\n $fn=50;\n \/\/ screw drill\n translate(-eps*[0,0,1])\n cylinder(d=4.5, h=h+2*eps);\n \/\/ screw guide\n translate(10*[0,0,1])\n cylinder(d1=10, d2=30, h=h);\n }\n }\n}\n\n\nbed_foot();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e3253fdcce7e5d6d35a85781412244dabe8f35ed","subject":"Added comment about laser cutting and kerf width.","message":"Added comment about laser cutting and kerf width.\n","repos":"RigacciOrg\/ProTherm,RigacciOrg\/ProTherm,RigacciOrg\/ProTherm","old_file":"case\/scad\/protherm-enclosure.scad","new_file":"case\/scad\/protherm-enclosure.scad","new_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.4;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.5;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n screw_diameter = 2.2;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=(screw_diameter * 0.75 \/ 2), h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Push-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.2;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n\n\/\/-------------------------------------------------------------------------\n\/\/ The cover: 2D shape for laser cutting. Load this geometry alone,\n\/\/ Compile and Render (F6), Export to DXF (protherm-2d-cover.dxf).\n\/\/\n\/\/ Nominal size on the X axis:\n\/\/\n\/\/ x_size - overcut * 2 => 115.0 - 0.1 * 2 = 114.8\n\/\/\n\/\/ The cutted real piece turned out to be 114.5 mm, then we suppose\n\/\/ that the laser track on plexiglass is about 0.3 mm.\n\/\/-------------------------------------------------------------------------\nscrew_diameter = 2.5;\nr1 = (chamfer - overcut) * 1.1;\nx = x_size + overlap * 2;\ny = y_size + overlap * 2;\ntranslate([-(x_size \/ 2), -(y_size\/2)]) {\n difference() {\n rounded_square(x_size - (overcut * 2), y_size - (overcut * 2), (chamfer - overcut));\n union() {\n translate([0, 0]) rotate(a=0 , v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n translate([x, 0]) rotate(a=90, v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n translate([x, y]) rotate(a=180, v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n translate([0, y]) rotate(a=270, v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n }\n }\n}\n","old_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.4;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.5;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n screw_diameter = 2.2;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=(screw_diameter * 0.75 \/ 2), h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Push-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.2;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n\n\/\/-------------------------------------------------------------------------\n\/\/ 2D Cover: load this geometry alone, Compile and Render (F6),\n\/\/ Export to DXF (protherm-2d-cover.dxf).\n\/\/-------------------------------------------------------------------------\nscrew_diameter = 2.5;\nr1 = (chamfer - overcut) * 1.1;\nx = x_size + overlap * 2;\ny = y_size + overlap * 2;\ntranslate([-(x_size \/ 2), -(y_size\/2)]) {\n difference() {\n rounded_square(x_size - (overcut * 2), y_size - (overcut * 2), (chamfer - overcut));\n union() {\n translate([0, 0]) rotate(a=0 , v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n translate([x, 0]) rotate(a=90, v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n translate([x, y]) rotate(a=180, v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n translate([0, y]) rotate(a=270, v=[0, 0, 1]) translate([r1 \/ 2, r1 \/ 2]) circle(r=(screw_diameter \/ 2), $fn=24);\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c45c891feb7498b902c8a77d63ddeb176e9b1a20","subject":"Changing roof","message":"Changing roof\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2350;\nshed_front_back = 2135;\nbase_timber = 47;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp*2,opp]);\n } \n}\n\nmodule breatherMembraneFront(x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo (\"lll\", x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) rotate([90,0,0]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([space_to_window_w,space_to_window_h,-100]) rotate([0,0,0]) cube([window_w,window_h,200]);\n translate([space_to_window_w*2+window_w,0,-100]) cube([door_w,door_h,200]);\n } \n}\n\n\nmodule sheetFramed(size,center=false, f_timber_width=0, f_timber_length=0, f_offset_w_l=0, f_offset_w_r=0, f_offset_l=0)\n{\n cubeI(size, center=center);\n if(f_timber_width>0) \/\/ Panel is Not longer than width\n {\n translate([f_offset_w_l,f_offset_l,-f_timber_length]) cubeI([size[0]-f_offset_w_l-f_offset_w_r, f_timber_width, f_timber_length]);\n translate([f_offset_w_l,size[1]-f_timber_width-f_offset_l,-f_timber_length]) cubeI([size[0]-f_offset_w_l-f_offset_w_r, f_timber_width, f_timber_length]);\n translate([f_offset_w_l,f_offset_l+f_timber_width,-f_timber_length]) cubeI([f_timber_width, size[1]-f_offset_l*2-f_timber_width*2, f_timber_length]);\n translate([size[0]-f_timber_width-f_offset_w_r,f_offset_l+f_timber_width,-f_timber_length]) cubeI([f_timber_width, size[1]-f_offset_l*2-f_timber_width*2, f_timber_length]);\n }\n}\n\n\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100, f_timber_width=0,f_timber_length=0, f_offset_l=0)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n \/\/ f_offset_w_l=0, f_offset_w_r=0\n f_offset_w_l_ = base_x==0 ? f_offset_l +timber_construct_w\/2+3: 0;\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) sheetFramed([panel_slf_w, panel_slf_l,panel_slf_t], f_timber_width=f_timber_width, f_timber_length=f_timber_length, f_offset_l=f_offset_l, f_offset_w_l=f_offset_w_l_);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) sheetFramed([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) sheetFramed([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t], f_timber_width=f_timber_width, f_timber_length=f_timber_length, f_offset_l=f_offset_l, f_offset_w_r=f_offset_l +timber_construct_w\/2+3); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) sheetFramed([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) sheetFramed([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) sheetFramed([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=timber_construct_w,timber_length=timber_construct_h, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n echo(\"Struts - http:\/\/www.wickes.co.uk\/Wickes-Studwork-%28CLS%29-38x63x2400mm-Single\/p\/107177\");\n cubeI([x,timber_length,timber_width]);\n translate([0,0,z-timber_width]) cubeI([x,timber_length,timber_width]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2,timber_length, timber_width]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n echo(\"Cladding: \", board_height, x); \n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 34, degrees=3)\n{\n echo(\"Cladding Total:\", x, z);\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp*2]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp*2]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n translate([0,timber_construct_h\/2,0]) shedLowerFloor(x+overhang_flat*2,panel_slf_l, f_timber_width=75, f_timber_length=47, f_offset_l=overhang_flat-base_timber\/2); \n\/\/ translate([overhang,overhang,0]) roofJoists(x,y+17.5,7 );\n }\n}\n\nmodule insulate(space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, thickness=50, colour=\"White\", off=0)\n{\n translate([thickness,shed_width-thickness-off,0]) color(colour,0.5) cube([shed_length-thickness*2, thickness, shed_front_back]);\n\n opp = shed_front_height-shed_front_back;\n adj = shed_width - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n translate([thickness,-thickness-off,0]) color(colour,0.5) cube([shed_width-thickness*2, thickness, shed_front_height]); \n translate([0,-opp\/2-off,shed_front_height]) rotate([0,theta,0]) cube([shed_width+10,opp,opp*2]);\n }\n translate([shed_length-thickness-off,0,0]) rotate([0,0,90]) difference()\n {\n translate([thickness,-thickness,0]) color(colour,0.5) cube([shed_width-thickness*2, thickness, shed_front_height]); \n translate([0,-opp\/2,shed_front_height]) rotate([0,theta,0]) cube([shed_width+10,opp,opp*2]);\n }\n\n translate([0,off,0]) rotate([0,0,0]) difference()\n {\n translate([thickness,0,0]) color(colour,0.5) cube([shed_length-thickness*2, thickness, shed_front_height]);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n\n \n \n \n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\nannimate_step = 1\/20;\n\n\/\/rotate([6.34182+180,0,0])\n\/\/ {\n\nif($t>annimate_step*1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>annimate_step*2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>annimate_step*3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>annimate_step*4) \n translate([0,shed_width-timber_construct_h,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back-base_timber-1, 5);\nif($t>annimate_step*5) \n translate([timber_construct_h,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back-base_timber-3,2, braces=1);\n\nif($t>annimate_step*6) \n translate([shed_length,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back-base_timber-3,2, braces=1);\n\nif($t>annimate_step*7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height-base_timber-3, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>annimate_step*8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>annimate_step*9) \n translate([0,shed_width+0.51,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>annimate_step*10) \n translate([-0.51,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*11) \n translate([shed_length+0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*12) \n translate([0,-0.5,timber_construct_h])\n breatherMembraneFront(shed_length,shed_front_height, thickness=0.5, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>annimate_step*13) \n translate([0,shed_width+3,timber_construct_h])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>annimate_step*14) \n translate([-3,0,timber_construct_h])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*15) \n translate([shed_length+3,0,timber_construct_h])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*16) \n translate([-3,0,timber_construct_h])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\nif($t>annimate_step*17) \n translate([0,0,timber_construct_h])\n insulate(space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\nif($t>annimate_step*18) \n translate([0,0,timber_construct_h])\n insulate(space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, thickness=5, colour=\"Black\", off=timber_construct_h);\n\n\n\/\/restOfGarden();","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2350;\nshed_front_back = 2135;\nbase_timber = 47;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp,opp]);\n } \n}\n\nmodule breatherMembraneFront(x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo (\"lll\", x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) rotate([90,0,0]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([space_to_window_w,space_to_window_h,-100]) rotate([0,0,0]) cube([window_w,window_h,200]);\n translate([space_to_window_w*2+window_w,0,-100]) cube([door_w,door_h,200]);\n } \n}\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=timber_construct_w,timber_length=timber_construct_h, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_length,timber_width]);\n translate([0,0,z-timber_width]) cubeI([x,timber_length,timber_width]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2,timber_length, timber_width]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 34, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,7 );\n }\n}\n\nmodule insulate(space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, thickness=50, colour=\"White\")\n{\n translate([0,shed_width-thickness,0]) color(colour,0.5) cube([shed_length, thickness, shed_front_back]);\n\n opp = shed_front_height-shed_front_back;\n adj = shed_width - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n translate([0,-thickness,0]) color(colour,0.5) cube([shed_width, thickness, shed_front_back]); \n translate([0,-opp\/2,shed_front_height]) rotate([0,theta,0]) cube([shed_width+10,opp,opp]);\n }\n translate([shed_length-thickness,0,0]) rotate([0,0,90]) difference()\n {\n translate([0,-thickness,0]) color(colour,0.5) cube([shed_width, thickness, shed_front_back]); \n translate([0,-opp\/2,shed_front_height]) rotate([0,theta,0]) cube([shed_width+10,opp,opp]);\n }\n\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n translate([0,0,0]) color(colour,0.5) cube([shed_length, thickness, shed_front_height]);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n\n \n \n \n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\nannimate_step = 1\/20;\n\n\nif($t>annimate_step*1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>annimate_step*2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>annimate_step*3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>annimate_step*4) \n translate([0,shed_width-timber_construct_h,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>annimate_step*5) \n translate([timber_construct_h,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*6) \n translate([shed_length,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>annimate_step*8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>annimate_step*9) \n translate([0,shed_width+0.51,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>annimate_step*10) \n translate([-0.51,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*11) \n translate([shed_length+0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*12) \n translate([0,-0.5,timber_construct_h])\n breatherMembraneFront(shed_length,shed_front_height, thickness=0.5, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>annimate_step*13) \n translate([0,shed_width+3,timber_construct_h])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>annimate_step*14) \n translate([-3,0,timber_construct_h])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*15) \n translate([shed_length+3,0,timber_construct_h])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*16) \n translate([-3,0,timber_construct_h])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\nif($t>annimate_step*16) \n translate([0,0,timber_construct_h])\n insulate(space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/restOfGarden();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"926fdface61294f4fd2a94af8686604781af4ab3","subject":"Added pyssla\/perler bases","message":"Added pyssla\/perler bases\n","repos":"ksuszka\/3d-projects","old_file":"small\/ikea_pyssla_beads_bases.scad","new_file":"small\/ikea_pyssla_beads_bases.scad","new_contents":"draft = true;\n$fa = draft ? 12 : 3;\n$fs = draft ? 2 : 0.1;\npin_fn = draft ? 12 : 24;\n\npin_height = 2.8;\npin_distance = 5;\npin_dia = 2.3;\nbase_height = 2;\n\nboard_type = \"circle\";\nn = 8;\n\nthing(board_type, n);\n\nmodule thing(board_type, n) {\n if (board_type == \"circle\") circle_board(n);\n if (board_type == \"square\") rectangular_board(n,n);\n if (board_type == \"heart\") heart_board(n);\n if (board_type == \"triangle\") triangle_board(n);\n if (board_type == \"hexagon\") hexagon_board(n);\n if (board_type == \"star\") star_board(n);\n}\n\n\nmodule pin() {\n round_d=pin_dia\/2;\n intersection() {\n minkowski() {\n translate([0,0,0]) cylinder(d=pin_dia-round_d,h=pin_height-round_d\/2,$fn=pin_fn);\n sphere(d=round_d,$fn=pin_fn);\n }\n cylinder(d=pin_dia*2,h=pin_height,$fn=pin_fn);\n }\n}\n\nmodule circle_board(n=8) {\n module pins() {\n pin();\n for(i=[1:1:n]) {\n r = i*pin_distance;\n c = i*6;\n for(a=[0:360\/c:359]) {\n rotate([0,0,a]) translate([r,0,0]) pin();\n }\n }\n }\n translate([0,0,base_height-0.01]) pins();\n cylinder(r=(n+1)*pin_distance,h=base_height);\n}\n\nmodule rectangular_board(sx=1, sy=1) {\n translate([0,0,base_height-0.01]) {\n for(x=[1:1:sx]) for(y=[1:1:sy]) {\n translate([x*pin_distance,y*pin_distance,0]) pin();\n }\n }\n cube([(sx+1)*pin_distance,(sy+1)*pin_distance,base_height]);\n}\n\nmodule heart_board(n=3) {\n module half_circle_board(n) {\n intersection() {\n circle_board(n);\n inf=10000;\n translate([0,inf\/2-pin_distance\/2,0]) cube([inf,inf,inf],center=true);\n }\n }\n w = n*2 + 1;\n rectangular_board(w,w);\n translate([w*pin_distance,0,0]) rectangular_board(n-1,w);\n translate([0,w*pin_distance,0]) rectangular_board(w,n-1);\n translate([(n+1)*pin_distance,(w+n)*pin_distance,0]) half_circle_board(n);\n translate([(w+n)*pin_distance,(n+1)*pin_distance,0]) rotate([0,0,-90])half_circle_board(n);\n}\n\nfunction triangle_h(a) = a*sqrt(3)\/2;\n\nmodule triangle_board(n=3) {\n translate([0,0,base_height-0.01]) {\n for(x=[0:1:n-1]) for(y=[n - x-1:-1:0]) {\n translate([pin_distance*triangle_h(x-(n-1)\/3), pin_distance*(y+x\/2-(n-1)\/2),0]) pin();\n }\n }\n minkowski() {\n cylinder(d=pin_distance*((n-1)*2*sqrt(3)\/3),h=base_height-0.5,$fn=3);\n cylinder(r=pin_distance,h=0.5);\n }\n}\n\nmodule hexagon_board(n=3) {\n for(a=[0:60:359]) {\n rotate([0,0,a]) {\n translate([-pin_distance*triangle_h(n-1)*2\/3,0,0])\n triangle_board(n);\n }\n }\n}\n\nmodule star_board(n=3) {\n for(a=[0:60:359]) {\n rotate([0,0,a]) {\n translate([-pin_distance*triangle_h(n-1)*2\/3,0,0])\n triangle_board(n);\n translate([-pin_distance*triangle_h(n-1)*4\/3,0,0])\n mirror([1,0,0])\n triangle_board(n);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/ikea_pyssla_beads_bases.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"dc3424c65ea0d6ef1919a5acbe0fe0b5c4fbdb8c","subject":"The use statement was moved.","message":"The use statement was moved.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\n\/\/ this is pretty much the working copy of name-tag.scad\r\n\r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\n\r\n\/\/ remember to download write.scad and fonts\r\nuse \r\n \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"\";\/\/\"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"\";\/\/\"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Top Text] *\/\r\n\/\/topText = \"tecolote\";\/\/\"Mark\";\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"\";\/\/Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\/\/font=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, \"this value is no longer used\", topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/nametag(font=\"write\/orbitron.dxf\");\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\", \r\n topText=\"Love is the Answer\",\r\n baseWidth = 200\r\n )\r\n{\r\n union()\r\n {\r\n nametag_assembly(font=font, topText=topText, baseWidth = baseWidth);\r\n\r\n icons();\r\n } \r\n}\r\n\r\nmodule nametag_assembly(font, topText, baseWidth) \r\n{\r\n echo(\"font is \" + font);\r\n\tcolor(textColor) \r\n\twriting(font=font, topText=topText);\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase(baseWidth);\r\n\t}\r\n}\r\n\r\n\/\/ TODO: Migrate this to use the built-in OpenSCAD text() module.\r\nmodule writing(font, topText)\r\n{\r\n translate([0,namematrix[0][0],baseThickness+letterThickness\/2])\r\n write(topText,\r\n t = letterThickness,\r\n h = namematrix[0][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[0][3]\r\n\/\/\t\t\t , bold=1\r\n );\r\n \r\n\t\/\/ this writes the second element (sub-element 1 and on) and on, max 100 names\r\n\tfor ( i = [1 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n} \r\n\r\nmodule base2holes(baseWidth) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes(baseWidth) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth)\r\n{\r\n roundedCorners = true;\r\n \r\n size = [baseWidth, baseHeight, baseThickness];\r\n \r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,cornerRadius=8, sides=30, sidesOnly=true, cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n \r\n chainLoop = true;\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n xTranslate = -x \/ 2.0;\r\n yTranslate = -baseHeight - 6;\r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xScale = x,\r\n yScale = y,\r\n zScale = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth)\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter(baseWidth)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","old_contents":"\r\n\/\/ this is pretty much the working copy of name-tag.scad\r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\n \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"\";\/\/\"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"\";\/\/\"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Top Text] *\/\r\n\/\/topText = \"tecolote\";\/\/\"Mark\";\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"\";\/\/Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\/\/font=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, \"this value is no longer used\", topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ remember to download write.scad and fonts\r\nuse \t\r\n\r\n\/\/nametag(font=\"write\/orbitron.dxf\");\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\", \r\n topText=\"Love is the Answer\",\r\n baseWidth = 200\r\n )\r\n{\r\n union()\r\n {\r\n nametag_assembly(font=font, topText=topText, baseWidth = baseWidth);\r\n\r\n icons();\r\n } \r\n}\r\n\r\nmodule nametag_assembly(font, topText, baseWidth) \r\n{\r\n echo(\"font is \" + font);\r\n\tcolor(textColor) \r\n\twriting(font=font, topText=topText);\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase(baseWidth);\r\n\t}\r\n}\r\n\r\n\/\/ TODO: Migrate this to use the built-in OpenSCAD text() module.\r\nmodule writing(font, topText)\r\n{\r\n translate([0,namematrix[0][0],baseThickness+letterThickness\/2])\r\n write(topText,\r\n t = letterThickness,\r\n h = namematrix[0][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[0][3]\r\n\/\/\t\t\t , bold=1\r\n );\r\n \r\n\t\/\/ this writes the second element (sub-element 1 and on) and on, max 100 names\r\n\tfor ( i = [1 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes(baseWidth) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes(baseWidth) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth)\r\n{\r\n roundedCorners = true;\r\n \r\n size = [baseWidth, baseHeight, baseThickness];\r\n \r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,cornerRadius=8, sides=30, sidesOnly=true, cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n \r\n chainLoop = true;\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n xTranslate = -x \/ 2.0;\r\n yTranslate = -baseHeight - 6;\r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xScale = x,\r\n yScale = y,\r\n zScale = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth)\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter(baseWidth)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4232f3fbdd3c7b727c04569d09f2744f3228d780","subject":"Add a sample to illustrate use of new mesh shapes","message":"Add a sample to illustrate use of new mesh shapes\n","repos":"jsconan\/camelSCAD","old_file":"samples\/mesh-grid.scad","new_file":"samples\/mesh-grid.scad","new_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * A simple mesh grid\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ As we need to use some shapes, use the right entry point of the library\nuse <..\/shapes.scad>\ninclude <..\/core\/constants.scad>\n\n\/\/ We will render the object using the specifications of this mode\nrenderMode = MODE_PROD;\n\n\/\/ Defines the dimensions of the object\nlength = 120;\nwidth = 120;\nthickness = 2;\ncorner = 8;\npaddingX = 6;\npaddingY = 6;\nholeDiameter = 5;\nholeIntervalX = length - 2 * holeDiameter;\nholeIntervalY = width - 2 * holeDiameter;\n\ncellCountX = 10;\ncellCountY = 10;\ncellSpaceX = 1;\ncellSpaceY = 1;\nmeshLength = length - 2 * paddingX;\nmeshWidth = width - 2 * paddingY;\n\n\/\/ Sets the minimum facet angle and size using the defined render mode.\n\/\/ Displays a build box visualization to preview the printer area.\napplyMode(mode=renderMode) {\n difference() {\n cushion([length, width, thickness], d=corner);\n\n negativeExtrude(thickness, direction=2) {\n translate([holeIntervalX, holeIntervalY, 0] \/ -2) {\n repeat2D(countX=2, countY=2, intervalX=[holeIntervalX, 0, 0], intervalY=[0, holeIntervalY, 0]) {\n circle(d=holeDiameter);\n }\n }\n\n mesh(\n size = [meshLength, meshWidth],\n count = [cellCountX, cellCountY],\n gap = [cellSpaceX, cellSpaceY],\n linear = true,\n even = true,\n pointy = false\n );\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/mesh-grid.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"fb78952c7322dc687950d4d638a491795099739b","subject":"initial version of new fork component, minimzed to a holes distancing part","message":"initial version of new fork component, minimzed to a holes distancing part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filament_holder\/fork_mk2.scad","new_file":"filament_holder\/fork_mk2.scad","new_contents":"h=11; \/\/ height\nw=14; \/\/ width\nd=(5+1)\/2; \/\/ diameter of the holes\n\n\t\tdifference() {\ndifference()\n{\n union()\n {\n \/\/ lower arc\n difference()\n {\n cylinder(h=h, r=(80+2*w)\/2);\n translate([-(80+2*w)\/2, 0, 0])\n cube([80+2*w, (80+2*w)\/2, h]);\n cylinder(h=h, r=(80)\/2);\n }\n\n \/\/ leg\n translate([-w\/2,-80-80\/2,0])\n cube([w, 80, h]);\n\n \/\/ forks\n translate([40, 0, 0])\n cube([w, 40, h]);\n translate([-40-w, 0, 0])\n cube([w, 40, h]);\n }\n\n \/\/ lower hole for screw\n translate([0, -80-33, -1])\n cylinder(h=h+2, r=d);\n \/\/ higher hole for screw\n translate([0, -80-33+11, -1])\n cylinder(h=h+2, r=d);\n}\n\n\t translate([-60, -96, 0])\n\t\t cube([200, 200, h]);\n\t translate([3, -98, 0])\n\t\t cube([200, 200, h]);\n\t\t\t}","old_contents":"","returncode":1,"stderr":"error: pathspec 'filament_holder\/fork_mk2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e897e96bd8622fa4d2dfd86bb1306270d1caa6f1","subject":"materials: add some materials, and material module","message":"materials: add some materials, and material module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"materials.scad","new_file":"materials.scad","new_contents":"Mat_Oak = [0.65, 0.5, 0.4];\nMat_Pine = [0.85, 0.7, 0.45];\nMat_Birch = [0.9, 0.8, 0.6];\nMat_FiberBoard = [0.7, 0.67, 0.6];\nMat_BlackPaint = [0.2, 0.2, 0.2];\nMat_Iron = [0.36, 0.33, 0.33];\nMat_Steel = [0.65, 0.67, 0.72];\nMat_Stainless = [0.45, 0.43, 0.5];\nMat_Aluminium = [0.77, 0.77, 0.8];\nMat_Brass = [0.88, 0.78, 0.5];\nMat_Transparent = [1, 1, 1, 0.2];\n\nMat_Chrome = Mat_Steel;\n\nMat_Plastic = Mat_Pine;\n\nmodule material(mat)\n{\n color(mat)\n children();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'materials.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f29db70f6a83fee2d9a789200dc3e6328338d76b","subject":"printing multiple elements at a time","message":"printing multiple elements at a time\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"aks_zielonka\/cable_tube_enclosure.scad","new_file":"aks_zielonka\/cable_tube_enclosure.scad","new_contents":"wall = 1.75;\nspacing = 1.3;\nl = 3.2;\nsize = [90+2*wall, 41, 15];\n\nmodule tooth_()\n{\n size = 4;\n difference()\n {\n cube([l, size, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube([l, size, 2*l]);\n }\n}\n\nmodule element()\n{\n \/\/ body\n difference()\n {\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n }\n\n \/\/ side teeth\n for(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth_();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth_();\n }\n\n \/\/ upper teeth\n for(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth_();\n}\n\ndistance = 4;\nfor(n=[0:1])\n for(m=[0:4])\n translate([n*(size[0]+distance), m*(size[1]+distance), 0])\n element();\n","old_contents":"wall = 1.75;\nspacing = 1.3;\nl = 3.2;\nsize = [90+2*wall, 41, 15];\n\nmodule tooth_()\n{\n size = 4;\n difference()\n {\n cube([l, size, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube([l, size, 2*l]);\n }\n}\n\nmodule element()\n{\n \/\/ body\n difference()\n {\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n }\n \n \/\/ side teeth\n for(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth_();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth_();\n }\n \n \/\/ upper teeth\n for(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth_();\n}\n\nelement();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"30f1fa105b5e9297d68691608a8d16151c128c58","subject":"sketch an LCD support 3D model","message":"sketch an LCD support 3D model\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/lcd_support_v1.scad","new_file":"3d\/lcd_support_v1.scad","new_contents":"$fn = 20;\neps = 1e-3;\n\n\/\/ TODO: Proper dimensions.\nsize_x = 50;\nsize_y = 20;\nsize_z = 7;\nwidth = 4;\n\npin_length = 3;\npin_radius = 1;\npin_offset_left = 2;\npin_offset_right = pin_offset_left;\npin_offset_top = 2;\npin_offset_bottom = 2;\n\ntranslate([-size_x\/2, 0, 0]) {\n cube([size_x, width, size_z]);\n cube([width, size_y, size_z]);\n translate([size_x - width, 0, 0]) {\n cube([width, size_y, size_z]);\n };\n translate([pin_offset_left, pin_offset_bottom, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n translate([size_x - pin_offset_right, pin_offset_bottom, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n translate([pin_offset_left, size_y - pin_offset_top, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n translate([size_x - pin_offset_right, size_y - pin_offset_top, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d\/lcd_support_v1.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c52dc6302423dd2baae80367f8bbe8a294bfd8b7","subject":"deleted several","message":"deleted several\n","repos":"JoeSuber\/QuickerPicker","old_file":"608zz_run_free.scad","new_file":"608zz_run_free.scad","new_contents":"\necho(\"608zz_run_free - cones for thread return on 608zz bearing\");\n\/\/ my_bearing_cutter() is for cutting into other stuff, not otherwise representing\n$fn=128;\n\n\nmodule my_bearing_cutter(\nshaftlen=20, \nwholeH=7.1, \nbevel=.55, \noutD=22.15, \noutwall_thk=2.3, \ninspinD=12.6, \ninspinID=8,\ninspincut=1.5,\n){\n\t\/\/ bevel on outside perimeters\n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([0,0,-(wholeH \/ 2)+bevel\/2])\n\t\t\t\tcylinder(r1=(outD-bevel*2)\/2, r2=outD\/2, h=.5, center=true);\n\t\t\ttranslate([0,0,wholeH \/ 2 - bevel\/2])\n\t\t\t\tcylinder(r1=outD\/2, r2=(outD-bevel*2)\/2, h=.5, center=true);\n\t\t}\n\t\tcylinder(r=(outD-bevel*2)\/2, h=wholeH+.2, center=true);\n\t}\n\t\/\/outside running surface and body\n\tcylinder(r=outD\/2, h=wholeH-1, center=true);\n\t\/\/ post-bevel rim\n\tdifference(){\n\t\tcylinder(r=(outD-bevel*2)\/2, h=wholeH, center=true);\n\t\tcylinder(r=(outD - outwall_thk)\/2, h=wholeH+.2, center=true);\n\t}\n\t\/\/ slightly fatter-than-reality insiderim\n\tdifference(){\n\t\tcylinder(r=inspinD\/2, h=wholeH+inspincut, center=true);\n\t\tcylinder(r=inspinID\/2, h=wholeH+inspincut, center=true);\n\t}\n\tif (shaftlen > 0){\n\t\t#cylinder(r=inspinID\/2, h=shaftlen, center=true);\n\t}\n}\n\nmodule freewheel (outsideD=28, sidewallthk=1.2, shaftage=8, bearingH=7.1){\ntranslate([0,0,+bearingH\/2])\n\tdifference(){\n\t\ttranslate([0,0,-bearingH\/2+sidewallthk])\n\t\t\tcylinder(r1=outsideD\/2, r2=22.15\/2, h=sidewallthk+bearingH\/2, center=true);\n\t\ttranslate([0,0,0])\n\t\t\tmy_bearing_cutter();\n\t}\n\techo(\"freewheel half\");\n}\n\nmodule freewheel_model (shaft=30, spacebear=7.1\/2){\n\tfor(i=[90,-90]){\n\t\ttranslate([0,spacebear*i\/abs(i),0]) rotate([i,0,0])\n\t\t\tfreewheel(shaftlen=shaft\/2);\n\t}\n}\n\n\n\/\/ print (in two halves) a snug fitting pully\n\/\/ so that thread runs on steel\n\nmodule print_freewheel(){\n\ttranslate([0,-(30+1)\/2,0])\n\t\tfreewheel();\n\ttranslate([0,(30+1)\/2,0])\n\t\tfreewheel();\n}\n\n\/\/freewheel_model();\n\nprint_freewheel();\n\n\/\/my_bearing_cutter();\n","old_contents":"\necho(\"608zz_run_free - cones for thread return on 608zz bearing\");\n\/\/ my_bearing_cutter() is for cutting into other stuff, not otherwise representing\n$fn=128;\n\n\nmodule my_bearing_cutter(\nshaftlen=20, \nwholeH=7.1, \nbevel=.55, \noutD=22.15, \noutwall_thk=2.3, \ninspinD=12.6, \ninspinID=8,\ninspincut=1.5,\n){\n\t\/\/ bevel on outside perimeters\n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([0,0,-(wholeH \/ 2)+bevel\/2])\n\t\t\t\tcylinder(r1=(outD-bevel*2)\/2, r2=outD\/2, h=.5, center=true);\n\t\t\ttranslate([0,0,wholeH \/ 2 - bevel\/2])\n\t\t\t\tcylinder(r1=outD\/2, r2=(outD-bevel*2)\/2, h=.5, center=true);\n\t\t}\n\t\tcylinder(r=(outD-bevel*2)\/2, h=wholeH+.2, center=true);\n\t}\n\t\/\/outside running surface and body\n\tcylinder(r=outD\/2, h=wholeH-1, center=true);\n\t\/\/ post-bevel rim\n\tdifference(){\n\t\tcylinder(r=(outD-bevel*2)\/2, h=wholeH, center=true);\n\t\tcylinder(r=(outD - outwall_thk)\/2, h=wholeH+.2, center=true);\n\t}\n\t\/\/ slightly fatter-than-reality insiderim\n\tdifference(){\n\t\tcylinder(r=inspinD\/2, h=wholeH+inspincut, center=true);\n\t\tcylinder(r=inspinID\/2, h=wholeH+inspincut, center=true);\n\t}\n\tif (shaftlen > 0){\n\t\t#cylinder(r=inspinID\/2, h=shaftlen, center=true);\n\t}\n}\n\nmodule freewheel (outsideD=28, sidewallthk=1.2, shaftage=8, bearingH=7.1){\ntranslate([0,0,+bearingH\/2])\n\tdifference(){\n\t\ttranslate([0,0,-bearingH\/2+sidewallthk])\n\t\t\tcylinder(r1=outsideD\/2, r2=22.15\/2, h=sidewallthk+bearingH\/2, center=true);\n\t\ttranslate([0,0,0])\n\t\t\tmy_bearing_cutter();\n\t}\n\techo(\"freewheel half\");\n}\n\nmodule freewheel_model (shaft=30, spacebear=7.1\/2){\n\tfor(i=[90,-90]){\n\t\ttranslate([0,spacebear*i\/abs(i),0]) rotate([i,0,0])\n\t\t\tfreewheel(shaftlen=shaft\/2);\n\t}\n}\n\nmodule print_freewheel(){\n\ttranslate([0,-(30+1)\/2,0])\n\t\tfreewheel();\n\ttranslate([0,(30+1)\/2,0])\n\t\tfreewheel();\n}\n\n\/\/freewheel_model();\nprint_freewheel();\n\/\/my_bearing_cutter();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c60cd74707ccf309e33a63142aa186bb99f27a76","subject":"Got the basic shelf working","message":"Got the basic shelf working\n\nNeed to make it be able to handle a top and a bottom shelf, as well as\nmaking the whole thing recursive\n","repos":"agupta231\/fractal_prints","old_file":"infinite_shelves.scad","new_file":"infinite_shelves.scad","new_contents":"\/\/ www.github.com\/agupta231\n\n\/\/ user set variables\ninitial_side_length = 100;\ninitial_side_height = 30;\npadding_ratio = .05;\n\nknob_ratio = .2;\n\nmax_iterations = 3;\n\ntop_opening_ratio = .3;\nbottom_opening_ratio = .7;\n\necho(version());\n\nmodule shelf(length, depth, height) {\n difference() {\n cube([length, depth, height], center = true);\n\n translate([0, 0, length * padding_ratio]) {\n cube([(1 - padding_ratio) * length, depth - length * padding_ratio, height], center = true);\n }\n }\n\n translate([0, (1 + knob_ratio \/ 2) * depth \/ 2 ,0])\n cube([length * knob_ratio, depth * knob_ratio \/ 2, height * knob_ratio], center = true);\n}\n\nmodule pattern(current_iteration, starting_pos, length, depth, height) {\n padding = length * padding_ratio;\n\n length_new = length \/ 2 - padding;\n height_new = (height - padding * 3) \/ 2;\n\n if(current_iteration % 2 == 0) {\n echo(starting_pos + [0, depth \/ 2, 0]);\n\n translate(starting_pos + [0, (length_new * top_opening_ratio) \/ 2, 0]) {\n shelf(length_new, length_new * top_opening_ratio, height_new);\n }\n }\n else if(current_iteration % 2 == 1) {\n\n }\n}\n\n#shelf(initial_side_length, initial_side_length * bottom_opening_ratio, initial_side_height);\n\npattern(0, [0, 35, 0], initial_side_length, initial_side_length, initial_side_height);\n","old_contents":"\/\/ www.github.com\/agupta231\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"892d6da17cd2d4e2cdd1681ccbba839403b288db","subject":"Cleaned up","message":"Cleaned up\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/camPi.scad","new_file":"hardware\/camPi.scad","new_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2015 Paolo Negrini\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*\/\n\n\/\/$fn = 250;\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\n\/\/ RPi supports does not touch the bottom of the case\ninclude ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoX = 11.8;\nservoY = 22.2;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nservoClerance = 31 - 16 - servoHornThickness;\neccentricity = 22.2 \/ 2 - 5;\nservoBodySupport = 20;\n\n\nscrewDiam = 3;\nscrewLenght = 10;\nscrewTolerance = 0.3;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLength = Pilength + 8;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\nboxThickness = 1;\ntopCoverHeight = 15;\n\nservoPanZ = boxHeight - 20 + topCoverHeight - servoClerance;\nservoPanBoxX = (servoX - 2 * boxThickness - tolerance);\nservoPanBoxThickness = 2;\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\n\n\/\/---------------------------------------\nmodule panSupport() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y translate if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\/\/--------------------------------------- \n\/\/This was the verion for RPi v1\nmodule panSupportRPiV1() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y translate if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\nmodule miscroServoSupport() {\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n }\n\n }\n\n}\n\n\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n }\n }\n\n\/\/Baseplate for pan mechanism\nmodule base(servo) {\n difference() {\n\n {\n minkowski() {\n cylinder(r = R + mik, h = supportBaseHeight);\n rotate([90, 0, 0]) cylinder(r = mik, h = 1);\n }\n\n \/\/This to create a anchoring mechanism with the pan base\n \/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n }\n if (servo == true) {\n translate([0, 0, -supportZ - servoHornThickness - mik]) rotate([0, 90, 0]) servoHorn(\"cross\");\n cylinder(r = 2.5, h = 15, center = true);\n }\n }\n }\n \n\nmodule supportSection() {\n intersection() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n translate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n }\n }\n \/\/-------------------------\n\n \/\/This creates the supporting pillar for the camera shell\n module tiltSupport()\n\n {\n union() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n translate([-gimballWidth, 0, 0]) cube([2 * gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n\n hull() {\n translate([0, 0, -5]) supportSection();\n translate([0, 0, -supportZ]) supportSection();\n }\n }\n\n }\n\n\nmodule servoTiltSupport(xPos, Pos) {\n \/\/The module ned to be rewritten to be easy to read!!!\n \/\/Need to center the servo shaft, the second figure is the distance form border\n supportPosition = xPos;\n \/\/Need to adjust the clearance to account for the Xpos\n supportCurvature = 30;\n\n rotate([-0, 0, 0]) difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 0]) {\n cube([shellThickness, 30, 1.8 * RatX(gimballWidth \/ 2)], center = true);\n }\n \n difference(){sphere(5*R);sphere(R - shellThickness);}\n difference() {\n }\n }\n\n \n translate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + tolerance + shellThickness + 3 , 22.2 + 3 + shellThickness], center = true);\n cube([servoBodySupport, 12 + tolerance, 22.2 + 1.1*tolerance], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n\n }\n }\n\n \/\/This is the slot in the servo arm\n translate([servoClerance + 8 + shellThickness, 0, eccentricity]) {\n cube([20 + tolerance, 12 + tolerance, 32.2 ], center = true);\n translate([-31 \/ 2, 0, 0]) cube([31 + 1, 12, 22.2 + + 1.1*tolerance], center = true);\n\n }\n }\n\n \/\/This is the curved extra support for the connection with the gimball internal shell\n translate([0, 0, 0])SUB_tiltwedge(xPos);\n mirror([0,0,1])translate([0, 0, 0])SUB_tiltwedge(xPos);\n\n \n \n\n }\n\n\n \/\/-------------------------\n\nmodule SUB_tiltwedge(xPos) {\n supportCurvature = 30;\n\t\n difference() {\n translate([12, 0, +RatX(xPos) - 10])\n difference() {\n cube([16, 30, 50], center = true);\n translate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20, center=true);\n\n }\n\n difference() {\n sphere(10*R);\n\n sphere(R - shellThickness);\n\n }\n\n\n }\n\n}\n\n\nmodule cameraSupport() {\n difference() {\n difference() {\n sphere(R);\n sphere(R - shellThickness);\n }\n\n translate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n translate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n \/\/Creates camera support\n translate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n translate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n \/\/Slot for camera wires\n translate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n \/\/Hole for the camera\n translate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + 2*tolerance, 10, PIcameraDiam + 2*tolerance], center = true);\n\t\ttranslate([0,0.9*R,0])SUB_PiCamHoles(0.3);\n }\n\n \/\/Need to hardwire the servo dimensions\n\n {\n servoTiltSupport(gimballWidth\/2, \"tilt\");\n\n\n }\n \/\/Pivot mechanism. Need to understand why 0.98 otherwise a layer gets created\n translate([-gimballWidth \/ 2, 0, 0]) {\n difference() {\n rotate([0, 90, 0]) cylinder(r = panSupport, h = 0.98*shellThickness);\n gimballPivot(1);\n rotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n }\n gimballPivot(1);\n }\n }\n \n \/\/-------------------------\n\nmodule SUB_PiCamHoles(T) {\n\/\/ T is the tolerance for holes\n translate([PIcameraX\/2-2, 0, PIcameraY\/2-1])rotate([90,0,0])cylinder(r=1+T,h=10, center=true);\n\t\ttranslate([-(PIcameraX\/2-2), 0, PIcameraY\/2-1])rotate([90,0,0])cylinder(r=1+T,h=10, center=true);\n\t\ttranslate([PIcameraX\/2-2, 0, (PIcameraY\/2-1)-12.5])rotate([90,0,0])cylinder(r=1+T,h=10, center=true);\n\t\ttranslate([-(PIcameraX\/2-2), 0, (PIcameraY\/2-1)-12.5])rotate([90,0,0])cylinder(r=1+T,h=10, center=true); \n \n} \n \n \n\n\nmodule camBolt() {\n difference(){\n SUB_camBoltFrame();\n SUB_PiCamHoles(0.1);\n \n \n}\n}\n\n\n\nmodule SUB_camBoltFrame(){\n\n\ntranslate([PIcameraX\/2-2,0,PIcameraY\/2-2])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([-(PIcameraX\/2-2),0,PIcameraY\/2-2])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([-(PIcameraX\/2-2),0,+(PIcameraY\/2-2)-12.5])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([(PIcameraX\/2-2),0,+(PIcameraY\/2-2)-12.5])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([0,+2.5-4,0]){\n translate([0,0,(PIcameraY\/2-2)-12.5])cube([(PIcameraX-2),5,5], center=true);\ntranslate([0,0,(PIcameraY\/2-2)])cube([(PIcameraX-2),5,5], center=true);\ntranslate([PIcameraX\/2-2.5,0,12.5\/2])cube([5,5,(12.5)], center=true);\ntranslate([-(PIcameraX\/2-2.5),0,12.5\/2])cube([5,5,(12.5)], center=true);\n}\n\n}\n\n\nmodule servoHorn(type) {\n cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n if (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n }\n \/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n rotate([0, 90, 0])\n difference() {\n cylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n cylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n }\n }\n \/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance) \/ R;\n\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n translate([gimballWidth \/ 2, 0, 0]) rotate([0, 90, 0]) cylinder(r = 3, h = 30);\n\n }\n\n \/\/Need to cut holes in the base for servo and camera cables and the screws\n translate([0, 0, -supportBaseHeight \/ 2])\n difference() {\n\n {\n color(\"blue\", 0.5) translate([0, 0, -supportZ - supportBaseHeight]) base(true);\n translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n SUB_cameracableDuct();\n translate([0, 0, +supportBaseHeight \/ 2]) mirror([1, 0, 0]) tiltSupport();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, 0]) rotate([0, 0, 180])\n SUB_servocableDuct();\n\n }\n\n }\n\n}\n\nmodule mountedPillar() {\n \/\/Pillar for camera. This one needs to be mounted separately\n difference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, -supportX \/ 2]) rotate([0, 0, 180])\n SUB_servocableDuct();\n }\n\n }\n\n\n}\n\n\nmodule SUB_screw(tolerance) {\n cylinder(r = screwDiam \/ 2 + tolerance, h = screwLenght);\n translate([0, 0, -3]) cylinder(r = 2 * screwDiam \/ 2 + screwTolerance, h = 4);\n}\n\nmodule SUB_mountedPillarScrewHoles() {\n color(\"blue\", 0.5) translate([-R + supportX \/ 2 + 2, 0, -supportZ - screwLenght \/ 2]) {\n translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n mirror([0, 1, 0]) translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n }\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 3, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 3, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 180]) cylinder(r = supportX \/ 3, h = 0.6 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct() {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n }\n \/\/---------------------------\n\n\n\n\nmodule connectionSocket() {\n\n cylinder(r = 3, h = 5);\n translate([-9, -3 \/ 2, 0]) cube([10, 3, 5]);\n\n}\n\nmodule PiSupport() {\n difference() {\n translate([0,0,1])cube([4 + 3 \/ 2 - 0.4, 4 + 3 \/ 2 - 0.2, 8], center = true);\n cylinder(r = 3 \/ 2 - 0.2, h = 2 * Piheight + 8, $fs = 0.1);\n }\n\n}\n\n\n\nmodule case () {\n translate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n difference() {\n minkowski() {\n box(boxLength, boxDepth, boxHeight, boxThickness, \"PI\");\n \/\/sphere(r = mik);\n cylinder(r = mik, h = 2);\n }\n translate([R - 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([R - 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n\n translate([0, 0, -boxHeight \/ 2 - 5 \/ 2]) cylinder(r = 3, h = 5);\n\n\ntranslate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 5 + shellThickness]) {\n rpi();\n }\n\/\/This is the power inlet. The +6 in z is half the z-lenght of the component\ntranslate([-boxLength\/2,-boxDepth\/2+8,-boxHeight\/2+shellThickness+2*mik+tolerance])cube([15+tolerance,9+tolerance,12], center=true);\n\n }\n translate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 1 + shellThickness]) {\ntranslate ([Pilength-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-3.5, -0+3.5,-0.1]) PiSupport();\ntranslate ([Pilength-58-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-58, 0+3.5,-0.1]) PiSupport();\n \/\/translate([25.5, 18, 0]) PiSupport();\n \/\/translate([Pilength - 5, Piwidth - 12.5, 0]) PiSupport();\n\n }\n\n\n }\ntranslate([-boxLength\/2+15\/2+mik,-boxDepth\/2+8,-supportZ-boxHeight-4])rotate([0,0,180])SUB_Power();\n \n}\n\nmodule topLid() {\n tolerance = 0.02;\n\n difference() {\n difference() {\n {\n minkowski() {\n translate([0, 0, -supportZ - supportBaseHeight - topCoverHeight \/ 2]) cube([boxLength + mik - 1, boxDepth + mik - 1, topCoverHeight], center = true);\n sphere(r = mik); \/\/cylinder(r = mik, h = 2);\n }\n translate([0, 0, -supportZ - supportBaseHeight]) {\n scale([1 + tolerance, 1 + tolerance, 1]) base(\"false\");\n scale([0.9, 0.9, 30]) base(\"false\");\n\n \/\/This is the grid an hole for mic.need to re-work the placement definition as it will not work for other box dimensions!!!\n translate([boxLength \/ 2 - 5 - mik - boxThickness, -(boxDepth \/ 2 - 5 - mik - boxThickness), +14 - supportBaseHeight - topCoverHeight \/ 2]) rotate([0, 180, 0]) SUB_Mic();\n\n }\n\t\n }\n\t\n }\n\t\n\n\n\n scale([0.98,0.98,1])case ();\n\n }\n\n\/\/Need to explain the -1.4*supportBaseHeight\ndifference(){\ntranslate([0,0,-supportZ-1.4*supportBaseHeight])rotate([0,-90,90])testSupport();\n case ();\n\n}\n\n}\n\nmodule SUB_Mic() {\n translate([-7, 0, 0]) for (i = [1: 6]) {\n translate([i * 2, 0, 0]) cube([1, 10, 2], center = true);\n }\n cylinder(r = 5, h = 2 * topCoverHeight);\n\n}\n\nmodule SUB_Power(){\n\tdifference(){\t\n\t\tcube([15,9+3,12], center=true);\n\t\ttranslate([2,0,2])cube([15+tolerance,9+tolerance,12], center=true);\n\t}\n}\nmodule assembly(view) \n{\n\nspace = (view == \"explode\") ? 20 : 0;\n\ntranslate([-space,0,0])cameraSupport();\ntranslate([0,0,-space])support();\ntranslate([-3*space,0,0])mountedPillar();\ntranslate([0,0,-3*space])topLid();\n\n\n\/\/translate([0,0,-4*space-1.5*supportZ])panSupport();\ntranslate([0,0,-6*space])case ();\n\n}\n\n\n\/\/-------------------------------\nmodule testSupport(xPos, Pos) {\n \/\/Need to center the servo shaft, the seconf figure is the distance form border\n eccentricity = 22.2 \/ 2 - 5;\n servoBodySupport = 25;\n \/\/Need to adjust the clearance to account for the Xpos\n\t\tarmLenght = 1.4*(boxDepth\/2);\n difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2, 0, 15]) {\n cube([shellThickness, servoBodySupport, armLenght], center = true);\n }\n\t\t\t\t\t\n }\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n }\n }\n\n \/\/This is the slot in the servo arm. Need to check why -15 in the translate is needed\ntranslate([-(11)+(32.2\/2+12\/2+tolerance\/2)-15, 0, eccentricity]) {\n\n cube([20 + tolerance, 12+tolerance\/2, 32.2 + tolerance], center = true);\n translate([-31\/2, 0, 0]) cube([31 + tolerance, 12+tolerance\/2, 22.2 + tolerance], center = true);\n\n }\n \n\n\n}\t\n\n\/\/Dimensions are hardwired, should be parameters!!!\n\t\ttranslate([-10,0,+armLenght\/2+15])rotate([270,0,0])linear_extrude(height = servoBodySupport, center = true, convexity = 10, twist = 0)\n\t\t\t\/\/polygon([[0,0],[8,20],[10,0]], convexity = N);\n polygon([[0,0],[10,armLenght\/3],[10,0]], convexity = N);\n \t\n}\n\n\/\/-------------------------\n\n\nassembly(\"explode\");\n\/\/case();\n\/\/topLid();\n\/\/SUB_Power();\n\n\/\/mountedPillar();\n\n\/\/servoTiltSupport(gimballWidth\/2, \"tilt\");\n\n\/\/cameraSupport();\n\/\/support();\n\/\/camBolt();\n\n ","old_contents":"\/*\nThe MIT License (MIT)\n\nCopyright (c) 2015 Paolo Negrini\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*\/\n\n\/\/$fn = 250;\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\n\/\/ RPi supports does not touch the bottom of the case\ninclude ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoX = 11.8;\nservoY = 22.2;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nservoClerance = 31 - 16 - servoHornThickness;\neccentricity = 22.2 \/ 2 - 5;\nservoBodySupport = 20;\n\n\nscrewDiam = 3;\nscrewLenght = 10;\nscrewTolerance = 0.3;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLength = Pilength + 8;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\nboxThickness = 1;\ntopCoverHeight = 15;\n\nservoPanZ = boxHeight - 20 + topCoverHeight - servoClerance;\nservoPanBoxX = (servoX - 2 * boxThickness - tolerance);\nservoPanBoxThickness = 2;\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\n\n\/\/---------------------------------------\nmodule panSupport() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y translate if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\/\/--------------------------------------- \n\/\/This was the verion for RPi v1\nmodule panSupportRPiV1() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y translate if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\nmodule miscroServoSupport() {\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n }\n\n }\n\n}\n\n\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n }\n }\n\n\/\/Baseplate for pan mechanism\nmodule base(servo) {\n difference() {\n\n {\n minkowski() {\n cylinder(r = R + mik, h = supportBaseHeight);\n rotate([90, 0, 0]) cylinder(r = mik, h = 1);\n }\n\n \/\/This to create a anchoring mechanism with the pan base\n \/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n }\n if (servo == true) {\n translate([0, 0, -supportZ - servoHornThickness - mik]) rotate([0, 90, 0]) servoHorn(\"cross\");\n cylinder(r = 2.5, h = 15, center = true);\n }\n }\n }\n \n\nmodule supportSection() {\n intersection() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n translate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n }\n }\n \/\/-------------------------\n\n \/\/This creates the supporting pillar for the camera shell\n module tiltSupport()\n\n {\n union() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n translate([-gimballWidth, 0, 0]) cube([2 * gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n\n hull() {\n translate([0, 0, -5]) supportSection();\n translate([0, 0, -supportZ]) supportSection();\n }\n }\n\n }\n\n\nmodule servoTiltSupport(xPos, Pos) {\n \/\/The module ned to be rewritten to be easy to read!!!\n \/\/Need to center the servo shaft, the second figure is the distance form border\n supportPosition = xPos;\n \/\/Need to adjust the clearance to account for the Xpos\n supportCurvature = 30;\n\n rotate([-0, 0, 0]) difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 0]) {\n cube([shellThickness, 30, 1.8 * RatX(gimballWidth \/ 2)], center = true);\n }\n \n difference(){sphere(5*R);sphere(R - shellThickness);}\n difference() {\n }\n }\n\n \n translate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + tolerance + shellThickness + 3 , 22.2 + 3 + shellThickness], center = true);\n cube([servoBodySupport, 12 + tolerance, 22.2 + 1.1*tolerance], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n\n }\n }\n\n \/\/This is the slot in the servo arm\n translate([servoClerance + 8 + shellThickness, 0, eccentricity]) {\n cube([20 + tolerance, 12 + tolerance, 32.2 ], center = true);\n translate([-31 \/ 2, 0, 0]) cube([31 + 1, 12, 22.2 + + 1.1*tolerance], center = true);\n\n }\n }\n\n \/\/This is the curved extra support for the connection with the gimball internal shell\n translate([0, 0, 0])SUB_tiltwedge(xPos);\n mirror([0,0,1])translate([0, 0, 0])SUB_tiltwedge(xPos);\n\n \n \n\n }\n\n\n \/\/-------------------------\n\nmodule SUB_tiltwedge(xPos) {\n supportCurvature = 30;\n\t\n difference() {\n translate([12, 0, +RatX(xPos) - 10])\n difference() {\n cube([16, 30, 50], center = true);\n translate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20, center=true);\n\n }\n\n difference() {\n sphere(10*R);\n\n sphere(R - shellThickness);\n\n }\n\n\n }\n\n}\n\n\nmodule cameraSupport() {\n difference() {\n difference() {\n sphere(R);\n sphere(R - shellThickness);\n }\n\n translate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n translate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n \/\/Creates camera support\n translate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n translate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n \/\/Slot for camera wires\n translate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n \/\/Hole for the camera\n translate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + tolerance, 10, PIcameraDiam + tolerance], center = true);\n\t\ttranslate([0,0.9*R,0])SUB_PiCamHoles(0.3);\n \n }\n\n \/\/Need to hardwire the servo dimensions\n\n {\n servoTiltSupport(gimballWidth\/2, \"tilt\");\n\n\n }\n \/\/Pivot mechanism. Need to understand why 0.98 otherwise a layer gets created\n translate([-gimballWidth \/ 2, 0, 0]) {\n difference() {\n rotate([0, 90, 0]) cylinder(r = panSupport, h = 0.98*shellThickness);\n gimballPivot(1);\n rotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n }\n gimballPivot(1);\n }\n }\n \n \/\/-------------------------\n\nmodule SUB_PiCamHoles(T) {\n\/\/ T is the tolerance for holes\n translate([PIcameraX\/2-2, 0, PIcameraY\/2-2])rotate([90,0,0])cylinder(r=1+T,h=10, center=true);\n\t\ttranslate([-(PIcameraX\/2-2), 0, PIcameraY\/2-2])rotate([90,0,0])cylinder(r=1+T,h=10, center=true);\n\t\ttranslate([PIcameraX\/2-2, 0, (PIcameraY\/2-2)-12.5])rotate([90,0,0])cylinder(r=1+T,h=10, center=true);\n\t\ttranslate([-(PIcameraX\/2-2), 0, (PIcameraY\/2-2)-12.5])rotate([90,0,0])cylinder(r=1+T,h=10, center=true); \n \n} \n \n \n\n\nmodule camBolt() {\n difference(){\n SUB_camBoltFrame();\n SUB_PiCamHoles(0.1);\n \n \n}\n}\n\n\n\nmodule SUB_camBoltFrame(){\n\n\ntranslate([PIcameraX\/2-2,0,PIcameraY\/2-2])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([-(PIcameraX\/2-2),0,PIcameraY\/2-2])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([-(PIcameraX\/2-2),0,+(PIcameraY\/2-2)-12.5])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([(PIcameraX\/2-2),0,+(PIcameraY\/2-2)-12.5])rotate([90,0,0])cylinder(r=3,h=8, center=true);\ntranslate([0,+2.5-4,0]){\n translate([0,0,(PIcameraY\/2-2)-12.5])cube([(PIcameraX-2),5,5], center=true);\ntranslate([0,0,(PIcameraY\/2-2)])cube([(PIcameraX-2),5,5], center=true);\ntranslate([PIcameraX\/2-2.5,0,12.5\/2])cube([5,5,(12.5)], center=true);\ntranslate([-(PIcameraX\/2-2.5),0,12.5\/2])cube([5,5,(12.5)], center=true);\n}\n\n}\n\n\nmodule servoHorn(type) {\n cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n if (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n }\n \/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n rotate([0, 90, 0])\n difference() {\n cylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n cylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n }\n }\n \/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance) \/ R;\n\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n translate([gimballWidth \/ 2, 0, 0]) rotate([0, 90, 0]) cylinder(r = 3, h = 30);\n\n }\n\n \/\/Need to cut holes in the base for servo and camera cables and the screws\n translate([0, 0, -supportBaseHeight \/ 2])\n difference() {\n\n {\n color(\"blue\", 0.5) translate([0, 0, -supportZ - supportBaseHeight]) base(true);\n translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n SUB_cameracableDuct();\n translate([0, 0, +supportBaseHeight \/ 2]) mirror([1, 0, 0]) tiltSupport();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, 0]) rotate([0, 0, 180])\n SUB_servocableDuct();\n\n }\n\n }\n\n}\n\nmodule mountedPillar() {\n \/\/Pillar for camera. This one needs to be mounted separately\n difference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, -supportX \/ 2]) rotate([0, 0, 180])\n SUB_servocableDuct();\n }\n\n }\n\n\n}\n\n\nmodule SUB_screw(tolerance) {\n cylinder(r = screwDiam \/ 2 + tolerance, h = screwLenght);\n translate([0, 0, -3]) cylinder(r = 2 * screwDiam \/ 2 + screwTolerance, h = 4);\n}\n\nmodule SUB_mountedPillarScrewHoles() {\n color(\"blue\", 0.5) translate([-R + supportX \/ 2 + 2, 0, -supportZ - screwLenght \/ 2]) {\n translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n mirror([0, 1, 0]) translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n }\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 3, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 3, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 180]) cylinder(r = supportX \/ 3, h = 0.6 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct() {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n }\n \/\/---------------------------\n\n\n\n\nmodule connectionSocket() {\n\n cylinder(r = 3, h = 5);\n translate([-9, -3 \/ 2, 0]) cube([10, 3, 5]);\n\n}\n\nmodule PiSupport() {\n difference() {\n translate([0,0,1])cube([4 + 3 \/ 2 - 0.4, 4 + 3 \/ 2 - 0.2, 8], center = true);\n cylinder(r = 3 \/ 2 - 0.2, h = 2 * Piheight + 8, $fs = 0.1);\n }\n\n}\n\n\n\nmodule case () {\n translate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n difference() {\n minkowski() {\n box(boxLength, boxDepth, boxHeight, boxThickness, \"PI\");\n \/\/sphere(r = mik);\n cylinder(r = mik, h = 2);\n }\n translate([R - 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([R - 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n\n translate([0, 0, -boxHeight \/ 2 - 5 \/ 2]) cylinder(r = 3, h = 5);\n\n\ntranslate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 5 + shellThickness]) {\n rpi();\n }\n\/\/This is the power inlet. The +6 in z is half the z-lenght of the component\ntranslate([-boxLength\/2,-boxDepth\/2+8,-boxHeight\/2+shellThickness+2*mik+tolerance])cube([15+tolerance,9+tolerance,12], center=true);\n\n }\n translate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 1 + shellThickness]) {\ntranslate ([Pilength-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-3.5, -0+3.5,-0.1]) PiSupport();\ntranslate ([Pilength-58-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-58, 0+3.5,-0.1]) PiSupport();\n \/\/translate([25.5, 18, 0]) PiSupport();\n \/\/translate([Pilength - 5, Piwidth - 12.5, 0]) PiSupport();\n\n }\n\n\n }\ntranslate([-boxLength\/2+15\/2+mik,-boxDepth\/2+8,-supportZ-boxHeight-4])rotate([0,0,180])SUB_Power();\n \n}\n\nmodule topLid() {\n tolerance = 0.02;\n\n difference() {\n difference() {\n {\n minkowski() {\n translate([0, 0, -supportZ - supportBaseHeight - topCoverHeight \/ 2]) cube([boxLength + mik - 1, boxDepth + mik - 1, topCoverHeight], center = true);\n sphere(r = mik); \/\/cylinder(r = mik, h = 2);\n }\n translate([0, 0, -supportZ - supportBaseHeight]) {\n scale([1 + tolerance, 1 + tolerance, 1]) base(\"false\");\n scale([0.9, 0.9, 30]) base(\"false\");\n\n \/\/This is the grid an hole for mic.need to re-work the placement definition as it will not work for other box dimensions!!!\n translate([boxLength \/ 2 - 5 - mik - boxThickness, -(boxDepth \/ 2 - 5 - mik - boxThickness), +14 - supportBaseHeight - topCoverHeight \/ 2]) rotate([0, 180, 0]) SUB_Mic();\n\n }\n\t\n }\n\t\n }\n\t\n\n\n\n scale([0.98,0.98,1])case ();\n\n }\n\n\/\/Need to explain the -1.4*supportBaseHeight\ndifference(){\ntranslate([0,0,-supportZ-1.4*supportBaseHeight])rotate([0,-90,90])testSupport();\n case ();\n\n}\n\n}\n\nmodule SUB_Mic() {\n translate([-7, 0, 0]) for (i = [1: 6]) {\n translate([i * 2, 0, 0]) cube([1, 10, 2], center = true);\n }\n cylinder(r = 5, h = 2 * topCoverHeight);\n\n}\n\nmodule SUB_Power(){\n\tdifference(){\t\n\t\tcube([15,9+3,12], center=true);\n\t\ttranslate([2,0,2])cube([15+tolerance,9+tolerance,12], center=true);\n\t}\n}\nmodule assembly(view) \n{\n\nspace = (view == \"explode\") ? 20 : 0;\n\ntranslate([-space,0,0])cameraSupport();\ntranslate([0,0,-space])support();\ntranslate([-3*space,0,0])mountedPillar();\ntranslate([0,0,-3*space])topLid();\n\n\n\/\/translate([0,0,-4*space-1.5*supportZ])panSupport();\ntranslate([0,0,-6*space])case ();\n\n}\n\n\n\/\/-------------------------------\nmodule testSupport(xPos, Pos) {\n \/\/Need to center the servo shaft, the seconf figure is the distance form border\n eccentricity = 22.2 \/ 2 - 5;\n servoBodySupport = 25;\n \/\/Need to adjust the clearance to account for the Xpos\n\t\tarmLenght = 1.4*(boxDepth\/2);\n difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2, 0, 15]) {\n cube([shellThickness, servoBodySupport, armLenght], center = true);\n }\n\t\t\t\t\t\n }\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n }\n }\n\n \/\/This is the slot in the servo arm. Need to check why -15 in the translate is needed\ntranslate([-(11)+(32.2\/2+12\/2+tolerance\/2)-15, 0, eccentricity]) {\n\n cube([20 + tolerance, 12+tolerance\/2, 32.2 + tolerance], center = true);\n translate([-31\/2, 0, 0]) cube([31 + tolerance, 12+tolerance\/2, 22.2 + tolerance], center = true);\n\n }\n \n\n\n}\t\n\n\/\/Dimensions are hardwired, should be parameters!!!\n\t\ttranslate([-10,0,+armLenght\/2+15])rotate([270,0,0])linear_extrude(height = servoBodySupport, center = true, convexity = 10, twist = 0)\n\t\t\t\/\/polygon([[0,0],[8,20],[10,0]], convexity = N);\n polygon([[0,0],[10,armLenght\/3],[10,0]], convexity = N);\n \t\n}\n\n\/\/-------------------------\n\n\nassembly(\"explode\");\n\/\/case();\n\/\/topLid();\n\/\/SUB_Power();\n\n\/\/mountedPillar();\n\n\/\/servoTiltSupport(gimballWidth\/2, \"tilt\");\n\n\/\/cameraSupport();\n\/\/support();\n\/\/camBolt();\n\n ","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3d449ad2f1b6b5e22bc65bbb5493f0544c9de44a","subject":"initial design. checking in before changing a bit","message":"initial design. checking in before changing a bit\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nlayer1bias = 0.4;\nplatformHeight = 45; \/\/ from bar to top platform\nmountHeight=15; \/\/ from bar to electronics platform\nPCBwidth=43;\nHoleInset=3;\n\nthick=5;\nt2=thick\/2;\n\nsf = 16; \/\/ sphere faces\n\ndifference() {\n payloadMount(Bx,Bhole,PCBwidth,HoleInset,PCBhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\/\/translate([0,20,0]) L298mount();\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\nmodule L298mount() intersection() { cube([99,99,4],center=true); \n \n difference() {\n union() {\n hull() {\n cube([36,1,4],center=true);\n for(x=[-1,1]) translate([x*27,17,0])\n scale([5,5,3]) sphere(1,$fn=24);\n }\n }\n\n translate([0,20,0]) scale([16,11,4]) sphere(1,$fn=60);\n\n difference() {\n union() {\n \/\/%scale([6,3,4]) sphere(1,$fn=36);\n\n for(x=[-1,1]) {\n translate([x*(PCBwidth\/2-HoleInset),18,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n translate([x*27,17,-4]) cylinder(r=1.6,h=9,$fn=15);\n translate([x*16,8,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*23,10,-4]) rotate([0,0,30]) cylinder(r=2,h=9,$fn=6);\n translate([x*20.5,6,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*17,4,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*13,5,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*9,4,-4]) rotate([0,0,30]) cylinder(r=2,h=9,$fn=6);\n translate([x*5,4,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n }\n }\n %cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\n\n\n\n\nmodule payloadMount(axisSep,axisRad,platWidth,dHole,rHole) {\n \/\/difference() {\n union() {\n \/\/%braceBar(axisSep,axisRad);\n for (x=[-1,1]) hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4);\n }\n hull() {\n translate([0,5,2]) cube([2*axisSep,.5,4],center=true);\n cube([2*axisSep,1,1],center=true);\n }\n\n translate([0,-34,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) hull() { \/\/ main side braces\n translate([x*axisSep,0,5]) scale([.6,.6,4]) sphere(1,$fn=16);\n translate([x*axisSep,0,0]) cube([2,2,1],center=true);\n translate([x*18,-34,0]) cube([4,4,1],center=true);\n translate([x*27,-34,8]) sphere(0.6,$fn=12);\n }\n\n *for(x=[-1,1]) hull() { \/\/ secondary supports\n translate([x*1 , 4 ,0.5]) scale([3,1,1]) sphere(1,$fn=16);\n translate([x*16,-34,0.5]) scale([2,1,1]) sphere(1,$fn=16);\n }\n\n }\n \/\/}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Drawings\/payloadMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"88909b046792bf4bd39fed14a6c21860b03363df","subject":"move refactor","message":"move refactor\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/badges\/feather-wings\/dotstar-matrix\/tix-clock\/plate\/tix-clock-plate.scad","new_file":"openscad\/models\/src\/main\/openscad\/badges\/feather-wings\/dotstar-matrix\/tix-clock\/plate\/tix-clock-plate.scad","new_contents":"\nmodule dotstarMatrixTixClockPlate()\n{\n difference()\n {\n xLength = dotstarMatrixTixClockPlate_xLength();\n yLength = dotstarMatrixTixClockPlate_yLength();\n\n cube([xLength, 23, 1]);\n\n dotstarMatrixTixClockPlate_cutouts();\n }\n}\n\nmodule dotstarMatrixTixClockPlate_cutouts(plateLength_x, plateLength_y)\n{\n plateLength_x = dotstarMatrixTixClockPlate_xLength();\n plateLength_y = dotstarMatrixTixClockPlate_yLength();\n\n cutoutLengthX = dotstarMatrixTixClockPlate_cutouts_xLength();\n cutoutLengthY = dotstarMatrixTixClockPlate_cutouts_yLength();\n\n xTranslate = dotstarMatrixTixClockPlate_cutouts_hourTens_xTranslate();\n yTranslate = dotstarMatrixTixClockPlate_cutouts_hourTens_yTranslate();\n\n echo(\"yt:\", yTranslate);\n\n \/\/ hour tens cutout\n translate([xTranslate, yTranslate, -0.01])\n cube([cutoutLengthX, cutoutLengthY, 1.02]);\n\n \/\/ hour ones cutout\n\/\/ dotstarMatrixTixClockPlate_cutouts_hourOnes();\n}\n\nmodule dotstarMatrixTixClockPlate_cutouts_hourOnes()\n{\n xTranslate = dotstarMatrixTixClockPlate_cutouts_hourTens_xTranslate()\n + dotstarMatrixTixClockPlate_cutouts_xLength() * 2;\n\n yTranslate = dotstarMatrixTixClockPlate_cutouts_hourTens_yTranslate();\n\n cutoutLengthX = dotstarMatrixTixClockPlate_cutouts_xLength();\n cutoutLengthY = dotstarMatrixTixClockPlate_cutouts_yLength();\n\n translate([xTranslate, yTranslate, -0.01])\n cube([cutoutLengthX, cutoutLengthY, 1.02]);\n\n}\n\nfunction dotstarMatrixTixClockPlate_xLength() = 50;\n\nfunction dotstarMatrixTixClockPlate_yLength() = 23;\n\nfunction dotstarMatrixTixClockPlate_cutouts_xLength() = 2.6;\n\nfunction dotstarMatrixTixClockPlate_cutouts_yLength() = 18;\n\nfunction dotstarMatrixTixClockPlate_cutouts_hourTens_xTranslate() = 7;\n\nfunction dotstarMatrixTixClockPlate_cutouts_hourTens_yTranslate() = (dotstarMatrixTixClockPlate_yLength() - dotstarMatrixTixClockPlate_cutouts_yLength()) \/ 2.0;\n","old_contents":"\nmodule dotstarMatrixTixClockPlate()\n{\n difference()\n {\n xLength = dotstarMatrixTixClockPlate_xLength();\n yLength = dotstarMatrixTixClockPlate_yLength();\n\n cube([xLength, 23, 1]);\n\n dotstarMatrixTixClockPlate_cutouts();\n }\n}\n\nmodule dotstarMatrixTixClockPlate_cutouts(plateLength_x, plateLength_y)\n{\n plateLength_x = dotstarMatrixTixClockPlate_xLength();\n plateLength_y = dotstarMatrixTixClockPlate_yLength();\n\n cutoutLengthX = 2.6;\n cutoutLengthY = 18;\n\n xTranslate = 7;\n yTranslate = (plateLength_y - cutoutLengthY) \/ 2.0;\n\n echo(\"yt:\", yTranslate);\n\n \/\/ hour tens cutout\n translate([xTranslate, yTranslate, -0.01])\n cube([cutoutLengthX, cutoutLengthY, 10.02]);\n\n \/\/ hour ones cutout\n dotstarMatrixTixClockPlate_cutouts_hourOnes(cutoutLengthX = cutoutLengthX, cutoutLengthY = cutoutLengthY);\n}\n\nmodule dotstarMatrixTixClockPlate_cutouts_hourOnes(cutoutLengthX, cutoutLengthY)\n{\n\n}\n\nfunction dotstarMatrixTixClockPlate_xLength() = 50;\n\nfunction dotstarMatrixTixClockPlate_yLength() = 23;\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"00d51aae9ed54be2a5f9b7e0a798c78a858fcaef","subject":"The customizer verson was corrected.","message":"The customizer verson was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/customizer\/coins-pendants-ornaments-customizer.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/customizer\/coins-pendants-ornaments-customizer.scad","new_contents":"\nuse <..\/coins-pendants-ornaments.scad>\n\n\/* [General] *\/\nheight = 3; \/\/ [1:10]\nincludeGimbal = \"yes\"; \/\/ [yes, no]\n\n\/* [Inner Icon] *\/\ninnerIcon = \"Tree\"; \/\/ [Tree, Cross, Throwie, Star of David, Crescent Star, Star, Blue Moon, Clover, Heart, Horseshoe, Hourglass, OSHW, Texas, Africa, Oval, Balloon, Circle]\ninnerIconXyScale = 1.15; \/\/ [-1 : 0.05 : 30]\ninnerIconOffsetY = -13; \/\/ [-35:35]\n\n\/* [Outer Icon] *\/\nouterIcon = \"Tree\"; \/\/ [Tree, Cross, Star of David, Crescent Star, Star, Blue Moon, Clover, Heart, Horseshoe, Hourglass, OSHW, Texas, Africa, Oval, Balloon, Circle]\nouterIconXyScale = 0.4; \/\/ [-1 : 0.05 : 25]\nouterIconCount = 8; \/\/ [1:15]\n\n\/* [Hidden] *\/\n\n$fn=100;\n\nornament(height = height,\n includeGimbal = includeGimbal,\n innerIcon = innerIcon,\n innerIconXyScale = innerIconXyScale,\n innerIconOffsetY = innerIconOffsetY,\n outerIcon = outerIcon,\n outerIconXyScale = outerIconXyScale,\n outerIconCount = outerIconCount);\n","old_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/ \n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\n\/* [General] *\/\nheight = 3; \/\/ [1:10]\nincludeGimbal = \"yes\"; \/\/ [yes, no]\n\n\/* [Inner Icon] *\/\ninnerIcon = \"Tree\"; \/\/ [Tree, Cross, Throwie, Star of David, Crescent Star, Star, Blue Moon, Clover, Heart, Horseshoe, Hourglass, OSHW, Texas, Africa, Oval, Balloon, Circle]\ninnerIconXyScale = 1.15; \/\/ [-1 : 0.05 : 30]\ninnerIconOffsetY = -13; \/\/ [-35:35]\n\n\/* [Outer Icon] *\/\nouterIcon = \"Tree\"; \/\/ [Tree, Cross, Star of David, Crescent Star, Star, Blue Moon, Clover, Heart, Horseshoe, Hourglass, OSHW, Texas, Africa, Oval, Balloon, Circle]\nouterIconXyScale = 0.4; \/\/ [-1 : 0.05 : 25]\nouterIconCount = 8; \/\/ [1:15]\n\n\/* [Hidden] *\/\n\n$fn=100;\n\nornament(height = height,\n includeGimbal = includeGimbal,\n innerIcon = innerIcon,\n innerIconXyScale = innerIconXyScale,\n innerIconOffsetY = innerIconOffsetY,\n outerIcon = outerIcon,\n outerIconXyScale = outerIconXyScale,\n outerIconCount = outerIconCount);\n\nmodule ornament(height = 3,\n includeGimbal = \"yes\", \/\/ [yes, no]\n innerIcon = \"Tree\",\n innerIconXyScale = 0.9,\n innerIconOffsetY = -4,\n outerIcon = \"Tree\",\n outerIconXyScale = 0.2,\n outerIconCount = 10)\n{\n {\n coinScale = 0.2;\/\/0.199248\n \n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n \n xyScale = 0.5;\n zTranslate = -height \/ 2.0;\n translate([0, -22, zTranslate])\n scale([xyScale, xyScale, 1])\n openCylinder(center=true);\n }\n \n\n difference()\n {\n color(\"blue\")\n scale([coinScale, -coinScale, 1]) \n coin(innerIcon = innerIcon,\n innerIconXyScale = innerIconXyScale,\n innerIconOffsetY = innerIconOffsetY,\n outerIcon = outerIcon,\n outerIconCount = outerIconCount, \n outerIconXyScale = outerIconXyScale,\n radius = 55,\n height=height\n ); \n\n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n\t color(\"pink\")\n \tcylinder(r=19.35, h=height, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t color(\"grey\")\n\t\tcylinder(r=15.95, h=height, center=true);\n\t\t\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}\n\n\/\/ Below this comment are the modules for the various charms.\n\nmodule coin(innerIcon,\n innerIconXyScale,\n innerIconOffsetY,\n outerIcon,\n outerIconCount, \n outerIconXyScale,\n radius,\n height)\n{\n difference()\n {\n \/\/ main disk\n cylinder (h = height, r=radius, center = true, $fn=100);\n \n \/\/ inner icon\n translate([0, innerIconOffsetY, -5])\n scale([innerIconXyScale, innerIconXyScale, 6.5])\n coinIcon(innerIcon, height);\n \n \/\/ outer icons\n for ( i = [0 : outerIconCount] )\n {\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\n translate([0, 43, -5])\n scale([outerIconXyScale, outerIconXyScale, 3.0])\n coinIcon(outerIcon, height);\n }\n } \n}\n\nmodule coinIcon(iconName, height)\n{\n if(iconName == \"Cross\")\n {\n crucifixionCcross(height);\n }\n else if(iconName == \"Throwie\")\n {\n throwieCutout(height=height);\n }\n else if(iconName == \"Star of David\")\n {\n starOfDavid();\n }\n else if(iconName == \"Crescent Star\")\n {\n crescentStar();\n }\n else if(iconName == \"Star\")\n {\n star(height);\n }\n else if(iconName == \"Blue Moon\")\n {\n blueMoon();\n }\n else if(iconName == \"Clover\")\n {\n clover();\n }\n else if(iconName == \"Heart\")\n {\n heart();\n }\n else if(iconName == \"Horseshoe\")\n {\n horseshoe();\n }\n else if(iconName == \"Hourglass\")\n {\n hourglass();\n }\n else if(iconName == \"OSHW\")\n {\n oshwlogo800px();\n }\n else if(iconName == \"Texas\")\n {\n texas();\n }\n else if(iconName == \"Africa\")\n {\n africa();\n }\n else if(iconName == \"Oval\")\n {\n oval();\n }\n else if(iconName == \"Balloon\")\n {\n balloon();\n }\n else if(iconName == \"Circle\")\n {\n disk();\n }\n else\n {\n \/\/ defalut\n christmasTree(height);\n } \n}\n\nmodule openCylinder(height = 3)\n{ \n difference()\n {\n cylinder(r=7, h=height);\n \n radius = 4.5;\n translate([0, 0, -1])\n cylinder(r=radius, h=height+2);\n }\n}\n\nmodule africa(h=3)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-150.580000,-277.423125],[-146.079531,-276.225156],[-140.091250,-275.406875],[-134.097344,-275.194219],[-129.580000,-275.813125],[-120.055000,-280.393125],[-114.524688,-282.987813],[-108.580000,-284.883125],[-90.580000,-286.663125],[-82.580000,-285.883125],[-75.580000,-286.763125],[-62.580000,-286.763125],[-52.580000,-288.703125],[-50.015000,-281.841875],[-49.666250,-278.301094],[-50.600000,-274.703125],[-52.933750,-271.236875],[-54.930000,-267.703125],[-55.193555,-265.725156],[-54.839063,-264.181250],[-52.785000,-262.050625],[-46.860000,-259.203125],[-41.540000,-255.233125],[-36.507344,-253.268438],[-31.121250,-252.310625],[-25.977031,-251.574063],[-21.670000,-250.273125],[-17.605000,-247.005625],[-13.570000,-243.123125],[-8.228750,-240.278125],[-2.580000,-238.243125],[5.116250,-234.408125],[9.233906,-233.020312],[13.330000,-233.033125],[16.578496,-234.635938],[18.767969,-237.296250],[21.523750,-244.195625],[22.867012,-247.637813],[24.705156,-250.543750],[27.426660,-252.515000],[31.420000,-253.153125],[34.020625,-252.561875],[37.112500,-251.273125],[43.420000,-248.613125],[54.744844,-245.195000],[66.751250,-242.238125],[72.823418,-241.322891],[78.842031,-240.991250],[84.732441,-241.399297],[90.420000,-242.703125],[92.335469,-239.300469],[94.096250,-237.531875],[96.518906,-236.848906],[100.420000,-236.703125],[101.106250,-239.456875],[102.850000,-241.663125],[105.623281,-242.223437],[109.931250,-242.088125],[114.233594,-241.457812],[116.990000,-240.533125],[118.950313,-237.889844],[119.937500,-234.041875],[120.058437,-229.982031],[119.420000,-226.703125],[116.170000,-232.609375],[114.042500,-235.172969],[111.420000,-237.413125],[109.258437,-238.469219],[107.140000,-238.586875],[105.336562,-237.645156],[104.120000,-235.523125],[104.051445,-233.774590],[104.660937,-231.706719],[107.225000,-227.049375],[112.910000,-218.703125],[117.230000,-209.703125],[129.190000,-193.703125],[136.070000,-179.703125],[143.770000,-170.703125],[145.389180,-167.818691],[146.422187,-164.894531],[147.452500,-159.011875],[148.306562,-153.224844],[150.430000,-147.703125],[153.026562,-144.378281],[155.977500,-141.654375],[158.977187,-138.954844],[161.720000,-135.703125],[163.706875,-131.857500],[165.367500,-127.753125],[167.901875,-123.198750],[172.510000,-118.003125],[196.360000,-99.413125],[198.547500,-96.899375],[199.119062,-95.462969],[199.190000,-93.703125],[198.023750,-88.798125],[197.858281,-85.915312],[199.190000,-83.293125],[202.035000,-81.735625],[205.420000,-80.643125],[210.616250,-78.339375],[216.420000,-77.033125],[221.343438,-77.255469],[226.137500,-78.466875],[235.420000,-81.903125],[242.420000,-83.823125],[247.420000,-86.313125],[252.815000,-87.886875],[261.420000,-91.703125],[260.857031,-82.415469],[259.203750,-75.181875],[252.840000,-59.703125],[248.200156,-48.958594],[243.043750,-38.299375],[237.105469,-28.092031],[230.120000,-18.703125],[214.420000,-3.703125],[202.590000,8.296875],[190.130000,23.296875],[182.700000,31.296875],[180.686719,34.408750],[179.621250,37.066875],[178.775156,39.537500],[177.420000,42.086875],[174.637500,45.061875],[171.990000,48.396875],[170.576719,52.960156],[170.493750,57.768125],[171.990000,67.296875],[173.087500,77.353125],[174.860000,87.296875],[176.987344,92.743437],[178.753750,95.896875],[179.963281,99.500312],[180.420000,106.296875],[180.420000,128.296875],[180.215000,134.388125],[179.604375,137.343281],[178.330000,140.126875],[175.454687,143.364688],[171.535000,146.326875],[163.420000,151.146875],[147.795000,161.195625],[139.491250,167.401719],[134.150000,172.586875],[132.644941,175.943496],[132.273906,179.825469],[133.563750,188.533125],[135.279219,197.445156],[135.440215,201.582598],[134.680000,205.296875],[133.025547,208.148828],[130.675000,210.429375],[124.757500,213.874375],[118.671250,216.828125],[116.109766,218.494609],[114.160000,220.486875],[112.725937,224.129219],[112.152500,228.723125],[111.327812,234.151406],[109.140000,240.296875],[106.635625,244.352031],[103.805000,247.665625],[97.630000,254.306875],[87.605312,266.389844],[82.611602,271.620801],[77.350000,276.165625],[71.610273,279.914980],[65.182187,282.759531],[57.855508,284.589941],[49.420000,285.296875],[37.996250,285.775625],[27.420000,287.716875],[21.231250,288.703125],[18.320156,288.421406],[15.440000,286.966875],[13.171465,284.906621],[11.957969,283.077344],[11.547676,281.413770],[11.688750,279.850625],[12.617656,276.764531],[12.730000,273.296875],[10.496250,268.883125],[7.730000,264.296875],[2.520000,252.296875],[-0.930938,246.156094],[-4.747500,240.648125],[-8.530313,234.714531],[-11.880000,227.296875],[-13.862656,219.380312],[-14.976250,211.379375],[-16.294219,203.337188],[-18.890000,195.296875],[-25.145469,183.220625],[-31.733750,171.166875],[-34.577012,165.005469],[-36.812656,158.678125],[-38.210410,152.127656],[-38.540000,145.296875],[-37.854844,140.384375],[-36.366250,134.541875],[-32.400000,124.296875],[-26.122500,114.133125],[-24.510938,109.040469],[-24.870000,102.296875],[-27.060000,94.296875],[-28.790000,82.296875],[-30.831875,75.304375],[-34.092500,66.459375],[-41.030000,51.296875],[-60.260000,25.296875],[-61.932031,21.229062],[-61.973750,17.819375],[-60.260000,10.296875],[-59.280000,2.296875],[-57.553750,-5.903125],[-56.907656,-9.822187],[-56.780000,-14.703125],[-56.876250,-18.770625],[-57.640000,-22.553125],[-59.782813,-24.350469],[-63.645000,-26.484375],[-70.580000,-29.403125],[-84.580000,-28.723125],[-87.447168,-29.114961],[-89.579219,-29.965937],[-92.421250,-32.718125],[-94.672656,-36.325312],[-97.900000,-40.133125],[-101.224531,-42.220937],[-104.861250,-43.275625],[-112.580000,-43.703125],[-120.136250,-43.681875],[-127.580000,-42.483125],[-151.580000,-33.243125],[-169.580000,-34.703125],[-179.666563,-33.916875],[-188.367500,-32.358125],[-195.924688,-31.361875],[-199.349961,-31.491875],[-202.580000,-32.263125],[-207.238594,-34.573906],[-211.221250,-37.586875],[-218.580000,-44.613125],[-227.745000,-52.869375],[-232.417500,-57.464844],[-235.860000,-61.703125],[-237.339688,-64.750937],[-238.150000,-67.650625],[-238.967813,-70.576562],[-240.470000,-73.703125],[-244.952656,-79.565469],[-250.688750,-86.101875],[-256.145469,-92.688906],[-259.790000,-98.703125],[-260.427031,-101.462344],[-260.371250,-103.946875],[-259.790000,-108.703125],[-260.481250,-112.615625],[-261.420000,-115.703125],[-261.367813,-118.479375],[-260.560000,-121.278125],[-258.260000,-126.703125],[-254.808750,-136.496875],[-252.580000,-146.703125],[-250.880000,-163.703125],[-252.245000,-170.073125],[-252.545000,-173.746563],[-251.600000,-177.703125],[-242.200000,-192.703125],[-235.110000,-200.703125],[-229.800000,-208.613125],[-217.280000,-222.003125],[-212.583750,-224.265625],[-207.580000,-225.823125],[-202.220000,-228.750625],[-197.580000,-232.743125],[-193.802637,-236.811113],[-191.282344,-240.379531],[-188.613750,-246.539375],[-186.775781,-252.266094],[-185.293770,-255.293105],[-182.970000,-258.603125],[-179.770781,-261.589844],[-175.706250,-264.361875],[-167.580000,-269.483125],[-155.580000,-280.703125],[-153.230000,-278.868125],[-150.580000,-277.423125]]);\n }\n}\n\nmodule oshwlogo800px(h=3)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-16.500000,-266.590625],[31.500000,-266.590625],[35.913750,-266.534375],[38.183906,-266.198281],[40.020000,-265.420625],[41.923281,-262.160625],[43.351250,-256.703125],[45.100000,-246.590625],[52.700000,-205.590625],[56.200000,-188.630625],[58.567813,-185.469375],[61.927500,-183.260625],[69.500000,-180.170625],[109.500000,-163.940625],[111.590645,-163.768535],[113.705781,-164.161406],[117.908750,-166.156875],[125.500000,-171.590625],[163.500000,-197.590625],[172.651250,-204.133125],[177.878906,-206.627187],[180.314082,-207.006445],[182.500000,-206.550625],[185.527031,-204.348437],[189.556250,-200.603125],[196.500000,-193.590625],[226.500000,-163.590625],[233.782500,-156.415625],[236.459063,-152.104375],[236.948320,-149.859687],[236.640000,-147.590625],[232.182500,-140.150625],[226.840000,-132.590625],[204.170000,-99.590625],[198.735000,-91.575625],[195.943438,-86.959688],[194.530000,-83.590625],[194.728750,-80.508125],[195.790000,-77.590625],[211.220000,-41.590625],[214.612500,-33.441875],[216.859063,-29.472969],[219.610000,-26.680625],[222.902969,-25.382031],[227.661250,-24.241875],[236.500000,-22.590625],[276.500000,-15.190625],[286.612500,-13.441875],[292.070000,-12.013906],[295.330000,-10.110625],[296.107656,-8.274531],[296.443750,-6.004375],[296.500000,-1.590625],[296.500000,61.409375],[296.451250,65.389375],[295.480000,69.129375],[294.216465,70.392695],[292.297969,71.428438],[287.243750,72.941875],[277.500000,74.609375],[241.500000,81.329375],[231.588750,83.055625],[222.540000,85.389375],[219.320156,88.367812],[216.851250,92.544375],[213.300000,101.409375],[196.980000,142.409375],[196.633398,144.880859],[196.950313,147.303125],[199.030000,151.971875],[205.160000,160.409375],[229.160000,195.409375],[234.117500,202.710625],[236.329062,206.919531],[237.050000,210.409375],[235.319687,214.041250],[231.757500,218.276875],[224.500000,225.409375],[196.500000,253.409375],[189.608750,260.354375],[185.617031,264.009687],[182.500000,266.189375],[180.431699,266.602383],[178.116719,266.266563],[173.136250,264.024375],[164.500000,257.989375],[130.500000,234.549375],[123.356250,229.544375],[119.259844,227.577187],[115.500000,227.209375],[96.500000,236.989375],[91.782500,239.339375],[89.162188,240.012813],[86.720000,239.769375],[84.989063,238.543438],[83.657500,236.621875],[81.780000,232.409375],[72.700000,210.409375],[42.900000,138.409375],[35.080000,119.409375],[33.190000,114.981875],[32.260000,110.419375],[32.972891,108.478281],[34.582500,106.401250],[39.522500,102.131875],[49.500000,95.179375],[57.860156,87.966563],[64.533750,80.444375],[70.125469,72.097188],[75.240000,62.409375],[77.913306,56.103069],[79.938008,49.652520],[81.332534,43.096531],[82.115312,36.473906],[81.919336,23.183965],[79.497500,10.093125],[74.997227,-2.488184],[68.565938,-14.249531],[60.351055,-24.880488],[50.500000,-34.070625],[44.132363,-38.671934],[37.722656,-42.482344],[31.219434,-45.552832],[24.571250,-47.934375],[17.726660,-49.677949],[10.634219,-50.834531],[-4.500000,-51.590625],[-12.808906,-50.868750],[-20.983750,-49.033125],[-28.916719,-46.286250],[-36.500000,-42.830625],[-43.849888,-38.623169],[-50.622070,-33.779414],[-56.794077,-28.357280],[-62.343437,-22.414687],[-67.247681,-16.009556],[-71.484336,-9.199805],[-75.030933,-2.043354],[-77.865000,5.401875],[-79.964067,13.077964],[-81.305664,20.926992],[-81.867319,28.891040],[-81.626563,36.912188],[-80.560923,44.932515],[-78.647930,52.894102],[-75.865112,60.739028],[-72.190000,68.409375],[-66.680937,77.253594],[-60.562500,84.788125],[-53.585312,91.540781],[-45.500000,98.039375],[-37.368750,103.516875],[-33.598906,106.893125],[-32.412598,108.660234],[-31.930000,110.449375],[-33.132500,115.478125],[-35.220000,120.409375],[-42.700000,138.409375],[-72.080000,209.409375],[-80.700000,230.409375],[-82.777500,235.313125],[-84.204375,237.720469],[-85.890000,239.369375],[-88.556094,240.028281],[-91.356250,239.390625],[-96.500000,236.719375],[-115.500000,227.149375],[-118.082500,227.133125],[-120.500000,228.069375],[-162.500000,256.739375],[-170.973750,262.574375],[-175.838281,265.477812],[-179.500000,266.789375],[-181.384844,266.498496],[-183.401875,265.566719],[-187.562500,262.415625],[-194.500000,255.409375],[-226.500000,223.409375],[-232.957500,216.975625],[-235.795312,213.122656],[-236.880000,209.409375],[-235.567031,205.754688],[-232.661250,200.879375],[-226.830000,192.409375],[-205.500000,161.409375],[-200.568750,154.221875],[-196.440000,147.409375],[-196.385938,143.771719],[-197.605000,139.390625],[-200.900000,131.409375],[-217.910000,89.449375],[-221.127969,86.020938],[-225.211250,84.229375],[-234.500000,82.609375],[-277.500000,74.609375],[-287.240000,72.863125],[-292.338750,71.331406],[-295.480000,69.129375],[-296.451250,65.389375],[-296.500000,61.409375],[-296.500000,-1.590625],[-296.447500,-5.591875],[-295.480000,-9.360625],[-294.130527,-10.698750],[-292.007969,-11.819375],[-286.333750,-13.505625],[-275.500000,-15.340625],[-233.500000,-23.170625],[-228.029687,-24.003906],[-223.090000,-25.066875],[-218.810313,-27.286719],[-215.320000,-31.590625],[-198.500000,-70.590625],[-195.253750,-77.966875],[-194.330469,-81.892656],[-194.820000,-85.590625],[-206.780000,-103.590625],[-227.360000,-133.590625],[-233.807500,-142.723125],[-236.275625,-148.018750],[-236.677656,-150.451875],[-236.280000,-152.590625],[-232.905156,-157.004062],[-226.726250,-163.508125],[-215.500000,-174.590625],[-191.500000,-198.590625],[-186.401250,-203.671875],[-183.398594,-205.983281],[-180.500000,-207.140625],[-177.010156,-206.419688],[-172.801250,-204.208125],[-165.500000,-199.250625],[-127.500000,-173.170625],[-118.897500,-167.035625],[-113.974688,-164.522188],[-111.640898,-163.903555],[-109.500000,-163.900625],[-92.500000,-170.590625],[-61.520000,-183.410625],[-58.996719,-185.205820],[-57.110000,-187.397812],[-54.785000,-192.665625],[-52.700000,-204.590625],[-44.700000,-247.590625],[-43.212500,-257.161875],[-41.800313,-261.775469],[-39.220000,-265.570625],[-34.366406,-266.527344],[-28.178750,-266.789375],[-16.500000,-266.590625]]);\n }\n}\n\nmodule balloon()\n{\n union () \n {\n \/\/ balloon\n scale ([0.8, 1, 1]) \n cylinder (h = 4, r=10, center = true, $fn=100);\n \n \/\/ middle knot piece\n knotPiece();\n\n \/\/ left knot piece\n rotate ([0, 0, -6.5])\n knotPiece();\n \n \/\/ right knot piece\n rotate ([0, 0, 6.5])\n knotPiece();\n } \n}\n\nmodule knotPiece()\n{\n translate ([0, -10.5, 0]) \n scale ([0.3, 0.8, 1]) \n cylinder (h = 4, r=2, center = true, $fn=100);\n}\n\nmodule blueMoon()\n{\n difference() \n { \n \/\/ blue moon\n cylinder (h = 4, r=10, center = true, $fn=100);\n \n \/\/ top cutout\n translate([5, 5, 0]) \n cylinder (h = 4.20, r=6, center = true, $fn=100);\n \n \/\/ bottom cutout\n translate([5, -5, 0]) \n cylinder (h = 4.20, r=6, center = true, $fn=100);\n \n \/\/ remainder cutout\n translate([10, 0, 5]) \n color(\"red\")\n cylinder (h = 14.20, r=6, center = true, $fn=100); \n }\n}\n\nmodule clover(sideHeartRotation = 100)\n{\n union () \n { \n rotate ([0, 0, sideHeartRotation])\n translate ([0,14,0])\n raisedHeart();\n \n rotate ([0, 0, 0])\n translate ([0,14,0])\n raisedHeart();\n \n rotate ([0, 0, -sideHeartRotation])\n translate ([0, 14, 0])\n raisedHeart();\n \n\/\/ color (\"red\")\n translate([-3.5,-30,0])\n cube (size = [7, 40, 15]);\n }\n}\n\nmodule disk(height = 3)\n{\n cylinder (h = height, r=10.9, center = true, $fn=100); \n}\n\n\nmodule heart()\n{\n rotate ([0, 0, 45])\n linear_extrude(height=10)\n flatHeart();\n}\n\nmodule hourglass()\n{\n union () \n { \n \/\/ top bar\n bar();\n \n \/\/ top glass\n rotate ([0, 0, 180]) \n translate ([0, -43, 0])\n color(\"teal\")\n linear_extrude(height=3)\n horseshoeProjection();\n\n \/\/ botton glass\n translate ([0, -43, 0])\n linear_extrude(height=3)\n horseshoeProjection();\n \n \/\/ bottom bar\n translate ([0, -92, 0]) \n bar();\n }\n}\n\nmodule bar()\n{\n translate ([-30, 43, 0]) \n color (\"black\")\n linear_extrude(height=3)\n square ([60 , 6]);\n}\n\nmodule horseshoe()\n{\n linear_extrude(height=3)\n difference() \n { \n horseshoeProjection();\n \n translate ([0, -1, 0])\n scale ([0.85, .9, 1]) \n horseshoeProjection();\n }\n}\n\nmodule horseshoeProjection()\n{\n rotate ([0, 0, 90])\n translate ([45, 0, 0]) \n projection(cut=true) \/\/ the projection is from http:\/\/blog.bangsplatpresents.com\/?p=1123\n {\n translate( v=[0,0,25] ) \n {\n rotate( a=[0,45,0] ) \n {\n cylinder( r1=25, r2=0, h=100, center=true );\n }\n }\n }\n}\n\nmodule oval(height = 3,\n xScale = 1.2,\n yScale = 1.4)\n{\n scale (v=[xScale, yScale, 1]) \n cylinder(h = height, r=20);\n}\n\nmodule crucifixionCcross(height=2)\n{\n beamWidth = 3;\n \n union()\n {\n \/\/ vertical beam\n xTranslate = -beamWidth \/ 2.0;\n yLength = 13;\n color(\"brown\")\n translate([xTranslate, 0, 0])\n cube([3, yLength, height]);\n\n \/\/ horizontal beam \n yTranslate = yLength * 0.5;\n xLength = yLength * 0.75;\n xTranslateHBeam = -xLength \/ 2.0;\n \n color(\"green\")\n translate([xTranslateHBeam, yTranslate, 0])\n cube([xLength, 3, height]); \n } \n}\n\nmodule starOfDavid()\n{\n height = 3;\n \n union()\n {\n triangle(height = height);\n \n rotate([0, 0, 180])\n color(\"green\")\n triangle(height = height);\n }\n}\n\nmodule crescentStar()\n{\n height = 3;\n\n xyScale = 10;\n scale([xyScale, xyScale,1])\n crescentMoon();\n \n xyTranslate = 25;\n translate([xyTranslate, xyTranslate, 0])\n star();\n}\n\nmodule spurs(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\n }\n}\n\nmodule star(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[9.080000,-22.000000],[10.922500,-17.093750],[12.213125,-14.728281],[13.890000,-13.020000],[15.773906,-12.298125],[18.041250,-12.022500],[22.500000,-11.910000],[34.390000,-10.968750],[40.862812,-10.133906],[45.500000,-9.000000],[28.500000,4.610000],[21.270000,12.170000],[22.870000,22.000000],[27.500000,43.000000],[8.500000,31.580000],[-0.500000,27.200000],[-10.500000,32.320000],[-28.500000,43.000000],[-22.870000,21.000000],[-21.690000,11.090000],[-28.500000,4.130000],[-45.500000,-11.000000],[-11.500000,-13.000000],[-0.500000,-43.000000],[2.289219,-38.828594],[4.908750,-33.096250],[9.080000,-22.000000]]);\n }\n}\n\nmodule texas(h = 3)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n linear_extrude(height=h)\n polygon([[-0.000625,-379.500000],[-0.000625,-252.500000],[0.795937,-245.904219],[3.191875,-241.733750],[7.241562,-238.528906],[12.999375,-234.830000],[23.379375,-227.987500],[29.283750,-224.567187],[33.999375,-222.630000],[42.999375,-222.630000],[48.664219,-221.990156],[54.088125,-220.458750],[59.217656,-218.100469],[63.999375,-214.980000],[71.150625,-208.972500],[74.910469,-206.176875],[78.999375,-204.060000],[106.999375,-198.130000],[113.231875,-196.239375],[117.506875,-194.442500],[124.999375,-191.430000],[143.999375,-189.060000],[160.999375,-184.960000],[165.444414,-184.693203],[170.080938,-185.227500],[179.576875,-187.617500],[188.784063,-189.966250],[193.059648,-190.448984],[196.999375,-190.110000],[200.435176,-188.790957],[203.504531,-186.692031],[209.170625,-181.403750],[212.080723,-178.839004],[215.251094,-176.743594],[218.838418,-175.429824],[222.999375,-175.210000],[227.598437,-176.005234],[232.323125,-177.416875],[241.984375,-181.420000],[251.653125,-185.880625],[260.999375,-189.460000],[267.290313,-190.971719],[272.521875,-191.451250],[283.999375,-190.540000],[292.999375,-190.540000],[300.536875,-189.371406],[307.129375,-187.273750],[313.406875,-184.356719],[319.999375,-180.730000],[326.113438,-177.697500],[332.206875,-175.415000],[344.999375,-171.870000],[352.124375,-169.785000],[355.681250,-168.177188],[358.259375,-166.110000],[359.398906,-163.958750],[359.898125,-161.507500],[359.999375,-156.500000],[359.999375,-118.500000],[360.999375,-101.500000],[361.308125,-79.733750],[362.491406,-68.749844],[365.089375,-58.500000],[369.369531,-50.203281],[375.450625,-41.626250],[382.013594,-32.736094],[387.739375,-23.500000],[392.570625,-12.382500],[394.161719,-6.619375],[395.099375,-0.500000],[395.099375,8.500000],[397.999375,31.500000],[398.000625,41.646250],[397.390469,46.573594],[395.909375,51.500000],[393.784063,55.601406],[391.274375,58.968750],[385.439375,65.500000],[378.478125,74.741250],[372.199375,84.500000],[365.138125,97.467500],[360.990156,104.156562],[356.959375,108.530000],[353.507012,110.351836],[349.562344,111.650312],[340.870625,113.370000],[332.233281,115.074687],[328.356582,116.354414],[324.999375,118.150000],[320.388437,122.233613],[316.306250,127.396406],[308.876875,139.651250],[301.008750,152.297969],[296.378125,157.950605],[290.999375,162.720000],[285.207520,166.355937],[279.138281,169.243750],[266.460625,173.570000],[253.552344,177.288750],[240.999375,181.990000],[235.013594,185.262031],[230.078750,188.835000],[222.251875,196.640000],[215.298750,204.917500],[206.999375,213.180000],[199.696094,218.223906],[192.328125,222.331250],[185.130781,226.942969],[181.669629,229.888262],[178.339375,233.500000],[174.527656,239.822656],[171.883125,246.986250],[169.664219,254.406719],[167.129375,261.500000],[162.033281,270.572656],[156.233125,279.488750],[153.536895,284.407520],[151.226094,289.910469],[149.487871,296.205371],[148.509375,303.500000],[148.726602,309.336465],[149.965938,315.742344],[154.581875,329.431250],[160.499062,342.904531],[165.859375,354.500000],[169.566875,363.312500],[171.068125,368.050625],[171.789375,372.500000],[171.161094,376.538438],[169.058125,378.617500],[165.873281,379.387813],[161.999375,379.500000],[155.657500,379.104219],[149.349375,378.051250],[136.999375,374.780000],[109.568125,365.266250],[95.561406,359.548906],[82.999375,353.750000],[69.848125,346.902500],[63.836406,342.739063],[58.459375,337.490000],[53.696660,330.723262],[49.967656,323.317969],[47.001074,315.435254],[44.525625,307.236250],[39.962969,290.533906],[37.333184,282.352832],[34.109375,274.500000],[12.999375,240.500000],[1.588281,221.689531],[-11.104375,201.698750],[-24.537656,182.358594],[-38.170625,165.500000],[-49.176875,154.292500],[-61.000625,144.000000],[-72.000625,136.180000],[-78.753281,129.575937],[-85.034375,122.347500],[-91.298594,115.505313],[-98.000625,110.060000],[-104.473906,107.202813],[-112.046875,105.487500],[-119.846719,104.668437],[-127.000625,104.500000],[-136.632031,105.592344],[-145.191875,108.626250],[-152.823594,113.597031],[-159.670625,120.500000],[-168.413906,132.824063],[-172.439199,138.787930],[-176.696875,144.212500],[-181.534395,148.792383],[-187.299219,152.222188],[-194.338809,154.196523],[-203.000625,154.410000],[-209.851719,153.008750],[-216.559375,150.302500],[-229.000625,143.300000],[-264.000625,121.350000],[-273.784375,113.561250],[-277.769219,109.072031],[-281.190625,103.500000],[-283.524688,97.963809],[-285.157500,92.341719],[-287.043125,81.103750],[-288.295000,70.313906],[-290.360625,60.500000],[-292.813535,54.220937],[-295.951406,48.236250],[-303.841875,37.090000],[-313.151719,26.941250],[-323.000625,17.670000],[-379.000625,-29.500000],[-385.416094,-36.333750],[-391.279375,-43.985000],[-395.753281,-52.393750],[-397.207598,-56.863438],[-398.000625,-61.500000],[-197.000625,-61.500000],[-197.000625,-379.500000],[-0.000625,-379.500000]]);\n }\n}\n\n\/**\n * this modeled after a 5mm LED\n *\/\nmodule throwieCutout(height=2)\n{\n ledWidth = 10;\n ledHeight = 13;\n \n union()\n {\n \/\/ LED bottom cutout\n ledBottomCutoutLengthX = ledWidth + 1 + 1; \n xTranslate = -ledBottomCutoutLengthX \/ 2.0;\n yLength = 13;\n color(\"brown\")\n translate([xTranslate, 0, 0])\n cube([ledBottomCutoutLengthX, 2, height]);\n\n \/\/ LED middle coutout \n yTranslate = 1.5;\n xLength = ledWidth + 1;\n xTranslateHBeam = -xLength \/ 2.0; \n color(\"green\")\n translate([xTranslateHBeam, yTranslate, 0])\n cube([xLength, 7, height]);\n \n \/\/ LED curved top\n curvedTopTranslateY = (2 + 7);\n curvedTopRadius = (ledWidth \/ 2.0) + 0.5;\n color(\"red\")\n translate([0, curvedTopTranslateY, 0])\n cylinder (h = height, r=curvedTopRadius, $fn=100);\n \n \/\/ battery\n batteryRadius = 10;\n translate([0, -11, 0])\n cylinder (h = height, r=batteryRadius, $fn=100);\n } \n}\n\nmodule christmasTree(height = 3)\n{\n union()\n {\n \/\/ top triangle\n translate([0, 30, 0])\n triangle(10, height);\n \n \/\/ middle triangle\n translate([0, 15, 0])\n color(\"green\")\n triangle(15, height);\n \n \/\/ bottom triangle\n triangle(20, height);\n \n \/\/ trunk\n color(\"brown\")\n translate([-2.5, -15, 0])\n cube([5,6, height]);\n }\n}\n\nmodule triangle(size, height)\n{\n rotate([0, 0, 90])\n cylinder(r=size, \n $fn=3,\n h=height);\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7d5d9fa48be19f9dc165b07c74098299a8719e07","subject":"shapes: cleanup rounded_rectangle_profile, make r param multivariate","message":"shapes: cleanup rounded_rectangle_profile, make r param multivariate\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction rounded_rectangle_profile(size=[1,1],r=[1,1],fn=$fn) = [\nfor (index = [0:fn-1])\nlet(a = index\/fn*360)\n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X*(size.x\/2-r.x)\n+ sign_y(index, fn) * Y*(size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction rounded_rectangle_profile(size=[1,1],r=1,fn=$fn) = [\nfor (index = [0:fn-1])\nlet(a = index\/fn*360)\nr * [cos(a), sin(a)]\n+ sign_x(index, fn) * [size[0]\/2-r,0]\n+ sign_y(index, fn) * [0,size[1]\/2-r]\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"aa16c868d7fbbc40fafbbe843f3346899d9e2682","subject":"hyperbolic top cage","message":"hyperbolic top cage\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/cage.scad","new_file":"3d\/cage.scad","new_contents":"$fs = 0.5;\n$fa = 12;\n\nmodule bar(p1, p2, d=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n \/\/translate(p1) sphere(d=d, center=true);\n \/\/translate(p2) sphere(d=d, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n \/\/cylinder(d=d, h=l, center=false);\n translate([0, 0, l\/2])\n cube(size=[d, d, l+d], center=true);\n \n}\n\nmodule sweep(a1, a2, b1, b2, n=10, d=1) {\n for (i=[0:n]) {\n t1 = i\/n;\n t2 = 1-t1;\n a = [t1*a1[0]+t2*a2[0], t1*a1[1]+t2*a2[1], t1*a1[2]+t2*a2[2]];\n b = [t1*b1[0]+t2*b2[0], t1*b1[1]+t2*b2[1], t1*b1[2]+t2*b2[2]];\n \n bar(a, b, d);\n }\n}\n\nmodule hyper(a, c, b, n=10, d=1) {\n sweep(a, c, c, b, n, d);\n}\n\nmodule hyper3d(p1, p2, p3, c, n=10, d=1) {\n sweep(p1, c, c, p2, n, d);\n sweep(p1, c, c, p3, n, d);\n sweep(p2, c, c, p3, n, d);\n}\n\nmodule sheet(a1, a2, b1, b2, n=10, d=1) {\n sweep(a1, a2, b1, b2, n, d);\n sweep(a1, a2, b1, b1, n, d);\n sweep(a2, a2, b1, b2, n, d);\n\n bar(a1, a2, d);\n bar(b1, b2, d);\n}\n\n\nmodule skew(dims) {\n matrix = [\n [ 1, dims[0], dims[1], 0 ],\n [ dims[2], 1, dims[4], 0 ],\n [ dims[5], dims[3], 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n multmatrix(matrix) children();\n}\n\nmodule cagetop()\n{\n for (x = [-20, 0, 20, 40]) translate([x-10, 0, 81]) cube(size=[2, 60, 2], center=true);\n for (y = [-30, 0, 30]) translate([0, y, 81]) cube(size=[60, 2, 2], center=true);\n\n translate([43, 0, 67]) skew([0, -0.9, 0, 0, 0, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ front sides\n translate([33, -33, 67]) skew([0, -0.2, 0, 0, 0.2, 0]) cube(size=[2, 2, 30], center=true);\n translate([33, 33, 67]) skew([0, -0.2, 0, 0, -0.2, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ rear\n translate([-42, -34.5, 67]) skew([0, 0.8, 0, 0, 0.3, 0]) cube(size=[2, 2, 30], center=true);\n translate([-42, 34.5, 67]) skew([0, 0.8, 0, 0, -0.3, 0]) cube(size=[2, 2, 30], center=true);\n}\n\nmodule cage(round=false)\n{\n if (round) minkowski() {\n cagetop();\n sphere(r=1);\n } else\n cagetop();\n\n #translate([ 36, 36, 45]) cylinder(d=3, h=7, center=false);\n #translate([ 36, -36, 45]) cylinder(d=3, h=7, center=false);\n\n #translate([-54, -39, 45]) cylinder(d=3, h=7, center=false);\n #translate([-54, 39, 45]) cylinder(d=3, h=7, center=false);\n}\n\n\/\/sweep([0,0,100], [0,0,0], [0,0,0], [100,0,0], 10);\n\n\/\/cage(false);\n\n\nunion() {\n \n d = 4;\n n = 4;\n \n top = 81;\n btm = 52;\n \n lft = 30;\n rgh = -30;\n \n front = 30;\n mid = 10;\n rear = -30;\n \n cntr = 0;\n\n \/\/for (x = [front, mid, rear]) bar([x, lft, top], [x, rgh, top]);\n \/\/for (y = [lft, cntr, rgh]) bar([front, y, top], [rear, y, top]);\n \n btm_fl = [36, 36, btm];\n btm_fr = [36, -36, btm];\n btm_rl = [-54, 39, btm];\n btm_rr = [-54, -39, btm];\n\n btm_fc = [60, 0, btm];\n\n top_fl = [front, lft, top];\n top_fr = [front, rgh, top];\n top_rl = [rear, lft, top];\n top_rr = [rear, rgh, top];\n \n \n\/\/ hyper3d(btm_fl, [mid, lft, top], [front, cntr, top], top_fl, n, d);\n\/\/ hyper3d(btm_fr, [mid, rgh, top], [front, cntr, top], top_fr, n, d);\n\/\/ hyper3d(btm_rl, [mid, lft, top], [rear, cntr, top], top_rl, n, d);\n\/\/ hyper3d(btm_rr, [mid, rgh, top], [rear, cntr, top], top_rr, n, d);\n \n \/\/hyper(btm_fc, [front, cntr, top], top_fl, 10, d); \n \/\/hyper(btm_fc, [front, cntr, top], top_fr, 10, d); \n \n sheet(btm_fc, [front, cntr, top], top_fl, btm_fl, n, d); \n sheet(btm_fc, [front, cntr, top], top_fr, btm_fr, n, d); \n\n sheet(btm_fl, top_fl, top_rl, btm_rl, n, d); \n sheet(btm_fr, top_fr, top_rr, btm_rr, n, d); \n\n sheet(btm_rr, top_rr, top_rl, btm_rl, n, d); \n \/\/sheet([mid, rgh, top], top_rr, top_rl, [mid, lft, top], n, d); \n\n\n \/\/sheet(top_rr, top_fr, top_fl, top_rl, n, d); \n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec '3d\/cage.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"2ca7d31720eacf2604eb088f74ece38edadd51ee","subject":"x\/carriage: color z sensor","message":"x\/carriage: color z sensor\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n fanduct();\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\n\/*explode=N;*\/\nexplode=20*Y;\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n te(extruder_offset_a, explode)\n extruder_a();\n\n te(extruder_offset_b+-Y*.1, explode)\n {\n extruder_b();\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n te(hotend_mount_offset)\n hotend_clamp();\n\n attach(hotend_mount_conn, hotend_conn)\n x_extruder_hotend();\n }\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x==-1);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n fanduct();\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\n\/*explode=N;*\/\nexplode=20*Y;\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n te(extruder_offset_a, explode)\n extruder_a();\n\n te(extruder_offset_b+-Y*.1, explode)\n {\n extruder_b();\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n te(hotend_mount_offset)\n hotend_clamp();\n\n attach(hotend_mount_conn, hotend_conn)\n x_extruder_hotend();\n }\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x==-1);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"0b76499d1a00f9e0ed460024a874eab089a66fb8","subject":"too narrow towers w\/o cooling fan is always bad at the end","message":"too narrow towers w\/o cooling fan is always bad at the end\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_printer_oozing_testing\/oozing_test.scad","new_file":"3d_printer_oozing_testing\/oozing_test.scad","new_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n\nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r=5\/2, h=20);\n","old_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n \nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r1=5\/2, r2=2\/2, h=20);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"86f127236d80b3dd849e48d1d745f632a87b0985","subject":"final version of phone strain relief","message":"final version of phone strain relief\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/phone-sr-v1.scad","new_file":"openscad\/strain-relief\/phone-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot phones - driver station and robot controller\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\nbase_thick = 1;\ncable_thick = 3;\n\n\n\/\/ Phone strain relief WITHOUT the\n\/\/ cutout to make the phone fit snuggly\nmodule phone_strain_relief0(cable_d) {\n cable_w = 12;\n base_w = 55;\n base_d = 30;\n ro = 2;\n ri = 5;\n cable_pad_h = 2.5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n cable_gap_d = 1; \/\/ a small gap in x between the start of the center protrusion.\n \n xoff = (base_w-cable_w)\/2;\n support_d = cable_d - cable_gap_d;\n shorten_T_d = cable_d - cable_gap_d - EPSILON - ro;\n translate([xoff, support_d, 0]) rotate([90, 0, 0]) oblong(cable_w, base_thick + cable_pad_h, ro, support_d);\n translate([0, shorten_T_d, 0]) \n T_channel(\n cable_w, cable_d - shorten_T_d,\n base_w, base_d, \n xoff,\n ro, ri, \n cable_thick);\n}\n\nmodule phone_strain_relief() {\n $fn = 50;\n cable_d = 18;\n curve_r = 8; \/\/ Curve around base of phone\n curve_offset = 2;\n difference() {\n phone_strain_relief0(cable_d);\n translate([-EPSILON, cable_d-curve_offset, base_thick]) rotate([90,0, 90]) oblong(LARGE, LARGE, curve_r, LARGE);\n }\n}\n\n\/\/ A vertical sliver of the strain relief - to print and\n\/\/ test dimensions\nmodule test_slice() {\n base_w = 55;\n xoff = base_w\/2;\n\n intersection() {\n phone_strain_relief();\n translate([xoff, 0, 0]) cube([2, LARGE, LARGE]);\n }\n}\n\nphone_strain_relief();\n\/\/test_slice();\n\n\n","old_contents":"\/\/\n\/\/ Strain relief for FTC robot phones - driver station and robot controller\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\nbase_thick = 1;\ncable_thick = 3;\n\n\n\/\/ Phone strain relief WITHOUT the\n\/\/ cutout to make the phone fit snuggly\nmodule phone_strain_relief0(cable_d) {\n cable_w = 12;\n base_w = 55;\n base_d = 30;\n ro = 2;\n ri = 5;\n cable_pad_h = 1.9; \/\/ the base of the lug is slightly elevated (z) from the switch base\n cable_gap_d = 1; \/\/ a small gap in x between the start of the center protrusion.\n xoff = (base_w-cable_w)\/2;\n support_d = cable_d - cable_gap_d;\n shorten_T_d = cable_d - cable_gap_d - EPSILON - ro;\n translate([xoff, support_d, 0]) rotate([90, 0, 0]) oblong(cable_w, cable_thick + cable_pad_h, ro, support_d);\n translate([0, shorten_T_d, 0]) \n T_channel(\n cable_w, cable_d - shorten_T_d,\n base_w, base_d, \n xoff,\n ro, ri, \n cable_thick);\n}\n\nmodule phone_strain_relief() {\n $fn = 50;\n cable_d = 18;\n curve_r = 8; \/\/ Curve around base of phone\n curve_offset = 2;\n difference() {\n phone_strain_relief0(cable_d);\n translate([-EPSILON, cable_d-curve_offset, base_thick]) rotate([90,0, 90]) oblong(LARGE, LARGE, curve_r, LARGE);\n }\n}\n\n\/\/ A vertical sliver of the strain relief - to print and\n\/\/ test dimensions\nmodule test_slice() {\n base_w = 55;\n xoff = base_w\/2;\n\n intersection() {\n phone_strain_relief();\n translate([xoff, 0, 0]) cube([2, LARGE, LARGE]);\n }\n}\n\n\/\/phone_strain_relief();\ntest_slice();\n\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"1c5afb9a7a4b92b87b6931fdab6816704d1f6c79","subject":"Faster voronoi type 2, fixed lid opening","message":"Faster voronoi type 2, fixed lid opening\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/VoronoiShell.scad","new_file":"hardware\/sandbox\/VoronoiShell.scad","new_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\nVoronoiShell_STL();\n\n\n\n\nmodule VoronoiShell_STL(type=2) {\n\tprintedPart(\"printedparts\/VoronoiShell.scad\", \"Voronoi Shell\", \"VoronoiShell_STL()\") {\n\t view(t=[-2, 6, 14], r=[63, 0, 26], d=726);\n\n color([Level2PlasticColor[0], Level2PlasticColor[1], Level2PlasticColor[2], 1])\n if (UseSTL) {\n import(str(STLPath, \"VoronoiShell.stl\"));\n } else {\n\t\t\t\tif (type==1) {\n\t\t\t\t\tVoronoiShell_Model_1();\n\t\t\t\t} else{\n\t\t\t\t\tVoronoiShell_Model_2();\n\t\t\t\t}\n }\n }\n}\n\n\nmodule VoronoiShell_Model_1() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\tdifference() {\n\t\t\t\t\trotate_extrude()\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tpolygon(\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\tlinear_extrude(or)\n\t\t\t\t\t\t\trandom_voronoi(\n\t\t\t\t\t\t\t\tn = 240, nuclei = false,\n\t\t\t\t\t\t\t\tL = or+30, thickness = 1,\n\t\t\t\t\t\t\t\tround = 1, min = 0, max = 2*or,\n\t\t\t\t\t\t\t\tseed = 7, center = true\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\/\/ hollow the middle of the voronoi mesh\n\t\t\t\t\t\tcylinder(r=ShellOpeningDiameter\/2 + 5, h=or);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\n\t\t\t\t\/\/ twist lock\n\t\t\t\tShell_TwistLock();\n\t\t\t}\n\t\t}\n}\n\n\n\nmodule polarVoronoi(points, or=50, L = 200, thickness = 1) {\n\tfor (p = points) {\n \/\/polarLat = atan2(p[1], p[0]);\n polarLon = sqrt(p[1]*p[1] + p[0]*p[0]);\n\n\t\tt = thickness * polarLon \/ 90;\n\n \/\/ calc rot vector\n rv = [ p[1], -p[0], 0 ];\n\n if (polarLon < 90 )\n rotate(a=-polarLon, v=rv)\n linear_extrude(or, scale=or)\n scale([1\/or,1\/or,1])\n translate([-p[0], -p[1], 0])\n intersection_for(p1 = points){\n if (p != p1) {\n\t\t\t\t\tdsqr = (p[1] - p1[1])*(p[1] - p1[1]) + (p[0] - p1[0])*(p[0] - p1[0]);\n\t\t\t\t\tif (dsqr < or*or) {\n\t\t\t\t\t\tangle = 90 + atan2(p[1] - p1[1], p[0] - p1[0]);\n\n\t translate((p + p1) \/ 2 - normalize(p1 - p) * (t))\n\t rotate([0, 0, angle])\n\t translate([-L, -L])\n\t square([2 * L, L]);\n\t\t\t\t\t}\n }\n }\n\n\t}\n}\n\nmodule polarVoronoiWrapper() {\n numPoints = 300;\n or = BaseDiameter\/2 + Shell_NotchTol + dw + 2;\n\n function x(r,a) = r * cos(a);\n function y(r,a) = r * sin(a);\n\n seed = 139;\n rand_vec = [rands(20,110 * 1.1,numPoints,seed), rands(0,360,numPoints,seed+1)];\n\n point_set = [\n for (i=[0:numPoints-1])\n let (r = rand_vec[0][i], a = rand_vec[1][i])\n [ x(r,a), y(r,a) ]\n ];\n\n\tpolarVoronoi(point_set, or=or, L = 2*or, thickness = 1.5);\n}\n\n\nmodule VoronoiShell_Model_2() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\t\/\/ skirt\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdonutSector(\n\t\t\t\t\t\tor=or,\n\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\ta=8\n\t\t\t\t\t);\n\n\t\t\t\t\/\/ shell coupling\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ skirt\n\t\t\t\t\t\trotate([0,0,55])\n\t\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\t\ta=10\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\tpolygon(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t}\n\n\n\t\t\t\tdifference() {\n\t\t\t\t\trotate_extrude()\n\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=57\n\t\t\t\t\t\t);\n\n\t\t\t\t\tpolarVoronoiWrapper();\n\t\t\t\t}\n\n\n\t\t\t\t\/\/ twist lock\n\t\t\t\tShell_TwistLock();\n\t\t\t}\n\t\t}\n}\n","old_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\nVoronoiShell_STL();\n\n\n\n\nmodule VoronoiShell_STL(type=2) {\n\tprintedPart(\"printedparts\/VoronoiShell.scad\", \"Voronoi Shell\", \"VoronoiShell_STL()\") {\n\t view(t=[-2, 6, 14], r=[63, 0, 26], d=726);\n\n color([Level2PlasticColor[0], Level2PlasticColor[1], Level2PlasticColor[2], 1])\n if (UseSTL) {\n import(str(STLPath, \"VoronoiShell.stl\"));\n } else {\n\t\t\t\tif (type==1) {\n\t\t\t\t\tVoronoiShell_Model_1();\n\t\t\t\t} else{\n\t\t\t\t\tVoronoiShell_Model_2();\n\t\t\t\t}\n }\n }\n}\n\n\nmodule VoronoiShell_Model_1() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\tdifference() {\n\t\t\t\t\trotate_extrude()\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tpolygon(\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\tlinear_extrude(or)\n\t\t\t\t\t\t\trandom_voronoi(\n\t\t\t\t\t\t\t\tn = 240, nuclei = false,\n\t\t\t\t\t\t\t\tL = or+30, thickness = 1,\n\t\t\t\t\t\t\t\tround = 1, min = 0, max = 2*or,\n\t\t\t\t\t\t\t\tseed = 7, center = true\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\/\/ hollow the middle of the voronoi mesh\n\t\t\t\t\t\tcylinder(r=ShellOpeningDiameter\/2 + 5, h=or);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\n\t\t\t\t\/\/ twist lock\n\t\t\t\tShell_TwistLock();\n\t\t\t}\n\t\t}\n}\n\n\n\nmodule polarVoronoi(points, or=50, L = 200, thickness = 1) {\n\tfor (p = points) {\n \/\/polarLat = atan2(p[1], p[0]);\n polarLon = sqrt(p[1]*p[1] + p[0]*p[0]);\n\n\t\tt = thickness * polarLon \/ 90;\n\n \/\/ calc rot vector\n rv = [ p[1], -p[0], 0 ];\n\n if (polarLon < 90 )\n rotate(a=-polarLon, v=rv)\n linear_extrude(or, scale=or)\n scale([1\/or,1\/or,1])\n translate([-p[0], -p[1], 0])\n intersection_for(p1 = points){\n if (p != p1) {\n angle = 90 + atan2(p[1] - p1[1], p[0] - p1[0]);\n\n translate((p + p1) \/ 2 - normalize(p1 - p) * (t))\n rotate([0, 0, angle])\n translate([-L, -L])\n square([2 * L, L]);\n }\n }\n\n\t}\n}\n\nmodule polarVoronoiWrapper() {\n numPoints = 300;\n or = BaseDiameter\/2 + Shell_NotchTol + dw + 2;\n\n function x(r,a) = r * cos(a);\n function y(r,a) = r * sin(a);\n\n seed = 139;\n rand_vec = [rands(20,110 * 1.1,numPoints,seed), rands(0,360,numPoints,seed+1)];\n\n point_set = [\n for (i=[0:numPoints-1])\n let (r = rand_vec[0][i], a = rand_vec[1][i])\n [ x(r,a), y(r,a) ]\n ];\n\n\tpolarVoronoi(point_set, or=or, L = 2*or, thickness = 1.5);\n}\n\n\nmodule VoronoiShell_Model_2() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\t\/\/ skirt\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdonutSector(\n\t\t\t\t\t\tor=or,\n\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\ta=8\n\t\t\t\t\t);\n\n\t\t\t\t\/\/ shell coupling\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ skirt\n\t\t\t\t\t\trotate([0,0,53])\n\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=4\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tpolygon(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t}\n\n\n\t\t\t\tdifference() {\n\t\t\t\t\trotate_extrude()\n\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=57\n\t\t\t\t\t\t);\n\n\t\t\t\t\tpolarVoronoiWrapper();\n\t\t\t\t}\n\n\n\t\t\t\t\/\/ twist lock\n\t\t\t\tShell_TwistLock();\n\t\t\t}\n\t\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"877fdae34e1a1b50d499269f79567491b5465599","subject":"maddening","message":"maddening\n","repos":"JoeSuber\/QuickerPicker","old_file":"chandra.scad","new_file":"chandra.scad","new_contents":"lenseD = 60;\ndepth = 20;\nrim = 4;\ncenter=18;\n\nnoseparts();\n\neyeparts();\n\nmodule noseparts(){\n translate([25,0,0])\n hingepin();\n translate([-14,0,0])\n clip();\n}\n\nmodule eyeparts(){\ntranslate([-30,0,0]) rotate([0,0,-90])\n lensebody(rotar=360*.3);\nmirror([1,0,0])\n translate([-45,0,0]) rotate([0,0,-90])\n lensebody(rotar=360*.3, flip=1);\n}\n\nmodule torus(r=lenseD\/2, circ=rim){\n\trotate_extrude($fn=96){\n\t\ttranslate([r,0,0])\n\t\t\tcircle(r=circ, $fn=36);\n\t\t}\n}\n\nmodule head(){\n\tscale([1.3,1.6,1])\n\t\tsphere(r=lenseD, $fn=64);\n}\n\nmodule flange(rad=lenseD\/2-3, flare=0.4){\n\trotate_extrude($fn=64){\n\t\ttranslate([rad,0,0]) rotate([0,0,0])\n\t\t\tdifference(){\n\t\t\t\tscale([1.6,.5,1]) \n\t\t\t\t\tcircle(r=3, $fn=36);\n\t\t\t\ttranslate([-2,0,0]) scale([1.6,1,1])\n\t\t\t\t\tcircle(r=3, center=true);\n\t\t\t}\n\t}\n}\n\n\/\/***********************************************\n\/\/ ***** nose parts **************\n\nnose=18;\nbase=1.2;\nshaft=3;\npinh=1;\npinthk=1;\nknobrad=2.2;\n\nmodule hingepin(fat=0){\n\/\/ the round part everything attaches to \n pinD=nose\/2;\n pinring= pinD - 2;\n cylinder(r=pinD\/2+1+fat, h=base, $fn=36);\n translate([0,0,base])\n cylinder(r=pinD\/2+fat, h=shaft, $fn=30);\n translate([0,0,base+shaft])\n cylinder(r=pinring\/2+fat, h=pinh+fat, $fn=48);\n translate([0,0,base+shaft+pinh])\n cylinder(r1=pinring\/2+fat, r2=pinring\/2+pinthk+fat, h=pinthk, $fn=48);\n}\n\nmodule clip(){\n \/\/ the c-clip that holds it all on the hingepin\n bigrad=(nose-4)\/2;\n difference(){\n cylinder(r=bigrad, h=pinh*2, $fn=36);\n translate([0,0,-(base+shaft)+0.05])\n hingepin(fat=.13);\n translate([0,bigrad\/2, pinthk])\n cube([nose\/2-pinthk*2, bigrad, pinthk*3+.1], center=true);\n }\n \/\/knobbies\n for (i=[44,136]){\n translate([bigrad*cos(i), bigrad*sin(i), 0])\n cylinder(r=knobrad, h=pinthk*4, $fn=24);\n }\n}\n\nmodule noseconnect(cut=1){\n \/\/ the plate that hooks to hingepin from the goggle-eye\n vital=.75*nose;\n curve= nose\/4;\n intersection(){\n difference(){\n minkowski(){\n cube([vital,vital,shaft - 0.1], center=false);\n cylinder(r=curve, h=0.05, center=false, $fn=32);\n }\n translate([vital-curve\/2, vital-curve\/2, -0.05 - base]){\n hingepin(fat=0.21);\n translate([0,0,base+shaft\/2])\n cylinder(r=vital*.75, h=shaft\/2+.1, $fn=36);\n }\n \n }\n scale([2.2,1,1]) rotate([0,0,0])\n cylinder(r=vital, h=shaft, $fn=64, center=false);\n }\n} \n\nmodule lensebody(rad=lenseD\/2, d=depth, rotar=0){\n translate([0,0,8]){\n\t difference(){\n rotate([0,0,rotar])\n\t\t union(){\n\t\t\t cylinder(r=rad, h=d-10, $fn=128, center=true);\n\t\t\t translate([0,0,-(d\/2)])\n\t\t\t\t cylinder(r1=rad-rim, r2=rad, h=d-10, $fn=128, center=true);\n\t\t\t translate([0,0,-3])\t\n\t\t\t\t torus(r=rad-1, circ=2);\n\t\t\t translate([0,0,4]) rotate([0,6,0])\n\t\t\t\t flange();\n\t\t\t for (i=[1:20:360]){\n\t\t\t\t translate([rad*cos(i), rad*sin(i), 0]) rotate([0,0,i])\n\t\t\t\t\t minkowski(){\n\t\t\t\t\t\t cube([1.5,0.5,10], center=true);\n\t\t\t\t\t\t rotate([0,90,0])\n\t\t\t\t\t\t\t cylinder(r=.5, h=.1, center=true, $fn=16);\n\t\t\t\t\t }\n\t\t\t }\n if (flip==1){\n translate([24.5,5,-2]) rotate([180,0,33])\n noseconnect();\n }\n else {\n translate([24.5,5,-5]) rotate([0,0,-57])\n noseconnect();\n }\n }\n\t\t translate([0,0,-d+7])\n\t\t\t cylinder(r=rad-1, h=d\/2, $fn=128, center=true);\n\t\t translate([0,0,-d\/3])\n\t\t\t cylinder(r=rad-rim, h=d\/4, $fn=128, center=true);\n\t\t translate([0,0,d\/2])\n\t\t\t cylinder(r=rad-1, h=d\/2+0.1, $fn=128, center=true);\n\t\t translate([0,0,0])\n assign(lenserad = rad - 2.2){\n\t\t\t cylinder(r=lenserad, h=d\/2+2, $fn=128, center=true);\n echo(\"lense radius (as rendered) is: \", lenserad);\n echo(\"so the diameter is: \", 2*lenserad);}\n\t\t translate([0,d*1.2,d*2.9])\t\n\t\t\t head();\n }\n\t}\n}\n\n\n\n","old_contents":"lenseD = 60;\ndepth = 20;\nrim = 4;\ncenter=18;\n\nflange();\n\nmirror([1,0,0])\n\ttranslate([-lenseD\/2-center\/2,0,0])\n\t\tlensebody();\n\ntranslate([-lenseD\/2-center\/2,0,0])\n\tlensebody();\n\/\/torus();\n\nmodule torus(r=lenseD\/2, circ=rim){\n\trotate_extrude($fn=96){\n\t\ttranslate([r,0,0])\n\t\t\tcircle(r=circ, $fn=36);\n\t\t}\n}\n\nmodule head(){\n\tscale([4,7,1])\n\t\tsphere(r=lenseD, $fn=64);\n}\n\nmodule flange(rad=lenseD\/2, flare=0.4){\n\trotate_extrude($fn=64){\n\t\ttranslate([rad,0,0]) rotate([0,0,0])\n\t\t\tdifference(){\n\t\t\t\tscale([1.6,1,1]) \n\t\t\t\t\tcircle(r=3, $fn=36);\n\t\t\t\ttranslate([-2,0,0]) scale([1.6,1,1])\n\t\t\t\t\tcircle(r=3, center=true);\n\t\t\t}\n\t}\n}\n\nmodule lensebody(rad=lenseD\/2, d=depth){\n\tdifference(){\n\t\tunion(){\n\t\t\tcylinder(r=rad, h=d-10, $fn=128, center=true);\n\t\t\ttranslate([0,0,-(d\/2)])\n\t\t\t\tcylinder(r1=rad-rim, r2=rad, h=d-10, $fn=128, center=true);\n\t\t\ttranslate([0,0,-3])\t\n\t\t\t\ttorus(r=rad-1, circ=2);\n\t\t\ttranslate([0,0,4]) rotate([0,6,0])\n\t\t\t\tflange();\n\t\t\tfor (i=[1:20:360]){\n\t\t\t\ttranslate([rad*cos(i), rad*sin(i), 0]) rotate([0,0,i])\n\t\t\t\t\tminkowski(){\n\t\t\t\t\t\tcube([1.5,0.5,10], center=true);\n\t\t\t\t\t\trotate([0,90,0])\n\t\t\t\t\t\t\tcylinder(r=.5, h=.1, center=true, $fn=16);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ttranslate([0,0,-d+7])\n\t\t\tcylinder(r=rad-1, h=d\/2, $fn=128, center=true);\n\t\ttranslate([0,0,-depth\/3])\n\t\t\tcylinder(r=rad-rim, h=d\/4, $fn=128, center=true);\n\t\ttranslate([0,0,d\/2])\n\t\t\tcylinder(r=rad-1, h=d\/2+0.1, $fn=128, center=true);\n\t\ttranslate([0,0,0])\n\t\t\tcylinder(r=rad-3, h=d\/2, $fn=128, center=true);\n\t\ttranslate([1.7*rad*2,d*2.1,d*2.8])\t\n\t\t\thead();\n\t}\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ab525d537422b3500528ab89a43b18d0c09df9d3","subject":"fanduct: add fan","message":"fanduct: add fan\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"fanduct.scad","new_file":"fanduct.scad","new_contents":"include \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\nuse \n\ninclude \n\nfunction vec_xyz(v) = [for(v=v) let(v_=v) [v_[0],v_[1], v_[2]]];\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nlet(filtered = filter(slice,U))\nconcat(\n [S[0]],\n nSpline(filtered, N)\n );\n\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($preview_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n\n sweepshape(A,true);\n }\n else\n {\n sweepshape(A,true);\n }\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nuse \nuse \nuse \n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct()\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n fanduct_conn_fan = [[0,0,-throat_seal_h\/2],-Z];\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 90)\n fan_5015S();\n\n fanduct_throat(throat_seal_h);\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nfanduct();\n\/*part_fanduct();*\/\n","old_contents":"include \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\nuse \n\nfunction vec_xyz(v) = [for(v=v) let(v_=v) [v_[0],v_[1], v_[2]]];\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nlet(filtered = filter(slice,U))\nconcat(\n [S[0]],\n nSpline(filtered, N)\n );\n\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct blades\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($preview_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n\n sweepshape(A,true);\n }\n else\n {\n sweepshape(A,true);\n }\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct()\n{\n $fn=32;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,13]+[fanduct_wallthick,fanduct_wallthick,0],align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nfanduct();\n\/*part_fanduct();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"0372127fcdd139dd7c5e9969ee2cf53e91a1c2af","subject":"transforms: make size_align tolerate U args for extra* params","message":"transforms: make size_align tolerate U args for extra* params\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9a44133952d71ada593ae0a4f54b2aba8a21ca16","subject":"xaxis\/ends: position idleholders better for print","message":"xaxis\/ends: position idleholders better for print\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2-1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[5], h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders, width=xaxis_beltpath_width);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n translate([x*45,25,0])\n translate([x*-0,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2-1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[5], h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders, width=xaxis_beltpath_width);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e894f3255c21215415d06edcdb65087e62a44ff6","subject":"Debugging ProMicro","message":"Debugging ProMicro\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/ProMicroDebugging.scad","new_file":"hardware\/sandbox\/ProMicroDebugging.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\n\/\/ Pro Micro\/Mini\nboard_colour = [26\/255, 90\/255, 160\/255];\nmetal_colour = [220\/255, 220\/255, 220\/255];\n\n\/\/ Show board clearance area for components\nboard_clearance = 3;\nshow_clearance = true;\n\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n micro_usb_area = [7.7, 5.2];\n micro_usb_height = 2.7;\n\n color(metal_colour)\n translate([pcbWidth\/2 - holeInset, pcbLength - holeSpace, pcbHeight])\n linear_extrude(height=2.7)\n square(size = micro_usb_area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(board_colour)\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (show_clearance)\n color(board_colour, 0.1)\n translate([-holeInset, -holeInset, pcbHeight])\n linear_extrude(height=board_clearance)\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\n*ArduinoPro(\"mini\");\nArduinoPro(\"micro\");","old_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: None\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size=[pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ Add headers to either side along y, leaving room for end header\n \/\/ distance between the two header rows\n rowpitch=pcbWidth-holeInset*2;\n \/\/ amount of holes in each row, leaving room for end header and insets\n rowcount=((pcbLength-holeSpace-holeInset*2)\/holeSpace);\n\n \/\/ FIXME: rowcount doesn't get fully interated\n \/\/ rowcount=11;\n\n echo(\"Count=\", rowcount * 10000);\n for (x=[0, rowpitch], y=[0:rowcount]) {\n echo(\"Loop=\", y);\n translate([x, y*holeSpace, 0]) {\n \/\/ Standard PCB hole\n circle(r=holeDiam\/2);\n }\n }\n echo(\"Count=\", rowcount);\n}\n\nmodule ArduinoPro(type=\"mini\") {\n \/\/ Common Features between Pro Mini and Pro Micro\n difference() {\n \/\/ Common PCB\n ArduinoPro_PCB();\n\n \/\/ Common headers\n ArduinoPro_Headers();\n }\n\n \/\/ Features for Pro Mini\n if (type==\"mini\") {\n }\n\n \/\/ Features for Pro Micro\n if (type==\"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c8e72062d465c2919a81bc0b19a32398a2c1afa3","subject":"Connector array collection","message":"Connector array collection\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ULN2003DriverBoard.scad","new_file":"hardware\/vitamins\/ULN2003DriverBoard.scad","new_contents":"\/*\n\tVitamin: ULN2003DriverBoard\n\tModel of a stepper driver board.\n\tBased on http:\/\/42bots.com\/tutorials\/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno\/\n\t\n\tAuthors:\n\t\tRobert Longbottom\n\t\n\tLocal Frame: \n\t\tCentred on the bottom left mounting hole\n\t\n\tParameters:\n\t\tNone\n\t\t\n\tReturns:\n\t\tA Stepper Driver Board, rendered and colored\n*\/\n\nULN2003Driver_BoardHeight = 35;\nULN2003Driver_BoardWidth = 30;\nULN2003Driver_PCBThickness = 1.5;\nULN2003Driver_HoleDia = 3;\nULN2003Driver_HoleInset = 2.5;\n\n\/\/ Connectors\nULN2003DriverBoard_Con_LowerLeft\t= [ [0, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_LowerRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperLeft\t= [ [0, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\n\nULN2003DriverBoard_Cons = [\n\tULN2003DriverBoard_Con_LowerLeft, \n\tULN2003DriverBoard_Con_LowerRight, \n\tULN2003DriverBoard_Con_UpperLeft,\n\tULN2003DriverBoard_Con_UpperRight\n];\n\nmodule ULN2003DriverBoard() {\n\n\tif (DebugCoordinateFrames) {\n\t\tframe();\n\t}\n\t\n\tif (DebugConnectors) {\n\t\tconnector(ULN2003DriverBoard_Con_LowerLeft);\n\t\tconnector(ULN2003DriverBoard_Con_LowerRight);\n\t\tconnector(ULN2003DriverBoard_Con_UpperLeft);\n\t\tconnector(ULN2003DriverBoard_Con_UpperRight);\n\t} \n\n\t\/\/ offset origin to bottom left\n\ttranslate([(ULN2003Driver_BoardWidth \/ 2) - ULN2003Driver_HoleInset, (ULN2003Driver_BoardHeight \/ 2) - ULN2003Driver_HoleInset, 0])\n\t{\n\t\t\/\/ Base PCB\n\t\tlinear_extrude(ULN2003Driver_PCBThickness)\n\t\t\tdifference() {\n\t\t\t\tsquare([ULN2003Driver_BoardWidth, ULN2003Driver_BoardHeight], center=true);\n\t\n\t\t\t\t\/\/ Mounting holes\n\t\t\t\tfor (i = [0:1], j = [0:1])\n\t\t\t\t\tmirror([i, 0, 0])\n\t\t\t\t\tmirror([0, j, 0])\n\t\t\t\t\ttranslate([ULN2003Driver_BoardWidth \/ 2 - ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight \/ 2 - ULN2003Driver_HoleInset, 0])\n\t\t\t\t\t\tcircle(r = ULN2003Driver_HoleDia \/ 2);\n\t\t\t}\n\t \n\t\t\/\/ Move us to the bottom left of the PCB\n\t\ttranslate([-ULN2003Driver_BoardWidth \/ 2, -ULN2003Driver_BoardHeight \/ 2, 0]) {\n\t\n\t\t\t\/\/ ULN2003 chip\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([1, 8, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([20, 10, 8]);\n\t\n\t\t\t\/\/ Arduino header\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([5, 4.5, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([10, 3, 15]);\n\t\n\t\t\t\/\/ Stepper Connection\n\t\t\tcolor(\"white\")\n\t\t\ttranslate([1.5, 19, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tdifference() {\n\t\t\t\t\tcube([15.5, 6, 8]);\n\t\t\t\t\ttranslate([1, 1, 1])\n\t\t\t\t\t\tcube([13.5, 4, 8]);\n\t\t\t\t}\n\t\n\t\t\t\/\/ Power & On\/Off Jumper\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([23, 8, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([3, 10, 15]);\n\t\n\t\t\t\/\/ LEDS\n\t\t\ttranslate([6, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([10, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([14.5, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([19, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t}\n\t}\n}\n","old_contents":"\/*\n\tVitamin: ULN2003DriverBoard\n\tModel of a stepper driver board.\n\tBased on http:\/\/42bots.com\/tutorials\/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno\/\n\t\n\tAuthors:\n\t\tRobert Longbottom\n\t\n\tLocal Frame: \n\t\tCentred on the bottom left mounting hole\n\t\n\tParameters:\n\t\tNone\n\t\t\n\tReturns:\n\t\tA Stepper Driver Board, rendered and colored\n*\/\n\nULN2003Driver_BoardHeight = 35;\nULN2003Driver_BoardWidth = 30;\nULN2003Driver_PCBThickness = 1.5;\nULN2003Driver_HoleDia = 3;\nULN2003Driver_HoleInset = 2.5;\n\n\/\/ Connectors\nULN2003DriverBoard_Con_LowerLeft\t= [ [0, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_LowerRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperLeft\t= [ [0, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\n\nmodule ULN2003DriverBoard() {\n\n\tif (DebugCoordinateFrames) {\n\t\tframe();\n\t}\n\t\n\tif (DebugConnectors) {\n\t\tconnector(ULN2003DriverBoard_Con_LowerLeft);\n\t\tconnector(ULN2003DriverBoard_Con_LowerRight);\n\t\tconnector(ULN2003DriverBoard_Con_UpperLeft);\n\t\tconnector(ULN2003DriverBoard_Con_UpperRight);\n\t} \n\n\t\/\/ offset origin to bottom left\n\ttranslate([(ULN2003Driver_BoardWidth \/ 2) - ULN2003Driver_HoleInset, (ULN2003Driver_BoardHeight \/ 2) - ULN2003Driver_HoleInset, 0])\n\t{\n\t\t\/\/ Base PCB\n\t\tlinear_extrude(ULN2003Driver_PCBThickness)\n\t\t\tdifference() {\n\t\t\t\tsquare([ULN2003Driver_BoardWidth, ULN2003Driver_BoardHeight], center=true);\n\t\n\t\t\t\t\/\/ Mounting holes\n\t\t\t\tfor (i = [0:1], j = [0:1])\n\t\t\t\t\tmirror([i, 0, 0])\n\t\t\t\t\tmirror([0, j, 0])\n\t\t\t\t\ttranslate([ULN2003Driver_BoardWidth \/ 2 - ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight \/ 2 - ULN2003Driver_HoleInset, 0])\n\t\t\t\t\t\tcircle(r = ULN2003Driver_HoleDia \/ 2);\n\t\t\t}\n\t \n\t\t\/\/ Move us to the bottom left of the PCB\n\t\ttranslate([-ULN2003Driver_BoardWidth \/ 2, -ULN2003Driver_BoardHeight \/ 2, 0]) {\n\t\n\t\t\t\/\/ ULN2003 chip\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([1, 8, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([20, 10, 8]);\n\t\n\t\t\t\/\/ Arduino header\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([5, 4.5, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([10, 3, 15]);\n\t\n\t\t\t\/\/ Stepper Connection\n\t\t\tcolor(\"white\")\n\t\t\ttranslate([1.5, 19, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tdifference() {\n\t\t\t\t\tcube([15.5, 6, 8]);\n\t\t\t\t\ttranslate([1, 1, 1])\n\t\t\t\t\t\tcube([13.5, 4, 8]);\n\t\t\t\t}\n\t\n\t\t\t\/\/ Power & On\/Off Jumper\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([23, 8, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([3, 10, 15]);\n\t\n\t\t\t\/\/ LEDS\n\t\t\ttranslate([6, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([10, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([14.5, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([19, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t}\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1b339d8284b0725b76e5810fa85f1a76ebc8805d","subject":"prototype of string holder","message":"prototype of string holder\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 2;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5;\nphotoresistorLength = 4;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6;\nledLaserLength = 10;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,stringWallThickness + .1])\n cylinder(h = stringRecess + stringWallThickness + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,stringWallThickness + .1])\n cylinder(h = ledLaserLength + stringWallThickness + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'controller\/case\/controller-case.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"5ad9ba21299520ebb7739368a072b2367ef810ae","subject":"hardware: extrude the text so it prints!","message":"hardware: extrude the text so it prints!\n","repos":"nzmichaelh\/pipoint,nzmichaelh\/pipoint","old_file":"hardware\/pipoint.scad","new_file":"hardware\/pipoint.scad","new_contents":"include ;\r\ninclude ;\r\n\r\n$fn=20;\r\n\r\n\/\/ Plate that the camera mounts into.\r\nmodule plate () {\r\n m=6;\r\n d=7;\r\n \/\/ Corner radius.\r\n r=2;\r\n w=59-r*2+m;\r\n h=42-r*2+m;\r\n\r\n translate([r, r, 0])\r\n hull () {\r\n cylinder(d, r, r);\r\n translate([w, h, 0])\r\n cylinder(7, r, r);\r\n translate([0, h, 0])\r\n cylinder(7, r, r);\r\n translate([w, 0, 0])\r\n cylinder(7, r, r);\r\n }\r\n \/\/ Text on the top.\r\n color(\"grey\")\r\n translate([r*2, h+r*2, d*3\/4])\r\n rotate(90, [-1, 0, 0])\r\n linear_extrude(0.5)\r\n text(\"pipoint v1\", size=d\/2+1);\r\n}\r\n\r\n\/\/ Camera mount assembly.\r\nmodule camera_mount() {\r\n difference () {\r\n union () {\r\n bracket();\r\n translate([-5, 2, 0])\r\n rotate(90, [1, 0, 0])\r\n plate();\r\n }\r\n translate([-2, -1, 3])\r\n rotate(90, [1, 0, 0])\r\n turnigy2k();\r\n }\r\n}\r\n\r\ncamera_mount();\r\n\r\n","old_contents":"include ;\r\ninclude ;\r\n\r\n$fn=20;\r\n\r\n\/\/ Plate that the camera mounts into.\r\nmodule plate () {\r\n m=6;\r\n d=7;\r\n \/\/ Corner radius.\r\n r=2;\r\n w=59-r*2+m;\r\n h=42-r*2+m;\r\n\r\n translate([r, r, 0])\r\n hull () {\r\n cylinder(d, r, r);\r\n translate([w, h, 0])\r\n cylinder(7, r, r);\r\n translate([0, h, 0])\r\n cylinder(7, r, r);\r\n translate([w, 0, 0])\r\n cylinder(7, r, r);\r\n }\r\n \/\/ Text on the top.\r\n color(\"grey\")\r\n translate([r*2, h+r*2, d*3\/4])\r\n rotate(90, [-1, 0, 0])\r\n text(\"pipoint v1\", size=d\/2+1);\r\n}\r\n\r\n\/\/ Camera mount assembly.\r\nmodule camera_mount() {\r\n difference () {\r\n union () {\r\n bracket();\r\n translate([-5, 2, 0])\r\n rotate(90, [1, 0, 0])\r\n plate();\r\n }\r\n translate([-2, -1, 3])\r\n rotate(90, [1, 0, 0])\r\n turnigy2k();\r\n }\r\n}\r\n\r\ncamera_mount();\r\n\r\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"002e538f1cdff7bba48b12ae82fe6e3d4259de50","subject":"mount tooths are not much thicker","message":"mount tooths are not much thicker\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"aks_zielonka\/cable_tube_enclosure.scad","new_file":"aks_zielonka\/cable_tube_enclosure.scad","new_contents":"size = [92.75, 41, 15];\nwall = 1.75;\nspacing = 2;\nl = 3.2;\n\nmodule tooth()\n{\n size = 4;\n difference()\n {\n cube([l, size, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube([l, size, 2*l]);\n }\n}\n\n\/\/ body\ndifference()\n{\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n}\n\n\/\/ side teeth\nfor(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth();\n }\n\n\/\/ upper teeth\nfor(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth();\n","old_contents":"size = [92.75, 41, 15];\nwall = 1.75;\nspacing = 2;\nl = 3.2;\n\nmodule tooth()\n{\n difference()\n {\n cube([l, wall, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube(l*[1, 1, 2]);\n }\n}\n\n\/\/ body\ndifference()\n{\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n}\n\n\/\/ side teeth\nfor(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth();\n }\n\n\/\/ upper teeth\nfor(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ee4d883c112a23285b0d0cd606f7142738e5c96b","subject":"Initial Version Lampenkopf","message":"Initial Version Lampenkopf\n","repos":"oprobst\/Tauchlampe","old_file":"Video-Lampenkopf.scad","new_file":"Video-Lampenkopf.scad","new_contents":"\/*\n * UW Video Leuchte\n * \n * Breiter Fokus mit viel Lichtleistung\n * M\u00f6glichst modular aufgebaut.\n *\n *\/\n\n\/\/ACHTUNG: Das Glas hat eine Toleranz von \u00b1 0.5mm, was eine Berechnung des \n\/\/ O-Rings und der dazugeh\u00f6rigen Nut erst erm\u00f6glicht, \n\/\/ wenn das Teil genau ausgemessen ist.\n\n\/\/ Aktueller Raum f\u00fcr Elektronik: 48mm Durchmesser, 40mm L\u00e4nge...\n\n\/\/Rendering information\n$fn=200;\n\n\/\/ Variablenblock:\n\n\/\/ max. Gesamtradius des Geh\u00e4uses\ngehaeuseRadius = 44;\nauflageRadiusGlas = 30;\nglasRadius = 35;\ngesamtLaenge = 90;\n\n\/\/M3 DIN 912 Innensechskantschrauben\nkernlochM3 = 1.25;\ndurchfuehrungM3 = 1.6;\nschraubenkopfM3 = 2.85;\nschraubenkopfM3hoehe = 3.0;\n\n\/\/Axiale O-Ringe fuer Scheibe (ID = 60mm, Dicke = 2.5mm)\noRingRadiusInnen = 30.0;\noRingRadiusAussen = oRingRadiusInnen + 2.5;\noRingNutbreite = 3.4;\noRingNutTiefe = 1.9; \/\/(\u00b1 0,06)\noRingNutAussenRadius = gehaeuseRadius - 4 -durchfuehrungM3 - schraubenkopfM3 - kernlochM3;\noRingNutInnenRadius = oRingNutAussenRadius - oRingNutbreite ;\n\nkernlochKabelverschraubung = 7;\n\necho (\"O-Ring Nut Ma\u00dfe: ID= \", oRingNutInnenRadius * 2, \" AD=\", oRingNutAussenRadius *2);\n\n\n\n\/\/Konstruktion der Hauptkomponenten:\n\n\/\/Die Deckelscheibe h\u00e4lt das Glas in der Fassung.\ntranslate ([0, 0, 230]){\n deckelscheibe(auflageRadiusGlas, gehaeuseRadius, 6);\n}\n\n\n\/\/Glasscheibe mit Dichtringen\ntranslate ([0, 0, 200]){ \n frontGlas (oRingRadiusInnen, oRingRadiusAussen);\n}\n\n\/\/Linse vor LED\ntranslate ([0, 0, 160]){\n rotate ([0,0,25]){\n linse ();\n }\n}\n\n\/\/LED\ntranslate ([0,0,140]){ \n rotate ([0,0,25]){\n led (); \n }\n}\n\n\/\/LED Tr\u00e4gerplatte mit Kernlochbohrungen f\u00fcr LED Modul\ndifference (){\n \/\/LED carrier\n translate ([0,0,130]){\n ledCarrier(30, 5);\n }\n\n \/\/ Bohrungen f\u00fcr LED\n rotate ([0,0,25]){\n for (i= [[17,17,130-1],\n [-17,17,130-1],\n [17,-17,130-1],\n [-17,-17, 130-1]]){\n translate (i){\n cylinder (h = 11, r = 1.25);\n }\n }\n }\n}\n\nkorpus (gehaeuseRadius, glasRadius, 30);\n\n\n\n\/\/Konstruktion der Deckelscheibe.\n\/\/ Diese klemmt die Borsilika Scheibe mit zwei O-Ringen.\n\/\/ Sie wird mit 8 Schrauben auf dem Geh\u00e4use befestigt.\nmodule deckelscheibe (innenRadius, aussenRadius, hoehe){\n difference(){\n cylinder (h = hoehe, r = aussenRadius); \n translate ([0, 0, -0.1]){\n cylinder (h = hoehe + 0.2, r = innenRadius);\n }\n\n \/\/ M3 Durchf\u00fchrung, 1mm vom Rand entfernt\n translate ([0, 0, -0.1]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, durchfuehrungM3, 8 , hoehe + 0.2); \n }\n \/\/ Senkung f\u00fcr M3, DIN 912, Innensechskant Schraubenk\u00f6pfe\n translate ([0, 0, hoehe-schraubenkopfM3hoehe]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, \n schraubenkopfM3, 8 , \n schraubenkopfM3hoehe + 0.1);\n }\n\n \/\/Nut f\u00fcr O-Ring \n translate ([0, 0, -1.0]){ \n \/\/ 2 mm vom Kernloch der Verschraubung entfernt:\n ring (oRingNutAussenRadius, \n oRingNutInnenRadius, \n oRingNutTiefe + 1.0);\n }\n }\n}\n\n\n\n\/\/Konstruktion der Borsilikascheibe mit Dichtringen\nmodule frontGlas (dichtringID, dichtringAD){\n\n \/\/ Borsilika Glas\n \/\/ \u00f8: 70 (\u00b1 0.5) x 12 (\u00b1 0.5)\n \n color(\"LightBlue\"){\n cylinder (h = 12, r = glasRadius);\n } \n\n \/\/O-Ringe\n color(\"Black\"){\n \/\/axial oben (nicht dichtend)\n translate ([0,0, 20]){\n ring ( dichtringAD, dichtringID, dichtringAD-dichtringID);\n }\n\n \/\/axial unten\n translate ([0,0,-10]){\n ring ( dichtringAD, dichtringID, dichtringAD-dichtringID); \n } \n }\n}\n\n \n\/\/ Linse f\u00fcr LED\nmodule linse (){\n color(\"LightSteelBlue\"){\n difference (){ \n sphere (22.0);\n translate ([-25,-25,-23.0]){\n cube ([50,50,23]);\n }\n }\n translate ([-0,-0, -8]){\n cylinder(r=25,h=8); \n }\n }\n}\n\n\n\/\/ Die LED die aufgeschraubt wird\nmodule led(){\n \n color(\"SlateGray\"){\n difference (){ \n cylinder (h = 1.42, r = 28);\n translate ([-20,20,-1.0]){\n cube ( [40, 20, 2.43]);\n }\n translate ([-20,-40,-1]){\n cube ( [40, 20, 3.43]);\n }\n \n for (i=[[17,17,-1],\n [-17,17,-1],\n [17,-17,-1],\n [ -17,-17, -1]]){\n translate (i){\n cylinder (h = 2.430, r= 1.75);\n }\n } \n \n }\n }\n\n color(\"Gray\"){\n difference (){ \n translate ([-20, -20, 1.42]){\n cube ( [40, 40, 2.86]);\n }\n translate ([-20, -20, 1.41]){\n for (i=[[0,40,-1],\n [40,0,-1],\n [0,0,-1],\n [40 ,40 ,-1]]){\n translate (i){ \n cylinder (h = 3.895, r= 10);\n }\n }\n }\n }\n }\n \n color (\"Yellow\"){\n translate ([-10.5, -10.5, 1.43]){\n cube ( [21, 21, 2.88]);\n }\n }\n\n}\n\n\n\/\/Auf diesen Tr\u00e4ger wird die LED geschraubt\nmodule ledCarrier(aussenRadius, hoehe){\n \n difference (){\n \n cylinder (h = hoehe, r = aussenRadius); \n \n \/\/ M3 Durchf\u00fchrung, 1mm vom Rand entfernt\n translate ([0, 0, -0.1]){\n bohrungenAufRadius (aussenRadius - 1 - schraubenkopfM3, durchfuehrungM3 , 8 , hoehe + 0.2); \n }\n \/\/ Senkung f\u00fcr M3, DIN 912, Innensechskant Schraubenk\u00f6pfe\n translate ([0, 0, hoehe-schraubenkopfM3hoehe]){\n bohrungenAufRadius (aussenRadius - 1 - schraubenkopfM3, \n schraubenkopfM3, 8 , \n schraubenkopfM3hoehe + 0.1);\n }\n }\n}\n\n\/\/Der Hauptlampenk\u00f6rper \nmodule korpus(aussenRadius, glasAufnahmeRadius, ledAufnahmeRadius){ \n\n difference(){\n cylinder (h = gesamtLaenge, r = aussenRadius); \n \n \/\/ === Innen\n\n \/\/Glasaufnahme\n translate ([0, 0, gesamtLaenge - 12]){ \n cylinder (h = gesamtLaenge, r = glasAufnahmeRadius + 0.25); \n }\n\n \/\/Bohrungen f\u00fcr Glasplattenhalter\n translate ([0, 0, gesamtLaenge - 20]){\n bohrungenAufRadius (aussenRadius - 2 - schraubenkopfM3, kernlochM3, 8 ,gesamtLaenge ); \n }\n \n \/\/Nut f\u00fcr O-Ring \n translate ([0, 0, gesamtLaenge - 12 - oRingNutTiefe]){ \n \/\/ 2 mm vom Kernloch der Verschraubung entfernt:\n ring (oRingNutAussenRadius, \n oRingNutInnenRadius, \n oRingNutTiefe + 1.0);\n }\n\n \/\/LED Tr\u00e4ger Aufnahme\n translate ([0, 0, gesamtLaenge - 12 - 35]){ \/\/= -glas - ledcarrier\n cylinder (h = gesamtLaenge, r = ledAufnahmeRadius + 0.25); \n }\n\n \/\/Kernlochbohrungen f\u00fcr Tr\u00e4geraufnahme M3\n translate ([0, 0, gesamtLaenge - 12 - 35 - 20]){ \n bohrungenAufRadius (ledAufnahmeRadius - 1 - schraubenkopfM3, kernlochM3, 8 , 150); \n }\n\n \/\/Raum elektronik\n translate ([0, 0, 3]){ \n cylinder (h = gesamtLaenge, r = 24); \n }\n\n \/\/Kabelverschraubung\n translate ([0,0,-.05]){\n cylinder (h = 6.1, r = kernlochKabelverschraubung); \n }\n\n \/\/ === Au\u00dfen\n \n \/\/ Aufnahme f\u00fcr Goodman Befestigung\n translate ([0, 0, gesamtLaenge - 30]){ \n ring (aussenRadius + 3.00, \n aussenRadius - 1.0, \n 10.0);\n }\n\n \/\/ K\u00fchlrippen\n for (i=[25:4:gesamtLaenge - 34]){\n translate ([0, 0, i]){ \n ring (aussenRadius + 3.00, \n ledAufnahmeRadius + 3.0, \n 2.5);\n }\n }\n translate ([0, 0, 20]){ \n ring (aussenRadius + 3.00, \n ledAufnahmeRadius + 11, \/\/rippenl\u00e4nge = 8mm \n 35);\n }\n \n \n translate ([0, 0, -1]){ \n ring (aussenRadius + 3.0, 27, 25); \n } \n }\n\n \/\/Leichte erh\u00f6hung f\u00fcr Gewinde der Kabelverschraubung\n difference(){\n \n cylinder (h = 6, r = kernlochKabelverschraubung *1.6); \n \n \/\/Gewinde f\u00fcr M16 x 1,5 Verschraubung\n translate ([0,0,-.05]){\n cylinder (h = 6.1, r = kernlochKabelverschraubung); \n }\n\n }\n\n \n \n} \n\n\n\/\/ Zeichnet eine Reihe von Zylindern auf einem festgelegtem Radius.\n\/\/ Gut geeignet um auf einem Ring Bohrungen anzubringen.\nmodule bohrungenAufRadius (radius, lochRadius, anzahl, tiefe){\n for ( i = [0 : anzahl] ) {\n rotate( i * 360 \/ anzahl + 1, [0, 0, 1]){\n translate ([radius ,0 , -0.1]){\n cylinder (h = tiefe + 0.1, r = lochRadius); \n } \n } \n }\n}\n\n\n\/\/ Ein einfacher Ring\nmodule ring(aussenRadius, innenRadius, hoehe) {\n difference() {\n cylinder(r = aussenRadius, h = hoehe);\n translate([ 0, 0, -1 ]) cylinder(r = innenRadius, h = hoehe+2);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Video-Lampenkopf.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"9dda58bdf3cd6fa35f16a8ef1067731cba747127","subject":"x\/carriage: add preview with x-ends","message":"x\/carriage: add preview with x-ends\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 22*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 22*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n \/*for(z=[-1,1])*\/\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*rotate([90,0,0])*\/\n \/*belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3af265bade0706d81dd7dfcc8500825625cf82f2","subject":"First version of HardHead clamp to Makita rail adapter","message":"First version of HardHead clamp to Makita rail adapter\n","repos":"ksuszka\/3d-projects","old_file":"powertools\/makita_rail_clamp_adapter.scad","new_file":"powertools\/makita_rail_clamp_adapter.scad","new_contents":"draft = false;\n$fa = draft ? 12 : 3;\n$fs = draft ? 2 : 0.3;\n\n\/\/ Possible options: clamp, knob, all\nshow(\"all\");\n\nmodule show(part) {\n if (part == \"knob\") {\n knob();\n } else if (part == \"clamp\") {\n rotate([-90,0,0]) clamp();\n } else {\n color(\"MediumPurple\") translate([0,10,24]) rotate([-90,0,0]) knob();\n color(\"DarkTurquoise\")clamp();\n }\n}\n\nmodule cube2(size, center) {\n translate([\n center[0] ? -size[0]\/2 : 0,\n center[1] ? -size[1]\/2 : 0,\n center[2] ? -size[2]\/2 : 0]) cube(size);\n}\n\nmodule clamp_rod_mold_hard_head() {\n module screw() {\n cylinder(d=6.2,h=50,center=true);\n translate([0,0,7]) cylinder(d=10*2\/sqrt(3)+0.2,h=50,$fn=6);\n }\n module stop() {\n hull() {\n cylinder(d=6,h=12,center=true);\n translate([0,20,0]) cylinder(d=6.5,h=12,center=true);\n }\n }\n hull() for(x=[-1,1]) translate([x*13\/2,0,-10]) cylinder(d=6, h=100);\n translate([0,0,24]) rotate([90,0,0]) screw();\n translate([0,0,43]) rotate([90,0,0]) stop();\n \n}\nmodule clamp_body() {\n intersection() {\n union() {\n hull() for(x=[-1,1]) translate([x*13\/2,0,0]) cylinder(d=20,h=45);\n }\n union() {\n translate([0,0,100*sqrt(2)\/2+9-4]) rotate([45,0,0])cube2([100,100,100],[true,true,true]);\n cube2([100,8,100],[true,true,true]);\n }\n }\n x1 = -30;\n x2 = 80;\n hull() for(x=[x1,x2]) translate([x,0,0]) cylinder(d=11.8,h=6.2);\n hull() for(x=[x1,x2]) translate([x,0,0]) cylinder(d=8,h=8);\n translate([0,0,24]) rotate([90,0,0])cylinder(d=15,h=7+5);\n}\n\nmodule clamp() {\n difference() {\n clamp_body();\n clamp_rod_mold_hard_head();\n }\n}\n\nmodule knob() {\n diameter1 = 25;\n height = 8;\n chamfer_r = (diameter1-5)\/2;\n module chamfer() {\n rotate_extrude(convexity = 10)\n intersection() {\n translate([0,-1]) square([100,100]);\n translate([diameter1\/2+3, -(chamfer_r-2), 0]) circle(r = chamfer_r, $fn = 100);\n }\n }\n difference() {\n union() {\n cylinder(d=diameter1, h=height);\n for(a=[0:30:359]) rotate([0,0,a])translate([diameter1\/2-1,0,0]) cylinder(d=5,h=height);\n }\n chamfer();\n translate([0,0,-1]) cylinder(d=6.2,h=100);\n translate([0,0,3]) cylinder(d=10*2\/sqrt(3),h=100,$fn=6);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'powertools\/makita_rail_clamp_adapter.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c86371b5b78215e4b073a771c51c29069d9fd488","subject":"Updating lasercut.scad - workignon twist holes (not yet complete)","message":"Updating lasercut.scad - workignon twist holes (not yet complete)\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n echo(\"!!\");\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([thickness*7, thickness, thickness*3], center=true); \n difference()\n {\n translate([0,0, -thickness]) cylinder(h=thickness*3, r=thickness*3\/2);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n\tscrew_tabs=[], screw_tab_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n\tscrew_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n\tscrew_tabs=[], screw_tab_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"0f7874ab7fb2b7c64125f52ab70493ea3c690001","subject":"external spacing is now a parameter","message":"external spacing is now a parameter\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tape_shorting_clamp\/tape_shorting_clamp.scad","new_file":"tape_shorting_clamp\/tape_shorting_clamp.scad","new_contents":"count=2;\n\ns = 3; \/\/ spacing\nw = 18+2*(4+2+s); \/\/ width\n\nmodule distancingElement()\n{\n difference()\n {\n cube([w, 8+6, 2]);\n for(dx = [2+4\/2, w-(2+4\/2)])\n translate([dx, 8\/2+4\/2, -1])\n cylinder(r=4\/2, h=4, $fs=0.1);\n }\n}\n\nmodule clamp()\n{\n difference()\n {\n cube([w, 4+2*2, 2]);\n for(dx = [2+4\/2, w-(2+4\/2)])\n translate([dx, 8\/2, -1])\n cylinder(r=4\/2, h=4, $fs=0.1);\n }\n}\n\n\nfor(i = [0:count-1])\n translate([i*38,0,0])\n {\n distancingElement();\n for(dy = [0, 10])\n translate([0, 16+dy, 0])\n clamp();\n }\n","old_contents":"count=2;\n\nw = 18+2*(4+2*2);\n\nmodule distancingElement()\n{\n difference()\n {\n cube([w, 8+6, 2]);\n for(dx = [2+4\/2, w-(2+4\/2)])\n translate([dx, 8\/2+4\/2, -1])\n cylinder(r=4\/2, h=4, $fs=0.1);\n }\n}\n\nmodule clamp()\n{\n difference()\n {\n cube([w, 4+2*2, 2]);\n for(dx = [2+4\/2, w-(2+4\/2)])\n translate([dx, 8\/2, -1])\n cylinder(r=4\/2, h=4, $fs=0.1);\n }\n}\n\n\nfor(i = [0:count-1])\n translate([i*35,0,0])\n {\n distancingElement();\n for(dy = [0, 10])\n translate([0, 16+dy, 0])\n clamp();\n }\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fd1e97058f5ab1ae915b8ed26a4433e4eeee2f0c","subject":"bearing: reduce ziptie cut thick (3x -> 2x)","message":"bearing: reduce ziptie cut thick (3x -> 2x)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],bearing_type[2]], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],bearing_type[2]], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n ziptie_thickness_cut = bearing_type[1]+ziptie_bearing_distance+ziptie_thickness*3;\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*3,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"886358f1f8eb76aed47f786b3b8a24e101e30c83","subject":"move back antenna point","message":"move back antenna point\n","repos":"depperson\/dronedroid","old_file":"hardware\/rustler-plate.scad","new_file":"hardware\/rustler-plate.scad","new_contents":"\/\/ rustler-plate.scad: an electronics tray for Traxxas Rustler\n\/\/ Daniel Epperson, 2015\n\n\/\/ main surface \nlinear_extrude(height = 3, center = true) \ndifference() {\n\n \/\/ plate\n polygon(points=[[0,5], [5,0],\n [70,0], [130,15],\n [135,35], [150,20],\n [210,35], [210,105],\n [70,140],\n [5,140], [0,135],\n [0,105], [40,105],\n [40,35], [0,35]\n ]);\n \n \/\/ ESC hole\n translate([40, 70])\n circle(12, $fn=50);\n \n \/\/ right bolt hole\n translate([15, 15])\n circle(3, $fn=50);\n \n \/\/ left bolt hole\n translate([15, 125])\n circle(3, $fn=50);\n \n \/\/ front bolt hole\n translate([180, 100])\n circle(3, $fn=50);\n}\n\n\n\/\/ rear supports\ndifference()\n{\n translate([0,0,-25])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right \n translate([15, 15])\n circle(6, $fn=50);\n\n \/\/ left \n translate([15, 125])\n circle(6, $fn=50);\n }\n translate([0,0,-22])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right tunnel\n translate([15, 15])\n circle(3, $fn=50);\n\n \/\/ left tunnel\n translate([15, 125])\n circle(3, $fn=50);\n }\n}\n\n\n\/\/ front support\ndifference()\n{\n \/\/ front\n translate([0,0,-10])\n linear_extrude(height = 20, center = true) \n translate([180, 100])\n circle(6, $fn=50);\n \n \/\/ front tunnel\n translate([0,0,-7])\n linear_extrude(height = 20, center = true) \n translate([180, 100])\n circle(3, $fn=50);\n}\n","old_contents":"\/\/ rustler-plate.scad: an electronics tray for Traxxas Rustler\n\/\/ Daniel Epperson, 2015\n\n\/\/ main surface \nlinear_extrude(height = 3, center = true) \ndifference() {\n\n \/\/ plate\n polygon(points=[[0,5], [5,0],\n [70,0], [130,15],\n [140,35], [150,20],\n [210,35], [210,105],\n [70,140],\n [5,140], [0,135],\n [0,105], [40,105],\n [40,35], [0,35]\n ]);\n \n \/\/ ESC hole\n translate([40, 70])\n circle(12, $fn=50);\n \n \/\/ right bolt hole\n translate([15, 15])\n circle(3, $fn=50);\n \n \/\/ left bolt hole\n translate([15, 125])\n circle(3, $fn=50);\n \n \/\/ front bolt hole\n translate([180, 100])\n circle(3, $fn=50);\n}\n\n\n\/\/ rear supports\ndifference()\n{\n translate([0,0,-25])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right \n translate([15, 15])\n circle(6, $fn=50);\n\n \/\/ left \n translate([15, 125])\n circle(6, $fn=50);\n }\n translate([0,0,-22])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right tunnel\n translate([15, 15])\n circle(3, $fn=50);\n\n \/\/ left tunnel\n translate([15, 125])\n circle(3, $fn=50);\n }\n}\n\n\n\/\/ front support\ndifference()\n{\n \/\/ front\n translate([0,0,-10])\n linear_extrude(height = 20, center = true) \n translate([180, 100])\n circle(6, $fn=50);\n \n \/\/ front tunnel\n translate([0,0,-7])\n linear_extrude(height = 20, center = true) \n translate([180, 100])\n circle(3, $fn=50);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"55fbce0e9a3cd8f69a8ee732339b77f4b4c468df","subject":"final tweaks - looks good!","message":"final tweaks - looks good!\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 29; \/\/ width - x\n wall_h = 10; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 15; \/\/ depth - y\n ro = 1.5; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n side_w = 5; \/\/ side part of base without hole\n front_d = 6; \/\/ front part of base without hole\n hole_r = 5;\n hole_w = switch_w - 2 * side_w; \/\/ width of hole\n base_w = switch_w + 2*thick;\n difference() {\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d);\n translate([thick + side_w, front_d, -EPSILON])\n oblong(hole_w, LARGE, hole_r, thick + 2*EPSILON);\n }\n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 13; \/\/ width - x \n lug_h = 8; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1.5; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.6; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 15; \/\/ depth - y - of lug\n lug_off = 6; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","old_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 29; \/\/ width - x\n wall_h = 10; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 15; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n side_w = 6; \/\/ side part of base without hole\n front_d = 6; \/\/ front part of base without hole\n hole_r = 5;\n hole_w = switch_w - 2 * side_w; \/\/ width of hole\n base_w = switch_w + 2*thick;\n difference() {\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d);\n translate([thick + side_w, front_d, -EPSILON])\n oblong(hole_w, LARGE, hole_r, thick + 2*EPSILON);\n }\n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 13; \/\/ width - x \n lug_h = 8; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.6; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 15; \/\/ depth - y - of lug\n lug_off = 6; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"e1ea8bf444b78f4ceb233f4f7aacfee42c8e9ae3","subject":"Typeatron code cleanup. Tweaked pressure sensor dimensions per direct measurement","message":"Typeatron code cleanup. Tweaked pressure sensor dimensions per direct measurement\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn","old_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\nmodule fingerButtonWell(length) {\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of whatever printer we have.\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.2; \/\/ max value, from the data sheet\npressureSensorThick = 0.35; \/\/ from the data sheet\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0; \/\/ this is the height of the body of the push button (without the actual button)\npushButtonBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = pushButtonPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + pushButtonHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2*buttonRetainerThick\n + (pushButtonHeight-pushButtonWellDepth+foreignPartClearance)\n + pressureSensorThick + 0.15 \/\/ TODO: improve this estimate when you have the sensor in hand\n + 0.1; \/\/ \"a little extra\" which can be easily corrected with tape or paint\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n w = pushButtonWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the push button well\n fsrChannelDepth = pushButtonLegLength + pushButtonHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-pushButtonLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-pushButtonLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, pushButtonHeight - pushButtonWellDepth]);\n }\n\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]);\n\n \/\/ retainer wells\n translate([0,0,-pushButtonWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d7aaf92046ce2c6100954a37aa04862a76d8f606","subject":"Improved the Typeatron's pressure\/velocity sensor wells so they don't cause thin spots in the lid and floor","message":"Improved the Typeatron's pressure\/velocity sensor wells so they don't cause thin spots in the lid and floor\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo","old_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\/\/ a slight overestimate of the sizes of subtracted objects which prevents a confusing \"film\" in the STL\noverkill = 0.001;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorHeadWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorHeadThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\npressureSensorTailWidth = 6.3; \/\/ by direct measurement\npressureSensorTailThick = 0.90; \/\/ by direct measurement; this is the thick segment of the sensor with the electrical contacts\n\ntactileSwitchWidth = 6.0;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 22.0; \/\/ originally 25mm in Typeatron #2, based on the model; this was a bit too high\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 67; \/\/ Typeatron #1 and #2 were both 70mm wide\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nfingerButtonHeight = 5;\nthumbButtonHeight = 8; \/\/ thumb button is a little taller because it is not deeply inset like the finger buttons\nbuttonWidth = tactileSwitchWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = 0;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + fingerButtonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + thumbButtonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = pressureSensorTailThick + foreignPartClearance;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length, buttonHeight) {\n innerRetainerWellWidth = (length - tactileSwitchWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorHeadThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n difference() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n \/\/ remove the bottom half of the cylinder, which could protrude below the button body\n translate([0, 0, buttonWidth\/2]) {\n cube(length, buttonWidth, buttonWidth\/2 + overkill);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length, buttonHeight) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n translate([-(pressureSensorTailWidth+foreignPartClearance)\/2,0,-tactileSwitchLegLength]) {\n translate([0, -w\/2, 0]) {\n cube([pressureSensorTailWidth+foreignPartClearance, pressureSensorChannelHeight+overkill, fsrChannelDepth]);\n }\n translate([0, w\/2-pressureSensorChannelHeight, 0]) {\n cube([pressureSensorTailWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength, buttonHeight) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+overkill, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+overkill, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength, buttonHeight);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalThumbWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalThumbWellDepth, thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+overkill,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength, fingerButtonHeight);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1+overkill]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\/\/ a slight overestimate of the sizes of subtracted objects which prevents a confusing \"film\" in the STL\noverkill = 0.001;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 22.0; \/\/ originally 25mm in Typeatron #2, based on the model; this was a bit too high\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 67; \/\/ Typeatron #1 and #2 were both 70mm wide\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nfingerButtonHeight = 5;\nthumbButtonHeight = 8; \/\/ thumb button is a little taller because it is not deeply inset like the finger buttons\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = 0;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + fingerButtonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + thumbButtonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length, buttonHeight) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n difference() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n \/\/ remove the bottom half of the cylinder, which could protrude below the button body\n translate([0, 0, buttonWidth\/2]) {\n cube(length, buttonWidth, buttonWidth\/2 + overkill);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length, buttonHeight) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+overkill, fsrChannelDepth]);\n }\n translate([0, w-overkill, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength, buttonHeight) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+overkill, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+overkill, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength, buttonHeight);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalThumbWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalThumbWellDepth, thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+overkill,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength, fingerButtonHeight);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1+overkill]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5c1fcbff3100379ad930b8cfadfed95ec40e9cca","subject":"Adding material usage planning file.","message":"Adding material usage planning file.\n","repos":"sarahemm\/laserbox","old_file":"lasercut_parts\/planning\/panel_layout.scad","new_file":"lasercut_parts\/planning\/panel_layout.scad","new_contents":"module plate(x, y, height, width, rotation, name) {\n translate([x, y]) {\n rotate([0, 0, rotation]) {\n color(rands(0, 1, 3))\n square([height, width]);\n color([1, 1, 1])\n translate([height\/2, width\/2])\n raised_text(name);\n }\n }\n}\n\nmodule raised_text(text_string) {\n translate([0, 0, 0.1])\n text(text_string, size=2, halign=\"center\", valign=\"center\");\n}\n\n\n\/\/ first sheet of material\ncolor([0.8, 0.8, 0.8])\n translate([0, 0, -1])\n square([48, 96]);\n\n\/\/ second sheet of material\ncolor([0.8, 0.8, 0.8])\n translate([50, 0, -1])\n square([48, 48]);\n\n\/\/ all the panels\nplate(0, 0, 24, 24, 0, \"Laser Plate L\");\nplate(24, 0, 24, 24, 0, \"Laser Plate B\");\n\nplate(0, 24, 24, 24, 0, \"Top Plate\");\n\nplate(24, 24, 24, 9, 0, \"Box Rails\");\nplate(24, 33, 24, 2.5, 0, \"Right Rails\");\nplate(24, 35.5, 24, 9, 0, \"Left Rails\");\n\nplate(24, 48, 36, 24, 90, \"Left Vert\");\nplate(48, 48, 36, 24, 90, \"Right Vert\");\n\nplate(50, 0, 36, 36, 0, \"Front\");\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lasercut_parts\/planning\/panel_layout.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1ede2e7db71ad23ee29baff72a8df1c09107af83","subject":"model is ready","message":"model is ready\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"brown_oral_b_brush_holder\/brush_holder.scad","new_file":"brown_oral_b_brush_holder\/brush_holder.scad","new_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n difference()\n {\n cube(size);\n translate([0,7.5,0])\n cube([size[0],size[1]-7.5,size[2]-7.5]);\n }\n translate([size[0],0,size[2]-(7.5-3.5)])\n cube([3-2,size[1],7.5-3.5]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [2,19,23.5]);\nholder([-20\/2-1,-1,2], [2,19,23.5]);\n","old_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=10;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,14.5,50\/2-2], [36-2*2,25,2]);\nholder([0,0,0], [1,1,1]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5445901ee627b9008efc997524fb1060120a3363","subject":"Renamed shoulder to coxa, refined the design.","message":"Renamed shoulder to coxa, refined the design.\n\nSigned-off-by: Thomas Helmke ","repos":"Syralist\/yet-another-hexapod,Syralist\/yet-another-hexapod","old_file":"hexacad\/leg-parts.scad","new_file":"hexacad\/leg-parts.scad","new_contents":"use \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\ncoxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();","old_contents":"use \r\n\r\nmodule shoulder()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\nshoulder();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f74dd3596c4b287ac71fd32488e698eb964c5035","subject":"rod_clamps: use rcylindera","message":"rod_clamps: use rcylindera\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],XAXIS];\n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? [0,0,0] : [0,0,0];\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-XAXIS);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? [0,0,0] : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*XAXIS)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-XAXIS);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*XAXIS)\n hull()\n {\n stack(axis=-XAXIS, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n %size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=ZAXIS, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],XAXIS];\n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? [0,0,0] : [0,0,0];\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-XAXIS);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? [0,0,0] : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*XAXIS)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-XAXIS);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*XAXIS)\n hull()\n {\n stack(axis=-XAXIS, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n %size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate(pos_offset)\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=ZAXIS, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"964bd5633b38a6ec0412345fd87267e6e66ea4c2","subject":"oozing test model","message":"oozing test model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_printer_oozing_testing\/oozing_test.scad","new_file":"3d_printer_oozing_testing\/oozing_test.scad","new_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n \nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r1=5\/2, r2=2\/2, h=20);\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d_printer_oozing_testing\/oozing_test.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a69f515afb16f4ac2177e100a3e503188899006c","subject":"element for limiting mavability of a string","message":"element for limiting mavability of a string\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"rollup_string_fix\/rollup_string_limiter.scad","new_file":"rollup_string_fix\/rollup_string_limiter.scad","new_contents":"r=(3+2)\/2;\n\ndifference()\n{\n \/\/ main element\n cube([17, 6, 3]);\n \/\/ spherical holes\n for(offset = [0.5, 0.5+2*r+0.5, 17-2*r-0.5])\n translate([r+offset, 6\/2, 3])\n sphere(r=r, $fs=0.01);\n \/\/ string entry\/exit points\n translate([-0.5, 6\/2, 6\/2])\n rotate([0, 90, 0])\n cylinder(r=(1+0.5)\/2, h=17+1, $fs=0.01);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rollup_string_fix\/rollup_string_limiter.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a53d51933da44d25ee4b60c03fb7b61deafad80b","subject":"main: tweak enclosure","message":"main: tweak enclosure\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1* axis_range_x_,-1*axis_range_x_+x_carriage_w];\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1* axis_range_x_,-1*axis_range_x_+x_carriage_w];\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"166c8b88b3a2d3476abc2d266af96853986b7cfd","subject":"misc: add zip,zip_v,vv_fallback and assert_v","message":"misc: add zip,zip_v,vv_fallback and assert_v\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert_v(fallback(undef,1), 1);\n}\n\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) = \nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"04209754721d3d578c100240b0ae6d6b252d2060","subject":"misc\/v_cumsum: add end param","message":"misc\/v_cumsum: add end param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2fd69d5c25abc7d75a50563de6092a5d10f06235","subject":"misc: fix include system","message":"misc: fix include system\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a6f82a3b994492d7cf6aca6423445a3edffe69d4","subject":"More values were parametized.","message":"More values were parametized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/cutouts\/rotated-spiral-cutouts.scad","new_file":"OpenSCAD\/cutouts\/rotated-spiral-cutouts.scad","new_contents":"\r\n\/**\r\n * This is a library for evenly spacted cutouts.\r\n *\/\r\nmodule originalRotatedSpiralCutout(verticalSpacingFromBottom=0, \r\n z=0,\r\n\t\t\t\t\t\t\t\t charmCount = 6,\r\n\t\t\t\t\t\t\t\t xyScale = 0.125,\r\n\t\t\t\t\t\t\t\t charmStl = \"..\/..\/..\/shapes\/spurs\/spurs-a.stl\",\r\n\t\t\t\t\t\t\t\t rowSpacing = 30)\r\n{\r\n\t\/\/ outer spurs\r\n\tfor ( i = [0 : charmCount-1] )\r\n\t{\r\n\t\tyTranslate = verticalSpacingFromBottom + (z*rowSpacing);\r\n\t\t\r\n\t\tzRotation = i * 360 \/ charmCount;\r\n\t\t\r\n\t\trotate([\r\n\t\t\t\t90, \r\n\t\t\t\t0,\r\n\t\t\t\tzRotation\r\n\t\t])\r\n\t\t\/\/ normally x,y,z - but here y moves the little spurs up and down\r\n\t\ttranslate([15, yTranslate, 30])\r\n\t\tscale([xyScale, xyScale, 20.2])\r\n\t\timport(charmStl);\r\n\t}\t\r\n}\r\n\r\n\r\nmodule propossedRotatedSpiralCutout(charmCount = 16,\r\n\t\t\t\t\t\t\t\t\txyScale = 0.4,\r\n\t\t\t\t\t\t\t\t\tcharmStl = \"..\/shapes\/oshw\/oshw.stl\",\r\n\t\t\t\t\t\t\t\t\tyTranslateFactor = 5,\r\n\t\t\t\t\t\t\t\t\tzRotationFactor = 30)\r\n{\r\n for ( i = [0 : charmCount] )\r\n {\t\r\n\t\tyTranslate = i * yTranslateFactor;\r\n\t\t\r\n\t\tzRotation = i * zRotationFactor;\r\n\t\t\r\n rotate([\r\n 90, \r\n 0,\r\n zRotation\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, yTranslate, 30])\r\n scale([xyScale, xyScale, 20.2])\r\n import(charmStl);\r\n }\r\n}","old_contents":"\r\n\/**\r\n * This is a library for evenly spacted cutouts.\r\n *\/\r\nmodule originalRotatedSpiralCutout(verticalSpacingFromBottom=0, \r\n z=0,\r\n\t\t\t\t\t\t\t\t charmCount = 6,\r\n\t\t\t\t\t\t\t\t xyScale = 0.125,\r\n\t\t\t\t\t\t\t\t charmStl = \"..\/..\/..\/shapes\/spurs\/spurs-a.stl\",\r\n\t\t\t\t\t\t\t\t rowSpacing = 30)\r\n{\r\n\t\/\/ outer spurs\r\n\tfor ( i = [0 : charmCount-1] )\r\n\t{\r\n\t\tyTranslate = verticalSpacingFromBottom + (z*rowSpacing);\r\n\t\t\r\n\t\trotate([\r\n\t\t\t\t90, \r\n\t\t\t\t0,\r\n\t\t\t\ti * 360 \/ charmCount\r\n\t\t])\r\n\t\t\/\/ normally x,y,z - but here y moves the little spurs up and down\r\n\t\ttranslate([15, yTranslate, 30])\r\n\t\tscale([xyScale, xyScale, 20.2])\r\n\t\timport(charmStl);\r\n\t}\t\r\n}\r\n\r\n\r\nmodule propossedRotatedSpiralCutout(charmStl = \"..\/shapes\/oshw\/oshw.stl\",\r\n\t\t\t\t\t\t\t\t\tcharmCount = 16,\r\n\t\t\t\t\t\t\t\t\txyScale = 0.4)\r\n{\r\n for ( i = [0 : charmCount] )\r\n {\t\r\n\t\tyTranslate = 5 * i;\r\n\t\t\r\n rotate([\r\n 90, \r\n 0,\r\n i * 30\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, yTranslate, 30])\r\n scale([xyScale, xyScale, 20.2])\r\n import(charmStl);\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bb393078a311d99b140b2e88f90b1ae77e233b9c","subject":"lifterwall started","message":"lifterwall started\n","repos":"JoeSuber\/QuickerPicker","old_file":"CardStack\/lifter_walls.scad","new_file":"CardStack\/lifter_walls.scad","new_contents":"\/\/ stackable trays bolt together\n\/\/ topper narrows to exact card size for camera positioning\n\/\/ IR sensor positions allow mcu to adjust card height\n\/\/ screw drive allows stepper disable to reduce power\/heat\n\/\/ 100lb test thread x 4 for lifting\n\nuse ;\n\n\/\/ * bearing(pos=[0,0,0], angle=[0,0,0], model=SkateBearing, outline=false, material=Steel, sideMaterial=Brass);\n\nuse ;\n\n\/\/ * stepper_motor_mount(nema_standard, slide_distance=0, mochup=true, tolerance=0);\n\nuse ;\n\n\/\/ * screw(length, nutpos, washer, bearingpos = -1);\n\nuse ;\n\nend_x = 2.5*25.4 + 22 + 8;\n\nend_plate();\n\/\/screwin();\n\nmodule screwin(ang=0, tail=10, nutpos=9, shaft=12){\n rotate([0,0,ang])\n screw(shaft, nutpos, 0, $fn=24);\n translate([0,-5.8\/2,-nutpos-2.5])\n cube([tail,5.8,2.5], center=false);\n}\n\nmodule end_plate(x = end_x, y = 70, thk = 7, boltlen=12){\n difference(){\n cube([x,y,thk], center=false);\n \n translate([x\/2, 42.3\/2, 22]) rotate([180,0,0])\n #steppercut();\n \n for (i=[1,-1]){\n translate([x\/2 + i*2.5\/2*25.4,12,0])\n cylinder(r=22.2\/2, h=20, center=true, $fn=64);\n translate([x\/2 + i*2.5\/2*25.4,y-12,0])\n cylinder(r=22.2\/2, h=20, center=true, $fn=64);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*11,y\/2-10,thk\/2]) rotate([0,90,90-90*i])\n #screwin(ang=1, tail=10, nutpos=9, shaft=12);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*12,y\/2+10,thk\/2]) rotate([0,90,90-90*i])\n #screwin(ang=1, tail=10, nutpos=9, shaft=12);\n translate([x\/2 + i*2.5\/4*25.4,y+4,thk\/2]) rotate([0,-270,90])\n #screwin(ang=1, tail=10, nutpos=9, shaft=12);\n\n }\n }\n}\n\nmodule steppercut(xy=42.3, curve=5.7, tall=20){\n linear_extrude(height=tall)\n minkowski(){\n square([xy-curve*2, xy-curve*2], center=true);\n circle(r = curve\/2, center=true, $fn=16);\n }\n linear_extrude(height=tall+12)\n stepper_motor_mount(17, slide_distance=0, mochup=true, tolerance=0);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CardStack\/lifter_walls.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"3e20d6045f774b879b36a03ab942a51b4d2a8c9f","subject":"Create deksiriboza_2.scad","message":"Create deksiriboza_2.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/deksiriboza_2.scad","new_file":"3D-models\/SCAD\/deksiriboza_2.scad","new_contents":"z=7; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([0,-50,3])cylinder(4.2,10,10);\ntranslate ([-7,0,0]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([-28,-73,-1])cube ([20,45,9]);\n\ntranslate ([2,-80,0]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,7]);\ntranslate ([0,-50,3])cylinder(4.2,10,10);\ntranslate ([-7,0,0]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/deksiriboza_2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a28b175cc1288da1c727696424ea6d7774c2aae0","subject":"first beta reading for printing","message":"first beta reading for printing\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 4, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"78c5e582c19cb9d4cbbe832ca3c666444118e473","subject":"internal shapre of a pipe is now drafted","message":"internal shapre of a pipe is now drafted\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/launcher.scad","new_file":"pop_rocket\/launcher.scad","new_contents":"eps = 0.01;\nphi = 25;\nwall = 1.3;\nside = 22;\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangular_prism(side, height)\n{\n linear_extrude(height=height)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h)\n{\n cylinder(d=d, h=h, $fn=200);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n ph = 180;\n translate([0, ph, 0])\n rotate([90, 0, 0])\n triangular_prism(side, ph);\n \/\/ rubber pipe side\n dz = side * sin(60);\n translate([0, -phi\/2, dz])\n pipe_connector(phi, 20);\n \/\/ interconenction of both\n hull()\n {\n rotate([90, 0, 0])\n triangular_prism(side, 0.1);\n translate([0, 0, dz])\n for(r=[0:5:40])\n rotate([r, 0, 0])\n translate([0, -phi\/2, 0])\n pipe_connector(phi-r\/5, 0.1, $fn=50);\n }\n}\n\n\nmodule launcher()\n{\n inner_pipe();\n}\n\nlauncher();\n","old_contents":"eps=0.01;\n\/\/wall=1;\n\/\/hose_phi=6;\n\/\/bottle_screw_phi=27.4 + 0.6;\n\/\/bottle_screw_h=9;\nside = 22;\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = -side\/2 * sin(30);\n translate([dx, dy, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\nmodule triangle_pipe(side, height)\n{\n linear_extrude(height=height)\n difference()\n {\n triangle_2d(side);\n triangle_2d(side-6);\n }\n}\n\n\nmodule launcher_core()\n{\n dx = 40+22+6;\n module pad_core()\n {\n \/\/ pipe mount\n translate([50, 0, 11])\n cylinder(d=6, h=10, $fn=50);\n difference()\n {\n \/\/ block\n translate([-side\/2, -side\/2+0.75, 0])\n cube([dx, side, 11]);\n \/\/ triangle cut at the basecut\n translate([0, 0, 2+eps])\n rotate([0, 0, -30])\n linear_extrude(height=9)\n triangle_2d(12);\n }\n \/\/ launcher tube\n rotate([0, 0, -30])\n triangle_pipe(side, 180);\n }\n\n difference()\n {\n pad_core();\n \/\/ cut in for pressure to get in\n translate([50, 0, 10-6\/3])\n cylinder(d=6-2, h=11+6\/3+eps, $fn=50);\n \/\/ pipe hole\n translate([1-4, 0, 8\/2+1])\n rotate([0, 90, 0])\n cylinder(d=8, h=dx-side\/2, $fn=30);\n }\n}\n\n\nmodule launcher()\n{\n launcher_core();\n for(dy=[-15, 16])\n translate([20, dy, 0])\n screw_mount();\n}\n\nlauncher();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"eb1b4be36c370e807bb3a242f634714246490e2f","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"51c95cbfa8796a81be0a91a14bfa7020663906ec","subject":"fixed bottom part - must be mirrored","message":"fixed bottom part - must be mirrored\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"qiabasz\/qiabasz.scad","new_file":"qiabasz\/qiabasz.scad","new_contents":"eps = 0.01;\nN = 4;\nM = 4;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\nmodule qiabasz()\n{\n difference()\n {\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n mirror([1, 0, 0])\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n }\n qiagen_logo();\n}\n\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*32, j*32, 0])\n qiabasz();\n","old_contents":"eps = 0.01;\nN = 4;\nM = 4;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\nmodule qiabasz()\n{\n difference()\n {\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n }\n qiagen_logo();\n}\n\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*32, j*32, 0])\n qiabasz();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6f273889f1af79e3711876a74ec3045ceb473a64","subject":"prototype forearm","message":"prototype forearm\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 160;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\nrender()\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n #cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 160;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\nrender()\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n translate([-forearmLength + (bearingOD \/ 2) \/* + (boundingBox \/ 2)*\/, -(armWidth \/ 2) + boundingBoxHalf, 0])\n #cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"eec27f49667d3a18b478da34c78d0a967d1b20de","subject":"checkpoint","message":"checkpoint\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\ntranslate([-armLength, 0, 0])\n forearmLower(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingSteo, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength);\n\/*\nrender() \ncolor([.1, .7, .1]) \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n\/*\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingOD - 2 * bearingStep);\n }\n \/\/ screw holes for joining to joint\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n*\/\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength) {\n}\n\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + 7]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\nrender() \ncolor([.1, .7, .1]) \n translate([-armLength, 0, shoulderBaseHeight + 7 + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n \/\/ hardcoded values should be moved out\n baseDeckExtension = 50;\n \/\/ 8 is distance from shaft center to screw center on x axis\n \/\/ 35 is screw center to screw center on y axis\n shaftCenterToMountHoldCenterXAxis = 8;\n mountHoleCenterToMountHoleCenter = 35;\n leadScrewDiameter = 8;\n \/\/ end\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n union() {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingOD - 2 * bearingStep);\n }\n \/\/ screw holes for joining to joint\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"d4dd7ca09f019fd6b322c61af4d263225813b47b","subject":"misc: add v_avg","message":"misc: add v_avg\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ad1f3067cf947dc9cc517a7b9a46b7de762e90ae","subject":"misc: extend assert_v to support arrays","message":"misc: extend assert_v to support arrays\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"39c3b4e315fdce13a85ed57cd463ba1737824f51","subject":"misc: add v_rotate","message":"misc: add v_rotate\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"955eb7e4e269043fa9e83f4546352492e7612f26","subject":"zaxis\/gantry: tolerances","message":"zaxis\/gantry: tolerances\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-upper-gantry-connector.scad","new_file":"z-axis-upper-gantry-connector.scad","new_contents":"include \n\nmodule zaxis_upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia*1.05, h=zmotor_mount_clamp_nut_thick*1.05, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, -1])\n {\n fncylindera(d=extrusion_thread_dia, h=100, orient=[0,0,1], align=[1,0,1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","old_contents":"include \n\nmodule zaxis_upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, -1])\n {\n fncylindera(d=extrusion_thread_dia, h=100, orient=[0,0,1], align=[1,0,1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c96d0770a2a7fc1e381648199fa6410095b5c9b3","subject":"main: use linear extrusion for upper gantry","message":"main: use linear extrusion for upper gantry\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - x_carriage_w\/2 + 20;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - x_carriage_w\/2 + 20;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_upper_width\/2))\n tz(main_height)\n {\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n mirror([x==1?0:-1,0,0])\n gantry_upper_connector();\n }\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f97acf661b0b2976d54f38e61e3177d95c88cefe","subject":"\u043e\u0448\u0438\u0431\u043a\u0438 (","message":"\u043e\u0448\u0438\u0431\u043a\u0438 (","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/TIMIN.scad","new_file":"3D-models\/SCAD\/TIMIN.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435: \u0410\u0434\u0435\u043d\u0438\u043d\n\nx=50;\ny=19;\nz=9;\ndx=9; \/\/\u0414\u043b\u0438\u043d\u0430 \u0440\u0430\u0437\u044a\u0435\u043c\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\nd=2.67; \/\/\u0414\u0438\u0430\u043c\u0435\u0442\u0440 \u0433\u043d\u0435\u0437\u0434\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\np=18.5; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\ndifference() {\nunion() { \n #translate([0, 0, 0]) cube ([x-2, y, z-0.3], center=true);\n\n translate([-24, 0, 0]) rotate([0, 0, 45]) cube ([13.5, 13.5, z-0.3], center=true);\n \n #translate([30.1, 0, 0]) cube ([13.1, 19, z-0.3], center=true);\n\n} \n translate([6, 0, 3]) cube ([x-10, y+2, z\/1.5], center=true); \/\/\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n\n\n #translate([-34.8, 0, 0]) cube ([10.5, 10.5, z+2], center=true); \/\/\u0414\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0438\n\n\n #rotate([0, 90, 0]) translate([0, 0, -34.8]) cylinder(dx, d, d);\n\n #rotate([0, 90, 0]) translate([0, 0, 33.1]) cylinder(dx, d, d);\n\n\/\/ #rotate([0, 90, 0]) translate([0, -4.5, 33.1]) cylinder(dx, d, d);\n}\n\nrotate([90, 0, 0]) translate([-13, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\nrotate([90, 0, 0]) translate([26.3, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435: \u0422\u0438\u043c\u0438\u043d\n\nx=50;\ny=19;\nz=9;\ndx=9; \/\/\u0414\u043b\u0438\u043d\u0430 \u0440\u0430\u0437\u044a\u0435\u043c\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\nd=2.67; \/\/\u0414\u0438\u0430\u043c\u0435\u0442\u0440 \u0433\u043d\u0435\u0437\u0434\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\n\ndifference() {\nunion() { \n #translate([0, 0, 0]) cube ([x-2, y, z-0.3], center=true);\n\n translate([-24, 0, 0]) rotate([0, 0, 45]) cube ([13.5, 13.5, z-0.3], center=true);\n \n #translate([30.1, 0, 0]) cube ([13.1, 19, z-0.3], center=true);\n\n} \n translate([6, 0, 3]) cube ([x-10, y+2, z\/1.5], center=true); \/\/\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n\n\n #translate([-34.8, 0, 0]) cube ([10.5, 10.5, z+2], center=true); \/\/\u0414\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0438\n\n\n #rotate([0, 90, 0]) translate([0, 0, -34.8]) cylinder(dx, d, d);\n\n #rotate([0, 90, 0]) translate([0, 0, 33.1]) cylinder(dx, d, d);\n\n\/\/ #rotate([0, 90, 0]) translate([0, -4.5, 33.1]) cylinder(dx, d, d);\n}\n\nrotate([90, 0, 0]) translate([-13, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\nrotate([90, 0, 0]) translate([26.3, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ndt=5; \/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u043a\u0432\u044b T \u043f\u043e \u043e\u0441\u0438 X\ntranslate([dt, -6, 0]) cube([xx, e+0.7, xx]);\ntranslate([dt-4.9, -6, 0]) cube([e, xx, xx]);\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"244a6210df87737a269d65fd8a2157d8d75afdaa","subject":"fixed bruses distancing + added correct screw mount size walls sizes","message":"fixed bruses distancing + added correct screw mount size walls sizes\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/junction_box.scad","new_file":"led_controler_junction_box\/junction_box.scad","new_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [73, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw holes\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center,\n wall+int_size[1]\/2,\n wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-4);\n translate([((12\/2+2)\/2)*(dx-1), -10\/2, 0])\n cube([12\/2+2, 10, int_size[2]-4]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-4-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[1]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","old_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [73, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw holes\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center,\n wall+int_size[1]\/2,\n wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-4);\n translate([(12\/2\/2+2)*(dx-1), -10\/2, 0])\n cube([12\/2+3, 10, int_size[2]-4]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-4-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[0]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2f17cb8836e54d98a488b2ed483e3cae380d8849","subject":"Smaller dimensions for microswitches","message":"Smaller dimensions for microswitches\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/MicroSwitch.scad","new_file":"hardware\/vitamins\/MicroSwitch.scad","new_contents":"\/\/ MicroSwitch v1.1 by Gyrobot\r\n\/\/ http:\/\/www.gyrobot.co.uk\r\n\/\/\r\n\/\/ Default values based upon :\r\n\/\/ Farnell P\/N : 2352329\r\n\/\/ Omron Electronic Components P\/N : SS-01GLT\r\n\/\/\r\n\/\/ Datum X is centre of mounting hole with X pointing away from mounting slot.\r\n\/\/ Datum Y is pointing away from terminals towards the lever.\r\n\/\/ Datum Z is in on base of model.\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ length = Length of body in X.\r\n\/\/ width = Width of body in Y.\r\n\/\/ height = Height (thickness) of body in Z.\r\n\/\/ datxoffset = X Position of lower left corner of body from Datum hole.\r\n\/\/ datyoffset = Y Position of lower left corner of body from Datum hole.\r\n\/\/ orientation = Defines whether the switch is mounted left or right (0:1).\r\n\/\/ holedia = Size of Datum mounting hole and slot width of second hole.\r\n\/\/ xholepitch = Mounting hole X pitch.\r\n\/\/ yholepitch = Mounting hole Y pitch.\r\n\/\/ hole_slot_length = Slot length of second mounting hole.\r\n\/\/ lever_length = Length of lever.\r\n\/\/ lever_width = Width of lever.\r\n\/\/ lever_thickness = Thickness of lever.\r\n\/\/ lever_height = Height of lever (OP) from Datum hole.\r\n\/\/ tab_length = Length of terminal tab from Datum hole.\r\n\/\/ tab_width = Width of terminal tab.\r\n\/\/ tab_thickness = Thickness of terminal tab.\r\n\/\/ tab_holedia = Diameter of terminal tab hole.\r\n\/\/\r\n\r\nmodule MicroSwitch(length = 12.9, width = 6.6, height = 5.8, datxoffset = -9.6, datyoffset = -1.25, orientation = 0, holedia = 2, xholepitch = 6.2, yholepitch = 0, hole_slot_length = 0, lever_length = 12, lever_width = 4, lever_thickness = 0.3, lever_height = 6.6, tab_length = 4.5, tab_width = 0.5, tab_thickness = 0.5, tab_holedia = 0){\r\n\r\n\tcutout_offset = 0;\r\n\tfoot_offset = datyoffset - 0.4;\r\n\r\n\tmirror ([orientation, 0, 0]){\r\n\t\t\/\/ Mirror to provide a left or right mounted switch.\r\n\t\t\/\/\r\n\t\ttranslate ([datxoffset, datyoffset, height \/ 2]){\r\n\t\t\t\/\/Move datum position.\r\n\t\t\t\/\/\r\n\t\t\tcolor(\"DarkSlateGray\")\r\n\t\t\tlinear_extrude(height, center=true){\r\n\t\t\t\t\/\/ Body\r\n\t\t\t\t\/\/ \r\n\t\t\t\tdifference(){\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\tsquare ([length, width]); \/\/Main body cuboid.\r\n\t\t\t\t\t\ttranslate ([-datxoffset, -datyoffset])\r\n\t\t\t\t\t\tsquare ([holedia, foot_offset * -2], center=true);\r\n\t\t\t\t\t\ttranslate ([-datxoffset - xholepitch - hole_slot_length \/ 2, -datyoffset + yholepitch])\r\n\t\t\t\t\t\tsquare ([holedia, foot_offset * -2], center=true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Subtractive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\ttranslate ([length \/ 2, width - cutout_offset]) \/\/ Move corner cutout.\r\n\t\t\t\t\t\tsquare ([length, width]); \/\/ Corner cutout.\r\n\t\t\t\t\t\ttranslate ([-datxoffset, -datyoffset]) \/\/ Move datum hole.\r\n\t\t\t\t\t\tcircle (d = holedia); \/\/ Remove datum hole.\r\n\t\t\t\t\t\ttranslate ([-datxoffset - xholepitch - hole_slot_length \/ 2, -datyoffset + yholepitch]){ \/\/ Move second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/ Second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\t\thull(){\r\n\t\t\t\t\t\t\t\tcircle (d = holedia);\r\n\t\t\t\t\t\t\t\ttranslate ([hole_slot_length, 0]) \/\/ Move circle to create slot.\r\n\t\t\t\t\t\t\t\tcircle (d = holedia);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcolor(\"Silver\")\r\n\t\t\tlinear_extrude(lever_width, center=true){\r\n\t\t\t\t\/\/ Lever\r\n\t\t\t\t\/\/\r\n\t\t\t\ttranslate([1 ,+ lever_height - datyoffset,0]) \/\/ Move lever to position\r\n\t\t\t\tmirror([0, 1, 0]) \/\/ Mirror lever to invert shape\r\n\t\t\t\tunion (){\r\n\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\/\/\r\n\t\t\t\t\tsquare ([lever_length + 2.5 , lever_thickness]);\r\n\t\t\t\t\tsquare ([lever_thickness,width \/ 2]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( x = [1.6, 6.3, 11.4]){\r\n\t\t\t\tcolor (\"Silver\")\r\n\t\t\t\ttranslate ([x, -tab_length - datyoffset, 0])\r\n\t\t\t\tterminal(tab_length, tab_width, tab_thickness, tab_holedia);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\/\/\r\n\/\/ Terminal module for solder pad. Other terminal types are available. \r\n\/\/\r\nmodule terminal (tab_length, tab_width, tab_thickness, tab_holedia){\r\n\trotate ([0,90,0]){\r\n\t\ttranslate ([tab_width \/ -2,0,0]) {\r\n\t\t\tlinear_extrude(tab_thickness, center=true){\r\n\t\t\t\tdifference (){\r\n\t\t\t\t\tsquare ([tab_width , tab_length]);\r\n\t\t\t\t\ttranslate ([tab_width \/ 2, tab_width \/ 2, 0])\r\n\t\t\t\t\tcircle (d = tab_holedia);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","old_contents":"\/\/ MicroSwitch v1.1 by Gyrobot\r\n\/\/ http:\/\/www.gyrobot.co.uk\r\n\/\/\r\n\/\/ Default values based upon :\r\n\/\/ Farnell P\/N : 2352329\r\n\/\/ Omron Electronic Components P\/N : SS-01GLT\r\n\/\/\r\n\/\/ Datum X is centre of mounting hole with X pointing away from mounting slot.\r\n\/\/ Datum Y is pointing away from terminals towards the lever.\r\n\/\/ Datum Z is in on base of model.\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ length = Length of body in X.\r\n\/\/ width = Width of body in Y.\r\n\/\/ height = Height (thickness) of body in Z.\r\n\/\/ datxoffset = X Position of lower left corner of body from Datum hole.\r\n\/\/ datyoffset = Y Position of lower left corner of body from Datum hole.\r\n\/\/ orientation = Defines whether the switch is mounted left or right (0:1).\r\n\/\/ holedia = Size of Datum mounting hole and slot width of second hole.\r\n\/\/ xholepitch = Mounting hole X pitch.\r\n\/\/ yholepitch = Mounting hole Y pitch.\r\n\/\/ hole_slot_length = Slot length of second mounting hole.\r\n\/\/ lever_length = Length of lever.\r\n\/\/ lever_width = Width of lever.\r\n\/\/ lever_thickness = Thickness of lever.\r\n\/\/ lever_height = Height of lever (OP) from Datum hole.\r\n\/\/ tab_length = Length of terminal tab from Datum hole.\r\n\/\/ tab_width = Width of terminal tab.\r\n\/\/ tab_thickness = Thickness of terminal tab.\r\n\/\/ tab_holedia = Diameter of terminal tab hole.\r\n\/\/\r\n\r\nmodule MicroSwitch(length = 19.8, width = 10.2, height = 6.4, datxoffset = -14.6, datyoffset = -2.5, orientation = 0, holedia = 2.35, xholepitch = 9.5, yholepitch = 0, hole_slot_length = 0.15, lever_length = 14.5, lever_width = 3.6, lever_thickness = 0.3, lever_height = 8.8, tab_length = 6.4, tab_width = 3.2, tab_thickness = 0.3, tab_holedia = 1.6){\r\n\r\n\tcutout_offset = 0.7;\r\n\tfoot_offset = datyoffset - 0.4;\r\n\r\n\tmirror ([orientation, 0, 0]){\r\n\t\t\/\/ Mirror to provide a left or right mounted switch.\r\n\t\t\/\/\r\n\t\ttranslate ([datxoffset, datyoffset, height \/ 2]){\r\n\t\t\t\/\/Move datum position.\r\n\t\t\t\/\/\r\n\t\t\tcolor(\"DarkSlateGray\")\r\n\t\t\tlinear_extrude(height, center=true){\r\n\t\t\t\t\/\/ Body\r\n\t\t\t\t\/\/ \r\n\t\t\t\tdifference(){\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\tsquare ([length, width]); \/\/Main body cuboid.\r\n\t\t\t\t\t\ttranslate ([-datxoffset, -datyoffset])\r\n\t\t\t\t\t\tsquare ([holedia, foot_offset * -2], center=true);\r\n\t\t\t\t\t\ttranslate ([-datxoffset - xholepitch - hole_slot_length \/ 2, -datyoffset + yholepitch])\r\n\t\t\t\t\t\tsquare ([holedia, foot_offset * -2], center=true);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Subtractive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\ttranslate ([length \/ 2, width - cutout_offset]) \/\/ Move corner cutout.\r\n\t\t\t\t\t\tsquare ([length, width]); \/\/ Corner cutout.\r\n\t\t\t\t\t\ttranslate ([-datxoffset, -datyoffset]) \/\/ Move datum hole.\r\n\t\t\t\t\t\tcircle (d = holedia); \/\/ Remove datum hole.\r\n\t\t\t\t\t\ttranslate ([-datxoffset - xholepitch - hole_slot_length \/ 2, -datyoffset + yholepitch]){ \/\/ Move second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/ Second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\t\thull(){\r\n\t\t\t\t\t\t\t\tcircle (d = holedia);\r\n\t\t\t\t\t\t\t\ttranslate ([hole_slot_length, 0]) \/\/ Move circle to create slot.\r\n\t\t\t\t\t\t\t\tcircle (d = holedia);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcolor(\"Silver\")\r\n\t\t\tlinear_extrude(lever_width, center=true){\r\n\t\t\t\t\/\/ Lever\r\n\t\t\t\t\/\/\r\n\t\t\t\ttranslate([2.5 ,+ lever_height - datyoffset,0]) \/\/ Move lever to position\r\n\t\t\t\tmirror([0, 1, 0]) \/\/ Mirror lever to invert shape\r\n\t\t\t\tunion (){\r\n\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\/\/\r\n\t\t\t\t\tsquare ([lever_length + 2.5 , lever_thickness]);\r\n\t\t\t\t\tsquare ([lever_thickness,width \/ 2]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( x = [1.6, 10.4, 17.7]){\r\n\t\t\t\tcolor (\"Silver\")\r\n\t\t\t\ttranslate ([x, -tab_length - datyoffset, 0])\r\n\t\t\t\tterminal(tab_length, tab_width, tab_thickness, tab_holedia);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\/\/\r\n\/\/ Terminal module for solder pad. Other terminal types are available. \r\n\/\/\r\nmodule terminal (tab_length, tab_width, tab_thickness, tab_holedia){\r\n\trotate ([0,90,0]){\r\n\t\ttranslate ([tab_width \/ -2,0,0]) {\r\n\t\t\tlinear_extrude(tab_thickness, center=true){\r\n\t\t\t\tdifference (){\r\n\t\t\t\t\tsquare ([tab_width , tab_length]);\r\n\t\t\t\t\ttranslate ([tab_width \/ 2, tab_width \/ 2, 0])\r\n\t\t\t\t\tcircle (d = tab_holedia);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ac764173b942c950d4bb320c858ed52fddbb8405","subject":"removed temp file","message":"removed temp file\n","repos":"fponticelli\/smallbridges","old_file":"temp.scad","new_file":"temp.scad","new_contents":"","old_contents":"include \n$fn = 48;\n$detailed = true;\nrotate([90,0,0]) {\n printer();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3ed33548ce6bbae36ca9b48c33c658bd14dcf77e","subject":"body: fine","message":"body: fine\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\n\nmodule body()\n{ \n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = 100);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"HEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\n\nmodule body()\n{ \n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = 100);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d65af6af06c2b79daa461e338b68c131dcfe941d","subject":"comment","message":"comment\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/voronoi.scad","new_file":"hardware\/sandbox\/voronoi.scad","new_contents":"include <..\/config\/config.scad>\n\n\n*random_voronoi(\n n = 100, nuclei = false, L = 100,\n thickness = 1, round = 0, min = 0, max = 100,\n seed = undef, center = true);\n\nmodule specialVoronoi() {\n\n \/\/ distributes voronoi points in a circular band around the origin\n\n numPoints = 80;\n or = 60;\n ir = 30;\n\n function x(r,a) = r * cos(a);\n function y(r,a) = r * sin(a);\n\n point_set = [\n for (i=[0:numPoints-1])\n let (r = rands(ir,or,1)[0], a = rands(0,360,1)[0])\n [ x(r,a), y(r,a) ]\n ];\n\n for (p = point_set)\n color(\"red\")\n translate([0,0,1])\n translate(p)\n circle(r=1);\n voronoi(point_set, L = 2*or, thickness = 1, round = 0, nuclei = false);\n}\n\n\nspecialVoronoi();\n","old_contents":"include <..\/config\/config.scad>\n\n\n*random_voronoi(\n n = 100, nuclei = false, L = 100,\n thickness = 1, round = 0, min = 0, max = 100,\n seed = undef, center = true);\n\nmodule specialVoronoi() {\n\n numPoints = 80;\n or = 60;\n ir = 30;\n\n function x(r,a) = r * cos(a);\n function y(r,a) = r * sin(a);\n\n point_set = [\n for (i=[0:numPoints-1])\n let (r = rands(ir,or,1)[0], a = rands(0,360,1)[0])\n [ x(r,a), y(r,a) ]\n ];\n\n for (p = point_set)\n color(\"red\")\n translate([0,0,1])\n translate(p)\n circle(r=1);\n voronoi(point_set, L = 2*or, thickness = 1, round = 0, nuclei = false);\n}\n\n\nspecialVoronoi();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9b73a275b03d19e8d0c53a7b21687c309f574c8b","subject":"misc: add v_x,v_y etc helpers","message":"misc: add v_x,v_y etc helpers\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e3abb319feb96a206a5b88b5b39b6a9132f4199c","subject":"x-ends: tweak height and bearing positions","message":"x-ends: tweak height and bearing positions\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+5*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=ZAXIS,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"dfceb6b212ca5a19fc6a4498acce1b78b7a5d399","subject":"see through lid\/base on elbow, marker indent in forearm, extended forearm cutout","message":"see through lid\/base on elbow, marker indent in forearm, extended forearm cutout\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n\/\/$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\nrender()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\nsharpieDiameter = 13;\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = sharpieDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n #translate([-forearmLength + sharpieDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\nquality = \"development\";\nif (quality == \"production\") {\n\t$fn = 48;\n} else {\n\t$fn = 24;\n}\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"fe951fee88d6abc2116775e68b92b3c29362caeb","subject":"y\/idler: fix print direction","message":"y\/idler: fix print direction\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2),\n align=N,\n orient=X\n );\n \/*rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);*\/\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n tz(extrusion_size\/2+yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", h=extrusion_size+yaxis_idler_mount_thickness+10*mm, head_embed=false, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2), orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", cut_screw=true, screw_l=7*mm, trap_axis=-Z, orient=-X);\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, Z], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,-X], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2),\n align=N,\n orient=X\n );\n \/*rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);*\/\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n tz(extrusion_size\/2+yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", h=extrusion_size+yaxis_idler_mount_thickness+10*mm, head_embed=false, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2), orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", cut_screw=true, screw_l=7*mm, trap_axis=-Z, orient=-X);\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, -X], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,-X], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2908ccd5d8cf454cab0fd20a7762c6eb650dda50","subject":"config: refactor lq\/hq modes","message":"config: refactor lq\/hq modes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 12;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+1*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\n$preview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+1*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"be72773e3ab715063f77948727746b3ff68f4a55","subject":"feat: add an operator to animate a scaling","message":"feat: add an operator to animate a scaling\n","repos":"jsconan\/camelSCAD","old_file":"operator\/animate\/scale.scad","new_file":"operator\/animate\/scale.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that animate child modules with respect to particular rules.\n *\n * @package operator\/animate\n * @author jsconan\n *\/\n\n\/**\n * Scales the child modules, interpolating the scale ratios with respect to the `$t` variable.\n *\n * @param Vector [from] - The scale ratios from where starts the interpolation.\n * @param Vector [to] - The scale ratios to where ends the interpolation.\n * @param Number [start] - The start threshold under what the from-scale ratios will persist and above what it will be interpolated.\n * @param Number [end] - The end threshold above what the to-scale ratios will persist and under what it will be interpolated.\n * @param Number [domain] - The percentage domain used to compute the thresholds (default: 100).\n * @param Vector [values] - A list of scale ratios composing the range to interpolate.\n * @param Vector [range] - A pre-built interpolation range. If missing, it will be built from the parameters `from`, `to`, `start`, `end`, `domain`.\n * @returns Number\n *\/\nmodule scaleAnimate(from, to, start, end, domain, values, range) {\n scale(interpolateStep3D(step=$t, low=from, high=to, start=start, end=end, domain=domain, values=values, range=range)) {\n children();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'operator\/animate\/scale.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1386df18299ba428ce83d0c4c55ae313e813055d","subject":"initial model","message":"initial model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"balcony_door_handle\/balcony_door_handle.scad","new_file":"balcony_door_handle\/balcony_door_handle.scad","new_contents":"$fs=0.01;\n\nmodule supportCore()\n{\n \/\/ top cylinder\n translate([0, 0, 30-5])\n rotate([-90, 0, 0])\n cylinder(r=5, h=40);\n \/\/ main support\n translate([-5, 0, 0])\n cube([10, 40, 30-5]);\n}\n\n\nmodule support()\n{\n difference()\n {\n supportCore();\n for(offset = [-5, +5])\n translate([offset, 0, 0])\n scale([1, 1, (30-5)\/(2*2)])\n translate([0, -1, 2])\n rotate([-90, 0, 0])\n cylinder(r=2, h=42);\n }\n}\n\n\nmodule mountingPad()\n{\n translate([-30\/2, -10, 0])\n cube([30, 60, 2]);\n}\n\n\nmountingPad();\ntranslate([0, 0, 2])\n support();\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"402d36c650495c7d7a9497515ecac4dbbe139f73","subject":"Create motor2.scad","message":"Create motor2.scad","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/motor2.scad","new_file":"hardware\/vitamins\/motor2.scad","new_contents":"module logo_motor(motor_rotation_x, motor_rotation_y, motor_rotation_z){\nmotor_shaft_r=5;\nmotor_shaft_h=8;\nmotor_flange_h = 1;\nmotor_flange_r = 9.20;\nMotor_body_r = 28.00;\nMotor_body_h = 19.30;\n\n\t\/\/\/rotate object around to Y access\n\trotate([motor_rotation_x, motor_rotation_y, motor_rotation_z]){\n\t\n\/\/ shaft\n\t\t\n\t\t\tdifference() {\n\t\tcolor(\"grey\");\n\t\tcylinder(r=motor_shaft_r, h=motor_shaft_h, center=true);\n\t\t\t\/\/\/add some flats\n\t\t\t\t\n\t\t\t\ttranslate([-5,2,-4])\n\t\t\t\tcube([10,5,6]);\n\t\t\t\t\n\t\t\t\tmirror([0,1,0]){\n\t\t\t\t\n\t\t\t\ttranslate([-5,2,-4])\n\t\t\t\tcube([10,5,6]);\n\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t\t\/\/flange\n\t\t\t\t\ttranslate([0,0,motor_shaft_h\/2]) \n\t\t\t\t\t\tcolor(\"yellow\")\n\t\t\t\t\t\tcylinder(r=motor_flange_r, h=motor_flange_h, center=true);\n\t\t\t\t\t\t\/\/ Main Body\n\t\t\t\t\t\t\ttranslate([0,-15,14])\n\t\t\t\t\t\t\t\tcolor(\"silver\")\n\t\t\t\t\t\tcylinder(r=Motor_body_r, h=Motor_body_h, center=true);\n\t\t\t\t\t\t\t\/\/Flanges\n\t\t\t\t\t\t\t\ttranslate([35,-15,4.5]){\n\t\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\t\tcylinder(r=7, h=1);\n\t\t\t\t\t\t\t\t\t\t\tcylinder(r=4, h=1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\ttranslate([-14,-7,0]){\n\t\t\t\t\t\t\t\t\t\t\tcube([14.5,14,1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\/\/color(\"white\")\n\t\t\t\t\t\t\t\t\t\t\/\/cylinder(r=4, h=1);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttranslate([-35,-15,4.5]){\n\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\tcylinder(r=7, h=1);\n\t\t\t\t\t\t\t\t\tcylinder(r=4, h=1);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ttranslate([0,-7,0]){\n\t\t\t\t\t\t\t\t\t\t\tcube([14.5,14,1]);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\/\/color(\"white\")\n\t\t\t\t\t\t\t\t\t\t\/\/cylinder(r=4, h=1);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t \/\/bottom\n\t\t\t\t\t\t\tcolor(\"blue\")\n\t\t\t\t\t\t\t translate([0-7,-46,4]) \n\t\t\t\t\t\t\t\t cube([14.5,5.5,Motor_body_h]); \n\t\t\t\n\t\t\t}\n}\nlogo_motor(90,0,0);\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/vitamins\/motor2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e50c88c15ade65d42db6d68ef93df6b70703ee98","subject":"made L298N module mounts a little closer to walls. raise top platform a bit to clear L298N heatsink","message":"made L298N module mounts a little closer to walls.\nraise top platform a bit to clear L298N heatsink\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/driveElectronicsMount.scad","new_file":"Drawings\/driveElectronicsMount.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/driveElectronicsMount.scad $\n\/\/ $Id: driveElectronicsMount.scad 437 2015-03-02 15:24:02Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nlayer1bias = 0.4;\nplatformHeight = 45; \/\/ from bar to top platform\nmountHeight=15; \/\/ from bar to electronics platform\nPCBwidth=43;\nHoleInset=3;\n\nthick=5;\nt2=thick\/2;\n\nsf = 16; \/\/ sphere faces\n\nmodule braceBar(axisSep,axisRad) { difference() { union() {\n for (a=[-1,1]) translate([a*axisSep,0,0]) {\n \/\/cylinder(h=thick,r1=axisRad+3,r2=axisRad+2,$fn=24);\n hull() {\n intersection() {\n translate([0,0,2]) scale([axisRad+3,axisRad+3,thick*.8]) sphere(r=1,$fn=24);\n translate([0,0,thick\/2]) cube([22,22,thick],center=true);\n }\n translate([-a*16,-2,t2]) sphere(t2,$fn=24);\n }\n }\n\n \/\/ main bar\n \/\/%hull() for (a=[-1,1]) translate([a*axisSep,-axisRad+1,0])\n \/\/ cylinder(h=thick,r1=4,r2=3,$fn=6);\n hull() for (a=[-1,1]) translate([a*axisSep,-axisRad+.5,0])\n intersection() {\n translate([0,0,2.5]) scale([4,3.5,3.5]) sphere(1,$fn=24);\n translate([0,0,t2]) cube([22,22,thick],center=true);\n }\n\n }\n\n \/\/ holes for main axle bars\n for (a=[-1,1]) translate([axisSep*a,0,-.1])\n cylinder(h=thick*2,r=axisRad,$fn=96);\n\n \/\/ u-groove in main bar\n hull() for (a=[-1,1]) translate([a*axisSep*.8,-axisRad*.8,4.1])\n scale([6,2,2.5]) sphere(r=1,$fn=18);\n}}\n\nmodule braceCutOut1(pw,mh,dh) {\n translate([-pw+dh,mh,0]) hull() {\n translate([0,0,11]) sphere(r=2.2,$fn=22);\n translate([0,0,4]) scale([3.5,3,2]) sphere(r=1,$fn=22);\n }\n\n for(b=[-1,1]) hull() {\n translate([-pw+dh-4*b,mh,13]) sphere(r=2.2,$fn=22);\n translate([-pw+dh-7.5*b,mh,5]) sphere(r=3,$fn=22);\n }\n}\n\nmodule braceCutOut(pw,mh,dh) {\n translate([-pw+dh,mh,0]) hull() {\n translate([0,0,11-1]) sphere(r=2.2,$fn=22);\n translate([0,0,5]) scale([2.5,4,2]) sphere(r=1,$fn=22);\n }\n\n for(b=[-1,1]) hull() {\n translate([-pw+dh-4*b,mh,13-2]) sphere(r=2.2,$fn=22);\n translate([-pw+dh-6.5*b,mh,5]) sphere(r=2.8,$fn=22);\n }\n}\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\nmodule mountBrace(pw,mh,dh) {\nmountInset = 16; \/\/ dist above z axis for PCB mount hole\nmountSphereRad=6;\n union() {\n difference() {\n hull() {\n translate([-pw-10,mh, 2]) sphere(r=2,$fn=sf);\n translate([-4 ,mh, 2]) sphere(r=2,$fn=sf);\n \/\/translate([-pw+dh,mh,16]) rotate([90,0,0])\n \/\/ cylinder(h=4,r=5,$fn=26,center=true);\n translate([-pw+dh,mh,mountInset+HoleInset-mountSphereRad]) intersection() {\n scale([1,.6,1]) sphere(r=mountSphereRad,$fn=24);\n cube([15,4,15],center=true);\n }\n }\n\n braceCutOut(pw,mh,dh);\n }\n\n \/\/ put a (hopefully) single-layer wall across middle of brace.\n \/\/ makes it more stable, easier to print, and can be remioved\n \/\/ if desired.\n #hull() {\n translate([-pw+dh,mh,16]) cube([8,thinWall,2],center=true);\n translate([-pw\/2-7,mh,2]) cube([pw+10,thinWall,1],center=true);\n }\n }\n}\nmodule mountBrace1(pw,mh,dh) {\n hull() { translate([-pw+2 ,mh,19]) sphere(r=2,$fn=sf);\n translate([-pw-10,mh, 2]) sphere(r=2,$fn=sf); }\n hull() { translate([-pw+2 ,mh,19]) sphere(r=2,$fn=sf);\n translate([-4 ,mh, 2]) sphere(r=2,$fn=sf); }\n translate([-pw+dh,mh,16]) rotate([90,0,0]) cylinder(h=4,r=6,$fn=6,center=true);\n}\n\nmodule motorDriverStand(axisSep,axisRad,platHeight,platWidth,dHole,rHole)\n{\ndifference() { union() {\n braceBar(axisSep,axisRad);\n\nif(0) {\n hull() { translate([-axisSep+thick, -2,t2]) sphere(r=t2-1,$fn=sf);\n translate([ axisSep-18,-2,22]) sphere(r=t2-1,$fn=sf); } hull() {\n translate([ axisSep-thick, -2,t2]) sphere(r=t2-1,$fn=sf);\n translate([-axisSep+18,-2,22]) sphere(r=t2-1,$fn=sf); } hull() {\n translate([-axisSep+thick, -2,t2]) sphere(r=t2,$fn=sf);\n translate([-axisSep+18,-2,22]) sphere(r=t2,$fn=sf); }\nhull() {\n translate([ axisSep-thick, -2,t2]) sphere(r=t2,$fn=sf);\n translate([ axisSep-18,-2,22]) sphere(r=t2,$fn=sf); }\nhull() {\n translate([-axisSep+18,-2,22]) sphere(r=t2,$fn=sf);\n translate([ axisSep-18,-2,22]) sphere(r=t2,$fn=sf); }\n}\n\n mirror([1,0,0]) mountBrace(platWidth\/2,mountHeight,dHole);\n mountBrace(platWidth\/2,mountHeight,dHole);\n\n hull() for(a=[-1,1]) translate([a*(platWidth\/2+15),mountHeight,2])\n sphere(r=2.4,$fn=sf);\n\n for (a=[-1,1]) hull() { \/\/ side diag rails\n translate([a*platWidth*.3,platHeight-.5,2]) sphere(r=2.4,$fn=sf);\n translate([a*(axisSep-5) , 1 ,2]) sphere(r=2.4,$fn=sf); }\n\n translate([-platWidth*.35,platHeight-2,0]) cube([platWidth*.7,4,8]);\n }\n\n for (a=[-1,1]) translate([a*(platWidth\/2-dHole),mountHeight,14.5])\n rotate([90,0,0]) cylinder(h=10,r=rHole,$fn=80,center=true);\n}}\n\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\ntranslate([-Bx,0,0]) footpad(12);\ntranslate([ Bx,0,0]) footpad(12);\ntranslate([-PCBwidth\/2, platformHeight-2,0]) footpad(12);\ntranslate([ PCBwidth\/2, platformHeight-2,0]) footpad(12);\n}\ntranslate([0,0,layer1bias\/2])\n motorDriverStand(Bx,Bhole,platformHeight,PCBwidth,HoleInset,PCBhole);\n}} else {\n difference() {\n motorDriverStand(Bx,Bhole,platformHeight,PCBwidth,HoleInset,PCBhole);\n translate([0,0,-4]) cube([200,200,8],center=true); }\n}\n\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/driveElectronicsMount.scad $\n\/\/ $Id: driveElectronicsMount.scad 437 2015-03-02 15:24:02Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = 1;\ninclude ; \/\/ Bx \nlayer1bias = 0.4;\nplatformHeight = 40;\nmountHeight=15;\nPCBwidth=43;\nHoleInset=3;\n\nthick=5;\nt2=thick\/2;\n\nsf = 16; \/\/ sphere faces\n\nmodule braceBar(axisSep,axisRad) { difference() { union() {\n for (a=[-1,1]) translate([a*axisSep,0,0]) {\n \/\/cylinder(h=thick,r1=axisRad+3,r2=axisRad+2,$fn=24);\n hull() {\n intersection() {\n translate([0,0,2]) scale([axisRad+3,axisRad+3,thick*.8]) sphere(r=1,$fn=24);\n translate([0,0,thick\/2]) cube([22,22,thick],center=true);\n }\n translate([-a*16,-2,t2]) sphere(t2,$fn=24);\n }\n }\n\n \/\/ main bar\n \/\/%hull() for (a=[-1,1]) translate([a*axisSep,-axisRad+1,0])\n \/\/ cylinder(h=thick,r1=4,r2=3,$fn=6);\n hull() for (a=[-1,1]) translate([a*axisSep,-axisRad+.5,0])\n intersection() {\n #translate([0,0,2.5]) scale([4,3.5,3.5]) sphere(1,$fn=24);\n translate([0,0,t2]) cube([22,22,thick],center=true);\n }\n\n }\n\n \/\/ holes for main axle bars\n for (a=[-1,1]) translate([axisSep*a,0,-.1])\n cylinder(h=thick*2,r=axisRad,$fn=96);\n\n \/\/ u-groove in main bar\n hull() for (a=[-1,1]) translate([a*axisSep*.8,-axisRad*.8,4.1])\n scale([6,2,2.5]) sphere(r=1,$fn=18);\n}}\n\nmodule braceCutOut1(pw,mh,dh) {\n translate([-pw+dh,mh,0]) hull() {\n translate([0,0,11]) sphere(r=2.2,$fn=22);\n translate([0,0,4]) scale([3.5,3,2]) sphere(r=1,$fn=22);\n }\n\n for(b=[-1,1]) hull() {\n translate([-pw+dh-4*b,mh,13]) sphere(r=2.2,$fn=22);\n translate([-pw+dh-7.5*b,mh,5]) sphere(r=3,$fn=22);\n }\n}\n\nmodule braceCutOut(pw,mh,dh) {\n translate([-pw+dh,mh,0]) hull() {\n translate([0,0,11]) sphere(r=2.2,$fn=22);\n translate([0,0,4]) scale([3.5,3,2]) sphere(r=1,$fn=22);\n }\n\n for(b=[-1,1]) hull() {\n translate([-pw+dh-4*b,mh,13]) sphere(r=2.2,$fn=22);\n translate([-pw+dh-7.5*b,mh,5]) sphere(r=3,$fn=22);\n }\n}\n\nmodule mountBrace(pw,mh,dh) {\n union() {\n difference() {\n hull() {\n translate([-pw-10,mh, 2]) sphere(r=2,$fn=sf);\n translate([-4 ,mh, 2]) sphere(r=2,$fn=sf);\n \/\/translate([-pw+dh,mh,16]) rotate([90,0,0])\n \/\/ cylinder(h=4,r=5,$fn=26,center=true);\n translate([-pw+dh,mh,16]) intersection() {\n scale([6,4,6]) sphere(r=1,$fn=24);\n cube([15,4,15],center=true);\n }\n }\n\n braceCutOut(pw,mh,dh);\n }\n\n \/\/ put a (hopefully) single-layer wall across middle of brace.\n \/\/ makes it more stable, easier to print, and can be remioved\n \/\/ if desired.\n #hull() {\n translate([-pw+dh,mh,16]) cube([9,.35,2],center=true);\n translate([-pw\/2-7,mh,2]) cube([pw+10,.35,1],center=true);\n }\n }\n}\nmodule mountBrace1(pw,mh,dh) {\n hull() { translate([-pw+2 ,mh,19]) sphere(r=2,$fn=sf);\n translate([-pw-10,mh, 2]) sphere(r=2,$fn=sf); }\n hull() { translate([-pw+2 ,mh,19]) sphere(r=2,$fn=sf);\n translate([-4 ,mh, 2]) sphere(r=2,$fn=sf); }\n translate([-pw+dh,mh,16]) rotate([90,0,0]) cylinder(h=4,r=6,$fn=6,center=true);\n}\n\nmodule motorDriverStand(axisSep,axisRad,platHeight,platWidth,dHole,rHole)\n{\ndifference() { union() {\n braceBar(axisSep,axisRad);\n\nif(0) {\n hull() { translate([-axisSep+thick, -2,t2]) sphere(r=t2-1,$fn=sf);\n translate([ axisSep-18,-2,22]) sphere(r=t2-1,$fn=sf); } hull() {\n translate([ axisSep-thick, -2,t2]) sphere(r=t2-1,$fn=sf);\n translate([-axisSep+18,-2,22]) sphere(r=t2-1,$fn=sf); } hull() {\n translate([-axisSep+thick, -2,t2]) sphere(r=t2,$fn=sf);\n translate([-axisSep+18,-2,22]) sphere(r=t2,$fn=sf); }\nhull() {\n translate([ axisSep-thick, -2,t2]) sphere(r=t2,$fn=sf);\n translate([ axisSep-18,-2,22]) sphere(r=t2,$fn=sf); }\nhull() {\n translate([-axisSep+18,-2,22]) sphere(r=t2,$fn=sf);\n translate([ axisSep-18,-2,22]) sphere(r=t2,$fn=sf); }\n}\n\n mirror([1,0,0]) mountBrace(platWidth\/2,mountHeight,dHole);\n mountBrace(platWidth\/2,mountHeight,dHole);\n\n hull() for(a=[-1,1]) translate([a*(platWidth\/2+13),mountHeight,2])\n sphere(r=2.4,$fn=sf);\n\n for (a=[-1,1]) hull() { \/\/ side diag rails\n translate([a*platWidth*.3,platHeight-.5,2]) sphere(r=2.4,$fn=sf);\n translate([a*(axisSep-5) , 1 ,2]) sphere(r=2.4,$fn=sf); }\n\n translate([-platWidth*.35,platHeight-2,0]) cube([platWidth*.7,4,8]);\n }\n\n for (a=[-1,1]) translate([a*(platWidth\/2-dHole),mountHeight,16])\n rotate([90,0,0]) cylinder(h=10,r=rHole,$fn=80,center=true);\n}}\n\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\ntranslate([-Bx,0,0]) footpad(12);\ntranslate([ Bx,0,0]) footpad(12);\ntranslate([-PCBwidth\/2, platformHeight-2,0]) footpad(12);\ntranslate([ PCBwidth\/2, platformHeight-2,0]) footpad(12);\n}\ntranslate([0,0,layer1bias\/2])\n motorDriverStand(Bx,Bhole,platformHeight,PCBwidth,HoleInset,PCBhole);\n}} else {\n difference() {\n motorDriverStand(Bx,Bhole,platformHeight,PCBwidth,HoleInset,PCBhole);\n translate([0,0,-4]) cube([200,200,8],center=true); }\n}\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e4abf4ac201c221a93318bc0b3f845696ece2e0d","subject":"final touches on the model","message":"final touches on the model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"module rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*20);\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\/\/ element for holding a single brush\nmodule holder()\n{\n translate([-4\/2, 0, 0])\n cube([4, 7, 17]);\n translate([0, 0, 17-2])\n {\n rotate([-90, 0, 0])\n cylinder(r=(8-1.5)\/2, h=7+2+7, $fn=50);\n translate([0, 7, 0])\n rotate([-90,0,0])\n cylinder(r=(3-1)\/2, h=14+2, $fn=30);\n }\n}\n\n\nmodule whole_holder(names)\n{\n assert( len(names) > 0 );\n r=5;\n spacing=20;\n total_len=2*(r+3) + spacing*(len(names)-1) + 4;\n\n \/\/ plate\n translate([0, r+2, -r])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([total_len, 35], r\/2+1);\n cube([total_len, r, r*2]);\n }\n \/\/ back wall\n rounded_half_surface_([total_len, 50], r);\n \/\/ holders\n for(i=[0:len(names)-1])\n translate([r+3+4\/2, 25, r-1] + i*[spacing, 0, 0])\n holder();\n}\n\n\nwhole_holder([\"John\", \"Jane\", \"Jackob\"]);\n","old_contents":"module rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*3); \/\/ TODO: r*10!\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\/\/ element for holding a single brush\nmodule holder()\n{\n translate([-3\/2, 0, 0])\n cube([3, 7, 17]);\n translate([0, 0, 17-2])\n {\n rotate([-90, 0, 0])\n cylinder(r=(8-1.5)\/2, h=7+2+7, $fn=50);\n translate([0, 7, 0])\n rotate([-90,0,0])\n cylinder(r=(3-1)\/2, h=14+2, $fn=30);\n }\n}\n\n\nmodule whole_holder(names)\n{\n \/\/ plate\n translate([0, 5+1, -5])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([36, 35], 3);\n cube([36, 5, 3*2]);\n }\n \/\/ back wall\n rounded_half_surface_([36, 50], 5);\n \/\/ holders\n for(i=[0:len(names)-1])\n translate([7+i*20, 25, 4])\n holder();\n}\n\n\nwhole_holder([\"John\", \"Jane\", \"Jackob\"]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"af9b9559388add3a69777b43cc80435677847540","subject":"Adding Apex details and ESC","message":"Adding Apex details and ESC\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"use \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[65, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[65, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-79, 4, 23]) cube(size=[43, 2, 6], center=false);\n translate ([-79, -6, 23]) cube(size=[43, 2, 6], center=false); \n \/\/ servo \n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n \n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n \n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([79, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,41], [-23,41],[-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-79-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,45], [-25,45],[-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n color(\"black\") translate ([0, 0, 46]) difference() {\n union() {\n #linear_extrude(height = 3)\n difference() {\n offset(20) offset(-20) base_plate();\n \n offset(5) offset(-10) polygon([\n [-54,40],[29,40],[29,-40],[-54,-40]\n ]);\n }\n \n \/\/ shock tower mount points\n translate ([-79, -25, 0]) cube(size=[5, 50, 11], center=false); \n translate ([79-5, -23, 0]) cube(size=[5, 46, 7], center=false); \n\n \/\/ joint mount plates to body\n translate ([-79, -25, 0]) cube(size=[15, 50, 3], center=false); \n translate ([79-15, -23, 0]) cube(size=[15, 46, 3], center=false); \n }\n \n \/\/ board mount holes\n #translate ([-54, 31, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([-54, -31, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([29, 31, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([29, -31, 0]) cylinder(d=3.2, h=10, center=true);\n }\n}\n\nmodule board() {\n \n \/\/ base\n color(\"yellow\") translate ([-12.5, 0, 45]) cube(size=[90, 70, 1], center=true); \n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 45+5]) cube(size=[20, 63, 10], center=true); \n \n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 45+5]) cube(size=[20, 20, 10], center=true); \n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true); \n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -45\/2, -6]) cube(size=[3, 45, 26], center=false);\n color(\"gray\") translate ([-8.5, -45\/2, -6]) cube(size=[10, 45, 5], center=false);\n \n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n \n \/\/translate ([10, -23, 35]) esc(); \n translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n \n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar(); \n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar(); \n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n \n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar(); \n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar(); \n}\n\nfullv();\n","old_contents":"use \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n \/\/ base plate\n color(\"gray\") translate ([0, 0, 12])\n linear_extrude(height = 20) base_plate();\n\n \/\/ front shocks\n color(\"gray\") translate ([79, 0, 12]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,41], [-23,41],[-38,0],[38,0]]);\n\n \/\/ rear shocks\n color(\"gray\") translate ([-79-16, 0, 12]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,45], [-25,45],[-38,0],[38,0]]);\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n color(\"black\") translate ([0, 0, 46]) difference() {\n union() {\n #linear_extrude(height = 3)\n difference() {\n offset(20) offset(-20) base_plate();\n \n offset(5) offset(-10) polygon([\n [-54,40],[29,40],[29,-40],[-54,-40]\n ]);\n }\n \n \/\/ shock tower mount points\n translate ([-79, -25, 0]) cube(size=[5, 50, 11], center=false); \n translate ([79-5, -23, 0]) cube(size=[5, 46, 7], center=false); \n\n \/\/ joint mount plates to body\n translate ([-79, -25, 0]) cube(size=[15, 50, 3], center=false); \n translate ([79-15, -23, 0]) cube(size=[15, 46, 3], center=false); \n }\n \n \/\/ board mount holes\n #translate ([-54, 27, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([-54, -27, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([29, 20, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([29, -20, 0]) cylinder(d=3.2, h=10, center=true);\n }\n\n \/\/ board\n color(\"yellow\") translate ([-12.5, 0, 45]) cube(size=[90, 70, 1], center=true); \n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 45+5]) cube(size=[20, 63, 10], center=true); \n \n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 45+5]) cube(size=[20, 20, 10], center=true); \n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -45\/2, -6]) cube(size=[3, 45, 26], center=false);\n color(\"gray\") translate ([-8.5, -45\/2, -6]) cube(size=[10, 45, 5], center=false);\n \n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/\/ ful model - vertical sonars\nmodule fullv() {\n base();\n platform();\n\n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar(); \n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar(); \n}\n\n\/\/ ful model - horizontal sonars\nmodule fullh() {\n base();\n platform();\n\n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar(); \n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar(); \n}\n\nfullv();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"576b359b6b3fb6c907f8bb45a0940abd8e092305","subject":"A model was added of a sample Borg ship.","message":"A model was added of a sample Borg ship.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/cosplay\/star-trek\/borg\/ship\/borg-ship.scad","new_file":"OpenSCAD\/cosplay\/star-trek\/borg\/ship\/borg-ship.scad","new_contents":"\r\n\/**\r\n * the box for the Borg costume is 18\" cubed.\r\n * \r\n * 1 inch is 25.4mm\r\n *\/\r\nsideLength = 25.4 * 18;\r\n\r\nsheetWidth = 203.2;\r\nsheetHeight = 271.4;\r\n\r\nborgShip();\r\n\r\nmodule borgShip()\r\n{\r\n\tunion()\r\n\t{\r\n\t\tcube([sideLength, sideLength, sideLength]);\r\n\t\t\r\n\t\tpokePanel();\r\n\t\t\r\n\t\tdiegoPanel1();\r\n\t\t\r\n\t\tsoundPanel();\r\n\t\t\r\n\t\tdiegoPanel2();\r\n\t}\t\r\n}\r\n\r\nmodule diegoPanel1()\r\n{\r\n\t\/\/ bottom right\r\n\tcolor(\"red\")\r\n\ttranslate([sideLength-sheetHeight, 0, sideLength])\r\n\trotate(a=[90, 90, 0])\r\n\tsheet();\r\n\t\r\n\t\/\/ bottom left\r\n\tcolor(\"red\")\r\n\trotate(a=[90, 0, 0])\r\n\tsheet();\r\n\t\r\n\t\/\/ bottom right\r\n\tcolor(\"red\")\r\n\ttranslate([sideLength-sheetHeight, 0, sheetWidth])\r\n\trotate(a=[90, 90, 0])\r\n\tsheet();\r\n}\r\n\r\nmodule diegoPanel2()\r\n{\r\n\ttranslateY = sideLength+2;\r\n\t\r\n\t\/\/ top left\r\n\tcolor(\"orange\")\r\n\ttranslate([sideLength-sheetHeight, translateY, sideLength])\r\n\trotate(a=[90, 90, 0])\r\n\tsheet();\r\n\t\r\n\t\/\/ bottom left\r\n\tcolor(\"orange\")\r\n\ttranslate([sideLength-sheetHeight, translateY, sheetWidth])\r\n\trotate(a=[90, 90, 0])\r\n\tsheet();\r\n\t\r\n\t\/\/ bottom right\r\n\tcolor(\"orange\")\r\n\ttranslate([0, translateY, 0])\r\n\trotate(a=[90, 0, 0])\r\n\tsheet();\r\n}\r\n\r\nmodule pokePanel()\r\n{\r\n\tpokeTranslate = [0,90,0]; \r\n\t\r\n\t\/\/ top left\r\n\tcolor(\"blue\")\r\n\ttranslate([sideLength, 0, sideLength])\r\n\trotate(a=pokeTranslate)\r\n\tsheet();\r\n\t\r\n\t\/\/ top right\r\n\tcolor(\"blue\")\r\n\ttranslate([sideLength, sideLength-sheetHeight, sideLength])\r\n\trotate(a=pokeTranslate)\r\n\tsheet();\r\n\t\r\n\t\/\/ bottom left\r\n\tcolor(\"blue\")\r\n\ttranslate([sideLength, 0, sheetWidth])\r\n\trotate(a=pokeTranslate)\/\/[0,90,0])\r\n\tsheet();\r\n\r\n\t\/\/ bottom right\r\n\tcolor(\"blue\")\r\n\ttranslate([sideLength, sideLength-sheetHeight, sheetWidth])\r\n\trotate(a=pokeTranslate)\r\n\tsheet();\t\r\n}\r\n\r\n\/**\r\n * printable area on letter sized paper (according to http:\/\/support-sg.canon-asia.com\/contents\/SG\/EN\/8200392300.html#2)\r\n * \r\n * 203.2 x 271.4 mm\r\n *\/\r\nmodule sheet()\r\n{\r\n\tcube([sheetWidth, sheetHeight, 2]);\r\n}\r\n\r\n\/**\r\n * This panel holds the LS31FL3137 (is this right???) for sound reactive charlie plexing an \r\n * LED matrix.\r\n *\/\r\nmodule soundPanel()\r\n{\r\n\thorizRotate = [0,-90,0];\r\n\t\r\n\tverticalRotate = [-90, 180, 90];\r\n\t\r\n\t\/\/ top left\r\n\tcolor(\"green\")\r\n\ttranslate([-30,sideLength-sheetHeight,sideLength-sheetWidth])\r\n\trotate(a=horizRotate)\r\n\tsheet();\r\n\r\n\t\/\/ top right\r\n\tcolor(\"green\")\r\n\ttranslate([0, sheetWidth, sideLength-sheetHeight])\r\n\trotate(a=verticalRotate)\r\n\tsheet();\r\n\t\r\n\t\/\/ top right\r\n\tcolor(\"green\")\r\n\ttranslate([0, sideLength, 0])\r\n\trotate(a=verticalRotate)\r\n\tsheet();\r\n\t\r\n\t\/\/ bottom right\r\n\tcolor(\"green\")\r\n\ttranslate([-30,0,0])\r\n\trotate(a=horizRotate)\r\n\tsheet();\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/cosplay\/star-trek\/borg\/ship\/borg-ship.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b82e695e30385ecd3c2755c9acbed11642f8766a","subject":"Drop any mention of feet or inlets, neither of which we'll want.","message":"Drop any mention of feet or inlets, neither of which we'll want.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/RaspberryPi_v15.scad","new_file":"designs\/RaspberryPi_v15.scad","new_contents":"\/\/ Raspberry Pi Case\n\/\/ Hans Harder 2012\n\/\/\n\/\/ Warning: this is based on the Beta board dimensions...\n\/\/ so production models can be slightly different\n\/\/ for instance SD card holder height and USB socket dimensions\n\/\/\n\/\/ Since all connectors stick out, case is split on HDMI height\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\n\/\/\n\/\/ v2: Adapted version after some suggestions from David...\n\/\/ removed feet, made both surface flat\n\/\/ v3: Added fliptop option and smooth the corners of the box\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\n\/\/ Looks strange but it fits...\n\/\/ Added frame mode (so no bottom and top deck)\n\/\/ Moved screw locations due to split and added some support structures\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\n\/\/ v5 relocated a lot of code in modules\n\/\/ SDslot location was not calculated correctly\n\/\/ v6 Added pcb drawing\n\/\/ Added colors\n\/\/ Cut out better so there is no debris around\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\n\/\/ Make a low as possible case, let USB stick out\n\/\/ v7 PCB options\n\/\/ Low level case optimisations\n\/\/ SD card location alterations\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\n\/\/ adapted support studs, moved some due to component location\n\/\/ components locations adapted\n\/\/ v9 Added logo in seperate dxf file\n\/\/ Option added to put logo in middle or using whole deck\n\/\/ beautified code, kr style\n\/\/ v10 Added logosunken and bottomsupport structures\n\/\/ Bottom supports are located where no components are located\n\/\/ so the pcb is not only supported from the sides\n\/\/ Well got my case, so based on what I see I changed:\n\/\/ case split level changed, should be better when printed on a reprap\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\n\/\/ Made frontstud a little thicker\n\/\/ v11 Different splitlevel (more simple) on back\n\/\/ keep a little margin on back split, so that top and bottom always fit\n\/\/ added openlogo option\n\/\/ v12 Different component locations\/sizes\n\/\/ keep a little margin on component holes\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\n\/\/ v13 skip this one.... :)\n\/\/ v14 Production board measurements...\n\/\/\t small differences, sometimes components are soldered differently\n\/\/ keep more space\n\/\/ should fit like a glove...\n\/\/ v15 moved the rca and snd a bit to get them more centered\n\/\/ Thanks to lincomatic at Thingiverse\n\/\/ Added option for GPIO side hole in bottom or top\n\/\/ Added showing GPIO pins with component drawing\n\/\/\n\/\/ All parts are draw as default just disable the ones you don't want\nDRAWfull = 0;\nDRAWtop = 1;\nDRAWbottom = 1;\nDRAWpcb = 0;\n\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\nGPIOsize = 2; \/\/ define height of gpiohole\n\n\/\/ select how the case should look like\ntopframe = false; \/\/ if false, underneath values determines how\ntopholes = true;\n\/\/ ---- holes sizes\nholeofs=2;\nholesiz=3;\nholestep=10;\nnoholes=6;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\nholelen=24;\ntopmiddle = false;\n\nbottomframe = false; \/\/ if false, underneath values determines how\nbottomholes = false;\nbottomscrew = false;\nbottomsupport = false; \/\/ Added extra support locations for pcb\nbottomclick = true;\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\n\nbox_thickness = 2.0; \/\/ minimum = 1.0\ninside_h = 12.5; \/\/ 12.1 = lowprofile 16.5 is full height\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\n\n\/\/ just some colors to see the difference\nCASEcolor=\"Maroon\";\nCONNcolor=\"Silver\";\n\n\/\/ Define Raspberry Pi pcb dimensions in mm\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\ninside_w = 57.2; \/\/56.17 is largest width reported, so a bit room on each side\npcb_thickness = 1.7;\n\n\/\/ Coordinates based on RJ45 corner = 0,0,0\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\n\n\/\/ Connectors\nCrj45_x=2.0;\t\t\t \/\/2.0\nCrj45_y=-1;\nCrj45_w=16.4;\t\t\t\/\/ 15.4\nCrj45_d=21.5; \/\/21.8\nCrj45_h=13.8;\n\nCusb_x=24.5; \/\/ 23.9\nCusb_y=-7.7;\nCusb_w=13.9; \/\/ 13.3\nCusb_d=19.0;\t\t\t\/\/ 17.2\nCusb_h=16.0;\n\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\nCpwr_y=80.9;\nCpwr_w=8.8;\t\t\t\t\/\/ 7.8 7.6\nCpwr_d=5.6;\nCpwr_h=2.6;\n\nCsd_x=16.7;\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\nCsd_w=27.8;\nCsd_d=29.0;\nCsd_h=3.4; \/\/ under pcb\n\nChdmi_x=-1.2;\nChdmi_y=32.0; \/\/ 32.4 if 15.1\nChdmi_w=11.4;\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\nChdmi_h=6.4;\n\nCsnd_x=inside_w - 11.4;\nCsnd_y=16.0;\nCsnd_w=11.4;\nCsnd_d=10.0;\nCsnd_h=10.5;\nCsnd_r=6.7;\nCsnd_z=3.0;\nCsnd_l=3.4;\n\nCrca_x=inside_w - 10.0 - 2.1;\nCrca_y=34.2; \/\/ 34.6 was 35.2\nCrca_w=10.0;\nCrca_d=10.4; \/\/ 9.8\nCrca_h=13.0;\nCrca_r=8.6;\nCrca_z=4;\nCrca_l=10; \/\/ wild guess\n\n\n\npcb_c = pcb_h + pcb_thickness; \/\/ component height\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\necho(\"casesplit=\",casesplit);\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\n\n\/\/ side stud sizes for supporting pcb\nstud_w = 2;\nstud_l = 4;\n\n\/\/ calculate box size\nbox_l = inside_l + (box_thickness * 2);\nbox_w = inside_w + (box_thickness * 2);\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\nbox_w1 = box_thickness;\nbox_w2 = box_w - box_thickness;\nbox_l1 = box_thickness;\nbox_l2 = box_l - box_thickness;\nbox_wc = box_w \/ 2; \/\/ center width\nbox_lc = box_l \/ 2; \/\/ center length\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\nmiddle = true;\n\/\/ rounded corners\ncorner_radius = box_thickness*2;\n\n\n\n\/\/ count no of items to draw\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom;\n\n\/\/ ====================================================== DRAW items\n\/\/ if one draw it centered\nif (DRAWtotal == 1) {\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\n if (DRAWfull ) {\n draw_case(0,1);\n translate(v=[0,0,0.2]) draw_case(1,0);\n }\n if (DRAWtop ) {\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\n }\n if (DRAWbottom) draw_case(1,0);\n }\n} else {\n\/\/ draw each one on there one location\n if (DRAWfull) {\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\n draw_case(1,0);\n translate(v=[0,0,0.2]) draw_case(0,1);\n }\n }\n if (DRAWbottom) {\n translate(v = [ 5, 5, 0]) draw_case(1,0);\n }\n if (DRAWtop) {\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\n }\n}\n\n\/\/ ======================================================= END of draw\n\/\/ Module sections\n\nmodule make_deckholes(no,w,d,step) {\nfor ( i = [0 : 1 : no - 1] ) {\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) cube([w,d, box_thickness+18], center=true);\n }\n}\n\n\n\/\/ create a deck or insert\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\n ofs1=4;\n ofs2=w - ofs1 - hole_w;\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\n color(CASEcolor) {\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\n difference() {\n cube([w, d, box_thickness], center = false);\n if (top && holes && hole_size>0) {\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n }\n if (screwholes) {\n \/\/ --- 2x screw holes in bottom for mounting\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\n \/\/ 2nd screw hole\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\n if (!holes) {\n \/\/ middle screw hole\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\n }\n }\n if (holes && !top) {\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep);\n }\n }\n color(CASEcolor) {\n if (top && holes) {\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\n }\n if (middle) {\n \/\/ --- solid area for sticker\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\n cube([20,20, box_thickness], center = false);\n }\n }\n }\n }\n }\n}\n\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\n translate(v = [x, y, -1]) {\n difference() {\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\n }\n }\n}\n\n\nmodule make_topcomponents() {\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\n\n \/\/SND\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\n\n \/\/RCA\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\n }\n for ( i = [0 : 1 : 12] ) {\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n\n }\n}\n\nmodule make_connholes() {\n \/\/ =================================== cut outs, offset from 0,0\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\n\n \/\/power: 3.4mm offset, 8mm width, 3mm height\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\n if (pcb_h >= (Csd_h+1.5) ) {\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\n } else {\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\n }\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\n\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\n\n \/\/ RCA: 35mm offset, 10mm width 10mm height\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\n }\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\n cube([5,Crca_r+2,Crca_r\/2+1]);\n }\n}\n\nmodule make_pcb() {\n translate(v=[box_w1,box_l1,pcb_h]) {\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\n }\n color(CONNcolor) {\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\n }\n make_topcomponents();\n}\n\n\/\/ put extra supports on free spaces, used beta board image\nmodule make_supports() {\n if (!bottomframe) {\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n }\n}\n\n\/\/ width,depth,height,boxthickness,ledgethickness\nmodule make_case(w,d,h,bt,lt) {\n dt=bt+lt; \/\/ box+ledge thickness\n bt2=bt+bt; \/\/ 2x box thickness\n \/\/ Now we just substract the shape we have created in the four corners\n color(CASEcolor) difference() {\n cube([w,d,h], center=false);\n if (rounded) {\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\n }\n \/\/ empty inside, but keep a ledge for strength\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\n \/\/ remove bottom and top deck\n translate(v = [box_thickness+2, box_thickness+5,-2]) {\n cube([inside_w-4, inside_l-10, box_h+4], center = false);\n }\n }\n if (!topframe) {\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,middle=topmiddle,screwholes=false,top=true);\n }\n if (!bottomframe) {\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,screwholes=bottomscrew,middle=false,top=false);\n if (bottomsupport) {\n make_supports();\n }\n }\n}\n\nmodule make_stud(x,y,z,w,h,l) {\n translate(v = [x, y, z]) cube([w, l, h], center = false);\n}\n\nmodule set_cutout(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\n}\n\nmodule set_cutoutv(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\n}\n\nmodule draw_pcbhold() {\n if (bottomclick) {\n color(CASEcolor) {\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\n difference() {\n cube([1, 3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\n difference() {\n cube([1,3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1, 3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1,3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n }\n }\n}\n\nmodule split_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w1+Csd_x - 12; \/\/ min 16.5+28\n split4=box_w2 - 7;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\n}\n\nmodule remove_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12;\n possd1=box_w1 + Csd_x - 0.3;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\n \/\/ back on 3 different levels\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\n if (bottompcb) {\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\n }\n}\n\nmodule remove_bottom() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12.1;\n possd1=box_w1 + Csd_x - 0.2;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\n}\n\nmodule draw_case(bottom, top) {\n difference() {\n union() {\n \/\/ make empty case\n difference() {\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\n if (top != 0 && bottom == 0) remove_bottom();\n if (top == 0 && bottom != 0) remove_top();\n }\n color(CASEcolor) {\n if (bottom != 0 ) {\n \/\/ add bottom studs for pcb\n \/\/ add bottom studs for pcb\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\n\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\n\n\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n\n draw_pcbhold();\n }\n\n if (top != 0) {\n \/\/ --- screw connection plates\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\n }\n translate(v = [box_w2-15, box_l2 - 1.5, casesplit - 5.4]) {\n cube([8, 1.5, box_h-(casesplit-5.4)], center = false);\n }\n \/\/ extra support for shell\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\n\t\t\t\t\t }\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\n cube([stud_w,10, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n }\n } \/\/ color\n } \/\/ end union\n \/\/ conn plate hole\n color(CASEcolor) {\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n if (GPIOHOLE == 1 && bottom != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \n }\n if (GPIOHOLE == 2 && top != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \n }\n }\n if (bottom != 0) {\n if (top == 0) {\n remove_top();\n } else {\n split_top();\n }\n }\n make_connholes();\n }\n if (bottom) {\n draw_pcbhold();\n if (DRAWpcb == 1) make_pcb();\n }\n} \/\/ end module\n","old_contents":"\/\/ Raspberry Pi Case\n\/\/ Hans Harder 2012\n\/\/\n\/\/ Warning: this is based on the Beta board dimensions...\n\/\/ so production models can be slightly different\n\/\/ for instance SD card holder height and USB socket dimensions\n\/\/\n\/\/ Since all connectors stick out, case is split on HDMI height\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\n\/\/\n\/\/ v2: Adapted version after some suggestions from David...\n\/\/ removed feet, made both surface flat\n\/\/ v3: Added fliptop option and smooth the corners of the box\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\n\/\/ Looks strange but it fits...\n\/\/ Added frame mode (so no bottom and top deck)\n\/\/ Moved screw locations due to split and added some support structures\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\n\/\/ v5 relocated a lot of code in modules\n\/\/ SDslot location was not calculated correctly\n\/\/ v6 Added pcb drawing\n\/\/ Added colors\n\/\/ Cut out better so there is no debris around\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\n\/\/ Make a low as possible case, let USB stick out\n\/\/ v7 PCB options\n\/\/ Low level case optimisations\n\/\/ SD card location alterations\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\n\/\/ adapted support studs, moved some due to component location\n\/\/ components locations adapted\n\/\/ v9 Added logo in seperate dxf file\n\/\/ Option added to put logo in middle or using whole deck\n\/\/ beautified code, kr style\n\/\/ v10 Added logosunken and bottomsupport structures\n\/\/ Bottom supports are located where no components are located\n\/\/ so the pcb is not only supported from the sides\n\/\/ Well got my case, so based on what I see I changed:\n\/\/ case split level changed, should be better when printed on a reprap\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\n\/\/ Made frontstud a little thicker\n\/\/ v11 Different splitlevel (more simple) on back\n\/\/ keep a little margin on back split, so that top and bottom always fit\n\/\/ added openlogo option\n\/\/ v12 Different component locations\/sizes\n\/\/ keep a little margin on component holes\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\n\/\/ v13 skip this one.... :)\n\/\/ v14 Production board measurements...\n\/\/\t small differences, sometimes components are soldered differently\n\/\/ keep more space\n\/\/ should fit like a glove...\n\/\/ v15 moved the rca and snd a bit to get them more centered\n\/\/ Thanks to lincomatic at Thingiverse\n\/\/ Added option for GPIO side hole in bottom or top\n\/\/ Added showing GPIO pins with component drawing\n\/\/\n\/\/ All parts are draw as default just disable the ones you don't want\nDRAWfull = 0;\nDRAWtop = 1;\nDRAWbottom = 1;\nDRAWtopinlet = 0;\nDRAWbottominlet = 0;\nDRAWpcb = 0;\n\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\nGPIOsize = 2; \/\/ define height of gpiohole\n\n\/\/ select how the case should look like\ntopframe = false; \/\/ if false, underneath values determines how\ntopinlet = false; \/\/ false is outside, otherwise it is with an indent\ntopholes = true;\n\/\/ ---- holes sizes\nholeofs=2;\nholesiz=3;\nholestep=10;\nnoholes=6;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\nholelen=24;\ntopmiddle = false;\n\nbottomframe = false; \/\/ if false, underneath values determines how\nbottominlet = false;\nbottomholes = false;\nbottomscrew = false;\nbottomfeet = false; \/\/ MHL: conflict w\/ various through-hole components\nbottomsupport = false; \/\/ Added extra support locations for pcb\nbottomclick = true;\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\n\nbox_thickness = 2.0; \/\/ minimum = 1.0\ninside_h = 12.5; \/\/ 12.1 = lowprofile 16.5 is full height\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\n\n\/\/ just some colors to see the difference\nCASEcolor=\"Maroon\";\nCONNcolor=\"Silver\";\n\n\/\/ Define Raspberry Pi pcb dimensions in mm\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\ninside_w = 57.2; \/\/56.17 is largest width reported, so a bit room on each side\npcb_thickness = 1.7;\n\n\/\/ Coordinates based on RJ45 corner = 0,0,0\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\n\n\/\/ Connectors\nCrj45_x=2.0;\t\t\t \/\/2.0\nCrj45_y=-1;\nCrj45_w=16.4;\t\t\t\/\/ 15.4\nCrj45_d=21.5; \/\/21.8\nCrj45_h=13.8;\n\nCusb_x=24.5; \/\/ 23.9\nCusb_y=-7.7;\nCusb_w=13.9; \/\/ 13.3\nCusb_d=19.0;\t\t\t\/\/ 17.2\nCusb_h=16.0;\n\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\nCpwr_y=80.9;\nCpwr_w=8.8;\t\t\t\t\/\/ 7.8 7.6\nCpwr_d=5.6;\nCpwr_h=2.6;\n\nCsd_x=16.7;\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\nCsd_w=27.8;\nCsd_d=29.0;\nCsd_h=3.4; \/\/ under pcb\n\nChdmi_x=-1.2;\nChdmi_y=32.0; \/\/ 32.4 if 15.1\nChdmi_w=11.4;\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\nChdmi_h=6.4;\n\nCsnd_x=inside_w - 11.4;\nCsnd_y=16.0;\nCsnd_w=11.4;\nCsnd_d=10.0;\nCsnd_h=10.5;\nCsnd_r=6.7;\nCsnd_z=3.0;\nCsnd_l=3.4;\n\nCrca_x=inside_w - 10.0 - 2.1;\nCrca_y=34.2; \/\/ 34.6 was 35.2\nCrca_w=10.0;\nCrca_d=10.4; \/\/ 9.8\nCrca_h=13.0;\nCrca_r=8.6;\nCrca_z=4;\nCrca_l=10; \/\/ wild guess\n\n\n\npcb_c = pcb_h + pcb_thickness; \/\/ component height\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\necho(\"casesplit=\",casesplit);\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\n\n\/\/ side stud sizes for supporting pcb\nstud_w = 2;\nstud_l = 4;\n\n\/\/ calculate box size\nbox_l = inside_l + (box_thickness * 2);\nbox_w = inside_w + (box_thickness * 2);\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\nbox_w1 = box_thickness;\nbox_w2 = box_w - box_thickness;\nbox_l1 = box_thickness;\nbox_l2 = box_l - box_thickness;\nbox_wc = box_w \/ 2; \/\/ center width\nbox_lc = box_l \/ 2; \/\/ center length\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\nmiddle = true;\n\/\/ rounded corners\ncorner_radius = box_thickness*2;\n\n\n\n\/\/ count no of items to draw\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom + DRAWtopinlet + DRAWbottominlet;\n\n\/\/ ====================================================== DRAW items\n\/\/ if one draw it centered\nif (DRAWtotal == 1) {\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\n if (DRAWfull ) {\n draw_case(0,1);\n translate(v=[0,0,0.2]) draw_case(1,0);\n }\n if (DRAWtop ) {\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\n }\n if (DRAWbottom) draw_case(1,0);\n if (DRAWtopinlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false);\n if (DRAWbottominlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew);\n }\n} else {\n\/\/ draw each one on there one location\n if (DRAWfull) {\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\n draw_case(1,0);\n translate(v=[0,0,0.2]) draw_case(0,1);\n }\n }\n if (DRAWbottom) {\n translate(v = [ 5, 5, 0]) draw_case(1,0);\n }\n if (DRAWtop) {\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\n }\n if (DRAWtopinlet) {\n translate(v = [ -box_w-5, -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false);\n }\n if (DRAWbottominlet) {\n translate(v = [ 5 , -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 10,3,5 , holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew);\n }\n}\n\n\/\/ ======================================================= END of draw\n\/\/ Module sections\n\nmodule make_deckholes(no,w,d,step) {\nfor ( i = [0 : 1 : no - 1] ) {\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) cube([w,d, box_thickness+18], center=true);\n }\n}\n\n\n\/\/ create a deck or insert\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\n ofs1=4;\n ofs2=w - ofs1 - hole_w;\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\n color(CASEcolor) {\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\n difference() {\n cube([w, d, box_thickness], center = false);\n if (top && holes && hole_size>0) {\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\n }\n if (screwholes) {\n \/\/ --- 2x screw holes in bottom for mounting\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\n \/\/ 2nd screw hole\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\n if (!holes) {\n \/\/ middle screw hole\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\n }\n }\n if (holes && !top) {\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep);\n }\n }\n color(CASEcolor) {\n if (feet) {\n translate(v=[3,3,0]) cube([8, 8, box_thickness+4], center = false);\n translate(v=[w-3-8,3,0]) cube([8, 8, box_thickness+4], center = false);\n translate(v=[3,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\n translate(v=[w-3-8,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\n }\n if (top && holes) {\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\n }\n if (middle) {\n \/\/ --- solid area for sticker\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\n cube([20,20, box_thickness], center = false);\n }\n }\n }\n }\n }\n}\n\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\n translate(v = [x, y, -1]) {\n difference() {\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\n }\n }\n}\n\n\nmodule make_topcomponents() {\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\n\n \/\/SND\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\n\n \/\/RCA\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\n }\n for ( i = [0 : 1 : 12] ) {\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\n\n }\n}\n\nmodule make_connholes() {\n \/\/ =================================== cut outs, offset from 0,0\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\n\n \/\/power: 3.4mm offset, 8mm width, 3mm height\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\n if (pcb_h >= (Csd_h+1.5) ) {\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\n } else {\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\n }\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\n\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\n\n \/\/ RCA: 35mm offset, 10mm width 10mm height\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\n }\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\n cube([5,Crca_r+2,Crca_r\/2+1]);\n }\n}\n\nmodule make_pcb() {\n translate(v=[box_w1,box_l1,pcb_h]) {\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\n }\n color(CONNcolor) {\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\n }\n make_topcomponents();\n}\n\n\/\/ put extra supports on free spaces, used beta board image\nmodule make_supports() {\n if (!bottomframe) {\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\n\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\n\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\n }\n}\n\n\/\/ width,depth,height,boxthickness,ledgethickness\nmodule make_case(w,d,h,bt,lt) {\n dt=bt+lt; \/\/ box+ledge thickness\n bt2=bt+bt; \/\/ 2x box thickness\n \/\/ Now we just substract the shape we have created in the four corners\n color(CASEcolor) difference() {\n cube([w,d,h], center=false);\n if (rounded) {\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\n }\n \/\/ empty inside, but keep a ledge for strength\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\n \/\/ remove bottom and top deck\n translate(v = [box_thickness+2, box_thickness+5,-2]) {\n cube([inside_w-4, inside_l-10, box_h+4], center = false);\n }\n }\n if (!topframe) {\n if (!topinlet) {\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,top=true);\n } else {\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness*2, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,top=true);\n }\n }\n if (!bottomframe) {\n if (!bottominlet) {\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,top=false);\n } else {\n make_deck(inside_w-4,inside_l-4,box_thickness, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,top=false);\n }\n if (bottomsupport) {\n make_supports();\n }\n }\n}\n\nmodule make_stud(x,y,z,w,h,l) {\n translate(v = [x, y, z]) cube([w, l, h], center = false);\n}\n\nmodule set_cutout(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\n}\n\nmodule set_cutoutv(x,y,z,w,l,h) {\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\n}\n\nmodule draw_pcbhold() {\n if (bottomclick) {\n color(CASEcolor) {\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\n difference() {\n cube([1, 3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\n difference() {\n cube([1,3,2]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1, 3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\n rotate(a=180, v=[0,0,1]) difference() {\n cube([1,3,3]);\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\n }\n }\n }\n }\n}\n\nmodule split_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w1+Csd_x - 12; \/\/ min 16.5+28\n split4=box_w2 - 7;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\n}\n\nmodule remove_top() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12;\n possd1=box_w1 + Csd_x - 0.3;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\n \/\/ back on 3 different levels\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\n if (bottompcb) {\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\n }\n}\n\nmodule remove_bottom() {\n split1=box_w1+Cpwr_x;\n split2=split1+Cpwr_w;\n split3=box_w2 - 12.1;\n possd1=box_w1 + Csd_x - 0.2;\n widesd1=Csd_w+0.6;\n \/\/ Different splitlevels for the shells\n \/\/ 1st half on split level\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\n \/\/ back on 3 different levels\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\n}\n\nmodule draw_case(bottom, top) {\n difference() {\n union() {\n \/\/ make empty case\n difference() {\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\n if (top != 0 && bottom == 0) remove_bottom();\n if (top == 0 && bottom != 0) remove_top();\n }\n color(CASEcolor) {\n if (bottom != 0 ) {\n \/\/ add bottom studs for pcb\n \/\/ add bottom studs for pcb\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\n\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\n\n\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\n\n draw_pcbhold();\n }\n\n if (top != 0) {\n \/\/ --- screw connection plates\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\n }\n translate(v = [box_w2-15, box_l2 - 1.5, casesplit - 5.4]) {\n cube([8, 1.5, box_h-(casesplit-5.4)], center = false);\n }\n \/\/ extra support for shell\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\n\t\t\t\t\t }\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\n cube([stud_w,10, box_h-pcb_c-1], center = false);\n }\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\n }\n }\n } \/\/ color\n } \/\/ end union\n \/\/ conn plate hole\n color(CASEcolor) {\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\n\t\t }\n if (GPIOHOLE == 1 && bottom != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \n }\n if (GPIOHOLE == 2 && top != 0) {\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \n }\n }\n if (bottom != 0) {\n if (top == 0) {\n remove_top();\n } else {\n split_top();\n }\n }\n make_connholes();\n }\n if (bottom) {\n draw_pcbhold();\n if (DRAWpcb == 1) make_pcb();\n }\n} \/\/ end module\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3c6f01ef2d19640bb315235c522caf6b22c372ae","subject":"nipple_top","message":"nipple_top\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/nipple.scad","new_file":"class1\/exercise\/refactor\/nipple.scad","new_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\n\nmodule shoulder_top_little()\n{\n position_ring = [0,0,-BORDER_NIPPLE];\n \n posicion_circle_x = radius(DIAMETER_NIPPLE)-BORDER_NIPPLE;\n position_circle = [posicion_circle_x, 0, 0];\n \n color(GREY)\n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\nmodule nipple()\n{\n top_little();\n shoulder_top_little();\n \n\n \n \n\/\/Main nipple cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = FINE);\n\n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = FINE);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n \n} \n\nnipple();\n","old_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\n\nmodule shoulder_top_little()\n{\n position_ring = [0,0,-BORDER_NIPPLE];\n \n posicion_circle_x = radius(DIAMETER_NIPPLE)-BORDER_NIPPLE;\n position_circle = [posicion_circle_x, 0, 0];\n \n color(GREY)\n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_NIPPLE, $fn = FINE); \n}\nmodule nipple()\n{\n top_little();\n shoulder_top_little();\n \n\/\/Main nipple cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = FINE);\n\n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = FINE);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n \n} \n\nnipple();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"05a5eef7bb5cd03cb66308faf38501b060e790d9","subject":"splines: add","message":"splines: add\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"splines.scad","new_file":"splines.scad","new_contents":"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ splines.scad - library for mulivariate splines\n\/\/ Implementation: Rudolf Huttary (c), Berlin \n\/\/ November 2015\n\/\/ commercial use prohibited\n\/\/\n\/\/ usage scheme - n-dimensional natural cubic spline interpolation \n\/\/ A = [[...],[...],[...]]; \/\/ define Mxn matrix, M>2, n>1\n\/\/ B = nSplines(A, N); \/\/ get interpolated Nxn matrix\n\/\/ C = gen_dat(B); \/\/ interpret data and transform into trajectory\n\/\/ sweep(B); \/\/ render \n\/\/\n\/\/ for code examples see: \n\/\/ http:\/\/forum.openscad.org\/Rendering-fails-difference-between-F5-and-F6-tp15041p15100.html\n\/\/ http:\/\/forum.openscad.org\/general-extrusion-imperfect-tp14740p14752.html\n\/\/ knot() example in this file!\n\/\/\n\/\/\/\/\/ some information functions to measure diameter and bounding box of an interpolated system\n\/\/ usage: \n\/\/ B = nSplines(A); \n\/\/ echo(str(\"outer diam=\",Max(Norm(B)))); \n\/\/ echo(str(\"bounding box=\",Box(B))); \n\n\n\/\/ testcode \n\/\/A = [ \n\/\/ [-4.3, .57, .1, .3],\n\/\/ [-.9, .32, 1, .4],\n\/\/ [1.5, .07, .1, .5],\n\/\/ [2.5, -1.48, -1, 1.6],\n\/\/ [5.6, -1.68, -2, .7],\n\/\/ [6.6, 1 , 1.5, .4],\n\/\/ [4.6, .5 , 1, .3],\n\/\/ [-1 , -2, 1.3, .7],\n\/\/ [-5 , -2, 1.5, 1.8]\n\/\/ ]*10;\n\n\n\/\/A= [\n\/\/[2*x, 0, 0, 1],\n\/\/[x+dx, dy, 0, 1],\n\/\/[x, 0, 0, 1],\n\/\/[x-dx, dy, 0, 1],\n\/\/[0, 0, 0, 1],\n\/\/[x-dx, -dy, 0, 1],\n\/\/[x, 0, 0, 1],\n\/\/[x+dx, -dy, 0, 1],\n\/\/[2*x, 0, 0, 1],\n\/\/]*40;\n\nknot(); \n\nsplines_help();\n\n\nmodule knot()\n{\n\/\/ knot\nA = [ \n [-5, 0, 0],\n [-1, 0, 0],\n [-.4, 0, -.2],\n [.3, .3, .2],\n [.2, -.5, 0],\n [0, 0, -.5],\n [-.2, .5, -0],\n [-.3, -.3, .2],\n [.4, 0, -.2],\n [1, 0, 0],\n [5, 0, 0],\n ]*10;\n\n\nN = 200; \n\nnS = nSpline(A,N); \/\/ 4D-Spline rasterized\n\ntranslate([0,0,20])\n\/\/{\n\/\/ plot4D(nS); \/\/ 4D-plot, 4th dim is implicit radius\n\/\/ plot4D(A, \"red\"); \n\/\/}\nplot3D(col3D(nS), r=2); \/\/ 3D-plot, radius explicit\nplot3D(col3D(nS), r=2); \/\/ 3D-plot, radius explicit\nplot3D(col3D(A), r=3, c=\"red\"); \n\n}\n\nmodule help() splines_help();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ library stuff - modules \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nmodule plot3D(A, r=1, c = \"yellow\")\n{ \n for(i=[0:len(A)-1])\n color(c)\n translate(A[i])\n sphere(r, $fn=30); \n}\n\nmodule plot4D(A, c = \"yellow\")\n{\n for(i=[0:len(A)-1])\n color(c)\n translate([A[i][0], A[i][1], A[i][2]])\n sphere(A[i][3], $fn=30); \n}\n\nmodule help () help_splines(); \n\nmodule help_splines()\n{\n echo(\"\\nModule prototypes:\\n\n=============\\n\n help() - echos help in console\n help_splines() - echos help in console\n plot3D(A, r=1, c = \\\"yellow\\\")\\n\n plot4D(A, c = \\\"yellow\\\")\\n\\n\n Function prototypes:\\n\n=============\\n\n NxM = nSpline(S, N) - n-dim spline interpolation\\n\n t = line_integral(S) - calcs line integral over 3D polygon\\n\n coeffs = spline2D(x,y) - caculates coeffs for cubic spline\\n\n y = spline2D_eval(coeffs, t, x) - evaluate spline at x\\n\n Y = spline2D_rasterize(coeffs, t, N) - \\n\n m = Max(A, flat=true) recursive max\\n\n m = Min(A, flat=true) recursive min\\n\n n = Norm(A) - recursive norm\\n\n bb = Box(A) - boundingbox\\n\n v = flat3(A, n=0) - flatten structured vector\\n \n \n \"\n); \n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ spline stuff - functions \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\nfunction nSpline(S, N) = \n\/\/ Rasterizes a PxM-dim vector sequence S into a NxM-dim sequence\n\/\/ using a multivariate cubic spline interpolation scheme.\n\/\/ along a line integral \n\/\/ over P-dim polygon cord is used as common x-vector\n\/\/ S - is PxM-dim and denotes a seq of M-dim vectors to be\n\/\/ used as y-vectors\n\/\/ returns NxM interpolated M-dim vectors\n let(M=len(S[0]))\n let(t = line_integral(S))\n transpose(\n [for(i=[0:M-1])\n let(C = col(S,i))\n let(coeffs = spline2D(t,C)) \n (spline2D_rasterize(coeffs, t, N))]);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/\/\/\/ 2D cubic splines - main functions \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ \nfunction spline2D(x,y) = \n\/\/ calculates coeffs of cubic spline segments \n\/\/ i.e. all coeffs of eq. systems Ax\u00b3+Bx\u00b2+Cx+D = y\n\/\/ x,y - paired vectors\n\/\/ [A, B, C, D] returned vector values\n let(MT = eq_sys(x,y)) \n let(b = concat(0, solve_eq(MT[0], MT[1]), 0))\n let(N = len(x)-2) \n let(dx = [for (i=[0:N]) x[i+1] - x[i]]) \n let(A = [for (i=[0:N]) (b[i+1]-b[i])\/(3*dx[i])])\n let(C = [for (i=[0:N]) (y[i+1]-y[i])\/dx[i] - (b[i+1]-b[i])*dx[i]\/3 - b[i]*dx[i]])\n [A, b, C, y]; \n\nfunction spline2D_rasterize(coeffs, t, N) = \n\/\/ evaluates a 2D-spline defined by coeffs for the ordered vector t\n\/\/ at N equidistant points\n\/\/ returns N vector containing sequence of interpolation values \n let(T = raster(t,N))\n [for(i=[0:len(T)-1]) spline2D_eval(coeffs, t, T[i])];\n\nfunction spline2D_eval(coeffs, t, x) = \n\/\/ evaluate spline represented by coeffs and t at x\n\/\/ f(x) returned\n let(i = interval_idx(t,x))\n let(x_ = x-t[i])\n pow(x_,3)*coeffs[0][i]+\n pow(x_,2)*coeffs[1][i]+\n x_*coeffs[2][i]+\n coeffs[3][i] ;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/stuff need for solving spline specific equation system \/\/\/\nfunction eq_sys(x, y) = \n\/\/transfers value pairs into eq.system M*x=T\n\/\/ x,y - paired vectors\n\/\/ [M, T] returned vector values with M - symmetric band (m=1) matrix \n\/\/ in sparse lower band Nx2 representation\n\/\/ T - right side vector\n let(N = len(x)-3)\n let(T = [for (i=[0:N]) \n 3*((y[i+2]-y[i+1])\/(x[i+2]-x[i+1]) - (y[i+1]-y[i])\/(x[i+1]-x[i])) ])\n let(M = [for (i=[0:N]) \n [(i==0)?0:(x[i+1]-x[i]), 2*(x[i+2]-x[i]) ]])\n [M, T]; \n\nfunction solve_eq(M,y) = \n\/\/ solves eq. system M*x = y, \n\/\/ M symmetric band (m=1) matrix, in sparse lower band representation\n\/\/ uses Cholesky factorization L'*L*x=y\n let(N = len(M)-1)\n let(L = cholesky(M))\n LLx(L,y);\n \nfunction LLx(L,y) = \n\/\/ solve L'Lx=y by first solving L'(Lx) = L'x_ = y and then Lx = x_\n let (N = len(y)-1) \n let (x_ = [ for (i= [0:N]) Lx(i, L, y)]) \n [ for (i= [0:N]) Lx_(i, N, L, x_)]; \nfunction Lx(i,L,y) = (i==0)? y[0]\/L[0][1]: (y[i] - Lx(i-1,L,y) * L[i][0])\/L[i][1]; \nfunction Lx_(i,N,L,y) =(i==N)? y[i]\/L[i][1]: (y[i] - Lx_(i+1,N,L,y) * L[i+1][0])\/L[i][1]; \n \nfunction cholesky(A) = \n\/\/ Cholesky factorization - applies only to symmetric band (m=1) matrix\n\/\/ A - matrix to be factorized in sparse lower band representation\n\/\/ returns Cholesky matrix in sparse lower band representation\n let(N=len(A)-1) \n [ for(k= [0:N]) \n let(Lk_ = Lk(A, k))\n [Lk_[0], Lk_[1]]\n ];\nfunction Lk(A,k) = \n\/\/ recursive helper of cholesky()\n (k==0)?\n [0, sqrt(A[0][1]), A[0][1]]: \n let(Lk_0 = (A[k][0] \/ Lk(A, k-1)[1])) \n let(Ak_1 = (A[k][1] - Lk_0*Lk_0))\n let(Lk_1 = sqrt(Ak_1))\n [Lk_0, Lk_1, Ak_1];\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ some more general matrix and vector functions \/\/\/\/\/\/\/\/\/\/\/\/\nfunction col(S,c=0) = \n\/\/ returns column c of matrix S\n [for(i=[0:len(S)-1]) S[i][c]]; \n\nfunction col3D(S) =\n\/\/ returns first 3 columns of matrix S\n let(n=len(S[0])-1)\n [for(i=[0:len(S)-1]) \n [S[i][0], (n>0)?S[i][1]:0, (n>1)?S[i][2]:0]]; \n\nfunction transpose(A) =\n [for(i=[0:len(A[0])-1])\n [for(j=[0:len(A)-1])\n A[j][i]]]; \n\nfunction line_integral(S) = let (M = len(S))\n\/\/ calculates piecewise line integral over S, \n\/\/ S is an ordered sequence of M distinct N-dim vectors\n\/\/ returns ordered N-sequence of accumulated distances\n [for (i=[0:M-1]) lineT2(S,i)]; \n \nfunction lineT1(S, i, k) = \n\/\/ recursive helper of lineT2()\n let(t1 = pow((S[i][k]-S[i-1][k]),2))\n k==0 ? t1 : t1 + lineT1(S, i, k-1); \n \nfunction lineT2(S, i) = \n\/\/ recursive helper of line_integral()\n let(N = len(S[0]))\n let(t1 = pow(lineT1(S,i,N-1), .25)) \n (i==0)? 0: (i==1) ? t1 : t1 + lineT2(S,i-1); \n\nfunction raster(t,N=100) = \n\/\/ splits interval covered by ordered vector t \n\/\/ into N equ.dist. intervals\n\/\/ returns raster as ordered N vector \n let(d = t[len(t)-1]-t[0])\n [for (i=[0:N-1]) t[0]+i*d\/(N-1)]; \n\nfunction interval_idx(t, x) = \n\/\/ returns index of interval containing real number x\n\/\/ in ordered interval sequence defined by vector t\n let(N= len(t)-1)\n [for(i=[0:N-1]) \n if(t[0]>x || (t[i]<=x && (t[i+1])>=x) || i==N-1) i][0];\n \n \n\/\/ if flat == true \n\/\/ max(vec of ... vec) \n\/\/ else\n\/\/ vec of (max(vec))\nfunction Max(A, flat=true) = \n let (m = \n len(A[0])>1?\n [for(i=[0:len(A)-1]) Max(A[i])]:\n max(A) ) \n flat?max(m):m; \n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/\/\/\/ some information functions to measure diameter and bounding box of an interpolated system\n\/\/ usage: \n\/\/ B = nSplines(A); \n\/\/ echo(str(\"outer diam=\",Max(Norm(B)))); \n\/\/ echo(str(\"bounding box=\",Box(B))); \n \n\/\/ if flat == true min(vec of ... vec) else vec of (min(vec))\nfunction Max(A, flat=true) = \n let (m = \n len(A[0])>1?\n [for(i=[0:len(A)-1]) Max(A[i])]:\n max(A) ) \n flat?max(m):m; \n\n\/\/ if flat == true max(vec of ... vec) else vec of (max(vec))\nfunction Min(A, flat=true) = \n let (m = \n len(A[0])>1?\n [for(i=[0:len(A)-1]) Min(A[i])]:\n min(A) ) \n flat?min(m):m; \n\n\/\/ norm of vec of vec ... vec3D \nfunction Norm(A) = \n let (m = \n len(A[0])>1?\n [for(i=[0:len(A)-1]) Norm(A[i])]:\n norm(A)) m; \n\n\/\/ calculate bounding box over vec of ... vec3D as [[x,y,z], [X,Y,Z]]\n\nfunction Box(A) = [ \n [min(flat3(A,0)), min(flat3(A,1)), min(flat3(A,2))], \n [max(flat3(A,0)), max(flat3(A,1)), max(flat3(A,2))], \n ]; \n\n\/\/ flatten vec of vec of ... vec3D into vec of vec3D\nfunction flat3(A, n=0) = \n A[0][0][0] ==undef? A[n]:\n [for (i=[0:len(A)-1]) \n for (j=[0:len(A[i])-1]) \n flat3(A[i][j], n)];\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'splines.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b795f4ac7fe4e0158cbfeadead5665d45958e30d","subject":"This is a whitespace update.","message":"This is a whitespace update.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\n\/\/ this is pretty much the working copy of name-tag.scad\r\n\r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\n\r\n\/\/ remember to download write.scad and fonts\r\nuse \r\n \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"\";\/\/\"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"\";\/\/\"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Top Text] *\/\r\n\/\/topText = \"tecolote\";\/\/\"Mark\";\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"\";\/\/Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\/\/font=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, \"this value is no longer used\", topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/nametag(font=\"write\/orbitron.dxf\");\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\", \r\n topText=\"Love is the Answer\",\r\n baseWidth = 200,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(font=font, \r\n topText=topText, \r\n baseWidth = baseWidth, \r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition);\r\n\r\n icons();\r\n } \r\n}\r\n\r\nmodule nametag_assembly(font, topText, baseWidth, chainLoop, chainLoopPosition) \r\n{\r\n echo(\"font is \" + font);\r\n color(textColor) \r\n writing(font=font, topText=topText);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\t\r\n nametagBorder();\t\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes();\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes();\r\n }\r\n else \r\n { \r\n nametagBase(baseWidth, chainLoop, chainLoopPosition);\r\n }\r\n }\r\n}\r\n\r\n\/\/ TODO: Migrate this to use the built-in OpenSCAD text() module.\r\nmodule writing(font, topText)\r\n{\r\n translate([0,namematrix[0][0],baseThickness+letterThickness\/2])\r\n write(topText,\r\n t = letterThickness,\r\n h = namematrix[0][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[0][3]);\r\n \r\n \/\/ this writes the second element (sub-element 1 and on) and on, max 100 names\r\n for ( i = [1 : 99] )\r\n {\t\t\t\t\r\n if (namematrix[i][0]==undef)\r\n {\r\n ;\t\/\/ then do nothing\r\n }\r\n else \r\n {\t\t \r\n translate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n write(namematrix[i][1],\r\n t = letterThickness,\r\n h = namematrix[i][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[i][3]);\r\n }\r\n }\r\n} \r\n\r\nmodule base2holes(baseWidth, chainLoop) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, chainLoop);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes(baseWidth, chainLoop) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, chainLoop);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth, chainLoop, chainLoopPosition)\r\n{\r\n roundedCorners = true;\r\n \r\n size = [baseWidth, baseHeight, baseThickness];\r\n \r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,cornerRadius=8, sides=30, sidesOnly=true, cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\/\/ yTranslate = -baseHeight - 6; \r\n \r\n yTranslate = (chainLoopPosition == \"bottom\") ? -baseHeight - 6 : \r\n baseHeight - 2; \r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xScale = x,\r\n yScale = y,\r\n zScale = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth)\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter(baseWidth)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","old_contents":"\r\n\/\/ this is pretty much the working copy of name-tag.scad\r\n\r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\n\r\n\/\/ remember to download write.scad and fonts\r\nuse \r\n \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"\";\/\/\"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"\";\/\/\"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Top Text] *\/\r\n\/\/topText = \"tecolote\";\/\/\"Mark\";\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"\";\/\/Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\/\/font=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, \"this value is no longer used\", topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/nametag(font=\"write\/orbitron.dxf\");\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\", \r\n topText=\"Love is the Answer\",\r\n baseWidth = 200,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(font=font, \r\n topText=topText, \r\n baseWidth = baseWidth, \r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition);\r\n\r\n icons();\r\n } \r\n}\r\n\r\nmodule nametag_assembly(font, topText, baseWidth, chainLoop, chainLoopPosition) \r\n{\r\n echo(\"font is \" + font);\r\n color(textColor) \r\n writing(font=font, topText=topText);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\t\r\n nametagBorder();\t\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes();\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes();\r\n }\r\n else \r\n { \r\n nametagBase(baseWidth, chainLoop, chainLoopPosition);\r\n }\r\n }\r\n}\r\n\r\n\/\/ TODO: Migrate this to use the built-in OpenSCAD text() module.\r\nmodule writing(font, topText)\r\n{\r\n translate([0,namematrix[0][0],baseThickness+letterThickness\/2])\r\n write(topText,\r\n t = letterThickness,\r\n h = namematrix[0][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[0][3]\r\n\/\/\t\t\t , bold=1\r\n );\r\n \r\n\t\/\/ this writes the second element (sub-element 1 and on) and on, max 100 names\r\n\tfor ( i = [1 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n} \r\n\r\nmodule base2holes(baseWidth, chainLoop) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, chainLoop);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes(baseWidth, chainLoop) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, chainLoop);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth, chainLoop, chainLoopPosition)\r\n{\r\n roundedCorners = true;\r\n \r\n size = [baseWidth, baseHeight, baseThickness];\r\n \r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,cornerRadius=8, sides=30, sidesOnly=true, cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\/\/ yTranslate = -baseHeight - 6; \r\n \r\n yTranslate = (chainLoopPosition == \"bottom\") ? -baseHeight - 6 : \r\n baseHeight - 2; \r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xScale = x,\r\n yScale = y,\r\n zScale = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth)\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter(baseWidth);\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter(baseWidth)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9bbc8d2ad88ccf3f9fe29b4a1dc3df28ea7332ef","subject":"levelSensor added","message":"levelSensor added\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"IrigMa\/levelSensor.scad","new_file":"IrigMa\/levelSensor.scad","new_contents":"\/\/Level Sensor\n$fn=50;\n\nmodule sensor(side=12) {\n for(i=[-1,1])translate([10*i,0])cube([side,side,1],center=true);\n difference() {\n translate([0,0,side\/2-0.5])cube([side+1,side,side],center=true);\n translate([0,0,side\/2-1.5])cube([side-4,side,side-2],center=true);\n for(i=[-1,1])translate([0,3*i])cylinder(r=1,h=side);\n }\n}\n!sensor();","old_contents":"","returncode":1,"stderr":"error: pathspec 'IrigMa\/levelSensor.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ab77c8264870ef2b879b4ccbb4bcbd062b5ba553","subject":"fixup! *: Update for fncylindera removal","message":"fixup! *: Update for fncylindera removal\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/\/ The default value is 2.\n$fs = 2;\n\/*$fs = 0.5;*\/\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\/*$fa = 4;*\/\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/\/ The default value is 2.\n\/*$fs = 2;*\/\n$fs = 0.5;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n\/*$fa = 12;*\/\n$fa = 4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"dac456513b320609cf8c259b2e8ced0dfd771ff6","subject":"Added circle cookie cutter","message":"Added circle cookie cutter\n","repos":"ksuszka\/3d-projects","old_file":"small\/circle_cookie_cutter.scad","new_file":"small\/circle_cookie_cutter.scad","new_contents":"\/\/ Circle cookie cutter\n\ndraft = true;\n\nsteps_per_bezier = draft ? 10 : 40;\nrotate_extrude_steps = draft ? 60 : 360;\n\n\/\/ Bezier functions taken from http:\/\/www.thingiverse.com\/thing:8443\/\nfunction BEZ03(u) = pow((1-u), 3);\nfunction BEZ13(u) = 3*u*(pow((1-u),2));\nfunction BEZ23(u) = 3*(pow(u,2))*(1-u);\nfunction BEZ33(u) = pow(u,3);\n\nfunction PointAlongBez4(p0, p1, p2, p3, u) = [\n\tBEZ03(u)*p0[0]+BEZ13(u)*p1[0]+BEZ23(u)*p2[0]+BEZ33(u)*p3[0],\n\tBEZ03(u)*p0[1]+BEZ13(u)*p1[1]+BEZ23(u)*p2[1]+BEZ33(u)*p3[1]];\n\nfunction length(v) = sqrt(v*v);\n\nfunction Curve(points, steps=steps_per_bezier) = [\n for (i = [ 0 : len(points) - 2 ])\n let ( prev = points[i>0?i-1:i],\n p0 = points[i], \n p3 = points[i+1],\n next = points[i+2\ninclude \ninclude \ninclude \n\n\/\/3 Pin IEC320 C14 Inlet Male Power Socket w Fuse Switch 10A 250V\n\/\/http:\/\/www.amazon.com\/IEC320-Inlet-Power-Socket-Switch\/dp\/B00511QVVK\n\/\/http:\/\/www.uxcell.com\/pin-iec320-c14-inlet-male-power-socket-fuse-switch-10a-250v-p-104813.html\n\n\/\/position X\/Y offset\nIEC_offset = [0,0];\n\n\/\/mounting width of IEC switch\/fuse\/socket\nIEC_width = 47*mm + .2*mm;\n\n\/\/mounting height of IEC switch\/fuse\/socket\nIEC_height = 27*mm + .2*mm;\n\n\/\/mounting flange depth of IEC switch\/fuse\/socket\nIEC_depth = 1;\n\n\/\/width of flange before returning to full panel thickness\nIEC_rim = 1.5;\n\n\/\/side length of the corner cutout on the IEC connect end of the power module\nIEC_corner = 6-.5;\n\npower_panel_iec320_width = IEC_width+15*mm;\npower_panel_iec320_height = main_lower_dist_z+extrusion_size;\npower_panel_iec320_thickness = 3.8*mm;\n\n\/\/horizontal distance from edge to mounting hole\npower_panel_iec320_hole_hedge_w = 5*mm;\n\n\/\/vertical spacing of mounting holes\npower_panel_iec320_hole_vspace = main_lower_dist_z;\n\nmount_hole_d = 5*mm;\n\nmodule power_panel_iec320(align=N, orient=[0,0,-1])\n{\n s = [power_panel_iec320_width,power_panel_iec320_height,power_panel_iec320_thickness];\n size_align(size=s, align=align, orient=orient, orient_ref=[0,0,-1])\n rotate ([180,0,180])\n difference ()\n {\n \/\/power_panel_iec320\n rcubea(size=s);\n\n \/\/socket\n translate(v = [IEC_offset[0], IEC_offset[1], 0])\n difference()\n {\n union()\n {\n translate(v = [0, 0, -IEC_depth])\n cube(size = [IEC_width,IEC_height+IEC_rim*2,power_panel_iec320_thickness], center = true );\n cube(size = [IEC_width,IEC_height,power_panel_iec320_thickness+1], center = true);\n }\n for (x = [-1:2:1])\n translate([(IEC_width-IEC_corner)\/2, x*(IEC_height-IEC_corner)\/2,0])\n\n rotate([0,0,x*45])\n translate([0,-(IEC_width+IEC_height)\/2,-(power_panel_iec320_thickness+1)\/2])\n cube([IEC_width+IEC_height,IEC_width+IEC_height,power_panel_iec320_thickness+1]);\n }\n\n \/\/ extrusion mounting holes\n for (x = [-1,1])\n for (y = [-1,1])\n translate([x*(power_panel_iec320_width\/2-power_panel_iec320_hole_hedge_w-mount_hole_d\/2), y*(power_panel_iec320_hole_vspace\/2), -s[2]\/2])\n screw_cut(nut=extrusion_nut, h=12*mm, with_nut=false, align=Z, orient=Z);\n }\n}\n\nmodule part_power_panel_iec320()\n{\n power_panel_iec320() ;\n}\n\nif(false)\n{\n power_panel_iec320() ;\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\n\/\/3 Pin IEC320 C14 Inlet Male Power Socket w Fuse Switch 10A 250V\n\/\/http:\/\/www.amazon.com\/IEC320-Inlet-Power-Socket-Switch\/dp\/B00511QVVK\n\/\/http:\/\/www.uxcell.com\/pin-iec320-c14-inlet-male-power-socket-fuse-switch-10a-250v-p-104813.html\n\n\/\/position X\/Y offset\nIEC_offset = [0,0];\n\n\/\/mounting width of IEC switch\/fuse\/socket\nIEC_width = 47*mm + .2*mm;\n\n\/\/mounting height of IEC switch\/fuse\/socket\nIEC_height = 27*mm + .2*mm;\n\n\/\/mounting flange depth of IEC switch\/fuse\/socket\nIEC_depth = 1;\n\n\/\/width of flange before returning to full panel thickness\nIEC_rim = 1.5;\n\n\/\/side length of the corner cutout on the IEC connect end of the power module\nIEC_corner = 6-.5;\n\npower_panel_iec320_width = IEC_width+15*mm;\npower_panel_iec320_height = main_lower_dist_z+extrusion_size;\npower_panel_iec320_thickness = 3.8*mm;\n\n\/\/horizontal distance from edge to mounting hole\npower_panel_iec320_hole_hedge_w = 5*mm;\n\n\/\/vertical spacing of mounting holes\npower_panel_iec320_hole_vspace = main_lower_dist_z;\n\nmount_hole_d = 5*mm;\n\nmodule power_panel_iec320(align=N, orient=[0,0,-1])\n{\n s = [power_panel_iec320_width,power_panel_iec320_height,power_panel_iec320_thickness];\n size_align(size=s, align=align, orient=orient, orient_ref=[0,0,-1])\n rotate ([180,0,180])\n difference ()\n {\n \/\/power_panel_iec320\n rcubea(size=s);\n\n \/\/socket\n translate(v = [IEC_offset[0], IEC_offset[1], 0])\n difference()\n {\n union()\n {\n translate(v = [0, 0, -IEC_depth])\n cube(size = [IEC_width,IEC_height+IEC_rim*2,power_panel_iec320_thickness], center = true );\n cube(size = [IEC_width,IEC_height,power_panel_iec320_thickness+1], center = true);\n }\n for (x = [-1:2:1])\n translate([(IEC_width-IEC_corner)\/2, x*(IEC_height-IEC_corner)\/2,0])\n\n rotate([0,0,x*45])\n translate([0,-(IEC_width+IEC_height)\/2,-(power_panel_iec320_thickness+1)\/2])\n cube([IEC_width+IEC_height,IEC_width+IEC_height,power_panel_iec320_thickness+1]);\n }\n\n \/\/ extrusion mounting holes\n for (x = [-1,1])\n for (y = [-1,1])\n translate([x*(power_panel_iec320_width\/2-power_panel_iec320_hole_hedge_w-mount_hole_d\/2), y*(power_panel_iec320_hole_vspace\/2), -s[2]\/2])\n screw_cut(nut=extrusion_nut, screw_l=12*mm, with_nut=false, align=Z, orient=Z);\n }\n}\n\nmodule part_power_panel_iec320()\n{\n power_panel_iec320() ;\n}\n\nif(false)\n{\n power_panel_iec320() ;\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6ccbd812d14b14879419109cd9a4be40f448cced","subject":"heizer vaporizer","message":"heizer vaporizer\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"heizer.scad","new_file":"heizer.scad","new_contents":"$fn=50;\nschliffRadius1=18.5\/2;\nschliffRadius2=19.5\/2;\nx=6;\nmodule heizer() {\n difference() {\n union(){difference() {\n cylinder(r=9,h=80);\n cylinder(r=3,h=80);\n }cylinder(r1=schliffRadius1,r2=schliffRadius2,h=15);}\n for(i=[0:1:x])rotate(a=[0,0,i*360\/x])translate([0,6])cylinder(r=2,h=80);\n }\n}\nheizer();","old_contents":"","returncode":1,"stderr":"error: pathspec 'heizer.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"9b8310b0c3e95341a074841d6b887ff33252d895","subject":"Simplify circles on knurled-cap (for faster printing)","message":"Simplify circles on knurled-cap (for faster printing)\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"knurled-cap\/cap.scad","new_file":"knurled-cap\/cap.scad","new_contents":"e = 0.01;\n\n\/\/Knob(knobType=0, $fn=100);\n\nmodule KnurledKnob(h=10,r=10,chamfer=0.5,\n knurlAngle=9, knurlSize=0.4, knurlOffset=0.2) {\n difference() {\n union() {\n \/\/ outer surface\n translate([0,0,chamfer-e])\n cylinder(h=h-(2*chamfer), r=r);\n \/\/ slight chamfers\n cylinder(h=chamfer+e, r1=r-chamfer, r2=r);\n translate([0,0,h-chamfer-e])\n cylinder(h=chamfer, r1=r, r2=r-chamfer);\n }\n for(i=[0:knurlAngle:360])\n rotate([0,0,i])\n translate([r+knurlOffset,0,-1])\n cylinder(h=h+2, r=knurlSize, $fn=10);\n }\n}\n\n\/\/ with \"top\" facing down\nmodule TeeKnob(h=10, r1=10, r2=20, chamfer=0.5,\n knurlAngle=9, knurlSize=0.4, knurlOffset=0.2) {\n union() {\n difference() {\n union() {\n translate([0,0,h\/2-e])\n cylinder(h=h\/2, r=r1);\n cylinder(h=h\/2, r1=r1*0.9, r2=r1);\n }\n \/\/ knurling\n for(i=[0:knurlAngle:360])\n rotate([0,0,i])\n translate([r1+knurlOffset,0,-1])\n cylinder(h=h+2, r=knurlSize, $fn=10);\n }\n \/\/ handles\n for(i=[0:180:360])\n rotate([0,0,i])\n linear_extrude(height=h-e)\n polygon([[-r1*0.5,0], [-r1*0.2,r2], [r1*0.2,r2], [r1*0.5,0]]);\n }\n}\n\n\n\/\/ knob types: 0=straight knurled, 1=tee\n\/\/ example of straight knurled is mcmaster 91175A061, tee is 91175A081\n\/\/ see catalog page for more common types\nmodule Knob(outerRad=8, pegRad=2.5, capRad=5.5, pegHeight=3, innerHeight=4,\n thick=6, chamfer=0.5, knurlAngle=9, knurlSize=0.4, knurlOffset=0.2,\n knobType=0) {\n baseThick = thick - innerHeight;\n\n union() {\n difference() {\n if(knobType==0)\n KnurledKnob(h=thick, r=outerRad, chamfer=chamfer,\n knurlAngle=knurlAngle, knurlSize=knurlSize, knurlOffset=knurlOffset);\n else\n TeeKnob(h=thick, r1=outerRad, r2=outerRad*1.8, chamfer=chamfer);\n \/\/ inner cutout\n translate([0,0,baseThick+e]) cylinder(h=innerHeight, r=capRad, $fn=32);\n }\n \/\/ peg\n translate([0,0,baseThick-e])\n cylinder(h=pegHeight, r=pegRad, $fn=16);\n }\n}\n\/\/ vim: ft=c sw=2 sts=2 ts=2 et\n","old_contents":"e = 0.01;\n\n\/\/Knob(knobType=0, $fn=100);\n\nmodule KnurledKnob(h=10,r=10,chamfer=0.5,\n knurlAngle=9, knurlSize=0.4, knurlOffset=0.2) {\n difference() {\n union() {\n \/\/ outer surface\n translate([0,0,chamfer-e])\n cylinder(h=h-(2*chamfer), r=r);\n \/\/ slight chamfers\n cylinder(h=chamfer+e, r1=r-chamfer, r2=r);\n translate([0,0,h-chamfer-e])\n cylinder(h=chamfer, r1=r, r2=r-chamfer);\n }\n for(i=[0:knurlAngle:360])\n rotate([0,0,i])\n translate([r+knurlOffset,0,-1])\n cylinder(h=h+2, r=knurlSize, $fn=10);\n }\n}\n\n\/\/ with \"top\" facing down\nmodule TeeKnob(h=10, r1=10, r2=20, chamfer=0.5,\n knurlAngle=9, knurlSize=0.4, knurlOffset=0.2) {\n union() {\n difference() {\n union() {\n translate([0,0,h\/2-e])\n cylinder(h=h\/2, r=r1);\n cylinder(h=h\/2, r1=r1*0.9, r2=r1);\n }\n \/\/ knurling\n for(i=[0:knurlAngle:360])\n rotate([0,0,i])\n translate([r1+knurlOffset,0,-1])\n cylinder(h=h+2, r=knurlSize, $fn=10);\n }\n \/\/ handles\n for(i=[0:180:360])\n rotate([0,0,i])\n linear_extrude(height=h-e)\n polygon([[-r1*0.5,0], [-r1*0.2,r2], [r1*0.2,r2], [r1*0.5,0]]);\n }\n}\n\n\n\/\/ knob types: 0=straight knurled, 1=tee\n\/\/ example of straight knurled is mcmaster 91175A061, tee is 91175A081\n\/\/ see catalog page for more common types\nmodule Knob(outerRad=8, pegRad=2.5, capRad=5.5, pegHeight=3, innerHeight=4,\n thick=6, chamfer=0.5, knurlAngle=9, knurlSize=0.4, knurlOffset=0.2,\n knobType=0) {\n baseThick = thick - innerHeight;\n\n union() {\n difference() {\n if(knobType==0)\n KnurledKnob(h=thick, r=outerRad, chamfer=chamfer,\n knurlAngle=knurlAngle, knurlSize=knurlSize, knurlOffset=knurlOffset);\n else\n TeeKnob(h=thick, r1=outerRad, r2=outerRad*1.8, chamfer=chamfer);\n \/\/ inner cutout\n translate([0,0,baseThick+e]) cylinder(h=innerHeight, r=capRad);\n }\n \/\/ peg\n translate([0,0,baseThick-e])\n cylinder(h=pegHeight, r=pegRad);\n }\n}\n\/\/ vim: ft=c sw=2 sts=2 ts=2 et\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"1eb7175470ad31cbd67ff02e4d78756654eef65b","subject":"LCD posistion adjusted so that drills will not be on the very edge of a print","message":"LCD posistion adjusted so that drills will not be on the very edge of a print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/positions.scad","new_file":"lcd_case_for_prusa_i3\/positions.scad","new_contents":"boxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5\/2, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n","old_contents":"boxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e01c96ddb9e59a4dea03c25d1103923bad47cf40","subject":"fully sealed element","message":"fully sealed element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"vent_shaft_doors\/seal.scad","new_file":"vent_shaft_doors\/seal.scad","new_contents":"use\ninclude\n\nmodule seal()\n{\n \/\/ body\n cylinder(r=r_shaft+15, h=wall);\n \/\/ grabs\n for(rot=[0, 90])\n rotate([0, 0, rot])\n for(dx=[-1, 1])\n translate(dx*[r_shaft+5, 0, 0])\n grab();\n}\n\nseal();\n%translate([0, 0, -5\/2])\n oring();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vent_shaft_doors\/seal.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7b84c4ed41d3dc6fbf21d312e046dec0df0ed68e","subject":"main: fix x carriage beltpath sign","message":"main: fix x carriage beltpath sign\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-1+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage();\n\n translate([0,0,10*mm])\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-1+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage();\n\n translate([0,0,10*mm])\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c197591cf4a04c2a10c10b2ba28d0cb3cda0875d","subject":"main: fix y rod clamps thread\/screw","message":"main: fix y rod clamps thread\/screw\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3ab5811306d400fbd9db89f9af4dc49c23452250","subject":"added some space rpi cam","message":"added some space rpi cam\n","repos":"selinux\/mechanics_parts","old_file":"cases\/rpi_z_cam\/rpi_holder.scad","new_file":"cases\/rpi_z_cam\/rpi_holder.scad","new_contents":"\/* =====================================================================================\n *\n * Filename: rpi_holer.scad\n *\n * Description: rpi zero holder\n *\n * Version: 1.0\n * Created: 29 05 2020\n * Revision: none\n * Compiler: gcc\n *\n * Author: Sebastien (sinux), seba.ptl@sinux.net\n *\n * =====================================================================================\n *\/\n\n\/* mobile rpi holder *\/\nmodule mobile(){\n translate([0, 25, 2]) difference(){\n union() {\n rotate([0,90,0]) cylinder(d=8,h=38, center=true, $fn=50);\n translate([0,0,-3]) cube([38,8,5], center=true);\n }\n cube([30,20,20], center=true);\n rotate([0,90,0]) cylinder(d=3.5,h=50, center=true, $fn=50);\n }\n\n\n difference(){\n union(){\n translate([-15, 0, -3.5]) cube([30,20,3.5]);\n \/\/ base\n difference() {\n translate([-19,0,-3.5]) cube([38,29,1.5]);\n \/\/ opening\n translate([-19,0,-3.5]) cube([4,11,20], center=true);\n translate([19,0,-3.5]) cube([4,11,20], center=true);\n }\n \n \/\/ rotation\n rotate([90,0,0]) rotate_extrude($fn=100) union(){\n translate([0,-0.75,6]) square([22,1.5]);\n translate([21.5,-2,6]) square([1.5,4]);\n }\n }\n translate([-50,-20,-53.5]) cube([100, 100, 50]);\n translate([1,0,6]) cube([32,60,12], center=true);\n translate([11.6,14,0]) cylinder(d=5.5,h=5, center=true, $fn=50);\n translate([-11.6,14,0]) cylinder(d=5.5,h=5, center=true, $fn=50);\n #translate([-12,-5,0]) cube([26,10,15]);\n translate([-15,-2,-2]) cube([7,12.5,5]);\n }\n}\n\n\/* support *\/\nmodule support(){\n union() { \n translate([0,6,0]) difference(){\n translate([0,0,-4]) cylinder(d=50, h=8, $fn=100);\n rotate_extrude($fn=100) union(){\n translate([0,-1,0]) square([22,2]);\n translate([21.25,-2.5,0]) square([2,5]);\n }\n translate([0,0,-5]) cylinder(d=37, h=10, $fn=100);\n translate([-50,0,-5]) cube([100,60,10]); \n }\n\n difference() {translate([23.5,3,-9]) cube([20,3,18]);\n rotate([90,0,0]) translate([35,0,-9]) cylinder(d=7, h=30, center=true, $fn=50);}\n difference() {translate([-43.5,3,-9]) cube([20,3,18]);\n rotate([90,0,0]) translate([-35,0,-9]) cylinder(d=7, h=30, center=true, $fn=50);}\n\n \/\/translate([35.5,0,-4]) cube([8,26,8]);\n \/\/translate([-43.5,0,-4]) cube([8,26,8]);\n }\n}\n\n\/* cam holder *\/\nmodule cam(){\n union(){\n difference() {\n translate([-15,0,0]) cube([30,24,1.5]);\n translate([-7.5,4,0])cube([15,22,5]);\n translate([10.5,9.5,0]) cylinder(d=2.5, h=10, $fn=50);\n translate([-10.5,9.5,0]) cylinder(d=2.5, h=10, $fn=50);\n translate([10.5,21.5,0]) cylinder(d=2.5, h=10, $fn=50);\n translate([-10.5,21.5,0]) cylinder(d=2.5, h=10, $fn=50);\n }\n \n translate([-15,0,0]) union() {\n difference() { \n hull(){\n translate([0,-5,0]) cube([3,10,1.5]);\n translate([1.5,-10,11]) rotate([90,0,90]) cylinder(d=6, h=3, center=true, $fn=50);\n }\n translate([1,-10,11]) rotate([90,0,90]) cylinder(d=2.5, h=10, center=true, $fn=50);\n }\n } \n translate([12,0,0]) union() {\n difference() { \n hull(){\n translate([0,-5,0]) cube([3,10,1.5]);\n translate([1.5,-10,11]) rotate([90,0,90]) cylinder(d=6, h=3, center=true, $fn=50);\n }\n translate([1,-10,11]) rotate([90,0,90]) cylinder(d=2.5, h=10, center=true, $fn=50);\n }\n }\n }\n}\n\n\/\/rotate([0,-45,0]) {\n mobile();\n\/\/ translate([0,38,9]) rotate([20,180,0]) cam();\n\/\/}\n\/\/translate([0,0,6]) rotate([-90,0,0]) support();\n\n\n","old_contents":"\/* =====================================================================================\n *\n * Filename: rpi_holer.scad\n *\n * Description: rpi zero holder\n *\n * Version: 1.0\n * Created: 29 05 2020\n * Revision: none\n * Compiler: gcc\n *\n * Author: Sebastien (sinux), seba.ptl@sinux.net\n *\n * =====================================================================================\n *\/\n\n\/* mobile rpi holder *\/\nmodule mobile(){\n translate([0, 25, 2]) difference(){\n union() {\n rotate([0,90,0]) cylinder(d=8,h=38, center=true, $fn=50);\n translate([0,0,-3]) cube([38,8,5], center=true);\n }\n cube([30,20,20], center=true);\n rotate([0,90,0]) cylinder(d=3.5,h=50, center=true, $fn=50);\n }\n\n\n difference(){\n union(){\n translate([-15, 0, -3.5]) cube([30,20,3.5]);\n \/\/ base\n difference() {\n translate([-19,0,-3.5]) cube([38,29,1.5]);\n \/\/ opening\n translate([-19,0,-3.5]) cube([3,9,20], center=true);\n translate([19,0,-3.5]) cube([3,9,20], center=true);\n }\n \n \/\/ rotation\n rotate([90,0,0]) rotate_extrude($fn=100) union(){\n translate([0,-0.75,6]) square([22,1.5]);\n translate([21.5,-2,6]) square([1.5,4]);\n }\n }\n translate([-50,-20,-53.5]) cube([100, 100, 50]);\n translate([1,0,6]) cube([32,60,12], center=true);\n translate([11.6,14,0]) cylinder(d=5.5,h=5, center=true, $fn=50);\n translate([-11.6,14,0]) cylinder(d=5.5,h=5, center=true, $fn=50);\n translate([-12,-5,0]) cube([24,10,15]);\n translate([-15,-2,-2]) cube([7,12.5,5]);\n }\n}\n\n\/* support *\/\nmodule support(){\n union() { \n translate([0,6,0]) difference(){\n translate([0,0,-4]) cylinder(d=50, h=8, $fn=100);\n rotate_extrude($fn=100) union(){\n translate([0,-1,0]) square([22,2]);\n translate([21.25,-2.5,0]) square([2,5]);\n }\n translate([0,0,-5]) cylinder(d=35, h=10, $fn=100);\n translate([-50,0,-5]) cube([100,60,10]); \n }\n\n difference() {translate([23.5,3,-9]) cube([20,3,18]);\n rotate([90,0,0]) translate([35,0,-9]) cylinder(d=7, h=30, center=true, $fn=50);}\n difference() {translate([-43.5,3,-9]) cube([20,3,18]);\n rotate([90,0,0]) translate([-35,0,-9]) cylinder(d=7, h=30, center=true, $fn=50);}\n\n \/\/translate([35.5,0,-4]) cube([8,26,8]);\n \/\/translate([-43.5,0,-4]) cube([8,26,8]);\n }\n}\n\n\/* cam holder *\/\nmodule cam(){\n union(){\n difference() {\n translate([-15,0,0]) cube([30,24,1.5]);\n translate([-7.5,4,0])cube([15,22,5]);\n translate([10.5,9.5,0]) cylinder(d=2.5, h=10, $fn=50);\n translate([-10.5,9.5,0]) cylinder(d=2.5, h=10, $fn=50);\n translate([10.5,21.5,0]) cylinder(d=2.5, h=10, $fn=50);\n translate([-10.5,21.5,0]) cylinder(d=2.5, h=10, $fn=50);\n }\n \n translate([-15,0,0]) union() {\n difference() { \n hull(){\n translate([0,-5,0]) cube([3,10,1.5]);\n translate([1.5,-10,11]) rotate([90,0,90]) cylinder(d=6, h=3, center=true, $fn=50);\n }\n translate([1,-10,11]) rotate([90,0,90]) cylinder(d=2.5, h=10, center=true, $fn=50);\n }\n } \n translate([12,0,0]) union() {\n difference() { \n hull(){\n translate([0,-5,0]) cube([3,10,1.5]);\n translate([1.5,-10,11]) rotate([90,0,90]) cylinder(d=6, h=3, center=true, $fn=50);\n }\n translate([1,-10,11]) rotate([90,0,90]) cylinder(d=2.5, h=10, center=true, $fn=50);\n }\n }\n }\n}\n\n\/\/rotate([0,-45,0]) {\n mobile();\n\/\/ translate([0,38,9]) rotate([20,180,0]) cam();\n\/\/}\n\/\/translate([0,0,6]) rotate([-90,0,0]) support();\n\n\/\/mobile();\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"f5c55ed45e80f16d2a54a825684bdf70e0c213db","subject":"screws: fix preview artifact","message":"screws: fix preview artifact\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n translate([0,0,-nut_thick-.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"fad25a8f43b8f2dd5aca3c00e114a61fd12260b9","subject":"The parameters were alphabetized.","message":"The parameters were alphabetized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\", \r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseColor, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor, baseThickness, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n echo(\"rc:7 \");\r\n echo(borderHeight);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseThickness = 2,\r\n borderColor = \"yellow\",\r\n font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n letterThickness = 3,\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseColor, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor, baseThickness, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n echo(\"rc:7 \");\r\n echo(borderHeight);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9143570cabe02762bdf9ce2271dd64f16ee5b7d0","subject":"Small radius mods","message":"Small radius mods\n","repos":"btcspry\/3d-wallet-generator","old_file":"scad\/roundCornersCube.scad","new_file":"scad\/roundCornersCube.scad","new_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,center=true);}\nmodule roundCornersCube(x,y,z)difference(){r=((x+y)\/2)*0.052;cube([x,y,z],center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}\n","old_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,$fn = 25,center=true);}\nmodule roundCornersCube(x,y,z)difference(){r=((x+y)\/2)*0.052;cube([x,y,z], center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5b0e860d7abe533e7edb34883475a1befed0eb83","subject":"shapes: rename rcylinder to rcylindera","message":"shapes: rename rcylinder to rcylindera\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0 || true)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=XAXIS, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0 || true)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=XAXIS, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5aa0797dbfa74e9125e5fa9b18bdc197f1243a53","subject":"fixup! main\/yaxis: better belt placement logic","message":"fixup! main\/yaxis: better belt placement logic\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis.scad","new_file":"y-axis.scad","new_contents":"include \ninclude \n\nuse \ninclude \ninclude \n\nycarriage_bearing_mount_bottom_thick = 3;\nycarriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nycarriage_bearing_mount_conn_bearing = [[0,0,ycarriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule ycarriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick;*\/\n height = 5+ycarriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,ycarriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*ycarriage_bearing_mount();*\/\n \/*#connector(ycarriage_bearing_mount_conn);*\/\n\/*}*\/\n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nyaxis_motor_pulley_h = 17.5*mm;\nyaxis_motor_mount_bearing_clamp_offset_z = yaxis_motor_pulley_h;\n\nmodule yaxis_motor_mount_bearing_clamp(align=[0,0,0])\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n fncylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/ cutout for belt path\n fncylindera(d=bearing_d, h=height*2, orient=[0,0,1], align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n fncylindera(h=height, d=3*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %fncylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=[0,0,1]);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=[1,0,0], align=[0,0,0])\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=[0,0,1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n fncylindera(d=ymotor_round_d, h=height*2, orient=[0,0,1], align=[0,0,0]);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness\/2, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=yaxis_motor_pulley_h, orient=[0,0,1]);\n }\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","old_contents":"include \ninclude \n\nuse \ninclude \ninclude \n\nycarriage_bearing_mount_bottom_thick = 3;\nycarriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nycarriage_bearing_mount_conn_bearing = [[0,0,ycarriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule ycarriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick;*\/\n height = 5+ycarriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,ycarriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*ycarriage_bearing_mount();*\/\n \/*#connector(ycarriage_bearing_mount_conn);*\/\n\/*}*\/\n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nyaxis_motor_pulley_h = 17.5*mm;\nyaxis_motor_mount_bearing_clamp_offset_z = yaxis_motor_pulley_h;\n\nmodule yaxis_motor_mount_bearing_clamp(align=[0,0,0])\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n fncylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/ cutout for belt path\n fncylindera(d=bearing_d, h=height*2, orient=[0,0,1], align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n fncylindera(h=height, d=3*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %fncylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=[0,0,1]);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=[1,0,0], align=[0,0,0])\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=[0,0,1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n fncylindera(d=ymotor_round_d, h=height*2, orient=[0,0,1], align=[0,0,0]);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness\/2, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=yaxis_motor_pulley_h, orient=[0,0,1]);\n }\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"04e4f21d6d1589885c5a1e5a2d7b88921736bc0c","subject":"shapes: fix profile functions","message":"shapes: fix profile functions\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_array(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction rounded_rectangle_profile(size=[1,1],r=[1,1],fn=$fn) = [\nfor (index = [0:fn-1])\nlet(a = index\/fn*360)\n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X*(size.x\/2-r.x)\n+ sign_y(index, fn) * Y*(size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9a833edeb160f1575d67be0cea9467393a20f25e","subject":"new cage with LCD \/ ESC attachments","message":"new cage with LCD \/ ESC attachments\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n #arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/ cage holes\n #cage(cut=true);\n\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule barbox(p1, p2, s=1, r=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n o = s\/2-r;\n s1 = s-2*r;\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l], center=true);\n cube(size=[s, s1, l], center=true);\n\n for (x=[o, -o]) \n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l, center=true);\n for (z=[l\/2, -l\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l\/2, -l\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true); \n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n \n }\n}\n\nmodule bar(p1, p2, s=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\nmodule ball8(p1, s=1, r=1) {\n\n o = s\/2-r;\n \n translate(p1) \n for (x=[o, -o]) \n for (y=[o, -o])\n for (z=[o, -o]) \n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\nmodule skew(p1, p2) { \/\/ TODO - not working\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n b = [a[0]\/a[2], a[1]\/a[2]];\n \n matrix = [\n [ 1, 0, b[1], 0 ],\n [ 0, 1, b[2], 0 ],\n [ 0, 0, 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n translate(p1) \n multmatrix(matrix) \n children();\n}\n\nmodule cage_leg(p1, p2, d, db, r)\n{\n\/\/ bar(p1, p2, d); \n \n hull() {\n ball8(p2, d, r);\n translate([0, 0, -d\/2]) translate(p1) difference() {\n sphere(d=db, center=true);\n translate([0, 0, -db\/2]) cube(size=[db, db, db], center=true);\n }\n }\n}\n\nmodule cage_pin(p1, p2, d, pd, ph, cut)\n{\n if (cut)\n {\n bar(p1, p2, d+0.5); \n }\n else\n difference() {\n bar(p1, p2, d); \n \n translate ([0,0,-ph])\n translate (p1) \n rotate([90,0,0])\n cylinder(d=pd, h=2*d, center=true);\n } \n}\n\nmodule lcd_mount(p1, x1, x2)\n{\n translate(p1) difference() {\n #translate([(x1-x2)\/2,0,-1]) cube(size=[x1+x2, 8, 2], center=true);\n #cylinder(d=2, h=6, center=true);\n } \n}\n\nmodule cage(cut = false)\n{\n \n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements \n top = 82;\n \n top_side = 30;\n \n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front-26\/*esc size*\/+d;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n \n bottom = 51\/*platform top*\/+d\/2;\n \n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n \/\/mid_front_left = [(top_front+bottom_front)\/2, (top_side+bottom_front_side)\/2, (top+bottom)\/2];\n \/\/mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n\n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n \n \/\/ bars\n if (!cut)\n {\n barbox(top_front_left, top_front_right, d, r1); \n barbox(top_rear_left, top_rear_right, d, r1); \n barbox(top_front_left, top_rear_left, d, r1); \n barbox(top_front_right, top_rear_right, d, r1); \n\n barbox(top_esc_left, top_esc_right, d, r1); \n barbox(top_lcd_left, top_lcd_right, d, r1);\n \n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23\/2, top+d\/2], 4, 3);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23\/2, top+d\/2], 4, 3);\n lcd_mount([top_rear+d\/2+2.5+0.5, 23\/2, top+d\/2], 3, 4);\n lcd_mount([top_rear+d\/2+2.5+0.5, -23\/2, top+d\/2], 3, 4);\n\n \/\/bar(mid_front_left, mid_front_right, d); \/\/ unprintable\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1);\n cage_leg(bottom_front_right, top_front_right, d, db, r1);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1);\n }\n \n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, cut); \n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, cut); \n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, cut); \n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, cut); \n}\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([9, -8, 79]) rotate([0, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd1602() {\ntranslate([-15,0,78]) difference() {\n union() {\n translate([0,0,5+8\/2]) color(\"blue\") cube(size=[27, 72, 8], center=true);\n translate([0,0,4+1\/2]) color(\"green\") cube(size=[36, 80, 1], center=true);\n }\n translate([ 31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([ 31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n}\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n cage();\n lcd();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\n\/\/fullb();\n\n\n\/\/barbox([0,0,0], [0,0,50], 10, 3);\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\ntranslate([0,0,90]) rotate([180,0,0]) cage();\n","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/*skew takes an array of six koef:\n *x along y\n *x along z\n *y along x\n *y along z\n *z along x\n *z along y\n *\/\n\nmodule skew(dims) {\n matrix = [\n\t [ 1, dims[0], dims[1], 0 ],\n\t [ dims[2], 1, dims[4], 0 ],\n\t [ dims[5], dims[3], 1, 0 ],\n\t [ 0, 0, 0, 1 ]\n ];\n\n multmatrix(matrix) children();\n}\n\nmodule cagetop()\n{\n for (x = [-20, 0, 20, 40]) translate([x-10, 0, 81]) cube(size=[2, 60, 2], center=true);\n for (y = [-30, 0, 30]) translate([0, y, 81]) cube(size=[60, 2, 2], center=true);\n\n translate([43, 0, 67]) skew([0, -0.9, 0, 0, 0, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ front sides\n translate([33, -33, 67]) skew([0, -0.2, 0, 0, 0.2, 0]) cube(size=[2, 2, 30], center=true);\n translate([33, 33, 67]) skew([0, -0.2, 0, 0, -0.2, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ rear\n translate([-42, -34.5, 67]) skew([0, 0.8, 0, 0, 0.3, 0]) cube(size=[2, 2, 30], center=true);\n translate([-42, 34.5, 67]) skew([0, 0.8, 0, 0, -0.3, 0]) cube(size=[2, 2, 30], center=true);\n}\n\nmodule cage(round=false)\n{\n if (round) minkowski() {\n cagetop();\n sphere(r=1);\n } else\n cagetop();\n\n #translate([ 36, 36, 45]) cylinder(d=3, h=7, center=false);\n #translate([ 36, -36, 45]) cylinder(d=3, h=7, center=false);\n\n #translate([-54, -39, 45]) cylinder(d=3, h=7, center=false);\n #translate([-54, 39, 45]) cylinder(d=3, h=7, center=false);\n}\n\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([30, -5, 60]) rotate([90, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd1602() {\ntranslate([-15,0,78]) difference() {\n union() {\n translate([0,0,5+8\/2]) color(\"blue\") cube(size=[27, 72, 8], center=true);\n #translate([0,0,4+1\/2]) color(\"green\") cube(size=[36, 80, 1], center=true);\n }\n #translate([ 31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n #translate([-31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n #translate([ 31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n #translate([-31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n}\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\nfullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\n\/\/translate([0,0,80]) rotate([180,0,0]) cage(true);\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b17e0fb65e39479a6873913a0e143e1db65abb1d","subject":"removed unused parameter","message":"removed unused parameter\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"w=119;\ns=21;\nh=2.5;\n\n\nmodule wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\n\nmodule fence(width, height)\n{\n cube([width, 119, height-h]);\n translate([0,0,1])\n wedge(width=w, span=1, height=h);\n}\n\n\nmodule support()\n{\n translate([1,0,0])\n {\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n }\n\n \/\/ side walls\n for(i=[0, s+1])\n translate(i*[1,0,0])\n fence(width=1, height=h+2);\n}\n\nsupport();\n","old_contents":"w=119;\ns=21;\nh=2.5;\n\n\nmodule wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\n\nmodule fence(width, height)\n{\n cube([width, 119, height-h]);\n translate([0,0,1])\n wedge(width=w, span=1, height=h);\n}\n\n\nmodule support()\n{\n translate([1,0,0])\n {\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n }\n\n \/\/ side walls\n for(i=[0, s+1])\n translate(i*[1,0,0])\n fence(width=1, height=h+2);\n}\n\nsupport(2.5);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1a0da71f637f005773042012461b2348370e0475","subject":"updating 'dingy' with proper dimensions","message":"updating 'dingy' with proper dimensions\n","repos":"abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev","old_file":"projects\/maslowcnc\/linkage\/maslowcnc_z_linkage.scad","new_file":"projects\/maslowcnc\/linkage\/maslowcnc_z_linkage.scad","new_contents":"\/\/ licensed under CC0\n\/\/\n\/\/ still a work in progress.\n\/\/ the dimensions need to be confirmed.\n\/\/ the 'dingy' especially needs to be confirmed.\n\/\/\n\nmodule saw_end_linkage( base_length,\n width,\n saw_h,\n circle_d_mid) {\n difference() {\n union() {\n square([base_length, width], center=true);\n polygon([[-base_length\/2.0,width\/2],\n [-base_length\/2.0 - saw_h, 0],\n [-base_length\/2.0,-width\/2]]);\n polygon([[ base_length\/2.0,width\/2],\n [ base_length\/2.0 + saw_h, 0],\n [ base_length\/2.0,-width\/2]]);\n }\n\n translate([0,0]) circle(d=circle_d_mid);\n }\n}\n \n\n\n\/\/ center_hole_p from circle end of base edge\n\/\/\nmodule circle_saw_end_linkage( base_length,\n width,\n saw_h,\n center_hole_p, \n circle_d_left,\n circle_d_mid) {\n difference() {\n union() {\n square([base_length, width], center=true);\n translate([-base_length\/2,0]) circle(d=width);\n polygon([[base_length\/2.0,width\/2],\n [base_length\/2.0 + saw_h, 0],\n [base_length\/2.0,-width\/2]]);\n }\n translate([-base_length\/2,0]) circle(d=circle_d_left); \n translate([-(base_length\/2.0) + center_hole_p ,0]) circle(d=circle_d_mid);\n }\n}\n \n\nmodule circle_end_linkage( base_length,\n width,\n circle_d_left,\n circle_d_mid,\n circle_d_right) {\n\n difference() {\n union() {\n square([base_length, width], center=true);\n translate([-base_length\/2,0]) circle(d=width);\n translate([ base_length\/2,0]) circle(d=width);\n }\n \n translate([-base_length\/2,0]) circle(d=circle_d_left);\n translate([0,0]) circle(d=circle_d_mid);\n translate([ base_length\/2,0]) circle(d=circle_d_right);\n }\n \n}\n\nmodule dingy(base_length,\n width,\n circle_d,\n hole_l_a,\n hole_w_a,\n hole_l_b,\n hole_w_b) {\n difference() {\n union() {\n square([base_length,width], center=true);\n translate([base_length\/2,0]) circle(d=width);\n }\n translate([base_length\/2,0]) circle(d=circle_d);\n translate([-base_length\/2.0 + 4.35 + hole_l_a\/2, 0])\n square([hole_l_a, hole_w_a], center=true);\n translate([-base_length\/2.0 + 4.35 + hole_l_a + hole_l_b\/2,0, 0])\n square([hole_l_b, hole_w_b], center=true);\n translate([-base_length\/2.0 + 4.35 + hole_l_a + hole_l_b, 0])\n circle(d=hole_w_b);\n }\n}\n\nmodule linkage_cross(base_length,\n width,\n tab_length,\n tab_width,\n square_hole_length,\n square_hole_width) {\n difference() {\n union() {\n square([base_length, width], center=true);\n translate([base_length\/2 + tab_length\/2, 0])\n square([tab_length, tab_width], center=true);\n translate([-(base_length\/2 + tab_length\/2), 0])\n square([tab_length, tab_width], center=true);\n }\n square([square_hole_length, square_hole_width], center=true);\n }\n}\n\n\n\/\/ a2, f2\nw=18.75;\nl=247-w;\ntranslate([0, 0*w]) circle_end_linkage(l, w, 6.5, 6.5, 9.15);\ntranslate([0, 2*w]) circle_end_linkage(l, w, 6.5, 6.5, 9.15);\n\n\/\/ b1, b3\ntranslate([0, 4*w]) circle_end_linkage(l, w, 6.5, 6.5, 6.5);\ntranslate([0, 6*w]) circle_end_linkage(l, w, 6.5, 6.5, 6.5);\n\n\/\/ d1, d3, c2\ntranslate([0, -2*w]) circle_end_linkage(l, w, 6.5, 0, 9.15);\ntranslate([0, -4*w]) circle_end_linkage(l, w, 6.5, 0, 9.15);\ntranslate([0, -6*w]) circle_end_linkage(l, w, 6.5, 0, 9.15);\n\n\/\/ a1, a3, f1, f3\nsaw_h = 5.75;\nll=223 - saw_h - (w\/2);\ncenter_hole_p = l\/2;\ntranslate([l + 3*w, 0*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p,9.15, 6.5);\ntranslate([l+3*w, -2*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 9.15, 6.5);\ntranslate([l+3*w, -4*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 9.15, 6.5);\ntranslate([l+3*w, -6*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 9.15, 6.5);\n\n\/\/ e1, e2, e3\ntranslate([l+3*w, 2*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 6.5, 6.5);\ntranslate([l+3*w, 4*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 6.5, 6.5);\ntranslate([l+3*w, 6*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 6.5, 6.5);\n\n\/\/ b2\nlll=182;\ntranslate([0, -8*w]) saw_end_linkage(lll, w, saw_h, 6.5);\n\n\/\/ g2, g2\ncross_tab_width = 9.2;\ntranslate([0, -10*w])\n linkage_cross(18.75, w, 6, cross_tab_width, 8.75, 6.5);\ntranslate([3*w, -10*w])\n linkage_cross(18.75, w, 6, cross_tab_width, 8.75, 6.5);\n \n\/\/ c1 c3, d2\n\ntranslate([6*w,-10*w])\n difference() { circle(d=18.75); circle(d=9.7); }\n \ntranslate([9*w,-10*w])\n difference() { circle(d=18.75); circle(d=9.7); }\ntranslate([12*w,-10*w])\n difference() { circle(d=18.75); circle(d=9.7); }\n\n\/\/ g1, g1, g3, g3\ndingy_l = 60.5 - w\/2;\nfudge = 0.5;\ntranslate([0, -12*w])\n dingy(dingy_l, w, 6.5, 6, cross_tab_width + fudge,, 9, 7.45);\ntranslate([4*w, -12*w])\n dingy(dingy_l, w, 6.5, 6, cross_tab_width + fudge, 9, 7.45);\ntranslate([0, -14*w])\n dingy(dingy_l, w, 6.5, 6, cross_tab_width + fudge, 9, 7.45);\ntranslate([4*w, -14*w])\n dingy(dingy_l, w, 6.5, 6, cross_tab_width + fudge, 9, 7.45);\n","old_contents":"\/\/ licensed under CC0\n\/\/\n\/\/ still a work in progress.\n\/\/ the dimensions need to be confirmed.\n\/\/ the 'dingy' especially needs to be confirmed.\n\/\/\n\nmodule saw_end_linkage( base_length,\n width,\n saw_h,\n circle_d_mid) {\n difference() {\n union() {\n square([base_length, width], center=true);\n polygon([[-base_length\/2.0,width\/2],\n [-base_length\/2.0 - saw_h, 0],\n [-base_length\/2.0,-width\/2]]);\n polygon([[ base_length\/2.0,width\/2],\n [ base_length\/2.0 + saw_h, 0],\n [ base_length\/2.0,-width\/2]]);\n }\n\n translate([0,0]) circle(d=circle_d_mid);\n }\n}\n \n\n\n\/\/ center_hole_p from circle end of base edge\n\/\/\nmodule circle_saw_end_linkage( base_length,\n width,\n saw_h,\n center_hole_p, \n circle_d_left,\n circle_d_mid) {\n difference() {\n union() {\n square([base_length, width], center=true);\n translate([-base_length\/2,0]) circle(d=width);\n polygon([[base_length\/2.0,width\/2],\n [base_length\/2.0 + saw_h, 0],\n [base_length\/2.0,-width\/2]]);\n }\n translate([-base_length\/2,0]) circle(d=circle_d_left); \n translate([-(base_length\/2.0) + center_hole_p ,0]) circle(d=circle_d_mid);\n }\n}\n \n\nmodule circle_end_linkage( base_length,\n width,\n circle_d_left,\n circle_d_mid,\n circle_d_right) {\n\n difference() {\n union() {\n square([base_length, width], center=true);\n translate([-base_length\/2,0]) circle(d=width);\n translate([ base_length\/2,0]) circle(d=width);\n }\n \n translate([-base_length\/2,0]) circle(d=circle_d_left);\n translate([0,0]) circle(d=circle_d_mid);\n translate([ base_length\/2,0]) circle(d=circle_d_right);\n }\n \n}\n\nmodule dingy(base_length,\n width,\n circle_d,\n hole_l_a,\n hole_w_a,\n hole_l_b,\n hole_w_b) {\n difference() {\n union() {\n square([base_length,width], center=true);\n translate([base_length\/2,0]) circle(d=width);\n }\n translate([base_length\/2,0]) circle(d=circle_d);\n translate([-base_length\/2.0 + 4.35 + hole_l_a\/2, 0])\n square([hole_l_a, hole_w_a], center=true);\n translate([-base_length\/2.0 + 4.35 + hole_l_a + hole_l_b\/2,0])\n square([hole_l_b, hole_w_b], center=true);\n }\n}\n\nmodule linkage_cross(base_length,\n width,\n tab_length,\n tab_width,\n square_hole_length,\n square_hole_width) {\n difference() {\n union() {\n square([base_length, width], center=true);\n translate([base_length\/2 + tab_length\/2, 0])\n square([tab_length, tab_width], center=true);\n translate([-(base_length\/2 + tab_length\/2), 0])\n square([tab_length, tab_width], center=true);\n }\n square([square_hole_length, square_hole_width], center=true);\n }\n}\n\n\n\/\/ a2, f2\nw=18.75;\nl=247-w;\ntranslate([0, 0*w]) circle_end_linkage(l, w, 6.5, 6.5, 9.15);\ntranslate([0, 2*w]) circle_end_linkage(l, w, 6.5, 6.5, 9.15);\n\n\/\/ b1, b3\ntranslate([0, 4*w]) circle_end_linkage(l, w, 6.5, 6.5, 6.5);\ntranslate([0, 6*w]) circle_end_linkage(l, w, 6.5, 6.5, 6.5);\n\n\/\/ d1, d3, c2\ntranslate([0, -2*w]) circle_end_linkage(l, w, 6.5, 0, 9.15);\ntranslate([0, -4*w]) circle_end_linkage(l, w, 6.5, 0, 9.15);\ntranslate([0, -6*w]) circle_end_linkage(l, w, 6.5, 0, 9.15);\n\n\/\/ a1, a3, f1, f3\nsaw_h = 5.75;\nll=223 - saw_h - (w\/2);\ncenter_hole_p = l\/2;\ntranslate([l + 3*w, 0*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p,9.15, 6.5);\ntranslate([l+3*w, -2*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 9.15, 6.5);\ntranslate([l+3*w, -4*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 9.15, 6.5);\ntranslate([l+3*w, -6*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 9.15, 6.5);\n\n\/\/ e1, e2, e3\ntranslate([l+3*w, 2*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 6.5, 6.5);\ntranslate([l+3*w, 4*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 6.5, 6.5);\ntranslate([l+3*w, 6*w]) circle_saw_end_linkage(ll, w, saw_h, center_hole_p, 6.5, 6.5);\n\n\/\/ b2\nlll=182;\ntranslate([0, -8*w]) saw_end_linkage(lll, w, saw_h, 6.5);\n\n\/\/ g2, g2\ntranslate([0, -10*w])\n linkage_cross(18.75, w, 6, 9, 8.75, 6.5);\ntranslate([3*w, -10*w])\n linkage_cross(18.75, w, 6, 9, 8.75, 6.5);\n \n\/\/ c1 c3, d2\n\ntranslate([6*w,-10*w])\n difference() { circle(d=18.75); circle(d=9.7); }\n \ntranslate([9*w,-10*w])\n difference() { circle(d=18.75); circle(d=9.7); }\ntranslate([12*w,-10*w])\n difference() { circle(d=18.75); circle(d=9.7); }\n\n\/\/ g1, g1, g3, g3\ntranslate([0, -12*w])\n dingy(52, w, 6.5, 6, 9.75, 9.4,7.45);\ntranslate([4*w, -12*w])\n dingy(52, w, 6.5, 6, 9.75, 9.4,7.45);\ntranslate([0, -14*w])\n dingy(52, w, 6.5, 6, 9.75, 9.4,7.45);\ntranslate([4*w, -14*w])\n dingy(52, w, 6.5, 6, 9.75, 9.4,7.45);\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"426af1186ba8eca9397e408a0ed044b459cfdccf","subject":"The start of a fan mount. Hilariously, the main thing missing is the actual fan mount. Plan is to use offsets to push this back from the fan mounting lugs, and have two long screws going through fan->mount->lugs, and two shorter screws securing the fan to the bottom of the mount. Offset should be about 10mm.","message":"The start of a fan mount. Hilariously, the main thing missing is the actual fan mount.\nPlan is to use offsets to push this back from the fan mounting lugs, and have two long screws going through fan->mount->lugs, and two shorter screws securing the fan to the bottom of the mount.\nOffset should be about 10mm.\n","repos":"twstdpear\/i3_parts","old_file":"bg8\/extruder\/fan_mount.scad","new_file":"bg8\/extruder\/fan_mount.scad","new_contents":"\n\nhot_rad = 30\/2\/cos(30);\nhotend_x=25;\nfan_x = 15;\n\nhotend_y=-5;\n\nthickness = 10;\nwall=2.5;\n\nfan_hole = 38\/2;\nfan_z = fan_hole+wall;\n\nfan_mount();\n\n%cylinder(r=hot_rad, h=20, center=true);\n\nmodule fan_mount(){\n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=6);\n \n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=6);\n translate([50+hot_rad,0,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=.1);\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r=hot_rad+wall, h=thickness+wall+1, $fn=6);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=6);\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness, $fn=6);\n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness, $fn=6);\n translate([50+hot_rad+wall,0,50+wall]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3, center=true);\n }\n }\n cylinder(r=hot_rad+wall+wall, h=thickness+wall, $fn=6);\n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=6);\n }\n }\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bg8\/extruder\/fan_mount.scad' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"4d8a33e2230e025e0347018e7cac96175ee124c5","subject":"=> rules coding \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440","message":"=> rules coding \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/skeleton.scad","new_file":"3D-models\/SCAD\/skeleton.scad","new_contents":"\/\/\u041a\u0430\u0440\u043a\u0430\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0414\u041d\u041a \n$fn=190; \nx=9; \ny=90; \nz=90; \ndz=0; \ncylinder(x,y,z); \ntranslate([0,0,dz]) cylinder(x*5,y\/10,z\/10); \n \n\n\n","old_contents":"\/\/\u041a\u0430\u0440\u043a\u0430\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0414\u041d\u041a \n$fn=190; \nx=9; \ny=90; \nz=90; \ndz=-45; \ncylinder(x,y,z); \ntranslate([0,0,dz]) cylinder(x*5,y\/10,z\/10); \n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"42746338bdb9a7219de2570e6ce79e59511c38e4","subject":"Adjusting motor shaft model further","message":"Adjusting motor shaft model further\n","repos":"sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning","old_file":"3d-models\/damper-mount\/vent-5v-stepper-adaptor.scad","new_file":"3d-models\/damper-mount\/vent-5v-stepper-adaptor.scad","new_contents":"wall_thickness=2;\n\/\/ Piece that will be rotated\ndamper_arm_diameter=9;\ndamper_arm_cut_width=5.1;\ndamper_arm_depth=12;\n\/\/ stepper mount\nstepper_shaft_diameter=5.8;\nstepper_shaft_cut_width=3.5;\nstepper_shaft_depth=7;\n\/\/ Marker for closed position\nmarker_size=2;\nmarker_distance=9;\nmarker_height=5;\n\/\/ Connecting the two\nmount_length=1.2*(damper_arm_depth+stepper_shaft_depth);\nmount_diameter=max(damper_arm_diameter,stepper_shaft_diameter)+wall_thickness*2;\n\/\/ Pin offset degrees to achieve fully closed vent on button press\npin_degrees_offset=0;\n\n\/* \n * motor-to-damper adaptor\n**\/\ntranslate([0,0,-mount_length]) motor_to_damper_adaptor();\n\nmodule motor_to_damper_adaptor() {\n rotate([0,0,pin_degrees_offset]) button_pin();\n difference() {\n \/\/ main body\n cylinder(mount_length, mount_diameter\/2, mount_diameter\/2);\n \/\/ Stepper cutout\n translate([0,0,stepper_shaft_depth\/2]) mount_cutout(stepper_shaft_diameter\/2, stepper_shaft_cut_width, stepper_shaft_depth);\n \/\/ Damper cutout\n translate([0,0,mount_length-damper_arm_depth\/2]) mount_cutout(damper_arm_diameter\/2, damper_arm_cut_width, damper_arm_depth);\n }\n \n}\n\nmodule button_pin() {\n translate([mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n translate([-mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n}\n\n\/\/ Motor mount\nvent_diameter = 6*25.4; \/\/ 6\"\nshaft_offset=8;\nmotor_ears_distance=35;\nmotot_ears_hole_diameter=3.8;\nmotor_ears_screw_length=15;\nvent_mount_distance=55;\nvent_mount_hole_diameter=6;\nmotor_to_vent_distance=mount_length+4-wall_thickness*1.5; \/\/ 4mm distance between connector and motor body\nvent_ears_total_length=vent_mount_distance+vent_mount_hole_diameter+wall_thickness*2;\nvent_ears_total_width=mount_diameter+wall_thickness*4;\nmotor_screw_cube_side=motot_ears_hole_diameter+wall_thickness*2;\n\/*\n * mount bracket itself\n**\/\n\/\/motor_to_vent_mount();\n\n\/\/ endstop sensor\nendstop_screw_diameter=1.8;\nendstop_screw1_distance=16;\nendstop_screw1_offset=-1.5;\nendstop_screw2_distance=5;\nendstop_screw2_offset=20;\n\n\n\nmodule motor_to_vent_mount() {\n union() {\n \/\/ Vent ears\n vent_mount_plate();\n \/\/ motor mount\n translate([motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n translate([-motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n }\n}\n\nmodule damper_mount_cutout() {\n intersection() {\n cylinder(damper_arm_depth, damper_arm_diameter, damper_arm_diameter, center=true, $fn=40);\n cube([damper_arm_diameter*2, damper_arm_cut_width, damper_arm_depth], center=true);\n }\n}\n\nmodule mount_cutout(radius, width, depth) {\n intersection() {\n cylinder(depth, radius, radius, center=true, $fn=40);\n cube([radius*2, width, depth], center=true);\n }\n}\n\nmodule vent(length) {\n cylinder(length, vent_diameter\/2, vent_diameter\/2, $fn=100);\n}\n\nmodule vent_mount_plate() {\n endstop_sensor_space=max(endstop_screw1_distance,endstop_screw2_distance)+endstop_screw_diameter\/2+wall_thickness-(vent_ears_total_width\/2-mount_diameter\/2);\n \/\/ ^ distance to furthest hole ^ mounting holes w\/ walls ^ distance from original edge to shaft\n plate_total_width=vent_ears_total_width+motor_screw_cube_side\/2+shaft_offset-vent_ears_total_width\/2+(endstop_sensor_space) ;\n \/\/ ^ base width ^ extend for motor mount ^ accommodate endstop sensor\n translate([-vent_ears_total_length\/2,0,0]) rotate([0,90,0]) translate([-wall_thickness*1.5,0,0]) intersection() {\n translate([-wall_thickness*1.5, -vent_ears_total_width\/2-endstop_sensor_space, 0]) cube([wall_thickness*3, plate_total_width, vent_ears_total_length]);\n difference() {\n translate([-vent_diameter\/2, 0, 0]) cylinder(vent_ears_total_length, d=vent_diameter+wall_thickness*8);\n translate([-vent_diameter\/2, 0, 0]) vent(vent_ears_total_length);\n \/\/ Mount holes cutout\n translate([-wall_thickness*1.5,0,vent_mount_hole_diameter\/2+wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n translate([-wall_thickness*1.5,0,vent_ears_total_length-vent_mount_hole_diameter\/2-wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n \/\/ shaft cutout\n translate([-wall_thickness*1.5,0,vent_ears_total_length\/2]) rotate([0,90,0]) cylinder(wall_thickness*4, mount_diameter\/2+wall_thickness, mount_diameter\/2+wall_thickness);\n \/\/ endstop sensor mount\n #translate([-5,-endstop_screw1_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw1_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n #translate([-5,-endstop_screw2_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw2_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n }\n }\n}\n\nmodule motor_screw_connector() {\n difference() {\n translate([-motor_screw_cube_side\/2, -motor_screw_cube_side\/2, 0]) cube([motor_screw_cube_side, motor_screw_cube_side, motor_to_vent_distance]);\n cylinder(motor_ears_screw_length, motot_ears_hole_diameter\/2, motot_ears_hole_diameter\/2, $fn=20);\n }\n\n}","old_contents":"wall_thickness=2;\n\/\/ Piece that will be rotated\ndamper_arm_diameter=8.5;\ndamper_arm_cut_width=6;\ndamper_arm_depth=12;\n\/\/ stepper mount\nstepper_shaft_diameter=5.8;\nstepper_shaft_cut_width=3.5;\nstepper_shaft_depth=7;\n\/\/ Marker for closed position\nmarker_size=2;\nmarker_distance=9;\nmarker_height=5;\n\/\/ Connecting the two\nmount_length=1.2*(damper_arm_depth+stepper_shaft_depth);\nmount_diameter=max(damper_arm_diameter,stepper_shaft_diameter)+wall_thickness*2;\n\n\/* \n * motor-to-damper adaptor\n**\/\ntranslate([0,0,-mount_length]) motor_to_damper_adaptor();\n\nmodule motor_to_damper_adaptor() {\n difference() {\n \/\/ main body\n cylinder(mount_length, mount_diameter\/2, mount_diameter\/2);\n \/\/ Stepper cutout\n translate([0,0,stepper_shaft_depth\/2]) mount_cutout(stepper_shaft_diameter\/2, stepper_shaft_cut_width, stepper_shaft_depth);\n \/\/ Damper cutout\n translate([0,0,mount_length-damper_arm_depth\/2]) mount_cutout(damper_arm_diameter\/2, damper_arm_cut_width, damper_arm_depth);\n }\n translate([mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n}\n\n\/\/ Motor mount\nvent_diameter = 6*25.4; \/\/ 6\"\nshaft_offset=8;\nmotor_ears_distance=35;\nmotot_ears_hole_diameter=3.8;\nmotor_ears_screw_length=15;\nvent_mount_distance=55;\nvent_mount_hole_diameter=6;\nmotor_to_vent_distance=mount_length+4-wall_thickness*1.5; \/\/ 4mm distance between connector and motor body\nvent_ears_total_length=vent_mount_distance+vent_mount_hole_diameter+wall_thickness*2;\nvent_ears_total_width=mount_diameter+wall_thickness*4;\nmotor_screw_cube_side=motot_ears_hole_diameter+wall_thickness*2;\n\/*\n * mount bracket itself\n**\/\n\/\/motor_to_vent_mount();\n\n\/\/ endstop sensor\nendstop_screw_diameter=1.8;\nendstop_screw1_distance=16;\nendstop_screw1_offset=-1.5;\nendstop_screw2_distance=5;\nendstop_screw2_offset=20;\n\n\n\nmodule motor_to_vent_mount() {\n union() {\n \/\/ Vent ears\n vent_mount_plate();\n \/\/ motor mount\n translate([motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n translate([-motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n }\n}\n\nmodule damper_mount_cutout() {\n intersection() {\n cylinder(damper_arm_depth, damper_arm_diameter, damper_arm_diameter, center=true, $fn=40);\n cube([damper_arm_diameter*2, damper_arm_cut_width, damper_arm_depth], center=true);\n }\n}\n\nmodule mount_cutout(radius, width, depth) {\n intersection() {\n cylinder(depth, radius, radius, center=true, $fn=40);\n cube([radius*2, width, depth], center=true);\n }\n}\n\nmodule vent(length) {\n cylinder(length, vent_diameter\/2, vent_diameter\/2, $fn=100);\n}\n\nmodule vent_mount_plate() {\n endstop_sensor_space=max(endstop_screw1_distance,endstop_screw2_distance)+endstop_screw_diameter\/2+wall_thickness-(vent_ears_total_width\/2-mount_diameter\/2);\n \/\/ ^ distance to furthest hole ^ mounting holes w\/ walls ^ distance from original edge to shaft\n plate_total_width=vent_ears_total_width+motor_screw_cube_side\/2+shaft_offset-vent_ears_total_width\/2+(endstop_sensor_space) ;\n \/\/ ^ base width ^ extend for motor mount ^ accommodate endstop sensor\n translate([-vent_ears_total_length\/2,0,0]) rotate([0,90,0]) translate([-wall_thickness*1.5,0,0]) intersection() {\n translate([-wall_thickness*1.5, -vent_ears_total_width\/2-endstop_sensor_space, 0]) cube([wall_thickness*3, plate_total_width, vent_ears_total_length]);\n difference() {\n translate([-vent_diameter\/2, 0, 0]) cylinder(vent_ears_total_length, d=vent_diameter+wall_thickness*8);\n translate([-vent_diameter\/2, 0, 0]) vent(vent_ears_total_length);\n \/\/ Mount holes cutout\n translate([-wall_thickness*1.5,0,vent_mount_hole_diameter\/2+wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n translate([-wall_thickness*1.5,0,vent_ears_total_length-vent_mount_hole_diameter\/2-wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n \/\/ shaft cutout\n translate([-wall_thickness*1.5,0,vent_ears_total_length\/2]) rotate([0,90,0]) cylinder(wall_thickness*4, mount_diameter\/2+wall_thickness, mount_diameter\/2+wall_thickness);\n \/\/ endstop sensor mount\n #translate([-5,-endstop_screw1_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw1_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n #translate([-5,-endstop_screw2_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw2_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n }\n }\n}\n\nmodule motor_screw_connector() {\n difference() {\n translate([-motor_screw_cube_side\/2, -motor_screw_cube_side\/2, 0]) cube([motor_screw_cube_side, motor_screw_cube_side, motor_to_vent_distance]);\n cylinder(motor_ears_screw_length, motot_ears_hole_diameter\/2, motot_ears_hole_diameter\/2, $fn=20);\n }\n\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8b87a76e22aaea9f287b79c6c8da9b4c01df7f8c","subject":"bearing: bearing mount rod cutout (use 1mm tolerance, not 1.3 factor)","message":"bearing: bearing mount rod cutout (use 1mm tolerance, not 1.3 factor)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = (override_h==undef ? bearing_type[2] : override_h) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = (override_h==undef ? bearing_type[2] : override_h) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]*1.3, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0b64c2001248137f28e07875b8b8d0d772aa0410","subject":"bearings: add MR105","message":"bearings: add MR105\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"bearings.scad","new_file":"bearings.scad","new_contents":"use ;\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR115 = [5,11,4];\nbearing_MR105 = [5,10,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\nmodule bearing(bearing_type, orient=[0,0,1])\n{\n orient(orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_dist_ = ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist;\n orient(orient)\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[0,0,1]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[0,0,1]);\n }\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n %if(show_zips)\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_thickness, orient=[0,0,1]);\n }\n }\n}\n","old_contents":"use ;\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR115 = [5,11,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\nmodule bearing(bearing_type, orient=[0,0,1])\n{\n orient(orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_dist_ = ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist;\n orient(orient)\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[0,0,1]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[0,0,1]);\n }\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n %if(show_zips)\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_thickness, orient=[0,0,1]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"78cea6c34a3893a384d1aca17e3ee2b3696e6351","subject":"Altered measurements for hardboard, tweaked height and lightbar position, rounded\/truncated overhangs on vertical faces.","message":"Altered measurements for hardboard, tweaked height and lightbar position, rounded\/truncated overhangs on vertical faces.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\n\/\/thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions (NOTE: from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 190; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n difference() {\n cube([thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 8;\nsupport_drop = 4;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/3, z=height\/2);\n mock_rpi(x=width, y=depth\/3-10, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/3, z=height\/2+support_drop);\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"12609a692f7d394bf7237d738f0ecd29e9a1befc","subject":"lcd2004: add mount for lcd2004","message":"lcd2004: add mount for lcd2004\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"lcd2004.scad","new_file":"lcd2004.scad","new_contents":"use \nuse \ninclude \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror([0,1,0])\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=[0,0,1]);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=[0,0,1]);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=[0,0,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=[0,0,1], align=[0,0,0])\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=[0,0,1], align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=[0,0,1], orient=[0,0,1]);\n }\n}\n\nlcd2004_offset = [0, -35*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=[0,0,1], align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=[0,0,1], align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\n\/*$show_vit=true;*\/\n\n\/*if(false)*\/\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\nif(false)\n{\n mount_lcd2004(show_gantry=true);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'lcd2004.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"dcc50d60a4bac80ff29ea79a5ff0f223a9c33caf","subject":"\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0444\u043e\u0441\u0444\u043e\u0440\u043d\u043e\u0439 \u043a\u0438\u0441\u043b\u043e\u0442\u044b","message":"\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0444\u043e\u0441\u0444\u043e\u0440\u043d\u043e\u0439 \u043a\u0438\u0441\u043b\u043e\u0442\u044b","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Phosphor.scad","new_file":"3D-models\/SCAD\/Phosphor.scad","new_contents":"\/\/\u041e\u0441\u0442\u0430\u0442\u043e\u043a \u0444\u043e\u0441\u0444\u043e\u0440\u043d\u043e\u0439 \u043a\u0438\u0441\u043b\u043e\u0442\u044b\n\n$fn=270; \nsphere(60); \ntranslate([0,3,4]) cylinder(150,10,10); \n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/Phosphor.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"16c69ea495d1b089b9ab42cd3539b112cb81ae77","subject":"metric\/screw: add screw","message":"metric\/screw: add screw\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=h, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n MKnurlInsertNutM3_5 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n ];\n\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([35,0,0])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","old_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n MKnurlInsertNutM3_5 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n ];\n\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([35,0,0])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b05d1d83751437d632b95f5926d2b76b2b619ee1","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"4d51c53a512827bc3f9734129a40ce339b3939d0","subject":"nut\/data: add NutKnurlM5_5_42","message":"nut\/data: add NutKnurlM5_5_42\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"nut-data.scad","new_file":"nut-data.scad","new_contents":"\/\/ THIS FILE HAS BEEN GENERATED\n\/\/ DO NOT MODIFY DIRECTLY\n\ninclude \ninclude \n\nNutHoleDia = 0;\nNutWidthMin = 1;\nNutThickness = 2;\nNutWidthMax = 3;\nNutThread = 4;\nNutFacets = 5;\n\nNutHexM1_2 = [\n [NutHoleDia, 1.2*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_2],\n [NutFacets, 6],\n];\n\nNutHexM1_4 = [\n [NutHoleDia, 1.4*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_4],\n [NutFacets, 6],\n];\n\nNutHexM1_6 = [\n [NutHoleDia, 1.6*mm],\n [NutWidthMin, 3.2*mm],\n [NutThickness, 1.3*mm],\n [NutWidthMax, 3.48*mm],\n [NutThread, ThreadM1_6],\n [NutFacets, 6],\n];\n\nNutHexM1_8 = [\n [NutHoleDia, 1.8*mm],\n [NutWidthMin, 3.5*mm],\n [NutThickness, 1.4*mm],\n [NutWidthMax, 3.82*mm],\n [NutThread, ThreadM1_8],\n [NutFacets, 6],\n];\n\nNutHexM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 2.4*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2.8*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 4.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 5.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexM7 = [\n [NutHoleDia, 7*mm],\n [NutWidthMin, 11*mm],\n [NutThickness, 5.5*mm],\n [NutWidthMax, 12.12*mm],\n [NutThread, ThreadM7],\n [NutFacets, 6],\n];\n\nNutHexM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 6.8*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 8.4*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 10.8*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 12.8*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 14.8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 15.8*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 19.4*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 21.5*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 23.8*mm],\n [NutWidthMax, 45.29*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexM30 = [\n [NutHoleDia, 30*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 25.6*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 28.7*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 31*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 33.4*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 34*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 36*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 38*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexM52 = [\n [NutHoleDia, 52*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 42*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 45*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 48*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 51*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutHexThinM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexThinM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexThinM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 1.8*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexThinM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexThinM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 2.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexThinM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 2.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexThinM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexThinM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexThinM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexThinM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexThinM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 7*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexThinM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexThinM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 9*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexThinM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 10*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexThinM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 11*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexThinM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 12*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexThinM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 13.5*mm],\n [NutWidthMax, 45.2*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexThinM30 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 15*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexThinM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 16.5*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexThinM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexThinM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 19.5*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexThinM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 21*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexThinM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 22.5*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexThinM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 24*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexThinM52 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 26*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexThinM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 28*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexThinM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 30*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexThinM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 32*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutKnurlM2_4_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM2_6_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM3_8_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_3_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 3*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM5_5_42 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 6.7*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 7.25*mm],\n [NutThread, ThreadM5],\n [NutFacets, 20],\n];\n\nAllNut = [NutHexM1_2,\nNutHexM1_4,\nNutHexM1_6,\nNutHexM1_8,\nNutHexM2,\nNutHexM2_5,\nNutHexM3,\nNutHexM3_5,\nNutHexM4,\nNutHexM5,\nNutHexM6,\nNutHexM7,\nNutHexM8,\nNutHexM10,\nNutHexM12,\nNutHexM14,\nNutHexM16,\nNutHexM18,\nNutHexM20,\nNutHexM22,\nNutHexM24,\nNutHexM27,\nNutHexM30,\nNutHexM33,\nNutHexM36,\nNutHexM39,\nNutHexM42,\nNutHexM45,\nNutHexM48,\nNutHexM52,\nNutHexM56,\nNutHexM60,\nNutHexM64,\nNutHexThinM2,\nNutHexThinM2_5,\nNutHexThinM3,\nNutHexThinM3_5,\nNutHexThinM4,\nNutHexThinM5,\nNutHexThinM6,\nNutHexThinM8,\nNutHexThinM10,\nNutHexThinM12,\nNutHexThinM14,\nNutHexThinM16,\nNutHexThinM18,\nNutHexThinM20,\nNutHexThinM22,\nNutHexThinM24,\nNutHexThinM27,\nNutHexThinM30,\nNutHexThinM33,\nNutHexThinM36,\nNutHexThinM39,\nNutHexThinM42,\nNutHexThinM45,\nNutHexThinM48,\nNutHexThinM52,\nNutHexThinM56,\nNutHexThinM60,\nNutHexThinM64,\nNutKnurlM2_4_42,\nNutKnurlM2_6_42,\nNutKnurlM3_5_42,\nNutKnurlM3_3_42,\nNutKnurlM5_5_42,\n];\n","old_contents":"\/\/ THIS FILE HAS BEEN GENERATED\n\/\/ DO NOT MODIFY DIRECTLY\n\ninclude \ninclude \n\nNutHoleDia = 0;\nNutWidthMin = 1;\nNutThickness = 2;\nNutWidthMax = 3;\nNutThread = 4;\nNutFacets = 5;\n\nNutHexM1_2 = [\n [NutHoleDia, 1.2*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_2],\n [NutFacets, 6],\n];\n\nNutHexM1_4 = [\n [NutHoleDia, 1.4*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_4],\n [NutFacets, 6],\n];\n\nNutHexM1_6 = [\n [NutHoleDia, 1.6*mm],\n [NutWidthMin, 3.2*mm],\n [NutThickness, 1.3*mm],\n [NutWidthMax, 3.48*mm],\n [NutThread, ThreadM1_6],\n [NutFacets, 6],\n];\n\nNutHexM1_8 = [\n [NutHoleDia, 1.8*mm],\n [NutWidthMin, 3.5*mm],\n [NutThickness, 1.4*mm],\n [NutWidthMax, 3.82*mm],\n [NutThread, ThreadM1_8],\n [NutFacets, 6],\n];\n\nNutHexM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 2.4*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2.8*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 4.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 5.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexM7 = [\n [NutHoleDia, 7*mm],\n [NutWidthMin, 11*mm],\n [NutThickness, 5.5*mm],\n [NutWidthMax, 12.12*mm],\n [NutThread, ThreadM7],\n [NutFacets, 6],\n];\n\nNutHexM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 6.8*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 8.4*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 10.8*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 12.8*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 14.8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 15.8*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 19.4*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 21.5*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 23.8*mm],\n [NutWidthMax, 45.29*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexM30 = [\n [NutHoleDia, 30*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 25.6*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 28.7*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 31*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 33.4*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 34*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 36*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 38*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexM52 = [\n [NutHoleDia, 52*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 42*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 45*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 48*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 51*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutHexThinM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexThinM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexThinM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 1.8*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexThinM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexThinM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 2.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexThinM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 2.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexThinM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexThinM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexThinM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexThinM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexThinM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 7*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexThinM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexThinM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 9*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexThinM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 10*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexThinM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 11*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexThinM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 12*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexThinM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 13.5*mm],\n [NutWidthMax, 45.2*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexThinM30 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 15*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexThinM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 16.5*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexThinM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexThinM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 19.5*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexThinM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 21*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexThinM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 22.5*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexThinM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 24*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexThinM52 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 26*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexThinM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 28*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexThinM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 30*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexThinM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 32*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutKnurlM2_4_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM2_6_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM3_8_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_3_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 3*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nAllNut = [NutHexM1_2,\nNutHexM1_4,\nNutHexM1_6,\nNutHexM1_8,\nNutHexM2,\nNutHexM2_5,\nNutHexM3,\nNutHexM3_5,\nNutHexM4,\nNutHexM5,\nNutHexM6,\nNutHexM7,\nNutHexM8,\nNutHexM10,\nNutHexM12,\nNutHexM14,\nNutHexM16,\nNutHexM18,\nNutHexM20,\nNutHexM22,\nNutHexM24,\nNutHexM27,\nNutHexM30,\nNutHexM33,\nNutHexM36,\nNutHexM39,\nNutHexM42,\nNutHexM45,\nNutHexM48,\nNutHexM52,\nNutHexM56,\nNutHexM60,\nNutHexM64,\nNutHexThinM2,\nNutHexThinM2_5,\nNutHexThinM3,\nNutHexThinM3_5,\nNutHexThinM4,\nNutHexThinM5,\nNutHexThinM6,\nNutHexThinM8,\nNutHexThinM10,\nNutHexThinM12,\nNutHexThinM14,\nNutHexThinM16,\nNutHexThinM18,\nNutHexThinM20,\nNutHexThinM22,\nNutHexThinM24,\nNutHexThinM27,\nNutHexThinM30,\nNutHexThinM33,\nNutHexThinM36,\nNutHexThinM39,\nNutHexThinM42,\nNutHexThinM45,\nNutHexThinM48,\nNutHexThinM52,\nNutHexThinM56,\nNutHexThinM60,\nNutHexThinM64,\nNutKnurlM2_4_42,\nNutKnurlM2_6_42,\nNutKnurlM3_5_42,\nNutKnurlM3_3_42,\n];\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"64fc01edf32e4783abbe82674288b4d1296c3ff9","subject":"center break in supports is n longer diamater-dependent","message":"center break in supports is n longer diamater-dependent\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"flowerpot_saucer\/template.scad","new_file":"flowerpot_saucer\/template.scad","new_contents":"$fs=1;\n$fa=0.5;\n\nmodule saucer(d)\n{\n difference()\n {\n cylinder(h=22, r1=d\/2, r2=(d+20)\/2);\n translate([0, 0, 2])\n cylinder(h=20, r1=(d-2)\/2, r2=(d-2+20)\/2);\n }\n difference()\n {\n for(rz=[0, 45, 90, 135])\n rotate([0, 0, rz])\n translate([-d\/2, -2\/2, 2])\n cube([d, 2, 2]);\n cylinder(r=40\/2, h=5);\n }\n}\n\nsaucer(d=102);\n","old_contents":"$fs=1;\n$fa=0.5;\n\nmodule saucer(d)\n{\n difference()\n {\n cylinder(h=22, r1=d\/2, r2=(d+20)\/2);\n translate([0, 0, 2])\n cylinder(h=20, r1=(d-2)\/2, r2=(d-2+20)\/2);\n }\n difference()\n {\n for(rz=[0, 45, 90, 135])\n rotate([0, 0, rz])\n translate([-d\/2, -2\/2, 2])\n cube([d, 2, 2]);\n cylinder(r=(d-2*30)\/2, h=5);\n }\n}\n\n%saucer(d=102);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c2a6c3658d2ba755a5bcb9182feb4aaa9d736f10","subject":"y-axis\/motor-mount: add some more reinforcement","message":"y-axis\/motor-mount: add some more reinforcement\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis.scad","new_file":"y-axis.scad","new_contents":"include \ninclude \n\nuse \ninclude \ninclude \n\nycarriage_bearing_mount_bottom_thick = 3;\nycarriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nycarriage_bearing_mount_conn_bearing = [[0,0,ycarriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule ycarriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick;*\/\n height = 5+ycarriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,ycarriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*ycarriage_bearing_mount();*\/\n \/*#connector(ycarriage_bearing_mount_conn);*\/\n\/*}*\/\n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_offset = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_mount_conn_motor = [[-yaxis_motor_offset, 0,-extrusion_size\/2],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nmodule yaxis_motor_mount()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n difference()\n {\n cubea([ymotor_w+ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_mount_thickness_h], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([ymotor_w\/2,0,-1])\n linear_extrude(ymotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n }\n\n translate([0,0,yaxis_motor_offset_z])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w, ymotor_h], align=[1,0,-1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n difference()\n {\n translate([0, 0, yaxis_motor_offset_z])\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n }\n\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \ninclude \ninclude \n\nycarriage_bearing_mount_bottom_thick = 3;\nycarriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nycarriage_bearing_mount_conn_bearing = [[0,0,ycarriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule ycarriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick;*\/\n height = 5+ycarriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+ycarriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,ycarriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*ycarriage_bearing_mount();*\/\n \/*#connector(ycarriage_bearing_mount_conn);*\/\n\/*}*\/\n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_offset = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_mount_conn_motor = [[-yaxis_motor_offset, 0,-extrusion_size\/2],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nmodule yaxis_motor_mount()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n difference()\n {\n cubea([ymotor_w+ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_mount_thickness_h], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([ymotor_w\/2,0,-1])\n linear_extrude(ymotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n }\n\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n difference()\n {\n translate([0, 0, yaxis_motor_offset_z])\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n }\n\n }\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9a0be522ecca7c74894ceb3195930ff40149cc6c","subject":"Several tweaks. Fit camera cable. Add some space here and there. Etc.","message":"Several tweaks. Fit camera cable. Add some space here and there. Etc.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/RaspberryPi_v15.scad","new_file":"designs\/RaspberryPi_v15.scad","new_contents":"\/\/ Raspberry Pi Case\r\n\/\/ Hans Harder 2012\r\n\/\/\r\n\/\/ Warning: this is based on the Beta board dimensions...\r\n\/\/ so production models can be slightly different\r\n\/\/ for instance SD card holder height and USB socket dimensions\r\n\/\/\r\n\/\/ Since all connectors stick out, case is split on HDMI height\r\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\r\n\/\/\r\n\/\/ v2: Adapted version after some suggestions from David...\r\n\/\/ removed feet, made both surface flat\r\n\/\/ v3: Added fliptop option and smooth the corners of the box\r\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\r\n\/\/ Looks strange but it fits...\r\n\/\/ Added frame mode (so no bottom and top deck)\r\n\/\/ Moved screw locations due to split and added some support structures\r\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\r\n\/\/ v5 relocated a lot of code in modules\r\n\/\/ SDslot location was not calculated correctly\r\n\/\/ v6 Added pcb drawing\r\n\/\/ Added colors\r\n\/\/ Cut out better so there is no debris around\r\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\r\n\/\/ Make a low as possible case, let USB stick out\r\n\/\/ v7 PCB options\r\n\/\/ Low level case optimisations\r\n\/\/ SD card location alterations\r\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\r\n\/\/ adapted support studs, moved some due to component location\r\n\/\/ components locations adapted\r\n\/\/ v9 Added logo in seperate dxf file\r\n\/\/ Option added to put logo in middle or using whole deck\r\n\/\/ beautified code, kr style\r\n\/\/ v10 Added logosunken and bottomsupport structures\r\n\/\/ Bottom supports are located where no components are located\r\n\/\/ so the pcb is not only supported from the sides\r\n\/\/ Well got my case, so based on what I see I changed:\r\n\/\/ case split level changed, should be better when printed on a reprap\r\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\r\n\/\/ Made frontstud a little thicker\r\n\/\/ v11 Different splitlevel (more simple) on back\r\n\/\/ keep a little margin on back split, so that top and bottom always fit\r\n\/\/ added openlogo option\r\n\/\/ v12 Different component locations\/sizes\r\n\/\/ keep a little margin on component holes\r\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\r\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\r\n\/\/ v13 skip this one.... :)\r\n\/\/ v14 Production board measurements...\r\n\/\/\t small differences, sometimes components are soldered differently\r\n\/\/ keep more space\r\n\/\/ should fit like a glove...\r\n\/\/ v15 moved the rca and snd a bit to get them more centered\r\n\/\/ Thanks to lincomatic at Thingiverse\r\n\/\/ Added option for GPIO side hole in bottom or top\r\n\/\/ Added showing GPIO pins with component drawing\r\n\/\/\r\n\/\/ All parts are draw as default just disable the ones you don't want\r\nDRAWfull = 0;\r\nDRAWtop = 1;\r\nDRAWbottom = 1;\r\nDRAWtopinlet = 0;\r\nDRAWbottominlet = 0;\r\nDRAWpcb = 0;\r\n\r\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\r\nGPIOsize = 2; \/\/ define height of gpiohole\r\n\r\n\/\/ select how the case should look like\r\ntopframe = false; \/\/ if false, underneath values determines how\r\ntopinlet = false; \/\/ false is outside, otherwise it is with an indent\r\ntopholes = true;\r\n\/\/ ---- holes sizes\r\nholeofs=2;\r\nholesiz=3;\r\nholestep=10;\r\nnoholes=6;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\r\nholelen=24;\r\ntopmiddle = false;\r\n\r\nbottomframe = false; \/\/ if false, underneath values determines how\r\nbottominlet = false;\r\nbottomholes = false;\r\nbottomscrew = false;\r\nbottomfeet = false; \/\/ MHL: conflict w\/ various through-hole components\r\nbottomsupport = false; \/\/ Added extra support locations for pcb\r\nbottomclick = true;\r\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\r\n\r\nbox_thickness = 2.0; \/\/ minimum = 1.0\r\ninside_h = 12.3; \/\/ 12.1 = lowprofile 16.5 is full height\r\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\r\n\r\n\/\/ just some colors to see the difference\r\nCASEcolor=\"Maroon\";\r\nCONNcolor=\"Silver\";\r\n\r\n\/\/ Define Raspberry Pi pcb dimensions in mm\r\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\r\ninside_w = 57.2; \/\/56.17 is largest width reported, so a bit room on each side\r\npcb_thickness = 1.7;\r\n\r\n\/\/ Coordinates based on RJ45 corner = 0,0,0\r\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\r\n\r\n\/\/ Connectors\r\nCrj45_x=2.0;\t\t\t \/\/2.0\r\nCrj45_y=-1;\r\nCrj45_w=16.4;\t\t\t\/\/ 15.4\r\nCrj45_d=21.5; \/\/21.8\r\nCrj45_h=13.2;\r\n\r\nCusb_x=24.5; \/\/ 23.9\r\nCusb_y=-7.7;\r\nCusb_w=13.9; \/\/ 13.3\r\nCusb_d=19.0;\t\t\t\/\/ 17.2\r\nCusb_h=15.6;\r\n\r\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\r\nCpwr_y=80.9;\r\nCpwr_w=8.8;\t\t\t\t\/\/ 7.8 7.6\r\nCpwr_d=5.6;\r\nCpwr_h=2.6;\r\n\r\nCsd_x=16.7;\r\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\r\nCsd_w=27.8;\r\nCsd_d=29.0;\r\nCsd_h=3.4; \/\/ under pcb\r\n\r\nChdmi_x=-1.2;\r\nChdmi_y=32.0; \/\/ 32.4 if 15.1\r\nChdmi_w=11.4;\r\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\r\nChdmi_h=6.4;\r\n\r\nCsnd_x=inside_w - 11.4;\r\nCsnd_y=16.0;\r\nCsnd_w=11.4;\r\nCsnd_d=10.0;\r\nCsnd_h=10.5;\r\nCsnd_r=6.7;\r\nCsnd_z=3.0;\r\nCsnd_l=3.4;\r\n\r\nCrca_x=inside_w - 10.0 - 2.1;\r\nCrca_y=34.2; \/\/ 34.6 was 35.2\r\nCrca_w=10.0;\r\nCrca_d=10.4; \/\/ 9.8\r\nCrca_h=13.0;\r\nCrca_r=8.6;\r\nCrca_z=4;\r\nCrca_l=10; \/\/ wild guess\r\n\r\n\r\n\r\npcb_c = pcb_h + pcb_thickness; \/\/ component height\r\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\r\necho(\"casesplit=\",casesplit);\r\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\r\n\r\n\/\/ side stud sizes for supporting pcb\r\nstud_w = 2;\r\nstud_l = 4;\r\n\r\n\/\/ calculate box size\r\nbox_l = inside_l + (box_thickness * 2);\r\nbox_w = inside_w + (box_thickness * 2);\r\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\r\nbox_w1 = box_thickness;\r\nbox_w2 = box_w - box_thickness;\r\nbox_l1 = box_thickness;\r\nbox_l2 = box_l - box_thickness;\r\nbox_wc = box_w \/ 2; \/\/ center width\r\nbox_lc = box_l \/ 2; \/\/ center length\r\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\r\nmiddle = true;\r\n\/\/ rounded corners\r\ncorner_radius = box_thickness*2;\r\n\r\n\r\n\r\n\/\/ count no of items to draw\r\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom + DRAWtopinlet + DRAWbottominlet;\r\n\r\n\/\/ ====================================================== DRAW items\r\n\/\/ if one draw it centered\r\nif (DRAWtotal == 1) {\r\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\r\n if (DRAWfull ) {\r\n draw_case(0,1);\r\n translate(v=[0,0,0.2]) draw_case(1,0);\r\n }\r\n if (DRAWtop ) {\r\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\r\n }\r\n if (DRAWbottom) draw_case(1,0);\r\n if (DRAWtopinlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false);\r\n if (DRAWbottominlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew);\r\n }\r\n} else {\r\n\/\/ draw each one on there one location\r\n if (DRAWfull) {\r\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\r\n draw_case(1,0);\r\n translate(v=[0,0,0.2]) draw_case(0,1);\r\n }\r\n }\r\n if (DRAWbottom) {\r\n translate(v = [ 5, 5, 0]) draw_case(1,0);\r\n }\r\n if (DRAWtop) {\r\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\r\n }\r\n if (DRAWtopinlet) {\r\n translate(v = [ -box_w-5, -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false);\r\n }\r\n if (DRAWbottominlet) {\r\n translate(v = [ 5 , -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 10,3,5 , holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew);\r\n }\r\n}\r\n\r\n\/\/ ======================================================= END of draw\r\n\/\/ Module sections\r\n\r\nmodule make_deckholes(no,w,d,step) {\r\nfor ( i = [0 : 1 : no - 1] ) {\r\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) cube([w,d, box_thickness+18], center=true);\r\n }\r\n}\r\n\r\n\r\n\/\/ create a deck or insert\r\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\r\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\r\n ofs1=4;\r\n ofs2=w - ofs1 - hole_w;\r\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\r\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\r\n color(CASEcolor) {\r\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\r\n difference() {\r\n cube([w, d, box_thickness], center = false);\r\n if (top && holes && hole_size>0) {\r\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\r\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep);\r\n }\r\n if (screwholes) {\r\n \/\/ --- 2x screw holes in bottom for mounting\r\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\r\n \/\/ 2nd screw hole\r\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\r\n if (!holes) {\r\n \/\/ middle screw hole\r\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\r\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\r\n }\r\n }\r\n if (holes && !top) {\r\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep);\r\n }\r\n }\r\n color(CASEcolor) {\r\n if (feet) {\r\n translate(v=[3,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[3,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n }\r\n if (top && holes) {\r\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\r\n }\r\n if (middle) {\r\n \/\/ --- solid area for sticker\r\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\r\n cube([20,20, box_thickness], center = false);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\r\n translate(v = [x, y, -1]) {\r\n difference() {\r\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\r\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\r\n }\r\n }\r\n}\r\n\r\n\r\nmodule make_topcomponents() {\r\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\r\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\r\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\r\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\r\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\r\n\r\n \/\/SND\r\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\r\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\r\n\r\n \/\/RCA\r\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\r\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\r\n }\r\n for ( i = [0 : 1 : 12] ) {\r\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n\r\n }\r\n}\r\n\r\nmodule make_connholes() {\r\n \/\/ =================================== cut outs, offset from 0,0\r\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\r\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\r\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\r\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\r\n\r\n \/\/power: 3.4mm offset, 8mm width, 3mm height\r\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\r\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\r\n if (pcb_h >= (Csd_h+1.5) ) {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\r\n } else {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\r\n }\r\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\r\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\r\n\r\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\r\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\r\n\r\n \/\/ RCA: 35mm offset, 10mm width 10mm height\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\r\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\r\n }\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\r\n cube([5,Crca_r+2,Crca_r\/2+1]);\r\n }\r\n}\r\n\r\nmodule make_pcb() {\r\n translate(v=[box_w1,box_l1,pcb_h]) {\r\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\r\n }\r\n color(CONNcolor) {\r\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\r\n }\r\n make_topcomponents();\r\n}\r\n\r\n\/\/ put extra supports on free spaces, used beta board image\r\nmodule make_supports() {\r\n if (!bottomframe) {\r\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n }\r\n}\r\n\r\n\/\/ width,depth,height,boxthickness,ledgethickness\r\nmodule make_case(w,d,h,bt,lt) {\r\n dt=bt+lt; \/\/ box+ledge thickness\r\n bt2=bt+bt; \/\/ 2x box thickness\r\n \/\/ Now we just substract the shape we have created in the four corners\r\n color(CASEcolor) difference() {\r\n cube([w,d,h], center=false);\r\n if (rounded) {\r\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\r\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\r\n }\r\n \/\/ empty inside, but keep a ledge for strength\r\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\r\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\r\n \/\/ remove bottom and top deck\r\n translate(v = [box_thickness+2, box_thickness+5,-2]) {\r\n cube([inside_w-4, inside_l-10, box_h+4], center = false);\r\n }\r\n }\r\n if (!topframe) {\r\n if (!topinlet) {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,top=true);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness*2, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,top=true);\r\n }\r\n }\r\n if (!bottomframe) {\r\n if (!bottominlet) {\r\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,top=false);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_thickness, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,top=false);\r\n }\r\n if (bottomsupport) {\r\n make_supports();\r\n }\r\n }\r\n}\r\n\r\nmodule make_stud(x,y,z,w,h,l) {\r\n translate(v = [x, y, z]) cube([w, l, h], center = false);\r\n}\r\n\r\nmodule set_cutout(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\r\n}\r\n\r\nmodule set_cutoutv(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\r\n}\r\n\r\nmodule draw_pcbhold() {\r\n if (bottomclick) {\r\n color(CASEcolor) {\r\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([1, 3,2]);\r\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([1,3,2]);\r\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([1, 3,3]);\r\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([1,3,3]);\r\n translate(v=[1,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule split_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w1+Csd_x - 5; \/\/ min 16.5+28\r\n split4=box_w2 - 7;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\r\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\r\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\r\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\r\n}\r\n\r\nmodule remove_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7;\r\n possd1=box_w1 + Csd_x - 0.3;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\r\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\r\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\r\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\r\n if (bottompcb) {\r\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\r\n }\r\n}\r\n\r\nmodule remove_bottom() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7.1;\r\n possd1=box_w1 + Csd_x - 0.2;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\r\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\r\n}\r\n\r\nmodule draw_case(bottom, top) {\r\n difference() {\r\n union() {\r\n \/\/ make empty case\r\n difference() {\r\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\r\n if (top != 0 && bottom == 0) remove_bottom();\r\n if (top == 0 && bottom != 0) remove_top();\r\n }\r\n color(CASEcolor) {\r\n if (bottom != 0 ) {\r\n \/\/ add bottom studs for pcb\r\n \/\/ add bottom studs for pcb\r\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\r\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\r\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\r\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\r\n\r\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\r\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\r\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\r\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\r\n\r\n\r\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n\r\n draw_pcbhold();\r\n }\r\n\r\n if (top != 0) {\r\n \/\/ --- screw connection plates\r\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\r\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\r\n }\r\n translate(v = [box_w2-10, box_l2 - 1.5, casesplit - 5.4]) {\r\n cube([10, 1.5, box_h-(casesplit-5.4)], center = false);\r\n }\r\n \/\/ extra support for shell\r\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\r\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\r\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\r\n\t\t\t\t\t }\r\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\r\n cube([stud_w,10, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n }\r\n } \/\/ color\r\n } \/\/ end union\r\n \/\/ conn plate hole\r\n color(CASEcolor) {\r\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n if (GPIOHOLE == 1 && bottom != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \r\n }\r\n if (GPIOHOLE == 2 && top != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \r\n }\r\n }\r\n if (bottom != 0) {\r\n if (top == 0) {\r\n remove_top();\r\n } else {\r\n split_top();\r\n }\r\n }\r\n make_connholes();\r\n }\r\n if (bottom) {\r\n draw_pcbhold();\r\n if (DRAWpcb == 1) make_pcb();\r\n }\r\n} \/\/ end module\r\n","old_contents":"\/\/ Raspberry Pi Case\r\n\/\/ Hans Harder 2012\r\n\/\/\r\n\/\/ Warning: this is based on the Beta board dimensions...\r\n\/\/ so production models can be slightly different\r\n\/\/ for instance SD card holder height and USB socket dimensions\r\n\/\/\r\n\/\/ Since all connectors stick out, case is split on HDMI height\r\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\r\n\/\/\r\n\/\/ v2: Adapted version after some suggestions from David...\r\n\/\/ removed feet, made both surface flat\r\n\/\/ v3: Added fliptop option and smooth the corners of the box\r\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\r\n\/\/ Looks strange but it fits...\r\n\/\/ Added frame mode (so no bottom and top deck)\r\n\/\/ Moved screw locations due to split and added some support structures\r\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\r\n\/\/ v5 relocated a lot of code in modules\r\n\/\/ SDslot location was not calculated correctly\r\n\/\/ v6 Added pcb drawing\r\n\/\/ Added colors\r\n\/\/ Cut out better so there is no debris around\r\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\r\n\/\/ Make a low as possible case, let USB stick out\r\n\/\/ v7 PCB options\r\n\/\/ Low level case optimisations\r\n\/\/ SD card location alterations\r\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\r\n\/\/ adapted support studs, moved some due to component location\r\n\/\/ components locations adapted\r\n\/\/ v9 Added logo in seperate dxf file\r\n\/\/ Option added to put logo in middle or using whole deck\r\n\/\/ beautified code, kr style\r\n\/\/ v10 Added logosunken and bottomsupport structures\r\n\/\/ Bottom supports are located where no components are located\r\n\/\/ so the pcb is not only supported from the sides\r\n\/\/ Well got my case, so based on what I see I changed:\r\n\/\/ case split level changed, should be better when printed on a reprap\r\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\r\n\/\/ Made frontstud a little thicker\r\n\/\/ v11 Different splitlevel (more simple) on back\r\n\/\/ keep a little margin on back split, so that top and bottom always fit\r\n\/\/ added openlogo option\r\n\/\/ v12 Different component locations\/sizes\r\n\/\/ keep a little margin on component holes\r\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\r\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\r\n\/\/ v13 skip this one.... :)\r\n\/\/ v14 Production board measurements...\r\n\/\/\t small differences, sometimes components are soldered differently\r\n\/\/ keep more space\r\n\/\/ should fit like a glove...\r\n\/\/ v15 moved the rca and snd a bit to get them more centered\r\n\/\/ Thanks to lincomatic at Thingiverse\r\n\/\/ Added option for GPIO side hole in bottom or top\r\n\/\/ Added showing GPIO pins with component drawing\r\n\/\/\r\n\/\/ All parts are draw as default just disable the ones you don't want\r\nDRAWfull = 0;\r\nDRAWtop = 1;\r\nDRAWbottom = 1;\r\nDRAWtopinlet = 0;\r\nDRAWbottominlet = 0;\r\nDRAWpcb = 0;\r\n\r\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\r\nGPIOsize = 2; \/\/ define height of gpiohole\r\n\r\n\/\/ select how the case should look like\r\ntopframe = false; \/\/ if false, underneath values determines how\r\ntopinlet = false; \/\/ false is outside, otherwise it is with an indent\r\ntopholes = true;\r\n\/\/ ---- top holes sizes\r\n\/\/holeofs=5;\t\t\t\t\t\t\/\/ 2 for fish1, 10 for fish2, 5 for holes\r\n\/\/holesiz=2;\r\n\/\/holelen=30;\r\n\/\/holestep=5.2;\r\n\/\/noholes=12;\r\n\/\/holeangle1=[0,0, 0];\t\t \/\/ , 30] for fish1 and ,-30] for fish2 ,0] for holes\r\n\/\/holeangle2=[0,0, 0];\t\t \/\/ ,-30] for fish1 and , 30] for fish2 ,0] for holes\r\n\/\/ ---- bottom holes sizes\r\nholeofs=5;\r\nholesiz=2.5;\r\nholestep=6;\r\nnoholes=12;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\r\nholelen=50;\r\nholeangle1=[0,0, 0];\r\ntopmiddle = false;\r\ntoplogo = false;\r\ntoplogopc = -1; \/\/ 0 0 placement correction of logo\r\ntoplogoxm = 0; \/\/ 3 6 leftmargin of logo\r\ntoplogotm = -1; \/\/ 12 15 topmargin of logo\r\ntoplogohole = false;\r\ntoplogosunken=false; \/\/ true or false, no idea if this works on a reprap\r\n\r\nbottomframe = false; \/\/ if false, underneath values determines how\r\nbottominlet = false;\r\nbottomholes = false;\r\nbottomscrew = false;\r\nbottomfeet = false; \/\/ MHL: conflict w\/ various through-hole components\r\nbottomsupport = false; \/\/ Added extra support locations for pcb\r\nbottomclick = true;\r\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\r\n\r\nbox_thickness = 2.0; \/\/ minimum = 1.0\r\ninside_h = 12.1; \/\/ 12.1 = lowprofile 16.5 is full height\r\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\r\n\r\n\/\/ just some colors to see the difference\r\nCASEcolor=\"Maroon\";\r\nCONNcolor=\"Silver\";\r\nLOGOcolor=\"White\";\r\n\r\n\/\/ Define Raspberry Pi pcb dimensions in mm\r\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\r\ninside_w = 57.0; \/\/56.17 is largest width reported, so a bit room on each side\r\npcb_thickness = 1.6;\r\n\r\n\/\/ Coordinates based on RJ45 corner = 0,0,0\r\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\r\n\r\n\/\/ Connectors\r\nCrj45_x=2.0;\t\t\t \/\/2.0\r\nCrj45_y=-1;\r\nCrj45_w=16.4;\t\t\t\/\/ 15.4\r\nCrj45_d=21.5; \/\/21.8\r\nCrj45_h=13;\r\n\r\nCusb_x=24.5; \/\/ 23.9\r\nCusb_y=-7.7;\r\nCusb_w=13.9; \/\/ 13.3\r\nCusb_d=19.0;\t\t\t\/\/ 17.2\r\nCusb_h=15.4;\r\n\r\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\r\nCpwr_y=80.9;\r\nCpwr_w=8.6;\t\t\t\t\/\/ 7.8 7.6\r\nCpwr_d=5.6;\r\nCpwr_h=2.5;\r\n\r\nCsd_x=16.7;\r\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\r\nCsd_w=27.8;\r\nCsd_d=29.0;\r\nCsd_h=3.4; \/\/ under pcb\r\n\r\nChdmi_x=-1.2;\r\nChdmi_y=32.0; \/\/ 32.4 if 15.1\r\nChdmi_w=11.4;\r\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\r\nChdmi_h=6.4;\r\n\r\nCsnd_x=inside_w - 11.4;\r\nCsnd_y=16.0;\r\nCsnd_w=11.4;\r\nCsnd_d=10.0;\r\nCsnd_h=10.5;\r\nCsnd_r=6.7;\r\nCsnd_z=3.0;\r\nCsnd_l=3.4;\r\n\r\nCrca_x=inside_w - 10.0 - 2.1;\r\nCrca_y=34.2; \/\/ 34.6 was 35.2\r\nCrca_w=10.0;\r\nCrca_d=10.4; \/\/ 9.8\r\nCrca_h=13.0;\r\nCrca_r=8.6;\r\nCrca_z=4;\r\nCrca_l=10; \/\/ wild guess\r\n\r\n\r\n\r\npcb_c = pcb_h + pcb_thickness; \/\/ component height\r\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\r\necho(\"casesplit=\",casesplit);\r\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\r\n\r\n\/\/ side stud sizes for supporting pcb\r\nstud_w = 2;\r\nstud_l = 4;\r\n\r\n\/\/ calculate box size\r\nbox_l = inside_l + (box_thickness * 2);\r\nbox_w = inside_w + (box_thickness * 2);\r\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\r\nbox_w1 = box_thickness;\r\nbox_w2 = box_w - box_thickness;\r\nbox_l1 = box_thickness;\r\nbox_l2 = box_l - box_thickness;\r\nbox_wc = box_w \/ 2; \/\/ center width\r\nbox_lc = box_l \/ 2; \/\/ center length\r\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\r\nmiddle = true;\r\n\/\/ rounded corners\r\ncorner_radius = box_thickness*2;\r\n\r\n\r\n\r\n\/\/ count no of items to draw\r\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom + DRAWtopinlet + DRAWbottominlet;\r\n\r\n\/\/ ====================================================== DRAW items\r\n\/\/ if one draw it centered\r\nif (DRAWtotal == 1) {\r\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\r\n if (DRAWfull ) {\r\n draw_case(0,1);\r\n translate(v=[0,0,0.2]) draw_case(1,0);\r\n }\r\n if (DRAWtop ) {\r\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\r\n }\r\n if (DRAWbottom) draw_case(1,0);\r\n if (DRAWtopinlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo);\r\n if (DRAWbottominlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew,logo=false);\r\n }\r\n} else {\r\n\/\/ draw each one on there one location\r\n if (DRAWfull) {\r\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\r\n draw_case(1,0);\r\n translate(v=[0,0,0.2]) draw_case(0,1);\r\n }\r\n }\r\n if (DRAWbottom) {\r\n translate(v = [ 5, 5, 0]) draw_case(1,0);\r\n }\r\n if (DRAWtop) {\r\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\r\n }\r\n if (DRAWtopinlet) {\r\n translate(v = [ -box_w-5, -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo);\r\n }\r\n if (DRAWbottominlet) {\r\n translate(v = [ 5 , -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 10,3,5 , holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew,logo=false);\r\n }\r\n}\r\n\r\n\/\/ ======================================================= END of draw\r\n\/\/ Module sections\r\n\r\nmodule put_pilogo(w,h,mx,mh,mt) {\r\n fn=\"raspberrypi_logo.dxf\";\r\n \/\/ calculate the scale and which offset to use\r\n scx=(w- (mx*2)) \/ 155.0;\r\n ofsy= (h - mh) - (205.0*scx);\r\n\r\n translate(v=[mx+toplogopc,ofsy-toplogotm,0]) linear_extrude(height=mt) import(file=fn, scale=scx);\r\n}\r\n\r\nmodule make_deckholes(no,w,d,step,v) {\r\nfor ( i = [0 : 1 : no - 1] ) {\r\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) rotate(a=v) cube([w,d, box_thickness+18], center=true);\r\n }\r\n}\r\n\r\n\r\n\/\/ create a deck or insert\r\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\r\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\r\n ofs1=4;\r\n ofs2=w - ofs1 - hole_w;\r\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\r\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\r\n color(CASEcolor) {\r\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\r\n difference() {\r\n cube([w, d, box_thickness], center = false);\r\n if (top && !logo && holes && hole_size>0) {\r\n\/\/ if (holeangle1 != [0,0,0]) {\r\n\/\/ translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle1);\r\n\/\/ translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle2);\r\n\/\/ } else {\r\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle1);\r\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle2);\r\n\/\/ }\r\n }\r\n if (screwholes) {\r\n \/\/ --- 2x screw holes in bottom for mounting\r\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\r\n \/\/ 2nd screw hole\r\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\r\n if (!holes) {\r\n \/\/ middle screw hole\r\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\r\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\r\n }\r\n }\r\n if (holes && !top) {\r\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep,holeangle1);\r\n }\r\n if (logo) {\r\n if (toplogohole) {\r\n if (!topholes) {\r\n translate(v=[0,0,-1],center=false) put_pilogo(w,d,2,4,box_thickness+1.2);\r\n } else {\r\n if (!middle) {\r\n translate(v=[0,0,-1],center=false) put_pilogo(w,d-14,5,0,box_thickness+3.2);\r\n }\r\n }\r\n } else {\r\n if (toplogosunken) {\r\n color(LOGOcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) {\r\n translate(v=[2,0,0],center=false) scale([ 0.1, 0.1, 1 ]) linear_extrude(height = 0.32) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n } else {\r\n translate(v=[10,14,box_thickness-0.3],center=false) scale([ 0.2, 0.2, 1 ]) linear_extrude(height = 0.32) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n }\r\n } else {\r\n color(CASEcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) cube([20,20, 30], center = false);\r\n } else {\r\n translate(v=[(w-30)\/2,14,box_thickness-0.3],center=false) cube([30,d-41, 30], center = false);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (logo && topholes) {\r\nfor ( i = [d-17 : hole_step : d - hole_ofs] ) {\r\n \/\/ thru hole\r\n translate(v = [ofs1,box_thickness+i+3,-1]) {\r\n cube([hole_w, hole_size-1, box_thickness+3], center = false);\r\n }\r\n translate(v = [ofs2,box_thickness+i+3,-1]) {\r\n cube([hole_w, hole_size-1, box_thickness+3], center = false);\r\n }\r\n }\r\n }\r\n }\r\n color(CASEcolor) {\r\n if (feet) {\r\n translate(v=[3,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[3,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n }\r\n if (top && !logo && holes) {\r\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\r\n }\r\n if (middle) {\r\n \/\/ --- solid area for sticker\r\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\r\n if (logo) {\r\n cube([20,20, box_thickness-0.3], center = false);\r\n } else {\r\n cube([20,20, box_thickness], center = false);\r\n }\r\n }\r\n }\r\n }\r\n if (logo && !toplogohole) {\r\n if (!toplogosunken) {\r\n color(LOGOcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) {\r\n translate(v=[2,0,0],center=false) scale([ 0.1, 0.1, 1 ]) linear_extrude(height = 0.3) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n } else {\r\n translate(v=[10.5,14,box_thickness-0.3],center=false) scale([ 0.2, 0.2, 1 ]) linear_extrude(height = 0.3) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\r\n translate(v = [x, y, -1]) {\r\n difference() {\r\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\r\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\r\n }\r\n }\r\n}\r\n\r\n\r\nmodule make_topcomponents() {\r\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\r\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\r\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\r\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\r\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\r\n\r\n \/\/SND\r\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\r\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\r\n\r\n \/\/RCA\r\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\r\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\r\n }\r\n for ( i = [0 : 1 : 12] ) {\r\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n\r\n }\r\n}\r\n\r\nmodule make_connholes() {\r\n \/\/ =================================== cut outs, offset from 0,0\r\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\r\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\r\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\r\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\r\n\r\n \/\/power: 3.4mm offset, 8mm width, 3mm height\r\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\r\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\r\n if (pcb_h >= (Csd_h+1.5) ) {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\r\n } else {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\r\n }\r\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\r\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\r\n\r\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\r\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\r\n\r\n \/\/ RCA: 35mm offset, 10mm width 10mm height\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\r\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\r\n }\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\r\n cube([5,Crca_r+2,Crca_r\/2+1]);\r\n }\r\n}\r\n\r\nmodule make_pcb() {\r\n translate(v=[box_w1,box_l1,pcb_h]) {\r\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\r\n }\r\n color(CONNcolor) {\r\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\r\n }\r\n make_topcomponents();\r\n}\r\n\r\n\/\/ put extra supports on free spaces, used beta board image\r\nmodule make_supports() {\r\n if (!bottomframe) {\r\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n }\r\n}\r\n\r\n\/\/ width,depth,height,boxthickness,ledgethickness\r\nmodule make_case(w,d,h,bt,lt) {\r\n dt=bt+lt; \/\/ box+ledge thickness\r\n bt2=bt+bt; \/\/ 2x box thickness\r\n \/\/ Now we just substract the shape we have created in the four corners\r\n color(CASEcolor) difference() {\r\n cube([w,d,h], center=false);\r\n if (rounded) {\r\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\r\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\r\n }\r\n \/\/ empty inside, but keep a ledge for strength\r\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\r\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\r\n \/\/ remove bottom and top deck\r\n translate(v = [box_thickness+5, box_thickness+5,-2]) {\r\n cube([inside_w-10, inside_l-10, box_h+4], center = false);\r\n }\r\n }\r\n if (!topframe) {\r\n if (!topinlet) {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo,top=true);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness*2, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo,top=true);\r\n }\r\n }\r\n if (!bottomframe) {\r\n if (!bottominlet) {\r\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,logo=false,top=false);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_thickness, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,logo=false,top=false);\r\n }\r\n if (bottomsupport) {\r\n make_supports();\r\n }\r\n }\r\n}\r\n\r\nmodule make_stud(x,y,z,w,h,l) {\r\n translate(v = [x, y, z]) cube([w, l, h], center = false);\r\n}\r\n\r\nmodule set_cutout(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\r\n}\r\n\r\nmodule set_cutoutv(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\r\n}\r\n\r\nmodule draw_pcbhold() {\r\n if (bottomclick) {\r\n color(CASEcolor) {\r\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([0.9, 3,2]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([0.9,3,2]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([0.9, 3,3]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([0.9,3,3]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule split_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w1+Csd_x - 5; \/\/ min 16.5+28\r\n split4=box_w2 - 7;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\r\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\r\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\r\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\r\n}\r\n\r\nmodule remove_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7;\r\n possd1=box_w1 + Csd_x - 0.3;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\r\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\r\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\r\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\r\n if (bottompcb) {\r\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\r\n }\r\n}\r\n\r\nmodule remove_bottom() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7.1;\r\n possd1=box_w1 + Csd_x - 0.2;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\r\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\r\n}\r\n\r\nmodule draw_case(bottom, top) {\r\n difference() {\r\n union() {\r\n \/\/ make empty case\r\n difference() {\r\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\r\n if (top != 0 && bottom == 0) remove_bottom();\r\n if (top == 0 && bottom != 0) remove_top();\r\n }\r\n color(CASEcolor) {\r\n if (bottom != 0 ) {\r\n \/\/ add bottom studs for pcb\r\n \/\/ add bottom studs for pcb\r\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\r\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\r\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\r\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\r\n\r\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\r\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\r\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\r\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\r\n\r\n\r\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n\r\n draw_pcbhold();\r\n }\r\n\r\n if (top != 0) {\r\n \/\/ --- screw connection plates\r\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\r\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\r\n }\r\n translate(v = [box_w2-10, box_l2 - 1.5, casesplit - 5.4]) {\r\n cube([10, 1.5, box_h-(casesplit-5.4)], center = false);\r\n }\r\n \/\/ extra support for shell\r\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\r\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\r\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\r\n\t\t\t\t\t }\r\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\r\n cube([stud_w,10, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n }\r\n } \/\/ color\r\n } \/\/ end union\r\n \/\/ conn plate hole\r\n color(CASEcolor) {\r\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n if (GPIOHOLE == 1 && bottom != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \r\n }\r\n if (GPIOHOLE == 2 && top != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \r\n }\r\n }\r\n if (bottom != 0) {\r\n if (top == 0) {\r\n remove_top();\r\n } else {\r\n split_top();\r\n }\r\n }\r\n make_connholes();\r\n }\r\n if (bottom) {\r\n draw_pcbhold();\r\n if (DRAWpcb == 1) make_pcb();\r\n }\r\n} \/\/ end module\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b72519d6eeaf6f78ab52490ceba55a71c83fee13","subject":"mechanical: diode: Add","message":"mechanical: diode: Add\n","repos":"atalax\/spectrometer,atalax\/spectrometer,atalax\/spectrometer,atalax\/spectrometer","old_file":"mechanical\/diode.scad","new_file":"mechanical\/diode.scad","new_contents":"\ndifference() {\n\tminkowski() {\n\t\tcube([16, 16, 6], center=true);\n\t\tcylinder(r=2, h=0.01, $fn=100);\n\t}\n\ttranslate([0, 0, -0.5])\n\t\tcube([17, 15.5, 4], center=true);\n\ttranslate([0, 0, 2])\n\t\tcube([9, 3, 5], center=true);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'mechanical\/diode.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"3f834eeb7f75955727fffb14b5d457e463100880","subject":"template model for all the boxes","message":"template model for all the boxes\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"minibox\/template.scad","new_file":"minibox\/template.scad","new_contents":"module _rounded_box(dim, r)\n{\n \/\/%cube(dim);\n hull()\n {\n for(dx=[r, dim[0]-r])\n for(dy=[r, dim[1]-r])\n translate([dx, dy, 0])\n cylinder(r=r, h=dim[2], $fn=100);\n }\n}\n\n\nmodule minibox(dim, r, wall)\n{\n difference()\n {\n _rounded_box(dim, r);\n translate(wall*[1,1,1])\n _rounded_box(dim-2*wall*[1,1,0], r);\n }\n}\n\n\nminibox([30, 20, 10], 2, 2);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'minibox\/template.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1cde9ce489acc7f20313d3caae59d393efcad66d","subject":"added openscad file for lens cover","message":"added openscad file for lens cover\n\nrender stl, slice it and print it\n","repos":"fialakarel\/lamax-x6","old_file":"improvements\/lens-cover.scad","new_file":"improvements\/lens-cover.scad","new_contents":"\/**\n * Lamax x6 -- lens cover\n * \n * @author Karel Fiala\n * @email fiala.karel@gmail.com\n *\/\n\n$fn=300;\n\nmodule lamax_x6_lens_cover() {\n\n width = 21\/2;\n heigh = 10;\n wall = 0.7;\n space = 0.3;\n\n inner = width + space;\n outer = inner + wall;\n\n difference() {\n translate([0, 0, -0.7]) cylinder(r1=outer, r2=outer, h=heigh + wall, center = true);\n cylinder(r1=inner, r2=inner, h=heigh + wall, center = true);\n }\n\n}\n\n\n\/\/ calling\nlamax_x6_lens_cover();","old_contents":"","returncode":1,"stderr":"error: pathspec 'improvements\/lens-cover.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"3220c7d4b9eddb47055fbf985409567b389614ef","subject":"main: use fncylindera orient param","message":"main: use fncylindera orient param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\nxaxis_pos_x = -225\/2*mm;\nxaxis_range_z=[85,350];\nxaxis_pos_z = 350*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n translate([xaxis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\nxaxis_pos_x = -225\/2*mm;\nxaxis_range_z=[85,350];\nxaxis_pos_z = 350*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n translate([xaxis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4013cb10950c3734904cd571f688cb3b44528452","subject":"Add some components to the ArduinoPro","message":"Add some components to the ArduinoPro\n\n- Approximate locations; only main components shown","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin() {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Distance to middle from origin\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5*25.4, ArduinoPro_PCB_Height])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(2*sqrt(.4*25.4), center=true);\n\n \/\/ Reset switch (or crystal for Pro Micro)\n color(\"silver\")\n translate([moveX, 0.15*25.4, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n square([5, 3.5], center=true);\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=2)\n union() {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n union() {\n square([1, 2.5], center=true);\n translate([0, 3, 0])\n square([2.5, 1.5], center=true);\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Serial_Pins);\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Header_Pins);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin() {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Serial_Pins);\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Header_Pins);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f2a86d32eb7b9274bae4755c7b88259934c66e47","subject":"Tweak measurement after hardboard cut test.","message":"Tweak measurement after hardboard cut test.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 2.8; \/\/ 2.8mm = 0.110\" (looks good based on cut test piece for hardboard slotting into hardboard)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n }\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n }\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bd67ba261b64e614b62ef2c7981a009f0a95189d","subject":"SD-card reader board","message":"SD-card reader board\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/sdcard_reader.scad","new_file":"lcd_case_for_prusa_i3\/sdcard_reader.scad","new_contents":"module sdCardReader()\n{\n difference()\n {\n union()\n {\n \/\/ main board\n cube([45,31,2]);\n \/\/ card connector\n translate([45-29+3.5, (31-29)\/2, 2])\n cube([29,29,3]);\n \/\/ connectors\n translate([0, (31-20.5)\/2, 2])\n cube([5, 20.5, 8]);\n \/\/ plugs\n translate([1, (31-20.5)\/2, 8+2])\n cube([2, 20.5, 18]);\n }\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [3\/2+1, 31-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=4, $fs=1);\n }\n }\n}\n\nsdCardReader();","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"451372d9556a0305292e385cb7759c9dfeb46305","subject":"change buttons height","message":"change buttons height\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 22.5;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"418c397a1096878c62448bc1dde3579f69e6f50e","subject":"added panel ammeter bracket","message":"added panel ammeter bracket\n","repos":"loxodes\/SuperDARN_Transmitter,loxodes\/SuperDARN_Transmitter,loxodes\/SuperDARN_Transmitter","old_file":"chassis\/agc_adapter\/ammeter.scad","new_file":"chassis\/agc_adapter\/ammeter.scad","new_contents":"\/\/ adapter plate for panel ammeter\n\n2_56 = .07; \/\/ drill tap diameter\nT_PLATE = .1;\n\nMOUNT_X = 1.626;\nMOUNT_Y = 1.07;\n\nmodule hole(x, y, height, d) {\n translate([x, y, height\/2])\n cylinder(h=2 * height,d=d,center=true,$fn=50);\n}\n\n\n\ndifference() {\n linear_extrude(height = T_PLATE)\n square([MOUNT_X + .25, MOUNT_Y + .25], center = true);\n union() {\n \n \/\/ mounting holes for agc\n hole(-MOUNT_X\/2, +MOUNT_Y\/2, T_PLATE, 2_56);\n hole(-MOUNT_X\/2, -MOUNT_Y\/2, T_PLATE, 2_56);\n hole(+MOUNT_X\/2, +MOUNT_Y\/2, T_PLATE, 2_56);\n hole(+MOUNT_X\/2, -MOUNT_Y\/2, T_PLATE, 2_56);\n\n \n \/\/ cutout unused space in middle\n translate([0,0,-.5])\n linear_extrude(height = 1)\n square([1.336, .838], center = true);\n\n };\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chassis\/agc_adapter\/ammeter.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"ad2d3d135d2d8d96e7be5caea6021afe82db497e","subject":"Partial FTC phone strain relief","message":"Partial FTC phone strain relief\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/phone-sr-v1.scad","new_file":"openscad\/strain-relief\/phone-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot phones - driver station and robot controller\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Phone side - just the bottom\nmodule phone_part(base_w) {\n \/\/base_w = 29; \/\/ width - x\n base_d = 20; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n cube([base_w, base_d, thick]);\n}\n\n\/\/ Support below usb cable - depth - in y-direction - is {d}\nmodule cable_support(cable_w, d) {\n \/\/cable_w = 13; \/\/ width - x \n cable_h = 11; \/\/ height - z\n cable_center_w = 5; \/\/ width of center protrusion\n cable_r = 1; \/\/ radii of curve in center protrusion\n cable_pad_h = 5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n cable_gap_d = 10; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([cable_w, d+EPSILON, thick]);\n translate([0, d-cable_gap_d, 0]) rotate([90, 0, 0])\n O_channel(cable_w, cable_h, cable_center_w, LARGE, \n (cable_w - cable_center_w)\/2, cable_pad_h+thick,\n cable_r, cable_r,\n d - cable_gap_d);\n }\n translate([-thick, d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(cable_w+2*thick, thick+thick, cable_w, LARGE, \n thick, thick,\n 0, cable_r, d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n base_w = 55;\n cable_w = 10;\n cable_d = 30; \/\/ depth - y - of lug\n cable_off = (base_w - cable_w)\/2; \/\/ offset in x of lug position\n translate([0, cable_d, 0]) phone_part(base_w);\n translate([cable_off, 0, 0]) cable_support(cable_w, cable_d);\n}\n\n\nswitch_strain_relief();\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/strain-relief\/phone-sr-v1.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"6e948f4573d8e8944f632e3f3964cc894e1c73bc","subject":"tweaked dimensions to matched actual measurements","message":"tweaked dimensions to matched actual measurements\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 29; \/\/ width - x\n wall_h = 10; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 15; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n side_w = 6; \/\/ side part of base without hole\n front_d = 6; \/\/ front part of base without hole\n hole_r = 5;\n hole_w = switch_w - 2 * side_w; \/\/ width of hole\n base_w = switch_w + 2*thick;\n difference() {\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d);\n translate([thick + side_w, front_d, -EPSILON])\n oblong(hole_w, LARGE, hole_r, thick + 2*EPSILON);\n }\n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 13; \/\/ width - x \n lug_h = 6; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.6; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 10; \/\/ depth - y - of lug\n lug_off = 6; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","old_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 30; \/\/ width - x\n wall_h = 10; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 30; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n side_w = 5; \/\/ side part of base without hole\n front_d = 5; \/\/ front part of base without hole\n hole_r = 5;\n hole_w = switch_w - 2 * side_w; \/\/ width of hole\n base_w = switch_w + 2*thick;\n difference() {\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d);\n translate([thick + side_w, front_d, -EPSILON])\n oblong(hole_w, LARGE, hole_r, thick + 2*EPSILON);\n }\n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 10; \/\/ width - x \n lug_h = 5; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 10; \/\/ depth - y - of lug\n lug_off = 5; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"a52218aed180c6d93cc791a23a208dfa764c57b1","subject":"main: reformatting","message":"main: reformatting\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n color(color_part)\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=Z);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n color(color_gantry_connectors)\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n color(color_gantry_connectors)\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(90*Y)\n belt_path(\n len=main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=Z);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n }\n\n translate([0, 0, main_height])\n {\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"60e0ec7bc6da7216f57a7b71ab9fc243822a6a59","subject":"z-axis\/motor-mount: add some more reinforcement","message":"z-axis\/motor-mount: add some more reinforcement\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis.scad","new_file":"z-axis.scad","new_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n difference()\n {\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\nmodule zaxis_motor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"81db5873eaccb823744fefdfad638c1516f91566","subject":" Wickes Treated Studwork (CLS) 38x63x2400mm Single Product Code: 133657","message":" Wickes Treated Studwork (CLS) 38x63x2400mm Single Product Code: 133657\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2350;\nshed_front_back = 2135;\nbase_timber = 47;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp,opp]);\n } \n}\n\nmodule breatherMembraneFront(x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo (\"lll\", x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) rotate([90,0,0]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([space_to_window_w,space_to_window_h,-100]) rotate([0,0,0]) cube([window_w,window_h,200]);\n translate([space_to_window_w*2+window_w,0,-100]) cube([door_w,door_h,200]);\n } \n}\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=timber_construct_w,timber_length=timber_construct_h, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_length,timber_width]);\n translate([0,0,z-timber_width]) cubeI([x,timber_length,timber_width]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2,timber_length, timber_width]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 25, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,7 );\n }\n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\nannimate_step = 1\/20;\n\n\nif($t>annimate_step*1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>annimate_step*2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>annimate_step*3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>annimate_step*4) \n translate([0,shed_width-timber_construct_h,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>annimate_step*5) \n translate([timber_construct_h,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*6) \n translate([shed_length,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>annimate_step*8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>annimate_step*9) \n translate([0,shed_width+0.5,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>annimate_step*10) \n translate([-0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*11) \n translate([shed_length+3,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*12) \n translate([-3,0,base_timber])\n breatherMembraneFront(shed_length,shed_front_height, thickness=0.5, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>annimate_step*13) \n translate([0,shed_width+3,base_timber])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>annimate_step*14) \n translate([-3,0,base_timber])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*15) \n translate([shed_length+3,0,base_timber])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*16) \n translate([-3,0,base_timber])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/restOfGarden();","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp,opp]);\n } \n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 25, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,6 );\n }\n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\n\nif($t>0.05) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>0.10) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>0.15) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>0.20) \n translate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>0.25) \n translate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.30) \n translate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.35) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>0.40) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>0.45) \n translate([0,shed_width+0.5,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>0.50) \n translate([-0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>0.65) \n translate([0,shed_width+3,base_timber])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>0.70) \n translate([-3,0,base_timber])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>0.75) \n translate([shed_length+3,0,base_timber])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>0.80) \n translate([-3,0,base_timber])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/restOfGarden();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b9ed7ed80c7387dcc806813e54baf73100477a36","subject":"body: top_surface correctoin","message":"body: top_surface correctoin\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n \n correction_diameter_base = (2 * BORDER_RADIUS_BODY);\n diameter_base = DIAMETER_BODY - correction_diameter_base;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule body()\n{ \n top_surface();\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nmodule body()\n{ \n top_surface();\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"841cf66cd6a114f217f0e28b56127b9bbb2559f7","subject":"wanhao-i3-z-stop: handle side clamp offset more gracefully","message":"wanhao-i3-z-stop: handle side clamp offset more gracefully\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-z-stop\/zstop_all_2.scad","new_file":"wanhao-i3-z-stop\/zstop_all_2.scad","new_contents":"include <..\/libs\/trig.scad>;\n\n\/\/ enlarged to account for shrink\ng3mm = 3.45;\ng3mmnut = 5.85;\ng2mm = 2.0;\ngNutChamfer = 0.5;\n\ngMicroswitchHoleSpacing = 6.0;\ngSideClampHole1 = 0;\ngSideClampHole2 = 10;\n\ngTopClampY1 = 15;\ngTopClampY2 = 30;\ngClampOffset = 10;\ngSideClampOffset = 0;\n\nmodule NutTrap(x,h=100) {\n cylinder(d=x\/0.866,h=h,$fn=6);\n translate([0,0,-0.01])\n cylinder(d1=(x+gNutChamfer)\/0.866,d2=x\/0.866,h=gNutChamfer,$fn=6);\n}\n\n\/* cylinder_wall_thick should be a small integer *nozzle_dia *\/\nmodule NutTrapSupport(d,h,cylinder_wall_thick=0.7,cylinder_wall_offset=0.1) {\n cylinder(d=d+cylinder_wall_offset*2,h=h,$fn=16);\n}\n\n\nmodule Fillet(r,h=100) {\n difference() {\n cube([r,r,h]);\n translate([0,0,-1]) cylinder(r=r,h=h+2);\n }\n}\n\n\/* Side clamp, in two parts *\/\n\nmodule SideBody() {\n difference() {\n translate([0,-4,0]) cube([22,24,5+gSideClampOffset]);\n if(gSideClampOffset > 0) {\n translate([1,-4.01,5.01]) cube([22,16,10]);\n translate([0.5,0.5,5.01]) linear_extrude(height=10, convexity=3) SideClampOutline();\n }\n translate([-1,-5,3.5]) cube([11,27,5+gSideClampOffset]);\n translate([14,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([14+gMicroswitchHoleSpacing,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([8,gSideClampHole1,-1]) cylinder(d=g3mm,h=100,$fn=32);\n translate([8,gSideClampHole2,-1]) cylinder(d=g3mm,h=100,$fn=32);\n }\n}\n\ngSidePos1 = [8,18];\ngSidePos2 = [11,4];\ngSideCutoutRad = 25;\n\nmodule SideClampOutline() {\n difference() {\n hull() for(c=[[4,-2],[11,-2],[4,18],gSidePos1,gSidePos2])\n translate(c) circle(r=2,$fn=32);\n translate([0,0,-1])\n translate(CircleCircleIntersection(gSidePos1, gSidePos2, 2, gSideCutoutRad))\n circle(r=gSideCutoutRad,$fn=256);\n }\n}\n\nmodule SideClamp() {\n difference() {\n linear_extrude(height=5, convexity=3) SideClampOutline();\n \/\/translate(gSidePos1) cylinder(r=2,h=10);\n \/\/translate(gSidePos2) cylinder(r=2,h=10);\n translate([8,gSideClampHole1,-1]) union() {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n translate([8,gSideClampHole2,-1]) {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n }\n}\n\n\n\/* Top clamp, in two parts *\/\n\nmodule TopBody() {\n difference() {\n union() {\n translate([-1,0,0]) cube([11,35,12]);\n \/* thing adjustment screw goes on *\/\n hull() for(x=[-9,0])\n for(y=[1,9])\n translate([x,y]) cylinder(r=1,h=12);\n translate([-2.99,11.99,0]) rotate([0,0,-90]) Fillet(2,12);\n }\n hull() {\n for(x=[5,10])\n for(y=[10,50])\n translate([x,y,3])\n cylinder(r=2,h=100);\n }\n hull() {\n for(x=[5+1.7,10])\n for(y=[10+1.7,50])\n translate([x,y,-1])\n cylinder(r=2,h=100);\n }\n \/* adjustment screw *\/\n translate([-5,5,0]) {\n NutTrap(g3mmnut,3);\n cylinder(d=g3mm,h=200);\n }\n \/* notch for frame *\/\n hull() {\n for(x=[8,20])\n translate([x,0,-1]) cylinder(r=2,h=100);\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([-10,y,6])\n rotate([0,90,0]) cylinder(d=g3mm,h=100);\n }\n \/* adjustment screw support *\/\n translate([-5,5,0]) NutTrapSupport(g3mm,3);\n}\n\nmodule TopClamp() {\n difference() {\n intersection() {\n cube([12,25,6]);\n hull() {\n translate([0,2,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,2,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n }\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0]) {\n cylinder(d=g3mm,h=100);\n NutTrap(g3mmnut,3);\n }\n }\n \/* clamp holes support *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0])\n NutTrapSupport(g3mm,3);\n}\n\nTopBody($fn=32);\n\n\/* to visualize together *\/\n\/* translate([11,gClampOffset,0]) rotate([0,-90,0]) Clamper($fn=32); *\/\n\/* for printing *\/\ntranslate([7,gClampOffset+2,0]) TopClamp($fn=32);\n\ntranslate([-25,15,0]) SideBody();\n\/* to visualise together *\/\n\/* translate([-25,15,6+gSideClampOffset]) SideClamp(); *\/\n\/* for printing *\/\ntranslate([-15,-3,0]) rotate([0,0,90]) SideClamp();\n","old_contents":"include <..\/libs\/trig.scad>;\n\n\/\/ enlarged to account for shrink\ng3mm = 3.45;\ng3mmnut = 5.85;\ng2mm = 2.0;\ngNutChamfer = 0.5;\n\ngMicroswitchHoleSpacing = 6.0;\ngSideClampHole1 = 0;\ngSideClampHole2 = 10;\n\ngTopClampY1 = 15;\ngTopClampY2 = 30;\ngClampOffset = 10;\ngSideClampOffset = 0;\n\nmodule NutTrap(x,h=100) {\n cylinder(d=x\/0.866,h=h,$fn=6);\n translate([0,0,-0.01])\n cylinder(d1=(x+gNutChamfer)\/0.866,d2=x\/0.866,h=gNutChamfer,$fn=6);\n}\n\n\/* cylinder_wall_thick should be a small integer *nozzle_dia *\/\nmodule NutTrapSupport(d,h,cylinder_wall_thick=0.7,cylinder_wall_offset=0.1) {\n cylinder(d=d+cylinder_wall_offset*2,h=h,$fn=16);\n}\n\n\nmodule Fillet(r,h=100) {\n difference() {\n cube([r,r,h]);\n translate([0,0,-1]) cylinder(r=r,h=h+2);\n }\n}\n\n\/* Side clamp, in two parts *\/\n\nmodule SideBody() {\n difference() {\n translate([0,-4,0]) cube([22,24,5+gSideClampOffset]);\n translate([-1,-5,3.5]) cube([11,27,5+gSideClampOffset]);\n translate([14,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([14+gMicroswitchHoleSpacing,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([8,gSideClampHole1,-1]) cylinder(d=g3mm,h=100,$fn=32);\n translate([8,gSideClampHole2,-1]) cylinder(d=g3mm,h=100,$fn=32);\n }\n}\n\ngSidePos1 = [8,18];\ngSidePos2 = [11,4];\ngSideCutoutRad = 25;\n\nmodule SideClamp() {\n difference() {\n hull() for(c=[[4,-2],[11,-2],[4,18],gSidePos1,gSidePos2])\n translate(c) cylinder(r=2,h=5,$fn=32);\n translate([0,0,-1])\n translate(CircleCircleIntersection(gSidePos1, gSidePos2, 2, gSideCutoutRad))\n cylinder(r=gSideCutoutRad,h=10,$fn=100);\n \/\/translate(gSidePos1) cylinder(r=2,h=10);\n \/\/translate(gSidePos2) cylinder(r=2,h=10);\n translate([8,gSideClampHole1,-1]) union() {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n translate([8,gSideClampHole2,-1]) {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n }\n}\n\n\n\/* Top clamp, in two parts *\/\n\nmodule TopBody() {\n difference() {\n union() {\n translate([-1,0,0]) cube([11,35,12]);\n \/* thing adjustment screw goes on *\/\n hull() for(x=[-9,0])\n for(y=[1,9])\n translate([x,y]) cylinder(r=1,h=12);\n translate([-2.99,11.99,0]) rotate([0,0,-90]) Fillet(2,12);\n }\n hull() {\n for(x=[5,10])\n for(y=[10,50])\n translate([x,y,3])\n cylinder(r=2,h=100);\n }\n hull() {\n for(x=[5+1.7,10])\n for(y=[10+1.7,50])\n translate([x,y,-1])\n cylinder(r=2,h=100);\n }\n \/* adjustment screw *\/\n translate([-5,5,0]) {\n NutTrap(g3mmnut,3);\n cylinder(d=g3mm,h=200);\n }\n \/* notch for frame *\/\n hull() {\n for(x=[8,20])\n translate([x,0,-1]) cylinder(r=2,h=100);\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([-10,y,6])\n rotate([0,90,0]) cylinder(d=g3mm,h=100);\n }\n \/* adjustment screw support *\/\n translate([-5,5,0]) NutTrapSupport(g3mm,3);\n}\n\nmodule TopClamp() {\n difference() {\n intersection() {\n cube([12,25,6]);\n hull() {\n translate([0,2,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,2,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n }\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0]) {\n cylinder(d=g3mm,h=100);\n NutTrap(g3mmnut,3);\n }\n }\n \/* clamp holes support *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0])\n NutTrapSupport(g3mm,3);\n}\n\nTopBody($fn=32);\n\n\/* to visualize together *\/\n\/* translate([11,gClampOffset,0]) rotate([0,-90,0]) Clamper($fn=32); *\/\n\/* for printing *\/\ntranslate([7,gClampOffset+2,0]) TopClamp($fn=32);\n\ntranslate([-25,15,0]) SideBody();\n\/* to visualise together *\/\n\/* translate([-25,15,5]) SideClamp(); *\/\n\/* for printing *\/\ntranslate([-15,-3,0]) rotate([0,0,90]) SideClamp();\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"aa35993e9e8d7faf422776e33909282bd260972b","subject":"wall height is now a parameter, too","message":"wall height is now a parameter, too\n","repos":"el-bart\/soft_playground,el-bart\/soft_playground","old_file":"openscad_svg_frame\/frame.scad","new_file":"openscad_svg_frame\/frame.scad","new_contents":"eps = 0.01;\nwall = 2;\nwall_h = 4;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children();\n }\n }\n\n cut_in_frame()\n children();\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n linear_extrude(wall_h)\n model_slot_base(name)\n children();\n sphere(r=wall\/2);\n }\n \/\/ cut-off for the bottom roundings\n \/\/ we're only interested in the top of the model\n translate([-50, -50, 0])\n cube(300*[1,1,1]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n \/\/ some location(s) that shall be removed from the overall shape:\n \/\/ bottom\n translate([40, -10, 0])\n square([60, 20]);\n \/\/ top\n translate([60, 110, 0])\n square([50, 20]);\n}\n","old_contents":"eps = 0.01;\nwall = 2;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children();\n }\n }\n\n cut_in_frame()\n children();\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n linear_extrude(2.7)\n model_slot_base(name)\n children();\n sphere(r=wall\/2);\n }\n \/\/ cut-off for the bottom roundings\n translate([-50, -50, 0])\n cube(300*[1,1,1]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n \/\/ some location(s) that shall be removed from the overall shape:\n \/\/ bottom\n translate([40, -10, 0])\n square([60, 20]);\n \/\/ top\n translate([60, 110, 0])\n square([50, 20]);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"c73252af983d6821dba6fa6a9d1176eb1e5eb5f0","subject":"misc: use fallback func","message":"misc: use fallback func\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"61c41749ee471c434e407ac7409df148f0afcbc1","subject":"empty model","message":"empty model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"chair_repairs\/side_arm_support.scad","new_file":"chair_repairs\/side_arm_support.scad","new_contents":"module support()\n{\n}\n\nsupport();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'chair_repairs\/side_arm_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"248d1191e55279ce7f85b1df76e551a6a6c3d48f","subject":"Added \"drawing\" of scintillator backplanes","message":"Added \"drawing\" of scintillator backplanes\n\nThese aluminum backplanes are used to mount the test-scintillators in\nthe testing rig in the x-ray lab.\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/ScintillatorBackplates.scad","new_file":"DetectorMockup\/ScintillatorBackplates.scad","new_contents":"\/\/ Scintillator backplate\n\n\/\/ Basic length variables\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\nCenterSzintillator = [459\/2, 380 - 80 - 172\/2, 0];\n\n\/\/ Toshiba Szintillator\nSizeToshiba = [236, 172, 100];\ndifference(){\n\tcube([459, 380, 6]);\n\ttranslate(CenterSzintillator-SizeToshiba\/2){\n\t\tcube(SizeToshiba);\n\t}\n}\n\n\/\/ Pingseng Szintillator\nSizePinseng = [200, 200, 100];\ntranslate([500,0,0]){\n\tdifference(){\n\t\tcube([459, 380, 6]);\n\t\ttranslate(CenterSzintillator-SizePinseng\/2){\n\t\t\tcube(SizePinseng);\n\t\t}\n\t}\n}\n\n\/\/ Applied Scintillation Technologies Szintillator\nSizeAppScinTech = [106, 106, 100];\ntranslate([1000,0,0]){\n\tdifference(){\n\t\tcube([459, 380, 6]);\n\t\ttranslate(CenterSzintillator-SizeAppScinTech\/2){\n\t\t\tcube(SizeAppScinTech);\n\t\t}\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'DetectorMockup\/ScintillatorBackplates.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"e100296043a61dae2c189fd7842d169ebabd227d","subject":"added temp for tests","message":"added temp for tests\n","repos":"fponticelli\/smallbridges","old_file":"temp.scad","new_file":"temp.scad","new_contents":"include \n$fn = 48;\n$detailed = true;\nrotate([90,0,0]) {\n printer();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'temp.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9d4438916ec3bc6f4e67ab8bad44f6a0f3d2c9c5","subject":"'fleshing out' arm","message":"'fleshing out' arm\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \nrender()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 160;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\nrender()\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n #cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"2d3fdd7369d8d8030ce4b307b822bb4e684d9a65","subject":"Not sure if the last commit was fully up to date...","message":"Not sure if the last commit was fully up to date...\n","repos":"twstdpear\/i3_parts","old_file":"bg10\/extras\/spool_roller.scad","new_file":"bg10\/extras\/spool_roller.scad","new_contents":"slop = .2;\n\n\/\/sized for m5 and 605\nbearing_w = 5+slop;\nbearing_d = 16;\nbearing_r = bearing_d\/2+slop;\nbearing_inner_d = 8.5;\nbearing_inner_r = bearing_inner_d\/2;\n\nbolt_d = 5;\nbolt_r = bolt_d\/2+slop;\nbolt_head_r = 10\/2+slop;\nnut_r = 9\/2+slop;\n\n\/\/these are for top-mounting the holder above your printer.\n\/\/Requires printing with support material!\ntop_length = 34;\ntop_thick = 6.5;\n\n\/\/sized for m8 and 608\n\/\/bearing_w = 7+slop;\n\/\/bearing_d = 22;\n\/\/bearing_r = bearing_d\/2+slop;\n\/\/bearing_inner_d = 12;\n\/\/bearing_inner_r = bearing_inner_d\/2;\n\n\/\/bolt_d = 8;\n\/\/bolt_r = bolt_d\/2+slop;\n\n\nseparation = 100;\nwall = 4;\n\n!spool_roller();\ntop_spool_roller();\n\n$fn=32;\nmodule spool_roller(){\n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([0,0,wall+slop\/2]) cube([separation+wall*2,wall*3+bearing_w,wall+wall+slop], center=true);\n\t\t\tfor(i=[-separation\/2, separation\/2]) translate([i,0,0]) {\n\t\t\t\ttranslate([0,0,wall]) bearing_mount();\n\t\t\t\t\n\t\t\t\tcylinder(r1=bearing_r+wall*1.5, r2=bearing_r+wall+wall, h=2);\n\n\t\t\t\ttranslate([0,0,1.95]) cylinder(r1=bearing_r+wall+wall, r2=(bearing_w+wall+wall+wall)\/2, h=wall+wall+slop-1.95);\n\t\t\t}\n\t\t}\n\n\t\t\/\/center channel\n\t\ttranslate([0,0,wall+wall+slop]) scale([1,(bearing_w+wall)\/(wall*2),1]) rotate([0,90,0]) cylinder(r=wall, h=separation*2, center=true, $fn=32);\n\t}\n}\n\nmodule top_spool_roller(){\n base = 5;\n lift = top_thick+base;\n \n mount_offset = 10;\n \n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([0,0,lift\/2+wall\/2+slop\/2]) cube([separation+wall*2,wall*3+bearing_w,lift+wall+slop], center=true);\n \n\t\t\tfor(i=[-separation\/2, separation\/2]) translate([i,0,0]) {\n\t\t\t\ttranslate([0,0,lift+wall\/2]) bearing_mount();\n\t\t\t\t\n \/\/chamfered base\n\t\t\t\tcylinder(r1=bearing_r+wall*1.5, r2=bearing_r+wall*2.5, h=3);\n\t\t\t\ttranslate([0,0,2.95]) cylinder(r1=bearing_r+wall*2.5, r2=(wall*3+bearing_w)\/2, h=lift+wall*1.5);\n\t\t\t}\n\t\t}\n\n\t\t\/\/center channel\n\t\ttranslate([0,0,lift+wall+slop]) hull(){\n \/\/scale([1,(bearing_w+wall)\/(wall*2),1]) rotate([0,90,0]) cylinder(r=wall, h=separation*2, center=true, $fn=32);\n translate([0,0,2]) scale([1,(bearing_w+wall)\/(wall*2),1]) rotate([0,90,0]) cylinder(r=wall, h=separation*2, center=true, $fn=32);\n }\n \n \n \/\/cutout for mounting atop the printer\n translate([mount_offset,0,0]) \n difference(){\n union(){\n cube([top_length,30,lift*2], center=true);\n hull(){\n cube([top_length,30,base*2], center=true);\n translate([-wall\/2,0,-lift]) cube([top_length,30,lift*2], center=true);\n }\n }\n \n translate([top_length\/2,0,0]) rotate([0,-10,0]) cube([top_thick*2,40,base*2], center=true);\n }\n\t}\n}\n\nmodule bearing_mount(){\n\ttranslate([0,0,bearing_r+wall])\n\trotate([-90,0,0]) \n\tdifference(){\n\t\tunion(){\n\t\t\tfor(i=[0,1]) mirror([0,0,i]) translate([0,0,-wall*1.5-bearing_w\/2]) {\n\t\t\t\ttranslate([-(bearing_r+wall),0,0]) cube([(bearing_r+wall)*2, bearing_r+wall+wall, wall]);\n\t\t\t\tcylinder(r=(bearing_r+wall\/2)\/cos(30), h=wall, $fn=6);\n\t\t\t\ttranslate([0,0,wall]) cylinder(r=bearing_r, r2=bearing_inner_r, h=wall\/2);\n\t\t\t}\n\t\t}\n\n\t\tcap_cylinder(r=bolt_r, h=14, center=true);\n\t\t\n\t\ttranslate([0,0,-wall*1.5-bearing_w\/2-wall\/2]) cap_cylinder(r=bolt_head_r, h=wall*1.4);\n\t\ttranslate([0,0,wall*1.4+bearing_w\/2-wall\/2]) cylinder(r1=nut_r, r2=nut_r+slop, h=wall*2, $fn=6);\n\t\t\n\t}\n}\n\nmodule cap_cylinder(r=1, h=1, center=false){\n\trender() union(){\n\t\tcylinder(r=r, h=h, center=center);\n\t\tintersection(){\n\t\t\trotate([0,0,22.5]) cylinder(r=r\/cos(180\/8), h=h, $fn=8, center=center);\n\t\t\ttranslate([0,-r\/cos(180\/4),0]) rotate([0,0,0]) cylinder(r=r\/cos(180\/4), h=h, $fn=4, center=center);\n\t\t}\n\t}\n}","old_contents":"slop = .2;\n\n\/\/sized for m5 and 605\nbearing_w = 5+slop;\nbearing_d = 16;\nbearing_r = bearing_d\/2+slop;\nbearing_inner_d = 8.5;\nbearing_inner_r = bearing_inner_d\/2;\n\nbolt_d = 5;\nbolt_r = bolt_d\/2+slop;\nbolt_head_r = 10\/2+slop;\nnut_r = 9\/2+slop;\n\n\/\/these are for top-mounting the holder above your printer.\n\/\/Requires printing with support material!\ntop_length = 34;\ntop_thick = 6.5;\n\n\/\/sized for m8 and 608\n\/\/bearing_w = 7+slop;\n\/\/bearing_d = 22;\n\/\/bearing_r = bearing_d\/2+slop;\n\/\/bearing_inner_d = 12;\n\/\/bearing_inner_r = bearing_inner_d\/2;\n\n\/\/bolt_d = 8;\n\/\/bolt_r = bolt_d\/2+slop;\n\n\nseparation = 100;\nwall = 4;\n\nspool_roller();\n!top_spool_roller();\n\n$fn=32;\nmodule spool_roller(){\n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([0,0,wall+slop\/2]) cube([separation+wall*2,wall*3+bearing_w,wall+wall+slop], center=true);\n\t\t\tfor(i=[-separation\/2, separation\/2]) translate([i,0,0]) {\n\t\t\t\ttranslate([0,0,wall]) bearing_mount();\n\t\t\t\t\n\t\t\t\tcylinder(r1=bearing_r+wall*1.5, r2=bearing_r+wall+wall, h=2);\n\n\t\t\t\ttranslate([0,0,1.95]) cylinder(r1=bearing_r+wall+wall, r2=(bearing_w+wall+wall+wall)\/2, h=wall+wall+slop-1.95);\n\t\t\t}\n\t\t}\n\n\t\t\/\/center channel\n\t\ttranslate([0,0,wall+wall+slop]) scale([1,(bearing_w+wall)\/(wall*2),1]) rotate([0,90,0]) cylinder(r=wall, h=separation*2, center=true, $fn=32);\n\t}\n}\n\nmodule top_spool_roller(){\n base = 5;\n lift = top_thick+base;\n \n mount_offset = 10;\n \n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([0,0,lift\/2+wall\/2+slop\/2]) cube([separation+wall*2,wall*3+bearing_w,lift+wall+slop], center=true);\n \n\t\t\tfor(i=[-separation\/2, separation\/2]) translate([i,0,0]) {\n\t\t\t\ttranslate([0,0,lift+wall\/2]) bearing_mount();\n\t\t\t\t\n \/\/chamfered base\n\t\t\t\tcylinder(r1=bearing_r+wall*1.5, r2=bearing_r+wall*2.5, h=3);\n\t\t\t\ttranslate([0,0,2.95]) cylinder(r1=bearing_r+wall*2.5, r2=(wall*3+bearing_w)\/2, h=lift+wall*1.5);\n\t\t\t}\n\t\t}\n\n\t\t\/\/center channel\n\t\ttranslate([0,0,lift+wall+slop]) hull(){\n \/\/scale([1,(bearing_w+wall)\/(wall*2),1]) rotate([0,90,0]) cylinder(r=wall, h=separation*2, center=true, $fn=32);\n translate([0,0,2]) scale([1,(bearing_w+wall)\/(wall*2),1]) rotate([0,90,0]) cylinder(r=wall, h=separation*2, center=true, $fn=32);\n }\n \n \n \/\/cutout for mounting atop the printer\n translate([mount_offset,0,0]) \n difference(){\n union(){\n cube([top_length,30,lift*2], center=true);\n hull(){\n cube([top_length,30,base*2], center=true);\n translate([-wall\/2,0,-lift]) cube([top_length,30,lift*2], center=true);\n }\n }\n \n translate([top_length\/2,0,0]) rotate([0,-10,0]) cube([top_thick*2,40,base*2], center=true);\n }\n\t}\n}\n\nmodule bearing_mount(){\n\ttranslate([0,0,bearing_r+wall])\n\trotate([-90,0,0]) \n\tdifference(){\n\t\tunion(){\n\t\t\tfor(i=[0,1]) mirror([0,0,i]) translate([0,0,-wall*1.5-bearing_w\/2]) {\n\t\t\t\ttranslate([-(bearing_r+wall),0,0]) cube([(bearing_r+wall)*2, bearing_r+wall+wall, wall]);\n\t\t\t\tcylinder(r=(bearing_r+wall\/2)\/cos(30), h=wall, $fn=6);\n\t\t\t\ttranslate([0,0,wall]) cylinder(r=bearing_r, r2=bearing_inner_r, h=wall\/2);\n\t\t\t}\n\t\t}\n\n\t\tcap_cylinder(r=bolt_r, h=14, center=true);\n\t\t\n\t\ttranslate([0,0,-wall*1.5-bearing_w\/2-wall\/2]) cap_cylinder(r=bolt_head_r, h=wall*1.4);\n\t\ttranslate([0,0,wall*1.4+bearing_w\/2-wall\/2]) cylinder(r1=nut_r, r2=nut_r+slop, h=wall*2, $fn=6);\n\t\t\n\t}\n}\n\nmodule cap_cylinder(r=1, h=1, center=false){\n\trender() union(){\n\t\tcylinder(r=r, h=h, center=center);\n\t\tintersection(){\n\t\t\trotate([0,0,22.5]) cylinder(r=r\/cos(180\/8), h=h, $fn=8, center=center);\n\t\t\ttranslate([0,-r\/cos(180\/4),0]) rotate([0,0,0]) cylinder(r=r\/cos(180\/4), h=h, $fn=4, center=center);\n\t\t}\n\t}\n}","returncode":0,"stderr":"","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"39313d9371348cb6973a2431685d524505d5e432","subject":"Add a bar mount support","message":"Add a bar mount support\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/bar_mount.scad","new_file":"Hardware\/bar_mount.scad","new_contents":"tube_diameter = 28;\nspace_margin = 1;\nthickness = 5;\nscrew_diameter = 5;\nscrew_head_thickness = 5;\n\na = tube_diameter + 2* space_margin +2*thickness;\ndifference(){\n\tunion(){\n\t\t\/\/Main part\n\t\tcube(size=[a,a,a], center = true);\n\t\t\n\t\t\/\/Screw tube\n\t\ttranslate([0, a\/2+screw_diameter\/2,0]) difference(){\n\t\t\tcylinder(r = screw_diameter\/2+thickness, h = a, center=\t\t\t\ttrue);\n\t\t\tcylinder(r = screw_diameter\/2, h = a, center=true);\n\t\t}\n\t\t\/\/Second screw tube\n\t\ttranslate([0, -a\/2-screw_diameter\/2,0]) difference(){\n\t\t\tcylinder(r = screw_diameter\/2+thickness, h = a, center=\t\t\t\ttrue);\n\t\t\tcylinder(r = screw_diameter\/2, h = a, center=true);\n\n\t\t}\n\t}\n\trotate([0,90,0]) cylinder(r=tube_diameter\/2. + space_margin, h= 2*a, center = true);\n cube(size =[2*a, 2*a,tube_diameter\/5.], center = true);\n\ttranslate([0,-a\/2-screw_diameter\/2,a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,-a\/2-screw_diameter\/2,-a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,+a\/2+screw_diameter\/2,a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,+a\/2+screw_diameter\/2,-a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/bar_mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b1367270a0cb41cbb32495d86e539465b215d59","subject":"Fixed typo in PinsDev.scad in Sandbox.","message":"Fixed typo in PinsDev.scad in Sandbox.\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/PinsDev.scad","new_file":"hardware\/sandbox\/PinsDev.scad","new_contents":"include <..\/config\/config.scad>\r\n\r\n\/\/ playground for pins libary\r\n\/\/ Modules to call = pin(), pinpeg(), pintack(), pinhole()\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ h = Length or height of pin\/hole.\r\n\/\/ r = radius of pin body (Default = PinDiameter\/2).\r\n\/\/ lh = Height of lip.\r\n\/\/ lt = Thickness of lip (Also adjusts slot width to allow legs to close).\r\n\/\/ t = Pin tolerance.\r\n\/\/ bh = Base Height (pintack only).\r\n\/\/ br = Base Radius (pintack only).\r\n\/\/ tight = Hole friction, set to false if you want a joint that spins easily (pinhole only)\r\n\/\/ fixed = Hole Twist, set to true so pins can't spin (pinhole only)\r\n\/\/\tSide = Orientates pins on their side for printing : true\/false (not pinhole).\r\n\r\n\r\ntranslate([-25,0,0])\r\n\tpin();\r\n\r\ntranslate([0,-20,0])\r\n\tpintack();\r\n\r\ntranslate([25,0,0])\r\n\tpinpeg(h=20);\r\n\r\ntranslate([-40,0,0])\r\n\tpin(side=true);\r\n\r\ntranslate([0,-40,0])\r\n\tpintack(side=true);\r\n\r\ntranslate([40,0,0])\r\n\tpinpeg(h=20, side=true);\r\n\r\n\r\ntranslate([0,20,0])\r\n\tpinhole(fixed=true);\r\n\r\ntranslate([10,0,0])difference(){\r\n\tcylinder(r=5.5,h=14);\r\n\tpinhole();\r\n}\r\n\r\ntranslate([-10,0,0])difference(){\r\n\tcylinder(r=5.5,h=14);\r\n\tpinhole(fixed=true);\r\n}","old_contents":"include <..\/config\/config.scad>\r\n\r\n\/\/ playground for pins libary\r\n\/\/ Modules to call = pin(), pinpeg(), pintack(), pinhole()\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ h = Length or height of pin\/hole.\r\n\/\/ r = radius of pin body (Default = PinDiameter\/2).\r\n\/\/ lh = Height of lip.\r\n\/\/ lt = Thickness of lip (Also adjusts slot width to allow legs to close).\r\n\/\/ t = Pin tolerance.\r\n\/\/ bh = Base Height (pintack only).\r\n\/\/ br = Base Radius (pintack only).\r\n\/\/ tight = Hole friction, set to false if you want a joint that spins easily (pinhole only)\r\n\/\/ fixed = Hole Twist, set to true so pins can't spin (pinhole only)\r\n\/\/\tSide = Orientates pins on their side for printing : true\/false (not pinhole).\r\n\r\n\r\ntranslate([-25,0,0])\r\n\tpin();\r\n\r\ntranslate([0,-20,0])\r\n\tpintack();\r\n\r\ntranslate([25,0,0])\r\n\tpinpeg(l=10);\r\n\r\ntranslate([-40,0,0])\r\n\tpin(side=true);\r\n\r\ntranslate([0,-40,0])\r\n\tpintack(side=true);\r\n\r\ntranslate([40,0,0])\r\n\tpinpeg(l=10, side=true);\r\n\r\n\r\ntranslate([0,20,0])\r\n\tpinhole(fixed=true);\r\n\r\ntranslate([10,0,0])difference(){\r\n\tcylinder(r=5.5,h=14);\r\n\tpinhole();\r\n}\r\n\r\ntranslate([-10,0,0])difference(){\r\n\tcylinder(r=5.5,h=14);\r\n\tpinhole(fixed=true);\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d67bbd55dd4002441eaa8b020a32fc6ea556551d","subject":"cleanup","message":"cleanup\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/circle-attachement\/water-pump-filter.scad","new_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/circle-attachement\/water-pump-filter.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d6ad28a9407ff9c955eecb3e6c309223c7ea7eb3","subject":"Attempt to fix warnings raised by newer openscad","message":"Attempt to fix warnings raised by newer openscad\n\nSpecifically, two changes were made:\n\n- There is no special variable called $generate. Define it as 0. '-Dgenerate=1'\n should still work due to how variables in openscad work.\n- Change 'path' to 'paths' in one of the polygon() calls as it seems to be a\n typo.\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, paths=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"3faeaf45b6055d79f048f1b1c85034e8ddaf0e20","subject":"fixup! materials: add some materials, and material module","message":"fixup! materials: add some materials, and material module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"materials.scad","new_file":"materials.scad","new_contents":"Mat_Oak = [0.65, 0.5, 0.4];\nMat_Pine = [0.85, 0.7, 0.45];\nMat_Birch = [0.9, 0.8, 0.6];\nMat_FiberBoard = [0.7, 0.67, 0.6];\nMat_BlackPaint = [0.2, 0.2, 0.2];\nMat_Iron = [0.36, 0.33, 0.33];\nMat_Steel = [0.65, 0.67, 0.72];\nMat_Stainless = [0.45, 0.43, 0.5];\nMat_Aluminium = [0.77, 0.77, 0.8];\nMat_Brass = [0.88, 0.78, 0.5];\nMat_Transparent = [1, 1, 1, 0.2];\n\nMat_Chrome = Mat_Steel;\nMat_Plastic = Mat_Pine;\nMat_PlasticBlack = Mat_BlackPaint;\nMat_Rubber = Mat_BlackPaint;\nMat_Ziptie = Mat_BlackPaint;\n\nmodule material(mat)\n{\n color(mat)\n children();\n}\n","old_contents":"Mat_Oak = [0.65, 0.5, 0.4];\nMat_Pine = [0.85, 0.7, 0.45];\nMat_Birch = [0.9, 0.8, 0.6];\nMat_FiberBoard = [0.7, 0.67, 0.6];\nMat_BlackPaint = [0.2, 0.2, 0.2];\nMat_Iron = [0.36, 0.33, 0.33];\nMat_Steel = [0.65, 0.67, 0.72];\nMat_Stainless = [0.45, 0.43, 0.5];\nMat_Aluminium = [0.77, 0.77, 0.8];\nMat_Brass = [0.88, 0.78, 0.5];\nMat_Transparent = [1, 1, 1, 0.2];\n\nMat_Chrome = Mat_Steel;\n\nMat_Plastic = Mat_Pine;\n\nmodule material(mat)\n{\n color(mat)\n children();\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"860b305a0698f394da002a1d8e981730cf57c12a","subject":"A rectangulare item was added.","message":"A rectangulare item was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/samples\/rectangular\/rectangular-water-pump-filter.scad","new_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/samples\/rectangular\/rectangular-water-pump-filter.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"04acb8c02f93d122da650d4507430ac06a15921f","subject":"removed hardcoded plate height","message":"removed hardcoded plate height\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"vent_shaft_doors\/base.scad","new_file":"vent_shaft_doors\/base.scad","new_contents":"use\ninclude\n\ndifference()\n{\n union()\n {\n cylinder(r=r_shaft, h=h);\n cylinder(r=r_shaft+30, h=wall);\n }\n translate([0, 0, -eps])\n cylinder(r=r_shaft-wall, h=h+2*eps);\n}\n\n%translate([0, 0, -5\/2])\n oring();\n","old_contents":"use\ninclude\n\ndifference()\n{\n union()\n {\n cylinder(r=r_shaft, h=h);\n cylinder(r=r_shaft+30, h=2);\n }\n translate([0, 0, -eps])\n cylinder(r=r_shaft-wall, h=h+2*eps);\n}\n\n%translate([0, 0, -5\/2])\n oring();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0ca459b5a01e7ec8ce6e9f0829ac037f9dc8ee98","subject":"Comments were added.","message":"Comments were added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/pencil-holder-with-cutouts\/spur-vase-spiral-lucky-charms.scad","new_file":"OpenSCAD\/pencil-holder-with-cutouts\/spur-vase-spiral-lucky-charms.scad","new_contents":"\r\n\/\/ this determines how tall the pen holder is\r\nvaseHeight = 300;\r\nvaseHeight = 120;\r\n\r\n\/\/ this sets how many cutouts are in the pen holder\r\ncharmCount = 26;\r\n\r\nspursCharmStl = \"..\/shapes\/spurs\/spurs-a.stl\";\r\nspursCharmXYScale = 0.2; \/\/ spur scale\r\nspursCharmDepthScale = 20.2; \/\/ oshw depth scale\r\n\r\noshwCharmStl = \"..\/shapes\/oshw\/oshw.stl\";\r\noshwCharmXYScale = 0.7;\r\noshwCharmDepthScale = 40.2;\r\n\r\nstarCharmStl = \"..\/shapes\/star\/star.stl\";\r\nstarCharmXYScale = 0.7;\r\nstarCharmDepthScale = 40.2;\r\n\r\ncharmStls = [\r\n spursCharmStl,\r\n oshwCharmStl,\r\n starCharmStl\r\n ];\r\n\r\ncharmXYScales = [\r\n spursCharmXYScale,\r\n oshwCharmXYScale,\r\n starCharmXYScale\r\n ];\r\n \r\ncharmDepthScales = [\r\n spursCharmDepthScale,\r\n oshwCharmDepthScale,\r\n starCharmDepthScale\r\n ];\r\n\r\nuniqueCharmCount = len(charmStls);\r\n\r\ncharmIndex = -1;\r\n\r\nrandomSeed = 2789676;\r\n\r\n\/\/ uncomment this next line to have a different pattern each time the model is rendered in OpenSCAD.\t\r\n\/\/randomSeed = rands(0,987654, 1)[0];\r\n\r\nmaxRandom = uniqueCharmCount - 1;\r\nrandomCharmIndcies = rands(0,maxRandom, charmCount, randomSeed);\r\n\r\ndifference()\r\n{\r\n \/\/ vase\r\n difference()\r\n {\r\n \/\/ outer vase\r\n translate([0,0,0])\r\n cylinder (h = vaseHeight, r=55, $fn=100);\r\n \r\n \/\/ remvoed inner vase centered\r\n translate([0,0,5])\r\n cylinder (h = vaseHeight, r=54, $fn=100);\r\n }\r\n \r\n y = 30;\r\n\r\n \/\/ lucky charms!\r\n for( i = [0 : charmCount] )\r\n {\r\n single_rand = randomCharmIndcies[i];\r\n\/\/ single_rand = rands(0,2,1)[0];\r\n\/\/\t\tsingle_rand = rands(0,2,1, randomSeed)[0];\r\n\t\t\r\n charmIndex = round(single_rand);\r\n \r\n\/\/echo(charmIndex);\r\n \r\n rotate([\r\n 90, \r\n 0,\r\n i * 38\r\n ])\r\n\r\n \/\/ normally x,y,z - but here y moves the charms up and down\r\n translate([15, 5 * i, 30])\r\n scale([charmXYScales[charmIndex],\r\n charmXYScales[charmIndex], \r\n charmDepthScales[charmIndex]\r\n ])\r\n import(charmStls[charmIndex]);\r\n }\r\n}","old_contents":"\r\nvaseHeight = 300;\r\nvaseHeight = 120;\r\n\r\n\/\/ this sets how many cutouts are in the vase\r\ncharmCount = 26;\r\n\r\nspursCharmStl = \"..\/shapes\/spurs\/spurs-a.stl\";\r\nspursCharmXYScale = 0.2; \/\/ spur scale\r\nspursCharmDepthScale = 20.2; \/\/ oshw depth scale\r\n\r\noshwCharmStl = \"..\/shapes\/oshw\/oshw.stl\";\r\noshwCharmXYScale = 0.7;\r\noshwCharmDepthScale = 40.2;\r\n\r\nstarCharmStl = \"..\/shapes\/star\/star.stl\";\r\nstarCharmXYScale = 0.7;\r\nstarCharmDepthScale = 40.2;\r\n\r\ncharmStls = [\r\n spursCharmStl,\r\n oshwCharmStl,\r\n starCharmStl\r\n ];\r\n\r\ncharmXYScales = [\r\n spursCharmXYScale,\r\n oshwCharmXYScale,\r\n starCharmXYScale\r\n ];\r\n \r\ncharmDepthScales = [\r\n spursCharmDepthScale,\r\n oshwCharmDepthScale,\r\n starCharmDepthScale\r\n ];\r\n\r\n\r\nuniqueCharmCount = len(charmStls);\r\n\r\ncharmIndex = -1;\r\n\r\nrandomSeed = 2789676;\r\nrandomSeed = rands(0,987654, 1)[0];\r\n\r\nmaxRandom = uniqueCharmCount - 1;\r\nrandomCharmIndcies = rands(0,maxRandom, charmCount, randomSeed);\r\n\r\ndifference()\r\n{\r\n \/\/ vase\r\n difference()\r\n {\r\n \/\/ outer vase\r\n translate([0,0,0])\r\n cylinder (h = vaseHeight, r=55, $fn=100);\r\n \r\n \/\/ remvoed inner vase centered\r\n translate([0,0,5])\r\n cylinder (h = vaseHeight, r=54, $fn=100);\r\n }\r\n \r\n y = 30;\r\n\r\n \/\/ lucky charms!\r\n for( i = [0 : charmCount] )\r\n {\r\n single_rand = randomCharmIndcies[i];\r\n\/\/ single_rand = rands(0,2,1)[0];\r\n\/\/\t\tsingle_rand = rands(0,2,1, randomSeed)[0];\r\n\t\t\r\n charmIndex = round(single_rand);\r\n \r\n\/\/echo(charmIndex);\r\n \r\n rotate([\r\n 90, \r\n 0,\r\n i * 38\r\n ])\r\n\r\n \/\/ normally x,y,z - but here y moves the charms up and down\r\n translate([15, 5 * i, 30])\r\n scale([charmXYScales[charmIndex],\r\n charmXYScales[charmIndex], \r\n charmDepthScales[charmIndex]\r\n ])\r\n import(charmStls[charmIndex]);\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"21149c0c04be9a79d96d69b5a4d6e96c372472ec","subject":"rod-clamps: use hull","message":"rod-clamps: use hull\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10*mm, screw_dist=undef, screw_h=10*mm, width=4, thick=undef, base_thick=undef, thread=ThreadM4, nut=NutHexM4, align=N, orient=Z, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n hull()\n {\n \/\/ cylinder around rod\n difference()\n {\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*3.5+.1, width+1], align=[-1,0,0]);\n }\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*3.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, nut=nut, h=screw_h, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10*mm, screw_dist=undef, screw_h=10*mm, width=4, thick=undef, base_thick=undef, thread=ThreadM4, nut=NutHexM4, align=N, orient=Z, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n hull()\n {\n \/\/ cylinder around rod\n difference()\n {\n tx(rod_d\/2)\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=-X);\n }\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, nut=nut, h=screw_h, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","old_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10*mm, screw_dist=undef, screw_h=10*mm, width=4, thick=undef, base_thick=undef, thread=ThreadM4, nut=NutHexM4, align=N, orient=Z, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n difference()\n {\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n }\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, nut=nut, h=screw_h, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10*mm, screw_dist=undef, screw_h=10*mm, width=4, thick=undef, base_thick=undef, thread=ThreadM4, nut=NutHexM4, align=N, orient=Z, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n difference()\n {\n tx(rod_d\/2)\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=-X);\n }\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, nut=nut, h=screw_h, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ba2282180cbdae1a37f92b3eedab76a48b3bf4c8","subject":"rodclamps: minor cleanup","message":"rodclamps: minor cleanup\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=-X);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","old_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, head=\"button\", orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n \/*%size_align(size=s, align=align, orient=orient, orient_ref=Z)*\/\n \/*translate(pos_offset)*\/\n \/*translate([rod_d\/2,0,0])*\/\n \/*translate(-clamp_tolerance*X)*\/\n \/*cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);*\/\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ebeea1628bcb1e78d7a523f72ec3c969a714e81b","subject":"A little implementation was added.","message":"A little implementation was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/shapes\/dialog-bubble\/samples\/stencil\/stencil-dialog-bubble.scad","new_file":"openscad\/models\/src\/main\/openscad\/shapes\/dialog-bubble\/samples\/stencil\/stencil-dialog-bubble.scad","new_contents":"\nuse <..\/..\/dialog-bubble.scad>\n\nmodule stencilDialogBubble()\n{\n\tdifference()\n\t{\n\t\tdialogBubble(yLength = 15);\n\n\t\tstencilDialogBubble_lines();\n\t}\n}\n\nmodule stencilDialogBubble_lines()\n{\n\t\n}\n","old_contents":"\nuse <..\/..\/dialog-bubble.scad>\n\ndialogBubble(yLength = 15);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f3f91f00a63d0e9e467a19155787c7deff21dcf7","subject":"recess lower tabs a bit","message":"recess lower tabs a bit\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b12bce30ffa0c2c53440e7fd87eed7f544558c17","subject":"xaxis\/extruder\/guidler: fix some tolerances\/bugs","message":"xaxis\/extruder\/guidler: fix some tolerances\/bugs\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height_body], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height_body], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height_body], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height_body], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"bbc5dbdc51a16815991b761b804780721a127992","subject":"x\/carriage: add 20t extruder gear","message":"x\/carriage: add 20t extruder gear\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"79b5714b59e1ac87d92767e18c2b7ba8ad25237e","subject":"fixup! submodules\/libutils: Update (for rcube rename)","message":"fixup! submodules\/libutils: Update (for rcube rename)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n base_cut = -rod_d\/2 + clamp_tolerance;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n translate([base_cut,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([base_cut,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","old_contents":"include \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n base_cut = -rod_d\/2 + clamp_tolerance;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n translate([base_cut,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([base_cut,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c1d87d5ba78dd66eb319a9101b0a6b84abb4cba8","subject":"Update, improved tilt servo support","message":"Update, improved tilt servo support\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/camPi.scad","new_file":"hardware\/camPi.scad","new_contents":"$fn = 150;\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\n\/\/ RPi supports does not touch the bottom of the case\ninclude ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoX = 11.8;\nservoY = 22.2;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nservoClerance = 31 - 16 - servoHornThickness;\neccentricity = 22.2 \/ 2 - 5;\nservoBodySupport = 20;\n\n\nscrewDiam = 3;\nscrewLenght = 10;\nscrewTolerance = 0.3;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLength = Pilength + 8;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\nboxThickness = 1;\ntopCoverHeight = 15;\n\nservoPanZ = boxHeight - 20 + topCoverHeight - servoClerance;\nservoPanBoxX = (servoX - 2 * boxThickness - tolerance);\nservoPanBoxThickness = 2;\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\n\n\/\/---------------------------------------\nmodule panSupport() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y transaltion if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\/\/--------------------------------------- \n\/\/This was the verion for RPi v1\nmodule panSupportOLD() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y transaltion if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\nmodule miscroServoSupport() {\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n }\n\n }\n\n}\n\n\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n }\n }\n\n\/\/Baseplate for pan mechanism\nmodule base(servo) {\n difference() {\n\n {\n minkowski() {\n cylinder(r = R + mik, h = supportBaseHeight);\n rotate([90, 0, 0]) cylinder(r = mik, h = 1);\n }\n\n \/\/This to create a anchoring mechanism with the pan base\n \/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n }\n if (servo == true) {\n translate([0, 0, -supportZ - servoHornThickness - mik]) rotate([0, 90, 0]) servoHorn(\"cross\");\n cylinder(r = 2.5, h = 15, center = true);\n }\n }\n }\n \/\/-------------------------\n \/\/\t\t\t\ttranslate([0, 0, -supportZ - servoHornThickness-mik])rotate([0, 90, 0])servoHorn(\"cross\");\n\nmodule supportSection() {\n intersection() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n translate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n }\n }\n \/\/-------------------------\n\nmodule tiltSupport()\n \/\/This creates the supporting pillar for the camera shell\n {\n union() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n translate([-gimballWidth, 0, 0]) cube([2 * gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n\n hull() {\n translate([0, 0, -5]) supportSection();\n translate([0, 0, -supportZ]) supportSection();\n }\n }\n\n }\n\n\nmodule servoTiltSupport(xPos, Pos) {\n \/\/Need to center the servo shaft, the second figure is the distance form border\n supportPosition = xPos;\n \/\/Need to adjust the clearance to account for the Xpos\n supportCurvature = 30;\n\n rotate([-0, 0, 0]) difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 0]) {\n cube([shellThickness, 20, 1.8 * RatX(gimballWidth \/ 2)], center = true);\n }\n\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 15]) cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\n\n \/\/The size of the sphere governs where the servo support will be cut. Need to add tolerance if you whant to print as one piece with the shell.\n sphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n }\n }\n\n \n translate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n\n }\n }\n\n \/\/This is the slot in the servo arm\n translate([servoClerance + 10, 0, eccentricity]) {\n cube([20 + 1, 12, 32.2 + 1], center = true);\n translate([-31 \/ 2, 0, 0]) cube([31 + 1, 12, 22.2 + 1], center = true);\n\n }\n }\n\n \/\/This is the curved extra support for the connection with the gimball internal shell\n translate([0, 0, 0])SUB_tiltwedge(xPos);\n mirror([0,0,1])translate([0, 0, 0])SUB_tiltwedge(xPos);\n\n \n \n\n }\n\n \/\/-------------------------\n\nmodule SUB_tiltwedge(xPos) {\n supportCurvature = 30;\n\t\n difference() {\n translate([12, 0, +RatX(xPos) - 10])\n difference() {\n cube([16, 20, 20], center = true);\n translate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20, center=true);\n\n }\n\n difference() {\n sphere(RatX(gimballWidth \/ 2) + 10 * shellThickness + tolerance);\n\n sphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n }\n\n\n }\n\n}\n\n\nmodule cameraSupport() {\n difference() {\n difference() {\n sphere(R);\n sphere(R - shellThickness);\n }\n\n translate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n translate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n \/\/Creates camera support\n translate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n translate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n \/\/Slot for camera wires\n translate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n \/\/Hole for the camera\n translate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + tolerance, 10, PIcameraDiam + tolerance], center = true);\n\t\ttranslate([PIcameraX\/2-2, 0.9*R, PIcameraY\/2-2])rotate([90,0,0])cylinder(r=1.2,h=10, center=true);\n\t\ttranslate([-(PIcameraX\/2-2), 0.9*R, PIcameraY\/2-2])rotate([90,0,0])cylinder(r=1.2,h=10, center=true);\n\t\ttranslate([PIcameraX\/2-2, 0.9*R, -(PIcameraY\/2-2)])rotate([90,0,0])cylinder(r=1.2,h=10, center=true);\n\t\ttranslate([-(PIcameraX\/2-2), 0.9*R, -(PIcameraY\/2-2)])rotate([90,0,0])cylinder(r=1.2,h=10, center=true); }\n\n \/\/Need to hardwire the servo dimensions\n\n {\n servoTiltSupport(gimballWidth\/2, \"tilt\");\n\n\n }\n \/\/pivot mechanism\n translate([-gimballWidth \/ 2, 0, 0]) {\n difference() {\n rotate([0, 90, 0]) cylinder(r = panSupport, h = shellThickness);\n gimballPivot(1);\n rotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n }\n gimballPivot(1);\n }\n }\n \n \/\/-------------------------\n\nmodule servoHorn(type) {\n cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n if (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n }\n \/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n rotate([0, 90, 0])\n difference() {\n cylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n cylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n }\n }\n \/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance) \/ R;\n\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n translate([gimballWidth \/ 2, 0, 0]) rotate([0, 90, 0]) cylinder(r = 2.5, h = 30);\n\n }\n\n \/\/Need to cut holes in the base for servo and camera cables and the screws\n translate([0, 0, -supportBaseHeight \/ 2])\n difference() {\n\n {\n color(\"blue\", 0.5) translate([0, 0, -supportZ - supportBaseHeight]) base(true);\n translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n SUB_cameracableDuct();\n translate([0, 0, +supportBaseHeight \/ 2]) mirror([1, 0, 0]) tiltSupport();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, 0]) rotate([0, 0, 180])\n SUB_servocableDuct();\n\n }\n\n }\n\n}\n\n\nmodule mountedPillar() {\n \/\/Pillar for camera. This one needs to be mounted separately\n difference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, -supportX \/ 2]) rotate([0, 0, 180])\n SUB_servocableDuct();\n }\n\n }\n\n\n}\n\nmodule SUB_screw(tolerance) {\n cylinder(r = screwDiam \/ 2 + tolerance, h = screwLenght);\n translate([0, 0, -3]) cylinder(r = 2 * screwDiam \/ 2 + screwTolerance, h = 4);\n}\n\nmodule SUB_mountedPillarScrewHoles() {\n color(\"blue\", 0.5) translate([-R + supportX \/ 2 + 2, 0, -supportZ - screwLenght \/ 2]) {\n translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n mirror([0, 1, 0]) translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n }\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 3, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 3, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 180]) cylinder(r = supportX \/ 3, h = 0.6 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct() {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n }\n \/\/---------------------------\n\n\n\n\nmodule connectionSocket() {\n\n cylinder(r = 3, h = 5);\n translate([-9, -3 \/ 2, 0]) cube([10, 3, 5]);\n\n}\n\nmodule PiSupport() {\n difference() {\n translate([0,0,1])cube([4 + 3 \/ 2 - 0.4, 4 + 3 \/ 2 - 0.2, 8], center = true);\n cylinder(r = 3 \/ 2 - 0.2, h = 2 * Piheight + 8, $fs = 0.1);\n }\n\n}\n\n\n\nmodule case () {\n translate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n difference() {\n minkowski() {\n box(boxLength, boxDepth, boxHeight, boxThickness, \"PI\");\n \/\/sphere(r = mik);\n cylinder(r = mik, h = 2);\n }\n translate([R - 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([R - 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n\n translate([0, 0, -boxHeight \/ 2 - 5 \/ 2]) cylinder(r = 3, h = 5);\n\n\ntranslate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 5 + shellThickness]) {\n rpi();\n }\n\/\/This is the power inlet. The +6 in z is half the z-lenght of the component\ntranslate([-boxLength\/2,-boxDepth\/2+8,-boxHeight\/2+shellThickness+2*mik+tolerance])cube([15+tolerance,9+tolerance,12], center=true);\n\n }\n translate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 1 + shellThickness]) {\ntranslate ([Pilength-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-3.5, -0+3.5,-0.1]) PiSupport();\ntranslate ([Pilength-58-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-58, 0+3.5,-0.1]) PiSupport();\n \/\/translate([25.5, 18, 0]) PiSupport();\n \/\/translate([Pilength - 5, Piwidth - 12.5, 0]) PiSupport();\n\n }\n\n\n }\ntranslate([-boxLength\/2+15\/2+mik,-boxDepth\/2+8,-supportZ-boxHeight-4])rotate([0,0,180])SUB_Power();\n \n}\n\nmodule topLid() {\n tolerance = 0.02;\n\n difference() {\n difference() {\n {\n minkowski() {\n translate([0, 0, -supportZ - supportBaseHeight - topCoverHeight \/ 2]) cube([boxLength + mik - 1, boxDepth + mik - 1, topCoverHeight], center = true);\n sphere(r = mik); \/\/cylinder(r = mik, h = 2);\n }\n translate([0, 0, -supportZ - supportBaseHeight]) {\n scale([1 + tolerance, 1 + tolerance, 1]) base(\"false\");\n scale([0.9, 0.9, 30]) base(\"false\");\n\n \/\/This is the grid an hole for mic.need to re-work the placement definition as it will not work for other box dimensions!!!\n translate([boxLength \/ 2 - 5 - mik - boxThickness, -(boxDepth \/ 2 - 5 - mik - boxThickness), +14 - supportBaseHeight - topCoverHeight \/ 2]) rotate([0, 180, 0]) SUB_Mic();\n\n }\n\t\n }\n\t\n }\n\t\n\n\n\n case ();\n\n }\n\n\/\/Need to explain the -1.4*supportBaseHeight\ndifference(){\ntranslate([0,0,-supportZ-1.4*supportBaseHeight])rotate([0,-90,90])testSupport();\n case ();\n\n}\n\n}\n\nmodule SUB_Mic() {\n translate([-7, 0, 0]) for (i = [1: 6]) {\n translate([i * 2, 0, 0]) cube([1, 10, 2], center = true);\n }\n cylinder(r = 5, h = 2 * topCoverHeight);\n\n}\n\nmodule SUB_Power(){\n\tdifference(){\t\n\t\tcube([15,9+3,12], center=true);\n\t\ttranslate([2,0,2])cube([15+tolerance,9+tolerance,12], center=true);\n\t}\n}\nmodule assembly(view) \n{\n\nspace = (view == \"explode\") ? 20 : 0;\n\ntranslate([-space,0,0])cameraSupport();\ntranslate([0,0,-space])support();\ntranslate([-3*space,0,0])mountedPillar();\ntranslate([0,0,-3*space])topLid();\n\n\n\/\/translate([0,0,-4*space-1.5*supportZ])panSupport();\ntranslate([0,0,-6*space])case ();\n\n}\n\n\n\/\/-------------------------------\nmodule testSupport(xPos, Pos) {\n \/\/Need to center the servo shaft, the seconf figure is the distance form border\n eccentricity = 22.2 \/ 2 - 5;\n servoBodySupport = 25;\n \/\/Need to adjust the clearance to account for the Xpos\n\t\tarmLenght = 1.4*(boxDepth\/2);\n difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2, 0, 15]) {\n cube([shellThickness, servoBodySupport, armLenght], center = true);\n }\n\t\t\t\t\t\n }\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n }\n }\n\n \/\/This is the slot in the servo arm. Need to check why -15 in the translate is needed\ntranslate([-(11)+(32.2\/2+12\/2+tolerance\/2)-15, 0, eccentricity]) {\n\n cube([20 + tolerance, 12+tolerance\/2, 32.2 + tolerance], center = true);\n translate([-31\/2, 0, 0]) cube([31 + tolerance, 12+tolerance\/2, 22.2 + tolerance], center = true);\n\n }\n \n\n\n}\t\n\n\/\/Dimensions are hardwired, should be parameters!!!\n\t\ttranslate([-10,0,+armLenght\/2+15])rotate([270,0,0])linear_extrude(height = servoBodySupport, center = true, convexity = 10, twist = 0)\n\t\t\t\/\/polygon([[0,0],[8,20],[10,0]], convexity = N);\n polygon([[0,0],[10,armLenght\/3],[10,0]], convexity = N);\n \t\n}\n\n\/\/-------------------------\n\n\n\/\/assembly(\"explode\");\n\/\/case();\n\/\/topLid();\n\/\/SUB_Power();\n\n\/\/mountedPillar();\n\nservoTiltSupport(gimballWidth\/2, \"tilt\");\n\n\/\/cameraSupport();","old_contents":"$fn = 50;\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\n\/\/ RPi supports does not touch the bottom of the case\ninclude ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoX = 11.8;\nservoY = 22.2;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nservoClerance = 31 - 16 - servoHornThickness;\neccentricity = 22.2 \/ 2 - 5;\nservoBodySupport = 20;\n\n\nscrewDiam = 3;\nscrewLenght = 10;\nscrewTolerance = 0.3;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLength = Pilength + 8;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\nboxThickness = 1;\ntopCoverHeight = 15;\n\nservoPanZ = boxHeight - 20 + topCoverHeight - servoClerance;\nservoPanBoxX = (servoX - 2 * boxThickness - tolerance);\nservoPanBoxThickness = 2;\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\n\n\/\/---------------------------------------\nmodule panSupport() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y transaltion if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\/\/--------------------------------------- \n\/\/This was the verion for RPi v1\nmodule panSupportOLD() {\n \/\/rotate([0,270,0])servoTiltSupport(15,\"pan\");\n difference() {\n union() {\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth, d2 = servoY + 2 * servoPanBoxThickness, center = true);\n \/\/Creates bottom support blocks add -mik to y transaltion if you want to zero the mechanical interference\n translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n mirror([0, 1, 0]) translate([0, boxDepth \/ 2 - 20 \/ 2 - mik, -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 20, 10], center = true);\n }\n\n \/\/Cuts the support from a cylinder\n translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n mirror(1, 0, 0) translate([boxHeight \/ 2 + (servoX - 2 * boxThickness - tolerance), 0, 0]) cube([boxHeight, boxDepth + 10, boxHeight - 20 + topCoverHeight - servoClerance], center = true);\n\n color(\"blue\", 0.5) multmatrix(m = [\n [1, 0, 0, 0],\n [0, 1, 0.4, 0],\n [0, 0, 1, 0],\n [0, 0, 0, 1]\n ]) cylinder(h = servoPanZ, d1 = boxDepth - 10, d2 = servoY - 10, center = true);\n\n \/\/Cuts the support to fit case\n translate([0, +eccentricity, 10]) cube([servoPanBoxX + servoPanBoxThickness + 4, servoY + servoPanBoxThickness + 1.5, 20], center = true);\n translate([0, -(boxDepth \/ 2 + 10 - mik), -servoPanZ \/ 2 + 5]) cube([boxHeight \/ 2 + servoPanBoxX, 20, 10], center = true);\n\n \/\/Slot for video\n translate([0, boxDepth \/ 2 - 10, -servoPanZ \/ 2 + 5]) rotate([90, 0, 0]) scale([1.2, 1.5, 1]) cube([8, 20, 20], center = true);\n\n }\n rotate([0, 90, 90]) translate([3.25, 0, 0]) miscroServoSupport();\n\n}\n\n\nmodule miscroServoSupport() {\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n }\n\n }\n\n}\n\n\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n }\n }\n\n\/\/Baseplate for pan mechanism\nmodule base(servo) {\n difference() {\n\n {\n minkowski() {\n cylinder(r = R + mik, h = supportBaseHeight);\n rotate([90, 0, 0]) cylinder(r = mik, h = 1);\n }\n\n \/\/This to create a anchoring mechanism with the pan base\n \/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n }\n if (servo == true) {\n translate([0, 0, -supportZ - servoHornThickness - mik]) rotate([0, 90, 0]) servoHorn(\"cross\");\n cylinder(r = 2.5, h = 15, center = true);\n }\n }\n }\n \/\/-------------------------\n \/\/\t\t\t\ttranslate([0, 0, -supportZ - servoHornThickness-mik])rotate([0, 90, 0])servoHorn(\"cross\");\n\nmodule supportSection() {\n intersection() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n translate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n }\n }\n \/\/-------------------------\n\nmodule tiltSupport()\n \/\/This creates the supporting pillar for the camera shell\n {\n union() {\n difference() {\n sphere(R);\n cube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n translate([-gimballWidth, 0, 0]) cube([2 * gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n }\n\n hull() {\n translate([0, 0, -5]) supportSection();\n translate([0, 0, -supportZ]) supportSection();\n }\n }\n\n }\n\n\nmodule servoTiltSupport(xPos, Pos) {\n \/\/Need to center the servo shaft, the second figure is the distance form border\n supportPosition = xPos;\n \/\/Need to adjust the clearance to account for the Xpos\n supportCurvature = 30;\n\n rotate([-0, 0, 0]) difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 15]) {\n cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n }\n\n if (Pos == \"tilt\") {\n difference() {\n translate([-shellThickness \/ 2 + supportPosition, 0, 15]) cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\n\n \/\/The size of the sphere governs where the servo support will be cut. Need to add tolerance if you whant to print as one piece with the shell.\n sphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n }\n }\n\n }\n\n translate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n \/\/cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n }\n\n }\n }\n\n \/\/This is the slot in the servo arm\n translate([servoClerance + 10, 0, eccentricity]) {\n cube([20 + 1, 12, 32.2 + 1], center = true);\n translate([-31 \/ 2, 0, 0]) cube([31 + 1, 12, 22.2 + 1], center = true);\n\n }\n }\n\n \/\/This is the curved extra support for the connection with the gimball internal shell\n if (Pos == \"tilt\") {\n translate([0, 0, 0])\n difference() {\n translate([3, 0, +RatX(xPos) - 10])\n difference() {\n cube([20, 20, 20], center = true);\n translate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20);\n\n }\n\n difference() {\n sphere(RatX(gimballWidth \/ 2) + 10 * shellThickness + tolerance);\n\n sphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n }\n\n\n }\n }\n\n \/\/Dimensions are hardwired, should be parameters!!!\n\n if (Pos == \"pan\") {\n\n translate([2 * shellThickness - 1, 0, 45]) rotate([270, 0, 0]) linear_extrude(height = servoBodySupport, center = true, convexity = 10, twist = 0)\n polygon([\n [0, 0],\n [8, 20],\n [10, 0]\n ], convexity = N);\n mirror([0, 0, 1]) translate([2 * shellThickness - 1, 0, 45]) rotate([270, 0, 0]) linear_extrude(height = servoBodySupport, center = true, convexity = 10, twist = 0) polygon([\n [0, 0],\n [7, 28],\n [10, 30],\n [10, 0]\n ], convexity = N);\n\n }\n\n }\n \/\/-------------------------\nmodule cameraSupport() {\n difference() {\n difference() {\n sphere(R);\n sphere(R - shellThickness);\n }\n\n translate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n translate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n \/\/Creates camera support\n translate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n translate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n \/\/Slot for camera wires\n translate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n \/\/Hole for the camera\n translate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + tolerance, 10, PIcameraDiam + tolerance], center = true);\n }\n\n \/\/Need to hardwire the servo dimensions\n\n {\n servoTiltSupport(15, \"tilt\");\n\n\n }\n \/\/pivot mechanism\n translate([-gimballWidth \/ 2, 0, 0]) {\n difference() {\n rotate([0, 90, 0]) cylinder(r = panSupport, h = shellThickness);\n gimballPivot(1);\n rotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n }\n gimballPivot(1);\n }\n }\n \/\/-------------------------\n\nmodule servoHorn(type) {\n cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n if (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n }\n \/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n rotate([0, 90, 0])\n difference() {\n cylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n cylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n }\n }\n \/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance) \/ R;\n\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n translate([gimballWidth \/ 2, 0, 0]) rotate([0, 90, 0]) cylinder(r = 2.5, h = 30);\n\n }\n\n \/\/Need to cut holes in the base for servo and camera cables and the screws\n translate([0, 0, -supportBaseHeight \/ 2])\n difference() {\n\n {\n color(\"blue\", 0.5) translate([0, 0, -supportZ - supportBaseHeight]) base(true);\n translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n SUB_cameracableDuct();\n translate([0, 0, +supportBaseHeight \/ 2]) mirror([1, 0, 0]) tiltSupport();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, 0]) rotate([0, 0, 180])\n SUB_servocableDuct();\n\n }\n\n }\n\n}\n\n\nmodule mountedPillar() {\n \/\/Pillar for camera. This one needs to be mounted separately\n difference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n SUB_mountedPillarScrewHoles();\n translate([-gimballWidth \/ 2 - supportX \/ 2, 0, -supportX \/ 2]) rotate([0, 0, 180])\n SUB_servocableDuct();\n }\n\n }\n\n\n}\n\nmodule SUB_screw(tolerance) {\n cylinder(r = screwDiam \/ 2 + tolerance, h = screwLenght);\n translate([0, 0, -3]) cylinder(r = 2 * screwDiam \/ 2 + screwTolerance, h = 4);\n}\n\nmodule SUB_mountedPillarScrewHoles() {\n color(\"blue\", 0.5) translate([-R + supportX \/ 2 + 2, 0, -supportZ - screwLenght \/ 2]) {\n translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n mirror([0, 1, 0]) translate([0, 0.5 * panSupport, 0]) SUB_screw(-screwTolerance);\n }\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 3, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 3, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 180]) cylinder(r = supportX \/ 3, h = 0.6 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct() {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n }\n \/\/---------------------------\n\n\n\n\nmodule connectionSocket() {\n\n cylinder(r = 3, h = 5);\n translate([-9, -3 \/ 2, 0]) cube([10, 3, 5]);\n\n}\n\nmodule PiSupport() {\n difference() {\n translate([0,0,1])cube([4 + 3 \/ 2 - 0.4, 4 + 3 \/ 2 - 0.2, 8], center = true);\n cylinder(r = 3 \/ 2 - 0.2, h = 2 * Piheight + 8, $fs = 0.1);\n }\n\n}\n\n\n\nmodule case () {\n translate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n difference() {\n minkowski() {\n box(boxLength, boxDepth, boxHeight, boxThickness, \"PI\");\n \/\/sphere(r = mik);\n cylinder(r = mik, h = 2);\n }\n translate([R - 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, -Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([R - 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n translate([-R + 10, Piwidth \/ 2, -boxHeight \/ 2 - 5 \/ 2]) connectionSocket();\n\n translate([0, 0, -boxHeight \/ 2 - 5 \/ 2]) cylinder(r = 3, h = 5);\n\n\ntranslate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 5 + shellThickness]) {\n rpi();\n }\n\/\/This is the power inlet. The +6 in z is half the z-lenght of the component\ntranslate([-boxLength\/2,-boxDepth\/2+8,-boxHeight\/2+shellThickness+2*mik+tolerance])cube([15+tolerance,9+tolerance,12], center=true);\n\n }\n translate([-Pilength \/ 2, -16, -boxHeight \/ 2 + 1 + shellThickness]) {\ntranslate ([Pilength-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-3.5, -0+3.5,-0.1]) PiSupport();\ntranslate ([Pilength-58-3.5, Piwidth-3.5,-0.1]) PiSupport(); \ntranslate ([Pilength-58, 0+3.5,-0.1]) PiSupport();\n \/\/translate([25.5, 18, 0]) PiSupport();\n \/\/translate([Pilength - 5, Piwidth - 12.5, 0]) PiSupport();\n\n }\n\n\n }\ntranslate([-boxLength\/2+15\/2+mik,-boxDepth\/2+8,-supportZ-boxHeight-4])rotate([0,0,180])SUB_Power();\n \n}\n\nmodule topLid() {\n tolerance = 0.02;\n\n difference() {\n difference() {\n {\n minkowski() {\n translate([0, 0, -supportZ - supportBaseHeight - topCoverHeight \/ 2]) cube([boxLength + mik - 1, boxDepth + mik - 1, topCoverHeight], center = true);\n sphere(r = mik); \/\/cylinder(r = mik, h = 2);\n }\n translate([0, 0, -supportZ - supportBaseHeight]) {\n scale([1 + tolerance, 1 + tolerance, 1]) base(\"false\");\n scale([0.9, 0.9, 30]) base(\"false\");\n\n \/\/This is the grid an hole for mic.need to re-work the placement definition as it will not work for other box dimensions!!!\n translate([boxLength \/ 2 - 5 - mik - boxThickness, -(boxDepth \/ 2 - 5 - mik - boxThickness), +14 - supportBaseHeight - topCoverHeight \/ 2]) rotate([0, 180, 0]) SUB_Mic();\n\n }\n\t\n }\n\t\n }\n\t\n\n\n\n case ();\n\n }\n\n\/\/Need to explain the -1.4*supportBaseHeight\ndifference(){\ntranslate([0,0,-supportZ-1.4*supportBaseHeight])rotate([0,-90,90])testSupport();\n case ();\n\n}\n\n}\n\nmodule SUB_Mic() {\n translate([-7, 0, 0]) for (i = [1: 6]) {\n translate([i * 2, 0, 0]) cube([1, 10, 2], center = true);\n }\n cylinder(r = 5, h = 2 * topCoverHeight);\n\n}\n\nmodule SUB_Power(){\n\tdifference(){\t\n\t\tcube([15,9+3,12], center=true);\n\t\ttranslate([2,0,2])cube([15+tolerance,9+tolerance,12], center=true);\n\t}\n}\nmodule assembly(view) \n{\n\nspace = (view == \"explode\") ? 20 : 0;\n\ntranslate([-space,0,0])cameraSupport();\ntranslate([0,0,-space])support();\ntranslate([-3*space,0,0])mountedPillar();\ntranslate([0,0,-3*space])topLid();\n\n\n\/\/translate([0,0,-4*space-1.5*supportZ])panSupport();\ntranslate([0,0,-6*space])case ();\n\n}\n\n\n\/\/-------------------------------\nmodule testSupport(xPos, Pos) {\n \/\/Need to center the servo shaft, the seconf figure is the distance form border\n eccentricity = 22.2 \/ 2 - 5;\n servoBodySupport = 25;\n \/\/Need to adjust the clearance to account for the Xpos\n\t\tarmLenght = 1.4*(boxDepth\/2);\n difference() {\n\n union() {\n\n difference() {\n translate([-shellThickness \/ 2, 0, 15]) {\n cube([shellThickness, servoBodySupport, armLenght], center = true);\n }\n\t\t\t\t\t\n }\n\n translate([-servoBodySupport \/ 2, 0, eccentricity]) {\n \/\/This is the servo box\n difference() {\n cube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n cube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n \/\/Servo cable slot\n translate([0, 0, -2 * eccentricity]) cube([100, 4, 4], center = true);\n\n }\n\n }\n }\n\n \/\/This is the slot in the servo arm. Need to check why -15 in the translate is needed\ntranslate([-(11)+(32.2\/2+12\/2+tolerance\/2)-15, 0, eccentricity]) {\n\n cube([20 + tolerance, 12+tolerance\/2, 32.2 + tolerance], center = true);\n translate([-31\/2, 0, 0]) cube([31 + tolerance, 12+tolerance\/2, 22.2 + tolerance], center = true);\n\n }\n \n\n\n}\t\n\n\/\/Dimensions are hardwired, should be parameters!!!\n\t\ttranslate([-10,0,+armLenght\/2+15])rotate([270,0,0])linear_extrude(height = servoBodySupport, center = true, convexity = 10, twist = 0)\n\t\t\t\/\/polygon([[0,0],[8,20],[10,0]], convexity = N);\n polygon([[0,0],[10,armLenght\/3],[10,0]], convexity = N);\n \t\n}\n\n\/\/-------------------------\n\n\n\/\/assembly(\"explode\");\n\/\/case();\ntopLid();\n\/\/SUB_Power();\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2801a7f3d4b071b84acf01ec0f15d89c42d3a905","subject":"GUANIN","message":"GUANIN","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Guanin.scad","new_file":"3D-models\/SCAD\/Guanin.scad","new_contents":"\/\/\u0413\u0443\u0430\u043d\u0438\u043d \nx=50; \ny=19; \nz=7;\nz2=2.5; \/\/\u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439\n\/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0413\u0443\u0430\u043d\u0438\u043d \ndifference(){\n union(){ \ndifference() { \ncolor(\"Red\") cube ([x+10, y, z], center=true);\n #rotate([0, 90, 0]) translate([0, 4.5, 26.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 26.5]) cylinder(9, 2.65, 2.65); \n} \n\n#color(\"Red\") translate ([-29, y\/200000, -3.5]) cylinder (z, y\/2, y\/2);\n} \n#rotate([90, 0, 90]) translate([0, 0, -44.4]) cylinder(9, 2.65, 2.65);\n\n#translate([-3, 0, 2.5]) cube([40, 21, 4.85], center=true);\n\n} \nrotate([90, 0, 0]) color(\"red\") translate([-23, 0, -9.5]) cylinder(19, 3.5, 3.5);\nrotate([90, 0, 0]) color(\"red\") translate([17.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0413\ntranslate([-6, -6, 0,]) cube([6, 2, 2]);\ntranslate([0, -6, 0,]) cube([2, 12, 2]);\n \n \n \n \n","old_contents":"x=50; \ny=19; \nz=7;\nz2=2.5; \/\/\u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439\n\/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0413\u0443\u0430\u043d\u0438\u043d \ndifference(){\n union(){ \ndifference() { \ncolor(\"Red\") cube ([x+10, y, z], center=true);\n #rotate([0, 90, 0]) translate([0, 4.5, 26.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 26.5]) cylinder(9, 2.65, 2.65); \n} \n\n#color(\"Red\") translate ([-29, y\/200000, -3.5]) cylinder (z, y\/2, y\/2);\n} \n#rotate([90, 0, 90]) translate([0, 0, -44.4]) cylinder(9, 2.65, 2.65);\n\n#translate([-3, 0, 2.5]) cube([40, 21, 4.85], center=true);\n\n} \nrotate([90, 0, 0]) color(\"red\") translate([-23, 0, -9.5]) cylinder(19, 3.5, 3.5);\nrotate([90, 0, 0]) color(\"red\") translate([17.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0413\ntranslate([-6, -6, 0,]) cube([6, 2, 2]);\ntranslate([0, -6, 0,]) cube([2, 12, 2]);\n \n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ed16dea8b6fadd01d2de7c1cd482c5238dc91f42","subject":"h=2.5mm + loop for printing multiple elements at once","message":"h=2.5mm + loop for printing multiple elements at once\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"module wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\nmodule support()\n{\n w=119;\n s=21;\n h=2.5;\n\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n}\n\nfor(i=[0:0])\n translate(i*[25, 0, 0])\n support(2.5);\n","old_contents":"module wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\nmodule support()\n{\n h=4;\n w=119;\n s=21;\n\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n}\n\nsupport();\n\ntranslate([-5, 0, 0])\n rotate([0, -90, 0])\n support();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f48fa56fef72dbc9492f1e809a23654a552d3dfa","subject":"screws: add support for square nuts","message":"screws: add support for square nuts\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n assert(h>0);\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n assert(nut_facets>=4, \"screw_nut: nut_facets < 4 is not supported\");\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n echo(nut_facets);\n if(nut_facets==4)\n {\n cubea([nut_dia,nut_dia,h_]);\n }\n else\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n }\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n nut_facets = get(NutFacets, nut);\n assert(nut_facets>=4, \"screw_nut: nut_facets < 4 is not supported\");\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n if(nut_facets==4)\n {\n cubea([nut_dia+2*mm,nut_dia+2*mm, h], align=-Z);\n }\n else\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = get(NutFacets, nut) > 4 ?\n 2*nut_radius(nut) :\n get(NutWidthMax, nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, cut_screw_close=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n screw_min_nut_dist = 2*mm;\n assert(screw_l+screw_offset >= trap_offset, \"nut_trap_cut: screw_l+screw_offset < trap_offset\");\n assert(screw_offset-trap_offset <= -screw_min_nut_dist, \"nut_trap_cut: screw_offset-trap_offset > -screw_min_nut_dist\");\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n if(cut_screw_close)\n {\n tz(-nut_h\/2)\n tz(-screw_min_nut_dist)\n tz(trap_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n else\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n if(nut_facets==4)\n {\n cubea([nut_dia,nut_dia,h_]);\n }\n else\n {\n rz(30)\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nif(false)\n{\n nut1 = NutHexM5;\n stack(dist=10,axis=X)\n {\n $show_vit=true;\n $preview_mode=true;\n #screw(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=false, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=true, orient=-Z, align=-Z);\n #screw(nut=nut1, h=20, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=25, screw_offset=-5, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, cut_screw_close=true, orient=-Z, align=-Z);\n }\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n assert(h>0);\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, cut_screw_close=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n screw_min_nut_dist = 2*mm;\n assert(screw_l+screw_offset >= trap_offset, \"nut_trap_cut: screw_l+screw_offset < trap_offset\");\n assert(screw_offset-trap_offset <= -screw_min_nut_dist, \"nut_trap_cut: screw_offset-trap_offset > -screw_min_nut_dist\");\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n if(cut_screw_close)\n {\n tz(-nut_h\/2)\n tz(-screw_min_nut_dist)\n tz(trap_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n else\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nif(false)\n{\n nut1 = NutHexM5;\n stack(dist=10,axis=X)\n {\n $show_vit=true;\n $preview_mode=true;\n #screw(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=false, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=true, orient=-Z, align=-Z);\n #screw(nut=nut1, h=20, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=25, screw_offset=-5, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, cut_screw_close=true, orient=-Z, align=-Z);\n }\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"69161f9d2bb8bad14ff9ac2d13306f5469809c5d","subject":"Another round of tweaks based on a print.","message":"Another round of tweaks based on a print.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/piCameraEnclosure.scad","new_file":"designs\/piCameraEnclosure.scad","new_contents":"\/\/ Adapted from: https:\/\/github.com\/luisibanez\/ShapesFor3DPrinting\/tree\/master\/OpenSCA\n\n\/\/ For case\nwidth = 36; \/\/ x\nlength = 36; \/\/ y\n\n\/\/ For camera cover\nflex_adapter_width = 23; \/\/ measures 21mm, but w\/ a nominal 22mm opening it was still too tight.\ncover_width = 27;\ncover_height = 2;\n\n\/\/ For rounded corners\nradius1 = 10;\nradius2 = 4;\n\npiCameraAdapter();\n\/\/ Comment out translate to see\n\/\/ back cover in place.\ntranslate([40,0,-8])\n piCameraBackCover();\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Modules\n\/\/\n\nmodule piCameraBackCoverBevel(length, clearance) {\n c = clearance;\n hh = cover_height \/ 2;\n hw = ( cover_width \/ 2 ) + c;\n he = hw + 1.5 + c;\n l = length \/ 2;\n polyhedron(\n points = [\n [ hw, -l-c, -hh-c ],\n [ hw, l+c, -hh-c ], \n [ hw, l+c, hh ], \n [ hw, -l-c, hh ],\n [ he, -l-c, -hh-c ],\n [ he, l+c, -hh-c ] \n ], \n faces = [\n [ 5, 1, 0, 4],\n [ 4, 0, 3 ],\n [ 2, 1, 5 ],\n [ 5, 4, 3, 2],\n [ 0, 1, 2, 3],\n ]\n );\n}\n\nmodule piCameraBackCover(for_subtraction=false) {\n indent = ! for_subtraction;\n clearance = for_subtraction ? 0.25 : 0;\n c = 2*clearance;\n cov_l = length-8;\n difference() {\n translate([0,-5,10-cover_height\/2])\n difference() {\n translate([0,1,0])\n union() {\n cube(size=[cover_width+c,cov_l+c,cover_height+c],center=true);\n piCameraBackCoverBevel(cov_l, clearance);\n mirror([1,0,0])\n piCameraBackCoverBevel(cov_l, clearance);\n }\n translate([0,15,0])\n cube(size=[flex_adapter_width-c,15,cover_height+c],center=true);\n if (indent)\n translate([0,8-length\/2,cover_height\/2+0.5])\n rotate([0,90,0])\n cylinder(r=1, h=cover_width-4, center=true, $fn=20);\n }\n if (! for_subtraction) {\n cornerRounding();\n }\n }\n}\n\nmodule cableOpening() {\n translate([0,14,8.1])\n cube(size=[17,12,4],center=true);\n}\n\nmodule chipOpening() {\n clearance = 0.5;\n c = 2 * clearance;\n translate([0,-9.5,5])\n cube(size=[8+c,10+c,4],center=true);\n}\n\nmodule lensOpening() {\n clearance = 0.5;\n c = 2 * clearance;\n translate([0,0,2.5])\n cube(size=[8+c,8+c,5+c], center=true);\n}\n\nmodule boardOpening() {\n clearance = 0.3;\n c = 2 * clearance;\n translate([0,-3,7.5])\n cube(size=[25+c,24+c,5], center=true);\n}\n\nmodule cameraFrame() {\n translate([0,0,5])\n cube(size=[width,length,10], center=true);\n}\n\nmodule roundedCorner(r) {\n translate([-r, -r, 0])\n difference() {\n translate([0,0,-50])\n cube(size=[r+0.1,r+0.1,100]);\n cylinder(h=100, r=r, $fn=50, center=true);\n }\n}\n\nmodule cornerRounding() {\n \/\/ vertical corners\n translate([width\/2,length\/2,0])\n roundedCorner(radius1);\n translate([-width\/2,length\/2,0])\n rotate([0,0,90])\n roundedCorner(radius1);\n translate([-width\/2,-length\/2,0])\n rotate([0,0,180])\n roundedCorner(radius1);\n translate([width\/2,-length\/2,0])\n rotate([0,0,-90])\n roundedCorner(radius1);\n\n \/\/ top corners\n translate([-width\/2,0,10])\n rotate([0,-90,0])\n rotate([90,0,0])\n roundedCorner(radius2);\n translate([width\/2,0,10])\n rotate([90,0,0])\n roundedCorner(radius2);\n}\n\nmodule piCameraAdapter() {\n difference() {\n cameraFrame();\n boardOpening();\n chipOpening();\n cableOpening();\n lensOpening();\n cornerRounding();\n piCameraBackCover(for_subtraction=true);\n }\n}\n","old_contents":"\/\/ Adapted from: https:\/\/github.com\/luisibanez\/ShapesFor3DPrinting\/tree\/master\/OpenSCA\n\n\/\/ For case\nwidth = 36; \/\/ x\nlength = 36; \/\/ y\n\n\/\/ For camera cover\nflex_adapter_width = 23; \/\/ measures 21mm, but w\/ a nominal 22mm opening it was still too tight.\ncover_width = 27;\ncover_height = 2;\n\n\/\/ For rounded corners\nradius = 8;\n\npiCameraAdapter();\n\/\/ Comment out translate to see\n\/\/ back cover in place.\ntranslate([40,0,-8])\n piCameraBackCover();\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Modules\n\/\/\n\nmodule piCameraBackCoverBevel(length, clearance) {\n c = clearance;\n hh = cover_height \/ 2;\n hw = ( cover_width \/ 2 ) + c;\n he = hw + 1.5 + c;\n l = length \/ 2;\n polyhedron(\n points = [\n [ hw, -l-c, -hh-c ],\n [ hw, l+c, -hh-c ], \n [ hw, l+c, hh ], \n [ hw, -l-c, hh ],\n [ he, -l-c, -hh-c ],\n [ he, l+c, -hh-c ] \n ], \n faces = [\n [ 5, 1, 0, 4],\n [ 4, 0, 3 ],\n [ 2, 1, 5 ],\n [ 5, 4, 3, 2],\n [ 0, 1, 2, 3],\n ]\n );\n}\n\nmodule piCameraBackCover(for_subtraction=false) {\n indent = ! for_subtraction;\n clearance = for_subtraction ? 0.3 : 0;\n c = 2*clearance;\n cov_l = length-8;\n difference() {\n translate([0,-5,10-cover_height\/2])\n difference() {\n translate([0,1,0])\n union() {\n cube(size=[cover_width+c,cov_l+c,cover_height+c],center=true);\n piCameraBackCoverBevel(cov_l, clearance);\n mirror([1,0,0])\n piCameraBackCoverBevel(cov_l, clearance);\n }\n translate([0,15,0])\n cube(size=[flex_adapter_width-c,11,cover_height+c],center=true);\n if (indent)\n translate([0,8-length\/2,cover_height\/2])\n rotate([0,90,0])\n cylinder(r=1, h=cover_width-0.5, center=true, $fn=20);\n }\n if (! for_subtraction) {\n cornerRounding();\n }\n }\n}\n\nmodule cableOpening() {\n translate([0,14,8.1])\n cube(size=[17,12,4],center=true);\n}\n\nmodule chipOpening() {\n clearance = 0.5;\n c = 2 * clearance;\n translate([0,-9.5,5])\n cube(size=[8+c,10+c,4],center=true);\n}\n\nmodule lensOpening() {\n clearance = 0.5;\n c = 2 * clearance;\n translate([0,0,2.5])\n cube(size=[8+c,8+c,5+c], center=true);\n}\n\nmodule boardOpening() {\n clearance = 0.3;\n c = 2 * clearance;\n translate([0,-3,7.5])\n cube(size=[25+c,24+c,5+clearance], center=true);\n}\n\nmodule cameraFrame() {\n translate([0,0,5])\n cube(size=[width,length,10], center=true);\n}\n\nmodule roundedCorner(r) {\n translate([-r, -r, 0])\n difference() {\n translate([0,0,-50])\n cube(size=[r+0.1,r+0.1,100]);\n cylinder(h=100, r=r, $fn=50, center=true);\n }\n}\n\nmodule cornerRounding() {\n \/\/ vertical corners\n translate([width\/2,length\/2,0])\n roundedCorner(radius);\n translate([-width\/2,length\/2,0])\n rotate([0,0,90])\n roundedCorner(radius);\n translate([-width\/2,-length\/2,0])\n rotate([0,0,180])\n roundedCorner(radius);\n translate([width\/2,-length\/2,0])\n rotate([0,0,-90])\n roundedCorner(radius);\n\n \/\/ top corners\n translate([-width\/2,0,10])\n rotate([0,-90,0])\n rotate([90,0,0])\n roundedCorner(radius\/2);\n translate([width\/2,0,10])\n rotate([90,0,0])\n roundedCorner(radius\/2);\n}\n\nmodule piCameraAdapter() {\n difference() {\n cameraFrame();\n boardOpening();\n chipOpening();\n cableOpening();\n lensOpening();\n cornerRounding();\n piCameraBackCover(for_subtraction=true);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a459bda9088d175472ae1ff250bf6a615e10f610","subject":"shapes\/stack: support both dist and distances param","message":"shapes\/stack: support both dist and distances param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=undef)\n{\n if(dist == undef && distances != undef)\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n else if(dist != undef && distances == undef)\n {\n for (i = [0 : $children-1])\n translate([ dist*i, 0, 0 ]) children(i);\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8c322f5d4b531db898cbbeec88fdc78ec65f5bb8","subject":"x\/carriage: increase rod cut diameter to allow gear through","message":"x\/carriage: increase rod cut diameter to allow gear through\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"157bddbca13a9452c3d23b45b4b5a046dacc01e0","subject":"x\/extruder: wip, fixes after first print","message":"x\/extruder: wip, fixes after first print\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2+.5*mm;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+6*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.7];\nextruder_guidler_mount_off = [.5*mm -guidler_mount_off[1]+hobbed_gear_d_inner\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(part=undef)\n{\n extruder_b_mount_thick = 5*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(d=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MHexNutM3, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n hull()\n {\n translate([hobbed_gear_d_inner\/2,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[1,0,0]);\n }\n\n translate(extruder_guidler_mount_off)\n {\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([0,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=(guidler_w)+1*mm, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([guidler_screws_mount_d_offset, y*(guidler_screws_distance), house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1*mm, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ cutout for bearing\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=extruder_hotmount_clamp_nut, h=1000, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n screw_cut(nut=MHexNutM3, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -7*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\n\/*if(false)*\/\n{\n x_carriage_withmounts();\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n extruder_b(part=\"vit\");\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n %extruder_guidler(show_extras=true);\n }\n\n %x_extruder_hotend();\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n\nif(false)\n{\n rotate([90,0,0])\n x_carriage(show_bearings=false);\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.7];\nextruder_guidler_mount_off = [.5*mm -guidler_mount_off[1]+hobbed_gear_d_inner\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n \n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n \/*cubea([guidler_screws_mount_d, house_w, house_guidler_screw_h], align=[0,0,0]);*\/\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n cubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n difference()\n {\n hull()\n {\n translate([hobbed_gear_d_inner\/2,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w+1*mm,guidler_bearing[1]*2], align=[1,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w+1*mm, orient=[0,1,0], align=[1,0,0]);\n }\n\n translate(extruder_guidler_mount_off)\n {\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d+.5*mm, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n cubea([10,(guidler_w-guidler_mount_w)\/2+.5*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([guidler_screws_mount_d_offset, y*(guidler_screws_distance), house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1*mm, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ cutout for bearing\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=extruder_hotmount_clamp_nut, h=1000, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -7*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\n\/*if(false)*\/\n{\n %x_carriage(show_bearings=false);\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n {\n extruder_b(show_vitamins=true);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n %extruder_guidler(show_extras=true);\n }\n }\n\n\n %x_extruder_hotend();\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d8d2f6982085f089d63c269659b4a612ce462460","subject":"Citosine","message":"Citosine","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"x=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([0, 0, 0]) cube ([x, y, z-2], center=true); \ncolor(\"Red\") translate ([-30, y\/200000, -4]) cylinder (z, y\/2, y\/2); \n \n } \n#rotate([0, 90, 0]) translate([0,0,-23]) cylinder(5,2.65,2.65); \ntranslate([-10, -10.5, -1]) cube([50, 21, 5]);\n}\n\nrotate([90,0,0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\ndifference() { \n translate([20, -9.5, -3.45]) cube([20, 19, 7]);\n #rotate([0, 90, 0]) translate([0, 4.5, 36.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 36.5]) cylinder(9, 2.65, 2.65);\n}\n\n\n","old_contents":"x=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([0, 0, 0]) cube ([x, y, z-2], center=true); \ncolor(\"Red\") translate ([-30, y\/200000, -4]) cylinder (z, y\/2, y\/2); \n \n } \n#rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(5, 2.65, 2.65); \ntranslate([-10, -10.5, -1]) cube([50, 21, 5]);\n}\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\ndifference() { \n translate([20, -9.5, -3.45]) cube([20, 19, 7]);\n #rotate([0, 90, 0]) translate([0, 4.5, 36.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 36.5]) cylinder(9, 2.65, 2.65);\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8bd511028a55c127f2be4f7993495de776aa5c51","subject":"\u041a\u043e\u0434 \u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438","message":"\u041a\u043e\u0434 \u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5;\nx=9; \ny=38;\nz=38; \ncylinder(x, y, z); \n}\n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t\ndx=4.2;\n\/\/difference () {\ntranslate([9,73,dx]) rotate([90,0,0]) cylinder(40,4,4);\t\t\n\/\/rotate ([90,0,0])translate ([30,7.5,-200.1])cylinder (3.5,5,5);\n\n\/\/}\n\n\/\/difference() {\ntranslate([9,-32,dx]) rotate([90,0,45]) cylinder(40,4,4);\n\/\/rotate ([90,45,45])translate ([-35,-24,196.1])cylinder (3.5,5,5);\n\n\/\/}\t\t\n\/\/difference () {\ntranslate([-61,-41,dx]) rotate([45,90,76]) cylinder(40,4,4);\t\t\t\n\/\/rotate ([90,90,-59])translate ([-7.5,8.5,204.7])cylinder (3.5,5,5);\n\/\/ }\t\t\n}\nplaid();\t\t\nconnect();\t\n\n\n","old_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5; \ncylinder(18, 100, 100); \n}\n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t\ndifference () {\ntranslate([30,200,7.6]) rotate([90,0,0]) cylinder(115,7.8,7.8);\t\t\nrotate ([90,0,0])translate ([30,7.5,-200.1])cylinder (3.5,5,5);\n\n}\n\ndifference() {\ntranslate([30,-89,7.6]) rotate([90,0,45]) cylinder(115,7.8,7.8);\nrotate ([90,45,45])translate ([-35,-24,196.1])cylinder (3.5,5,5);\n\n}\t\t\ndifference () {\ntranslate([-174,-114.5,7.6]) rotate([45,90,76]) cylinder(115,7.8,7.8);\t\t\t\nrotate ([90,90,-59])translate ([-7.5,8.5,204.7])cylinder (3.5,5,5);\n }\t\t\n}\nplaid();\t\t\nconnect();\t\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f8ec5bc6556830e0098ce400120af19661b1db6b","subject":"add setup for icons","message":"add setup for icons\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n\n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n iconColor, iconType, iconXyScale, iconHeight, icon_xOffset, icon_yOffset,\n\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\n{\n color(iconColor)\n translate([xOffset, yOffset, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=1.6);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbaseclef15scale(1.8);\n }\n else if(iconType == \"Cat\")\n {\n cat(1.8);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 1.6])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumtrooper(2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bd6ea7b5d6b2e13a48f108b4b8401f5df25bd75c","subject":"zaxis\/motor-mount: Use nut_trap_cut","message":"zaxis\/motor-mount: Use nut_trap_cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-motor-mount.scad","new_file":"z-axis-motor-mount.scad","new_contents":"include \ninclude \n\nuse \nuse \n\ninclude \ninclude \n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=[1,0,0]\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_mount_screw_offset_x, 0, 0])\n translate([0,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-5, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n #nut_trap_cut(nut=zmotor_mount_clamp_nut, h=10, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[1,0,0], align=[0,0,0]);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n\/*print = true;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*rotate([0,-90,0])*\/\n \/*zaxis_motor_mount();*\/\n\n \/*translate([-25,0,zmotor_mount_thickness_h\/2])*\/\n \/*mount_rod_clamp_half(*\/\n \/*rod_d=zaxis_rod_d,*\/\n \/*screw_dist=zmotor_mount_clamp_dist,*\/\n \/*thick=5,*\/\n \/*base_thick=5,*\/\n \/*width=zmotor_mount_thickness_h,*\/\n \/*thread=zmotor_mount_clamp_thread);*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\nuse \n\ninclude \ninclude \n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=[1,0,0]\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_mount_screw_offset_x, 0, 0])\n translate([0,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.3, zmotor_mount_clamp_nut_dia*1.1, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n translate([-zmotor_mount_clamp_nut_thick*1.3\/2,0,0])\n cylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n\/*print = true;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*rotate([0,-90,0])*\/\n \/*zaxis_motor_mount();*\/\n\n \/*translate([-25,0,zmotor_mount_thickness_h\/2])*\/\n \/*mount_rod_clamp_half(*\/\n \/*rod_d=zaxis_rod_d,*\/\n \/*screw_dist=zmotor_mount_clamp_dist,*\/\n \/*thick=5,*\/\n \/*base_thick=5,*\/\n \/*width=zmotor_mount_thickness_h,*\/\n \/*thread=zmotor_mount_clamp_thread);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"64be5e3c0da5c2f7913f9044fe8e4fc6d7b9d7f1","subject":"Smaller (125mm square) and with thinner base - 1mm instead of 2mm","message":"Smaller (125mm square) and with thinner base - 1mm instead of 2mm\n\n4 of these per chair. I've printed 7 of these on the Pulse. Takes about 3 hours per unit.\n","repos":"josephmjoy\/funstuff","old_file":"models\/cushiongrab\/cushiongrab.scad","new_file":"models\/cushiongrab\/cushiongrab.scad","new_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\ntri_height = 5;\nbase_thickness = 1;\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([3*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ Dome - used for differencing\nmodule dome(width) {\n r = 7;\n ceiling_height = tri_height + base_thickness; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n n = width \/ (3*tri_height); \/\/ each row is 3*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0]) \n difference() {\n union() { \n cube([width, base_thickness, width]);\n translate([tri_height, base_thickness, 0]) prism_rows(tri_height, width, n);\n }\n dome(width);\n }\n}\n\n\ncushion_grabber(125);\n\/\/dome(100);\n\n\n\n\n\n","old_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\ntri_height = 5;\nbase_thickness = 2;\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([3*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ Dome - used for differencing\nmodule dome(width) {\n r = 7;\n ceiling_height = tri_height + base_thickness; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n n = width \/ (3*tri_height); \/\/ each row is 3*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0]) \n difference() {\n union() { \n cube([width, base_thickness, width]);\n translate([tri_height, base_thickness, 0]) prism_rows(tri_height, width, n);\n }\n dome(width);\n }\n}\n\n\ncushion_grabber(200);\n\/\/dome(100);\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"46d989d952c4ab56206093dbb5f003c475a571bc","subject":"Add OpenSCAD model of a tinwhistle mouthpiece.","message":"Add OpenSCAD model of a tinwhistle mouthpiece.\n","repos":"loic-fejoz\/loic-fejoz-fabmoments,loic-fejoz\/loic-fejoz-fabmoments,loic-fejoz\/loic-fejoz-fabmoments","old_file":"tinwhistle\/tinwhistle.scad","new_file":"tinwhistle\/tinwhistle.scad","new_contents":"\/\/The MIT License (MIT)\n\/\/\n\/\/Copyright (c) 2014 Lo\u00efc Fejoz\n\/\/\n\/\/Permission is hereby granted, free of charge, to any person obtaining a copy of\n\/\/this software and associated documentation files (the \"Software\"), to deal in\n\/\/the Software without restriction, including without limitation the rights to\n\/\/use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of\n\/\/the Software, and to permit persons to whom the Software is furnished to do so,\n\/\/subject to the following conditions:\n\/\/\n\/\/The above copyright notice and this permission notice shall be included in all\n\/\/copies or substantial portions of the Software.\n\/\/\n\/\/THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\/\/IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n\/\/FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n\/\/COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n\/\/IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n\/\/CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\ninner_tolerance=0.3; \/\/ Tolerance for hole\n\ntotal_length=58;\nbig_cylinder_length=19;\nbig_cylinder_radius=16 \/ 2;\nmouthpiece_height=6;\nmouthpiece_width=14.5;\nmouthpiece_length=12;\nbigger_part_length=33;\nstep_length=5;\npipe_radius=(12.8 \/ 2) + inner_tolerance;\nmouthpiece_inner_height=1.8;\nmouthpiece_inner_width=8.8;\nhole_width=8.5;\nhole_length=6;\nhole_angle=25;\n\nsc = 100;\nepsilon=5;\nreally_long=total_length;\ndifference() {\n\tunion() {\n \/\/ Mouthpiece part\n \/\/ PROFILE_B = ellipse... = \n\t\ttranslate([0, big_cylinder_radius - mouthpiece_height\/2, big_cylinder_length])\n\t\t scale([mouthpiece_width\/sc,mouthpiece_height\/sc,1])\n\t\t\tcylinder(h = total_length-big_cylinder_length, r1 = sc\/2, r2 = sc\/2, center = false);\n\n \/\/ big cylinder part\n\t\tcylinder(h = big_cylinder_length, r1 = big_cylinder_radius, r2 = big_cylinder_radius, center = false);\n\n \/\/ connection to mouthpiece\n\t\thull() {\n \/\/ PROFILE_B =\n\t\t translate([0, big_cylinder_radius - mouthpiece_height\/2, total_length-mouthpiece_length])\n\t\t scale([mouthpiece_width\/sc,mouthpiece_height\/sc,1])\n\t\t cylinder(h = 1, r1 = sc\/2, r2 = sc\/2, center = false);\n\t\t \/\/ PROFILE_A =\n\t\t translate([0,0, bigger_part_length])\n\t\t hull() {\n\t\t translate([0, big_cylinder_radius - mouthpiece_height\/2, 0])\n\t\t scale([mouthpiece_width\/sc,mouthpiece_height\/sc,1])\n\t\t cylinder(h = 1, r1 = sc\/2, r2 = sc\/2, center = false);\n\t\t cylinder(h = 1, r1 = big_cylinder_radius, r2 = big_cylinder_radius, center = false);\n\t\t }\n\t\t}\n\t\t\/\/ connection to big cylinder\n\t\thull() {\n\t\t \/\/ PROFILE_A =\n\t\t translate([0, 0, big_cylinder_length])\n\t\t hull() {\n\t\t translate([0, big_cylinder_radius - mouthpiece_height\/2, 0])\n\t\t scale([mouthpiece_width\/sc,mouthpiece_height\/sc,1])\n\t\t cylinder(h = 1, r1 = sc\/2, r2 = sc\/2, center = false);\n\t\t cylinder(h = 1, r1 = big_cylinder_radius, r2 = big_cylinder_radius, center = false);\n\t\t }\n\t\t translate([0, 0, big_cylinder_length-step_length])\n\t\t cylinder(h = 1, r1 = big_cylinder_radius, r2 = big_cylinder_radius, center = false);\n\t\t}\n\t\t\n\t\t\/\/ Middle part\n\t\t\/\/ scale([1, 1, bigger_part_length - big_cylinder_length]) * PROFILE_A =\n\t\ttranslate([0, 0, big_cylinder_length])\n\t\t hull() {\n\t\t translate([0, big_cylinder_radius - mouthpiece_height\/2, 0])\n\t\t scale([mouthpiece_width\/sc,mouthpiece_height\/sc,1])\n\t\t cylinder(h = bigger_part_length - big_cylinder_length, r1 = sc\/2, r2 = sc\/2, center = false);\n\t\t cylinder(h = bigger_part_length - big_cylinder_length, r1 = big_cylinder_radius, r2 = big_cylinder_radius, center = false);\n\t\t };\n\t\t\/\/ BOX_1 =\n\t\ttranslate([0, big_cylinder_radius-mouthpiece_inner_height, bigger_part_length-hole_length])\n\t\t\tcube(size=[hole_width, mouthpiece_inner_height, 2*hole_length], center=true);\n\t};\n \/\/ Now create holes...\n\ttranslate([0, 0, -epsilon])\n\t\tdifference() {\n\t\t\tcylinder(h = bigger_part_length+epsilon, r1 = pipe_radius, r2 = pipe_radius, center = false);\n \/\/ minus BOX_1\n\t\t\ttranslate([-hole_width\/2, big_cylinder_radius - mouthpiece_height\/2, bigger_part_length-hole_length])\n\t\t\t\tcube(size=[hole_width, 2*mouthpiece_inner_height, 2*hole_length], center=false);\n\t\t};\n\ttranslate([0, big_cylinder_radius - mouthpiece_height\/2, bigger_part_length+total_length\/2-epsilon])\n\t\tcube(size=[mouthpiece_inner_width, mouthpiece_inner_height, total_length], center =true);\n\ttranslate([0, really_long\/2, bigger_part_length-hole_length\/2])\n\t\tcube(size=[hole_width, really_long, hole_length], center=true);\n\ttranslate([0, big_cylinder_radius , bigger_part_length - hole_length + sin(hole_angle)*hole_length\/2 ])\n\t\trotate([-90+hole_angle, 0, 0])\n\t\t\ttranslate([0, really_long\/2, 0])\n\t\t\t\tcube(size=[hole_width, really_long, hole_length], center=true);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'tinwhistle\/tinwhistle.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0f10127e967ddd49deddbd63a32b0e0afa02bdd4","subject":"change to use $t for animations","message":"change to use $t for animations\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\ntranslate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\ntranslate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ncheckLink(xC,yC,xH,yH,CH);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n #cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n #cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.5]) cylinder(r=1.4,h=8,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\nmodule EFlink() {\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ 2,0,0]) cube([7,3,2],center=true);\n translate([EF-2,0,0]) cube([7,3,2],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-6,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=.7,h=3,center=true);\n cylinder(r=.7,h=3,center=true);\n }\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\na=44;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\ntranslate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\ntranslate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ncheckLink(xC,yC,xH,yH,CH);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n #cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n #cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.5]) cylinder(r=1.4,h=8,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\nmodule EFlink() {\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ 2,0,0]) cube([7,3,2],center=true);\n translate([EF-2,0,0]) cube([7,3,2],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-6,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=.7,h=3,center=true);\n cylinder(r=.7,h=3,center=true);\n }\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"29bd3d83882f160affabf3593e9a196a0d41bf4a","subject":"The baseline images were updated.","message":"The baseline images were updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"javascad\/src\/main\/generated-openscad\/org\/onebeartoe\/modeling\/javascad\/light\/signals\/heart\/heart-light-signal-test-compiles.scad","new_file":"javascad\/src\/main\/generated-openscad\/org\/onebeartoe\/modeling\/javascad\/light\/signals\/heart\/heart-light-signal-test-compiles.scad","new_contents":"use <..\/light-signal-test.scad>\n\ncolor([1,0.7843,0])difference(){cylinder(h=2, r=7, center=true);\ncube([5,5,5],center=true);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'javascad\/src\/main\/generated-openscad\/org\/onebeartoe\/modeling\/javascad\/light\/signals\/heart\/heart-light-signal-test-compiles.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c3931bf2cdd4069cfef66ddab4344929decf365c","subject":"Made the thumb button more accessible and reduced the overall width of the case.","message":"Made the thumb button more accessible and reduced the overall width of the case.\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo","old_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\/\/ a slight overestimate of the sizes of subtracted objects which prevents a confusing \"film\" in the STL\noverkill = 0.001;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 22.0; \/\/ originally 25mm in Typeatron #2, based on the model; this was a bit too high\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 67; \/\/ Typeatron #1 and #2 were both 70mm wide\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nfingerButtonHeight = 5;\nthumbButtonHeight = 8; \/\/ thumb button is a little taller because it is not deeply inset like the finger buttons\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = 0;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + fingerButtonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + thumbButtonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length, buttonHeight) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n difference() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n \/\/ remove the bottom half of the cylinder, which could protrude below the button body\n translate([0, 0, buttonWidth\/2]) {\n cube(length, buttonWidth, buttonWidth\/2 + overkill);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length, buttonHeight) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+overkill, fsrChannelDepth]);\n }\n translate([0, w-overkill, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength, buttonHeight) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+overkill, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+overkill, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength, buttonHeight);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalThumbWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalThumbWellDepth, thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+overkill,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength, fingerButtonHeight);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1+overkill]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 5;\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = thumbNotchDepth * 2\/3;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + buttonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + buttonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1.0001]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2868394091a959b04999fd190156d79217f4f40b","subject":"Update DeOxyRibose.scad","message":"Update DeOxyRibose.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5; \ncylinder(18, 100, 100); \n}\n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t\ndifference () {\ntranslate([30,200,7.6]) rotate([90,0,0]) cylinder(115,7.8,7.8);\t\t\nrotate ([90,0,0])translate ([30,7.5,-200.1])cylinder (3.5,5,5);\n\n}\n\ndifference() {\ntranslate([30,-89,7.6]) rotate([90,0,45]) cylinder(115,7.8,7.8);\nrotate ([90,45,45])translate ([-35,-24,196.1])cylinder (3.5,5,5);\n\n}\t\t\ndifference () {\ntranslate([-174,-114.5,7.6]) rotate([45,90,76]) cylinder(115,7.8,7.8);\t\t\t\nrotate ([90,90,-59])translate ([-7.5,8.5,204.7])cylinder (3.5,5,5);\n }\t\t\n}\nplaid();\t\t\nconnect();\t\n\n","old_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5; \ncylinder(18, 100, 100); \n}\n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t\ntranslate([30,200,7.6]) rotate([90,0,0]) cylinder(115,7.8,7.8);\t\t\ntranslate([30,-89,7.6]) rotate([90,0,45]) cylinder(115,7.8,7.8);\t\t\ntranslate([-174,-114.5,7.6]) rotate([45,90,76]) cylinder(115,7.8,7.8);\t\t\t\n}\t\t\n\t\t\nplaid();\t\t\nconnect();\t\t\n\t\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c409ceb9aa16f191fc5c07f27aef8c69722458e8","subject":"flower saurcer - project based on actual ones","message":"flower saurcer - project based on actual ones\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"flowerpot_saucer\/flowerpot_saucer.scad","new_file":"flowerpot_saucer\/flowerpot_saucer.scad","new_contents":"$fs=5;\n$fa=0.5;\n\nmodule saucer()\n{\n difference()\n {\n cylinder(h=22, r1=102\/2, r2=122\/2);\n translate([0, 0, 2])\n cylinder(h=20, r1=100\/2, r2=120\/2);\n }\n difference()\n {\n for(rz=[0, 45, 90, 135])\n rotate([0, 0, rz])\n translate([-102\/2, -2\/2, 2])\n cube([102, 2, 2]);\n cylinder(r=(102-2*30)\/2, h=5);\n }\n}\n\nsaucer();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'flowerpot_saucer\/flowerpot_saucer.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"31ee49bf29e10c168709d10688ee4b2ba51520f2","subject":"Refined Typeatron model. Getting close to a version precise enough for the one-shot Shapeways order","message":"Refined Typeatron model. Getting close to a version precise enough for the one-shot Shapeways order\n","repos":"joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo","old_file":"typeatron\/typeatron.scad","new_file":"typeatron\/typeatron.scad","new_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nincludeInternalComponents = true;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.10;\nchargerHeaderWidth = 2.56;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 11;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\nlidMargin = 1;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\npushButtonWellWidth = 7;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1;\npushButtonLegLength = 4;\npushButtonRadius = 3.5\/2;\npushButtonLegProtrusion = pushButtonLegLength - pushButtonBaseThick;\nbuttonThick = 8;\nbuttonPressDepth = 0.3;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonStabilizerRodHeight = pushButtonWellDepth - 1;\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + buttonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + buttonPressDepth + pushButtonWellDepth;\n\nledDomeRadius = 2.6;\nledRimRadius = 3.1;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\nlidWidth = caseWidth - wallThick + lidMargin - totalFingerWellDepth + 3;\nlidLength = caseLength - thumbBevelLength - wallThick + 2*lidMargin;\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([-1,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+buttonPressDepth+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2); \n }\n}\n\n\/\/ create the lid\n\/\/ buffer: hyper-extends the lid, for better rendering\n\/\/ shrinkage: clearance around the edges of the lid\nmodule lid(buffer, shrinkage) {\n translate([0,0,-buffer]) {\n translate([wallThick-lidMargin+shrinkage,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth,lidLength,lidThick+buffer]);\n }\n translate([thumbBevelWidth,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth-thumbBevelWidth+wallThick,cavityLength+(lidMargin-shrinkage)*2,lidThick+buffer]);\n }\n\n \/\/ note: currently no \"shrinkage\" on this edge\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n rotate([180,0,0]) {\n translate([-27,-wallThick,pushButtonBaseThick]) {\n translate([0,0,-6]) {\n cube([47,lidThick+buffer,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\nmodule screwHoles() {\n translate([0,0,-1]) {\n translate([15,caseLength-thumbBevelLength-wallThick+9,0]) { cylinder(h=caseHeight+2,r=1.5); }\n\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*2,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*4,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*6,0]) { cylinder(h=caseHeight+2,r=1.5); }\n }\n}\n\ndifference() {\n \/\/ basic shape of the case\n union() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick);\n }\n }\n }\n }\n\n \/\/ inner compartment\n translate([wallThick,wallThick,0]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick]);\n }\n translate([thumbBevelWidth+2,wallThick,0]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-2,cavityLength,caseHeight-floorThick]);\n }\n\n \/\/ depression for lid\n lid(1,0);\n\n screwHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick-1,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick+1,15]);\n cube([22,caseHeight-floorThick+1,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius);\n\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick,0,caseHeight-floorThick-chargerHeaderLength-2*error]) {\n cube([chargerHeaderWidth+2*error,wallThick,chargerHeaderLength+2*error]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+2*error,wallThick,powerSwitchWidth+2*error]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick,nanoUsbHeight+clearance]);\n }\n \/\/ trim off the thin remainder above the USB port which would be problematic to print,\n \/\/ and make it harder to get the Nano into its socket anyway\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,wallThick-lidMargin,0]) {\n cube([nanoUsbWidth+2*clearance,lidMargin,2]);\n }\n}\n\n\/\/ lid\ntranslate([0,0,caseHeight + 2]) {\n difference() {\n \/\/ the gap of 0.4 was determined by taking into account the 0.15mm accuracy of\n \/\/ the device and the 0.15% error by longest axis of the material, keeping in mind\n\t \/\/ that there are always a pair of gaps across the lid from each other.\n \/\/ 0.4mm is actually larger than necessary in the horizontal (narrower) dimension.\n lid(0,0.4);\n\n screwHoles();\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the most smooth\ntranslate([-5,0,10]) {\n for (i = [0:4]) {\n translate([0,i*(buttonLength+2),0]) { rotate([90,180,-90]) {\n \/\/cube([10,20,40]);\n\n difference() {\n union() {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength,r=buttonWidth\/2); }\n }\n\n translate([0,0,buttonWidth\/2]) {\n cube([buttonLength,buttonWidth,buttonThick-buttonWidth\/2]);\n }\n\n translate([0,0,buttonThick]) {\n cube([buttonStabilizerWellWidth, buttonWidth, buttonStabilizerRodHeight]);\n\t\t }\n\n translate([buttonLength-buttonStabilizerWellWidth,0,buttonThick]) {\n cube([buttonStabilizerWellWidth, buttonWidth, buttonStabilizerRodHeight]);\n\t\t }\n }\n\n translate([buttonLength\/2,buttonWidth\/2,buttonThick-0.5]) {\n cylinder(h=1,r=pushButtonRadius);\n }\n }\n }} \n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+2*error,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n if (includeInternalComponents) {\n translate([0,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n }\n\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (includeInternalComponents) {\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([1,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,3,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\ttranslate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([1,4,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","old_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 11;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\nlidMargin = 1.5;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\npushButtonWellWidth = 7;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1;\npushButtonLegLength = 4;\npushButtonRadius = 3.5\/2;\npushButtonLegProtrusion = pushButtonLegLength - pushButtonBaseThick;\nbuttonThick = 8;\nbuttonPressDepth = 1;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonStabilizerRodHeight = pushButtonWellDepth - 1;\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + buttonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + buttonPressDepth + pushButtonWellDepth;\n\nledDomeRadius = 2.6;\nledRimRadius = 3.1;\n\nthumbBevelLength = 50;\nthumbBevelWidth = 35;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\nlidWidth = caseWidth - wallThick + lidMargin - totalFingerWellDepth + 3;\nlidLength = caseLength - thumbBevelLength - wallThick + 2*lidMargin;\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([-1,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+buttonPressDepth+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2); \n }\n}\n\nmodule lid(buffer, shrinkage) {\n translate([0,0,-buffer]) {\n translate([wallThick-lidMargin+shrinkage,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth,lidLength,lidThick+buffer]);\n }\n translate([thumbBevelWidth,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth-thumbBevelWidth+wallThick,cavityLength+(lidMargin-shrinkage)*2,lidThick+buffer]);\n }\n\n \/\/ note: currently no \"shrinkage\" on this edge\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n rotate([180,0,0]) {\n translate([-27,-wallThick,pushButtonBaseThick]) {\n translate([0,0,-6]) {\n cube([47,lidThick+buffer,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\nmodule screwHoles() {\n translate([-1,0,0]) {\n translate([17,caseLength-thumbBevelLength-wallThick+9,0]) { cylinder(h=caseHeight+2,r=1.5); }\n\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*2,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*4,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*6,0]) { cylinder(h=caseHeight+2,r=1.5); }\n }\n}\n\ndifference() {\n \/\/ basic shape of the case\n union() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick);\n }\n }\n }\n }\n\n \/\/ inner compartment\n translate([wallThick,wallThick,0]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick]);\n }\n translate([thumbBevelWidth+2,wallThick,0]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-2,cavityLength,caseHeight-floorThick]);\n }\n\n \/\/ depression for lid\n lid(1,0);\n\n screwHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick-1,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick+1,15]);\n cube([22,caseHeight-floorThick+1,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius);\n\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick+cavityWidth-3,-1,wallThick]) {\n translate([-2,0,-3.5]) { cube([4,wallThick+2,7]); }\n }\n\n \/\/ hole for USB port\n translate([31,0,wallThick-2.5]) {\n cube([8,wallThick,5]);\n }\n\n \/\/ socket for SPDT slide switch\n translate([10,0,wallThick-2.25]) {\n cube([12,wallThick,4.5]);\n }\n}\n\n\/\/ lid\ntranslate([0,0,50]) {\n difference() {\n lid(0,0.5);\n\n screwHoles();\n }\n}\n\n\/\/ buttons\ntranslate([caseWidth+30,wallThick,wallThick]) {\n for (i = [0:4]) {\n translate([0,i*2*fingerRad,0]) { rotate([0,-90,0]) { rotate([0,0,90]) {\n \/\/cube([10,20,40]);\n\n difference() {\n union() {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength,r=buttonWidth\/2); }\n }\n\n translate([0,0,buttonWidth\/2]) {\n cube([buttonLength,buttonWidth,buttonThick-buttonWidth\/2]);\n }\n\n translate([0,0,buttonThick]) {\n cube([buttonStabilizerWellWidth, buttonWidth, buttonStabilizerRodHeight]);\n\t\t }\n\n translate([buttonLength-buttonStabilizerWellWidth,0,buttonThick]) {\n cube([buttonStabilizerWellWidth, buttonWidth, buttonStabilizerRodHeight]);\n\t\t }\n }\n\n translate([buttonLength\/2,buttonWidth\/2,buttonThick-1]) {\n cylinder(h=2,r=pushButtonRadius);\n }\n }\n }}} \n }\n}\n\n\/\/ electronic components (for visualization only; comment out before printing!)\ntranslate([wallThick,wallThick,lidThick]) {\n \/\/ Arduino Nano v3.0\n translate([22,1,0]) { cube([18.5,43.2,1]); }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([1,1,0]) { cube([16.6,45,3.9]); }\n \/\/ Surface Transducer - Small\n translate([1,50,0]) { cube([14.5,21.5,7.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,3,0]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\ttranslate([18,47,0]) { cube([25,35,5]); }\n\n \/\/ TODO: MPU-6050 breakout board\n}\n \n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"471b4b2ea2c6df81f1f4aee42e6874cbe51ff435","subject":"Delete pahar_vero.scad","message":"Delete pahar_vero.scad","repos":"ceausuveronica\/ceausuveronica.github.io","old_file":"pahar_vero.scad","new_file":"pahar_vero.scad","new_contents":"","old_contents":"pahar_sampanie(raza_baza = 50, grosime_baza = 5, raza_picior = 3, inaltime_picior = 100, raza_cupa = 50, grosime_perete = 2);\r\n\r\n\/\/----------------------------------------------------\r\nmodule baza_pahar(raza_baza, grosime_baza, raza_picior)\r\n{\r\n cylinder(h = grosime_baza, r1 = raza_baza, r2 = raza_picior);\r\n}\r\n\/\/----------------------------------------------------\r\nmodule picior_pahar(inaltime_picior, raza_picior)\r\n{\r\n cylinder(h = inaltime_picior, r = raza_picior);\r\n}\r\n\/\/----------------------------------------------------\r\nmodule cupa_pahar(raza_cupa, grosime_perete)\r\n{\r\n difference(){\r\n sphere(r = raza_cupa);\r\n translate ([- raza_cupa, -raza_cupa, 0]) cube([2 * raza_cupa, 2 * raza_cupa, raza_cupa]);\r\n \r\n sphere(r = raza_cupa - grosime_perete);\r\n }\r\n}\r\n\/\/----------------------------------------------------\r\nmodule pahar_sampanie(raza_baza, grosime_baza, raza_picior, inaltime_picior, raza_cupa, grosime_perete)\r\n{\r\n baza_pahar(raza_baza, grosime_baza, raza_picior);\r\n translate ([0, 0, grosime_baza]) picior_pahar(inaltime_picior, raza_picior);\r\n translate ([0, 0, grosime_baza + inaltime_picior + raza_cupa]) cupa_pahar(raza_cupa, grosime_perete);\r\n}\r\n\r\n\r\n\r\n\r\n\r\ntresolution = 50; \r\n\r\n\r\nradius = 80;\r\n\r\n\r\nheight = 10;\r\n\r\n\r\nMessage = \"Bine a\u021bi venit la...\"; \r\n\r\n\r\nTo = \"Pagina Vero\";\r\n\r\n$fn = resolution;\r\n\r\nscale([1, 0.5]) difference() {\r\n cylinder(r =radius , h = 2 * height, center = true);\r\n translate([0, 0, height])\r\n cylinder(r = radius - 10, h = height + 1, center = true);\r\n}\r\nlinear_extrude(height = height) {\r\n translate([0, --4]) text(Message, halign = \"center\");\r\n translate([0, -16]) text(To, halign = \"center\");\r\n}\r\n\r\n\r\n\r\n$fn = 100;\r\nnumber_of_holes = 10;\r\n\r\nfor(i = [1 : 360 \/ number_of_holes : 360]) {\r\n \r\n make_cylinder(i);\r\n}\r\n\r\nmodule make_cylinder(i) {\r\n \r\n rotate([0, 0, i]) translate([100, 0, 0]) cylinder(h = 4, r = 20);\r\n}\r\n\r\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b2c791eb1b2b5be0f275e3b50d8df362df2e644e","subject":"hardware tweaks","message":"hardware tweaks\n","repos":"coreyabshire\/marv,coreyabshire\/marv","old_file":"scad\/main_electronics_case.scad","new_file":"scad\/main_electronics_case.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\n$fn=20;\n\nfunction vecmax (a,b) = [for (i=[0:len(a)]) max(a[i],b[i])];\n\nmodule halfRoundedBox(d, r) {\n epsilon = 0.01;\n difference() {\n roundedBox(d, r);\n translate([-epsilon, -epsilon, d[2]\/2])\n cube([d[0] + epsilon * 4, \n d[1] + epsilon * 4, \n d[2]], center=true);\n }\n}\n\nmodule halfRoundedShell(d, r, t) {\n difference() {\n halfRoundedBox(d, r);\n translate([0,0,t]) halfRoundedBox([d[0]-t*2,d[1]-t*2,d[2]], r);\n }\n}\n\nmodule standoff(x, y, h, d1, d2) {\n translate([x, y, 0]) {\n difference() {\n cylinder(d=d1, h=h);\n cylinder(d=d2, h=h);\n }\n }\n}\n\nmodule wall_standoff(x, y, z, rz, w, h1, h2, d1, d2) {\n epsilon = 0.01;\n translate([x, y, z]) rotate([0, 0, rz]) {\n difference() {\n hull() {\n cylinder(d=d1, h=h1);\n translate([-d1\/2,0,0]) cube([d1, w, h1]);\n translate([-d1\/2,w,-h2]) cube([d1, w, h2]);\n }\n translate([0, 0, h1-h2]) cylinder(d=d2, h=h2);\n translate([-d1\/2 - epsilon, w, -h2 - epsilon]) \n cube([d1 + 2 * epsilon, w + epsilon, h1 + h2 + 2 * epsilon]);\n }\n }\n}\n\nmodule quadstandoff(dx, dy, h, d1, d2) {\n for (x=[-dx,dx]\/2, y=[-dy,dy]\/2)\n standoff(x, y, h, d1, d2);\n}\n\nmodule case(with_exhaust = 1) {\n std_pitch = 2.54;\n pi_standoff_diameter = 5;\n pi_hull_dimensions = [60, 90, 20];\n hat_hull_dimensions = [72, 50, 28];\n corner_radius = 1;\n wall_thickness = 1.5;\n side_spacing = [5, 14, 38]; \/\/38\n\n \/\/ raspberry pi component support\n pi_standoffs = [49, 58];\n pi_standoff_height = 6;\n pi_offset = [0, -14, 0];\n\n \/\/ marv hat component support\n hat_standoffs = [64.92, 45.72, 12.4 + pi_standoff_height];\n hat_standoff_height = 12.4 + pi_standoff_height;\n hat_offset = [0, -19.4, 0];\n \n \/\/ tft component support\n tft_standoffs = [61, 35.56, 21.3 + pi_standoff_height];\n tft_standoff_height = 22.3 + pi_standoff_height;\n tft_offset = [0, 26, 0];\n \n standoff_outer = 5;\n standoff_inner = 1.75;\n bottom_offset = [0, 0, wall_thickness];\n case_hull_dimensions = vecmax(pi_hull_dimensions, hat_hull_dimensions) + side_spacing;\n \n module fan_cutout(x, z, r, s) {\n $fn = 50;\n epsilon = 0.01;\n screw_inner = 2.4;\n h = wall_thickness * 3 + 2 * epsilon;\n translate([0, 0, 0])\n cylinder(h = h, r = r);\n for (x = [-s, s], y = [-s, s])\n translate([x, y, 0])\n cylinder(d = screw_inner, h = h);\n }\n \n module exhaust_cutout() {\n for (x = [-11 : 11], y = [-4 : 4]) {\n translate([x * 3, y * 3, 0])\n cylinder(d = 2, h = 4);\n }\n }\n \n module bottom_screwholes(dx, dy) {\n for (x = [-dx\/2, dx\/2], y = [-dy\/2, dy\/2]) {\n translate([x, y, 0])\n cylinder(d = 2.9, h = 3);\n }\n }\n \n module teensy_usb_cutout() {\n cube([12, 6, 8], center=true);\n }\n \n module power_cutout() {\n cylinder(d=8, h=8);\n }\n \n module bottom () {\n difference() {\n translate ([0, 0, case_hull_dimensions[2] \/ 2])\n halfRoundedShell(case_hull_dimensions, corner_radius, wall_thickness);\n translate([0, -48, 16]) rotate([90, 0, 0])\n fan_cutout(0, 0, 12.1, 10);\n if (with_exhaust) {\n color(\"red\") translate([0, 53, 16]) rotate([90, 0, 0])\n exhaust_cutout();\n }\n color(\"red\") translate([0, 10, -1])\n bottom_screwholes(50, 50);\n color(\"red\") translate([11.5, -51, 35])\n teensy_usb_cutout();\n color(\"red\") translate([25, -48, 10]) rotate([90, 0, 0]) \n power_cutout();\n }\n }\n \n module sqstandoff(dxdy, h) \n quadstandoff(dxdy[0], dxdy[1], h, standoff_outer, standoff_inner);\n \n translate([0,0,0]) bottom();\n \n translate(pi_offset + bottom_offset) \n sqstandoff(pi_standoffs, pi_standoff_height);\n \n module hat_standoffs(pos) {\n h = 4;\n w = 5;\n wall_standoff(pos[0]\/2, pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, -pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(pos[0]\/2, -pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n }\n \n \/\/translate(hat_offset + bottom_offset) \n \/\/ sqstandoff(hat_standoffs, hat_standoff_height);\n translate(hat_offset + bottom_offset) \n hat_standoffs(hat_standoffs);\n \n module tft_wall_standoff(x, y, z, rz) \n wall_standoff(x, y, z, rz, 8, 4, 8, \n standoff_outer, standoff_inner);\n \n module tft_wall_standoffs(pos) {\n wall_standoff(pos[0]\/2, pos[1]\/2, pos[2], -90, 7, 4, 8, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, pos[1]\/2, pos[2], 90, 7, 4, 4, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, -pos[1]\/2, pos[2], 90, 7, 4, 4, \n standoff_outer, standoff_inner);\n wall_standoff(pos[0]\/2, -pos[1]\/2, pos[2], -90, 7, 4, 8, \n standoff_outer, standoff_inner);\n }\n \n module gps_wall_standoffs() {\n for (y=[2.27, -0.27-(2.54*7)]) \n wall_standoff(-33.27, y, 22.3 + pi_standoff_height, 90, 4, 4, 4, \n standoff_outer, standoff_inner);\n }\n \n \/\/translate(tft_offset + bottom_offset) \n \/\/ sqstandoff(tft_standoffs, tft_standoff_height);\n translate(tft_offset + bottom_offset) \n tft_wall_standoffs(tft_standoffs);\n\n gps_wall_standoffs();\n\n module faceplate_standoffs(pos) {\n h = 4;\n w = 2;\n wall_standoff(pos[0]\/2, pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, -pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(pos[0]\/2, -pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n }\n \n \n \n faceplate_standoffs([case_hull_dimensions[0] - 6, \n case_hull_dimensions[1] - 6, case_hull_dimensions[2]\/2]);\n}\n\n\nmodule components () {\n p = 2.54;\n pi3();\n translate([-p*6, 0, 1.5 + p + 8.5]) rotate([0, 0, 90]) hat(p);\n translate([30, 0, 26]) rotate([0, 0, -90]) tft();\n \/\/translate([20, -50, 16]) rotate([90, 0, 0]) lipo2000(with_wire=1);\n \/\/translate([-45, -50, 34]) rotate([90, 90, 0]) powerboost1000c(has_usb_out=0);\n \/\/translate([37, -30, 7]) rotate([0, 90, 0]) big_toggle_switch();\n}\n\np = 2.54;\n\n\/\/%translate([0,-4,7.5]) rotate([0,0,90]) components();\n\/\/%translate([0,35,-3]) rotate([0,0,0]) main_plate();\ncase(with_exhaust=1);\n\n","old_contents":"use \nuse \nuse \nuse \nuse \nuse \nuse \n\n$fn=20;\n\nfunction vecmax (a,b) = [for (i=[0:len(a)]) max(a[i],b[i])];\n\nmodule halfRoundedBox(d, r) {\n epsilon = 0.01;\n difference() {\n roundedBox(d, r);\n translate([-epsilon, -epsilon, d[2]\/2])\n cube([d[0] + epsilon * 4, \n d[1] + epsilon * 4, \n d[2]], center=true);\n }\n}\n\nmodule halfRoundedShell(d, r, t) {\n difference() {\n halfRoundedBox(d, r);\n translate([0,0,t]) halfRoundedBox([d[0]-t*2,d[1]-t*2,d[2]], r);\n }\n}\n\nmodule standoff(x, y, h, d1, d2) {\n translate([x, y, 0]) {\n difference() {\n cylinder(d=d1, h=h);\n cylinder(d=d2, h=h);\n }\n }\n}\n\nmodule wall_standoff(x, y, z, rz, w, h1, h2, d1, d2) {\n epsilon = 0.01;\n translate([x, y, z]) rotate([0, 0, rz]) {\n difference() {\n hull() {\n cylinder(d=d1, h=h1);\n translate([-d1\/2,0,0]) cube([d1, w, h1]);\n translate([-d1\/2,w,-h2]) cube([d1, w, h2]);\n }\n translate([0, 0, h1-h2]) cylinder(d=d2, h=h2);\n translate([-d1\/2 - epsilon, w, -h2 - epsilon]) \n cube([d1 + 2 * epsilon, w + epsilon, h1 + h2 + 2 * epsilon]);\n }\n }\n}\n\nmodule quadstandoff(dx, dy, h, d1, d2) {\n for (x=[-dx,dx]\/2, y=[-dy,dy]\/2)\n standoff(x, y, h, d1, d2);\n}\n\nmodule case(with_exhaust = 1) {\n std_pitch = 2.54;\n pi_standoff_diameter = 5;\n pi_hull_dimensions = [60, 90, 20];\n hat_hull_dimensions = [72, 50, 28];\n corner_radius = 1;\n wall_thickness = 1.5;\n side_spacing = [5, 14, 38];\n\n \/\/ raspberry pi component support\n pi_standoffs = [49, 58];\n pi_standoff_height = 5;\n pi_offset = [0, -14, 0];\n\n \/\/ marv hat component support\n hat_standoffs = [64.92, 44.92, 17.4];\n hat_standoff_height = 17.4;\n hat_offset = [0, -19, 0];\n \n \/\/ tft component support\n tft_standoffs = [61, 35.56, 26.3];\n tft_standoff_height = 27.3;\n tft_offset = [-3, 26, 0];\n \n standoff_outer = 5;\n standoff_inner = 1.75;\n bottom_offset = [0, 0, wall_thickness];\n case_hull_dimensions = vecmax(pi_hull_dimensions, hat_hull_dimensions) + side_spacing;\n \n module fan_cutout(x, z, r, s) {\n $fn = 50;\n epsilon = 0.01;\n screw_inner = 2.4;\n h = wall_thickness * 3 + 2 * epsilon;\n translate([0, 0, 0])\n cylinder(h = h, r = r);\n for (x = [-s, s], y = [-s, s])\n translate([x, y, 0])\n cylinder(d = screw_inner, h = h);\n }\n \n module exhaust_cutout() {\n for (x = [-11 : 11], y = [-4 : 4]) {\n translate([x * 3, y * 3, 0])\n cylinder(d = 2, h = 4);\n }\n }\n \n module bottom_screwholes(dx, dy) {\n for (x = [-dx\/2, dx\/2], y = [-dy\/2, dy\/2]) {\n translate([x, y, 0])\n cylinder(d = 2.9, h = 3);\n }\n }\n \n module bottom () {\n difference() {\n translate ([0, 0, case_hull_dimensions[2] \/ 2])\n halfRoundedShell(case_hull_dimensions, corner_radius, wall_thickness);\n translate([0, -48, 18]) rotate([90, 0, 0])\n fan_cutout(0, 0, 12.1, 10);\n if (with_exhaust) {\n color(\"red\") translate([0, 53, 16]) rotate([90, 0, 0])\n exhaust_cutout();\n }\n color(\"red\") translate([0, 0, -1])\n bottom_screwholes(35, 70);\n }\n }\n \n module sqstandoff(dxdy, h) \n quadstandoff(dxdy[0], dxdy[1], h, standoff_outer, standoff_inner);\n \n bottom();\n \n translate(pi_offset + bottom_offset) \n sqstandoff(pi_standoffs, pi_standoff_height);\n \n module hat_standoffs(pos) {\n h = 4;\n w = 5;\n wall_standoff(pos[0]\/2, pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, -pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(pos[0]\/2, -pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n }\n \n \/\/translate(hat_offset + bottom_offset) \n \/\/ sqstandoff(hat_standoffs, hat_standoff_height);\n translate(hat_offset + bottom_offset) \n hat_standoffs(hat_standoffs);\n \n module tft_wall_standoff(x, y, z, rz) \n wall_standoff(x, y, z, rz, 8, 4, 8, \n standoff_outer, standoff_inner);\n \n module tft_wall_standoffs(pos) {\n wall_standoff(pos[0]\/2, pos[1]\/2, pos[2], -90, 10, 4, 8, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, pos[1]\/2, pos[2], 90, 4, 4, 4, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, -pos[1]\/2, pos[2], 90, 4, 4, 4, \n standoff_outer, standoff_inner);\n wall_standoff(pos[0]\/2, -pos[1]\/2, pos[2], -90, 10, 4, 8, \n standoff_outer, standoff_inner);\n }\n \n module gps_wall_standoffs() {\n for (y=[2.27, -0.27-(2.54*7)]) \n wall_standoff(-33.27, y, 27.3, 90, 4, 4, 4, \n standoff_outer, standoff_inner);\n }\n \n \/\/translate(tft_offset + bottom_offset) \n \/\/ sqstandoff(tft_standoffs, tft_standoff_height);\n translate(tft_offset + bottom_offset) \n tft_wall_standoffs(tft_standoffs);\n\n gps_wall_standoffs();\n\n module faceplate_standoffs(pos) {\n h = 4;\n w = 2;\n wall_standoff(pos[0]\/2, pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(-pos[0]\/2, -pos[1]\/2, pos[2] - h, 90, w, h, h, \n standoff_outer, standoff_inner);\n wall_standoff(pos[0]\/2, -pos[1]\/2, pos[2] - h, -90, w, h, h, \n standoff_outer, standoff_inner);\n }\n \n \n \n faceplate_standoffs([case_hull_dimensions[0] - 6, \n case_hull_dimensions[1] - 6, side_spacing[2] - 5]);\n}\n\n\nmodule components () {\n p = 2.54;\n pi3();\n translate([-p*6, 0, 1.5 + p + 8.5]) rotate([0, 0, 90]) hat(p);\n translate([30, 3, 26]) rotate([0, 0, -90]) tft();\n \/\/translate([20, -50, 16]) rotate([90, 0, 0]) lipo2000(with_wire=1);\n \/\/translate([-45, -50, 34]) rotate([90, 90, 0]) powerboost1000c(has_usb_out=0);\n \/\/translate([37, -30, 7]) rotate([0, 90, 0]) big_toggle_switch();\n}\n\np = 2.54;\n\n%translate([0,-4,6.5]) rotate([0,0,90]) components();\ncase();\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cbfef6c4652174643ebe81e0ef89711697fafae6","subject":"The documentation was updated.","message":"The documentation was updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/name-tags\/nametag.scad","new_file":"OpenSCAD\/name-tags\/nametag.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3;\/\/3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconType = \"Trooper\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat]\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n","old_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3;\/\/3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconType = \"Trooper\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat]\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4956775e09c31dbea1a2bd30db22685cf45476a1","subject":"add another arch example","message":"add another arch example\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/shapes\/geometry\/arc\/projection\/parabola.scad","new_file":"openscad\/models\/src\/main\/openscad\/shapes\/geometry\/arc\/projection\/parabola.scad","new_contents":"\n\/\/ This was inspired by the post found here:\n\/\/\thttp:\/\/forum.openscad.org\/Parabolic-tube-tp28894p28897.html\n\nmodule parabola()\n{\n\/\/ projection(cut=false)\n projection(cut=true)\n rotate([0, 70, 0])\n cylinder(d1=20, d2=0, h = 30);\n}\n\n linear_extrude(50)\n difference()\n {\n parabola();\n \n translate([-1,0,0])\n parabola()\n\/\/ offset(-1)\n parabola();\n } \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/models\/src\/main\/openscad\/shapes\/geometry\/arc\/projection\/parabola.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"17b239091f15a949bbf1f8c004e0bf9a2ef618c5","subject":"Basic model of a single switch with assumed values","message":"Basic model of a single switch with assumed values","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/SlideSwitch.scad","new_file":"hardware\/vitamins\/SlideSwitch.scad","new_contents":"\/*\n Vitamin: SlideSwitch\n Model of various Slide Switches\n\n Derived from: http:\/\/www.maplin.co.uk\/p\/double-pole-miniature-fh36p\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is through the centre of the bottom hole\n\n Parameters: none\n\n Returns:\n Model of a slide switch with mounting holes\n*\/\n\n\nmodule SlideSwitch()\n{\n\n plate_w = 12.5;\n plate_l = 35.0;\n plate_h = 1.0; \/\/ FIXME: ASSUMED VALUE\n centres = 28.0; \/\/ distance between mounting holes\n\n tang_w = 5.0; \/\/ FIXME: ASSUMED VALUE\n tang_d = 5.0; \/\/ FIXME: ASSUMED VALUE\n tang_h = 10.0;\n tthrow = 5.5; \/\/ amount tang moves to actuate switch\n\n body_w = 24.0; \/\/ FIXME: ASSUMED VALUE\n body_d = 12.5; \/\/ FIXME: ASSUMED VALUE\n body_h = 8.0; \/\/ FIXME: ASSUMED VALUE\n\n tags_w = 2.5;\n tags_h = 5.0;\n tags_d = 1.0; \/\/ FIXME: ASSUMED VALUE\n tags_x = 8.0; \/\/ FIXME: ASSUMED VALUE\n tags_y = 8.0; \/\/ FIXME: ASSUMED VALUE\n\n tags_a = 2; \/\/ switch poles\n tags_b = 3; \/\/ switch throw\n\n \/\/ Mounting Plate\n\n color(Grey60)\n translate([0, centres\/2, 0]) \/\/ move origin to bottom hole\n linear_extrude(plate_h)\n {\n difference()\n {\n \/\/ mounting plate\n \/\/ TODO: Show rounded corners?\n square(size=[plate_w, plate_l], center=true);\n\n \/\/ mounting holes (M3 tapped)\n translate([0, centres\/2, 0])\n circle(d=3);\n translate([0, -centres\/2, 0])\n circle(d=3);\n\n \/\/ tang hole\n square(size=[tang_w, tang_d + tthrow], center=true);\n }\n }\n\n \/\/ Switch Tang\n\n color(Grey50)\n translate([0, centres\/2 + tthrow\/2, 0])\n linear_extrude(tang_h)\n {\n square(size=[tang_w, tang_d], center=true);\n }\n\n \/\/ Switch Body\n\n color(Grey50)\n translate([0, centres\/2, -body_h])\n linear_extrude(body_h)\n {\n square(size=[body_d, body_w], center=true);\n }\n\n \/\/ Switch Tags\n\n color(\"silver\")\n translate([-tags_x * (tags_a-1)\/2, centres\/2-tags_y*(tags_b-1)\/2, -body_h - tags_h])\n linear_extrude(tags_h)\n {\n for (x=[0 : tags_a-1], y=[0 : tags_b-1]) {\n translate([x * tags_x, y * tags_y, 0]) {\n square(size=[tags_d, tags_w], center=true);\n }\n }\n }\n}\n\n\n\/\/ Example Usage\n\/\/ SlideSwitch();\n","old_contents":"\/*\n Vitamin: SlideSwitch\n Model of various Slide Switches\n\n Derived from: http:\/\/www.maplin.co.uk\/p\/double-pole-miniature-fh36p\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is through the centre of the bottom hole\n\n Parameters: none\n\n Returns:\n Model of a slide switch with mounting holes\n*\/\n\n\nmodule SlideSwitch()\n{\n\n}\n\n\n\/\/ Example Usage\n\/\/ SlideSwitch();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"423e3b481556feb6c8dd3b73f54573d09129ae36","subject":"zaxis\/motormount: refactoring","message":"zaxis\/motormount: refactoring\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-motor-mount.scad","new_file":"z-axis-motor-mount.scad","new_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n difference()\n {\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"52fa4947648d4a954a882e26cecea554c24b5acb","subject":"misc: Rename sum_vec to v_sum","message":"misc: Rename sum_vec to v_sum\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position iV\nfunction sum_vec(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"dc7b1ca7ee9052189281ddc21851cb46452dae5e","subject":"metric\/screw: fix nut","message":"metric\/screw: fix nut\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n cylindera($fn=6, d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","old_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n cylindera(fn=6, d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4421b1f8b539cbb641cecbe8c8c89819a1472cf5","subject":"One piece version of E3D fan duct","message":"One piece version of E3D fan duct\n","repos":"ksuszka\/3d-projects","old_file":"kossel\/e3d-fan-duct-joined.scad","new_file":"kossel\/e3d-fan-duct-joined.scad","new_contents":"$fa=3;\n$fs=0.2;\n\nradiator_height = 26;\nradiator_diameter = 22;\nradiator_radius = radiator_diameter \/ 2;\nthin_wall_radius = 1;\nradiator_cut_angle = 65;\n\n\/\/%translate([-22, -19.6, 25.9])\n\/\/ rotate([-90, 0, 0])\n\/\/ import(\"Part1 - E3D_DoubleDuct2.stl\");\n\/\/color(\"green\") cylinder(r = radiator_diameter\/2, h = radiator_height);\n\/\/%translate([0,0,40]) import(\"Effector_E3d.stl\");\n\n\/\/%rotate([0,0,90]) translate([5.195,-3.384,24.52]) import(\"E3D_v6_To_Spec.stl\");\n\/\/%translate([19.35,0,26.2]) rotate([0,142,180]) import(\"Optional - Duct_40mm.stl\");\n\n\/\/cylinder(r=1.4, h=10, center=true);\n\n\/\/ fan mount part\nfan_width = 40;\nfan_wall_thickness = 1;\nfan_wall_spacing = 1;\nfan_mount_corner_radius = 3;\nfan_mount_distance_to_center = 35;\nfan_plate_thickness = 1;\nfan_duct_height = fan_width + 2 * fan_wall_thickness + 2 * fan_wall_spacing;\n\nmodule fan_mount() {\n fan_mount_thickness = 5 + fan_plate_thickness;\n module outer_hull() {\n linear_extrude(height=fan_mount_thickness) {\n offset(r=fan_mount_corner_radius + fan_wall_spacing + fan_wall_thickness)\n offset(delta=-fan_mount_corner_radius)\n square([fan_width, fan_width], true);\n };\n }\n module inner_hull() {\n translate([0,0,fan_plate_thickness])\n linear_extrude(height=fan_mount_thickness) {\n offset(r=fan_mount_corner_radius + fan_wall_spacing)\n offset(delta=-fan_mount_corner_radius)\n square([fan_width, fan_width], true);\n };\n }\n \/\/ cube([fan_width, fan_width, fan_plate_thickness], true);\n difference() {\n outer_hull();\n inner_hull();\n }\n}\n\/\/!fan_mount();\n\nmodule fan_screws_mold() {\n hole_dia = 4;\n hole_screw_head_dia = 8;\n hole_spacing = 32;\n \n for(x=[-hole_spacing\/2:hole_spacing:hole_spacing\/2])\n for(y=[-hole_spacing\/2:hole_spacing:hole_spacing\/2])\n union() {\n translate([x,y,50-1])\n cylinder(r=hole_dia\/2, h=100, center=true);\n translate([x*2,y*2,0])\n mirror([0,0,1])\n linear_extrude(height=fan_mount_distance_to_center, scale=0.7) {\n minkowski() {\n square([hole_spacing, hole_spacing],true);\n circle(r=hole_screw_head_dia\/2, center=true);\n }\n }\n }\n}\n\/\/!fan_screws_mold();\n\nmodule fan_mount_outer_hull_mold() {\n module outer_hull() {\n linear_extrude(height=200) {\n offset(r=fan_mount_corner_radius + fan_wall_spacing + fan_wall_thickness)\n offset(delta=-fan_mount_corner_radius)\n square([fan_width, fan_width], true);\n };\n }\n translate([0,0,-100])\n outer_hull();\n}\n\/\/!fan_mount_outer_hull_mold();\n\nmodule fan_mount_position() {\n translate([0,-fan_mount_distance_to_center,0])\n rotate([80,0,0])\n translate([0,fan_duct_height\/2,0])\n children();\n}\n\n\nmodule fan_mount_duct_part_mold() {\n fan_mount_position()\n translate([0,0,-50+fan_plate_thickness])\n cube([100,100,100],true);\n}\n\/\/!fan_mount_duct_part_mold();\n\n\/\/ A form of a radiator to be cut from other parts\nmodule radiator_trunk() {\n module holding_ring() {\n ring_number = 4;\n translate([0, 0, 0.75 + 2.5 * ring_number])\n rotate_extrude($fn=100)\n translate([radiator_diameter \/ 2, 0, 0])\n polygon ([[-1,0.5], [-1,1.5], [1,2], [1,0]]);\n }\n \n difference () {\n translate([0, 0, - 2*radiator_height])\n cylinder(r = radiator_diameter \/ 2, h = radiator_height * 4);\n holding_ring();\n }\n}\n\/\/!radiator_trunk();\n\nmodule mounting_plates() {\n width = 44;\n height = 22;\n thickness = 5;\n hole_x_distance = width \/ 2 - 4;\n hole_y1_distance = 6;\n hole_y2_distance = hole_y1_distance + 10;\n hole_radius = 1.25;\n difference() {\n minkowski() {\n translate([0, -thickness, height \/ 2]) cube([width - 2, thickness - 1, height - 2], center=true);\n rotate([90,0,0]) cylinder(r=1, h=1, center=true);\n }\n translate([hole_x_distance,0,hole_y1_distance])\n rotate([90,0,0]) cylinder(r=hole_radius, h=thickness*100, center=true);\n translate([hole_x_distance,0,hole_y2_distance])\n rotate([90,0,0]) cylinder(r=hole_radius, h=thickness*100, center=true);\n translate([-hole_x_distance,0,hole_y1_distance])\n rotate([90,0,0]) cylinder(r=hole_radius, h=thickness*100, center=true);\n translate([-hole_x_distance,0,hole_y2_distance])\n rotate([90,0,0]) cylinder(r=hole_radius, h=thickness*100, center=true);\n \/\/radiator_trunk();\n };\n}\n\/\/!mounting_plates();\n\n\/\/ A triangle-like shape cut from the front so air output is free\nmodule radiator_cut_2D() {\n polygon([[0,0],\n [-r*sin(radiator_cut_angle),r*cos(radiator_cut_angle)],\n [-r,r],\n [r,r],\n [r*sin(radiator_cut_angle),r*cos(radiator_cut_angle)]]);\n};\n\nmodule holding_arms_half_2D() {\n minkowski() {\n r = radiator_diameter; \/\/ much bigger then radiator radius\n intersection() {\n circle(radiator_radius + thin_wall_radius, center = true);\n polygon([[0,0],\n [r*sin(radiator_cut_angle),r*cos(radiator_cut_angle)],\n [r,r],\n [r,-r],\n [0,-r]]);\n }\n circle(r = thin_wall_radius);\n };\n};\n\nmodule trunk_half_2D() {\n hull () {\n translate([0, -fan_mount_distance_to_center, 0]) square([fan_width + fan_wall_thickness*2+ fan_wall_spacing*2,1],center=true);\n holding_arms_half_2D();\n }\n}\n\nmodule trunk_2D() {\n trunk_half_2D();\n mirror([1,0,0]) trunk_half_2D();\n}\n\nmodule holding_arms() {\n linear_extrude(height=26) {\n holding_arms_half_2D();\n mirror([1,0,0]) holding_arms_half_2D();\n }\n}\n\nmodule fan_duct_zy_mold() {\n rotate([90,0,90])\n linear_extrude(h=200,center=true)\n polygon([\n [100,0],\n [100,radiator_height],\n [0,radiator_height],\n [-9,radiator_height+1],\n [-9,100],\n [-100,0]]);\n}\n\nmodule fan_duct_trunk() {\n difference() {\n union() {\n intersection() {\n union() {\n air_duct_wall_mold(); \n holding_arms();\n }\n \/\/linear_extrude(height=50) trunk_2D();\n \/\/fan_mount_position() fan_mount_outer_hull_mold();\n fan_duct_zy_mold();\n fan_mount_duct_part_mold();\n\n }\n fan_mount_position() fan_mount();\n }\n fan_mount_position() fan_screws_mold();\n radiator_trunk();\n }\n}\n\nmodule fan_screws_walls_mold() {\n intersection() {\n fan_duct_trunk();\n fan_mount_position() minkowski() {\n fan_screws_mold();\n cube([1,1,fan_plate_thickness*2],true);\n }\n }\n}\n\n\nmodule air_duct_mold() {\n module back_plate() {\n fan_mount_position() translate([0,0,1]) cylinder(r=fan_width\/2-1, h=0.1, center=true);\n }\n module front_plate() {\n translate([-radiator_diameter\/2,-radiator_diameter\/2,1])\n cube([radiator_diameter, radiator_diameter\/2, radiator_height-2]);\n }\n module ideal_duct() {\n hull() {\n front_plate();\n back_plate();\n }\n }\n intersection() {\n ideal_duct();\n rotate([90,0,90])\n linear_extrude(h=200,center=true)\n polygon([\n [100,0],\n [100,radiator_height-1],\n [-radiator_diameter\/2+1,radiator_height-1],\n [-100,100],\n [-100,0]]);\n\n }\n}\n\nmodule air_duct_wall_mold() {\n minkowski() {\n air_duct_mold();\n \/\/cube([4,4,4],true);\n sphere(r=2);\n }\n}\n\nmodule final_part() {\n union() {\n difference() {\n fan_duct_trunk();\n air_duct_mold();\n }\n fan_screws_walls_mold();\n\/\/ difference() {\n\/\/ mounting_plates(); \n\/\/ radiator_trunk();\n\/\/ air_duct_mold();\n\/\/ }\n }\n}\n\ncolor(\"lightblue\")final_part();\n\/\/ color(\"lightblue\") mounting_plates(); \n\nmodule side_fan_mount_position() {\n translate([29,0,1])\n rotate([0,60,0])\n \/\/translate([0,fan_duct_height\/2,0])\n children();\n}\n\nmodule side_fan_mount_duct_part_mold() {\n side_fan_mount_position()\n translate([0,0,-50+fan_plate_thickness])\n cube([100,100,100],true);\n}\n\nmodule side_air_duct_mold() {\n module back_plate() {\n side_fan_mount_position() translate([0,0,1]) cylinder(r=fan_width\/2-1, h=0.1, center=true);\n }\n module front_plate() {\n translate([14,0,-15.5])\n cube([0.1,fan_width-10, 3],true);\n }\n module ideal_duct() {\n hull() {\n front_plate();\n back_plate();\n }\n }\n difference() {\n ideal_duct();\n rotate([90,0,0])\n linear_extrude(h=200,center=true)\n polygon([\n [21,30],\n [19,-1],\n [12, -20],\n [-100,0]]);\n\n }\n}\n\nmodule side_air_duct_wall_mold() {\n minkowski() {\n side_air_duct_mold();\n \/\/cube([4,4,4],true);\n sphere(r=1.5);\n }\n}\n\nmodule side_fan_duct_trunk() {\n difference() {\n union() {\n intersection() {\n side_air_duct_wall_mold(); \n side_fan_mount_duct_part_mold();\n translate([64,0,32]) cube([100,100,100],true);\n }\n side_fan_mount_position() fan_mount();\n }\n side_fan_mount_position() fan_screws_mold();\n }\n}\nmodule side_fan_screws_walls_mold() {\n intersection() {\n side_fan_duct_trunk();\n side_fan_mount_position() minkowski() {\n fan_screws_mold();\n cube([1,1,fan_plate_thickness*2],true);\n }\n }\n}\n\nmodule side_joint() {\n difference() {\n intersection() {\n translate([0,-9,0])\n rotate([90,0,0])\n linear_extrude(height=5,center=true)\n polygon([\n [30,20],\n [30,0],\n [10, 0],\n [10,20]]);\n side_fan_mount_duct_part_mold();\n }\n side_air_duct_mold();\n radiator_trunk();\n air_duct_mold();\n }\n \n}\n\nmodule side_final_part() {\n union() {\n difference() {\n side_fan_duct_trunk();\n side_air_duct_mold();\n }\n side_fan_screws_walls_mold();\n side_joint();\n }\n}\nside_final_part();\nmirror([1,0,0]) side_final_part();\n\n\n\n\/\/side_fan_duct_trunk();\n\/\/side_fan_mount_position() fan_mount();\n\/\/color(\"green\")side_air_duct_wall_mold();\n\/\/side_air_duct_wall_mold();\n\/\/color(\"red\")cube([30,1,1]);\n\/\/translate([0,0,-20])color(\"red\") cube([100,40,2], true);\nmodule side_mounting_plates() {\n width = 9;\n height = 22;\n thickness = 5;\n hole_x_distance = width \/ 2 - 4;\n hole_y1_distance = 6;\n hole_y2_distance = hole_y1_distance + 10;\n hole_radius = 1.5;\n translate([18.5,0,0])\n difference() {\n minkowski() {\n translate([0, 0, height \/ 2]) cube([width - 2, thickness - 1, height - 2], center=true);\n rotate([90,0,0]) cylinder(r=1, h=1, center=true);\n }\n translate([-hole_x_distance,0,hole_y1_distance])\n rotate([90,0,0]) cylinder(r=hole_radius, h=thickness*100, center=true);\n translate([-hole_x_distance,0,hole_y2_distance])\n rotate([90,0,0]) cylinder(r=hole_radius, h=thickness*100, center=true);\n \/\/radiator_trunk();\n };\n}\n\/\/side_mounting_plates();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kossel\/e3d-fan-duct-joined.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"247b3038f4df77e3e3c68b6a73ab02189b3c623c","subject":"Documentation was added for the scaling tweak needed for Thingiverse Customizer.","message":"Documentation was added for the scaling tweak needed for Thingiverse Customizer.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad","new_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Mark\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","old_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"Treble Clef\";\r\n\r\n\/\/TODO: update the logic to look out for two a left and right icon scale\r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.60; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.30; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Mark\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"cead28a5b4a28653aa9d7bf32c123d5f73190694","subject":"shapes: add cylindera and fncylindera","message":"shapes: add cylindera and fncylindera\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-shapes.scad","new_file":"utils-shapes.scad","new_contents":"module size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);\n%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);\n","old_contents":"module size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);\n%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2daea7014d1dd899472fefd83cf9000cd5535512","subject":"Delete R2-3D.scad","message":"Delete R2-3D.scad","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"Hardware\/OpenSCAD\/R2-3D.scad","new_file":"Hardware\/OpenSCAD\/R2-3D.scad","new_contents":"","old_contents":"include \ninclude \ninclude \ninclude \n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"cd8d630ae24bc408a6edd08c733cbdb0bf1af65a","subject":"This is a move refactor.","message":"This is a move refactor.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/shapes\/chain-loop\/examples\/loop-in-x-axis\/chain-loop-test.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/shapes\/chain-loop\/examples\/loop-in-x-axis\/chain-loop-test.scad","new_contents":"\r\nuse <..\/..\/chain-loop.scad>\r\n\r\ncolor(\"blue\")\r\ntranslate([0, -45, 0])\r\nchainLoop();\r\n\r\ntranslate([0, -22, 0])\r\nchainLoop(yLength = 17,\r\n zLength = 15,\r\n zPercentage=0.4319);\r\n\r\ncolor(\"orange\")\r\ntranslate([0, 0, 0])\r\nchainLoop(yPercentage = 0.368,\r\n zPercentage=0.4319);\r\n\r\ncolor(\"pink\")\r\ntranslate([0, 25, 0])\r\nchainLoop(xLength = 19,\r\n yLength = 17,\r\n yPercentage = 0.4,\r\n zLength = 15);\r\n\r\n","old_contents":"\r\nuse \r\n\r\ncolor(\"blue\")\r\ntranslate([0, -45, 0])\r\nchainLoop();\r\n\r\ntranslate([0, -22, 0])\r\nchainLoop(yLength = 17,\r\n zLength = 15,\r\n zPercentage=0.4319);\r\n\r\ncolor(\"orange\")\r\ntranslate([0, 0, 0])\r\nchainLoop(yPercentage = 0.368,\r\n zPercentage=0.4319);\r\n\r\ncolor(\"pink\")\r\ntranslate([0, 25, 0])\r\nchainLoop(xLength = 19,\r\n yLength = 17,\r\n yPercentage = 0.4,\r\n zLength = 15);\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"562265a19317bc45af5785a357eaccc25b32f771","subject":"huh... the damn thing works","message":"huh... the damn thing works\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube_with_enclosure.scad","new_file":"inverse_cube_with_enclosure.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\nhull_width = 7;\nstrut_width = 3;\n\necho(version());\necho(\"Total Size: ---------\");\necho(((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size);\necho(\"---------------------\");\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nmodule struts(total_length) {\n strut_length = total_length * sqrt(3) + hull_width \/ 2;\n \n for(i = [[35, 0, -45], [35, 0, 45], [-35, 0, 45], [-35, 0, -45]]) {\n rotate(i) {\n cube([strut_width, strut_length, strut_width], center = true);\n }\n }\n}\n\nmodule enclosure() {\n total_length = ((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size;\n \n union() {\n difference() {\n cube(total_length + hull_width, center = true);\n \n for(i = [[hull_width + 1, 0, 0], [0, hull_width + 1, 0], [0, 0, hull_width + 1], [-hull_width - 1, 0, 0], [0, -hull_width - 1, 0], [0, 0, -hull_width - 1]]) {\n translate(i) {\n cube(total_length, center = true);\n }\n }\n }\n \n struts(total_length);\n }\n}\n\nunion() {\n cube(init_size, center = true);\n aux_cubes(1, [0, 0, 0]);\n \n enclosure();\n \n}","old_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\nhull_width = 7;\nstrut_width = 3;\n\necho(version());\necho(\"Total Size: ---------\");\necho(((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size);\necho(\"---------------------\");\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nmodule struts(total_length) {\n strut_length = total_length * sqrt(3) + hull_width \/ 2;\n \n for(i = [[35, 0, -45], [35, 0, 45], [-35, 0, 45], [-35, 0, -45]]) {\n rotate(i) {\n cube([strut_width, strut_length, strut_width], center = true);\n }\n }\n}\n\nmodule enclosure() {\n total_length = ((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations))) \/ (1 - iteration_multiplier) * 2 + init_size;\n \n union() {\n difference() {\n cube(total_length + hull_width, center = true);\n \n for(i = [[hull_width + 1, 0, 0], [0, hull_width + 1, 0], [0, 0, hull_width + 1], [-hull_width - 1, 0, 0], [0, -hull_width - 1, 0], [0, 0, -hull_width - 1]]) {\n translate(i) {\n cube(total_length, center = true);\n }\n }\n }\n \n struts(total_length);\n }\n}\n\nunion() {\n \/\/cube(init_size, center = true);\n \/\/saux_cubes(1, [0, 0, 0]);\n \n enclosure();\n \n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"60b59dc13203c5f5dd6deb54c7384f758d3e56ff","subject":"belt_fastener: fix nut_trap_cut trap axis","message":"belt_fastener: fix nut_trap_cut trap axis\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"belt_fastener.scad","new_file":"belt_fastener.scad","new_contents":"include ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\nuse \nuse \n\n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=U, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*Y)\n translate(-1*11*mm*X)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n\n translate(-1*11*mm*X)\n nut_trap_cut(nut=tension_screw_nut, screw_offset=3*mm, cut_screw=true, orient=-X, trap_axis=-Y);\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extrasize=[0,1000,1*mm], extrasize_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extrasize=1000*Y, extrasize_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","old_contents":"include ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\nuse \nuse \n\n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=U, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*Y)\n translate(-1*11*mm*X)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n\n translate(-1*11*mm*X)\n nut_trap_cut(nut=tension_screw_nut, screw_offset=3*mm, cut_screw=true, orient=-X, trap_axis=Y);\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extrasize=[0,1000,1*mm], extrasize_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extrasize=1000*Y, extrasize_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6fb6ce6601914cfca293f0aa0795990b0657ec24","subject":"bearing: enable taper for ziptie cutouts","message":"bearing: enable taper for ziptie cutouts\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]*1.3, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]*1.3, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5761f6c53d3ac6f18942044a9ab5e741c204ac45","subject":"Moar tweaks for enclosure v2","message":"Moar tweaks for enclosure v2\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 1.6;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 11;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 20;\ndynamic_y = shift_y + 31.5;\ndynamic_r = 15.2;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 2;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 6;\nsocket_int = 15.6;\nstart_socket_x = 6 + shift_x;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 31;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 13;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 3;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ gaika\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1e59171f93f9e430b103743c81bc97d7d3b77a38","subject":"Tweak measurements to better fit tank.","message":"Tweak measurements to better fit tank.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\n\/\/thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n difference() {\n cube([thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\n\/\/thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions (NOTE: from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 190; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n difference() {\n cube([thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5f1d4f5d489514c419efb35561679715dd8d516c","subject":"main: fix gantry extrusion (use linear_extrusion)","message":"main: fix gantry extrusion (use linear_extrusion)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n color(color_part)\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=Z);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n color(color_gantry_connectors)\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n color(color_gantry_connectors)\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n color(color_part)\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=Z);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n color(color_gantry_connectors)\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n color(color_gantry_connectors)\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d3440231b458770a347afd3bed3321fcd2046be9","subject":"support draft","message":"support draft\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/support.scad","new_file":"tablet_toilet_mount\/support.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"79d7f08c6ea3531a1c37aeaae04c02194553f255","subject":"resized depth","message":"resized depth\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 390;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 40 * 2;\n cut_width = 440;\n cut_offset = 1.0;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 40 * 2;\n cut_width = 440;\n cut_offset = 1.0;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"85d257c25470da0ab9ee176faf8908bab86ac01c","subject":"correct servo dimensions","message":"correct servo dimensions\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/BubbleCopter,DanNixon\/Multirotors","old_file":"Komachi\/modules\/servo_cutout.scad","new_file":"Komachi\/modules\/servo_cutout.scad","new_contents":"\/* For Tower Pro 9g servos *\/\n\nfunction ServoCutoutSize() = [13.1, 23.1];\nfunction ServoHoleDiameter() = 2;\n\nmodule ServoCutout()\n{\n square(ServoCutoutSize(), center = true);\n\n dy = (ServoCutoutSize()[1] + 5) \/ 2;\n for(y = [-dy, dy])\n translate([0, y])\n circle(d = ServoHoleDiameter(), $fa = 1, $fs = 0.1);\n}\n","old_contents":"\/* For Tower Pro 9g servos *\/\n\nfunction ServoCutoutSize() = [11.8, 22.2];\nfunction ServoHoleDiameter() = 3;\n\nmodule ServoCutout()\n{\n square(ServoCutoutSize(), center = true);\n\n dy = (ServoCutoutSize()[1] + 5) \/ 2;\n for(y = [-dy, dy])\n translate([0, y])\n circle(d = ServoHoleDiameter(), $fa = 1, $fs = 0.1);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6659dc2508058f9b89d3551bc4a0e22ffabda034","subject":"axialfan: add","message":"axialfan: add\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"axialfan.scad","new_file":"axialfan.scad","new_contents":"\/\/ Remixed from MiseryBot's original work: http:\/\/www.thingiverse.com\/thing:8063\ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule axialfan(width, depth, mount_dist, thread, head_embed=true, corner_radius=3, blade_angle=-45, bore_dia_walls=1.5, orient=[0,0,1], align=[0,0,0])\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=[0,0,-1], align=align)\n {\n bore_diameter = width - bore_dia_walls;\n s = [width, width, depth];\n difference()\n {\n union()\n {\n roundedBox(size=s, radius=corner_radius, sidesonly=true);\n }\n\n difference()\n {\n cylindera(d=bore_diameter, h=depth+.2, orient=[0,0,1]);\n cylindera(d=bore_diameter\/2 + 2*mm, h=depth+.2, orient=[0,0,1]);\n }\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=depth, head_embed=head_embed, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n axialfan_blades(width=bore_diameter, depth=depth, blade_angle=blade_angle);\n }\n}\n\n\nmodule axialfan_cut(width, depth, tolerance=.3*mm, mount_dist, screw_l, thread, head_embed=true, orient=[0,0,1], align=[0,0,0])\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=[0,0,-1], align=align)\n {\n cubea(size=s, extrasize=[tolerance,tolerance,tolerance]);\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=screw_l, head_embed=head_embed, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n}\n\nmodule body(width, depth, bore_diameter, mount_dist, corner_radius, thread)\n{\n\n}\n\nmodule axialfan_blades(width, depth, angle)\n{\n linear_extrude(height=depth-1, center = true, convexity = 4, twist = angle)\n {\n for(i=[0:6])\n rotate((360*i)\/7)\n translate([0,-1.5\/2]) square([width\/2-0.75,1.5]);\n }\n}\n\n\nif(false)\n{\n axialfan(width=40*mm, depth=10.5*mm, mount_dist=32*mm, thread=ThreadM3, orient=[0,1,0], align=[0,0,0]);\n %axialfan_cut(width=40*mm, depth=10.5*mm, mount_dist=32*mm, screw_l=25*mm, thread=ThreadM3, orient=[0,1,0], align=[0,0,0]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'axialfan.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5828f016e40f61732f0d8bfe335e1235851201a7","subject":"bearings\/bearing_mount_holes: extend with ziptie_dist param","message":"bearings\/bearing_mount_holes: extend with ziptie_dist param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"bearings.scad","new_file":"bearings.scad","new_contents":"use ;\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\nmodule bearing(bearing_type, orient=[0,0,1])\n{\n orient(orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, orient=[1,0,0], ziptie_dist=undef)\n{\n orient(orient)\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n }\n\n difference()\n {\n union()\n {\n ziptie_dist_ = ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist;\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[0,0,1]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[0,0,1]);\n }\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n }\n}\n","old_contents":"use ;\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\nmodule bearing(bearing_type, orient=[0,0,1])\n{\n orient(orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, orient=[1,0,0])\n{\n orient(orient)\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate([0,0,i*bearing_type[3]\/2])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[0,0,1]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[0,0,1]);\n }\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1d432805cfd2bb70b5652436f6a1bef7255d327b","subject":"feat: add an operator to animate a rotation","message":"feat: add an operator to animate a rotation\n","repos":"jsconan\/camelSCAD","old_file":"operator\/animate\/rotate.scad","new_file":"operator\/animate\/rotate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that animate child modules with respect to particular rules.\n *\n * @package operator\/animate\n * @author jsconan\n *\/\n\n\/**\n * Rotates the child modules, interpolating the angles with respect to the `$t` variable.\n *\n * @param Vector [from] - The angles from where start the interpolation.\n * @param Vector [to] - The angles to where end the interpolation.\n * @param Number [start] - The start threshold under what the from-angles will persist and above what it will be interpolated.\n * @param Number [end] - The end threshold above what the to-angles will persist and under what it will be interpolated.\n * @param Number [domain] - The percentage domain used to compute the thresholds (default: 100).\n * @param Vector [values] - A list of angles composing the range to interpolate.\n * @param Vector [range] - A pre-built interpolation range. If missing, it will be built from the parameters `from`, `to`, `start`, `end`, `domain`.\n * @returns Number\n *\/\nmodule rotateAnimate(from, to, start, end, domain, values, range) {\n rotate(interpolateStep3D(step=$t, low=from, high=to, start=start, end=end, domain=domain, values=values, range=range)) {\n children();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'operator\/animate\/rotate.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"359afd38108666ad284f44686586aa251a38d386","subject":"adjust camera stand to fit in the zoom compartement","message":"adjust camera stand to fit in the zoom compartement\n","repos":"DamCB\/mush","old_file":"scad\/openscad\/detection.scad","new_file":"scad\/openscad\/detection.scad","new_contents":"use ;\n$fn = 36;\nphi_ext = 26;\n\n\n\n\n\nmodule camera(){\n\/\/ http:\/\/www.arducam.com\/spy-camera-raspberry-pi\/\n\/\/ Not the same cam exactly, but view angle is given\n\/\/ as 54x41\u00b0, i.e 0.94 rad\n translate([0, 0, 2]) cylinder(d=7.4, h=3);\n translate([0, 1.5, 1.5]) cube([8.5, 11.3, 3], center=true);\n translate([0, 7, -1.2])\n union(){\n rotate([0, 0, -90]) translate([0, 3.75, 0]) rotate([90, 0, 0])\n difference(){\n cylinder(d=4, h=7.5);\n translate([0, 0, -1]) cylinder(d=3.6, h=9, $fn=36);\n translate([0, -5, -1]) cube(10);\n }\n translate([-3.75, -12, -2]) cube([7.5, 12, 0.2], center=false);\n }\n}\n\n\n\nmodule base_plate(){\n difference(){\n cylinder(d=phi_ext, h=6);\n for (i=[0:5])\n rotate([0, 0, 60*i]) translate([-phi_ext\/2+1, 0, 0.9])\n union(){\n translate([0, -3.5, -1]) cylinder(h=10, d=3);\n translate([0, 3.5, -1]) cylinder(h=10, d=3);\n }\n }\n}\n\n\nmodule camera_stand(){\n difference(){\n base_plate();\n translate([0, 2.5, 1.5]) cube([8.6, 13.6, 3], center=true);\n translate([0, 0, -2]) cylinder(d=7.8, h=12);\n translate([0, 0, 3]) ring(6, 22, 30);\n }\n}\n\n\nmodule lens_75(){\n translate([0, 0, -5.2]) union(){\n translate([0, 0, 0]) ring(3.2, 4.4, 8.4);\n translate([0, 0, -3.2]) ring(3.2, 7.2, 9.2);\n }\n}\n\n\nmodule lens_75_stand(){\n difference(){\n base_plate();\n translate([0, 0, -2]) cylinder(d=9.3, h=5.2);\n translate([0, 0, -2]) cylinder(d=8.1, h=12);\n }\n}\n\n\nmodule sequins_stand(){\n difference(){\n translate([0, 0, -5]) base_plate();\n for (i=[0:5])\n rotate([0, 0, 60*i]) translate([-10, 0, -1])\n union(){\n cube([2.2, 9.2, 4.2], center=true);\n translate([2, 0, 0.1]) cube([4, 6, 4.1], center=true);\n }\n translate([0, 0, -8]) cylinder(d=16, h=12);\n\n }\n}\n\n\nmodule leds_sequins(){\n for (i=[0:5])\n rotate([0, 0, 60*i]) translate([-10, 0, -1]) sequin();\n}\n\n\/\/\nmodule sequin(){\n difference() {\n minkowski(){\n cube([1, 7, 2], center=true);\n rotate([0, 90, 0]) cylinder(r=1, h=1, center=true);\n }\n translate([-2, 3.5, 0]) rotate([0, 90, 0]) cylinder(r=0.5, h=4);\n translate([-2, -3.5, 0]) rotate([0, 90, 0]) cylinder(r=0.5, h=4);\n }\n translate([1., 0, 1]) cube([0.4, 0.4, 0.4], center=true);\n}\n\n\nmodule detection(){\n translate([0, 0, -17.65]) union() {\n camera_stand();\n camera();\n translate([0, 0, 6.05]) lens_75_stand();\n }\n}\n\n\n\/* difference(){ *\/\n\/* union(){ *\/\n\/* color(c=[0.2, 0.0, 0.1, 0.3]) {detection();} *\/\n\/* color(c=[0.8, 0.0, 0.1, 0.3]) {lens_75();} *\/\n\/* } *\/\n\/* translate([-30, 0, 0]) cube([60, 60, 60], center=true); *\/\n\/* } *\/\n\n\ndifference(){\n union(){\n\ncolor([0.1, 0.1, 0.6]) {translate([0, 0, 0.1]) leds_sequins();}\nsequins_stand();\ncolor(c=[0.4, 0.8, 0.4]) {detection();}\n\ncolor(c=[0.8, 0.1, 0.1]) {lens_75();}\ntranslate([0, 0, 2.1]) ring(1, 22.9, phi_ext);\n\n }\n translate([-30, 0, 0]) cube([60, 60, 60], center=true);\n}\n\n\n\/\/detection();\n","old_contents":"use ;\n$fn = 36;\nphi_ext = 26;\n\n\n\n\n\nmodule camera(){\n\/\/ http:\/\/www.arducam.com\/spy-camera-raspberry-pi\/\n\/\/ Not the same cam exactly, but view angle is given\n\/\/ as 54x41\u00b0, i.e 0.94 rad\n translate([0, 0, 2]) cylinder(d=7.4, h=3);\n translate([0, 1.5, 0.5]) cube([8.5, 11.3, 3], center=true);\n translate([0, 7, -2.2])\n union(){\n rotate([0, 0, -90]) translate([0, 3.75, 0]) rotate([90, 0, 0])\n difference(){\n cylinder(d=4, h=7.5);\n translate([0, 0, -1]) cylinder(d=3.6, h=9, $fn=36);\n translate([0, -5, -1]) cube(10);\n }\n translate([-3.75, -12, -2]) cube([7.5, 12, 0.2], center=false);\n }\n}\n\n\n\nmodule base_plate(){\n difference(){\n cylinder(d=phi_ext, h=6);\n for (i=[0:5])\n rotate([0, 0, 60*i]) translate([-phi_ext\/2+1, 0, 0.9])\n union(){\n translate([0, -3.5, -1]) cylinder(h=10, d=3);\n translate([0, 3.5, -1]) cylinder(h=10, d=3);\n }\n }\n}\n\n\nmodule camera_stand(){\n difference(){\n base_plate();\n translate([0, 1.5, 0.5]) cube([8.6, 11.6, 3], center=true);\n translate([0, 0, -2]) cylinder(d=7.8, h=12);\n }\n}\n\n\nmodule lens_75(){\n translate([0, 0, -5.2]) union(){\n translate([0, 0, 0]) ring(3.2, 4.4, 8.4);\n translate([0, 0, -3.2]) ring(3.2, 7.2, 9.2);\n }\n}\n\n\nmodule lens_75_stand(){\n difference(){\n base_plate();\n translate([0, 0, -2]) cylinder(d=9.3, h=5.2);\n translate([0, 0, -2]) cylinder(d=8.1, h=12);\n }\n}\n\n\nmodule sequins_stand(){\n difference(){\n translate([0, 0, -5]) base_plate();\n for (i=[0:5])\n rotate([0, 0, 60*i]) translate([-10, 0, -1])\n union(){\n cube([2.2, 9.2, 4.2], center=true);\n translate([2, 0, 0.1]) cube([4, 6, 4.1], center=true);\n }\n translate([0, 0, -8]) cylinder(d=16, h=12);\n\n }\n}\n\n\nmodule leds_sequins(){\n for (i=[0:5])\n rotate([0, 0, 60*i]) translate([-10, 0, -1]) sequin();\n}\n\n\/\/\nmodule sequin(){\n difference() {\n minkowski(){\n cube([1, 7, 2], center=true);\n rotate([0, 90, 0]) cylinder(r=1, h=1, center=true);\n }\n translate([-2, 3.5, 0]) rotate([0, 90, 0]) cylinder(r=0.5, h=4);\n translate([-2, -3.5, 0]) rotate([0, 90, 0]) cylinder(r=0.5, h=4);\n }\n translate([1., 0, 1]) cube([0.4, 0.4, 0.4], center=true);\n}\n\n\nmodule detection(){\n translate([0, 0, -17.65]) union() {\n camera_stand();\n camera();\n translate([0, 0, 6.05]) lens_75_stand();\n }\n}\n\n\n\/* difference(){ *\/\n\/* union(){ *\/\n\/* color(c=[0.2, 0.0, 0.1, 0.3]) {detection();} *\/\n\/* color(c=[0.8, 0.0, 0.1, 0.3]) {lens_75();} *\/\n\/* } *\/\n\/* translate([-30, 0, 0]) cube([60, 60, 60], center=true); *\/\n\/* } *\/\n\ncolor([0.1, 0.1, 0.6]) {translate([0, 0, 0.1]) leds_sequins();}\nsequins_stand();\ncolor(c=[0.4, 0.8, 0.4]) {detection();}\n\ncolor(c=[0.8, 0.1, 0.1]) {lens_75();}\ntranslate([0, 0, 2.1]) ring(1, 20, phi_ext);\n\n\n\/\/detection();\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"35362ad6db1c6f7305d4c3a7d7529945f8a51235","subject":"nine has tub for breadboard.","message":"nine has tub for breadboard.\n","repos":"chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella","old_file":"cad\/mezzanine.scad","new_file":"cad\/mezzanine.scad","new_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes a well for a breadboard and\n\/\/ rivet holes for a battery.\nthickness = 4;\nwide_y = 36; \/\/ The length of the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = 86; \/\/ Greatest extent of the plate\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nnarrow_x= 45; \/\/ 1\/2 width of the battery holder\nbreadboard_x = 52; \/\/ Chopped\nbreadboard_y = 26; \/\/ Chopped\nbreadboard_z = 10;\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = 30; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\nrivet1_x = 54;\nrivet2_x = 60;\nrivet_y = 8;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ This is the holder for the chopped off breadboard.\n\/\/ rwidth is the rim width\nmodule tub(z,rwidth) {\n linear_extrude(height=z,center=false,convexity=10) {\n difference() {\n square([breadboard_x+2*rwidth,breadboard_y+2*rwidth],true);\n square([breadboard_x,breadboard_y],true);\n }\n }\n}\n\/\/ Subtract this from the base platform\n\/\/ These are the posts\nmodule post_holes(z) {\n for(i=[[pillar_x,-pillar_y],[-pillar_x,-pillar_y]]) {\n translate(i)\n cylinder(r=5,h=z,$fn=6);\n }\n}\n\n\/\/ These are the various holes for rivets\n\/\/ z - thickness\nmodule rivet_holes(z) {\n for(i=[[rivet1_x,-rivet_y],[rivet2_x,-rivet_y],\n [-rivet1_x,-rivet_y],[-rivet2_x,-rivet_y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the GPIO pins.\n\/\/ This object cannot be translated once created.\n\/\/ y is negative towards us. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n \/\/ place 4 circles in the corners, with the rounding radius\n translate([-wide_x+round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,-wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,-wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate.\n\/\/ There should be no rim where the hulls join\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, -wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, -wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, -full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth,-full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\ndifference() {\n base(thickness);\n rivet_holes(thickness);\n post_holes(thickness);\n}\ntranslate([0,0,thickness\/2])\ndifference() {\n base(thickness);\n base_cutout(thickness,rim);\n }\n translate([0,-breadboard_y\/2,thickness\/2])\n tub(thickness,rim);\n \n","old_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes a well for a breadboard and\n\/\/ rivet holes for a battery.\nthickness = 4;\nwide_y = 26; \/\/ The length of the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = 86; \/\/ Greatest extent of the plate\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nnarrow_x= 45; \/\/ 1\/2 width of the battery holder\nbreadboard_x = 52; \/\/ Chopped\nbreadboard_y = 26; \/\/ Chopped\nbreadboard_z = 10;\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = 30; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\nrivet1_x = 54;\nrivet2_x = 60;\nrivet_y = 8;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the GPIO pins.\n\/\/ This object cannot be translated once created.\n\/\/ y is negative towards us. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n \/\/ place 4 circles in the corners, with the rounding radius\n translate([-wide_x+round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,-wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,-wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate.\n\/\/ There should be no rim where the hulls join\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n union() {\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, -wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, -wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n }\n };\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, -full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth,-full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, -wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\nbase(thickness);\ntranslate([0,0,thickness\/2])\ndifference() {\n base(thickness);\n base_cutout(thickness,rim);\n }","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"639010b91ac4e1b99c2ea0bd1f74433e608e137d","subject":"Fixed type in comment.","message":"Fixed type in comment.\n","repos":"RigacciOrg\/ProTherm,RigacciOrg\/ProTherm,RigacciOrg\/ProTherm","old_file":"case\/scad\/protherm-enclosure.scad","new_file":"case\/scad\/protherm-enclosure.scad","new_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.4;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.5;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n screw_diameter = 2.2;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=(screw_diameter * 0.75 \/ 2), h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Push-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.2;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n","old_contents":"\/\/See:\n\/\/ http:\/\/edutechwiki.unige.ch\/en\/OpenScad_beginners_tutorial\n\/\/ https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/\n\n\/\/ Global variables.\novercut = 0.1; \/\/ Overcut for solid difference(), to assure complete holes.\noverlap = 0.1; \/\/ Intersection for solid union() to avoid the manifold problem.\n\ninclude ;\ninclude ;\ninclude ;\n\n\/\/ Box internal size.\nx_size = 115.0;\ny_size = 144.0;\nz_size = 29.0;\nthick = 2.2;\nchamfer = 13.0;\n\n\/\/ Mounting screw holes.\nscrew_hole1_y = 24;\nscrew_hole2_y = y_size - 26;\nscrew_diam = 3.6;\n\n\/\/ Position and size of push button hole.\nbutton_x = x_size;\nbutton_y = 64;\nbutton_z = 16.0;\nbutton_d = 6.4;\n\n\/\/ Position and size of power socket hole.\npsocket_x = x_size \/ 2;\npsocket_z = 7;\npsocket_d = 8.2;\n\n\/\/ Position and size for temperature sensor grommet.\ntsensor_x = -thick - 1;\ntsensor_y = 78;\ntsensor_z = 13;\ntsensor_h = thick + 9;\ntsensor_d1 = 9.0;\ntsensor_d2 = 5.5;\n\n\/\/ Positon and size for boiler cable grommet (cable is 5.5 x 3.5 mm).\nbcable_x = 19;\nbcable_y = -thick - 1;\nbcable_z = 9.5;\nbcable_h = thick + 9;\nbcable_t = 1.7; \/\/ Grommet thickness\nbcable_d1 = 5.4; \/\/ Rectangular hole X\nbcable_d2 = 3.4; \/\/ Rectangular hole Y\nbcable_r = 1.5; \/\/ Chamfer radius\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housing for a rubber foot.\n\/\/-------------------------------------------------------------------------\nmodule rubber_foot(d1, d2, h) {\n $fn = 48;\n difference() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + overcut * 2));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Housings for rubber feet (grows towards negative z axis).\n\/\/-------------------------------------------------------------------------\nmodule box_feet(x, y, margin) {\n d1 = 11.0;\n d2 = 8.2;\n h = 0.8;\n translate([margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([x - margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n translate([margin, y - margin, -h]) rubber_foot(d1, d2, h + overlap);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Flange for screw hole.\n\/\/-------------------------------------------------------------------------\nmodule screw_flange(r, t) {\n $fn = 60;\n screw_diameter = 2.2;\n r1 = r * 1.1;\n difference() {\n intersection() {\n cylinder(r=r1, h=t);\n union() {\n translate([r, r, 0]) cylinder(r=r, h=t);\n translate([r, 0, 0]) cube([r, r, t]);\n translate([0, r, 0]) cube([r, r, t]);}}\n translate([r1 \/ 2, r1 \/ 2, -overcut]) cylinder(r=(screw_diameter * 0.75 \/ 2), h=(t + overcut * 2), $fn=24);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Add a flange to the rounded_box() module.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_flange(x, y, z, r) {\n w = 1.5;\n difference() {\n rounded_cube(x_size, y_size, z, r);\n translate([w, w, -overcut])\n rounded_cube(x_size - w * 2, y_size - w * 2, z + overcut * 2, r);\n }\n translate([0, 0, 0]) rotate(a=0 , v=[0, 0, 1]) screw_flange(r, z);\n translate([x, 0, 0]) rotate(a=90, v=[0, 0, 1]) screw_flange(r, z);\n translate([x, y, 0]) rotate(a=180, v=[0, 0, 1]) screw_flange(r, z);\n translate([0, y, 0]) rotate(a=270, v=[0, 0, 1]) screw_flange(r, z);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Round cable grommet.\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet(h, d1, d2) {\n $fn = 32;\n cut_width = 3;\n difference() {\n union() {\n cylinder(r=(d1 \/ 2), h=h);\n translate([0, 0, h - 2.4]) cylinder(r=((d1 + 1.0) \/ 2), h=2.4);\n }\n translate([0, 0, -overcut]) cylinder(r=(d2 \/ 2), h=(h + 2 * overcut));\n translate([(d2 \/ 4), -(d1 \/ 2), h - (cut_width + 2.5)])\n cube([(d1 \/ 2), d1, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Rectangular (with chamfer) cable grommet.\n\/\/ h = height, x, y = hole inner size, r = chamfer radius, t = thickness\n\/\/-------------------------------------------------------------------------\nmodule cable_grommet_rect(h, x, y, r, t) {\n cut_width = 3;\n difference() {\n union() {\n translate([-x \/ 2, -y \/ 2, 0]) rounded_cube_border(x, y, h, r, t);\n translate([-x \/ 2, -y \/ 2, h - 2.4]) rounded_cube_border(x, y, 2.4, r, t + 0.5);\n }\n translate([-(x \/ 2) - t - overcut, 0, h - (cut_width + 2.5)])\n cube([x + (t + overcut) * 2, y \/ 2 + t + overcut, cut_width]);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a screw hole with cuts for horizontal and vertical wall mount.\n\/\/ Screw body diameter is d, head diameter will be d * 2.\n\/\/-------------------------------------------------------------------------\nmodule screw_hole(d, depth) {\n $fn = 32;\n hole_depth = depth + overcut * 2;\n hole_bottom = -(depth + overcut);\n cut_length = d * 2;\n union() {\n translate([0, 0, hole_bottom]) cylinder(r=d, h=hole_depth);\n translate([-(d \/ 2), 0, hole_bottom]) cube([d, cut_length, hole_depth]);\n translate([0, -(d \/ 2), hole_bottom]) cube([cut_length, d, hole_depth]);\n translate([0, cut_length, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n translate([cut_length, 0, hole_bottom]) cylinder(r=(d \/ 2), h=hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Build a cap to place over a screw hole.\n\/\/ Screw body diameter = d\n\/\/ Screw head diameter = d * 2\n\/\/ Screw head height = d * 0.6\n\/\/-------------------------------------------------------------------------\nmodule screw_hole_cap(d, thick) {\n $fn = 36;\n r2 = 1.4142;\n pin_radius = thick * 1.3;\n pin_heigh = (d * 0.6) + (overlap * 2);\n pin_base = -overlap;\n offset = (((pin_radius * r2) - pin_radius) \/ r2) + ((pin_radius * 2) \/ r2) + (d \/ r2);\n size1 = (offset + overlap) * 2;\n size2 = size1 + d * 2;\n translate([-(size1 \/ 2), -(size1 \/ 2), 0]) {\n union() {\n translate([0, 0, d * 0.6]) rounded_cube(size1, size2, thick, pin_radius);\n translate([0, 0, d * 0.6]) rounded_cube(size2, size1, thick, pin_radius);\n translate([pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size2 - pin_radius, size1 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([size1 - pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n translate([pin_radius, size2 - pin_radius, pin_base]) cylinder(r=pin_radius, h=pin_heigh);\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with the requested internal size and rounded corners.\n\/\/ The origin is the lower-left internal corner.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box(x_size, y_size, z_size, chamfer, thick) {\n cover_thick = 2;\n union() {\n translate([-overlap, -overlap, -thick])\n rounded_cube(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n rounded_cube_border(x_size, y_size, z_size + thick, chamfer, thick);\n translate([-overlap, -overlap, z_size - cover_thick - thick])\n rounded_box_flange(x_size + overlap * 2, y_size + overlap * 2, thick, chamfer + overlap);\n translate([0, 0, -thick])\n box_feet(x_size, y_size, 10);\n \/\/ Draw the box cover, for dimension testing.\n \/\/translate([0, 0, z_size - cover_thick]) \n \/\/ %rounded_cube(x_size, y_size, cover_thick, chamfer);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Make a box with rounded corners, drill all the required holes.\n\/\/-------------------------------------------------------------------------\nmodule rounded_box_holes(x_size, y_size, z_size, chamfer, thick) {\n\n holes_diam = 3.5;\n\n \/\/ Boiler cable grommet.\n translate([bcable_x, bcable_y, bcable_z])\n rotate(a=180, v=[0, 1, 0])\n rotate(a=270, v=[1, 0, 0])\n cable_grommet_rect(bcable_h, bcable_d1, bcable_d2, bcable_r, bcable_t);\n\n \/\/ Temperature sensor cable grommet.\n translate([tsensor_x, tsensor_y, tsensor_z])\n rotate(a=90, v=[1, 0, 0])\n rotate(a=90, v=[0, 1, 0])\n cable_grommet(tsensor_h, tsensor_d1, tsensor_d2);\n\n difference() {\n rounded_box(x_size, y_size, z_size, chamfer, thick);\n\n \/\/ Bottom venting holes.\n translate([x_size \/ 2, 0, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(12, 3, holes_diam, thick);\n\n \/\/ Top venting holes.\n translate([x_size \/ 2, y_size + thick, z_size \/ 2])\n rotate(a=90, v=[1, 0, 0]) vent_holes(11, 3, holes_diam, thick);\n\n \/\/ Backplane venting holes.\n translate([83, 88, -thick]) vent_holes(8, 6, holes_diam, thick);\n translate([25, 38, -thick]) vent_holes(5, 4, holes_diam, thick);\n\n \/\/ Mounting screw holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) screw_hole(screw_diam, thick);\n\n \/\/ Temperature sensor hole.\n translate([-(thick + overcut), tsensor_y, tsensor_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(tsensor_d2 \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Bush-button hole.\n translate([button_x - overcut, button_y, button_z])\n rotate(a=90, v=[0, 1, 0]) cylinder(r=(button_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Power socket hole.\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n\n \/\/ Boiler cable hole.\n translate([bcable_x, bcable_y - overcut, bcable_z])\n rotate(a=270, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, bcable_h + overcut * 2, bcable_r);\n\n }\n\n \/\/ Reinforce for power socket hole.\n difference() {\n translate([psocket_x, 0, psocket_z]) rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2) + 2.5, h=thick);\n translate([psocket_x, overcut, psocket_z])\n rotate(a=90, v=[1, 0, 0]) cylinder(r=(psocket_d \/ 2), h=(thick + overcut * 2), $fn=24);\n }\n\n \/\/ Reinforce for boiler cable hole.\n difference() {\n translate([bcable_x, 0, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1 + 5.5, bcable_d2 + 5.5, thick, 3);\n translate([bcable_x, overcut, bcable_z])\n rotate(a=90, v=[1, 0, 0]) rounded_cube_centered(bcable_d1, bcable_d2, (thick + overcut * 2), bcable_r);\n }\n\n \/\/ Mounting screws holes.\n translate([x_size \/ 2, screw_hole1_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n translate([x_size \/ 2, screw_hole2_y, 0]) rotate(a=90, v=[0, 0, 1]) #screw_hole_cap(screw_diam, 1.7);\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Drill a grid of rows x columns vent holes. Each hole has the\n\/\/ specified diameter and depth, the grid is centered into the origin.\n\/\/-------------------------------------------------------------------------\nmodule vent_holes(x, y, diameter, depth) {\n $fn = 6; \/\/ 18 = rounded holes, 6 = hexagonal\n step = diameter * 2;\n radius = diameter \/ 1.8; \/\/ Divide by 2.0 if rounded holes, 1.8 if hexagonal.\n offset_x = (step * (x - 1)) \/ 2;\n offset_y = (step * (y - 1)) \/ 2;\n for (i = [1:x]) {\n for (j = [1:y]) {\n translate([(i - 1) * step - offset_x, (j -1) * step - offset_y, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n for (i = [1:x-1]) {\n for (j = [1:y-1]) {\n translate([(i - 1) * step - offset_x + step \/ 2, (j -1) * step - offset_y + step \/ 2, -overcut])\n cylinder(r=radius, h=(depth + overcut * 2));\n }\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stub: d1 is the outer diameter, d2 is the screw diameter.\n\/\/ The stub height must be grather than the depth of the hole.\n\/\/-------------------------------------------------------------------------\nmodule stub(d1, height, d2, hole_depth) {\n $fn = 36;\n \/\/ The hole for a self-tapping screw is narrower than the screw.\n hole_diameter = d2 * 0.75;\n difference() {\n translate([0, 0, -overlap]) {\n union() {\n cylinder(r=(d1 \/ 2), h=(height + overlap));\n cylinder(r1=(d1 * 0.7), r2=(d1 \/ 2), h=(4 + overlap));\n }\n }\n translate([0, 0, height - hole_depth])\n cylinder(r=(hole_diameter \/ 2), h=(hole_depth + overcut));\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (SainSmart like manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_sainsmart(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([2.75, 2.75, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([33.5, 45.5, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for relay board (Keyes manufacturer).\n\/\/-------------------------------------------------------------------------\nmodule stubs_2relays_keyes(height) {\n diameter = 7;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([3.5, 9, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([38, 40, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), blue PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_blue(height) {\n diameter = 6.5;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([4.25, 2.25, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([0, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([34.5, 41, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for PCD8544 LCD (Nokia 5110\/3310), red PCB model.\n\/\/-------------------------------------------------------------------------\nmodule stubs_pcd8544_red(height) {\n diameter = 6.0;\n screw_diameter = 2.2;\n hole_depth = 6;\n \/\/ Offset of first (lower left) hole from edge.\n translate([1.75, 2.0, 0]) {\n translate([ 0, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 0, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([ 0, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n translate([40, 39, 0]) stub(diameter, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Screw stubs for Raspberry Pi Model B v.2.\n\/\/-------------------------------------------------------------------------\nmodule stubs_raspberrypi_model_b_v2(height) {\n screw_diameter = 2.2;\n hole_depth = 6;\n translate([38, 25.5, 0]) {\n translate([ 0, 0, 0]) stub(6.5, height, screw_diameter, hole_depth);\n translate([-25.5, 54.5, 0]) stub(6.5, height, screw_diameter, hole_depth);\n }\n}\n\n\/\/-------------------------------------------------------------------------\n\/\/ Main procedure.\n\/\/-------------------------------------------------------------------------\ntranslate([-(x_size \/ 2), -(y_size\/2), 0]) {\n rounded_box_holes(x_size, y_size, z_size, chamfer, thick);\n translate([ 5, 12, 0.0]) stubs_2relays_sainsmart(5.0);\n translate([ 8, 90, 0.0]) stubs_pcd8544_red(20.5); \/\/ Non diminuire Y senn\u00f2 tocca il coprivite!\n translate([55, 37, 0.0]) stubs_raspberrypi_model_b_v2(5.0);\n \/\/translate([55, 37 , 5.0]) board_raspberrypi_model_b_v2();\n \/\/translate([ 8, 90, 20.5]) board_pcd8544_red();\n \/\/translate([ 5, 12, 5.0]) board_2relays_sainsmart();\n \/\/translate([button_x, button_y, button_z]) rotate(a=90, v=[0, 1, 0]) push_button();\n \/\/translate([psocket_x, -thick, psocket_z]) rotate(a=90, v=[1, 0, 0]) coax_power_jack();\n}\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, -29, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([55, 12.54, 0.5], center=true);\n RigacciOrg(0.5);\n }\n\ninclude ;\ntranslate([-x_size \/ 2 - thick + overlap, 34, 13])\n rotate(a=270, v=[0,0,1]) rotate(a=90, v=[1,0,0]) {\n \/\/#cube([35.60, 12.54, 0.5], center=true);\n ccbysa(0.5);\n }\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"0b6d591fa49f84b5fee615a8225e81fa47110698","subject":"config: Add extrusion screw nut variables","message":"config: Add extrusion screw nut variables\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 300*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 21.5*mm);\n\n\/\/ 2GT2 20T pulley\nyaxis_pulley_d = 18;\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\nyaxis_idler_pulley_h = 8.65*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 300*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 21.5*mm);\n\n\/\/ 2GT2 20T pulley\nyaxis_pulley_d = 18;\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\nyaxis_idler_pulley_h = 8.65*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6ed475618c4dca8e1ba698bde4fd602588785ab3","subject":"config\/xz: increase x to z distance w\/1mm","message":"config\/xz: increase x to z distance w\/1mm\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 0*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f9bd9e28c4e3d74d048d7b276d98fc531a0f4739","subject":"xaxis\/carriage: tweak beltfasten","message":"xaxis\/carriage: tweak beltfasten\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR105;\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*45,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=7*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-45,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,45,0])\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_capmount_offset=[35,-7,-41];*\/\nextruder_b_capmount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,50,0];*\/\n\nmodule x_carriage_full()\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n extruder_a(part=\"support\");\n }\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b(with_sensormount=false);*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 15*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+4*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR105;\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*45,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=7*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-45,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,45,0])\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_capmount_offset=[35,-7,-41];*\/\nextruder_b_capmount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,50,0];*\/\n\nmodule x_carriage_full()\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n extruder_a(part=\"support\");\n }\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b(with_sensormount=false);*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ab24a3107ec17d1c871558858a25f2fbf0c118dd","subject":"Add positions for power and status LEDs","message":"Add positions for power and status LEDs\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n moveZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5 * 25.4, moveZ])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([moveX, 0.15 * 25.4, moveZ])\n {\n color(\"silver\")\n linear_extrude(height=1.7)\n square([4.5, 4.5], center=true);\n color(\"gold\")\n translate([0, 0, 1.7])\n linear_extrude(height=1.0)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([0.5 * 25.4, 0.05 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ Green - Status\n square([0.7,1.2], center=true);\n \/\/ Red - Power\n translate([-0.2 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n }\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([moveX, 0.15 * 25.4, moveZ])\n linear_extrude(height=1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([moveX\/2, 0.2 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ RX - Yellow\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors etc.\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, moveZ])\n linear_extrude(height=2)\n {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, moveZ])\n linear_extrude(height=1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5 * 25.4, ArduinoPro_PCB_Height])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([moveX, 0.15 * 25.4, ArduinoPro_PCB_Height])\n union() {\n color(\"silver\")\n linear_extrude(height=1.7)\n square([6, 3.5], center=true);\n color(\"darkorange\")\n translate([0, 0, 1.7])\n linear_extrude(height=1.0)\n square([3, 2], center=true);\n }\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([moveX, 0.15 * 25.4, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n square([6, 3.5], center=true);\n }\n\n \/\/ Capacitors etc.\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=2)\n union() {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n union() {\n square([1, 2.5], center=true);\n translate([0, 3, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"838ac2650e5030d89a5391bac3a58b9db7112d53","subject":"misc: Remove assert (now built-in)","message":"misc: Remove assert (now built-in)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3495ad1513a912d094649bfeefd8111e414f0b5c","subject":"side-walls with sensors","message":"side-walls with sensors\n","repos":"JoeSuber\/QuickerPicker","old_file":"CardStack\/lifter_walls.scad","new_file":"CardStack\/lifter_walls.scad","new_contents":"\/\/ stackable trays bolt together\n\/\/ topper narrows to exact card size for camera positioning\n\/\/ IR sensor positions allow mcu to adjust card height\n\/\/ screw drive allows stepper disable to reduce power\/heat\n\/\/ 100lb test thread x 4 for lifting\n\nuse ;\n\n\/\/ * bearing(pos=[0,0,0], angle=[0,0,0], model=SkateBearing, outline=false, material=Steel, sideMaterial=Brass);\n\nuse ;\n\n\/\/ * stepper_motor_mount(nema_standard, slide_distance=0, mochup=true, tolerance=0);\n\nuse ;\n\n\/\/ * screw(length, nutpos, washer, bearingpos = -1);\n\nuse ;\n\nend_x = 2.5*25.4 + 22 + 20;\n\n\/\/end_plate();\n\/\/end_mold();\nsideplate();\n\/\/screwin();\n\/\/opb6xx();\n\n\nmodule screwin(ang=0, tail=10, nutpos=9, shaft=12){\n rotate([0,0,ang])\n screw(shaft, nutpos, 0, $fn=24);\n translate([0,-5.8\/2,-nutpos-2.5])\n cube([tail,5.8,2.5], center=false);\n}\n\nmodule end_plate(x = end_x, y = 70, thk = 7, boltlen=12){\n difference(){\n minkowski(){\n cylinder(1,1.5,center=false, $fn=20);\n cube([x,y,thk], center=false);\n }\n translate([x\/2, 42.3\/2, 22]) rotate([180,0,0])\n #steppercut();\n \n for (i=[1,-1]){\n translate([x\/2 + i*2.5\/2*25.4+i*9,13,0])\n cylinder(r=22.2\/2, h=20, center=true, $fn=64);\n translate([x\/2 + i*2.5\/2*25.4+i*9,y-13,0])\n cylinder(r=22.2\/2, h=20, center=true, $fn=64);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*20,y\/2-10,thk\/2]) rotate([0,90,90-90*i])\n #screwin(ang=0, tail=10, nutpos=8, shaft=12);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*20,y\/2+10,thk\/2]) rotate([0,90,90-90*i])\n #screwin(ang=0, tail=10, nutpos=8, shaft=12);\n translate([x\/2 + i*2.5\/4*25.4,y+4,thk\/2]) rotate([0,-270,90])\n #screwin(ang=0, tail=10, nutpos=8, shaft=12);\n\n }\n }\n}\n\nmodule end_mold(x = end_x, y = 70, thk = 7, boltlen=12){\n \/\/ a positive for cutting into side-panels\n translate([thk+1, 0, 4]) rotate([0,-90,0]){\n cube([thk,y,thk], center=false);\n for (i=[-1]){\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*20,y\/2+10,thk\/2]) rotate([0,90,90-90*i])\n screwin(ang=0, tail=10, nutpos=8, shaft=12);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*20,y\/2-10,thk\/2]) rotate([0,90,90-90*i])\n screwin(ang=0, tail=10, nutpos=8, shaft=12);\n }\n }\n}\n\nmodule opb6xx(\n sensor_bottom_x = 5,\n sensor_bottom_y = 4.6,\n sensor_bottom_z = 1.7,\n sensor_top = [6.35,4.6,3.3]){\n \n sensor_bot = [sensor_bottom_x,sensor_bottom_y,sensor_bottom_z];\n totalsensor_ht = sensor_top[2] + sensor_bottom_z;\n \n for (j=[-1,1]){\n translate([0, j*(y\/2 - sensor_bottom_y\/2), -8.25]){\n translate([0,0,sensor_bottom_z\/2])\n #cube(sensor_bot, center=true);\n translate([0,0,totalsensor_ht\/2 + sensor_bottom_z\/2- 0.1])\n #cube(sensor_top, center=true);\n cube([sensor_bottom_x, sensor_bottom_y, 16], center=true);\n cylinder(r=sensor_bottom_x\/2-0.25, h=17, center=false); \n }\n }\n}\n\n\nmodule sideplate(x = 4.1*25.4, y = 70, z = 5){\n \/\/ structure\n difference(){\n cube([x,y,z], center=false);\n end_mold();\n translate([x, y, 0]) rotate([0,0,180])\n end_mold();\n for (i=[2\/7, 5\/7]){\n translate([x\/2, y*i, 0]) scale([3.6,1.18,1]){\n #cylinder(r=y\/6, h=z+.1, center=false, $fn=128);\n }\n translate([x*i, 2.2, 5.7]) rotate([180,0,0])\n #opb6xx();\n }\n }\n}\n\n\n\nmodule steppercut(xy=42.3, curve=5.7, tall=20){\n linear_extrude(height=tall)\n minkowski(){\n square([xy-curve, xy-curve], center=true);\n circle(r = curve\/2, center=true, $fn=16);\n }\n linear_extrude(height=tall+12)\n stepper_motor_mount(17, slide_distance=0, mochup=true, tolerance=0);\n}\n","old_contents":"\/\/ stackable trays bolt together\n\/\/ topper narrows to exact card size for camera positioning\n\/\/ IR sensor positions allow mcu to adjust card height\n\/\/ screw drive allows stepper disable to reduce power\/heat\n\/\/ 100lb test thread x 4 for lifting\n\nuse ;\n\n\/\/ * bearing(pos=[0,0,0], angle=[0,0,0], model=SkateBearing, outline=false, material=Steel, sideMaterial=Brass);\n\nuse ;\n\n\/\/ * stepper_motor_mount(nema_standard, slide_distance=0, mochup=true, tolerance=0);\n\nuse ;\n\n\/\/ * screw(length, nutpos, washer, bearingpos = -1);\n\nuse ;\n\nend_x = 2.5*25.4 + 22 + 20;\n\nend_plate();\n\/\/screwin();\n\nmodule screwin(ang=0, tail=10, nutpos=9, shaft=12){\n rotate([0,0,ang])\n screw(shaft, nutpos, 0, $fn=24);\n translate([0,-5.8\/2,-nutpos-2.5])\n cube([tail,5.8,2.5], center=false);\n}\n\nmodule end_plate(x = end_x, y = 70, thk = 7, boltlen=12){\n difference(){\n minkowski(){\n cylinder(1,1.5,center=false);\n cube([x,y,thk], center=false, $fn=20);\n }\n translate([x\/2, 42.3\/2, 22]) rotate([180,0,0])\n #steppercut();\n \n for (i=[1,-1]){\n translate([x\/2 + i*2.5\/2*25.4+i*9,13,0])\n cylinder(r=22.2\/2, h=20, center=true, $fn=64);\n translate([x\/2 + i*2.5\/2*25.4+i*9,y-13,0])\n cylinder(r=22.2\/2, h=20, center=true, $fn=64);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*20,y\/2-10,thk\/2]) rotate([0,90,90-90*i])\n #screwin(ang=0, tail=10, nutpos=8, shaft=12);\n translate([x\/2 + i*2.5\/2*25.4+i*boltlen\/2+i*20,y\/2+10,thk\/2]) rotate([0,90,90-90*i])\n #screwin(ang=0, tail=10, nutpos=8, shaft=12);\n translate([x\/2 + i*2.5\/4*25.4,y+4,thk\/2]) rotate([0,-270,90])\n #screwin(ang=0, tail=10, nutpos=8, shaft=12);\n\n }\n }\n}\n\nmodule steppercut(xy=42.3, curve=5.7, tall=20){\n linear_extrude(height=tall)\n minkowski(){\n square([xy-curve, xy-curve], center=true);\n circle(r = curve\/2, center=true, $fn=16);\n }\n linear_extrude(height=tall+12)\n stepper_motor_mount(17, slide_distance=0, mochup=true, tolerance=0);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"60fca0f7ad5b40de46a18021eb414dc1e6a5b041","subject":"Update to \"pillar\" holes.","message":"Update to \"pillar\" holes.\n","repos":"chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella","old_file":"cad\/mezzanine.scad","new_file":"cad\/mezzanine.scad","new_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes supports for a breadboard and\n\/\/ rivet holes for a battery. The breadboard is\n\/\/ centered on the origin. y is positive toward the RPi.\nthickness = 4;\n\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nstart_cutout_x = 40; \/\/ 1\/2 width of cutout around the helper board\nend_cutout_x = 65; \/\/ 1\/2 width of cutout around the helper board\nnarrow_x= 80; \/\/ 1\/2 width of the battery holder\n\nmin_y = 18; \/\/ beginning of \"wing\ncutout_y = 0; \/\/ close edge of the cutout\nwide_y = -26; \/\/ The near edge the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = -86; \/\/ Greatest extent of the plate\n\n\/\/ NOTE: Added 1mm of \"slop\" to breadboard dimensions\nbreadboard_width = 165; \/\/ \nbreadboard_height = 27; \/\/ Chopped\nbreadboard_thickness = 10;\nbreadboard_z = 10; \/\/ Base to bottom of breadboard\npost_width = 8; \/\/ Support post for breadboard\n\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = -20; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\n\narduino_width = 54; \/\/ y direction\nbattery_rivet_x = 28; \/\/ On centerline\nbattery_rivet_y = 8; \/\/ On centerline, 16mm from rim.\nmain_rivet_x = 48; \/\/ Connect to main board\nmain_rivet_y = 0;\n\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ Make 4 holders for the breadboard corners\nmodule breadboard_posts() {\n z = breadboard_z+thickness;\n \n for(i=[[breadboard_width\/2,breadboard_height\/2,z\/2],\n [-breadboard_width\/2,breadboard_height\/2,z\/2], \n [-breadboard_width\/2,-breadboard_height\/2,z\/2],\n [breadboard_width\/2,-breadboard_height\/2,z\/2]]) {\n translate(i)\n cube(size=[post_width,post_width,z],center=true);\n }\n}\n\/\/ Offset holders for the breadboard corners to make notches at the top\nmodule breadboard_notches() {\n z = 2*breadboard_z+thickness;\n w = post_width;\n for(i=[[breadboard_width\/2-w\/2,breadboard_height\/2-w\/2,z\/2],\n [-breadboard_width\/2+w\/2,breadboard_height\/2-w\/2,z\/2], \n [-breadboard_width\/2+w\/2,-breadboard_height\/2+w\/2,z\/2],\n [breadboard_width\/2-w\/2,-breadboard_height\/2+w\/2,z\/2]]) {\n translate(i)\n cube(size=[w,w,breadboard_thickness],center=true);\n }\n}\n\/\/ Subtract this from the base platform\n\/\/ These are the posts.\n\/\/ Cylinder arguments: height,r1,r2,center\nmodule post_holes(z) {\n for(i=[[pillar_x,pillar_y],[-pillar_x,pillar_y]]) {\n translate(i)\n rotate(22.5,0,0)\n cylinder(z,4,4,false,$fn=6);\n }\n}\n\n\/\/ These are for connecting the main board\n\/\/ z - thickness\nmodule main_holes(z) {\n for(i=[[main_rivet_x,main_rivet_y],\n [-main_rivet_x,main_rivet_y]] ) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ These are the various holes for battery rivets.\n\/\/ We've offset by 35mm\nmodule rivet_holes(z) {\n for(i=[[battery_rivet_x-35,0],[-battery_rivet_x-35,0],\n [-35,battery_rivet_y],[-35,-battery_rivet_y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ These are the various holes for arduino rivets.\n\/\/ These are on the plus side\nmodule arduino_holes(z) {\n for(i=[[11,17],[11,45],\n [62,0],[64,48]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ These are for connecting the \"ears\" near the\n\/\/ end of the wings.\nmodule ear_holes(z) {\n for(i=[[wide_x-14,cutout_y-2+10],\n [wide_x-14,cutout_y-2-10],\n [-wide_x+14,cutout_y-2+10],\n [-wide_x+14,cutout_y-2-10]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the edge of the helper\n\/\/ board next to the RPi GPIO header. This object cannot be translated once created.\n\/\/ y is positive towards the RPi. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate. There should be no rim where hulls join.\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius and rim\n \/\/ There is no rim on joint.\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\ndifference() {\n base(thickness);\n post_holes(thickness);\n main_holes(thickness);\n ear_holes(thickness);\n translate([0,full_y+32,0]) {\n rivet_holes(thickness);\n }\n translate([0,full_y+thickness,0]) {\n arduino_holes(thickness);\n }\n}\ntranslate([0,0,thickness\/2])\ndifference() {\n color(\"red\")\n base(thickness);\n base_cutout(thickness,rim);\n}\n translate([0,0,thickness\/2])\ndifference() {\n breadboard_posts();\n breadboard_notches();\n}","old_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes supports for a breadboard and\n\/\/ rivet holes for a battery. The breadboard is\n\/\/ centered on the origin. y is positive toward the RPi.\nthickness = 4;\n\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nstart_cutout_x = 40; \/\/ 1\/2 width of cutout around the helper board\nend_cutout_x = 65; \/\/ 1\/2 width of cutout around the helper board\nnarrow_x= 80; \/\/ 1\/2 width of the battery holder\n\nmin_y = 18; \/\/ beginning of \"wing\ncutout_y = 0; \/\/ close edge of the cutout\nwide_y = -26; \/\/ The near edge the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = -86; \/\/ Greatest extent of the plate\n\n\/\/ NOTE: Added 1mm of \"slop\" to breadboard dimensions\nbreadboard_width = 165; \/\/ \nbreadboard_height = 27; \/\/ Chopped\nbreadboard_thickness = 10;\nbreadboard_z = 10; \/\/ Base to bottom of breadboard\npost_width = 8; \/\/ Support post for breadboard\n\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = -20; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\n\narduino_width = 54; \/\/ y direction\nbattery_rivet_x = 28; \/\/ On centerline\nbattery_rivet_y = 8; \/\/ On centerline, 16mm from rim.\nmain_rivet_x = 48; \/\/ Connect to main board\nmain_rivet_y = 0;\n\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ Make 4 holders for the breadboard corners\nmodule breadboard_posts() {\n z = breadboard_z+thickness;\n \n for(i=[[breadboard_width\/2,breadboard_height\/2,z\/2],\n [-breadboard_width\/2,breadboard_height\/2,z\/2], \n [-breadboard_width\/2,-breadboard_height\/2,z\/2],\n [breadboard_width\/2,-breadboard_height\/2,z\/2]]) {\n translate(i)\n cube(size=[post_width,post_width,z],center=true);\n }\n}\n\/\/ Offset holders for the breadboard corners to make notches at the top\nmodule breadboard_notches() {\n z = 2*breadboard_z+thickness;\n w = post_width;\n for(i=[[breadboard_width\/2-w\/2,breadboard_height\/2-w\/2,z\/2],\n [-breadboard_width\/2+w\/2,breadboard_height\/2-w\/2,z\/2], \n [-breadboard_width\/2+w\/2,-breadboard_height\/2+w\/2,z\/2],\n [breadboard_width\/2-w\/2,-breadboard_height\/2+w\/2,z\/2]]) {\n translate(i)\n cube(size=[w,w,breadboard_thickness],center=true);\n }\n}\n\/\/ Subtract this from the base platform\n\/\/ These are the posts\nmodule post_holes(z) {\n for(i=[[pillar_x,pillar_y],[-pillar_x,pillar_y]]) {\n translate(i)\n rotate(22.5,0,0)\n cylinder(r=4,h=z,$fn=6);\n }\n}\n\n\/\/ These are for connecting the main board\n\/\/ z - thickness\nmodule main_holes(z) {\n for(i=[[main_rivet_x,main_rivet_y],\n [-main_rivet_x,main_rivet_y]] ) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ These are the various holes for battery rivets.\n\/\/ We've offset by 35mm\nmodule rivet_holes(z) {\n for(i=[[battery_rivet_x-35,0],[-battery_rivet_x-35,0],\n [-35,battery_rivet_y],[-35,-battery_rivet_y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ These are the various holes for arduino rivets.\n\/\/ These are on the plus side\nmodule arduino_holes(z) {\n for(i=[[11,17],[11,45],\n [62,0],[64,48]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ These are for connecting the \"ears\" near the\n\/\/ end of the wings.\nmodule ear_holes(z) {\n for(i=[[wide_x-14,cutout_y-2+10],\n [wide_x-14,cutout_y-2-10],\n [-wide_x+14,cutout_y-2+10],\n [-wide_x+14,cutout_y-2-10]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the edge of the helper\n\/\/ board next to the RPi GPIO header. This object cannot be translated once created.\n\/\/ y is positive towards the RPi. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate. There should be no rim where hulls join.\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius and rim\n \/\/ There is no rim on joint.\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\ndifference() {\n base(thickness);\n post_holes(thickness);\n main_holes(thickness);\n ear_holes(thickness);\n translate([0,full_y+32,0]) {\n rivet_holes(thickness);\n }\n translate([0,full_y+thickness,0]) {\n arduino_holes(thickness);\n }\n}\ntranslate([0,0,thickness\/2])\ndifference() {\n color(\"red\")\n base(thickness);\n base_cutout(thickness,rim);\n}\n translate([0,0,thickness\/2])\ndifference() {\n breadboard_posts();\n breadboard_notches();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ec3e92f39c53dc94c6127e366eb8a16814c91b89","subject":"using exterial diameter for con distancing","message":"using exterial diameter for con distancing\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toy_lid\/lid_dzielny_pacjent.scad","new_file":"toy_lid\/lid_dzielny_pacjent.scad","new_contents":"include ;\n\nint_dia=110;\next_dia=int_dia+5+2*(3+10);\n\ntranslate([0, ext_dia\/2+15, 0])\n con();\nlid(internal_diameter=int_dia, external_diameter=ext_dia);\n","old_contents":"include ;\n\nint_dia=110;\next_dia=int_dia+5+2*(3+10);\n\ntranslate([0, int_dia\/2+30, 0])\n con();\nlid(internal_diameter=int_dia, external_diameter=ext_dia);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e887d37d29bf1990527e7f4b8a0230c220316f8d","subject":"pulley: bugfix alignment of idlers","message":"pulley: bugfix alignment of idlers\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"pulley.scad","new_file":"pulley.scad","new_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?undef:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n fncylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n fncylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\n\/*debug = true;*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,0], orient=[0,0,1]);*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,1], flip=false);*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?0:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n fncylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n fncylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\n\/*debug = true;*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*[>pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);<]*\/\n \/*[>pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,1], flip=false);<]*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d46bd3facb91709eb8253ef425f54f77ccf5af09","subject":"Create deksiriboza_1.scad","message":"Create deksiriboza_1.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/deksiriboza_1.scad","new_file":"3D-models\/SCAD\/deksiriboza_1.scad","new_contents":"z=7; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([-11.4,-67.5,2])cube ([20,21,3.5]);\ntranslate ([-7,0,0]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([-28,-73,-1])cube ([20,45,9]);\n\ntranslate ([2,-80,0]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,7]);\ntranslate ([-11.4,-67.5,2])cube ([20,21,3.5]);\ntranslate ([-7,0,0]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/deksiriboza_1.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"dd5c710a4364574e6ec9872536ba0d884d524a67","subject":"x\/ends: change preview setup slightly","message":"x\/ends: change preview setup slightly\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3540cc93a150043aa81c8c96c5467d812009ebe5","subject":"Updated with stepper motor expansion","message":"Updated with stepper motor expansion","repos":"pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey","old_file":"hardware\/Robot.scad","new_file":"hardware\/Robot.scad","new_contents":"\/\/Make passage for cables larger\nRobotY = 220;\nRobotX = 80;\nRobotZ = 5;\nBodyHoleR = 20;\nBodyHoleSpace = 55;\n\nplateX = 150;\nplateZ = 3;\nplateY = RobotX;\ncablePassageWidht = 8;\nplateanchorX = RobotZ;\nplateanchorY = 15;\nholeradius = 3;\nholespace = 3 * holeradius;\nborderZ = 30;\nborder = 8;\nT = 0.3;\n$fs = 0.01;\n\nstepperSupportHeight = 70;\n\nborder = holespace + ((plateX) \/ holespace - floor((plateX) \/ holespace)) \/ 2;\ninclude < TextGenerator.scad > ;\n\nmodule put_pilogo(mt) {\n fn = \"raspberrypi_logo.dxf\";\n \/\/ calculate the scale and which offset to use\n\n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\n\nmodule put_Alogo(mt) {\n fn = \"arduino.dxf\";\n \/\/ calculate the scale and which offset to use\n\n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\nmodule put_OAlogo(mt) {\n fn = \"ohw-logo.dxf\";\n \/\/ calculate the scale and which offset to use \n linear_extrude(height = mt) import (file = fn, scale = scx);\n}\n\n\nmodule SUB_batteryAnchor() {\n\n}\n\nmodule arduinoLogo(h, r) {\n\n scale([0.9, .7, 1]) union() {\n difference() {\n cylinder(h = h, r = r);\n cylinder(h = h, r = r - .25 * r);\n }\n translate([1.8 * r, 0, 0]) difference() {\n cylinder(h = h, r = r);\n cylinder(h = h, r = r - .25 * r);\n }\n\n }\n translate([0, 0, h \/ 2]) cube([0.6 * r, 0.2 * r, h], center = true);\n translate([2 * r - 0.4 * r, 0, h \/ 2]) {\n cube([0.6 * r, 0.2 * r, h], center = true);\n rotate([0, 0, 90]) cube([0.6 * r, 0.2 * r, h], center = true);\n }\n}\n\nmodule plate(plateX, plateY, plateZ, borderZ, holes, baseF, baseB, text) {\n difference() {\n linear_extrude(plateZ, center = true, convexity = 0, twist = 0)\n\n difference() {\n\n union() {\n square([plateX, plateY], center = true);\n\n translate([-plateX \/ 2 - plateanchorX, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n mirror([0, 1, 0]) translate([-plateX \/ 2 - plateanchorX, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n\n translate([+plateX \/ 2, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n mirror([0, 1, 0]) translate([+plateX \/ 2, plateanchorY + RobotX \/ 8 - (7 * (RobotX \/ 8) - plateanchorY), 0]) square([plateanchorX, plateanchorY], center = \"True\");\n\n }\n\n \/\/punchholes at the bottom of the plate\n if (holes == \"True\") {\n for (j = [border: holespace: plateY - border]) {\n for (i = [border: holespace: plateX - 2 * border]) {\n translate([i + border - plateX \/ 2 - holeradius \/ 2, j - plateY \/ 2, 0]) circle(holeradius);\n }\n }\n\n }\n }\n\n \/\/Passage for cables\n translate([-plateX \/ 2 + cablePassageWidht, j + border - plateY \/ 2, 0]) cube([cablePassageWidht, 0.5 * plateY, plateZ], center = true);\n translate([plateX \/ 2 - cablePassageWidht, j + border - plateY \/ 2, 0]) cube([cablePassageWidht, 0.5 * plateY, plateZ], center = true);\n\n }\n if (baseF == \"True\")\n translate([-plateX \/ 2, plateY \/ 2 - plateZ, -plateZ \/ 2]) cube([plateX, plateZ, borderZ]);\n if (baseB == \"True\")\n translate([-plateX \/ 2, -plateY \/ 2, -plateZ \/ 2]) cube([plateX, plateZ, borderZ]);\n\n translate([-plateX \/ 2, -plateY \/ 2, 5]) rotate(90, [1, 0, 0]) scale([2, 2, 1]) drawtext(text);\n\n}\n\nmodule SensorsPlate() {\n IRLedD = 3;\n\n plate(plateX, plateY, plateZ, borderZ, \"True\", \"True\", \"false\", \"\");\n difference() {\n translate([0, -plateY \/ 2 + 10, borderZ - plateZ \/ 2])\n rotate([180, 0, 0]) difference() {\n scale(v = [1, 0.30, 1]) difference() {\n cylinder(r = plateX \/ 2, h = borderZ, center = false);\n cylinder(r = plateX \/ 2 - 2 * plateZ, h = borderZ, center = false);\n }\n\n\n translate([-plateX \/ 2, -plateY \/ 2 + 10, 0]) cube([plateX, 0.35 * plateX \/ 2, plateY \/ 2]);\n }\n \/\/hole for the IR sensor\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, -30]) translate([6, -3.48, 0]) cube([6, 6.95, 10]);\n translate([-8, -plateY \/ 2 - 10, borderZ \/ 4]) rotate([100, 0, 0]) translate([6, -3.48, 0]) cube([6, 6.95, 10]);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, 30]) translate([-12, -3.48, 0]) cube([6, 6.95, 10]);\n\n \/\/holes for sonars and slots for sensors\n translate([0 + 28, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(r = 16.8 \/ 2, h = 8);\n translate([0 - 28, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(r = 16.8 \/ 2, h = 8);\n translate([0, -plateY \/ 2 - 8, borderZ \/ 2]) rotate([90, 0, 0]) cube([3, 1, 5]);\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 2]) rotate([90, 0, -30]) cube([3, 1, 5]);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 2]) rotate([90, 0, 30]) cube([3, 1, 5]);\n\n translate([-plateX \/ 2 + 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, -30]) cylinder(r = 1.5 + IRLedD, h = 10);\n translate([-8, -plateY \/ 2 - 10, borderZ \/ 4]) rotate([100, 0, 0]) cylinder(r = 1.5 + IRLedD, h = 10);\n translate([+plateX \/ 2 - 12, -plateY \/ 2 + 2, borderZ \/ 4]) rotate([100, 0, 30]) cylinder(r = 1.5 + IRLedD, h = 10);\n }\n\n \/\/Tubes to focus the IR beams\n translate([-plateX \/ 2, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n translate([-plateX \/ 2 + 15, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n translate([-plateX \/ 2 + 30, -plateY \/ 2 - 30, 0]) difference() {\n cylinder(r = 1 + IRLedD, h = 15);\n cylinder(r = IRLedD, h = 15);\n }\n \/\/\ttranslate([-8,-plateY\/2-10,borderZ\/4]) rotate([100,0,0])difference (){cylinder(r=1.2*IRLedD,h=8); cylinder(r=IRLedD,h=10);}\n \/\/\ttranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/4]) rotate([100,0,30])difference (){cylinder(r=1.2*IRLedD,h=10); cylinder(r=IRLedD,h=8);}\n}\n\nmodule Powerplate() {\n\n difference() {\n plate(plateX, plateY, plateZ, borderZ, \"True\", \"True\", \"True\", \"Power\");\n \/\/fix for batteries\n translate([plateX \/ 2 - 15, plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([-plateX \/ 2 + 15, plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([plateX \/ 2 - 15, -plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n translate([-plateX \/ 2 + 15, -plateY \/ 2 + 5, borderZ \/ 2]) translate([0, 0, 3]) rotate([90, 0, 0]) cylinder(h = 10, r = 2);\n\n }\n\n translate([plateX \/ 2 - 15, plateY \/ 2 + 4, borderZ \/ 2])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([-plateX \/ 2 + 15, plateY \/ 2 + 4, borderZ \/ 2])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([plateX \/ 2 - 15, -plateY \/ 2 - 1, borderZ \/ 2]) rotate([0, 0, 180])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n translate([-plateX \/ 2 + 15, -plateY \/ 2 - 1, borderZ \/ 2]) rotate([0, 0, 180])\n difference() {\n sphere(2);\n rotate([0, 90, 0]) translate([0.7, 0.6, 0]) cylinder(h = 10, r = 1.1, center = true);\n }\n\n\n \/\/mid section\n difference() {\n translate([-plateX \/ 2, 0, 0]) cube([plateX, plateZ, borderZ]);\n for (i = [1: plateX \/ 4: plateX]) {\n translate([i + (-plateX \/ 2) + borderZ \/ 2, 10, borderZ \/ 2]) rotate([90, 0, 0]) cylinder(20, r = 0.8 * borderZ \/ 2);\n\n }\n\n\n }\n\n\n}\n\nmodule BrainPlate() {\n plate(plateX, plateY, plateZ, borderZ, \"False\", \"True\", \"True\", \"\");\n translate([-plateX \/ 2, -plateY \/ 2, borderZ \/ 2]) {\n color(\"green\") rotate([90, 0, 0])\n translate([120, -2, 0]) scale(0.3) arduinoLogo(5, 30);\n translate([5, -12, 0]) scale(0.1) put_pilogo(1.5 \/ 0.1);\n translate([80, -2, 0]) scale(0.1) put_OAlogo(1.5 \/ 0.1);\n }\n}\n\n\nmodule MotorBody() {\n difference() {\n linear_extrude(RobotZ, center = true, convexity = 0, twist = 0) {\n difference() {\n \/\/eed to redefine the motorbody as a fixed lenght \t\t\t\n union() {\n translate([0, RobotX \/ 2, 0]) square([RobotX, 220 - RobotX - 15]);\n translate([RobotX \/ 2, 40, 0]) circle(RobotX \/ 2);\n }\n translate([RobotX \/ 2, 40, 0]) circle(26 \/ 2);\n translate([RobotX \/ 2, 40, 0]) circle(3);\n\n \/\/Motor holes\n translate([RobotX \/ 2, 40, 0]) {\n for (i = [0: 4]) {\n rotate((i * 360 \/ 4) + 45)\n \/\/datasheet provides distance between holes, we need the radius from the shaft\n translate([21.92, 0, 0])\n circle(3);\n }\n }\n \/\/Modules\n for (i = [112: BodyHoleSpace: RobotY]) {\n translate([RobotX \/ 2, i, 0]) circle(BodyHoleR);\n \/\/Slots for plates\n translate([RobotX \/ 8, i - BodyHoleR - 5, 0]) square([1.15 * plateanchorY, 1.15 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, i - BodyHoleR - 5, 0]) square([plateanchorY, plateZ]);\n translate([RobotX \/ 2, i - 25 - plateZ, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([7 * RobotX \/ 8, i, 0]) circle(3);\n }\n }\n\n }\n \/\/Connection with body extension\n translate([0, 220 - RobotX + 2, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, 3 * BodyHoleSpace - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, 3 * BodyHoleSpace - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n }\n}\n\n\nmodule BodyExtension() {\n difference() {\n linear_extrude(RobotZ, center = true, convexity = 0, twist = 0) {\n difference() {\n square([RobotX, RobotY]);\n for (i = [0: BodyHoleSpace: RobotY]) {\n translate([RobotX \/ 2, i, 0]) circle(BodyHoleR);\n translate([RobotX \/ 8, i - BodyHoleR - 5, 0]) square([1.15 * plateanchorY, 1.15 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, i - BodyHoleR - 5, 0]) square([plateanchorY, plateZ]);\n translate([RobotX \/ 2, i - 25 - plateZ, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([RobotX \/ 8, i, 0]) circle(3);\n translate([7 * RobotX \/ 8, i, 0]) circle(3);\n\n }\n\n translate([RobotX \/ 8, 0, 0]) square([1.05 * plateanchorY, 1.05 * plateZ]);\n translate([7 * (RobotX \/ 8) - plateanchorY, 0, 0]) square([plateanchorY, plateZ]);\n }\n\n }\n\n \/\/creates attachment for other vertical modules\n translate([0, RobotY - 25, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, RobotY - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, RobotY - 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n\n translate([0, 0, 0]) cube([RobotX, 25, RobotZ \/ 2]);\n translate([15, 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n translate([RobotX - 15, 25 \/ 2, -RobotZ \/ 2]) cylinder(h = 2 * RobotZ, r = 3);\n }\n\n\n\n}\n\n\n\nmodule PCBSupport(PCBHoleR) {\n difference() {\n cylinder(h = plateZ + 5, r = holeradius - .2);\n cylinder(h = plateZ + 2, r = holeradius \/ 2);\n cube([10, 1, 8], center = true);\n }\n translate([0, 0, plateZ + 5]) cylinder(h = 6, r = PCBHoleR);\n\n}\n\nmodule PCBSupportHole(PCBHoleR, Height) {\n difference() {\n cylinder(h = plateZ + Height, r = holeradius - T);\n cylinder(h = plateZ - 5, r = holeradius \/ 2);\n }\n translate([0, 0, plateZ + Height]) cylinder(h = 6, r = PCBHoleR);\n\n}\n\n\/\/Draw a prism based on a \n\/\/right angled triangle\n\/\/l - length of prism\n\/\/w - width of triangle\n\/\/h - height of triangle\nmodule prism(l, w, h, he) {\n translate([0, l, 0]) rotate(a = [90, 0, 0])\n linear_extrude(height = he) polygon(points = [\n [0, 0],\n [w, 0],\n [0, h]\n ], paths = [\n [0, 1, 2, 0]\n ]);\n}\n\n\nmodule SUB_nemaMountingPlateHoles() {\n translate([-35 \/ 2, plateY \/ 2, 0]) {\n translate([0, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([35, 0, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([0, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([35, 25, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n }\n }\n \/\/creates attachment for other vertical modules\nmodule base() {\n {\n translate([0, 0, 0]) {\n difference() {\n translate([0, plateY, 25 \/ 2]) cube([RobotX, RobotZ \/ 2, 25], center = true);\n translate([BodyHoleSpace \/ 2 - 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n translate([-BodyHoleSpace \/ 2 + 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n }\n }\n mirror([0, 1, 0]) {\n difference() {\n translate([0, plateY, 25 \/ 2]) cube([RobotX, RobotZ \/ 2, 25], center = true);\n translate([BodyHoleSpace \/ 2 - 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n translate([-BodyHoleSpace \/ 2 + 3 \/ 2, plateY, 25 \/ 2 + 2]) rotate([90, 0, 0]) cylinder(h = 2 * RobotZ, r = 3, center = true);\n }\n\n\n\n }\n\n }\n\n\n difference() {\n translate([0, 0, 0]) {\n \/\/Bottomo of the baseplate\n cube([RobotX, 2 * (RobotX + RobotZ \/ 4), 6], center = true);\n\n }\n\n translate([-plateY \/ 2, 0, 0]) {\n \/\/ \"35\/4\" because of the distance of the hole in the bracket for the stepper NEMA\n\n\n for (i = [-plateX \/ 5 - 1.5: 2 * holeradius + 3: plateX \/ 5 + 1.5]) {\n translate([border, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([border + 2 * holeradius + 3, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n translate([plateY - border, i, 0]) cylinder(h = 15, r = holeradius, center = true);\n translate([plateY - border - (2 * holeradius + 3), i, 0]) cylinder(h = 15, r = holeradius, center = true);\n\n }\n\n }\n\n SUB_nemaMountingPlateHoles();\n mirror([0, 1, 0]) SUB_nemaMountingPlateHoles();\n\n translate([0, 0, 0]) cylinder(h = 15, r = plateX \/ 10, center = true);\n\n }\n\n}\n\n\nmodule batteryPlate() {\n translate([0, 0, plateZ \/ 2])\n plate(plateX, 103 + 2 * plateZ, plateZ, plateZ + 5, \"True\", \"True\", \"True\", \"\");\n translate([-plateanchorY \/ 2, (103 + 2 * plateZ) \/ 2, 0])\n difference() {\n\n cube([plateanchorY, 1.5 * plateanchorX, plateZ], center = \"True\");\n translate([0, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n translate([plateanchorY, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n }\n mirror([0, 1, 0]) translate([-plateanchorY \/ 2, (103 + 2 * plateZ) \/ 2, 0])\n difference() {\n\n cube([plateanchorY, 1.5 * plateanchorX, plateZ], center = \"True\");\n translate([0, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n translate([plateanchorY, 1.5 * plateanchorX \/ 2, 0]) cylinder(h = plateZ, r = 2);\n }\n\n}\n\n\n\nmodule stepperDriverSupport() {\n\n difference() {\n translate([RobotX \/ 2, (0 + BodyHoleSpace \/ 2), 0]) {\n\n cube([RobotX, 1.6 * BodyHoleSpace, RobotZ \/ 2], center = true);\n translate([0, 1.6 * BodyHoleSpace \/ 2, 30 \/ 2 - RobotZ \/ 2 \/ 2]) cube([RobotX, RobotZ \/ 2, 30], center = true);\n\n }\n\n for (i = [-8: BodyHoleSpace: BodyHoleSpace]) {\n translate([RobotX \/ 8, i, 0]) cylinder(r = 3, h = 10, center = true);\n translate([7 * RobotX \/ 8, i, 0]) cylinder(r = 3, h = 10, center = true);\n }\n translate([RobotX \/ 2, 1.4 * BodyHoleSpace, 20]) rotate([90, 0, 0]) cylinder(r = 3, h = 50, center = true);\n\n translate([RobotX \/ 2, 0, 0])\n hull() {\n \/\/translate([0,-BodyHoleR,0])cylinder(r=BodyHoleR,h=RobotZ\/2,center=true);\t\t\n translate([0, 5, 0]) cube([2 * BodyHoleR, 15, 20], center = true);\n translate([0, BodyHoleSpace - RobotZ \/ 2 - 8, 0]) cylinder(r = BodyHoleR, h = RobotZ \/ 2, center = true);\n }\n translate([RobotX \/ 2, -3 * RobotZ + 3, 0]) cylinder(r = 3, h = 10, center = true);\n }\n\n}\n\nbase();\n\/\/stepperDriverSupport();\n\/\/translate([-plateY\/2,-plateX\/2,0])rotate([90,0,0])BodyExtension();","old_contents":"\/\/Make passage for cables larger\n\nRobotY=220;\nRobotX=80;\nRobotZ=5;\nBodyHoleR=20;\nBodyHoleSpace=55;\n\nplateX=150;\nplateZ=3;\nplateY=RobotX;\nplateanchorX=RobotZ;\nplateanchorY=15;\nholeradius=3;\nholespace=3*holeradius;\nborderZ=30;\nborder=8;\nT=0.3;\n\nstepperSupportHeight = 70;\n\nborder=holespace+((plateX)\/holespace-floor((plateX)\/holespace))\/2;\ninclude ;\n\nmodule put_pilogo(mt) {\n fn=\"raspberrypi_logo.dxf\";\n \/\/ calculate the scale and which offset to use\n \n linear_extrude(height=mt) import(file=fn, scale=scx);\n}\n\n\nmodule put_Alogo(mt) {\n fn=\"arduino.dxf\";\n \/\/ calculate the scale and which offset to use\n \n linear_extrude(height=mt) import(file=fn, scale=scx);\n}\n\nmodule put_OAlogo(mt) {\n fn=\"ohw-logo.dxf\";\n \/\/ calculate the scale and which offset to use \n linear_extrude(height=mt) import(file=fn, scale=scx);\n}\n\nmodule arduinoLogo(h,r) {\n\n\tscale([0.9,.7,1])union(){\n\t\tdifference() {cylinder(h=h,r=r);cylinder(h=h,r=r-.25*r);}\n\t\ttranslate([1.8*r,0,0])difference() {cylinder(h=h,r=r);cylinder(h=h,r=r-.25*r);}\n\n\t}\ntranslate([0,0,h\/2])cube([0.6*r,0.2*r,h], center=true);\ntranslate([2*r-0.4*r,0,h\/2]){cube([0.6*r,0.2*r,h], center=true); rotate([0,0,90])cube([0.6*r,0.2*r,h], center=true);}\n}\n\nmodule plate(holes,baseF,baseB,text) \n{\ndifference(){linear_extrude(plateZ, center = true, convexity = 0, twist = 0)\n\n\tdifference(){\n\t\t\n\t\tunion(){square ([plateX, plateY], center=true);\n\t\t\ttranslate([-plateX\/2-plateanchorX,plateY-RobotX\/8-(7*(RobotX\/8)-plateanchorY),0]) square([plateanchorX,plateanchorY], center = \"True\");\n\t\t\t\n\t\t\ttranslate([-plateX\/2-plateanchorX,plateanchorY+RobotX\/8-(7*(RobotX\/8)-plateanchorY),0]) square([plateanchorX,plateanchorY], center = \"True\");\n\t\t\t\n\t\t\ttranslate([+plateX\/2,plateY-RobotX\/8-(7*(RobotX\/8)-plateanchorY),0]) square([plateanchorX,plateanchorY], center = \"True\");\n\t\t\t\n\t\t\ttranslate([+plateX\/2,plateanchorY+RobotX\/8-(7*(RobotX\/8)-plateanchorY),0]) square([plateanchorX,plateanchorY], center = \"True\");\t\t\t\t\t\n\t\t\t\n\t\t}\n\n\/\/punchholes at the bottom of the plate\nif (holes==\"True\")\t{\nfor (j= [0 : holespace : plateY-1*border ]){\n\tfor ( i = [0 : holespace : plateX-2*border ] ){\n\t\t\ttranslate([i+border-plateX\/2+3,j+border-plateY\/2, 0]) circle(holeradius);\n\t}\n\t}\n\n}\n\t}\t\t\t\n\n\/\/Passage for cables\ntranslate([-plateX\/2+5,j+border-plateY\/2, 0]) cube([5,0.5*plateY,plateZ], center=true);\ntranslate([plateX\/2-5,j+border-plateY\/2, 0]) cube([5,0.5*plateY,plateZ], center=true);\n\n}\nif (baseF==\"True\")\ntranslate([-plateX\/2,plateY\/2-plateZ,-plateZ\/2]) cube([plateX,plateZ,borderZ]);\nif (baseB==\"True\")\ntranslate([-plateX\/2,-plateY\/2,-plateZ\/2]) cube([plateX,plateZ,borderZ]);\n\ntranslate([-plateX\/2,-plateY\/2,5])rotate(90,[1,0,0]) scale([2,2,1]) drawtext(text);\n\n}\n\nmodule SensorsPlate(){\n\tIRLedD=3;\n\t\n\tplate(\"True\",\"True\",\"false\",\"\");\n\tdifference(){\n\t\ttranslate([0,-plateY\/2+10,borderZ-plateZ\/2])\n\t\trotate([180,0,0]) difference(){ \n\t\t\tscale( v=[1,0.30,1] ) difference() {\t\t\n\t\t\t\t\tcylinder( r = plateX\/2, h=borderZ, center=false );\n\t\t\t\t\tcylinder( r = plateX\/2-2*plateZ, h=borderZ, center=false );\t\t\t\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\n\t\t translate([-plateX\/2,-plateY\/2+10,0])cube([plateX,0.35*plateX\/2,plateY\/2]);\n\t\t}\n\t\t\/\/hole for the IR sensor\n\t \ttranslate([-plateX\/2+12,-plateY\/2+2,borderZ\/4])rotate([100,0,-30]) translate([6,-3.48,0])cube([6,6.95,10]);\n\t\ttranslate([-8,-plateY\/2-10,borderZ\/4])rotate([100,0,0]) translate([6,-3.48,0])cube([6,6.95,10]);\n\t\ttranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/4])rotate([100,0,30]) translate([-12,-3.48,0])cube([6,6.95,10]);\n\t\n\t\t\/\/holes for sonars and slots for sensors\n\t\ttranslate([0+28,-plateY\/2-8,borderZ\/2])rotate([90,0,0]) cylinder(r=16.8\/2,h=8);\n\t\ttranslate([0-28,-plateY\/2-8,borderZ\/2])rotate([90,0,0]) cylinder(r=16.8\/2,h=8);\n\t\ttranslate([0,-plateY\/2-8,borderZ\/2])rotate([90,0,0]) cube([3,1,5]);\n\t\ttranslate([-plateX\/2+12,-plateY\/2+2,borderZ\/2])rotate([90,0,-30]) cube([3,1,5]);\n\t\ttranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/2])rotate([90,0,30]) cube([3,1,5]);\n\n\ttranslate([-plateX\/2+12,-plateY\/2+2,borderZ\/4]) rotate([100,0,-30])cylinder(r=1.5+IRLedD,h=10);\ntranslate([-8,-plateY\/2-10,borderZ\/4]) rotate([100,0,0])cylinder(r=1.5+IRLedD,h=10);\ntranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/4]) rotate([100,0,30])cylinder(r=1.5+IRLedD,h=10);\n\t}\n\n\/\/Tubes to focus the IR beams\n\ttranslate([-plateX\/2,-plateY\/2-30,0]) difference (){cylinder(r=1+IRLedD,h=15); cylinder(r=IRLedD,h=15);}\n\ttranslate([-plateX\/2+15,-plateY\/2-30,0]) difference (){cylinder(r=1+IRLedD,h=15); cylinder(r=IRLedD,h=15);}\n\ttranslate([-plateX\/2+30,-plateY\/2-30,0]) difference (){cylinder(r=1+IRLedD,h=15); cylinder(r=IRLedD,h=15);}\n\/\/\ttranslate([-8,-plateY\/2-10,borderZ\/4]) rotate([100,0,0])difference (){cylinder(r=1.2*IRLedD,h=8); cylinder(r=IRLedD,h=10);}\n\/\/\ttranslate([+plateX\/2-12,-plateY\/2+2,borderZ\/4]) rotate([100,0,30])difference (){cylinder(r=1.2*IRLedD,h=10); cylinder(r=IRLedD,h=8);}\n}\n\nmodule PowerPlate(){\n\n\tdifference(){\n\tplate(\"True\",\"True\",\"True\",\"Power\");\n\t\/\/fix for batteries\n\ttranslate([plateX\/2-15,plateY\/2+5,borderZ\/2])translate([0,0,3])rotate([90,0,0])cylinder(h=10,r=2);\t\n\ttranslate([-plateX\/2+15,plateY\/2+5,borderZ\/2])translate([0,0,3])rotate([90,0,0])cylinder(h=10,r=2);\t\n\ttranslate([plateX\/2-15,-plateY\/2+5,borderZ\/2])translate([0,0,3])rotate([90,0,0])cylinder(h=10,r=2);\t\n\ttranslate([-plateX\/2+15,-plateY\/2+5,borderZ\/2])translate([0,0,3])rotate([90,0,0])cylinder(h=10,r=2);\t\n\t\t\n\t}\n\t\t\n\ttranslate([plateX\/2-15,plateY\/2+4,borderZ\/2])\n\t\tdifference(){\n\t\t\tsphere(2);rotate([0,90,0])translate([0.7,0.6,0])cylinder(h=10,r=1.1, center=true);}\t\n\ttranslate([-plateX\/2+15,plateY\/2+4,borderZ\/2])\n\t\tdifference(){\n\t\t\tsphere(2);rotate([0,90,0])translate([0.7,0.6,0])cylinder(h=10,r=1.1, center=true);}\t\n\ttranslate([plateX\/2-15,-plateY\/2-1,borderZ\/2])rotate([0,0,180])\n\t\tdifference(){\n\t\t\tsphere(2);rotate([0,90,0])translate([0.7,0.6,0])cylinder(h=10,r=1.1, center=true);}\t\n\ttranslate([-plateX\/2+15,-plateY\/2-1,borderZ\/2])rotate([0,0,180])\n\t\tdifference(){\n\t\t\tsphere(2);rotate([0,90,0])translate([0.7,0.6,0])cylinder(h=10,r=1.1, center=true);}\t\n\t\n\t\n\t\/\/mid section\n\t\tdifference(){\n\t\t\ttranslate([-plateX\/2,0,0]) cube([plateX,plateZ,borderZ]);\n\t\t\tfor ( i = [1 : plateX\/4 : plateX] ){\n\t\t\t\ttranslate([i+(-plateX\/2)+borderZ\/2,10,borderZ\/2]) rotate([90,0,0]) cylinder(20,r=0.8*borderZ\/2);\n\t\n\t\t\t}\n\t\t\n\t\n\t}\n\n\n}\n\nmodule BrainPlate()\n{\n\tplate(\"False\",\"True\",\"True\",\"\"); \n\ttranslate([-plateX\/2,-plateY\/2,borderZ\/2]){\n\tcolor(\"green\")rotate([90,0,0])\n\t\ttranslate([120,-2,0])scale(0.3)arduinoLogo(5,30);\n\t\ttranslate([5,-12,0])scale(0.1)put_pilogo(1.5\/0.1);\n\t\ttranslate([80,-2,0])scale(0.1)put_OAlogo(1.5\/0.1);}\n}\n\t\n\nmodule MotorBody()\n{difference(){\n\tlinear_extrude(RobotZ, center = true, convexity = 0, twist = 0){\n\t\tdifference() {\n\/\/eed to redefine the motorbody as a fixed lenght \t\t\t\nunion(){translate([0,RobotX\/2,0]) square([RobotX,220-RobotX-15]);translate([RobotX\/2,40,0]) circle(RobotX\/2);}\n\t\t\ttranslate([RobotX\/2,40,0]) circle(26\/2);\n\t\t\ttranslate([RobotX\/2,40,0]) circle(3);\n\t\t\t\t\t\n\t\t\t\/\/Motor holes\n\t\t\ttranslate([RobotX\/2, 40, 0]){\n\t\t\tfor ( i = [0 : 4] )\n\t\t\t\t{\n\t\t\t\t rotate( (i * 360 \/ 4)+45)\n\t\t\t\t \/\/datasheet provides distance between holes, we need the radius from the shaft\n\t\t\t\t\t translate([21.92, 0, 0])\n\t\t\t\t circle(3);\n\t\t\t\t}}\n\t\t\t\/\/Modules\n\t\t\tfor ( i = [112 :BodyHoleSpace: RobotY] ){\n\t\t\t\ttranslate([RobotX\/2,i,0]) circle(BodyHoleR);\t\t\n\t\t\/\/Slots for plates\n\t\t\t\ttranslate([RobotX\/8,i-BodyHoleR-5,0]) square([1.15*plateanchorY,1.15*plateZ]);\ntranslate([7*(RobotX\/8)-plateanchorY,i-BodyHoleR-5,0]) square([plateanchorY,plateZ]);\n\t\t\t\ttranslate([RobotX\/2,i-25-plateZ,0]) circle(3);\t\n\t\t\t\ttranslate([RobotX\/8,i,0]) circle(3);\t\t\n\t\t\t\ttranslate([7*RobotX\/8,i,0]) circle(3);\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\t\/\/Connection with body extension\n\t\t\ttranslate([0,220-RobotX+2,0]) cube([RobotX,25,RobotZ\/2]);\n\t\t\ttranslate([15,3*BodyHoleSpace-25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\t\n\t\t\ttranslate([RobotX-15,3*BodyHoleSpace-25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n}\n}\n\nmodule BodyExtension()\n{ difference() {\n\tlinear_extrude(RobotZ, center = true, convexity = 0, twist = 0){\n\t\tdifference() {\n\t\t\tsquare([RobotX,RobotY]);\n\t\t\tfor ( i = [0 :BodyHoleSpace: RobotY] ){\n\t\t\t\ttranslate([RobotX\/2,i,0]) circle(BodyHoleR);\t\t\n\t\t\t\ttranslate([RobotX\/8,i-BodyHoleR-5,0]) square([1.15*plateanchorY,1.15*plateZ]);\n\t\t\t\ttranslate([7*(RobotX\/8)-plateanchorY,i-BodyHoleR-5,0]) square([plateanchorY,plateZ]);\n\t\t\t\ttranslate([RobotX\/2,i-25-plateZ,0]) circle(3);\t\t\t\t\t\t\ttranslate([RobotX\/8,i,0]) circle(3);\t\t\n\t\t\t\ttranslate([7*RobotX\/8,i,0]) circle(3);\t\t\n\t\t\n\t\t\t}\n\ntranslate([RobotX\/8,0,0]) square([1.05*plateanchorY,1.05*plateZ]);\ntranslate([7*(RobotX\/8)-plateanchorY,0,0]) square([plateanchorY,plateZ]);\n\/*\ntranslate([RobotX\/8,RobotY-plateanchorY,0]) square([1.05*plateanchorY,1.05*plateZ]);\ntranslate([7*(RobotX\/8)-plateanchorY,0,0]) square([plateanchorY,plateZ]);\n\n\t*\/\t}\n\t\n\t}\n\t\t\t\n\/\/creates attachment for other vertical modules\n\t\t\ttranslate([0,RobotY-25,0]) cube([RobotX,25,RobotZ\/2]);\n\t\t\ttranslate([15,RobotY-25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n\t\t\ttranslate([RobotX-15,RobotY-25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n\n\t\t\ttranslate([0,0,0]) cube([RobotX,25,RobotZ\/2]);\n\t\t\ttranslate([15,25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n\t\t\ttranslate([RobotX-15,25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\n\t\t\t}\n\t\t\t \n\n\n}\t\n\n$fs = 0.01;\n\nmodule PCBSupport(PCBHoleR){\n\tdifference (){\n\t\tcylinder(h=plateZ+5,r=holeradius-.2);\t\n\t\tcylinder(h=plateZ+2,r=holeradius\/2);\t\n\t\tcube([10,1,8], center=true);\n\t}\n\t\ttranslate([0,0,plateZ+5])cylinder(h=6,r=PCBHoleR);\t\n\n}\n\nmodule PCBSupportHole(PCBHoleR, Height){\n\tdifference (){\n\t\tcylinder(h=plateZ+Height,r=holeradius-T);\t\n\t\tcylinder(h=plateZ-5,r=holeradius\/2);\t\n\t}\n\t\ttranslate([0,0,plateZ+Height])cylinder(h=6,r=PCBHoleR);\t\n\n}\n\n\/\/Draw a prism based on a \n\/\/right angled triangle\n\/\/l - length of prism\n\/\/w - width of triangle\n\/\/h - height of triangle\nmodule prism(l, w, h, he) {\n\ttranslate([0, l, 0]) rotate( a= [90, 0, 0]) \n\tlinear_extrude(height = he) polygon(points = [\n\t\t[0, 0],\n\t\t[w, 0],\n\t\t[0, h]\n\t], paths=[[0,1,2,0]]);\n}\n\n\n\n\/\/creates attachment for other vertical modules\nmodule base(){\n\trotate([90,0,0]){\n\t\t\ttranslate([0,-(RobotY-25),-RobotX]){\n\t\t\t\tdifference(){\n\t\t\t\t\ttranslate([0,RobotY-25,0]) cube([RobotX,25,RobotZ\/2]);\n\t\t\t\t\ttranslate([15,RobotY-25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n\t\t\t\t\ttranslate([RobotX-15,RobotY-25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n\t\t\t}}\n\t\t\ttranslate([0,0,RobotX]){\n\t\t\t\tdifference(){\n \n\t\t\t\ttranslate([0,-stepperSupportHeight+0,0]) cube([RobotX,25+stepperSupportHeight,5]);\n \n\t\t\t\ttranslate([15,25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);\t\n\t\t\t\ttranslate([RobotX-15,25\/2,-RobotZ\/2])\tcylinder(h=2*RobotZ,r=3);}}}\n\n\ndifference()\n{\n translate([0,-RobotX-RobotZ\/2,-25\/2+7]){\n\n\t\t\t\tcube([RobotX,2*(RobotX+RobotZ\/4),6], center=false);\n translate([RobotX\/2,0,-((5+60)\/2)]){rotate([90,0,0])cylinder(h=10, r=38.01\/2+T, center=true);\n \n translate([47.14\/2,0,47.14\/2])rotate([90,0,0])cylinder(h=10, r=2.5, center=true);\n \n translate([47.14\/2,0,-47.14\/2])rotate([90,0,0])cylinder(h=10, r=2.5, center=true);\n \n translate([-47.14\/2,0,47.14\/2])rotate([90,0,0])cylinder(h=10, r=2.5, center=true);\n \n translate([-47.14\/2,0,-47.14\/2])rotate([90,0,0])cylinder(h=10, r=2.5, center=true); \n }\n\t\t\t}\n\t\ntranslate([RobotX\/2-border,0,0]) {\n\nfor (i= [0 : 2*holeradius+3: plateY - 4*border]){\n\nfor (j= [0 : 2*holeradius+3: plateY-2*border ]){\n\t\n\t\t\ttranslate([i-border,j-plateY+border, -10]) cylinder(h=15,r = holeradius);\n translate([i-border,-j+plateY-border, -10]) cylinder(h=15,r = holeradius);\n\t}\t\n}\n }\n \n translate([plateX\/4,0, 0])cylinder(h=15,r = plateX\/15, center=true);\n \n}\n\n}\n\nbase();\nPCBSupportHole(0,8);\n\/\/permaproto drill holes 1.2mm \n\n\n\n\n\/\/MotorBody();\n\/\/BodyExtension();\n\/\/SensorsPlate();\n\n\t\/\/rotate([0,0,90])plate(\"True\",\"True\",\"True\", \" Motors\");\n\n\t\/\/translate([RobotX\/2,-RobotX,0])rotate([0,0,90]) prism(3,30,25,RobotZ);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fd00e5b9dd6ed0f18d83835b9b1356138b861761","subject":"Added springy bits","message":"Added springy bits\n\nfor illustration purposes only :)\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"module Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = 2;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 45;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Guide pins\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\tfor(i = [0,1])\n\t\tmirror([i, 0, 0,]) {\n\t\t\ttranslate([-1.5 - 8.6, BaseDiameter\/2 - Bumper_Pin_Length, 0])\n\t\t\t\tcube([Bumper_Pin_Width, Bumper_Pin_Length + eta, 5]);\n\t\t\ttranslate([-1.5 - 8.6, BaseDiameter\/2, 0])\n\t\t\t\tcube([Bumper_Pin_Width + 8.5, offset + eta, 5]);\n\t\t}\n\t}\n\n\t\/\/ Springy bits - to illustrate the idea\n\t\/\/ would also get rid of the need for the guide pins\n\tfor(i=[0,1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 19, 0])\n\t\trotate([0,0,90])\n\t\tlinear_extrude(5)\n\t\tdonutSector(12,11,180, center=true);\n\n}\n","old_contents":"module Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\t\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = 2;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 45;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Guide pins\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\tfor(i = [0,1])\n\t\tmirror([i, 0, 0,]) {\n\t\t\ttranslate([-1.5 - 8.6, BaseDiameter\/2 - Bumper_Pin_Length, 0])\n\t\t\t\tcube([Bumper_Pin_Width, Bumper_Pin_Length + eta, 5]);\n\t\t\ttranslate([-1.5 - 8.6, BaseDiameter\/2, 0])\n\t\t\t\tcube([Bumper_Pin_Width + 8.5, offset + eta, 5]);\n\t\t}\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a918a298e8d8483f5351266ef65ec0a04fbbafb6","subject":"Dirty hack for rotation of header material","message":"Dirty hack for rotation of header material\n\nFIXME: material needs to be rotated based on vector argument","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0) {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Distance to middle from origin\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5*25.4, ArduinoPro_PCB_Height])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(2*sqrt(.4*25.4), center=true);\n\n \/\/ Reset switch (or crystal for Pro Micro)\n color(\"silver\")\n translate([moveX, 0.15*25.4, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n square([5, 3.5], center=true);\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=2)\n union() {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n union() {\n square([1, 2.5], center=true);\n translate([0, 3, 0])\n square([2.5, 1.5], center=true);\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin() {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Distance to middle from origin\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5*25.4, ArduinoPro_PCB_Height])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(2*sqrt(.4*25.4), center=true);\n\n \/\/ Reset switch (or crystal for Pro Micro)\n color(\"silver\")\n translate([moveX, 0.15*25.4, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n square([5, 3.5], center=true);\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=2)\n union() {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n union() {\n square([1, 2.5], center=true);\n translate([0, 3, 0])\n square([2.5, 1.5], center=true);\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"41255a66739b4cbf42caacc39840d971e4589324","subject":"Use centre line along y as datum for SMT components","message":"Use centre line along y as datum for SMT components\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 0.1 * 25.4; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n datumX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n datumZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([datumX, 0.5 * 25.4, datumZ])\n rotate([0,0,45])\n linear_extrude(1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([datumX, 0.05 * 25.4, datumZ])\n {\n color(\"silver\")\n linear_extrude(1.2)\n square([4.5, 4.5], center=true);\n color(\"sandybrown\")\n translate([0, 0, 1.2])\n linear_extrude(0.5)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([datumX, 0.05 * 25.4, datumZ])\n linear_extrude(1)\n {\n \/\/ Red - Power\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ Green - Status\n translate([0.2 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([datumX, 0.15 * 25.4, datumZ])\n linear_extrude(1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([datumX, 0.2 * 25.4, datumZ])\n linear_extrude(1)\n {\n \/\/ RX - Yellow\n translate([-0.3 * 25.4\/2, 0, 0])\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([-0.15 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4\/2, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([datumX, moveY, datumZ])\n linear_extrude(2)\n {\n translate([-7.5\/2, 0, 0])\n square([1.5, 3.5], center=true);\n translate([7.5\/2, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([datumX, moveY, datumZ])\n linear_extrude(1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n moveZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5 * 25.4, moveZ])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([moveX, 0.05 * 25.4, moveZ])\n {\n color(\"silver\")\n linear_extrude(height=1.2)\n square([4.5, 4.5], center=true);\n color(\"gold\")\n translate([0, 0, 1.2])\n linear_extrude(height=0.5)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([0.5 * 25.4, 0.05 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ Green - Status\n square([0.7,1.2], center=true);\n \/\/ Red - Power\n translate([-0.2 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n }\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([moveX, 0.15 * 25.4, moveZ])\n linear_extrude(height=1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([moveX\/2, 0.2 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ RX - Yellow\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors etc.\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, moveZ])\n linear_extrude(height=2)\n {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, moveZ])\n linear_extrude(height=1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"80bd956ffa5c422ca09325725788a85ab8af3560","subject":"Adjusted bottom","message":"Adjusted bottom\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 8;\nfn = 10;\ngaika_d = 6.25;\ngaika_h = 2.5;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_d\/2, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 1;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 37.4;\ncontrast_start_y = shift_y + 26.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 6;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n translate([volume_start_x, volume_start_y, -eps]) {\n cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6aa646b2cf2cee208828b4840035c5248cfd3c58","subject":"change the nut trap drawing code","message":"change the nut trap drawing code\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.5;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_d = 6.25;\ngaika_h = 6;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_d\/2, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"14c83b79ad8b9ddab0f1c74eb7bb295137ced07e","subject":"TubeCollector","message":"TubeCollector\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"TubeCollector\/TubeCollector.scad","new_file":"TubeCollector\/TubeCollector.scad","new_contents":"\/\/TubeCollector\n\n\/\/Parameters\n$fn=50;\ninnerDiameter = 40;\nouterDiameter = 45;\nhoseDiameter = 10;\n\nmodule bottom() {\n difference() {\n circle(d=outerDiameter+5);\n circle(d=hoseDiameter);\n }\n}\nmodule top() {\n difference() {\n circle(d=innerDiameter);\n circle(d=hoseDiameter);\n }\n}\nmodule extrude(h=5) {\n linear_extrude(height=h)children();\n}\nmodule assembly() {\n extrude()bottom();\n translate([0,0,5])extrude()top();\n}\nassembly();","old_contents":"","returncode":1,"stderr":"error: pathspec 'TubeCollector\/TubeCollector.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"526e704206e3ef33c8d915d4e3499b21aa1b2075","subject":"Add demo for the starBox shape and some other shapes","message":"Add demo for the starBox shape and some other shapes\n","repos":"jsconan\/camelSCAD","old_file":"samples\/christmas-star.scad","new_file":"samples\/christmas-star.scad","new_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * A parametric christmas star.\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ As we need to use some shapes, use the right entry point of the library\nuse <..\/shapes.scad>\n\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = \"prod\";\n\n\/\/ Defines the dimensions of the star\nradius = 40;\r\nthickness = 3;\r\nholeDiameter = 4;\r\nringThickness = 2;\r\nringDiameter = holeDiameter + ringThickness * 2;\r\ncoreRadius = (radius * 2) * (1 - 3 \/ 5);\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\n$fa = facetAngle(renderMode);\n$fs = facetSize(renderMode);\n\n\/\/ And draw the star\nunion() {\n \/\/ This is the frame of the star\n difference() {\n starBox(size=radius, h=thickness, edges=5, center=true);\n starBox(size=radius \/ 1.5, h=thickness + 1, edges=5, center=true);\n }\n \/\/ This is the core of the star\n rotateZ(180) {\n difference() {\n regularPolygonBox(size=coreRadius, n=5, h=thickness, center=true);\n cylinder(r=radius \/ 5, h=thickness + 1, center=true);\n }\n }\n \/\/ This the ring to hook the star\n translate([0, radius + ringThickness]) {\n pipe(d=ringDiameter, w=ringThickness, h=thickness, center=true);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/christmas-star.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"428bea0c215c3b267be603c024a66f5407bca059","subject":"attach: fix warnings (using undefined global vars)","message":"attach: fix warnings (using undefined global vars)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"attach.scad","new_file":"attach.scad","new_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/ ATTACH OPERATOR\n\/\/ This operator applies the necessary transformations to the\n\/\/ child (attachable part) so that it is attached to the main part\n\/\/ Parameters\n\/\/ a: Connector of the main part\n\/\/ b: Connector of the attachable part\n\/\/ explode: extra translation between parts (child moved away from parent)\n\/\/ roll:\n\/\/ rollaxis:\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis=N)\n{\n \/*if($debug)*\/\n \/*echo(\"attach():\", a,b,roll,rollaxis);*\/\n\n assert(is_list(a), a);\n assert(len(a)==2, a);\n assert_v3n(a[0], a);\n assert_v3n(a[1], a);\n \/*assert(a[1]!=N, a);*\/\n\n assert(is_list(b), b);\n assert(len(b)==2, b);\n assert_v3n(b[0], b);\n assert_v3n(b[1], b);\n \/*assert(b[1]!=N, b);*\/\n\n assert(is_num(roll));\n\n \/\/ Get the data from the connectors\n \/\/ Attachment point. Main part\n pos1 = a[0];\n \/\/ Attachment axis. Main part\n v = a[1];\n\n \/\/ Attachment point. Attachable part\n pos2 = b[0];\n \/\/ Atachment axis. Attachable part\n vref = b[1];\n\n assert(is_list(pos1));\n assert(is_list(v));\n assert(is_list(pos2));\n assert(is_list(vref));\n\n \/\/ Calculations for the \"orientate operator\"\n \/\/ Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/ Calculate the angle between the vectors\n \/\/ this can become nan if vref and v are N\n ang_ = v_anglev(vref,v);\n ang = is_num(ang_)?ang_:0;\n assert(is_num(ang));\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/*if($debug)*\/\n \/*echo(pos1,v,pos2,vref, raxis, ang, raxis_);*\/\n\n \/\/ Apply the transformations to the child\n\n \/\/ Place the attachable part on the main part attachment point\n t(pos1)\n \/\/ Orientate operator. Apply the orientation so that\n \/\/ both attachment axis are paralell. Also apply the roll angle\n r(a=roll, v=rollaxis)\n r(a=ang, v=raxis_)\n \/\/ Attachable part to the origin\n t(-pos2)\n t(is_undef($explode)?[0,0,0]:-$explode*vref)\n {\n children();\n\n if(is_undef($show_conn)?false:$show_conn)\n connector([b.x, -b.y]);\n }\n\n if(is_undef($show_conn)?false:$show_conn)\n connector(a);\n}\n\nif(false)\n{\n s=[10,10,10];\n\n conn = [X*s.x\/2,X];\n\n \/*connector(conn);*\/\n cubea(s);\n attach(conn, -conn, $explode=2)\n spherea(d=s.x);\n}\n\n","old_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/ ATTACH OPERATOR\n\/\/ This operator applies the necessary transformations to the\n\/\/ child (attachable part) so that it is attached to the main part\n\/\/ Parameters\n\/\/ a: Connector of the main part\n\/\/ b: Connector of the attachable part\n\/\/ explode: extra translation between parts (child moved away from parent)\n\/\/ roll:\n\/\/ rollaxis:\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis=N)\n{\n \/*if($debug)*\/\n \/*echo(\"attach():\", a,b,roll,rollaxis);*\/\n\n assert(is_list(a), a);\n assert(len(a)==2, a);\n assert_v3n(a[0], a);\n assert_v3n(a[1], a);\n \/*assert(a[1]!=N, a);*\/\n\n assert(is_list(b), b);\n assert(len(b)==2, b);\n assert_v3n(b[0], b);\n assert_v3n(b[1], b);\n \/*assert(b[1]!=N, b);*\/\n\n assert(is_num(roll));\n\n \/\/ Get the data from the connectors\n \/\/ Attachment point. Main part\n pos1 = a[0];\n \/\/ Attachment axis. Main part\n v = a[1];\n\n \/\/ Attachment point. Attachable part\n pos2 = b[0];\n \/\/ Atachment axis. Attachable part\n vref = b[1];\n\n assert(is_list(pos1));\n assert(is_list(v));\n assert(is_list(pos2));\n assert(is_list(vref));\n\n \/\/ Calculations for the \"orientate operator\"\n \/\/ Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/ Calculate the angle between the vectors\n \/\/ this can become nan if vref and v are N\n ang_ = v_anglev(vref,v);\n ang = is_num(ang_)?ang_:0;\n assert(is_num(ang));\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/*if($debug)*\/\n \/*echo(pos1,v,pos2,vref, raxis, ang, raxis_);*\/\n\n \/\/ Apply the transformations to the child\n\n \/\/ Place the attachable part on the main part attachment point\n t(pos1)\n \/\/ Orientate operator. Apply the orientation so that\n \/\/ both attachment axis are paralell. Also apply the roll angle\n r(a=roll, v=rollaxis)\n r(a=ang, v=raxis_)\n \/\/ Attachable part to the origin\n t(-pos2)\n t(-$explode==U?[0,0,0]:$explode*vref)\n {\n children();\n\n if($show_conn)\n connector([b.x, -b.y]);\n }\n\n if($show_conn)\n connector(a);\n}\n\nif(false)\n{\n s=[10,10,10];\n\n conn = [X*s.x\/2,X];\n\n \/*connector(conn);*\/\n cubea(s);\n attach(conn, -conn, $explode=2)\n spherea(d=s.x);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"cdc230d87e8b4014953a959cf7cd2eccd5ebfae5","subject":"base: rename position","message":"base: rename position\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/base.scad","new_file":"class1\/exercise\/refactor\/base.scad","new_contents":"include ;\n\nDIAMETER_BASE = 6;\nDIAMETER_OUTER_RING = 0.6;\nTHICKNESS = 0.3; \n\nfunction radius(diameter) = diameter \/ 2;\n\nmodule base()\n{\n surface();\n border();\n}\n\nmodule surface()\n{\n position_z = - HEIGHT_BODY - THICKNESS;\n position = [0, 0, position_z];\n \n diameter_total = DIAMETER_BASE - DIAMETER_OUTER_RING;\n \n color(GREY)\n translate(position)\n cylinder(h = THICKNESS, d = diameter_total, $fn = FINE);\n}\n\nmodule border()\n{\n position_base_z = -HEIGHT_BODY;\n position_base = [0, 0, position_base_z];\n \n position_border_x = radius(DIAMETER_BASE) - radius(DIAMETER_OUTER_RING);\n\n position_border = [position_border_x, 0, 0];\n \n color(GREY)\n translate(position_base)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_border)\n circle(r = THICKNESS, $fn = FINE);\n}\n\nbase();","old_contents":"include ;\n\nDIAMETER_BASE = 6;\nDIAMETER_OUTER_RING = 0.6;\nTHICKNESS = 0.3; \n\nfunction radius(diameter) = diameter \/ 2;\n\nmodule base()\n{\n surface();\n border();\n}\n\nmodule surface()\n{\n offset_z = - HEIGHT_BODY - THICKNESS;\n offset = [0, 0, offset_z];\n \n diameter_total = DIAMETER_BASE - DIAMETER_OUTER_RING;\n \n color(GREY)\n translate(offset)\n cylinder(h = THICKNESS, d = diameter_total, $fn = FINE);\n}\n\nmodule border()\n{\n offset_z = -HEIGHT_BODY;\n offset_base = [0, 0, offset_z];\n \n offset_x = radius(DIAMETER_BASE) - radius(DIAMETER_OUTER_RING);\n offset_border = [offset_x, 0, 0];\n \n color(GREY)\n translate(offset_base)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(offset_border)\n circle(r = THICKNESS, $fn = FINE);\n}\n\nbase();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f7bc45e4adcce03e6c3f75b134a6290862daa89a","subject":"[scad] first enclosure iteration in openscad","message":"[scad] first enclosure iteration in openscad\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"module kube()\n{\n\tdifference() {\n\t\tcube(35, 35, 35);\n\t\ttranslate([2, 2, 7]) {\n\t\t\tcube(31, 31, 28);\n\t\t}\n\t\ttranslate([17.5, 17.5, 2]) {\n\t\t\tcylinder(r=13.7, h=5);\t\/* r(magnet) = 13.5 *\/\n\t\t}\n\t}\n\n\ttranslate([17.5, 17.5, 2]) {\n\t\tcylinder(r=5, h=9.5);\n\t}\n}\n\nkube();","old_contents":"","returncode":1,"stderr":"error: pathspec 'enclosure\/kube.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"4ceb97c1db38247f2d35abcb50ed2f9076f062a1","subject":"adjusted dimensions to match the real phone","message":"adjusted dimensions to match the real phone\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/phone-charging-holder\/holder.scad","new_file":"openscad\/phone-charging-holder\/holder.scad","new_contents":"\/\/ Holder for 4 phones - for the charging station\nuse <..\/common\/extrusions.scad>\nLARGE = 100;\nEPSILON = 0.01;\n\niw = 16.5; \/\/ enough to fit phone thickness\nthick = 3; \/\/ wall thickness\now = iw + 2*thick;\nri = 5; \/\/ internal curvature - should work with phone curvature\nro = 0;\nwall_height = 35; \/\/ wall height\nlength = 60; \/\/ front-to-back length - along phone should be at least half phone length\ndome_r = 5;\n\nmodule U() {\n O_channel(\n ow, wall_height, \n iw, LARGE,\n thick, thick,\n ro, ri, length\n );\n}\n\nmodule dome_U() {\n hi = 2*wall_height;\n translate([LARGE-EPSILON,0,0]) rotate([0,-90,0])translate([-thick, 0, 0])\n O_channel(\n length+2*thick, hi\/2+2*thick,\n length, hi,\n thick, -hi\/2, \/\/ offsets\n 0, dome_r,\n LARGE\n );\n}\n\nmodule many_Us(n) {\n separation = ow - thick;\n for (i = [0 : n-1]) {\n translate([i*separation, 0, 0]) U();\n }\n}\n\nmodule holder() {\n difference() {\n many_Us(4);\n dome_U();\n }\n}\n\nholder();\n\/\/dome_U();\n\/\/translate ([50, 0, 0]) many_Us(4);","old_contents":"\/\/ Holder for 4 phones - for the charging station\nuse <..\/common\/extrusions.scad>\nLARGE = 100;\nEPSILON = 0.01;\nmodule marker_thing() {\n w = 4.5*25.4;\n thick = 3;\n d = 2*25.4;\n h = 2*25.4;\n ri = 3;\n ro = 1;\n \n O_channel(\n w+2*thick, h+thick, \n w, LARGE, \n thick, thick, ro, ri, d);\n \/\/cube([w, d, h]);\n}\n\niw = 10; \/\/ enough to fit phone thickness\nthick = 3; \/\/ wall thickness\now = iw + 2*thick;\nri = 3; \/\/ internal curvature - should work with phone curvature\nro = 0;\nwall_height = 20; \/\/ wall height\nlength = 30; \/\/ front-to-back length - along phone should be at least half phone length\ndome_r = 4;\n\nmodule U() {\n O_channel(\n ow, wall_height, \n iw, LARGE,\n thick, thick,\n ro, ri, length\n );\n}\n\nmodule dome_U() {\n hi = 2*wall_height;\n translate([LARGE-EPSILON,0,0]) rotate([0,-90,0])translate([-thick, 0, 0])\n O_channel(\n length+2*thick, hi\/2+2*thick,\n length, hi,\n thick, -hi\/2, \/\/ offsets\n 0, dome_r,\n LARGE\n );\n}\n\nmodule many_Us(n) {\n separation = ow - thick;\n for (i = [0 : n-1]) {\n translate([i*separation, 0, 0]) U();\n }\n}\n\nmodule holder() {\n difference() {\n many_Us(4);\n dome_U();\n }\n}\n\nholder();\n\/\/dome_U();\n\/\/translate ([50, 0, 0]) many_Us(4);","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"0a83659373a978414b3b87d683563a8877107131","subject":"main model of toy elevator roller","message":"main model of toy elevator roller\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toy_elevator_roll\/toy_elevator_roll.scad","new_file":"toy_elevator_roll\/toy_elevator_roll.scad","new_contents":"eps=0.01;\nr_stick=2.8\/2; \/\/ extr_width=0.4, d=2.5mm, thus 7*0.4=2.8 as a next best thing\n\nmodule roller()\n{\n difference()\n {\n cylinder(r=20\/2, h=5, $fn=200);\n translate([0, 0, -eps])\n cylinder(r=r_stick, h=5+2*eps, $fn=200);\n }\n translate([20\/2-5\/2, 0, 5])\n cylinder(r=5\/2, h=20, $fn=100);\n}\n\nmodule spool_body_()\n{\n r_ext=(5+2*3)\/2;\n r_int=r_stick+1;\n\n difference()\n {\n union()\n {\n cylinder(r1=r_ext, r2=r_int, h=5.5, $fn=150);\n translate([0, 0, 5.5+3])\n cylinder(r1=r_int, r2=r_ext, h=5.5, $fn=150);\n translate([0, 0, 5.5])\n cylinder(r=r_int, h=3, $fn=100);\n }\n translate([0, 0, -eps])\n cylinder(r=r_stick, h=2*5.5+3+2*eps, $fn=200);\n }\n}\n\nmodule hook_()\n{\n r_int=1\/2;\n r_ext=r_int+1;\n\n difference()\n {\n translate([-2, -1.5\/2, 0])\n cube([2, 1.5, 3+2*3]);\n \n translate([-1, 0, (3+2*3)\/2])\n translate([0, 1, 0])\n rotate([90, 0, 0])\n translate([0, 0, -eps])\n cylinder(r=1\/2, h=2+2*eps, $fn=200);\n }\n}\n\nmodule spool()\n{\n spool_body_();\n translate([-1.8, 0, 2.5])\n hook_();\n}\n\nroller();\ntranslate([20, 0, 0])\n spool();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'toy_elevator_roll\/toy_elevator_roll.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"279be4921f538a65059d98dbc6ac1f1bcc28f613","subject":"[3d] Fix lip edge geometry not perfectly lining up on on side of probewrap","message":"[3d] Fix lip edge geometry not perfectly lining up on on side of probewrap\n\nThe rounded portion of the lip at the 180 degree point wasn't flush with\nthe flat lip on the stackable portions\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/probewrap.scad","new_file":"3d\/probewrap.scad","new_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.5;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 0.75;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule rextrude_180(diameter, h) {\n intersection() {\n translate([-diameter\/2-e, -e, -e])\n cube([diameter+2*e, diameter\/2+e, h+2*e]);\n rotate_extrude()\n children();\n }\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \n translate([0,(center_d-center_w)\/2,0]) \n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.15;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.12;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","old_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.5;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 0.75;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule rextrude_180(diameter, h, $fn) {\n intersection() {\n translate([-diameter\/2-e, e, -e])\n cube([diameter+2*e, diameter\/2+e, h+2*e]);\n rotate_extrude($fn=$fn)\n children();\n }\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rextrude_180(oa_w, height*4, $fn=45)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \n translate([0,(center_d-center_w)\/2,0]) \n rextrude_180(oa_w, height*4, $fn=45)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.15;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.12;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"95c195c73c95604909c2ce519d7e31bb1a7db64f","subject":"[3d] Rearrange some stuff to make it clearer","message":"[3d] Rearrange some stuff to make it clearer\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+38.8,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:No,1:Yes]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+38.8,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c295ba6e1e260e8dc09f52e09cfc5613a7af0fe2","subject":"holder for guide created","message":"holder for guide created\n","repos":"dviejo\/freeSlotTrackDesigner","old_file":"chasis\/rally.scad","new_file":"chasis\/rally.scad","new_contents":"\/**\n * rally.scad\n * \n * Created by Diego Viejo\n * \n * 11\/Dic\/2015\n * \n * This is my attemp on creating a chassis for a rally slot car\n * \n *\/\n\n\/\/guide arm's holder\n\/\/work in progress: check for all the sizes is still needed\nnumSlots = 3;\nguideWidth = 40;\nguideInternalWidth = 30;\nguideHeight = 6;\nguideHoleHeight = 3;\nguideSupportLength = 7;\nguideLength = guideSupportLength + 2 + numSlots*4;\nengineHolderHoleSep = 20;\n\nmodule guide(chassisLink=1)\ndifference()\n{\n cube([guideWidth, guideLength, guideHeight], center=true);\n \n translate([0, guideSupportLength, 0]) cube([guideInternalWidth, guideLength, guideHeight+2], center=true);\n translate([0, 0, guideHeight\/2]) cube([guideInternalWidth, guideLength+2, guideHeight], center=true);\n \n for(i=[1:10])\n {\n translate([-guideWidth\/2-1, -guideLength\/2 + guideSupportLength +i*4, -guideHeight\/2+guideHoleHeight])\n rotate([0, 90, 0]) cylinder(d=2, h=guideWidth+2);\n }\n \n if(chassisLink==1)\n for(i=[-1,1])\n {\n translate([i*engineHolderHoleSep\/2, (guideSupportLength-guideLength)\/2, -guideHeight\/2-1+guideHeight\/4+1+0.3]) cylinder(d=2.5, h=guideHeight\/2+2);\n translate([i*engineHolderHoleSep\/2, (guideSupportLength-guideLength)\/2, -guideHeight\/2-1]) cylinder(d=5, h=guideHeight\/4+1);\n }\n}\n\nguide();","old_contents":"\/**\n * rally.scad\n * \n * Created by Diego Viejo\n * \n * 11\/Dic\/2015\n * \n * This is my attemp on creating a chassis for a rally slot car\n * \n *\/\n\n\/\/guide arm's holder\n\/\/work in progress: check for all the sizes is still needed\nnumSlots = 3;\nguideWidth = 40;\nguideInternalWidth = 30;\nguideHeight = 6;\nguideHoleHeight = 3;\nguideSupportLength = 7;\nguideLength = guideSupportLength + 2 + numSlots*4;\n\nmodule guide()\ndifference()\n{\n cube([guideWidth, guideLength, guideHeight], center=true);\n \n translate([0, guideSupportLength, 0]) cube([guideInternalWidth, guideLength, guideHeight+2], center=true);\n translate([0, 0, guideHeight\/2]) cube([guideInternalWidth, guideLength+2, guideHeight], center=true);\n \n for(i=[1:10])\n {\n translate([-guideWidth\/2-1, -guideLength\/2 + guideSupportLength +i*4, -guideHeight\/2+guideHoleHeight])\n rotate([0, 90, 0]) cylinder(d=2, h=guideWidth+2);\n }\n}\n\nguide();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"006b98ff6dfd91e15aa4846e0d58f70f275eef22","subject":"Well... iT worked","message":"Well... iT worked\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube.scad","new_file":"inverse_cube.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.4;\niterations = 2;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","old_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.4;\niterations = 2;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n echo(\"in here\");\n \n \/\/ aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e1f288d2a716f69eaf91b622c06024919453cc66","subject":"complete string prototype","message":"complete string prototype\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 6.5;\nphotoresistorLength = 6.5;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 8;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 6.5;\nphotoresistorLength = 6.5;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 8;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth + stringWallThickness * 2], center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth + stringWallThickness * 2], center=false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0d7ca4cb2d564bb57d26df5e922787ce009f985c","subject":"use cube in minkowsi","message":"use cube in minkowsi\n","repos":"hagleitn\/GuerrillaRadio,hagleitn\/GuerrillaRadio","old_file":"hardware\/controllerv2.scad","new_file":"hardware\/controllerv2.scad","new_contents":"use ;\nuse ;\n\ndebug = false;\nno_fillet = false;\n\nprint = true;\n\n$fa = 12; \/\/ 12 for printing\n$fs = 2; \/\/ 2 for printing\n$fn = 0;\n\nrender_outer = false;\nrender_full = false;\nrender_all = true;\n\n\/\/ thickness of the shell\nwall = 3;\n\n\/\/ handle dimensions\nhandle_max_width = 35;\nhandle_min_width = 20;\nhandle_length = 75;\n\n\/\/ used to avoid phantom wall when cutting objects\nspace = 1;\n\n\/\/ dimensions of the 4 switches\nswitch_r = 4;\nswitch_offset = [7,7]; \/\/ relative to top and bottom corner\n\n\/\/ dimensions of the led\nled_r = 3;\nled_offset = 2; \/\/ relative to bottom of the gimbal\n\n\/\/ dimensions of the module bay\nmodule_bay = [60,45,18];\ncutout = [13,4];\ncutout_offset = [3,3];\nmodule_bay_lip = 3;\n\n\/\/ gimbal dimensions\ngimbal = [58,58,30];\ngimbal_r = 25;\n\n\/\/ dimensions of 4 gimbal screws per gimbal\ngimbal_screw_offset = [5,5];\ngimbal_screw_r = 1.5;\ngimbal_space = [0,0];\n\n\/\/ power switch dimension\nswitch_cutout = [10,20];\n\n\/\/ angle of left and right side of controller\nside_angle = 10;\n\n\/\/ inclination of the handles\ntilt_angle = 25;\n\n\/\/ screw dimensions\nnut_r = 2.1;\nscrew_head_r = 2;\nscrew_body_r = 1;\nholder_r = 3.5;\nseparator = 4;\n\n\/\/ trim switches\ntrim_switch_r = 6.5\/2;\n\ndims = [gimbal[0]*2+gimbal_space[0]*2,\n max(gimbal[1]+2*gimbal_space[1], module_bay[1]+2*wall+2*module_bay_lip),\n gimbal[2]];\n \n\/\/ needs to be bigger than model\nbox_size = (max(dims[0],dims[1],dims[2]) + handle_length) * 10;\n \nmodule module_bay_cutout() {\n cube([15,2*wall,16], center=true);\n}\n\nmodule module_bay(solid=false) {\n translate([0,0,-wall])\n difference() {\n union() {\n translate([0,0,module_bay[2]\/2+wall\/2])\n cube([module_bay[0]+2*wall, module_bay[1]+2*wall, module_bay[2]+wall], center=true);\n difference() {\n translate([0,0,(module_bay_lip+wall)\/2+module_bay[2]])\n cube([module_bay[0]+2*wall+2*module_bay_lip, \n module_bay[1]+2*wall+2*module_bay_lip, \n module_bay_lip+wall], center=true);\n if (!solid) \n translate([0,0,module_bay[2]\/2+wall])\n cube([module_bay[0]+2*wall, \n module_bay[1]+2*wall, \n module_bay[2]+wall], center=true);\n } \n }\n \n if (!solid) {\n translate([0,0,module_bay[2]+module_bay_lip\/2+wall])\n cube([module_bay[0]+2*module_bay_lip, \n module_bay[1]+2*module_bay_lip, \n module_bay_lip], center=true);\n \n translate([0,0,wall+module_bay[2]\/2]) \n cube([module_bay[0], module_bay[1], module_bay[2]], center=true);\n \n \n translate([module_bay[0]\/2-cutout[0]-cutout_offset[0], \n module_bay[1]\/2-cutout[1]-cutout_offset[1],\n -space])\n cube([cutout[0], cutout[1], wall+2*space]);\n \n translate([0,module_bay[1]\/2+wall,wall+8]) module_bay_cutout();\n translate([0,-module_bay[1]\/2-wall,wall+8]) module_bay_cutout();\n }\n }\n}\n\n\/\/!module_bay();\n\nmodule core(d = [10,10,10], offset = 0, solid=false) {\n scale_cylinder = [1,0.1,1];\n \n addition = sin(side_angle)*d[1];\n \n minkowski() {\n hull() {\n translate([0,-d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,d[0]\/2+addition,d[0]\/2,center=true);\n translate([0,d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,r=d[0]\/2,center=true);\n }\n scale([0.6,0.6,1]) sphere(d[2]\/2 - offset);\n }\n}\n\nmodule core_with_bay(solid=false, debug=false) {\n if (!debug && !no_fillet) {\n fillet(r=25,steps=20) {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n } else {\n union() {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n }\n}\n\nmodule handle(debug=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n tilt_vector = tilt_angle*[cos(side_angle),sin(side_angle),0];\n sf = 0.75;\n scale_vector = [1,1,sf];\n \n hull() {\n difference() {\n core_with_bay(debug=debug);\n translate([-handle_max_width,0,0]) \n rotate([0,0,side_angle+5]) \n cube(dims[0],center=true);\n translate([0,11,0]) \n rotate([0,0,side_angle+5]) \n cube([2*dims[0],dims[0],dims[0]],center=true);\n }\n scale(scale_vector)\n rotate(tilt_vector)\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length,\n dims[2]\/2-sf*handle_min_width\/2])\n sphere(handle_min_width);\n }\n}\n\nmodule core_with_bay_and_handles(debug=false) {\n union() {\n core_with_bay(debug=debug);\n handle(debug=debug);\n mirror() handle(debug=debug);\n }\n}\n\nmodule skin(debug=false, thickness=5, box=box_size) {\n if (!debug) intersection() { \n children(); \n minkowski() {\n cube(2*thickness,center=true);\n \/\/cylinder(thickness,thickness,0,$fn=3,center=true);\n difference() { \n cube(box,center=true); \n children(); \n } \n } \n }\n \n if (debug) children();\n}\n\nmodule cutouts() {\n \n h = 2*wall+2*space;\n\n \/\/ gimbal cutout\n translate([gimbal[0]\/2,0,dims[2]\/2]) \n cylinder(h, r=gimbal_r, center=true);\n \n \/\/ gimbal screw cutout\n translate([gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n translate([gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n \/\/ switches\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, dims[2]\/2-switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, -dims[2]\/2+switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n \n \/\/ power switch\n translate([0,dims[1]\/2+dims[2]\/2,0]) \n rotate([0,90,90])\n cube([switch_cutout[0], switch_cutout[1], gimbal[1]\/2], center=true);\n \n \/\/ led\n translate([0,-gimbal[1]\/2-led_offset-led_r,gimbal[2]\/2]) \n cylinder(h, r=led_r, center=true);\n \n \/\/ trim switches\n translate([-dims[0]\/2+handle_min_width+trim_switch_r-5, -dims[1]\/2-16, 0]) \n rotate([0,45,-25]) \n translate([0,0,dims[2]\/2]) \n cylinder(h=dims[2], r=trim_switch_r, center=true);\n}\n\nmodule screw_cylinder(h=30, solid=false) {\n spacing = 2;\n l = (h-separator)\/2;\n union() {\n translate([0,0,separator\/2+l\/2+spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=nut_r, $fn=6, center=true);\n }\n translate([0,0,separator\/2+spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-l\/2-spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=screw_head_r, center=true);\n }\n }\n}\n\nmodule screw__(solid=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n sf = 0.75;\n\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length-handle_min_width+4,\n dims[2]\/2-sf*handle_min_width\/2-3])\n rotate([tilt_angle,0,0]) \n translate([0,0,-handle_max_width-7])\n mirror([0,0,1]) \n screw_cylinder(2*handle_max_width, solid=solid);\n}\n\nmodule screw___(solid=false) { \n screw_offset = -3;\n \n translate([-module_bay[0]\/2+screw_offset-holder_r,gimbal[1]\/2+holder_r+1,0])\n mirror([0,0,1]) \n screw_cylinder(2*(gimbal[2]+module_bay[2]+wall), solid=solid);\n}\n\nmodule screw_(solid=false, debug=false) {\n intersection() {\n union() {\n screw__(solid=solid);\n screw___(solid=solid);\n }\n core_with_bay_and_handles(debug=debug);\n }\n}\n\n\/\/screw_cylinder();\nmodule screws(solid=false, debug=false) {\n screw_(solid=solid, debug=debug);\n mirror() screw_(solid=solid, debug=debug);\n}\n \nmodule body(solid = false, w = wall) {\n difference() {\n union() {\n difference() {\n skin(debug=debug,thickness=w, box=box_size) {\n core_with_bay_and_handles(debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(true);\n screws(solid=true, debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid);\n screws(solid=false, debug=debug);\n }\n \n if (!solid) cutouts();\n if (!solid) mirror() cutouts();\n }\n}\n\nmodule full_skin() render() {\n if (render_full || render_all) {\n body(w=wall);\n } else {\n import(\"full_skin.stl\");\n }\n}\n\nmodule inner_skin() render() {\n difference() {\n full_skin();\n outer_skin();\n }\n}\n\nmodule outer_skin() render() {\n if (render_outer || render_all) {\n body(w=wall\/2);\n } else {\n import(\"outer_skin.stl\");\n }\n}\n\nmodule bottom(box=box_size) {\n union () {\n difference() {\n outer_skin();\n translate([0,0,box\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2]) \n cube(box, center=true);\n }\n\n difference() {\n full_skin();\n translate([0,0,box\/2-wall\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2-wall\/2]) \n cube(box, center=true);\n }\n }\n}\n\nmodule cut_in_halves() {\n union() {\n translate([-100,0,gimbal[2]\/2]) difference() { \n bottom(box=box_size); \n battery_compartments(solid=true); \n }\n \n translate([100,0,0]) difference() { \n full_skin(); \n bottom(box=box_size); \n }\n }\n}\n\n\nmodule battery_compartments(solid=false) {\n union() {\n battery_compartment(solid);\n mirror() battery_compartment(solid);\n }\n}\n\nbatt = [61,21,24];\nbatt_pos = [-dims[0]\/2-2,-66,-16];\nbatt_rot = [90,26,-101];\n\nmodule battery_compartment_(solid = false) {\n offset = solid ? wall : 0;\n union() {\n intersection() {\n outer_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,offset\/2])\n cube([batt[0]+wall,batt[1],batt[2]-offset],center=true);\n }\n \n intersection() {\n inner_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot) \n translate([0,0,wall\/4+offset\/2])\n cube([batt[0],batt[1],batt[2]+wall\/2-offset],center=true);\n } \n \n \/\/ cutout to open compartment\n if (solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n union() {\n translate([0,0,wall\/2])\n cube([batt[0],batt[1],batt[2]-wall],center=true);\n translate([0,0,-batt[2]\/2]) \n cube([batt[2]\/2,batt[1],2*wall],center=true);\n }\n }\n }\n}\n\nmodule battery_compartment(solid=false) {\n difference() {\n union() {\n difference() {\n battery_compartment_(solid);\n \n \/\/ cutout block to be able to unlatch\n if (!solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2+wall])\n cube([batt[2],batt[1],wall],center=true);\n }\n }\n \n if (!solid) {\n scale([1.01,1.01,1.01])\n union() {\n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n }\n \n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n \n }\n }\n }\n }\n \n if (!solid) {\n difference() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2],batt[1],wall+2],center=true);\n }\n\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2]\/2,batt[1],wall+2],center=true);\n }\n }\n }\n }\n}\n\nif (render_outer) {\n outer_skin();\n} else if (render_full) {\n full_skin();\n} else {\n union() {\n cut_in_halves();\n translate([-100,dims[1]\/2+2*module_bay[1],0]) rotate([0,180,90]) module_cover();\n translate([-100,-dims[1]\/2-2*module_bay[1],0]) battery_compartments();\n }\n}","old_contents":"use ;\nuse ;\n\ndebug = false;\nno_fillet = false;\n\nprint = true;\n\n$fa = 12; \/\/ 12 for printing\n$fs = 2; \/\/ 2 for printing\n$fn = 0;\n\nrender_outer = false;\nrender_full = false;\nrender_all = true;\n\n\/\/ thickness of the shell\nwall = 3;\n\n\/\/ handle dimensions\nhandle_max_width = 35;\nhandle_min_width = 20;\nhandle_length = 75;\n\n\/\/ used to avoid phantom wall when cutting objects\nspace = 1;\n\n\/\/ dimensions of the 4 switches\nswitch_r = 4;\nswitch_offset = [7,7]; \/\/ relative to top and bottom corner\n\n\/\/ dimensions of the led\nled_r = 3;\nled_offset = 2; \/\/ relative to bottom of the gimbal\n\n\/\/ dimensions of the module bay\nmodule_bay = [60,45,18];\ncutout = [13,4];\ncutout_offset = [3,3];\nmodule_bay_lip = 3;\n\n\/\/ gimbal dimensions\ngimbal = [58,58,30];\ngimbal_r = 25;\n\n\/\/ dimensions of 4 gimbal screws per gimbal\ngimbal_screw_offset = [5,5];\ngimbal_screw_r = 1.5;\ngimbal_space = [0,0];\n\n\/\/ power switch dimension\nswitch_cutout = [10,20];\n\n\/\/ angle of left and right side of controller\nside_angle = 10;\n\n\/\/ inclination of the handles\ntilt_angle = 25;\n\n\/\/ screw dimensions\nnut_r = 2.1;\nscrew_head_r = 2;\nscrew_body_r = 1;\nholder_r = 3.5;\nseparator = 4;\n\n\/\/ trim switches\ntrim_switch_r = 6.5\/2;\n\ndims = [gimbal[0]*2+gimbal_space[0]*2,\n max(gimbal[1]+2*gimbal_space[1], module_bay[1]+2*wall+2*module_bay_lip),\n gimbal[2]];\n \n\/\/ needs to be bigger than model\nbox_size = (max(dims[0],dims[1],dims[2]) + handle_length) * 10;\n \nmodule module_bay_cutout() {\n cube([15,2*wall,16], center=true);\n}\n\nmodule module_bay(solid=false) {\n translate([0,0,-wall])\n difference() {\n union() {\n translate([0,0,module_bay[2]\/2+wall\/2])\n cube([module_bay[0]+2*wall, module_bay[1]+2*wall, module_bay[2]+wall], center=true);\n difference() {\n translate([0,0,(module_bay_lip+wall)\/2+module_bay[2]])\n cube([module_bay[0]+2*wall+2*module_bay_lip, \n module_bay[1]+2*wall+2*module_bay_lip, \n module_bay_lip+wall], center=true);\n if (!solid) \n translate([0,0,module_bay[2]\/2+wall])\n cube([module_bay[0]+2*wall, \n module_bay[1]+2*wall, \n module_bay[2]+wall], center=true);\n } \n }\n \n if (!solid) {\n translate([0,0,module_bay[2]+module_bay_lip\/2+wall])\n cube([module_bay[0]+2*module_bay_lip, \n module_bay[1]+2*module_bay_lip, \n module_bay_lip], center=true);\n \n translate([0,0,wall+module_bay[2]\/2]) \n cube([module_bay[0], module_bay[1], module_bay[2]], center=true);\n \n \n translate([module_bay[0]\/2-cutout[0]-cutout_offset[0], \n module_bay[1]\/2-cutout[1]-cutout_offset[1],\n -space])\n cube([cutout[0], cutout[1], wall+2*space]);\n \n translate([0,module_bay[1]\/2+wall,wall+8]) module_bay_cutout();\n translate([0,-module_bay[1]\/2-wall,wall+8]) module_bay_cutout();\n }\n }\n}\n\n\/\/!module_bay();\n\nmodule core(d = [10,10,10], offset = 0, solid=false) {\n scale_cylinder = [1,0.1,1];\n \n addition = sin(side_angle)*d[1];\n \n minkowski() {\n hull() {\n translate([0,-d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,d[0]\/2+addition,d[0]\/2,center=true);\n translate([0,d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,r=d[0]\/2,center=true);\n }\n scale([0.6,0.6,1]) sphere(d[2]\/2 - offset);\n }\n}\n\nmodule core_with_bay(solid=false, debug=false) {\n if (!debug && !no_fillet) {\n fillet(r=25,steps=20) {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n } else {\n union() {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n }\n}\n\nmodule handle(debug=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n tilt_vector = tilt_angle*[cos(side_angle),sin(side_angle),0];\n sf = 0.75;\n scale_vector = [1,1,sf];\n \n hull() {\n difference() {\n core_with_bay(debug=debug);\n translate([-handle_max_width,0,0]) \n rotate([0,0,side_angle+5]) \n cube(dims[0],center=true);\n translate([0,11,0]) \n rotate([0,0,side_angle+5]) \n cube([2*dims[0],dims[0],dims[0]],center=true);\n }\n scale(scale_vector)\n rotate(tilt_vector)\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length,\n dims[2]\/2-sf*handle_min_width\/2])\n sphere(handle_min_width);\n }\n}\n\nmodule core_with_bay_and_handles(debug=false) {\n union() {\n core_with_bay(debug=debug);\n handle(debug=debug);\n mirror() handle(debug=debug);\n }\n}\n\nmodule skin(debug=false, thickness=5, box=box_size) {\n if (!debug) intersection() { \n children(); \n minkowski() {\n cylinder(thickness,thickness,0,$fn=3,center=true);\n difference() { \n cube(box,center=true); \n children(); \n } \n } \n }\n \n if (debug) children();\n}\n\nmodule cutouts() {\n \n h = 2*wall+2*space;\n\n \/\/ gimbal cutout\n translate([gimbal[0]\/2,0,dims[2]\/2]) \n cylinder(h, r=gimbal_r, center=true);\n \n \/\/ gimbal screw cutout\n translate([gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n translate([gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n \/\/ switches\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, dims[2]\/2-switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, -dims[2]\/2+switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n \n \/\/ power switch\n translate([0,dims[1]\/2+dims[2]\/2,0]) \n rotate([0,90,90])\n cube([switch_cutout[0], switch_cutout[1], gimbal[1]\/2], center=true);\n \n \/\/ led\n translate([0,-gimbal[1]\/2-led_offset-led_r,gimbal[2]\/2]) \n cylinder(h, r=led_r, center=true);\n \n \/\/ trim switches\n translate([-dims[0]\/2+handle_min_width+trim_switch_r-5, -dims[1]\/2-16, 0]) \n rotate([0,45,-25]) \n translate([0,0,dims[2]\/2]) \n cylinder(h=dims[2], r=trim_switch_r, center=true);\n}\n\nmodule screw_cylinder(h=30, solid=false) {\n spacing = 2;\n l = (h-separator)\/2;\n union() {\n translate([0,0,separator\/2+l\/2+spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=nut_r, $fn=6, center=true);\n }\n translate([0,0,separator\/2+spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-l\/2-spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=screw_head_r, center=true);\n }\n }\n}\n\nmodule screw__(solid=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n sf = 0.75;\n\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length-handle_min_width+4,\n dims[2]\/2-sf*handle_min_width\/2-3])\n rotate([tilt_angle,0,0]) \n translate([0,0,-handle_max_width-7])\n mirror([0,0,1]) \n screw_cylinder(2*handle_max_width, solid=solid);\n}\n\nmodule screw___(solid=false) { \n screw_offset = -3;\n \n translate([-module_bay[0]\/2+screw_offset-holder_r,gimbal[1]\/2+holder_r+1,0])\n mirror([0,0,1]) \n screw_cylinder(2*(gimbal[2]+module_bay[2]+wall), solid=solid);\n}\n\nmodule screw_(solid=false, debug=false) {\n intersection() {\n union() {\n screw__(solid=solid);\n screw___(solid=solid);\n }\n core_with_bay_and_handles(debug=debug);\n }\n}\n\n\/\/screw_cylinder();\nmodule screws(solid=false, debug=false) {\n screw_(solid=solid, debug=debug);\n mirror() screw_(solid=solid, debug=debug);\n}\n \nmodule body(solid = false, w = wall) {\n difference() {\n union() {\n difference() {\n skin(debug=debug,thickness=w, box=box_size) {\n core_with_bay_and_handles(debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(true);\n screws(solid=true, debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid);\n screws(solid=false, debug=debug);\n }\n \n if (!solid) cutouts();\n if (!solid) mirror() cutouts();\n }\n}\n\nmodule full_skin() render() {\n if (render_full || render_all) {\n body(w=wall);\n } else {\n import(\"full_skin.stl\");\n }\n}\n\nmodule inner_skin() render() {\n difference() {\n full_skin();\n outer_skin();\n }\n}\n\nmodule outer_skin() render() {\n if (render_outer || render_all) {\n body(w=wall\/2);\n } else {\n import(\"outer_skin.stl\");\n }\n}\n\nmodule bottom(box=box_size) {\n union () {\n difference() {\n outer_skin();\n translate([0,0,box\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2]) \n cube(box, center=true);\n }\n\n difference() {\n full_skin();\n translate([0,0,box\/2-wall\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2-wall\/2]) \n cube(box, center=true);\n }\n }\n}\n\nmodule cut_in_halves() {\n union() {\n translate([-100,0,gimbal[2]\/2]) difference() { \n bottom(box=box_size); \n battery_compartments(solid=true); \n }\n \n translate([100,0,0]) difference() { \n full_skin(); \n bottom(box=box_size); \n }\n }\n}\n\n\nmodule battery_compartments(solid=false) {\n union() {\n battery_compartment(solid);\n mirror() battery_compartment(solid);\n }\n}\n\nbatt = [61,21,24];\nbatt_pos = [-dims[0]\/2-2,-66,-16];\nbatt_rot = [90,26,-101];\n\nmodule battery_compartment_(solid = false) {\n offset = solid ? wall : 0;\n union() {\n intersection() {\n outer_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,offset\/2])\n cube([batt[0]+wall,batt[1],batt[2]-offset],center=true);\n }\n \n intersection() {\n inner_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot) \n translate([0,0,wall\/4+offset\/2])\n cube([batt[0],batt[1],batt[2]+wall\/2-offset],center=true);\n } \n \n \/\/ cutout to open compartment\n if (solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n union() {\n translate([0,0,wall\/2])\n cube([batt[0],batt[1],batt[2]-wall],center=true);\n translate([0,0,-batt[2]\/2]) \n cube([batt[2]\/2,batt[1],2*wall],center=true);\n }\n }\n }\n}\n\nmodule battery_compartment(solid=false) {\n difference() {\n union() {\n difference() {\n battery_compartment_(solid);\n \n \/\/ cutout block to be able to unlatch\n if (!solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2+wall])\n cube([batt[2],batt[1],wall],center=true);\n }\n }\n \n if (!solid) {\n scale([1.01,1.01,1.01])\n union() {\n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n }\n \n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n \n }\n }\n }\n }\n \n if (!solid) {\n difference() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2],batt[1],wall+2],center=true);\n }\n\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2]\/2,batt[1],wall+2],center=true);\n }\n }\n }\n }\n}\n\nif (render_outer) {\n outer_skin();\n} else if (render_full) {\n full_skin();\n} else {\n union() {\n cut_in_halves();\n translate([-100,dims[1]\/2+2*module_bay[1],0]) rotate([0,180,90]) module_cover();\n translate([-100,-dims[1]\/2-2*module_bay[1],0]) battery_compartments();\n }\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0d5fa23ba4cbd6c63f83cf037d99238e3b24a7d1","subject":"Rework the buildbox shape, making it more consistent. It now offers an option to center the shape, and it does not apply the render mode anymore.","message":"Rework the buildbox shape, making it more consistent. It now offers an option to center the shape, and it does not apply the render mode anymore.\n","repos":"jsconan\/camelSCAD","old_file":"shape\/context\/build-box.scad","new_file":"shape\/context\/build-box.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2020 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Build box visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of the build plate.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBuildPlate(size, cell, l, w, cl, cw) =\n let(\n size = apply2D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w),\n cell = apply2D(uor(cell, DEFAULT_BUILD_PLATE_CELL), cl, cw),\n nb = [\n cell[0] ? floor(size[0] \/ cell[0]) : 0,\n cell[1] ? floor(size[1] \/ cell[1]) : 0\n ],\n count = [\n nb[0] + 1,\n nb[1] + 1\n ],\n offset = [\n cell[0] ? -nb[0] * cell[0] \/ 2 : 0,\n cell[1] ? -nb[1] * cell[1] \/ 2 : 0\n ]\n )\n [ size, cell, count, offset ]\n;\n\n\/**\n * Creates a build plate visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildPlate(size=DEFAULT_BUILD_PLATE_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, cl, cw, center=false) {\n size = sizeBuildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n plateSize = size[0];\n cellSize = size[1];\n cellCount = size[2];\n cellOffset = size[3];\n\n plateHeight = 1;\n lineWidth = .5;\n\n %color([1, 1, 1, .2]) {\n negativeExtrude(height=-plateHeight, direction=0) {\n translate(center ? -plateSize \/ 2 : [0, 0]) {\n square(plateSize);\n }\n }\n negativeExtrude(height=-plateHeight, direction=2) {\n translate(center ? [cellOffset[0], -plateSize[1] \/ 2, 0] : [0, 0, 0]) {\n repeat(count=cellCount[0], intervalX=cellSize[0]) {\n square([lineWidth, plateSize[1]]);\n }\n }\n translate(center ? [-plateSize[0] \/ 2, cellOffset[1], 0] : [0, 0, 0]) {\n repeat(count=cellCount[1], intervalY=cellSize[1]) {\n square([plateSize[0], lineWidth]);\n }\n }\n }\n }\n}\n\n\/**\n * Creates a build volume visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildVolume(size=DEFAULT_BUILD_VOLUME_SIZE, l, w, h, center=false) {\n %color([1, 1, 1, .1]) {\n size = apply3D(size, l, w, w);\n translate(center ? apply3D(-size \/ 2, z=0) : [0, 0, 0]) {\n cube(size);\n }\n }\n}\n\n\/**\n * Creates a build box visualization at the origin.\n * A build box contains visualizations for a build plate and a build volume.\n *\n * @param Number|Vector [size] - The size of the build volume.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildBox(size=DEFAULT_BUILD_VOLUME_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, h, cl, cw, center=false) {\n buildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw, center=center);\n buildVolume(size=size, l=l, w=w, h=h, center=center);\n\n children();\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Build box visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of the build plate.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBuildPlate(size, cell, l, w, cl, cw) =\n let(\n size = apply2D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w),\n cell = apply2D(uor(cell, DEFAULT_BUILD_PLATE_CELL), cl, cw),\n nb = [\n cell[0] ? floor(size[0] \/ cell[0]) : 0,\n cell[1] ? floor(size[1] \/ cell[1]) : 0\n ],\n count = [\n nb[0] + 1,\n nb[1] + 1\n ],\n offset = [\n cell[0] ? -nb[0] * cell[0] \/ 2 : 0,\n cell[1] ? -nb[1] * cell[1] \/ 2 : 0\n ]\n )\n [ size, cell, count, offset ]\n;\n\n\/**\n * Creates a build plate visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n *\/\nmodule buildPlate(size=DEFAULT_BUILD_PLATE_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, cl, cw) {\n size = sizeBuildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n plateSize = size[0];\n cellSize = size[1];\n cellCount = size[2];\n cellOffset = size[3];\n\n plateHeight = 1;\n lineWidth = .5;\n\n %color([1, 1, 1, .2]) {\n negativeExtrude(height=-plateHeight, direction=0) {\n rectangle(plateSize);\n }\n negativeExtrude(height=-plateHeight, direction=2) {\n translateX(cellOffset[0]) {\n repeat(count=cellCount[0], intervalX=cellSize[0]) {\n rectangle([lineWidth, plateSize[1]]);\n }\n }\n translateY(cellOffset[1]) {\n repeat(count=cellCount[1], intervalY=cellSize[1]) {\n rectangle([plateSize[0], lineWidth]);\n }\n }\n }\n }\n}\n\n\/**\n * Creates a build volume visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n *\/\nmodule buildVolume(size=DEFAULT_BUILD_VOLUME_SIZE, l, w, h) {\n %color([1, 1, 1, .1]) {\n box(size=size, l=l, w=w, h=w);\n }\n}\n\n\/**\n * Creates a build box visualization at the origin.\n * A build box contains visualizations for a build plate and a build volume.\n * It also applies a render mode.\n * @param Number|Vector [size] - The size of the build volume.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param String [mode] - The mode to apply on the children modules.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n *\/\nmodule buildBox(size, cell, mode, l, w, h, cl, cw) {\n size = apply3D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w, h);\n\n buildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n buildVolume(size=size, l=l, w=w, h=h);\n\n applyMode(mode) {\n children();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4a167adfd53ea866e7bf963e408e135bd5a6ab6b","subject":"attach: fix vector shape","message":"attach: fix vector shape\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"attach.scad","new_file":"attach.scad","new_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, align=-Z);\n }\n\n \/\/-- Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=rollaxis==U?v:rollaxis) rotate(a=ang, v=raxis_)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","old_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate(X)\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n cylindera(r=1\/2, h=lb, center=true);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=rollaxis==U?v:rollaxis) rotate(a=ang, v=raxis_)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3cb70e440ad0962bbc240b432c459d5e9f7685f1","subject":"xaxis\/carriage: render extruder motor heatsink+fan","message":"xaxis\/carriage: render extruder motor heatsink+fan\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d4b13ed58bf68ad3a75c926fa07fa394e91a11ed","subject":"Create a support for component to be integrated in waterproof pocket","message":"Create a support for component to be integrated in waterproof pocket\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/pocket_IMU_sensor.scad","new_file":"Hardware\/pocket_IMU_sensor.scad","new_contents":"thickness = 2;\nwidth=85;\nlength=133-30;\nnano_length_max=43.6;\nnano_length_min = 37.1;\nnano_width_max = 22.7;\nnano_internal_width = 9;\nnano_thickness=7;\n9V_width=26.2;\n9V_length=45;\ntransmitter_width = 30;\ntransmitter_length= 45;\nIMU_screw_spacing_width = 12.1;\nIMU_screw_spacing_length = 16.3;\ncorner_radius=5;\n\nmodule support()\n{\n\tdifference()\n\t{\n\t\tminkowski(){\n\t\ttranslate([0,-15,0]) cube(size=[width-2*corner_radius,length-2*corner_radius,thickness\/3.], center=true);\n\t\tcylinder(h=thickness\/3., r=corner_radius);\n}\n\t\ttranslate([10,12,0]) difference(){\n\t\t\tcube(size=[nano_width_max,nano_length_min,2*thickness], center=true);\n\t\t \tcube(size=[nano_internal_width,nano_length_min,2*thickness], center=true);\n\t}\n\t\ttranslate([-23,8,0]) cube(size=[9V_width,9V_length,2*thickness], center=true);\n\t\t\/\/translate([10,-45,0]) cube(size=[transmitter_length,transmitter_width,2*thickness], center=true);\n\ttranslate([0,-60,0]) cube(size=[12,3,2*thickness], center=true);\n\ttranslate([0,-60 +transmitter_width ,0]) cube(size=[12,3,2*thickness], center=true);\n\t\n\t\n\t\/\/ Holes to screw drotek IMU board\t\n\t\ttranslate([-30, -50,0]) cylinder(r=0.3, h=2*thickness, center=true);\n\t\ttranslate([-30+IMU_screw_spacing_length, -50+IMU_screw_spacing_width,0]) cylinder(r=0.3, h=2*thickness, center=true);\n\t\ttranslate([-30+IMU_screw_spacing_length, -50,0]) cylinder(r=0.3, h=2*thickness, center=true);\n\t}\n}\nprojection() support();","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/pocket_IMU_sensor.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e4ac759280e9074a89f157164c923c91784c005a","subject":"fixup! main\/zaxis: Improve leadscrew\/rod distance calc","message":"fixup! main\/zaxis: Improve leadscrew\/rod distance calc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 45*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n","old_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 45*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ place z rod on edge of motor\nzaxis_rod_screw_distance_x = lookup(NemaSideSize,zaxis_motor);\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5ce487aa1ad830c2f8e3c1919816a2c5de53eb8a","subject":"Tri at my age ...","message":"Tri at my age ...\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n }\n}\n\n\n\nshedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\ntranslate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\ntranslate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nroof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust);\n translate([0,0,z_front+base_timber+panel_slf_t+height_adjust])\n {\n rotate([-theta,0,0]) cubeI([panel_slf_w,panel_slf_l, panel_slf_t]);\n }\n}\n\n\n\nshedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\ntranslate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\ntranslate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nroof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"329af62fa9f6cf63576783def672fda167f33e39","subject":"tried to make H node a bit thinner. Also trying to bring legs in a little closer to main bar to save width","message":"tried to make H node a bit thinner.\nAlso trying to bring legs in a little closer to main bar to save width\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"pulley\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + HoleFuzz; \/\/ standoff countersink radius\nsd=1; \/\/ standoff countersink distance \n\n \/\/ countersink main pulley for standoffs a bit.\n difference() {\n union() {\n pulley(18,ph,rad4,0);\n \/\/ pulley hub was 1.3 mm higher than outher thickness. a little more for countersink\n cylinder(r1=5,r2=4,h=ph+1.5,$fn=36); \/\/ give pulley a wider hub\n }\n\n translate([0,0,-1]) {\n cylinder(r=rad4,h=ph+3,$fn=17); \/\/ main threaded rod hole\n \/\/cylinder(r=sr,h=1+sd+.2,$fn=28); \/\/ a little extra on bridged standoff depth\n }\n translate([0,0,ph+1.5-sd-.5]) cylinder(r=sr,h=3,$fn=28);\n }\n}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+2,BradFree,3,Hrad+2.5,rad4);\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley\") { mainPulley(); }\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"BH\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\n\/\/ make small end of BH a little shorter to make it easier to use a 1\" screw for 'hamstirng' node\nelse if (PART==\"BHs\" ) BHs( BH,2.5*NodeHeight+1.5,Brad+1.8,BradFree,3.7,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight+1.5,Brad+1.8,BradFree,3.7,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"4bcd23ae72e6990d7ccef3ec20c0dbc3d3b2d8d9","subject":"extruder\/b: increase size of drive gear viewport","message":"extruder\/b: increase size of drive gear viewport\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(2*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n \/*[>tx(-extruder_drivegear_d_inner)<]*\/\n {\n s=[100,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n cubea(s, align=-X);\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(2*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c51d17b0d2567f5fe8b878fb02b40bdb763e7264","subject":"fix the top yet again","message":"fix the top yet again\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1.scad","new_file":"3d\/enclosure_v1.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\nscreen_tol = 1;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.6;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 29.15;\nscreen_start_y = shift_y + 39.1;\nscreen_length_x = 72;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n\t cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8ed8b0a1c061072c361dcd23b8225adc828f4fc4","subject":"cone made way lower - it should be enough as bearings will keep it in tact any way","message":"cone made way lower - it should be enough as bearings will keep it in tact any way\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filament_spool_holder\/cone.scad","new_file":"filament_spool_holder\/cone.scad","new_contents":"difference()\n{\n cylinder(h=20, r1=120\/2, r2=40\/2); \/\/ main hull\n cylinder(h=20, r=(22+1)\/2); \/\/ center rod & bearings holding\n}\n","old_contents":"difference()\n{\n cylinder(h=40, r1=120\/2, r2=40\/2); \/\/ main hull\n cylinder(h=40, r=(22+1)\/2); \/\/ center rod & bearings holding\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d4480f4a88a9e567fd993371bd981b5ac794691f","subject":"[3d] Adjust interior fillet to round, make Pi ethernet hole tighter, USB pillar wider","message":"[3d] Adjust interior fillet to round, make Pi ethernet hole tighter, USB pillar wider\n\n-- USB pillar width 2.0mm -> 2.2mm\n-- Interior fillet from 1mm chamfer to body_corner_radius\/2 round\n-- Don't cut out pic_ex and then rebuild it, just cut less (makes Pi ethernet jack area smaller)\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+2.0), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[1,1,1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 1.5])\n cube_fillet([pic_ex+wall, 2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0])\n cube_fillet([pic_ex+wall, 3, 20.8], bottom=[0,pic_ex,0,0], top=[0,pic_ex],\n vertical=[0,0,pic_ex]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([wall, 33.75+59.5-pic_ex, 1.5])\n cube_fillet([pic_ex, pic_ex+e, 20.8-1.5], bottom=[0,0,0,2], vertical=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9e4993744b84859cd11e74475eae67a9b4fc3cdd","subject":"Adding hole_template","message":"Adding hole_template\n","repos":"bmsleight\/shedshed","old_file":"hole_template.scad","new_file":"hole_template.scad","new_contents":"\nloose_fitting = 0;\ntimber_w = 47;\ntimber_h = 75;\n\ntimber_construct_w = timber_w+loose_fitting;\ntimber_construct_h = timber_h+loose_fitting;\n\n\nhole_size = 5;\nparameter = 2.5;\n$fn=60;\n\n\ndifference()\n{\n cube([timber_construct_w+1*parameter,timber_construct_h+1*parameter,+2*parameter]);\n translate([parameter,parameter,parameter]) cube([timber_construct_w+2*parameter,timber_construct_h+2*parameter,+2*parameter]);\n translate([parameter,parameter,-parameter])\n {\n translate([timber_construct_w*1\/4,timber_construct_h*1\/4,0]) cylinder(5*parameter, d=hole_size);\n translate([timber_construct_w*1\/4,timber_construct_h*3\/4,0]) cylinder(5*parameter, d=hole_size);\n translate([timber_construct_w*3\/4,timber_construct_h*1\/4,0]) cylinder(5*parameter, d=hole_size);\n translate([timber_construct_w*3\/4,timber_construct_h*3\/4,0]) cylinder(5*parameter, d=hole_size);\n translate([timber_construct_w*2\/4,timber_construct_h*2\/4,0]) cylinder(5*parameter, d=hole_size);\n }\n translate([timber_w\/2+parameter*2,timber_h\/2+parameter,parameter*3\/4]) rotate([0,0,90]) linear_extrude(parameter) text(str(timber_w,\"x\",timber_h), size=timber_w\/4, halign = \"center\");\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'hole_template.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"24bff3b8143b74737a14508d83c4defb2e9c3bba","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"86a7c0f370bbddc80a074731707d3f1381158ead","subject":"resized","message":"resized\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = false;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+30])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-30])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 3;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 3);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 60 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 140);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 400;\n display_projection = false;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+30])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-30])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 3;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 3);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 60 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - 210])\n rotate([90,90,0])\n profile(3, 140);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3639364b896fedd1f566d8b9a5a6ea1854e6fa67","subject":"bearing: add extra_h param","message":"bearing: add extra_h param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = (override_h==undef ? bearing_type[2] : override_h) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]*1.3, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]*1.3, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"07367016b871461f635ffe7b5c60e3a9772a5d3e","subject":"prototype of an element","message":"prototype of an element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"shower_mount_screw\/shower_mount_screw.scad","new_file":"shower_mount_screw\/shower_mount_screw.scad","new_contents":"eps = 0.01;\n\nmodule element()\n{\n difference()\n {\n union()\n {\n \/\/ center guideing element\n intersection()\n {\n cylinder(d=35, h=42-4, $fn=200);\n translate([-100\/2, -4\/2, 0])\n cube([100, 4, 50]);\n }\n \/\/ core cylinder\n cylinder(d=32, h=42-4, $fn=200);\n }\n \/\/ center side cut\n translate([0, 50\/2, 26\/2+7])\n rotate([90, 0, 0])\n cylinder(d=26, h=50, $fn=200);\n \/\/ bottom cut\n translate([0, 0, -eps])\n cylinder(d=17, h=2.5);\n \/\/ screw hole\n translate([0, 0, -eps])\n cylinder(d=3.5, h=50, $fn=30);\n \/\/ screw head\n translate([0, 0, -eps])\n cylinder(d=9.5, h=42-4-5+2.5, $fn=30);\n }\n}\n\nrotate([180, 0, 0])\n element();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shower_mount_screw\/shower_mount_screw.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"17c40f91f4ccd32d4bc165d61e74b1e1c36439d8","subject":"New motor size and finish","message":"New motor size and finish\n\nFinish layout code for motor retention rings\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/BubbleCopter,DanNixon\/Multirotors","old_file":"Suika\/frame_main.scad","new_file":"Suika\/frame_main.scad","new_contents":"MOTOR_DIST_X = 37.5;\nMOTOR_DIST_Y = 37.5;\nMOTOR_DIAMETER = 8.5;\n\nWIRING_HOLE_OFFSET = 0.7;\nWIRING_HOLE_DIAMETER = 2;\n\nARM_WIDTH = 13.5;\nPLATE_DIMENSIONS = [30, 45];\n\nZIP_TIE_HOLE_OFFSETS = [0.15, 0.4, 0.6, 0.85];\nZIP_TIE_HOLE_DIAM = 3;\n\n\nmodule MainPlate()\n{\n motor_positions = [\n [MOTOR_DIST_X, MOTOR_DIST_Y],\n [-MOTOR_DIST_X, MOTOR_DIST_Y],\n [MOTOR_DIST_X, -MOTOR_DIST_Y],\n [-MOTOR_DIST_X, -MOTOR_DIST_Y]\n ];\n\n module Plate()\n {\n square(PLATE_DIMENSIONS, center=true);\n }\n\n module MotorCross()\n {\n for(p=motor_positions)\n {\n hull()\n {\n circle(d=ARM_WIDTH);\n translate(p)\n circle(d=ARM_WIDTH);\n }\n }\n }\n\n module MotorMountingHoles()\n {\n for(p=motor_positions)\n {\n translate(p)\n circle(d=MOTOR_DIAMETER);\n\n translate(p * WIRING_HOLE_OFFSET)\n circle(d=WIRING_HOLE_DIAMETER);\n }\n }\n\n module Cutouts()\n {\n half_dim = PLATE_DIMENSIONS \/ 2;\n translate(-half_dim)\n {\n for(i=ZIP_TIE_HOLE_OFFSETS)\n {\n translate([PLATE_DIMENSIONS[0] * 0.85, PLATE_DIMENSIONS[1] * i])\n circle(d=ZIP_TIE_HOLE_DIAM);\n translate([PLATE_DIMENSIONS[0] * 0.15, PLATE_DIMENSIONS[1] * i])\n circle(d=ZIP_TIE_HOLE_DIAM);\n }\n }\n }\n\n difference()\n {\n union()\n {\n Plate();\n MotorCross();\n }\n\n union()\n {\n MotorMountingHoles();\n Cutouts();\n }\n }\n}\n\n\nmodule MotorRetentionClips()\n{\n difference()\n {\n circle(d=ARM_WIDTH);\n circle(d=MOTOR_DIAMETER);\n }\n}\n\n\n$fs = 2;\n\nMainPlate();\n\nfor(a = [0 : 90 : 360])\n rotate([0, 0, a])\n translate([0, (max(PLATE_DIMENSIONS) \/ 2) + ARM_WIDTH])\n MotorRetentionClips();\n","old_contents":"MOTOR_DIST_X = 37.5;\nMOTOR_DIST_Y = 37.5;\nMOTOR_DIAMETER = 6.9;\n\nWIRING_HOLE_OFFSET = 0.7;\nWIRING_HOLE_DIAMETER = 2;\n\nARM_WIDTH = 11;\nPLATE_DIMENSIONS = [30, 45];\n\nZIP_TIE_HOLE_OFFSETS = [0.15, 0.4, 0.6, 0.85];\nZIP_TIE_HOLE_DIAM = 3;\n\n\nmodule MainPlate()\n{\n motor_positions = [\n [MOTOR_DIST_X, MOTOR_DIST_Y],\n [-MOTOR_DIST_X, MOTOR_DIST_Y],\n [MOTOR_DIST_X, -MOTOR_DIST_Y],\n [-MOTOR_DIST_X, -MOTOR_DIST_Y]\n ];\n\n module Plate()\n {\n square(PLATE_DIMENSIONS, center=true);\n }\n\n module MotorCross()\n {\n for(p=motor_positions)\n {\n hull()\n {\n circle(d=ARM_WIDTH);\n translate(p)\n circle(d=ARM_WIDTH);\n }\n }\n }\n\n module MotorMountingHoles()\n {\n for(p=motor_positions)\n {\n translate(p)\n circle(d=MOTOR_DIAMETER);\n\n translate(p * WIRING_HOLE_OFFSET)\n circle(d=WIRING_HOLE_DIAMETER);\n }\n }\n\n module Cutouts()\n {\n half_dim = PLATE_DIMENSIONS \/ 2;\n translate(-half_dim)\n {\n for(i=ZIP_TIE_HOLE_OFFSETS)\n {\n translate([PLATE_DIMENSIONS[0] * 0.85, PLATE_DIMENSIONS[1] * i])\n circle(d=ZIP_TIE_HOLE_DIAM);\n translate([PLATE_DIMENSIONS[0] * 0.15, PLATE_DIMENSIONS[1] * i])\n circle(d=ZIP_TIE_HOLE_DIAM);\n }\n }\n }\n\n difference()\n {\n union()\n {\n Plate();\n MotorCross();\n }\n\n union()\n {\n MotorMountingHoles();\n Cutouts();\n }\n }\n}\n\n\nmodule MotorRetentionClips()\n{\n difference()\n {\n circle(d=ARM_WIDTH);\n circle(d=MOTOR_DIAMETER);\n }\n}\n\n\n$fs = 2;\nMainPlate();\ntranslate([0, (PLATE_DIMENSIONS[1] \/ 2) + 10])\n MotorRetentionClips();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"8f0bac4b5e4cdccb67c93f3ce2da29c80e4607cc","subject":"decreased spacing between coins","message":"decreased spacing between coins\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"qiabasz\/qiabasz.scad","new_file":"qiabasz\/qiabasz.scad","new_contents":"eps = 0.01;\nN = 4;\nM = 4;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\nmodule qiabasz()\n{\n difference()\n {\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n }\n qiagen_logo();\n}\n\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*32, j*32, 0])\n qiabasz();\n","old_contents":"eps = 0.01;\nN = 4;\nM = 4;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\nmodule qiabasz()\n{\n difference()\n {\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n }\n qiagen_logo();\n}\n\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*35, j*35, 0])\n qiabasz();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"42d28ed35a0e8646d4a6c60de6e5ba3a4aa3cc2b","subject":"psu\/mount: define parts","message":"psu\/mount: define parts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"psu.scad","new_file":"psu.scad","new_contents":"use ;\nuse ;\ninclude ;\ninclude ;\n\ninclude \n\npsu_a_w=11.5*cm;\npsu_a_d=21.5*cm;\npsu_a_h=5*cm;\npsu_a_screw_side_dist_z = 2.5*cm;\npsu_a_screw_dist_y = 15*cm;\npsu_a_screw_bottom_dist_x = 5*cm;\n\npsu_a_screw_thread = ThreadM4;\npsu_a_screw_thread_dia = lookup(ThreadSize, psu_a_screw_thread);\n\npsu_b_w=98*mm;\npsu_b_d=19.5*cm;\npsu_b_h=42*mm;\npsu_b_screw_offset_y = 37.5*mm-18*mm;\npsu_b_screw_dist_y = 12*cm;\npsu_b_screw_bottom_dist_x = 8*cm;\n\npsu_b_screw_thread = ThreadM3;\npsu_b_screw_thread_dia = lookup(ThreadSize, psu_b_screw_thread);\n\npsu_mount_bottom_height = 4*mm;\n\n\nmodule psu_a(align=[0,0,0], detailed_model=true)\n{\n if(detailed_model)\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n translate([-24.5,105,-25])\n rotate([0,0,90])\n import(\"stl\/ledpowersupply.stl\");\n }\n else\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n difference()\n {\n cubea([psu_a_w,psu_a_d,psu_a_h]);\n\n \/\/ screw holes, sides\n for(x=[-1,1])\n for(y=[-1,1])\n for(z=[-1,1])\n translate([x*(psu_a_w\/2+1), y*(psu_a_screw_dist_y\/2), z*psu_a_screw_side_dist_z\/2])\n cylindera(d=psu_a_screw_thread_dia, h=0.5*cm, orient=[1,0,0], align=[-x,0,0]);\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), y*(psu_a_screw_dist_y\/2), -psu_a_h\/2-1])\n cylindera(d=psu_a_screw_thread_dia, h=1*cm, orient=[0,0,1], align=[0,0,1]);\n }\n }\n}\n\n\nmodule psu_a_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n cylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_a_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n cylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b(align=[0,0,0])\n{\n {\n size_align([psu_b_w,psu_b_d,psu_b_h], align)\n difference()\n {\n cubea([psu_b_w,psu_b_d,psu_b_h]);\n\n \/\/ screw holes, sides\n \/*for(x=[-1,1])*\/\n \/*for(y=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([x*(psu_b_w\/2+1), y*(psu_b_screw_dist_y\/2), z*psu_b_screw_side_dist_z\/2])*\/\n \/*cylindera(d=psu_b_screw_thread_dia, h=0.5*cm, orient=[1,0,0], align=[-x,0,0]);*\/\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y+y*(psu_b_screw_dist_y\/2), -psu_b_h\/2-1])\n cylindera(d=psu_b_screw_thread_dia, h=1*cm, orient=[0,0,1], align=[0,0,1]);\n }\n }\n}\n\nmodule psu_b_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2])\n cylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2])\n cylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule part_psu_a_extrusion_bracket_side()\n{\n psu_a_extrusion_bracket_side();\n}\n\nmodule part_psu_a_extrusion_bracket_back()\n{\n psu_a_extrusion_bracket_back();\n}\n\nmodule part_psu_b_extrusion_bracket_side()\n{\n psu_b_extrusion_bracket_side();\n}\n\nmodule part_psu_b_extrusion_bracket_back()\n{\n psu_b_extrusion_bracket_back();\n}\n\n\/*psu_a();*\/\n\n\/*translate([0, -psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_back();*\/\n\n\/*psu_b();*\/\n\n\/*translate([0, psu_b_screw_offset_y-psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_back();*\/\n","old_contents":"use ;\nuse ;\ninclude ;\ninclude ;\n\ninclude \n\npsu_a_w=11.5*cm;\npsu_a_d=21.5*cm;\npsu_a_h=5*cm;\npsu_a_screw_side_dist_z = 2.5*cm;\npsu_a_screw_dist_y = 15*cm;\npsu_a_screw_bottom_dist_x = 5*cm;\n\npsu_a_screw_thread = ThreadM4;\npsu_a_screw_thread_dia = lookup(ThreadSize, psu_a_screw_thread);\n\npsu_b_w=98*mm;\npsu_b_d=19.5*cm;\npsu_b_h=42*mm;\npsu_b_screw_offset_y = 37.5*mm-18*mm;\npsu_b_screw_dist_y = 12*cm;\npsu_b_screw_bottom_dist_x = 8*cm;\n\npsu_b_screw_thread = ThreadM3;\npsu_b_screw_thread_dia = lookup(ThreadSize, psu_b_screw_thread);\n\npsu_mount_bottom_height = 4*mm;\n\n\nmodule psu_a(align=[0,0,0], detailed_model=true)\n{\n if(detailed_model)\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n translate([-24.5,105,-25])\n rotate([0,0,90])\n import(\"stl\/ledpowersupply.stl\");\n }\n else\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n difference()\n {\n cubea([psu_a_w,psu_a_d,psu_a_h]);\n\n \/\/ screw holes, sides\n for(x=[-1,1])\n for(y=[-1,1])\n for(z=[-1,1])\n translate([x*(psu_a_w\/2+1), y*(psu_a_screw_dist_y\/2), z*psu_a_screw_side_dist_z\/2])\n cylindera(d=psu_a_screw_thread_dia, h=0.5*cm, orient=[1,0,0], align=[-x,0,0]);\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), y*(psu_a_screw_dist_y\/2), -psu_a_h\/2-1])\n cylindera(d=psu_a_screw_thread_dia, h=1*cm, orient=[0,0,1], align=[0,0,1]);\n }\n }\n}\n\n\nmodule psu_a_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n cylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_a_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n cylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\n\/*psu_a();*\/\n\n\/*translate([0, -psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_back();*\/\n\nmodule psu_b(align=[0,0,0])\n{\n {\n size_align([psu_b_w,psu_b_d,psu_b_h], align)\n difference()\n {\n cubea([psu_b_w,psu_b_d,psu_b_h]);\n\n \/\/ screw holes, sides\n \/*for(x=[-1,1])*\/\n \/*for(y=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([x*(psu_b_w\/2+1), y*(psu_b_screw_dist_y\/2), z*psu_b_screw_side_dist_z\/2])*\/\n \/*cylindera(d=psu_b_screw_thread_dia, h=0.5*cm, orient=[1,0,0], align=[-x,0,0]);*\/\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y+y*(psu_b_screw_dist_y\/2), -psu_b_h\/2-1])\n cylindera(d=psu_b_screw_thread_dia, h=1*cm, orient=[0,0,1], align=[0,0,1]);\n }\n }\n}\n\nmodule psu_b_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2])\n cylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2])\n cylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\n\/*psu_b();*\/\n\n\/*translate([0, psu_b_screw_offset_y-psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_back();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3227bd7c722d1df5d41b218c1253053df5efb6fe","subject":"psu: tweaks to dimensions","message":"psu: tweaks to dimensions\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"psu.scad","new_file":"psu.scad","new_contents":"use ;\nuse ;\ninclude ;\ninclude ;\n\ninclude \n\npsu_w=11.5*cm;\npsu_d=21.5*cm;\npsu_h=5*cm;\npsu_screw_side_dist_z = 2.5*cm;\npsu_screw_dist_y = 15*cm;\npsu_screw_bottom_dist_x = 5*cm;\n\npsu_screw_thread = ThreadM4;\npsu_screw_thread_dia = lookup(ThreadSize, psu_screw_thread);\n\npsu_mount_bottom_height = 5*mm;\n\n\nmodule psu(align=[0,0,0])\n{\n size_align([psu_w,psu_d,psu_h], align)\n difference()\n {\n cubea([psu_w,psu_d,psu_h]);\n\n \/\/ screw holes, sides\n for(x=[-1,1])\n for(y=[-1,1])\n for(z=[-1,1])\n translate([x*(psu_w\/2+1), y*(psu_screw_dist_y\/2), z*psu_screw_side_dist_z\/2])\n fncylindera(d=psu_screw_thread_dia, h=0.5*cm, orient=[1,0,0], align=[-x,0,0]);\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), y*(psu_screw_dist_y\/2), -psu_h\/2-1])\n fncylindera(d=psu_screw_thread_dia, h=1*cm, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nmodule psu_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2])\n fncylindera(d=psu_screw_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_h\/2])\n fncylindera(d=extrusion_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2+1])\n fncylindera(d=psu_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_h\/2+1])\n fncylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2])\n fncylindera(d=psu_screw_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_screw_bottom_dist_x\/2, -psu_screw_dist_y\/2+psu_d\/2+extrusion_size\/2, -psu_h\/2])\n fncylindera(d=extrusion_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2+1])\n fncylindera(d=psu_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_screw_bottom_dist_x\/2, -psu_screw_dist_y\/2+psu_d\/2+extrusion_size\/2, -psu_h\/2+1])\n fncylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\n\/*psu();*\/\n\n\/*translate([0, -psu_screw_dist_y\/2, 0])*\/\n\/*psu_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_screw_dist_y\/2, 0])*\/\n\/*psu_extrusion_bracket_back();*\/\n","old_contents":"use ;\nuse ;\ninclude ;\ninclude ;\n\ninclude \n\npsu_w=11*cm;\npsu_d=21.5*cm;\npsu_h=5*cm;\npsu_screw_side_dist_z = 2.5*cm;\npsu_screw_dist_y = 15*cm;\npsu_screw_bottom_dist_x = 5*cm;\n\npsu_screw_thread = ThreadM4;\npsu_screw_thread_dia = lookup(ThreadSize, psu_screw_thread);\n\npsu_mount_bottom_height = 3*mm;\n\n\nmodule psu(align=[0,0,0])\n{\n size_align([psu_w,psu_d,psu_h], align)\n difference()\n {\n cubea([psu_w,psu_d,psu_h]);\n\n \/\/ screw holes, sides\n for(x=[-1,1])\n for(y=[-1,1])\n for(z=[-1,1])\n translate([x*(psu_w\/2+1), y*(psu_screw_dist_y\/2), z*psu_screw_side_dist_z\/2])\n fncylindera(d=psu_screw_thread_dia, h=0.5*cm, orient=[1,0,0], align=[-x,0,0]);\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), y*(psu_screw_dist_y\/2), -psu_h\/2-1])\n fncylindera(d=psu_screw_thread_dia, h=1*cm, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nmodule psu_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2])\n fncylindera(d=psu_screw_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_h\/2])\n fncylindera(d=extrusion_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2+1])\n fncylindera(d=psu_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_h\/2+1])\n fncylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2])\n fncylindera(d=psu_screw_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_screw_bottom_dist_x\/2, -psu_screw_dist_y\/2+psu_d\/2+extrusion_size\/2, -psu_h\/2])\n fncylindera(d=extrusion_thread_dia*4, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_screw_bottom_dist_x\/2), 0, -psu_h\/2+1])\n fncylindera(d=psu_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_screw_bottom_dist_x\/2, -psu_screw_dist_y\/2+psu_d\/2+extrusion_size\/2, -psu_h\/2+1])\n fncylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\n\/*psu();*\/\n\n\/*translate([0, -psu_screw_dist_y\/2, 0])*\/\n\/*psu_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_screw_dist_y\/2, 0])*\/\n\/*psu_extrusion_bracket_back();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"75769010e67155f8efc8646d11492df257bf4679","subject":"added additional prolonging for the support part","message":"added additional prolonging for the support part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filter_support\/filter_support.scad","new_file":"filter_support\/filter_support.scad","new_contents":"eps=0.01;\n\nmodule support()\n{\n rotate([90, 0, 0])\n {\n \/\/ main block\n intersection()\n {\n difference()\n {\n cube([30, 30, 10]);\n \/\/ magnet hole\n translate([5, -eps, 10\/2])\n rotate([-90, 0, 0])\n cylinder(d=5+0.5, h=5+0.5+eps, $fn=25);\n \/\/ main rounding\n translate([30, 30, -eps])\n cylinder(r=30, h=10+2*eps, $fn=200);\n }\n \/\/ truncating sharp edges\n cube([25, 25, 10+2*eps]);\n }\n \/\/ support prolonging\n cube([1.2, 35, 10]);\n }\n}\n\n\nsupport();\n","old_contents":"eps=0.01;\n\nmodule support()\n{\n rotate([90, 0, 0])\n intersection()\n {\n difference()\n {\n cube([30, 30, 10]);\n \/\/ magnet hole\n translate([5, -eps, 10\/2])\n rotate([-90, 0, 0])\n cylinder(d=5+0.5, h=5+0.5+eps, $fn=25);\n \/\/ main rounding\n translate([30, 30, -eps])\n cylinder(r=30, h=10+2*eps, $fn=200);\n }\n \/\/ truncating sharp edges\n cube([25, 25, 10+2*eps]);\n }\n}\n\n\nsupport();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"428b6eaea293c968654f8d76d0a3d3498e521dd4","subject":"config: tiny refactor preview mode variables","message":"config: tiny refactor preview mode variables\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\/*$fs = 0.5;*\/\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\/*$fa = 4;*\/\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"54576fbca2ce4dc9365bf2782db18bbaa620ec8a","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e4b68e0b1a222236667aa8488f87df7ad1bd00fb","subject":"main: rename variables","message":"main: rename variables\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = -225\/2*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n rotate([90,0,0])\n bearing(yaxis_bearing);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\nxaxis_pos_x = -225\/2*mm;\nxaxis_range_z=[85,350];\nxaxis_pos_z = 350*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n translate([xaxis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n rotate([90,0,0])\n bearing(yaxis_bearing);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,xaxis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, xaxis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3d36b26af3aec5ddee8a58e2f21c66fa0c33758b","subject":"main: fix x axis range","message":"main: fix x axis range\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - zaxis_rod_d\/2 - xaxis_end_width_right(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2+extrusion_size+zaxis_rod_d\/2+xaxis_end_motor_offset.x))\n rotate(90*X)\n belt_path(\n len=-xaxis_end_motor_offset.x+extrusion_size+zaxis_rod_d\/2+(main_width-2*extrusion_size-2*zaxis_rod_d\/2),\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n tx(x*(main_width\/2))\n ty(xaxis_zaxis_distance_y)\n tx(-x*(extrusion_size+zaxis_rod_d\/2))\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n tx(x*(yaxis_rod_distance\/2))\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n \/*render()*\/\n tz(-main_lower_dist_z\/2)\n gantry_lower();\n\n \/*render()*\/\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n \/*render()*\/\n x_axis();\n\n \/*render()*\/\n y_axis();\n\n \/*render()*\/\n z_axis();\n\n \/*render()*\/\n \/*translate([-75*mm,0,0])*\/\n \/*translate([0,main_depth\/2,0])*\/\n \/*translate([0,extrusion_size,0])*\/\n \/*translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])*\/\n \/*power_panel_iec320(orient=[0,-1,0], align=Y);*\/\n\n if(!$preview_mode)\n {\n render()\n ty(-main_depth\/2)\n ty(-extrusion_size\/2)\n tz(-main_lower_dist_z\/2)\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render()\n psu_a();\n\n render()\n mirror([x==-1?1:0,0,0])\n ty(-psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_side();\n\n render()\n translate(psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_back();\n }\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - zaxis_rod_d\/2 - xaxis_end_width_right(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2+extrusion_size+zaxis_rod_d\/2+xaxis_end_motor_offset.x))\n rotate(90*X)\n belt_path(\n len=-xaxis_end_motor_offset.x+extrusion_size+zaxis_rod_d\/2+(main_width-2*extrusion_size-2*zaxis_rod_d\/2),\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n tx(x*(main_width\/2))\n ty(xaxis_zaxis_distance_y)\n tx(-x*(extrusion_size+zaxis_rod_d\/2))\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n tx(x*(yaxis_rod_distance\/2))\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n \/*render()*\/\n tz(-main_lower_dist_z\/2)\n gantry_lower();\n\n \/*render()*\/\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n \/*render()*\/\n x_axis();\n\n \/*render()*\/\n y_axis();\n\n \/*render()*\/\n z_axis();\n\n \/*render()*\/\n \/*translate([-75*mm,0,0])*\/\n \/*translate([0,main_depth\/2,0])*\/\n \/*translate([0,extrusion_size,0])*\/\n \/*translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])*\/\n \/*power_panel_iec320(orient=[0,-1,0], align=Y);*\/\n\n if(!$preview_mode)\n {\n render()\n ty(-main_depth\/2)\n ty(-extrusion_size\/2)\n tz(-main_lower_dist_z\/2)\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render()\n psu_a();\n\n render()\n mirror([x==-1?1:0,0,0])\n ty(-psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_side();\n\n render()\n translate(psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_back();\n }\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"76d98fd8e5a65b70fe65ab427ea9563c5a09491e","subject":"misc: add dict_replace and dict_replace_multiple","message":"misc: add dict_replace and dict_replace_multiple\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2da7c319033ef3a68ab6a4951a950bf38df1d112","subject":"Corrected Typo","message":"Corrected Typo\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/OmmatiDiag.scad","new_file":"DetectorMockup\/OmmatiDiag.scad","new_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkercad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detector will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n \/\/ box front walls, can (and should be turned off for increased visibility)\n translate(v = [0, unitlength + padding, 0]) {\n cube([unitlength + padding, 1, height]);\n }\n translate(v = [unitlength + padding, 0, 0]) {\n cube([1, unitlength + padding, height]); \/\/\n }\n }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ CMOS Backplate\nmodule Backplate()\n translate([(unitlength+padding)\/2 + 5, (unitlength+padding)\/2 + 5, height-15]) {\n color (\"red\", semitransparent) {\n cube([350,320,1],center=true);\n }\n }\nBackplate();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\")\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ Ommatidium back plate\n module Ommatidiumplate()\n color (\"red\", semitransparent)\n cube([15, 20, 1], center=true);\n translate ([5,7,0]) Ommatidiumplate();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\", nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1)\n polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2]) CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","old_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detector will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n \/\/ box front walls, can (and should be turned off for increased visibility)\n translate(v = [0, unitlength + padding, 0]) {\n cube([unitlength + padding, 1, height]);\n }\n translate(v = [unitlength + padding, 0, 0]) {\n cube([1, unitlength + padding, height]); \/\/\n }\n }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ CMOS Backplate\nmodule Backplate()\n translate([(unitlength+padding)\/2 + 5, (unitlength+padding)\/2 + 5, height-15]) {\n color (\"red\", semitransparent) {\n cube([350,320,1],center=true);\n }\n }\nBackplate();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\")\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ Ommatidium back plate\n module Ommatidiumplate()\n color (\"red\", semitransparent)\n cube([15, 20, 1], center=true);\n translate ([5,7,0]) Ommatidiumplate();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\", nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1)\n polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2]) CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"578d654fa1abf529de0efaba519206b850a88f3d","subject":"misc: add take3 and vec3","message":"misc: add take3 and vec3\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"81bf6d74d90900ca7d22ba76575415822c7f756f","subject":"\u0434\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430","message":"\u0434\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5; \ncylinder(18, 100, 100); \n}\n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t\ntranslate([30,200,7.6]) rotate([90,0,0]) cylinder(115,7.8,7.8);\t\t\ntranslate([30,-89,7.6]) rotate([90,0,45]) cylinder(115,7.8,7.8);\t\t\ntranslate([-174,-114.5,7.6]) rotate([45,90,76]) cylinder(115,7.8,7.8);\t\t\t\n}\t\t\n\t\t\nplaid();\t\t\nconnect();\t\t\n\t\n\n\n","old_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \n\n$fn=5; \ncylinder(15, 100, 100);\n\/\/\u0441\u0432\u044f\u0437\u044c \ntranslate([30,200,7.6]) rotate([90,0,0]) cylinder(115,7.8,7.8);\ntranslate([30,-89,7.6]) rotate([90,0,45]) cylinder(115,7.8,7.8);\ntranslate([-174,-114.5,7.6]) rotate([45,90,76]) cylinder(115,7.8,7.8);\n \n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"97087065b0de39770b8ef8cbc54655edd59b3ba8","subject":"change to nema connector from pc power supply","message":"change to nema connector from pc power supply\n","repos":"kak-bo-che\/zen_toolworks_quelab","old_file":"src\/power_supplies\/power_supply.scad","new_file":"src\/power_supplies\/power_supply.scad","new_contents":"include <..\/util\/slots.scad>\ninclude <..\/util\/rounded_square.scad>\n$fn=20;\npower_supply_length=215;\npower_supply_width=115;\npower_supply_height=50;\n\noverall_length=300;\noverall_height=70;\nstepper_power_width=30;\n\npart_separation=5;\nmaterial_thickness=3.04;\ncorner_radius=10;\nhole_size=3.2;\n\nbase_plate_length=150 + 70;\nbase_plate_width=power_supply_width + 2*corner_radius+material_thickness;\nmodule m4_holes(){\n hole_radius = 4.2\/2;\n x_offset = 150\/2;\n y_offset = 50\/2;\n translate([x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([x_offset, -y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, -y_offset]){\n circle(hole_radius);\n }\n\n}\nmodule power_supply(){\n difference(){\n %square([215, 115], center=true);\n m4_holes();\n }\n}\nmodule power_supply_side_holes(){\n hole_diameter = 4.2;\n x_offset = 150\/2;\n y_offset = 13;\n translate([x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n translate([-x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n}\nmodule power_supply_side(){\n difference(){\n %square([215, 50], center=true);\n power_supply_side_holes();\n }\n}\n\nmodule nema_with_switch(){\n square([27, 42.3], center=true);\n}\n\nmodule nema(){\n hole_diameter=3.2;\n square([27, 19.1], center=true);\n %square([49.5,22.5], center=true);\n translate([-20, 0]) circle(d=hole_diameter);\n translate([20, 0]) circle(d=hole_diameter);\n\n}\n\nmodule vent_legs(count=3, radius=10){\n for(x=[1:count]){\n translate([x*overall_length\/(count + 1), 0]){\n hull(){\n translate([-1.5*radius, 0])circle(radius);\n translate([1.5*radius, 0]) circle(radius);\n }\n }\n }\n}\n\nmodule power_switch(){\n circle(12);\n %square([30, 37], center=true);\n}\n\nmodule stepper_power(){\n square([stepper_power_width, 110]);\n}\n\nmodule stepper_power_side_dc(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 9]) circle(d=10);\n}\n\nmodule stepper_power_side_ac(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 15.5]) square([15,20], center=true);\n}\n\nmodule ac_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_ac();\n translate([material_thickness + stepper_power_width + 25, power_supply_height\/2 + 10]) nema();\n translate([material_thickness + stepper_power_width + 10, 9]) circle(d=7.5);\n }\n}\n\n\nmodule dc_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_dc();\n translate([material_thickness + stepper_power_width + 25, 2*power_supply_height\/3]) circle(d=19.7);\n translate([material_thickness + stepper_power_width + 5, 17]) circle(d=7.5);\n }\n}\n\nmodule screw_terminal(n=2){\n terminal_height=18.6;\n divider_height=21.8;\n\n hole_locations = [[ 2, 28.7], [3, 38.2], [4, 47.7], [5, 57.2], [6, 66.7], [7, 76.2], [8, 85.7]];\n lengths = [[2, 36.2], [3, 45.7], [4, 55.2], [5, 64.7], [6, 74.2], [7, 83.7], [8, 93.2]];\n hole_distance = lookup(n, hole_locations);\n length = lookup(n, lengths);\n \/\/ translate([length\/2, divider_height\/2]){\n %square([length, divider_height], center=true);\n translate([-hole_distance\/2, 4]) circle(d=4);\n translate([-hole_distance\/2, -4]) circle(d=4);\n translate([hole_distance\/2, 4]) circle(d=4);\n translate([hole_distance\/2, -4]) circle(d=4);\n \/\/ }\n}\n\nmodule side(){\n leg_holes = floor(overall_length\/5);\n difference(){\n square([overall_length, overall_height]);\n make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, overall_height]) vent_legs();\n translate([material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([material_thickness, power_supply_height + 1.5]) make_slots(overall_length - power_supply_length - material_thickness, 5, material_thickness, true);\n translate([overall_length - power_supply_length, 0]){\n translate([power_supply_length\/2, power_supply_height\/2]) rotate(180) power_supply_side();\n }\n }\n}\n\nmodule front(){\n translate([0, material_thickness]) square([power_supply_width, overall_height - material_thickness]);\n translate([power_supply_width + material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([0, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n make_slots(power_supply_width, 5, material_thickness, true);\n}\n\nmodule top(){\n difference(){\n union(){\n square([overall_length - power_supply_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n }\n translate([material_thickness, 0]) rotate(90) make_slots(power_supply_width, 5, material_thickness, true);\n translate([(overall_length - power_supply_length + 13)\/2, 2.4*power_supply_width\/5]) power_switch();\n translate([(overall_length - power_supply_length + 30)\/2, 4*power_supply_width\/5]) screw_terminal(2);\n % translate([material_thickness, 0]) stepper_power();\n }\n}\n\nmodule bottom(){\n bottom_length = overall_length - power_supply_length - material_thickness;\n square([bottom_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(bottom_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(bottom_length, 5, material_thickness, true);\n}\n\nac_side();\ntranslate([0, -part_separation]) mirror([0,1,0]) dc_side();\ntranslate([0, -(overall_height + power_supply_width + 2* part_separation)]) top();\ntranslate([-power_supply_width - part_separation, 0]) front();\ntranslate([material_thickness, overall_height + part_separation]) bottom();\n","old_contents":"include <..\/util\/slots.scad>\ninclude <..\/util\/rounded_square.scad>\n$fn=20;\npower_supply_length=215;\npower_supply_width=115;\npower_supply_height=50;\n\noverall_length=300;\noverall_height=70;\nstepper_power_width=30;\n\npart_separation=5;\nmaterial_thickness=3.04;\ncorner_radius=10;\nhole_size=3.2;\n\nbase_plate_length=150 + 70;\nbase_plate_width=power_supply_width + 2*corner_radius+material_thickness;\nmodule m4_holes(){\n hole_radius = 4.2\/2;\n x_offset = 150\/2;\n y_offset = 50\/2;\n translate([x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([x_offset, -y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, -y_offset]){\n circle(hole_radius);\n }\n\n}\nmodule power_supply(){\n difference(){\n %square([215, 115], center=true);\n m4_holes();\n }\n}\nmodule power_supply_side_holes(){\n hole_diameter = 4.2;\n x_offset = 150\/2;\n y_offset = 13;\n translate([x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n translate([-x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n}\nmodule power_supply_side(){\n difference(){\n %square([215, 50], center=true);\n power_supply_side_holes();\n }\n}\n\nmodule nema(){\n square([27, 42.3], center=true);\n}\n\nmodule vent_legs(count=3, radius=10){\n for(x=[1:count]){\n translate([x*overall_length\/(count + 1), 0]){\n hull(){\n translate([-1.5*radius, 0])circle(radius);\n translate([1.5*radius, 0]) circle(radius);\n }\n }\n }\n}\n\nmodule power_switch(){\n circle(12);\n %square([30, 37], center=true);\n}\n\nmodule stepper_power(){\n square([stepper_power_width, 110]);\n}\n\nmodule stepper_power_side_dc(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 9]) circle(d=10);\n}\n\nmodule stepper_power_side_ac(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 15.5]) square([15,20], center=true);\n}\n\nmodule ac_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_ac();\n translate([material_thickness + stepper_power_width + 25, power_supply_height\/2 + 10]) rotate(90) nema();\n translate([material_thickness + stepper_power_width + 10, 9]) circle(d=7.5);\n }\n}\n\n\nmodule dc_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_dc();\n translate([material_thickness + stepper_power_width + 25, 2*power_supply_height\/3]) circle(d=19.7);\n translate([material_thickness + stepper_power_width + 5, 17]) circle(d=7.5);\n }\n}\n\nmodule screw_terminal(n=2){\n terminal_height=18.6;\n divider_height=21.8;\n\n hole_locations = [[ 2, 28.7], [3, 38.2], [4, 47.7], [5, 57.2], [6, 66.7], [7, 76.2], [8, 85.7]];\n lengths = [[2, 36.2], [3, 45.7], [4, 55.2], [5, 64.7], [6, 74.2], [7, 83.7], [8, 93.2]];\n hole_distance = lookup(n, hole_locations);\n length = lookup(n, lengths);\n \/\/ translate([length\/2, divider_height\/2]){\n %square([length, divider_height], center=true);\n translate([-hole_distance\/2, 4]) circle(d=4);\n translate([-hole_distance\/2, -4]) circle(d=4);\n translate([hole_distance\/2, 4]) circle(d=4);\n translate([hole_distance\/2, -4]) circle(d=4);\n \/\/ }\n}\n\nmodule side(){\n leg_holes = floor(overall_length\/5);\n difference(){\n square([overall_length, overall_height]);\n make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, overall_height]) vent_legs();\n translate([material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([material_thickness, power_supply_height + 1.5]) make_slots(overall_length - power_supply_length - material_thickness, 5, material_thickness, true);\n translate([overall_length - power_supply_length, 0]){\n translate([power_supply_length\/2, power_supply_height\/2]) rotate(180) power_supply_side();\n }\n }\n}\n\nmodule front(){\n translate([0, material_thickness]) square([power_supply_width, overall_height - material_thickness]);\n translate([power_supply_width + material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([0, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n make_slots(power_supply_width, 5, material_thickness, true);\n}\n\nmodule top(){\n difference(){\n union(){\n square([overall_length - power_supply_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n }\n translate([material_thickness, 0]) rotate(90) make_slots(power_supply_width, 5, material_thickness, true);\n translate([(overall_length - power_supply_length + 13)\/2, 2.4*power_supply_width\/5]) power_switch();\n translate([(overall_length - power_supply_length + 30)\/2, 4*power_supply_width\/5]) screw_terminal(2);\n % translate([material_thickness, 0]) stepper_power();\n }\n}\n\nmodule bottom(){\n bottom_length = overall_length - power_supply_length - material_thickness;\n square([bottom_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(bottom_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(bottom_length, 5, material_thickness, true);\n}\n\nac_side();\ntranslate([0, -part_separation]) mirror([0,1,0]) dc_side();\ntranslate([0, -(overall_height + power_supply_width + 2* part_separation)]) top();\ntranslate([-power_supply_width - part_separation, 0]) front();\ntranslate([material_thickness, overall_height + part_separation]) bottom();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"7ef88f9e6f9ebc468310a5e4eb576d00f6f873fb","subject":"bearing\/data: add 683 and M83","message":"bearing\/data: add 683 and M83\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \ninclude \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_683 = [3,7,3];\nbearing_MR128 = [8,12,3.5];\nbearing_MR83 = [3,8,3];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ SKF linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_LBBR12 = [12, 19, 28, 23, 20];\n\n\/\/ PBC linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_KHP12 = [12, 19, 28, 23, 20];\n\n\/\/ Bosch Rexroth linear ball bearing\nbearing_KBC12 = [12, 19, 28, 23, 20];\n\nbearing_KH1026 = [12, 19, 28, 23, 20];\nbearing_KH1228 = [12, 19, 28, 23, 20];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \ninclude \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ SKF linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_LBBR12 = [12, 19, 28, 23, 20];\n\n\/\/ PBC linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_KHP12 = [12, 19, 28, 23, 20];\n\n\/\/ Bosch Rexroth linear ball bearing\nbearing_KBC12 = [12, 19, 28, 23, 20];\n\nbearing_KH1026 = [12, 19, 28, 23, 20];\nbearing_KH1228 = [12, 19, 28, 23, 20];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4874954adb1a40091165dbb8ea9d78d3809736c2","subject":"Added cadcorn-camera.scad","message":"Added cadcorn-camera.scad\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"vor-3d-models\/cadcorn-camera.scad","new_file":"vor-3d-models\/cadcorn-camera.scad","new_contents":"\/\/ Cadcorn Camera, a 3D-printable unicorn webcam holder\n\/\/ \u00a92015 Paul Houghton, paul.houghton@futurice.com, CC-attribution-sharealike license, http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\n\nuse ;\nuse ;\n\nlow_poly = 8;\nhigh_poly = 128;\n\npoly=high_poly;\nscale=1.8;\n\ncut_size=300;\n\nfront();\nback();\n\nmodule camera() {\n rotate([25,0,0]) {\n minkowski() {\n creative_hd();\n sphere($fn=8, r=1);\n }\n lens_space();\n}\n}\n\nmodule corn() {\n translate([-50,0,50]) scale([scale,scale,scale])\n cadcorn(poly=poly); \n}\n\nmodule front() {\n difference() {\n corn();\n union() {\n cut();\n camera();\n }\n }\n}\n\nmodule back() {\n difference() {\n corn();\n union() {\n uncut();\n camera();\n }\n }\n}\n\nmodule cut() {\n translate([cut_size\/2,0,0]) cube([cut_size,cut_size,cut_size], center=true);\n}\n\nmodule uncut() {\n difference() {\n translate([cut_size\/2,0,0]) cube([2*cut_size,cut_size,cut_size], center=true);\n cut();\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'vor-3d-models\/cadcorn-camera.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b6c42541c58161dbbfcfcebc7e96967948c92f3","subject":"fancier box","message":"fancier box","repos":"arpruss\/gamecube-usb-adapter,arpruss\/gamecube-usb-adapter,arpruss\/gamecube-usb-adapter","old_file":"adaptercase.scad","new_file":"adaptercase.scad","new_contents":"use ;\r\n\r\n\/\/\r\nincludeBottom = 1; \/\/ [1:yes, 0:no]\r\nincludeTop = 1; \/\/ [1:yes, 0:no]\r\nincludeGamecubePort = 1; \/\/ [1:yes, 0:no]\r\nincludeEllipticalPort = 0; \/\/ [1:yes, 0:no]\r\nincludeNunchuckPort = 0; \/\/ [1:yes, 0:no]\r\n\/\/ TODO:\r\nincludeSwitchPort = 0; \/\/ [1:yes, 0:no]\r\ninnerLength = 80;\r\nextraWidth = 15;\r\nsideWall = 1.5;\r\ntopWall = 1.6;\r\nbottomWall = 2;\r\nbottomScrewLength = 8;\r\ntopScrewLength = 5.7;\r\nscrewDiameter = 2.12;\r\nscrewHeadDiameter = 4.11;\r\nthinPillarDiameter = 5.5;\r\nfatPillarDiameter = 9;\r\nstm32Width = 24.35;\r\nstm32Length = 57.2;\r\ntolerance = 0.2;\r\npcbThickness = 1.25;\r\nbottomOverlap = 4;\r\ntopUnderlap = 4.8;\r\nstm32ScrewYSpacing=18.8;\r\nstm32ScrewXSpacing=52;\r\nstm32ScrewOffset=2.4;\r\ngcCableDiameter=3.7;\r\nellipticalCableMajorDiameter=5.32;\r\nellipticalCableMinorDiameter=2.66;\r\ntopOffset = 4.8;\r\ntopScrewX1 = 6;\r\ntopScrewXSpacing = 54.66;\r\nbuttonHoleDiameter = 4.9;\r\nbutton1OffsetFromHole = 12.7;\r\nbutton2OffsetFromHole = 5.78;\r\nledHoleDiameter = 4;\r\nled1XOffsetFromButton1 = 10.16; \r\nled1YOffsetFromButton1 = 1.27; \r\nledSpacing = 5.08;\r\npcbToPCBSpacing = 12;\r\nusbPortWidth = 10;\r\nusbPortHeight = 4.5;\r\nnunchuckPortTolerance = 0.3;\r\nnunchuckPortHeight = 7.36;\r\nnunchuckPortWidth = 12.24;\r\nnunchuckPortInsetDepth = 1.28;\r\nnunchuckPortInsetWidth = 4.59;\r\nnunchuckPortPillarTopFromCenter = 4.8;\r\nnunchuckPortZOffset = 2;\r\nnunchuckScrewHoleYMinusFromCenterOfPort = 6.99;\r\nnunchuckScrewHoleXMinusFromOutsideOfWall = 12.91;\r\nnunchuckScrewHoleYSpacing = 2.54*5;\r\nnunchuckScrewHoleXSpacing = 2.54*6;\r\n\/\/<\/params>\r\n\r\nmodule dummy() {}\r\n\r\n$fn = 32;\r\nnudge = 0.001;\r\n\r\ninnerWidth = extraWidth+stm32Width+fatPillarDiameter*2;\r\nbottomOffset = bottomScrewLength-pcbThickness;\r\nbottomHeight = bottomWall+bottomOffset+pcbThickness;\r\nbottomFatPillarLength = bottomHeight+bottomOverlap;\r\ntopHeight = topWall + topOffset + pcbThickness + max(topUnderlap,pcbToPCBSpacing);\r\ntopFatPillarLength = topHeight-topUnderlap;\r\nnunchuckPillarLength = bottomHeight + nunchuckPortZOffset - nunchuckPortPillarTopFromCenter;\r\n\r\nfatPillarLocations = [\r\n [-sideWall+fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [-sideWall+fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0]\r\n];\r\nstm32ScrewX1 = stm32ScrewOffset;\r\nstm32ScrewY1 = fatPillarLocations[0][1]+fatPillarDiameter\/2+thinPillarDiameter\/2;\r\n\r\n\r\nellipticalCableY = fatPillarLocations[1][1]-fatPillarDiameter-1.5*ellipticalCableMinorDiameter;\r\ngcPortY = stm32ScrewY1+stm32ScrewYSpacing\/2;\r\n\r\nnunchuckPortY = innerWidth+sideWall-fatPillarDiameter-nunchuckPortWidth\/2-nunchuckPortTolerance*2;\/\/ (stm32ScrewY1+stm32ScrewYSpacing+thinPillarDiameter+innerWidth-fatPillarDiameter)*0.5;\r\nnx0 = innerLength+sideWall-nunchuckScrewHoleXMinusFromOutsideOfWall;\r\nny0 = nunchuckPortY-nunchuckScrewHoleYMinusFromCenterOfPort;\r\nnunchuckPillarLocations = [\r\n [nx0,ny0],\r\n [nx0-nunchuckScrewHoleXSpacing,ny0],\r\n [nx0-nunchuckScrewHoleXSpacing,ny0+nunchuckScrewHoleYSpacing],\r\n [nx0,ny0+nunchuckScrewHoleYSpacing]];\r\necho(nunchuckPillarLocations);\r\n\r\ntopScrewY = innerWidth-stm32ScrewY1-stm32ScrewYSpacing\/2;\r\nbottomThinPillarLocations = [\r\n [stm32ScrewX1,stm32ScrewY1,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1,0],\r\n [stm32ScrewX1,stm32ScrewY1+stm32ScrewYSpacing,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1+stm32ScrewYSpacing,0] ];\r\n\r\nmodule base(inset=0) {\r\n translate([-sideWall+inset,-sideWall+inset])\r\n roundedSquare([innerLength+2*sideWall-2*inset,innerWidth+2*sideWall-2*inset], radius=fatPillarDiameter\/2-inset);\r\n}\r\n\r\nmodule ellipticalCable() {\r\n rotate([0,90,0])\r\n translate([0,0,-nudge-sideWall])\r\n linear_extrude(height=3*sideWall+2*nudge)\r\n hull() {\r\n translate([-(ellipticalCableMajorDiameter-ellipticalCableMinorDiameter)\/2-tolerance,0,0])\r\n circle(d=ellipticalCableMinorDiameter);\r\n translate([(ellipticalCableMajorDiameter-ellipticalCableMinorDiameter)\/2+tolerance,0,0])\r\n circle(d=ellipticalCableMinorDiameter);\r\n }\r\n}\r\n\r\nnunchuckPortHeight = 7.36;\r\nnunchuckPortWidth = 12.24;\r\nnunchuckPortInsetDepth = 1.28;\r\nnunchuckPortInsetWidth = 4.59;\r\n\r\nmodule nunchuckConnector() {\r\n h = nunchuckPortHeight + 2*nunchuckPortTolerance;\r\n w = nunchuckPortWidth + 2*nunchuckPortTolerance;\r\n insetDepth = nunchuckPortInsetDepth;\r\n insetWidth = nunchuckPortInsetWidth+2*nunchuckPortTolerance;\r\n rotate([0,90,0])\r\n translate([0,0,-nudge])\r\n linear_extrude(height=sideWall+2*nudge)\r\n polygon([[-h\/2,-w\/2],[h\/2,-w\/2],[h\/2,w\/2],[-h\/2,w\/2],[-h\/2,insetWidth\/2],[-h\/2+insetDepth,insetWidth\/2],[-h\/2+insetDepth,-insetWidth\/2],[-h\/2,-insetWidth\/2]]);\r\n}\r\n\r\nmodule sideWalls() {\r\n difference() {\r\n base();\r\n base(inset=sideWall);\r\n }\r\n}\r\n\r\nmodule tweakedSideWalls() {\r\n difference() {\r\n base(inset=-sideWall);\r\n base(inset=sideWall+tolerance);\r\n }\r\n}\r\n\r\nmodule fatPillar(hole=false,bottom=true) {\r\n fatPillarLength = bottom?bottomFatPillarLength:topFatPillarLength;\r\n if (!hole)\r\n cylinder(d=fatPillarDiameter,fatPillarLength);\r\n else {\r\n if (bottom)\r\n cylinder(d=screwHeadDiameter+2*tolerance,h=fatPillarLength-(bottom?bottomWall:topWall));\r\n cylinder(d=screwDiameter+2*tolerance,h=fatPillarLength+nudge);\r\n }\r\n}\r\n\r\nmodule thinPillar(hole=false,height=10) {\r\n if (!hole)\r\n cylinder(d=thinPillarDiameter,h=height);\r\n else {\r\n cylinder(d=screwDiameter+2*tolerance,h=height);\r\n }\r\n}\r\n\r\n\r\n\r\nmodule bottom() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=bottomWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar();\r\n linear_extrude(height=bottomHeight+nudge) sideWalls();\r\n for (p=bottomThinPillarLocations)\r\n translate(p) thinPillar(height=bottomWall+bottomOffset);\r\n if (includeNunchuckPort)\r\n for (p=nunchuckPillarLocations)\r\n translate(p) thinPillar(height=nunchuckPillarLength);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,gcPortY-gcCableDiameter*1.5,0]) cube([2*sideWall+nudge,3*gcCableDiameter,bottomHeight]);\r\n if (includeEllipticalPort) \r\n translate([-nudge,ellipticalCableY-ellipticalCableMinorDiameter*1.5,0]) cube([2*sideWall+nudge,3*ellipticalCableMinorDiameter,bottomHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(hole=true);\r\n translate([0,0,bottomHeight]) linear_extrude(height=bottomOverlap+nudge) tweakedSideWalls();\r\n if (includeNunchuckPort)\r\n for (p=nunchuckPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(height=nunchuckPillarLength,hole=true);\r\n for (p=bottomThinPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(hole=true,height=bottomHeight+nudge);\r\n if (includeNunchuckPort)\r\n translate([innerLength,nunchuckPortY,bottomHeight+nunchuckPortZOffset]) nunchuckConnector();\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,gcPortY,bottomHeight]) rotate([0,90,0]) cylinder(d=gcCableDiameter,h=3*sideWall+2*nudge);\r\n if (includeEllipticalPort)\r\n translate([0,ellipticalCableY,bottomHeight]) ellipticalCable();\r\n }\r\n}\r\n\r\nmodule top() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=topWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(bottom=false);\r\n linear_extrude(height=topHeight+nudge) sideWalls();\r\n translate([topScrewX1,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,innerWidth-gcPortY-gcCableDiameter*1.5,0]) cube([2*sideWall+nudge,3*gcCableDiameter,topHeight]);\r\n if (includeEllipticalPort) \r\n translate([-nudge,innerWidth-ellipticalCableY-ellipticalCableMinorDiameter*1.5,0]) cube([2*sideWall+nudge,3*ellipticalCableMinorDiameter,topHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate([0,0,topWall]) translate(p) fatPillar(hole=true,bottom=false);\r\n translate([topScrewX1,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n\r\n y0=innerWidth-(stm32ScrewY1+stm32ScrewYSpacing\/2);\r\n if (includeNunchuckPort)\r\n translate([innerLength,innerWidth-nunchuckPortY,topHeight-nunchuckPortZOffset]) rotate([180,0,0]) nunchuckConnector();\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,innerWidth-gcPortY,topHeight]) rotate([0,90,0]) cylinder(d=gcCableDiameter,h=3*sideWall+2*nudge);\r\n if (includeEllipticalPort)\r\n translate([0,innerWidth-ellipticalCableY,topHeight]) ellipticalCable();\r\n translate([-sideWall-nudge,y0-usbPortWidth\/2,topHeight-usbPortHeight]) cube([sideWall+2*nudge,usbPortWidth,usbPortHeight+nudge]);\r\n translate([-sideWall*0.25-tolerance,y0-(stm32Width+2*tolerance)\/2,topHeight-pcbThickness-tolerance]) cube([sideWall*0.25+tolerance+nudge,stm32Width+2*tolerance,pcbThickness+tolerance+nudge]);\r\n translate([topScrewX1+button1OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n translate([topScrewX1+topScrewXSpacing-button2OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n for(i=[0:3]) translate([topScrewX1+button1OffsetFromHole+led1XOffsetFromButton1+i*ledSpacing,topScrewY+led1YOffsetFromButton1,-nudge]) cylinder(d=ledHoleDiameter,h=topWall+2*nudge);\r\n }\r\n}\r\n\r\nif (includeBottom)\r\n bottom();\r\nif (includeTop)\r\n translate([0,innerWidth+sideWall+8,0])\r\n top();\r\n","old_contents":"use ;\r\n\r\n\/\/\r\nincludeBottom = 1; \/\/ [1:yes, 0:no]\r\nincludeTop = 1; \/\/ [1:yes, 0:no]\r\ninnerLength = 80;\r\nextraWidth = 15;\r\nsideWall = 1.5;\r\ntopWall = 1.6;\r\nbottomWall = 2;\r\nbottomScrewLength = 8;\r\ntopScrewLength = 5.7;\r\nscrewDiameter = 2.12;\r\nscrewHeadDiameter = 4.11;\r\nthinPillarDiameter = 5.5;\r\nfatPillarDiameter = 9;\r\nstm32Width = 24.35;\r\nstm32Length = 57.2;\r\ntolerance = 0.2;\r\npcbThickness = 1.25;\r\nbottomOverlap = 4;\r\ntopUnderlap = 4.8;\r\nstm32ScrewYSpacing=18.8;\r\nstm32ScrewXSpacing=52;\r\nstm32ScrewOffset=2.4;\r\ncableDiameter=3.7;\r\ntopOffset = 4.8;\r\ntopScrewX1 = 6;\r\ntopScrewXSpacing = 54.66;\r\nbuttonHoleDiameter = 4.9;\r\nbutton1OffsetFromHole = 12.7;\r\nbutton2OffsetFromHole = 5.78;\r\nledHoleDiameter = 4;\r\nled1XOffsetFromButton1 = 10.16; \r\nled1YOffsetFromButton1 = 1.27; \r\nledSpacing = 5.08;\r\npcbToPCBSpacing = 12;\r\nusbPortWidth = 10;\r\nusbPortHeight = 4.5;\r\n\/\/<\/params>\r\n\r\nmodule dummy() {}\r\n\r\n$fn = 32;\r\nnudge = 0.001;\r\n\r\ninnerWidth = extraWidth+stm32Width+fatPillarDiameter*2;\r\nbottomOffset = bottomScrewLength-pcbThickness;\r\nbottomHeight = bottomWall+bottomOffset+pcbThickness;\r\nbottomFatPillarLength = bottomHeight+bottomOverlap;\r\ntopHeight = topWall + topOffset + pcbThickness + max(topUnderlap,pcbToPCBSpacing);\r\ntopFatPillarLength = topHeight-topUnderlap;\r\n\r\nfatPillarLocations = [\r\n [-sideWall+fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [-sideWall+fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0]\r\n];\r\nstm32ScrewX1 = stm32ScrewOffset;\r\nstm32ScrewY1 = fatPillarLocations[0][1]+fatPillarDiameter\/2+thinPillarDiameter\/2;\r\ntopScrewY = innerWidth-stm32ScrewY1-stm32ScrewYSpacing\/2;\r\nbottomThinPillarLocations = [\r\n [stm32ScrewX1,stm32ScrewY1,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1,0],\r\n [stm32ScrewX1,stm32ScrewY1+stm32ScrewYSpacing,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1+stm32ScrewYSpacing,0] ];\r\n\r\n\r\nmodule base(inset=0) {\r\n translate([-sideWall+inset,-sideWall+inset])\r\n roundedSquare([innerLength+2*sideWall-2*inset,innerWidth+2*sideWall-2*inset], radius=fatPillarDiameter\/2-inset);\r\n}\r\n\r\nmodule sideWalls() {\r\n difference() {\r\n base();\r\n base(inset=sideWall);\r\n }\r\n}\r\n\r\nmodule tweakedSideWalls() {\r\n difference() {\r\n base(inset=-sideWall);\r\n base(inset=sideWall+tolerance);\r\n }\r\n}\r\n\r\nmodule fatPillar(hole=false,bottom=true) {\r\n fatPillarLength = bottom?bottomFatPillarLength:topFatPillarLength;\r\n if (!hole)\r\n cylinder(d=fatPillarDiameter,fatPillarLength);\r\n else {\r\n if (bottom)\r\n cylinder(d=screwHeadDiameter+2*tolerance,h=fatPillarLength-(bottom?bottomWall:topWall));\r\n cylinder(d=screwDiameter+2*tolerance,h=fatPillarLength+nudge);\r\n }\r\n}\r\n\r\nmodule thinPillar(hole=false,height=10) {\r\n if (!hole)\r\n cylinder(d=thinPillarDiameter,h=height);\r\n else {\r\n cylinder(d=screwDiameter+2*tolerance,h=height);\r\n }\r\n}\r\n\r\n\r\n\r\nmodule bottom() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=bottomWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar();\r\n linear_extrude(height=bottomHeight+nudge) sideWalls();\r\n for (p=bottomThinPillarLocations)\r\n translate(p) thinPillar(height=bottomWall+bottomOffset);\r\n translate([innerLength-2*sideWall,stm32ScrewY1+stm32ScrewYSpacing\/2-cableDiameter*1.5,0]) cube([2*sideWall+nudge,3*cableDiameter,bottomHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(hole=true);\r\n translate([0,0,bottomHeight]) linear_extrude(height=bottomOverlap+nudge) tweakedSideWalls();\r\n for (p=bottomThinPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(hole=true,height=bottomHeight+nudge);\r\n translate([innerLength-2*sideWall,stm32ScrewY1+stm32ScrewYSpacing\/2,bottomHeight]) rotate([0,90,0]) cylinder(d=cableDiameter,h=3*sideWall+2*nudge);\r\n }\r\n}\r\n\r\nmodule top() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=topWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(bottom=false);\r\n linear_extrude(height=topHeight+nudge) sideWalls();\r\n translate([topScrewX1,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n translate([innerLength-2*sideWall,innerWidth-(stm32ScrewY1+stm32ScrewYSpacing\/2)-cableDiameter*1.5,0]) cube([2*sideWall+nudge,3*cableDiameter,topHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate([0,0,topWall]) translate(p) fatPillar(hole=true,bottom=false);\r\n translate([topScrewX1,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n\r\n y0=innerWidth-(stm32ScrewY1+stm32ScrewYSpacing\/2);\r\n translate([innerLength-2*sideWall,y0,topHeight]) rotate([0,90,0]) cylinder(d=cableDiameter,h=3*sideWall+2*nudge);\r\n translate([-sideWall-nudge,y0-usbPortWidth\/2,topHeight-usbPortHeight]) cube([sideWall+2*nudge,usbPortWidth,usbPortHeight+nudge]);\r\n translate([-sideWall*0.25-tolerance,y0-(stm32Width+2*tolerance)\/2,topHeight-pcbThickness-tolerance]) cube([sideWall*0.25+tolerance+nudge,stm32Width+2*tolerance,pcbThickness+tolerance+nudge]);\r\n translate([topScrewX1+button1OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n translate([topScrewX1+topScrewXSpacing-button2OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n for(i=[0:3]) translate([topScrewX1+button1OffsetFromHole+led1XOffsetFromButton1+i*ledSpacing,topScrewY+led1YOffsetFromButton1,-nudge]) cylinder(d=ledHoleDiameter,h=topWall+2*nudge);\r\n\/\/ translate([fatPillarDiameter-sideWall+ventMargin,-sideWall-nudge,topWall+ventMargin]) vent(innerLength+2*sideWall-2*ventMargin,ventMargin,sideWall+2*nudge);\r\n\/\/ translate([fatPillarDiameter-sideWall+ventMargin,innerWidth-nudge,topWall+ventMargin]) vent(innerLength+2*sideWall-2*ventMargin,ventMargin,sideWall+2*nudge);\r\n }\r\n}\r\n\r\nif (includeBottom)\r\n bottom();\r\nif (includeTop)\r\n translate([0,innerWidth+sideWall+8,0])\r\n top();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e39f14b152c878bc9bb839bd139321f1f17d849e","subject":"The height variable was removed as a global variable.","message":"The height variable was removed as a global variable.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/coins\/coins-pendants-ornaments.scad","new_file":"OpenSCAD\/coins\/coins-pendants-ornaments.scad","new_contents":"\n\/\/ Ths OpenSCAD script is a direvative of:\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ \"Customizable Gimbal\" Description: \n\/\/ This model was insirped by DesignMakeTeach's print in place gimbal designs \n\/\/ on Thingiverse. Below I have linked an example. I personalized one of these\n\/\/ for myself and thought I'd make it a full on Customizer model. To do this\n\/\/ I recreated something similar to DesignMakeTeach's design in OpenSCAD and \n\/\/ used the Stencil-o-Matic from Benjamin to add in some easy customization.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution from:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\n\/\/ Coin and pendant features were added by Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\nuse ;\n\n\/* [Dimensions] *\/\n\n\n\n\/\/ Paste your Sencil-o-Matic code here\ninput =\"default_TNH\";\n\n\n\/\/ Move image left\/right\nMove_X = 0; \/\/ [-50:50]\n\n\/\/ Move image up\/down\nMove_Y = 0; \/\/ [-50:50]\n\n\/\/ Resize your image\nimage_size = 26.5; \/\/ [1:50]\n\nincludeGimbal = \"yes\"; \/\/ [yes, no]\n\n\/* [Hidden] *\/\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Stencil-o-Matic Stuff \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstencil_thickness = 5;\noffX = 0;\noffY = 0;\nmargin = 0;\ndispo_width = image_size;\n\npoints_array = (input==\"default_TNH\"? [[133,286],[[234.27,6.02],[231.55,7.45],[227.5,10.88],[222.85,15.67],[218.69,20.35],[214.95,25.17],[211.32,30.24],[208.44,34.98],[206.52,39],[205.31,48.23],[204.14,65.5],[202.43,96.43],[199.95,138.5],[197.65,174.91],[196.37,192.25],[195.44,195.38],[192.95,196],[190.58,196.5],[189.09,197.84],[188.55,199.75],[188.65,201.77],[188.28,204.15],[185.74,207.18],[181.17,210.7],[175.06,214.5],[168.61,218.79],[163.29,223.5],[159.05,228.64],[155.24,233.98],[152.19,239.17],[149.77,243.98],[148.11,250.02],[146.97,258.66],[145.84,267.33],[144.06,272.66],[141.97,276.16],[139.87,279.16],[138.4,281.78],[138.36,284.3],[139.83,286.58],[143.12,288.43],[150.09,289.9],[162.38,291.02],[181.28,291.67],[205.5,291.95],[229.79,291.67],[248.86,291],[261.56,289.87],[267.86,288.28],[270.76,286.27],[271.82,283.7],[271.26,280.36],[268.97,275.96],[266.18,270.14],[264.49,261.76],[263.22,253.76],[262.03,247.53],[260.34,242.46],[257.87,237.27],[254.58,232.07],[250.91,227.01],[246.01,222],[239.74,216.91],[233.89,213.03],[230,210.88],[227.72,209.34],[225.75,206.9],[224.51,204.05],[224,201.5],[223.82,199.39],[223.39,197.58],[222.07,196.41],[219.45,196],[216.94,195.74],[215.57,195.11],[215.61,179.54],[216.5,143.36],[217.84,100.02],[218.98,67.24],[219.99,41.97],[223.5,34.86],[227.01,28.44],[230.51,22.99],[232.97,19.44],[234,17.58],[234.64,16.25],[236.17,13.98],[237.73,11.12],[237.19,8.52],[235.86,6.75],[234.27,6.02]],[[212.84,76.5],[212.5,59.5],[211.74,69.5],[210.48,90.08],[208.53,125.5],[206.63,159.58],[205.5,176.93],[204.81,181.12],[203.95,183.56],[203.18,185.98],[202.73,190.13],[202.5,195.5],[206.22,195.81],[209.36,195.65],[210.42,193.81],[211.09,177.78],[212.04,142.5],[212.75,102.9],[212.84,76.5]],[[206,209],[195.82,209.28],[191.5,210],[194.92,210.74],[206,211],[217.08,210.74],[220.5,210],[216.18,209.28],[206,209]],[[205.86,215.72],[183.79,215.5],[178.37,218.41],[172.58,222.55],[166.23,228.5],[160.29,235.76],[156.27,243.19],[153.68,250.66],[151.96,258.09],[150.89,264.79],[149.83,270.5],[148.37,275.16],[146.32,279.34],[144.69,282.17],[144.25,283.58],[147.3,284.15],[154.07,284.97],[173.01,285.68],[205.29,285.98],[237.8,285.68],[256.79,284.92],[263.77,284.03],[266.92,283.42],[266.23,281.75],[264,278.35],[260.66,273.7],[259.87,264.1],[259.05,256.44],[258.15,251.5],[256.85,248.06],[255.05,244],[252.96,239.81],[250.98,236.07],[248.08,232.07],[243.79,227.28],[238.5,222.61],[233.21,218.93],[227.93,215.94],[205.86,215.72]],[[156.85,278.42],[154.78,278.35],[153.53,278.95],[153.45,279.83],[154.19,280.46],[157.32,281.08],[163,281.96],[173.19,282.99],[187.17,283.97],[203.88,284.41],[220.67,283.98],[234.91,283.01],[245.5,281.96],[251.42,280.91],[254.43,279.94],[254.97,279.17],[254.93,278.6],[251.4,278.77],[243.5,279.76],[228.64,280.99],[205,281.42],[182.42,281.13],[168.5,280.22],[161.36,279.17],[156.85,278.42]]]: input);\ninput_width = points_array[0][0];\ninput_height= points_array[0][1];\nsTrace = dispo_width\/input_width;\n\/\/stencil_height = input_height*sTrace + 2*margin;\n\n$fn=100;\n\/\/ preview[view:south, tilt:top]\n\nornament();\n\nmodule ornament(height = 3)\n{\n {\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1();\n ring2();\n ring3(); \n }\n\n difference()\n {\n color(\"blue\") \n pattern(height);\n \n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule pattern(height)\n{\n union()\n {\n \tscale([sTrace, -sTrace, 1]) \n \t{\n \t\tunion() \n \t\t{\n \t\t coin(height=height);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1()\n{\n\tdifference()\n\t{\n\/\/TODO: MAKE ALL THE HIGHT VALUES 5 AS A VARIABLE!!!!\t \n\/\/ \tcylinder(r=19.35, h=15, center=true);\n \tcylinder(r=19.35, h=3, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2()\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=15.95, h=3, center=true);\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3()\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=3, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}","old_contents":"\n\/\/ Ths OpenSCAD script is a direvative of:\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ \"Customizable Gimbal\" Description: \n\/\/ This model was insirped by DesignMakeTeach's print in place gimbal designs \n\/\/ on Thingiverse. Below I have linked an example. I personalized one of these\n\/\/ for myself and thought I'd make it a full on Customizer model. To do this\n\/\/ I recreated something similar to DesignMakeTeach's design in OpenSCAD and \n\/\/ used the Stencil-o-Matic from Benjamin to add in some easy customization.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution from:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\n\/\/ Coin and pendant features were added by Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\nuse ;\n\n\/* [Dimensions] *\/\n\nheight = 3;\n\n\/\/ Paste your Sencil-o-Matic code here\ninput =\"default_TNH\";\n\n\n\/\/ Move image left\/right\nMove_X = 0; \/\/ [-50:50]\n\n\/\/ Move image up\/down\nMove_Y = 0; \/\/ [-50:50]\n\n\/\/ Resize your image\nimage_size = 26.5; \/\/ [1:50]\n\nincludeGimbal = \"yes\"; \/\/ [yes, no]\n\n\/* [Hidden] *\/\n\n \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n \/\/ Stencil-o-Matic Stuff \/\/\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nstencil_thickness = 5;\noffX = 0;\noffY = 0;\nmargin = 0;\ndispo_width = image_size;\n\npoints_array = (input==\"default_TNH\"? [[133,286],[[234.27,6.02],[231.55,7.45],[227.5,10.88],[222.85,15.67],[218.69,20.35],[214.95,25.17],[211.32,30.24],[208.44,34.98],[206.52,39],[205.31,48.23],[204.14,65.5],[202.43,96.43],[199.95,138.5],[197.65,174.91],[196.37,192.25],[195.44,195.38],[192.95,196],[190.58,196.5],[189.09,197.84],[188.55,199.75],[188.65,201.77],[188.28,204.15],[185.74,207.18],[181.17,210.7],[175.06,214.5],[168.61,218.79],[163.29,223.5],[159.05,228.64],[155.24,233.98],[152.19,239.17],[149.77,243.98],[148.11,250.02],[146.97,258.66],[145.84,267.33],[144.06,272.66],[141.97,276.16],[139.87,279.16],[138.4,281.78],[138.36,284.3],[139.83,286.58],[143.12,288.43],[150.09,289.9],[162.38,291.02],[181.28,291.67],[205.5,291.95],[229.79,291.67],[248.86,291],[261.56,289.87],[267.86,288.28],[270.76,286.27],[271.82,283.7],[271.26,280.36],[268.97,275.96],[266.18,270.14],[264.49,261.76],[263.22,253.76],[262.03,247.53],[260.34,242.46],[257.87,237.27],[254.58,232.07],[250.91,227.01],[246.01,222],[239.74,216.91],[233.89,213.03],[230,210.88],[227.72,209.34],[225.75,206.9],[224.51,204.05],[224,201.5],[223.82,199.39],[223.39,197.58],[222.07,196.41],[219.45,196],[216.94,195.74],[215.57,195.11],[215.61,179.54],[216.5,143.36],[217.84,100.02],[218.98,67.24],[219.99,41.97],[223.5,34.86],[227.01,28.44],[230.51,22.99],[232.97,19.44],[234,17.58],[234.64,16.25],[236.17,13.98],[237.73,11.12],[237.19,8.52],[235.86,6.75],[234.27,6.02]],[[212.84,76.5],[212.5,59.5],[211.74,69.5],[210.48,90.08],[208.53,125.5],[206.63,159.58],[205.5,176.93],[204.81,181.12],[203.95,183.56],[203.18,185.98],[202.73,190.13],[202.5,195.5],[206.22,195.81],[209.36,195.65],[210.42,193.81],[211.09,177.78],[212.04,142.5],[212.75,102.9],[212.84,76.5]],[[206,209],[195.82,209.28],[191.5,210],[194.92,210.74],[206,211],[217.08,210.74],[220.5,210],[216.18,209.28],[206,209]],[[205.86,215.72],[183.79,215.5],[178.37,218.41],[172.58,222.55],[166.23,228.5],[160.29,235.76],[156.27,243.19],[153.68,250.66],[151.96,258.09],[150.89,264.79],[149.83,270.5],[148.37,275.16],[146.32,279.34],[144.69,282.17],[144.25,283.58],[147.3,284.15],[154.07,284.97],[173.01,285.68],[205.29,285.98],[237.8,285.68],[256.79,284.92],[263.77,284.03],[266.92,283.42],[266.23,281.75],[264,278.35],[260.66,273.7],[259.87,264.1],[259.05,256.44],[258.15,251.5],[256.85,248.06],[255.05,244],[252.96,239.81],[250.98,236.07],[248.08,232.07],[243.79,227.28],[238.5,222.61],[233.21,218.93],[227.93,215.94],[205.86,215.72]],[[156.85,278.42],[154.78,278.35],[153.53,278.95],[153.45,279.83],[154.19,280.46],[157.32,281.08],[163,281.96],[173.19,282.99],[187.17,283.97],[203.88,284.41],[220.67,283.98],[234.91,283.01],[245.5,281.96],[251.42,280.91],[254.43,279.94],[254.97,279.17],[254.93,278.6],[251.4,278.77],[243.5,279.76],[228.64,280.99],[205,281.42],[182.42,281.13],[168.5,280.22],[161.36,279.17],[156.85,278.42]]]: input);\ninput_width = points_array[0][0];\ninput_height= points_array[0][1];\nsTrace = dispo_width\/input_width;\n\/\/stencil_height = input_height*sTrace + 2*margin;\n\n$fn=100;\n\/\/ preview[view:south, tilt:top]\n\nornament();\n\nmodule ornament()\n{\n {\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1();\n ring2();\n ring3(); \n }\n\n difference()\n {\n color(\"blue\") \n pattern();\n \n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule pattern()\n{\n union()\n {\n \tscale([sTrace, -sTrace, 1]) \n \t{\n \t\tunion() \n \t\t{\n \t\t coin(height=height);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1()\n{\n\tdifference()\n\t{\n\/\/TODO: MAKE ALL THE HIGHT VALUES 5 AS A VARIABLE!!!!\t \n\/\/ \tcylinder(r=19.35, h=15, center=true);\n \tcylinder(r=19.35, h=3, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2()\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=15.95, h=3, center=true);\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3()\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=3, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"847a2659424ce1bd1bb137c45dc97c0e1ac3d624","subject":"Added traffic lights model","message":"Added traffic lights model\n","repos":"ksuszka\/3d-projects","old_file":"small\/traffic_lights_model.scad","new_file":"small\/traffic_lights_model.scad","new_contents":"$fs=0.2; \/\/ default 2\n$fa=3; \/\/ default 12\n\n\n\/\/pole();\nlight_holder();\nmodule light_holder() {\n module single() {\n cylinder(d=7, h=5);\n }\n module single_hole() {\n cylinder(d=5, h=30, center=true);\n translate([-1,0,54]) cube([5,100,100],true);\n }\n difference() {\n union() {\n hull() {\n translate([0,0,0]) cylinder(d=7, h=4);;\n translate([14,0,0]) cylinder(d=7, h=4);;\n }\n translate([0,0,0]) single();\n translate([7,0,0]) single();\n translate([14,0,0]) single();\n }\n union() {\n translate([0,0,0]) single_hole();\n translate([7,0,0]) single_hole();\n translate([14,0,0]) single_hole();\n }\n }\n difference() {\n union() {\n translate([3.5,0,-3.5]) cube([0.8,7,7],true);\n translate([10.5,0,-3.5]) cube([0.8,7,7],true); \n }\n translate([0,0,-6]) cube([100,4,10],true);\n }\n \n}\n\nmodule head() {\n \/\/cube([10,12,24],true);\n module outer() {\n hull() {\n translate([0,0,0]) cylinder(d=10, h=12);\n translate([14,0,0]) cylinder(d=10, h=12);\n }\n }\n module inner() {\n translate([0,0,1]) hull() {\n translate([0,0,0]) cylinder(d=7, h=12);\n translate([14,0,0]) cylinder(d=7, h=12);\n }\n }\n rotate([0,-90,0]) difference() {\n outer();\n inner();\n }\n}\nmodule pole() {\n \n difference() {\n union() {\n translate([0,0,-6]) cylinder(d=10,h=6);\n translate([0,0,0]) cylinder(d1=14,d2=6,h=10);\n translate([0,0,10]) cylinder(d=6,h=60);\n translate([5,0,73]) head();\n }\n cylinder(d=4,h=170,center=true);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/traffic_lights_model.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"aecfcd4d3d374f38902dbc1fb800975ed66cd2af","subject":"base a funciones","message":"base a funciones\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/base.scad","new_file":"class1\/exercise\/refactor\/base.scad","new_contents":"DIAMETER_BASE = 6;\nBORDER_RADIUS_BASE = 0.3;\n\nHEIGHT_BODY = 44.5;\nGREY = \"LightGrey\";\n\nmodule base()\n{\n base_cylinder();\n base_border();\n}\n\nmodule base_cylinder()\n{\n color(GREY)\n translate([0,0,-(HEIGHT_BODY + BORDER_RADIUS_BASE)])\n cylinder(\n h = BORDER_RADIUS_BASE, \n d = (DIAMETER_BASE - (2 * BORDER_RADIUS_BASE)),\n $fn = 100);\n}\n\nmodule base_border()\n{\n color(GREY)\n translate([0,0,-(HEIGHT_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE\/2)-BORDER_RADIUS_BASE, 0, 0])\n circle(r = BORDER_RADIUS_BASE, $fn = 100);\n}\n\nbase();","old_contents":"DIAMETER_BASE = 6;\nBORDER_RADIUS_BASE = 0.3;\n\nHEIGHT_BODY = 44.5;\nGREY = \"LightGrey\";\n\nmodule base()\n{\n \/\/Base cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_BODY + BORDER_RADIUS_BASE)])\n cylinder(\n h = BORDER_RADIUS_BASE, \n d = (DIAMETER_BASE - (2 * BORDER_RADIUS_BASE)),\n $fn = 100);\n\n\/\/Base shoulder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE\/2)-BORDER_RADIUS_BASE, 0, 0])\n circle(r = BORDER_RADIUS_BASE, $fn = 100);\n\n}\nbase();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"adbeae206bef370caede8352fdc0e5f96b221460","subject":"foot cube - main","message":"foot cube - main\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bed_foot\/bed_foot.scad","new_file":"bed_foot\/bed_foot.scad","new_contents":"module bed_foot()\n{\n h=60;\n d=52;\n cylinder(d=d, h=h, $fn=200);\n}\n\n\nbed_foot();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bed_foot\/bed_foot.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c7e41cd32f810ed9466a4cc9868110d32cbeee39","subject":"moved back to 1, single shlef, but longer + extra 0.5mm for mount tolerance","message":"moved back to 1, single shlef, but longer + extra 0.5mm for mount tolerance\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pen_shelf\/pen_shelf.scad","new_file":"pen_shelf\/pen_shelf.scad","new_contents":"$fn=30;\n\nmodule part()\n{\n \/\/ bottom part\n cube([350, 2*5+70+14.5-10\/2, 5]);\n \/\/ rounder corners\n hull()\n for(i=[0,1])\n translate([i*(350-10)+10\/2, 2*5+70+14.5-10\/2, 0])\n cylinder(r=10\/2, h=5);\n \/\/ mounts\n for(dx=[20, (350-30\/2)\/2 , 350-20-30\/2])\n {\n difference()\n {\n \/\/ towers\n union()\n {\n for(dy=[0, 14.5+5])\n translate([dx, dy, 0])\n cube([15, 5, 30]);\n }\n \/\/ drill holes\n translate([dx+15\/2, -1, 30-15\/2])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, 28);\n }\n }\n}\n\npart();\n","old_contents":"$fn=30;\n\nmodule part()\n{\n \/\/ bottom part\n cube([250, 2*5+70+14-10\/2, 5]);\n \/\/ rounder corners\n hull()\n for(i=[0,1])\n translate([i*(250-10)+10\/2, 2*5+70+14-10\/2, 0])\n cylinder(r=10\/2, h=5);\n \/\/ mounts\n for(dx=[20, (250-30\/2)\/2 , 250-20-30\/2])\n {\n difference()\n {\n \/\/ towers\n union()\n {\n for(dy=[0, 14+5])\n translate([dx, dy, 0])\n cube([15, 5, 30]);\n }\n \/\/ drill holes\n translate([dx+15\/2, -1, 30-15\/2])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, 28);\n }\n }\n}\n\npart();\ntranslate([250, -5, 0])\n rotate([0, 0, 180])\n part();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"82b8ebf7ed565ae879437262823177e3a793cecb","subject":"parameterize scale values","message":"parameterize scale values\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/customizer\/lamp-shade-customizer.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/customizer\/lamp-shade-customizer.scad","new_contents":"\nouterRadius = 15; \/\/ [10 : 60]\nsquareLength = 20; \/\/ [10 : 30]\nxScale = 0.5; \/\/ [0.1 : 0.1 : 2.0]\nyScale = 0.7; \/\/ [0.1 : 0.1 : 2.0]\n\nuse <..\/lamp-shade.scad>\n\nlampShade(outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\nouterRadius = 15;\nsquareLength = 20;\nxScale = 0.5;\n\nuse <..\/lamp-shade.scad>\n\nlampShade(outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"115dc5f7e2748f97e6c2bc6cbd32c1e6df5d00ee","subject":"'fleshing out' arm","message":"'fleshing out' arm\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \nrender()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"75327024f3e00941872f4bed072d269751f52cf1","subject":"laser mount effector on forearm for testing","message":"laser mount effector on forearm for testing\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n\/\/$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ forearm manipulator\nsharpieDiameter = 13;\nlaserDiodeDiameter = 2 * 3.05;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\n\/\/render()\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\nrender()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n cylinder(h = screwSpacerHeight \/ 4, r = setScrewRadius);\n translate([0, 0, screwSpacerHeight * .75])\n cylinder(h = screwSpacerHeight\/4, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight * 1.2]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight * .8], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = laserDiodeDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + laserDiodeDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox \/ 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \/\/ laser mount\n union() {\n translate([-forearmLength, 0, 0])\n difference() {\n union() {\n cylinder(h = bearingStep * 2, d = laserDiodeDiameter * 2);\n translate([-laserDiodeDiameter * 1.75, -1.5, 0])\n cube([laserDiodeDiameter + 4 * setScrewRadius, 3, bearingStep * 2]);\n }\n cylinder(h = bearingStep * 2, d = laserDiodeDiameter);\n #translate([ - laserDiodeDiameter * 1.75, -.5, 0])\n cube([laserDiodeDiameter + 4 * setScrewRadius, 1, bearingStep * 2], center = false);\n translate([-laserDiodeDiameter - 1.5 * setScrewRadius, laserDiodeDiameter * 2, bearingStep])\n rotate([90, 0, 0])\n cylinder(h = laserDiodeDiameter * 4, r = setScrewRadius);\n }\n }\n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n\/\/$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\n\/\/render()\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\n\/\/render()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust_d, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n cylinder(h = screwSpacerHeight \/ 4, r = setScrewRadius);\n translate([0, 0, screwSpacerHeight * .75])\n cylinder(h = screwSpacerHeight\/4, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight * 1.2]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight * .8], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\nsharpieDiameter = 13;\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = sharpieDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + sharpieDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"fa6c4196ab6baccbce7fe5da763b00220b1b19cc","subject":"add strain relief for lugs and wire, fix over height","message":"add strain relief for lugs and wire, fix over height\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/limit-switches\/limit-switch-large.scad","new_file":"openscad\/limit-switches\/limit-switch-large.scad","new_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, specifically this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100;\nEPSILON = 0.1;\n\n\nmodule switch_cover() {\n base_thick = 3; \/\/ Thickness of \"base\" plate\n base_ro = 2; \/\/ Outer radii of base plate\n \n \/\/ Switch dimensions\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10.2 + 0.8; \/\/ + space for sticky tape or wire\n \n \/\/ Nominal offset in y and x of the lower-left-corner\n \/\/ of the switch well.\n switch_off_d0 = 8;\n switch_off_w = 12;\n \n switch_r = 3; \/\/ inner radius of switch well \n top_gap_w = 18.5; \/\/ width of gap on the top, from LHS\n top_gap_d = 5; \/\/ depth (in y) of the top gap, from the top\n top_wall_thick = 3.5; \/\/ thickness (y) of top wall\n right_wall_thick = 3; \/\/ thickness (x) of right wall\n \n bottom_gap_w = 14; \/\/ width of bottom gap, from RHS\n bottom_gap_d = 11; \/\/ depth (in y) of bottom gap, from bottom\n\n \/\/ These are for screw holes\n hole_dist_x = 16; \/\/Distance of screw holes in x == Tetrix spacing\n hole_dist_y = 8; \/\/ Distance of scew holes in y == Lego spacing\n hole_wall_thick = 3; \/\/ Min thickness of walls around a hole\n hole_r = 2.05; \/\/ Just enough for 3\/32 (imperial) screws to slip through easily\n \n \/\/ Extension to the right for lugs & wire strain relief\n strain_r = 2;\n strain_w = 20; \/\/ x\n strain_d = 13; \/\/\/ y\n strain_h = base_thick + 1; \/\/ z. Extends slightly above base to be closer to lugs\n\n \/\/ These are minimum distances to check against when computing\n \/\/ how much deep (in y) to start the well for the switch - so that there is\n \/\/ enough space around each hole in the y-direction\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n\n top_gap_end_x = switch_off_w + top_gap_w;\n bottom_gap_end_x = switch_off_w + bottom_gap_w;\n bottom_gap_end_y = switch_off_d + bottom_gap_d;\n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_h;\n hole_x = hole_wall_thick + hole_r;\n hole_y = hole_wall_thick + hole_r;\n base_w = switch_off_w + switch_w + right_wall_thick; \/\/ thickness of base\n \n\n difference() {\n oblong(base_w, base_d, base_ro, tot_thick); \/\/ Starting block\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE); \/\/ remove switch well\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_end_x+EPSILON, LARGE, LARGE]); \/\/ remove top gap\n translate([bottom_gap_end_x, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_end_y + 2*EPSILON, LARGE]); \/\/ remove bottom gap\n translate([hole_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 1\n translate([hole_x, hole_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 2\n translate([hole_x + hole_dist_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE); \/\/ remove hole 3\n }\n \n \/\/ Add the strain relief extension\n strain_off_x = base_w - strain_r;\n strain_off_y = switch_off_d + (switch_d - strain_d)\/2;\n translate([strain_off_x, strain_off_y, 0])\n rotate([90, 0, 90]) oblong(strain_d, strain_h, strain_r, strain_w);\n}\n\nmodule trial1() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([LARGE, 18, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\nmodule trial2() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([30, LARGE, LARGE]);\n translate([35, -EPSILON, -EPSILON]) cube([35, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\nswitch_cover();\n\/\/translate([60, 0, 0]) trial1();\n\/\/translate([80, 0, 0]) trial2();","old_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, specifically this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100;\nEPSILON = 0.1;\n\n\nmodule switch_cover() {\n base_thick = 1; \/\/ Thickness of \"base\" plate\n base_ro = 2; \/\/ Outer radii of base plate\n switch_thick = 8;\n \n \/\/ Switch dimensions\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10 + 0.5; \/\/ for sticky tape or wire\n \n \/\/ Nominal offset in y and x of the lower-left-corner\n \/\/ of the switch well.\n switch_off_d0 = 8;\n switch_off_w = 12;\n \n switch_r = 3; \/\/ inner radius of switch well \n top_gap_w = 18.5; \/\/ width of gap on the top, from LHS\n top_gap_d = 5; \/\/ depth (in y) of the top gap, from the top\n top_wall_thick = 3.5; \/\/ thickness (y) of top wall\n right_wall_thick = 3; \/\/ thickness (x) of right wall\n \n bottom_gap_w = 14; \/\/ width of bottom gap, from RHS\n bottom_gap_d = 11; \/\/ depth (in y) of bottom gap, from bottom\n\n \/\/ These are for screw holes\n hole_dist_x = 16; \/\/Distance of screw holes in x == Tetrix spacing\n hole_dist_y = 8; \/\/ Distance of scew holes in y == Lego spacing\n hole_wall_thick = 3; \/\/ Min thickness of walls around a hole\n hole_r = 2.05; \/\/ Just enough for 3\/32 (imperial) screws to slip through easily\n \n \/\/ These are minimum distances to check against when computing\n \/\/ how much deep (in y) to start the well for the switch - so that there is\n \/\/ enough space around each hole in the y-direction\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n\n top_gap_end_x = switch_off_w + top_gap_w;\n bottom_gap_end_x = switch_off_w + bottom_gap_w;\n bottom_gap_end_y = switch_off_d + bottom_gap_d;\n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_thick;\n hole_x = hole_wall_thick + hole_r;\n hole_y = hole_wall_thick + hole_r;\n base_w = switch_off_w + switch_w + right_wall_thick; \/\/ thickness of base\n \n\n difference() {\n oblong(base_w, base_d, base_ro, tot_thick);\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE);\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_end_x+EPSILON, LARGE, LARGE]);\n translate([bottom_gap_end_x, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_end_y + 2*EPSILON, LARGE]);\n translate([hole_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole_x, hole_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole_x + hole_dist_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n }\n}\n\nmodule trial1() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([LARGE, 18, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\nmodule trial2() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([30, LARGE, LARGE]);\n translate([35, -EPSILON, -EPSILON]) cube([35, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\n\/\/switch_cover();\ntranslate([60, 0, 0]) trial1();\ntranslate([80, 0, 0]) trial2();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"431ccaedaae6888afe672dd03a98c0df4554987e","subject":"The include path was corrected.","message":"The include path was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/toys\/treasure-troll\/test\/treasure-troll-test.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/toys\/treasure-troll\/test\/treasure-troll-test.scad","new_contents":"\r\nuse <..\/treasure-troll.scad>\r\n\r\n\/\/ This next commented STL slowed OpenSCAD too much. So the Blender decimate too was used to reduce the number of faces.\r\n\/\/stlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\troll-doll-planter-1.stl\";\r\nstlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\treasure-troll-stl-to-openscad-via-blender-and-back-to-stl-2.stl\";\r\n\r\nshowOriginal = 0;\r\nshowHeadless = 0;\r\nshowHeadOnly = 1;\r\nshowTwoHeaded = 1;\r\n\r\nif(showOriginal == 1)\r\n{\r\n originalTroll(stlPath);\r\n}\r\n\r\nif(showHeadless == 1)\r\n{\r\n headlessTroll(stlPath);\r\n}\r\n\r\nif(showHeadOnly == 1)\r\n{\r\n trollHead(stlPath);\r\n}\r\n\r\nif(showTwoHeaded == 1)\r\n{\r\n twoHeadedTroll(stlPath);\r\n}\r\n","old_contents":"\r\nuse \r\n\r\n\/\/ This next commented STL slowed OpenSCAD too much. So the Blender decimate too was used to reduce the number of faces.\r\n\/\/stlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\troll-doll-planter-1.stl\";\r\nstlPath = \"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\toys\\\\treasure-troll\\\\ercin-gunduz\\\\treasure-troll-stl-to-openscad-via-blender-and-back-to-stl-2.stl\";\r\n\r\nshowOriginal = 0;\r\nshowHeadless = 0;\r\nshowHeadOnly = 1;\r\nshowTwoHeaded = 1;\r\n\r\nif(showOriginal == 1)\r\n{\r\n originalTroll(stlPath);\r\n}\r\n\r\nif(showHeadless == 1)\r\n{\r\n headlessTroll(stlPath);\r\n}\r\n\r\nif(showHeadOnly == 1)\r\n{\r\n trollHead(stlPath);\r\n}\r\n\r\nif(showTwoHeaded == 1)\r\n{\r\n twoHeadedTroll(stlPath);\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"cb56c425d38f2b70af35fe955fc3f5c0cd010eac","subject":"draft of reset button","message":"draft of reset button\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/reset_button.scad","new_file":"lcd_case_for_prusa_i3\/reset_button.scad","new_contents":"module resetButton()\n{\n cylinder(r=16\/2, h=15);\n \/\/ soldering pins:\n translate([0,0,-6])\n {\n translate([-2\/2+5,-3\/2,0])\n cube([2,3,6]);\n translate([-2\/2-5,-3\/2,0])\n cube([2,3,6]);\n }\n \/\/ mounting cap\n translate([0,0,15-2])\n cylinder(r=22\/2, h=2);\n \/\/ button's moving part\n translate([0,0,15])\n cylinder(r=16\/2-2, h=2);\n}\n\nresetButton();","old_contents":"","returncode":1,"stderr":"error: pathspec 'lcd_case_for_prusa_i3\/reset_button.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9f9bc44bbcfefbb6f47df4428993977bd48847e0","subject":"gears: add simple test","message":"gears: add simple test\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"gears.scad","new_file":"gears.scad","new_contents":"include \ninclude \ninclude \n\n\/\/ SPUR GEARS (all functions assume module\/mm system!)\n\/\/ From http:\/\/www.micro-machine-shop.com\/module_gear_data.pdf\n\/\/ Legend:\n\/\/ M Metric Module\n\/\/ C Circular Pitch (mm)\n\/\/ DP Diametral Pitch\n\/\/ N Number of teeth\n\/\/ OD Outside Diameter (mm)\n\/\/ DP Diametral Pitch\n\/\/ CP Circular Pitch\n\/\/ A Addendum\n\/\/ WD Whole Depth\n\nfunction spurgear_M_from_PD_N(PD,N) = PD\/N;\nfunction spurgear_M_from_C(C) = C\/PI;\nfunction spurgear_M_from_DP(DP) = 25.4\/DP;\nfunction spurgear_M_from_OD_N(OD, N) = OD\/(N+2);\n\nfunction spurgear_PD_from_M_N(M, N) = M*N;\nfunction spurgear_PD_from_N_OD(N, OD) = (OD*N)\/(N+2);\nfunction spurgear_PD_from_OD_M(OD, M) = OD-2*M;\n\nfunction spurgear_OD_from_M_N(M,N) = (N+2)*M;\n\nfunction spurgear_DP_from_M(M) = 25.4\/M;\n\nfunction spurgear_CP_from_M(M) = M*PI;\n\nfunction spurgear_A_from_M(M) = M;\n\n\/*function spurgear_WD_from_M(M) = let (DP = spurgear_DP_from_M(M)) DP>=20 ? (2.2\/DP+.002) : 2.157*M;*\/\nfunction spurgear_WD_from_M(M) = 2.157*M;\n\nfunction calc_gear_PD(gear) = get(GearMod,gear)*get(GearTeeth,gear);\nfunction calc_gear_OD(gear) = spurgear_OD_from_M_N(get(GearMod,gear),get(GearTeeth,gear));\n\n\/\/ CD = (PD1+PD1)\/2\nfunction calc_gears_center_distance(A, B) = (calc_gear_PD(A)+calc_gear_PD(B))\/2;\n\nif($test_mode)\n{\n assert_v(spurgear_M_from_DP(48), 0.529167);\n\n echo(calc_gear_PD(gear_60t_mod05));\n echo(calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05));\n\n for(i=[0:1:75])\n echo(i, spurgear_WD_from_M(i));\n}\n","old_contents":"include \ninclude \n\n\/\/ SPUR GEARS (all functions assume module\/mm system!)\n\/\/ From http:\/\/www.micro-machine-shop.com\/module_gear_data.pdf\n\/\/ Legend:\n\/\/ M Metric Module\n\/\/ C Circular Pitch (mm)\n\/\/ DP Diametral Pitch\n\/\/ N Number of teeth\n\/\/ OD Outside Diameter (mm)\n\/\/ DP Diametral Pitch\n\/\/ CP Circular Pitch\n\/\/ A Addendum\n\/\/ WD Whole Depth\n\nfunction spurgear_M_from_PD_N(PD,N) = PD\/N;\nfunction spurgear_M_from_C(C) = C\/PI;\nfunction spurgear_M_from_DP(DP) = 25.4\/DP;\nfunction spurgear_M_from_OD_N(OD, N) = OD\/(N+2);\n\nfunction spurgear_PD_from_M_N(M, N) = M*N;\nfunction spurgear_PD_from_N_OD(N, OD) = (OD*N)\/(N+2);\nfunction spurgear_PD_from_OD_M(OD, M) = OD-2*M;\n\nfunction spurgear_OD_from_M_N(M,N) = (N+2)*M;\n\nfunction spurgear_DP_from_M(M) = 25.4\/M;\n\nfunction spurgear_CP_from_M(M) = M*PI;\n\nfunction spurgear_A_from_M(M) = M;\n\n\/*function spurgear_WD_from_M(M) = let (DP = spurgear_DP_from_M(M)) DP>=20 ? (2.2\/DP+.002) : 2.157*M;*\/\nfunction spurgear_WD_from_M(M) = 2.157*M;\n\nfunction calc_gear_PD(gear) = get(GearMod,gear)*get(GearTeeth,gear);\nfunction calc_gear_OD(gear) = spurgear_OD_from_M_N(get(GearMod,gear),get(GearTeeth,gear));\n\n\/\/ CD = (PD1+PD1)\/2\nfunction calc_gears_center_distance(A, B) = (calc_gear_PD(A)+calc_gear_PD(B))\/2;\n\nif(false)\n{\n echo(calc_gear_PD(gear_60t_mod05));\n echo(calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05));\n\n for(i=[0:1:75])\n echo(i, spurgear_WD_from_M(i));\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8725280ece562619011e76d2d64e8e98b9baf554","subject":"initial model of the coin","message":"initial model of the coin\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"qiabasz\/qiabasz.scad","new_file":"qiabasz\/qiabasz.scad","new_contents":"eps = 0.01;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n\/\/ mirror([1,0,0])\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\n\ndifference()\n{\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n}\n#qiagen_logo();\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'qiabasz\/qiabasz.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"68c114c80d99c29e9b2ae0b83036825c9412f827","subject":"Added fn variable to add more sides to circles (for rounded corners), now set to 100","message":"Added fn variable to add more sides to circles (for rounded corners), now set to 100\n","repos":"btcspry\/3d-wallet-generator","old_file":"scad\/roundCornersCube.scad","new_file":"scad\/roundCornersCube.scad","new_contents":"$fn=100;\nmodule createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,center=true);}\nmodule roundCornersCube(x,y,z)translate([x\/2,y\/2,z\/2]){difference(){r=((x+y)\/2)*0.052;cube([x,y,z],center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}}","old_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,center=true);}\nmodule roundCornersCube(x,y,z)translate([x\/2,y\/2,z\/2]){difference(){r=((x+y)\/2)*0.052;cube([x,y,z],center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e412879ab7a0599694312eac38875231df121c26","subject":"bolt heads on the top","message":"bolt heads on the top\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1_board.scad","new_file":"3d\/enclosure_v1_board.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n\tdifference() {\n\t cube([box_x, box_y, board_h + eps], false);\n\t translate([board_w, board_w, -eps]) {\n\t\tcube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n\t }\n\t}\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n\tdifference() {\n\t cube([box_x, box_y, board_h + eps], false);\n\t translate([board_w, board_w, -eps]) {\n\t\tcube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n\t }\n\t}\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"339e2508a3f96e618c02fb1356970c2e3a1af9dc","subject":"Commented code was removed.","message":"Commented code was removed.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/pencil-holder-with-cutouts\/rows\/one-row-single-charm\/one-row-single-charm.scad","new_file":"OpenSCAD\/pencil-holder-with-cutouts\/rows\/one-row-single-charm\/one-row-single-charm.scad","new_contents":"\r\nuse <..\/..\/..\/shapes\/cup\/cup.scad>;\r\nuse <..\/..\/..\/cutouts\/rotated-spiral-cutouts.scad>;\r\n\r\ncharmCount = 6;\r\n\r\ndifference()\r\n{\r\n\tcup();\r\n\t\r\n\tpropossedRotatedSpiralCutout(charmCount = 6,\r\n\t\t\t\t\t\t\t\t xyScale = 0.125,\r\n\t\t\t\t\t\t\t\t charmStl = \"..\/..\/..\/shapes\/spurs\/spurs-a.stl\",\r\n\t\t\t\t\t\t\t\t yTranslateFactor = 0,\r\n\t\t\t\t\t\t\t\t yTranslateMinimum = 35,\r\n\t\t\t\t\t\t\t\t zRotationFactor = 360.0 \/ charmCount);\r\n}","old_contents":"\r\nuse <..\/..\/..\/shapes\/cup\/cup.scad>;\r\nuse <..\/..\/..\/cutouts\/rotated-spiral-cutouts.scad>;\r\n\r\ncharmCount = 6;\r\n\r\ndifference()\r\n{\r\n\tcup();\r\n\r\n\/\/\toriginalRotatedSpiralCutout(verticalSpacingFromBottom=35);\r\n\t\r\n\tpropossedRotatedSpiralCutout(charmCount = 6,\r\n\t\t\t\t\t\t\t\t xyScale = 0.125,\r\n\t\t\t\t\t\t\t\t charmStl = \"..\/..\/..\/shapes\/spurs\/spurs-a.stl\",\r\n\t\t\t\t\t\t\t\t yTranslateFactor = 0,\r\n\t\t\t\t\t\t\t\t yTranslateMinimum = 35,\r\n\t\t\t\t\t\t\t\t zRotationFactor = 360.0 \/ charmCount);\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ea6916315667c64e9f0cc06fd4826d763246ec44","subject":"refactor","message":"refactor\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n\/\/PICK UP HERE\n\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n\/\/ halfCirclePhoneStand_stand_connectorBar();\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar()\n{\n cube([40, 5, 5]);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = 4.2; \n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar();\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar()\n{\n \n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ec42a8c1ab9d7aab73ebc86340277c23f0d3e704","subject":"Suika frame","message":"Suika frame\n","repos":"DanNixon\/BubbleCopter,DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/Multirotors","old_file":"Suika\/frame_main.scad","new_file":"Suika\/frame_main.scad","new_contents":"MOTOR_DIST_X = 37.5;\nMOTOR_DIST_Y = 37.5;\nMOTOR_DIAMETER = 6.9;\n\nWIRING_HOLE_OFFSET = 0.7;\nWIRING_HOLE_DIAMETER = 2;\n\nARM_WIDTH = 11;\nPLATE_DIMENSIONS = [30, 45];\n\nZIP_TIE_HOLE_OFFSETS = [0.15, 0.4, 0.6, 0.85];\nZIP_TIE_HOLE_DIAM = 3;\n\n\nmodule MainPlate()\n{\n motor_positions = [\n [MOTOR_DIST_X, MOTOR_DIST_Y],\n [-MOTOR_DIST_X, MOTOR_DIST_Y],\n [MOTOR_DIST_X, -MOTOR_DIST_Y],\n [-MOTOR_DIST_X, -MOTOR_DIST_Y]\n ];\n\n module Plate()\n {\n square(PLATE_DIMENSIONS, center=true);\n }\n\n module MotorCross()\n {\n for(p=motor_positions)\n {\n hull()\n {\n circle(d=ARM_WIDTH);\n translate(p)\n circle(d=ARM_WIDTH);\n }\n }\n }\n\n module MotorMountingHoles()\n {\n for(p=motor_positions)\n {\n translate(p)\n circle(d=MOTOR_DIAMETER);\n\n translate(p * WIRING_HOLE_OFFSET)\n circle(d=WIRING_HOLE_DIAMETER);\n }\n }\n\n module Cutouts()\n {\n half_dim = PLATE_DIMENSIONS \/ 2;\n translate(-half_dim)\n {\n for(i=ZIP_TIE_HOLE_OFFSETS)\n {\n translate([PLATE_DIMENSIONS[0] * 0.85, PLATE_DIMENSIONS[1] * i])\n circle(d=ZIP_TIE_HOLE_DIAM);\n translate([PLATE_DIMENSIONS[0] * 0.15, PLATE_DIMENSIONS[1] * i])\n circle(d=ZIP_TIE_HOLE_DIAM);\n }\n }\n }\n\n difference()\n {\n union()\n {\n Plate();\n MotorCross();\n }\n\n union()\n {\n MotorMountingHoles();\n Cutouts();\n }\n }\n}\n\n\nmodule MotorRetentionClips()\n{\n difference()\n {\n circle(d=ARM_WIDTH);\n circle(d=MOTOR_DIAMETER);\n }\n}\n\n\n$fs = 2;\nMainPlate();\ntranslate([0, (PLATE_DIMENSIONS[1] \/ 2) + 10])\n MotorRetentionClips();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Suika\/frame_main.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"65109fe7b95d427ee146a1cb6cb4be6f5d8bf0c5","subject":"config: remove zaxis rod offset in X","message":"config: remove zaxis rod offset in X\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\ngantry_upper_offset_y = -25;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=1;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10L;\nxaxis_bearing_bottom = LinearBearingLM10;;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = 5*mm;\n\nyaxis_motor_offset_z = yaxis_belt_path_offset_z - 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_offset =\n Z*get(LinearBearingInnerDiameter, yaxis_bearing)\/2;\n\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,0*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n [NemaAxleFlatDepth, 0*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3.5;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\ngantry_upper_offset_y = -25;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=1;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10L;\nxaxis_bearing_bottom = LinearBearingLM10;;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = 5*mm;\n\nyaxis_motor_offset_z = yaxis_belt_path_offset_z - 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_offset =\n Z*get(LinearBearingInnerDiameter, yaxis_bearing)\/2;\n\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n [NemaAxleFlatDepth, 0*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3.5;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"837805693e480b32b6ea2b6af3523d03bccfdeb9","subject":"added 3d printed box","message":"added 3d printed box\n","repos":"mixbe\/arduinoyun-sounddetector,mixbe\/arduinoyun-sounddetector","old_file":"3d-printed-box\/box.scad","new_file":"3d-printed-box\/box.scad","new_contents":"$fn=80; \/\/ resolutie (zet lager om te debuggen)\n\nthickness = 1.5;\nbottom_thickness = 1.05;\nwidth = 100;\ndepth = 185;\nheight = 35;\n\nfudge = 12.1;\n\nxlr_diameter = 24;\n\nxlr_srew_diameter = 3.53;\nxlr_width = 26.03;\nxlr_height = 31.04;\nxlr_srew_distance_from_side = 1.80;\nxlr_screw_centerdistance_width = xlr_width\/2 - xlr_srew_distance_from_side - xlr_srew_diameter\/2;\nxlr_screw_centerdistance_height = xlr_height\/2 - xlr_srew_distance_from_side - xlr_srew_diameter\/2;\n\n\nyun_bottom_offset = 6.00;\nyun_pcb_thickness = 1.67;\nyun_connector_offset = yun_bottom_offset + yun_pcb_thickness;\n\nxlr_spacing = 2;\nxlr_distance = xlr_width + xlr_spacing;\n\n\n\n\nmodule gat (){\n\ttranslate([0,0,-(thickness+fudge)\/2]) cylinder(thickness+fudge,d=xlr_diameter,true);\n\ttranslate([xlr_screw_centerdistance_width,12.5,-(thickness+fudge)\/2]) cylinder(thickness+fudge,d=xlr_srew_diameter,true);\n\ttranslate([-xlr_screw_centerdistance_width,-12.5,-(thickness+fudge)\/2]) cylinder(thickness+fudge,d=xlr_srew_diameter,true);\n}\n\n\n\n\n\n\n\n\/\/left side:\ntranslate([-depth\/2, -width\/2, 0]) cube([depth, thickness, height]);\n\/\/right side:\ntranslate([-depth\/2, width\/2-thickness, 0]) {\n\tdifference() {\n\n \t\tcube([depth, thickness, height]);\n\t\tfor ( i = [0 : 5] ) {\n\t\t\ttranslate([(-xlr_distance\/2+xlr_distance*6)+(depth-6*xlr_distance)\/2-i*xlr_distance, 0, 18]) rotate(a=[90,0,0]) gat();\n\t\t}\n\n\t}\n}\n\/\/back:\ntranslate([-depth\/2, -width\/2, 0]) cube([thickness, width, height]);\n\n\/\/ bottom:\ntranslate([-depth\/2, -width\/2, 0]) cube([depth, width, bottom_thickness]);\n\n\n\/\/front:\n\n\n\nethernet_ypos = -width\/2+thickness+16;\ndifference() {\n\n\t\/\/ plate:\n\ttranslate([depth\/2-thickness, -width\/2, 0]) cube([thickness, width, height]);\n\n\n\t\/\/ holes:\n\n\t\/\/ ehternet hole\n\ttranslate([depth\/2-20, ethernet_ypos, yun_connector_offset]) cube([40, 16.20, 14]);\n\n\t\/\/ micro usb hole:\n\ttranslate([depth\/2-20, ethernet_ypos+24.32, yun_connector_offset]) cube([40, 8.02, 4]);\n\n\t\/\/ usb hole\n\ttranslate([depth\/2-20, ethernet_ypos+35.56, yun_connector_offset]) cube([40, 7, 15]);\n\n}\n\n\n\/\/ support holes:\nsupportholes_height = yun_bottom_offset;\nmodule supporthole(){\n\ttranslate([0,0,supportholes_height\/2]){\n\t\tdifference() {\n\t\t\tcylinder(h=supportholes_height, d=5, center=true);\n\t\t\tcylinder(h=supportholes_height*2, d=2.1, center=true);\n\t\t}\n\t}\n}\n\n\/\/ voorste:\ntranslate([depth\/2-thickness-13.83, ethernet_ypos-2.28, bottom_thickness]) supporthole();\ntranslate([depth\/2-thickness-13.83, ethernet_ypos+45.39, bottom_thickness]) supporthole();\n\n\/\/ achterste:\ntranslate([depth\/2-thickness-65.88, ethernet_ypos+12.51, bottom_thickness]) supporthole();\ntranslate([depth\/2-thickness-65.88, ethernet_ypos+12.51+28.07, bottom_thickness]) supporthole();\n\n\n\n\nmodule lidhole(height){\n\ttranslate([0,0,height\/2]) difference() {\n\t\tcube(size=[5,5,height], center=true);\n\t\tcylinder(h=height*2, d=2.1, center=true);\n\t}\n}\n\ntranslate([(depth\/2-5\/2-thickness),+(width\/2-5\/2-thickness),0]) lidhole(height);\ntranslate([(depth\/2-5\/2-thickness),-(width\/2-5\/2-thickness),0]) lidhole(height);\n\ntranslate([-(depth\/2-5\/2-thickness),+(width\/2-5\/2-thickness),0]) lidhole(height);\ntranslate([-(depth\/2-5\/2-thickness),-(width\/2-5\/2-thickness),0]) lidhole(height);\n\n\n\n\n\n\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d-printed-box\/box.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"934d70bd9658003376fb2e581f03c250878fd2f7","subject":"shoe drying box","message":"shoe drying box\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"ShoeDryingBox.scad","new_file":"ShoeDryingBox.scad","new_contents":"\/\/Modules\nmodule cut() {\n square([16,10.5]);\n translate([134,0])square([16,10.5]);\n translate([134+139,0])square([16,10.5]);\n}\nmodule fanCut() {\n tr_xy(x=20)circle(r=1.5);\n circle(r=10);\n}\n\/\/Translations\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'ShoeDryingBox.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"18ab4309aedaf411247b6987366256c28d063929","subject":"baseline","message":"baseline\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/connectors\/rounded-corners-square\/end-cap\/rounded-corner-end-cap.scad","new_file":"openscad\/models\/src\/main\/openscad\/connectors\/rounded-corners-square\/end-cap\/rounded-corner-end-cap.scad","new_contents":" \nuse <..\/..\/..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\n\nboardLength = 150;\nboardWidth = 100;\nsize = [boardLength, boardWidth, 1];\n\nroundedCube(cornerRadius = 5,\n sides=20,\n sidesOnly=true,\n size=size);\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/models\/src\/main\/openscad\/connectors\/rounded-corners-square\/end-cap\/rounded-corner-end-cap.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a33f1c6432bdc28e8f66b0d360a04bafc18d02c4","subject":"Add shape pipeSegment","message":"Add shape pipeSegment\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/ellipsoid.scad","new_file":"shape\/3D\/ellipsoid.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Ellipsoid shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of an ellipsoid.\n *\n * @param Number|Vector [r] - The radius or a vector that contains 3D radius.\n * @param Number|Vector [d] - The diameter or a vector that contains 3D diameters.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns a vector containing the 3D radius.\n *\/\nfunction sizeEllipsoid(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n \/\/ use divisor() to ensure the values will be forced to anything but 0\n divisor(d[0] && !rx ? d[0] \/ 2 : r[0]),\n divisor(d[1] && !ry ? d[1] \/ 2 : r[1]),\n divisor(d[2] && !rz ? d[2] \/ 2 : r[2])\n ]\n;\n\n\/**\n * Creates a shaft (extruded ellipse) at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains length and width radius.\n * @param Number|Vector [d] - The diameter or a vector that contains length and width diameters.\n * @param Number [h] - The height of the shaft.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [dx] - The length of the shaft.\n * @param Number [dy] - The width of the shaft.\n * @param Boolean [center] - Whether or not center the shaft on the vertical axis.\n *\/\nmodule shaft(r, h, d, rx, ry, dx, dy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n ellipse(size);\n }\n}\n\n\/**\n * Creates a wedge (extruded pie slice) at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains length and width radius.\n * @param Number|Vector [d] - The diameter or a vector that contains length and width diameters.\n * @param Number [h] - The height of the wedge.\n * @param Number [a] - The angle of the wedge\n * @param Number [a1] - The start angle of the wedge\n * @param Number [a2] - The end angle of the wedge\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [dx] - The length of the wedge.\n * @param Number [dy] - The width of the wedge.\n * @param Boolean [center] - Whether or not center the wedge on the vertical axis.\n *\/\nmodule wedge(r, h, a=90, d, a1, a2, rx, ry, dx, dy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n pie(size, a=a, a1=a1, a2=a2);\n }\n}\n\n\/**\n * Creates an ellipsoid at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains 3D radius.\n * @param Number|Vector [d] - The diameter or a vector that contains 3D diameters.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n *\/\nmodule ellipsoid(r, d, rx, ry, rz, dx, dy, dz) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=rz, dx=dx, dy=dy, dz=dz);\n r = max(size);\n scale(size \/ r) {\n sphere(r);\n }\n}\n\n\/**\n * Creates a pipe at the origin.\n *\n * @param Number|Vector [r] - The radius of the pipe or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the pipe.\n * @param Number [h] - The height of the pipe.\n * @param Number|Vector [d] - The diameter of the pipe or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the pipe hole.\n * @param Number [wy] - The vertical thickness of the pipe hole.\n * @param Boolean [center] - Whether or not center the pipe on the vertical axis.\n *\/\nmodule pipe(r, h, w=0.1, d, rx, ry, dx, dy, wx, wy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n ring(r=size, w=w, wx=wx, wy=wy);\n }\n}\n\n\/**\n * Creates a pipe segment at the origin.\n *\n * @param Number|Vector [r] - The radius of the pipe or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the pipe.\n * @param Number [h] - The height of the pipe.\n * @param Number|Vector [d] - The diameter of the pipe or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the pipe hole.\n * @param Number [wy] - The vertical thickness of the pipe hole.\n * @param Boolean [center] - Whether or not center the pipe on the vertical axis.\n *\/\nmodule pipeSegment(r, h, w=0.1, a=90, d, a1, a2, rx, ry, dx, dy, wx, wy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n ringSegment(r=size, a=a, a1=a1, a2=a2, w=w, wx=wx, wy=wy);\n }\n}\n\n\/**\n * Creates a torus at the origin.\n * Note: the tore can be deformed if the ring is not perfectly circular.\n *\n * @param Number|Vector [r] - The radius of the torus ring or a vector that contains 3D radius.\n * @param Number|Vector [d] - The diameter of the torus ring or a vector that contains 3D diameters.\n * @param Number|Vector [w] - The radius of the torus pipe.\n * @param Number|Vector [W] - The diameter of the torus pipe.\n * @param Number [rx] - The length radius of the torus ring.\n * @param Number [ry] - The width radius of the torus ring.\n * @param Number [dx] - The length diameter of the torus ring.\n * @param Number [dy] - The width diameter of the torus ring.\n * @param Number [wx] - The length radius of the torus pipe.\n * @param Number [wy] - The width radius of the torus pipe.\n * @param Number [Wx] - The length diameter of the torus pipe.\n * @param Number [Wy] - The width diameter of the torus pipe.\n * @param Boolean [center] - Whether or not center the torus on the vertical axis.\n *\/\nmodule torus(r, w=0.1, d, W, rx, ry, dx, dy, wx, wy, Wx, Wy, center) {\n sizeRing = sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy);\n sizePipe = sizeEllipse(r=w, d=W, rx=wx, ry=wy, dx=Wx, dy=Wy);\n\n translate([0, 0, center ? 0 : sizePipe[1]]) {\n resize(apply3D(vadd(sizeRing, sizePipe[0]), z=sizePipe[1]) * 2) {\n rotate_extrude(convexity=10) {\n translate([max(sizeRing) - sizePipe[0], 0, 0]) {\n ellipse(sizePipe);\n }\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Ellipsoid shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of an ellipsoid.\n *\n * @param Number|Vector [r] - The radius or a vector that contains 3D radius.\n * @param Number|Vector [d] - The diameter or a vector that contains 3D diameters.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns a vector containing the 3D radius.\n *\/\nfunction sizeEllipsoid(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n \/\/ use divisor() to ensure the values will be forced to anything but 0\n divisor(d[0] && !rx ? d[0] \/ 2 : r[0]),\n divisor(d[1] && !ry ? d[1] \/ 2 : r[1]),\n divisor(d[2] && !rz ? d[2] \/ 2 : r[2])\n ]\n;\n\n\/**\n * Creates a shaft (extruded ellipse) at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains length and width radius.\n * @param Number|Vector [d] - The diameter or a vector that contains length and width diameters.\n * @param Number [h] - The height of the shaft.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [dx] - The length of the shaft.\n * @param Number [dy] - The width of the shaft.\n * @param Boolean [center] - Whether or not center the shaft on the vertical axis.\n *\/\nmodule shaft(r, h, d, rx, ry, dx, dy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n ellipse(size);\n }\n}\n\n\/**\n * Creates a wedge (extruded pie slice) at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains length and width radius.\n * @param Number|Vector [d] - The diameter or a vector that contains length and width diameters.\n * @param Number [h] - The height of the wedge.\n * @param Number [a] - The angle of the wedge\n * @param Number [a1] - The start angle of the wedge\n * @param Number [a2] - The end angle of the wedge\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [dx] - The length of the wedge.\n * @param Number [dy] - The width of the wedge.\n * @param Boolean [center] - Whether or not center the wedge on the vertical axis.\n *\/\nmodule wedge(r, h, a=90, d, a1, a2, rx, ry, dx, dy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n pie(size, a=a, a1=a1, a2=a2);\n }\n}\n\n\/**\n * Creates an ellipsoid at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains 3D radius.\n * @param Number|Vector [d] - The diameter or a vector that contains 3D diameters.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n *\/\nmodule ellipsoid(r, d, rx, ry, rz, dx, dy, dz) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=rz, dx=dx, dy=dy, dz=dz);\n r = max(size);\n scale(size \/ r) {\n sphere(r);\n }\n}\n\n\/**\n * Creates a pipe at the origin.\n *\n * @param Number|Vector [r] - The radius of the pipe or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the pipe.\n * @param Number [h] - The height of the pipe.\n * @param Number|Vector [d] - The diameter of the pipe or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the pipe hole.\n * @param Number [wy] - The vertical thickness of the pipe hole.\n * @param Boolean [center] - Whether or not center the pipe on the vertical axis.\n *\/\nmodule pipe(r, h, w=0.1, d, rx, ry, dx, dy, wx, wy, center) {\n size = sizeEllipsoid(r=r, d=d, rx=rx, ry=ry, rz=h, dx=dx, dy=dy);\n linear_extrude(height=size[2], center=center, convexity=10) {\n ring(r=size, w=w, wx=wx, wy=wy);\n }\n}\n\n\/**\n * Creates a torus at the origin.\n * Note: the tore can be deformed if the ring is not perfectly circular.\n *\n * @param Number|Vector [r] - The radius of the torus ring or a vector that contains 3D radius.\n * @param Number|Vector [d] - The diameter of the torus ring or a vector that contains 3D diameters.\n * @param Number|Vector [w] - The radius of the torus pipe.\n * @param Number|Vector [W] - The diameter of the torus pipe.\n * @param Number [rx] - The length radius of the torus ring.\n * @param Number [ry] - The width radius of the torus ring.\n * @param Number [dx] - The length diameter of the torus ring.\n * @param Number [dy] - The width diameter of the torus ring.\n * @param Number [wx] - The length radius of the torus pipe.\n * @param Number [wy] - The width radius of the torus pipe.\n * @param Number [Wx] - The length diameter of the torus pipe.\n * @param Number [Wy] - The width diameter of the torus pipe.\n * @param Boolean [center] - Whether or not center the torus on the vertical axis.\n *\/\nmodule torus(r, w=0.1, d, W, rx, ry, dx, dy, wx, wy, Wx, Wy, center) {\n sizeRing = sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy);\n sizePipe = sizeEllipse(r=w, d=W, rx=wx, ry=wy, dx=Wx, dy=Wy);\n\n translate([0, 0, center ? 0 : sizePipe[1]]) {\n resize(apply3D(vadd(sizeRing, sizePipe[0]), z=sizePipe[1]) * 2) {\n rotate_extrude(convexity=10) {\n translate([max(sizeRing) - sizePipe[0], 0, 0]) {\n ellipse(sizePipe);\n }\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c267bfd244c828487b656718b7e3d2a0b12ca7a9","subject":"shapes\/fncylindera: fix r1\/r2 and d1\/d2 params","message":"shapes\/fncylindera: fix r1\/r2 and d1\/d2 params\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[10,10,10], facets=32, rounding_radius=1)\n{\n translate(-size\/2)\n hull()\n {\n translate([rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n }\n}\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_r = r__;\n\n fn_=fn==undef?(floor(2*(r__)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n\/*fncylindera(h=10, r1=5, r2=10, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\/*fncylindera(h=10, d1=5, d2=30, orient=[0,0,1], align=[0,0,1]);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[10,10,10], facets=32, rounding_radius=1)\n{\n translate(-size\/2)\n hull()\n {\n translate([rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n }\n}\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r_*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bcd0b2290e63549846ccbd90e4b34b961ed20232","subject":"shapes: add rtriangle","message":"shapes: add rtriangle\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/*triangle_a(45, 5, 5);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(10, 15, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d2f78cebe3aa15fcddae4b65a26a5422cb225258","subject":"attach: cleanup and add support for show_conn and explode","message":"attach: cleanup and add support for show_conn and explode\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"attach.scad","new_file":"attach.scad","new_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/ ATTACH OPERATOR\n\/\/ This operator applies the necessary transformations to the\n\/\/ child (attachable part) so that it is attached to the main part\n\/\/ Parameters\n\/\/ a: Connector of the main part\n\/\/ b: Connector of the attachable part\n\/\/ explode: extra translation between parts (child moved away from parent)\n\/\/ roll:\n\/\/ rollaxis:\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis)\n{\n \/\/ Get the data from the connectors\n \/\/ Attachment point. Main part\n pos1 = a[0];\n \/\/ Attachment axis. Main part\n v = a[1];\n\n \/\/ Attachment point. Attachable part\n pos2 = b[0];\n \/\/ Atachment axis. Attachable part\n vref = b[1];\n\n \/\/ Calculations for the \"orientate operator\"\n \/\/ Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/ Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/ Apply the transformations to the child\n\n \/\/ Place the attachable part on the main part attachment point\n t(pos1)\n \/\/ Orientate operator. Apply the orientation so that\n \/\/ both attachment axis are paralell. Also apply the roll angle\n r(a=roll, v=rollaxis==U?v:rollaxis)\n r(a=ang, v=raxis_)\n \/\/ Attachable part to the origin\n t(-pos2)\n t(-$explode==U?0:$explode*vref)\n {\n children();\n\n if($show_conn)\n connector([b.x, -b.y]);\n }\n\n if($show_conn)\n connector(a);\n}\n\nif(false)\n{\n s=[10,10,10];\n\n conn = [X*s.x\/2,X];\n\n \/*connector(conn);*\/\n cubea(s);\n attach(conn, -conn, $explode=2)\n spherea(d=s.x);\n}\n\n","old_contents":"include \nuse \nuse ;\nuse \n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0, rollaxis)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=rollaxis==U?v:rollaxis) rotate(a=ang, v=raxis_)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"fd12a31e3a7c1cb24c13198aa4b3f113788c5f27","subject":"x\/carriage: use te (translate_explode)","message":"x\/carriage: use te (translate_explode)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n fanduct();\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n te(extruder_offset_a, explode)\n extruder_a();\n\n te(extruder_offset_b, explode)\n extruder_b();\n\n te(extruder_offset_b, explode)\n te(hotend_mount_offset, explode)\n hotend_clamp();\n\n te(extruder_offset_b, explode)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn)\n x_extruder_hotend();\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=true);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n fanduct();\n }\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=true);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c6806c98f1ea11c40bb0c51df04098cb7c23faf6","subject":"Add option to center in repeatShape","message":"Add option to center in repeatShape\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/translate.scad","new_file":"operator\/repeat\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n * @param Boolean [center] - Whether or not center the repeated shapes\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n translate(center ? -vmul(size, count - [1, 1]) \/ 2 : 0) {\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0]\n ) {\n children();\n }\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n * @param Boolean [center] - Whether or not center the repeated shapes\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n translate(center ? -vmul(size, count - [1, 1, 1]) \/ 2 : 0) {\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]]\n ) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n *\/\nmodule repeatShape2D(size, count = 1) {\n size = vector2D(size);\n count = vector2D(count);\n\n translate(-vmul(size, count - [1, 1]) \/ 2) {\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0]\n ) {\n children();\n }\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n *\/\nmodule repeatShape3D(size, count = 1) {\n size = vector3D(size);\n count = vector3D(count);\n\n translate(-vmul(size, count - [1, 1, 1]) \/ 2) {\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]]\n ) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c2b513d3bb8a8b070c600d598c6a29c7b06122c3","subject":"Add operator repeatShape3D","message":"Add operator repeatShape3D\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/translate.scad","new_file":"operator\/repeat\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape on two directions.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n *\/\nmodule repeatShape2D(size, count = 1) {\n size = vector2D(size);\n count = vector2D(count);\n\n translate(-vmul(size, count - [1, 1]) \/ 2) {\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0]\n ) {\n children();\n }\n }\n}\n\n\/**\n * Repeats a shape on three directions.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n *\/\nmodule repeatShape3D(size, count = 1) {\n size = vector3D(size);\n count = vector3D(count);\n\n translate(-vmul(size, count - [1, 1, 1]) \/ 2) {\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]]\n ) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape on two directions.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n *\/\nmodule repeatShape2D(size, count = 1) {\n size = vector2D(size);\n count = vector2D(count);\n\n translate(-vmul(size, count - [1, 1]) \/ 2) {\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0]\n ) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5ab3b8c66f12da7838f9948b47186cdc37e151f0","subject":"screw: misc fixes","message":"screw: misc fixes\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6305b0a5f2b582c49d02ca17ff14a3ca89bc8f26","subject":"x\/carriage: reduce width slightly","message":"x\/carriage: reduce width slightly\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2ef8ee5e47a0c0c82035305589ea4c0141268552","subject":"config: cosmetics","message":"config: cosmetics\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"16c5163cc7af665d562979dd2e68a051220feb33","subject":"feat: set a default color for the simple test elements","message":"feat: set a default color for the simple test elements\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [size] - The size of the element.\n *\/\nmodule testElement(c=\"red\", size=1) {\n color(c) {\n cube(size);\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element.\n * @param String|Vector c - The color of the element.\n * @param Number|Vector size - The size of the element.\n *\/\nmodule testElement(c, size=1) {\n color(c) {\n cube(size);\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6c3bc84a36dfe30ebaa38a48ed0f9fa5274221d0","subject":"Updating example-010","message":"Updating example-010\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"readme\/example-010.scad","new_file":"readme\/example-010.scad","new_contents":"include <..\/lasercut.scad>; \n\n\/\/ From http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n\n$fn=60;\nthickness = 3.1;\nx = 50;\ny = 75;\nx_beam = 20;\n\nmodule beam()\n{\n lasercutoutSquare(thickness=thickness, x=x_beam, y=y,\n twist_connect=[\n [RIGHT,x\/2,y\/2]\n ]\n );\n}\n\nmodule crossBeam()\n{\n rotate([90,0,0]) \n lasercutoutSquare(thickness=thickness, x=x, y=y,\n twist_holes=[\n [RIGHT, x\/2, y*3\/4, x_beam],\n [UP, x\/2, y\/4, x_beam]\n ]\n );\n}\n\n\nrotate([-90,0,0]) crossBeam();\ntranslate([x+thickness,0,0]) beam();\n\ntranslate([0,y+50,0]) crossBeam();\ntranslate([x\/2-thickness\/2,y\/2+50-thickness\/2,y*3\/4+x_beam\/2]) rotate([0,90,0]) beam();\ntranslate([(x-x_beam)\/2,y\/2+50-thickness,y*1\/4-thickness\/2]) rotate([0,0,0]) beam();\n\n","old_contents":"include <..\/lasercut.scad>; \n\n\/\/ From http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n\n$fn=60;\nthickness = 3.1;\nx = 50;\ny = 75;\nx_beam = 20;\n\nmodule beam()\n{\n lasercutoutSquare(thickness=thickness, x=x_beam, y=y,\n twist_connect=[\n [RIGHT,x\/2,y\/2]\n ]\n );\n}\n\nmodule crossBeam()\n{\n rotate([90,0,0]) \n lasercutoutSquare(thickness=thickness, x=x, y=y,\n twist_holes=[\n [RIGHT, x\/2, y*3\/4, x_beam],\n [UP, x\/2, y\/4, x_beam]\n ]\n );\n}\n\n\nrotate([-90,0,0]) crossBeam();\ntranslate([x+thickness,0,0]) beam();\n\n\ntranslate([0,y+50,0]) crossBeam();\ntranslate([x\/2-thickness\/2,y\/2+50-thickness\/2,y*3\/4+x_beam\/2]) rotate([0,90,0]) beam();\n\ntranslate([(x-x_beam)\/2,y\/2+50-thickness,y*1\/4-thickness\/2]) rotate([0,0,0]) beam();\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"79e8ddd09d645cbdc88d856f5782d4c2ecea4de9","subject":"3d: wider master buttons","message":"3d: wider master buttons\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"use \n\ntol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th + 0.5;\nshift_y = th + 0.5;\n\nbox_x = pcb_x + 2*th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 1.8;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36.5;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 30;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\nround_radius=2;\n\ntranslate([0,0,-50]) {\n\n\/\/ put exclamation mark here to render bottom\ndifference() {\n union() {\n difference() {\n union() {\n cubeBottomX([box_x, box_y, bottom_box_z-board_h], radius=round_radius);\n translate([th - board_w, th - board_w, 0]) {\n cubeBottomX([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], radius=round_radius);\n }\n }\n translate([th, th, th]) {\n cubeBottomX([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], radius=round_radius);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 5;\npcb_room = 1;\nscreen_start_x = shift_x + 11.5;\nscreen_start_y = shift_y + 25;\nscreen_length_x = 77;\nscreen_length_y = 50.5;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 19;\nmaster_button_int = 31.5;\nmaster_button_r = 6.5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\n\n\/\/ put exclamation mark here to render top\n!rotate(a=[180,0,0]) {\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cubeSideX(size=[box_x, box_y, board_h + eps], radius=round_radius, center=false);\n translate([board_w, board_w, -eps]) {\n cubeSideX(size=[box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], radius=round_radius, center=false);\n }\n }\n }\n difference() {\n cubeTopX(size=[box_x,box_y,top_box_z], radius=round_radius, center=false);\n translate([th, th, -eps]) {\n cubeTopX(size=[box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], radius=round_radius, center=false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h-2*eps);\n }\n }\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=20, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\nmodule roundedRect(size, radius)\n{\n x = size[0];\n y = size[1];\n z = size[2];\n translate([x\/2,y\/2,0]) {\n linear_extrude(height=z)\n hull()\n {\n \/\/ place 4 circles in the corners, with the given radius\n translate([(-x\/2)+(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(-x\/2)+(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n }\n }\n}\n","old_contents":"use \n\ntol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th + 0.5;\nshift_y = th + 0.5;\n\nbox_x = pcb_x + 2*th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 1.8;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36.5;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 30;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\nround_radius=2;\n\ntranslate([0,0,-50]) {\n\n\/\/ put exclamation mark here to render bottom\ndifference() {\n union() {\n difference() {\n union() {\n cubeBottomX([box_x, box_y, bottom_box_z-board_h], radius=round_radius);\n translate([th - board_w, th - board_w, 0]) {\n cubeBottomX([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], radius=round_radius);\n }\n }\n translate([th, th, th]) {\n cubeBottomX([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], radius=round_radius);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 11.5;\nscreen_start_y = shift_y + 25;\nscreen_length_x = 77;\nscreen_length_y = 50.5;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 19;\nmaster_button_int = 31.5;\nmaster_button_r = 6.25;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\n\n\/\/ put exclamation mark here to render top\n!rotate(a=[180,0,0]) {\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cubeSideX(size=[box_x, box_y, board_h + eps], radius=round_radius, center=false);\n translate([board_w, board_w, -eps]) {\n cubeSideX(size=[box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], radius=round_radius, center=false);\n }\n }\n }\n difference() {\n cubeTopX(size=[box_x,box_y,top_box_z], radius=round_radius, center=false);\n translate([th, th, -eps]) {\n cubeTopX(size=[box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], radius=round_radius, center=false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h-2*eps);\n }\n }\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=20, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\nmodule roundedRect(size, radius)\n{\n x = size[0];\n y = size[1];\n z = size[2];\n translate([x\/2,y\/2,0]) {\n linear_extrude(height=z)\n hull()\n {\n \/\/ place 4 circles in the corners, with the given radius\n translate([(-x\/2)+(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(-x\/2)+(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0dcd8b525dc4f0e3f0c1f260a8b8aa5a251b3647","subject":"config: reduce beltpath_width","message":"config: reduce beltpath_width\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 1*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"0467e3056ff5c5b6a426bea8a4a1e85047340b96","subject":"months old changes, not committed?","message":"months old changes, not committed?\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n\/\/%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\ntranslate([0,0,9]) lid();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\ndh=3.1;\nc30=cos(30); dx=3*dh; dy=2*c30*dh;\nmodule hexGrid() {\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y,s=[1,1,1]) translate([x,y,0]) scale(s)\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\nmodule lid() {\n difference() {\n union() {\n for (i=[-1,1]) {\n for (j=[-1,1]) translate([2*dx*i,5*dy*j,0]) hull() {\n translate([0,1.2*j,3]) cylinder(r=.1 ,h=5,$fn=6); \n hex( 0 , 0 ,[.9,.9,1]); }\n hull() { hex(4.5*dx*i,0.5*dy*i,[.9,.9,1]);\n translate([(4.5*dx+1.3)*i,0.5*dy*i,8]) sphere(0.1); }\n }\n difference() {\n lidShell();\n translate([0,0,0.3]) scale([.985,.976,.97]) lidShell();\n\n \/\/trim off thin edges of shell\n translate([0,0,2.4]) cube([84,53,2],center=true);\n }\n }\n\n \/\/ pass through for cable ties to attach platform to sides\n for(x=[-1,1]) translate([x*28,0,2.7]) rotate([90,0,0])\n scale([3,2,1]) cylinder(r=1,h=77,$fn=16,center=true);\n\n \/\/translate([0,0,-99]) cube([200,200,200]);\n }\n\n}\n\nmodule lidShell()\n hull() {\n for (x=[-1,1]) for(y=[-1,1]) {\n translate([41.5*x,26*y,4.6]) sphere(3,$fn=24);\n translate([ 31*x,20*y,30 ]) sphere(3,$fn=24);\n }\n}\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n\/\/%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n*for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\ntranslate([0,0,9]) lid();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\ndh=3.1;\nc30=cos(30); dx=3*dh; dy=2*c30*dh;\nmodule hexGrid() {\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y,s=[1,1,1]) translate([x,y,0]) scale(s)\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\nmodule lid() {\n difference() {\n union() {\n for (i=[-1,1]) {\n for (j=[-1,1]) translate([2*dx*i,5*dy*j,0]) {\n hull() {\n translate([0, 0 ,1.7]) cylinder(r=2.2,h=1.4,$fn=6);\n translate([0,1.5*j,3]) cylinder(r=.1 ,h=5,$fn=6); }\n hex(0,0,[.9,.9,1]); }\n hull() { hex(5*dx*i, 0 ,[.9,.9,1]);\n translate([(5*dx-0.6)*i,0,8]) sphere(0.1); }\n }\n difference() {\n lidShell();\n translate([0,0,0.3]) scale([.982,.976,.97]) lidShell();\n\n \/\/trim off thin edges of shell\n translate([0,0,2.4]) cube([89,53,2],center=true);\n }\n }\n\n \/\/ trim off severe overhanging parts of tabs\n *hull() {\n translate([0,0,3.5]) cube([70,55,.1],center=true);\n cube([70,50,7],center=true);\n }\n\n \/\/ trim off part of tab in partial hex hole\n for(x=[-1,1]) translate([49.7*x,0,0]) rotate([0,10*x,0])\n cube([6,6,20],center=true);\n\n \/\/ pass through for cable ties to attach platform to sides\n for(x=[-1,1]) translate([x*28,0,2.7]) rotate([90,0,0])\n scale([3,2,1]) cylinder(r=1,h=77,$fn=16,center=true);\n\n \/\/translate([0,0,-99]) cube([200,200,200]);\n }\n\n}\n\nmodule lidShell()\n hull() {\n for (x=[-1,1]) for(y=[-1,1]) {\n translate([44*x,26*y,4.6]) sphere(3,$fn=24);\n translate([40*x,23 *y,30 ]) sphere(3,$fn=24);\n }\n}\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c8ee3d712dcfd835b026de9129900cf06dd84b5c","subject":"Final form of the Monomanual Type-o-tastic, or whatever it will be called. All that remains is to double\/triple check measurements and arithmetic before printing","message":"Final form of the Monomanual Type-o-tastic, or whatever it will be called. All that remains is to double\/triple check measurements and arithmetic before printing\n","repos":"joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn","old_file":"typeatron\/typeatron.scad","new_file":"typeatron\/typeatron.scad","new_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\n\/\/cornerRoundingRes = 50;\ncornerRoundingRes = 10;\npinHoleRes = 10;\n\/\/connectorPinRes = 50;\nconnectorPinRes = 10;\n\/\/ledHoleRes = 50;\nledHoleRes = 10;\n\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.10;\nchargerHeaderWidth = 2.56;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.9;\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 12;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 4;\npushButtonPressDepth = 0.3;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1.5;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = 0.3; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\n\nmodule button() {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([buttonLength-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n translate([buttonLength-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([buttonLength-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t\/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-2,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-2,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+pushButtonPressDepth+10]);\n\/\/ cube([buttonLength,buttonWidth,pushButtonWellDepth+buttonThick-buttonWidth\/2+error]);\n\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+3,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n \/\/translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n\n }\n\n for (i = [1:5]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbBevelLength - wallThick*2\/3)\/5,0]) {\n pinHole();\n }\n }\n translate([15,caseLength-thumbBevelLength+3,0]) {\n pinHole();\n }\n\n translate([thumbBevelWidth, caseLength-wallThick*2\/3,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-15, 0]) {\n pinHole();\n }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+thumbBevelBuffer,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-thumbBevelBuffer,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius+clearance, $fn=20);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick+cavityWidth-chargerHeaderWidth-2*error,0,caseHeight-floorThick-chargerHeaderLength-2*error]) {\n cube([chargerHeaderWidth+2*error,wallThick,chargerHeaderLength+2*error]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+2*error,wallThick,powerSwitchWidth+2*error]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick,nanoUsbHeight+clearance]);\n }\n }\n}\n\n\/\/ body\ndifference() {\n union() {\n basicCase();\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight-floorThick+0.001, r=3);\n }\n }\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick+7, caseLength-thumbBevelLength+7, 0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n}\n\n\/\/ lid\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick+7, caseLength-thumbBevelLength+7, 0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([-5,0,10]) {\n for (i = [0:4]) {\n translate([0,i*(buttonLength+2),0]) { rotate([90,180,-90]) {\n \/\/cube([10,20,40]);\n\n button();\n }} \n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+2*error,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([0,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([0,3,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","old_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.10;\nchargerHeaderWidth = 2.56;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.9;\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 11;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\nlidMargin = 1;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\npushButtonWellWidth = 7;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1;\npushButtonLegLength = 4;\npushButtonHeight = 5.0;\npushButtonPressDepth = 0.3;\n\/\/pushButtonRadius = 3.5\/2;\npushButtonLegProtrusion = pushButtonLegLength - pushButtonBaseThick;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + 0.5 + error);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\nbuttonClearance = 0.3;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\nlidWidth = caseWidth - wallThick + lidMargin - totalFingerWellDepth + 3;\nlidLength = caseLength - thumbBevelLength - wallThick + 2*lidMargin;\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([-1,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+pushButtonPressDepth+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2); \n }\n}\n\n\/\/ create the lid\n\/\/ buffer: hyper-extends the lid, for better rendering\n\/\/ shrinkage: clearance around the edges of the lid\nmodule lid(buffer, shrinkage) {\n translate([0,0,-buffer]) {\n translate([wallThick-lidMargin+shrinkage,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth,lidLength,lidThick+buffer]);\n }\n translate([thumbBevelWidth,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth-thumbBevelWidth+wallThick,cavityLength+(lidMargin-shrinkage)*2,lidThick+buffer]);\n }\n\n \/\/ note: currently no \"shrinkage\" on this edge\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n rotate([180,0,0]) {\n translate([-27,-wallThick,pushButtonBaseThick]) {\n translate([0,0,-6]) {\n cube([47,lidThick+buffer,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\nmodule button() {\n difference() {\n union() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength-2*buttonClearance,r=buttonWidth\/2-buttonClearance); }\n }\n\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([buttonLength-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n\n translate([buttonLength-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n }\n\n translate([buttonClearance+1,0,0]) { cube([1,buttonWidth,2]); }\n translate([buttonLength-buttonClearance-2,0,0]) { cube([1,buttonWidth,2]); }\n\n \/\/translate([0,buttonWidth\/2,buttonWidth\/2]) {\n \/\/ rotate([0,90,0]) { cylinder(h=buttonLength+1,r=buttonWidth\/3); }\n \/\/}\n\n \/\/translate([buttonLength\/2,buttonWidth\/2,buttonThick-0.5]) {\n \/\/ cylinder(h=1,r=pushButtonRadius);\n \/\/}\n }\n}\n\nmodule screwHoles() {\n translate([0,0,-1]) {\n translate([15,caseLength-thumbBevelLength-wallThick+9,0]) { cylinder(h=caseHeight+2,r=1.5); }\n\n translate([wallThick+cavityWidth+2.5,caseLength-fingerHeightOffset-fingerRad*2,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+2.5,caseLength-fingerHeightOffset-fingerRad*4,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+2.5,caseLength-fingerHeightOffset-fingerRad*6,0]) { cylinder(h=caseHeight+2,r=1.5); }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+2,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-2,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n \/*\n \/\/ depression for lid\n lid(1,0);\n *\/\n\n screwHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius+clearance);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick,0,caseHeight-floorThick-chargerHeaderLength-2*error]) {\n cube([chargerHeaderWidth+2*error,wallThick,chargerHeaderLength+2*error]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+2*error,wallThick,powerSwitchWidth+2*error]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick,nanoUsbHeight+clearance]);\n }\n \/\/ trim off the thin remainder above the USB port which would be problematic to print,\n \/\/ and make it harder to get the Nano into its socket anyway\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,wallThick-lidMargin,0]) {\n cube([nanoUsbWidth+2*clearance,lidMargin,2]);\n }\n }\n}\n\ndifference() {\n basicCase();\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n}\n\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n}\n\n\/*\n\/\/ lid\ntranslate([0,0,caseHeight + 2]) {\n difference() {\n \/\/ the gap of 0.4 was determined by taking into account the 0.15mm accuracy of\n \/\/ the device and the 0.15% error by longest axis of the material, keeping in mind\n\t \/\/ that there are always a pair of gaps across the lid from each other.\n \/\/ 0.4mm is actually larger than necessary in the horizontal (narrower) dimension.\n lid(0,0.4);\n\n screwHoles();\n }\n}\n*\/\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the most smooth\ntranslate([-5,0,10]) {\n for (i = [0:4]) {\n translate([0,i*(buttonLength+2),0]) { rotate([90,180,-90]) {\n \/\/cube([10,20,40]);\n\n button();\n }} \n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+2*error,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([0,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([1,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,3,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([1,4,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8a8d063303fa3494d629b633af2ee52d69c166ed","subject":"fix passing of fatten value","message":"fix passing of fatten value\n","repos":"JoeSuber\/QuickerPicker","old_file":"simons.scad","new_file":"simons.scad","new_contents":"\necho(\"a box with holes in it for Simon\");\n\/\/ todo: get rid of hard-coded '28' in walls_of_box\n\nbigbox = 80;\t\t\t\t\t\t\/\/ old box was 70?\nbigboxht = 55;\t\t\t\t\t\t\/\/ up from 50\nfatten_for_lid_cut=0;\t\t\t\t\/\/ test fit lids: if more than .6 needed, bad geometry or print\n\t\t\t\t\t\t\t\t\t\/\/ also, should be zero when printing center section\nsides = 2;\t\t\t\t\t\t\t\/\/ skinny, assumes some further light-stopping material\/paint\nledhole=15;\t\nholeside=ledhole + sides*2 + 10;\t\/\/ accomodate lense assembly\ncornerad=4;\t\t\t\t\t\t\/\/ used with minkowski(), cornerad*2 + 4-flat-sides = perimeter\nsmall_chamber = 1\/3;\t\t\t\t\/\/ total of chambers' ratios should == 1\nbig_chamber = 2\/3;\t\t\t\t\/\/ chambers can be swapped\nslit_width = 5;\t\t\t\t\t\t\/\/ mm\ncuvtt_inside = 12;\t\t\t\t\t\/\/ put cuvette into a lid, slide detector around it, put other lid on.\nlid_lad = 7;\t\t\t\t\t\t\/\/ basic lid thickness\nlid_puff = 4;\t\t\t\t\t\t\/\/ rounded-ness for lid\n\n\nmodule walls_of_box(\n\t\t\tfattener=fatten_for_lid_cut,\n\t\t\tlongside=bigbox, \n\t\t\tbigboxht=bigboxht, \n\t\t\twallthick=sides,\n\t\t\tledhole=ledhole,\n\t\t\tcornerad=cornerad,\n\t\t\tholeside=holeside,\n\t\t\tinsiders_x=bigbox - sides*3 - cornerad*2,\n\t\t\tinsiders_y=ledhole - cornerad,\t\t\/\/ inner-wall corner radius is hard-coded at 1\/2 of outer\n\t\t\t){\n\techo(\"longside = \", longside);\n\techo(\"insiders_x = \", insiders_x);\n\techo(\"insiders_y = \", insiders_y);\n\tdifference(){\n\t\tminkowski(){\n\t\t\tsquare([longside - cornerad*2, holeside - cornerad*2], center=true);\n\t\t\tcircle(r=cornerad+fattener, $fn=36);\n\t\t}\n\t\tfor(block=[[small_chamber*insiders_x - fattener*2, fattener\/2], \n\t\t\t\t\t[big_chamber*insiders_x - fattener*2, 28-fattener\/2]]){\n\t\t\techo(\"block[0] = \", block[0]);\n\t\t\ttranslate([-longside\/2+(wallthick+fattener\/2)*2+block[0]\/2 + block[1], 0, 0]){\n\t\t\t\tminkowski(){\n\t\t\t\t\tsquare([block[0], holeside - cornerad - sides*2 - fattener*2], center=true);\n\t\t\t\t\tcircle(r=(cornerad-fattener)\/2, $fn=36);\n\t\t\t\t}\n\t\t\t\t\/\/ this square is just here to show the light-path\n\t\t\t\t#square([block[0], slit_width], center=true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule growbox(to_height=bigboxht, slit_width=slit_width, fatboy=0){\n\tdifference(){\n\t\tlinear_extrude(height = to_height, center = true, convexity = 10, twist = 0, slices = to_height*2, scale = 1){\n\t\t\twalls_of_box(fattener=fatboy+fatten_for_lid_cut);\n\t\t}\n\t\tcube([bigbox-sides*2-cornerad, slit_width, to_height - 10], center=true);\n\t\tfor (i=[-bigbox\/2, bigbox\/2]){\n\t\t\ttranslate([i,0,0]) rotate([0,90,0])\n\t\t\t#cylinder(r=ledhole\/2, h=sides*3, center=true, $fn=128);\n\t\t}\n\t}\n}\n\nmodule lids_on_it (overhang=lid_puff, basethick=lid_lad, with_cuvt=1){\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube([bigbox, holeside, basethick], center=true);\n\t\t\tsphere(r=overhang\/2, center=true, $fn=64);\n\t\t}\n\t\t\/\/ imprint the base of the walls and cuvette on a lid-like-structure\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tgrowbox(fatboy=.2);\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([cuvtt_inside+.5, cuvtt_inside+.5, bigboxht], center=true);\n\t\t\/\/ an extra cut to ensure the lid doesn't obscure the cuvett:\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([bigbox-sides*4, slit_width-.1, bigboxht], center=true);\n\t}\n}\n\n\ntranslate([0,holeside+lid_puff+2,(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=1);\ntranslate([0,-(holeside+lid_puff+2),(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=0);\ntranslate([0,0,bigboxht\/2])\n\tgrowbox();\n\n\n\n\n","old_contents":"\necho(\"a box with holes in it for Simon\");\n\/\/ todo: get rid of hard-coded '28' in walls_of_box\n\nbigbox = 80;\t\t\t\t\t\t\/\/ old box was 70?\nbigboxht = 55;\t\t\t\t\t\t\/\/ up from 50\nfatten_for_lid_cut=.0;\t\t\t\t\/\/ test fit lids: if more than .6 needed, bad geometry or print\nsides = 2;\t\t\t\t\t\t\t\/\/ skinny, assumes some further light-stopping material\/paint\nledhole=15;\t\nholeside=ledhole + sides*2 + 10;\t\/\/ accomodate lense assembly\ncornerad=4;\t\t\t\t\t\t\/\/ used with minkowski(), cornerad*2 + 4-flat-sides = perimeter\nsmall_chamber = 1\/3;\t\t\t\t\/\/ total of chambers' ratios should == 1\nbig_chamber = 2\/3;\t\t\t\t\/\/ chambers can be swapped\nslit_width = 5;\t\t\t\t\t\t\/\/ mm\ncuvtt_inside = 12;\t\t\t\t\t\/\/ put cuvette into a lid, slide detector around it, put other lid on.\nlid_lad = 7;\t\t\t\t\t\t\/\/ basic lid thickness\nlid_puff = 4;\t\t\t\t\t\t\/\/ rounded-ness for lid\n\n\nmodule walls_of_box(\n\t\t\tfattener=fatten_for_lid_cut,\n\t\t\tlongside=bigbox, \n\t\t\tbigboxht=bigboxht, \n\t\t\twallthick=sides,\n\t\t\tledhole=ledhole,\n\t\t\tcornerad=cornerad,\n\t\t\tholeside=holeside,\n\t\t\tinsiders_x=bigbox - sides*3 - cornerad*2,\n\t\t\tinsiders_y=ledhole - cornerad,\t\t\/\/ inner-wall corner radius is hard-coded at 1\/2 of outer\n\t\t\t){\n\techo(\"longside = \", longside);\n\techo(\"insiders_x = \", insiders_x);\n\techo(\"insiders_y = \", insiders_y);\n\tdifference(){\n\t\tminkowski(){\n\t\t\tsquare([longside - cornerad*2, holeside - cornerad*2], center=true);\n\t\t\tcircle(r=cornerad-fattener, $fn=36);\n\t\t}\n\t\tfor(block=[[small_chamber*insiders_x - fattener*2, fattener\/2], \n\t\t\t\t\t[big_chamber*insiders_x - fattener*2, 28-fattener\/2]]){\n\t\t\techo(\"block[0] = \", block[0]);\n\t\t\ttranslate([-longside\/2+(wallthick+fattener\/2)*2+block[0]\/2 + block[1], 0, 0]){\n\t\t\t\tminkowski(){\n\t\t\t\t\tsquare([block[0], holeside - cornerad - sides*2 - fattener*2], center=true);\n\t\t\t\t\tcircle(r=cornerad\/2, $fn=36);\n\t\t\t\t}\n\t\t\t\t\/\/ this square is just here to show the light-path\n\t\t\t\t#square([block[0], slit_width], center=true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule growbox(to_height=bigboxht, slit_width=slit_width, fatboy=0){\n\tdifference(){\n\t\tlinear_extrude(height = to_height, center = true, convexity = 10, twist = 0, slices = to_height*2, scale = 1){\n\t\t\twalls_of_box(fattener=fatboy);\n\t\t}\n\t\tcube([bigbox-sides*2-cornerad, slit_width, to_height - 10], center=true);\n\t\tfor (i=[-bigbox\/2, bigbox\/2]){\n\t\t\ttranslate([i,0,0]) rotate([0,90,0])\n\t\t\t#cylinder(r=ledhole\/2, h=sides*3, center=true, $fn=128);\n\t\t}\n\t}\n}\n\nmodule lids_on_it (overhang=lid_puff, basethick=lid_lad, with_cuvt=1){\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube([bigbox, holeside, basethick], center=true);\n\t\t\tsphere(r=overhang\/2, center=true, $fn=64);\n\t\t}\n\t\t\/\/ imprint the base of the walls and cuvette on a lid-like-structure\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tgrowbox(fatboy=.2);\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([cuvtt_inside+.5, cuvtt_inside+.5, bigboxht], center=true);\n\t\t\/\/ an extra cut to ensure the lid doesn't obscure the cuvett:\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([bigbox-sides*4, slit_width-.1, bigboxht], center=true);\n\t}\n}\n\n\ntranslate([0,holeside+lid_puff+2,(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=1);\ntranslate([0,-(holeside+lid_puff+2),(lid_lad+lid_puff)\/2])\n\tlids_on_it(with_cuvt=0);\ntranslate([0,0,bigboxht\/2])\n\tgrowbox();\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"74f9d47e200a4eedbcfa74d026e60f425305e183","subject":"system: Add XY,XZ,YZ","message":"system: Add XY,XZ,YZ\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"system.scad","new_file":"system.scad","new_contents":"XAXIS = [1,0,0];\nYAXIS = [0,1,0];\nZAXIS = [0,0,1];\nNAXIS = [0,0,0];\n\nX = XAXIS;\nY = YAXIS;\nZ = ZAXIS;\nN = NAXIS;\n\nXY = X+Y;\nXZ = X+Z;\nYZ = Y+Z;\n\nAXES = [X,Y,Z];\n\nU = undef;\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n","old_contents":"XAXIS = [1,0,0];\nYAXIS = [0,1,0];\nZAXIS = [0,0,1];\nNAXIS = [0,0,0];\n\nX = XAXIS;\nY = YAXIS;\nZ = ZAXIS;\nN = NAXIS;\n\nAXES = [X,Y,Z];\n\nU = undef;\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"900911ec344426e0bc00e6119d955b6739bddbd7","subject":"screws\/cut: add cut_screw, screw_offset params","message":"screws\/cut: add cut_screw, screw_offset params\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=Z, align=-Z);\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=-Z, align=-Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4414d00d245c496df98df7d86f34eeae7fc41ff4","subject":"Better base for milwaukee battery","message":"Better base for milwaukee battery\n","repos":"ksuszka\/3d-projects","old_file":"powertools\/milwaukee_battery.scad","new_file":"powertools\/milwaukee_battery.scad","new_contents":"use ;\n\n\/\/ dimension\n\/\/ heights:\n\/\/ - base = 0mm\n\/\/ - slope highest point = 26.5mm\n\/\/ - slope mid point = 14mm\n\/\/ - hook lowest edge = 19mm\n\n\/\/ Guide lines\n\/\/translate([20,-5,60]) cube([1,29,1],true);\n\/\/%translate([0,5.5,100])color(\"gray\") cube([1,52,1],true);\n\/\/%translate([0,0,100])color(\"gray\") cube([46,1,1],true);\n\/\/%translate([50,-20,26.5]) rotate([-19,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n\/\/%translate([50,22,0]) rotate([-65,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n\n\nmodule outer_horizontal_boundary(dim, x0, y0, x1, y1, y2) {\n module half() {\n BezLine([\n [0, 0],\n [dim*y0, dim*x0],\n [dim*y1, dim*x1],\n [dim*y2, dim],\n [0, dim],\n ], width = [0.1, 0.1], resolution = 6);\n }\n half();\n mirror([1,0,0]) half();\n}\n\n\/*\n#color(\"green\") difference() {\ntranslate([0,-19.5, 3]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.06, 0.72, 0.66, 0.41, 0.30);\n translate([0,0.5,0]) battery_tower();\n}\n*\/\n\n\/*\n#color(\"green\") difference() {\n translate([0,-19.5, -55]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n translate([0,0.5,0]) battery_tower();\n}\/\/*\/\n\n\n\/\/translate([0,-15,-16]) hull() outer_horizontal_boundary(46.4, 0.9, 0.58, 0.37, 0.26);\nmodule outline(height=10, type=1) {\n translate([0,-20.5, -height\/2]) hull() linear_extrude(height=height) {\n if (type == 1) {\n outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n } else if (type == 2) {\n outer_horizontal_boundary(52, 0.04, 0.73, 0.81, 0.43, 0.2);\n } else if (type == 3) {\n outer_horizontal_boundary(52, 0.03, 0.73, 0.86, 0.44, 0.2);\n }\n }\n}\n\nmodule thin_wall() {\n type = 2;\n intersection() {\n\/\/* \n minkowski() {\n difference() {\n cube([100,100,100], true);\n outline(110,type);\n }\n sphere(r=1);\n }\n\/\/ *\/\n outline(110,type);\n }\n}\n\/\/translate([0,0,40])#outline(1,2);\n\nmodule hooks2() {\n module hook() {\n radius=40;\n intersection() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+1.5,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n };\n cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n }\n\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,13.5,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\nmodule hooks() {\n module hook() {\n radius=40;\n intersection() {\n union() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+2,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n translate([0,0,2]) rotate([-4,0,0]) translate([0,-1,-5]) cylinder(r=radius,h=20,$fn=120); \n };\n }\n rotate([0,0,-30])cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n }\n\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,13.5,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\nmodule battery_tower_base_negative_mold() {\n hull() {\n intersection() {\n translate([0,-165,-452]) rotate([0,90,0]) cylinder(d=1000,h=100,center=true,$fn=360);\n translate([0,-11,0])cube([100,50,100],true);\n }\n translate([0,13.13,11.91]) rotate([0,90,0]) cylinder(d=6,h=100,center=true,$fn=36);\n translate([0,22,0])rotate([-65,0,0])translate([0,0,-1])cube([100,20,2],true);\n }\n translate([0,0,-48.9]) rotate([-2,0,0]) cube([100,100,100],true);\n}\n\/\/color(\"red\") battery_tower_base_negative_mold(2);\n\nmodule handle() {\n hull() {\n translate([0,0,1]) outline(2,2);\n translate([0,0,29]) outline(22,3);\n }\n hull() {\n\/\/ translate([0,0,38]) outline(10,3);\n\/\/ translate([0,5,70]) cylinder(d=50,h=1);\n }\n}\n\ndifference() {\n union() {\n\/\/ intersection() {\n\/\/ thin_wall(); \n\/\/ translate([0,0,15]) cube([1000,1000,30], true);\n\/\/ }\n color(\"blue\")difference() {\n\/\/ translate([0,0,26+5]) outline(16,2);\n handle();\n translate([0,0,-0.01]) battery_tower();\n }\n }\n battery_tower_base_negative_mold();\n hooks();\n}\n\/\/battery_tower();\n\n\/\/translate([0,0,50]) hooks();\n\n\/\/translate([0,0,120])color(\"green\")cube([46,1,1],true);\n\/\/translate([0,-18, 50]) hull() outer_horizontal_boundary(50, 0.83, 0.62, 0.37, 0.26);\n\nmodule battery_tower() {\n clearance = 0.0;\n battery_r = 11 + clearance;\n battery_distance = 9.4;\n cell_h = 60;\n big_tower_h = cell_h + 10;\n battery_d = battery_r * 2;\n big_tower_w = battery_d * 1.1;\n triangle_h = battery_distance * sqrt(3);\n big_tower_offset = triangle_h - battery_r;\n \n module trunk(height) {\n hull() {\n translate([-battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([0, triangle_h, 0])\n cylinder(height, r=battery_r+0.0,$fn=60);\n }\n }\n \n trunk(cell_h);\n \n module edge(height) {\n hull() {\n translate([12.8,21.5])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([12.8,19.4])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([10,19.2])cylinder(d=4+ clearance*2,h=height, $fn=36);\n }\n }\n color(\"red\") edge(big_tower_h);\n color(\"red\") mirror([1,0,0]) edge(big_tower_h);\n intersection() {\n trunk(big_tower_h);\n translate([-big_tower_w \/ 2, big_tower_offset, 0])\n cube([big_tower_w, big_tower_w, big_tower_h]);\n }\n \n color(\"blue\") translate([6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n color(\"blue\") translate([-6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n}\n\n\n\n\n\n","old_contents":"use ;\n\n\/\/ dimension\n\/\/ heights:\n\/\/ - base = 0mm\n\/\/ - slope highest point = 26.5mm\n\/\/ - slope mid point = 14mm\n\/\/ - hook lowest edge = 19mm\n\nmodule outer_horizontal_boundary(dim, x0, y0, x1, y1, y2) {\n module half() {\n BezLine([\n [0, 0],\n [dim*y0, dim*x0],\n [dim*y1, dim*x1],\n [dim*y2, dim],\n [0, dim],\n ], width = [0.1, 0.1], resolution = 6);\n }\n half();\n mirror([1,0,0]) half();\n}\n\n\/*\n#color(\"green\") difference() {\ntranslate([0,-19.5, 3]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.06, 0.72, 0.66, 0.41, 0.30);\n translate([0,0.5,0]) battery_tower2();\n}\n*\/\n\n\/*\n#color(\"green\") difference() {\n translate([0,-19.5, -55]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n translate([0,0.5,0]) battery_tower();\n}\/\/*\/\n\n\n\/\/translate([0,-15,-16]) hull() outer_horizontal_boundary(46.4, 0.9, 0.58, 0.37, 0.26);\nmodule outline(height=10, type=1) {\n translate([0,-20.5, -height\/2]) hull() linear_extrude(height=height) {\n if (type == 1) {\n outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n } else if (type == 2) {\n outer_horizontal_boundary(52, 0.04, 0.73, 0.81, 0.43, 0.2);\n } else if (type == 3) {\n outer_horizontal_boundary(52, 0.03, 0.73, 0.86, 0.44, 0.2);\n }\n }\n}\n\nmodule thin_wall() {\n type = 2;\n intersection() {\n\/\/* \n minkowski() {\n difference() {\n cube([100,100,100], true);\n outline(110,type);\n }\n sphere(r=1);\n }\n\/\/ *\/\n outline(110,type);\n }\n}\n\/\/translate([0,0,40])#outline(1,3);\nmodule hooks2() {\n module hook() {\n radius=40;\n intersection() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+1.5,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n };\n cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n }\n\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,13.5,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\nmodule hooks() {\n module hook() {\n radius=40;\n intersection() {\n union() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+2,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n translate([0,0,2]) rotate([-4,0,0]) translate([0,-1,-5]) cylinder(r=radius,h=20,$fn=120); \n };\n }\n rotate([0,0,-30])cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n }\n\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,13.5,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\n\/\/translate([20,-5,60]) cube([1,29,1],true);\n%translate([50,-20,26.5]) rotate([-19,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n%translate([50,22,0]) rotate([-65,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n\nmodule mold() {\n hull() \n {\n translate([0,13.13,11.91]) rotate([0,90,0]) cylinder(d=6,h=100,center=true,$fn=36);\n\/\/ translate([0,11,10.1]) rotate([0,90,0]) cylinder(d=10,h=100,center=true,$fn=36);\n translate([0,-20,26.5])rotate([-19,0,0])translate([0,0,-20])cube([100,2,40],true);\n translate([0,22,0])rotate([-65,0,0])translate([0,0,-1])cube([100,20,2],true);\n }\n}\n\/\/color(\"red\")mold();\nmodule handle() {\n hull() {\n translate([0,0,1]) outline(2,2);\n translate([0,0,29]) outline(22,3);\n }\n}\ndifference() {\n union() {\n\/\/ intersection() {\n\/\/ thin_wall(); \n\/\/ translate([0,0,15]) cube([1000,1000,30], true);\n\/\/ }\n color(\"blue\")difference() {\n\/\/ translate([0,0,26+5]) outline(16,2);\n handle();\n translate([0,0,-0.01]) battery_tower();\n }\n }\n mold();\n hooks();\n}\n\/\/battery_tower();\n\n\/\/translate([0,0,50]) hooks();\n\n\/\/translate([0,0,120])color(\"green\")cube([46,1,1],true);\n\/\/translate([0,-18, 50]) hull() outer_horizontal_boundary(50, 0.83, 0.62, 0.37, 0.26);\n\nmodule battery_tower() {\n clearance = 0.0;\n battery_r = 11 + clearance;\n battery_distance = 9.4;\n cell_h = 60;\n big_tower_h = cell_h + 10;\n battery_d = battery_r * 2;\n big_tower_w = battery_d * 1.1;\n triangle_h = battery_distance * sqrt(3);\n big_tower_offset = triangle_h - battery_r;\n \n module trunk(height) {\n hull() {\n translate([-battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([0, triangle_h, 0])\n cylinder(height, r=battery_r+0.0,$fn=60);\n }\n }\n \n trunk(cell_h);\n \n module edge(height) {\n hull() {\n translate([12.8,21.5])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([12.8,19.4])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([10,19.2])cylinder(d=4+ clearance*2,h=height, $fn=36);\n }\n }\n color(\"red\") edge(big_tower_h);\n color(\"red\") mirror([1,0,0]) edge(big_tower_h);\n intersection() {\n trunk(big_tower_h);\n translate([-big_tower_w \/ 2, big_tower_offset, 0])\n cube([big_tower_w, big_tower_w, big_tower_h]);\n }\n \n color(\"blue\") translate([6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n color(\"blue\") translate([-6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n}\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"923c73687c6986796b368ca12244055e9f9bb121","subject":"feat: allow selecting a single visual test","message":"feat: allow selecting a single visual test\n","repos":"jsconan\/camelSCAD","old_file":"shape\/context\/test.scad","new_file":"shape\/context\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testElement(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbed(alpha) {\n testElement(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbed(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbed(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testElement(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbed(alpha) {\n testElement(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbed(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbed(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n lines = cols ? ceil($children \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [0 : $children - 1]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8341bcc0aa4db44ee962182b9105fa64d9da7cbb","subject":"Cladding and animation","message":"Cladding and animation\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 25, degrees=3)\n{\n panels = round(-0.5+z\/board_height);\n panel_uplift = board_height - overlap;\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,6 );\n }\n}\n\n\nif($t>0.1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>0.2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>0.3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>0.4) \n translate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>0.5) \n translate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.6) \n translate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nif($t>0.8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n\n!caddings(2000, 500);\n\n\/\/! cadding(2000);","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,6 );\n }\n}\n\n\n\nshedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\ntranslate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\ntranslate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nroof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a19c2e59872a634fee00df670c657d4fe191e4e3","subject":"Create 20x20_Profile.scad","message":"Create 20x20_Profile.scad","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"20x20_Profile.scad","new_file":"20x20_Profile.scad","new_contents":"\/*\n20x20 Aluminium T-slot profile from modeus...\n*\/\n\n\n\n module AluProfile(Lenght){\n\n$fn=50; \n \nunion () { \nRealLenght = Lenght \/ 2 ; \/\/ bug in OpenScad ?\n\n\ndifference (){ \n union (){ \/\/ the Aluminium base\n translate ([1,1,0]){\n color( \"Gainsboro\", 1 ) {\n minkowski(){\n cube([18,18,RealLenght]);\n cylinder(r=1,h=RealLenght);\n }\n }\n }\n }\n\/\/ Difference starts here \n translate ([10,10,0]){ \/\/ center hole\n cube([5,5,Lenght*2+1], true);\n } \n \n union (){ \/\/ first T-Slot South\n translate ([10,2,0]){ \n cube([6,8,Lenght*2+1], true); \n }\n translate ([10,3,0]){ \n cube([8,2,Lenght*2+1], true); \n }\n translate ([10,2,0]){ \n cube([12.5,1.6,Lenght*2+1], true); \n }\n translate ([13.9,3.7,0]){ \n rotate ([0,0,45]) { \n cube([2,4.5,Lenght*2+1], true); \n }}\n translate ([6.1,3.7,0]){ \n rotate ([0,0,45]) { \n cube([4.5,2,Lenght*2+1], true); \n }} \n } \n\n translate ([0,20,0]){ \/\/ Second T-Slot North\n mirror ([0,1,0]) { \n union (){ \n translate ([10,2,0]){ \n cube([6,8,Lenght*2+1], true); \n }\n translate ([10,3,0]){ \n cube([8,2,Lenght*2+1], true); \n }\n translate ([10,2,0]){ \n cube([12.5,1.6,Lenght*2+1], true); \n }\n translate ([13.9,3.7,0]){ \n rotate ([0,0,45]) { \n cube([2,4.5,Lenght*2+1], true); \n }}\n translate ([6.1,3.7,0]){ \n rotate ([0,0,45]) { \n cube([4.5,2,Lenght*2+1], true); \n }} \n } \n}}\n\ntranslate ([20,0,0]){ \/\/ third and forth T-Slot East West\nrotate ([0,0,90]) { \n union (){ \n translate ([10,2,0]){ \n cube([6,8,Lenght*2+1], true); \n }\n translate ([10,3,0]){ \n cube([8,2,Lenght*2+1], true); \n }\n translate ([10,2,0]){ \n cube([12.5,1.6,Lenght*2+1], true); \n }\n translate ([13.9,3.7,0]){ \n rotate ([0,0,45]) { \n cube([2,4.5,Lenght*2+1], true); \n }}\n translate ([6.1,3.7,0]){ \n rotate ([0,0,45]) { \n cube([4.5,2,Lenght*2+1], true); \n }} \n } \n translate ([0,20,0]){ \n mirror ([0,1,0]) { \n union (){ \n translate ([10,2,0]){ \n cube([6,8,Lenght*2+1], true); \n }\n translate ([10,3,0]){ \n cube([8,2,Lenght*2+1], true); \n }\n translate ([10,2,0]){ \n cube([12.5,1.6,Lenght*2+1], true); \n }\n translate ([13.9,3.7,0]){ \n rotate ([0,0,45]) { \n cube([2,4.5,Lenght*2+1], true); \n }}\n translate ([6.1,3.7,0]){ \n rotate ([0,0,45]) { \n cube([4.5,2,Lenght*2+1], true); \n }} \n }\n}}}} \n\n\n } \n}}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '20x20_Profile.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"13f5f9a635874dd3895a681845492d99e2fdb1da","subject":"new platform","message":"new platform\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/*skew takes an array of six koef:\n *x along y\n *x along z\n *y along x\n *y along z\n *z along x\n *z along y\n *\/\n\nmodule skew(dims) {\n matrix = [\n\t [ 1, dims[0], dims[1], 0 ],\n\t [ dims[2], 1, dims[4], 0 ],\n\t [ dims[5], dims[3], 1, 0 ],\n\t [ 0, 0, 0, 1 ]\n ];\n\n multmatrix(matrix) children();\n}\n\nmodule cagetop()\n{\n for (x = [-20, 0, 20, 40]) translate([x-10, 0, 81]) cube(size=[2, 60, 2], center=true);\n for (y = [-30, 0, 30]) translate([0, y, 81]) cube(size=[60, 2, 2], center=true);\n\n translate([43, 0, 67]) skew([0, -0.9, 0, 0, 0, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ front sides\n translate([33, -33, 67]) skew([0, -0.2, 0, 0, 0.2, 0]) cube(size=[2, 2, 30], center=true);\n translate([33, 33, 67]) skew([0, -0.2, 0, 0, -0.2, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ rear\n translate([-42, -34.5, 67]) skew([0, 0.8, 0, 0, 0.3, 0]) cube(size=[2, 2, 30], center=true);\n translate([-42, 34.5, 67]) skew([0, 0.8, 0, 0, -0.3, 0]) cube(size=[2, 2, 30], center=true);\n}\n\nmodule cage(round=false)\n{\n if (round) minkowski() {\n cagetop();\n sphere(r=1);\n } else\n cagetop();\n\n #translate([ 36, 36, 45]) cylinder(d=3, h=7, center=false);\n #translate([ 36, -36, 45]) cylinder(d=3, h=7, center=false);\n\n #translate([-54, -39, 45]) cylinder(d=3, h=7, center=false);\n #translate([-54, 39, 45]) cylinder(d=3, h=7, center=false);\n}\n\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([30, -5, 60]) rotate([90, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\nrotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\n\/\/translate([0,0,80]) rotate([180,0,0]) cage(true);\n\n","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n polygon([\n [-50,-35], [50,-35],\n [50,-30], [60,-15],[60,15], [50,30],\n [50,35], [-50,35],\n [-50,30], [-55,20],[-55,-20], [-50,-30]\n ])\n\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n translate ([-45, 35, 0]) circle(r=7.5, center=true);\n translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n }\n square(size=[162,120], center=true);\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front\n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/ cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 2.5]) screw2x6bore(); \/\/cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n \/\/translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n \/\/translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n\n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n\n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30) \n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=0, left=1);\n }\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 47]) cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 47+5]) cube(size=[20, 63, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 47+5]) cube(size=[20, 20, 10], center=true);\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n\n translate ([10, -23, 35]) esc();\n\/\/ translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n\n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar();\n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar();\n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n\n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar();\n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 45, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([0, 52.5, 42]) rotate([180, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -45, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([0, -52.5, 42]) rotate([180, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\nplatform();\n\n\/*\nintersection() {\nplatform();\n#translate ([80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/*\nintersection() {\nplatform();\n#translate ([45-2.5, 30, 0]) cube(size=[20, 20, 400], center=true);\n}\n*\/\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0063cec98474d8edf22b7878a56fc63c2d6bbd2c","subject":"base object prototype","message":"base object prototype\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bash_coin\/bash_coin.scad","new_file":"bash_coin\/bash_coin.scad","new_contents":"N=1;\nM=1;\n\nmodule coin()\n{\n cylinder(r=25\/2, h=1, $fs=0.1);\n\n translate([-9, -7, 1])\n linear_extrude(height=1.5)\n text(text=str(\"#!\"), size=16, halign=[0,\"left\"]);\n}\n\n\n\/*\nfor(i = [0:N-1])\n for(j = [0:M-1])\n translate([i*20, j*20, 0])\n*\/\n coin();","old_contents":"","returncode":1,"stderr":"error: pathspec 'bash_coin\/bash_coin.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a8c2407dcceac18c25f6d9dbbf298a96d5832ec0","subject":"Delete Fh@TBot.scad","message":"Delete Fh@TBot.scad","repos":"TildenG\/FH_Tbot,TildenG\/FH_Tbot,ideaHex\/FH_Tbot,Rodinga\/FH_Tbot,TildenG\/FH_Tbot,ideaHex\/FH_Tbot,Rodinga\/FH_Tbot,Rodinga\/FH_Tbot,Rodinga\/FH_Tbot,TildenG\/FH_Tbot,ideaHex\/FH_Tbot,ideaHex\/FH_Tbot","old_file":"Fh@TBot.scad","new_file":"Fh@TBot.scad","new_contents":"","old_contents":"\/* _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \r\n *\r\n * Mechanical design of FH@Tbot for Makerfair 2016\r\n * \r\n * Written by Damian Kleiss \r\n * OpenSCAD version 2016.04.06\r\n * _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\*\/\r\n \r\n \r\n \/\/ HUB MOTOR END \/\/\r\n shaftMountOuterWidth = 13.5;\r\n shaftDia = 3.6; \/\/ Diameter of the motor shaft\r\n shaftLength = 8.1; \/\/ Length of motor shaft\r\n shaftFlat = 2.9; \/\/ This is the flat part of the motor shaft\r\n shaftNutWidth = 5.9; \/\/ distance across flats of shaft nuts\r\n shaftnutHeight = 2.8; \/\/ height of shaft nut\r\n shaftBoltDia = 3.5; \/\/ Required hole for grub screw\r\n \r\n \/\/ HUBWHEEL END \/\/\r\n hexWidth = 12.1; \/\/ width between flats of the Wheel Hex\r\n hexLength = 6.2; \/\/ Length of the hex that goes into the wheel\r\n wheelNutWidth = 7.7; \/\/ Width between flats of the nut that the wheel is held on with\r\n wheelNutHeight = 3.9; \/\/ Height of the nut that holds the wheel on\r\n wheelBoltDia = 3.5; \/\/ Diameter of the hole \r\n \r\n \/\/ ORING \/\/\r\n oringInnerDia = 50;\r\n oringThickness = 5;\r\n \r\n \/\/ WHEEL \/\/\r\n wheelDia = oringInnerDia+oringThickness;\r\n wheelThickness = oringThickness;\r\n \r\n \/\/ GENERIC \/\/\r\n minWallThickness = 0.9; \/\/ This is only used between the shaft nut and shaft\r\n smidge = 0.01; \/\/ small value used to get manifold geometry\r\n \r\n $fn = 100; \/\/ number of facets that make up round things\r\n \r\n \r\n \/\/ ASSMBLY \/\/\r\n\r\ntranslate([0,0,wheelThickness\/2])\r\n{\r\n Wheel(hubShape = \"Round\", shaft = \"D\");\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n}\r\n\r\n module Wheel(hubShape = \"Round\", shaft = \"D\")\r\n {\r\n color(\"red\")\r\n difference()\r\n {\r\n union()\r\n {\r\n translate([0,0,shaftLength\/2+1]) \r\n Hub(shape = hubShape);\r\n Rim();\r\n }\r\n translate([0,0,shaftLength\/2+1])\r\n rotate([180,0,0])\r\n HubHoles(shape = shaft);\r\n }\r\n}\r\n\r\n\r\n \r\n \r\n module Rim()\r\n {\r\n difference()\r\n {\r\n cylinder(d=wheelDia,h=wheelThickness,center=true);\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n }\r\n }\r\n\r\n\r\nmodule Oring(id = 50, thickness = 5)\r\n{\r\n color(\"DimGray\")\r\n rotate_extrude(convexity = 10)\r\n {\r\n translate([(id+thickness)\/2,0,0])\r\n circle(r=thickness\/2);\r\n }\r\n}\r\n\r\nmodule Hub(shape = \"Hex\")\r\n{\r\n rotate([0,0,30])\r\n if(shape == \"Hex\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, $fn=6, center = true); \/\/ Motor End\r\n }\r\n else if(shape == \"Round\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, center = true); \/\/ Motor End\r\n }\r\n \r\n}\r\n\r\nmodule HubHoles(shape = \"D\")\r\n{\r\n \/\/ Shaft Mount Holes \r\n color(\"red\")\r\n \r\n if (shape == \"D\")\r\n {\r\n union()\r\n { \r\n rotate([0,90,0])\r\n {\r\n translate([0,0,shaftDia-shaftFlat+minWallThickness])\r\n hull() \/\/ Hull two nuts so we can slip a nut in after the hub has been printed\r\n {\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n translate([shaftLength\/2,0,0])\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n }\r\n translate([0,0,hexWidth\/2])\r\n cylinder(r = shaftBoltDia \/2, h=hexWidth,center = true,$fn=100); \/\/ Shaft Bolt hole\r\n }\r\n \r\n \r\n \/\/ Shaft Hole\r\n difference()\r\n {\r\n cylinder(r=shaftDia\/2,h=shaftLength+smidge,center = true, $fn = 100);\r\n translate([(shaftDia-(shaftDia-shaftFlat)),0,0])\r\n cube([shaftDia,shaftDia,shaftLength+(smidge*2)],center=true); \/\/ Shaft Flat\r\n }\r\n } \r\n }\r\n else if (shape == \"Hex\")\r\n { \r\n cylinder(r = shaftDia \/ 2 \/ cos(180\/6), h = shaftLength+smidge,center = true, $fn=6); \/\/ ShaftNut Hole\r\n translate([0,0,shaftLength\/2 + wheelThickness\/2])\r\n cylinder(r = wheelBoltDia, h = wheelThickness,center = true); \/\/ ShaftNut Hole\r\n }\r\n \r\n}\r\n\r\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6a638eadf7cede9341358e3251f4b0143204fe28","subject":"whole structure is now ready","message":"whole structure is now ready\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bed_foot\/bed_foot.scad","new_file":"bed_foot\/bed_foot.scad","new_contents":"eps=0.01;\n\nmodule bed_foot()\n{\n h=60;\n d=52;\n difference()\n {\n cylinder(d=d, h=h, $fn=200);\n {\n $fn=50;\n \/\/ screw drill\n translate(-eps*[0,0,1])\n cylinder(d=4.5, h=h+2*eps);\n \/\/ screw guide\n translate(10*[0,0,1])\n cylinder(d1=10, d2=30, h=h);\n }\n }\n}\n\n\nbed_foot();\n","old_contents":"module bed_foot()\n{\n h=60;\n d=52;\n cylinder(d=d, h=h, $fn=200);\n}\n\n\nbed_foot();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6e888a7d7736cf9f5ef3c34c6ce85fac01918e71","subject":"fanduct: cleanup","message":"fanduct: cleanup\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"fanduct.scad","new_file":"fanduct.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($preview_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nfanduct();\n\/*part_fanduct();*\/\n","old_contents":"include \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\nuse \n\ninclude \n\nfunction vec_xyz(v) = [for(v=v) let(v_=v) [v_[0],v_[1], v_[2]]];\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nlet(filtered = filter(slice,U))\nconcat(\n [S[0]],\n nSpline(filtered, N)\n );\n\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($preview_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n\n sweepshape(A,true);\n }\n else\n {\n sweepshape(A,true);\n }\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nuse \nuse \nuse \n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct()\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n fanduct_conn_fan = [[0,0,-throat_seal_h\/2],-Z];\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 90)\n fan_5015S();\n\n fanduct_throat(throat_seal_h);\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nfanduct();\n\/*part_fanduct();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5d7825869d52ca08ffd6c0ce0ea0fdb722943d78","subject":"mk2 airbox","message":"mk2 airbox\n","repos":"JoeSuber\/QuickerPicker","old_file":"innerds.scad","new_file":"innerds.scad","new_contents":"\/\/ collection of parts for the new picker idea\n\nairflow = 57;\nsleeveout = airflow+1;\n\n\/\/ [fullOD, shaftD, thickness, turning_hubD]\nhubbearing = [22,8,7,13];\ntravelbearing = [6,3,2.5,5];\ntravelwheel = 60;\ntravelpeg = travelwheel - travelbearing[1];\n\nfat = 0.3; \/\/ add-on to make walls cut out enough space\nhb = 12.7 + fat; \/\/ height of bar cross-section\nwthk = 1.5 + fat; \/\/ thickness of walls\nflrthk = 1.6 + fat; \/\/ thickness of floor (that walls extend from)\ninside = 6.9 - fat; \/\/ between walls, across floor (subtracting 2*.5*fat)\nc_bar = [[0,0], [0,hb], [wthk, hb], [wthk, flrthk], [wthk+inside, flrthk], [wthk+inside, hb], [wthk+inside+wthk, hb], [wthk+inside+wthk, 0]];\n\n\/\/#shaft(travelbearing);\n\/\/#cbar(barH=100);\n\/\/#can_sleeve();\n\/\/translate([50,50,0])\n\/\/ for (i=[0:3:360]){\n\/\/ nutbolt(nut_position=20*i\/360, channel_ang=i);\n\/\/ }\n\/\/bigwheel_part();\n\/\/ bartest();\n\n\/\/ ** the can traveler by itself ***\n\/\/rotate([0,0,180]) translate([0, -56, +25.9])\n \/\/upndown(); \n\n\/\/motorcut();\n\/\/cbar();\n\n\/\/ ** the main picker body ** \n\/\/cbracket();\n\n\/\/ ** the valve parts **\nlouvers();\n\nplate_air_parts();\n \n\n\/\/ for cutting out shaft and hub-turning space\nmodule shaft(bearing, xtraH=0, hubclearance=0.5){\n height=bearing[2] + xtraH;\n translate([0,0,-height\/2-hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n translate([0,0,0])\n cylinder(r=bearing[1]\/2, h=height, center=true, $fn=24);\n translate([0,0,height\/2+hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n echo(\"shaft of bearing = \", bearing, \"is top-to-bottom = \", hubclearance*2 + height);\n} \n\n\/\/ alluminum c-channel, positive or negative\nmodule cbar(outline=c_bar, barH=50){\n midbar = outline[7][0] \/ 2;\n echo(\"midbar read as: \",midbar);\n translate([-midbar,0,0])\n linear_extrude(center=true, height=barH, convexity=10, slices=2)\n polygon(points=outline);\n}\n\n\/\/ intended as positive model, could add scale or thickness\nmodule can_sleeve (emptyness=airflow, thickness=sleeveout-airflow-0.2, sleeveH=25){\n translate([0,0,-sleeveH\/2])\n rotate_extrude($fn=196)\n translate([(emptyness+thickness) \/ 2, 0, 0])\n polygon(points=[[0,0], [0,sleeveH], [thickness,sleeveH], [thickness,0]]);\n}\n\n\/\/ negative model with channel for captured nut insertion\nmodule nutbolt(hexhead=6.65, \n shaftD=3.1, \n shaftlen=20, \n nut_position=17,\n nut_thick=2.33, \n channel_len=30, \n channel_ang=0,){\n color( .5, .9, .9 )\n translate([0,0,-shaftlen\/2]){ \/\/center it by shaftlen\n \/\/shaft\n cylinder(r=shaftD\/2, h=shaftlen, center=false, $fn=18);\n \/\/head\n #translate([0,0,shaftlen-hexhead\/2])\n cylinder(r=hexhead\/2, h=hexhead\/2, center=false, $fn=6);\n \/\/nut + channel\n translate([0,0,shaftlen-nut_position])\n hull(){\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.1, h=nut_thick+.1, center=false, $fn=6);\n translate([cos(channel_ang)*channel_len, \n sin(channel_ang)*channel_len, 0])\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.2, h=nut_thick+.1, center=false, $fn=6);\n }\n }\n}\n\nmodule motorhub(flat_to_flat=4.76, diameter=7.4, height=5.57, baseD=9, baseH=1.0){\n cutrad = (diameter - flat_to_flat)\/2;\n cutcenter = flat_to_flat\/2 + cutrad;\n cylinder(r=baseD\/2, h=baseH+0.1, center=false, $fn=36);\n cylinder(r=0.8, h=baseH+5*height+.1, center=true, $fn=6);\n translate([0,0,baseH])\n difference(){\n cylinder(r=diameter\/2, h=height+baseH, center=false, $fn=24);\n for (i=[cutcenter+0.05, -cutcenter-0.05]){\n translate([0,i,(height+baseH)\/2])\n cube([diameter+0.1, cutrad+0.1, height+.1], center=true);\n }\n\n }\n}\n \nmodule bigwheel_part(od=travelwheel, thk=4, hub=12, hubthk=4, holes=6, lever=5){\n overall_thk = thk+hubthk;\n echo(\"overall bigwheel thickness is : \", overall_thk);\n difference(){\n union(){\n cylinder(r=od\/2, h=thk, $fn=196);\n translate([0,0,4])\n cylinder(r=hub\/2, h=hubthk, $fn=64);\n }\n translate([0,0,overall_thk+0.05]) rotate([180,0,0])\n motorhub();\n for (i=[0 : 360\/holes : 360-(360\/holes)*.5]){\n translate([od\/3.14*cos(i), od\/3.14*sin(i), hubthk\/2])\n cylinder(r=od*.5\/(holes-1), h=hubthk+.1, center=true, $fn=42);\n }\n translate([0,od\/2-lever,-9]) rotate([0,0,0])\n nutbolt();\n translate([0,-od\/2+lever,-9]) rotate([0,0,0])\n nutbolt();\n }\n}\n\nmodule ring(ID, OD, ht){\n difference(){\n cylinder(r=OD\/2, h=ht, center=true, $fn=96);\n cylinder(r=ID\/2, h=ht+.1, center=true, $fn=96);\n }\n}\n\n\/\/ for LMB8MM\nmodule bearingcut(D=15.1\/2, dring=14.41\/2, drod=8.9\/2, dziptie=[19,3.3],){\n rotate_extrude(center=true, convexity=10, $fn=36){\n polygon(points=[[0,-2], [D,0], \n [D,3.3], [dring,3.3], \n [dring,4.55], [D,4.55], \n [D,19.35], [dring,19.35], \n [dring,20.8], [D,20.8], \n [D, 24.01], [0,26.01]]);\n }\n \/\/ zip tie rings\n for (i=[(3.3+4.55)\/2, (19.35+20.8)\/2]){\n translate([0,0,i])\n ring(dziptie[0], dziptie[0]+dziptie[1], 5);\n }\n \/\/ rod upon which it travels\n translate([0,0,12])\n cylinder(r=drod, h=90, $fn=18, center=true);\n}\n\nmodule bigwheel_cutout(od=travelwheel+3, thk=10){\n cylinder(r=od\/2, h=thk, $fn=128);\n}\n\nmodule bartest(ht=10){\n difference(){\n minkowski(){\n cube([20,20,10], center=true);\n cylinder(r=4, h=.1, center=true, $fn=24);\n }\n translate([-7,-9,0])\n #cbar(barH=30);\n translate([17,0,0]) rotate([0,0,90])\n #cbar(barH=30);\n translate([0,10.5,0]) rotate([90,0,0])\n #shaft(hubbearing);\n }\n}\n\nmodule upndown(ht=travelwheel){\n difference(){\n cube([travelwheel, travelwheel\/2, ht], center=true);\n \/\/ lift rail\n translate([0, travelwheel\/2-hb, 0])\n cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+.5 ,3.25, 0]) rotate([0,0,-0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n translate([travelwheel\/2-.5 ,3.25, 0]) rotate([0,0,0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n\n \/\/ cylinder space\n translate([0, -travelwheel\/2, 0])\n cylinder(r = (sleeveout+.5)\/2, h=ht+.1, $fn=196, center=true);\n \/\/ nuts\n translate([0,0,ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=90);\n translate([0,0,-ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=-90);\n }\n \/\/ underside printing supports for lift rail\n for (i=[0:5:travelwheel-1]){\n translate([i - travelwheel\/2+2.5, travelwheel\/2-hb*1.333, 0])\n cube([.5, hb*.37, c_bar[6][0]+.1], center=true);\n }\n}\n\nmodule upndown_cutout(ht=travelwheel){\n translate([0,-4.5,0])\n cube([travelwheel+1, travelwheel\/2+9.5, ht+2], center=true);\n \/\/ lift rail\n \/\/translate([0, travelwheel\/2+hb, 0])\n \/\/ cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+hb\/2+.2,-5, 0]) rotate([0,0,90])\n cbar(barH=70);\n translate([travelwheel\/2-hb\/2-.2,-5, 0]) rotate([0,0,-90])\n cbar(barH=70);\n \/\/ cylinder of suckage\n translate([0, -travelwheel\/2 -9.5, 0])\n cylinder(r = (sleeveout+2)\/2, h=ht+2, $fn=196, center=true);\n\n}\n\nmodule motorcut(x=23,y=22,z=37,tab=[6,4,5],tabpos=7,curverad=5, shaftpos=[0,11,16], canheight=28){\n tiptop = canheight + z + tab[2] - curverad;\n \/\/ top-motorhousing\n translate([0,y\/2, tiptop - canheight])\n cylinder(r=x\/2, h=canheight, center=false, $fn=36);\n \/\/ gearbox housing\n translate([-(x-curverad*2)\/2, 0, curverad+tab[2]])\n minkowski(){\n cube([x-curverad*2,y,z-curverad*2], center=false);\n rotate([90,0,0])\n cylinder(r=curverad, h=.1, center=false, $fn=64);\n }\n \/\/ tab thingy for motor attachment\n translate([0,tabpos+tab[1]\/2, tab[2]\/2]){\n cube(tab, center=true);\n \/\/ cuts hole for bolting tab\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ driven hub stub and slide-in track\n translate(shaftpos)\n rotate([90,0,0])\n hull(){\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n }\n \/\/ cuts shaft for holes that penetrate housing\n for (i=[1,-1]){\n translate([17.75\/2 * i, 0, 36])\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ add on the driven wheel\n translate(shaftpos)\n rotate([90, 0,0]) translate([0,0,-y]){\n bigwheel_cutout();\n \/\/ and its connection hub\n translate([0,0,+3])\n hull(){\n cylinder(r=8, h=15, $fn=16, center=false);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=8, h=15, $fn=16, center=false);\n }\n }\n \/\/ make a cut-out for the traveling part\n rotate([0,0,180]) translate(shaftpos) translate([0,-59,0])\n upndown_cutout();\n}\n\n\n\/\/ carve the big thing out of a block \nmodule cbracket(z=travelwheel\/2, bs=1.5){\n difference(){\n translate([-travelwheel\/2, 0, -4])\n minkowski(){\n cube([travelwheel, travelwheel*1.2, travelwheel-17], center=false);\n cylinder(r=8, h=1, $fn=16);\n }\n motorcut();\n translate([-travelwheel\/2-bs, -bs, 4]) \n bearingcut();\n translate([travelwheel\/2+bs,-bs, 4])\n bearingcut();\n translate([z+2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=45);\n translate([-z-2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=135);\n translate([-z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=180);\n translate([z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=0);\n }\n}\n\/\/\/\/-----------------------------\/\/\/\/\n\/\/\/\/ *** air valve section **** \/\/\/\/\n\/\/\/\/ ____________________________\/\/\/\/\n\nflapquant=4;\nopeningside=airflow\/flapquant;\nflapthick = 5;\nbuttonht = 4;\ngap = 1.8; \/\/ between walls\n\nflap = [[0,0], [flapthick,openingside], [flapthick,0], [0,-openingside]];\n\nmodule one_love(scaler=1){\n \/\/ one flap with key holes \n difference(){\n translate([-flapthick\/2, 0, 0])\n linear_extrude(height=airflow){\n polygon(points=flap);\n }\n translate([0,0, airflow\/2]) rotate([0,0,-10.1])\n scale([scaler,scaler,1]){\n cube([flapthick\/2.8, openingside\/1.5, airflow+.1], center=true);\n cylinder(r=1.6, h=airflow+.1, $fn=16, center=true);\n }\n }\n}\n\nmodule carabas(wheelrad=openingside\/2){\n \/\/ its the place for louvers\n wheel = max(wheelrad, 3);\n difference(){\n cylinder(r1=wheel, r2=wheel-3, h=buttonht, $fn=196, center=true);\n scale([1.07,1.07,1]) \n one_love(scaler=0.85);\n cylinder(r=1.6, h=4.1, $fn=16, center=true);\n }\n}\n\nmodule lever(lvrad= openingside\/2 +1.5, lvthk=gap\/2){\n difference(){\n hull(){\n cylinder(r=lvrad, h=lvthk, center=false, $fn=36);\n translate([0,25,0])\n cylinder(r=lvrad, h=lvthk, center=false, $fn=36);\n }\n hull(){\n translate([0,10,-0.05])\n cylinder(r=1.82, h=lvthk+0.1, center=false, $fn=36);\n translate([0,26,-0.05])\n cylinder(r=1.82, h=lvthk+0.1, center=false, $fn=36);\n }\n }\n}\n\nmodule louvers(){\n \/\/ the flaps- working well standing up\n for (i=[0:flapquant-2]){\n translate([i*openingside, 0, 0]) rotate([0,0,75])\n one_love(); \n translate([i*(openingside+3.2),-openingside*3 ,buttonht\/2+gap\/2]){\n carabas();\n \/\/translate([0, 0, -buttonht\/2 - gap\/2])\n \/\/ lever();\n mirror([0,1,0]) \/\/{\n translate([0, openingside*1.2, 0]) \n carabas();\n \/\/ translate([0, openingside*1.2, - buttonht\/2- gap\/2])\n \/\/ lever();}\n } \n } \n \/\/translate([airflow\/2-openingside,openingside,airflow\/2]) rotate([90,0,0])\n \/\/ #circle(r=30, $fn=128, center=true);\n}\n\nmodule side_plate(sidethick=2, insider=1){\n \/\/ laying on its... side \n difference(){\n translate([airflow - openingside*(flapquant-1), 0, buttonht\/4])\n union(){\n cube([airflow, openingside*2 + 1, buttonht\/2], center=true);\n for (i=[1,-1]){\n translate([i * (airflow\/2+sidethick\/2), 0,0]) rotate([0,-i*90,0])\n notcher();\n }\n }\n \n if (insider==1){ \n for (i=[0:flapquant-2]){ \n translate([i*openingside*1.06, 0, buttonht\/2+0.05]) scale([1.09,1.09,1.09])\n carabas();\n }\n }\n }\n}\n\nmodule notcher(cd=2.2, cz=6, clong=1){\n difference(){\n cube([cd, openingside*2, cz], center=true);\n translate([0,0,-clong\/2-0.05])\n cube([cd+0.05, openingside*2-((cz-clong)*2), cz-clong], center=true);\n }\n}\n \nmodule end_plate(sidethick=2.2, ridge=1, cc=buttonht\/2+0.2){\n xlen = airflow+sidethick*4+gap*2+ridge*2;\n translate([0,0,(sidethick+ridge)\/2])\n difference(){\n cube([xlen, openingside*2 + 1, sidethick+ridge], center=true);\n translate([0,openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n translate([0,-openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n for (i=[1,-1], j=[cc, cc*3.5]){\n translate([i*(xlen\/2-j),0, 0])\n scale([1.05,1.05,1.05])\n notcher(cd=cc, cz=6, clong=ridge);\n }\n }\n}\n\nmodule plate_air_parts(){\n translate([0,52,0]) end_plate();\n mirror([ 1, 0, 0 ]) { \n translate([0,22,0]) end_plate(); }\n\n translate([airflow+2,-55,2]) rotate([180,0,90]) side_plate();\n mirror([ 1, 0, 0 ]) { \n translate([-airflow-1,15,2]) rotate([180,0,90]) side_plate(); }\n\n translate([-25,-airflow+13,0]) rotate([0,0,90]){\n side_plate(insider=0);\n mirror([ 1, 0, 0 ]) {\n translate([65,airflow-100,0]) rotate([0,0,90])\n side_plate(insider=0); }\n }\n}\n","old_contents":"\/\/ collection of parts for the new picker idea\n\nairflow = 57;\nsleeveout = airflow+1;\n\n\/\/ [fullOD, shaftD, thickness, turning_hubD]\nhubbearing = [22,8,7,13];\ntravelbearing = [6,3,2.5,5];\ntravelwheel = 60;\ntravelpeg = travelwheel - travelbearing[1];\n\nfat = 0.3; \/\/ add-on to make walls cut out enough space\nhb = 12.7 + fat; \/\/ height of bar cross-section\nwthk = 1.5 + fat; \/\/ thickness of walls\nflrthk = 1.6 + fat; \/\/ thickness of floor (that walls extend from)\ninside = 6.9 - fat; \/\/ between walls, across floor (subtracting 2*.5*fat)\nc_bar = [[0,0], [0,hb], [wthk, hb], [wthk, flrthk], [wthk+inside, flrthk], [wthk+inside, hb], [wthk+inside+wthk, hb], [wthk+inside+wthk, 0]];\n\n\/\/#shaft(travelbearing);\n\/\/#cbar(barH=100);\n\/\/#can_sleeve();\n\/\/translate([50,50,0])\n\/\/ for (i=[0:3:360]){\n\/\/ nutbolt(nut_position=20*i\/360, channel_ang=i);\n\/\/ }\n\/\/bigwheel_part();\n\/\/ bartest();\n\n\/\/ ** the can traveler by itself ***\n\/\/rotate([0,0,180]) translate([0, -56, +25.9])\n \/\/upndown(); \n\n\/\/motorcut();\n\/\/cbar();\n\n\/\/ ** the main picker body ** \n\/\/cbracket();\n\n\/\/ ** the valve parts **\nlouvers();\n \n\n\/\/ for cutting out shaft and hub-turning space\nmodule shaft(bearing, xtraH=0, hubclearance=0.5){\n height=bearing[2] + xtraH;\n translate([0,0,-height\/2-hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n translate([0,0,0])\n cylinder(r=bearing[1]\/2, h=height, center=true, $fn=24);\n translate([0,0,height\/2+hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n echo(\"shaft of bearing = \", bearing, \"is top-to-bottom = \", hubclearance*2 + height);\n} \n\n\/\/ alluminum c-channel, positive or negative\nmodule cbar(outline=c_bar, barH=50){\n midbar = outline[7][0] \/ 2;\n echo(\"midbar read as: \",midbar);\n translate([-midbar,0,0])\n linear_extrude(center=true, height=barH, convexity=10, slices=2)\n polygon(points=outline);\n}\n\n\/\/ intended as positive model, could add scale or thickness\nmodule can_sleeve (emptyness=airflow, thickness=sleeveout-airflow-0.2, sleeveH=25){\n translate([0,0,-sleeveH\/2])\n rotate_extrude($fn=196)\n translate([(emptyness+thickness) \/ 2, 0, 0])\n polygon(points=[[0,0], [0,sleeveH], [thickness,sleeveH], [thickness,0]]);\n}\n\n\/\/ negative model with channel for captured nut insertion\nmodule nutbolt(hexhead=6.65, \n shaftD=3.1, \n shaftlen=20, \n nut_position=17,\n nut_thick=2.33, \n channel_len=30, \n channel_ang=0,){\n color( .5, .9, .9 )\n translate([0,0,-shaftlen\/2]){ \/\/center it by shaftlen\n \/\/shaft\n cylinder(r=shaftD\/2, h=shaftlen, center=false, $fn=18);\n \/\/head\n #translate([0,0,shaftlen-hexhead\/2])\n cylinder(r=hexhead\/2, h=hexhead\/2, center=false, $fn=6);\n \/\/nut + channel\n translate([0,0,shaftlen-nut_position])\n hull(){\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.1, h=nut_thick+.1, center=false, $fn=6);\n translate([cos(channel_ang)*channel_len, \n sin(channel_ang)*channel_len, 0])\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.2, h=nut_thick+.1, center=false, $fn=6);\n }\n }\n}\n\nmodule motorhub(flat_to_flat=4.76, diameter=7.4, height=5.57, baseD=9, baseH=1.0){\n cutrad = (diameter - flat_to_flat)\/2;\n cutcenter = flat_to_flat\/2 + cutrad;\n cylinder(r=baseD\/2, h=baseH+0.1, center=false, $fn=36);\n cylinder(r=0.8, h=baseH+5*height+.1, center=true, $fn=6);\n translate([0,0,baseH])\n difference(){\n cylinder(r=diameter\/2, h=height+baseH, center=false, $fn=24);\n for (i=[cutcenter+0.05, -cutcenter-0.05]){\n translate([0,i,(height+baseH)\/2])\n cube([diameter+0.1, cutrad+0.1, height+.1], center=true);\n }\n\n }\n}\n \nmodule bigwheel_part(od=travelwheel, thk=4, hub=12, hubthk=4, holes=6, lever=5){\n overall_thk = thk+hubthk;\n echo(\"overall bigwheel thickness is : \", overall_thk);\n difference(){\n union(){\n cylinder(r=od\/2, h=thk, $fn=196);\n translate([0,0,4])\n cylinder(r=hub\/2, h=hubthk, $fn=64);\n }\n translate([0,0,overall_thk+0.05]) rotate([180,0,0])\n motorhub();\n for (i=[0 : 360\/holes : 360-(360\/holes)*.5]){\n translate([od\/3.14*cos(i), od\/3.14*sin(i), hubthk\/2])\n cylinder(r=od*.5\/(holes-1), h=hubthk+.1, center=true, $fn=42);\n }\n translate([0,od\/2-lever,-9]) rotate([0,0,0])\n nutbolt();\n translate([0,-od\/2+lever,-9]) rotate([0,0,0])\n nutbolt();\n }\n}\n\nmodule ring(ID, OD, ht){\n difference(){\n cylinder(r=OD\/2, h=ht, center=true, $fn=96);\n cylinder(r=ID\/2, h=ht+.1, center=true, $fn=96);\n }\n}\n\n\/\/ for LMB8MM\nmodule bearingcut(D=15.1\/2, dring=14.41\/2, drod=8.9\/2, dziptie=[19,3.3],){\n rotate_extrude(center=true, convexity=10, $fn=36){\n polygon(points=[[0,-2], [D,0], \n [D,3.3], [dring,3.3], \n [dring,4.55], [D,4.55], \n [D,19.35], [dring,19.35], \n [dring,20.8], [D,20.8], \n [D, 24.01], [0,26.01]]);\n }\n \/\/ zip tie rings\n for (i=[(3.3+4.55)\/2, (19.35+20.8)\/2]){\n translate([0,0,i])\n ring(dziptie[0], dziptie[0]+dziptie[1], 5);\n }\n \/\/ rod upon which it travels\n translate([0,0,12])\n cylinder(r=drod, h=90, $fn=18, center=true);\n}\n\nmodule bigwheel_cutout(od=travelwheel+3, thk=10){\n cylinder(r=od\/2, h=thk, $fn=128);\n}\n\nmodule bartest(ht=10){\n difference(){\n minkowski(){\n cube([20,20,10], center=true);\n cylinder(r=4, h=.1, center=true, $fn=24);\n }\n translate([-7,-9,0])\n #cbar(barH=30);\n translate([17,0,0]) rotate([0,0,90])\n #cbar(barH=30);\n translate([0,10.5,0]) rotate([90,0,0])\n #shaft(hubbearing);\n }\n}\n\nmodule upndown(ht=travelwheel){\n difference(){\n cube([travelwheel, travelwheel\/2, ht], center=true);\n \/\/ lift rail\n translate([0, travelwheel\/2-hb, 0])\n cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+.5 ,3.25, 0]) rotate([0,0,-0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n translate([travelwheel\/2-.5 ,3.25, 0]) rotate([0,0,0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n\n \/\/ cylinder space\n translate([0, -travelwheel\/2, 0])\n cylinder(r = (sleeveout+.5)\/2, h=ht+.1, $fn=196, center=true);\n \/\/ nuts\n translate([0,0,ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=90);\n translate([0,0,-ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=-90);\n }\n \/\/ underside printing supports for lift rail\n for (i=[0:5:travelwheel-1]){\n translate([i - travelwheel\/2+2.5, travelwheel\/2-hb*1.333, 0])\n cube([.5, hb*.37, c_bar[6][0]+.1], center=true);\n }\n}\n\nmodule upndown_cutout(ht=travelwheel){\n translate([0,-4.5,0])\n cube([travelwheel+1, travelwheel\/2+9.5, ht+2], center=true);\n \/\/ lift rail\n \/\/translate([0, travelwheel\/2+hb, 0])\n \/\/ cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+hb\/2+.2,-5, 0]) rotate([0,0,90])\n cbar(barH=70);\n translate([travelwheel\/2-hb\/2-.2,-5, 0]) rotate([0,0,-90])\n cbar(barH=70);\n \/\/ cylinder of suckage\n translate([0, -travelwheel\/2 -9.5, 0])\n cylinder(r = (sleeveout+2)\/2, h=ht+2, $fn=196, center=true);\n\n}\n\nmodule motorcut(x=23,y=22,z=37,tab=[6,4,5],tabpos=7,curverad=5, shaftpos=[0,11,16], canheight=28){\n tiptop = canheight + z + tab[2] - curverad;\n \/\/ top-motorhousing\n translate([0,y\/2, tiptop - canheight])\n cylinder(r=x\/2, h=canheight, center=false, $fn=36);\n \/\/ gearbox housing\n translate([-(x-curverad*2)\/2, 0, curverad+tab[2]])\n minkowski(){\n cube([x-curverad*2,y,z-curverad*2], center=false);\n rotate([90,0,0])\n cylinder(r=curverad, h=.1, center=false, $fn=64);\n }\n \/\/ tab thingy for motor attachment\n translate([0,tabpos+tab[1]\/2, tab[2]\/2]){\n cube(tab, center=true);\n \/\/ cuts hole for bolting tab\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ driven hub stub and slide-in track\n translate(shaftpos)\n rotate([90,0,0])\n hull(){\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n }\n \/\/ cuts shaft for holes that penetrate housing\n for (i=[1,-1]){\n translate([17.75\/2 * i, 0, 36])\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ add on the driven wheel\n translate(shaftpos)\n rotate([90, 0,0]) translate([0,0,-y]){\n bigwheel_cutout();\n \/\/ and its connection hub\n translate([0,0,+3])\n hull(){\n cylinder(r=8, h=15, $fn=16, center=false);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=8, h=15, $fn=16, center=false);\n }\n }\n \/\/ make a cut-out for the traveling part\n rotate([0,0,180]) translate(shaftpos) translate([0,-59,0])\n upndown_cutout();\n}\n\n\n\/\/ carve the big thing out of a block \nmodule cbracket(z=travelwheel\/2, bs=1.5){\n difference(){\n translate([-travelwheel\/2, 0, -4])\n minkowski(){\n cube([travelwheel, travelwheel*1.2, travelwheel-17], center=false);\n cylinder(r=8, h=1, $fn=16);\n }\n motorcut();\n translate([-travelwheel\/2-bs, -bs, 4]) \n bearingcut();\n translate([travelwheel\/2+bs,-bs, 4])\n bearingcut();\n translate([z+2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=45);\n translate([-z-2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=135);\n translate([-z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=180);\n translate([z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=0);\n }\n}\n\/\/\/\/-----------------------------\/\/\/\/\n\/\/\/\/ *** air valve section **** \/\/\/\/\n\/\/\/\/ ____________________________\/\/\/\/\n\nflapquant=4;\nopeningside=airflow\/flapquant;\nflapthick = 5;\nbuttonht = 4;\ngap = 2; \/\/ between walls\n\nflap = [[0,0], [flapthick,openingside], [flapthick,0], [0,-openingside]];\n\nmodule one_love(scaler=1){\n \/\/ one flap with key holes \n difference(){\n translate([-flapthick\/2, 0, 0])\n linear_extrude(height=airflow){\n polygon(points=flap);\n }\n translate([0,0, airflow\/2]) rotate([0,0,-10.1])\/\/rotate([0,0,flapthick\/openingside*3.141592654\/180])\n scale([scaler,scaler,1]){\n cube([flapthick\/2.8, openingside\/1.5, airflow+.1], center=true);\n cylinder(r=1.6, h=airflow+.1, $fn=16, center=true);\n }\n }\n}\n\nmodule carabas(wheelrad=openingside\/2){\n \/\/ its the place for louvers\n wheel = max(wheelrad, 3);\n difference(){\n cylinder(r1=wheel, r2=wheel-3, h=buttonht, $fn=196, center=true);\n scale([1.07,1.07,1]) \n one_love(scaler=0.92);\n cylinder(r=1.6, h=4.1, $fn=16, center=true);\n }\n}\n\nmodule lever(lvrad= openingside\/2 +1.5, lvthk=gap\/2){\n difference(){\n hull(){\n cylinder(r=lvrad, h=lvthk, center=false, $fn=36);\n translate([0,25,0])\n cylinder(r=lvrad, h=lvthk, center=false, $fn=36);\n }\n hull(){\n translate([0,10,-0.05])\n cylinder(r=1.82, h=lvthk+0.1, center=false, $fn=36);\n translate([0,26,-0.05])\n cylinder(r=1.82, h=lvthk+0.1, center=false, $fn=36);\n }\n }\n}\n\nmodule louvers(){\n \/\/ the flaps- standing up for now\n for (i=[0:flapquant-2]){\n translate([i*openingside, 0, 0]) rotate([0,0,75])\n one_love(); \n translate([i*(openingside+3.2),-openingside*3 ,buttonht\/2+gap\/2]){\n carabas();\n translate([0, 0, -buttonht\/2 - gap\/2])\n lever();\n mirror([0,1,0]) {\n translate([0, openingside*1.2, 0]) \n carabas();\n translate([0, openingside*1.2, - buttonht\/2- gap\/2])\n lever();}\n } \n } \n \/\/translate([airflow\/2-openingside,openingside,airflow\/2]) rotate([90,0,0])\n \/\/ #circle(r=30, $fn=128, center=true);\n}\n\nmodule side_plate(sidethick=5, insider=1){\n \/\/ laying on its... side \n difference(){\n translate([airflow - openingside*(flapquant-1), 0, buttonht\/4])\n union(){\n cube([airflow, openingside*2 + 1, buttonht\/2], center=true);\n for (i=[1,-1]){\n translate([i * (airflow\/2+sidethick\/2), 0,0]) rotate([0,-i*90,0])\n notcher();\n }\n }\n \n if (insider==1){ \n for (i=[0:flapquant-2]){ \n translate([i*openingside*1.06, 0, buttonht\/2+0.05]) scale([1.09,1.09,1.09])\n carabas();\n }\n }\n }\n}\n\nmodule notcher(cd=2.2, cz=6, clong=1){\n difference(){\n cube([cd, openingside*2, cz], center=true);\n translate([0,0,-clong\/2-0.05])\n cube([cd+0.05, openingside*2-((cz-clong)*2), cz-clong], center=true);\n }\n}\n \nmodule end_plate(sidethick=5, ridge=1, cc=buttonht\/2+0.2){\n xlen = airflow+sidethick*4+gap*2+ridge*2;\n translate([0,0,(sidethick+ridge)\/2])\n difference(){\n cube([xlen, openingside*2 + 1, sidethick+ridge], center=true);\n translate([0,openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n translate([0,-openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n for (i=[1,-1], j=[cc, cc*3.5]){\n translate([i*(xlen\/2-j),0, 0])\n scale([1.05,1.05,1.05])\n notcher(cd=cc, cz=sidethick+ridge, clong=ridge);\n }\n }\n}\n\ntranslate([0,52,0]) end_plate();\nmirror([ 1, 0, 0 ]) { \ntranslate([0,22,0]) end_plate(); }\n\ntranslate([airflow+2,-55,2]) rotate([180,0,90]) side_plate();\nmirror([ 1, 0, 0 ]) { \ntranslate([-airflow-1,15,2]) rotate([180,0,90]) side_plate(); }\n\ntranslate([-25,-airflow+13,0]) rotate([0,0,90]){\n side_plate(insider=0);\n mirror([ 1, 0, 0 ]) {\n translate([65,airflow-100,0]) rotate([0,0,90])\n side_plate(insider=0); }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"68c98fa1ab88fd1e11b3faffec47119866e2fc4f","subject":"Refining layout","message":"Refining layout\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBotPolarGraph.scad","new_file":"hardware\/assemblies\/LogoBotPolarGraph.scad","new_contents":"\nmodule LogoBotPolarGraphAssembly () {\n\n assembly(\"assemblies\/LogoBotPolarGraph.scad\", \"LogoBot Polar Graph\", str(\"LogoBotPolarGraphAssembly()\")) {\n\n \/\/ Rough placement of the polar graph parts\n\n\n \/\/ bit of wood to fix it all to\n color([0.8,0.7,0.6])\n translate([-250,-10,-20])\n cube([500,20,20]);\n\n \/\/ drawing surface\n color([0.9,0.9,0.9])\n translate([-250,-10,-420])\n cube([500,4,400]);\n\n \/\/ wheels - aka winches\n attach([[240,0,0],[0,0,-1],0,00], MotorClip_Con_Fixing1, ExplodeSpacing = 40)\n LeftWheelAssembly();\n\n attach([[-240,0,0],[0,0,-1],0,00], MotorClip_Con_Fixing2, ExplodeSpacing = 40)\n RightWheelAssembly();\n\n\n \/\/ gondola - aka base\n attach([[0,-GroundClearance-10,-150],[0,1,0],0,0,0], DefConDown) {\n LogoBotBase_STL();\n\n \/\/ need the pen lift and servo, but rotated 90 deg\n rotate([0,0,90]) {\n attach(LogoBot_Con_PenLift_Front, PenLiftSlider_Con_BaseFront)\n PenLiftAssembly();\n\n attach(LogoBot_Con_PenLiftServo, MicroServo_Con_Horn, ExplodeSpacing=0) {\n MicroServo();\n attach(MicroServo_Con_Horn, ServoHorn_Con_Default)\n ServoHorn();\n }\n }\n\n \/\/ and some castors to hold the base away from the drawing surface\n attach(invertConnector(LogoBot_Con_GridFixing(3,4,0)), MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n attach(invertConnector(LogoBot_Con_GridFixing(-3,4,0)), MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n attach(invertConnector(LogoBot_Con_GridFixing(0,-6,0)), MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n }\n\n\n \/\/ electronic stuff at the top somewhere\n attach([[0,0,3],[0,0,-1],90,0,0], ArduinoPro_Con_Center, ExplodeSpacing=20)\n ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Opposite, true);\n\n\n \/\/ steps\n step(1, \"Do something\") {\n view(t=[0,0,0], r=[52,0,218], d=400);\n\n \/\/attach(DefConDown, DefConDown)\n \/\/ AnotherAssembly();\n }\n\n\n\n }\n}\n","old_contents":"\nmodule LogoBotPolarGraphAssembly () {\n\n assembly(\"assemblies\/LogoBotPolarGraph.scad\", \"LogoBot Polar Graph\", str(\"LogoBotPolarGraphAssembly()\")) {\n\n \/\/ Rough placement of the polar graph parts\n\n\n \/\/ bit of wood to fix it all to\n color([0.8,0.7,0.6])\n translate([-200,-10,-20])\n cube([400,20,20]);\n\n \/\/ drawing surface\n color([0.9,0.9,0.9])\n translate([-200,-10,-420])\n cube([400,4,400]);\n\n \/\/ wheels - aka winches\n attach([[200,0,0],[0,0,-1],0,00], MotorClip_Con_Fixing1, ExplodeSpacing = 40)\n RightWheelAssembly();\n\n attach([[-200,0,0],[0,0,-1],0,00], MotorClip_Con_Fixing2, ExplodeSpacing = 40)\n LeftWheelAssembly();\n\n\n \/\/ gondola - aka base\n attach([[0,-GroundClearance-10,-150],[0,1,0],0,0,0], DefConDown) {\n LogoBotBase_STL();\n\n \/\/ need the pen lift and servo, but rotated 90 deg\n rotate([0,0,90]) {\n attach(LogoBot_Con_PenLift_Front, PenLiftSlider_Con_BaseFront)\n PenLiftAssembly();\n\n attach(LogoBot_Con_PenLift_Front, offsetConnector(DefConUp, [0, 0, 2 + 2.5]), ExplodeSpacing=20)\n PinTack_STL(h=2.5+4+2.5);\n attach(LogoBot_Con_PenLift_Rear, offsetConnector(DefConUp, [0, 0, 2 + 2.5]), ExplodeSpacing=20)\n PinTack_STL(h=2.5+4+2.5);\n\n attach(LogoBot_Con_PenLiftServo, MicroServo_Con_Horn, ExplodeSpacing=0) {\n MicroServo();\n attach(MicroServo_Con_Horn, ServoHorn_Con_Default)\n ServoHorn();\n }\n }\n\n \/\/ and some castors to hold the base away from the drawing surface\n attach(invertConnector(LogoBot_Con_GridFixing(3,4,0)), MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n attach(invertConnector(LogoBot_Con_GridFixing(-3,4,0)), MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n attach(invertConnector(LogoBot_Con_GridFixing(0,-6,0)), MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n }\n\n\n \/\/ electronic stuff at the top somewhere\n attach([[0,0,3],[0,0,-1],90,0,0], ArduinoPro_Con_Center, ExplodeSpacing=20)\n ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Opposite, true);\n\n\n \/\/ steps\n step(1, \"Do something\") {\n view(t=[0,0,0], r=[52,0,218], d=400);\n\n \/\/attach(DefConDown, DefConDown)\n \/\/ AnotherAssembly();\n }\n\n\n\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"95f8695ab16fd5bbe288303b0bfe4bf0cf74ff7c","subject":"getting ready to make motor clips","message":"getting ready to make motor clips\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/LogoBotBase.scad","new_file":"hardware\/sandbox\/LogoBotBase.scad","new_contents":"include <..\/config\/config.scad>\n\nDebugConnectors = 1;\nDebugCoordinateFrames = 0;\n\n$Explode=true;\n$ShowStep = 3;\n\nLogoBotAssembly();","old_contents":"include <..\/config\/config.scad>\n\nDebugConnectors = 1;\nDebugCoordinateFrames = 0;\n\n$Explode=true;\n$ShowStep = 4;\n\nLogoBotAssembly();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5316e90d8e9b3d9ea907650dffed71fefa8409ad","subject":"Rotator: added LEGO shaft openscad file","message":"Rotator: added LEGO shaft openscad file\n","repos":"MakerWear\/MakerWear,MakerWear\/MakerWear,MakerWear\/MakerWear","old_file":"Modules\/Action\/Rotator\/LegoShaft\/DummyLegoBrick.scad","new_file":"Modules\/Action\/Rotator\/LegoShaft\/DummyLegoBrick.scad","new_contents":"\/*\n\n Basic Lego brick builder module for OpenScad by Jorg Janssen 2013 (CC BY-NC 3.0) \n To use this in your own projects add:\n\n use \n brick (length, width, height [,smooth]);\n\n Length and width are in standard lego brick dimensions. \n Height is in flat brick heights, so for a normal lego brick height = 3.\n Add optional smooth = true for a brick without studs. \n Use height = 0 to just put studs\/knobs on top of other things.\n\n *\/\n$fn = 150;\n \n \/\/ this is it:\nbrick(2,2,1);\n\n\n\/\/ and this is how it's done:\n\nFLU = 1.6; \/\/ Fundamental Lego Unit = 1.6 mm\n\nBRICK_WIDTH = 5*FLU; \/\/ basic brick width\nBRICK_HEIGHT = 6*FLU; \/\/ basic brick height\nPLATE_HEIGHT = 2*FLU; \/\/ basic plate height\nWALL_THICKNESS = FLU; \/\/ outer wall of the brick\nSTUD_RADIUS = 0*FLU; \/\/ studs are the small cylinders on top of the brick with the lego logo ('nopje' in Dutch)\nSTUD_HEIGHT = FLU; \nANTI_STUD_RADIUS = 0.5*4.07*FLU; \/\/ an anti stud is the hollow cylinder inside bricks that have length > 1 and width > 1\nPIN_RADIUS = FLU; \/\/ a pin is the small cylinder inside bricks that have length = 1 or width = 1\nSUPPORT_THICKNESS = 0.254; \/\/ support is the thin surface between anti studs, pins and walls, your printer might not print this thin, try thicker!\nEDGE = 0.254; \/\/ this is the width and height of the bottom line edge of smooth bricks\nCORRECTION = 0.1; \/\/ addition to each size, to make sure all parts connect by moving them a little inside each other\n\nmodule brick(length = 4, width = 2, height = 3, smooth = false){\n\n\t\/\/ brick shell\n\tdifference(){\n\t\tcube(size = [length*BRICK_WIDTH,width*BRICK_WIDTH,height*PLATE_HEIGHT]);\n\t\ttranslate([WALL_THICKNESS,WALL_THICKNESS,-WALL_THICKNESS])\n\t\tunion(){\n\t\t\tcube(size = [length*BRICK_WIDTH-2*WALL_THICKNESS,width*BRICK_WIDTH-2*WALL_THICKNESS,height*PLATE_HEIGHT]);\n\t\t\t\/\/ stud inner holes, radius = pin radius\n\t\t\tif (!smooth) {\n\t\t\t\n\t\t\t}\n\t\t\t\/\/ small bottom line edge for smooth bricks\n\t\t\telse {\n\t\t\t\ttranslate([-WALL_THICKNESS-CORRECTION,-WALL_THICKNESS-CORRECTION,FLU-CORRECTION]) \n\t\t\t\tdifference() {\n\t\t\t\t\tcube([length*BRICK_WIDTH+2*CORRECTION,width*BRICK_WIDTH+2*CORRECTION,EDGE+CORRECTION]);\n\t\t\t\t\ttranslate([EDGE+CORRECTION,EDGE+CORRECTION,-CORRECTION])\n\t\t\t\t\tcube([length*BRICK_WIDTH-2*EDGE,width*BRICK_WIDTH-2*EDGE,EDGE+3*CORRECTION]); \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\/\/ Studs\n\tif(!smooth){\n\t\ttranslate([STUD_RADIUS+WALL_THICKNESS,STUD_RADIUS+WALL_THICKNESS,height*PLATE_HEIGHT])\n\t\tfor (y = [0:width-1]){\n\t\t\tfor (x = [0:length-1]){\n\t\t\t\ttranslate ([x*BRICK_WIDTH,y*BRICK_WIDTH,-CORRECTION])\n\t\t\t\tdifference(){\n\t\t\t\t\tcylinder(h=STUD_HEIGHT+CORRECTION, r=STUD_RADIUS);\n\t\t\t\t\t\/\/ Stud inner holes\n\t\t\t\t\ttranslate([0,0,-CORRECTION])\n\t\t\t\t\tcylinder(h=0.5*STUD_HEIGHT+CORRECTION,r=PIN_RADIUS);\n\t\t\t\t}\n\t\t\t\t\/\/ tech logo - disable this if your printer isn't capable of printing this small\n\t\t\t\tif ( length > width){\n\t\t\t\t\ttranslate([x*BRICK_WIDTH+0.8,y*BRICK_WIDTH-1.9,STUD_HEIGHT-CORRECTION])\n\t\t\t\t\tresize([1.2*1.7,2.2*1.7,0.254+CORRECTION])\n\t\t\t\t\trotate(a=[0,0,90])\n\t\t\t\t\timport(\"tech.stl\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttranslate([x*BRICK_WIDTH-1.9,y*BRICK_WIDTH-0.8,STUD_HEIGHT-CORRECTION])\n\t\t\t\t\tresize([2.2*1.7,1.2*1.7,0.254+CORRECTION])\n\t\t\t\t\timport(\"tech.stl\");\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\/* \n\t\t\t\t\/\/ Alternative 2-square logo\n\t\t\t\ttranslate ([x*BRICK_WIDTH+CORRECTION,y*BRICK_WIDTH-CORRECTION,STUD_HEIGHT-CORRECTION])\t\t\n\t\t\t\tcube([1,1,2*CORRECTION]);\n\t\t\t\ttranslate ([x*BRICK_WIDTH-0.9,y*BRICK_WIDTH-0.9,STUD_HEIGHT-CORRECTION])\t\t\n\t\t\t\tcube([1,1,0.3]);\n\t\t\t\t*\/\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\/\/ Pins x\n\tif (width == 1 && length > 1) {\t\n\t\t\tfor (x = [1:length-1]){\n\t\t\t\ttranslate([x*BRICK_WIDTH,0.5*BRICK_WIDTH,0])\n\t\t\t\tcylinder(h=height*PLATE_HEIGHT-WALL_THICKNESS+CORRECTION,r=PIN_RADIUS);\n\t\t\t\t\/\/ Supports\n\t\t\t\tif (height > 1) {\n\t\t\t\ttranslate([x*BRICK_WIDTH-0.5*SUPPORT_THICKNESS,CORRECTION,STUD_HEIGHT])\n\t\t\t\tcube(size=[SUPPORT_THICKNESS,BRICK_WIDTH-2*CORRECTION,height*PLATE_HEIGHT-STUD_HEIGHT-WALL_THICKNESS+CORRECTION]);\n\t\t\t}\n\t\t}\n\t}\n\t\/\/ Pins y\n\tif (length == 1 && width > 1) {\t\n\t\t\tfor (y = [1:width-1]){\n\t\t\ttranslate([0.5*BRICK_WIDTH,y*BRICK_WIDTH,0])\n\t\t\tcylinder(h=height*PLATE_HEIGHT-WALL_THICKNESS+CORRECTION,r=PIN_RADIUS);\n\t\t\t\/\/ Supports\n\t\t\tif (height > 1) {\n\t\t\ttranslate([CORRECTION,y*BRICK_WIDTH-0.5*SUPPORT_THICKNESS,STUD_HEIGHT])\n\t\t\tcube(size=[BRICK_WIDTH-2*CORRECTION,SUPPORT_THICKNESS,height*PLATE_HEIGHT-STUD_HEIGHT-WALL_THICKNESS+CORRECTION]);}\n\t\t\t\n\t\t}\n\t}\n\t\/\/ Anti Studs\n\tif (width > 1 && length > 1){\n\t\tdifference(){\n\t\t\tunion(){\n\t\t\t\tfor(y = [1:width-1]){\n\t\t\t\t\tfor(x = [1:length-1]){\n\t\t\t\t\t\t\/\/ anti studs\n\t\t\t\t\t\ttranslate([x*BRICK_WIDTH,y*BRICK_WIDTH,0])\n\t\t\t\t\t\tcylinder (h=height*PLATE_HEIGHT-WALL_THICKNESS+CORRECTION, r = ANTI_STUD_RADIUS);\n\t\t\t\t\t\t\/\/ Supports\n\t\t\t\t\t\tif (height > 1){\n\t\t\t\t\t\t\t\/\/ Support x\n\t\t\t\t\t\t\tif (x%2 == 0 && (length%2 == 0 || length%4 == 1 && xlength\/2) || x%2 == 1 && (length%4 == 3 && xlength\/2)) {\n\t\t\t\t\t\t\t\ttranslate([BRICK_WIDTH*x-0.5*SUPPORT_THICKNESS,y*BRICK_WIDTH-BRICK_WIDTH+WALL_THICKNESS-CORRECTION,STUD_HEIGHT])\n\t\t\t\t\t\t\t\tcube(size=[SUPPORT_THICKNESS,2*BRICK_WIDTH-2*WALL_THICKNESS,height*PLATE_HEIGHT-STUD_HEIGHT-WALL_THICKNESS+CORRECTION]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\/\/ Supports y\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (y%2 == 0 && (width%2 == 0 || width%4 == 1 && ywidth\/2) || y%2 == 1 && (width%4 == 3 && ywidth\/2)) {\n\t\t\t\t\t\t\t\ttranslate([x*BRICK_WIDTH-BRICK_WIDTH+WALL_THICKNESS-CORRECTION,BRICK_WIDTH*y-0.5*SUPPORT_THICKNESS,STUD_HEIGHT])\n\t\t\t\t\t\t\t\tcube(size=[2*BRICK_WIDTH-2*WALL_THICKNESS,SUPPORT_THICKNESS,height*PLATE_HEIGHT-STUD_HEIGHT-WALL_THICKNESS+CORRECTION]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tunion(){\n\t\t\t\tfor(y = [1:width-1]){\n\t\t\t\t\tfor(x = [1:length-1]){\n\t\t\t\t\t\t\/\/ hollow anti studs\n\t\t\t\t\t\ttranslate([x*BRICK_WIDTH,y*BRICK_WIDTH,-WALL_THICKNESS])\n\t\t\t\t\t\tcylinder (h=height*PLATE_HEIGHT, r = STUD_RADIUS);\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}\n}\n\t","old_contents":"","returncode":1,"stderr":"error: pathspec 'Modules\/Action\/Rotator\/LegoShaft\/DummyLegoBrick.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9306dd8ebafb1f760a24043a90d25e90fb851222","subject":"lower tub made thicker, so that it prints better; strucutre details simplified to build faster","message":"lower tub made thicker, so that it prints better; strucutre details simplified to build faster\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"\/*\n * configuration\n *\/\nbrushes_count = 2;\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(offset = [0:brushes_count-1])\n {\n translate(offset * [30, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"\/*\n * configuration\n *\/\nbrushes_count = 2;\n$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=20\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(offset = [0:brushes_count-1])\n {\n translate(offset * [30, 0, 0])\n brush_holder();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"73f9f8891da955e5d9b49ae2a0907ae09ea2921c","subject":"set LCD support dimensions","message":"set LCD support dimensions\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/lcd_support_v1.scad","new_file":"3d\/lcd_support_v1.scad","new_contents":"$fn = 20;\neps = 1e-3;\n\n\/\/ TODO: Proper dimensions.\nsize_x = 80;\nsize_y = 36;\nsize_z = 11;\nwidth = 4;\n\npin_length = 3;\npin_radius = 1.5;\npin_offset_left = 2.5;\npin_offset_right = pin_offset_left;\npin_offset_top = 2.5;\npin_offset_bottom = pin_offset_top;\n\ntranslate([-size_x\/2, 0, 0]) {\n cube([size_x, width, size_z]);\n cube([width, size_y, size_z]);\n translate([size_x - width, 0, 0]) {\n cube([width, size_y, size_z]);\n };\n translate([pin_offset_left, pin_offset_bottom, -pin_length]) {\n cylinder(2*pin_length + size_z, pin_radius);\n }\n translate([size_x - pin_offset_right, pin_offset_bottom, -pin_length]) {\n cylinder(2*pin_length + size_z, pin_radius);\n }\n translate([pin_offset_left, size_y - pin_offset_top, -pin_length]) {\n cylinder(2*pin_length + size_z, pin_radius);\n }\n translate([size_x - pin_offset_right, size_y - pin_offset_top, -pin_length]) {\n cylinder(2*pin_length + size_z, pin_radius);\n }\n}\n","old_contents":"$fn = 20;\neps = 1e-3;\n\n\/\/ TODO: Proper dimensions.\nsize_x = 50;\nsize_y = 20;\nsize_z = 7;\nwidth = 4;\n\npin_length = 3;\npin_radius = 1;\npin_offset_left = 2;\npin_offset_right = pin_offset_left;\npin_offset_top = 2;\npin_offset_bottom = 2;\n\ntranslate([-size_x\/2, 0, 0]) {\n cube([size_x, width, size_z]);\n cube([width, size_y, size_z]);\n translate([size_x - width, 0, 0]) {\n cube([width, size_y, size_z]);\n };\n translate([pin_offset_left, pin_offset_bottom, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n translate([size_x - pin_offset_right, pin_offset_bottom, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n translate([pin_offset_left, size_y - pin_offset_top, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n translate([size_x - pin_offset_right, size_y - pin_offset_top, -pin_length]) {\n cylinder(pin_length + eps, pin_radius);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b8e6af3cdbe3631e7212edce829d6c983af8abe8","subject":"nipple_module","message":"nipple_module\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/AAACell-refactor.scad","new_file":"class1\/exercise\/AAACell-refactor.scad","new_contents":"HEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\n\nDIAMETER_BASE = 6;\nBORDER_RADIUS_BASE = 0.3;\n\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nGREY = \"LightGrey\";\n\nmodule nipple()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = 100);\n \n \/\/First shoulder\ncolor(GREY)\ntranslate([0,0,-BORDER_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n\n\/\/Main nipple cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = 100);\n\n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = 100);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n\n \n} \n\nmodule RenderCell()\n{ \n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = 100);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n\n\/\/Base cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_BODY + BORDER_RADIUS_BASE)])\n cylinder(\n h = BORDER_RADIUS_BASE, \n d = (DIAMETER_BASE - (2 * BORDER_RADIUS_BASE)),\n $fn = 100);\n\n\/\/Base shoulder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE\/2)-BORDER_RADIUS_BASE, 0, 0])\n circle(r = BORDER_RADIUS_BASE, $fn = 100);\n}\nnipple();\nRenderCell();","old_contents":"HEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\n\nDIAMETER_BASE = 6;\nBORDER_RADIUS_BASE = 0.3;\n\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule RenderCell()\n{\n\/\/Top face of nipple\ncolor(\"LightGrey\")\ntranslate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = 100);\n \n\/\/First shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-BORDER_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n\n\/\/Main nipple cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = 100);\n\n\/\/Main nipple cylinder; base fillet\ncolor(\"LightGrey\")\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = 100);\n \n\/\/Nipple base shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n\n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = 100);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = 100);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = 100);\n\n\/\/Base cylinder\ncolor(\"LightGrey\")\ntranslate([0,0,-(HEIGHT_BODY + BORDER_RADIUS_BASE)])\n cylinder(\n h = BORDER_RADIUS_BASE, \n d = (DIAMETER_BASE - (2 * BORDER_RADIUS_BASE)),\n $fn = 100);\n\n\/\/Base shoulder\ncolor(\"LightGrey\")\ntranslate([0,0,-(HEIGHT_BODY)])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE\/2)-BORDER_RADIUS_BASE, 0, 0])\n circle(r = BORDER_RADIUS_BASE, $fn = 100);\n}\nRenderCell();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bf16a0ed73ba68c435663d509ab8d93ee1b6cd8d","subject":"minor change","message":"minor change\n","repos":"Sembiance\/common,Sembiance\/common,Sembiance\/common","old_file":"openscad\/roundedCube.scad","new_file":"openscad\/roundedCube.scad","new_contents":"\/*\n\troundedCube() v1.0.0 by robert@cosmicrealms.com from https:\/\/github.com\/Sembiance\/openscad-modules\n\tAllows you to round any edge of a cube\n\t\n\tUsage\n\t=====\n\tPrototype: roundedCube(dim, r, x, y, z, xcorners, ycorners, zcorners, $fn)\n\tArguments:\n\t\t- dim = Array of x,y,z numbers representing cube size\n\t\t- r = Radius of corners. Default: 1\n\t\t- x = Round the corners along the X axis of the cube. Default: false\n\t\t- y = Round the corners along the Y axis of the cube. Default: false\n\t\t- z = Round the corners along the Z axis of the cube. Default: true\n\t\t- xcorners = Array of 4 booleans, one for each X side of the cube, if true then round that side. Default: [true, true, true, true]\n\t\t- ycorners = Array of 4 booleans, one for each Y side of the cube, if true then round that side. Default: [true, true, true, true]\n\t\t- zcorners = Array of 4 booleans, one for each Z side of the cube, if true then round that side. Default: [true, true, true, true]\n\t\t- center = Whether to render the cube centered or not. Default: false\n\t\t- $fn = How smooth you want the rounding to be. Default: 128\n\n\tChange Log\n\t==========\n\t2017-05-15: v1.0.2 - Fixed bugs relating to rounding corners on the X axis\n\t2017-04-22: v1.0.1 - Added center option\n\t2017-01-04: v1.0.0 - Initial Release\n\n\tThanks to Sergio Vilches for the initial code inspiration\n*\/\n\n\/\/ Example code:\n\n\/*cube([5, 10, 4]);\n\ntranslate([8, 0, 0]) { roundedCube([5, 10, 4], r=1); }\ntranslate([16, 0, 0]) { roundedCube([5, 10, 4], r=1, zcorners=[true, false, true, false]); }\n\ntranslate([24, 0, 0]) { roundedCube([5, 10, 4], r=1, y=true, z=false); }\ntranslate([32, 0, 0]) { roundedCube([5, 10, 4], r=1, x=true, z=false); }\ntranslate([40, 0, 0]) { roundedCube([5, 10, 4], r=1, x=true, y=true, z=true); }\n*\/\n\nmodule roundedCube(dim, r=1, x=false, y=false, z=true, xcorners=[true,true,true,true], ycorners=[true,true,true,true], zcorners=[true,true,true,true], center=false, $fn=128)\n{\n\ttranslate([(center==true ? (-(dim[0]\/2)) : 0), (center==true ? (-(dim[1]\/2)) : 0), (center==true ? (-(dim[2]\/2)) : 0)])\n\t{\n\t\tdifference()\n\t\t{\n\t\t\tcube(dim);\n\n\t\t\tif(z)\n\t\t\t{\n\t\t\t\ttranslate([0, 0, -0.1])\n\t\t\t\t{\n\t\t\t\t\tif(zcorners[0])\n\t\t\t\t\t\ttranslate([0, dim[1]-r]) { rotateAround([0, 0, 90], [r\/2, r\/2, 0]) { meniscus(h=dim[2], r=r, fn=$fn); } }\n\t\t\t\t\tif(zcorners[1])\n\t\t\t\t\t\ttranslate([dim[0]-r, dim[1]-r]) { meniscus(h=dim[2], r=r, fn=$fn); }\n\t\t\t\t\tif(zcorners[2])\n\t\t\t\t\t\ttranslate([dim[0]-r, 0]) { rotateAround([0, 0, -90], [r\/2, r\/2, 0]) { meniscus(h=dim[2], r=r, fn=$fn); } }\n\t\t\t\t\tif(zcorners[3])\n\t\t\t\t\t\trotateAround([0, 0, -180], [r\/2, r\/2, 0]) { meniscus(h=dim[2], r=r, fn=$fn); }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(y)\n\t\t\t{\n\t\t\t\ttranslate([0, -0.1, 0])\n\t\t\t\t{\n\t\t\t\t\tif(ycorners[0])\n\t\t\t\t\t\ttranslate([0, 0, dim[2]-r]) { rotateAround([0, 180, 0], [r\/2, 0, r\/2]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } } }\n\t\t\t\t\tif(ycorners[1])\n\t\t\t\t\t\ttranslate([dim[0]-r, 0, dim[2]-r]) { rotateAround([0, -90, 0], [r\/2, 0, r\/2]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } } }\n\t\t\t\t\tif(ycorners[2])\n\t\t\t\t\t\ttranslate([dim[0]-r, 0]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } }\n\t\t\t\t\tif(ycorners[3])\n\t\t\t\t\t\trotateAround([0, 90, 0], [r\/2, 0, r\/2]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(x)\n\t\t\t{\n\t\t\t\ttranslate([-0.1, 0, 0])\n\t\t\t\t{\n\t\t\t\t\tif(xcorners[0])\n\t\t\t\t\t\ttranslate([0, dim[1]-r]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } }\n\t\t\t\t\tif(xcorners[1])\n\t\t\t\t\t\ttranslate([0, dim[1]-r, dim[2]-r]) { rotateAround([90, 0, 0], [0, r\/2, r\/2]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } } }\n\t\t\t\t\tif(xcorners[2])\n\t\t\t\t\t\ttranslate([0, 0, dim[2]-r]) { rotateAround([180, 0, 0], [0, r\/2, r\/2]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } } }\n\t\t\t\t\tif(xcorners[3])\n\t\t\t\t\t\trotateAround([-90, 0, 0], [0, r\/2, r\/2]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule meniscus(h, r, fn=128)\n{\n\t$fn=fn;\n\n\tdifference()\n\t{\n\t\tcube([r+0.2, r+0.2, h+0.2]);\n\t\ttranslate([0, 0, -0.1]) { cylinder(h=h+0.4, r=r); }\n\t}\n}\n\nmodule rotateAround(a, v) { translate(v) { rotate(a) { translate(-v) { children(); } } } }\n","old_contents":"\/*\n\troundedCube() v1.0.0 by robert@cosmicrealms.com from https:\/\/github.com\/Sembiance\/openscad-modules\n\tAllows you to round any edge of a cube\n\t\n\tUsage\n\t=====\n\tPrototype: roundedCube(dim, r, x, y, z, xcorners, ycorners, zcorners, $fn)\n\tArguments:\n\t\t- dim = Array of x,y,z numbers representing cube size\n\t\t- r = Radius of corners. Default: 1\n\t\t- x = Round the corners along the X axis of the cube. Default: false\n\t\t- y = Round the corners along the Y axis of the cube. Default: false\n\t\t- z = Round the corners along the Z axis of the cube. Default: true\n\t\t- xcorners = Array of 4 booleans, one for each X side of the cube, if true then round that side. Default: [true, true, true, true]\n\t\t- ycorners = Array of 4 booleans, one for each Y side of the cube, if true then round that side. Default: [true, true, true, true]\n\t\t- zcorners = Array of 4 booleans, one for each Z side of the cube, if true then round that side. Default: [true, true, true, true]\n\t\t- center = Whether to render the cube centered or not. Default: false\n\t\t- $fn = How smooth you want the rounding to be. Default: 128\n\n\tChange Log\n\t==========\n\t2017-05-15: v1.0.2 - Fixed bugs relating to rounding corners on the X axis\n\t2017-04-22: v1.0.1 - Added center option\n\t2017-01-04: v1.0.0 - Initial Release\n\n\tThanks to Sergio Vilches for the initial code inspiration\n*\/\n\n\/\/ Example code:\n\/*\ncube([5, 10, 4]);\n\ntranslate([8, 0, 0]) { roundedCube([5, 10, 4], r=1); }\ntranslate([16, 0, 0]) { roundedCube([5, 10, 4], r=1, zcorners=[true, false, true, false]); }\n\ntranslate([24, 0, 0]) { roundedCube([5, 10, 4], r=1, y=true, z=false); }\ntranslate([32, 0, 0]) { roundedCube([5, 10, 4], r=1, x=true, z=false); }\ntranslate([40, 0, 0]) { roundedCube([5, 10, 4], r=1, x=true, y=true, z=true); }\n*\/\n\nmodule roundedCube(dim, r=1, x=false, y=false, z=true, xcorners=[true,true,true,true], ycorners=[true,true,true,true], zcorners=[true,true,true,true], center=false, $fn=128)\n{\n\ttranslate([(center==true ? (-(dim[0]\/2)) : 0), (center==true ? (-(dim[1]\/2)) : 0), (center==true ? (-(dim[2]\/2)) : 0)])\n\t{\n\t\tdifference()\n\t\t{\n\t\t\tcube(dim);\n\n\t\t\tif(z)\n\t\t\t{\n\t\t\t\ttranslate([0, 0, -0.1])\n\t\t\t\t{\n\t\t\t\t\tif(zcorners[0])\n\t\t\t\t\t\ttranslate([0, dim[1]-r]) { rotateAround([0, 0, 90], [r\/2, r\/2, 0]) { meniscus(h=dim[2], r=r, fn=$fn); } }\n\t\t\t\t\tif(zcorners[1])\n\t\t\t\t\t\ttranslate([dim[0]-r, dim[1]-r]) { meniscus(h=dim[2], r=r, fn=$fn); }\n\t\t\t\t\tif(zcorners[2])\n\t\t\t\t\t\ttranslate([dim[0]-r, 0]) { rotateAround([0, 0, -90], [r\/2, r\/2, 0]) { meniscus(h=dim[2], r=r, fn=$fn); } }\n\t\t\t\t\tif(zcorners[3])\n\t\t\t\t\t\trotateAround([0, 0, -180], [r\/2, r\/2, 0]) { meniscus(h=dim[2], r=r, fn=$fn); }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(y)\n\t\t\t{\n\t\t\t\ttranslate([0, -0.1, 0])\n\t\t\t\t{\n\t\t\t\t\tif(ycorners[0])\n\t\t\t\t\t\ttranslate([0, 0, dim[2]-r]) { rotateAround([0, 180, 0], [r\/2, 0, r\/2]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } } }\n\t\t\t\t\tif(ycorners[1])\n\t\t\t\t\t\ttranslate([dim[0]-r, 0, dim[2]-r]) { rotateAround([0, -90, 0], [r\/2, 0, r\/2]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } } }\n\t\t\t\t\tif(ycorners[2])\n\t\t\t\t\t\ttranslate([dim[0]-r, 0]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } }\n\t\t\t\t\tif(ycorners[3])\n\t\t\t\t\t\trotateAround([0, 90, 0], [r\/2, 0, r\/2]) { rotateAround([-90, 0, 0], [0, r\/2, r\/2]) { meniscus(h=dim[1], r=r); } }\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(x)\n\t\t\t{\n\t\t\t\ttranslate([-0.1, 0, 0])\n\t\t\t\t{\n\t\t\t\t\tif(xcorners[0])\n\t\t\t\t\t\ttranslate([0, dim[1]-r]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } }\n\t\t\t\t\tif(xcorners[1])\n\t\t\t\t\t\ttranslate([0, dim[1]-r, dim[2]-r]) { rotateAround([90, 0, 0], [0, r\/2, r\/2]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } } }\n\t\t\t\t\tif(xcorners[2])\n\t\t\t\t\t\ttranslate([0, 0, dim[2]-r]) { rotateAround([180, 0, 0], [0, r\/2, r\/2]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } } }\n\t\t\t\t\tif(xcorners[3])\n\t\t\t\t\t\trotateAround([-90, 0, 0], [0, r\/2, r\/2]) { rotateAround([0, 90, 0], [r\/2, 0, r\/2]) { meniscus(h=dim[0], r=r); } }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule meniscus(h, r, fn=128)\n{\n\t$fn=fn;\n\n\tdifference()\n\t{\n\t\tcube([r+0.2, r+0.2, h+0.2]);\n\t\ttranslate([0, 0, -0.1]) { cylinder(h=h+0.4, r=r); }\n\t}\n}\n\nmodule rotateAround(a, v) { translate(v) { rotate(a) { translate(-v) { children(); } } } }\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"b0a0add063c50d1d427a550cce41214d67e795d1","subject":"main: Centex x carriage again","message":"main: Centex x carriage again\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n xcarriage_padding=10;\n xcarriage_width = xaxis_bearing[2]*2 + xaxis_bearing_dist + xcarriage_padding;\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n cubea([xcarriage_width, 5, xaxis_rod_distance+xaxis_bearing[1]+xcarriage_padding], align=[0,-1,0]);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2, 10, -17], [0,0,0]], extruder_conn_xcarriage)\n \/*#cubea([10,10,10]);*\/\n extruder();\n\n \/\/ x carriage bearings\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,(xaxis_rod_distance\/2)])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, -(xaxis_rod_distance\/2)])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = -225\/2*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n xcarriage_padding=10;\n xcarriage_width = xaxis_bearing[2]*2 + xaxis_bearing_dist + xcarriage_padding;\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n cubea([xcarriage_width, 5, xaxis_rod_distance+xaxis_bearing[1]+xcarriage_padding], align=[0,-1,0]);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2, 10, -17], [0,0,0]], extruder_conn_xcarriage)\n \/*#cubea([10,10,10]);*\/\n extruder();\n\n \/\/ x carriage bearings\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,(xaxis_rod_distance\/2)])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, -(xaxis_rod_distance\/2)])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"012d8f4646b81594e0b181ec497e504e9a3223a4","subject":"psu: apply rounding","message":"psu: apply rounding\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"psu.scad","new_file":"psu.scad","new_contents":"include \n\nuse ;\nuse ;\n\nmodule psu_a(align=N, detailed_model=true)\n{\n if(detailed_model)\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n translate([-24.5,105,-25])\n rotate([0,0,90])\n import(\"stl\/ledpowersupply.stl\");\n }\n else\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n difference()\n {\n cubea([psu_a_w,psu_a_d,psu_a_h]);\n\n \/\/ screw holes, sides\n for(x=[-1,1])\n for(y=[-1,1])\n for(z=[-1,1])\n translate([x*(psu_a_w\/2+1), y*(psu_a_screw_dist_y\/2), z*psu_a_screw_side_dist_z\/2])\n rcylindera(d=psu_a_screw_thread_dia, h=0.5*cm, orient=X, align=[-x,0,0]);\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), y*(psu_a_screw_dist_y\/2), -psu_a_h\/2-1])\n rcylindera(d=psu_a_screw_thread_dia, h=1*cm, orient=Z, align=Z);\n }\n }\n}\n\n\nmodule psu_a_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n rcylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2])\n rcylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n rcylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2+1])\n rcylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_a_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n rcylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2])\n rcylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b(align=N)\n{\n {\n size_align([psu_b_w,psu_b_d,psu_b_h], align)\n difference()\n {\n rcubea([psu_b_w,psu_b_d,psu_b_h]);\n\n \/\/ screw holes, sides\n \/*for(x=[-1,1])*\/\n \/*for(y=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([x*(psu_b_w\/2+1), y*(psu_b_screw_dist_y\/2), z*psu_b_screw_side_dist_z\/2])*\/\n \/*cylindera(d=psu_b_screw_thread_dia, h=0.5*cm, orient=X, align=[-x,0,0]);*\/\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y+y*(psu_b_screw_dist_y\/2), -psu_b_h\/2-1])\n cylindera(d=psu_b_screw_thread_dia, h=1*cm, orient=Z, align=Z);\n }\n }\n}\n\nmodule psu_b_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2])\n rcylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2])\n rcylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2])\n rcylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2])\n rcylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule part_psu_a_extrusion_bracket_side()\n{\n psu_a_extrusion_bracket_side();\n}\n\nmodule part_psu_a_extrusion_bracket_back()\n{\n psu_a_extrusion_bracket_back();\n}\n\nmodule part_psu_b_extrusion_bracket_side()\n{\n psu_b_extrusion_bracket_side();\n}\n\nmodule part_psu_b_extrusion_bracket_back()\n{\n psu_b_extrusion_bracket_back();\n}\n\n\/*psu_a();*\/\n\n\/*translate([0, -psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_back();*\/\n\n\/*psu_b();*\/\n\n\/*translate([0, psu_b_screw_offset_y-psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_back();*\/\n","old_contents":"include \n\nuse ;\nuse ;\n\nmodule psu_a(align=N, detailed_model=true)\n{\n if(detailed_model)\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n translate([-24.5,105,-25])\n rotate([0,0,90])\n import(\"stl\/ledpowersupply.stl\");\n }\n else\n {\n size_align([psu_a_w,psu_a_d,psu_a_h], align)\n difference()\n {\n cubea([psu_a_w,psu_a_d,psu_a_h]);\n\n \/\/ screw holes, sides\n for(x=[-1,1])\n for(y=[-1,1])\n for(z=[-1,1])\n translate([x*(psu_a_w\/2+1), y*(psu_a_screw_dist_y\/2), z*psu_a_screw_side_dist_z\/2])\n cylindera(d=psu_a_screw_thread_dia, h=0.5*cm, orient=X, align=[-x,0,0]);\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), y*(psu_a_screw_dist_y\/2), -psu_a_h\/2-1])\n cylindera(d=psu_a_screw_thread_dia, h=1*cm, orient=Z, align=Z);\n }\n }\n}\n\n\nmodule psu_a_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n cylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_a_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_a_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2])\n cylindera(d=psu_a_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_a_screw_bottom_dist_x\/2), 0, -psu_a_h\/2+1])\n cylindera(d=psu_a_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_a_screw_bottom_dist_x\/2, -psu_a_screw_dist_y\/2+psu_a_d\/2+extrusion_size\/2, -psu_a_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b(align=N)\n{\n {\n size_align([psu_b_w,psu_b_d,psu_b_h], align)\n difference()\n {\n cubea([psu_b_w,psu_b_d,psu_b_h]);\n\n \/\/ screw holes, sides\n \/*for(x=[-1,1])*\/\n \/*for(y=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([x*(psu_b_w\/2+1), y*(psu_b_screw_dist_y\/2), z*psu_b_screw_side_dist_z\/2])*\/\n \/*cylindera(d=psu_b_screw_thread_dia, h=0.5*cm, orient=X, align=[-x,0,0]);*\/\n\n \/\/ screw holes, bottom\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y+y*(psu_b_screw_dist_y\/2), -psu_b_h\/2-1])\n cylindera(d=psu_b_screw_thread_dia, h=1*cm, orient=Z, align=Z);\n }\n }\n}\n\nmodule psu_b_extrusion_bracket_side()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2])\n cylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), 0, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([psu_b_w\/2+extrusion_size\/2, y*extrusion_side_screw_dist\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule psu_b_extrusion_bracket_back()\n{\n extrusion_side_screw_dist = 3*cm;\n difference()\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2])\n cylindera(d=psu_b_screw_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2])\n cylindera(d=extrusion_thread_dia*3, h=psu_mount_bottom_height, align=[0,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(psu_b_screw_bottom_dist_x\/2), psu_b_screw_offset_y, -psu_b_h\/2+1])\n cylindera(d=psu_b_screw_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n\n for(x=[-1,1])\n translate([x*psu_b_screw_bottom_dist_x\/2, -psu_b_screw_dist_y\/2+psu_b_d\/2+extrusion_size\/2, -psu_b_h\/2+1])\n cylindera(d=extrusion_thread_dia, h=psu_mount_bottom_height*2, align=[0,0,-1]);\n }\n}\n\nmodule part_psu_a_extrusion_bracket_side()\n{\n psu_a_extrusion_bracket_side();\n}\n\nmodule part_psu_a_extrusion_bracket_back()\n{\n psu_a_extrusion_bracket_back();\n}\n\nmodule part_psu_b_extrusion_bracket_side()\n{\n psu_b_extrusion_bracket_side();\n}\n\nmodule part_psu_b_extrusion_bracket_back()\n{\n psu_b_extrusion_bracket_back();\n}\n\n\/*psu_a();*\/\n\n\/*translate([0, -psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_a_screw_dist_y\/2, 0])*\/\n\/*psu_a_extrusion_bracket_back();*\/\n\n\/*psu_b();*\/\n\n\/*translate([0, psu_b_screw_offset_y-psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_side();*\/\n\n\/*translate([0, psu_b_screw_dist_y\/2, 0])*\/\n\/*psu_b_extrusion_bracket_back();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"975d849d1e3b1f5f89ad0450b1cbf5935462edaf","subject":"Create led-wire-guide.scad","message":"Create led-wire-guide.scad\n\nThis is for keeping wires soldered to a \"Super Bright 921 LED bulb\" separated.\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"3dprinting\/openscad\/led-wire-guide\/led-wire-guide.scad","new_file":"3dprinting\/openscad\/led-wire-guide\/led-wire-guide.scad","new_contents":"use <..\/common\/extrusions.scad>\nLARGE = 100;\n\n\/\/ This is a wire guide for the \"Super Bright 921 LED Bulbs\" ordered for the CM Rig\n\/\/ flash unit - to position and orient the power wires soldered to the tabs and keep\n\/\/ them from moving and potentially shorting.\nmodule wire_guide() {\n \n\n wb = 2; \/\/ Thickness of separator at it's narrowest (topmost part when oriented flat)\n hb = 4;\n wt = 9; \/\/ Width of the guide - side-to-side\n ht = 2; \/\/ Thickness of thinnest portion of base of guide\n xoff = (wt - wb)\/2;\n t = 7.5; \/\/ Length of base - front to back\n ri = 2; \/\/ Wire curvature\n ro = 0;\n \n \n T_channel(wb, hb, wt, ht, xoff, ro, ri, t);\n}\n\n\nwire_guide();","old_contents":"","returncode":1,"stderr":"error: pathspec '3dprinting\/openscad\/led-wire-guide\/led-wire-guide.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"1a68f2aade28de824af884f66248e02ddb952e6c","subject":"red pot's cover","message":"red pot's cover\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toy_lid\/lid_red_pot.scad","new_file":"toy_lid\/lid_red_pot.scad","new_contents":"include ;\n\nint_dia=110;\next_dia=129;\n\ntranslate([0, ext_dia\/2+15, 0])\n con();\nlid(internal_diameter=int_dia, external_diameter=ext_dia);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'toy_lid\/lid_red_pot.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"17fdcd0ad4a01a541b485639163716df8378100f","subject":"work in progress checkpoint","message":"work in progress checkpoint\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 120;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \nrender()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/render()\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength) {\n rotate([180, 0, 0]) union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\ntranslate([-armLength, 0, 0])\n forearmLower(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingSteo, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength);\n\/*\nrender() \ncolor([.1, .7, .1]) \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n\/*\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingOD - 2 * bearingStep);\n }\n \/\/ screw holes for joining to joint\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n*\/\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength) {\n}\n\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"4af0c4187a4995869d3a515a323ea7f5091f9da5","subject":"Tweak front structs","message":"Tweak front structs\n","repos":"bmsleight\/shedshed","old_file":"shedshedshed.scad","new_file":"shedshedshed.scad","new_contents":"shed_length = 5184;\nshed_width = 1981;\nshed_front_height = 2250;\n\/\/shed_back_height = 2030;\n\nwindow_w=1830;\nwindow_h=920; \ndoor_w=858; \/\/ 1981 x 838mm + 20\ndoor_h=1991; \/\/ 1981 x 838mm + 20\nshed_back_height = door_h;\n\nspace_to_window_w=window_w\/2;\nspace_to_window_h=door_h-window_h;\nspace_to_door_w=window_w + 2*space_to_window_w;\n\n\n\nbase_timber_w = 47;\nbase_timber_h = 75;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\ntimber_length_unit=2400;\nbase_sheet_t = 18;\nsheet_width = 1220;\nsheet_length = 2440;\n\nwrap_t = 1;\n\nfirst_layer = base_timber_h+wrap_t+base_sheet_t;\n\n\nopp = shed_front_height-shed_back_height;\nadj = shed_width -timber_construct_h;\nhyp = sqrt(opp*opp+adj*adj);\ntheta = atan(opp\/adj);\nthin_opp = tan(theta) * timber_construct_h;\n\necho(\"Theta \", theta);\n\nmodule cubeI(size,comment=\"\/\/\", center=false)\n{\n if (comment != \"\/\/\")\n echo(comment);\n \/\/ Cube - but will echo dimensions in order of size\n if( (size[0]>size[1]) && (size[1]>=size[2]) )\n echo( size[0], size[1], size[2]);\n if( (size[0]>size[2]) && (size[2]>size[1]) )\n echo( size[0], size[2], size[1]);\n \n if( (size[1]>size[0]) && (size[0]>=size[2]) )\n echo( size[1], size[0], size[2]);\n if( (size[1]>size[2]) && (size[2]>size[0]) )\n echo( size[1], size[2], size[0]);\n \n if( (size[2]>size[0]) && (size[0]>=size[1]) )\n echo( size[2], size[0], size[1]);\n if( (size[2]>size[1]) && (size[1]>size[0]) )\n echo( size[2], size[1], size[0]);\n\n cube(size, center=center);\n}\n\nmodule houseWrapLayer(width,length, overlap=100)\n{\n echo(\"House Wrap\",width+overlap,length+overlap);\n color(\"Black\",0.75)\n {\n cube([width, length, wrap_t]);\n cube([width, wrap_t, overlap]);\n translate([0,length-wrap_t,0]) cube([width, wrap_t, overlap]);\n cube([wrap_t, length, overlap]);\n translate([width-wrap_t,0,0]) cube([wrap_t, length, overlap]);\n }\n}\n\n\nmodule beamsWrap()\n{\n \n translate([0,shed_width,first_layer]) rotate([90,0,0]) houseWrapLayer(shed_length,shed_back_height, overlap=100);\n\n translate([0,-1,first_layer]) rotate([90,0,90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height+timber_construct_h,-opp]) rotate([0,0,-theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n\n translate([shed_length,shed_width-1,first_layer]) rotate([90,0,-90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height-opp,-opp]) rotate([0,0,theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n difference() \n {\n translate([shed_length,-2,first_layer]) rotate([90,0,180]) houseWrapLayer(shed_length,shed_front_height, overlap=100);\n translate([space_to_window_w, -50, space_to_window_h+first_layer]) cube([window_w, 100, window_h]);\n translate([space_to_door_w, -50, first_layer]) cube([door_w, 100, door_h]);\n }\n\n \n}\n\n\nmodule OSB(size,center=false)\n{\n echo(\"OSB\");\n cubeI(size,center=center);\n}\n\n\nmodule floorPanel(width,length)\n{\n\/*\n echo(\"Timber\");\n \/\/Timber supporting base along left side\n cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base along right side\n translate([width-base_timber_w,0,0]) cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base Middle of I\n translate([base_timber_w,(length-base_timber_h)\/2,base_timber_h-base_timber_w]) cubeI([width-base_timber_w*2, base_timber_h, base_timber_w]);\n*\/\n \/\/DuPont Tyvek Housewrap - 100m 1.4m\n translate([0,0,base_timber_h]) houseWrapLayer(width,length,overlap=25);\n\n \/\/OSB Board - although the board is not cut by 1 mm (wrap_t) in each\n \/\/ direction for drawing purposes it is shaved\n translate([wrap_t,wrap_t,base_timber_h+wrap_t]) OSB([width-wrap_t*2,length-wrap_t*2,base_sheet_t]); \n}\n\nmodule floorBeams(width = shed_width, length = shed_length, overlap = 150, cross_beams=5)\n{\n echo(\"floorBeams\");\n \/\/ from one end along the front\n translate([0,0,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, 0, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, base_timber_w, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Again at the back\n \/\/ from one end along the front\n translate([0,width-base_timber_w,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, width-base_timber_w, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, width-base_timber_w*2, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Each end of shed\n translate([0, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n translate([length-base_timber_h, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n\n \/\/ Middle suport\n translate([base_timber_h, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([length-base_timber_h-timber_length_unit, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit+base_timber_h-overlap, (width-base_timber_w)\/2+base_timber_w, 0]) cubeI([length-2*timber_length_unit+overlap, base_timber_w, base_timber_h]);\n\n \/\/ Middle Cross beams0\n translate([(length-base_timber_w)\/2-base_timber_h\/2, base_timber_w*2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2, base_timber_w]);\n translate([(length-base_timber_w)\/2+base_timber_h\/2, base_timber_w*3+(width-3*base_timber_w)\/2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2-2*base_timber_w, base_timber_w]);\n \n}\n\n\nmodule floorPanels(width = shed_width, length = shed_length)\n{\n echo(\"floorPanels\");\n sheet_width_inc_wrap = sheet_width + 2*wrap_t;\n num_width_panels = round(-0.5+length\/sheet_width_inc_wrap);\n for(base_x = [0 : num_width_panels-1])\n {\n translate([base_x*sheet_width_inc_wrap, 0, 0]) floorPanel(sheet_width_inc_wrap,width);\n }\n full_panels_width = sheet_width_inc_wrap*num_width_panels;\n translate([full_panels_width, 0, 0]) floorPanel(length-full_panels_width,width);\n}\n\nmodule verticalStruts(width, height, beams=0, extra_struct=0)\n{\n cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,height-timber_construct_w]) cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n translate([width-timber_construct_w,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n\n if(beams>0 && extra_struct==0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing = middle_height\/(beams+1);\n for(loop=[1:beams])\n {\n translate([timber_construct_w, 0, beam_spacing*loop]) cubeI([width-timber_construct_w*2,timber_construct_h,timber_construct_w]);\n }\n }\n if(beams==0 && extra_struct>0)\n {\n middle_width = width-timber_construct_w*1;\n beam_spacing = middle_width\/(extra_struct+1);\n for(loop=[1:extra_struct])\n {\n translate([beam_spacing*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n }\n }\n if(beams>0 && extra_struct>0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing_h = middle_height\/(beams+1);\n middle_width = width-timber_construct_w*1;\n beam_spacing_w = middle_width\/(extra_struct+1);\n\n \/\/ Wee need to off set, so we divide by mod 2\n \/\/ move the all the beams down by timber_construct_w\n \/\/ but add loop mod 2 * timber_construct_w \n \/\/ (hence odd move up, even remain down\n \n for(loop=[0:extra_struct])\n {\n if (loop>0)\n translate([beam_spacing_w*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n for(loop_b=[1:beams])\n {\n offset = - timber_construct_w + (timber_construct_w * (loop%2));\n translate([timber_construct_w+beam_spacing_w*loop, 0, beam_spacing_h*loop_b+offset]) cubeI([beam_spacing_w-timber_construct_w,timber_construct_h,timber_construct_w]);\n }\n } \n }\n}\n\nmodule backStructs(width = shed_length, height = shed_back_height, structs_sets=3, beams=2, extra_struct=1)\n{\n echo(\"backStructs\");\n translate([wrap_t,shed_width-timber_construct_h-wrap_t,first_layer]) \n {\n struct_set_w = (width-wrap_t*2)\/structs_sets;\n for(structs=[0:structs_sets-1])\n {\n echo(\"backStructs - Section\");\n translate([structs*struct_set_w,0,0]) verticalStruts(struct_set_w, height, beams=beams, extra_struct=extra_struct);\n }\n }\n \n}\n\nmodule sideStructs(width = shed_width, height = shed_back_height, beams=2, extra_struct=2)\n{\n echo(\"SideStructs\");\n translate([timber_construct_h+wrap_t,timber_construct_h,first_layer])\n {\n rotate([0,0,90]) verticalStruts(width-timber_construct_h*2, height, beams=beams, extra_struct=extra_struct);\n } \n}\n\n\nmodule leftSideStructs()\n{\n echo(\"leftSideStructs\");\n sideStructs();\n}\n\n\nmodule rightSideStructs()\n{\n echo(\"rightSideStructs\");\n translate([shed_length-timber_construct_h-wrap_t*2,0,0]) sideStructs();\n}\n\n\nmodule frontStructs()\n{\n echo(\"frontStructs\");\n translate([wrap_t,-wrap_t,first_layer+1]) \n {\n verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=0);\n translate([space_to_window_w,0,0]) verticalStruts(window_w, space_to_window_h, beams=1, extra_struct=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=0);\n translate([space_to_door_w+door_w,0,0]) verticalStruts(shed_length-(space_to_door_w+door_w), door_h, beams=3, extra_struct=1);\n \/\/ top part, which is longer than a standard timber_length_unit \n gap = (space_to_door_w - timber_length_unit)\/2;\n remainder = shed_length - timber_length_unit - gap;\n translate([0,0,door_h]) verticalStruts(gap, shed_front_height-door_h, beams=0, extra_struct=0);\n translate([gap,0,door_h]) verticalStruts(timber_length_unit, shed_front_height-door_h, beams=0, extra_struct=2);\n translate([timber_length_unit + gap,0,door_h]) verticalStruts(remainder, shed_front_height-door_h, beams=0, extra_struct=2);\n }\n}\n\nmodule roof()\n{\n echo(\"roof\");\n \/\/ hyp\n inner_width = hyp+timber_construct_h;\n flat_offset = (sheet_length - inner_width)\/2;\n\n translate([-flat_offset,-wrap_t,shed_front_height+ first_layer +1 +thin_opp ]) rotate([-theta,0,0]) \n {\n frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, left_offset=flat_offset);\n translate([sheet_width*4,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, right_offset=flat_offset, sw= shed_length - sheet_width*4+flat_offset*2);\n\n translate([sheet_width,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*2,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*3,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n }\n}\n\nmodule frameSheet(left_offset=0, right_offset=0, front_offset=0, back_offset=0, sheet_left_offset=0, sheet_right_offset=0, sheet_front_offset=0, sheet_back_offset=0, sw=sheet_width, sl = sheet_length)\n{\n translate([left_offset, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n translate([sw-right_offset-timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n\n beam_l = (sw-left_offset-right_offset-3*timber_construct_h)\/2;\n \n translate([left_offset+beam_l+timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n\n translate([sheet_left_offset, sheet_front_offset, timber_construct_w]) OSB([sw-sheet_back_offset,sl-sheet_right_offset, base_sheet_t]);\n mirror([0,0,1]) translate([sheet_left_offset, sheet_front_offset, -timber_construct_w-base_sheet_t-wrap_t]) \n houseWrapLayer(sw-sheet_back_offset+2*wrap_t,sl-sheet_right_offset+2*wrap_t, overlap=25);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n echo(\"Cladding: \", x, board_height); \n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 34, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall()\n{\n translate([shed_length,shed_width,first_layer]) rotate([0,0,180]) caddings(shed_length, shed_back_height);\n}\n\nmodule claddingLeftWall()\n{\n translate([0,shed_width,first_layer]) rotate([0,0,180+90]) \n difference()\n {\n caddings(shed_width, shed_front_height);\n translate([-opp,-opp,shed_front_height-opp]) rotate([0,-theta,0]) cube([shed_width*2,opp*2, opp*2]);\n }\n}\n\nmodule claddingRightWall()\n{\n translate([shed_length,0,first_layer]) rotate([0,0,180-90]) \n difference()\n {\n caddings(shed_width, shed_front_height);\n translate([-opp,-opp,shed_back_height+opp+base_timber_h]) rotate([0,theta,0]) cube([shed_width*2,opp*2, opp*2]);\n }\n}\n\nmodule claddingFrontWall()\n{\n translate([0,0,first_layer]) rotate([0,0,0]) \n difference()\n {\n caddings(shed_length, shed_front_height);\n translate([space_to_window_w, -50, space_to_window_h]) cube([window_w, 100, window_h]);\n translate([space_to_door_w, -50, 0]) cube([door_w, 100, door_h]);\n }\n}\n\nmodule innerInsulation()\n{\n echo(\"Insulation\");\n insulation_t = 50;\n translate([0,0,first_layer]) \n {\n translate([0,shed_width-insulation_t,0]) \n cube([shed_length, insulation_t, shed_back_height]);\n\n translate([0,insulation_t,0]) difference()\n {\n cube([insulation_t, shed_width-2*insulation_t, shed_front_height]);\n translate([-insulation_t,0,shed_front_height]) rotate([-theta,0,0]) cube([3*insulation_t,shed_width+2*insulation_t, opp*2]);\n }\n translate([shed_length-insulation_t,insulation_t,0]) difference()\n {\n cube([insulation_t, shed_width-2*insulation_t, shed_front_height]);\n translate([-insulation_t,0,shed_front_height]) rotate([-theta,0,0]) cube([3*insulation_t,shed_width+2*insulation_t, opp*2]);\n }\n\n \n \n translate([0,0,0]) difference()\n {\n cube([shed_length, insulation_t, shed_front_height]);\n translate([space_to_window_w, -insulation_t, space_to_window_h]) cube([window_w, 3*insulation_t, window_h]);\n translate([space_to_door_w, -insulation_t, 0]) cube([door_w, 3*insulation_t, door_h]);\n }\n \n translate([0,insulation_t,shed_front_height+60]) rotate([-theta-90,0,0]) cube([shed_length, insulation_t, hyp]);\n\n \n }\n}\n\n\nannimate_step = 1\/20;\n\nif($t>annimate_step*2) \n floorBeams();\n\nif($t>annimate_step*3) \n floorPanels();\n\nif($t>annimate_step*4) \n backStructs();\nif($t>annimate_step*5) \n leftSideStructs();\nif($t>annimate_step*6) \n rightSideStructs();\n\nif($t>annimate_step*7) \n frontStructs();\nif($t>annimate_step*8) \n roof();\nif($t>annimate_step*9) \n beamsWrap();\n\nif($t>annimate_step*10) \n claddingBackWall();\nif($t>annimate_step*11) \n claddingLeftWall();\nif($t>annimate_step*12) \n claddingRightWall();\nif($t>annimate_step*13) \n claddingFrontWall();\n\nif($t>annimate_step*14) \n innerInsulation();\n","old_contents":"shed_length = 5184;\nshed_width = 1981;\nshed_front_height = 2250;\n\/\/shed_back_height = 2030;\n\nwindow_w=1830;\nwindow_h=920; \ndoor_w=858; \/\/ 1981 x 838mm + 20\ndoor_h=1991; \/\/ 1981 x 838mm + 20\nshed_back_height = door_h;\n\nspace_to_window_w=window_w\/2;\nspace_to_window_h=door_h-window_h;\nspace_to_door_w=window_w + 2*space_to_window_w;\n\n\n\nbase_timber_w = 47;\nbase_timber_h = 75;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\ntimber_length_unit=2400;\nbase_sheet_t = 18;\nsheet_width = 1220;\nsheet_length = 2440;\n\nwrap_t = 1;\n\nfirst_layer = base_timber_h+wrap_t+base_sheet_t;\n\n\nopp = shed_front_height-shed_back_height;\nadj = shed_width -timber_construct_h;\nhyp = sqrt(opp*opp+adj*adj);\ntheta = atan(opp\/adj);\nthin_opp = tan(theta) * timber_construct_h;\n\necho(\"Theta \", theta);\n\nmodule cubeI(size,comment=\"\/\/\", center=false)\n{\n if (comment != \"\/\/\")\n echo(comment);\n \/\/ Cube - but will echo dimensions in order of size\n if( (size[0]>size[1]) && (size[1]>=size[2]) )\n echo( size[0], size[1], size[2]);\n if( (size[0]>size[2]) && (size[2]>size[1]) )\n echo( size[0], size[2], size[1]);\n \n if( (size[1]>size[0]) && (size[0]>=size[2]) )\n echo( size[1], size[0], size[2]);\n if( (size[1]>size[2]) && (size[2]>size[0]) )\n echo( size[1], size[2], size[0]);\n \n if( (size[2]>size[0]) && (size[0]>=size[1]) )\n echo( size[2], size[0], size[1]);\n if( (size[2]>size[1]) && (size[1]>size[0]) )\n echo( size[2], size[1], size[0]);\n\n cube(size, center=center);\n}\n\nmodule houseWrapLayer(width,length, overlap=100)\n{\n echo(\"House Wrap\",width+overlap,length+overlap);\n color(\"Black\",0.75)\n {\n cube([width, length, wrap_t]);\n cube([width, wrap_t, overlap]);\n translate([0,length-wrap_t,0]) cube([width, wrap_t, overlap]);\n cube([wrap_t, length, overlap]);\n translate([width-wrap_t,0,0]) cube([wrap_t, length, overlap]);\n }\n}\n\n\nmodule beamsWrap()\n{\n \n translate([0,shed_width,first_layer]) rotate([90,0,0]) houseWrapLayer(shed_length,shed_back_height, overlap=100);\n\n translate([0,-1,first_layer]) rotate([90,0,90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height+timber_construct_h,-opp]) rotate([0,0,-theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n\n translate([shed_length,shed_width-1,first_layer]) rotate([90,0,-90]) difference() \n {\n houseWrapLayer(shed_width,shed_front_height+timber_construct_h, overlap=100);\n translate([-opp,shed_front_height-opp,-opp]) rotate([0,0,theta]) cube([shed_width*2,opp*2, opp*2]);\n }\n difference() \n {\n translate([shed_length,-2,first_layer]) rotate([90,0,180]) houseWrapLayer(shed_length,shed_front_height, overlap=100);\n translate([space_to_window_w, -50, space_to_window_h+first_layer]) cube([window_w, 100, window_h]);\n translate([space_to_door_w, -50, first_layer]) cube([door_w, 100, door_h]);\n }\n\n \n}\n\n\nmodule OSB(size,center=false)\n{\n echo(\"OSB\");\n cubeI(size,center=center);\n}\n\n\nmodule floorPanel(width,length)\n{\n\/*\n echo(\"Timber\");\n \/\/Timber supporting base along left side\n cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base along right side\n translate([width-base_timber_w,0,0]) cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base Middle of I\n translate([base_timber_w,(length-base_timber_h)\/2,base_timber_h-base_timber_w]) cubeI([width-base_timber_w*2, base_timber_h, base_timber_w]);\n*\/\n \/\/DuPont Tyvek Housewrap - 100m 1.4m\n translate([0,0,base_timber_h]) houseWrapLayer(width,length,overlap=25);\n\n \/\/OSB Board - although the board is not cut by 1 mm (wrap_t) in each\n \/\/ direction for drawing purposes it is shaved\n translate([wrap_t,wrap_t,base_timber_h+wrap_t]) OSB([width-wrap_t*2,length-wrap_t*2,base_sheet_t]); \n}\n\nmodule floorBeams(width = shed_width, length = shed_length, overlap = 150, cross_beams=5)\n{\n echo(\"floorBeams\");\n \/\/ from one end along the front\n translate([0,0,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, 0, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, base_timber_w, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Again at the back\n \/\/ from one end along the front\n translate([0,width-base_timber_w,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, width-base_timber_w, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, width-base_timber_w*2, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Each end of shed\n translate([0, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n translate([length-base_timber_h, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n\n \/\/ Middle suport\n translate([base_timber_h, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([length-base_timber_h-timber_length_unit, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit+base_timber_h-overlap, (width-base_timber_w)\/2+base_timber_w, 0]) cubeI([length-2*timber_length_unit+overlap, base_timber_w, base_timber_h]);\n\n \/\/ Middle Cross beams0\n translate([(length-base_timber_w)\/2-base_timber_h\/2, base_timber_w*2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2, base_timber_w]);\n translate([(length-base_timber_w)\/2+base_timber_h\/2, base_timber_w*3+(width-3*base_timber_w)\/2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2-2*base_timber_w, base_timber_w]);\n \n}\n\n\nmodule floorPanels(width = shed_width, length = shed_length)\n{\n echo(\"floorPanels\");\n sheet_width_inc_wrap = sheet_width + 2*wrap_t;\n num_width_panels = round(-0.5+length\/sheet_width_inc_wrap);\n for(base_x = [0 : num_width_panels-1])\n {\n translate([base_x*sheet_width_inc_wrap, 0, 0]) floorPanel(sheet_width_inc_wrap,width);\n }\n full_panels_width = sheet_width_inc_wrap*num_width_panels;\n translate([full_panels_width, 0, 0]) floorPanel(length-full_panels_width,width);\n}\n\nmodule verticalStruts(width, height, beams=0, extra_struct=0)\n{\n cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,height-timber_construct_w]) cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n translate([width-timber_construct_w,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n\n if(beams>0 && extra_struct==0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing = middle_height\/(beams+1);\n for(loop=[1:beams])\n {\n translate([timber_construct_w, 0, beam_spacing*loop]) cubeI([width-timber_construct_w*2,timber_construct_h,timber_construct_w]);\n }\n }\n if(beams==0 && extra_struct>0)\n {\n middle_width = width-timber_construct_w*1;\n beam_spacing = middle_width\/(extra_struct+1);\n for(loop=[1:extra_struct])\n {\n translate([beam_spacing*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n }\n }\n if(beams>0 && extra_struct>0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing_h = middle_height\/(beams+1);\n middle_width = width-timber_construct_w*1;\n beam_spacing_w = middle_width\/(extra_struct+1);\n\n \/\/ Wee need to off set, so we divide by mod 2\n \/\/ move the all the beams down by timber_construct_w\n \/\/ but add loop mod 2 * timber_construct_w \n \/\/ (hence odd move up, even remain down\n \n for(loop=[0:extra_struct])\n {\n if (loop>0)\n translate([beam_spacing_w*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n for(loop_b=[1:beams])\n {\n offset = - timber_construct_w + (timber_construct_w * (loop%2));\n translate([timber_construct_w+beam_spacing_w*loop, 0, beam_spacing_h*loop_b+offset]) cubeI([beam_spacing_w-timber_construct_w,timber_construct_h,timber_construct_w]);\n }\n } \n }\n}\n\nmodule backStructs(width = shed_length, height = shed_back_height, structs_sets=3, beams=2, extra_struct=1)\n{\n echo(\"backStructs\");\n translate([wrap_t,shed_width-timber_construct_h-wrap_t,first_layer]) \n {\n struct_set_w = (width-wrap_t*2)\/structs_sets;\n for(structs=[0:structs_sets-1])\n {\n echo(\"backStructs - Section\");\n translate([structs*struct_set_w,0,0]) verticalStruts(struct_set_w, height, beams=beams, extra_struct=extra_struct);\n }\n }\n \n}\n\nmodule sideStructs(width = shed_width, height = shed_back_height, beams=2, extra_struct=2)\n{\n echo(\"SideStructs\");\n translate([timber_construct_h+wrap_t,timber_construct_h,first_layer])\n {\n rotate([0,0,90]) verticalStruts(width-timber_construct_h*2, height, beams=beams, extra_struct=extra_struct);\n } \n}\n\n\nmodule leftSideStructs()\n{\n echo(\"leftSideStructs\");\n sideStructs();\n}\n\n\nmodule rightSideStructs()\n{\n echo(\"rightSideStructs\");\n translate([shed_length-timber_construct_h-wrap_t*2,0,0]) sideStructs();\n}\n\n\nmodule frontStructs()\n{\n echo(\"frontStructs\");\n translate([wrap_t,-wrap_t,first_layer+1]) \n {\n verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=0);\n translate([space_to_window_w,0,0]) verticalStruts(window_w, space_to_window_h, beams=1, extra_struct=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=1);\n translate([space_to_door_w+door_w,0,0]) verticalStruts(shed_length-(space_to_door_w+door_w), door_h, beams=2, extra_struct=0);\n \/\/ top part, which is longer than a standard timber_length_unit \n gap = (space_to_door_w - timber_length_unit)\/2;\n remainder = shed_length - timber_length_unit - gap;\n translate([0,0,door_h]) verticalStruts(gap, shed_front_height-door_h, beams=0, extra_struct=0);\n translate([gap,0,door_h]) verticalStruts(timber_length_unit, shed_front_height-door_h, beams=0, extra_struct=2);\n translate([timber_length_unit + gap,0,door_h]) verticalStruts(remainder, shed_front_height-door_h, beams=0, extra_struct=2);\n }\n}\n\nmodule roof()\n{\n echo(\"roof\");\n \/\/ hyp\n inner_width = hyp+timber_construct_h;\n flat_offset = (sheet_length - inner_width)\/2;\n\n translate([-flat_offset,-wrap_t,shed_front_height+ first_layer +1 +thin_opp ]) rotate([-theta,0,0]) \n {\n frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, left_offset=flat_offset);\n translate([sheet_width*4,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, right_offset=flat_offset, sw= shed_length - sheet_width*4+flat_offset*2);\n\n translate([sheet_width,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*2,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n translate([sheet_width*3,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2);\n }\n}\n\nmodule frameSheet(left_offset=0, right_offset=0, front_offset=0, back_offset=0, sheet_left_offset=0, sheet_right_offset=0, sheet_front_offset=0, sheet_back_offset=0, sw=sheet_width, sl = sheet_length)\n{\n translate([left_offset, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n translate([sw-right_offset-timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n\n beam_l = (sw-left_offset-right_offset-3*timber_construct_h)\/2;\n \n translate([left_offset+beam_l+timber_construct_h, front_offset, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, front_offset, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n \n translate([left_offset+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n translate([left_offset+timber_construct_h+beam_l+timber_construct_h, sl - back_offset-timber_construct_h, 0]) cubeI([beam_l, timber_construct_h, timber_construct_w]);\n\n translate([sheet_left_offset, sheet_front_offset, timber_construct_w]) OSB([sw-sheet_back_offset,sl-sheet_right_offset, base_sheet_t]);\n mirror([0,0,1]) translate([sheet_left_offset, sheet_front_offset, -timber_construct_w-base_sheet_t-wrap_t]) \n houseWrapLayer(sw-sheet_back_offset+2*wrap_t,sl-sheet_right_offset+2*wrap_t, overlap=25);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n echo(\"Cladding: \", x, board_height); \n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 34, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall()\n{\n translate([shed_length,shed_width,first_layer]) rotate([0,0,180]) caddings(shed_length, shed_back_height);\n}\n\nmodule claddingLeftWall()\n{\n translate([0,shed_width,first_layer]) rotate([0,0,180+90]) \n difference()\n {\n caddings(shed_width, shed_front_height);\n translate([-opp,-opp,shed_front_height-opp]) rotate([0,-theta,0]) cube([shed_width*2,opp*2, opp*2]);\n }\n}\n\nmodule claddingRightWall()\n{\n translate([shed_length,0,first_layer]) rotate([0,0,180-90]) \n difference()\n {\n caddings(shed_width, shed_front_height);\n translate([-opp,-opp,shed_back_height+opp+base_timber_h]) rotate([0,theta,0]) cube([shed_width*2,opp*2, opp*2]);\n }\n}\n\nmodule claddingFrontWall()\n{\n translate([0,0,first_layer]) rotate([0,0,0]) \n difference()\n {\n caddings(shed_length, shed_front_height);\n translate([space_to_window_w, -50, space_to_window_h]) cube([window_w, 100, window_h]);\n translate([space_to_door_w, -50, 0]) cube([door_w, 100, door_h]);\n }\n}\n\nmodule innerInsulation()\n{\n echo(\"Insulation\");\n insulation_t = 50;\n translate([0,0,first_layer]) \n {\n translate([0,shed_width-insulation_t,0]) \n cube([shed_length, insulation_t, shed_back_height]);\n\n translate([0,insulation_t,0]) difference()\n {\n cube([insulation_t, shed_width-2*insulation_t, shed_front_height]);\n translate([-insulation_t,0,shed_front_height]) rotate([-theta,0,0]) cube([3*insulation_t,shed_width+2*insulation_t, opp*2]);\n }\n translate([shed_length-insulation_t,insulation_t,0]) difference()\n {\n cube([insulation_t, shed_width-2*insulation_t, shed_front_height]);\n translate([-insulation_t,0,shed_front_height]) rotate([-theta,0,0]) cube([3*insulation_t,shed_width+2*insulation_t, opp*2]);\n }\n\n \n \n translate([0,0,0]) difference()\n {\n cube([shed_length, insulation_t, shed_front_height]);\n translate([space_to_window_w, -insulation_t, space_to_window_h]) cube([window_w, 3*insulation_t, window_h]);\n translate([space_to_door_w, -insulation_t, 0]) cube([door_w, 3*insulation_t, door_h]);\n }\n \n translate([0,insulation_t,shed_front_height+60]) rotate([-theta-90,0,0]) cube([shed_length, insulation_t, hyp]);\n\n \n }\n}\n\n\nannimate_step = 1\/20;\n\nif($t>annimate_step*2) \n floorBeams();\n\nif($t>annimate_step*3) \n floorPanels();\n\nif($t>annimate_step*4) \n backStructs();\nif($t>annimate_step*5) \n leftSideStructs();\nif($t>annimate_step*6) \n rightSideStructs();\n\nif($t>annimate_step*7) \n frontStructs();\nif($t>annimate_step*8) \n roof();\nif($t>annimate_step*9) \n beamsWrap();\n\nif($t>annimate_step*10) \n claddingBackWall();\nif($t>annimate_step*11) \n claddingLeftWall();\nif($t>annimate_step*12) \n claddingRightWall();\nif($t>annimate_step*13) \n claddingFrontWall();\n\nif($t>annimate_step*14) \n innerInsulation();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"971c28c1a1b18cd2101eb1a50b6b44b67d6eaa12","subject":"Adding size option for Open Structures-compatibility","message":"Adding size option for Open Structures-compatibility\n","repos":"hugs\/tapsterbot,jackskalitzky\/tapsterbot,oscarxie\/tapsterbot,jackskalitzky\/tapsterbot","old_file":"scad\/bitbeam-beam.scad","new_file":"scad\/bitbeam-beam.scad","new_contents":"\/\/ Description: \"LEGO Technic-compatible gridbeam\"\n\/\/ Project home: http:\/\/bitbeam.org\n\n\/\/ Each bitbeam is 8mm inches wide. \n\/\/ Center of each hole is 8mm apart from each other\n\/\/ Holes are 5.1 mm in diameter.\n\n\/\/ Mini\n\/\/beam_width = 4;\n\/\/hole_diameter = 2.2;\n\n\/\/ Standard\nbeam_width = 8;\nhole_diameter = 5.1;\n\n\/\/ Open Structures\n\/\/beam_width = 10;\n\/\/hole_diameter = 5.6;\n\nhole_radius = hole_diameter \/ 2;\n\nmodule beam(number_of_holes) {\n beam_length = number_of_holes * beam_width;\n difference() {\n \/\/ Draw the beam...\n cube([beam_length,beam_width,beam_width]);\n \n \/\/ Cut the holes...\n for (x=[beam_width\/2 : beam_width : beam_length]) {\n translate([x,beam_width\/2,-2])\n cylinder(r=hole_radius, h=beam_width*1.5, $fn=30);\n }\n for (x=[beam_width\/2 : beam_width : beam_length]) {\n rotate([90,0,0])\n translate([x,beam_width\/2,-beam_width*1.5])\n cylinder(r=hole_radius, h=beam_width*2, $fn=30);\n }\n\n \/\/ Optional through-hole\n \/\/rotate([0,90,0])\n \/\/translate([-4,beam_width\/2,-2])\n \/\/cylinder(r=hole_radius, h=number_of_holes*beam_width+4, $fn=30);\n }\n}\n\nbeam(9);\n","old_contents":"\/\/ Description: \"LEGO Technic-compatible gridbeam\"\n\/\/ Project home: http:\/\/bitbeam.org\n\n\/\/ Each bitbeam is 8mm inches wide. \n\/\/ Center of each hole is 8mm apart from each other\n\/\/ Holes are 5.1 mm in diameter.\n\n\/\/ Mini\n\/\/beam_width = 4;\n\/\/hole_diameter = 2.2;\n\n\/\/ Standard\nbeam_width = 8;\nhole_diameter = 5.1;\n\nhole_radius = hole_diameter \/ 2;\n\nmodule beam(number_of_holes) {\n beam_length = number_of_holes * beam_width;\n difference() {\n \/\/ Draw the beam...\n cube([beam_length,beam_width,beam_width]);\n \n \/\/ Cut the holes...\n for (x=[beam_width\/2 : beam_width : beam_length]) {\n translate([x,beam_width\/2,-2])\n cylinder(r=hole_radius, h=12, $fn=30);\n }\n for (x=[beam_width\/2 : beam_width : beam_length]) {\n rotate([90,0,0])\n translate([x,beam_width\/2,-10])\n cylinder(r=hole_radius, h=12, $fn=30);\n }\n\n \/\/ Optional through-hole\n \/\/rotate([0,90,0])\n \/\/translate([-4,beam_width\/2,-2])\n \/\/cylinder(r=hole_radius, h=number_of_holes*beam_width+4, $fn=30);\n }\n}\n\nbeam(3);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"6ecac2e548d82d3e90da27b3439b4b8882a62cff","subject":"House wrap","message":"House wrap\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp,opp]);\n } \n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 25, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,6 );\n }\n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\n\nif($t>0.05) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>0.10) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>0.15) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>0.20) \n translate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>0.25) \n translate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.30) \n translate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.35) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>0.40) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>0.45) \n translate([0,shed_width+0.5,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>0.50) \n translate([-0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>0.65) \n translate([0,shed_width+3,base_timber])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>0.70) \n translate([-3,0,base_timber])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>0.75) \n translate([shed_length+3,0,base_timber])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>0.80) \n translate([-3,0,base_timber])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/restOfGarden();","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 25, degrees=3)\n{\n panels = round(-0.5+z\/board_height);\n panel_uplift = board_height - overlap;\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,6 );\n }\n}\n\n\nif($t>0.1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>0.2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>0.3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>0.4) \n translate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>0.5) \n translate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.6) \n translate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\nif($t>0.7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nif($t>0.8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n\n!caddings(2000, 500);\n\n\/\/! cadding(2000);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"851707435f9b0bea790e74d6311935f6e9e4f486","subject":"main: use linear_extrusion builtin preview mode","message":"main: use linear_extrusion builtin preview mode\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(90*Y)\n belt_path(\n len=main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=Z);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n }\n\n translate([0, 0, main_height])\n {\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(90*Y)\n belt_path(\n len=main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n %yaxis_carriage_bearing_mount(part=\"vit\");\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=Z);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=Z);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=Y);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"99f83669f23bee51f9c83f6aac72452403a50424","subject":"edged top v2","message":"edged top v2\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th + 0.5;\nshift_y = th + 0.5;\n\nbox_x = pcb_x + 2*th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36.5;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 20;\ndynamic_y = shift_y + 31;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 11.5;\nscreen_start_y = shift_y + 24.5;\nscreen_length_x = 77;\nscreen_length_y = 51;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 18.5;\nmaster_button_int = 31.5;\nmaster_button_r = 6.5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\n\n!rotate(a=[180,0,0]) {\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n \/\/translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n \/\/cube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n \/\/}\n \/\/translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n \/\/cube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n \/\/}\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 1.6;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 11;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 20;\ndynamic_y = shift_y + 31.5;\ndynamic_r = 15.2;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 11;\nscreen_start_y = shift_y + 26;\nscreen_length_x = 78;\nscreen_length_y = 51;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 18.5;\nmaster_button_int = 31.5;\nmaster_button_r = 6;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n \/\/translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n \/\/cube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n \/\/}\n \/\/translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n \/\/cube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n \/\/}\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c38f7519e3d7df57256225eb22dd186e6dfc0729","subject":"Rounded ends to wheel section on tibia","message":"Rounded ends to wheel section on tibia\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"hardware\/mk1\/tibia.scad","new_file":"hardware\/mk1\/tibia.scad","new_contents":"\nmodule tibia(sl = 23, sw = 12.5){\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/leg\n\t\t\ttranslate([0,-1.5,0]) cube([40,3,4]);\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n\nmodule tibia2(sl = 23, sw = 12.5) {\n\twheelThickness = 6;\n\tor = 70;\n\tir = or - wheelThickness;\n\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\n\t\t\t\/\/ wheel section\n\t\t\ttranslate([-44, ir - 20,0])\n\t\t\trotate([0,0,-80]) {\n\n\t\t\t\t\/\/ section\n\t\t\t\tsector3D(r=or, ir=ir, a=160, h=4, center = false, $fn=64);\n\n\t\t\t\t\/\/ add rounded tips to the wheel section\n\t\t\t\tfor (i=[0,1])\n\t\t\t\t\trotate([0,0,i*160])\n\t\t\t\t\ttranslate([or - wheelThickness\/2,0,0])\n\t\t\t\t\tcylinder(r=3, h=4);\n\t\t\t}\n\n\n\n\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n","old_contents":"\nmodule tibia(sl = 23, sw = 12.5){\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/leg\n\t\t\ttranslate([0,-1.5,0]) cube([40,3,4]);\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n\nmodule tibia2(sl = 23, sw = 12.5){\n\tor = 70;\n\tir = or - 6;\n\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\n\t\t\t\/\/ wheel section\n\t\t\ttranslate([-44, ir - 20,0])\n\t\t\t\trotate([0,0,-80])\n\t\t\t\tsector3D(r=or, ir=ir, a=160, h=4, center = false, $fn=64);\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c6207f00789cfcad36c89dbc9a2528d274b85ad6","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6d26e454fab659ce5a19635fb8f6250fea0b8919","subject":"reworked to use 2D CSG exclusively, plus added end pieces.","message":"reworked to use 2D CSG exclusively, plus added end pieces.\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/nut-drive\/nut-housings.scad","new_file":"openscad\/nut-drive\/nut-housings.scad","new_contents":"\/\/ Housings to hold hexagonal nut for a \"nut drive\" two nuts with\n\/\/ reverse threads on a threaded rod.\nuse <..\/common\/extrusions.scad>\nEPSILON = 0.01;\nLARGE = 100;\n\nfunction poly_coords(order, r=1) = \n let(angles=[ for (i = [0:order-1]) i*(360\/order) ])\n \t[ for (th=angles) [r*cos(th), r*sin(th)] ];\n\n \n module regular_polygon(order, r=1){\n \tpolygon(poly_coords(order, r));\n }\n\n\nblock_w = 30;\nblock_d = 30;\nblock_ro = 3;\n\nhole_r = 2.05;\nholes_major_dia = block_d - hole_r;\n \n center_h = 10;\n end_h = 3;\n\n\n\/\/ about center\nmodule block2d(w, r) {\n offset(r = r) square([w-2*r, w-2*r], center=true);\n}\n\n\n\/\/ about center\nmodule holes2d(major_dia, r) {\n hole_centers = poly_coords(4, major_dia\/2);\n rotate([0, 0, 45]) for (i = [0:3]) {\n translate(hole_centers[i]) \n circle(r);\n }\n}\n\nmodule center_piece() {\n \n hex_dia = 20;\n \n linear_extrude(height = center_h) {\n difference() {\n block2d(block_w, block_ro);\n regular_polygon(6, hex_dia\/2);\n holes2d(holes_major_dia, hole_r);\n }\n }\n}\n\nmodule end_piece() {\n linear_extrude(height = end_h) {\n center_hole_r = 5;\n anchor_offset = 5; \/\/ from top of block\n anchor_hole_r = hole_r;\n anchor_wall = 3; \/\/ min wall surrounding anchor\n anchor_center = [0, block_w\/2 + anchor_offset];\n difference() {\n \/\/linear_extrude(height = block_h + 2*EPSILON) \n hull() {\n block2d(block_w, block_ro);\n translate(anchor_center)\n circle(anchor_wall + anchor_hole_r);\n }\n holes2d(holes_major_dia, hole_r);\n circle(center_hole_r);\n translate(anchor_center)\n circle(anchor_hole_r);\n \n }\n }\n}\n\n\n$fn = 50;\ncenter_piece();\ntranslate([block_w + 10, 0, 0]) end_piece();\ntranslate([0, block_w + 10, 0]) end_piece();","old_contents":"\/\/ Housings to hold hexagonal nut for a \"nut drive\" two nuts with\n\/\/ reverse threads on a threaded rod.\nuse <..\/common\/extrusions.scad>\nEPSILON = 0.01;\nLARGE = 100;\n\nfunction poly_coords(order, r=1) = \n let(angles=[ for (i = [0:order-1]) i*(360\/order) ])\n \t[ for (th=angles) [r*cos(th), r*sin(th)] ];\n\n \n module regular_polygon(order, r=1){\n \tpolygon(poly_coords(order, r));\n }\n\n\nblock_w = 30;\nblock_d = 30;\nblock_h = 10;\nblock_ro = 3;\n \nmodule center_piece() {\n \n hex_dia = 20;\n hole_r = 2.05;\n hole_major_dia = block_d - hole_r;\n hole_centers = poly_coords(4, hole_major_dia\/2);\n punch_h = block_h + 2*EPSILON;\n \n difference() {\n oblong(block_w, block_d, block_ro, block_h);\n translate([block_w\/2, block_d\/2, -EPSILON]) {\n linear_extrude(height = block_h + 2*EPSILON) regular_polygon(6, hex_dia\/2);\n rotate([0, 0, 45]) for (i = [0:3]) {\n translate(hole_centers[i]) \n cylinder(r=hole_r, h = punch_h);\n }\n }\n }\n}\n\n\n$fn = 50;\ncenter_piece();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"22c62a220f9be906dfffbb77c945a294195f111e","subject":"oozing test tower is narrowed at the top now","message":"oozing test tower is narrowed at the top now\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_printer_oozing_testing\/oozing_test.scad","new_file":"3d_printer_oozing_testing\/oozing_test.scad","new_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n \nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r1=5\/2, r2=1\/2, h=20);\n","old_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n \nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r1=5\/2, r2=2\/2, h=20);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2154d714f3ac8c4b1911424db06c215aadfd13e5","subject":"back to low poly","message":"back to low poly\n","repos":"DamCB\/mush","old_file":"scad\/openscad\/turret.scad","new_file":"scad\/openscad\/turret.scad","new_contents":"use ;\nuse ;\n\nphi_sphere = 38;\ne_sphere = 3.;\nphi_sphere_in = phi_sphere - e_sphere;\nphi_sphere_out = phi_sphere + e_sphere;\n\nphi_knob_in = phi_sphere_in;\nphi_knob_out = phi_knob_in + 6;\nw_knob = (phi_knob_out - phi_knob_in)\/2;\ne_knob = 4;\nhh = e_knob\/3-0.1;\nclear = 2;\n$fn = 36;\n\n\nmodule turret_base(){\n union(){\n ring(e_knob, phi_knob_in, phi_knob_out);\n \/\/ SM1Z specific\n translate([0, 0, -2.2]) ring(2, 28.5, phi_knob_out);\n translate([0, 0, -3]) ring(3, 28.5, 31.5);\n }\n}\n\n\nmodule turret(){\n difference(){\n union(){\n movement_sphere(phi_sphere_in, phi_sphere_out);\n turret_base();\n }\n sphere_hole(e=e_sphere,\n phi_sphere=phi_sphere,\n clear=clear,\n aperture=175);\n }\n}\n\nmodule half_turret(){\n difference(){\n turret();\n translate([-25, -0.05, -25]) cube([50, 50, 50]);\n }\n}\n\n\nmodule left_turret(){\n union(){\n difference(){\n half_turret();\n translate([phi_knob_in\/2+w_knob\/2, -0.5, -1.5])\n rotate(90, [1, 0, 0])\n magnet();\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.5])\n cube([w_knob+0.2, w_knob+0.2, hh+0.3], center=true);\n\n }\n translate([-phi_knob_in\/2-w_knob\/2, 0, -hh\/2])\n cylinder(d=w_knob, h=hh, $fn=36, center=true);\n translate([-phi_knob_in\/2-w_knob\/2, 0, -e_knob+hh\/2])\n cylinder(d=w_knob, h=hh, $fn=36, center=true);\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.5])\n cylinder(d=1., h=e_knob, $fn=36, center=true);\n\n }\n}\n\nmodule right_turret(){\n difference(){\n union(){\n difference(){\n rotate(180, [0, 0, 1]) half_turret();\n translate([phi_knob_in\/2+w_knob\/2, 0.5, -1.5])\n rotate(90, [1, 0, 0])\n magnet();\n translate([-phi_knob_in\/2-w_knob\/2, 0, 0.])\n cube([w_knob+0.4, w_knob+0.4, hh+1.5], center=true);\n translate([-phi_knob_in\/2-w_knob\/2, 0, -e_knob+hh\/2-0.05])\n cube([w_knob+0.4, w_knob+0.2, hh+0.5], center=true);\n }\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.5])\n cylinder(d=w_knob, h=hh, center=true, $fn=30);\n }\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.6])\n cylinder(d=1.2, h=hh+0.6, center=true, $fn=30);\n }\n}\n\n\nright_turret();\n\/* right_grip(e=e_sphere, *\/\n\/* phi_sphere=phi_sphere, *\/\n\/* shift=clear\/2); *\/\n\n\ntranslate([-phi_knob_in\/2-w_knob\/2, 0, 0])\nrotate([0, 0, -30])\ntranslate([phi_knob_in\/2+w_knob\/2, 0, 0])\nunion(){\n left_turret();\n \/* left_grip(e=e_sphere, *\/\n \/* phi_sphere=phi_sphere, *\/\n \/* shift=clear\/2); *\/\n}\n","old_contents":"use ;\nuse ;\n\nphi_sphere = 38;\ne_sphere = 3.;\nphi_sphere_in = phi_sphere - e_sphere;\nphi_sphere_out = phi_sphere + e_sphere;\n\nphi_knob_in = phi_sphere_in;\nphi_knob_out = phi_knob_in + 6;\nw_knob = (phi_knob_out - phi_knob_in)\/2;\ne_knob = 4;\nhh = e_knob\/3-0.1;\nclear = 2;\n$fn = 256;\n\n\nmodule turret_base(){\n union(){\n ring(e_knob, phi_knob_in, phi_knob_out);\n \/\/ SM1Z specific\n translate([0, 0, -2.2]) ring(2, 28.5, phi_knob_out);\n translate([0, 0, -3]) ring(3, 28.5, 31.5);\n }\n}\n\n\nmodule turret(){\n difference(){\n union(){\n movement_sphere(phi_sphere_in, phi_sphere_out);\n turret_base();\n }\n sphere_hole(e=e_sphere,\n phi_sphere=phi_sphere,\n clear=clear,\n aperture=175);\n }\n}\n\nmodule half_turret(){\n difference(){\n turret();\n translate([-25, -0.05, -25]) cube([50, 50, 50]);\n }\n}\n\n\nmodule left_turret(){\n union(){\n difference(){\n half_turret();\n translate([phi_knob_in\/2+w_knob\/2, -0.5, -1.5])\n rotate(90, [1, 0, 0])\n magnet();\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.5])\n cube([w_knob+0.2, w_knob+0.2, hh+0.3], center=true);\n\n }\n translate([-phi_knob_in\/2-w_knob\/2, 0, -hh\/2])\n cylinder(d=w_knob, h=hh, $fn=36, center=true);\n translate([-phi_knob_in\/2-w_knob\/2, 0, -e_knob+hh\/2])\n cylinder(d=w_knob, h=hh, $fn=36, center=true);\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.5])\n cylinder(d=1., h=e_knob, $fn=36, center=true);\n\n }\n}\n\nmodule right_turret(){\n difference(){\n union(){\n difference(){\n rotate(180, [0, 0, 1]) half_turret();\n translate([phi_knob_in\/2+w_knob\/2, 0.5, -1.5])\n rotate(90, [1, 0, 0])\n magnet();\n translate([-phi_knob_in\/2-w_knob\/2, 0, 0.])\n cube([w_knob+0.4, w_knob+0.4, hh+1.5], center=true);\n translate([-phi_knob_in\/2-w_knob\/2, 0, -e_knob+hh\/2-0.05])\n cube([w_knob+0.4, w_knob+0.2, hh+0.5], center=true);\n }\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.5])\n cylinder(d=w_knob, h=hh, center=true, $fn=30);\n }\n translate([-phi_knob_in\/2-w_knob\/2, 0., -2*hh+0.6])\n cylinder(d=1.2, h=hh+0.6, center=true, $fn=30);\n }\n}\n\n\nright_turret();\n\/* right_grip(e=e_sphere, *\/\n\/* phi_sphere=phi_sphere, *\/\n\/* shift=clear\/2); *\/\n\n\ntranslate([-phi_knob_in\/2-w_knob\/2, 0, 0])\nrotate([0, 0, -30])\ntranslate([phi_knob_in\/2+w_knob\/2, 0, 0])\nunion(){\n left_turret();\n \/* left_grip(e=e_sphere, *\/\n \/* phi_sphere=phi_sphere, *\/\n \/* shift=clear\/2); *\/\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"08875e08822365987bb33846e007bc70319ae7b6","subject":"screws: remove debug echo","message":"screws: remove debug echo\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n assert(h>0);\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n assert(nut_facets>=4, \"screw_nut: nut_facets < 4 is not supported\");\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n if(nut_facets==4)\n {\n cubea([nut_dia,nut_dia,h_]);\n }\n else\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n }\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n nut_facets = get(NutFacets, nut);\n assert(nut_facets>=4, \"screw_nut: nut_facets < 4 is not supported\");\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n if(nut_facets==4)\n {\n cubea([nut_dia+2*mm,nut_dia+2*mm, h], align=-Z);\n }\n else\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = get(NutFacets, nut) > 4 ?\n 2*nut_radius(nut) :\n get(NutWidthMax, nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, cut_screw_close=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n screw_min_nut_dist = 2*mm;\n assert(screw_l+screw_offset >= trap_offset, \"nut_trap_cut: screw_l+screw_offset < trap_offset\");\n assert(screw_offset-trap_offset <= -screw_min_nut_dist, \"nut_trap_cut: screw_offset-trap_offset > -screw_min_nut_dist\");\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n if(cut_screw_close)\n {\n tz(-nut_h\/2)\n tz(-screw_min_nut_dist)\n tz(trap_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n else\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n if(nut_facets==4)\n {\n cubea([nut_dia,nut_dia,h_]);\n }\n else\n {\n rz(30)\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nif(false)\n{\n nut1 = NutHexM5;\n stack(dist=10,axis=X)\n {\n $show_vit=true;\n $preview_mode=true;\n #screw(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=false, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=true, orient=-Z, align=-Z);\n #screw(nut=nut1, h=20, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=25, screw_offset=-5, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, cut_screw_close=true, orient=-Z, align=-Z);\n }\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n assert(h>0);\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n assert(nut_facets>=4, \"screw_nut: nut_facets < 4 is not supported\");\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n echo(nut_facets);\n if(nut_facets==4)\n {\n cubea([nut_dia,nut_dia,h_]);\n }\n else\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n }\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n nut_facets = get(NutFacets, nut);\n assert(nut_facets>=4, \"screw_nut: nut_facets < 4 is not supported\");\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n if(nut_facets==4)\n {\n cubea([nut_dia+2*mm,nut_dia+2*mm, h], align=-Z);\n }\n else\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = get(NutFacets, nut) > 4 ?\n 2*nut_radius(nut) :\n get(NutWidthMax, nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, cut_screw_close=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n screw_min_nut_dist = 2*mm;\n assert(screw_l+screw_offset >= trap_offset, \"nut_trap_cut: screw_l+screw_offset < trap_offset\");\n assert(screw_offset-trap_offset <= -screw_min_nut_dist, \"nut_trap_cut: screw_offset-trap_offset > -screw_min_nut_dist\");\n\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n if(cut_screw_close)\n {\n tz(-nut_h\/2)\n tz(-screw_min_nut_dist)\n tz(trap_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n else\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n if(nut_facets==4)\n {\n cubea([nut_dia,nut_dia,h_]);\n }\n else\n {\n rz(30)\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=Z, align=Z);\n }\n\n tz(trap_offset)\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nif(false)\n{\n nut1 = NutHexM5;\n stack(dist=10,axis=X)\n {\n $show_vit=true;\n $preview_mode=true;\n #screw(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #screw_cut(nut=nut1, h=10, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=false, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=10, cut_screw=true, orient=-Z, align=-Z);\n #screw(nut=nut1, h=20, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=25, screw_offset=-5, trap_offset=20, cut_screw=true, orient=-Z, align=-Z);\n #nut_trap_cut(nut=nut1, screw_l=20, cut_screw=true, cut_screw_close=true, orient=-Z, align=-Z);\n }\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"783a6e6f6ef0496bbfe679c954eb9e8f0d043732","subject":"added support shape (needs measures)","message":"added support shape (needs measures)\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/support.scad","new_file":"resin\/tank\/support.scad","new_contents":"inch = 25.4;\nwidth = 400;\nheight = 300;\nthickness = inch \/ 4;\ntollerance = 0.2;\n\ncut_thickness = 2;\ncut_width = 250;\ncut_height = 150;\ncut_support = inch \/ 8;\nhole_diameter = 6;\nholes_per_side = 5;\nholes_coverage = 200;\nholes_distance = 350;\n\nmodule support(width, height, thickness) {\n color([0,0,0,0.75]) {\n difference() {\n cube([width, height, thickness], center=true);\n\n translate([0,0,thickness-cut_thickness])\n cube([cut_width + tollerance * 2, cut_height + tollerance * 2, thickness], center=true);\n cube([cut_width - cut_support * 2, cut_height - cut_support * 2, thickness * 2], center=true);\n\n $fn = 32;\n dist = holes_coverage \/ (holes_per_side - 1);\n for(y = [0 : holes_per_side - 1]) {\n translate([0, -holes_coverage \/ 2 + y * dist, 0]) {\n translate([ holes_distance \/ 2, 0, 0])\n cylinder(h = thickness * 2, r = hole_diameter \/ 2, center = true);\n translate([- holes_distance \/ 2, 0, 0])\n cylinder(h = thickness * 2, r = hole_diameter \/ 2, center = true);\n }\n }\n }\n }\n}\n\ntranslate([0,0,thickness\/2])\n support(width, height, thickness);","old_contents":"","returncode":1,"stderr":"error: pathspec 'resin\/tank\/support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"12116ca369eb21ccab6252daca1769b2a2b8fa0d","subject":"adding resin tank","message":"adding resin tank\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/tank.scad","new_file":"resin\/tank\/tank.scad","new_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h]);\n}\n\nwidth = 120;\ndepth = 80;\nheight = 4;\n\n\nglass(width, depth, height);","old_contents":"","returncode":1,"stderr":"error: pathspec 'resin\/tank\/tank.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"bfcbdaeb831ef999b34ab4cbdbe20a6a11b31a0f","subject":"sensor holes added to fanholder","message":"sensor holes added to fanholder\n","repos":"JoeSuber\/QuickerPicker","old_file":"twofan.scad","new_file":"twofan.scad","new_contents":"\/\/ two fan powered picker\nuse ;\n\/\/motorbox();\n\/\/fancut();\nfanbracket();\n\nfansize = 50;\ncurve = 5;\nfanh=15.15;\nboarder=3;\nsensor_bottom_x = 4;\nsensor_bottom_y = 4;\nsensor_bottom_z = 1.7;\nsensor_bot = [sensor_bottom_x,sensor_bottom_y,sensor_bottom_z];\nsensor_top = [6,4,3.5];\ntotalsensor_ht = sensor_top[2] + sensor_bottom_z;\necho(totalsensor_ht);\nscrewdistance = fansize - curve*2; \n\n\nmodule elbi (){\n\tfor (i=[0,1]){\n\t\tmirror([0,i,0]){\n\t\t translate([0,43,0])\n\t\t elbow();\n\t\ttranslate([0,55,0])\n\t\t\telbow(tr=3*(6.67+2), thk=5.2);\n\t\t}\n\t}\n}\n\nmodule lifter(s=fanh){\n difference(){\n cube([s,s,s], center=true);\n translate([0,0,-s\/2-1-0.1])\n rotate([90,0,0])\n translate([3, 0, -s\/2+1.5-0.1])\n linear_extrude(convexity=10, height=s-3)\n sinewave(portion=180, normto=s\/2-1);\n translate([0,0,-0.25*s-0.1])\n cube([s+.1, s+.1, s\/2], center=true);\n }\n}\n\nmodule elbow(tr=6.67+2, thk=5, nutthk=2.5){\n translate([0,0,thk\/2])\n difference(){\n union(){\n cube([tr, thk, thk], center=true);\n translate([tr\/2,tr\/2,0]){\n \/\/cube([thk,tr, thk], center=true);\n translate([0,-tr\/2,0])\n cylinder(r=thk, h=thk, center=true);\n translate([-4.3, .5, 0])\n #cylinder(r=thk\/2, h=thk, center=true, $fn=24);\n }\n translate([-tr\/2,0,0])\n cylinder(r=thk, h=thk, center=true);\n }\n for (i=[tr\/2, -tr\/2]){\n translate([i,0,0]){\n cylinder(r=1.7, h=thk+.1, center=true);\n translate([0,0,thk\/2-nutthk\/2])\n cylinder(r=6.67\/2, h=nutthk+.1, center=true, $fn=6);\n } \n\n }\n }\n}\n \nmodule motorbox(){\n\tdifference(){\n\t\tunion(){\n\t\t\tcube([12,10,25.4], center=true);\n\t\t\tcylinder(r=2, h=26.5, $fn=14, center=true);\n\t\t\ttranslate([0,0,(33.3+26.5)\/4])\n\t\t\t\tcylinder(r=1.7, h=33.3-26.5, $fn=14, center=true);\n\t\t}\n\t\ttranslate([0,1.45,(33.3+26.5)\/4+1.7])\n\t\t\t\tcube([3.4, .6, 33.3-26.5], center=true);\n\t}\n}\n\nmodule fancut(xy=fansize, h=fanh, curve=curve, screwhole_space=screwdistance, screwhole_OD=3.3){\n\tminkowski(){\n\t\tcube([xy-curve, xy-curve, h-.1], center=true);\n\t\tcylinder(r=curve\/2, h=.1, $fn=curve*6, center=true);\n\t}\n\tcylinder(r=(xy-0.8)\/2, h=h+20, center=true, $fn=48);\n\tfor (i=[screwhole_space\/2, -screwhole_space\/2], j=[screwhole_space\/2, -screwhole_space\/2]){\n echo(\"from fancut(), screwhole_OD: \", screwhole_OD);\n\t\ttranslate([i,j,0])\n\t\t\tcylinder(r=screwhole_OD\/2, h=h*2, $fn=screwhole_OD*4, center=true);\n\t}\n}\n\nmodule fanblock(x=fansize*2+boarder*2, y=fansize+boarder*5, h=fanh+1, scl=1.03){\n minkowski(){\n\t cube([x-curve, y-curve, h-0.1], center=true);\n\t cylinder(r=curve\/2, h=0.1, $fn=curve*6, center=true);\n }\n\n}\n\nmodule fanbracket(x=fansize*2+boarder*2, y=fansize+boarder*5, h=fanh+1, scl=1.011, screwhole_OD=5){\n translate([0,0,h\/2])\n\t difference(){\n fanblock();\n \n \/\/ two fan cut-outs\n for (i=[fansize\/2*scl, -fansize\/2*scl]){\n translate([i,0,1])\n scale([scl,scl,1])\n fancut(screwhole_OD=screwhole_OD);\n }\n \n \/\/ holes on the sides with captured nuts\n for (i=[-2,-1,1,2], j=[-1,1]){\n translate([fansize\/2.5*i, 0, 0]){\n\t\t translate([0,0,-1]) rotate([90,0,0])\n\t\t\t cylinder(r=1.7,h=100, center=true, $fn=12);\n\t\t translate([0,0,-1]) rotate([90,0,0])\n\t\t\t cylinder(r=3,h=57, center=true, $fn=18);\n\t\t translate([0, j*(y\/2-1.14), -1]) rotate([90,0,0])\n\t\t\t cylinder(r=3.35,h=2.3, center=true, $fn=6);\n } \n\t }\n \n \/\/ holes\n for (i=[-1,0,1,], j=[1,-1]){\n translate([j*x\/2, i*(y\/2-boarder*1.5), 0]) rotate([0,90,0])\n #cylinder(r=1.5, h=boarder*6, center=true, $fn=10);\n }\n \n \/\/ IR sensor ( ods687 )\n for (j=[-1,1]){\n translate([0, j*(y\/2 - sensor_bottom_y\/2), -8.25]){\n translate([0,0,sensor_bottom_z\/2])\n #cube(sensor_bot, center=true);\n translate([0,0,totalsensor_ht\/2 + sensor_bottom_z\/2- 0.1])\n #cube(sensor_top, center=true);\n cube([sensor_bottom_x, sensor_bottom_y, 16], center=true);\n cylinder(r=sensor_bottom_x\/2-0.25, h=17, center=false); \n }\n }\n }\n}\n\n","old_contents":"\/\/ two fan powered picker\nuse ;\n\/\/motorbox();\n\/\/fancut();\nfanbracket();\n\nfansize = 50;\ncurve = 5;\nfanh=15.15;\nboarder=3;\n\nscrewdistance = fansize - curve*2; \n\n\nmodule elbi (){\n\tfor (i=[0,1]){\n\t\tmirror([0,i,0]){\n\t\t translate([0,43,0])\n\t\t elbow();\n\t\ttranslate([0,55,0])\n\t\t\telbow(tr=3*(6.67+2), thk=5.2);\n\t\t}\n\t}\n}\n\nmodule lifter(s=fanh){\n difference(){\n cube([s,s,s], center=true);\n translate([0,0,-s\/2-1-0.1])\n rotate([90,0,0])\n translate([3, 0, -s\/2+1.5-0.1])\n linear_extrude(convexity=10, height=s-3)\n sinewave(portion=180, normto=s\/2-1);\n translate([0,0,-0.25*s-0.1])\n cube([s+.1, s+.1, s\/2], center=true);\n }\n}\n\nmodule elbow(tr=6.67+2, thk=5, nutthk=2.5){\n translate([0,0,thk\/2])\n difference(){\n union(){\n cube([tr, thk, thk], center=true);\n translate([tr\/2,tr\/2,0]){\n \/\/cube([thk,tr, thk], center=true);\n translate([0,-tr\/2,0])\n cylinder(r=thk, h=thk, center=true);\n translate([-4.3, .5, 0])\n #cylinder(r=thk\/2, h=thk, center=true, $fn=24);\n }\n translate([-tr\/2,0,0])\n cylinder(r=thk, h=thk, center=true);\n }\n for (i=[tr\/2, -tr\/2]){\n translate([i,0,0]){\n cylinder(r=1.7, h=thk+.1, center=true);\n translate([0,0,thk\/2-nutthk\/2])\n cylinder(r=6.67\/2, h=nutthk+.1, center=true, $fn=6);\n } \n\n }\n }\n}\n \nmodule motorbox(){\n\tdifference(){\n\t\tunion(){\n\t\t\tcube([12,10,25.4], center=true);\n\t\t\tcylinder(r=2, h=26.5, $fn=14, center=true);\n\t\t\ttranslate([0,0,(33.3+26.5)\/4])\n\t\t\t\tcylinder(r=1.7, h=33.3-26.5, $fn=14, center=true);\n\t\t}\n\t\ttranslate([0,1.45,(33.3+26.5)\/4+1.7])\n\t\t\t\tcube([3.4, .6, 33.3-26.5], center=true);\n\t}\n}\n\nmodule fancut(xy=fansize, h=fanh, curve=curve, screwhole_space=screwdistance, screwhole_OD=3.3){\n\tminkowski(){\n\t\tcube([xy-curve, xy-curve, h-.1], center=true);\n\t\tcylinder(r=curve\/2, h=.1, $fn=curve*6, center=true);\n\t}\n\tcylinder(r=(xy-0.8)\/2, h=h+20, center=true, $fn=48);\n\tfor (i=[screwhole_space\/2, -screwhole_space\/2], j=[screwhole_space\/2, -screwhole_space\/2]){\n echo(\"from fancut(), screwhole_OD: \", screwhole_OD);\n\t\ttranslate([i,j,0])\n\t\t\tcylinder(r=screwhole_OD\/2, h=h*2, $fn=screwhole_OD*4, center=true);\n\t}\n}\n\nmodule fanblock(x=fansize*2+boarder*2, y=fansize+boarder*5, h=fanh+1, scl=1.03){\n minkowski(){\n\t cube([x-curve, y-curve, h-0.1], center=true);\n\t cylinder(r=curve\/2, h=0.1, $fn=curve*6, center=true);\n }\n\n}\n\nmodule fanbracket(x=fansize*2+boarder*2, y=fansize+boarder*5, h=fanh+1, scl=1.011, screwhole_OD=5){\n translate([0,0,h\/2])\n\t difference(){\n fanblock();\n\t\tfor (i=[fansize\/2*scl, -fansize\/2*scl]){\n\t\t\ttranslate([i,0,1])\n\t\t\tscale([scl,scl,1])\n\t\t\t\tfancut(screwhole_OD=screwhole_OD);\n\t\t}\n for (i=[-2,-1,0,1,2], j=[-1,1]){\n translate([fansize\/2.5*i, 0, 0]){\n\t\t translate([0,0,-1]) rotate([90,0,0])\n\t\t\t cylinder(r=1.7,h=100, center=true, $fn=12);\n\t\t translate([0,0,-1]) rotate([90,0,0])\n\t\t\t cylinder(r=3,h=57, center=true, $fn=18);\n\t\t translate([0, j*(y\/2-1.14), -1]) rotate([90,0,0])\n\t\t\t cylinder(r=3.35,h=2.3, center=true, $fn=6);\n } \n\t }\n\t for (i=[-1,0,1,], j=[1,-1]){\n translate([j*x\/2, i*(y\/2-boarder*1.5), 0]) rotate([0,90,0])\n #cylinder(r=1.5, h=boarder*6, center=true, $fn=10);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cefb823b69326e2d36509cc4cffea274ffc73066","subject":"stuff","message":"stuff\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1.scad","new_file":"3d\/enclosure_v1.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n dx = master_button_x + master_button_int*i;\n translate([dx, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"70bc67a7b4d0883b232b9d11343209112558ea1b","subject":"Update ADENIN.scad","message":"Update ADENIN.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/ADENIN.scad","new_file":"3D-models\/SCAD\/ADENIN.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435: \u0410\u0434\u0435\u043d\u0438\u043d\n\nx=50;\ny=19;\nz=9;\ndx=9; \/\/\u0414\u043b\u0438\u043d\u0430 \u0440\u0430\u0437\u044a\u0435\u043c\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\nd=2.67; \/\/\u0414\u0438\u0430\u043c\u0435\u0442\u0440 \u0433\u043d\u0435\u0437\u0434\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\np=6; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\ndifference() {\nunion() { \n translate([0, 0, 0]) cube ([x-2, y, z-0.3], center=true);\n\n translate([-24, 0, 0]) rotate([0, 0, 45]) cube ([13.5, 13.5, z-0.3], center=true);\n \n translate([30.1, 0, 0]) cube ([13.1, 19, z-0.3], center=true);\n\n} \n translate([6, 0, 3]) cube ([x-10, y+2, z\/1.5], center=true); \/\/\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n\n\n translate([-34.8, 0, 0]) cube ([10.5, 10.5, z+2], center=true); \/\/\u0414\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0438\n\n\n rotate([0, 90, 0]) translate([0, 0, -34.8]) cylinder(dx, d, d);\n\n\n\/\/ #rotate([0, 90, 0]) translate([0, -4.5, 33.1]) cylinder(dx, d, d);\n}\n\nrotate([90, 0, 0]) translate([-13, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\nrotate([90, 0, 0]) translate([26.3, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, 0]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n#translate ([24.63,-11,-2])cube([12,22,4.2]);\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435: \u0410\u0434\u0435\u043d\u0438\u043d\n\nx=50;\ny=19;\nz=9;\ndx=9; \/\/\u0414\u043b\u0438\u043d\u0430 \u0440\u0430\u0437\u044a\u0435\u043c\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\nd=2.67; \/\/\u0414\u0438\u0430\u043c\u0435\u0442\u0440 \u0433\u043d\u0435\u0437\u0434\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\np=6; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\ndifference() {\nunion() { \n translate([0, 0, 0]) cube ([x-2, y, z-0.3], center=true);\n\n translate([-24, 0, 0]) rotate([0, 0, 45]) cube ([13.5, 13.5, z-0.3], center=true);\n \n translate([30.1, 0, 0]) cube ([13.1, 19, z-0.3], center=true);\n\n} \n translate([6, 0, 3]) cube ([x-10, y+2, z\/1.5], center=true); \/\/\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n\n\n translate([-34.8, 0, 0]) cube ([10.5, 10.5, z+2], center=true); \/\/\u0414\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0438\n\n\n rotate([0, 90, 0]) translate([0, 0, -34.8]) cylinder(dx, d, d);\n\n rotate([0, 90, 0]) translate([0, 0, 33.1]) cylinder(dx, d, d);\n\n\/\/ #rotate([0, 90, 0]) translate([0, -4.5, 33.1]) cylinder(dx, d, d);\n}\n\nrotate([90, 0, 0]) translate([-13, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\nrotate([90, 0, 0]) translate([26.3, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, 0]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n#translate ([24.63,-11,-2])cube([12,22,4.2]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"30e8ebf78a0223f3ad3699e36da46b040fa3d6cd","subject":"x\/ends: fix vit rendering","message":"x\/ends: fix vit rendering\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n \/*xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);*\/\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"920c46cc4e9b939ba5603783a7ae13b62168ec4f","subject":"x\/carriage\/extruder\/a: clean","message":"x\/carriage\/extruder\/a: clean\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n ty(-21.5)\n rotate(180*Y)\n import(\"stl\/30mm_Clamp.stl\");\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n tx(10) \/\/ E3D fan thickness\n tx(-12.7)\n ty(22)\n rotate(90*X)\n import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");\n\n \/\/ E3D fan\n tx(22.5*mm)\n ty(-6*mm)\n {\n difference()\n {\n cubea([10*mm,30*mm,30*mm]);\n cylindera(d=25*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(30\/2*mm - 3.5*mm))\n ty(y*(30\/2*mm - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n attach(extruder_b_sensormount_conn, sensormount_conn)\n \/*translate(extruder_b_sensormount_offset)*\/\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n attach(extruder_b_sensormount_conn, sensormount_conn)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+5*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n attach(extruder_b_sensormount_conn, sensormount_conn)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n\n if(with_sensormount)\n attach(extruder_b_sensormount_conn, sensormount_conn)\n sensormount(part, align=-Y);\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n {\n cubea(size=[17.8,5,15], align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n }\n else if(part == \"vit\")\n {\n \/*rz(-180)*\/\n \/*ty(5)*\/\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=true);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n ty(-21.5)\n rotate(180*Y)\n import(\"stl\/30mm_Clamp.stl\");\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n tx(10) \/\/ E3D fan thickness\n tx(-12.7)\n ty(22)\n rotate(90*X)\n import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");\n\n \/\/ E3D fan\n tx(22.5*mm)\n ty(-6*mm)\n {\n difference()\n {\n cubea([10*mm,30*mm,30*mm]);\n cylindera(d=25*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(30\/2*mm - 3.5*mm))\n ty(y*(30\/2*mm - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n attach(extruder_b_sensormount_conn, sensormount_conn)\n \/*translate(extruder_b_sensormount_offset)*\/\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n attach(extruder_b_sensormount_conn, sensormount_conn)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+5*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n attach(extruder_b_sensormount_conn, sensormount_conn)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n\n if(with_sensormount)\n attach(extruder_b_sensormount_conn, sensormount_conn)\n sensormount(part, align=-Y);\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n {\n cubea(size=[17.8,5,15], align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n }\n else if(part == \"vit\")\n {\n \/*rz(-180)*\/\n \/*ty(5)*\/\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=true);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1de460857f07e40221f257a2059110330716edf6","subject":"x\/carriage\/extruder: fix guidler nuts trap axis","message":"x\/carriage\/extruder: fix guidler nuts trap axis\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=-Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extrasize=1000*Z, extrasize_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extrasize=1000*Z, extrasize_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f81b29b8cf2f6dce4dc8bc5bf16685fa152355b7","subject":"x\/carriage: move x axis endstop to back (from top)","message":"x\/carriage: move x axis endstop to back (from top)\n\nThis reverts commit d23e0b13f313cb89246d5cd3b9be0b2a75ea3a87.\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \nuse \ninclude \n\nuse \n\nmodule x_extruder_hotend(side=-1, new=true)\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n\n mx(side>=1)\n tx(-16)\n tz(-29)\n rz(-90)\n rx(-90)\n tx(-123)\n ty(-123)\n import(\"stl\/thing_43783214\/30mm_clip_with_venturi_v3_50_by_thed0ct0r_.stl\");\n\n mx(side>=1)\n tx(-26)\n ty(-4.1)\n tz(-30)\n rz(10)\n fan(orient=X, align=-X);\n\n mx(side>=1)\n tz(-76.4)\n ty(-112.8)\n rx(-90)\n rz(180)\n import(\"stl\/thing_3316685\/e3d_v6_30mm_to_40mm_adapter.stl\");\n\n if(new)\n {\n tx(-13)\n ty(129)\n tz(-178)\n rz(180)\n ry(-90)\n import(\"stl\/thing_43783214\/Clip_with_sliding_guide_and_screw_slot_rev2.stl\");\n\n tx(-161.2)\n ty(-147.9)\n tz(71)\n rx(-90)\n rx(45)\n import(\"stl\/thing_43783214\/5015_sloped_layer_cooling.stl\");\n\n tx(-150.5)\n ty(-163.5)\n tz(-65.5)\n import(\"stl\/thing_43783214\/Prusa_like_nozzle_duct1.stl\");\n\n tx(-17)\n ty(-49)\n tz(-38)\n rx(-45)\n rz(-90)\n fan_5015S();\n }\n else\n {\n tx(-113.5)\n ty(-22.1)\n tz(-148)\n rz(-90)\n ry(-90)\n import(\"stl\/thing_2769783\/5015_layer_cooling_adapter_-_for_prusa_cooler_v1_2_-_rotated.stl\");\n\n tx(17)\n ty(-30)\n tz(-25)\n rz(180)\n rx(-90)\n rz(-90)\n fan_5015S();\n\n tx(-1)\n ty(13)\n tz(-4)\n rz(180)\n import(\"stl\/thing_2769783\/prusa_nozzle_fan_converted_2_v3_5L3.stl\");\n\n }\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,xaxis_carriage_thickness\/2,-8*mm])\n rcubea(size=[8,10,10], align=X+Y, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1*mm, orient=Y, align=-Y, extra_h=.1*mm, extra_align=Y);\n\n \/\/ cut out for shaft (so we can attach a knob)\n cylindera(d=extruder_b_bearing[0]+1*mm, h=1000, orient=Y, align=N);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=true, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, head_embed=true, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-15*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n tz(-10*mm)\n rcubea(size=[18*mm,4*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(side)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n mx(side==1)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n mx(side==1)\n extruder_b();\n\n mx(side==1)\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n mx(side==1)\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend(side);\n\n mx(side==1)\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*187*mm:-129*mm)\n {\n mx(x==1)\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(x);\n\n mx(x==1)\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*270,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \nuse \ninclude \n\nuse \n\nmodule x_extruder_hotend(side=-1, new=true)\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n\n mx(side>=1)\n tx(-16)\n tz(-29)\n rz(-90)\n rx(-90)\n tx(-123)\n ty(-123)\n import(\"stl\/thing_43783214\/30mm_clip_with_venturi_v3_50_by_thed0ct0r_.stl\");\n\n mx(side>=1)\n tx(-26)\n ty(-4.1)\n tz(-30)\n rz(10)\n fan(orient=X, align=-X);\n\n mx(side>=1)\n tz(-76.4)\n ty(-112.8)\n rx(-90)\n rz(180)\n import(\"stl\/thing_3316685\/e3d_v6_30mm_to_40mm_adapter.stl\");\n\n if(new)\n {\n tx(-13)\n ty(129)\n tz(-178)\n rz(180)\n ry(-90)\n import(\"stl\/thing_43783214\/Clip_with_sliding_guide_and_screw_slot_rev2.stl\");\n\n tx(-161.2)\n ty(-147.9)\n tz(71)\n rx(-90)\n rx(45)\n import(\"stl\/thing_43783214\/5015_sloped_layer_cooling.stl\");\n\n tx(-150.5)\n ty(-163.5)\n tz(-65.5)\n import(\"stl\/thing_43783214\/Prusa_like_nozzle_duct1.stl\");\n\n tx(-17)\n ty(-49)\n tz(-38)\n rx(-45)\n rz(-90)\n fan_5015S();\n }\n else\n {\n tx(-113.5)\n ty(-22.1)\n tz(-148)\n rz(-90)\n ry(-90)\n import(\"stl\/thing_2769783\/5015_layer_cooling_adapter_-_for_prusa_cooler_v1_2_-_rotated.stl\");\n\n tx(17)\n ty(-30)\n tz(-25)\n rz(180)\n rx(-90)\n rz(-90)\n fan_5015S();\n\n tx(-1)\n ty(13)\n tz(-4)\n rz(180)\n import(\"stl\/thing_2769783\/prusa_nozzle_fan_converted_2_v3_5L3.stl\");\n\n }\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1*mm, orient=Y, align=-Y, extra_h=.1*mm, extra_align=Y);\n\n \/\/ cut out for shaft (so we can attach a knob)\n cylindera(d=extruder_b_bearing[0]+1*mm, h=1000, orient=Y, align=N);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=true, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, head_embed=true, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-15*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n tz(-10*mm)\n rcubea(size=[18*mm,4*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(side)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n mx(side==1)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n mx(side==1)\n extruder_b();\n\n mx(side==1)\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n mx(side==1)\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend(side);\n\n mx(side==1)\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*187*mm:-129*mm)\n {\n mx(x==1)\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(x);\n\n mx(x==1)\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*270,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"909b097a3f13df9f18908b314a3a1c70845af395","subject":"\u0431\u0443\u043a\u0432\u0430 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435","message":"\u0431\u0443\u043a\u0432\u0430 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/ADENIN.scad","new_file":"3D-models\/SCAD\/ADENIN.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \u0422\u0438\u043c\u0438\u043d\nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \n \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, 0]) cube([42, 24, 9]); \/\/\u043a\u0443\u0431 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n } \n } \n}\ndifference() {\n\n #translate([39, -9.5, -4.29]) cube([12.5, 19, 8.55]); \/\/\u0437\u0430\u0434\u043d\u0438\u0439 \u043a\u0443\u0431 \u0441 \u0433\u043d\u0435\u0437\u0434\u043e\u043c \u0434\u043b\u044f \u043c\u0430\u0433\u043d\u0438\u0442\u0430\n rotate([0, 90, 0]) translate([0, 0, 47.12]) cylinder(5, 2.67, 2.67); \/\/\u0433\u043d\u0435\u0437\u0434\u043e \u0434\u043b\u044f \u043c\u0430\u0433\u043d\u0438\u0442\u0430 \u0437\u0430\u0434\u043d\u0435\u0435\n\/\/rotate([0, 90, 0]) translate([0, 5, 47.12]) cylinder(5, 2.67, 2.67);\n }\n\/\/\u043a\u0440\u0443\u0433\n rotate([90, 0, 0]) translate([1.4, 0, -9.5]) cylinder(19, 4.29, 4.29); \n rotate([90, 0, 0]) translate([40.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ndt=20; \/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u043a\u0432\u044b T \u043f\u043e \u043e\u0441\u0438 X\ntranslate([dt, -6, 0]) cube([xx, e+0.7, xx]);\ntranslate([dt-4.9, -6, 0]) cube([e, xx, xx]);\n\n\n\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \u0422\u0438\u043c\u0438\u043d\nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \n \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, -1]) cube([42, 24, 9]); \/\/\u043a\u0443\u0431 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n } \n } \n}\ndifference() {\n\n #translate([39, -9.5, -4.29]) cube([12.5, 19, 8.55]); \/\/\u0437\u0430\u0434\u043d\u0438\u0439 \u043a\u0443\u0431 \u0441 \u0433\u043d\u0435\u0437\u0434\u043e\u043c \u0434\u043b\u044f \u043c\u0430\u0433\u043d\u0438\u0442\u0430\n rotate([0, 90, 0]) translate([0, 0, 47.12]) cylinder(5, 2.67, 2.67); \/\/\u0433\u043d\u0435\u0437\u0434\u043e \u0434\u043b\u044f \u043c\u0430\u0433\u043d\u0438\u0442\u0430 \u0437\u0430\u0434\u043d\u0435\u0435\n\/\/rotate([0, 90, 0]) translate([0, 5, 47.12]) cylinder(5, 2.67, 2.67);\n }\n\/\/\u043a\u0440\u0443\u0433\n rotate([90, 0, 0]) translate([1.4, 0, -9.5]) cylinder(19, 4.29, 4.29); \n rotate([90, 0, 0]) translate([40.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ndt=5; \/\/\u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0443\u043a\u0432\u044b T \u043f\u043e \u043e\u0441\u0438 X\ntranslate([dt, -6, 0]) cube([xx, e+0.7, xx]);\ntranslate([dt-4.9, -6, 0]) cube([e, xx, xx]);\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9f56412736e53f7e92a0bb20952e6371240e6ff2","subject":"bigger button holes","message":"bigger button holes\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1_board.scad","new_file":"3d\/enclosure_v1_board.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n\tdifference() {\n\t cube([box_x, box_y, board_h + eps], false);\n\t translate([board_w, board_w, -eps]) {\n\t\tcube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n\t }\n\t}\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n\tdifference() {\n\t cube([box_x, box_y, board_h + eps], false);\n\t translate([board_w, board_w, -eps]) {\n\t\tcube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n\t }\n\t}\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"928e3516dbb627c2424f74ff293e62dc0fc5cd24","subject":"doc: typo in doc","message":"doc: typo in doc\n","repos":"jsconan\/camelSCAD","old_file":"core\/util.scad","new_file":"core\/util.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Miscellaneous utils.\r\n *\r\n * @package core\/util\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Builds a position value:\r\n * -1: there is something before\r\n * 0: there is nothing anywhere\r\n * 1: there is something after\r\n * 2: there is something before and after\r\n *\r\n * @param Boolean [before] - If there is something before.\r\n * @param Boolean [after] - If there is something after.\r\n * @returns Number\r\n *\/\r\nfunction position(before, after) =\r\n before && after ? 2\r\n :after ? 1\r\n :before ? -1\r\n :0\r\n;\r\n\r\n\/**\r\n * Checks a position value and tells if there is something before.\r\n * -1: there is something before\r\n * 0: there is nothing anywhere\r\n * 1: there is something after\r\n * 2: there is something before and after\r\n *\r\n * @param Number position - The position value.\r\n * @returns Boolean\r\n *\/\r\nfunction before(position) =\r\n let( position = float(position) )\r\n position < 0 || position > 1\r\n;\r\n\r\n\/**\r\n * Checks a position value and tells if there is something after.\r\n * -1: there is something before\r\n * 0: there is nothing anywhere\r\n * 1: there is something after\r\n * 2: there is something before and after\r\n *\r\n * @param Number position - The position value.\r\n * @returns Boolean\r\n *\/\r\nfunction after(position) = float(position) > 0;\r\n\r\n\/**\r\n * Gets a numeric representation of a cardinal point.\r\n * West and East are related to X-coordinate (resp. -1 and 1, or 2 if both).\r\n * South and North are related to Y-coordinate (resp. -1 and 1, or 2 if both).\r\n *\r\n * A cardinal expression is a string that contains cardinal point literals:\r\n * - \"n\": North\r\n * - \"e\": East\r\n * - \"s\": South\r\n * - \"w\": West\r\n *\r\n * Combinations are allowed, for instance\r\n * - \"ne\" means North East, and will be translated to [1, 1]\r\n * - \"nwe\" means North West East, and will be translated to [2, 1]\r\n * - \"nsw\" means North South West, and will be translated to [-1, 2]\r\n * - \"nswe\" means North South West East, and will be translated to [2, 2]\r\n *\r\n * @param Vector|String p - A vector or a cardinal expression.\r\n * @returns Vector - A 2D vector that contains position values for horizontal and vertical axis.\r\n *\/\r\nfunction cardinal(p) =\r\n is_num(p) || isVector(p) ?\r\n let( p = vector2D(p) )\r\n [ position(before(p.x), after(p.x)),\r\n position(before(p.y), after(p.y)) ]\r\n :\r\n let( p = p && p != true ? str(p) : \"\" )\r\n [ position(min(len(search(\"wW\", p)), 1), min(len(search(\"eE\", p)), 1)),\r\n position(min(len(search(\"sS\", p)), 1), min(len(search(\"nN\", p)), 1)) ]\r\n;\r\n\r\n\/**\r\n * Computes a size value, and its offset, of an object to be used as a negative for a `difference()` operation.\r\n * An alignment value will be added according to the parameter `direction` to counter the wall alignment issue.\r\n *\r\n * @param Number [value] - The value of the size to adjust. If the value is negative, the offset will be adjusted\r\n * to allow top to bottom position (below the origin).\r\n * @param Number|String [direction] - Tells on what sides adjust the size to make sure the difference won't\r\n * produce dummy walls.\r\n * @param Boolean [center] - Whether or not center the position on the axis.\r\n * @returns Vector - A 2D vector that contains the adjusted size and its offset.\r\n *\/\r\nfunction align(value, direction, center) =\r\n let(\r\n direction = cardinal(uor(direction, 2)).y,\r\n value = divisor(value),\r\n absv = abs(value),\r\n adjust = direction ? (direction == 2 ? ALIGN2 : ALIGN) : 0,\r\n offset = center ? (direction == 2 || direction == 0 ? 0 : direction * ALIGN \/ 2)\r\n : (direction == 2 || direction == -1 ? -ALIGN : 0)\r\n )\r\n [\r\n absv + adjust,\r\n offset + (value < 0 && !center ? value : 0)\r\n ]\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Miscellaneous utils.\r\n *\r\n * @package core\/util\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Builds a position value:\r\n * -1: there is something before\r\n * 0: there is nothing anywhere\r\n * 1: there is something after\r\n * 2: there is something before and after\r\n *\r\n * @param Boolean [before] - If there is something before.\r\n * @param Boolean [after] - If there is something after.\r\n * @returns Number\r\n *\/\r\nfunction position(before, after) =\r\n before && after ? 2\r\n :after ? 1\r\n :before ? -1\r\n :0\r\n;\r\n\r\n\/**\r\n * Checks a position value and tells if there is something before.\r\n * -1: there is something before\r\n * 0: there is nothing anywhere\r\n * 1: there is something after\r\n * 2: there is something before and after\r\n *\r\n * @param Number position - The position value.\r\n * @returns Boolean\r\n *\/\r\nfunction before(position) =\r\n let( position = float(position) )\r\n position < 0 || position > 1\r\n;\r\n\r\n\/**\r\n * Checks a position value and tells if there is something after.\r\n * -1: there is something before\r\n * 0: there is nothing anywhere\r\n * 1: there is something after\r\n * 2: there is something before and after\r\n *\r\n * @param Number position - The position value.\r\n * @returns Boolean\r\n *\/\r\nfunction after(position) = float(position) > 0;\r\n\r\n\/**\r\n * Gets a numeric representation of a cardinal point.\r\n * West and Eath are related to X-coordinate (resp. -1 and 1, or 2 if both).\r\n * South and North are related to Y-coordinate (resp. -1 and 1, or 2 if both).\r\n *\r\n * A cardinal expression is a string that contains cardinal point literals:\r\n * - \"n\": North\r\n * - \"e\": East\r\n * - \"s\": South\r\n * - \"w\": West\r\n *\r\n * Combinations are allowed, for instance\r\n * - \"ne\" means North East, and will be translated to [1, 1]\r\n * - \"nwe\" means North Weast East, and will be translated to [2, 1]\r\n * - \"nsw\" means North South Weast, and will be translated to [-1, 2]\r\n * - \"nswe\" means North South Weast East, and will be translated to [2, 2]\r\n *\r\n * @param Vector|String p - A vector or a cardinal expression.\r\n * @returns Vector - A 2D vector that contains position values for horizontal and vertical axis.\r\n *\/\r\nfunction cardinal(p) =\r\n is_num(p) || isVector(p) ?\r\n let( p = vector2D(p) )\r\n [ position(before(p.x), after(p.x)),\r\n position(before(p.y), after(p.y)) ]\r\n :\r\n let( p = p && p != true ? str(p) : \"\" )\r\n [ position(min(len(search(\"wW\", p)), 1), min(len(search(\"eE\", p)), 1)),\r\n position(min(len(search(\"sS\", p)), 1), min(len(search(\"nN\", p)), 1)) ]\r\n;\r\n\r\n\/**\r\n * Computes a size value, and its offset, of an object to be used as a negative for a `difference()` operation.\r\n * An alignment value will be added according to the parameter `direction` to counter the wall alignment issue.\r\n *\r\n * @param Number [value] - The value of the size to adjust. If the value is negative, the offset will be adjusted\r\n * to allow top to bottom position (below the origin).\r\n * @param Number|String [direction] - Tells on what sides adjust the size to make sure the difference won't\r\n * produce dummy walls.\r\n * @param Boolean [center] - Whether or not center the position on the axis.\r\n * @returns Vector - A 2D vector that contains the adjusted size and its offset.\r\n *\/\r\nfunction align(value, direction, center) =\r\n let(\r\n direction = cardinal(uor(direction, 2)).y,\r\n value = divisor(value),\r\n absv = abs(value),\r\n adjust = direction ? (direction == 2 ? ALIGN2 : ALIGN) : 0,\r\n offset = center ? (direction == 2 || direction == 0 ? 0 : direction * ALIGN \/ 2)\r\n : (direction == 2 || direction == -1 ? -ALIGN : 0)\r\n )\r\n [\r\n absv + adjust,\r\n offset + (value < 0 && !center ? value : 0)\r\n ]\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bf45717dae162547d3c682b63386de057e54b250","subject":"increased plate length + removed positioning hacks","message":"increased plate length + removed positioning hacks\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"\/\/ TODO: add names engravings\n\nmodule rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*20);\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\/\/ element for holding a single brush\nmodule holder()\n{\n translate([-4\/2, 0, 0])\n cube([4, 7, 17]);\n translate([0, 0, 17-2])\n {\n rotate([-90, 0, 0])\n cylinder(r=(8-1.5)\/2, h=7+2+7, $fn=50);\n translate([0, 7, 0])\n rotate([-90,0,0])\n cylinder(r=(3-1)\/2, h=14+2, $fn=30);\n }\n}\n\n\nmodule whole_holder(names)\n{\n assert( len(names) > 0 );\n r=5;\n spacing=20;\n total_len=2*(r+6) + spacing*(len(names)-1) + 4;\n\n \/\/ plate\n translate([0, r+2, -r])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([total_len, 40], r\/2+1);\n cube([total_len, r, r*2]);\n }\n \/\/ back wall\n rounded_half_surface_([total_len, 60], r);\n \/\/ holders + names\n translate([r+6+4\/2, 25, r])\n {\n for(i=[0:len(names)-1])\n translate(i*[spacing, 0, 0])\n {\n holder();\n #translate([0, 25, 0])\n linear_extrude(3*0.2)\n text(names[i], size=4, halign=\"center\");\n }\n }\n}\n\n\nwhole_holder([\"John\", \"Jane\", \"Jackob\"]);\n","old_contents":"\/\/ TODO: add names engravings\n\nmodule rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*5); \/\/ TODO\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\/\/ element for holding a single brush\nmodule holder()\n{\n translate([-4\/2, 0, 0])\n cube([4, 7, 17]);\n translate([0, 0, 17-2])\n {\n rotate([-90, 0, 0])\n cylinder(r=(8-1.5)\/2, h=7+2+7, $fn=50);\n translate([0, 7, 0])\n rotate([-90,0,0])\n cylinder(r=(3-1)\/2, h=14+2, $fn=30);\n }\n}\n\n\nmodule whole_holder(names)\n{\n assert( len(names) > 0 );\n r=5;\n spacing=20;\n total_len=2*(r+6) + spacing*(len(names)-1) + 4;\n\n \/\/ plate\n translate([0, r+2, -r])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([total_len, 35], r\/2+1);\n cube([total_len, r, r*2]);\n }\n \/\/ back wall\n rounded_half_surface_([total_len, 60], r);\n \/\/ holders + names\n translate([r+6+4\/2, 25, r-1])\n {\n for(i=[0:len(names)-1])\n translate(i*[spacing, 0, 0])\n {\n holder();\n translate([0, 20, 0.9])\n linear_extrude(3*0.2)\n text(names[i], size=4, halign=\"center\");\n }\n }\n}\n\n\nwhole_holder([\"John\", \"Jane\", \"Jackob\"]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"72e5f86e03c143b8d87de0e5927581ba39326c3b","subject":"minor refinements","message":"minor refinements\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/SupportedShell.scad","new_file":"hardware\/sandbox\/SupportedShell.scad","new_contents":"include <..\/config\/config.scad>\n\nDebugCoordinateFrames = true;\nDebugConnectors = true;\n\nsw = 2 * 0.5; \/\/ approx 2 perimeters\n\nfunction sqr(a) = a*a;\n\nfunction circumference(radius) = 2 * PI * radius;\nfunction arcLength(radius, theta) = PI * radius * theta \/ 180;\nfunction chordLength(radius, theta) = radius * sqrt(2 - 2*cos(theta));\nfunction segmentHeight(radius, theta) = radius - sqrt(sqr(radius) - sqr(chordLength(radius, theta))\/4);\nfunction segmentDistance(radius,theta) = radius - segmentHeight(radius,theta);\n\n\n\/\/ 2D\n\/\/ in XY plane\n\/\/ chord begins at intersection of x+\n\/\/ extends towards y+\n\/\/ theta should be <= 180 degrees\nmodule circularSegment(radius, theta) {\n\tintersection() {\n\t\tcircle(radius);\n\t\t\n\t\t\/\/ chord hull\n\t\tpolygon(\n\t\t[\n\t\t\t[radius, 0],\n\t\t\t[2*radius * cos(theta*0.25), 2*radius * sin(theta*0.1)],\n\t\t\t[2*radius * cos(theta*0.5), 2*radius * sin(theta*0.5)],\n\t\t\t[2*radius * cos(theta*0.75), 2*radius * sin(theta*0.9)],\n\t\t\t[radius * cos(theta), radius * sin(theta)]\n\t\t], 5);\n\t}\n}\n\n\nmodule domeSupportSegment(radius=100, inset=0, thickness=1, supportAngle=45) {\n\tinsetAng = asin(inset\/radius);\t\n\ttheta = 180 - 2*supportAngle - 2*insetAng;\n\n\tsh = segmentHeight(radius,theta);\n\t\n\tif (sh > 2)\n\t\trotate([0,0,90 - theta - insetAng])\n\t\ttranslate([0,0,-thickness\/2])\n\t\tlinear_extrude(thickness)\n\t\tcircularSegment(radius,theta);\n}\n\n\nmodule shell() {\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + sw;\n\t\n\tsr = or - sw + eta;\n\t\n\tsupportAngle = 50;\n\tbridgeDist = 6;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\t\n\t$fn=64;\n\t\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\t\t\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\tdonutSector2D(\n\t\t\t\t\t\t\tor=or, \n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\t\/\/ clearance for pen\n\t\t\t\t\t\tsquare([PenHoleDiameter\/2, BaseDiameter]);\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\/\/ large support ribs\n\t\t\t\tfor (i=[0:numRibs\/4])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/4)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(sr, PenHoleDiameter\/2, perim, supportAngle);\n\t\t\t\t\t\n\t\t\t\t\/\/ medium support ribs\n\t\t\t\tfor (i=[0:numRibs\/4])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/4) + 360\/(numRibs\/2)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(sr, PenHoleDiameter\/2 + 2*bridgeDist, perim, supportAngle);\n\t\t\t\t\t\n\t\t\t\t\/\/ small support ribs\n\t\t\t\tfor (i=[0:numRibs\/2])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/2) + 360\/(numRibs)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(sr, PenHoleDiameter\/2 + 4*bridgeDist, perim, supportAngle);\n\t\t\t}\n\t\t}\n}\n\nshell();\n","old_contents":"include <..\/config\/config.scad>\n\nDebugCoordinateFrames = true;\nDebugConnectors = true;\n\nsw = 2 * 0.5; \/\/ approx 2 perimeters\n\nfunction sqr(a) = a*a;\n\nfunction circumference(radius) = 2 * PI * radius;\nfunction arcLength(radius, theta) = PI * radius * theta \/ 180;\nfunction chordLength(radius, theta) = radius * sqrt(2 - 2*cos(theta));\nfunction segmentHeight(radius, theta) = radius - sqrt(sqr(radius) - sqr(chordLength(radius, theta))\/4);\nfunction segmentDistance(radius,theta) = radius - segmentHeight(radius,theta);\n\n\n\/\/ 2D\n\/\/ in XY plane\n\/\/ chord begins at intersection of x+\n\/\/ extends towards y+\n\/\/ theta should be <= 180 degrees\nmodule circularSegment(radius, theta) {\n\tintersection() {\n\t\tcircle(radius);\n\t\t\n\t\t\/\/ chord hull\n\t\tpolygon(\n\t\t[\n\t\t\t[radius, 0],\n\t\t\t[2*radius * cos(theta*0.25), 2*radius * sin(theta*0.1)],\n\t\t\t[2*radius * cos(theta*0.5), 2*radius * sin(theta*0.5)],\n\t\t\t[2*radius * cos(theta*0.75), 2*radius * sin(theta*0.9)],\n\t\t\t[radius * cos(theta), radius * sin(theta)]\n\t\t], 5);\n\t}\n}\n\n\nmodule domeSupportSegment(radius=100, inset=0, thickness=1, supportAngle=45) {\n\tinsetAng = asin(inset\/radius);\t\n\ttheta = 180 - 2*supportAngle - 2*insetAng;\n\n\trotate([0,0,90 - theta - insetAng])\n\t\tlinear_extrude(thickness)\n\t\tcircularSegment(radius,theta);\n}\n\n\nmodule shell() {\n\n\tsupportAngle = 50;\n\tbridgeDist = 6;\n\n\tnumRibs = round(circumference(BaseDiameter\/2 * cos(90-supportAngle)) \/ bridgeDist);\n\techo(numRibs);\n\t\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\t\t\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\tdonutSector2D(\n\t\t\t\t\t\t\tor=BaseDiameter\/2 + Shell_NotchTol + sw, \n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\t\/\/ clearance for pen\n\t\t\t\t\t\tsquare([PenHoleDiameter\/2, BaseDiameter]);\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\/\/ large support ribs\n\t\t\t\tfor (i=[0:numRibs\/4])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/4)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2, perim, supportAngle);\n\t\t\t\t\t\n\t\t\t\t\/\/ medium support ribs\n\t\t\t\tfor (i=[0:numRibs\/4])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/4) + 360\/(numRibs\/2)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2 + 10, perim, supportAngle);\n\t\t\t\t\t\n\t\t\t\t\/\/ small support ribs\n\t\t\t\tfor (i=[0:numRibs\/2])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/2) + 360\/(numRibs)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2 + 20, perim, supportAngle);\n\t\t\t}\n\t\t\n\t\t\t\/\/ section\n\t\t\t*translate([-100,-200,-100])\n\t\t\t\tcube([200,200,200]);\n\t\t}\n}\n\nshell();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"062a77fabc2d08bf9cf29669f1260d753b96b6b8","subject":"pulley: minor fixes","message":"pulley: minor fixes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"pulley.scad","new_file":"pulley.scad","new_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?0:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, h], align=align, orient=orient)\n {\n difference()\n {\n union()\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n fncylindera(d = outer_d, h = walls, align=[0,0,-z], orient=[0,0,1]);\n\n fncylindera(d = inner_d, h = h, align=[0,0,0], orient=[0,0,1]);\n\n if(!is_idler)\n {\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,0], orient=[0,0,1]);\n }\n }\n fncylindera(d = bore, h = full_h, align=[0,0,0], orient=[0,0,1]);\n }\n }\n}\n\n\/*debug = false;*\/\nif(debug)\n{\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,1]);*\/\n}\n","old_contents":"\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?0:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, h], align=align, orient=orient)\n {\n difference()\n {\n union()\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n fncylindera(d = outer_d, h = walls, align=[0,0,-z], orient=[0,0,1]);\n\n fncylindera(d = inner_d, h = h, align=[0,0,0], orient=[0,0,1]);\n\n if(!is_idler)\n {\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,0], orient=[0,0,1]);\n }\n }\n fncylindera(d = bore, h = h+full_h, align=[0,0,0], orient=[0,0,1]);\n }\n }\n}\n\n\/*pulley(pulley_2GT_20T_idler, align, orient);*\/\n\/*pulley(pulley_2GT_20T, align=align, orient=orient);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d7d2c27a09f09dd6e2d48da2d0c156d5185ea7cd","subject":"fixup! shapes: add cuberounda","message":"fixup! shapes: add cuberounda\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0 || true)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0 || true)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0 || true)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d6536e0122b90a7b0c003974e6545466cc4f07d7","subject":"added negative_sq module","message":"added negative_sq module\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library2d.scad","new_file":"library2d.scad","new_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Hollowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule honeycomb_drainholes(x=10,y=10,r=0.7,d=0.1,fn=6,o1=1,o2=1,ra=0.25) {\n for(k=[-1,1])for(l=[0:(2*(r+r*sin(30)-d))*o1:x]){\n for(i=[1,-1])for(j=[0:(2*r*cos(30)-d)*o2:y]) {\n translate([k*l,i*j])circle(r=ra);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])circle(r=ra);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\nmodule negativ_sq() {\n difference() {\n hull()children();\n children();\n }\n}\n","old_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Hollowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule honeycomb_drainholes(x=10,y=10,r=0.7,d=0.1,fn=6,o1=1,o2=1,ra=0.25) {\n for(k=[-1,1])for(l=[0:(2*(r+r*sin(30)-d))*o1:x]){\n for(i=[1,-1])for(j=[0:(2*r*cos(30)-d)*o2:y]) {\n translate([k*l,i*j])circle(r=ra);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])circle(r=ra);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"d56f519bcd3b5ec296a402943b66707059516bad","subject":"Partial implementation of hut housing for \"nut drive\"","message":"Partial implementation of hut housing for \"nut drive\"\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/nut-drive\/nut-housings.scad","new_file":"openscad\/nut-drive\/nut-housings.scad","new_contents":"\/\/ Housings to hold hexagonal nut for a \"nut drive\" two nuts with\n\/\/ reverse threads on a threaded rod.\nuse <..\/common\/extrusions.scad>\nEPSILON = 0.01;\nLARGE = 100;\n\nfunction poly_coords(order, r=1) = \n let(angles=[ for (i = [0:order-1]) i*(360\/order) ])\n \t[ for (th=angles) [r*cos(th), r*sin(th)] ];\n\n \n module regular_polygon(order, r=1){\n \tpolygon(poly_coords(order, r));\n }\n\n\nblock_w = 30;\nblock_d = 30;\nblock_h = 10;\nblock_ro = 3;\n \nmodule center_piece() {\n \n hex_dia = 20;\n hole_r = 2.05;\n hole_major_dia = block_d - hole_r;\n hole_centers = poly_coords(4, hole_major_dia\/2);\n punch_h = block_h + 2*EPSILON;\n \n difference() {\n oblong(block_w, block_d, block_ro, block_h);\n translate([block_w\/2, block_d\/2, -EPSILON]) {\n linear_extrude(height = block_h + 2*EPSILON) regular_polygon(6, hex_dia\/2);\n rotate([0, 0, 45]) for (i = [0:3]) {\n translate(hole_centers[i]) \n cylinder(r=hole_r, h = punch_h);\n }\n }\n }\n}\n\n\n$fn = 50;\ncenter_piece();","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/nut-drive\/nut-housings.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"c693461d679ddc69e77e4acc41d6ab03f9ce1177","subject":"core pipe (in and out side) is now completed","message":"core pipe (in and out side) is now completed\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/launcher.scad","new_file":"pop_rocket\/launcher.scad","new_contents":"eps = 0.01;\nwall = 1.3;\n\nlaunch_side = 22;\nlaunch_h = 180;\n\nconn_phi = 25;\nconn_h = 20;\n\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangle_2d_int(side)\n{\n offset(r=-wall)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h, $fn=200)\n{\n cylinder(d=d, h=h);\n}\n\n\nmodule outer_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h)\n triangle_2d(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi, 20);\n \/\/ interconenction of both\n translate([-conn_phi\/2, -conn_phi, 0])\n cube([conn_phi, conn_phi, dz]);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h+2*eps)\n triangle_2d_int(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 20+eps);\n \/\/ smooth interconenction of both\n hull()\n {\n \/\/ launch side\n #rotate([90, 0, 0])\n linear_extrude(height=eps)\n triangle_2d_int(launch_side);\n \/\/ top-level connection facing side\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 0.1, $fn=50);\n \/\/ gradual narrowing of the pipe\n denom = 10;\n translate([0, 0, dz-1.5])\n for(r=[0:5:60])\n rotate([r, 0, 0])\n translate([0, -(conn_phi-r\/denom)\/2, 0])\n pipe_connector(conn_phi-2*wall-r\/denom, 0.1, $fn=50);\n }\n}\n\n\nmodule launcher()\n{\n difference()\n {\n outer_pipe();\n inner_pipe();\n }\n \/\/ TODO screw holes :P\n}\n\nlauncher();\n","old_contents":"eps = 0.01;\nwall = 1.3;\n\nlaunch_side = 22;\nlaunch_h = 180;\n\nconn_phi = 25;\nconn_h = 20;\n\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangle_2d_int(side)\n{\n offset(r=-wall)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h, $fn=200)\n{\n cylinder(d=d, h=h);\n}\n\n\nmodule outer_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h)\n triangle_2d(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi, 20);\n \/\/ interconenction of both\n translate([-conn_phi\/2, -conn_phi, 0])\n cube([conn_phi, conn_phi, dz]);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h+2*eps)\n triangle_2d_int(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 20+eps);\n \/\/ interconenction of both\n \/*\n hull()\n {\n rotate([90, 0, 0])\n triangular_prism(launch_side, 0.1);\n translate([0, 0, dz])\n for(r=[0:5:40])\n rotate([r, 0, 0])\n translate([0, -conn_phi\/2, 0])\n pipe_connector(conn_phi-r\/5, 0.1, $fn=50);\n }\n *\/\n}\n\n\nmodule launcher()\n{\n difference()\n {\n\/\/ outer_pipe();\n inner_pipe();\n }\n \/\/ TODO screw holes :P\n}\n\nlauncher();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"44deafd31ee37d7d50a9341a73f317f5bbbf4681","subject":"fixed dimentioning - some diameters were put in diameter instead of redius","message":"fixed dimentioning - some diameters were put in diameter instead of redius\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"\/*\n * configuration\n *\/\nbrushes_count = 2;\n$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=20\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=16, r=(24+5)\/2);\n cylinder(h=16, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-16+13])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 16]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(offset = [0:brushes_count-1])\n {\n translate(offset * [30, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"\/*\n * configuration\n *\/\nbrushes_count = 2;\n$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, 20+4, 0])\n difference()\n {\n cylinder(h=10+3, r=20);\n translate([0,0,3])\n cylinder(h=10+3, r2=20, r1=16);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, 24+5, 0])\n difference()\n {\n cylinder(h=16, r=24+5);\n cylinder(h=16, r=24+0);\n }\n}\n\n\nmodule back_wall()\n{\n translate([0,0,0])\n {\n \/\/ lower part\n translate([-70\/2, 0, 0])\n cube([70, 3, 20]);\n \/\/ upper part\n translate([-70\/2, 0, 100-16+13])\n cube([70, 3, 20]);\n \/\/ connector\n translate([-20\/2, 0, 0])\n cube([20, 3, 100]);\n }\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-30\/2, 3, 0])\n cube([30, 10, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100])\n {\n difference()\n {\n translate([-40\/2, 3, 0])\n cube([40, 10, 16]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(offset = [0:brushes_count-1])\n {\n translate(offset * [60, 0, 0])\n brush_holder();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"582c6ad04bc58504f2ec7a10ecec0e71d24c5377","subject":"number of brushes is now computed from array names length, that is a part of configuration","message":"number of brushes is now computed from array names length, that is a part of configuration\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"include \n\n\/*\n * configuration\n *\/\nnames = [\"JOHN\", \"JANE\", \"BILLY\"];\nbrushes_count = len(names);\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,55])\n rotate([-90, 90, 0])\n scale([2,1,1])\n write(names[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"include \n\n\/*\n * configuration\n *\/\nbrushes_count = 2;\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\nname = [\"name1\", \"name2\"];\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,55])\n rotate([-90, 90, 0])\n scale([2,1,1])\n write(name[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f9ed9875682a7cb321a5170e5a2a1700d6749188","subject":"increased hole diameter for a roller","message":"increased hole diameter for a roller\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toy_elevator_roll\/toy_elevator_roll.scad","new_file":"toy_elevator_roll\/toy_elevator_roll.scad","new_contents":"eps=0.01;\nr_stick=3.5\/2; \/\/ d=2.5mm + 1mm for imprecissions, etc.\n\nmodule roller()\n{\n difference()\n {\n cylinder(r=20\/2, h=5, $fn=200);\n translate([0, 0, -eps])\n cylinder(r=r_stick, h=5+2*eps, $fn=200);\n }\n translate([20\/2-5\/2, 0, 5])\n cylinder(r=5\/2, h=20, $fn=100);\n}\n\nmodule spool_body_()\n{\n r_ext=(5+2*3)\/2;\n r_int=r_stick+1;\n\n difference()\n {\n union()\n {\n cylinder(r1=r_ext, r2=r_int, h=5.5, $fn=150);\n translate([0, 0, 5.5+3])\n cylinder(r1=r_int, r2=r_ext, h=5.5, $fn=150);\n translate([0, 0, 5.5])\n cylinder(r=r_int, h=3, $fn=100);\n }\n translate([0, 0, -eps])\n cylinder(r=r_stick, h=2*5.5+3+2*eps, $fn=200);\n }\n}\n\nmodule hook_()\n{\n r_int=1\/2;\n r_ext=r_int+1;\n\n difference()\n {\n translate([-2, -1.5\/2, 0])\n cube([2, 1.5, 3+2*3]);\n\n translate([-1, 0, (3+2*3)\/2])\n translate([0, 1, 0])\n rotate([90, 0, 0])\n translate([0, 0, -eps])\n cylinder(r=1\/2, h=2+2*eps, $fn=200);\n }\n}\n\nmodule spool()\n{\n spool_body_();\n translate([-1.8, 0, 2.5])\n hook_();\n}\n\nroller();\ntranslate([20, 0, 0])\n spool();\n","old_contents":"eps=0.01;\nr_stick=2.8\/2; \/\/ extr_width=0.4, d=2.5mm, thus 7*0.4=2.8 as a next best thing\n\nmodule roller()\n{\n difference()\n {\n cylinder(r=20\/2, h=5, $fn=200);\n translate([0, 0, -eps])\n cylinder(r=r_stick, h=5+2*eps, $fn=200);\n }\n translate([20\/2-5\/2, 0, 5])\n cylinder(r=5\/2, h=20, $fn=100);\n}\n\nmodule spool_body_()\n{\n r_ext=(5+2*3)\/2;\n r_int=r_stick+1;\n\n difference()\n {\n union()\n {\n cylinder(r1=r_ext, r2=r_int, h=5.5, $fn=150);\n translate([0, 0, 5.5+3])\n cylinder(r1=r_int, r2=r_ext, h=5.5, $fn=150);\n translate([0, 0, 5.5])\n cylinder(r=r_int, h=3, $fn=100);\n }\n translate([0, 0, -eps])\n cylinder(r=r_stick, h=2*5.5+3+2*eps, $fn=200);\n }\n}\n\nmodule hook_()\n{\n r_int=1\/2;\n r_ext=r_int+1;\n\n difference()\n {\n translate([-2, -1.5\/2, 0])\n cube([2, 1.5, 3+2*3]);\n \n translate([-1, 0, (3+2*3)\/2])\n translate([0, 1, 0])\n rotate([90, 0, 0])\n translate([0, 0, -eps])\n cylinder(r=1\/2, h=2+2*eps, $fn=200);\n }\n}\n\nmodule spool()\n{\n spool_body_();\n translate([-1.8, 0, 2.5])\n hook_();\n}\n\nroller();\ntranslate([20, 0, 0])\n spool();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6af3d25375afa42abf8832468a54f54d636ddc16","subject":"Added dumplings cutter","message":"Added dumplings cutter\n","repos":"ksuszka\/3d-projects","old_file":"small\/dumplings_cutter.scad","new_file":"small\/dumplings_cutter.scad","new_contents":"$fs=0.2; \/\/ default 2\n$fa=3; \/\/ default 12\n\nform_r = 25;\nflange_width = 5;\nflange_height = 3;\nflange_notches_count = 28;\nflange_notch_r = 1.5;\ninner_r = form_r - flange_width;\n\nmodule flange() {\n module flange_shell() {\n rotate_extrude() {\n polygon([\n [inner_r, 0],\n [inner_r, 1],\n [form_r + 1, 1],\n [form_r + 1, -flange_height\/2],\n [form_r + 0.5, -flange_height],\n [form_r, -flange_height],\n [form_r, 0]\n ]);\n }\n }\n module flange_notches() {\n intersection() {\n for(i=[0:360\/flange_notches_count:359]) {\n rotate([0,0,i])\n translate([inner_r,0,0]) {\n intersection() {\n union() {\n translate([flange_notch_r,0,0])\n sphere(r=flange_notch_r);\n translate([flange_width\/2+flange_notch_r,0,0])\n rotate([0,90,0])\n cylinder(r=flange_notch_r,h=flange_width,center=true);\n }\n }\n }\n }\n translate([0,0,-4.5]) cylinder(r=form_r+0.1,h=10,center=true);\n }\n }\n flange_shell();\n flange_notches();\n}\nhandle_inner_x0 = inner_r+0.1;\nhandle_outer_x0 = form_r + 1.52;\nhandle_inner_x1 = handle_inner_x0;\nhandle_outer_x1 = handle_inner_x1 + 3;\nhandle_y1 = 10;\nhandle_inner_x2 = 2;\nhandle_outer_x2 = handle_inner_x2 + 3;\nhandle_y2 = 28;\nhandle_inner_x3 = 3;\nhandle_outer_x3 = 0;\nhandle_inner_y3 = 30;\nhandle_outer_y3 = 32;\nhandle_outer_x4 = 300;\nhandle_inner_x4 = 100;\nhandle_y4 = 150;\nhandle_top = 40;\nhandle_bottom = 0.99;\n\n\/\/#translate([0,0,31]) rotate([0,-45,0])cube([1000,1,1],true);\nmodule handle_outer_edge() {\n polygon([\n [handle_outer_x0, 2],\n [handle_outer_x1, handle_y1],\n [handle_outer_x2, handle_y2],\n [handle_outer_x3, handle_outer_y3],\n [handle_outer_x4, handle_y4],\n [-100, handle_y4],\n [-100, -100],\n [handle_outer_x0, -100]\n ]);\n}\nmodule handle_inner_edge() {\n polygon([\n [handle_inner_x0, 2],\n [handle_inner_x1, handle_y1],\n [handle_inner_x2, handle_y2],\n [handle_inner_x3, handle_inner_y3],\n [handle_inner_x4, handle_y4],\n [-100, handle_y4],\n [-100, -100],\n [handle_inner_x0, -100]\n ]);\n}\n\/\/handle_inner_edge();\nmodule handle_both_edges() {\n difference() {\n offset(r=-10) offset(delta=10)\n offset(r=25) offset(delta=-25)\n handle_outer_edge();\n offset(r=-10) offset(delta=10)\n offset(r=25) offset(delta=-25)\n handle_inner_edge();\n };\n}\n\nmodule handle_silhouette() {\n intersection() {\n offset(r=0.9) offset(delta=-0.9)\n intersection() {\n handle_both_edges();\n translate([0,handle_top-500]) square(1000, true);\n }\n translate([0,handle_bottom+500]) square(1000, true);\n } \n}\n\/\/handle_silhouette();\nmodule handle() {\n rotate_extrude() {\n handle_silhouette();\n }\n}\n\nmodule cutter() {\n handle();\n flange();\n}\n\nintersection() {\n cutter();\n\/\/ cube([1000,1,1000],true);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/dumplings_cutter.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c88b8edab0d67cbd81f3e19cc244e6afb8f764f9","subject":"Commented code was removed.","message":"Commented code was removed.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(borderColor = \"yellow\",\r\n font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n letterThickness = 3,\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n echo(\"rc:7 \");\r\n echo(borderHeight);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\n\r\n\/* [Top Text] *\/\r\n\/\/topTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\n\/\/topLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\n\/\/topLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\n\/\/bottomText = \"\";\r\n\/\/bottomLetterSize = 8.8; \/\/ [2 : 25]\r\n\/\/bottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\n\/\/bottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(borderColor = \"yellow\",\r\n font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n letterThickness = 3,\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n echo(\"rc:7 \");\r\n echo(borderHeight);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"eae777d5cdceed75f8b0e6db92650ddbe6684172","subject":"decreased spacing for the original model mount, for a better fit","message":"decreased spacing for the original model mount, for a better fit\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"orp_orze\u0142_model_holder\/holder.scad","new_file":"orp_orze\u0142_model_holder\/holder.scad","new_contents":"eps = 0.01;\nspacing = 4;\nsize = [74.1+2*spacing, 32.2+2*spacing];\nrounding = 5;\n\nmodule holder_()\n{\n z=2;\n x=74.1;\n y=32.2;\n w=3.08;\n for(dx=[0, x-w])\n translate([dx,0,0])\n {\n cube([w, y, z]);\n translate(6*[0, 1\/2, 0])\n cube([w, y-6, z+20]);\n }\n translate([0, y\/2-w\/2, z])\n cube([x, w, z]);\n}\n\nmodule holder_space_()\n{\n space=1;\n z=2-0.5;\n x=74.1;\n y=32.2+2*space;\n w=3.08+2*space;\n for(dx=[0, x-w+2*space])\n translate([dx, 0, 0])\n cube([w, y, z]);\n}\n\nmodule main_block_()\n{\n \/\/ desk mount\n difference()\n {\n cube([size[0], 19+2*2, 20+4]);\n translate([-eps, 2, 4])\n cube([size[0]+2*eps, 19, 20+1]);\n }\n \/\/ main surface\n for(i=[0, size[0]-rounding*2-1])\n translate([i, 0, 0])\n hull()\n {\n cube([2*rounding+1, 1, 3]);\n for(j=[0, 1])\n translate(spacing*[1,0,0] + [j+1, size[1], 0])\n cylinder(r=rounding, h=3, $fn=120);\n }\n}\n\n\nmodule holder()\n{\n difference()\n {\n main_block_();\n translate([3, spacing+1, 0])\n #holder_space_();\n translate(2*[1, 1, 0] + [size[0]-spacing-2, spacing, 1.5])\n rotate([0, 180, 0])\n %holder_();\n }\n}\n\nholder();\n","old_contents":"eps = 0.01;\nspacing = 4;\nsize = [74.1+2*spacing, 32.2+2*spacing];\nrounding = 5;\n\nmodule holder_()\n{\n z=2;\n x=74.1;\n y=32.2;\n w=3.08;\n for(dx=[0, x-w])\n translate([dx,0,0])\n {\n cube([w, y, z]);\n translate(6*[0, 1\/2, 0])\n cube([w, y-6, z+20]);\n }\n translate([0, y\/2-w\/2, z])\n cube([x, w, z]);\n}\n\nmodule holder_space_()\n{\n space=2;\n z=2-0.5;\n x=74.1;\n y=32.2+2*space;\n w=3.08+2*space;\n for(dx=[0, x-w+2*space])\n translate([dx, 0, 0])\n cube([w, y, z]);\n}\n\nmodule main_block_()\n{\n \/\/ desk mount\n difference()\n {\n cube([size[0], 19+2*2, 20+4]);\n translate([-eps, 2, 4])\n cube([size[0]+2*eps, 19, 20+1]);\n }\n \/\/ main surface\n for(i=[0, size[0]-rounding*2-1])\n translate([i, 0, 0])\n hull()\n {\n cube([2*rounding+1, 1, 3]);\n for(j=[0, 1])\n translate(spacing*[1,0,0] + [j+1, size[1], 0])\n cylinder(r=rounding, h=3, $fn=120);\n }\n}\n\n\nmodule holder()\n{\n difference()\n {\n main_block_();\n translate([2, spacing, 0])\n #holder_space_();\n translate(2*[1, 1, 0] + [size[0]-spacing-2, spacing, 1.5])\n rotate([0, 180, 0])\n %holder_();\n }\n}\n\nholder();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d22358beab513604469e07f893613c0e4f873c17","subject":"fix ttb and rotate on cylinder","message":"fix ttb and rotate on cylinder\n\nFixes for tb,btt on circles and cylinders, as well as error in rotate on\ncylinder.\n","repos":"brodykenrick\/text_on_OpenSCAD","old_file":"text_on.scad","new_file":"text_on.scad","new_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t=\"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\";\t \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false;\t \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0;\t\t \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth= 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi=3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2=internal_pi*2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = (center==true) ? height\/2 : height ;\r\nfunction cylinder_center_adjusted_bottom( height, center ) = (center==true) ? height\/2 : 0 ;\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0)\r\n = ( width_of_text_char( size, spacing ) \/(internal_pi2*r))*360*(1-abs(rotate)\/90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering\t\r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing,r,rotate,center)\r\n\t= (center) ? (width_of_text_string_num_length( len(t)-1, size, spacing )\/2\/(internal_pi2*r)*360) : 0 ;\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center)\r\n\t= ((center) ? (width_of_text_string( t, size, spacing )\/2\/(internal_pi2*r)*360) : 1) * (1-abs(rotate)\/90);\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t=default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\trtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n\tif ((face==\"top\")||(face==\"bottom\") ){\r\n\t\t\/\/Work on a circle\r\n\t\tlocn_offset_vec = (face==\"top\" ) ? [0,0,cylinder_center_adjusted_top(h,cylinder_center)] : [0,0,cylinder_center_adjusted_bottom(h,cylinder_center)] ;\r\n\t\trotation_angle = (face==\"top\" ) ? 0 : 180 ;\r\n\t\tint_radius = (r==undef) ? ((face==\"top\" ) ? r2 : r1 ) : r; \/\/Use the top\/bottom radius for slanty-cylinders\r\n\t\t\trotate(rotation_angle,[1,0,0])\r\n\t\t\ttext_on_circle(t,locn_vec+locn_offset_vec,r=int_radius-size,\r\n\t\t\t\tfont=font,size=size,\r\n\t\t\t\tspacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t\textrusion_height=extrusion_height,\r\n\t\t\t\trotate=rotate,\r\n\t\t\t\teastwest=eastwest,middle=middle,ccw=ccw);\r\n\t}else{\r\n\t\tif((middle!=undef) && (middle!=default_circle_middle))\r\n\t\t{\r\n\t\t\t\/\/TODO: Which others?\r\n\t\t\t\/\/TODO: Which side things aren't supported on the circle\r\n\t\t\techo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n\t\t}\r\n\t\t\/\/Work on the side\r\n\t\tlocn_offset_vec = (cylinder_center==true) ? [0,0,0] : [0,0,h\/2]; \r\n\t\trotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing,r,rotate,center), [0,0,1])\r\n\t\ttranslate(locn_vec+locn_offset_vec)\r\n\t\t__internal_text_on_cylinder_side(t,locn_vec,r=r,h=h,r1=r1,r2=r2,\r\n\t\t\tcylinder_center=cylinder_center,\r\n\t\t\tcenter=center,\r\n\t\t\tfont=font,size=size,\r\n\t\t\tspacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\textrusion_height=extrusion_height,\r\n\t\t\trotate=rotate,face=face,updown=updown,\r\n\t\t\teastwest=eastwest);\r\n\t}\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\tccw_sign = (ccw==true) ? 1 : -1;\r\n\trtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n\trotate_z_outer = -rotate + ccw_sign*eastwest;\r\n\trotate_z_inner = -rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string( t, size, spacing, r-middle, rotate, center);\r\n\trotate( rotate_z_outer, [0,0,1] )\r\n\trotate( rotate_z_inner, [0,0,1] )\r\n\ttranslate(locn_vec)\r\n\tfor (l=[0:len(t)-1]){\r\n\t\t\/\/TTB\/BTT means no per letter rotation\r\n\t\trotate_z_inner2 = -ccw_sign * 90 + ttb_btt_inaction*rtl_sign*ccw_sign*l*rotation_for_character(size, spacing, r-middle, rotate=0); \/\/Bottom out=-270+r\r\n\t\t\/\/TTB means we go toward center, BTT means away\r\n\t\tvert_x_offset = (direction==\"ttb\" || direction==\"btt\") ? (l * size * ((direction==\"btt\") ? -1 : 1)) : 0;\r\n\t\trotate( rotate_z_inner2, [0,0,1] )\r\n\t\ttranslate([r - middle - vert_x_offset,0,0])\r\n\t\trotate(-ccw_sign*270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\ttext_extrude(t[l],center=true,\r\n\t\t\tfont=font,size=size,\r\n\t\t\trotate=undef,\r\n\t\t\tspacing=spacing,\r\n\t\t\tdirection=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t\t\tlanguage=language,script=script,halign=halign,valign=valign,\r\n\t\t\textrusion_height=extrusion_height );\r\n\t}\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1,r2,h_total,h_offset) = ( r1 + ((r2-r1) * (h_total-h_offset)\/h_total) );\r\n \r\n \t\/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1,r2,h,length,rotate, updown) = ( h\/2 - updown + length * rotate\/90 * cos( atan( (r2-r1)\/h ) ) );\r\n\r\n function calc_radius_at_length(r1,r2,h,length,rotate,updown) = ( calc_radius_at_height_offset(r1,r2,h,calc_height_offset_at_length(r1,r2,h,length,rotate,updown)));\r\n \r\n if(r==undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction==\"btt\") || (direction==\"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\")); \r\n }\r\n if(center==true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n r1 = (r1!=undef) ? r1 : r;\r\n r2 = (r2!=undef) ? r2 : r;\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\trr1 = (center) ? r1-extrusion_height\/2 : r1;\r\n\trr2 = (center) ? r2-extrusion_height\/2 : r2;\r\n\t\r\n ccenter = (r!=undef) ? center : false; \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n ddirection = ((r==undef) && ((direction==\"ttb\")||(direction==\"btt\"))) ? \"ltr\" : direction; \/\/We don't do ttb or btt directions on slanty\r\n rtl_sign = (ddirection==\"rtl\") ? -1 : 1;\r\n\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0,0,updown])\r\n rotate(eastwest,[0,0,1])\r\n for (l=[0:len(t)-1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \t \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n length_to_center_of_char = width_of_text_string_num_length(l+0.5,size,spacing);\r\n radius_here = calc_radius_at_length(rr1,rr2,h, length_to_center_of_char, rotate, updown);\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n\t\t rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, ( radius_here ), rotate) * ((ddirection==\"ttb\" || ddirection==\"btt\") ? 0 : l);\r\n\t rotate(rotate_z_inner,[0,0,1])\r\n\t\t\t{\r\n\t \/\/Positioning - based on (somewhat innacurate) string length\r\n\t\t \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n\t\t vert_z_char_offset = (ddirection==\"ttb\" || ddirection==\"btt\") ? (l * size * ((ddirection==\"ttb\") ? -1 : 1 )) : 0 ;\r\n\t\t \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n\t\t vert_z_half_text_offset_tmp = (len(t)-1)\/2 * (rotate\/90*wid);\r\n\t\t vert_z_half_text_offset = ((ddirection==\"ttb\" || ddirection==\"btt\") || (ccenter==false)) ? 0 : vert_z_half_text_offset_tmp;\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate)\/90*wid) + vert_z_half_text_offset])\r\n\r\n\t \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n\t rotate( atan( (rr2-rr1)\/h ) , [0,1,0])\r\n\t \/\/Flip onto face of \"normal\" cylinder\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\r\n \t \/\/Modify the offset of the baselined text to center\r\n translate([0,(ccenter) ? -size\/2 : 0,0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t font=font,size=size,\r\n\t spacing=spacing,\r\n\t direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t language=language,script=script,\r\n\t halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n\t extrusion_height=extrusion_height\r\n\t );\r\n\t\t\t}\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n\trtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n\t\r\n\t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\t\/\/If we are centered - we sink the radius by half the\r\n\t\/\/extrusion height to draw \"just below the surface\"\r\n\trr = (center) ? r-extrusion_height\/2 : r ;\r\n\t\r\n\trotate(eastwest,[0,0,1])\r\n\trotate(-northsouth,[1,0,0])\r\n\trotate(spin,[0,1,0])\r\n\t{\r\n\t\/\/This tries to center the text (for RTL text).\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n\trotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, rr, rotate, center), [0,0,1])\r\n\t{\r\n\t translate(locn_vec)\r\n\t\tif ( rounded == false ){\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=rr,\r\n\t \t\trotate=rotate,\r\n\t \t\tcenter=center,\r\n\t \t\tscale=scale,\r\n\t font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height\r\n\t\t\t);\r\n\t\t}else{\r\n\t\t \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n\t\t\tintersection()\r\n\t\t\t{\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=rr,\r\n \t\trotate=rotate,\r\n \t\tcenter=center,\r\n \t\tscale=scale,\r\n font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height*2 \/\/Make it proud to clip it off.\r\n\t\t );\r\n\r\n \/\/Shell - bounding inner and outer\r\n\t\t\tdifference()\r\n\t\t\t{ \/\/rounded outside\r\n\t\t\t\tsphere(rr+extrusion_height);\r\n\t\t\t\t\/\/ rounded inside for indented text\r\n\t\t\t sphere( rr );\r\n\t\t\t}\r\n\r\n\t\t }\r\n\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t=default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n rtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n ttb_btt_action = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0;\r\n \r\n for (l=[0:len(t)-1]){\r\n\t rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0);\r\n\t \r\n rotate( rotate_z_inner, [0,0,1] )\r\n\t\t{\r\n translate_sign = (direction==\"ttb\" || direction==\"btt\") ? ((direction==\"btt\") ? 1 : -1) : 0 ;\r\n \/\/translate_effect = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0 ;\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n\t translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n\t rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l )\/90 , [0,1,0])\r\n \/\/Flip character into position to be flush against sphere\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\t \r\n\t \/\/Modify the offset of the baselined text to center\r\n\t translate([0,(center) ? -size\/2 : 0 ,0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t scale=scale,\r\n\t font=font,\r\n\t size=size,\r\n spacing=spacing,\r\n direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language=language,script=script,\r\n halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height=extrusion_height );\r\n\t\t}\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t=default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0,0,0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n int_cube_size = (str(cube_size)[0] != \"[\") ? [cube_size,cube_size,cube_size] : cube_size;\r\n rotate_x = ( (face==\"front\") || (face==\"back\") || (face==\"left\") || (face==\"right\") ) ? 90\r\n\t\t\t\t: ((face==\"bottom\") ? 180 : 0) ; \/\/Top is zero\r\n\trotate_y = ( (face==\"back\") || (face==\"left\") || (face==\"right\") ) ? (face==\"back\") ? 180 : ((face==\"left\") ? -90 : 90) \/\/Right is 90\r\n\t\t\t\t: 0 ; \/\/Top, bottom, front are zero\r\n\tlocn_vec_offset =\r\n\t (face==\"front\") ? [+rightleft, -int_cube_size[1]\/2, +updown]\r\n\t :((face==\"back\")? [+rightleft, +int_cube_size[1]\/2, +updown]\r\n\t : ((face==\"left\")? [-int_cube_size[0]\/2, +rightleft, +updown]\r\n\t : ((face==\"right\")? [+int_cube_size[0]\/2, +rightleft, +updown]\r\n\t : ((face==\"top\")? [+rightleft, +updown, +int_cube_size[2]\/2]\r\n\t : [+rightleft, -updown, -int_cube_size[2]\/2]\r\n\t\t\t\t\t\t\t)))); \/\/bottom\r\n\t\t\t\t\t\t\t\r\n\t\ttranslate(locn_vec + locn_vec_offset)\r\n\t\trotate(rotate_x,[1,0,0])\r\n\t\trotate(rotate_y,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\ttext_extrude(t,\r\n\t\t center=center,\r\n\t\t rotate=rotate,\r\n\t\t scale=scale,\r\n\t\t font=font,\r\n\t\t size=size,\r\n\t\t spacing=spacing,\r\n\t\t direction=direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n\t\t language=language,\r\n\t\t script=script,\r\n\t\t halign=halign,\r\n\t\t valign=valign,\r\n\t\t extrusion_height=extrusion_height );\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val!=undef) ? val : default_val ;\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t=default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center==true)\r\n {\r\n if((halign!=undef) || (valign!=undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n t = default_if_undef(t,default_t);\r\n font = default_if_undef(font,default_font);\r\n extrusion_height = default_if_undef(extrusion_height,default_extrusion_height);\r\n center = default_if_undef(center,default_center);\r\n rotate = default_if_undef(rotate,default_rotate);\r\n spacing = default_if_undef(spacing,default_spacing);\r\n size = default_if_undef(size,default_size);\r\n \r\n halign = (center) ? \"center\" : halign ;\r\n valign = (center) ? \"center\" : valign ;\r\n extrusion_center = (center) ? true : false ;\r\n\t\r\n\tscale( scale )\r\n rotate(rotate,[0,0,-1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n\t{\r\n\t linear_extrude(height=extrusion_height,convexity=10,center=extrusion_center)\r\n text(text=t, size = size,\r\n $fn = 40,\r\n font = font, direction = direction, spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language=language, script=script);\r\n\t}\r\n}\r\n\r\n","old_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t=\"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\";\t \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false;\t \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0;\t\t \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth= 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi=3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2=internal_pi*2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = (center==true) ? height\/2 : height ;\r\nfunction cylinder_center_adjusted_bottom( height, center ) = (center==true) ? height\/2 : 0 ;\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0)\r\n = ( width_of_text_char( size, spacing ) \/(internal_pi2*r))*360*(1-abs(rotate)\/90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering\t\r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing,r,rotate,center)\r\n\t= (center) ? (width_of_text_string_num_length( len(t)-1, size, spacing )\/2\/(internal_pi2*r)*360) : 0 ;\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center)\r\n\t= ((center) ? (width_of_text_string( t, size, spacing )\/2\/(internal_pi2*r)*360) : 1) * (1-abs(rotate)\/90);\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t=default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\trtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n\tif ((face==\"top\")||(face==\"bottom\") ){\r\n\t\t\/\/Work on a circle\r\n\t\tlocn_offset_vec = (face==\"top\" ) ? [0,0,cylinder_center_adjusted_top(h,cylinder_center)] : [0,0,cylinder_center_adjusted_bottom(h,cylinder_center)] ;\r\n\t\trotation_angle = (face==\"top\" ) ? 0 : 180 ;\r\n\t\tint_radius = (r==undef) ? ((face==\"top\" ) ? r2 : r1 ) : r; \/\/Use the top\/bottom radius for slanty-cylinders\r\n\t\t\trotate(rotation_angle,[1,0,0])\r\n\t\t\ttext_on_circle(t,locn_vec+locn_offset_vec,r=int_radius-size,\r\n\t\t\t\tfont=font,size=size,\r\n\t\t\t\tspacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t\textrusion_height=extrusion_height,\r\n\t\t\t\trotate=rotate,\r\n\t\t\t\teastwest=eastwest,middle=middle,ccw=ccw);\r\n\t}else{\r\n\t\tif((middle!=undef) && (middle!=default_circle_middle))\r\n\t\t{\r\n\t\t\t\/\/TODO: Which others?\r\n\t\t\t\/\/TODO: Which side things aren't supported on the circle\r\n\t\t\techo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n\t\t}\r\n\t\t\/\/Work on the side\r\n\t\tlocn_offset_vec = (cylinder_center==true) ? [0,0,0] : [0,0,h\/2]; \r\n\t\trotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing,r,rotate,center), [0,0,1])\r\n\t\ttranslate(locn_vec+locn_offset_vec)\r\n\t\t__internal_text_on_cylinder_side(t,locn_vec,r=r,h=h,r1=r1,r2=r2,\r\n\t\t\tcylinder_center=cylinder_center,\r\n\t\t\tcenter=center,\r\n\t\t\tfont=font,size=size,\r\n\t\t\tspacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\textrusion_height=extrusion_height,\r\n\t\t\trotate=rotate,face=face,updown=updown,\r\n\t\t\teastwest=eastwest);\r\n\t}\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\tccw_sign = (ccw==true) ? 1 : -1;\r\n\trtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n\trotate_z_outer = -rotate + ccw_sign*eastwest;\r\n\trotate_z_inner = -rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string( t, size, spacing, r-middle, rotate, center);\r\n\trotate( rotate_z_outer, [0,0,1] )\r\n\trotate( rotate_z_inner, [0,0,1] )\r\n\ttranslate(locn_vec)\r\n\tfor (l=[0:len(t)-1]){\r\n\t\t\/\/TTB\/BTT means no per letter rotation\r\n\t\trotate_z_inner2 = -ccw_sign * 90 + ttb_btt_inaction*rtl_sign*ccw_sign*l*rotation_for_character(size, spacing, r-middle, rotate=0); \/\/Bottom out=-270+r\r\n\t\t\/\/TTB means we go toward center, BTT means away\r\n\t\tvert_x_offset = (direction==\"ttb\" || direction==\"btt\") ? size * ((direction==\"btt\") ? -1 : 1) : 0;\r\n\t\trotate( rotate_z_inner2, [0,0,1] )\r\n\t\ttranslate([r - middle - vert_x_offset,0,0])\r\n\t\trotate(-ccw_sign*270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\ttext_extrude(t[l],center=true,\r\n\t\t\tfont=font,size=size,\r\n\t\t\trotate=undef,\r\n\t\t\tspacing=spacing,\r\n\t\t\tdirection=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t\t\tlanguage=language,script=script,halign=halign,valign=valign,\r\n\t\t\textrusion_height=extrusion_height );\r\n\t}\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1,r2,h_total,h_offset) = ( r1 + ((r2-r1) * (h_total-h_offset)\/h_total) );\r\n \r\n \t\/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1,r2,h,length,rotate, updown) = ( h\/2 - updown + length * rotate\/90 * cos( atan( (r2-r1)\/h ) ) );\r\n\r\n function calc_radius_at_length(r1,r2,h,length,rotate,updown) = ( calc_radius_at_height_offset(r1,r2,h,calc_height_offset_at_length(r1,r2,h,length,rotate,updown)));\r\n \r\n if(r==undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction==\"btt\") || (direction==\"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\")); \r\n }\r\n if(center==true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n r1 = (r1!=undef) ? r1 : r;\r\n r2 = (r2!=undef) ? r2 : r;\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\trr1 = (center) ? r1-extrusion_height\/2 : r1;\r\n\trr2 = (center) ? r2-extrusion_height\/2 : r2;\r\n\t\r\n ccenter = (r!=undef) ? center : false; \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n ddirection = ((r==undef) && ((direction==\"ttb\")||(direction==\"btt\"))) ? \"ltr\" : direction; \/\/We don't do ttb or btt directions on slanty\r\n rtl_sign = (ddirection==\"rtl\") ? -1 : 1;\r\n\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0,0,updown])\r\n rotate(eastwest,[0,0,1])\r\n for (l=[0:len(t)-1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \t \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n length_to_center_of_char = width_of_text_string_num_length(l+0.5,size,spacing);\r\n radius_here = calc_radius_at_length(rr1,rr2,h, length_to_center_of_char, rotate, updown);\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n\t\t rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, ( radius_here ), rotate) * (ddirection==\"ttb\" || ddirection==\"btt\") ? 0 : l;\r\n\t rotate(rotate_z_inner,[0,0,1])\r\n\t\t\t{\r\n\t \/\/Positioning - based on (somewhat innacurate) string length\r\n\t\t \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n\t\t vert_z_char_offset = (ddirection==\"ttb\" || ddirection==\"btt\") ? size * ((ddirection==\"ttb\") ? -1 : 1 ) : 0 ;\r\n\t\t \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n\t\t vert_z_half_text_offset_tmp = (len(t)-1)\/2 * (rotate\/90*wid);\r\n\t\t vert_z_half_text_offset = ((ddirection==\"ttb\" || ddirection==\"btt\") || (ccenter==false)) ? 0 : vert_z_half_text_offset_tmp;\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate)\/90*wid) + vert_z_half_text_offset])\r\n\r\n\t \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n\t rotate( atan( (rr2-rr1)\/h ) , [0,1,0])\r\n\t \/\/Flip onto face of \"normal\" cylinder\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\r\n \t \/\/Modify the offset of the baselined text to center\r\n translate([0,(ccenter) ? -size\/2 : 0,0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t font=font,size=size,\r\n\t spacing=spacing,\r\n\t direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t language=language,script=script,\r\n\t halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n\t extrusion_height=extrusion_height\r\n\t );\r\n\t\t\t}\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n\trtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n\t\r\n\t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\t\/\/If we are centered - we sink the radius by half the\r\n\t\/\/extrusion height to draw \"just below the surface\"\r\n\trr = (center) ? r-extrusion_height\/2 : r ;\r\n\t\r\n\trotate(eastwest,[0,0,1])\r\n\trotate(-northsouth,[1,0,0])\r\n\trotate(spin,[0,1,0])\r\n\t{\r\n\t\/\/This tries to center the text (for RTL text).\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n\trotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, rr, rotate, center), [0,0,1])\r\n\t{\r\n\t translate(locn_vec)\r\n\t\tif ( rounded == false ){\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=rr,\r\n\t \t\trotate=rotate,\r\n\t \t\tcenter=center,\r\n\t \t\tscale=scale,\r\n\t font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height\r\n\t\t\t);\r\n\t\t}else{\r\n\t\t \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n\t\t\tintersection()\r\n\t\t\t{\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=rr,\r\n \t\trotate=rotate,\r\n \t\tcenter=center,\r\n \t\tscale=scale,\r\n font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height*2 \/\/Make it proud to clip it off.\r\n\t\t );\r\n\r\n \/\/Shell - bounding inner and outer\r\n\t\t\tdifference()\r\n\t\t\t{ \/\/rounded outside\r\n\t\t\t\tsphere(rr+extrusion_height);\r\n\t\t\t\t\/\/ rounded inside for indented text\r\n\t\t\t sphere( rr );\r\n\t\t\t}\r\n\r\n\t\t }\r\n\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t=default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n rtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n ttb_btt_action = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0;\r\n \r\n for (l=[0:len(t)-1]){\r\n\t rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0);\r\n\t \r\n rotate( rotate_z_inner, [0,0,1] )\r\n\t\t{\r\n translate_sign = (direction==\"ttb\" || direction==\"btt\") ? ((direction==\"btt\") ? 1 : -1) : 0 ;\r\n \/\/translate_effect = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0 ;\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n\t translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n\t rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l )\/90 , [0,1,0])\r\n \/\/Flip character into position to be flush against sphere\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\t \r\n\t \/\/Modify the offset of the baselined text to center\r\n\t translate([0,(center) ? -size\/2 : 0 ,0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t scale=scale,\r\n\t font=font,\r\n\t size=size,\r\n spacing=spacing,\r\n direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language=language,script=script,\r\n halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height=extrusion_height );\r\n\t\t}\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t=default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0,0,0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n int_cube_size = (str(cube_size)[0] != \"[\") ? [cube_size,cube_size,cube_size] : cube_size;\r\n rotate_x = ( (face==\"front\") || (face==\"back\") || (face==\"left\") || (face==\"right\") ) ? 90\r\n\t\t\t\t: ((face==\"bottom\") ? 180 : 0) ; \/\/Top is zero\r\n\trotate_y = ( (face==\"back\") || (face==\"left\") || (face==\"right\") ) ? (face==\"back\") ? 180 : ((face==\"left\") ? -90 : 90) \/\/Right is 90\r\n\t\t\t\t: 0 ; \/\/Top, bottom, front are zero\r\n\tlocn_vec_offset =\r\n\t (face==\"front\") ? [+rightleft, -int_cube_size[1]\/2, +updown]\r\n\t :((face==\"back\")? [+rightleft, +int_cube_size[1]\/2, +updown]\r\n\t : ((face==\"left\")? [-int_cube_size[0]\/2, +rightleft, +updown]\r\n\t : ((face==\"right\")? [+int_cube_size[0]\/2, +rightleft, +updown]\r\n\t : ((face==\"top\")? [+rightleft, +updown, +int_cube_size[2]\/2]\r\n\t : [+rightleft, -updown, -int_cube_size[2]\/2]\r\n\t\t\t\t\t\t\t)))); \/\/bottom\r\n\t\t\t\t\t\t\t\r\n\t\ttranslate(locn_vec + locn_vec_offset)\r\n\t\trotate(rotate_x,[1,0,0])\r\n\t\trotate(rotate_y,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\ttext_extrude(t,\r\n\t\t center=center,\r\n\t\t rotate=rotate,\r\n\t\t scale=scale,\r\n\t\t font=font,\r\n\t\t size=size,\r\n\t\t spacing=spacing,\r\n\t\t direction=direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n\t\t language=language,\r\n\t\t script=script,\r\n\t\t halign=halign,\r\n\t\t valign=valign,\r\n\t\t extrusion_height=extrusion_height );\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val!=undef) ? val : default_val ;\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t=default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center==true)\r\n {\r\n if((halign!=undef) || (valign!=undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n t = default_if_undef(t,default_t);\r\n font = default_if_undef(font,default_font);\r\n extrusion_height = default_if_undef(extrusion_height,default_extrusion_height);\r\n center = default_if_undef(center,default_center);\r\n rotate = default_if_undef(rotate,default_rotate);\r\n spacing = default_if_undef(spacing,default_spacing);\r\n size = default_if_undef(size,default_size);\r\n \r\n halign = (center) ? \"center\" : halign ;\r\n valign = (center) ? \"center\" : valign ;\r\n extrusion_center = (center) ? true : false ;\r\n\t\r\n\tscale( scale )\r\n rotate(rotate,[0,0,-1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n\t{\r\n\t linear_extrude(height=extrusion_height,convexity=10,center=extrusion_center)\r\n text(text=t, size = size,\r\n $fn = 40,\r\n font = font, direction = direction, spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language=language, script=script);\r\n\t}\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4a2bf08cbfcca90c78a0c893d7562b96a6d5093f","subject":"Added chock to hold poster in 4mm polycarbonate board rail","message":"Added chock to hold poster in 4mm polycarbonate board rail\n","repos":"ksuszka\/3d-projects","old_file":"small\/poster_frame_chock.scad","new_file":"small\/poster_frame_chock.scad","new_contents":"$fa=3;\n$fs=0.2;\n\nmodule chock() {\n length = 200;\n module bulk() {\n hull() {\n cylinder(r=2.5, h=length, center=true);\n translate([0.5,7,0]) cylinder(r=2, h=length, center=true);\n }\n }\n bulk();\n translate([0,5,0]) cube([0.5,10,length],true);\n}\n\nrotate([0,0,0]) translate([0,-10,0]) chock();\nrotate([0,0,120]) translate([0,-10,0]) chock();\nrotate([0,0,240]) translate([0,-10,0]) chock();\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/poster_frame_chock.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1fce97447515afcdcfda3b65a00744b36426d3df","subject":"decreased height of the model, as there is not enough space for 30mm length - 25mm is for sure, thus sticking with 20mm, just to be on a safe side","message":"decreased height of the model, as there is not enough space for 30mm length - 25mm is for sure, thus sticking with 20mm, just to be on a safe side\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"anycubic_chiron\/cable_guide_support\/cable_guide_support.scad","new_file":"anycubic_chiron\/cable_guide_support\/cable_guide_support.scad","new_contents":"eps=0.01;\nh=20;\n\ndifference()\n{\n cube([10+47, 10+20.6+10+35, h]);\n \/\/ profile cut-in\n translate([10, 10, -eps])\n cube([47+eps, 20.6+eps, h+2*eps]);\n \/\/ top cut-in\n translate([10, 10+20.6+10, -eps])\n cube([47+eps, 35+eps, h+2*eps]);\n \/\/ cable guide screws\n for(dz=[2.5, 10.4])\n translate([-eps, 10+20.6+10+35 - 19\/2, dz+1.5])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=10+2*eps, $fn=50);\n \/\/ tightening screws\n for(dz=[10\/2, h-10\/2])\n translate([10+47 - 7\/2, -eps, dz])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, h=10+20.8+10+2*eps, $fn=50);\n}\n","old_contents":"eps=0.01;\nh=30;\n\ndifference()\n{\n cube([10+47, 10+20.6+10+35, h]);\n \/\/ profile cut-in\n translate([10, 10, -eps])\n cube([47+eps, 20.6+eps, h+2*eps]);\n \/\/ top cut-in\n translate([10, 10+20.6+10, -eps])\n cube([47+eps, 35+eps, h+2*eps]);\n \/\/ cable guide screws\n for(dz=[2.5, 10.4])\n translate([-eps, 10+20.6+10+35 - 19\/2, dz+1.5])\n rotate([0, 90, 0])\n #cylinder(r=3.5\/2, h=10+2*eps, $fn=50);\n \/\/ tightening screws\n for(dz=[10\/2, h-10\/2])\n translate([10+47 - 7\/2, -eps, dz])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, h=10+20.8+10+2*eps, $fn=50);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0971b9bb528e9c23eca6e2c05983651745cc8d9e","subject":"launcher prototype","message":"launcher prototype\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/launcher.scad","new_file":"pop_rocket\/launcher.scad","new_contents":"eps=0.01;\n\/\/wall=1;\n\/\/hose_phi=6;\n\/\/bottle_screw_phi=27.4 + 0.6;\n\/\/bottle_screw_h=9;\nside = 22;\n\nmodule screw_mount()\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s, h]);\n translate([0, 0, -eps])\n #cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = -side\/2 * sin(30);\n translate([dx, dy, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\nmodule triangle_pipe(side, height)\n{\n linear_extrude(height=height)\n difference()\n {\n triangle_2d(side);\n triangle_2d(side-6);\n }\n}\n\n\nmodule launcher_core()\n{\n dx = 40+22+6;\n module pad_core()\n {\n \/\/ pipe mount\n translate([50, 0, 11])\n cylinder(d=6, h=10, $fn=50);\n difference()\n {\n \/\/ block\n translate([-side\/2, -side\/2+0.75, 0])\n cube([dx, side, 11]);\n \/\/ triangle cut at the basecut\n translate([0, 0, 2+eps])\n rotate([0, 0, -30])\n linear_extrude(height=9)\n triangle_2d(12);\n }\n \/\/ launcher tube\n rotate([0, 0, -30])\n triangle_pipe(side, 180);\n }\n\n difference()\n {\n pad_core();\n \/\/ cut in for pressure to get in\n translate([50, 0, 10-6\/3])\n cylinder(d=6-2, h=11+6\/3+eps, $fn=50);\n \/\/ pipe hole\n translate([1-4, 0, 8\/2+1])\n rotate([0, 90, 0])\n cylinder(d=8, h=dx-side\/2, $fn=30);\n }\n}\n\n\nmodule launcher()\n{\n launcher_core();\n for(dy=[-15, 16])\n translate([20, dy, 0])\n screw_mount();\n}\n\nlauncher();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'pop_rocket\/launcher.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f6a297cbf1329f5fcbb8b9d795cfbc5c62237ff1","subject":"shapes: misc minor fixes\/tweaks","message":"shapes: misc minor fixes\/tweaks\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=undef, radius=5, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_,r2_];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r\/2, radial_width=round_r, align=[0,0,z]);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1], extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=[0,0,1], align=[0,0,0], extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n rcylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n sphere(r=round_r);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_r=2,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_,r2_];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r\/2, radial_width=round_r\/2, align=[0,0,z]);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n rcylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2e2dbc51c4d70db1644721690cac261152d9caac","subject":"shapes\/torus: add d parameter","message":"shapes\/torus: add d parameter\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_array(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_array(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"85b86ae96e6051e46cda7841a5699d437fa17abb","subject":"Update thickness based on measurement \/ cut test. Improve base.","message":"Update thickness based on measurement \/ cut test. Improve base.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*3;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*3;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"089b0c95874905b18b121b0f3a098aa8a363ed9e","subject":"Minor comment","message":"Minor comment\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"vor-3d-models\/3d-iot-case-models\/bathroom-sensor-case.scad","new_file":"vor-3d-models\/3d-iot-case-models\/bathroom-sensor-case.scad","new_contents":"\/\/ Bathroom Sensor 3D Model with methane sensor, 2 motion sensors and Arduino Yun, http:\/\/vor.space\n\/\/ \u00a9Futurice Oy, paul.houghton@futurice.com, CC-attribution-sharealike license, http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\n\/\/ Be vary patient, this model may take an hour or more to render\n\n$fn = 8;\n\ncube_side = 140;\ncube_tip_clip = 10;\nwall_width = 29; \/\/ Bathroom divider wall tunnel size\nside_clip_ratio = 2;\nleft_wing_clip_height = 35;\nright_wing_clip_height = 35;\n\nskin = 10;\ninner_skin = 8;\nthin_skin = 0.1;\nmotion_skin = 0.2;\nyun_skin = 0.4;\n\nsensor_x=94;\nsensor_y=40;\n\nyun_x = 0;\nyun_y = -22.9\/2;\nyun_z = -3;\n\nlogo_spread=67;\n\ntext_x=27;\ntext_y=12;\ntext_spread=32;\n\nspike_z1 = 23;\nspike_z2 = 51;\ndx=1;\n\n\/\/bathroom_sensor_shell();\n\/\/bathroom_sensor_shell_left();\nbathroom_sensor_shell_right();\n\/\/bathroom_sensors_shown();\n\nmodule bathroom_sensor_shell_left() {\n difference() {\n bathroom_sensor_shell();\n union() {\n translate([-50,0,-cube_side]) cube([cube_side*2, cube_side*2, cube_side*2]);\n unspike(z=spike_z1,skin=.2);\n unspike(z=spike_z2,skin=.2);\n }\n }\n spike(z=spike_z1);\n spike(z=spike_z2);\n}\n\nmodule bathroom_sensor_shell_right() {\n difference() {\n bathroom_sensor_shell();\n union() {\n translate([-50,-cube_side*2,-cube_side]) cube([cube_side*2, cube_side*2, cube_side*2]);\n spike(z=spike_z1,skin=.2);\n spike(z=spike_z2,skin=.2);\n }\n }\n unspike(z=spike_z1);\n unspike(z=spike_z2);\n}\n\nmodule spike(z=0, skin=0) {\n translate([-5+dx,-4.3,z+skin\/2]) rotate([0,0,45]) {\n minkowski() {\n cube([8,4,3]);\n sphere(r=skin);\n }\n }\n}\n\nmodule unspike(z=0, skin=0) {\n translate([1+dx,-4.3,z+skin\/2]) rotate([0,0,45]) {\n minkowski() {\n cube([8,4,3]);\n sphere(r=skin);\n }\n }\n}\n\nmodule bathroom_sensor_shell() {\n linear_extrude(height=2) {\n text_imprint(theta=0,x=-text_x,y=text_y+text_spread);\n text_imprint(theta=180,x=text_x,y=-text_y-text_spread);\n }\n translate([0,0,36]) union() {\n difference() {\n union() {\n color(\"red\") box();\n color(\"blue\") yun_holder();\n color(\"pink\") translate([123,0,0]) rotate([0,90,0]) {\n cylinder(r=14.2,h=8);\n }\n logo_moved(theta=0, y=-logo_spread);\n logo_moved(theta=180, y=logo_spread);\n }\n union() {\n methane_space_moved_skin();\n motion_moved_skin(y=-sensor_y, theta=0, rot=120);\n motion_moved_skin(y=sensor_y, theta=90, rot=120+180);\n yun_moved_skin();\n translate([129,-7,14]) rotate([90,0,0]) m3();\n translate([129,7,14]) rotate([-90,0,0]) m3();\n }\n }\n color(\"green\") yun_airgap_feet();\n }\n}\n\nmodule bathroom_sensors_shown() {\n translate([0,0,36]) union() {\n methane_moved();\n motion_moved(y=-sensor_y, theta=0, rot=120);\n motion_moved(y=sensor_y, theta=90, rot=120+180);\n }\n}\n\nmodule motion_moved(y=0, theta=0, rot=0) {\n translate([sensor_x, y, -20]) \n rotate([36, 137, theta]) {\n motion_angle(rot);\n }\n}\n\nmodule motion_moved_skin(y=0, theta=0, rot=0) {\n minkowski() {\n motion_moved(y, theta, rot);\n sphere(r=motion_skin);\n }\n}\n\nmodule motion_angle(angle = 0) {\n rotate([0, 0, angle]) {\n motion();\n }\n}\n\nmodule yun_moved_skin() {\n minkowski() {\n yun_moved();\n sphere(r=yun_skin);\n }\n}\n\nmodule yun_moved() {\n translate([yun_x, yun_y, yun_z])\n yun();\n}\n\nmodule yun_holder() {\n translate([-7.5, -wall_width\/2, -13])\n cube([81, wall_width, 5]);\n}\n\nmodule yun_airgap_feet() {\n translate([-10, -wall_width\/2, -17])\n cube([130, 6, 3]);\n translate([-10, wall_width\/2 - 6, -17])\n cube([130, 6, 3]);\n}\n\nmodule methane_moved_skin() {\n minkowski() {\n methane_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule methane_space_moved_skin() {\n minkowski() {\n methane_space_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule methane_space_moved() {\n translate([cube_side + skin - cube_tip_clip*2 - 5, 0, 0])\n rotate([0, 90, 0]) {\n methane_space();\n }\n}\n\nmodule methane_moved() {\n translate([cube_side + skin - cube_tip_clip*2 - 5, 0, 0])\n rotate([0, 90, 0]) {\n methane();\n }\n}\n\nmodule poly(clip=0, shorten=0) {\n difference() {\n polyhedron(\n points=[[shorten,cube_side,0],\n [shorten,0,-cube_side],\n [shorten,-cube_side,0],\n [shorten,0,cube_side],\n [cube_side,0,0]],\n faces=[[0,1,4],[1,2,4],[2,3,4],[3,0,4],[1,0,3],[2,1,3]]);\n union() {\n translate([-2*cube_side, -2*cube_side, clip\/.85])\n cube([cube_side*4, cube_side*4, cube_side]);\n translate([cube_side - clip\/2, 0, 0])\n cube([clip*2, clip*3, clip*3], center = true);\n side_block(wall_width*side_clip_ratio, 180);\n side_block(wall_width*side_clip_ratio, 0);\n }\n }\n}\n\nmodule wall_tunnel() {\n translate([-2*cube_side, -wall_width\/2, -2*cube_side - cube_tip_clip\/.7])\n cube([4*cube_side, wall_width, 2*cube_side]);\n left_wing_clip(); \/\/ Comment this line to make wing full size\n right_wing_clip(); \/\/ Comment this line to make wing full size\n}\n\nmodule left_wing_clip() {\n translate([-cube_side, 0, -left_wing_clip_height - cube_side])\n cube([cube_side*2, cube_side, cube_side]); \n}\n\nmodule right_wing_clip() {\n translate([-cube_side, -cube_side, -right_wing_clip_height - cube_side])\n cube([cube_side*2, cube_side, cube_side]); \n}\n\nmodule box() {\n difference() {\n minkowski() {\n difference() {\n union() {\n poly(clip=cube_tip_clip, shorten=0);\n intersection() {\n hull() {\n poly(clip=cube_tip_clip, shorten=0);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin);\n }\n }\n }\n }\n sphere(r=skin);\n }\n union() {\n methane_moved_skin();\n difference() {\n minkowski() {\n translate([-skin, 0, 0])\n poly(clip=cube_tip_clip\/2, shorten=10);\n sphere(r=inner_skin);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin-inner_skin);\n }\n }\n wall_tunnel();\n }\n }\n}\n\nmodule side_block(y=0, theta=0) {\n rotate([theta, 0, 0]) {\n translate([-2*cube_side, y, -2*cube_side])\n cube([4*cube_side, 3*wall_width, 4*cube_side]);\n }\n}\n\nmodule methane_space() {\n minkowski() {\n methane();\n sphere(r=thin_skin);\n }\n}\n\nmodule text_imprint(theta=0,x=0,y=0) {\n translate([x+40,y,0]) rotate([180,0,theta]) {\n translate([0,9,0]) scale([.6,.6,1]) text(\"http:\/\/vor.space\");\n scale(.6,.6,1) text(\"by futurice\");\n }\n}\n\nmodule logo_moved(theta=0, y=0) {\n s=.2;\n translate([41, y, -9]) rotate([90,0,theta]) {\n scale([s,s,s]) logo();\n }\n}\n\nmodule logo() {\n import(\"vor-logo-negative.stl\", convexity=10);\n}\n\nmodule yun() {\n include <..\/3d-iot-component-models\/arduino-yun-mini.scad>\n}\n\nmodule methane() {\n include <..\/3d-iot-component-models\/methane-sensor.scad>\n}\n\nmodule motion() {\n include <..\/3d-iot-component-models\/pir-motion-sensor.scad>\n}\n\nmodule m3() {\n include <..\/3d-iot-component-models\/m3.scad>\n}\n","old_contents":"\/\/ Bathroom Sensor 3D Model with methane sensor, 2 motion sensors and Arduino Yun, http:\/\/vor.space\n\/\/ \u00a9Futurice Oy, paul.houghton@futurice.com, CC-attribution-sharealike license, http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\n\n$fn = 8;\n\ncube_side = 140;\ncube_tip_clip = 10;\nwall_width = 29; \/\/ Bathroom divider wall tunnel size\nside_clip_ratio = 2;\nleft_wing_clip_height = 35;\nright_wing_clip_height = 35;\n\nskin = 10;\ninner_skin = 8;\nthin_skin = 0.1;\nmotion_skin = 0.2;\nyun_skin = 0.4;\n\nsensor_x=94;\nsensor_y=40;\n\nyun_x = 0;\nyun_y = -22.9\/2;\nyun_z = -3;\n\nlogo_spread=67;\n\ntext_x=27;\ntext_y=12;\ntext_spread=32;\n\nspike_z1 = 23;\nspike_z2 = 51;\ndx=1;\n\n\/\/bathroom_sensor_shell();\n\/\/bathroom_sensor_shell_left();\nbathroom_sensor_shell_right();\n\/\/bathroom_sensors_shown();\n\nmodule bathroom_sensor_shell_left() {\n difference() {\n bathroom_sensor_shell();\n union() {\n translate([-50,0,-cube_side]) cube([cube_side*2, cube_side*2, cube_side*2]);\n unspike(z=spike_z1,skin=.2);\n unspike(z=spike_z2,skin=.2);\n }\n }\n spike(z=spike_z1);\n spike(z=spike_z2);\n}\n\nmodule bathroom_sensor_shell_right() {\n difference() {\n bathroom_sensor_shell();\n union() {\n translate([-50,-cube_side*2,-cube_side]) cube([cube_side*2, cube_side*2, cube_side*2]);\n spike(z=spike_z1,skin=.2);\n spike(z=spike_z2,skin=.2);\n }\n }\n unspike(z=spike_z1);\n unspike(z=spike_z2);\n}\n\nmodule spike(z=0, skin=0) {\n translate([-5+dx,-4.3,z+skin\/2]) rotate([0,0,45]) {\n minkowski() {\n cube([8,4,3]);\n sphere(r=skin);\n }\n }\n}\n\nmodule unspike(z=0, skin=0) {\n translate([1+dx,-4.3,z+skin\/2]) rotate([0,0,45]) {\n minkowski() {\n cube([8,4,3]);\n sphere(r=skin);\n }\n }\n}\n\nmodule bathroom_sensor_shell() {\n linear_extrude(height=2) {\n text_imprint(theta=0,x=-text_x,y=text_y+text_spread);\n text_imprint(theta=180,x=text_x,y=-text_y-text_spread);\n }\n translate([0,0,36]) union() {\n difference() {\n union() {\n color(\"red\") box();\n color(\"blue\") yun_holder();\n color(\"pink\") translate([123,0,0]) rotate([0,90,0]) {\n cylinder(r=14.2,h=8);\n }\n logo_moved(theta=0, y=-logo_spread);\n logo_moved(theta=180, y=logo_spread);\n }\n union() {\n methane_space_moved_skin();\n motion_moved_skin(y=-sensor_y, theta=0, rot=120);\n motion_moved_skin(y=sensor_y, theta=90, rot=120+180);\n yun_moved_skin();\n translate([129,-7,14]) rotate([90,0,0]) m3();\n translate([129,7,14]) rotate([-90,0,0]) m3();\n }\n }\n color(\"green\") yun_airgap_feet();\n }\n}\n\nmodule bathroom_sensors_shown() {\n translate([0,0,36]) union() {\n methane_moved();\n motion_moved(y=-sensor_y, theta=0, rot=120);\n motion_moved(y=sensor_y, theta=90, rot=120+180);\n }\n}\n\nmodule motion_moved(y=0, theta=0, rot=0) {\n translate([sensor_x, y, -20]) \n rotate([36, 137, theta]) {\n motion_angle(rot);\n }\n}\n\nmodule motion_moved_skin(y=0, theta=0, rot=0) {\n minkowski() {\n motion_moved(y, theta, rot);\n sphere(r=motion_skin);\n }\n}\n\nmodule motion_angle(angle = 0) {\n rotate([0, 0, angle]) {\n motion();\n }\n}\n\nmodule yun_moved_skin() {\n minkowski() {\n yun_moved();\n sphere(r=yun_skin);\n }\n}\n\nmodule yun_moved() {\n translate([yun_x, yun_y, yun_z])\n yun();\n}\n\nmodule yun_holder() {\n translate([-7.5, -wall_width\/2, -13])\n cube([81, wall_width, 5]);\n}\n\nmodule yun_airgap_feet() {\n translate([-10, -wall_width\/2, -17])\n cube([130, 6, 3]);\n translate([-10, wall_width\/2 - 6, -17])\n cube([130, 6, 3]);\n}\n\nmodule methane_moved_skin() {\n minkowski() {\n methane_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule methane_space_moved_skin() {\n minkowski() {\n methane_space_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule methane_space_moved() {\n translate([cube_side + skin - cube_tip_clip*2 - 5, 0, 0])\n rotate([0, 90, 0]) {\n methane_space();\n }\n}\n\nmodule methane_moved() {\n translate([cube_side + skin - cube_tip_clip*2 - 5, 0, 0])\n rotate([0, 90, 0]) {\n methane();\n }\n}\n\nmodule poly(clip=0, shorten=0) {\n difference() {\n polyhedron(\n points=[[shorten,cube_side,0],\n [shorten,0,-cube_side],\n [shorten,-cube_side,0],\n [shorten,0,cube_side],\n [cube_side,0,0]],\n faces=[[0,1,4],[1,2,4],[2,3,4],[3,0,4],[1,0,3],[2,1,3]]);\n union() {\n translate([-2*cube_side, -2*cube_side, clip\/.85])\n cube([cube_side*4, cube_side*4, cube_side]);\n translate([cube_side - clip\/2, 0, 0])\n cube([clip*2, clip*3, clip*3], center = true);\n side_block(wall_width*side_clip_ratio, 180);\n side_block(wall_width*side_clip_ratio, 0);\n }\n }\n}\n\nmodule wall_tunnel() {\n translate([-2*cube_side, -wall_width\/2, -2*cube_side - cube_tip_clip\/.7])\n cube([4*cube_side, wall_width, 2*cube_side]);\n left_wing_clip(); \/\/ Comment this line to make wing full size\n right_wing_clip(); \/\/ Comment this line to make wing full size\n}\n\nmodule left_wing_clip() {\n translate([-cube_side, 0, -left_wing_clip_height - cube_side])\n cube([cube_side*2, cube_side, cube_side]); \n}\n\nmodule right_wing_clip() {\n translate([-cube_side, -cube_side, -right_wing_clip_height - cube_side])\n cube([cube_side*2, cube_side, cube_side]); \n}\n\nmodule box() {\n difference() {\n minkowski() {\n difference() {\n union() {\n poly(clip=cube_tip_clip, shorten=0);\n intersection() {\n hull() {\n poly(clip=cube_tip_clip, shorten=0);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin);\n }\n }\n }\n }\n sphere(r=skin);\n }\n union() {\n methane_moved_skin();\n difference() {\n minkowski() {\n translate([-skin, 0, 0])\n poly(clip=cube_tip_clip\/2, shorten=10);\n sphere(r=inner_skin);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin-inner_skin);\n }\n }\n wall_tunnel();\n }\n }\n}\n\nmodule side_block(y=0, theta=0) {\n rotate([theta, 0, 0]) {\n translate([-2*cube_side, y, -2*cube_side])\n cube([4*cube_side, 3*wall_width, 4*cube_side]);\n }\n}\n\nmodule methane_space() {\n minkowski() {\n methane();\n sphere(r=thin_skin);\n }\n}\n\nmodule text_imprint(theta=0,x=0,y=0) {\n translate([x+40,y,0]) rotate([180,0,theta]) {\n translate([0,9,0]) scale([.6,.6,1]) text(\"http:\/\/vor.space\");\n scale(.6,.6,1) text(\"by futurice\");\n }\n}\n\nmodule logo_moved(theta=0, y=0) {\n s=.2;\n translate([41, y, -9]) rotate([90,0,theta]) {\n scale([s,s,s]) logo();\n }\n}\n\nmodule logo() {\n import(\"vor-logo-negative.stl\", convexity=10);\n}\n\nmodule yun() {\n include <..\/3d-iot-component-models\/arduino-yun-mini.scad>\n}\n\nmodule methane() {\n include <..\/3d-iot-component-models\/methane-sensor.scad>\n}\n\nmodule motion() {\n include <..\/3d-iot-component-models\/pir-motion-sensor.scad>\n}\n\nmodule m3() {\n include <..\/3d-iot-component-models\/m3.scad>\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"443970eac89b1520aeebf9d377dd35c56b056ec8","subject":"One Ommatidium can be drawn.","message":"One Ommatidium can be drawn.\n\nModules on OpenSCAD are awesome!\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/OmmatiDiag.scad","new_file":"DetectorMockup\/OmmatiDiag.scad","new_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nlength = 430;\npadding = 20;\nheight = 100;\n\n\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", 0.618) {\n \/\/ box bottom\n cube([length + padding, length + padding,1]);\n \/\/ box back walls\n cube([length + padding, 1, height]);\n cube([1, length + padding, height]);\n }\n\n \/\/ box front walls, can (and should be turned off for increased visibility)\n \/*\n color (\"gray\", 0.6) {\n translate(v = [0, length + padding, 0]) {\n cube([length + padding, 1, height]);\n }\n translate(v = [length + padding, 0, 0]) {\n cube([1, length + padding, height]); \/\/\n }\n }\n *\/\n\n\/\/Housing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate(v = [padding\/2, padding\/2, 1]) {\n color (\"green\", 0.25) {\n cube([length,length,1]);\n }\n }\n\/\/~ Scintillator();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([430\/4, 430\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280,960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\", 0.618) cube([CMOSSize[0] * pixelsize ,CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ FOV CMOS\n d_cmos_lens = 5;\n d_lens_scintillator = 20;\n module CMOSCone()\n color(\"green\",0.5) cylinder(h = d_cmos_lens, r1 = CMOSSize[0] * pixelsize \/ 2 , r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2])CMOSCone();\n\n \/\/ Lens (http:\/\/is.gd\/4H9sZf)\n lensdiameter = 2;\n module Lens()\n \/\/ the lens is a squashed sphere which we translate to the middle of the CMOS\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"green\",0.5) cylinder(h = d_lens_scintillator, r1 = lensdiameter * 2 , r2 = FOVSize[1]\/2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\nOmmatidium();\n","old_contents":"\/\/ Box\ncolor (\"gray\", 0.618) {\n\tcube([450,450,1]);\n\tcube([450,1,100]);\n\tcube([1,450,100]);\n\ttranslate(v = [0, 450, 0]) { \n \t\tcube([450,1,100]);\n\t\t}\n\t}\n\n\/\/ Scintillator\ntranslate(v = [15, 15, 1]) { \n\tcolor (\"green\", 0.25) {\n\t\tcube([400,400,1]);\n\t\t}\n\t}\n\n\/\/ Optical modules\n\/\/color (\"brown\", 0.618) {\n\/\/\tcube([12.8,9.6,1]);\n\/\/\t}\n\/\/sphere(d=15);\n\n\/\/cylinder(h = 65, r1 = 430\/4, r2 = 430\/3, center = false);","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"7d7586085d743bb98e5d408e9b294a01b6176216","subject":"fixup! misc: Rename sum_vec to v_sum","message":"fixup! misc: Rename sum_vec to v_sum\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) sum_vec(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) sum_vec(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ce00855e0b8b52c7c8494b10fb98b10938c26668","subject":"x\/carriage\/extruder: more clearance for guidler mount screw","message":"x\/carriage\/extruder: more clearance for guidler mount screw\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n ty(-0.1*mm)\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n tx(-guidler_bearing[1]\/2+2*mm)\n cubea([100, bearing_cut_w, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bearing[0]*1.05,guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05], align=-X);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=Y);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=Y);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n ty(-0.1*mm)\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n tx(-guidler_bearing[1]\/2+2*mm)\n cubea([100, bearing_cut_w, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bearing[0]*1.05,guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05], align=-X);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=Y);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=Y);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a95a59d2509091cd1dd91845791a73925026c8c7","subject":"x\/carriage: add drivegear module","message":"x\/carriage: add drivegear module\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n material(Mat_Aluminium)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3c7c0caa2a9c5298001e733b0ddc82dffbf55ccc","subject":"y\/motor_mount: use button head screws","message":"y\/motor_mount: use button head screws\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-motor-mount.scad","new_file":"y-motor-mount.scad","new_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n rcubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n %yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n tz(extrusion_size\/2)\n tx(ymotor_mount_thickness)\n tx(ymotor_w\/2)\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n\n \/\/ reinforcement plate between motor and extrusion\n translate([0,0,extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extra_size=[0,0,ymotor_mount_thickness_h], extra_align=Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n tz(7*mm)\n rotate(180*X)\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","old_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n rcubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n %yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n tz(extrusion_size\/2)\n tx(ymotor_mount_thickness)\n tx(ymotor_w\/2)\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n\n \/\/ reinforcement plate between motor and extrusion\n translate([0,0,extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extra_size=[0,0,ymotor_mount_thickness_h], extra_align=Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n tz(7*mm)\n rotate(180*X)\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8d24107c13927fd3fa68e475b3b902f9e0687d2f","subject":"shapes: rename round(ing)_radius param to round_r","message":"shapes: rename round(ing)_radius param to round_r\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n sphere(r=round_r);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_r=2,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_,r2_];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r\/2, radial_width=round_r\/2, align=[0,0,z]);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n rcylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=2,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if($preview_mode || round_radius == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_,r2_];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n rcylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"784b34d2d7d36ac8c0b59c6337811d3547de466b","subject":"xaxis\/carriage: add var for beltpath fasten height","message":"xaxis\/carriage: add var for beltpath fasten height\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5d968f11280416300a02c13e6624fa7e3e2ac937","subject":"x\/carriage: fix bearing\/rod cutout","message":"x\/carriage: fix bearing\/rod cutout\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ bearing mount top\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n }\n }\n\n \/\/ bearing mount top cutout\n hull()\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n }\n\n\n \/\/ bearing mount bottom\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n }\n }\n\n \/\/ bearing mount bottom cutout\n hull()\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0]);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0]);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"47c5373c4c4147088cb16a1ca9ade98d0319007d","subject":"Add test scad file","message":"Add test scad file\n","repos":"cameronlai\/sound3d,cameronlai\/sound3d","old_file":"scad\/test.scad","new_file":"scad\/test.scad","new_contents":"surface(\"test.dat\", center = true, convexity = 5);","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/test.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"d1488d27581719e5b8097c7723d105a536997ed2","subject":"fixed lcd_mount","message":"fixed lcd_mount\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n #arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/ cage holes\n #cage(cut=true);\n\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule barbox(p1, p2, s=1, r=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n o = s\/2-r;\n s1 = s-2*r;\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l], center=true);\n cube(size=[s, s1, l], center=true);\n\n for (x=[o, -o]) \n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l, center=true);\n for (z=[l\/2, -l\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l\/2, -l\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true); \n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n \n }\n}\n\nmodule bar(p1, p2, s=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\nmodule ball8(p1, s=1, r=1) {\n\n o = s\/2-r;\n \n translate(p1) \n for (x=[o, -o]) \n for (y=[o, -o])\n for (z=[o, -o]) \n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\nmodule skew(p1, p2) { \/\/ TODO - not working\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n b = [a[0]\/a[2], a[1]\/a[2]];\n \n matrix = [\n [ 1, 0, b[1], 0 ],\n [ 0, 1, b[2], 0 ],\n [ 0, 0, 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n translate(p1) \n multmatrix(matrix) \n children();\n}\n\nmodule cage_leg(p1, p2, d, db, r)\n{\n\/\/ bar(p1, p2, d); \n \n hull() {\n ball8(p2, d, r);\n translate([0, 0, -d\/2]) translate(p1) difference() {\n sphere(d=db, center=true);\n translate([0, 0, -db\/2]) cube(size=[db, db, db], center=true);\n }\n }\n}\n\nmodule cage_pin(p1, p2, d, pd, ph, cut)\n{\n if (cut)\n {\n bar(p1, p2, d+0.5); \n }\n else\n difference() {\n bar(p1, p2, d); \n \n translate ([0,0,-ph])\n translate (p1) \n rotate([90,0,0])\n cylinder(d=pd, h=2*d, center=true);\n } \n}\n\nmodule lcd_mount(p1, x1, x2)\n{\n translate(p1) difference() {\n #translate([(x1-x2)\/2,0,-1]) cube(size=[x1+x2, 6, 2], center=true);\n #cylinder(d=2.2, h=6, center=true);\n } \n}\n\nmodule cage(cut = false)\n{\n \n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements \n top = 82;\n \n top_side = 30;\n \n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front-26\/*esc size*\/+d;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n \n bottom = 51\/*platform top*\/+d\/2;\n \n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n \/\/mid_front_left = [(top_front+bottom_front)\/2, (top_side+bottom_front_side)\/2, (top+bottom)\/2];\n \/\/mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n\n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n \n \/\/ bars\n if (!cut)\n {\n barbox(top_front_left, top_front_right, d, r1); \n barbox(top_rear_left, top_rear_right, d, r1); \n barbox(top_front_left, top_rear_left, d, r1); \n barbox(top_front_right, top_rear_right, d, r1); \n\n barbox(top_esc_left, top_esc_right, d, r1); \n barbox(top_lcd_left, top_lcd_right, d, r1);\n \n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5-0.5, 23.5\/2, top+d\/2], 2, 4);\n lcd_mount([top_rear+d\/2+2.5-0.5, -23.5\/2, top+d\/2], 2, 4);\n\n \/\/bar(mid_front_left, mid_front_right, d); \/\/ unprintable\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1);\n cage_leg(bottom_front_right, top_front_right, d, db, r1);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1);\n }\n \n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, cut); \n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, cut); \n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, cut); \n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, cut); \n}\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([9, -8, 79]) rotate([0, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd1602() {\ntranslate([-15,0,78]) difference() {\n union() {\n translate([0,0,5+8\/2]) color(\"blue\") cube(size=[27, 72, 8], center=true);\n translate([0,0,4+1\/2]) color(\"green\") cube(size=[36, 80, 1], center=true);\n }\n translate([ 31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([ 31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n}\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n cage();\n lcd();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\n\/\/fullb();\n\n\n\/\/barbox([0,0,0], [0,0,50], 10, 3);\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\ntranslate([0,0,90]) rotate([180,0,0]) cage();\n","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n #arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/ cage holes\n #cage(cut=true);\n\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule barbox(p1, p2, s=1, r=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n o = s\/2-r;\n s1 = s-2*r;\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l], center=true);\n cube(size=[s, s1, l], center=true);\n\n for (x=[o, -o]) \n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l, center=true);\n for (z=[l\/2, -l\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l\/2, -l\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true); \n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n \n }\n}\n\nmodule bar(p1, p2, s=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\nmodule ball8(p1, s=1, r=1) {\n\n o = s\/2-r;\n \n translate(p1) \n for (x=[o, -o]) \n for (y=[o, -o])\n for (z=[o, -o]) \n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\nmodule skew(p1, p2) { \/\/ TODO - not working\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n b = [a[0]\/a[2], a[1]\/a[2]];\n \n matrix = [\n [ 1, 0, b[1], 0 ],\n [ 0, 1, b[2], 0 ],\n [ 0, 0, 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n translate(p1) \n multmatrix(matrix) \n children();\n}\n\nmodule cage_leg(p1, p2, d, db, r)\n{\n\/\/ bar(p1, p2, d); \n \n hull() {\n ball8(p2, d, r);\n translate([0, 0, -d\/2]) translate(p1) difference() {\n sphere(d=db, center=true);\n translate([0, 0, -db\/2]) cube(size=[db, db, db], center=true);\n }\n }\n}\n\nmodule cage_pin(p1, p2, d, pd, ph, cut)\n{\n if (cut)\n {\n bar(p1, p2, d+0.5); \n }\n else\n difference() {\n bar(p1, p2, d); \n \n translate ([0,0,-ph])\n translate (p1) \n rotate([90,0,0])\n cylinder(d=pd, h=2*d, center=true);\n } \n}\n\nmodule lcd_mount(p1, x1, x2)\n{\n translate(p1) difference() {\n #translate([(x1-x2)\/2,0,-1]) cube(size=[x1+x2, 8, 2], center=true);\n #cylinder(d=2, h=6, center=true);\n } \n}\n\nmodule cage(cut = false)\n{\n \n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements \n top = 82;\n \n top_side = 30;\n \n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front-26\/*esc size*\/+d;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n \n bottom = 51\/*platform top*\/+d\/2;\n \n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n \/\/mid_front_left = [(top_front+bottom_front)\/2, (top_side+bottom_front_side)\/2, (top+bottom)\/2];\n \/\/mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n\n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n \n \/\/ bars\n if (!cut)\n {\n barbox(top_front_left, top_front_right, d, r1); \n barbox(top_rear_left, top_rear_right, d, r1); \n barbox(top_front_left, top_rear_left, d, r1); \n barbox(top_front_right, top_rear_right, d, r1); \n\n barbox(top_esc_left, top_esc_right, d, r1); \n barbox(top_lcd_left, top_lcd_right, d, r1);\n \n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23\/2, top+d\/2], 4, 3);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23\/2, top+d\/2], 4, 3);\n lcd_mount([top_rear+d\/2+2.5+0.5, 23\/2, top+d\/2], 3, 4);\n lcd_mount([top_rear+d\/2+2.5+0.5, -23\/2, top+d\/2], 3, 4);\n\n \/\/bar(mid_front_left, mid_front_right, d); \/\/ unprintable\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1);\n cage_leg(bottom_front_right, top_front_right, d, db, r1);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1);\n }\n \n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, cut); \n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, cut); \n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, cut); \n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, cut); \n}\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([9, -8, 79]) rotate([0, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd1602() {\ntranslate([-15,0,78]) difference() {\n union() {\n translate([0,0,5+8\/2]) color(\"blue\") cube(size=[27, 72, 8], center=true);\n translate([0,0,4+1\/2]) color(\"green\") cube(size=[36, 80, 1], center=true);\n }\n translate([ 31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([ 31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n}\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n cage();\n lcd();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\n\/\/fullb();\n\n\n\/\/barbox([0,0,0], [0,0,50], 10, 3);\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\ntranslate([0,0,90]) rotate([180,0,0]) cage();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a4e2355cda94f0cdeb1e9fc689287fad6f90c876","subject":"added 1602LCD module","message":"added 1602LCD module\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/*skew takes an array of six koef:\n *x along y\n *x along z\n *y along x\n *y along z\n *z along x\n *z along y\n *\/\n\nmodule skew(dims) {\n matrix = [\n\t [ 1, dims[0], dims[1], 0 ],\n\t [ dims[2], 1, dims[4], 0 ],\n\t [ dims[5], dims[3], 1, 0 ],\n\t [ 0, 0, 0, 1 ]\n ];\n\n multmatrix(matrix) children();\n}\n\nmodule cagetop()\n{\n for (x = [-20, 0, 20, 40]) translate([x-10, 0, 81]) cube(size=[2, 60, 2], center=true);\n for (y = [-30, 0, 30]) translate([0, y, 81]) cube(size=[60, 2, 2], center=true);\n\n translate([43, 0, 67]) skew([0, -0.9, 0, 0, 0, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ front sides\n translate([33, -33, 67]) skew([0, -0.2, 0, 0, 0.2, 0]) cube(size=[2, 2, 30], center=true);\n translate([33, 33, 67]) skew([0, -0.2, 0, 0, -0.2, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ rear\n translate([-42, -34.5, 67]) skew([0, 0.8, 0, 0, 0.3, 0]) cube(size=[2, 2, 30], center=true);\n translate([-42, 34.5, 67]) skew([0, 0.8, 0, 0, -0.3, 0]) cube(size=[2, 2, 30], center=true);\n}\n\nmodule cage(round=false)\n{\n if (round) minkowski() {\n cagetop();\n sphere(r=1);\n } else\n cagetop();\n\n #translate([ 36, 36, 45]) cylinder(d=3, h=7, center=false);\n #translate([ 36, -36, 45]) cylinder(d=3, h=7, center=false);\n\n #translate([-54, -39, 45]) cylinder(d=3, h=7, center=false);\n #translate([-54, 39, 45]) cylinder(d=3, h=7, center=false);\n}\n\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([30, -5, 60]) rotate([90, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd1602() {\ntranslate([-15,0,78]) difference() {\n union() {\n translate([0,0,5+8\/2]) color(\"blue\") cube(size=[27, 72, 8], center=true);\n #translate([0,0,4+1\/2]) color(\"green\") cube(size=[36, 80, 1], center=true);\n }\n #translate([ 31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n #translate([-31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n #translate([ 31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n #translate([-31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n}\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\nfullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\n\/\/translate([0,0,80]) rotate([180,0,0]) cage(true);\n\n","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\n\/*skew takes an array of six koef:\n *x along y\n *x along z\n *y along x\n *y along z\n *z along x\n *z along y\n *\/\n\nmodule skew(dims) {\n matrix = [\n\t [ 1, dims[0], dims[1], 0 ],\n\t [ dims[2], 1, dims[4], 0 ],\n\t [ dims[5], dims[3], 1, 0 ],\n\t [ 0, 0, 0, 1 ]\n ];\n\n multmatrix(matrix) children();\n}\n\nmodule cagetop()\n{\n for (x = [-20, 0, 20, 40]) translate([x-10, 0, 81]) cube(size=[2, 60, 2], center=true);\n for (y = [-30, 0, 30]) translate([0, y, 81]) cube(size=[60, 2, 2], center=true);\n\n translate([43, 0, 67]) skew([0, -0.9, 0, 0, 0, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ front sides\n translate([33, -33, 67]) skew([0, -0.2, 0, 0, 0.2, 0]) cube(size=[2, 2, 30], center=true);\n translate([33, 33, 67]) skew([0, -0.2, 0, 0, -0.2, 0]) cube(size=[2, 2, 30], center=true);\n\n \/\/ rear\n translate([-42, -34.5, 67]) skew([0, 0.8, 0, 0, 0.3, 0]) cube(size=[2, 2, 30], center=true);\n translate([-42, 34.5, 67]) skew([0, 0.8, 0, 0, -0.3, 0]) cube(size=[2, 2, 30], center=true);\n}\n\nmodule cage(round=false)\n{\n if (round) minkowski() {\n cagetop();\n sphere(r=1);\n } else\n cagetop();\n\n #translate([ 36, 36, 45]) cylinder(d=3, h=7, center=false);\n #translate([ 36, -36, 45]) cylinder(d=3, h=7, center=false);\n\n #translate([-54, -39, 45]) cylinder(d=3, h=7, center=false);\n #translate([-54, 39, 45]) cylinder(d=3, h=7, center=false);\n}\n\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([30, -5, 60]) rotate([90, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\nrotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\n\/\/translate([0,0,80]) rotate([180,0,0]) cage(true);\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"708fec6b143be02aad3b9c168ef00dfdd849f71f","subject":"Tweaked Typeatron for compatibility with the Stratasys uPrint","message":"Tweaked Typeatron for compatibility with the Stratasys uPrint\n","repos":"joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo","old_file":"typeatron\/mark1\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of whatever printer we have.\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.2; \/\/ max value, from the data sheet\npressureSensorThick = 0.35; \/\/ from the data sheet\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0; \/\/ this is the height of the body of the push button (without the actual button)\npushButtonBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = pushButtonPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 1.0;\nbuttonRetainerHookHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + pushButtonHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2*buttonRetainerThick\n + (pushButtonHeight-pushButtonWellDepth+foreignPartClearance)\n + pressureSensorThick + 0.15 \/\/ TODO: improve this estimate when you have the sensor in hand\n + 0.1; \/\/ \"a little extra\" which can be easily corrected with tape or paint\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n w = pushButtonWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the push button well\n fsrChannelDepth = pushButtonLegLength + pushButtonHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-pushButtonLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-pushButtonLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, pushButtonHeight - pushButtonWellDepth]);\n }\n\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]);\n\n \/\/ retainer wells\n translate([0,0,-pushButtonWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\naccuracy = 0.178;\n\nratio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of whatever printer we have.\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * ratio;\nminWallSupported = 0.7 * ratio;\nminWallFree = 0.7 * ratio;\nminWireSupported = 0.9 * ratio;\nminWireFree = 1.0 * ratio;\nminEmbossedDetail = 0.2 * ratio;\nminEmbossedText = 0.5 * ratio;\nminEngravedDetail = 0.2 * ratio;\nminEngravedText = 0.5 * ratio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.2; \/\/ max value, from the data sheet\npressureSensorThick = 0.35; \/\/ from the data sheet\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0; \/\/ this is the height of the body of the push button (without the actual button)\npushButtonBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = pushButtonPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 1.0;\nbuttonRetainerHookHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + pushButtonHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.9;\npinHoleBlockWidth = 3.0;\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2*buttonRetainerThick\n + (pushButtonHeight-pushButtonWellDepth+foreignPartClearance)\n + pressureSensorThick + 0.15 \/\/ TODO: improve this estimate when you have the sensor in hand\n + 0.1; \/\/ \"a little extra\" which can be easily corrected with tape or paint\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n w = pushButtonWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the push button well\n fsrChannelDepth = pushButtonLegLength + pushButtonHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-pushButtonLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-pushButtonLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, pushButtonHeight - pushButtonWellDepth]);\n }\n\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]);\n\n \/\/ retainer wells\n translate([0,0,-pushButtonWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n for (i = [0:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + 1.5, 0]) {\n pinHole();\n }\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-1.5, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-1.5, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=10,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n for (i = [0:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"12b9372122e3bbb703190c4ffef209395cfea6f2","subject":"Fix error introduced by rounded hanging supports.","message":"Fix error introduced by rounded hanging supports.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=inner_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=4, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9669d9ab6883cdc5a2c93d625ecb487e563ed303","subject":"x\/ends: define parts","message":"x\/ends: define parts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d10a67f9b185a0773cb799be579d2a38e2c7ec10","subject":"xaxis\/ends\/xaxis_end: rewrite to part system","message":"xaxis\/ends\/xaxis_end: rewrite to part system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n\n \/\/ cut away some of nut mount support\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n\n \/\/ cut away some of nut mount support\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1f639d8cecbf7b60dbbbf76e128c7bf8b9b55c0a","subject":"Allow to center rotated shapes","message":"Allow to center rotated shapes\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/rotate.scad","new_file":"operator\/repeat\/rotate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = [0, 0, 1],\n interval = [0, 0, 0],\n origin = [0, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : [0, 0, 0];\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n axisZ = [1, 0, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n originZ = [0, 0, 0],\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = [0, 0, 1],\n interval = [0, 0, 0],\n origin = [0, 0, 0],\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0]) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n axisZ = [1, 0, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n originZ = [0, 0, 0]) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d51fdbde75f4953d0eb91b6886099e73be795f20","subject":"added side1","message":"added side1\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/tank.scad","new_file":"resin\/tank\/tank.scad","new_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h], center=true);\n}\n\nmodule side1(side, wall_thickness, cut_depth, glass_thickness) {\n depth = 30;\n gap_width = side + 2;\n support_width = 2;\n color([1,0.1,0.0,0.75])\n difference() {\n cube([side,depth,wall_thickness], center=true);\n translate([\n -1,\n depth \/ 2 - support_width - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\ndepth = 80;\nglass_thickness = 4;\nwall_thickness = 3;\ncut_depth = 1;\n\n\/\/glass(width, depth, glass_thickness);\n\/\/rotate([90,00,0])\n side1(width, wall_thickness, cut_depth, glass_thickness);","old_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h]);\n}\n\nwidth = 120;\ndepth = 80;\nheight = 4;\n\n\nglass(width, depth, height);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1053367daa9f6e8bff05b9b4b082873b90e69300","subject":"x\/carriage: use screw_cut in guidler (for screw preview)","message":"x\/carriage: use screw_cut in guidler (for screw preview)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f069bd4cc15e844fc5094283b48c79d86c84367b","subject":"projector","message":"projector\n","repos":"fponticelli\/smallbridges","old_file":"resin\/projector.scad","new_file":"resin\/projector.scad","new_contents":"module projector(width, depth, height, feetHeight, lensDiameter, lensX, lensY) {\n color(\"White\")\n difference() {\n translate([0, 0, feetHeight])\n cube([width, depth, height]);\n rotate([90,0,90])\n translate([lensX, lensY, -2])\n cylinder(20, lensDiameter, lensDiameter \/ 3 * 2);\n }\n}\n\nmodule pyramid(w, l, h) {\n mw = w\/2;\n ml = l\/2;\n polyhedron(points = [\n [0, 0, 0],\n [w, 0, 0],\n [0, l, 0],\n [w, l, 0],\n [mw, ml, h]\n ], faces = [\n [4, 1, 0],\n [4, 3, 1],\n [4, 2, 3],\n [4, 0, 2],\n \/\/base\n [0, 1, 2],\n [2, 1, 3]\n ]);\n}\n\nmodule projection(center, distToWidth, widthToHeight, dist) {\n w = distToWidth * dist;\n h = widthToHeight * w;\n rotate([0,90,0])\n translate([-w\/2,-h\/2,-dist])\n translate(center)\n pyramid(w, h, dist);\n}\n\nmodule Acer_H6510BD(showProjection=true) {\n feetHeight = 8; \/\/ ~\n height = 78;\n lensDiameter = 30; \/\/ ~\n lensX = 55; \/\/ ~\n lensY = feetHeight + height \/ 2;\n projector(264, 220, height, feetHeight, lensDiameter, lensX, lensY);\n if(showProjection) {\n distToWidth = 192\/225;\n widthToHeight = 16\/9;\n dist = 225;\n color([0.75,1,1,0.5])\n projection([-lensY,lensX,0], distToWidth, widthToHeight, dist);\n }\n}\n\nAcer_H6510BD();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'resin\/projector.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"763de18de5ebcae58c0d3e371e6eef494df5ed2d","subject":"minor alignment updated, for visualization","message":"minor alignment updated, for visualization\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/all.scad","new_file":"tablet_toilet_mount\/all.scad","new_contents":"use \nuse \n\nmodule bothElements()\n{\n translate([0, 55, 0])\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 16])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n\/\/%openPosition();\n\nrotate([0, 0, 90])\n bothElements();\n","old_contents":"use \nuse \n\nmodule bothElements()\n{\n translate([0, 55, 0])\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n\/\/%openPosition();\n\nrotate([0, 0, 90])\n bothElements();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"867db59305dcffafd75a26bc1edadd99412cd9ad","subject":"final frame code is now ready","message":"final frame code is now ready\n","repos":"el-bart\/soft_playground,el-bart\/soft_playground","old_file":"openscad_svg_frame\/frame.scad","new_file":"openscad_svg_frame\/frame.scad","new_contents":"eps = 0.01;\nwall = 2;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children();\n }\n }\n\n cut_in_frame()\n children();\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n linear_extrude(2.7)\n model_slot_base(name)\n children();\n sphere(r=wall\/2);\n }\n \/\/ cut-off for the bottom roundings\n translate([-50, -50, 0])\n cube(300*[1,1,1]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n \/\/ some location(s) that shall be removed from the overall shape:\n \/\/ bottom\n translate([40, -10, 0])\n square([60, 20]);\n \/\/ top\n translate([60, 110, 0])\n square([50, 20]);\n}\n","old_contents":"eps = 0.01;\nwall = 2;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children(0);\n }\n }\n\n cut_in_frame()\n children(0);\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n\/\/ linear_extrude(2.7)\n model_slot_base(name)\n children(0);\n\/\/ sphere(r=wall\/2);\n }\n \/\/ cut-off for the bottom roundings\n #translate([-50, -50, 0])\n cube([200, 200, 100]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n translate([0, 40, 0])\n square([70, 20]);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"acfcb5d54acd1bfe0a3a0fec3abb615430e3aa8c","subject":"use original x,y locations","message":"use original x,y locations\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/3D_Lover\/3D_Lover-half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/3D_Lover\/3D_Lover-half-circle-phone-stand.scad","new_contents":"\n\/**\n * This version is a replica of the one from 3D_Lover found on Thingiverse.\n *\n * https:\/\/www.thingiverse.com\/thing:1746053\n *\/\n\nuse <..\/..\/half-circle-phone-stand.scad>\n\n\/\/difference()\n{\n\/\/ import(\"\/home\/roberto\/Versioning\/world\/betoland\/electronics\/phone-stand\/half-circle\/3D_Lover\/files\/Part1.STL\",\n\/\/ convexity=10);\n\n xTranslate = 7.65;\n yTranslate = 6;\n\n translate([xTranslate, yTranslate, 0])\n halfCirclePhoneStand(base_xTranslate = 0,\n base_yTranslate = 0,\n stand_top_xTranslate = 8.105,\n stand_top_yTranslate = 8.85);\n}\n","old_contents":"\n\/**\n * This version is a replica of the one from 3D_Lover found on Thingiverse.\n *\n * https:\/\/www.thingiverse.com\/thing:1746053\n *\/\n\nuse <..\/..\/half-circle-phone-stand.scad>\n\n\/\/difference()\n{\n\/\/ import(\"\/home\/roberto\/Versioning\/world\/betoland\/electronics\/phone-stand\/half-circle\/3D_Lover\/files\/Part1.STL\",\n\/\/ convexity=10);\n\n xTranslate = 7.65;\n yTranslate = 6;\n\n translate([xTranslate, yTranslate, 0])\n halfCirclePhoneStand();\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b1d8f440546710008fee6dd63dfc93458e8f0398","subject":"simple schema for printing multiple instances","message":"simple schema for printing multiple instances\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"rollup_string_fix\/print.scad","new_file":"rollup_string_fix\/print.scad","new_contents":"use \nuse \n\n\/\/ required quantities. adjust according to your needs.\n\/\/ (note: you need two identical elements per functional part)\nfixes = 2*2;\nlimiters = 3*2;\n\n\/\/ ball-size\nr=(3+2)\/2;\n\nfor(i = [0:fixes-1])\n translate([0, 10*i, 0])\n rollup_string_fix(r);\n\nfor(i = [0:limiters-1])\n translate([20, 10*i, 0])\n rollup_string_limiter(r);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rollup_string_fix\/print.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"037596c118e7248997feb3aa8c5277b690b1f466","subject":"[scad] go for a hollow support","message":"[scad] go for a hollow support\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_g = gap\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.1;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 1;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\nsupport_w = 1;\nsupport_g = 3;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\trotate(a=[0, 0, 45]) difference() {\n\t\t\tcylinder(r=support_r, h=support_h);\n\t\t\tcylinder(r=support_r - support_w, h=support_h);\n\t\t\ttranslate([-support_r, -support_g\/2, 0]) cube([support_r*2, support_g, support_h]);\n\t\t\ttranslate([-support_g\/2, -support_r, 0]) cube([support_g, support_r*2, support_h]);\n\t\t}\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","old_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 1;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b2135ed3093d2169481a7bd037d43912305d8840","subject":"customize the side tiles","message":"customize the side tiles\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/microcontrollers\/adafruit\/trellis\/face-plate-with-icons\/cusomizer\/face-plate-with-icons-customizer.scad","new_file":"openscad\/models\/src\/main\/openscad\/microcontrollers\/adafruit\/trellis\/face-plate-with-icons\/cusomizer\/face-plate-with-icons-customizer.scad","new_contents":"\nleftTileOn = \"Yes\"; \/\/ [Yes, No]\n\nleftTileIcon = \"Mario\"; \/\/ [Autobot, Decepticon, Luigi, Mario, Rebel, Trooper]\n\nrightTileOn = \"Yes\"; \/\/ [Yes, No]\n\nrightTileIcon = \"Luigi\"; \/\/ [Autobot, Decepticon, Luigi, Mario, Rebel, Trooper]\n\n\/* [Hidden] *\/\n\nuse <..\/face-plate-with-icons.scad>\n\nfacePlateWithIcons(leftTileIcon = leftTileIcon,\n leftTileOn = leftTileOn,\n rightTileIcon = rightTileIcon,\n rightTileOn = rightTileOn);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/models\/src\/main\/openscad\/microcontrollers\/adafruit\/trellis\/face-plate-with-icons\/cusomizer\/face-plate-with-icons-customizer.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"83d4db78f93bb1b139ec5190a6fda5cf8c2fb4db","subject":"Parameter cleanup to match modified module signature.","message":"Parameter cleanup to match modified module signature.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n }\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1; \/\/ 3.1mm = 0.122\" (best guess for hardboard for now)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n }\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true, rot=false);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"127f2a7ab0119859ee4c7af95485cda5d0392c93","subject":"lock cut-in now will not require support; fixing wall-support element in progress","message":"lock cut-in now will not require support; fixing wall-support element in progress\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/support.scad","new_file":"tablet_toilet_mount\/support.scad","new_contents":"use \n\nmodule _supportSurface()\n{\n difference()\n {\n union()\n {\n difference()\n {\n \/\/ root element\n cube([150, 40, 2]);\n \/\/ holes\n for(offset = [30, 90])\n translate([offset, 10, 0])\n cube([30, 20, 2]);\n }\n \/\/ lower stripe for wall-support\n off = 4;\n translate([0, -off, 0])\n cube([150, off, 3]);\n \/\/ upport tablet block-wall\n translate([0, 40-2, 0])\n cube([150, 2, 9]);\n }\n \/\/ lock cut-in\n radius = 7.5;\n translate([150\/2, 40-(10), 0])\n rotate([-90, 0, 0])\n cylinder(h=10, r=radius, $fs=0.01);\n }\n}\n\n\nmodule support()\n{\n _supportSurface();\n for(offset = [10+(3+1), 150-10-3-(3+1)])\n translate([offset, 0, 2])\n joint(2);\n}\n\n\nsupport();\n","old_contents":"use \n\nmodule _supportSurface()\n{\n difference()\n {\n union()\n {\n difference()\n {\n \/\/ root element\n cube([150, 40, 2]);\n \/\/ holes\n for(offset = [30, 90])\n translate([offset, 10, 0])\n cube([30, 20, 2]);\n }\n \/\/ lower stripe for wall-support\n off = 6.5\/2+2+2;\n translate([0, -off, 0])\n cube([150, off, 3]);\n \/\/ upport tablet block-wall\n translate([0, 40, 0])\n cube([150, 2, 9]);\n }\n \/\/ lock cut-in\n translate([(150-10)\/2, 40-(10-2), 0])\n rotate([-90, 0, 0])\n cylinder(h=10, r=7.5, $fs=0.01);\n }\n}\n\n\nmodule support()\n{\n _supportSurface();\n for(offset = [10+(3+1), 150-10-3-(3+1)])\n translate([offset, 0, 2])\n joint(2);\n}\n\n\nsupport();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"62bcb2fd7c9609151ebfc0659a3cc4e3ad286def","subject":"bearing\/data: add KH1026,KH1228","message":"bearing\/data: add KH1026,KH1228\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ SKF linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_LBBR12 = [12, 19, 28, 23, 20];\n\n\/\/ PBC linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_KHP12 = [12, 19, 28, 23, 20];\n\n\/\/ Bosch Rexroth linear ball bearing\nbearing_KBC12 = [12, 19, 28, 23, 20];\n\nbearing_KH1026 = [12, 19, 28, 23, 20];\nbearing_KH1228 = [12, 19, 28, 23, 20];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ SKF linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_LBBR12 = [12, 19, 28, 23, 20];\n\n\/\/ PBC linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_KHP12 = [12, 19, 28, 23, 20];\n\n\/\/ Bosch Rexroth linear ball bearing\nbearing_KBC12 = [12, 19, 28, 23, 20];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3ee6a383c4da84128b2d88c370f13aeb648c6212","subject":"make B node on BH a little thicker. Want to get leg assembles a little farther from main bar","message":"make B node on BH a little thicker. Want to get leg assembles\na little farther from main bar\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"HipA\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\nelse if (PART==\"BHs\" ) BHs(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight+1.5,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"HipA\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\nelse if (PART==\"BHs\" ) BHs(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e332364a11a2b1a4bf6ebaaca5fa1e3471a78d95","subject":"ajout du mod\u00e8le de pignon","message":"ajout du mod\u00e8le de pignon\n","repos":"RoseTeam\/Futurakart,RoseTeam\/Futurakart,RoseTeam\/Futurakart","old_file":"m\u00e9ca\/pignon.scad","new_file":"m\u00e9ca\/pignon.scad","new_contents":"\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule poly_path3386(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-33.987888,392.697738],[-49.999310,390.711858],[-59.408529,387.759464],[-62.169828,385.621300],[-63.919597,382.882078],[-65.236568,375.121218],[-66.075386,368.025598],[-69.612998,363.966368],[-75.641290,360.729031],[-85.746118,357.799868],[-111.487888,350.589118],[-126.487888,345.885178],[-133.362888,343.136938],[-147.737888,337.085178],[-157.863998,332.485828],[-164.846488,330.701288],[-170.294780,330.708022],[-175.074868,333.991018],[-179.072268,338.673768],[-181.414938,341.632408],[-185.685749,343.830842],[-190.868628,343.507162],[-198.252756,340.299062],[-209.127318,333.844238],[-230.448268,319.469238],[-236.816338,315.216468],[-241.605968,311.992958],[-255.237888,300.282038],[-276.197684,280.902674],[-297.748008,257.716468],[-298.530303,255.253976],[-297.985943,251.665674],[-296.274140,247.498817],[-293.554108,243.300658],[-290.862888,238.172888],[-289.612888,236.466468],[-288.346295,235.346986],[-288.737353,232.323879],[-293.874928,222.578828],[-315.508307,189.979131],[-328.660668,166.464348],[-334.679480,155.121539],[-339.878817,147.272869],[-344.441620,142.685292],[-348.550827,141.125758],[-357.238139,141.989078],[-362.568678,142.272016],[-366.253002,139.918628],[-369.103974,135.468962],[-372.568990,127.608501],[-378.458152,108.966468],[-382.039590,95.216468],[-386.570862,75.937019],[-388.362674,61.883128],[-388.726847,58.082357],[-389.602112,56.258128],[-391.015580,52.091468],[-392.189853,40.841468],[-394.100952,19.812536],[-393.980025,5.169928],[-392.459216,0.609433],[-389.174474,-2.373812],[-382.078520,-4.778852],[-377.267507,-6.033233],[-373.305582,-9.551489],[-370.455026,-14.988789],[-368.978122,-22.000302],[-367.142514,-42.283532],[-364.946418,-60.813713],[-359.644638,-86.658532],[-356.658329,-102.349650],[-356.277549,-112.058453],[-357.144447,-115.253946],[-358.758987,-117.655211],[-364.359335,-121.010192],[-367.800635,-123.147476],[-370.286114,-126.319423],[-371.661458,-130.242452],[-371.772355,-134.632982],[-369.555734,-143.205617],[-366.366540,-149.158532],[-362.128939,-159.158532],[-352.481307,-181.485303],[-338.773760,-206.321192],[-335.862888,-211.619542],[-328.362888,-222.808232],[-320.862888,-234.171412],[-318.701653,-237.972675],[-313.739350,-244.218646],[-308.258081,-250.230726],[-304.539948,-253.330322],[-300.524921,-253.523447],[-294.107398,-250.884992],[-285.055768,-247.283532],[-281.342092,-248.322538],[-276.132718,-251.803957],[-258.457168,-268.280432],[-237.668561,-287.813311],[-216.589368,-304.158532],[-206.175438,-311.969502],[-201.863048,-314.782006],[-195.613048,-318.384906],[-176.487888,-328.778513],[-157.554116,-338.984662],[-152.454413,-342.806714],[-148.903618,-346.657918],[-146.227438,-351.212924],[-147.007528,-356.174767],[-147.980833,-360.671210],[-147.839054,-364.505963],[-146.374777,-367.833411],[-143.380588,-370.807942],[-138.649072,-373.583940],[-131.972817,-376.315793],[-111.956428,-382.264607],[-96.331428,-386.989347],[-84.376198,-389.037092],[-74.764528,-389.874043],[-71.563698,-385.163620],[-68.362888,-378.328482],[-67.222176,-376.015643],[-64.479608,-373.438631],[-61.985849,-371.922180],[-59.053443,-371.206801],[-46.042108,-371.596801],[-27.112888,-373.080517],[-0.174899,-374.079236],[26.316772,-373.378646],[34.262300,-372.876069],[39.695595,-373.884667],[43.189146,-376.646225],[45.315442,-381.402528],[47.481279,-386.406379],[50.460362,-390.478716],[54.883834,-393.323097],[63.140352,-393.666307],[78.512112,-391.668918],[101.012112,-386.023358],[122.438302,-379.673143],[130.204252,-376.693748],[136.903062,-374.385826],[145.387112,-371.033532],[153.824612,-367.761976],[162.574612,-364.062149],[173.637002,-359.062149],[181.305742,-356.033532],[184.043617,-354.282157],[185.819957,-349.486589],[186.493708,-342.334663],[185.923812,-333.514213],[185.856340,-328.301367],[188.189602,-324.624654],[194.854652,-319.062196],[220.163902,-300.145732],[223.550902,-298.533532],[230.072402,-293.846032],[237.935402,-287.099502],[253.512112,-273.610492],[261.945906,-266.212899],[267.661434,-262.993267],[273.095571,-263.319133],[280.685192,-266.558032],[288.844482,-269.783532],[292.121154,-267.792961],[297.220829,-263.319239],[301.780198,-258.609354],[303.435952,-255.910292],[303.295944,-255.114517],[303.937232,-254.783532],[315.745882,-240.621644],[328.084902,-222.973622],[330.587762,-219.783532],[331.637112,-217.970642],[333.199612,-215.158142],[336.146670,-211.890367],[339.305722,-206.033532],[343.711952,-197.283532],[353.700972,-177.908532],[361.785692,-163.741872],[362.887112,-161.480592],[363.290995,-160.413157],[364.299272,-160.508762],[365.163542,-160.673747],[365.103752,-159.645032],[365.520872,-155.134892],[365.820871,-152.622646],[364.319842,-150.759892],[359.720102,-145.094432],[357.384580,-142.015011],[355.102952,-140.318342],[352.964857,-138.790648],[351.048642,-135.973866],[349.151872,-128.908112],[351.299975,-117.356137],[357.863222,-93.533532],[364.197575,-63.379653],[367.887112,-36.197342],[368.854739,-32.841599],[371.287934,-29.544194],[374.482170,-27.032411],[377.732922,-26.033532],[381.391420,-25.082045],[386.064132,-22.762623],[390.366923,-19.877823],[392.915652,-17.230202],[394.100952,-2.053212],[392.307452,33.356571],[389.362822,61.466468],[385.449962,78.341468],[378.388502,107.226396],[375.838083,114.104678],[373.343672,117.892278],[370.376340,120.591025],[367.645231,122.023864],[364.698150,122.329223],[361.082902,121.645528],[356.582250,121.076053],[352.351451,121.830888],[348.623518,123.829426],[345.631462,126.991058],[342.887112,133.032538],[341.637112,135.841468],[340.387112,138.440078],[337.262112,145.216468],[334.137112,151.744528],[328.143839,165.435862],[320.781192,178.091078],[319.137112,181.375528],[317.262112,185.216468],[315.387112,187.942818],[311.684162,193.727268],[304.789602,204.591468],[302.602607,210.094453],[301.189431,215.933839],[300.776791,220.782478],[301.591402,223.313218],[306.461342,229.524908],[309.310295,234.804256],[309.192742,239.344808],[308.145957,243.047161],[306.214850,246.708069],[295.387112,260.520288],[263.520422,292.091468],[250.458152,303.987729],[242.398202,310.091388],[240.387112,311.407318],[231.637112,317.782388],[222.887112,324.118938],[214.865227,328.168506],[204.255962,331.207718],[201.056942,331.432934],[198.779370,330.922332],[193.453362,325.984268],[188.468610,321.307977],[184.584512,320.779658],[170.650860,324.930919],[165.120474,327.416670],[162.887112,329.261348],[161.738622,330.216468],[148.926122,335.732308],[126.637112,344.774008],[115.387112,348.945668],[112.262112,349.962968],[99.385522,353.567898],[91.160241,356.705014],[86.116402,360.368411],[83.582521,365.321631],[82.887112,372.328218],[82.624029,377.293749],[81.508472,380.619268],[79.050986,383.100175],[74.762112,385.531868],[63.867735,388.561793],[47.461562,390.937928],[32.887112,392.663488],[1.199152,393.666307],[-33.987888,392.697788]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[26.252372,105.125118],[34.690422,103.966468],[39.035151,103.455062],[41.637112,102.091468],[44.882602,100.216468],[56.487952,95.216468],[67.166562,90.216468],[73.318872,84.591468],[77.739067,80.618812],[80.797832,78.966468],[82.273385,78.428606],[82.887112,77.135448],[83.571600,75.475957],[85.217272,74.057358],[93.281489,66.966307],[99.137112,60.010518],[101.620332,58.966468],[103.913926,57.923144],[105.848382,54.903968],[110.552662,47.740608],[113.199612,43.678108],[115.387112,40.216468],[117.887112,35.816628],[121.028092,26.186788],[123.590945,17.601082],[124.895312,7.152608],[126.260462,-5.185372],[127.153307,-13.654833],[125.809472,-23.373682],[124.137112,-31.860982],[121.814202,-40.770832],[117.276502,-52.569262],[115.392917,-57.429122],[113.974422,-59.057982],[113.160612,-59.155836],[112.730862,-60.334762],[110.315122,-68.138792],[108.515207,-71.113213],[106.524462,-72.675182],[104.366632,-74.489284],[102.165002,-78.069922],[95.235152,-87.908532],[84.957959,-99.184096],[81.637112,-103.757322],[75.765345,-107.349189],[64.449612,-112.390792],[61.637112,-114.826372],[61.261959,-115.551272],[60.359982,-115.391772],[57.649685,-115.947016],[52.926822,-118.390332],[43.651959,-122.414063],[31.373902,-125.422209],[17.831128,-127.099320],[4.762112,-127.129942],[-20.711670,-123.990051],[-29.596237,-121.629860],[-36.698118,-118.580862],[-44.833098,-116.033532],[-48.999588,-114.764592],[-53.955438,-111.752642],[-58.197253,-109.215908],[-62.755159,-105.336239],[-66.757669,-100.954667],[-69.333298,-96.912222],[-70.862888,-89.974722],[-72.136328,-85.260092],[-75.854488,-75.947592],[-81.456048,-58.682412],[-84.612888,-45.494912],[-86.145818,-40.000612],[-87.951618,-33.188112],[-89.106696,-24.313042],[-91.043118,-19.713512],[-92.379448,-15.651012],[-93.596288,-12.283532],[-93.797048,-10.361972],[-93.829575,-8.375973],[-94.943168,-6.299472],[-97.455118,0.216468],[-98.952438,7.716468],[-101.878959,20.100288],[-102.687098,30.113118],[-102.334379,36.258386],[-101.175388,38.654778],[-99.612888,40.751908],[-97.112888,44.591468],[-94.612888,48.535208],[-94.022825,49.722593],[-92.604148,50.216468],[-91.288903,50.726058],[-91.384288,52.272238],[-91.301995,54.309300],[-90.144711,56.507019],[-88.497601,58.078843],[-86.945828,58.238218],[-86.179178,58.429774],[-85.856678,59.830188],[-82.641258,65.841468],[-80.662133,67.941041],[-80.410348,67.722978],[-78.453734,69.050904],[-72.375758,74.867378],[-63.362888,84.872678],[-60.732088,87.508068],[-58.943494,88.406549],[-59.031078,87.646578],[-59.265019,86.685833],[-58.224388,86.720968],[-56.331638,88.758128],[-56.019138,91.558118],[-55.266183,92.370482],[-53.675388,92.439588],[-51.507370,92.807327],[-49.366728,94.337708],[-47.543320,95.802187],[-46.138038,96.011518],[-40.554598,98.368488],[-35.916154,100.702139],[-31.049478,102.041838],[-20.868158,104.735208],[-15.120311,106.168498],[-7.976978,106.130408],[2.887112,106.531908],[14.224757,106.932697],[26.252372,105.125118]]);\n }\n }\n}\n\nheight = 95;\n\nmodule pignon(h, s=.155)\n{\nscale([s,s,s])\npoly_path3386(h);\n}\next_radius = 34.6\/2;\n\nmodule dents(){\nrotate([0,0,-12])\ntranslate([0,-.2,0]){\n color(\"White\", .5)\n {\n cylindre(6,6.2);\n pignon(height);\n }\n}\n}\n\n\nmodule cylindre(r, h=1){\nlinear_extrude(height=h)\n circle(r);\n}\n\nmodule carreau(r, h=1){\nlinear_extrude(height=h)\n square(r,center=true);\n}\n\nmodule axe(sca=1.10, h=16)\n{\n scale([sca, sca, sca])\n rotate([0,0,-90])\n difference(){\n cylindre(5.6,h);\n translate([0,-9.7,0]){\n carreau(9.7,h);\n }\n \n }\n}\n\ndifference()\n{\n difference(){\n dents();\n axe();\n };\n translate([0,0,4])\n rotate([0,90,0])\n cylindre(r=2,h=35);\n}\n\/\/cercle(ext_radius);\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'm\u00e9ca\/pignon.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7985bd63e4c384e5155af5e23e3583d9a67b97a8","subject":"metric\/screw: add more asserts","message":"metric\/screw: add more asserts\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c0a9b9a963fb7e931691325aa9c31fcd70de0bcd","subject":"feat: allow to provide custom test elements by using child modules","message":"feat: allow to provide custom test elements by using child modules\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element. If no children is given, a cube is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", size=1, center=false) {\n color(c) {\n if ($children) {\n children();\n } else {\n cube(size=size, center=center);\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [size] - The size of the element.\n * @param Boolean [center] - Whether or not the element is centered.\n *\/\nmodule testElement(c=\"red\", size=1, center=false) {\n color(c) {\n cube(size=size, center=center);\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1d02dedd66913017302b8d26aba6392923d0dfb2","subject":"main\/yaxis: fix oops where y carriage clamp did not move with carriage","message":"main\/yaxis: fix oops where y carriage clamp did not move with carriage\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(ycarriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n attach(ycarriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b95fe286a8f96a9b63ed3d799422a530cde6bbc9","subject":"main: fix bug w\/y carriage plate","message":"main: fix bug w\/y carriage plate\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c4190a188cb6ee5296b2e7ff8d59f44a1e4d5317","subject":"checking in before making tabs a bit bigger","message":"checking in before making tabs a bit bigger\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n\/\/translate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n\/\/for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=3.6; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=5,r2=4.5,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.8) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.1) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) difference() {\n tab();\n %translate([0,0,2]) \/\/ pilot hole for plastic screw\n cylinder(r1=PCBhole-.5,r2=PCBhole+.2,h=5,$fn=13);\n }\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n\/\/translate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n\/\/for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=3.6; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=5,r2=4.5,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.8) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.1) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,5,2]) cube([2*axisSep,.5,4],center=true);\n cube([2*axisSep,1,1],center=true);\n }\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) difference() {\n tab();\n %translate([0,0,2]) \/\/ pilot hole for plastic screw\n cylinder(r1=PCBhole-.5,r2=PCBhole+.2,h=5,$fn=13);\n }\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"82c241f2cc3807758a12d62e7da78a68bfdbffd9","subject":"move back front support","message":"move back front support\n","repos":"depperson\/dronedroid","old_file":"hardware\/rustler-plate.scad","new_file":"hardware\/rustler-plate.scad","new_contents":"\/\/ rustler-plate.scad: an electronics tray for Traxxas Rustler\n\/\/ Daniel Epperson, 2015\n\n\/\/ main surface \nlinear_extrude(height = 3, center = true) \ndifference() {\n\n \/\/ plate\n polygon(points=[[0,5], [5,0],\n [70,0], [130,15],\n [135,35], [150,20],\n [210,35], [210,105],\n [70,140],\n [5,140], [0,135],\n [0,105], [40,105],\n [40,35], [0,35]\n ]);\n \n \/\/ ESC hole\n translate([40, 70])\n circle(12, $fn=50);\n \n \/\/ right bolt hole\n translate([15, 15])\n circle(3, $fn=50);\n \n \/\/ left bolt hole\n translate([15, 125])\n circle(3, $fn=50);\n \n \/\/ front bolt hole\n translate([177, 100])\n circle(3, $fn=50);\n}\n\n\n\/\/ rear supports\ndifference()\n{\n translate([0,0,-25])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right \n translate([15, 15])\n circle(6, $fn=50);\n\n \/\/ left \n translate([15, 125])\n circle(6, $fn=50);\n }\n translate([0,0,-22])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right tunnel\n translate([15, 15])\n circle(3, $fn=50);\n\n \/\/ left tunnel\n translate([15, 125])\n circle(3, $fn=50);\n }\n}\n\n\n\/\/ front support\ndifference()\n{\n \/\/ front\n translate([0,0,-10])\n linear_extrude(height = 20, center = true) \n translate([177, 100])\n circle(6, $fn=50);\n \n \/\/ front tunnel\n translate([0,0,-7])\n linear_extrude(height = 20, center = true) \n translate([177, 100])\n circle(3, $fn=50);\n}\n","old_contents":"\/\/ rustler-plate.scad: an electronics tray for Traxxas Rustler\n\/\/ Daniel Epperson, 2015\n\n\/\/ main surface \nlinear_extrude(height = 3, center = true) \ndifference() {\n\n \/\/ plate\n polygon(points=[[0,5], [5,0],\n [70,0], [130,15],\n [135,35], [150,20],\n [210,35], [210,105],\n [70,140],\n [5,140], [0,135],\n [0,105], [40,105],\n [40,35], [0,35]\n ]);\n \n \/\/ ESC hole\n translate([40, 70])\n circle(12, $fn=50);\n \n \/\/ right bolt hole\n translate([15, 15])\n circle(3, $fn=50);\n \n \/\/ left bolt hole\n translate([15, 125])\n circle(3, $fn=50);\n \n \/\/ front bolt hole\n translate([180, 100])\n circle(3, $fn=50);\n}\n\n\n\/\/ rear supports\ndifference()\n{\n translate([0,0,-25])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right \n translate([15, 15])\n circle(6, $fn=50);\n\n \/\/ left \n translate([15, 125])\n circle(6, $fn=50);\n }\n translate([0,0,-22])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right tunnel\n translate([15, 15])\n circle(3, $fn=50);\n\n \/\/ left tunnel\n translate([15, 125])\n circle(3, $fn=50);\n }\n}\n\n\n\/\/ front support\ndifference()\n{\n \/\/ front\n translate([0,0,-10])\n linear_extrude(height = 20, center = true) \n translate([180, 100])\n circle(6, $fn=50);\n \n \/\/ front tunnel\n translate([0,0,-7])\n linear_extrude(height = 20, center = true) \n translate([180, 100])\n circle(3, $fn=50);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c4993828d43ac9c47de30f79c033c9b2d11e3eee","subject":"added animation of full assembly","message":"added animation of full assembly\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ https:\/\/github.com\/Mr-What\/Sleipnir\/blob\/master\/Drawings\/Jansen.scad\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC\n\/\/ mainPulley, mainBar, motorPulley, braceBar\n\/\/\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ PART=\"motor\" to show motor-mount assembly\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"assembly\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude \ninclude \/\/ some generic utiltiy modules\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight-.2;\nacH1 = acH0+1.5;\nacOR = Arad+2.4;\nacIR = rad4;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nmodule linkBH(len)\n linkage1(len,2.5*NodeHeight,Brad+2.5,BradFree+.2,2.6,Hrad+1.6,rad4);\n\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nif (PART==\"HipA\" ) BED(DEleft,DE,DEperp);\nelse if (PART==\"HipB\" ) mirror([1,0,0]) BED(DEleft,DE,DEperp);\nelse if (PART==\"jHipA\" ) imBEDj(DEleft,DE,DEperp);\nelse if (PART==\"jHipB\" ) mirror([1,0,0]) imBEDj(DEleft,DE,DEperp);\nelse if (PART==\"FootA\") bracedFoot(FGleft,FG,FGperp);\nelse if (PART==\"FootB\") mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp);\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkBH(BH);\nelse if (PART==\"AC\" ) crankArmAC(); \nelse if (PART==\"mainPulley\") mainPulley();\nelse if (PART==\"motorPulley\") motorPulley();\nelse if (PART==\"mainBar\") mainBar(Bx,Ay);\nelse if (PART==\"braceBar\") brace(2*Bx,8,Brad+.1);\nelse if (PART==\"motorMount\") motorMount();\n\/\/else if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n\/\/ translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\nelse if (PART==\"motor\") motorMountDemo();\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse if (PART==\"assembly\") assembly($t*360);\nelse demo();\n\n\/\/=============================================================================\n\nuse ;\ninclude \ninclude \ninclude \ninclude \ninclude \n\n\/\/ Show whole assembly at given phase angle\nmodule assembly(phase=0) {\n translate([0,Ay,-11]) mirror([0,0,1]) motorMountDemo(phase);\n legAssembly(phase);\n mirror([1,0,0]) legAssembly(180-phase,4.4);\n %translate([0,-93,0]) cube([200,2,2],center=true);\n}\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\nmodule legAssembly(ang=0,linkOffset=0) {\necho(\"Phase\",ang);\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- \n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0])\n rotate([0,0,180+hipRot])\n translate([0,-DEperp,0]) BED(DEleft,DE,DEperp);\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\ntranslate([xC,yC,linkOffset])\n rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD,15,Drad);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+4.2])\n rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH,15,Hrad);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0])\n rotate([0,0,atan2(yE-yF,xE-xF)]) EFlinks();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n translate([FGleft,0,0]) bracedFoot(FGleft,FG,FGperp);\ncheckLink(xF,yF,xH,yH,FH);\n} \/\/ end module legAssembly()\nmodule EFlinks() {\n\/\/ translate([EF,0,5]) rotate([0,0,180])\n translate([0,0,4.5]) monoBracedLinkage(EF);\n translate([0,0,-.2]) mirror([0,0,1]) monoBracedLinkage(EF);\n}\nmodule BHlinks() {\n translate([0,0,12.5]) linkBH(BH);\n translate([0,0,-.2]) mirror([0,0,1]) linkBH(BH);\n}\n\n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + 1.5*HoleFuzz; \/\/ standoff countersink radius\n\n difference() {\n union() {\n pulley2(AC+4,ph,sr,0); \/\/ make with radius for standoff\n translate([0,0,0.17])\n cylinder(r=sr+1,h=ph-0.7,$fn=12); \/\/ fill back in for rod hole\n }\n\n cylinder(r=rad4,h=ph+4,$fn=17); \/\/ drill hole for central rod\n for (y=[-1,1]) translate([0,AC*y,-1])\n cylinder(r=2.4,h=ph,$fn=36); \/\/ screw pass-through for crank arm\n\n \/\/translate([0,0,-9]) cube([60,60,20]); \/\/ diagnostic cut-out\n }\n}\n\n\/\/module motorPulley() pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz);\n\/\/ let small pulley be polygon to give it some \"teeth\"\nmodule motorPulley() pulley2(8,4,1.5+dHoleFuzz,1+dHoleFuzz,fn=12,fni=12);\n\nuse \nmodule motorMountDemo(phase=90) {\npo=8; \/\/ main pulley offset\n\/\/difference() { union() {\n translate([0,-Ay,0]) mainBar(Bx,Ay);\n translate([0,-Ay,22.2]) rotate([0,180,0]) mainBar(Bx,Ay);\n translate([0,-Ay,3.85]) rotate([0,180,0]) motorMount();\n translate([0,0,po]) rotate([0,0,phase+90]) mainPulley();\n #translate([0,0,po-12.7 ]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n #translate([0,0,po+6.6-.6]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n translate([0,-48.5,8]) motorPulley();\n translate([0,0,26.7]) rotate([0,0,phase+180]) crankArmAC();\n translate([0,0,-4.9]) rotate([180,0,phase]) crankArmAC();\n}\n\/\/translate([-Bx,-Ay,-10]) cube([2*Bx,50,50]);}}\n\nmodule crankArmAC() {\n \/\/echo(\"AC:\",AC,acH0,acOR,acIR,acH1,acOR,acIR); \n crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}\n\n\/\/ demo display of (most of) the linkage parts\nmodule demo() {\n mainBar(Bx,Ay);\n %translate([0,Ay,20]) mainPulley();\n translate([0,-50,0]) motorPulley();\n translate([ 50, 30,0]) BED(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArmAC(); \n translate([ 25, 15,0]) linkBH(BH);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n translate([-36,-35,0]) motorMount();\n}\n\n\/\/=====================================================\n\/\/use ;\n","old_contents":"\/\/ https:\/\/github.com\/Mr-What\/Sleipnir\/blob\/master\/Drawings\/Jansen.scad\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC\n\/\/ mainPulley, mainBar, motorPulley, braceBar\n\/\/\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ PART=\"motor\" to show motor-mount assembly\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"motor\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude \ninclude \/\/ some generic utiltiy modules\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight-.2;\nacH1 = acH0+1.5;\nacOR = Arad+2.4;\nacIR = rad4;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\nmodule linkBH(len)\n linkage1(len,2.5*NodeHeight,Brad+2.5,BradFree+.2,2.6,Hrad+1.6,rad4);\n\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nif (PART==\"HipA\" ) BED(DEleft,DE,DEperp);\nelse if (PART==\"HipB\" ) mirror([1,0,0]) BED(DEleft,DE,DEperp);\nelse if (PART==\"jHipA\" ) imBEDj(DEleft,DE,DEperp);\nelse if (PART==\"jHipB\" ) mirror([1,0,0]) imBEDj(DEleft,DE,DEperp);\nelse if (PART==\"FootA\") bracedFoot(FGleft,FG,FGperp);\nelse if (PART==\"FootB\") mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp);\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkBH(BH);\nelse if (PART==\"AC\" ) crankArmAC(); \nelse if (PART==\"mainPulley\") mainPulley();\nelse if (PART==\"motorPulley\") motorPulley();\nelse if (PART==\"mainBar\") mainBar(Bx,Ay);\nelse if (PART==\"braceBar\") brace(2*Bx,8,Brad+.1);\nelse if (PART==\"motorMount\") motorMount();\n\/\/else if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n\/\/ translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\nelse if (PART==\"motor\") motorMountDemo();\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse demo();\n\n\/\/=============================================================================\n\nuse ;\ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + 1.5*HoleFuzz; \/\/ standoff countersink radius\n\n difference() {\n union() {\n pulley2(AC+4,ph,sr,0); \/\/ make with radius for standoff\n translate([0,0,0.17])\n cylinder(r=sr+1,h=ph-0.7,$fn=12); \/\/ fill back in for rod hole\n }\n\n cylinder(r=rad4,h=ph+4,$fn=17); \/\/ drill hole for central rod\n for (y=[-1,1]) translate([0,AC*y,-1])\n cylinder(r=2.4,h=ph,$fn=36); \/\/ screw pass-through for crank arm\n\n \/\/translate([0,0,-9]) cube([60,60,20]); \/\/ diagnostic cut-out\n }\n}\n\n\/\/module motorPulley() pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz);\n\/\/ let small pulley be polygon to give it some \"teeth\"\nmodule motorPulley() pulley2(8,4,1.5+dHoleFuzz,1+dHoleFuzz,fn=12,fni=12);\n\nuse \nmodule motorMountDemo() {\npo=8; \/\/ main pulley offset\n\/\/difference() { union() {\n translate([0,-Ay,0]) mainBar(Bx,Ay);\n translate([0,-Ay,22.2]) rotate([0,180,0]) mainBar(Bx,Ay);\n translate([0,-Ay,3.85]) rotate([0,180,0]) motorMount();\n %translate([0,0,po]) mainPulley();\n #translate([0,0,po-12.7 ]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n #translate([0,0,po+6.6-.6]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n translate([0,-48.5,8]) motorPulley();\n translate([0,0,26.7]) rotate([0,0,90]) crankArmAC();\n translate([0,0,-4.9]) rotate([180,0,-90]) crankArmAC();\n}\n\/\/translate([-Bx,-Ay,-10]) cube([2*Bx,50,50]);}}\n\nmodule crankArmAC() {\n \/\/echo(\"AC:\",AC,acH0,acOR,acIR,acH1,acOR,acIR); \n crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}\n\n\/\/ demo display of (most of) the linkage parts\nmodule demo() {\n mainBar(Bx,Ay);\n %translate([0,Ay,20]) mainPulley();\n translate([0,-50,0]) motorPulley();\n translate([ 50, 30,0]) BED(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArmAC(); \n translate([ 25, 15,0]) linkBH(BH);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n translate([-36,-35,0]) motorMount();\n}\n\n\/\/=====================================================\n\/\/use ;\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"becb73a459a536a2ad17f1a4c75e098f243feeaa","subject":"model for the holder","message":"model for the holder\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [3,25,18]);\nholder([-20\/2-1,-1,2], [3,25,18]);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'philips_sonicare_brush_holder\/brush_holder.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0471ac90687cc83c52d3c2b0601ab3c502461ad9","subject":"Flip thumbwheel to printing orientation.","message":"Flip thumbwheel to printing orientation.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"thumbwheel\/thumbwheel.scad","new_file":"thumbwheel\/thumbwheel.scad","new_contents":"\/\/ Tested on a 5mm shaft and it works! Fits very sungly.\n\ntrap_nut_depth = 9.1;\n\n\/\/ nut measures: 7.91 flat faces, 9.05 pointed faces, 3.8 thick\n\/\/ TODO merge this into a library module, and increase 9.05 figure slightly\n\/\/ because it's too tight (plus, probably more natural to specify the small\n\/\/ dimension and derive the large one).\n\n\/\/ screw, nut thick, wide (tips)\nM5 = [5, 3.9, 9.24];\ngCos30 = 0.866; \/\/ math.cos(pi\/6 or 30 deg)\n\n\/\/ Screw axis is at z=0, nut itself is centered on origin.\nmodule TrapNut(x, d) {\n \/\/ nut-shaped bottom\n rotate([0,90,0]) cylinder(r=x[2]\/2, h=x[1], $fn=6, center=true);\n \/\/ entrance hole (slightly larger)\n translate([0,0,-x[2]\/2])\n cube([x[1]+0.1, x[2]*gCos30, d], center=true);\n}\n\nunion() {\n translate([0,0,20])\n rotate([0,180,0])\n difference() {\n union() {\n \/\/ handle part\n translate([0,0,8\/2+12]) cylinder(r=20, h=8, center=true, $fn=20);\n \/\/ shaft part\n translate([0,0,7]) cylinder(r=10, h=14, center=true);\n }\n \/\/ trap nut hole\n translate([5, 0, trap_nut_depth\/2-0.1])\n TrapNut(M5, trap_nut_depth);\n \/\/ screw hole\n #translate([20\/2,0,trap_nut_depth\/2])\n rotate([0,90,0])\n cylinder(r=M5[0]\/2, h=20, center=true);\n \/\/ motor hole\n translate([0,0,10.5\/2-0.1])cylinder(r=5\/2,h=10.5,center=true,$fn=30);\n }\n \/\/ For checking that the part lays on z=0\n \/\/color([0.5,0.5,0.5,0.4]) translate([0,0,-1\/2]) cube([50,50,1], center=true);\n}\n","old_contents":"\/\/ Tested on a 5mm shaft and it works! Fits very sungly.\n\ntrap_nut_depth = 9.1;\n\n\/\/ nut measures: 7.91 flat faces, 9.05 pointed faces, 3.8 thick\n\/\/ TODO merge this into a library module, and increase 9.05 figure slightly\n\/\/ because it's too tight (plus, probably more natural to specify the small\n\/\/ dimension and derive the large one).\n\n\/\/ screw, nut thick, wide (tips)\nM5 = [5, 3.9, 9.05];\ngCos30 = 0.866; \/\/ math.cos(pi\/6 or 30 deg)\n\n\/\/ Screw axis is at z=0, nut itself is centered on origin.\nmodule TrapNut(x, d) {\n \/\/ nut-shaped bottom\n rotate([0,90,0]) cylinder(r=x[2]\/2, h=x[1], $fn=6, center=true);\n \/\/ entrance hole (slightly larger)\n translate([0,0,-x[2]\/2])\n cube([x[1]+0.1, x[2]*gCos30, d], center=true);\n}\n\ndifference() {\n union() {\n \/\/ handle part\n translate([0,0,8\/2+12]) cylinder(r=20, h=8, center=true, $fn=20);\n \/\/ shaft part\n translate([0,0,7]) cylinder(r=10, h=14, center=true);\n \/\/ For checking that the part lays on z=0\n \/\/ color([0.5,0.5,0.5,0.4]) translate([0,0,-1\/2]) cube([50,50,1], center=true);\n }\n \/\/ trap nut hole\n translate([5, 0, trap_nut_depth\/2-0.1])\n TrapNut(M5, trap_nut_depth);\n \/\/ screw hole\n #translate([20\/2,0,trap_nut_depth\/2])\n rotate([0,90,0])\n cylinder(r=M5[0]\/2, h=20, center=true);\n \/\/ motor hole\n translate([0,0,10.5\/2-0.1])cylinder(r=5\/2,h=10.5,center=true,$fn=30);\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"9aa7e85e787a7dee8cc7da436e0c48360c41face","subject":"xaxis\/carriage: Tweaks to geometry (sf1 bushings?)","message":"xaxis\/carriage: Tweaks to geometry (sf1 bushings?)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 20*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 13*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = 5*mm + xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = 5*mm + xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n \/*translate([0, -extruder_b_mount_thick-1*mm, 0])*\/\n rcylinder(r=5*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c07d76f5d0ddabb58e979f2d03899b3f73579b34","subject":"More tweaks","message":"More tweaks\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"extras\/iotsaCase.scad","new_file":"extras\/iotsaCase.scad","new_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\niotsaBoardXSize = 63.5; \/\/ one dimension of the unmodified board\niotsaBoardYSize = 43.5; \/\/ the other dimension of the board\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nesp12AntennaStickout = 5; \/\/ How many mm the esp12 antenna sticks out of the iotsa board\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([iotsaBoardXSize-numberOfMMRemoved,iotsaBoardYSize,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-esp12AntennaStickout, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 14; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 1.5;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually)\n\nmodule box() {\n innerXSize = (iotsaBoardXSize-numberOfMMRemoved) + esp12AntennaStickout + 2*leeWay;\n innerYSize = iotsaBoardYSize + 2*leeWay;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n retainerWidth = 3;\n retainerLength = 6;\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n module rightHoles() {\n }\n module bottomHoles() {\n \/\/ Holes in the bottom. X and Y are relative to inner box frontleft corner, Z should be 2*bottomThickness\n translate([3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize\/2, innerYSize\/2, 0]) cylinder(2*boxBottomThickness, d=6, $fn=12);\n }\n \n union() {\n difference() {\n translate([-esp12AntennaStickout-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n * translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n\n \/\/ front left retainer hole\n translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ front right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n\n \/\/ back left retainer hole\n translate([boxLeftThickness,innerYSize+boxFrontThickness-0.5*boxBackThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxBackThickness, retainerWidth]); \n \/\/ back right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, innerYSize+boxFrontThickness-0.5*boxBackThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxBackThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize+boxFrontThickness-strutThickness, 0])\n cube([outerXSize, boxBackThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n * translate() rightHoles();\n translate([-esp12AntennaStickout, -leeWay, -(boardThickness+iotsaSolderingHeight+1.5*boxBottomThickness+leeWay)]) bottomHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","old_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nesp12AntennaStickout = 5; \/\/ How many mm the esp12 antenna sticks out of the iotsa board\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-esp12AntennaStickout, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 14; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 1.5;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually)\n\nmodule box() {\n innerXSize = (63-numberOfMMRemoved) + esp12AntennaStickout + 2*leeWay;\n innerYSize = 43 + 2*leeWay;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n retainerWidth = 3;\n retainerLength = 6;\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n module rightHoles() {\n }\n module bottomHoles() {\n \/\/ Holes in the bottom. X and Y are relative to inner box frontleft corner, Z should be 2*bottomThickness\n translate([3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n }\n \n union() {\n difference() {\n translate([-esp12AntennaStickout-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n \/\/ left retainer hole\n translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize+boxFrontThickness-strutThickness, 0])\n cube([outerXSize, boxBackThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n * translate() rightHoles();\n translate([-esp12AntennaStickout, -leeWay, -(boardThickness+iotsaSolderingHeight+1.5*boxBottomThickness+leeWay)]) bottomHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f912cec269dca83cda635552972594781064acdf","subject":"hole's wall is now thicker","message":"hole's wall is now thicker\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/joint.scad","new_file":"tablet_toilet_mount\/joint.scad","new_contents":"module joint(groundSpacing)\n{\n hch = groundSpacing + 8\/2; \/\/ hole center height\n\n difference()\n {\n \/\/ main element\n union()\n {\n cube([3, 8, hch]);\n translate([0, 8\/2, hch])\n rotate([0, 90, 0])\n cylinder(r=8\/2, h=3, $fs=0.01);\n }\n \/\/ screw hole\n translate([-1, 8\/2, hch])\n rotate([0, 90, 0])\n cylinder(r=4.5\/2, h=3+2*1, $fs=0.01);\n }\n}\n\n\njoint(1);\n","old_contents":"module joint(groundSpacing)\n{\n hch = groundSpacing + 6.5\/2; \/\/ hole center height\n\n difference()\n {\n \/\/ main element\n union()\n {\n cube([3, 6.5, hch]);\n translate([0, 6.5\/2, hch])\n rotate([0, 90, 0])\n cylinder(r=6.5\/2, h=3, $fs=0.01);\n }\n \/\/ screw hole\n translate([-1, 6.5\/2, hch])\n rotate([0, 90, 0])\n cylinder(r=4.5\/2, h=3+2*1, $fs=0.01);\n }\n}\n\n\njoint(1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"16fab538f8e39004e9379b35d560a18bdfaba398","subject":"Allow to center mirrored shapes","message":"Allow to center mirrored shapes\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/mirror.scad","new_file":"operator\/repeat\/mirror.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2020 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`\n * and mirror them around the plan described by the vector `axis`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [axis] - The normal vector of the mirroring plan around which mirror the children.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X-coordinate of the normal vector of the mirroring plan around which mirror the children\n * (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y-coordinate of the normal vector of the mirroring plan around which mirror the children\n * (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z-coordinate of the normal vector of the mirroring plan around which mirror the children\n * (will overwrite the Z coordinate in the `axis` vector).\n *\/\nmodule repeatMirror(count = 2,\n interval = [0, 0, 0],\n axis = [1, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n axis = apply3D(axis, axisX, axisY, axisZ);\n offset = center ? -interval * (count - 1) \/ 2 : 0;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n if (i % 2) {\n mirror(axis) {\n children();\n }\n } else {\n children();\n }\n }\n }\n}\n\n\/**\n* Repeats the children modules `count` times in two directions with the provided `interval`\n* and mirror them around the plan described by the vector `axis`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatMirror2D(countX = 2,\n countY = 2,\n axisX = [1, 0, 0],\n axisY = [0, 1, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n center = false) {\n\n repeatMirror(count=countY, interval=vector3D(intervalY), axis=vector3D(axisY), center=center) {\n repeatMirror(count=countX, interval=vector3D(intervalX), axis=vector3D(axisX), center=center) {\n children();\n }\n }\n}\n\n\/**\n* Repeats the children modules `count` times in three directions with the provided `interval`\n* and mirror them around the plan described by the vector `axis`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatMirror3D(countX = 2,\n countY = 2,\n countZ = 2,\n axisX = [1, 0, 0],\n axisY = [0, 1, 0],\n axisZ = [0, 0, 1],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n center = false) {\n\n repeatMirror(count=countZ, interval=vector3D(intervalZ), axis=vector3D(axisZ), center=center) {\n repeatMirror(count=countY, interval=vector3D(intervalY), axis=vector3D(axisY), center=center) {\n repeatMirror(count=countX, interval=vector3D(intervalX), axis=vector3D(axisX), center=center) {\n children();\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`\n * and mirror them around the plan described by the vector `axis`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [axis] - The normal vector of the mirroring plan around which mirror the children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X-coordinate of the normal vector of the mirroring plan around which mirror the children\n * (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y-coordinate of the normal vector of the mirroring plan around which mirror the children\n * (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z-coordinate of the normal vector of the mirroring plan around which mirror the children\n * (will overwrite the Z coordinate in the `axis` vector).\n *\/\nmodule repeatMirror(count = 2,\n interval = [0, 0, 0],\n axis = [1, 0, 0],\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n axis = apply3D(axis, axisX, axisY, axisZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n if (i % 2) {\n mirror(axis) {\n children();\n }\n } else {\n children();\n }\n }\n }\n}\n\n\/**\n* Repeats the children modules `count` times in two directions with the provided `interval`\n* and mirror them around the plan described by the vector `axis`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeatMirror2D(countX = 2,\n countY = 2,\n axisX = [1, 0, 0],\n axisY = [0, 1, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeatMirror(count=countY, interval=vector3D(intervalY), axis=vector3D(axisY)) {\n repeatMirror(count=countX, interval=vector3D(intervalX), axis=vector3D(axisX)) {\n children();\n }\n }\n}\n\n\/**\n* Repeats the children modules `count` times in three directions with the provided `interval`\n* and mirror them around the plan described by the vector `axis`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeatMirror3D(countX = 2,\n countY = 2,\n countZ = 2,\n axisX = [1, 0, 0],\n axisY = [0, 1, 0],\n axisZ = [0, 0, 1],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeatMirror(count=countZ, interval=vector3D(intervalZ), axis=vector3D(axisZ)) {\n repeatMirror(count=countY, interval=vector3D(intervalY), axis=vector3D(axisY)) {\n repeatMirror(count=countX, interval=vector3D(intervalX), axis=vector3D(axisX)) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4e6d32ee530d06ff69fd7791dc7048e317780ea3","subject":"Removed commented out code in finger joins","message":"Removed commented out code in finger joins\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n\t\n\t\/*\n\t\tif(start_up == 1) \n\t\t{\n\t\t\n\t\t\ttranslate([range_min,0,0]) \n\t\t\t{\n\t\t\t\tcube([ (range_max-range_min)\/(fingers*2) + kerf\/4, thickness*2, thickness]);\n\t\t\t\tif(bumps == true)\n\t\t\t\t{\n\t\t\t\t\ttranslate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse \n\t\t{\n\t\t\ttranslate([(range_max-range_min)\/(fingers*2),0,0]) \n\t\t\t{\n\t\t\t\tcube([ (range_max-range_min)\/(fingers*2)+ kerf\/4, thickness*2, thickness]);\n\t\t\t\tif(bumps == true)\n\t\t\t\t{\n\t\t\t\t\tif (i < (range_max - (range_max-range_min)\/fingers ))\n\t\t\t\t\t{\n\t\t\t\t\t\ttranslate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t*\/\n \/\/ for ( i = [range_min + ((range_max-range_min)\/fingers) : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"79a705a1c4067a3a29cd5fe916d0d1721c701e6a","subject":"y\/rodclamps: add rod clamps part","message":"y\/rodclamps: add rod clamps part\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-rod-clamps.scad","new_file":"y-rod-clamps.scad","new_contents":"include \nuse \n\nmodule part_y_rod_clamp()\n{\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_mount_thread, align=ZAXIS);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'y-rod-clamps.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"02b8657f222373145894bbe6de3d8c267af77f41","subject":"Add a piece to support embedded sensor, battery, and RF module","message":"Add a piece to support embedded sensor, battery, and RF module\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/embedded_support.scad","new_file":"Hardware\/embedded_support.scad","new_contents":"RF_module_length = 160;\n9V_battery_length = 50;\nlength_for_arduino_nano = 30;\ntotal_length = RF_module_length +9V_battery_length+length_for_arduino_nano; \nwidth = 30; \/\/ Based on arduino nano length between \"legs\"\nthickness = 5;\n\nprojection() embedded_support();\n\nmodule embedded_support(){\n\tdifference(){\n\t\tunion(){\n\t\t\t\/\/ Main support\n\t\t\tcube(size = [total_length +20, width, thickness], center = true);\n\t\t\t\n\t\t\t\/\/ Right plate to attach strap\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,0,0]) cube(size = [30, width+20, thickness], center = true);\n\t\n\t\t\t\/\/ Left plate to attach strap\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,0,0]) cube(size = [30, width+20, thickness], center = true);\n\t\t}\n\t\t\t\t\/\/ Right holes to attach strap\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,17.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,-17.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\n\t\t\t\/\/ Left holes to attach strap\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,17.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,-17.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/embedded_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"01dacdfd1eacecdfdb59314ff08cfd9153517741","subject":"Adding lasercutoutVinylBox better approach for #22","message":"Adding lasercutoutVinylBox better approach for #22\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n cutouts_vb = cutouts_vb,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(cutouts_vb != undef) for (t = [0:1:len(cutouts_vb)-1]) \n {\n simpleCutouts(cutouts_vb[t][0], cutouts_vb[t][1], cutouts_vb[t][2], cutouts_vb[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(cutouts_vb)\n echo(str(\"[LC] , cutouts_vb = \", cutouts_vb));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n\nmodule lasercutoutVinylBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2, overlapfactor=20,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n overlap=(1+overlapfactor)*thickness;\n \n if (sides>3)\n {\n cutouts_1_2= [ \n [x*1\/5, overlap, x\/5, thickness],\n [x*1\/5, y-overlap-thickness, x\/5, thickness],\n [x*3\/5, overlap, x\/5, thickness],\n [x*3\/5, y-overlap-thickness, x\/5, thickness],\n [overlap, y\/3, thickness, y\/3],\n [x-overlap, y\/3, thickness, y\/3] \n ];\n \n \/\/ Base side 1\n translate([0,0,overlap]) lasercutoutSquare(thickness=thickness,\n x=x, y=y,\n cutouts_vb=cutouts_1_2,\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit\n ); \n \n translate([0,y,z-overlap]) rotate([180,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=y,\n cutouts_vb=cutouts_1_2,\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit\n ); \n \n cutouts_3_4= [ \n [overlap, z\/3, thickness, z\/3],\n [x-overlap, z\/3, thickness, z\/3]\n ];\n \n points = [\n [0,overlap+thickness], [x*1\/5,overlap+thickness], \n [x*1\/5,0], [x*2\/5,0], \n [x*2\/5, overlap+thickness], [x*3\/5,overlap+thickness],\n [x*3\/5,0], [x*4\/5,0],\n [x*4\/5,overlap+thickness], [x*5\/5,overlap+thickness],\n [x*5\/5,z-overlap-thickness], [x*4\/5,z-overlap-thickness],\n [x*4\/5,z], [x*3\/5,z],\n [x*3\/5,z-overlap-thickness], [x*2\/5,z-overlap-thickness],\n [x*2\/5,z], [x*1\/5,z],\n [x*1\/5,z-overlap-thickness], [0,z-overlap-thickness],\n [0,z]];\n \n translate([0,thickness+overlap,0]) rotate([90,0,0]) lasercutout(thickness=thickness,\n points=points,\n cutouts_vb=cutouts_3_4,\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit\n ); \n \n translate([0,y-overlap-thickness,z]) rotate([270,0,0]) lasercutout(thickness=thickness,\n points=points,\n cutouts_vb=cutouts_3_4,\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n ); \n }\n points_end = [\n [overlap+thickness,overlap+thickness], \n [overlap+thickness,y*1\/3], \n [0,y*1\/3], [0,y*2\/3],\n [overlap+thickness,y*2\/3], \n [overlap+thickness,y-overlap-thickness], \n [z*1\/3,y-overlap-thickness], \n [z*1\/3,y], \n [z*2\/3,y], \n [z*2\/3,y-overlap-thickness], \n [z-overlap-thickness,y-overlap-thickness], \n [z-overlap-thickness,y*2\/3], \n [z,y*2\/3], \n [z,y*1\/3], \n [z-overlap-thickness,y*1\/3], \n [z-overlap-thickness,overlap+thickness], \n [z*2\/3,overlap+thickness], \n [z*2\/3,0], \n [z*1\/3,0], \n [z*1\/3,overlap+thickness], \n ];\n\n if (sides>4)\n {\n translate([overlap,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_end,\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit\n ); \n }\n\n if (sides>5)\n { \n translate([x-overlap+thickness,0,0]) rotate([0,270,0]) lasercutout(thickness=thickness,\n points=points_end,\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit\n ); \n }\n\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"89bc8049e65c9146ac5c450a72577c54bedda57a","subject":"model with cylinders printed in printer's callibarion points","message":"model with cylinders printed in printer's callibarion points\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_leveling_pattern\/3d_leveling_pattern.scad","new_file":"3d_leveling_pattern\/3d_leveling_pattern.scad","new_contents":"N = 5;\nd = 20;\nh = 2;\nedge_dist = 20;\nlen_x = 400-2*edge_dist-2*d\/2;\nlen_y = len_x;\n\ntranslate((d\/2)*[1,1,0] + edge_dist*[1,1,0])\n for(i=[0:N-1])\n for(j=[0:N-1])\n translate([j*(len_x\/(N-1)), i*(len_y\/(N-1)), 0])\n cylinder(d=d, h=h, $fn=100);\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d_leveling_pattern\/3d_leveling_pattern.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"519a85f8e74e289c11e58b98e4052823e238114f","subject":"metric-screw\/nuttrap: fix nut rot and tweak tolerances","message":"metric-screw\/nuttrap: fix nut rot and tweak tolerances\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.1*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.1*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"42b2ff59317535e40275d48522b014956d3e2aae","subject":"screw: fix nut trap nut cut size","message":"screw: fix nut trap nut cut size\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(MHexNutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = get(MHexNutThickness,nut)*tolerance;\n d = get(MHexNutWidthMin, nut)*tolerance;\n facets = get(MHexNutFacets, nut);\n nut_hex_radius = hex_radius(get(MHexNutWidthMax, nut))+.1;\n cylindera($fn=get(MHexNutFacets, nut), r=nut_hex_radius, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = get(MHexNutThickness,nut)*tolerance;\n d = get(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(MHexNutThickness, nut) +.5*mm;\n\n \/\/ nut width is average of min\/max\n nut_width = v_avg([get(MHexNutWidthMin, nut),get(MHexNutWidthMax, nut)]);\n\n nut_hex_radius = hex_radius(nut_width)+.1*mm;\n s = nut_hex_radius;\n total_h = nut_h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=get(MHexNutFacets, nut), r=nut_hex_radius, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width,nut_width,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(MHexNutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = get(MHexNutThickness,nut)*tolerance;\n d = get(MHexNutWidthMin, nut)*tolerance;\n facets = get(MHexNutFacets, nut);\n cylindera($fn=get(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = get(MHexNutThickness,nut)*tolerance;\n d = get(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = get(MHexNutWidthMin, nut)+.1*mm;\n nut_width_max = get(MHexNutWidthMax, nut)+.1*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=get(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bb31616d303871c0ad0d42b997bfd41153854d75","subject":"The flag for the gimbal was moved to the module signature.","message":"The flag for the gimbal was moved to the module signature.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/coins\/coins-pendants-ornaments.scad","new_file":"OpenSCAD\/coins\/coins-pendants-ornaments.scad","new_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/ \n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\nuse ;\n\n$fn=100;\n\nornament();\n\nmodule ornament(height = 3,\n includeGimbal = \"yes\" \/\/ [yes, no]\n )\n{\n {\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n }\n\n difference()\n {\n color(\"blue\") \n pattern(height);\n \n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule pattern(height)\n{\n coinScale = 0.2;\/\/0.199248\n \n union()\n {\n \tscale([coinScale, -coinScale, 1]) \n \t{\n \t\tunion() \n \t\t{\n \t\t coin(height=height);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n \tcylinder(r=19.35, h=height, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=15.95, h=height, center=true);\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}","old_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/ \n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a \n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach \n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\nuse ;\n\n\/* [Dimensions] *\/\n\n\/\/ Move image left\/right\nMove_X = 0; \/\/ [-50:50]\n\n\/\/ Move image up\/down\nMove_Y = 0; \/\/ [-50:50]\n\n\/\/ Resize your image\nimage_size = 26.5; \/\/ [1:50]\n\nincludeGimbal = \"yes\"; \/\/ [yes, no]\n\n\/* [Hidden] *\/\n\nstencil_thickness = 5;\noffX = 0;\noffY = 0;\nmargin = 0;\n\ninput_width = 133;\/\/points_array[0][0];\n\ncoinScale = 0.2;\/\/0.199248;\/\/image_size\/input_width;\n\n$fn=100;\n\nornament();\n\nmodule ornament(height = 3)\n{\n {\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n }\n\n difference()\n {\n color(\"blue\") \n pattern(height);\n \n clipOversizedImages(center=true);\n }\n }\n } \n}\n\nmodule pattern(height)\n{\n union()\n {\n echo(coinScale);\n \tscale([coinScale, -coinScale, 1]) \n \t{\n \t\tunion() \n \t\t{\n \t\t coin(height=height);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule clipOversizedImages()\n{ \n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n \tcylinder(r=19.35, h=height, center=true);\n \t\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=15.95, h=height, center=true);\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6f3b27f6a92c498da2b8fc1257daeaebe1c8b9f5","subject":"[3d] Attempt at case keyholes (commented out)","message":"[3d] Attempt at case keyholes (commented out)\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+2.3, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+2.3+1.4, d=2.5, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+18]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1,1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side (not sure why the + is needed)\n translate([w+wall*0.5, wall+d_off+0.6, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,inch(0.2),3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 1.5])\n cube_fillet([pic_ex+wall, 2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0])\n cube_fillet([pic_ex+wall, 3, 20.8], bottom=[0,pic_ex,0,0], top=[0,pic_ex],\n vertical=[0,0,pic_ex]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([wall, 33.75+59.5-pic_ex, 1.5])\n cube_fillet([pic_ex, pic_ex+e, 20.8-1.5], bottom=[0,0,0,2], vertical=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(h=2.25+1.4, d=2.5, $fn=12);\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+18]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1,1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side (not sure why the + is needed)\n translate([w+wall*0.5, wall+d_off+0.6, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,inch(0.2),3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 1.5])\n cube_fillet([pic_ex+wall, 2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0])\n cube_fillet([pic_ex+wall, 3, 20.8], bottom=[0,pic_ex,0,0], top=[0,pic_ex],\n vertical=[0,0,pic_ex]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([wall, 33.75+59.5-pic_ex, 1.5])\n cube_fillet([pic_ex, pic_ex+e, 20.8-1.5], bottom=[0,0,0,2], vertical=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"24e06c171f42e1003fc7dd46ca5abc9175d05dcb","subject":"smaller hole for screw","message":"smaller hole for screw\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"chair_repairs\/side_arm_support.scad","new_file":"chair_repairs\/side_arm_support.scad","new_contents":"eps = 0.01;\n\nmodule support_core()\n{\n rc = 4; \/\/ r corrners\n re = 1; \/\/ r edges\n h = 5;\n module round_base()\n {\n $fn = 80;\n translate([0, 0, re])\n minkowski()\n {\n hull()\n {\n \/\/ main block\n for(dx=[-1, +1])\n for(dy=[0, 1])\n translate([dx*(45.4-2*(rc+re))\/2, rc+re+dy*(50.5-22.5-2*(rc+re)), 0])\n cylinder(r=rc, h=h-2*re);\n \/\/ upper part\n for(dx=[-1, +1])\n translate([dx*(21-2*(rc+re))\/2, (50.5-rc-re), 0])\n cylinder(r=rc, h=h-2*re);\n }\n sphere(r=re, $fn=40);\n }\n }\n\n module rods_center()\n {\n translate([0, 50.5-26.2, 1+re])\n translate([0, 0, 8\/2])\n rotate([-90, 0, 0])\n children();\n }\n\n difference()\n {\n \/\/ rod mount\n union()\n {\n round_base();\n rods_center()\n {\n translate([0, 0, -28+26.2])\n minkowski()\n {\n cylinder(d=8+1+5, h=28-re, $fn=80);\n sphere(r=re, $fn=40);\n }\n \/\/ rod mock\n %cylinder(d=8, h=26.2, $fn=40);\n }\n }\n \/\/ rod hole\n rods_center()\n cylinder(d=8+1, h=28+2*eps, $fn=80);\n \/\/ side screw holes\n {\n d = 7.5;\n for(dx=[-1, +1])\n translate([dx*(21.5+d)\/2, d\/2+4.4, -eps])\n cylinder(d=d, h=h+2*eps, $fn=100);\n }\n }\n}\n\nmodule support()\n{\n intersection()\n {\n support_core();\n c = 80;\n translate(-c\/2*[1, 0, 0])\n cube(c*[1,1,1]);\n }\n}\n\n\nsupport();\n","old_contents":"eps = 0.01;\n\nmodule support_core()\n{\n rc = 4; \/\/ r corrners\n re = 1; \/\/ r edges\n h = 5;\n module round_base()\n {\n $fn = 80;\n translate([0, 0, re])\n minkowski()\n {\n hull()\n {\n \/\/ main block\n for(dx=[-1, +1])\n for(dy=[0, 1])\n translate([dx*(45.4-2*(rc+re))\/2, rc+re+dy*(50.5-22.5-2*(rc+re)), 0])\n cylinder(r=rc, h=h-2*re);\n \/\/ upper part\n for(dx=[-1, +1])\n translate([dx*(21-2*(rc+re))\/2, (50.5-rc-re), 0])\n cylinder(r=rc, h=h-2*re);\n }\n sphere(r=re, $fn=40);\n }\n }\n\n module rods_center()\n {\n translate([0, 50.5-26.2, 1+re])\n translate([0, 0, 8\/2])\n rotate([-90, 0, 0])\n children();\n }\n\n difference()\n {\n \/\/ rod mount\n union()\n {\n round_base();\n rods_center()\n {\n translate([0, 0, -28+26.2])\n minkowski()\n {\n cylinder(d=8+1+5, h=28-re, $fn=80);\n sphere(r=re, $fn=40);\n }\n \/\/ rod mock\n %cylinder(d=8, h=26.2, $fn=40);\n }\n }\n \/\/ rod hole\n rods_center()\n cylinder(d=8+1, h=28+2*eps, $fn=80);\n \/\/ side screw holes\n {\n d = 7.5 + 1;\n for(dx=[-1, +1])\n translate([dx*(21.5+7.5)\/2, d\/2+4.4, -eps])\n cylinder(d=d, h=h+2*eps, $fn=100);\n }\n }\n}\n\nmodule support()\n{\n intersection()\n {\n support_core();\n c = 80;\n translate(-c\/2*[1, 0, 0])\n cube(c*[1,1,1]);\n }\n}\n\n\nsupport();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c5facf1d8a8895e2b31fe5056f5ec796455bc324","subject":"misc\/singlify: add tests","message":"misc\/singlify: add tests\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6fd09f31f4d8ff2e909ce08157eaa73b68d82125","subject":"manifold working! with cosine!","message":"manifold working! with cosine!\n","repos":"JoeSuber\/QuickerPicker","old_file":"rubber_wheels.scad","new_file":"rubber_wheels.scad","new_contents":"\n$fn=32;\nsleeve_height=35;\nsleeve_inside=30;\nsleeve_wall=5;\n\n\/\/ burrower is to be used 6 times, one on each section to make a circle-groove\nmodule burrower (degrees=360\/6, \n\t\t\t\t\tsection_num=0,\t\t\/\/ passed in for echo debug\n\t\t\t\t\tupndown=0, \t\t\t\/\/ ie -20, 0, 20 - relative rise \/ fall\n\t\t\t\t\tcurrentline=20, \t\t\/\/ starting z-level\n\t\t\t\t\tradius=30, \t\t\t\t\/\/ of can\n\t\t\t\t\tquant=40, \t\t\t\t\/\/ how many cuts\/section\n\t\t\t\t\tbulge=4,\t\t\t\t\/\/ radius of cutter-sphere\n\t\t\t\t\thuck=24,\t\t\t\t\/\/ fine-ness of cutter '$fn'\n\t\t\t\t\t){\n\t\techo(\"currentline = \", currentline, \" section = \", section_num);\n\t\tfor (i=[0:degrees\/quant:degrees- (degrees\/quant)*.5]){\n\t\t\trotate([0, 0, i])\n\t\t\ttranslate([radius, 0, currentline - upndown*cos(i\/degrees*180)*.5 + upndown\/2])\n\t\t\t\tsphere(r=bulge, center=true, $fn=huck);\n\t\t}\n}\n\ns=11;\nlvl1 = 30;\ndigmap = [[1,lvl1,0], [2, lvl1, 0], [3, lvl1, -s], [4, lvl1-s , -s], [5, lvl1-s-s ,s], [6, lvl1-s, s]];\n\ndigmap = [[1,lvl1,0], [2, lvl1, 0], [3, lvl1, -s], [4, lvl1-s , -s], [5, lvl1-s-s ,s], [6, lvl1-s, s]];\n\nmodule digdug (sections=6, instructions=digmap){\n\tfor (shovel=instructions){\n\trotate([0,0,(shovel[0]-1)*(360\/sections)]){\n\t\tif (shovel[0] < 3){\n\t\t\t#burrower(currentline=shovel[1], \n\t\t\t\t\t\tsection_num=shovel[0], upndown=shovel[2]);\n\t\t\techo(\"section \",shovel[0],\" is done\");\n\t\t}\n\t\telse {\n\t\t\t%burrower(currentline=shovel[1], \n\t\t\t\t\t\tsection_num=shovel[0], upndown=shovel[2]);\n\t\t}\n\t}\n\t}\n}\n\n\/\/difference(){\n\/\/\ttranslate([0,0,sleeve_height\/2])\n\/\/\t\tsleeve(outside_r=sleeve_inside+sleeve_wall, inside_r=sleeve_inside, ht=sleeve_height);\n\tdigdug();\n\/\/}\n\nmodule sleeve(outside_r=sleeve_inside+sleeve_wall, \n\t\t\t\tinside_r=sleeve_inside,\n\t\t\t\tht=sleeve_height){\n\techo(\"outside_r=\",outside_r, \n\t\t\t\t\"inside_r=\",inside_r,\n\t\t\t\t\"ht=\",ht);\n\tdifference(){\n\t\tcylinder(r=outside_r, h=ht, center=true, $fn=128);\n\t\tcylinder(r=inside_r, h=ht+.1, center=true, $fn=128);\n\t}\n}\n\n\/*\ntranslate([0,0,sleeve_height\/2])\n\tsleeve(outside_r=sleeve_inside, inside_r=sleeve_inside-2, ht=sleeve_height);\n*\/\nmodule strude(angle=45, xtilt=1, ytilt=1, cylinder_rad=sleeve_inside, cutter_rad=5){\n\tmultmatrix(m = [ [cos(angle), sin(angle), 0, 0],\n\t [-sin(angle), cos(angle), 0, 0],\n\t [xtilt, ytilt, 1, 0],\n\t [0, 1, 0, 1]\n\t ]) union() {\n\t \/\/cylinder(r=cylinder_rad,h=cutter_rad*2,center=false);\n\t\trotate_extrude(twist=90){\n\t\t\ttranslate([cylinder_rad, cutter_rad, cutter_rad])\n\t\t\t\tcircle(r=cutter_rad);\n\t\t}\n\t}\n}\n\n\/\/strude();\nmodule score (steptheta=25, ht=sleeve_height){\n\tfor (theta=[0:steptheta:360-(360%steptheta)]){\n\ttranslate([0,0,theta\/360*ht - ht\/2])\n\t\tstrude(angle=theta, xtilt=.61, ytilt=.61, cylinder_rad=sleeve_inside, cutter_rad=5);\n\t}\n}\n\nmodule groove(){\n\tdifference(){\n\t\tsleeve(outside_r=sleeve_inside+sleeve_wall, \n\t\t\t\tinside_r=sleeve_inside,\n\t\t\t\tht=sleeve_height);\n\t\tscore(steptheta=180);\n\t}\n}\n\n","old_contents":"\n$fn=32;\nsleeve_height=35;\nsleeve_inside=30;\nsleeve_wall=5;\n\n\/\/ burrower is to be used 6 times, one on each section to make a circle-groove\nmodule burrower (degrees=360\/6, \n\t\t\t\t\tsection_num=0,\t\t\/\/ passed in for echo debug\n\t\t\t\t\tupndown=0, \t\t\t\/\/ ie -20, 0, 20 - relative rise \/ fall\n\t\t\t\t\tcurrentline=20, \t\t\/\/ starting z-level\n\t\t\t\t\tradius=30, \t\t\t\t\/\/ of can\n\t\t\t\t\tquant=40, \t\t\t\t\/\/ how many cuts\/section\n\t\t\t\t\tbulge=4,\t\t\t\t\/\/ radius of cutter-sphere\n\t\t\t\t\thuck=24,\t\t\t\t\/\/ fine-ness of cutter '$fn'\n\t\t\t\t\t){\n\t\techo(\"currentline = \", currentline, \" section = \", section_num);\n\t\tfor (i=[0:degrees\/quant:degrees]){\n\t\t\trotate([0, 0, i])\n\t\t\ttranslate([radius, 0, currentline + upndown*sin(i\/degrees*90)])\n\t\t\t\tsphere(r=bulge, center=true, $fn=huck);\n\t\t}\n}\n\/\/currentline=50\ns=11;\nlvl = 30;\ndigmap = [[1, lvl, 0], [2, lvl, -s], [3, lvl-s , -s], [4, lvl-s-s ,s], [5, lvl-s, s], [6,lvl,0]];\nmodule digdug (sections=6, instructions=digmap){\n\tfor (shovel=instructions){\n\trotate([0,0,(shovel[0]-1)*(360\/sections)]){\n\t\tif (shovel[0] <= 3){\n\t\t\tburrower(currentline=shovel[1], \n\t\t\t\t\t\tsection_num=shovel[0], upndown=shovel[2]);\n\t\t}\n\t\tif (shovel[0] >= 4){\n\t\t\tburrower(currentline=shovel[1], \n\t\t\t\t\t\tsection_num=shovel[0], upndown=shovel[2]);\n\t\t}\n\t}\n\t}\n}\ndifference(){\n\ttranslate([0,0,sleeve_height\/2])\n\t\tsleeve(outside_r=sleeve_inside+sleeve_wall, inside_r=sleeve_inside, ht=sleeve_height);\n\tdigdug();\n}\n\/*\ntranslate([0,0,sleeve_height\/2])\n\tsleeve(outside_r=sleeve_inside, inside_r=sleeve_inside-2, ht=sleeve_height);\n*\/\nmodule strude(angle=45, xtilt=1, ytilt=1, cylinder_rad=sleeve_inside, cutter_rad=5){\n\tmultmatrix(m = [ [cos(angle), sin(angle), 0, 0],\n\t [-sin(angle), cos(angle), 0, 0],\n\t [xtilt, ytilt, 1, 0],\n\t [0, 1, 0, 1]\n\t ]) union() {\n\t \/\/cylinder(r=cylinder_rad,h=cutter_rad*2,center=false);\n\t\trotate_extrude(twist=90){\n\t\t\ttranslate([cylinder_rad, cutter_rad, cutter_rad])\n\t\t\t\tcircle(r=cutter_rad);\n\t\t}\n\t}\n}\n\n\/\/strude();\n\nmodule sleeve(outside_r=sleeve_inside+sleeve_wall, \n\t\t\t\tinside_r=sleeve_inside,\n\t\t\t\tht=sleeve_height){\n\techo(\"outside_r=\",outside_r, \n\t\t\t\t\"inside_r=\",inside_r,\n\t\t\t\t\"ht=\",ht);\n\tdifference(){\n\t\tcylinder(r=outside_r, h=ht, center=true, $fn=128);\n\t\tcylinder(r=inside_r, h=ht+.1, center=true, $fn=128);\n\t}\n}\n\nmodule score (steptheta=25, ht=sleeve_height){\n\tfor (theta=[0:steptheta:360-(360%steptheta)]){\n\ttranslate([0,0,theta\/360*ht - ht\/2])\n\t\tstrude(angle=theta, xtilt=.61, ytilt=.61, cylinder_rad=sleeve_inside, cutter_rad=5);\n\t}\n}\n\nmodule groove(){\n\tdifference(){\n\t\tsleeve(outside_r=sleeve_inside+sleeve_wall, \n\t\t\t\tinside_r=sleeve_inside,\n\t\t\t\tht=sleeve_height);\n\t\tscore(steptheta=180);\n\t}\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b2ecee6513af416e5b4f1cd1aba32e571a8ec015","subject":"Common extrusions","message":"Common extrusions\n\nO (and U) and T extrusions.\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/common\/extrusions.scad","new_file":"openscad\/common\/extrusions.scad","new_contents":"\/\/\n\/\/ Common extrusions\n\/\/ Author: Joseph M. Joy FTC 12598 mentor\n\/\/\nEPSILON = 0.001; \/\/ For moving things to properly punch out holes\n\n\/\/ Makes a flat (horizontal) \"T\":\n\/\/\n\/\/ --------------\n\/\/ |wtXht --|\n\/\/ ----\\ \/---\n\/\/ |wbX|\n\/\/ |hb |\n\/\/ -----\n\/\/\n\/\/\n\/\/ It could also be an inverted L shape\n\/\/ if the lower (vertical) bar is wide enough to extend beyond the right \n\/\/ hand side of the upper (horizontal) bar.\n\/\/\n\/\/ {xoff} is horizontal distance to the start of the bar.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule T_channel(wb, hb, wt, ht, xoff, r, t) {\n ow = 10*wb;\n oh = 10*hb;\n\n difference() {\n cube([wt, hb+ht, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n }\n}\n\n\n\/\/ Makes a flat (horizontal) \"O\":\n\/\/\n\/\/ \/-------------\\\n\/\/ | |\n\/\/ | \/--------\\ |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | \\ \/ |\n\/\/ | --------- |\n\/\/ \\------------\/\n\/\/\n\/\/\n\/\/ It could also be a U or L\n\/\/ if the oblong hole extends outside the outer\n\/\/ boundary.\n\/\/\n\/\/ ({xoff},{yoff} is origin of bounding-rectangle of the oblong hole\n\/\/ {(wo}, {ho}) is the bounding box of the outer oblong.\n\/\/ {(wi}, {hi}) is the bounding box of the inner (hole) oblong.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule O_channel(wo, ho, wi, hi, xoff, yoff, r, t) {\n difference() {\n oblong(wo, ho, r, t);\n translate([xoff, yoff, -EPSILON]) oblong(wi, hi, r, t+2*EPSILON);\n }\n}\n\n\n\/\/ A rectangular prism that fits within {w} x {h} and\n\/\/ has rounded corners with radius {r} on all 4 sides.\n\/\/ The actual radius may be reduced so keep the oblong\n\/\/ viable. {t} is the thickness (in z).\nmodule oblong(w, h, r, t) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON);\n translate([r, r, 0])\n minkowski() {\n cube([w-2*r, h-2*r, t]);\n cylinder(2*t, r, r);\n }\n}\n\n\nwb = 5;\nhb = 20;\nwt = 40;\nht = 30;\nt = 2;\nr = 5;\nri = 5;\nxoff = 10;\n\/\/T_channel(wb, hb, wt, ht, xoff, r, t);\nO_channel(wt, hb+ht, wb, hb+ht, xoff, xoff, ri, t);\n\/\/oblong(11, 40, 5, 2);\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/common\/extrusions.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"0349fe41374d2ddeee9f4e53e37709b4b45289f7","subject":"Added experimental cable gland","message":"Added experimental cable gland\n","repos":"ksuszka\/3d-projects","old_file":"small\/car_sensor_brackets.scad","new_file":"small\/car_sensor_brackets.scad","new_contents":"\n\/\/dependency:http:\/\/dkprojects.net\/openscad-threads\/threads.scad\ninclude <.dependencies\/threads.scad>\n\nFFF=[false,false,false];FFT=[false,false,true];\nFTF=[false,true,false];FTT=[false,true,true];\nTFF=[true,false,false];TFT=[true,false,true];\nTTF=[true,true,false];TTT=[true,true,true];\nmodule cube2(size, center) {\n translate([\n center[0] ? -size[0]\/2 : 0,\n center[1] ? -size[1]\/2 : 0,\n center[2] ? -size[2]\/2 : 0]) cube(size);\n}\nmodule mirror_x() {\n for(a=[0,1])mirror([a,0,0])children();\n}\nmodule mirror_y() {\n for(a=[0,1])mirror([0,a,0])children();\n}\nmodule mirror_z() {\n for(a=[0,1])mirror([0,0,a])children();\n}\n\n\nmodule switch_bracket() {\n dist_x=141\/2;\n hook_x=34;\n points1=[[dist_x,hook_x],[dist_x,hook_x+47.5],[-dist_x,hook_x],[-dist_x,hook_x+47.5]];\n holes1=[[dist_x,hook_x],[-dist_x,hook_x+36.8],[-dist_x,hook_x],[dist_x,hook_x+47.5]];\n holes2=[[50,0],[0,0],[-50,0]];\n points=concat(points1,holes2);\n module joint(array, i1, i2) {\n hull() {\n translate(array[i1]) cylinder(d=12,h=4);\n translate(array[i2]) cylinder(d=12,h=4);\n }\n }\n difference() {\n union() {\n joint(points, 0, 1);\n joint(points, 1, 3);\n joint(points, 3, 2);\n joint(points, 2, 6);\n joint(points, 6, 5);\n joint(points, 5, 4);\n joint(points, 4, 0);\n }\n \n for(xy=holes2)translate(xy)cylinder(d=3.2,h=20,center=true,$fn=24);\n for(xy=holes1)translate(xy) {\n cylinder(d=3.2,h=20,center=true,$fn=24);\n translate([0,0,-0.01])cylinder(d1=6.2,d2=3.2,h=3,$fn=24);\n }\n }\n}\n\nmodule realsense_bracket() {\n distance_x=62.25\/2;\n difference() {\n union() {\n cube2([72,6,50-6],TFF);\n mirror_x()translate([25,-12.5])cube2([12,13,25-6-2],TFF);\n \n mirror_x()translate([distance_x,0])cube2([12,35,5],TFF);\n mirror_x()translate([distance_x+6,0])hull() {\n cube2([3,35,5],TFF);\n cube2([3,6,50-6],TFF);\n }\n }\n mirror_x()translate([50\/2,0,12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n translate([0,25-12.5+6])rotate([90,0])cylinder(d=6,h=25,$fn=36);\n }\n mirror_x()translate([45\/2,0,25+12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n }\n mirror_x() for(a=[10,20,30])translate([distance_x,a])cylinder(d=3.2,h=30,$fn=24,center=true);\n }\n}\n\nmodule cable_gland_25() {\n difference() {\n union() {\n intersection() {\n cylinder(d=32,h=5,$fn=6);\n rotate([0,0,30])cylinder(d=36,h=20,center=true,$fn=6);\n }\n translate([0,0,5])metric_thread(diameter=24, pitch=1.5, length=15);\n }\n cylinder(d=20,h=50,center=true,$fn=72);\n translate([0,0,])cylinder(d1=20,d2=24,h=10,$fn=72);\n }\n}\ncable_gland_25();\n\/\/switch_bracket();\n\/\/realsense_bracket();","old_contents":"\nFFF=[false,false,false];FFT=[false,false,true];\nFTF=[false,true,false];FTT=[false,true,true];\nTFF=[true,false,false];TFT=[true,false,true];\nTTF=[true,true,false];TTT=[true,true,true];\nmodule cube2(size, center) {\n translate([\n center[0] ? -size[0]\/2 : 0,\n center[1] ? -size[1]\/2 : 0,\n center[2] ? -size[2]\/2 : 0]) cube(size);\n}\nmodule mirror_x() {\n for(a=[0,1])mirror([a,0,0])children();\n}\nmodule mirror_y() {\n for(a=[0,1])mirror([0,a,0])children();\n}\nmodule mirror_z() {\n for(a=[0,1])mirror([0,0,a])children();\n}\n\n\nmodule switch_bracket() {\n dist_x=141\/2;\n hook_x=34;\n points1=[[dist_x,hook_x],[dist_x,hook_x+47.5],[-dist_x,hook_x],[-dist_x,hook_x+47.5]];\n holes1=[[dist_x,hook_x],[-dist_x,hook_x+36.8],[-dist_x,hook_x],[dist_x,hook_x+47.5]];\n holes2=[[50,0],[0,0],[-50,0]];\n points=concat(points1,holes2);\n module joint(array, i1, i2) {\n hull() {\n translate(array[i1]) cylinder(d=12,h=4);\n translate(array[i2]) cylinder(d=12,h=4);\n }\n }\n difference() {\n union() {\n joint(points, 0, 1);\n joint(points, 1, 3);\n joint(points, 3, 2);\n joint(points, 2, 6);\n joint(points, 6, 5);\n joint(points, 5, 4);\n joint(points, 4, 0);\n }\n \n for(xy=holes2)translate(xy)cylinder(d=3.2,h=20,center=true,$fn=24);\n for(xy=holes1)translate(xy) {\n cylinder(d=3.2,h=20,center=true,$fn=24);\n translate([0,0,-0.01])cylinder(d1=6.2,d2=3.2,h=3,$fn=24);\n }\n }\n}\n\nmodule realsense_bracket() {\n distance_x=62.25\/2;\n difference() {\n union() {\n cube2([72,6,50-6],TFF);\n mirror_x()translate([25,-12.5])cube2([12,13,25-6-2],TFF);\n \n mirror_x()translate([distance_x,0])cube2([12,35,5],TFF);\n mirror_x()translate([distance_x+6,0])hull() {\n cube2([3,35,5],TFF);\n cube2([3,6,50-6],TFF);\n }\n }\n mirror_x()translate([50\/2,0,12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n translate([0,25-12.5+6])rotate([90,0])cylinder(d=6,h=25,$fn=36);\n }\n mirror_x()translate([45\/2,0,25+12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n }\n mirror_x() for(a=[10,20,30])translate([distance_x,a])cylinder(d=3.2,h=30,$fn=24,center=true);\n }\n}\n\nswitch_bracket();\n\/\/realsense_bracket();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"03651d18e167fcda99e942d84d9b542a2545f1a9","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"713684855b84d030a54b89fb587047d6c4569649","subject":"update scad model","message":"update scad model\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/pantilt.scad","new_file":"hardware\/pantilt.scad","new_contents":"$fn = 250;\n\nR = 50;\nballShell = 3;\nsupportX = 35;\nsupportY = 8;\nsupportZ = 60;\nmik = 2;\nsThickness = 5;\nsupportBaseHeight = 5;\nbaseHeight = 31;\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif(application == \"servo\")\n\t{\n\t\ttranslate([-Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\t\n\t\ttranslate([+Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\n\t\ttranslate([+Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\n\t\ttranslate([-Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\t\t\n\t}\n\t}\n}\n\nmodule support() {\n\tdifference() {\n\t\tunion() {\n\t\t\tintersection() {\n\t\t\t\tsphere(R);\n\t\t\t\ttranslate([-R, -R+(supportY+sThickness)\/2, 0]) cube([500, 25, 200], center = true);\n\t\t\t}\n\n\t\t}\n\t}\n\n\ttranslate([0, -R+(supportY+sThickness\/2), -supportZ\/2]) {\n\t\tminkowski() {\n\t\t\tbox(supportX, supportY, supportZ, sThickness , \"none\");\n\t\t\tcylinder(r = mik, h = 1);\n\t\t\t\/\/rotate([90,0,0])cylinder(r = mik, h = 1);\n\t\t}\n\t}\n}\n\nmodule base() {\ntranslate([0, 0, -supportZ])\n\t\tminkowski() {\n\t\t\tcylinder(r= R+mik, h= supportBaseHeight);\n\t\trotate([90,0,0])cylinder(r = mik, h = 1);\n}\n}\n\n\n\nsphere(R);\nsupport();\nmirror([0, 10, 0]) support();\n\/\/need to understnad -2 in 2*R-5-mik-2\nbase();\n\ntranslate([0, 0, -supportZ-supportBaseHeight-baseHeight])\ndifference(){\n{difference(){\n\tminkowski() {\ncylinder(r= R+6, h = baseHeight);\t\t\nrotate([90,0,0])cylinder(r = mik, h = 1);\n}\n\ntranslate([0, 0, 5])cylinder(r= (R+mik)\/2, h = 10*baseHeight);\t\t\n}\ntranslate([0, 0, 5])cylinder(r= R+mik+2, h = 10*baseHeight);\t\t\n\n\n}\n\ntranslate([0, 0, 17-3])\tbox(24.5, 13, 17, 3,\"servo\");}\n","old_contents":"$fn = 250;\n\nR = 50;\nballShell = 3;\nsupportX = 35;\nsupportY = 8;\nsupportZ = 60;\nmik = 2;\nsThickness = 5;\nsupportBaseHeight = 5;\nbaseHeight = 31;\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif(application == \"servo\")\n\t{\n\t\ttranslate([-Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\t\n\t\ttranslate([+Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\n\t\ttranslate([+Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\n\t\ttranslate([-Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\t\t\n\t}\n\t}\n}\n\nmodule support() {\n\tdifference() {\n\t\tunion() {\n\t\t\tintersection() {\n\t\t\t\tsphere(R);\n\t\t\t\ttranslate([-R, -R+(supportY+sThickness)\/2, 0]) cube([500, 25, 200], center = true);\n\t\t\t}\n\n\t\t}\n\t}\n\n\ttranslate([0, -R+(supportY+sThickness\/2), -supportZ\/2]) {\n\t\tminkowski() {\n\t\t\tbox(supportX, supportY, supportZ, sThickness , \"none\");\n\t\t\tcylinder(r = mik, h = 1);\n\t\t\t\/\/rotate([90,0,0])cylinder(r = mik, h = 1);\n\t\t}\n\t}\n}\n\nmodule base() {\ntranslate([0, 0, -supportZ])\n\t\tminkowski() {\n\t\t\tcylinder(r= R+mik, h= supportBaseHeight);\n\t\trotate([90,0,0])cylinder(r = mik, h = 1);\n}\n}\n\n\n\nsphere(R);\nsupport();\nmirror([0, 10, 0]) support();\n\/\/need to understnad -2 in 2*R-5-mik-2\nbase();\n\ntranslate([0, 0, -supportZ-supportBaseHeight-baseHeight])\n{difference(){\n\tminkowski() {\ncylinder(r= R+mik, h = baseHeight);\t\t\nrotate([90,0,0])cylinder(r = mik, h = 1);\n}\n\ntranslate([0, 0, 5])cylinder(r= (R+mik)\/2, h = 10*baseHeight);\t\t\n}\ntranslate([0, 0, 17-3])\tbox(24.5, 13, 17, 3,\"servo\");}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"db2a5a92a96a47e28a45099e36c78aaac2987ebc","subject":"print-ready version","message":"print-ready version\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/all.scad","new_file":"tablet_toilet_mount\/all.scad","new_contents":"use \nuse \n\nmodule bothElements()\n{\n translate([0, 55, 0])\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n\/\/%openPosition();\n\nbothElements();\n","old_contents":"use \nuse \n\nmodule bothElements()\n{\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n%openPosition();\n\n\/\/bothElements();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0cf565b9a190d2a55d9c36cd903b69be1caad60a","subject":"x\/carriage\/extruder\/b: fix ugly guidler nut screw cut showing","message":"x\/carriage\/extruder\/b: fix ugly guidler nut screw cut showing\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=-Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"19ebce9e83ad36b4411f2a92dc3a6b07eb39136d","subject":"x\/carrige: fix extruder_b guidler cutout","message":"x\/carrige: fix extruder_b guidler cutout\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-8*mm)\n ty(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=20*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm-5*mm)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=20*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,Z], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-8*mm)\n ty(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=20*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm-5*mm)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=20*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"bef3d2669a484c89b1d13dea79289bb56d7cd2eb","subject":"config: x-axis rod distance to 70mm","message":"config: x-axis rod distance to 70mm\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 70*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3293dd6ff95e625934ef3b73b3defafb96922a2c","subject":"config\/ziptie: increase zip distance (wall thick)","message":"config\/ziptie: increase zip distance (wall thick)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 0*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.1*mm, 2.4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=2*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2 + zaxis_rod_screw_distance_x + zmotor_mount_motor_offset;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\nxaxis_zaxis_distance_y = 0*mm + xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fbdf2a21a5e78b193110596254ec2f3d6c0b14a4","subject":"screws\/nut_trap: fix trap_axis","message":"screws\/nut_trap: fix trap_axis\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1fe0baec86f31a544490a40dd7d58ea3a6e0ef0f","subject":"shapes: cubea,rcubea: rename extrasize param to extra_size","message":"shapes: cubea,rcubea: rename extrasize param to extra_size\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extra_size, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extra_size, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n \/*cube(size=size, center=true);*\/\n sphere(d=d_+extra_d_, center=true);\n }\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n \/*cube(size=size, center=true);*\/\n sphere(d=d_+extra_d_, center=true);\n }\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2719bacf74666030f6de11a386b8495b84061ccd","subject":"Wheel: thinner spokes and slightly larger centre hole for motor","message":"Wheel: thinner spokes and slightly larger centre hole for motor\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Wheel.scad","new_file":"hardware\/printedparts\/Wheel.scad","new_contents":"module Wheel_STL() {\n\n\tprintedPart(\"printedparts\/Wheel.scad\", \"Wheel\", \"Wheel_STL()\") {\n\t\n\t view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Wheel.stl\"));\n } else {\n\t\t\t\tWheelModel();\n }\n }\n\t}\n}\n\n\nmodule WheelModel()\n{\n\trimThickness = 4;\n\tspokeThickness = 5;\n\thubDiameter = 10;\n\n \/\/ Outer Rim\n rotate_extrude($fn=100)\n translate ([(WheelDiameter \/ 2) - rimThickness, 0, 0])\n difference()\n {\n square([rimThickness, WheelThickness]);\n\n translate([rimThickness + 0.5 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n }\n\t\n\t\/\/ Spokes\n\tlinear_extrude(2)\n\tdifference() {\n\t\tunion() {\n\t\t\t\/\/ Cool, curvey spokes\n\t\t\tfor (i = [0, 120, 240])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([WheelDiameter \/ 4 - 1, 0 ])\n\t\t\t\tdifference() {\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2);\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2 - spokeThickness\/2);\n\t\t\t\t}\n\n\t\t\t\/\/ Boring straight spokes\t\n\t\t\t*for (i = [0, 90, 180, 270])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([hubDiameter \/ 2 - 1, -spokeThickness \/ 2, 0 ])\n\t\t\t\t\tsquare([(WheelDiameter \/ 2) - (hubDiameter \/ 2 - 1) - (rimThickness - 1), spokeThickness]);\n\t\t}\n\n\t\t\/\/ Chop out center where hub will go\n\t\ttranslate([0,0,-eta])\n\t\t\tcircle(r=hubDiameter\/2 - eta);\n\t}\n\n\t\/\/ Hub\n\trender()\n\tdifference() {\n\t\tlinear_extrude(6) \/\/ = motor_shaft_h - a bit?\n\t\tdifference() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\tMotorShaftSlot();\n\t\t}\n\n\t\t\/\/ Grub screw hole\n\t\ttranslate([0, 0, 3.5])\n\t\trotate(a=90, v=[0, 1, 0])\n\t\t\tcylinder(r=1.5, h=hubDiameter\/2 + eta);\n\n\t}\n}\n\nmodule MotorShaftSlot()\n{\n\tdifference() {\n\t\tcircle(r = 5\/2 + 0.2); \/\/ = motor_shaft_r \/ 2\n\n\t\tfor(i = [0:1])\n\t\t\tmirror([i, 0, 0])\t\t\n\t\t\ttranslate([MotorShaftFlatThickness \/ 2 + 0.1, -MotorShaftDiameter \/ 2, 0])\n\t\t\t\tsquare([MotorShaftDiameter \/ 2, MotorShaftDiameter]);\n\t}\n}\n\nmodule Tyre_STL()\n{\n\ttyreThickness = 1.5;\n\tstretchAmount = 2; \/\/ Make tyre dia this much less than wheel so it is stretch to fit\n\n\tcolor(Grey80)\n\trotate_extrude($fn=100)\n\ttranslate ([(WheelDiameter - stretchAmount) \/ 2, 0, 0]) {\n square([tyreThickness, WheelThickness]);\n\n translate([0 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n\t}\n}","old_contents":"module Wheel_STL() {\n\n\tprintedPart(\"printedparts\/Wheel.scad\", \"Wheel\", \"Wheel_STL()\") {\n\t\n\t view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Wheel.stl\"));\n } else {\n\t\t\t\tWheelModel();\n }\n }\n\t}\n}\n\n\nmodule WheelModel()\n{\n\trimThickness = 4;\n\tspokeThickness = 5;\n\thubDiameter = 10;\n\n \/\/ Outer Rim\n rotate_extrude($fn=100)\n translate ([(WheelDiameter \/ 2) - rimThickness, 0, 0])\n difference()\n {\n square([rimThickness, WheelThickness]);\n\n translate([rimThickness + 0.5 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n }\n\t\n\t\/\/ Spokes\n\tlinear_extrude(WheelThickness)\n\tdifference() {\n\t\tunion() {\n\t\t\t\/\/ Cool, curvey spokes\n\t\t\tfor (i = [0, 120, 240])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([WheelDiameter \/ 4 - 1, 0 ])\n\t\t\t\tdifference() {\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2);\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2 - spokeThickness\/2);\n\t\t\t\t}\n\n\t\t\t\/\/ Boring straight spokes\t\n\t\t\t*for (i = [0, 90, 180, 270])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([hubDiameter \/ 2 - 1, -spokeThickness \/ 2, 0 ])\n\t\t\t\t\tsquare([(WheelDiameter \/ 2) - (hubDiameter \/ 2 - 1) - (rimThickness - 1), spokeThickness]);\n\t\t}\n\n\t\t\/\/ Chop out center where hub will go\n\t\ttranslate([0,0,-eta])\n\t\t\tcircle(r=hubDiameter\/2 - eta);\n\t}\n\n\t\/\/ Hub\n\trender()\n\tdifference() {\n\t\tlinear_extrude(6) \/\/ = motor_shaft_h - a bit?\n\t\tdifference() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\tMotorShaftSlot();\n\t\t}\n\n\t\t\/\/ Grub screw hole\n\t\ttranslate([0, 0, 3.5])\n\t\trotate(a=90, v=[0, 1, 0])\n\t\t\tcylinder(r=1.5, h=hubDiameter\/2 + eta);\n\n\t}\n}\n\nmodule MotorShaftSlot()\n{\n\tdifference() {\n\t\tcircle(r = 5\/2); \/\/ = motor_shaft_r \/ 2\n\n\t\tfor(i = [0:1])\n\t\t\tmirror([i, 0, 0])\t\t\n\t\t\ttranslate([MotorShaftFlatThickness \/ 2, -MotorShaftDiameter \/ 2, 0])\n\t\t\t\tsquare([MotorShaftDiameter \/ 2, MotorShaftDiameter]);\n\t}\n}\n\nmodule Tyre_STL()\n{\n\ttyreThickness = 1.5;\n\tstretchAmount = 2; \/\/ Make tyre dia this much less than wheel so it is stretch to fit\n\n\tcolor(Grey80)\n\trotate_extrude($fn=100)\n\ttranslate ([(WheelDiameter - stretchAmount) \/ 2, 0, 0]) {\n square([tyreThickness, WheelThickness]);\n\n translate([0 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ff0bf4c4d7957350af128751bb6a9d04d31fbead","subject":"Citosine","message":"Citosine","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"x=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([0, 0, 0]) cube ([x, y, z-2], center=true); \ncolor(\"Red\") translate ([-30, y\/200000, -4]) cylinder (z, y\/2, y\/2); \n \n } \n#rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(5, 2.65, 2.65); \ntranslate([-10, -10.5, -1]) cube([50, 21, 5]);\n}\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\ndifference() { \n translate([20, -9.5, -3.45]) cube([20, 19, 7]);\n #rotate([0, 90, 0]) translate([0, 4.5, 36.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 36.5]) cylinder(9, 2.65, 2.65);\n}\n\n\n","old_contents":"$fn=128;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \n$fn=270; \ndifference(){\n \ndifference (){ \ncolor(\"MediumPurple\") translate ([0,0,0]) cube ([x,y,z-2], center=true); \ncolor(\"Red\") translate ([-30,y\/200000,-4]) cylinder (z,y\/2,y\/2); \n \n } \n#rotate([0,90,0]) translate([0,0,-22]) cylinder(5,2.3,2.3); \ntranslate([-10,-10.5,-1]) cube([50,21,5]);\n}\n\nrotate([90,0,0]) translate([-10.5,0,-9.5]) cylinder(19,3.5,3.5);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8095764af00db0218576f6333e4221fef8936b8c","subject":"Fix for 2 mm","message":"Fix for 2 mm\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\n\/\/TODO\nshift_x = 4;\nshift_y = th + 1;\n\n\/\/TODO\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\n\/\/ TODO\nusb_type_b_w = 15.2;\nusb_type_b_h = 11.5;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\n\/\/ TODO\nusb_type_a_w = 17.3;\nusb_type_a_h = 8;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\nstoiki_r = 4;\n\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps+pcb_up\/2]) {\n cylinder(r=stoiki_r, h=pcb_up, center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_h = top_box_z - th;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n \/\/cube(size=[under_pcb, under_pcb, stoiki_h + eps], center=true);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\nusb_type_b_h = 11.5;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\nusb_type_a_h = 8;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_r = bolt_d\/2 + 2;\nstoiki_h = top_box_z - th;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room+stoiki_h\/2]) {\n\t \/\/cylinder($fn=fn, r=stoiki_r, h=top_box_z-th+eps);\n cube(size=[under_pcb, under_pcb, stoiki_h + eps], center=true);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=fn, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d09f92cfb1f3476df5d34b5a9cab07658f8e469d","subject":"helper object that guides the rod, to make sure rocket starts in a proper orientation","message":"helper object that guides the rod, to make sure rocket starts in a proper orientation\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/rod_sockets.scad","new_file":"water_rocket_launcher\/rod_sockets.scad","new_contents":"eps = 0.01;\nrod_d = 5+1.2;\n\nmodule rod_guide()\n{\n intersection()\n {\n \/\/ main block\n difference()\n {\n cylinder(d=rod_d+1.5, h=20, $fn=30);\n translate([0, 0, -eps])\n cylinder(d=rod_d, h=20+2*eps, $fn=100);\n }\n \/\/ cut at the top, to minimize drag\n translate([-50\/2, -50\/2, -30+1.2])\n rotate([45, 0, 0])\n cube([50, 50, 50]);\n }\n}\n\n\nfor(i=[0:1])\n translate([0, i*(rod_d+3), 0])\n rod_guide();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'water_rocket_launcher\/rod_sockets.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"6043408c57aa44aabfa8f92f2cc8757839fbc2fb","subject":"Debug print statements were commented out of execution.","message":"Debug print statements were commented out of execution.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad","new_file":"OpenSCAD\/src\/main\/openscad\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad","new_contents":"\/*\n * knurledFinishLib_v2.scad\n * \n * Written by aubenc @ Thingiverse\n *\n * This script is licensed under the Public Domain license.\n *\n * http:\/\/www.thingiverse.com\/thing:31122\n *\n * Derived from knurledFinishLib.scad (also Public Domain license) available at\n *\n * http:\/\/www.thingiverse.com\/thing:9095\n *\n * Usage:\n *\n *\t Drop this script somewhere where OpenSCAD can find it (your current project's\n *\t working directory\/folder or your OpenSCAD libraries directory\/folder).\n *\n *\t Add the line:\n *\n *\t\tuse \n *\n *\t in your OpenSCAD script and call either...\n *\n * knurled_cyl( Knurled cylinder height,\n * Knurled cylinder outer diameter,\n * Knurl polyhedron width,\n * Knurl polyhedron height,\n * Knurl polyhedron depth,\n * Cylinder ends smoothed height,\n * Knurled surface smoothing amount );\n *\n * ...or...\n *\n * knurl();\n *\n *\tIf you use knurled_cyl() module, you need to specify the values for all and\n *\n * Call the module ' help(); ' for a little bit more of detail\n * and\/or take a look to the PDF available at http:\/\/www.thingiverse.com\/thing:9095\n * for a in depth descrition of the knurl properties.\n *\/\n\n\nmodule knurl(\tk_cyl_hg\t= 12,\n\t\t\t\t\tk_cyl_od\t= 25,\n\t\t\t\t\tknurl_wd = 3,\n\t\t\t\t\tknurl_hg = 4,\n\t\t\t\t\tknurl_dp = 1.5,\n\t\t\t\t\te_smooth = 2,\n\t\t\t\t\ts_smooth = 0)\n{\n knurled_cyl(k_cyl_hg, k_cyl_od, \n knurl_wd, knurl_hg, knurl_dp, \n e_smooth, s_smooth);\n}\n\nmodule knurled_cyl(chg, cod, cwd, csh, cdp, fsh, smt)\n{\n cord=(cod+cdp+cdp*smt\/100)\/2;\n cird=cord-cdp;\n cfn=round(2*cird*PI\/cwd);\n clf=360\/cfn;\n crn=ceil(chg\/csh);\n\n\/\/ echo(\"knurled cylinder max diameter: \", 2*cord);\n\/\/ echo(\"knurled cylinder min diameter: \", 2*cird);\n\n\t if( fsh < 0 )\n {\n union()\n {\n shape(fsh, cird+cdp*smt\/100, cord, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else if ( fsh == 0 )\n {\n intersection()\n {\n cylinder(h=chg, r=cord-cdp*smt\/100, $fn=2*cfn, center=false);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else\n {\n intersection()\n {\n shape(fsh, cird, cord-cdp*smt\/100, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n}\n\nmodule shape(hsh, ird, ord, fn4, hg)\n{\n\tx0= 0;\tx1 = hsh > 0 ? ird : ord;\t\tx2 = hsh > 0 ? ord : ird;\n\ty0=-0.1;\ty1=0;\ty2=abs(hsh);\ty3=hg-abs(hsh);\ty4=hg;\ty5=hg+0.1;\n\n\tif ( hsh >= 0 )\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y1],[x1,y1],[x2,y2],[x2,y3],[x1,y4],[x0,y4]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5]\t]);\n\t}\n\telse\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y0],[x1,y0],[x1,y1],[x2,y2],\n\t\t\t\t\t\t\t\t[x2,y3],[x1,y4],[x1,y5],[x0,y5]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5,6,7]\t]);\n\t}\n}\n\nmodule knurled_finish(ord, ird, lf, sh, fn, rn)\n{\n for(j=[0:rn-1])\n assign(h0=sh*j, h1=sh*(j+1\/2), h2=sh*(j+1))\n {\n for(i=[0:fn-1])\n assign(lf0=lf*i, lf1=lf*(i+1\/2), lf2=lf*(i+1))\n {\n polyhedron(\n points=[\n [ 0,0,h0],\n [ ord*cos(lf0), ord*sin(lf0), h0],\n [ ird*cos(lf1), ird*sin(lf1), h0],\n [ ord*cos(lf2), ord*sin(lf2), h0],\n\n [ ird*cos(lf0), ird*sin(lf0), h1],\n [ ord*cos(lf1), ord*sin(lf1), h1],\n [ ird*cos(lf2), ird*sin(lf2), h1],\n\n [ 0,0,h2],\n [ ord*cos(lf0), ord*sin(lf0), h2],\n [ ird*cos(lf1), ird*sin(lf1), h2],\n [ ord*cos(lf2), ord*sin(lf2), h2]\n ],\n triangles=[\n [0,1,2],[2,3,0],\n [1,0,4],[4,0,7],[7,8,4],\n [8,7,9],[10,9,7],\n [10,7,6],[6,7,0],[3,6,0],\n [2,1,4],[3,2,6],[10,6,9],[8,9,4],\n [4,5,2],[2,5,6],[6,5,9],[9,5,4]\n ],\n convexity=5);\n }\n }\n}\n\nmodule knurl_help()\n{\n\techo();\n\techo(\" Knurled Surface Library v2 \");\n echo(\"\");\n\techo(\" Modules: \");\n\techo(\"\");\n\techo(\" knurled_cyl(parameters... ); - Requires a value for each an every expected parameter (see bellow) \");\n\techo(\"\");\n\techo(\" knurl(); - Call to the previous module with a set of default parameters, \");\n\techo(\" values may be changed by adding 'parameter_name=value' i.e. knurl(s_smooth=40); \");\n\techo(\"\");\n\techo(\" Parameters, all of them in mm but the last one. \");\n\techo(\"\");\n\techo(\" k_cyl_hg - [ 12 ] ,, Height for the knurled cylinder \");\n\techo(\" k_cyl_od - [ 25 ] ,, Cylinder's Outer Diameter before applying the knurled surfacefinishing. \");\n\techo(\" knurl_wd - [ 3 ] ,, Knurl's Width. \");\n\techo(\" knurl_hg - [ 4 ] ,, Knurl's Height. \");\n\techo(\" knurl_dp - [ 1.5 ] ,, Knurl's Depth. \");\n\techo(\" e_smooth - [ 2 ] ,, Bevel's Height at the bottom and the top of the cylinder \");\n\techo(\" s_smooth - [ 0 ] ,, Knurl's Surface Smoothing : File donwn the top of the knurl this value, i.e. 40 will snooth it a 40%. \");\n\techo(\"\");\n}\n\n","old_contents":"\/*\n * knurledFinishLib_v2.scad\n * \n * Written by aubenc @ Thingiverse\n *\n * This script is licensed under the Public Domain license.\n *\n * http:\/\/www.thingiverse.com\/thing:31122\n *\n * Derived from knurledFinishLib.scad (also Public Domain license) available at\n *\n * http:\/\/www.thingiverse.com\/thing:9095\n *\n * Usage:\n *\n *\t Drop this script somewhere where OpenSCAD can find it (your current project's\n *\t working directory\/folder or your OpenSCAD libraries directory\/folder).\n *\n *\t Add the line:\n *\n *\t\tuse \n *\n *\t in your OpenSCAD script and call either...\n *\n * knurled_cyl( Knurled cylinder height,\n * Knurled cylinder outer diameter,\n * Knurl polyhedron width,\n * Knurl polyhedron height,\n * Knurl polyhedron depth,\n * Cylinder ends smoothed height,\n * Knurled surface smoothing amount );\n *\n * ...or...\n *\n * knurl();\n *\n *\tIf you use knurled_cyl() module, you need to specify the values for all and\n *\n * Call the module ' help(); ' for a little bit more of detail\n * and\/or take a look to the PDF available at http:\/\/www.thingiverse.com\/thing:9095\n * for a in depth descrition of the knurl properties.\n *\/\n\n\nmodule knurl(\tk_cyl_hg\t= 12,\n\t\t\t\t\tk_cyl_od\t= 25,\n\t\t\t\t\tknurl_wd = 3,\n\t\t\t\t\tknurl_hg = 4,\n\t\t\t\t\tknurl_dp = 1.5,\n\t\t\t\t\te_smooth = 2,\n\t\t\t\t\ts_smooth = 0)\n{\n knurled_cyl(k_cyl_hg, k_cyl_od, \n knurl_wd, knurl_hg, knurl_dp, \n e_smooth, s_smooth);\n}\n\nmodule knurled_cyl(chg, cod, cwd, csh, cdp, fsh, smt)\n{\n cord=(cod+cdp+cdp*smt\/100)\/2;\n cird=cord-cdp;\n cfn=round(2*cird*PI\/cwd);\n clf=360\/cfn;\n crn=ceil(chg\/csh);\n\n echo(\"knurled cylinder max diameter: \", 2*cord);\n echo(\"knurled cylinder min diameter: \", 2*cird);\n\n\t if( fsh < 0 )\n {\n union()\n {\n shape(fsh, cird+cdp*smt\/100, cord, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else if ( fsh == 0 )\n {\n intersection()\n {\n cylinder(h=chg, r=cord-cdp*smt\/100, $fn=2*cfn, center=false);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n else\n {\n intersection()\n {\n shape(fsh, cird, cord-cdp*smt\/100, cfn*4, chg);\n\n translate([0,0,-(crn*csh-chg)\/2])\n knurled_finish(cord, cird, clf, csh, cfn, crn);\n }\n }\n}\n\nmodule shape(hsh, ird, ord, fn4, hg)\n{\n\tx0= 0;\tx1 = hsh > 0 ? ird : ord;\t\tx2 = hsh > 0 ? ord : ird;\n\ty0=-0.1;\ty1=0;\ty2=abs(hsh);\ty3=hg-abs(hsh);\ty4=hg;\ty5=hg+0.1;\n\n\tif ( hsh >= 0 )\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y1],[x1,y1],[x2,y2],[x2,y3],[x1,y4],[x0,y4]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5]\t]);\n\t}\n\telse\n\t{\n\t\trotate_extrude(convexity=10, $fn=fn4)\n\t\tpolygon(points=[\t[x0,y0],[x1,y0],[x1,y1],[x2,y2],\n\t\t\t\t\t\t\t\t[x2,y3],[x1,y4],[x1,y5],[x0,y5]\t],\n\t\t\t\t\tpaths=[\t[0,1,2,3,4,5,6,7]\t]);\n\t}\n}\n\nmodule knurled_finish(ord, ird, lf, sh, fn, rn)\n{\n for(j=[0:rn-1])\n assign(h0=sh*j, h1=sh*(j+1\/2), h2=sh*(j+1))\n {\n for(i=[0:fn-1])\n assign(lf0=lf*i, lf1=lf*(i+1\/2), lf2=lf*(i+1))\n {\n polyhedron(\n points=[\n [ 0,0,h0],\n [ ord*cos(lf0), ord*sin(lf0), h0],\n [ ird*cos(lf1), ird*sin(lf1), h0],\n [ ord*cos(lf2), ord*sin(lf2), h0],\n\n [ ird*cos(lf0), ird*sin(lf0), h1],\n [ ord*cos(lf1), ord*sin(lf1), h1],\n [ ird*cos(lf2), ird*sin(lf2), h1],\n\n [ 0,0,h2],\n [ ord*cos(lf0), ord*sin(lf0), h2],\n [ ird*cos(lf1), ird*sin(lf1), h2],\n [ ord*cos(lf2), ord*sin(lf2), h2]\n ],\n triangles=[\n [0,1,2],[2,3,0],\n [1,0,4],[4,0,7],[7,8,4],\n [8,7,9],[10,9,7],\n [10,7,6],[6,7,0],[3,6,0],\n [2,1,4],[3,2,6],[10,6,9],[8,9,4],\n [4,5,2],[2,5,6],[6,5,9],[9,5,4]\n ],\n convexity=5);\n }\n }\n}\n\nmodule knurl_help()\n{\n\techo();\n\techo(\" Knurled Surface Library v2 \");\n echo(\"\");\n\techo(\" Modules: \");\n\techo(\"\");\n\techo(\" knurled_cyl(parameters... ); - Requires a value for each an every expected parameter (see bellow) \");\n\techo(\"\");\n\techo(\" knurl(); - Call to the previous module with a set of default parameters, \");\n\techo(\" values may be changed by adding 'parameter_name=value' i.e. knurl(s_smooth=40); \");\n\techo(\"\");\n\techo(\" Parameters, all of them in mm but the last one. \");\n\techo(\"\");\n\techo(\" k_cyl_hg - [ 12 ] ,, Height for the knurled cylinder \");\n\techo(\" k_cyl_od - [ 25 ] ,, Cylinder's Outer Diameter before applying the knurled surfacefinishing. \");\n\techo(\" knurl_wd - [ 3 ] ,, Knurl's Width. \");\n\techo(\" knurl_hg - [ 4 ] ,, Knurl's Height. \");\n\techo(\" knurl_dp - [ 1.5 ] ,, Knurl's Depth. \");\n\techo(\" e_smooth - [ 2 ] ,, Bevel's Height at the bottom and the top of the cylinder \");\n\techo(\" s_smooth - [ 0 ] ,, Knurl's Surface Smoothing : File donwn the top of the knurl this value, i.e. 40 will snooth it a 40%. \");\n\techo(\"\");\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ced3dd7a76760f5f7b48691fbf1634841d251eb8","subject":"screws: start work on different screw heads","message":"screws: start work on different screw heads\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n }\n else\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference() {\n \/*translate([0, 0, d])*\/\n #spherea(r = r, align=-Z);\n\n translate([0, 0, -r])\n cubea(r*2);\n\n translate([0, 0, f\/3])\n cylinder(r = hexRadius(threadsize), h = f, $fn = 6);\n\n } \/\/ end difference\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"db769233fb922f7a8f988ba2e59ddcb6befca0e9","subject":"screw: misc fixes","message":"screw: misc fixes\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+.1*mm;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(XAXIS*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n }\n}\n\nif(false)\n{\n box_w = 40*mm;\n box_h = 10*mm;\n box_d = 10*mm;\n o = 10*mm;\n\n \/*$show_vit = true;*\/\n $fs= 0.2;\n $fa = 4;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n difference()\n {\n \/*rcubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);*\/\n\n \/*screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);*\/\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = get(NutThickness,nut)*tolerance;\n d = get(NutWidthMin, nut)*tolerance;\n facets = get(NutFacets, nut);\n nut_hex_radius = hex_radius(get(NutWidthMax, nut))+.1;\n cylindera($fn=get(NutFacets, nut), r=nut_hex_radius, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = get(NutThickness,nut)*tolerance;\n d = get(NutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width = get(NutWidthMin, nut);\n nut_hex_radius = hex_radius(nut_width)+.1*mm;\n s = nut_hex_radius;\n total_h = nut_h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=get(NutFacets, nut), r=nut_hex_radius, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width,nut_width,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidth = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidth, 0, nuti)[nuti]*1.2;\n translate(XAXIS*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n }\n}\n\nif(false)\n{\n box_w = 40;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.1;\n $fa = 5;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n difference()\n {\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);*\/\n\n \/*screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n \/*screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);*\/\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"89b26ce79a47fe6ba7b536ff4a6778483ecbbd1e","subject":"The font names were added.","message":"The font names were added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n icon1 = \"\",\r\n icon1_scale = 1,\r\n icon1_x = 0,\r\n icon1_y = 0,\r\n icon2 = \"\",\r\n icon2_scale = 1.0,\r\n icon2_x = 0,\r\n icon2_y = 0,\r\n text1 = \"\",\r\n\t\t\t\t\ttext1_fontName = \"Bauhaus 93:style=Regular\",\r\n text1_fontSize = 7.5,\r\n text1_x = 0,\r\n text1_y = 0,\r\n text2 = \"\",\r\n\t\t\t\t\ttext2_fontName = \"Bauhaus 93:style=Regular\",\r\n text2_fontSize = 7.5,\r\n text2_x = 0,\r\n text2_y = 0)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n\t\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\n\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\nfunction lightSignal_stlBaseInnerRadius() = 18.5;\r\n\r\nfunction lightSignal_stlBaseOuterRadius() = lightSignal_stlBaseInnerRadius() + 2.5;\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y)\r\n{\r\n lightSignal_oneIconCutout(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y);\r\n\r\n lightSignal_oneIconCutout(icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_oneIconCutout(\r\n icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y)\r\n{\r\n if(icon1 == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n zScale = 3;\r\n translate([icon1_x, icon1_y, -1.01])\r\n if(icon1 == \"heart\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n heartThumbnail();\r\n }\r\n else if(icon1 == \"bat\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n batmanLogoThumbnail();\r\n }\r\n }\r\n}\r\n\r\nmodule lightSignal_oneTextCutout(text, fontName, fontSize, x, y)\r\n{\r\n if(text == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n extrudeHeight = 6;\r\n zTranslate = -3;\r\n\r\n translate([x, y, zTranslate])\r\n linear_extrude(height = extrudeHeight)\r\n text(text = text, font = fontName, size = fontSize);\r\n }\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\r\n\tstlBaseInnerRadius = lightSignal_stlBaseInnerRadius();\r\n\tstlBaseOuterRadius = lightSignal_stlBaseOuterRadius();\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n lightSignal_oneTextCutout(text1, text1_fontName, text1_fontSize, text1_x, text1_y);\r\n\r\n lightSignal_oneTextCutout(text2, text2_fontName, text2_fontSize, text2_x, text2_y);\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n icon1 = \"\",\r\n icon1_scale = 1,\r\n icon1_x = 0,\r\n icon1_y = 0,\r\n icon2 = \"\",\r\n icon2_scale = 1.0,\r\n icon2_x = 0,\r\n icon2_y = 0,\r\n text1 = \"\",\r\n text1_fontSize = 7.5,\r\n text1_x = 0,\r\n text1_y = 0,\r\n text2 = \"\",\r\n text2_fontSize = 7.5,\r\n text2_x = 0,\r\n text2_y = 0)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\n\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\nfunction lightSignal_stlBaseInnerRadius() = 18.5;\r\n\r\nfunction lightSignal_stlBaseOuterRadius() = lightSignal_stlBaseInnerRadius() + 2.5;\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y)\r\n{\r\n lightSignal_oneIconCutout(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y);\r\n\r\n lightSignal_oneIconCutout(icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_oneIconCutout(\r\n icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y)\r\n{\r\n if(icon1 == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n zScale = 3;\r\n translate([icon1_x, icon1_y, -1.01])\r\n if(icon1 == \"heart\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n heartThumbnail();\r\n }\r\n else if(icon1 == \"bat\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n batmanLogoThumbnail();\r\n }\r\n }\r\n}\r\n\r\nmodule lightSignal_oneTextCutout(text, fontSize, x, y)\r\n{\r\n if(text == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n extrudeHeight = 6;\r\n zTranslate = -3;\r\n fontName = \"Bauhaus 93:style=Regular\";\r\n\r\n translate([x, y, zTranslate])\r\n linear_extrude(height = extrudeHeight)\r\n text(text = text, font = fontName, size = fontSize);\r\n }\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\r\n\tstlBaseInnerRadius = lightSignal_stlBaseInnerRadius();\r\n\tstlBaseOuterRadius = lightSignal_stlBaseOuterRadius();\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n lightSignal_oneTextCutout(text1, text1_fontSize, text1_x, text1_y);\r\n\r\n lightSignal_oneTextCutout(text2, text2_fontSize, text2_x, text2_y);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4460abb4a14f4f20fffda0ad47c86b59647e9046","subject":"detailed sonar holder and platform","message":"detailed sonar holder and platform\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"$fs = 0.1;\n$fa = 5;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false); \n \/\/ servo \n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n \n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n \n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20) \n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n \n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true); translate ([-45, 35, 0]) circle(r=7.5, center=true); translate ([ 45, 35, 0]) circle(r=7.5, center=true); }\n \n } \n square(size=[162,120], center=true);\n }\n \n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points \n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front \n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n \n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n \n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \n \n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true); \n \n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \n }\n arrangebottom(30) hbaseholes(center=true);\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n \n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 43]) cube(size=[90, 70, 1.2], center=true); \n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 43+5]) cube(size=[20, 63, 10], center=true); \n \n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 43+5]) cube(size=[20, 20, 10], center=true); \n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true); \n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = false)\n{\n translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false); \n if (!center) { \n translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false); \n translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false); \n }\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n \n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 22], center=false);\n translate ([0, 43, 22]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n translate ([0, 5, 22]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n }\n \n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n \n \/\/ sonar\n translate([16\/2+1,18\/2+1,1.3]) cylinder(d=16.5, h=15);\n translate([16\/2+27+1,18\/2+1,1.3]) cylinder(d=16.5, h=15); \n \n \/\/xtal(s)\n translate([45\/2-3.25,20-4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=5, h=5);\n translate([6.5,0,0]) cylinder(d=5, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=5, h=5);\n translate([6.5,0,0]) cylinder(d=5, h=5);\n }\n \n \/\/ screws\n translate([2.5,2.5,4.5]) screw2x6bore();\n translate([2.5+40,2.5+15,4.5]) screw2x6bore();\n translate([2.5+40,2.5,4.5]) screw2x6bore();\n translate([2.5,2.5+15,4.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10]) \n cube(size=[5, 20, 9], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n #hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2, h=6);\n translate ([0, 0, -1.3]) \n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n \n hmount(); \n \n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n \n \/\/translate ([10, -23, 35]) esc(); \n translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n \n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar(); \n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar(); \n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n \n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar(); \n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar(); \n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) children();\n translate ([40, 40, 57]) rotate([0, 0, a]) children();\n translate ([40, -40, 57]) rotate([0, 0, -a]) children();\n \n translate ([5, 52.5, 42]) rotate([180, 0, 2*a]) children();\n translate ([5, -52.5, 42]) rotate([180, 0, -2*a]) children(); \n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\nplatform();\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","old_contents":"use \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[65, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[65, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-79, 4, 23]) cube(size=[43, 2, 6], center=false);\n translate ([-79, -6, 23]) cube(size=[43, 2, 6], center=false); \n \/\/ servo \n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n \n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n \n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([79, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,41], [-23,41],[-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-79-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,45], [-25,45],[-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n color(\"black\") translate ([0, 0, 46]) difference() {\n union() {\n #linear_extrude(height = 3)\n difference() {\n offset(20) offset(-20) \n polygon([\n [-79,25], [-70,25],[-44,60],[44,60],[70,23], [79,23],\n [79,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-79,-25]\n ]);\n \n offset(5) offset(-10) polygon([\n [-54,40],[29,40],[29,-40],[-54,-40]\n ]);\n }\n \n \/\/ shock tower mount points\n translate ([-79, -25, 0]) cube(size=[5, 50, 11], center=false); \n translate ([79-5, -23, 0]) cube(size=[5, 46, 7], center=false); \n\n \/\/ joint mount plates to body\n translate ([-79, -25, 0]) cube(size=[15, 50, 3], center=false); \n translate ([79-15, -23, 0]) cube(size=[15, 46, 3], center=false); \n }\n \n \/\/ board mount holes\n #translate ([-54, 31, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([-54, -31, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([29, 31, 0]) cylinder(d=3.2, h=10, center=true);\n #translate ([29, -31, 0]) cylinder(d=3.2, h=10, center=true);\n }\n}\n\nmodule board() {\n \n \/\/ base\n color(\"yellow\") translate ([-12.5, 0, 45]) cube(size=[90, 70, 1], center=true); \n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 45+5]) cube(size=[20, 63, 10], center=true); \n \n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 45+5]) cube(size=[20, 20, 10], center=true); \n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true); \n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -45\/2, -6]) cube(size=[3, 45, 26], center=false);\n color(\"gray\") translate ([-8.5, -45\/2, -6]) cube(size=[10, 45, 5], center=false);\n \n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n \n \/\/translate ([10, -23, 35]) esc(); \n translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n \n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar(); \n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar(); \n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n \n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar(); \n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar(); \n}\n\nmodule fullb() {\n car();\n \n translate ([68, 0, 55]) hsonar();\n translate ([40, 40, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -40, 55]) rotate([0, 0, -30]) hsonar(); \n \n translate ([5, 50, 40]) rotate([180, 0, 60]) hsonar();\n translate ([5, -50, 40]) rotate([180, 0, -60]) hsonar(); \n}\n\nfullb();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"8d7445246444d2176df9a9884a6ca7c4632261f0","subject":"bearing: remove redundant\/duplicate","message":"bearing: remove redundant\/duplicate\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"29b5d33d2eadd5c8e6d1b3069beee97921507781","subject":"[3d] Minor adjustments to screws and probe positions","message":"[3d] Minor adjustments to screws and probe positions\n\nRefactored some offsets to use their real-world PCB locations\n-- HeaterMeter left jacks moved to front 0.17-0.25mm, d_off increased to\n0.8mm to compensate\n-- HeaterMeter right jacks moved to front 0.12mm\n-- Screws moved 0.165mm left, 0.31mm to front\n-- Added 1mm radius vertical chamfer to front left\/right internal\ncorners\n-- Pi mounting screws 0.2mm to back\n\nRelativity:\n-- Made the SD card edge and LCD block relative to front edge rather\nthan back, allows resizing\n-- Fixed bottom nuttrap edge not being wide enough for full wall\nthickness\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nd_off = 0.8; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+1.2; \/\/ overall interior case width\nd = inch(3.75)+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(h=2.25+1.4, d=2.5, $fn=12);\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+18]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1,1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall+d_off,wall_t]) {\n \/\/ Probe jacks\n translate([0,inch(0.95),probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.08,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,d-d_off-78,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall+d_off, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-d_off-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nd_off = wall\/4; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+18]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall+d_off,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+d_off+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+d_off+2.9,0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+38.8,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+d_off+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+d_off+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall+d_off, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-d_off-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5efd5eae7149f2711aa7859323faf418dc2358fb","subject":"add parameters for customization","message":"add parameters for customization\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/trooper\/scrum-trooper.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/trooper\/scrum-trooper.scad","new_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule scrumTrooper(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumTrooperThumbnail(height)\r\n{\r\n\txyScale = .74;\r\n\tscale([xyScale, xyScale, 1])\t\r\n\tscrumTrooper(h = height);\t\r\n}\r\n","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule scrumTrooper(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumTrooperThumbnail()\r\n{\r\n\txyScale = .74;\r\n\tscale([xyScale, xyScale, 1])\t\r\n\tscrumTrooper();\t\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3f022634caf19d39357f25f7740f2daaa4d5110f","subject":"bearing\/linear: fixes, improve mounting module","message":"bearing\/linear: fixes, improve mounting module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part=part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=X, mount_style=\"closed\")\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n D_=D+2*support_wall_thickness;\n h_ = h+flange_offset;\n rcylindera(h=h_, d=D_, orient=Z, align=Z);\n rcubea(size=[D_,D_,h_], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n D_=D+2*support_wall_thickness;\n h_ = h+flange_offset;\n rcylindera(h=h_, d=D_, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \n\nmodule linear_bearing(bearing, part, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n t = offset_flange ? -Z*flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(bearing=bearing, part=\"pos\", align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(bearing=bearing, part=\"neg\", align=align, orient=orient, offset_flange=offset_flange);\n }\n\n }\n else if(part==\"pos\")\n translate(t)\n size_align(size=s, align=align, orient=orient)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n translate(t)\n size_align(size=s, align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=10*mm, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, align=N, orient=Z, ziptie_dist=U, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n bearing_ID = get(LinearBearingInnerDiameter, bearing);\n bearing_OD = get(LinearBearingOuterDiameter, bearing);\n bearing_L = get(LinearBearingLength, bearing);\n\n h = fallback(override_h, bearing_L) + extra_h;\n size_align(size=[bearing_OD,bearing_OD,h], align=align ,orient=orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_L*tolerance, d=bearing_OD*tolerance, orient=Z);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_OD+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_ID+2*mm, h=100, orient=Z);\n\n if($show_vit)\n {\n %linear_bearing(bearing=bearing);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_OD+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"faadc7d413ca30cb2e72ffafea797385e6800201","subject":"Limit switch update - still incomplete","message":"Limit switch update - still incomplete\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/limit-switches\/limit-switch-large.scad","new_file":"openscad\/limit-switches\/limit-switch-large.scad","new_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, such as this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\nbase_thick = 1;\nswitch_thick = 8;\nLARGE = 100;\nEPSILON = 0.1;\n\nmodule switch_base() {\n base_w = 50;\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10 + 0.5; \/\/ for sticky tape or wire\n switch_off_d0 = 8;\n switch_off_w = 12;\n switch_r = 3;\n top_gap_w = switch_off_w + 18.5;\n top_gap_d = 5;\n top_wall_thick = 3.5;\n hole_dist_x = 16;\n hole_dist_y = 8;\n hole_wall_thick = 3;\n hole_r = 2; \/\/ enough for 3\/32 (imperial) screws\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n \/\/switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n switch_off_d = max(switch_off_d0, bot_hole_check);\n\n bottom_gap_w = switch_off_w + 14;\n bottom_gap_d = switch_off_d + 11; \n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_thick;\n hole1_x = hole_wall_thick + hole_r;\n hole1_y = hole_wall_thick + hole_r;\n\n ro = 2;\n difference() {\n oblong(base_w, base_d, ro, tot_thick);\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE);\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_w+EPSILON, LARGE, LARGE]);\n translate([bottom_gap_w, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_d + 2*EPSILON, LARGE]);\n translate([hole1_x, hole1_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole1_x, hole1_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole1_x + hole_dist_x, hole1_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n }\n}\n\nmodule trial() {\n difference() {\n switch_base();\n translate([25, -EPSILON, -EPSILON]) cube([LARGE, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, base_thick + 5]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\n\/\/switch_base();\ntrial();","old_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, such as this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\nbase_thick = 3;\nswitch_thick = 8;\nLARGE = 100;\nEPSILON = 0.1;\n\nmodule switch_base() {\n base_w = 50;\n base_d = 30;\n switch_w = 20;\n switch_d = 10;\n switch_off_d = 5;\n switch_off_w = 5;\n switch_r = 3;\n top_gap_w = switch_off_w + switch_w\/2;\n top_gap_h = 4;\n top_gap_d = 4;\n tot_thick = base_thick + switch_thick\/2;\n bottom_gap_off_w = switch_off_w + 4;\n bottom_gap_w = 5;\n bottom_gap_h = 4;\n right_gap_off_d = switch_off_d + 3;\n right_gap_d = 5;\n right_gap_h = bottom_gap_h;\n ro = 2;\n difference() {\n oblong(base_w, base_d, ro, tot_thick);\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE);\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_w+EPSILON, LARGE, LARGE]);\n translate([bottom_gap_off_w, -EPSILON, base_thick])\n cube([bottom_gap_w, switch_off_d + 2*EPSILON, LARGE]);\n translate([switch_off_w+switch_w-EPSILON, right_gap_off_d, base_thick])\n cube([LARGE, right_gap_d, LARGE]);\n\n\n }\n}\n\n\n\nswitch_base();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"3ba6cc961b28a24c77176c3baa793fe78f4012ba","subject":"This is a coin with a chain loop.","message":"This is a coin with a chain loop.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/pendants\/spur\/rotated-spurs-pendant.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/pendants\/spur\/rotated-spurs-pendant.scad","new_contents":"\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/pendants\/spur\/rotated-spurs-pendant.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b84db43422fd944bf4767622b4e01b6f21caa5d2","subject":"worked on","message":"worked on\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"TubeCollector\/TubeCollector.scad","new_file":"TubeCollector\/TubeCollector.scad","new_contents":"\/\/TubeCollector\n\n\/\/Parameters\n$fn=50;\ninnerDiameter = 40;\nouterDiameter = 45;\nhoseDiameter = 10;\ntubeLenght = 3000;\n\n\/\/Seal\nmodule bottomSeal() {\n difference() {\n circle(d=outerDiameter+5);\n circle(d=hoseDiameter);\n }\n}\nmodule topSeal() {\n difference() {\n circle(d=innerDiameter);\n circle(d=hoseDiameter);\n }\n}\nmodule assemblySeal() {\n extrude()bottomSeal();\n translate([0,0,5])extrude()topSeal();\n}\n\/\/Sealed Pipe\nmodule sealedPipe() {\n rotate(a=[90,0,0])translate([0,0,-tubeLenght\/2]){\n extrude(h=tubeLenght)difference() {\n circle(d=outerDiameter);\n circle(d=innerDiameter);\n }\n translate([0,0,-5])assemblySeal();\n translate([0,0,tubeLenght+5])mirror([0,0,1])assemblySeal();\n }\n}\n\/\/Pipe Holder\nmodule pipeHolder() {\n difference() {\n square([60,250],center=true);\n for(i=[0:3])translate([0,i*(outerDiameter+10)-82.5]){\n hull(){\n circle(d=outerDiameter);\n translate([outerDiameter\/2+10,0])square([1,outerDiameter],center=true);\n }\n for(i=[0,1])mirror([0,i,0])translate([-outerDiameter\/2,(outerDiameter+5)\/2])square(5,center=true);\n }\n }\n}\nmodule assembly() {\n for(i=[0:3])translate([0,0,i*(outerDiameter+10)-82.5])sealedPipe();\n for(i=[-3:3])translate([0,i*(tubeLenght\/6-5),0])rotate([90,0,0])extrude()pipeHolder();\n}\nassembly();\n\/\/Heleper Modules\nmodule extrude(h=5) {\n linear_extrude(height=h)children();\n}","old_contents":"\/\/TubeCollector\n\n\/\/Parameters\n$fn=50;\ninnerDiameter = 40;\nouterDiameter = 45;\nhoseDiameter = 10;\n\nmodule bottom() {\n difference() {\n circle(d=outerDiameter+5);\n circle(d=hoseDiameter);\n }\n}\nmodule top() {\n difference() {\n circle(d=innerDiameter);\n circle(d=hoseDiameter);\n }\n}\nmodule extrude(h=5) {\n linear_extrude(height=h)children();\n}\nmodule assembly() {\n extrude()bottom();\n translate([0,0,5])extrude()top();\n}\nassembly();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"d3c79016d726cf0800c73962714ce6cbf37c568f","subject":"main: Minor tweak for xcarriage pos","message":"main: Minor tweak for xcarriage pos\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\nxaxis_pos_x = -225\/2*mm;\nxaxis_range_z=[85,350];\nxaxis_pos_z = 350*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"790c36e8b291fd054184237d411892892adc85b9","subject":"Tried adding CPU mount to vent bracket, did not work out. Adjusted positioning of a switch a bit, though.","message":"Tried adding CPU mount to vent bracket, did not work out. Adjusted positioning of a switch a bit, though.\n","repos":"sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning","old_file":"3d-models\/damper-mount\/vent-5v-stepper-adaptor.scad","new_file":"3d-models\/damper-mount\/vent-5v-stepper-adaptor.scad","new_contents":"wall_thickness=2;\n\/\/ Piece that will be rotated\ndamper_arm_diameter=9;\ndamper_arm_cut_width=5.1;\ndamper_arm_depth=12;\n\/\/ stepper mount\nstepper_shaft_diameter=5.8;\nstepper_shaft_cut_width=3.5;\nstepper_shaft_depth=7;\n\/\/ Marker for closed position\nmarker_size=2;\nmarker_distance=9;\nmarker_height=5;\n\/\/ Connecting the two\nmount_length=1.2*(damper_arm_depth+stepper_shaft_depth);\nmount_diameter=max(damper_arm_diameter,stepper_shaft_diameter)+wall_thickness*2;\n\/\/ Pin offset degrees to achieve fully closed vent on button press\npin_degrees_offset=0;\n\n\/* \n * motor-to-damper adaptor\n**\/\ntranslate([0, mount_diameter, -mount_length]) motor_to_damper_adaptor();\n\nmodule motor_to_damper_adaptor() {\n rotate([0,0,pin_degrees_offset]) button_pin();\n difference() {\n \/\/ main body\n cylinder(mount_length, mount_diameter\/2, mount_diameter\/2);\n \/\/ Stepper cutout\n translate([0,0,stepper_shaft_depth\/2]) mount_cutout(stepper_shaft_diameter\/2, stepper_shaft_cut_width, stepper_shaft_depth);\n \/\/ Damper cutout\n translate([0,0,mount_length-damper_arm_depth\/2]) mount_cutout(damper_arm_diameter\/2, damper_arm_cut_width, damper_arm_depth);\n }\n \n}\n\nmodule button_pin() {\n translate([mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n translate([-mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n}\n\n\/\/ Motor mount\nvent_diameter = 6*25.4; \/\/ 6\"\nshaft_offset=8;\nmotor_ears_distance=35;\nmotot_ears_hole_diameter=3.5;\nmotor_ears_screw_length=15;\nvent_mount_distance=55;\nvent_mount_hole_diameter=6;\nmotor_to_vent_distance=mount_length+4-wall_thickness*1.5; \/\/ 4mm distance between connector and motor body\nvent_ears_total_length=vent_mount_distance+vent_mount_hole_diameter+wall_thickness*2;\nvent_ears_total_width=mount_diameter+wall_thickness*4;\nmotor_screw_cube_side=motot_ears_hole_diameter+wall_thickness*2;\n\/*\n * mount bracket itself\n**\/\nrotate([90,0,0]) motor_to_vent_mount();\n\n\/\/ endstop sensor\nendstop_screw_diameter=1.8;\nendstop_screw1_distance=16;\nendstop_screw1_offset=0;\nendstop_screw2_distance=5;\nendstop_screw2_offset=21.5;\n\n\/\/ Control board\nboard_width=23.5;\nboard_length=37.5;\nboard_latch_height=3.5;\nholder_offset=3;\n\n\/\/ Not a good idea after all\n\/\/translate([motor_ears_distance\/2+motor_screw_cube_side\/2,shaft_offset+motor_screw_cube_side\/2,wall_thickness]) rotate([90,90,0]) controller_mount();\n\nmodule controller_mount() {\n difference(){\n cube([board_width+wall_thickness*2, board_length+wall_thickness*2, board_latch_height+wall_thickness]);\n translate([wall_thickness, wall_thickness, wall_thickness]) cube([board_width, board_length, board_latch_height]);\n \/\/ Cutout for holder to be more flexible\n translate([holder_offset,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([holder_offset+wall_thickness*2,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([board_width-holder_offset+wall_thickness,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([board_width-holder_offset-wall_thickness,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n }\n \/\/ board holder\n \/\/translate([wall_thickness+holder_offset,wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,270]) board_holder();\n \/\/translate([board_width-holder_offset,wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,270]) board_holder();\n \/\/translate([2*wall_thickness+holder_offset,board_length+wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,90]) board_holder();\n \/\/translate([wall_thickness+board_width-holder_offset,board_length+wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,90]) board_holder();\n}\n\nmodule board_holder() {\n union() {\n cube(wall_thickness, wall_thickness, wall_thickness);\n translate([0,wall_thickness, wall_thickness\/2])rotate([90,0,0]) cylinder(d=wall_thickness, h=wall_thickness, $fn=20);\n }\n}\n\n\nmodule motor_to_vent_mount() {\n union() {\n \/\/ Vent ears\n vent_mount_plate();\n \/\/ motor mount\n translate([motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n translate([-motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n }\n}\n\nmodule damper_mount_cutout() {\n intersection() {\n cylinder(damper_arm_depth, damper_arm_diameter, damper_arm_diameter, center=true, $fn=40);\n cube([damper_arm_diameter*2, damper_arm_cut_width, damper_arm_depth], center=true);\n }\n}\n\nmodule mount_cutout(radius, width, depth) {\n intersection() {\n cylinder(depth, radius, radius, center=true, $fn=40);\n cube([radius*2, width, depth], center=true);\n }\n}\n\nmodule vent(length) {\n cylinder(length, vent_diameter\/2, vent_diameter\/2, $fn=100);\n}\n\nmodule vent_mount_plate() {\n endstop_sensor_space=max(endstop_screw1_distance,endstop_screw2_distance)+endstop_screw_diameter\/2+wall_thickness-(vent_ears_total_width\/2-mount_diameter\/2);\n \/\/ ^ distance to furthest hole ^ mounting holes w\/ walls ^ distance from original edge to shaft\n plate_total_width=vent_ears_total_width+motor_screw_cube_side\/2+shaft_offset-vent_ears_total_width\/2+(endstop_sensor_space) ;\n \/\/ ^ base width ^ extend for motor mount ^ accommodate endstop sensor\n translate([-vent_ears_total_length\/2,0,0]) rotate([0,90,0]) translate([-wall_thickness*1.5,0,0]) intersection() {\n difference() {\n translate([-wall_thickness*1.5, -vent_ears_total_width\/2-endstop_sensor_space, 0]) cube([wall_thickness*3, plate_total_width, vent_ears_total_length]);\n translate([-vent_diameter\/2, 0, 0]) vent(vent_ears_total_length);\n \/\/ Mount holes cutout\n translate([-wall_thickness*1.5,0,vent_mount_hole_diameter\/2+wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n translate([-wall_thickness*1.5,0,vent_ears_total_length-vent_mount_hole_diameter\/2-wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n \/\/ shaft cutout\n translate([-wall_thickness*1.5,0,vent_ears_total_length\/2]) rotate([0,90,0]) cylinder(wall_thickness*4, mount_diameter\/2+wall_thickness, mount_diameter\/2+wall_thickness);\n \/\/ endstop sensor mount\n #translate([-5,-endstop_screw1_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw1_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n #translate([-5,-endstop_screw2_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw2_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n }\n }\n}\n\nmodule motor_screw_connector() {\n difference() {\n translate([-motor_screw_cube_side\/2, -motor_screw_cube_side\/2, 0]) cube([motor_screw_cube_side, motor_screw_cube_side, motor_to_vent_distance]);\n cylinder(motor_ears_screw_length, motot_ears_hole_diameter\/2, motot_ears_hole_diameter\/2, $fn=20);\n }\n\n}","old_contents":"wall_thickness=2;\n\/\/ Piece that will be rotated\ndamper_arm_diameter=9;\ndamper_arm_cut_width=5.1;\ndamper_arm_depth=12;\n\/\/ stepper mount\nstepper_shaft_diameter=5.8;\nstepper_shaft_cut_width=3.5;\nstepper_shaft_depth=7;\n\/\/ Marker for closed position\nmarker_size=2;\nmarker_distance=9;\nmarker_height=5;\n\/\/ Connecting the two\nmount_length=1.2*(damper_arm_depth+stepper_shaft_depth);\nmount_diameter=max(damper_arm_diameter,stepper_shaft_diameter)+wall_thickness*2;\n\/\/ Pin offset degrees to achieve fully closed vent on button press\npin_degrees_offset=0;\n\n\/* \n * motor-to-damper adaptor\n**\/\ntranslate([0,0,-mount_length]) motor_to_damper_adaptor();\n\nmodule motor_to_damper_adaptor() {\n rotate([0,0,pin_degrees_offset]) button_pin();\n difference() {\n \/\/ main body\n cylinder(mount_length, mount_diameter\/2, mount_diameter\/2);\n \/\/ Stepper cutout\n translate([0,0,stepper_shaft_depth\/2]) mount_cutout(stepper_shaft_diameter\/2, stepper_shaft_cut_width, stepper_shaft_depth);\n \/\/ Damper cutout\n translate([0,0,mount_length-damper_arm_depth\/2]) mount_cutout(damper_arm_diameter\/2, damper_arm_cut_width, damper_arm_depth);\n }\n \n}\n\nmodule button_pin() {\n translate([mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n translate([-mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n}\n\n\/\/ Motor mount\nvent_diameter = 6*25.4; \/\/ 6\"\nshaft_offset=8;\nmotor_ears_distance=35;\nmotot_ears_hole_diameter=3.8;\nmotor_ears_screw_length=15;\nvent_mount_distance=55;\nvent_mount_hole_diameter=6;\nmotor_to_vent_distance=mount_length+4-wall_thickness*1.5; \/\/ 4mm distance between connector and motor body\nvent_ears_total_length=vent_mount_distance+vent_mount_hole_diameter+wall_thickness*2;\nvent_ears_total_width=mount_diameter+wall_thickness*4;\nmotor_screw_cube_side=motot_ears_hole_diameter+wall_thickness*2;\n\/*\n * mount bracket itself\n**\/\n\/\/motor_to_vent_mount();\n\n\/\/ endstop sensor\nendstop_screw_diameter=1.8;\nendstop_screw1_distance=16;\nendstop_screw1_offset=-1.5;\nendstop_screw2_distance=5;\nendstop_screw2_offset=20;\n\n\n\nmodule motor_to_vent_mount() {\n union() {\n \/\/ Vent ears\n vent_mount_plate();\n \/\/ motor mount\n translate([motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n translate([-motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n }\n}\n\nmodule damper_mount_cutout() {\n intersection() {\n cylinder(damper_arm_depth, damper_arm_diameter, damper_arm_diameter, center=true, $fn=40);\n cube([damper_arm_diameter*2, damper_arm_cut_width, damper_arm_depth], center=true);\n }\n}\n\nmodule mount_cutout(radius, width, depth) {\n intersection() {\n cylinder(depth, radius, radius, center=true, $fn=40);\n cube([radius*2, width, depth], center=true);\n }\n}\n\nmodule vent(length) {\n cylinder(length, vent_diameter\/2, vent_diameter\/2, $fn=100);\n}\n\nmodule vent_mount_plate() {\n endstop_sensor_space=max(endstop_screw1_distance,endstop_screw2_distance)+endstop_screw_diameter\/2+wall_thickness-(vent_ears_total_width\/2-mount_diameter\/2);\n \/\/ ^ distance to furthest hole ^ mounting holes w\/ walls ^ distance from original edge to shaft\n plate_total_width=vent_ears_total_width+motor_screw_cube_side\/2+shaft_offset-vent_ears_total_width\/2+(endstop_sensor_space) ;\n \/\/ ^ base width ^ extend for motor mount ^ accommodate endstop sensor\n translate([-vent_ears_total_length\/2,0,0]) rotate([0,90,0]) translate([-wall_thickness*1.5,0,0]) intersection() {\n translate([-wall_thickness*1.5, -vent_ears_total_width\/2-endstop_sensor_space, 0]) cube([wall_thickness*3, plate_total_width, vent_ears_total_length]);\n difference() {\n translate([-vent_diameter\/2, 0, 0]) cylinder(vent_ears_total_length, d=vent_diameter+wall_thickness*8);\n translate([-vent_diameter\/2, 0, 0]) vent(vent_ears_total_length);\n \/\/ Mount holes cutout\n translate([-wall_thickness*1.5,0,vent_mount_hole_diameter\/2+wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n translate([-wall_thickness*1.5,0,vent_ears_total_length-vent_mount_hole_diameter\/2-wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n \/\/ shaft cutout\n translate([-wall_thickness*1.5,0,vent_ears_total_length\/2]) rotate([0,90,0]) cylinder(wall_thickness*4, mount_diameter\/2+wall_thickness, mount_diameter\/2+wall_thickness);\n \/\/ endstop sensor mount\n #translate([-5,-endstop_screw1_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw1_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n #translate([-5,-endstop_screw2_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw2_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n }\n }\n}\n\nmodule motor_screw_connector() {\n difference() {\n translate([-motor_screw_cube_side\/2, -motor_screw_cube_side\/2, 0]) cube([motor_screw_cube_side, motor_screw_cube_side, motor_to_vent_distance]);\n cylinder(motor_ears_screw_length, motot_ears_hole_diameter\/2, motot_ears_hole_diameter\/2, $fn=20);\n }\n\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7ef89120f3c6d702f8de25f6508f55816797935b","subject":"adjust the icon","message":"adjust the icon\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/wider\/mario\/wider-mario-half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/samples\/wider\/mario\/wider-mario-half-circle-phone-stand.scad","new_contents":"\n\/* [Hidden] *\/\n\nuse <..\/..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = -1.0,\n base_yTranslate = -1.0,\n iconType = \"Mario\",\n iconColor = \"blue\",\n icon_xOffset = -8.7,\n icon_yOffset = 34,\n icon_zOffset = 21.0,\n iconXyScale = 1.0,\n bed_cutout_zLength = 10,\n height = 40,\n stand_connectorBar_xLength = 8,\n stand_top_xTranslate = 9.105,\n stand_top_yTranslate = 9.85);\n","old_contents":"\n\/* [Hidden] *\/\n\nuse <..\/..\/..\/half-circle-phone-stand.scad>\n \nhalfCirclePhoneStand(base_xTranslate = -1.0,\n base_yTranslate = -1.0,\n iconType = \"Mario\",\n iconColor = \"blue\",\n icon_xOffset = -9,\n icon_yOffset = 34,\n icon_zOffset = 19,\n bed_cutout_zLength = 10,\n height = 40,\n stand_connectorBar_xLength = 8,\n stand_top_xTranslate = 9.105,\n stand_top_yTranslate = 9.85);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a835d063bb85482968e13b350df5051449a44fcb","subject":"added color coding on assemblies","message":"added color coding on assemblies\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/walkerChassis.scad","new_file":"Drawings\/steel\/walkerChassis.scad","new_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) color([.2,.2,.8,1]) mainBar();\n #translate([0,0,a*(zBar+20)]) rotate([0,90*(a+1),0]) outerCap();\n}\nbasket();\n\nmodule basket() {\n for(a=[-1,1]) {\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,.6]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n \/\/color([.6,.8,0,1]) \n translate([loX*a,loY,0]) difference() { \n cube([2.5,2.5,230],center=true); \/\/ lower rails\n\n \/\/ remove center section for wide platform version\n cube([3,3,66],center=true);\n }\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([20*b,loY+2,70*a]) sphere(1);\n }\n }\n\n for(x=[-1,1]) {\n hull() { \/\/ inner back trap\n translate([x*35,loY+4,22*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*35,loY+2,31*a]) sphere(1);\n translate([x*Bx, 0 ,60*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n *hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n *for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n \/\/ may do something more complicated for payload bay,\n \/\/ but for now, just stich sides together\n translate([a*(Bx+2),2,0]) cube([3.8,3.8,140],center=true);\n\n translate([34*a,loY+6,0]) cube([2.5,2.5,138],center=true);\n translate([0,loY+3,67*a]) cube([70,3.8 ,3.8],center=true);\n }\n\n for(z=[-1,0,1]) translate([0,loY+3,34*z])\n cube([70,2.5,2.5],center=true);\n color([0,.2,.8,.2]) \/\/ expanded mesh floor\n translate([0,loY+5,0]) cube([68,.5,130],center=true);\n \/\/translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n \/\/ lower support\n for(x=[-1,1]) {\n \/\/ lower rail tubes\n translate([x*loX,loY,0]) cube([3.8,3.8,10],center=true);\n\n hull() { \/\/ diagonals\n translate([x*(loX+2),loY,0]) sphere(1);\n translate([x*(Bx-8),0,0]) sphere(1);\n }\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n}\n\nmodule outerCap() {\n for (b=[-1,1]) translate([Bx*b,0,-1]) {\n \/\/ axle brace sleves... shorter on outside\n cylinder(r=2.5,h=6 ,$fn=16,center=true);\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n for(x=[-1,1]) translate([x*loX,loY,1])\n cube([3.8,3.8,8],center=true); \/\/ lower rail sleves\n\n for (b=[-1,1]) hull() { \/\/ outside diagonal brace\n translate([loX*b,loY,0]) sphere(1);\n translate([ Bx*b, 0 ,0]) sphere(1);\n }\n hull() for(b=[-1,1]) translate([Bx*b,0,0]) sphere(1);\n}\n\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","old_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) mainBar();\n translate([0,0,a*(zBar+20)]) rotate([0,90*(a+1),0]) outerCap();\n}\nbasket();\n\nmodule basket() {\n for(a=[-1,1]) {\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,1]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n translate([loX*a,loY,0]) {\n color([0,0,1,1]) cube([2.5,2.5,230],center=true); \/\/ lower rails\n }\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ outer front diag\n translate([loX,loY,68*a]) sphere(1);\n translate([ Bx, 0 ,40*a]) sphere(1);\n }\n for(x=[-1,1]) {\n #hull() { \/\/ inner back trap\n translate([x*loX,loY,25*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*loX,loY,35*a]) sphere(1);\n translate([x*Bx , 0 ,60*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n *hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n *for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n \/\/ may do something more complicated for payload bay,\n \/\/ but for now, just stich sides together\n translate([a*(Bx+2),2,0]) cube([3.8,3.8,140],center=true);\n }\n\n \/\/ expanded mesh floor\n color([0,.2,.8,.2]) translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n \/\/ lower support\n for(x=[-1,1]) {\n \/\/ lower rail tubes\n translate([x*loX,loY,0]) cube([3.8,3.8,10],center=true);\n\n hull() { \/\/ diagonals\n translate([x*(loX+2),loY,0]) sphere(1);\n translate([x*(Bx-8),0,0]) sphere(1);\n }\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n}\n\nmodule outerCap() {\n for (b=[-1,1]) translate([Bx*b,0,-1]) {\n \/\/ axle brace sleves... shorter on outside\n cylinder(r=2.5,h=6 ,$fn=16,center=true);\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n for(x=[-1,1]) translate([x*loX,loY,1])\n cube([3.8,3.8,8],center=true); \/\/ lower rail sleves\n\n for (b=[-1,1]) hull() { \/\/ outside diagonal brace\n translate([loX*b,loY,0]) sphere(1);\n translate([ Bx*b, 0 ,0]) sphere(1);\n }\n hull() for(b=[-1,1]) translate([Bx*b,0,0]) sphere(1);\n}\n\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b92c061b35dba1afd3ea53f1065a1cee1fe6413b","subject":"Added license","message":"Added license\n","repos":"agupta231\/fractal_prints","old_file":"corner_cubes.scad","new_file":"corner_cubes.scad","new_contents":"init_cube_size = 50;\niteration_factor = 0.5;\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"36437f1625811d94dd0e2fffe4ba944ef7d18100","subject":"Update deksiriboza_2.scad","message":"Update deksiriboza_2.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/deksiriboza_2.scad","new_file":"3D-models\/SCAD\/deksiriboza_2.scad","new_contents":"z=9; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([0,-50,5])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([-28,-73,-1])cube ([20,45,11]);\n\ntranslate ([2,-80,1]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,z]);\ntranslate ([0,-50,5])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n\n","old_contents":"z=7; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([0,-50,3])cylinder(4.2,10,10);\ntranslate ([-7,0,0]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([-28,-73,-1])cube ([20,45,9]);\n\ntranslate ([2,-80,0]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,7]);\ntranslate ([0,-50,3])cylinder(4.2,10,10);\ntranslate ([-7,0,0]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"db182a34789df8a58daf8f1807fc3adc2c018535","subject":"Added BMP160 mount model","message":"Added BMP160 mount model\n","repos":"sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning","old_file":"3d-models\/pressure-sensor-mount\/bmp160-mount.scad","new_file":"3d-models\/pressure-sensor-mount\/bmp160-mount.scad","new_contents":"wall=2;\nsensor_height=4.5;\nsensor_sit_depth=6;\nsensor_width=11;\nhandle_size=20;\nwire_d=4;\n\ndifference() {\n shape_outline();\n \/\/ wire hole\n translate([0,0,-handle_size]) cylinder(h=100, d=wire_d, $fn=20);\n \/\/ sensor cavity\n translate([-sensor_width\/2,1-sensor_height\/2,wall+0.1]) cube([sensor_width, sensor_height, sensor_sit_depth]);\n}\n\n\nmodule shape_outline() {\n cylinder_d=sensor_width+wall*2;\n cone_multiplier = 1.2;\n union() {\n \/\/ Inside vent sensor screw-in\n cylinder(d2=cylinder_d, d1=cylinder_d*cone_multiplier, h=sensor_sit_depth+wall);\n \/\/ Outside handle body\n translate([0,0,-handle_size]) cylinder(d2=cylinder_d*cone_multiplier, d1=cylinder_d\/cone_multiplier, h=handle_size);\n \/\/ Twist grip\n translate([-cylinder_d*cone_multiplier\/2,-wall\/2,-handle_size]) cube([cylinder_d*cone_multiplier, wall, handle_size]);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec '3d-models\/pressure-sensor-mount\/bmp160-mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"be3e95086a2f3c1d94beb5aa90445cb39a916e20","subject":"tibia flange","message":"tibia flange\n\nfor better stability in wheel mode, and general stiffness\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"hardware\/mk1\/tibia.scad","new_file":"hardware\/mk1\/tibia.scad","new_contents":"\nmodule tibia(sl = 23, sw = 12.5){\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/leg\n\t\t\ttranslate([0,-1.5,0]) cube([40,3,4]);\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n\n\/\/ rounded tibia for rolling on :)\nmodule tibia2(sl = 23, sw = 12.5) {\n\twheelThickness = 6;\n\tor = 70;\n\tir = or - wheelThickness;\n\tflangeW = 12;\n\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\n\t\t\t\/\/ wheel section\n\t\t\ttranslate([-44, ir - 20,0]) {\n\t\t\t\t\/\/ main section\n\t\t\t\trotate([0,0,-80]) {\n\n\t\t\t\t\t\/\/ section\n\t\t\t\t\tsector3D(r=or, ir=ir, a=160, h=4, center = false, $fn=64);\n\n\t\t\t\t\t\/\/flange\n\t\t\t\t\tsector3D(r=or, ir=or-1, a=155, h=flangeW, center = false, $fn=64);\n\n\t\t\t\t\t\/\/ add rounded tips to the wheel section\n\t\t\t\t\tfor (i=[0,1])\n\t\t\t\t\t\trotate([0,0,i*160])\n\t\t\t\t\t\ttranslate([or - wheelThickness\/2,0,0])\n\t\t\t\t\t\tcylinder(r=3, h=4);\n\t\t\t\t}\n\n\t\t\t}\n\n\n\n\n\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n","old_contents":"\nmodule tibia(sl = 23, sw = 12.5){\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/leg\n\t\t\ttranslate([0,-1.5,0]) cube([40,3,4]);\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n\nmodule tibia2(sl = 23, sw = 12.5) {\n\twheelThickness = 6;\n\tor = 70;\n\tir = or - wheelThickness;\n\n\tdifference(){\n\t\t\/\/solid parts\n\t\tunion(){\n\t\t\thull(){\n\t\t\t\t\/\/main inner square\n\t\t\t\ttranslate([-30,-10,0]) cube([28,20,4]);\n\t\t\t\t\/\/lower taper\n\t\t\t\ttranslate([5,-1.5,0]) cube([2,3,4]);\n\t\t\t}\n\n\t\t\t\/\/top bar\n\t\t\ttranslate([-33,-7,0]) cube([6,14,4]);\n\t\t\t\/\/rounded corners\n\t\t\tfor (i = [ [-30,7,0],[-30,-7,0] ]){\n\t\t\t\ttranslate(i) cylinder(r=3,h=4,$fn=50);\n\t\t\t}\n\n\t\t\t\/\/ wheel section\n\t\t\ttranslate([-44, ir - 20,0])\n\t\t\trotate([0,0,-80]) {\n\n\t\t\t\t\/\/ section\n\t\t\t\tsector3D(r=or, ir=ir, a=160, h=4, center = false, $fn=64);\n\n\t\t\t\t\/\/ add rounded tips to the wheel section\n\t\t\t\tfor (i=[0,1])\n\t\t\t\t\trotate([0,0,i*160])\n\t\t\t\t\ttranslate([or - wheelThickness\/2,0,0])\n\t\t\t\t\tcylinder(r=3, h=4);\n\t\t\t}\n\n\n\n\n\t\t}\n\t\t\/\/servo mounts\n\t\tfor (i = [ [-3,0,-2],[-31,0,-2] ]){\n\t\t\ttranslate(i) cylinder(r=1,h=20,$fn=20);\n\t\t}\n\t\t\/\/hole for servo body\n\t\ttranslate([-17,0,2]) cube([sl,sw,22], center=true);\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f2d412645f9559c5d73b1b98df0aa7cb548d3efa","subject":"Hinge module (w\/o integral pin) first pass","message":"Hinge module (w\/o integral pin) first pass\n","repos":"kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot","old_file":"Prototype-UR2\/assets\/3d\/pin-hinge.scad","new_file":"Prototype-UR2\/assets\/3d\/pin-hinge.scad","new_contents":" \nfunction debugprint(s) = search(s, []);\n\nmodule chamfered_cube(dims, chamfer) {\n w=dims[0]; l=dims[1]; h=dims[2];\n linear_extrude(height=h,twist=0,center=true) {\n offset(r=chamfer) {\n square([w-chamfer*2,l-chamfer*2], center=true);\n }\n }\n}\n\nmodule pin_hinge(h, radius, pin_radius=1.5, fingers=3) {\n gap=0.75;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n $fn=30;\n difference() {\n translate([0,0,unit_h\/2]) union() {\n for(i=[0:fingers-1]) {\n \/\/ the hinge 'finger' cylinder\n translate([0,0, gap*i+i*unit_h]) cylinder(r=radius, h=unit_h, center=true);\n \/\/ the lug for each 'finger'\n if (i%2>0) {\n translate([radius,radius*0.5-gap,gap*i+i*unit_h]) {\n #chamfered_cube([radius, radius*1.5, unit_h], 1);\n }\n } else {\n translate([-radius,radius*0.5-gap,gap*i+i*unit_h]) {\n #chamfered_cube([radius, radius*1.5, unit_h], 1);\n }\n }\n }\n }\n union() {\n chamfer = pin_radius+1;\n \/\/ the hole for the pin\n translate([0,0, h\/2]) #cylinder(r=pin_radius, h=h, center=true);\n \/\/ chamfer the pin hole at each end\n translate([0,0,pin_radius\/2]) #cylinder(r1=chamfer, r2=pin_radius, h=pin_radius, center=true);\n translate([0,0,h-pin_radius\/2]) #cylinder(r1=pin_radius, r2=chamfer, h=pin_radius, center=true);\n }\n }\n difference() {\n \/\/ the wall we attach the hinge lugs to\n translate([0,radius*0.5,h\/2]) cube([radius*4-gap*2,radius,h], center=true);\n translate([0,0,h\/2]) cylinder(r=radius+gap,h=h, center=true);\n }\n\n}\n\nmodule horizontal_pin_with_5_fingers(length, radius=3, pin_r=1) {\n translate([0,-length\/2,3]) rotate([-90,0,0]) pin_hinge(length, radius, pin_r, 5);\n}\n\n\/\/ horizontal_pin_with_5_fingers(25);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Prototype-UR2\/assets\/3d\/pin-hinge.scad' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"a9835576ff3f895eefaff20b0ce4994fe0208e4c","subject":"metric-screw: add thread param","message":"metric-screw: add thread param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=1.25, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut=nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut=nut, tolerance=1.25, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2c8c5aab105401a9b445634a3d0b73e058a276a5","subject":"yaxis\/motormount add print module","message":"yaxis\/motormount add print module\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-motor-mount.scad","new_file":"y-axis-motor-mount.scad","new_contents":"include \ninclude \n\nuse \ninclude \ninclude \ninclude \n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nyaxis_motor_pulley_h = 17.5*mm;\nyaxis_motor_mount_bearing_clamp_offset_z = yaxis_motor_pulley_h;\n\nmodule yaxis_motor_mount_bearing_clamp(align=[0,0,0])\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n fncylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/ cutout for belt path\n fncylindera(d=bearing_d, h=height*2, orient=[0,0,1], align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n fncylindera(h=height, d=3*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %fncylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=[0,0,1]);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=[1,0,0], align=[0,0,0])\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=[0,0,1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n fncylindera(d=ymotor_round_d, h=height*2, orient=[0,0,1], align=[0,0,0]);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness\/2, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,8*mm])\n %pulley_2GT2_20T();\n\n }\n }\n}\n\nmodule print_yaxis_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[1,0,0]])\n {\n yaxis_motor_mount(show_motor=false);\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","old_contents":"include \ninclude \n\nuse \ninclude \ninclude \ninclude \n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nyaxis_motor_pulley_h = 17.5*mm;\nyaxis_motor_mount_bearing_clamp_offset_z = yaxis_motor_pulley_h;\n\nmodule yaxis_motor_mount_bearing_clamp(align=[0,0,0])\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n fncylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/ cutout for belt path\n fncylindera(d=bearing_d, h=height*2, orient=[0,0,1], align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n fncylindera(h=height, d=3*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %fncylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=[0,0,1]);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=[1,0,0], align=[0,0,0])\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=[0,0,1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n fncylindera(d=ymotor_round_d, h=height*2, orient=[0,0,1], align=[0,0,0]);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rotate([90,90,0])\n Right_Angled_Triangle(a=ymotor_w+ymotor_mount_thickness\/2, b=main_lower_dist_z+extrusion_size+yaxis_motor_offset_z, height=ymotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n fncylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,8*mm])\n %pulley_2GT2_20T();\n\n }\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9fa7aef41e936d0c139e8a3127e4550c60d74dab","subject":"xaxis\/carriage: fix extruder b mount knurl nut screw cut","message":"xaxis\/carriage: fix extruder b mount knurl nut screw cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b1f4bc0ccffaee102c037d796df444c8686d2eb0","subject":"Clean up parameters, units, etc.","message":"Clean up parameters, units, etc.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\/\/ fishbox.scad\r\n\/\/ - Enclosure design for zebrafish Skinner box\r\n\/\/ \r\n\/\/ Author: Mark Liffiton\r\n\/\/ Date: Oct, 2014\r\n\/\/\r\n\/\/ Units are mm\r\n\r\n\/\/ Set thickness to account for thickness of material\r\n\/\/ PLUS needed clearance for cuts into which material should fit.\r\nthickness = 3;\r\n\r\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\r\nwidth = 400; \/\/ x\r\ndepth = 300; \/\/ y\r\nheight = 180; \/\/ z\r\n\r\n\/\/ tank base plate\r\nbase_width = 80;\r\nbase_height = 10;\r\n\r\n\/\/ light bar\r\nlight_bar_width = 20;\r\nlight_pos_x = thickness+base_width-light_bar_width;\r\nlight_height = height-10;\r\n\r\n\/\/ height of side supports\r\n\/\/side_support_height = height\/2; \/\/ full side walls\r\nside_support_height = 20;\r\n\r\n\/\/ amount faces extend past each other at corners\r\noverhang = 10;\r\n\r\n\/\/ amount horizontal support bars extend past side supports\r\noutset = overhang\/2;\r\n\r\n\/\/ components to include (comment out unwanted)\r\nvert_faces();\r\nside_supports();\r\ntank_base();\r\nlight_bar();\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ Module definitions\r\n\/\/\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=width);\r\n\t\t}\r\n\t\tside_support_base(height_scale=0.5);\r\n\t\tside_support_top(height_scale=0.5);\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,-overhang,0])\r\n\t\tcube([thickness,depth+overhang*2,height]);\r\n}\r\n\r\nmodule tank_base() {\r\n\ttranslate([thickness,-outset,base_height])\r\n\tdifference() {\r\n\t\tcube([base_width, depth+outset*2, thickness]);\r\n\t\tcutouts(3,base_width,outset,far_side=false);\r\n cutouts(3,base_width,outset,far_side=true);\r\n\t}\r\n}\r\n\r\nmodule light_bar() {\r\n\ttranslate([light_pos_x,-outset,light_height])\r\n\tdifference() {\r\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\r\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\r\n cutouts(2,light_bar_width,outset,far_side=true);\r\n\t}\r\n}\r\n\r\nmodule cutouts(num, width, outset, far_side=False) {\r\n w = width \/ ((num-1) * 2);\r\n y = far_side ? depth+outset-thickness\/2 : 0;\r\n for (i = [0 : num-1]) {\r\n translate([-w\/2 + i*2*w,y,0])\r\n cube([w, outset+thickness\/2, thickness]);\r\n }\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tside_support_base();\r\n\t\t\tside_support_top();\r\n\t\t}\r\n\t\tvert_faces();\r\n\t\ttank_base();\r\n light_bar();\r\n\t}\r\n}\r\n\r\nmodule side_support_top(height_scale=1) {\r\n\ttranslate([0,0,height])\r\n side_support_base(height_scale=-height_scale);\r\n}\r\n\r\nmodule side_support_base(height_scale=1) {\r\n\tscale([1,1,height_scale])\r\n\t\tunion() {\r\n\t\t\tside_support(y=0);\r\n\t\t\tside_support(y=depth);\r\n\t\t}\r\n}\r\n\r\nmodule side_support(y) {\r\n\ttranslate([-overhang,y-thickness\/2,0])\r\n\t\tcube([width+overhang*2, thickness, side_support_height]);\r\n}\r\n","old_contents":"\r\n\/\/ Set thickness to account for thickness of material\r\n\/\/ PLUS needed clearance for cuts into which material should fit.\r\nthickness = 0.25;\r\n\r\nwidth = 20; \/\/ x\r\ndepth = 20; \/\/ y\r\nheight = 10; \/\/ z\r\n\r\n\/\/ width and height of tank base plate\r\nbase_width = width\/5;\r\nbase_height = 1;\r\nlight_bar_width = 1;\r\nlight_height = height-1;\r\n\r\n\/\/ height of side supports\r\n\/\/side_support_height = height\/2; \/\/ full side walls\r\nside_support_height = 2;\r\n\r\n\/\/ amount faces extend past each other at corners\r\noverhang = 1;\r\n\r\n\/\/ components to include (comment out unwanted)\r\nvert_faces();\r\nside_supports();\r\ntank_base();\r\nlight_bar();\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ Module definitions\r\n\/\/\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=width);\r\n\t\t}\r\n\t\tside_support_base(height_scale=0.5);\r\n\t\tside_support_top(height_scale=0.5);\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,0,0])\r\n\t\tcube([thickness,depth,height]);\r\n}\r\n\r\nmodule tank_base() {\r\n\ttranslate([thickness,0,base_height])\r\n\tdifference() {\r\n\t\tcube([base_width, depth, thickness]);\r\n\t\tcutouts(3,base_width);\r\n\t\ttranslate([0,depth-overhang-thickness\/2,0])\r\n\t\t\tcutouts(3,base_width);\r\n\t}\r\n}\r\n\r\nmodule light_bar() {\r\n\ttranslate([thickness+base_width-light_bar_width,0,light_height])\r\n\tdifference() {\r\n\t\tcube([light_bar_width, depth, thickness]);\r\n\t\tcutouts(2,light_bar_width);\r\n\t\ttranslate([0,depth-overhang-thickness\/2,0])\r\n\t\t\tcutouts(2,light_bar_width);\r\n\t}\r\n}\r\n\r\nmodule cutouts(num, width) {\r\n w = width \/ ((num-1) * 2);\r\n for (i = [0 : num-1]) {\r\n translate([-w\/2 + i*2*w,0,0])\r\n cube([w, overhang+thickness\/2, thickness]);\r\n }\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tside_support_base();\r\n\t\t\tside_support_top();\r\n\t\t}\r\n\t\tvert_faces();\r\n\t\ttank_base();\r\n light_bar();\r\n\t}\r\n}\r\n\r\nmodule side_support_top(height_scale=1) {\r\n\ttranslate([0,0,height])\r\n\tside_support_base(height_scale=-height_scale);\r\n}\r\n\r\nmodule side_support_base(height_scale=1) {\r\n\tscale([1,1,height_scale])\r\n\t\tunion() {\r\n\t\t\tside_support(y=overhang);\r\n\t\t\tside_support(y=depth-overhang);\r\n\t\t}\r\n}\r\n\r\nmodule side_support(y) {\r\n\ttranslate([-overhang,y-thickness\/2,0])\r\n\t\tcube([width+overhang*2, thickness, side_support_height]);\r\n}\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f8ed2180b6c9fdfaf0a2724f010819ea44d71757","subject":"model for different vitamines bottles","message":"model for different vitamines bottles\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"vitamines_box\/vitamines_box.scad","new_file":"vitamines_box\/vitamines_box.scad","new_contents":"$fs=0.1;\n$fa=3;\n\nspace = 2*5; \/\/ extra space added to actual bottle size\nwall = 3; \/\/ wall thickness\nheight = 20+wall; \/\/ height of a whole thing\n\nmodule tran()\n{\n hull()\n for(dx=[-1:+1])\n translate([dx*(75-40)\/2, 0, 0])\n cylinder(r=(40+space)\/2, h=height);\n}\n\nmodule large_bottle()\n{\n cylinder(r=(35+space)\/2, h=height);\n}\n\nmodule small_bottle()\n{\n cylinder(r=(25+space)\/2, h=height);\n}\n\n\ndifference()\n{\n cx=2*(75+space)+3*wall;\n cy=40+space+3*wall + 35+space\/2+2*wall;\n cube([cx, cy, height]);\n translate([0, 0, wall])\n {\n for(dx=[cx\/4, cx*3\/4])\n translate([dx, cy-(40+space)\/2-wall, 0])\n tran();\n translate([(35+space)\/2+wall, (35+space)\/2+wall, 0])\n large_bottle();\n for(dx=[0:2])\n translate([35+space+2*wall + (25+space)\/2 + 7 + dx*(25+space+wall), (40+space)\/2, 0])\n small_bottle();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vitamines_box\/vitamines_box.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"89768789c6678a9ac4e63f371231a5ac5db6c0bc","subject":"Link bumper thickness to dw","message":"Link bumper thickness to dw\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"module Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = dw;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0,1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0,0,90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\t}\n\n\t\/\/ Microswitch plates\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\tMicroSwitchPlate();\n\t\n}\n\n\nmodule MicroSwitchPlate()\n{\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Pin section\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0,0,dw])\n\t\tmirror([0,0,1])\n\t\t\tpinhole(fixed=true);\n\t}\n}","old_contents":"module Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = 2;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0,1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0,0,90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\t}\n\n\t\/\/ Microswitch plates\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\tMicroSwitchPlate();\n\t\n}\n\n\nmodule MicroSwitchPlate()\n{\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Pin section\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0,0,dw])\n\t\tmirror([0,0,1])\n\t\t\tpinhole(fixed=true);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d78d2118fb01a24072284357813b9152b5a67c07","subject":"Add groud station 3D","message":"Add groud station 3D\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/ground_station.scad","new_file":"Hardware\/ground_station.scad","new_contents":"\/\/rotate([90,0,0]) union(){\n\/\/\trotate_extrude(convexity = 10)\n\/\/\ttranslate([6, 0, 0])\n\/\/\tcircle(r = 1);\n\/\/}\nrotate([90,0,0]) union(){\n\tlinear_extrude(height = 2, center = false, convexity = 10, twist = 360, $fn = 100)\n\ttranslate([6, 0, 0])\n\tscale([1,1,1]) circle(r=1);\n}\nrotate([90,0,0])\nminkowski(){\nrotate([0,0,90]) translate([6,0,0]) sphere(r=1);\nrotate([0,0,70]) translate([6,0,0]) sphere(r=1);\n}\n\nwinch();\ntranslate([480, 0,0]) rotate([0, 0, 180]) winch();\ntranslate([480\/2,0,-40\/2-20\/2]) cube(size=[480+100, 300,20], center=true);\nmodule pulley(){\n\tdifference(){\n\tcylinder(r=6, h =10, center= true);\n\tcylinder(r=5, h =11, center= true);\n\t\n\t}\n\tdifference(){\n\tcylinder(r=15, h =10, center= true);\n\tcylinder(r=7.5, h =11, center= true);\n\t\n\t}\n}\n\nmodule winch(){\n\trotate([90, 0,0]) union(){\n\t\ttranslate([0,0, 50])\n\t\tunion(){\n\t\t\tpulley();\n\t\t\tpulley_support();\n\t\t}\n\t\ttranslate([0,0, -50])\n\t\tunion(){\n\t\t\tpulley();\n\t\t\tpulley_support();\n\t\t}\n\t\ttranslate([0,0,0]) cylinder(r=5, h=150, center=true);\n\t\n\t}\n}\n\nmodule pulley_support(){\ndifference(){\ntranslate([25, 0,0]) cube(size=[100, 40,10], center=true);\ncylinder(r=16, h =11, center= true);\ntranslate([-15,0,0]) cube(size=[25,12,11], center=true);\n}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/ground_station.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e1151e8c0339673eae815f901a46c840b7b12cd9","subject":"adapted block","message":"adapted block\n\nextrusiuon heigth 13, and pipe module added\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"block\/block.scad","new_file":"block\/block.scad","new_contents":"$fn=50;\nmodule side_flat() {\n difference() {\n square([37,34]);\n for(i=[3.5,37-3.5])translate([i,3.5])circle(r=3\/2);\n translate([37-3.5,11.5])circle(r=8\/2);\n translate([0,7])square([7,50]);\n translate([18,25.5])circle(r=7);\n translate([5,25.5])square([37,34]);\n translate([17,18.5])square([37,34]);\n }\n}\nmodule side_ext() {\n difference() {\n translate([0,16])rotate(a=[90,0,0])difference() {\n linear_extrude(height=13)side_flat();\n for(i=[3.5,37-3.5])translate([i,3.5,2])cylinder(r=5.4\/2,h=16);\n }\n translate([21.5,11])pipe();\n }\n}\nmodule pipe() {\n \n cylinder(r=3,$fn=9,h=2);\n translate([0,0,2])cylinder(r=3,$fn=6,h=6);\n translate([0,0,8])cylinder(r2=1,r1=1.75,h=4);\n translate([0,0,11])cylinder(r=1,h=8);\n}\nside_ext();","old_contents":"$fn=50;\nmodule side_flat() {\n difference() {\n square([37,34]);\n for(i=[3.5,37-3.5])translate([i,3.5])circle(r=3\/2);\n translate([37-3.5,11.5])circle(r=8\/2);\n translate([0,7])square([7,50]);\n translate([18,25.5])circle(r=7);\n translate([5,25.5])square([37,34]);\n translate([17,18.5])square([37,34]);\n }\n}\nmodule side_ext() {\n difference() {\n translate([0,16])rotate(a=[90,0,0])difference() {\n linear_extrude(height=16)side_flat();\n for(i=[3.5,37-3.5])translate([i,3.5,2])cylinder(r=5.4\/2,h=16);\n }\n translate([21.5,11])cylinder(r=2,h=30);\n }\n}\n\nside_ext();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"f23a8c3aa98d426227ee5be668e3177adebe9c09","subject":"Line up batteries inside battery pack (slightly cheating)","message":"Line up batteries inside battery pack (slightly cheating)\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/BatteryPack.scad","new_file":"hardware\/vitamins\/BatteryPack.scad","new_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\neta = 0.01;\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\n\/\/ Battery len, Battery dia, Pack width, Pack depth, Pack height, Linear?, Batteries, Name \nBatteryPack_AA_4_SQ = [ 50.5, 14.5, 31.4, 27.5, 57.4, 0, , 4, \"AA\" ];\n\n\/\/ Default:\nBatteryPack_AA = BatteryPack_AA_4_SQ;\n\n\/\/ Constants for access:\nBatteryPack_Const_BLen = 0;\nBatteryPack_Const_BDia = 1;\nBatteryPack_Const_PWidth = 2;\nBatteryPack_Const_PDepth = 3;\nBatteryPack_Const_PHeight = 4;\nBatteryPack_Const_Linear = 5;\nBatteryPack_Const_Count = 6;\nBatteryPack_Const_Name = 7;\n\n\/\/ Connectors:\nfunction BatteryPack_Con_Centre(BP) = [\n [\n BP[BatteryPack_Const_PWidth]\/2 + BP[BatteryPack_Const_BDia]\/2,\n BP[BatteryPack_Const_PDepth]\/2 + BP[BatteryPack_Const_BDia]\/2,\n BP[BatteryPack_Const_PHeight]\/2, \n ],\n [ 0,0,0 ],\n 0, 0, 0\n];\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n\n}\n\nmodule battery_pack_linear(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n if(i % 2 == 1) {\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery(BP);\n } else {\n battery(BP);\n }\n }\n}\n\nmodule battery_pack_double(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n BatteryPack_height = BP[BatteryPack_Const_PHeight];\n\n translate([0,0,(BatteryPack_height-Battery_len)\/2])\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery(BP);\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery(BP);\n }\n}\n\n\/\/ NB, This completely ignores battery count\/linear setting! 2x2 is what you get!\nmodule BatteryPack(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n BatteryPack_height = BP[BatteryPack_Const_PHeight];\n BatteryPack_width = BP[BatteryPack_Const_PWidth];\n BatteryPack_depth = BP[BatteryPack_Const_PDepth];\n\n \/\/ Actually measured, it overhangs by 2mm, 1 because this is actually\n \/\/ a radius -- how far is the center-line of the battery offset from the edge\n \/\/ of the case (in the y direction).\n battery_depth_offset = Battery_dia\/2 - 1;\n\n render()\n translate([-Battery_dia\/2, -Battery_dia\/2,0])\n difference() {\n linear_extrude(height=BatteryPack_height)\n hull() {\n \/\/ Main body\n translate([Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n }\n\n \/\/ Subtract battery shapes\n translate([Battery_dia\/2-eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n \n\n translate([BatteryPack_width-Battery_dia\/2+eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([Battery_dia\/2-eta, BatteryPack_depth-battery_depth_offset+eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2+eta,BatteryPack_depth-battery_depth_offset+eta,(BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([BatteryPack_width\/4,-BatteryPack_depth+6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n translate([BatteryPack_width\/4,BatteryPack_depth-6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n\n }\n}\n\n\n*battery_pack_linear(BatteryPack_AA, 2,4);\n*battery_pack_double(BatteryPack_AA, 2, 4);\n*battery(BatteryPack_AA);\nBatteryPack(BatteryPack_AA);\n\n","old_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\neta = 0.01;\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\n\/\/ Battery len, Battery dia, Pack width, Pack depth, Pack height, Linear?, Batteries, Name \nBatteryPack_AA_4_SQ = [ 50.5, 14.5, 31.4, 27.5, 57.4, 0, , 4, \"AA\" ];\n\n\/\/ Default:\nBatteryPack_AA = BatteryPack_AA_4_SQ;\n\n\/\/ Constants for access:\nBatteryPack_Const_BLen = 0;\nBatteryPack_Const_BDia = 1;\nBatteryPack_Const_PWidth = 2;\nBatteryPack_Const_PDepth = 3;\nBatteryPack_Const_PHeight = 4;\nBatteryPack_Const_Linear = 5;\nBatteryPack_Const_Count = 6;\nBatteryPack_Const_Name = 7;\n\n\/\/ Connectors:\nfunction BatteryPack_Con_Centre(BP) = [\n [\n BP[BatteryPack_Const_PWidth]\/2 + BP[BatteryPack_Const_BDia]\/2,\n BP[BatteryPack_Const_PDepth]\/2 + BP[BatteryPack_Const_BDia]\/2,\n BP[BatteryPack_Const_PHeight]\/2, \n ],\n [ 0,0,0 ],\n 0, 0, 0\n];\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n\n}\n\nmodule battery_pack_linear(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n if(i % 2 == 1) {\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery(BP);\n } else {\n battery(BP);\n }\n }\n}\n\nmodule battery_pack_double(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery(BP);\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery(BP);\n }\n}\n\n\/\/ NB, This completely ignores battery count\/linear setting! 2x2 is what you get!\nmodule BatteryPack(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n BatteryPack_height = BP[BatteryPack_Const_PHeight];\n BatteryPack_width = BP[BatteryPack_Const_PWidth];\n BatteryPack_depth = BP[BatteryPack_Const_PDepth];\n\n \/\/ Actually measured, it overhangs by 2mm, 1 because this is actually\n \/\/ a radius -- how far is the center-line of the battery offset from the edge\n \/\/ of the case (in the y direction).\n battery_depth_offset = Battery_dia\/2 - 1;\n\n render()\n translate([-Battery_dia\/2, -Battery_dia\/2,0])\n difference() {\n linear_extrude(height=BatteryPack_height)\n hull() {\n \/\/ Main body\n translate([Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n }\n\n \/\/ Subtract battery shapes\n translate([Battery_dia\/2-eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n \n\n translate([BatteryPack_width-Battery_dia\/2+eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([Battery_dia\/2-eta, BatteryPack_depth-battery_depth_offset+eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2+eta,BatteryPack_depth-battery_depth_offset+eta,(BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([BatteryPack_width\/4,-BatteryPack_depth+6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n translate([BatteryPack_width\/4,BatteryPack_depth-6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n\n }\n}\n\n\n*battery_pack_linear(BatteryPack_AA, 2,4);\n*battery_pack_double(BatteryPack_AA, 2, 4);\n*battery(BatteryPack_AA);\nBatteryPack(BatteryPack_AA);\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"97f58af081f54f6160c328fef3b1ad9421e732f7","subject":"more details on hinges, plans for bushing at axle","message":"more details on hinges, plans for bushing at axle\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.4);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2.2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.9])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.3]) rotate([180,0,0]) F698();\n translate([0,0,2.24]) F698();\n translate([0,0,6.74]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) sphere(.8);\n translate([FGleft-1,FGperp-1,z]) sphere(.8);\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) sphere(.8);\n translate([12,11,-.3]) sphere(.8);\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) sphere(.8);\n translate([14,13.5,-.3]) sphere(.8);\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) sphere(.8);\n translate([FGleft+1,FGperp-1,-.3]) sphere(.8);\n }\n hull() {\n translate([FG-10,0,0]) sphere(.8);\n translate([FGleft+1,FGperp-1,5.2]) sphere(.8);\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) sphere(.8);\n translate([FGleft,0,-.3]) sphere(.8);\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) sphere(.8);\n translate([35, 0,0]) sphere(.8);\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-110,0,0]) cylinder(r=.8,h=14.4);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=1,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .36]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.36]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-6,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,.7,-1.6]) sphere(.8);\n translate([BH-9,.7, 6.2]) sphere(.8); \n }\n hull() {\n translate([ 4,-.7, 6.2]) sphere(.8);\n translate([BH-9,-.7,-1.6]) sphere(.8); \n }\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.4);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.2]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2.2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.9])cube([3,3,2.8],center=true);\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.3]) hull() {\n translate([ 3 , 1 ,z]) sphere(.8);\n translate([FGleft-1,FGperp-1,z]) sphere(.8);\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) sphere(.8);\n translate([12,11,-.3]) sphere(.8);\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) sphere(.8);\n translate([14,13.5,-.3]) sphere(.8);\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) sphere(.8);\n translate([FGleft+1,FGperp-1,-.3]) sphere(.8);\n }\n hull() {\n translate([FG-10,0,0]) sphere(.8);\n translate([FGleft+1,FGperp-1,5.8]) sphere(.8);\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.7]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) sphere(.8);\n translate([FGleft,0,-.3]) sphere(.8);\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) sphere(.8);\n translate([35, 0,0]) sphere(.8);\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) cylinder(r=1.4,h=7.2,$fn=36); \/\/ axle\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=1,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .36]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.36]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,2*2.54\/2]) difference() {\n cylinder(r=2.54\/2,h=2.54*3,$fn=36,center=true);\n cylinder(r=2.54\/2-.3,h=9,$fn=36,center=true);\n }\n translate([0,0,6.22]) F698();\n translate([0,0,-1.14]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() {\n translate([0,0,2.4]) cylinder(r=1.4,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([4,4,7.9],center=true);\n }\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-3,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,0.5,-2.4]) sphere(.8);\n translate([BH-5,1, 6 ]) sphere(.8); \n }\n hull() {\n translate([ 4,-.5, 7]) sphere(.8);\n translate([BH-5, -1, -2 ]) sphere(.8); \n }\n\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"30a03354dc83b2f467f114187bd123769199e94b","subject":"New iterations","message":"New iterations\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/bar_mount_reduced.scad","new_file":"Hardware\/bar_mount_reduced.scad","new_contents":"tube_diameter = 28;\nmargin = 1 ;\nthickness\t =1;\nwidth = 15;\nbeam_size = 10;\nbeam_thickness = 5;\n\n\nclip_width=10;\ndifference(){\nunion(){\nunion(){\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin, h = width, center=true);\ntranslate([0, 0, beam_thickness]) cube(size=[beam_size+2*thickness, width, tube_diameter+2*thickness], center = true);\n}\n\ntranslate([0, width\/2-(width-clip_width)\/4, 0]) hull(){\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin+1, h = (width-clip_width)\/2, center=true);\ntranslate([0, 0, beam_thickness+1]) cube(size=[beam_size+2*thickness, (width-clip_width)\/2, tube_diameter+2*thickness], center = true);\n}\ntranslate([0, -width\/2+(width-clip_width)\/4, 0]) hull(){\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin+1, h = (width-clip_width)\/2, center=true);\ntranslate([0, 0, beam_thickness+1]) cube(size=[beam_size+2*thickness, (width-clip_width)\/2, tube_diameter+2*thickness], center = true);\n}\n}\ntranslate([0, 0, tube_diameter\/2+thickness*2+beam_thickness\/2+1]) cube(size=[beam_size, 2*width, beam_thickness+2], center = true);\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+margin, h = 2*width, center=true);\ntranslate([0, 0, -tube_diameter*5\/8]) cube(size=[2*tube_diameter, 2*width, tube_diameter*2], center=true);\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/bar_mount_reduced.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"efc963ae38c90f5cf8b44c05f9d97d79afeb4ddf","subject":"Correct rear panel","message":"Correct rear panel\n","repos":"DanNixon\/Multirotors,DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/BubbleCopter","old_file":"TFT_FPV_station\/components.scad","new_file":"TFT_FPV_station\/components.scad","new_contents":"use \n\ndisplay_dxf = \"..\/Kanako\/Displays\/eBay_7inch_TFT.dxf\";\nrx_dxf = \"..\/Kanako\/Modules\/RC832_5.8ghz_video_RX.dxf\";\n\nmodule DisplayCutout()\n{\n projection()\n DXFImport(display_dxf, subtraction_layers=[\"TFT_Cutout\"]);\n}\n\nmodule DisplayMountingHoles()\n{\n projection()\n DXFImport(display_dxf, subtraction_layers=[\"TFT_MountingHoles\"]);\n}\n\nmodule RX()\n{\n projection()\n DXFImport(rx_dxf, subtraction_layers=[\"RX_Cutouts\"]);\n}\n\nmodule RX_MountingHoles()\n{\n hole_diam = 3.5;\n\n translate([-40, 20]) circle(d=hole_diam);\n translate([-40, -20]) circle(d=hole_diam);\n translate([ 40, 20]) circle(d=hole_diam);\n translate([ 40, -20]) circle(d=hole_diam);\n translate([ 15, -50]) circle(d=hole_diam);\n translate([-15, -50]) circle(d=hole_diam);\n}\n","old_contents":"use \n\ndisplay_dxf = \"..\/Kanako\/Displays\/eBay_7inch_TFT.dxf\";\nrx_dxf = \"..\/Kanako\/Modules\/RC832_5.8ghz_video_RX.dxf\";\n\nmodule DisplayCutout()\n{\n projection()\n DXFImport(display_dxf, subtraction_layers=[\"TFT_Cutout\"]);\n}\n\nmodule DisplayMountingHoles()\n{\n projection()\n DXFImport(display_dxf, subtraction_layers=[\"TFT_MountingHoles\"]);\n}\n\nmodule RX()\n{\n projection()\n DXFImport(rx_dxf, subtraction_layers=[\"RX_Cutouts\", \"RX_Case\"]);\n}\n\nmodule RX_MountingHoles()\n{\n hole_diam = 3.5;\n\n translate([-40, 20]) circle(d=hole_diam);\n translate([-40, -20]) circle(d=hole_diam);\n translate([ 40, 20]) circle(d=hole_diam);\n translate([ 40, -20]) circle(d=hole_diam);\n translate([ 15, -50]) circle(d=hole_diam);\n translate([-15, -50]) circle(d=hole_diam);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"18b7c588fb2cdc12e2444239520e8c4967f59906","subject":"ring created","message":"ring created\n\n2d and 3d\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library.scad","new_file":"library.scad","new_contents":"\/\/2D\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\n\/\/3D\nmodule ring(r=5,d=1,h=2) {\n\tdifference() {\n\t\tcylinder(r=r,h=h);\n\t\tcylinder(r=r-d,h=h);\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'library.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"508a9c1a13df043f7f3c1a0085d33f4c5839b992","subject":"Tidy up and simplify some positioning","message":"Tidy up and simplify some positioning\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 8;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 5;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate([0, 0, wrapAngle\/2])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate([0, 0, -wrapAngle\/2])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0]) \n\trotate([0, 0, microSwitchAngle]) {\n\n\t\t\/\/ Springy bits\n\t\ttranslate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Rear support lozenge with pin hole\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0, 0, dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n","old_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate([0, 0, wrapAngle\/2])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate([0, 0, -wrapAngle\/2])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0, 1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0, 0, 90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0, 1])\n\t\tmirror([i, 0, 0])\n\t\trotate([0, 0, microSwitchAngle])\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\n\t\/\/ Microswitch plates\n\tfor(i=[0, 1])\n\t\tmirror([i, 0, 0])\n\t\trotate([0, 0, microSwitchAngle])\n\t\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\t\tMicroSwitchPlate();\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Rear support lozenge with pin hole\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0, 0, dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2264434354db3a14bf4e2cf51cd0a47b82bf415d","subject":"Added Malcolm's motor.scad file to the repo","message":"Added Malcolm's motor.scad file to the repo\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/motor.scad","new_file":"hardware\/vitamins\/motor.scad","new_contents":"motor_shaft_r=5;\r\nmotor_shaft_h=8;\r\nmotor_flange_h = 1;\r\nmotor_flange_r = 9.20;\r\nMotor_body_r = 28.00;\r\nMotor_body_h = 19.30;\r\n\r\n\t\/\/\/rotate object around to Y access\r\n\trotate([90,0,0]){\r\n\t\/\/ shaft\r\n\t\tcolor(\"grey\")\r\n\tcylinder(r=motor_shaft_r, h=motor_shaft_h, center=true);\r\n\t\t\/\/flange\r\n\t\ttranslate([0,0,motor_shaft_h\/2]) \r\n\t\t\tcolor(\"yellow\")\r\n\t\t\tcylinder(r=motor_flange_r, h=motor_flange_h, center=true);\r\n\t\t\t\/\/ Main Body\r\n\t\t\t\ttranslate([0,-15,14])\/\/\/don't understand this \r\n\t\t\t\t\tcolor(\"silver\")\r\n\t\t\tcylinder(r=Motor_body_r, h=Motor_body_h, center=true);\r\n\t\t\t\t\/\/Flanges\r\n\t\t\t\t\ttranslate([35,-15,4.5]){\/\/\/don't understand this \r\n\t\t\t\t\t\r\n\t\t\t\t\tcylinder(r=7, h=1);\r\n\t\t\t\t\t\t\ttranslate([-14,-7,0]){\r\n\t\t\t\t\t\t\t\tcube([14.5,14,1]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\tcolor(\"white\")\r\n\t\t\t\t\tcylinder(r=4, h=1);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\ttranslate([-35,-15,4.5]){\/\/\/don't understand this \r\n\t\t\t\t\t\r\n\t\t\t\t\tcylinder(r=7, h=1);\r\n\t\t\t\t\t\ttranslate([0,-7,0]){\r\n\t\t\t\t\t\t\t\tcube([14.5,14,1]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tcolor(\"white\")\r\n\t\t\t\t\tcylinder(r=4, h=1);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t \/\/bottom\r\n\t\t\t\tcolor(\"blue\")\r\n\t\t\t\t translate([0-7,-46,4]) \r\n\t\t\t\t\t cube([14.5,5.5,Motor_body_h]); \r\n\r\n}\r\n ","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/vitamins\/motor.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"cb5a17c77e1e5c940d6903a5ea1503a6bff12851","subject":"fixed external padding","message":"fixed external padding\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tape_connector\/tape_connector.scad","new_file":"tape_connector\/tape_connector.scad","new_contents":"count=2;\n\nmodule tusk(h, l)\n{\n translate([l,0,0])\n rotate([0,0,90])\n polyhedron(\n points=[\n [0, 0, 0], \/\/ 0\n [h, 0, 0], \/\/ 1\n [h\/2, 0, h], \/\/ 2\n [0, l, 0], \/\/ 3\n [h, l, 0], \/\/ 4\n [h\/2, l, h] \/\/ 5\n ],\n faces=[\n [0,2,1],\n [0,1,4],\n [4,3,0],\n [1,2,5],\n [5,4,1],\n [0,5,2],\n [3,5,0],\n [3,4,5]\n ]\n );\n}\n\nmodule side()\n{\n w =20; \/\/ width\n tc=8; \/\/ Tusks Count\n th=5; \/\/ Tusk Height\n ph=3; \/\/ Platform Height\n l =tc*1.5*th-0.5*th; \/\/ length\n \/\/ tusks:\n for(dy = [0:tc-1])\n translate([0, dy*1.5*th, ph])\n tusk(h=th, l=w);\n \/\/ base and mount\n phi=4; \/\/ diameter for screw\n pad=3; \/\/ padding around each hole\n ext=phi+pad; \/\/ external element size\n difference()\n {\n union()\n {\n translate([-ext,0,0])\n cube([w+2*ext, l, ph]);\n }\n \/\/ screw mounts\n for(dx = [-phi\/2, w+phi\/2])\n for(dy = [0, (tc-2)*th*1.5-th*1.5])\n translate([dx, dy+1.5*th-th\/4, -ph])\n hull()\n for(offy = [0, th*1.5])\n translate([0,offy,0])\n cylinder(h=ph*3, r=phi\/2, $fs=1);\n }\n}\n\n\nfor(i = [0:count-1])\n translate([i*35,0,0])\n side();\n\n%translate([20, 4, 15])\n% rotate([0,180,0])\n% side();\n","old_contents":"count=2;\n\nmodule tusk(h, l)\n{\n translate([l,0,0])\n rotate([0,0,90])\n polyhedron(\n points=[\n [0, 0, 0], \/\/ 0\n [h, 0, 0], \/\/ 1\n [h\/2, 0, h], \/\/ 2\n [0, l, 0], \/\/ 3\n [h, l, 0], \/\/ 4\n [h\/2, l, h] \/\/ 5\n ],\n faces=[\n [0,2,1],\n [0,1,4],\n [4,3,0],\n [1,2,5],\n [5,4,1],\n [0,5,2],\n [3,5,0],\n [3,4,5]\n ]\n );\n}\n\nmodule side()\n{\n w =20; \/\/ width\n tc=8; \/\/ Tusks Count\n th=5; \/\/ Tusk Height\n ph=3; \/\/ Platform Height\n l =tc*1.5*th-0.5*th; \/\/ length\n \/\/ tusks:\n for(dy = [0:tc-1])\n translate([0, dy*1.5*th, ph])\n tusk(h=th, l=w);\n \/\/ base and mount\n phi=4; \/\/ diameter for screw\n pad=3; \/\/ padding around each hole\n ext=phi\/2+pad; \/\/ external element size\n difference()\n {\n union()\n {\n translate([-ext,0,0])\n cube([w+2*ext, l, ph]);\n }\n \/\/ screw mounts\n for(dx = [-phi\/2, w+phi\/2])\n for(dy = [0, (tc-2)*th*1.5-th*1.5])\n translate([dx, dy+1.5*th-th\/4, -ph])\n hull()\n for(offy = [0, th*1.5])\n translate([0,offy,0])\n cylinder(h=ph*3, r=phi\/2, $fs=1);\n }\n}\n\n\nfor(i = [0:count-1])\n translate([i*35,0,0])\n side();\n\n%translate([20, 4, 15])\n% rotate([0,180,0])\n% side();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c203a661f675e3153015990ca781345d9be56512","subject":"TrooperDoorLockBushing.scad: attempt to compensate for thin wall thickness problem","message":"TrooperDoorLockBushing.scad: attempt to compensate for thin wall thickness problem\n","repos":"tschutter\/printrbot","old_file":"things\/TrooperDoorLockBushing.scad","new_file":"things\/TrooperDoorLockBushing.scad","new_contents":"\/\/ Door lock bushing for unlock rod on a 1993 Isuzu Trooper.\n\n\/\/ http:\/\/www.vehicross.info\/modules.php?name=Content&file=viewarticle&id=22\n\/\/ The manufacturer name for the part is \"Holder; Rod, Door\".\n\/\/ The part number for right door is 8-97037-508-0.\n\/\/ The part number for left door is 8-97037-509-0.\n\n\/\/ The original version had notches at the end of the cylinder to\n\/\/ allow it to flex in to put in the hole, and flex out to insert\n\/\/ the rod. But the cylinder wall thickness is so thin that it\n\/\/ would break when flexing.\n\n\/\/ number of faces on each cylinder\n$fn=36;\n\ndifference() {\n union() {\n \/\/ base\n cylinder(h=2, r=5);\n translate([5, 0, 1]) {\n cube([8, 10, 2], center=true);\n }\n translate([8, 0, 0]) {\n cylinder(h=2, r=5);\n }\n\n \/\/ cylinder\n cylinder(h=16, r=3.7);\n }\n\n \/\/ through hole\n cylinder(h=20, r=2.75);\n\n \/\/ notches in base for ziptie\n translate([7, 5, 1]) {\n cube([4, 4, 4], center=true);\n }\n translate([7, -5, 1]) {\n cube([4, 4, 4], center=true);\n }\n}\n","old_contents":"\/\/ Door lock bushing for unlock rod on a 1993 Isuzu Trooper.\n\n\/\/ need to verify dimensions!\n\n\/\/ http:\/\/www.vehicross.info\/modules.php?name=Content&file=viewarticle&id=22\n\/\/ The manufacturer name for the part is \"Holder; Rod, Door\".\n\/\/ The part number for right door is 8-97037-508-0.\n\/\/ The part number for left door is 8-97037-509-0.\n\n\/\/ number of faces on each cylinder\n$fn=36;\n\ndifference() {\n union() {\n \/\/ base\n cylinder(h=2, r=5);\n translate([5, 0, 1]) {\n cube([10, 10, 2], center=true);\n }\n translate([10, 0, 0]) {\n cylinder(h=2, r=5);\n }\n\n \/\/ cylinder\n cylinder(h=17, r=3.7);\n\n \/\/ swell\n translate([0, 0, 14.1]) {\n sphere(r=4.0);\n }\n }\n\n \/\/ through hole\n cylinder(h=10.5, r=2.75);\n translate([0, 0, 10]) {\n cylinder(h=4, r=2.5);\n }\n translate([0, 0, 13]) {\n cylinder(h=4, r=2.75);\n }\n\n \/\/ hole through base for ziptie\n translate([10, 0, 0]) {\n cylinder(h=3, r=2.7);\n }\n\n \/\/ E\/W notch\n translate([-5, -0.4, 11]) {\n cube([10, 0.8, 7]);\n }\n\n \/\/ N\/S notch\n translate([-0.4, -5, 11]) {\n cube([0.8, 10, 7]);\n }\n\n \/\/ chop top\n translate([0, 0, 16]) {\n cylinder(h=10, r=10);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"778fb6b3c9dbec79be0a39c59a63c0cbbb1b686e","subject":"added cart to big screw","message":"added cart to big screw\n","repos":"fponticelli\/smallbridges","old_file":"resin\/big_screw.scad","new_file":"resin\/big_screw.scad","new_contents":"include \n\ncart_position = 300;\n\nmodule big_screw() {\n len = 650;\n r1 = 5;\n r2 = 6;\n\n r3 = 14;\n r4 = 24;\n h1 = 15;\n h2 = 5;\n\n w = 40;\n\n cw = 200;\n\n color(Stainless) {\n rotate([-90,0,0]) {\n cylinder(len, r1, r1);\n translate([0, 0, 10])\n cylinder(len - 25, r2, r2);\n translate([0, 0, cart_position - h1 - h2]) {\n difference() {\n union() {\n cylinder(h1, r3, r3);\n translate([0, 0, h1])\n cylinder(h2, r4, r4);\n }\n translate([w\/2,-cw\/2,0])\n cube([cw,cw,cw]);\n translate([-w\/2-cw,-cw\/2,0])\n cube([cw,cw,cw]);\n }\n }\n }\n }\n}","old_contents":"include \n\nmodule big_screw() {\n len = 650;\n r1 = 5;\n r2 = 6;\n color(Stainless)\n rotate([-90,0,0]) {\n cylinder(len, r1, r1);\n translate([0, 0, 10])\n cylinder(len - 25, r2, r2);\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"de7d0ae2c56798ccf262114c4c395be0a2696aa7","subject":"Started on a StealthShell","message":"Started on a StealthShell\n\n\u2026didn\u2019t get very far\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/StealthShell.scad","new_file":"hardware\/sandbox\/StealthShell.scad","new_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\nStealthShell_STL();\n\n\n\n\nmodule StealthShell_STL() {\n\tprintedPart(\"printedparts\/StealthShell.scad\", \"Stealth Shell\", \"StealthShell_STL()\") {\n\t view(t=[-2, 6, 14], r=[63, 0, 26], d=726);\n\n color([Level2PlasticColor[0], Level2PlasticColor[1], Level2PlasticColor[2], 1])\n if (UseSTL) {\n import(str(STLPath, \"StealthShell.stl\"));\n } else {\n\t\t\t\tStealthShell_Model();\n }\n }\n}\n\n\nmodule StealthShell_Model() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\t*rotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tpolygon(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\/\/ twist lock\n\t\t\t\tShell_TwistLock();\n\t\t\t}\n\t\t}\n}\n\n\n\/*\n\n Shell API Functions\n\n To help build loads of funky shells... with twist-lock fitting\n\n*\/\n\nShell_NotchOuterWidth = 20;\nShell_NotchSlope = 2;\nShell_NotchInnerWidth = Shell_NotchOuterWidth - 2* Shell_NotchSlope;\nShell_NotchDepth = 5;\nShell_NotchTol = 1;\nShell_NotchStop = dw;\nShell_NotchRotation = 2 * atan2(Shell_NotchOuterWidth\/2 - Shell_NotchStop\/2, BaseDiameter\/2);\n\n\/\/ 2D shape to be removed from the base to support shell twist-lock\nmodule Shell_TwistLockCutouts() {\n a = Shell_NotchOuterWidth + 2*Shell_NotchTol;\n b = Shell_NotchInnerWidth + 2*Shell_NotchTol;\n h = Shell_NotchDepth + Shell_NotchTol;\n aOffset = Shell_NotchSlope;\n\n for (i=[0,1])\n rotate([0,0, i*180 + Shell_NotchRotation\/2])\n translate([BaseDiameter\/2 - h\/2 + eta, 0, 0])\n rotate([0,0, 90])\n trapezoid(b, a, h, aOffset, center=true);\n}\n\n\/\/ 3D twist-lock ring to mate a shell to the base\nmodule Shell_TwistLock() {\n a = Shell_NotchOuterWidth;\n b = Shell_NotchInnerWidth;\n h = Shell_NotchDepth;\n aOffset = Shell_NotchSlope;\n\n union() {\n \/\/ Locking tabs\n for (i=[0,1])\n translate([0,0,-dw])\n difference() {\n \/\/ create the basic tab shape\n linear_extrude(dw)\n hull() {\n \/\/ Locking tab\n rotate([0,0, i*180 - Shell_NotchRotation\/2])\n translate([BaseDiameter\/2 - h\/2 + eta, 0, 0])\n rotate([0,0, 90])\n trapezoid(b, a, h, aOffset, center=true);\n\n \/\/ linking piece to connect locking tab to outer ring\n translate([0,0,0])\n rotate([0,0, i*180 - Shell_NotchRotation])\n donutSector(or=BaseDiameter\/2 + Shell_NotchTol + dw,\n ir=BaseDiameter\/2,\n a=Shell_NotchRotation\n );\n }\n\n \/\/ now chop out a slight slope to allow for a tight friction fit\n rotate([0,0, i*180 - Shell_NotchRotation\/2])\n translate([BaseDiameter\/2 - h - 3, 0, dw * 0.8])\n rotate([5,0,0])\n translate([0,-a\/2-1,0])\n cube([10, a + 2,10]);\n }\n\n\n \/\/ notch stops\n for (i=[0,1])\n rotate([0,0, i*180 - Shell_NotchRotation\/2 + 0.3])\n translate([BaseDiameter\/2 - h\/2 + 1+eta, a\/2 - Shell_NotchStop\/2 - 0.5\/2, -dw])\n rotate([0,0, 90])\n linear_extrude(dw*2)\n trapezoid(Shell_NotchStop-aOffset+0.7, Shell_NotchStop+1.3, h+2, 0, center=true);\n\n \/\/ outer ring\n translate([0,0,-dw])\n rotate_extrude()\n translate([BaseDiameter\/2 + Shell_NotchTol, 0])\n union() {\n square([dw, 3*dw]);\n\n translate([eta, 3*dw - Shell_NotchTol, 0])\n mirror([1,1,0])\n rightTriangle(dw, dw, center = true);\n\n translate([-dw+eta, 3*dw - Shell_NotchTol - eta,0])\n square([dw, Shell_NotchTol+eta]);\n }\n\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/sandbox\/StealthShell.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"936c363c58c31cb6f2afab0cc61c841d69823c3a","subject":"body:bottom shoulder","message":"body:bottom shoulder\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nHEIGHT_TOP = 2 * BORDER_RADIUS_BODY;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n diameter_base = DIAMETER_BODY - HEIGHT_TOP;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n position_ring = [0,0,top_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n position_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{\n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_TOP);\n \n position = [0,0,main_position_z()];\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\nmodule bottom_shoulder()\n{\n position_ring = [0,0,main_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n posision_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(posision_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n}\nmodule body()\n{ \n top_surface();\n top_shoulder();\n main_cylinder();\n bottom_shoulder();\n \n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nHEIGHT_TOP = 2 * BORDER_RADIUS_BODY;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n diameter_base = DIAMETER_BODY - HEIGHT_TOP;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n position_ring = [0,0,top_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n position_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{\n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_TOP);\n \n position = [0,0,main_position_z()];\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\n\nmodule body()\n{ \n top_surface();\n top_shoulder();\n main_cylinder();\n \n \n\/\/Body bottom shoulder\ntranslate([0,0,main_position_z()])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b2d80901d910f4e99535644b75cba3e399a1c945","subject":"Show body by default","message":"Show body by default\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"$fn=100;\n\nbutton_radius = 49;\nhole_radius = 14.5;\ntable_padding = 40;\nextra_padding = 2;\nbottom_padding = 30;\n\nwall_thickness = 3;\n\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\nfont = \"monaco.dxf\";\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/\/ difference() {\n\/\/ translate([0, 0, mount_depth-wall_thickness])\n\/\/ cover();\n\/\/ cover_screws();\n\/\/ project();\n\/\/ }\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"$fn=100;\n\nbutton_radius = 49;\nhole_radius = 14.5;\ntable_padding = 40;\nextra_padding = 2;\nbottom_padding = 30;\n\nwall_thickness = 3;\n\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\nfont = \"monaco.dxf\";\n\n\/\/ Body\n\/\/ union() {\n\/\/ difference() {\n\/\/ bottom();\n\/\/ name();\n\/\/ }\n \n\/\/ difference() {\n\/\/ sides();\n\/\/ cover_screws();\n\/\/ mount_screws();\n\/\/ }\n\/\/ }\n\n\/\/ Cover\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n project();\n}\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9a0add1cab24a2df5c6468b3fe03855c1640769d","subject":"shorter holder for Lis :)","message":"shorter holder for Lis :)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"include \n\n\/*\n * configuration\n *\/\nnames = [\"LIS\"];\nbrushes_count = len(names);\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10-25])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100-25]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5-25])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5-25])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,45])\n rotate([-90, -90, 0])\n scale([2,1,1])\n write(names[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"include \n\n\/*\n * configuration\n *\/\nnames = [\"JOHN\", \"JANE\", \"BILLY\"];\nbrushes_count = len(names);\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,55])\n rotate([-90, 90, 0])\n scale([2,1,1])\n write(names[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"49cd3fc5d9782966e8f24c44ee0f2afb847bd64a","subject":"bearings: Add orient param","message":"bearings: Add orient param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"bearings.scad","new_file":"bearings.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f2bfbeb8a9d70117358dd321422f651f7accc73a","subject":"Updated white space","message":"Updated white space\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n \n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children(); \n }\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness = \",thickness,\", \\n \n points = \",points,\", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\", \\n\n cutouts = \",cutouts,\", \\n\n flat_adjust = \",flat_adjust,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\", \\n\n cutouts = \",cutouts,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"6223c0486a0c559cf0109b4d26f0669c51bfdb6b","subject":"x\/carriage\/hotend_clamp: minor fix","message":"x\/carriage\/hotend_clamp: minor fix\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n\n ty(-hotend_clamp_offset)\n tz(hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[1], hotend_d_h[1][0], hotend_clamp_height], align=Y);\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2+.1])\n rcubea([hotend_clamp_w[1], 1000, hotend_clamp_height+.2], align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part);\n hotend_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n\n ty(-hotend_clamp_offset)\n tz(hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n rcubea([hotend_clamp_w[1], hotend_d_h[1][0], hotend_clamp_height], align=Y);\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n ty(-hotend_clamp_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotend_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n translate([0, -hotend_clamp_offset-extruder_b_filapath_offset[1], 0])\n translate([0, 0, 0-hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2+.1])\n rcubea([hotend_clamp_w[1], 1000, hotend_clamp_height+.2], align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part);\n hotend_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7744e0b997bd3fee7f5040fbab9b460f04f1368e","subject":"3D test cube reowrked so that it is easy to parametrize + all the letters are now truely at the center of the cube","message":"3D test cube reowrked so that it is easy to parametrize + all the letters are now truely at the center of the cube\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/3d_cube.scad","new_file":"3d_cube\/3d_cube.scad","new_contents":"eps=0.01;\ndepth=2;\nside = 20;\nsize = side*[1,1,1];\nfont_size = 15;\n\ndifference()\n{\n cube(size);\n translate([size[0]\/2, depth, size[2]\/2])\n rotate([90,0,0])\n linear_extrude(height=depth+eps)\n text(\"X\", size=font_size, valign=\"center\", halign=\"center\");\n translate([-eps, size[1]\/2, size[2]\/2])\n rotate([90,0,90])\n linear_extrude(height=depth+eps)\n text(\"Y\", size=font_size, valign=\"center\", halign=\"center\");\n translate([size[0]\/2, size[1]\/2, size[2]-depth])\n #linear_extrude(height=depth+eps)\n text(\"Z\", size=font_size, valign=\"center\", halign=\"center\");\n}\n","old_contents":"d=2;\n\ndifference()\n{\n cube([20, 20, 20]);\n translate([d\/2,d,d\/2])\n rotate([90,0,0])\n linear_extrude(height=d)\n text(\"X\", size=20-d);\n rotate([0,0,90])\n translate([d\/2,0,d\/2])\n rotate([90,0,0])\n linear_extrude(height=d)\n text(\"Y\", size=20-d);\n translate([d,d,20-d])\n linear_extrude(height=d)\n text(\"Z\", size=20-d);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b61e03520ae27327e36f78faa2c2cd9d77659be9","subject":"removed default rotation","message":"removed default rotation\n","repos":"fponticelli\/smallbridges","old_file":"scad\/or_gantry_plate.scad","new_file":"scad\/or_gantry_plate.scad","new_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nor_gantry_plate_height=3.175;\r\n\r\nd71 = 7.1;\r\nd52 = 5.2;\r\n\r\ni100 = 10;\r\ni200 = 20;\r\ni223 = 22.3;\r\ni263 = 26.3;\r\ni300 = 30;\r\ni323 = 32.3;\r\ni350 = 35;\r\ni400 = 40;\r\ni423 = 42.3;\r\ni523 = 52.3;\r\ni550 = 55;\r\ni623 = 62.3;\r\n\r\nor_gantry_plate_holes = [\r\n\t[],\r\n\t[\r\n\t\t\/\/ 80x80\r\n\t\t[[-i223,0],d71],[[-i223,i223],d71],[[-i223,-i223],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i223,0],d52],[[i223,i223],d52],[[i223,-i223],d52],[[0,i223],d52],[[0,-i223],d52]\r\n\t], [\r\n\t\t\/\/ 100x120\r\n\t\t[[-i323,0],d71],\r\n\t\t[[-i223,i423],d71],[[-i323,i423],d71],[[-i223,-i423],d71],[[-i323,-i423],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,i100],d52],[[i200,-i100],d52],[[-i200,i100],d52],[[-i200,-i100],d52],\r\n\t\t[[i100,i200],d52],[[i100,-i200],d52],[[-i100,i200],d52],[[-i100,-i200],d52],\r\n\t\t[[i100,i300],d52],[[i100,-i300],d52],[[-i100,i300],d52],[[-i100,-i300],d52],\r\n\t\t[[i323,0],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[0,i423],d52],[[0,-i423],d52],[[i100,i423],d52],[[i100,-i423],d52],[[-i100,i423],d52],[[-i100,-i423],d52],\r\n\t\t[[i223,i423],d52],[[i323,i423],d52],[[i223,-i423],d52],[[i323,-i423],d52]\r\n\t], [\r\n\t\t\/\/ 120x140\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,0],d52],[[i300,0],d52],[[-i200,0],d52],[[-i300,0],d52],\r\n\t\t[[0,i200],d52],[[0,i300],d52],[[0,-i200],d52],[[0,-i300],d52],\r\n\t\t[[i200,i300],d52],[[i200,-i300],d52],[[-i200,i300],d52],[[-i200,-i300],d52],\r\n\t\t[[i300,i200],d52],[[i300,-i200],d52],[[-i300,i200],d52],[[-i300,-i200],d52],\r\n\r\n\t\t[[i400,0],d52],[[i423,i100],d52],[[i423,-i100],d52],\r\n\t\t[[i400,i263],d52],[[i400,-i263],d52],\r\n\r\n\t\t[[-i400,0],d71],[[-i423,i100],d52],[[-i423,-i100],d52],\r\n\t\t[[-i400,i263],d71],[[-i400,-i263],d71],\r\n\t\t[[0,i523],d52],[[i100,i523],d52],[[i223,i523],d52],[[i323,i523],d52],[[i423,i523],d52],\r\n\t\t[[0,-i523],d52],[[i100,-i523],d52],[[i223,-i523],d52],[[i323,-i523],d52],[[i423,-i523],d52],\r\n\t\t[[0,i523],d52],[[-i100,i523],d52],[[-i223,i523],d71],[[-i323,i523],d71],[[-i423,i523],d71],\r\n\t\t[[0,-i523],d52],[[-i100,-i523],d52],[[-i223,-i523],d71],[[-i323,-i523],d71],[[-i423,-i523],d71]\r\n\t], [\r\n\t\t\/\/ 140x160\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i300,0],d52],[[0,i300],d52],[[-i300,0],d52],[[0,-i300],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[i100,i400],d52],[[i100,-i400],d52],[[-i100,i400],d52],[[-i100,-i400],d52],\r\n\t\t[[i300,i400],d52],[[i300,-i400],d52],[[-i300,i400],d52],[[-i300,-i400],d52],\r\n\t\t[[i400,i300],d52],[[i400,-i300],d52],[[-i400,i300],d52],[[-i400,-i300],d52],\r\n\t\t[[i100,i550],d52],[[i100,-i550],d52],[[-i100,i550],d52],[[-i100,-i550],d52],\r\n\t\t[[i523,0],d52],[[-i523,0],d71],\r\n\t\t[[i523,i350],d52],[[-i523,i350],d71],[[i523,-i350],d52],[[-i523,-i350],d71],\r\n\t\t[[0,i623],d52],[[i100,i623],d52],[[i223,i623],d52],[[i323,i623],d52],[[i423,i623],d52],[[i523,i623],d52],[[-i100,i623],d52],[[-i223,i623],d71],[[-i323,i623],d71],[[-i423,i623],d71],[[-i523,i623],d71],\r\n\t\t[[0,-i623],d52],[[i100,-i623],d52],[[i223,-i623],d52],[[i323,-i623],d52],[[i423,-i623],d52],[[i523,-i623],d52],[[-i100,-i623],d52],[[-i223,-i623],d71],[[-i323,-i623],d71],[[-i423,-i623],d71],[[-i523,-i623],d71]\r\n\t]\r\n];\r\n\r\nmodule or_gantry_plate(mod = 1) {\r\n\t$fn=50;\r\n\tr=10;\r\n\tw=80;\r\n\th=80;\r\n\tsizes=[[-1,-1],[80,80],[100,120],[120,140],[140,160]];\r\n\tmw = sizes[mod][0];\r\n\tmh = sizes[mod][1];\r\n\r\n\tbom(str(\"ORGP_\",mod), str(\"OpenRail Gantry Plate: \", mw, \"x\", mh, \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack)\r\n\t\tdifference() {\r\n\t\t\thull()\r\n\t\t\t\tfor(x = [-1,1], y = [-1,1])\r\n\t\t\t\t\ttranslate([x*(mw\/2-10),y*(mh\/2-10),-or_gantry_plate_height\/2])\r\n\t\t\t\t\t\tcylinder(r=r,h=or_gantry_plate_height);\r\n\t\t\ttranslate([0,0,-or_gantry_plate_height]) {\r\n\t\t\t\tfor(p = or_gantry_plate_holes[mod])\r\n\t\t\t\t\ttranslate (p[0])\r\n\t\t\t\t\t\tcylinder(r=p[1]\/2,h=or_gantry_plate_height*2);\r\n\t\t\t}\r\n\t\t}\r\n}","old_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nor_gantry_plate_height=3.175;\r\n\r\nd71 = 7.1;\r\nd52 = 5.2;\r\n\r\ni100 = 10;\r\ni200 = 20;\r\ni223 = 22.3;\r\ni263 = 26.3;\r\ni300 = 30;\r\ni323 = 32.3;\r\ni350 = 35;\r\ni400 = 40;\r\ni423 = 42.3;\r\ni523 = 52.3;\r\ni550 = 55;\r\ni623 = 62.3;\r\n\r\nor_gantry_plate_holes = [\r\n\t[],\r\n\t[\r\n\t\t\/\/ 80x80\r\n\t\t[[-i223,0],d71],[[-i223,i223],d71],[[-i223,-i223],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i223,0],d52],[[i223,i223],d52],[[i223,-i223],d52],[[0,i223],d52],[[0,-i223],d52]\r\n\t], [\r\n\t\t\/\/ 100x120\r\n\t\t[[-i323,0],d71],\r\n\t\t[[-i223,i423],d71],[[-i323,i423],d71],[[-i223,-i423],d71],[[-i323,-i423],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,i100],d52],[[i200,-i100],d52],[[-i200,i100],d52],[[-i200,-i100],d52],\r\n\t\t[[i100,i200],d52],[[i100,-i200],d52],[[-i100,i200],d52],[[-i100,-i200],d52],\r\n\t\t[[i100,i300],d52],[[i100,-i300],d52],[[-i100,i300],d52],[[-i100,-i300],d52],\r\n\t\t[[i323,0],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[0,i423],d52],[[0,-i423],d52],[[i100,i423],d52],[[i100,-i423],d52],[[-i100,i423],d52],[[-i100,-i423],d52],\r\n\t\t[[i223,i423],d52],[[i323,i423],d52],[[i223,-i423],d52],[[i323,-i423],d52]\r\n\t], [\r\n\t\t\/\/ 120x140\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,0],d52],[[i300,0],d52],[[-i200,0],d52],[[-i300,0],d52],\r\n\t\t[[0,i200],d52],[[0,i300],d52],[[0,-i200],d52],[[0,-i300],d52],\r\n\t\t[[i200,i300],d52],[[i200,-i300],d52],[[-i200,i300],d52],[[-i200,-i300],d52],\r\n\t\t[[i300,i200],d52],[[i300,-i200],d52],[[-i300,i200],d52],[[-i300,-i200],d52],\r\n\r\n\t\t[[i400,0],d52],[[i423,i100],d52],[[i423,-i100],d52],\r\n\t\t[[i400,i263],d52],[[i400,-i263],d52],\r\n\r\n\t\t[[-i400,0],d71],[[-i423,i100],d52],[[-i423,-i100],d52],\r\n\t\t[[-i400,i263],d71],[[-i400,-i263],d71],\r\n\t\t[[0,i523],d52],[[i100,i523],d52],[[i223,i523],d52],[[i323,i523],d52],[[i423,i523],d52],\r\n\t\t[[0,-i523],d52],[[i100,-i523],d52],[[i223,-i523],d52],[[i323,-i523],d52],[[i423,-i523],d52],\r\n\t\t[[0,i523],d52],[[-i100,i523],d52],[[-i223,i523],d71],[[-i323,i523],d71],[[-i423,i523],d71],\r\n\t\t[[0,-i523],d52],[[-i100,-i523],d52],[[-i223,-i523],d71],[[-i323,-i523],d71],[[-i423,-i523],d71]\r\n\t], [\r\n\t\t\/\/ 140x160\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i300,0],d52],[[0,i300],d52],[[-i300,0],d52],[[0,-i300],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[i100,i400],d52],[[i100,-i400],d52],[[-i100,i400],d52],[[-i100,-i400],d52],\r\n\t\t[[i300,i400],d52],[[i300,-i400],d52],[[-i300,i400],d52],[[-i300,-i400],d52],\r\n\t\t[[i400,i300],d52],[[i400,-i300],d52],[[-i400,i300],d52],[[-i400,-i300],d52],\r\n\t\t[[i100,i550],d52],[[i100,-i550],d52],[[-i100,i550],d52],[[-i100,-i550],d52],\r\n\t\t[[i523,0],d52],[[-i523,0],d71],\r\n\t\t[[i523,i350],d52],[[-i523,i350],d71],[[i523,-i350],d52],[[-i523,-i350],d71],\r\n\t\t[[0,i623],d52],[[i100,i623],d52],[[i223,i623],d52],[[i323,i623],d52],[[i423,i623],d52],[[i523,i623],d52],[[-i100,i623],d52],[[-i223,i623],d71],[[-i323,i623],d71],[[-i423,i623],d71],[[-i523,i623],d71],\r\n\t\t[[0,-i623],d52],[[i100,-i623],d52],[[i223,-i623],d52],[[i323,-i623],d52],[[i423,-i623],d52],[[i523,-i623],d52],[[-i100,-i623],d52],[[-i223,-i623],d71],[[-i323,-i623],d71],[[-i423,-i623],d71],[[-i523,-i623],d71]\r\n\t]\r\n];\r\n\r\nmodule or_gantry_plate(mod = 1) {\r\n\t$fn=50;\r\n\tr=10;\r\n\tw=80;\r\n\th=80;\r\n\tsizes=[[-1,-1],[80,80],[100,120],[120,140],[140,160]];\r\n\tmw = sizes[mod][0];\r\n\tmh = sizes[mod][1];\r\n\r\n\tbom(str(\"ORGP_\",mod), str(\"OpenRail Gantry Plate: \", mw, \"x\", mh, \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack)\r\n\t\trotate([0,0,90]) difference() {\r\n\t\t\thull()\r\n\t\t\t\tfor(x = [-1,1], y = [-1,1])\r\n\t\t\t\t\ttranslate([x*(mw\/2-10),y*(mh\/2-10),-or_gantry_plate_height\/2])\r\n\t\t\t\t\t\tcylinder(r=r,h=or_gantry_plate_height);\r\n\t\t\ttranslate([0,0,-or_gantry_plate_height]) {\r\n\t\t\t\tfor(p = or_gantry_plate_holes[mod])\r\n\t\t\t\t\ttranslate (p[0])\r\n\t\t\t\t\t\tcylinder(r=p[1]\/2,h=or_gantry_plate_height*2);\r\n\t\t\t}\r\n\t\t}\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"58fa7f46c79a8fe2f872855525ca7c44256f8779","subject":"fixup! lots of initial work on main printer","message":"fixup! lots of initial work on main printer\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n gantry_lower();\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2),0,zaxis_motor_offset_z])\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n\n}\n\nmodule extrusion(h, w, l) {\n rotate([90, 0, 90]) {\n translate([2.5, 2.5, 0]) cube([h - 5, w - 5, l]);\n translate([0, 0, 0.1]) cube([h, w, l - 0.2]);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([extrusion_size,extrusion_size,main_height], align=[0,i,1]);\n\n translate([0, 0, main_height]) \n cubea([main_upper_width,extrusion_size,extrusion_size], align=[0,0,1]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n cubea([main_width,extrusion_size,extrusion_size], align=[0,i,-1]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([main_depth,extrusion_size,extrusion_size], align=[0,i,-1]);\n}\n","old_contents":"use ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n gantry_lower();\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2),0,zaxis_motor_offset_z])\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n\n}\n\nmodule extrusion(h, w, l) {\n rotate([90, 0, 90]) {\n translate([2.5, 2.5, 0]) cube([h - 5, w - 5, l]);\n translate([0, 0, 0.1]) cube([h, w, l - 0.2]);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n #cubea([extrusion_size,extrusion_size,main_height], align=[0,i,1]);\n\n translate([0, 0, main_height]) \n cubea([main_upper_width,extrusion_size,extrusion_size], align=[0,0,1]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n cubea([main_width,extrusion_size,extrusion_size], align=[0,i,-1]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([main_depth,extrusion_size,extrusion_size], align=[0,i,-1]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f7938392e61795908634b17fcfc575c59ca36364","subject":"Improve yellow bin fillet for large nozzles","message":"Improve yellow bin fillet for large nozzles\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"yellow-bins\/bin.scad","new_file":"yellow-bins\/bin.scad","new_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO This appears to have rounding issues with s3d; add 0.01 for it\ngExtWidth = 0.4;\ngWall = gExtWidth*3;\n\n\/\/ TODO test print for HF, Stanley sizes\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\n\ngPegHole = 2.5;\ngPegHead = 6;\ngPegCircle = 18; \/\/ measure hole in base, and subtract 1mm for intentional slop\ngPegDepth = 8;\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([w\/2-r,h\/2-r]) circle(r=r);\n}\nmodule Corner(r,e=1) {\n translate([-r,-r]) difference() {\n square([r+e,r+e]);\n circle(r=r,$fn=128);\n }\n}\nmodule Ess(w,h,r) {\n difference() {\n square([w,h]);\n \/\/ cut corner\n translate([w,h]) Corner(r);\n }\n \/\/ add corners\n translate([w,0]) rotate([0,0,180]) Corner(r,0);\n translate([0,h]) rotate([0,0,180]) Corner(r,0);\n}\n\nmodule Fillet(a, r) {\n intersection() {\n difference() {\n hull() {\n translate([-a,a]) circle(r=a);\n translate([a,-a]) circle(r=a);\n }\n hull() {\n translate([a,r]) circle(r=r);\n translate([r,a]) circle(r=r);\n }\n }\n square([a,a]);\n }\n}\n\nmodule Bin(x=1,y=1,wall=gWall,feet=true,cutaway=false) {\n inside_wall_w = (x*gGridX)-(wall*2)-gTopSlop;\n inside_wall_h = (y*gGridY)-(wall*2)-gTopSlop;\n difference() {\n union() {\n linear_extrude(height=gHeight,convexity=4) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=128);\n RoundRect(inside_wall_w,inside_wall_h,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=2)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n if(feet) {\n linear_extrude(height=gPegDepth+2,convexity=4)\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([-inside_wall_w\/2,-inside_wall_h\/2]) Fillet(11, 3, $fn=32);\n \/\/Ess(6,6,3);\n }\n }\n if(feet) {\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(x*gGridX-gTopSlop)\/2,(y*gGridY-gTopSlop)\/2,-1])\n rotate([0,0,180+45]) translate([(gPegCircle-gPegHead)\/2,0])\n cylinder(d=gPegHole,h=gPegDepth+1,$fn=32);\n }\n if(cutaway) {\n translate([-inside_wall_w\/2,-inside_wall_h\/2,-1])\n rotate([0,0,-45]) translate([0,-1,0]) cube([12,12,20]);\n }\n }\n}\n\nBin(4,1);\n","old_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO I'm not sure this works, maybe because of poylgon circles?\ngExtWidth = 0.45;\n\n\/\/ TODO test print for HF, Stanley sizes\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\n\ngPegHole = 2.5;\ngPegHead = 6;\ngPegCircle = 18; \/\/ measure hole in base, and subtract 1mm for intentional slop\ngPegDepth = 8;\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([w\/2-r,h\/2-r]) circle(r=r);\n}\nmodule Corner(r,e=1) {\n translate([-r,-r]) difference() {\n square([r+e,r+e]);\n circle(r=r,$fn=128);\n }\n}\nmodule Ess(w,h,r) {\n difference() {\n square([w,h]);\n \/\/ cut corner\n translate([w,h]) Corner(r);\n }\n \/\/ add corners\n translate([w,0]) rotate([0,0,180]) Corner(r,0);\n translate([0,h]) rotate([0,0,180]) Corner(r,0);\n}\n\nmodule Fillet(a, r) {\n intersection() {\n difference() {\n hull() {\n translate([-a,a]) circle(r=a);\n translate([a,-a]) circle(r=a);\n }\n hull() {\n translate([a,r]) circle(r=r);\n translate([r,a]) circle(r=r);\n }\n }\n square([a,a]);\n }\n}\n\nmodule Bin(x=1,y=1,wall=gExtWidth*3,feet=true,cutaway=false) {\n inside_wall_w = (x*gGridX)-(wall*2)-gTopSlop;\n inside_wall_h = (y*gGridY)-(wall*2)-gTopSlop;\n difference() {\n union() {\n linear_extrude(height=gHeight,convexity=4) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=128);\n RoundRect(inside_wall_w,inside_wall_h,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=2)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n if(feet) {\n linear_extrude(height=gPegDepth+2,convexity=4)\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([-inside_wall_w\/2,-inside_wall_h\/2]) Fillet(10, 3, $fn=32);\n \/\/Ess(6,6,3);\n }\n }\n if(feet) {\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(x*gGridX-gTopSlop)\/2,(y*gGridY-gTopSlop)\/2,-1])\n rotate([0,0,180+45]) translate([(gPegCircle-gPegHead)\/2,0])\n cylinder(d=gPegHole,h=gPegDepth+1,$fn=32);\n }\n if(cutaway) {\n translate([-inside_wall_w\/2,-inside_wall_h\/2,-1])\n rotate([0,0,-45]) translate([0,-1,0]) cube([12,12,20]);\n }\n }\n}\n\nBin(4,1);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"9b4bd453867885e84db58e9ec3e77032015be2a6","subject":"modify scad file","message":"modify scad file\n","repos":"luoyi\/RpiPlayer","old_file":"RpiPlayer.scad","new_file":"RpiPlayer.scad","new_contents":"module round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\nmodule gong_bang(all_x, side_x, mid_w, side_y, h) {\n cube([all_x, mid_w, h], center=true);\n translate([(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n}\n\ngong_bang(80, 2, 2, 10, 40);\n\n\n\/*\ncolor([0.5,0.5,0.99]) \ndifference () {\nround_cube(80+6,60+6,40,4); \ntranslate([0,-2,3]) round_cube(80,58,40,4);\n\/\/translate([0,20,3]) round_cube(70,3,20,4);\ntranslate([0,33.5,2]) cube([70,3,40],center=true);\n}\n*\/\n\n","old_contents":"module round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\n\n\ncolor([0.5,0.5,0.99]) \ndifference () {\nround_cube(80+6,60+6,40,4); \ntranslate([0,-2,3]) round_cube(80,58,40,4);\n\/\/translate([0,20,3]) round_cube(70,3,20,4);\ntranslate([0,33.5,2]) cube([70,3,40],center=true);\n}\n\n\n","returncode":0,"stderr":"","license":"artistic-2.0","lang":"OpenSCAD"} {"commit":"0e1b3741d19722a23d4e849c35301edd3449e5ba","subject":"corrected ESC position","message":"corrected ESC position\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/all.scad","new_file":"3d\/all.scad","new_contents":"$fs = 0.25;\n$fa = 8;\n\nuse \nuse \nuse \nuse \nuse \nuse \n\n\/\/ whole car\nmodule all()\n{\n apex();\n platform();\n board();\n arrange(30) horizontal_sonar();\n color(\"white\") cage(mode=2\/*simple*\/);\n esc();\n lcd();\n}\n\nall();\n","old_contents":"$fs = 0.25;\n$fa = 8;\n\nuse \nuse \nuse \nuse \nuse \nuse \n\n\/\/ whole car\nmodule all()\n{\n apex();\n platform();\n board();\n arrange(30) horizontal_sonar();\n color(\"white\") cage(mode=2\/*simple*\/);\n translate ([33, -8, 79]) rotate([0, 0, 90]) esc();\n lcd();\n}\n\nall();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"5cc2b7616154143cfe67f23726a826d405f30b3e","subject":"The # operator is used instead of the % operator. The % operator causes the item to not show in the final render, while the # operator shows the item as transparent but still rendered with the final model.","message":"The # operator is used instead of the % operator. The % operator causes the item to not show in the final render, while the # operator shows the item as transparent but still rendered with the final model.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/rainmaker.scad","new_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/rainmaker.scad","new_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule rainmaker(height = 140,\n innerRadius = 30,\n outerRadius = 34,\n\t\t\t\t rungsPerLevel = 1,\n\t\t\t\t shellDecoration = \"none\",\n\t\t\t\t showShell = \"yes\",\n\t\t\t \t stepRadius = 2,\n\t\t\t\t zDistanceBetweenRungs = 5,\n\t\t\t \t zRotateAngle = 25)\n{\n union()\n {\n \/\/ the main shell\n\t\tif(showShell == \"yes\")\n\t\t{\n \t\t#\n\t openCylinder(height = height,\n\t innerRadius = innerRadius,\n\t outerRadius = outerRadius);\n\t\t}\n\n bottomZ = 5;\n\n \/\/ the steps\n zStart = bottomZ;\n step_xLength = (innerRadius * 2) + 1;\n rainmaker_steps(height = height,\n\t\t\t\t\t\touterRadius = outerRadius,\n\t\t\t\t\t\trungsPerLevel = rungsPerLevel,\n\t\t\t\t\t\tshellDecoration = shellDecoration,\n\t\t\t\t\t\tstepRadius = stepRadius,\n\t\t\t\t\t\tstep_xLength = step_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs = zDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle = zRotateAngle,\n zStart = zStart);\n\n \/\/ the bottom\n cylinder(r=outerRadius, h=bottomZ);\n }\n}\n\n\/\/ suport modules follow\n\nmodule rainmaker_steps(height,\n\t\t\t\t\t\touterRadius,\n\t\t\t\t\t\trungsPerLevel,\n\t\t\t\t\t\tshellDecoration,\n\t\t\t\t\t\tstepRadius,\n\t\t\t\t\t\tstep_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle,\n\t\t\t\t\t\tzStart)\n{\n\tzEnd = height - zDistanceBetweenRungs - stepRadius;\n\n for(z = [zStart : zDistanceBetweenRungs : zEnd])\n {\n\t\txTranslate = 0;\n zTranslate = zStart + z;\n\n\t\trotate([0, 0, zRotateAngle * z])\n\t\tunion()\n\t\t{\n\t\t\tfor(s = [1 : 1 : rungsPerLevel])\n\t\t\t{\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\tstepColor = s == 1 ? \"yellow\" :\n\t\t\t\t\t\t\t\t s == 2 ? \"green\" :\n\t\t\t\t\t\t\t\t s == 3 ? \"orange\" :\n\t\t\t\t\t\t\t\t s == 4 ? \"blue\" :\n\t\t\t\t\t\t\t\t \"pink\";\n\n\t\t\t\t\tangleDivision = 360.0 \/ rungsPerLevel;\n\t\t\t\t zRotate = (angleDivision * (s-1) ) \/ 2;\n\n\t\t\t\t\tcolor(stepColor)\n\t\t\t translate([xTranslate, 0, zTranslate])\n\t\t\t\t\trotate([0, 90, zRotate])\n\t\t\t cylinder(r = stepRadius,\n\t\t\t\t\t\t\t\th = step_xLength,\n\t\t\t\t\t\t\t\tcenter = true);\n\n\t\t\t\t\tif(shellDecoration == \"bumps\")\n\t\t\t\t\t{\n\/\/\t\t\t\t\t\tbumpsRotate = (angleDivision * s) \/ s;\n\/\/\t\t\t\t\t\tbumpsRotate = zRotate \/ s;\n\t\t\t\t\t\tbumpsRotate = zRotate;\n\/\/\t\t\t\t\t\tbumpsRotate = s + 30;\n\/\/\t\t\t\t\t\tbumpsRotate = 0;\n\n\t\t\t\t\t\techo(\"bumps\", s, bumpsRotate);\n\n\t\t\t\t\t\tcolor(stepColor)\n\n\t\t\t\t\t\ttranslate([outerRadius, 0, zTranslate])\n\/\/rotate([bumpsRotate, 0, 0])\n\/\/rotate([0, 90, bumpsRotate])\n\t\t\t\t\t\tsphere(r=3);\n\n\/\/ this is the bump on the 'other' end\n\t\t\t\t\t\tcolor(stepColor)\n\t\t\t\t\t\ttranslate([-outerRadius, 0, zTranslate])\n\/\/\t\t\t\t\t\trotate([0, 90, bumpsRotate * s])\n\t\t\t\t\t\tsphere(r=3);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}\n","old_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule rainmaker(height = 140,\n innerRadius = 30,\n outerRadius = 34,\n\t\t\t\t rungsPerLevel = 1,\n\t\t\t\t shellDecoration = \"none\",\n\t\t\t \t stepRadius = 2,\n\t\t\t\t zDistanceBetweenRungs = 5,\n\t\t\t \t zRotateAngle = 25)\n{\n union()\n {\n \/\/ the main shell\n \t%\n openCylinder(height = height,\n innerRadius = innerRadius,\n outerRadius = outerRadius);\n\n bottomZ = 5;\n\n \/\/ the steps\n zStart = bottomZ;\n step_xLength = (innerRadius * 2) + 1;\n rainmaker_steps(height = height,\n\t\t\t\t\t\touterRadius = outerRadius,\n\t\t\t\t\t\trungsPerLevel = rungsPerLevel,\n\t\t\t\t\t\tshellDecoration = shellDecoration,\n\t\t\t\t\t\tstepRadius = stepRadius,\n\t\t\t\t\t\tstep_xLength = step_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs = zDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle = zRotateAngle,\n zStart = zStart);\n\n \/\/ the bottom\n cylinder(r=outerRadius, h=bottomZ);\n }\n}\n\n\/\/ suport modules follow\n\nmodule rainmaker_steps(height,\n\t\t\t\t\t\touterRadius,\n\t\t\t\t\t\trungsPerLevel,\n\t\t\t\t\t\tshellDecoration,\n\t\t\t\t\t\tstepRadius,\n\t\t\t\t\t\tstep_xLength,\n\t\t\t\t\t\tzDistanceBetweenRungs,\n\t\t\t\t\t\tzRotateAngle,\n\t\t\t\t\t\tzStart)\n{\n\tzEnd = height - zDistanceBetweenRungs - stepRadius;\n\n for(z = [zStart : zDistanceBetweenRungs : zEnd])\n {\n\t\txTranslate = 0;\n zTranslate = zStart + z;\n\n\t\trotate([0, 0, zRotateAngle * z])\n\t\tunion()\n\t\t{\n\t\t\tfor(s = [1 : 1 : rungsPerLevel])\n\t\t\t{\n\t\t\t\tstepColor = s == 1 ? \"yellow\" :\n\t\t\t\t\t\t\t s == 2 ? \"green\" :\n\t\t\t\t\t\t\t s == 3 ? \"orange\" :\n\t\t\t\t\t\t\t s == 4 ? \"blue\" :\n\t\t\t\t\t\t\t \"pink\";\n\n\t\t\t\tangleDivision = 360.0 \/ rungsPerLevel;\n\t\t\t zRotate = (angleDivision * (s-1) ) \/ 2;\n\n\t\t\t\tcolor(stepColor)\n\t\t translate([xTranslate, 0, zTranslate])\n\t\t\t\trotate([0, 90, zRotate])\n\t\t cylinder(r = stepRadius,\n\t\t\t\t\t\t\th = step_xLength,\n\t\t\t\t\t\t\tcenter = true);\n\n\t\t\t\tif(shellDecoration == \"bumps\")\n\t\t\t\t{\n\t\t\t\t\tcolor(stepColor)\n\t\t\t\t\ttranslate([outerRadius, 0, zTranslate])\n\t\t\t\t\trotate([0, 90, zRotate])\n\t\t\t\t\tsphere(r=3);\n\n\t\t\t\t\tcolor(stepColor)\n\t\t\t\t\ttranslate([-outerRadius, 0, zTranslate])\n\t\t\t\t\trotate([0, 90, zRotate])\n\t\t\t\t\tsphere(r=3);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7aecc17e2c88cf1638b39f2b443cea4d781fddc9","subject":"frame","message":"frame\n","repos":"jaw0\/minicopter","old_file":"cad\/frame.scad","new_file":"cad\/frame.scad","new_contents":"\/\/ Copyright (c) 2015\n\/\/ Author: Jeff Weisberg \n\/\/ Created: 2015-Oct-04 22:32 (EDT)\n\/\/ Function: frame for mini-copter\n\n\nshow_env = 0;\n\npcb_x = 25.0;\npcb_y = 25.0;\npcb_z = 1.6;\n\npeg_pos = 1.25;\t\/\/ in from corner\nprop_x = 56.0;\t\/\/ prop diam plus margin\nmot_z = 10.0; \t\/\/ ht of center of motor\nmotor_phi = 5.0;\t\/\/ slight dihedral\nmotor_diam = 7;\n\n\n\/\/################################################################\n\nmot_pos = (prop_x - pcb_x) \/ 2;\nmot_armang = atan( (mot_z + 2) \/ (mot_pos + peg_pos) \/ sqrt(2) );\n\n$fn = 0;\n$fa = .5;\n$fs = 0.05;\n\n\/\/################################################################\n\nmodule vcyl(x,y,z,diam1, diam2, len){\n translate([x,y,z])\n cylinder(r1=diam1\/2, r2=diam2\/2, h=len);\n}\n\nmodule hcyl(x,y,z,diam1, diam2, len){\n translate([x,y,z])\n rotate([0,90,0])\n cylinder(r1=diam1\/2, r2=diam2\/2, h=len);\n}\n\nmodule box(x,y,z, dx,dy,dz){\n translate([x, y, z]) cube([dx, dy, dz]);\n}\n\n\nmodule proparm(){\n\n \/\/ board support+attach\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, 0]) rotate([0,0,45]){\n vcyl(0,0,-3, 3, 3,3);\n \/\/ slightly tapered pins\n vcyl(0,0,-.1, 1.0, 0.7, 2.1);\n box(-3.5,-.5,-1.5, 4,1,1.5);\n box( -.5,-.5,-1.5, 1,4,1.5);\n\n }\n\n \/\/ legs\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, -3.0]) rotate([0,30,0]){\n intersection(){\n box(0,-1,0, 15,2,1.5);\n hcyl(0,0,1, 2, 1, 15);\n }\n translate([15,0,.5]) sphere(1.0);\n }\n\n difference(){\n union(){\n \/\/ motor arms\n intersection(){\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, -2.0]) rotate([0,-mot_armang,0]) {\n box(0, -1.4, 0, (mot_pos+peg_pos)*sqrt(2) \/ cos(mot_armang), 2.8,1 );\n box(0,-.5, -1.5, (mot_pos+peg_pos)*sqrt(2) \/ cos(mot_armang), 1,2.5 );\n }\n \/\/ clean up the bottom\n box(-5,-5,-3, 60,60,60);\n }\n \/\/ motor mounts\n translate([prop_x\/2 * sqrt(2),0, mot_z]) rotate([0,-motor_phi,0]){\n vcyl(0,0,-3.25, motor_diam+2, motor_diam+2, 6.5 );\n\n \/\/ prop\n if( show_env ) color([.75,0,.75,1]) vcyl(0,0,5, 45, 45, 5);\n }\n\n }\n union(){\n \/\/ hole for motor\n translate([prop_x\/2 * sqrt(2),0, mot_z]) rotate([0,-motor_phi,0]){\n vcyl(0,0,-5, motor_diam-.5, motor_diam-.5, 9 );\n rotate([0,0,90]) box(motor_diam\/2-2, -.5,-5, 5,1,9);\n }\n }\n }\n}\n\nmodule cage(){\n \/\/ outer box\n box(-28\/2-1.5, 28\/2+.5, -1.25, 28+3, 1.0,2.5);\n box(-28\/2-1.5, 28\/2-.5, -.5, 28+3, 2.0,1.0);\n\n \/\/ rubber band attachment pegs\n hcyl(28\/2+.5, -6, 0, 2,2,3);\n hcyl(28\/2+.5, 6, 0, 2,2,3);\n hcyl(28\/2+.5, -2, 0, 2,2,3);\n hcyl(28\/2+.5, 2, 0, 2,2,3);\n}\n\n\n\/\/ ################################################################\n\nif( show_env ) color([.75,0,.75, 1]) box(-pcb_x\/2, -pcb_y\/2, 0, pcb_x, pcb_y, pcb_z);\n\nfor( angle = [ 0 : 90 : 270 ] ){\n rotate([0,0,45+angle]) proparm();\n\n \/\/ outer cage\n rotate([0,0,angle]) translate([0,0,.60]) cage();\n\n}\n\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cad\/frame.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"4c17efec0a6415a78bc351141e7d6c43948fe9f1","subject":"Add bottom fillet to yellow bin","message":"Add bottom fillet to yellow bin\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"yellow-bins\/bin.scad","new_file":"yellow-bins\/bin.scad","new_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO This appears to have rounding issues with s3d; add 0.01 for it\ngExtWidth = 0.4;\ngWall = gExtWidth*3;\n\n\/\/ TODO test print for HF, Stanley sizes\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\ngBaseThick=2;\ngFilletRad=3;\n\ngPegHole = 2.5;\ngPegHead = 6;\ngPegCircle = 18; \/\/ measure hole in base, and subtract 1mm for intentional slop\ngPegDepth = 8;\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([w\/2-r,h\/2-r]) circle(r=r);\n}\nmodule Corner(r,e=1) {\n translate([-r,-r]) difference() {\n square([r+e,r+e]);\n circle(r=r,$fn=128);\n }\n}\nmodule Ess(w,h,r) {\n difference() {\n square([w,h]);\n \/\/ cut corner\n translate([w,h]) Corner(r);\n }\n \/\/ add corners\n translate([w,0]) rotate([0,0,180]) Corner(r,0);\n translate([0,h]) rotate([0,0,180]) Corner(r,0);\n}\n\nmodule Fillet(a, r) {\n intersection() {\n difference() {\n hull() {\n translate([-a,a]) circle(r=a);\n translate([a,-a]) circle(r=a);\n }\n hull() {\n translate([a,r]) circle(r=r);\n translate([r,a]) circle(r=r);\n }\n }\n square([a,a]);\n }\n}\ne=0.001;\nmodule BaseOutline(x,y,wall,feet) {\n inside_wall_w = (x*gGridX)-(wall*2)-gTopSlop;\n inside_wall_h = (y*gGridY)-(wall*2)-gTopSlop;\n \/\/\/RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n difference() {\n RoundRect(inside_wall_w,inside_wall_h,3-wall,$fn=32);\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([-inside_wall_w\/2-e,-inside_wall_h\/2-e]) Fillet(11, 3, $fn=32);\n }\n}\n\nmodule BaseFillet(x,y,wall,feet) {\n translate([0,0,gFilletRad]) minkowski() {\n sphere(r=gFilletRad,$fn=32);\n linear_extrude(convexity=2,height=1) offset(delta=-gFilletRad) BaseOutline(x,y,wall,feet);\n }\n}\n\n\n\nmodule Bin(x=1,y=1,wall=gWall,feet=true,cutaway=false) {\n inside_wall_w = (x*gGridX)-(wall*2)-gTopSlop;\n inside_wall_h = (y*gGridY)-(wall*2)-gTopSlop;\n difference() {\n union() {\n linear_extrude(height=gHeight,convexity=4) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=128);\n RoundRect(inside_wall_w,inside_wall_h,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=gBaseThick+gFilletRad)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n if(feet) {\n linear_extrude(height=gPegDepth+2,convexity=4)\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([-inside_wall_w\/2,-inside_wall_h\/2]) Fillet(11, 3, $fn=32);\n \/\/Ess(6,6,3);\n }\n }\n if(feet) {\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(x*gGridX-gTopSlop)\/2,(y*gGridY-gTopSlop)\/2,-1])\n rotate([0,0,180+45]) translate([(gPegCircle-gPegHead)\/2,0])\n cylinder(d=gPegHole,h=gPegDepth+1,$fn=32);\n translate([0,0,gBaseThick]) BaseFillet(x,y,wall,true);\n }\n if(cutaway) {\n translate([-inside_wall_w\/2,-inside_wall_h\/2,-1])\n rotate([0,0,-45]) translate([0,-1,0]) cube([12,12,20]);\n }\n }\n}\n\nBin(4,1);\n","old_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO This appears to have rounding issues with s3d; add 0.01 for it\ngExtWidth = 0.4;\ngWall = gExtWidth*3;\n\n\/\/ TODO test print for HF, Stanley sizes\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\n\ngPegHole = 2.5;\ngPegHead = 6;\ngPegCircle = 18; \/\/ measure hole in base, and subtract 1mm for intentional slop\ngPegDepth = 8;\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([w\/2-r,h\/2-r]) circle(r=r);\n}\nmodule Corner(r,e=1) {\n translate([-r,-r]) difference() {\n square([r+e,r+e]);\n circle(r=r,$fn=128);\n }\n}\nmodule Ess(w,h,r) {\n difference() {\n square([w,h]);\n \/\/ cut corner\n translate([w,h]) Corner(r);\n }\n \/\/ add corners\n translate([w,0]) rotate([0,0,180]) Corner(r,0);\n translate([0,h]) rotate([0,0,180]) Corner(r,0);\n}\n\nmodule Fillet(a, r) {\n intersection() {\n difference() {\n hull() {\n translate([-a,a]) circle(r=a);\n translate([a,-a]) circle(r=a);\n }\n hull() {\n translate([a,r]) circle(r=r);\n translate([r,a]) circle(r=r);\n }\n }\n square([a,a]);\n }\n}\n\nmodule Bin(x=1,y=1,wall=gWall,feet=true,cutaway=false) {\n inside_wall_w = (x*gGridX)-(wall*2)-gTopSlop;\n inside_wall_h = (y*gGridY)-(wall*2)-gTopSlop;\n difference() {\n union() {\n linear_extrude(height=gHeight,convexity=4) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=128);\n RoundRect(inside_wall_w,inside_wall_h,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=2)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n if(feet) {\n linear_extrude(height=gPegDepth+2,convexity=4)\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([-inside_wall_w\/2,-inside_wall_h\/2]) Fillet(11, 3, $fn=32);\n \/\/Ess(6,6,3);\n }\n }\n if(feet) {\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(x*gGridX-gTopSlop)\/2,(y*gGridY-gTopSlop)\/2,-1])\n rotate([0,0,180+45]) translate([(gPegCircle-gPegHead)\/2,0])\n cylinder(d=gPegHole,h=gPegDepth+1,$fn=32);\n }\n if(cutaway) {\n translate([-inside_wall_w\/2,-inside_wall_h\/2,-1])\n rotate([0,0,-45]) translate([0,-1,0]) cube([12,12,20]);\n }\n }\n}\n\nBin(4,1);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"2237e926a96bc8fb31588c971a16eec060ce190b","subject":"Discoverd that openscad DOENS'T HAVE ELEMENTWISE MUTIPLICATION.","message":"Discoverd that openscad DOENS'T HAVE ELEMENTWISE MUTIPLICATION.\n\nI'm going to create my own functions to do this... Probably will end up\ncreating a seperate library to for other users as well.\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n if(len(vec1) != len(vec2)) {\n echo(\"Vectors not the same dimensions\");\n break;\n =\n}\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n echo(translation_vectors[i] );\n \n translate(translation_vectors[i] * [size \/ (2 * sqrt(2)), size \/ (2 * sqrt(2))] + starting_pos) {\n rotate(rotation_vectors[i] * [0, 45, 45]) {\n #square([connector_thickness, size], center = true);\n }\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false; \n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false; \n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translation = [0,0];\n $dank = 1;\n translations = translation_vectors;\n rotations = rotation_vectors;\n }\n else if(seed_corner == \"bottom_left\") {\n translation = [current_size \/ 2, current_size \/ 2];\n translations = [translation_vectors[0] , translation_vectors[2], translation_vectors[3]];\n rotations = [rotation_vectors[0], rotation_vectors[2], rotation_vectors[3]];\n }\n else if(seed_corner == \"bottom_right\") {\n translation = [-current_size \/ 2, current_size \/ 2];\n translations = [translation_vectors[0], translation_vectors[1], translation_vectors[2]];\n rotations = [rotation_vectors[0], rotation_vectors[1], rotation_vectors[2]];\n }\n else if(seed_corner == \"top_left\") {\n translation = [current_size \/ 2, -current_size \/ 2];\n translations = [translation_vectors[0], translation_vectors[1], translation_vectors[3]];\n rotations = [rotation_vectors[0], rotation_vectors[1], rotation_vectors[3]];\n }\n else if(seed_corner == \"top_right\") {\n translation = [-current_size \/ 2, -current_size \/ 2];\n translations = [translation_vectors[1], translation_vectors[2], translation_vectors[3]];\n rotations = [rotation_vectors[1], rotation_vectors[2], rotation_vectors[3]];\n }\n\n translate(translation) {\n square(current_size, center = true);\n }\n\n if(current_iteration < iterations) {\n for(i = [0, len(translations) - 1]) {\n translate(translations[i] * [current_connector_size \/ (2 * sqrt(2)), current_connector_size \/ (2 * sqrt(2))]) {\n rotate(rotations[i] * [0, 45, 45]) {\n square([connector_thickness, current_connector_size], center = true);\n }\n }\n\n if(translations[i] == [1, 1]) {\n }\n else if(translations[i] == [-1, -1]) {\n }\n else if(translations[i] == [-1, 1]) {\n }\n else if(translations[i] == [1, -1]) {\n }\n }\n }\n}\n\npattern([0, 0], \"center\", 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"16f7c84783aba5332e0e95376349c0228e29336c","subject":"A value for the increment step was added.","message":"A value for the increment step was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/pencil-holder-with-cutouts\/spiral\/single-charm\/star\/spiral-star-pencil-holder-NO-LIBRARY.scad","new_file":"OpenSCAD\/pencil-holder-with-cutouts\/spiral\/single-charm\/star\/spiral-star-pencil-holder-NO-LIBRARY.scad","new_contents":"\r\ncharmName = \"balloon\"; \/\/ [star, balloon, blue-moon, pacman, Spurs]\r\n\r\ncharmCount = 28; \/\/ [1:100]\r\n\r\ncharmXYScale = 0.9; \/\/ [0.1:0.1:5]\r\n\r\ncupHeight = 150; \/\/ [75:300]\r\n\r\n\/* [Hidden] *\/\r\nmaxRandom = 0;\r\ncharmIndcies = rands(0,maxRandom, charmCount);\r\n\r\n\r\ncharmXYScales = rands(charmXYScale, charmXYScale, charmCount);\r\n\r\ndepthScale = 40.2;\r\ncharmDepthScales = rands(depthScale, depthScale, charmCount);\r\n\r\n\r\ndifference()\r\n{\r\n\tcup(cupHeight=cupHeight);\r\n\r\n\t\/\/ uses the default value for the charmStls parameter\r\n\trotatedCutouts(charmCount = charmCount,\r\n\t\t\t\t charmIndcies = charmIndcies,\r\n\t\t\t\t charmXYScales = charmXYScales,\r\n\t\t\t\t charmDepthScales = charmDepthScales,\r\n\t\t\t\t charmStls = [\"..\/..\/..\/..\/shapes\/star\/star.stl\"]);\r\n}\r\n\r\n\r\n\/\/use <..\/..\/..\/..\/shapes\/cup\/cup.scad>;\r\n\/**\r\n * Create a cylindrical cup.\r\n *\/\r\nmodule cup(cupHeight=70, innerRadius=53)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tcentered = false;\r\n\t\r\n\t\t\/\/ outer part of the cup\r\n\t\ttranslate([0,0,0])\r\n\t\tcylinder (h = cupHeight, r=55, center = centered, $fn=100);\r\n\t\t\r\n\t\t\/\/ subtracted inner cup\r\n\t\ttranslate([0,0,5])\r\n\t\tcylinder (h = cupHeight, r=innerRadius, center = centered, $fn=100);\r\n\t}\r\n}\r\n\r\n\/\/use <..\/..\/..\/..\/cutouts\/rotated-spiral-cutouts.scad>;\r\n\/**\r\n * This is a library for evenly spaced cutouts.\r\n*\/\r\nmodule rotatedCutouts(charmCount = 16,\r\n\t\t\t\t\t charmXYScales,\r\n\t\t\t\t\t charmStls = [\"..\/shapes\/oshw\/oshw.stl\"],\r\n\t\t\t\t\t charmIndcies = [], \/\/ the vector of array index needs required\r\n\t\t\t\t\t charmDepthScales,\r\n\t\t\t\t\t yTranslateFactor = 5,\r\n\t\t\t\t\t yTranslateMinimum = 0,\r\n\t\t\t\t\t zRotationFactor = 30)\r\n{\r\n for ( i = [0 : charmCount-1] )\r\n {\r\n\r\n single_rand = charmIndcies[i];\r\n\r\n charmIndex = round(single_rand);\r\n \r\n\t\tyTranslate = (i * yTranslateFactor) + yTranslateMinimum;\r\n\t\t\r\n\t\tzRotation = i * zRotationFactor;\r\n\t\t\r\n rotate([\r\n 90, \r\n 0,\r\n zRotation\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, yTranslate, 30])\r\n scale([\r\n\t\t charmXYScales[charmIndex], \r\n\t\t\t charmXYScales[charmIndex], \r\n\t\t\t charmDepthScales[charmIndex] \/\/20.2])\r\n\t\t\t ])\r\n\/\/ import(charmStls[charmIndex])\r\n\/\/\t\tstar(1);\r\n\t\t\r\n\t\tif(charmName == \"balloon\")\r\n\t\t{\r\n\t\t\techo(\"no sucka!\");\r\n\t\t\tballoon();\r\n\t\t}\r\n\t\telse if(charmName == \"blue-moon\")\r\n\t\t{\r\n\t\t\tblueMoon();\r\n\t\t}\r\n\t\telse if(charmName == \"pacman\")\r\n\t\t{\r\n\t\t\tpacman();\r\n\t\t}\r\n\t\telse if(charmName == \"Spurs\")\r\n\t\t{\r\n\t\t\tspursa(5);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\/\/ star is the default\t\r\n\t\t\tstar(1);\r\n\t\t}\r\n\t\t\r\n }\r\n}\r\n\r\n\/\/ from the OpenSCAD tutotials\r\nmodule star_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[9.080000,-22.000000],[10.922500,-17.093750],[12.213125,-14.728281],[13.890000,-13.020000],[15.773906,-12.298125],[18.041250,-12.022500],[22.500000,-11.910000],[34.390000,-10.968750],[40.862812,-10.133906],[45.500000,-9.000000],[28.500000,4.610000],[21.270000,12.170000],[22.870000,22.000000],[27.500000,43.000000],[8.500000,31.580000],[-0.500000,27.200000],[-10.500000,32.320000],[-28.500000,43.000000],[-22.870000,21.000000],[-21.690000,11.090000],[-28.500000,4.130000],[-45.500000,-11.000000],[-11.500000,-13.000000],[-0.500000,-43.000000],[2.289219,-38.828594],[4.908750,-33.096250],[9.080000,-22.000000]]);\r\n }\r\n}\r\n\r\nmodule star(h)\r\n{\r\n\tstar_poly_Selection(h);\r\n}\r\n\r\n\r\n\/\/ ..\/..\/..\/..\/shapes\/balloon\/balloon.scad\r\nmodule balloon()\r\n{\r\n\tunion () \r\n\t{\r\n\t\t\/\/ balloon\r\n\t\tscale ([0.8, 1, 1]) \r\n\t\tcylinder (h = 4, r=10, center = true, $fn=100);\r\n\t\t\r\n\t\t\/\/ middle knot piece\r\n\t\tknotPiece();\r\n\r\n\t\t\/\/ left knot piece\r\n\t\trotate ([0, 0, -6.5])\r\n\t\tknotPiece();\r\n\t\t\r\n\t\t\/\/ right knot piece\r\n\t\trotate ([0, 0, 6.5])\r\n\t\tknotPiece();\r\n\t}\t\r\n}\r\n\r\nmodule knotPiece()\r\n{\r\n\ttranslate ([0, -10.5, 0]) \r\n\tscale ([0.3, 0.8, 1]) \r\n\tcylinder (h = 4, r=2, center = true, $fn=100);\r\n}\r\n\r\n\r\n\r\n\/\/ ..\/..\/..\/..\/shapes\/blue-moon\/blue-moon.scad\r\nmodule blueMoon()\r\n{\r\n\tdifference() \r\n\t{ \r\n\t\t\/\/ blue moon\r\n\t\tcylinder (h = 4, r=10, center = true, $fn=100);\r\n\t\t\r\n\t\t\/\/ top cutout\r\n\t\ttranslate([5, 5, 0]) \r\n\t\tcylinder (h = 4.20, r=6, center = true, $fn=100);\r\n\t\t\t\t\r\n\t\t\/\/ bottom cutout\r\n\t\ttranslate([5, -5, 0]) \r\n\t\tcylinder (h = 4.20, r=6, center = true, $fn=100);\r\n\t\t\r\n\t\t\/\/ remainder cutout\r\n\t\ttranslate([10, 0, 5]) \r\n\t\tcolor(\"red\")\r\n\t\tcylinder (h = 14.20, r=6, center = true, $fn=100);\t\t\t\r\n\t}\r\n}\r\n\r\n\/\/ http:\/\/www.thingiverse.com\/thing:241081\/\r\nmodule pacman()\r\n{\r\n\t\/\/linear_extrude(height=50, center=true, convexity = 10, twist = 0) \r\n\tdifference () \r\n\t{\r\n\t cylinder(r=20, center=true, h=5);\r\n\t \r\n\t linear_extrude(height=10, center= true)\r\n\t\/\/ linear_extrude(height=50, center=true, convexity = 10, twist = 0) \r\n\t\/\/ {\r\n\t\t polygon(points=[[0,0],[100,60],[100,-60]], paths=[[0,1,2]]);\r\n\t\/\/ };\r\n\t}\r\n}\r\n\r\n\/\/pacman();\r\n\r\n\r\n\/\/ http:\/\/www.thingiverse.com\/thing:603115\r\nmodule poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule spursa(h)\r\n{\r\n\tpoly_Selection(h);\r\n}\r\n","old_contents":"\r\ncharmName = \"blue-moon\"; \/\/ [star, balloon, blue-moon, pacman, Spurs]\r\n\r\ncharmCount = 28; \/\/ [1:100]\r\n\r\ncharmXYScale = 0.9; \/\/ [0.1:5]\r\n\r\ncupHeight = 150; \/\/ [75:300]\r\n\r\n\/* [Hidden] *\/\r\nmaxRandom = 0;\r\ncharmIndcies = rands(0,maxRandom, charmCount);\r\n\r\n\r\ncharmXYScales = rands(charmXYScale, charmXYScale, charmCount);\r\n\r\ndepthScale = 40.2;\r\ncharmDepthScales = rands(depthScale, depthScale, charmCount);\r\n\r\n\r\ndifference()\r\n{\r\n\tcup(cupHeight=cupHeight);\r\n\r\n\t\/\/ uses the default value for the charmStls parameter\r\n\trotatedCutouts(charmCount = charmCount,\r\n\t\t\t\t charmIndcies = charmIndcies,\r\n\t\t\t\t charmXYScales = charmXYScales,\r\n\t\t\t\t charmDepthScales = charmDepthScales,\r\n\t\t\t\t charmStls = [\"..\/..\/..\/..\/shapes\/star\/star.stl\"]);\r\n}\r\n\r\n\r\n\/\/use <..\/..\/..\/..\/shapes\/cup\/cup.scad>;\r\n\/**\r\n * Create a cylindrical cup.\r\n *\/\r\nmodule cup(cupHeight=70, innerRadius=53)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tcentered = false;\r\n\t\r\n\t\t\/\/ outer part of the cup\r\n\t\ttranslate([0,0,0])\r\n\t\tcylinder (h = cupHeight, r=55, center = centered, $fn=100);\r\n\t\t\r\n\t\t\/\/ subtracted inner cup\r\n\t\ttranslate([0,0,5])\r\n\t\tcylinder (h = cupHeight, r=innerRadius, center = centered, $fn=100);\r\n\t}\r\n}\r\n\r\n\/\/use <..\/..\/..\/..\/cutouts\/rotated-spiral-cutouts.scad>;\r\n\/**\r\n * This is a library for evenly spaced cutouts.\r\n*\/\r\nmodule rotatedCutouts(charmCount = 16,\r\n\t\t\t\t\t charmXYScales,\r\n\t\t\t\t\t charmStls = [\"..\/shapes\/oshw\/oshw.stl\"],\r\n\t\t\t\t\t charmIndcies = [], \/\/ the vector of array index needs required\r\n\t\t\t\t\t charmDepthScales,\r\n\t\t\t\t\t yTranslateFactor = 5,\r\n\t\t\t\t\t yTranslateMinimum = 0,\r\n\t\t\t\t\t zRotationFactor = 30)\r\n{\r\n for ( i = [0 : charmCount-1] )\r\n {\r\n\r\n single_rand = charmIndcies[i];\r\n\r\n charmIndex = round(single_rand);\r\n \r\n\t\tyTranslate = (i * yTranslateFactor) + yTranslateMinimum;\r\n\t\t\r\n\t\tzRotation = i * zRotationFactor;\r\n\t\t\r\n rotate([\r\n 90, \r\n 0,\r\n zRotation\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, yTranslate, 30])\r\n scale([\r\n\t\t charmXYScales[charmIndex], \r\n\t\t\t charmXYScales[charmIndex], \r\n\t\t\t charmDepthScales[charmIndex] \/\/20.2])\r\n\t\t\t ])\r\n\/\/ import(charmStls[charmIndex])\r\n\/\/\t\tstar(1);\r\n\t\t\r\n\t\tif(charmName == \"balloon\")\r\n\t\t{\r\n\t\t\techo(\"no sucka!\");\r\n\t\t\tballoon();\r\n\t\t}\r\n\t\telse if(charmName == \"blue-moon\")\r\n\t\t{\r\n\t\t\tblueMoon();\r\n\t\t}\r\n\t\telse if(charmName == \"pacman\")\r\n\t\t{\r\n\t\t\tpacman();\r\n\t\t}\r\n\t\telse if(charmName == \"Spurs\")\r\n\t\t{\r\n\t\t\tspursa(5);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t\/\/ star is the default\t\r\n\t\t\tstar(1);\r\n\t\t}\r\n\t\t\r\n }\r\n}\r\n\r\n\/\/ from the OpenSCAD tutotials\r\nmodule star_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[9.080000,-22.000000],[10.922500,-17.093750],[12.213125,-14.728281],[13.890000,-13.020000],[15.773906,-12.298125],[18.041250,-12.022500],[22.500000,-11.910000],[34.390000,-10.968750],[40.862812,-10.133906],[45.500000,-9.000000],[28.500000,4.610000],[21.270000,12.170000],[22.870000,22.000000],[27.500000,43.000000],[8.500000,31.580000],[-0.500000,27.200000],[-10.500000,32.320000],[-28.500000,43.000000],[-22.870000,21.000000],[-21.690000,11.090000],[-28.500000,4.130000],[-45.500000,-11.000000],[-11.500000,-13.000000],[-0.500000,-43.000000],[2.289219,-38.828594],[4.908750,-33.096250],[9.080000,-22.000000]]);\r\n }\r\n}\r\n\r\nmodule star(h)\r\n{\r\n\tstar_poly_Selection(h);\r\n}\r\n\r\n\r\n\/\/ ..\/..\/..\/..\/shapes\/balloon\/balloon.scad\r\nmodule balloon()\r\n{\r\n\tunion () \r\n\t{\r\n\t\t\/\/ balloon\r\n\t\tscale ([0.8, 1, 1]) \r\n\t\tcylinder (h = 4, r=10, center = true, $fn=100);\r\n\t\t\r\n\t\t\/\/ middle knot piece\r\n\t\tknotPiece();\r\n\r\n\t\t\/\/ left knot piece\r\n\t\trotate ([0, 0, -6.5])\r\n\t\tknotPiece();\r\n\t\t\r\n\t\t\/\/ right knot piece\r\n\t\trotate ([0, 0, 6.5])\r\n\t\tknotPiece();\r\n\t}\t\r\n}\r\n\r\nmodule knotPiece()\r\n{\r\n\ttranslate ([0, -10.5, 0]) \r\n\tscale ([0.3, 0.8, 1]) \r\n\tcylinder (h = 4, r=2, center = true, $fn=100);\r\n}\r\n\r\n\r\n\r\n\/\/ ..\/..\/..\/..\/shapes\/blue-moon\/blue-moon.scad\r\nmodule blueMoon()\r\n{\r\n\tdifference() \r\n\t{ \r\n\t\t\/\/ blue moon\r\n\t\tcylinder (h = 4, r=10, center = true, $fn=100);\r\n\t\t\r\n\t\t\/\/ top cutout\r\n\t\ttranslate([5, 5, 0]) \r\n\t\tcylinder (h = 4.20, r=6, center = true, $fn=100);\r\n\t\t\t\t\r\n\t\t\/\/ bottom cutout\r\n\t\ttranslate([5, -5, 0]) \r\n\t\tcylinder (h = 4.20, r=6, center = true, $fn=100);\r\n\t\t\r\n\t\t\/\/ remainder cutout\r\n\t\ttranslate([10, 0, 5]) \r\n\t\tcolor(\"red\")\r\n\t\tcylinder (h = 14.20, r=6, center = true, $fn=100);\t\t\t\r\n\t}\r\n}\r\n\r\n\/\/ http:\/\/www.thingiverse.com\/thing:241081\/\r\nmodule pacman()\r\n{\r\n\t\/\/linear_extrude(height=50, center=true, convexity = 10, twist = 0) \r\n\tdifference () \r\n\t{\r\n\t cylinder(r=20, center=true, h=5);\r\n\t \r\n\t linear_extrude(height=10, center= true)\r\n\t\/\/ linear_extrude(height=50, center=true, convexity = 10, twist = 0) \r\n\t\/\/ {\r\n\t\t polygon(points=[[0,0],[100,60],[100,-60]], paths=[[0,1,2]]);\r\n\t\/\/ };\r\n\t}\r\n}\r\n\r\n\/\/pacman();\r\n\r\n\r\n\/\/ http:\/\/www.thingiverse.com\/thing:603115\r\nmodule poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule spursa(h)\r\n{\r\n\tpoly_Selection(h);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b97027186a8539899e1df57685f1a7b13083d3a6","subject":"Simpler cut test, for use on hardboard.","message":"Simpler cut test, for use on hardboard.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/cut_test2.scad","new_file":"designs\/cut_test2.scad","new_contents":"\/\/ Dimensions are in mm by default\nheight = 2.5; \/\/ 0.1\" = 2.54mm\nmincut = 2;\nmaxcut = 3.6; \/\/ 0.125\" = 3.175mm, so get some cuts above that\ncutstep = 0.2;\ncutshift = maxcut * 2;\ncutlength = 50; \/\/ 5cm\nlength = cutlength + 2*maxcut;\nnumcuts = ((maxcut - mincut) \/ cutstep) + 1;\nwidth = cutshift * (numcuts+1);\n\nprojection(cut=false) testobj();\n\/\/testobj();\n\nmodule testobj() {\n difference () {\n cube([width, length, height]);\n\n \/\/ slot cuts\n for (i = [0 : numcuts-1]) {\n translate([cutshift * (i+0.5), 0, -50])\n cube([mincut + cutstep*i, cutlength, 100]);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'designs\/cut_test2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b58bdea0fa2044295e97bf0cb0b6dc2e334368d","subject":"[3d] Increase case front offset to 2.0mm","message":"[3d] Increase case front offset to 2.0mm\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 2.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3c8f5a032f2426e321f6b094d5e55dd3aa01944d","subject":"Add parametric stanley bin","message":"Add parametric stanley bin\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"yellow-bins\/bin.scad","new_file":"yellow-bins\/bin.scad","new_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO I'm not sure this works, maybe because of poylgon circles?\ngExtWidth = 0.45;\n\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(w-r)\/2,(h-r)\/2]) circle(r=r);\n}\n\n\/\/ TODO h for HF\n\/\/ TODO locating feet, maybe a really short screw?\n\/\/ TODO bottom inside rounding\nmodule Bin(x=1,y=1,wall=gExtWidth*3) {\n linear_extrude(height=gHeight) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n RoundRect((x*gGridX)-(wall*2)-gTopSlop,(y*gGridY)-(wall*2)-gTopSlop,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=2)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n}\n\nBin(4,1);\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'yellow-bins\/bin.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"b7c8a60926c3352296c9a5f2509ad9ae18ea2bea","subject":"closes #18 #19","message":"closes #18 #19\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"4a414be8a195d9be68e178056f67d7e71cf53bed","subject":"body: top_surface position","message":"body: top_surface position\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nmodule body()\n{ \n top_surface();\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\n\nmodule body()\n{ \n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"06921c65d02e9b865ce448261c3b24df975db032","subject":"fixed position to be calculated based on real diameter of the hole, instead of enlarged one + multiple elements on the print","message":"fixed position to be calculated based on real diameter of the hole, instead of enlarged one + multiple elements on the print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"door_hinge_fix\/door_hinge_fix.scad","new_file":"door_hinge_fix\/door_hinge_fix.scad","new_contents":"module distance_fixer(extra_d)\n{\n difference()\n {\n d_real=7;\n d=d_real+extra_d;\n cube([12, 40, 22-16]);\n for(dy = [5+d_real\/2, 40-6-d_real\/2])\n translate([12\/2, dy, -5])\n cylinder(r=d\/2, h=20, $fs=0.1);\n }\n}\n\ntranslate([0*15, 0, 0])\n distance_fixer(1);\n\ntranslate([1*15, 0, 0])\n distance_fixer(1.5);\n\ntranslate([2*15, 0, 0])\n distance_fixer(2);","old_contents":"difference()\n{\n d=6+1;\n cube([12, 39, 22-16]);\n #for(dy = [5+d\/2, 39-6-d\/2])\n translate([12\/2, dy, -5])\n cylinder(r=d\/2, h=20, $fs=0.1);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cc48478f46dfbd0d0df0def8135173786b4d43a9","subject":"Updated poster frame chock","message":"Updated poster frame chock\n","repos":"ksuszka\/3d-projects","old_file":"small\/poster_frame_chock.scad","new_file":"small\/poster_frame_chock.scad","new_contents":"$fa=3;\n$fs=0.2;\n\nmodule chock() {\n length = 176;\n module bulk() {\n r1 = 2.4;\n r2 = 1.6;\n hull() {\n cylinder(r=r1, h=length, center=true);\n translate([r1-r2,7,0]) cylinder(r=r2, h=length, center=true);\n }\n }\n bulk();\n\/\/ translate([0,5,0]) cube([0.5,10,length],true);\n}\n\n\/\/rotate([0,0,0]) translate([0,-10,0]) chock();\n\/\/rotate([0,0,120]) translate([0,-10,0]) chock();\n\/\/rotate([0,0,240]) translate([0,-10,0]) chock();\n\nrotate([0,90,0]) chock();\ntranslate([0,12,0]) rotate([0,90,0]) chock();\ntranslate([0,24,0]) rotate([0,90,0]) chock();\n","old_contents":"$fa=3;\n$fs=0.2;\n\nmodule chock() {\n length = 200;\n module bulk() {\n hull() {\n cylinder(r=2.5, h=length, center=true);\n translate([0.5,7,0]) cylinder(r=2, h=length, center=true);\n }\n }\n bulk();\n translate([0,5,0]) cube([0.5,10,length],true);\n}\n\nrotate([0,0,0]) translate([0,-10,0]) chock();\nrotate([0,0,120]) translate([0,-10,0]) chock();\nrotate([0,0,240]) translate([0,-10,0]) chock();\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"76f160431b784692930807424c47c6eb1016aacb","subject":"misc: add v_i,v_get,v_sub","message":"misc: add v_i,v_get,v_sub\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e3dd44fde6354727e6548d12a8ccba448bf07d3f","subject":"screw module","message":"screw module\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/screw.scad","new_file":"led_controler_junction_box\/screw.scad","new_contents":"module screw()\n{\n intersection()\n {\n size = 6;\n height=3;\n cube([size, size, height], center=true);\n rotate([0,0,45])\n cube([size, size, height], center=true);\n }\n}\n\n%screw();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led_controler_junction_box\/screw.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"33fd583a672e31c95df777de7cce0efa44307e5a","subject":"Delete diera.scad","message":"Delete diera.scad","repos":"oscarxie\/tapsterbot,hugs\/tapsterbot,jackskalitzky\/tapsterbot,jackskalitzky\/tapsterbot","old_file":"hardware\/tapster-1\/scad\/diera.scad","new_file":"hardware\/tapster-1\/scad\/diera.scad","new_contents":"","old_contents":"use \n\nbeam_width = 8;\nhole_diameter = 5.1;\nhole_radius = hole_diameter \/ 2;\nnumber_of_holes = 10;\n\n\ndifference() {\n\tunion() {\n\t cube([90,50,4], center=true);\n\t\n\t translate([0,0,2])\n\t write(\"Diera\", font=\"vendor\/orbitron.dxf\", t=3, h=15, center=true);\n\t\n\t}\n\n\ttranslate([-40,-20,-7])\n\trotate([0,0,90])\n\tholes(5);\n\t\n\ttranslate([40,-20,-7])\n\trotate([0,0,90])\n\tholes(5);\n\n}\n\nmodule holes(number_of_holes) {\n beam_length = number_of_holes * 8;\n for (x=[beam_width : beam_width : beam_length]) {\n translate([x-4,0,2])\n cylinder(r=hole_radius, h=12, $fn=30);\n }\n}\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"bca63efd73d0cb885d0d38e2e24007dcd202398d","subject":"main cone simplification - single cylinder cut through inside should do it","message":"main cone simplification - single cylinder cut through inside should do it\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filament_spool_holder\/cone.scad","new_file":"filament_spool_holder\/cone.scad","new_contents":"difference()\n{\n cylinder(h=40, r1=120\/2, r2=40\/2); \/\/ main hull\n cylinder(h=40, r=(22+1)\/2); \/\/ center rod & bearings holding\n}\n","old_contents":"difference()\n{\n cylinder(h=40, r1=120\/2, r2=40\/2); \/\/ main hull\n cylinder(h=40, r=16\/2); \/\/ center rod holding\n \/\/ bearings' holders\n for(offset = [ [0,0,0], [0,0,40-(7+1)] ])\n translate(offset)\n cylinder(h=7+1, r=(22+1)\/2);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"458e2a33c70088d15e0b7eefe01a5c480fe9657b","subject":"added crank as well","message":"added crank as well\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"small_fishing_boat_roller\/roller.scad","new_file":"small_fishing_boat_roller\/roller.scad","new_contents":"eps=0.01;\n\n\nmodule roller_main()\n{\n difference()\n {\n \/\/ core part\n union()\n {\n cylinder(d=20, h=1, $fn=12);\n translate([0, 0, 1])\n {\n \/\/ internal roller part\n difference()\n {\n cylinder(d=8, h=10\/2, $fn=50);\n translate([0, -10, 10\/2-1])\n cube([10, 20, 10]);\n \/\/ cut in for string\n translate([2, 0, 2])\n rotate([0, 90, 0])\n cylinder(d=2, h=2, $fn=10);\n }\n }\n }\n \/\/ main shaft\n translate([0,0,-1])\n cylinder(d=2.5, h=20, $fn=60);\n }\n}\n\n\nmodule holder()\n{\n wall=2;\n width=12+2*1+2*wall;\n \/\/ main bulwark mount\n difference()\n {\n cube([2+2*wall, width, 8+wall]);\n translate([wall, -eps, wall])\n cube([2, width+2*eps, 8+wall]);\n }\n \/\/ roller mount\n translate([2+2*wall, 0, 0])\n {\n difference()\n {\n \/\/ core\n hull()\n {\n cube([eps, width, 8+wall]);\n translate([13, 0, 8\/2])\n rotate([-90, 0, 0])\n cylinder(d=8, h=width, $fn=60);\n }\n \/\/ cut-in\n translate([0, wall, -eps])\n cube([20, width-2*wall, 15]);\n \/\/ shaft\n translate([13, -eps, 8\/2])\n rotate([-90, 0, 0])\n cylinder(d=2.5, h=width+2*eps, $fn=60);\n }\n }\n}\n\n\nmodule crank()\n{\n d=2.5+2*1;\n difference()\n {\n dx_max = 10;\n hull()\n for(dx=[0, dx_max])\n translate([dx, 0, 0])\n cylinder(d=d, h=2, $fn=20);\n translate([dx_max, 0, -eps])\n cylinder(d=2.5, h=2+2*eps, $fn=20);\n }\n cylinder(d=d-1, h=2+8, $fn=20);\n}\n\n\ntranslate([1, -5, 0])\n crank();\n\nfor(i=[0,1])\n translate([-12, i*22, 0])\n roller_main();\n\nholder();\n\n%if(true)\n translate([19, 2+3\/2, 8\/2])\n rotate([-90, 0, 0])\n union()\n {\n roller_main();\n rotate([0, 0, 180])\n translate([0, 0, 11])\n rotate([180, 0, 0])\n roller_main();\n }\n","old_contents":"eps=0.01;\n\n\nmodule roller_main()\n{\n difference()\n {\n \/\/ core part\n union()\n {\n cylinder(d=20, h=1, $fn=12);\n translate([0, 0, 1])\n {\n \/\/ internal roller part\n difference()\n {\n cylinder(d=8, h=10\/2, $fn=50);\n translate([0, -10, 10\/2-1])\n cube([10, 20, 10]);\n \/\/ cut in for string\n translate([2, 0, 2])\n rotate([0, 90, 0])\n cylinder(d=2, h=2, $fn=10);\n }\n }\n }\n \/\/ main shaft\n translate([0,0,-1])\n cylinder(d=2.5, h=20, $fn=60);\n }\n}\n\n\nmodule holder()\n{\n wall=2;\n width=12+2*1+2*wall;\n \/\/ main bulwark mount\n difference()\n {\n cube([2+2*wall, width, 8+wall]);\n translate([wall, -eps, wall])\n cube([2, width+2*eps, 8+wall]);\n }\n \/\/ roller mount\n translate([2+2*wall, 0, 0])\n {\n difference()\n {\n \/\/ core\n hull()\n {\n cube([eps, width, 8+wall]);\n translate([13, 0, 8\/2])\n rotate([-90, 0, 0])\n cylinder(d=8, h=width, $fn=60);\n }\n \/\/ cut-in\n translate([0, wall, -eps])\n cube([20, width-2*wall, 15]);\n \/\/ shaft\n translate([13, -eps, 8\/2])\n rotate([-90, 0, 0])\n cylinder(d=2.5, h=width+2*eps, $fn=60);\n }\n }\n}\n\n\nfor(i=[0,1])\n translate([-12, i*22, 0])\n roller_main();\n\nholder();\n\n%if(true)\n translate([19, 2+3\/2, 8\/2])\n rotate([-90, 0, 0])\n union()\n {\n roller_main();\n rotate([0, 0, 180])\n translate([0, 0, 11])\n rotate([180, 0, 0])\n roller_main();\n }\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"550f5bb34c8074f162b753c0fc8c1411329250f4","subject":"rod-clamps: Add full\/half clamp modules","message":"rod-clamps: Add full\/half clamp modules\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4)\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick=thick_*1.5;\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n cubea([base_thick, screw_dist_+thread_dia*2, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4)\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?rod_d+thread_dia*2+thick_+thread_dia\/2:screw_dist;\n base_thick=thick_*1.5;\n difference()\n {\n union()\n {\n difference()\n {\n fncylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n translate([-rod_d\/2,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n }\n translate([-rod_d\/2,0,0])\n cubea([base_thick, screw_dist_+thread_dia*2, width], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n fncylindera(d=thread_dia, h=base_thick*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n fncylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\/*mount_rod_clamp_full(rod_d=xaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'rod-clamps.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a4f273f96bd10e42f27a34bfb0f55a765cc08af3","subject":"'fleshing out' arm","message":"'fleshing out' arm\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"7cf6cb554aa3b2c88d05d5cd22c2b0a0e9977df4","subject":"screws: add support for setscrew head","message":"screws: add support for setscrew head\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n difference()\n {\n union()\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=\"pos\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n }\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=\"neg\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"button\")\n {\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"set\")\n {\n if(drive == \"hex\")\n {\n \/\/ set head uses -1*mm smaller hex\n tz(-head_h)\n cylindera(d = fn_radius(threadsize-1, 6), h = 1000, $fn = 6, align=Z);\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"82d6743531670efe6d3545a07a2234688955eaef","subject":"Base: remove rogue translate so that wheels are in the centre or the wheel slots again","message":"Base: remove rogue translate so that wheels are in the centre or the wheel slots again\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/LogoBotBase.scad","new_file":"hardware\/printedparts\/LogoBotBase.scad","new_contents":"\/*\n\tSTL: LogoBotBase_STL\n\n\tThe printable base plate for the robot.\n\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\n\tParameters:\n\t\tNone\n\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\nmodule LogoBotBase_STL() {\n\n\t\/\/ turn off explosions inside STL!!!\n\t$Explode = false;\n\n\tprintedPart(\"printedparts\/LogoBotBase.scad\", \"Base\", \"LogoBotBase_STL()\") {\n\n\t\tview(t=[0,0,0], r=[58,0,225], d=681);\n\n\t\t\/\/ Color it as a printed plastic part\n\t\tcolor(PlasticColor)\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Base.stl\"));\n\t\t\t} else {\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\t\/\/ Start with an extruded base plate, with all the relevant holes punched in it\n\t\t\t\t\tlinear_extrude(BaseThickness)\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\/\/ Union together all the bits to make the plate\n\t\t\t\t\t\t\tunion() {\n\t\t\t\t\t\t\t\t\/\/ Base plate\n\t\t\t\t\t\t\t\tcircle(r=BaseDiameter\/2);\n\t\t\t\t\t\t\t}\n\n\/*\n\t\t\t\t\t\t\t\/\/ hole for breadboard\n\t\t\t\t\t\t\tattach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170))\n\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\ttranslate([2,2,0])\n\t\t\t\t\t\t\t\t\t\tsquare([Breadboard_Width(Breadboard_170)-4, Breadboard_Depth(Breadboard_170)-4]);\n\n\t\t\t\t\t\t\t\t\t\/\/ attach mounting points, has the effect of not differencing them\n\t\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon) {\n\t\t\t\t\t\t\t\t\t\tcircle(r=4\/2 + dw);\n\t\t\t\t\t\t\t\t\t\ttranslate([0, -2 - dw, 0])\n\t\t\t\t\t\t\t\t\t\t\tsquare([10, 4 + 2*dw]);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomRight(Breadboard_170),DefCon) {\n\t\t\t\t\t\t\t\t\t\tcircle(r=4\/2 + dw);\n\t\t\t\t\t\t\t\t\t\trotate([0,0,180])\n\t\t\t\t\t\t\t\t\t\t\ttranslate([0, -2 - dw, 0])\n\t\t\t\t\t\t\t\t\t\t\tsquare([10, 4 + 2*dw]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\/\/ mounting holes for breadboard\n\t\t\t\t\t\t\tattach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170)) {\n\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon)\n\t\t\t\t\t\t\t\t\tcircle(r=4.3\/2);\n\n\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomRight(Breadboard_170),DefCon)\n\t\t\t\t\t\t\t\t\tcircle(r=4.3\/2);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\/\/ weight loss holes under the motor drivers\n\t\t\t\t\t\t\tattach(LogoBot_Con_LeftMotorDriver, (ULN2003DriverBoard_Con_UpperLeft))\n\t\t\t\t\t\t\t\troundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\n\t\t\t\t\t\t\t\/\/ Right Motor Driver\n\t\t\t\t\t\t\tattach(LogoBot_Con_RightMotorDriver, (ULN2003DriverBoard_Con_UpperRight))\n\t\t\t\t\t\t\t\troundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n*\/\n\t\t\t\t\t\t\t\/\/ slots for wheels\n\t\t\t\t\t\t\tfor (i=[0:1])\n\t\t\t\t\t\t\t\tmirror([i,0,0])\n\t\t\t\t\t\t\t\ttranslate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n\t\t\t\t\t\t\t\troundedSquare([WheelThickness + tw, WheelDiameter + tw], (WheelThickness + tw)\/2, center=true);\n\n\n\n\t\t\t\t\t\t\t\/\/ Centre hole for pen\n\t\t\t\t\t\t\tcircle(r=PenHoleDiameter\/2);\n\n\t\t\t\t\t\t\t\/\/ Chevron at the front so we're clear where the front is!\n\t\t\t\t\t\t\t*translate([0, BaseBigHolesRadius - 3, 0])\n\t\t\t\t\t\t\t\tchevron(width=10, height=6, thickness=3);\n\n\t\t\t\t\t\t\t\/\/ Caster\n\t\t\t\t\t\t\t\/\/ TODO: Replace with sep \"skid\" part and pin connector\n\t\t\t\t\t\t\t\/\/attach(LogoBot_Con_Caster, MarbleCaster_Con_Default)\n\t\t\t\t\t\t\t\/\/ circle(r = connector_bore(MarbleCaster_Con_Default) \/ 2);\n\n\n\t\t\t\t\t\t\tif (false) {\n\t\t\t\t\t\t\t\tLogoBotBase_RadialHoles();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tLogoBotBase_GridHoles();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\/\/ Remove shell fittings\n\t\t\t\t\t\t\tShell_TwistLockCutouts();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\/\/ Now union on any other bits (i.e. sticky-up bits!)\n\n\t\t\t\t\t\/\/ clips for the motors\n\t\t\t\t\t\/\/ TODO: Move these into separate printed part\n\t\t\t\t\t\/\/LogoBotBase_MotorClips();\n\n\t\t\t\t\t\/\/ Not required in new design, they will be integrated with the motor clips\n\t\t\t\t\t\/\/LogoBotBase_MotorDriverPosts();\n\n\n\t\t\t\t}\n\t\t\t}\n\t}\n}\n\nmodule LogoBotBase_GridHoles() {\n\n\tpitch = 10;\n\txn = round((BaseDiameter \/ pitch)\/2) + 1;\n\tyn = xn;\n\n\tfor (x=[-xn:xn], y=[-yn:yn]) {\n\t\tif (\n\t\t\tcircleInCircle(BaseDiameter\/2 - dw, x*pitch, y*pitch, PinDiameter\/2) &&\n\t\t\tcircleOutsideCircle(PenHoleDiameter\/2 + dw, x*pitch, y*pitch, PinDiameter\/2) &&\n\t\t\tabs(x*pitch) <= BaseDiameter\/2 + MotorOffsetX - 1 - dw - PinDiameter\/2\n\t\t) {\n\t\t\ttranslate([x*pitch, y*pitch,0])\n\t\t\t\tcircle(r=PinDiameter\/2, $fn=20);\n\t\t}\n\n\t}\n\n}\n\nfunction circleInCircle(r1,x,y,r2) = sqrt(sqr(x)+sqr(y))+r2 <= r1;\n\nfunction circleOutsideCircle(r1,x,y,r2) = !circleInCircle(r1 + 2*r2,x,y,r2);\n\nfunction circleIntersectSquare(x1,y1,x2,y2,x,y,r) = pointInSquare(x1,y1,x2,y2,x,y) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x1,y1,x2,y1,x,y,r) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x1,y2,x2,y2,x,y,r) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x1,y1,x1,y2,x,y,r) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x2,y1,x2,y2,x,y,r);\n\nfunction pointInSquare(x1,y1,x2,y2,x,y) = x>=x1 && x<=x2 && y>=y1 && y<=y2;\n\nfunction circleIntersectLine(x1,y1,x2,y2,x,y,r) = circleInCircle(r,x-x1,y-y1,0) ||\n\t\t\t\t\t\t\t\t\t\t\t\tcircleInCircle(r,x-x2,y-y2,0) ||\n\t\t\t\t\t\t\t\t\t\t\t\tfalse;\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ TODO: fix this!!\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/((abs((x2-x1)*(y-y1) - (x-x1)*(y2-y1)) \/ sqrt(sqr(x2-x1) + sqr(y2-y1))) <= r);\n\n\n\nmodule LogoBotBase_RadialHoles() {\n\n\t\/\/ Outer fixing holes - for bumpers, sensors, etc\n\tfor (ang=[-3:3], frontBack=[0,1])\n\t\tmirror([0,frontBack,0])\n\t\trotate([0, 0, ang * 15 + 90])\n\t\ttranslate([BaseOuterFixingsRadius, 0, 0])\n\t\tcircle(r=PinDiameter\/2, $fn=20);\n\n\t\/\/ Mid fixing holes - motor drivers, battery pack\n\tfor (i=[0:360\/15])\n\t\trotate([0, 0, i*15])\n\t\ttranslate([BaseMiddleFixingsRadius, 0, 0])\n\t\tcircle(r=PinDiameter\/2, $fn=20);\n\n\n\t\/\/ Inner fixing holes (around pen hole) - for pen lift\n\tfor (i=[0:360\/30])\n\t\trotate([0, 0, i*30])\n\t\ttranslate([BaseInnerFixingsRadius, 0, 0])\n\t\tcircle(r=PinDiameter\/2, $fn=20);\n\n\n\t\/\/ Ring of big holes\n\n\tfor (i=[0:360\/60])\n\t\trotate([0, 0, i*60])\n\t\ttranslate([BaseBigHolesRadius, 0, 0])\n\t\tcircle(r=BaseBigHoleRadius, $fn=20);\n\n}\n\n\nmodule LogoBotBase_MotorClips() {\n\t\/\/ TODO: feed these local variables from the motor vitamin global vars\n\tmbr = 28\/2; \/\/ motor body radius\n\tmao = 8; \/\/ motor axle offset from centre of motor body\n\tmth = 7; \/\/ motor tab height\n\n\t\/\/ clips\n\tfor (i=[0:1], j=[0,1])\n\t\tmirror([i,0,0])\n\t\ttranslate([BaseDiameter\/2 + MotorOffsetX - 6 - j*12, 0, MotorOffsetZ + mao])\n\t\trotate([-90, 0, 90])\n\t\trotate([0,0, 0])\n\t\tlinear_extrude(5) {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\thull() {\n\t\t\t\t\t\t\t\/\/ main circle\n\t\t\t\t\t\t\tcircle(r=mbr + dw);\n\n\t\t\t\t\t\t\t\/\/ extension to correctly union to the base plate\n\t\t\t\t\t\t\ttranslate([-(mbr * 1.5)\/2, MotorOffsetZ + mao -1,0])\n\t\t\t\t\t\t\t\tsquare([mbr * 1.5, 1]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\/\/ trim the top off\n\t\t\t\t\t\trotate([0,0,180 + 30])\n\t\t\t\t\t\t\tsector(r=mbr+30, a=120);\n\t\t\t\t\t}\n\n\t\t\t\t\t\/\/ welcoming hands\n\t\t\t\t\tfor (k=[0,1])\n\t\t\t\t\t\tmirror([k,0,0])\n\t\t\t\t\t\trotate([0,0,180+30])\n\t\t\t\t\t\ttranslate([mbr, -dw, 0])\n\t\t\t\t\t\tpolygon([[1.5,0],[4,5],[3,5],[0,dw]],4);\n\t\t\t\t}\n\n\t\t\t\t\/\/ hollow for the motor\n\t\t\t\tcircle(r=mbr);\n\n\t\t\t}\n\t\t}\n}\n\nmodule LogoBotBase_MotorDriverPosts() {\n\t\/\/ mounting posts for motor drivers\n\t\/\/ using a mirror because the layout is symmetrical\n\n\tfor (i=[0,1])\n\t\tmirror([i,0,0])\n\t\t\tfor (j=[0:3])\n\t\t\t\tattach(offsetConnector(LogoBot_Con_RightMotorDriver, [0,0,-LogoBot_Con_RightMotorDriver[0][2]]),\n\t\t\t\t\t\tULN2003DriverBoard_Cons[j],\n\t\t\t\t\t\t$Explode=false)\n\t\t\t\tLogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_RightMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n}\n\nmodule LogoBotBase_MountingPost(r1=5\/2, h1=3, r2=3\/2, h2=3) {\n\tcylinder(r=r1, h=h1);\n\ttranslate([0,0,h1-eta])\n\t\tcylinder(r1=r2, r2=r2 * 0.7, h=h2 +eta);\n}\n","old_contents":"\/*\n\tSTL: LogoBotBase_STL\n\n\tThe printable base plate for the robot.\n\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\n\tParameters:\n\t\tNone\n\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\nmodule LogoBotBase_STL() {\n\n\t\/\/ turn off explosions inside STL!!!\n\t$Explode = false;\n\n\tprintedPart(\"printedparts\/LogoBotBase.scad\", \"Base\", \"LogoBotBase_STL()\") {\n\n\t\tview(t=[0,0,0], r=[58,0,225], d=681);\n\n\t\t\/\/ Color it as a printed plastic part\n\t\tcolor(PlasticColor)\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Base.stl\"));\n\t\t\t} else {\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\t\/\/ Start with an extruded base plate, with all the relevant holes punched in it\n\t\t\t\t\tlinear_extrude(BaseThickness)\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\/\/ Union together all the bits to make the plate\n\t\t\t\t\t\t\tunion() {\n\t\t\t\t\t\t\t\t\/\/ Base plate\n\t\t\t\t\t\t\t\tcircle(r=BaseDiameter\/2);\n\t\t\t\t\t\t\t}\n\n\/*\n\t\t\t\t\t\t\t\/\/ hole for breadboard\n\t\t\t\t\t\t\tattach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170))\n\t\t\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\t\ttranslate([2,2,0])\n\t\t\t\t\t\t\t\t\t\tsquare([Breadboard_Width(Breadboard_170)-4, Breadboard_Depth(Breadboard_170)-4]);\n\n\t\t\t\t\t\t\t\t\t\/\/ attach mounting points, has the effect of not differencing them\n\t\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon) {\n\t\t\t\t\t\t\t\t\t\tcircle(r=4\/2 + dw);\n\t\t\t\t\t\t\t\t\t\ttranslate([0, -2 - dw, 0])\n\t\t\t\t\t\t\t\t\t\t\tsquare([10, 4 + 2*dw]);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomRight(Breadboard_170),DefCon) {\n\t\t\t\t\t\t\t\t\t\tcircle(r=4\/2 + dw);\n\t\t\t\t\t\t\t\t\t\trotate([0,0,180])\n\t\t\t\t\t\t\t\t\t\t\ttranslate([0, -2 - dw, 0])\n\t\t\t\t\t\t\t\t\t\t\tsquare([10, 4 + 2*dw]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\/\/ mounting holes for breadboard\n\t\t\t\t\t\t\tattach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170)) {\n\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon)\n\t\t\t\t\t\t\t\t\tcircle(r=4.3\/2);\n\n\t\t\t\t\t\t\t\tattach(Breadboard_Con_BottomRight(Breadboard_170),DefCon)\n\t\t\t\t\t\t\t\t\tcircle(r=4.3\/2);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\/\/ weight loss holes under the motor drivers\n\t\t\t\t\t\t\tattach(LogoBot_Con_LeftMotorDriver, (ULN2003DriverBoard_Con_UpperLeft))\n\t\t\t\t\t\t\t\troundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\n\t\t\t\t\t\t\t\/\/ Right Motor Driver\n\t\t\t\t\t\t\tattach(LogoBot_Con_RightMotorDriver, (ULN2003DriverBoard_Con_UpperRight))\n\t\t\t\t\t\t\t\troundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n*\/\n\t\t\t\t\t\t\t\/\/ slots for wheels\n\t\t\t\t\t\t\tfor (i=[0:1])\n\t\t\t\t\t\t\t\tmirror([i,0,0])\n\t\t\t\t\t\t\t\ttranslate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n\t\t\t\t\t\t\t\ttranslate([-1,0,0])\n\t\t\t\t\t\t\t\troundedSquare([WheelThickness + tw, WheelDiameter + tw], (WheelThickness + tw)\/2, center=true);\n\n\n\n\t\t\t\t\t\t\t\/\/ Centre hole for pen\n\t\t\t\t\t\t\tcircle(r=PenHoleDiameter\/2);\n\n\t\t\t\t\t\t\t\/\/ Chevron at the front so we're clear where the front is!\n\t\t\t\t\t\t\t*translate([0, BaseBigHolesRadius - 3, 0])\n\t\t\t\t\t\t\t\tchevron(width=10, height=6, thickness=3);\n\n\t\t\t\t\t\t\t\/\/ Caster\n\t\t\t\t\t\t\t\/\/ TODO: Replace with sep \"skid\" part and pin connector\n\t\t\t\t\t\t\t\/\/attach(LogoBot_Con_Caster, MarbleCaster_Con_Default)\n\t\t\t\t\t\t\t\/\/ circle(r = connector_bore(MarbleCaster_Con_Default) \/ 2);\n\n\n\t\t\t\t\t\t\tif (false) {\n\t\t\t\t\t\t\t\tLogoBotBase_RadialHoles();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tLogoBotBase_GridHoles();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\/\/ Remove shell fittings\n\t\t\t\t\t\t\tShell_TwistLockCutouts();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\/\/ Now union on any other bits (i.e. sticky-up bits!)\n\n\t\t\t\t\t\/\/ clips for the motors\n\t\t\t\t\t\/\/ TODO: Move these into separate printed part\n\t\t\t\t\t\/\/LogoBotBase_MotorClips();\n\n\t\t\t\t\t\/\/ Not required in new design, they will be integrated with the motor clips\n\t\t\t\t\t\/\/LogoBotBase_MotorDriverPosts();\n\n\n\t\t\t\t}\n\t\t\t}\n\t}\n}\n\nmodule LogoBotBase_GridHoles() {\n\n\tpitch = 10;\n\txn = round((BaseDiameter \/ pitch)\/2) + 1;\n\tyn = xn;\n\n\tfor (x=[-xn:xn], y=[-yn:yn]) {\n\t\tif (\n\t\t\tcircleInCircle(BaseDiameter\/2 - dw, x*pitch, y*pitch, PinDiameter\/2) &&\n\t\t\tcircleOutsideCircle(PenHoleDiameter\/2 + dw, x*pitch, y*pitch, PinDiameter\/2) &&\n\t\t\tabs(x*pitch) <= BaseDiameter\/2 + MotorOffsetX - 1 - dw - PinDiameter\/2\n\t\t) {\n\t\t\ttranslate([x*pitch, y*pitch,0])\n\t\t\t\tcircle(r=PinDiameter\/2, $fn=20);\n\t\t}\n\n\t}\n\n}\n\nfunction circleInCircle(r1,x,y,r2) = sqrt(sqr(x)+sqr(y))+r2 <= r1;\n\nfunction circleOutsideCircle(r1,x,y,r2) = !circleInCircle(r1 + 2*r2,x,y,r2);\n\nfunction circleIntersectSquare(x1,y1,x2,y2,x,y,r) = pointInSquare(x1,y1,x2,y2,x,y) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x1,y1,x2,y1,x,y,r) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x1,y2,x2,y2,x,y,r) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x1,y1,x1,y2,x,y,r) ||\n\t\t\t\t\t\t\t\t\t\t\t\t\tcircleIntersectLine(x2,y1,x2,y2,x,y,r);\n\nfunction pointInSquare(x1,y1,x2,y2,x,y) = x>=x1 && x<=x2 && y>=y1 && y<=y2;\n\nfunction circleIntersectLine(x1,y1,x2,y2,x,y,r) = circleInCircle(r,x-x1,y-y1,0) ||\n\t\t\t\t\t\t\t\t\t\t\t\tcircleInCircle(r,x-x2,y-y2,0) ||\n\t\t\t\t\t\t\t\t\t\t\t\tfalse;\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/ TODO: fix this!!\n\t\t\t\t\t\t\t\t\t\t\t\t\/\/((abs((x2-x1)*(y-y1) - (x-x1)*(y2-y1)) \/ sqrt(sqr(x2-x1) + sqr(y2-y1))) <= r);\n\n\n\nmodule LogoBotBase_RadialHoles() {\n\n\t\/\/ Outer fixing holes - for bumpers, sensors, etc\n\tfor (ang=[-3:3], frontBack=[0,1])\n\t\tmirror([0,frontBack,0])\n\t\trotate([0, 0, ang * 15 + 90])\n\t\ttranslate([BaseOuterFixingsRadius, 0, 0])\n\t\tcircle(r=PinDiameter\/2, $fn=20);\n\n\t\/\/ Mid fixing holes - motor drivers, battery pack\n\tfor (i=[0:360\/15])\n\t\trotate([0, 0, i*15])\n\t\ttranslate([BaseMiddleFixingsRadius, 0, 0])\n\t\tcircle(r=PinDiameter\/2, $fn=20);\n\n\n\t\/\/ Inner fixing holes (around pen hole) - for pen lift\n\tfor (i=[0:360\/30])\n\t\trotate([0, 0, i*30])\n\t\ttranslate([BaseInnerFixingsRadius, 0, 0])\n\t\tcircle(r=PinDiameter\/2, $fn=20);\n\n\n\t\/\/ Ring of big holes\n\n\tfor (i=[0:360\/60])\n\t\trotate([0, 0, i*60])\n\t\ttranslate([BaseBigHolesRadius, 0, 0])\n\t\tcircle(r=BaseBigHoleRadius, $fn=20);\n\n}\n\n\nmodule LogoBotBase_MotorClips() {\n\t\/\/ TODO: feed these local variables from the motor vitamin global vars\n\tmbr = 28\/2; \/\/ motor body radius\n\tmao = 8; \/\/ motor axle offset from centre of motor body\n\tmth = 7; \/\/ motor tab height\n\n\t\/\/ clips\n\tfor (i=[0:1], j=[0,1])\n\t\tmirror([i,0,0])\n\t\ttranslate([BaseDiameter\/2 + MotorOffsetX - 6 - j*12, 0, MotorOffsetZ + mao])\n\t\trotate([-90, 0, 90])\n\t\trotate([0,0, 0])\n\t\tlinear_extrude(5) {\n\t\t\tdifference() {\n\t\t\t\tunion() {\n\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\thull() {\n\t\t\t\t\t\t\t\/\/ main circle\n\t\t\t\t\t\t\tcircle(r=mbr + dw);\n\n\t\t\t\t\t\t\t\/\/ extension to correctly union to the base plate\n\t\t\t\t\t\t\ttranslate([-(mbr * 1.5)\/2, MotorOffsetZ + mao -1,0])\n\t\t\t\t\t\t\t\tsquare([mbr * 1.5, 1]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\/\/ trim the top off\n\t\t\t\t\t\trotate([0,0,180 + 30])\n\t\t\t\t\t\t\tsector(r=mbr+30, a=120);\n\t\t\t\t\t}\n\n\t\t\t\t\t\/\/ welcoming hands\n\t\t\t\t\tfor (k=[0,1])\n\t\t\t\t\t\tmirror([k,0,0])\n\t\t\t\t\t\trotate([0,0,180+30])\n\t\t\t\t\t\ttranslate([mbr, -dw, 0])\n\t\t\t\t\t\tpolygon([[1.5,0],[4,5],[3,5],[0,dw]],4);\n\t\t\t\t}\n\n\t\t\t\t\/\/ hollow for the motor\n\t\t\t\tcircle(r=mbr);\n\n\t\t\t}\n\t\t}\n}\n\nmodule LogoBotBase_MotorDriverPosts() {\n\t\/\/ mounting posts for motor drivers\n\t\/\/ using a mirror because the layout is symmetrical\n\n\tfor (i=[0,1])\n\t\tmirror([i,0,0])\n\t\t\tfor (j=[0:3])\n\t\t\t\tattach(offsetConnector(LogoBot_Con_RightMotorDriver, [0,0,-LogoBot_Con_RightMotorDriver[0][2]]),\n\t\t\t\t\t\tULN2003DriverBoard_Cons[j],\n\t\t\t\t\t\t$Explode=false)\n\t\t\t\tLogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_RightMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n}\n\nmodule LogoBotBase_MountingPost(r1=5\/2, h1=3, r2=3\/2, h2=3) {\n\tcylinder(r=r1, h=h1);\n\ttranslate([0,0,h1-eta])\n\t\tcylinder(r1=r2, r2=r2 * 0.7, h=h2 +eta);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"99530c2446d2a37d40e8edee6429a1d0048bfa0e","subject":"Update cushiongrab.scad","message":"Update cushiongrab.scad\n","repos":"josephmjoy\/funstuff","old_file":"models\/cushiongrab\/cushiongrab.scad","new_file":"models\/cushiongrab\/cushiongrab.scad","new_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\ntri_height = 5;\nbase_thickness = 1;\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([3*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ pan - upside down pan used for differencing\nmodule pan(width) {\n r = 7;\n ceiling_height = tri_height + base_thickness; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n n = width \/ (3*tri_height); \/\/ each row is 3*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0]) \n difference() {\n union() { \n cube([width, base_thickness, width]);\n translate([tri_height, base_thickness, 0]) prism_rows(tri_height, width, n);\n }\n pan(width);\n }\n}\n\n\ncushion_grabber(125);\n\/\/pan(100);\n\n\n\n\n\n","old_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\ntri_height = 5;\nbase_thickness = 1;\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([3*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ Dome - used for differencing\nmodule dome(width) {\n r = 7;\n ceiling_height = tri_height + base_thickness; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n n = width \/ (3*tri_height); \/\/ each row is 3*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0]) \n difference() {\n union() { \n cube([width, base_thickness, width]);\n translate([tri_height, base_thickness, 0]) prism_rows(tri_height, width, n);\n }\n dome(width);\n }\n}\n\n\ncushion_grabber(125);\n\/\/dome(100);\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7cce69471f2163adc742fc32e1c96c45a4efebe6","subject":"Up issued the version number.","message":"Up issued the version number.\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/MicroSwitch.scad","new_file":"hardware\/vitamins\/MicroSwitch.scad","new_contents":"\/\/ MicroSwitch v1.1 by Gyrobot\r\n\/\/ http:\/\/www.gyrobot.co.uk\r\n\/\/\r\n\/\/ Default values based upon :\r\n\/\/ Farnell P\/N : 2352329\r\n\/\/ Omron Electronic Components P\/N : SS-01GLT\r\n\/\/\r\n\/\/ Datum X is centre of mounting hole with X pointing away from mounting slot.\r\n\/\/ Datum Y is pointing away from terminals towards the lever.\r\n\/\/ Datum Z is in on base of model.\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ ms_length = Length of body in X.\r\n\/\/ ms_width = Width of body in Y.\r\n\/\/ ms_height = Height (thickness) of body in Z.\r\n\/\/ ms_datxoffset = X Position of lower left corner of body from Datum hole.\r\n\/\/ ms_datyoffset = Y Position of lower left corner of body from Datum hole.\r\n\/\/ ms_orientation = Defines whether the switch is mounted left or right (0:1).\r\n\/\/ ms_hole_diam = Size of Datum mounting hole and slot width of second hole.\r\n\/\/ ms_xholepitch = Mounting hole X pitch.\r\n\/\/ ms_yholepitch = Mounting hole Y pitch.\r\n\/\/ ms_hole_slot_length = Slot length of second mounting hole.\r\n\/\/ ms_lever_length = Length of lever.\r\n\/\/ ms_lever_width = Width of lever.\r\n\/\/ ms_lever_thickness = Thickness of lever.\r\n\/\/ ms_lever_height = Height of lever (OP) from Datum hole.\r\n\/\/ ms_tab_length = Length of terminal tab from Datum hole.\r\n\/\/ ms_tab_width = Width of terminal tab.\r\n\/\/ ms_tab_thickness = Thickness of terminal tab.\r\n\/\/ ms_tab_hole_diam = Diameter of terminal tab hole.\r\n\/\/\r\n\r\nmodule microswitch(ms_length = 19.8, ms_width = 10.2, ms_height = 6.4, ms_datxoffset = -14.6, ms_datyoffset = -2.5, ms_orientation = 0, ms_hole_diam = 2.35, ms_xholepitch = 9.5, ms_yholepitch = 0, ms_hole_slot_length = 0.15, ms_lever_length = 14.5, ms_lever_width = 3.6, ms_lever_thickness = 0.3, ms_lever_height = 8.8, ms_tab_length = 6.4, ms_tab_width = 3.2, ms_tab_thickness = 0.3, ms_tab_hole_diam = 1.6){\r\n\r\n\tcutout_offset = 0.7;\r\n\tfoot_offset = ms_datyoffset - 0.4;\r\n\r\n\tmirror ([ms_orientation, 0, 0]){\r\n\t\t\/\/ Mirror to provide a left or right mounted switch.\r\n\t\t\/\/\r\n\t\ttranslate ([ms_datxoffset, ms_datyoffset, ms_height \/ 2]){\r\n\t\t\t\/\/Move datum position.\r\n\t\t\t\/\/\r\n\t\t\tcolor(\"DarkSlateGray\")\r\n\t\t\tlinear_extrude(ms_height, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Body\r\n\t\t\t\t\/\/\r\n\t\t\t\tdifference(){\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/Main body cuboid.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Subtractive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\ttranslate ([ms_length \/ 2, ms_width - cutout_offset]) \/\/ Move corner cutout.\r\n\t\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/ Corner cutout.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset]) \/\/ Move datum hole.\r\n\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32); \/\/ Remove datum hole.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch]){ \/\/ Move second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/ Second mounting hole (slot)\r\n\t\t\t\t\t\t\thull(){\r\n\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t\ttranslate ([ms_hole_slot_length, 0]) \/\/ Move circle to create slot.\r\n\t\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcolor(\"Silver\")\r\n\t\t\tlinear_extrude(ms_lever_width, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Lever\r\n\t\t\t\t\/\/\r\n\t\t\t\ttranslate([2.5 ,+ ms_lever_height - ms_datyoffset,0]) \/\/ Move lever to position\r\n\t\t\t\t\tmirror([0, 1, 0]) \/\/ Mirror lever to invert shape\r\n\t\t\t\t\t\tunion (){\r\n\t\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\t\tsquare ([ms_lever_length + 2.5 , ms_lever_thickness]);\r\n\t\t\t\t\t\t\tsquare ([ms_lever_thickness,ms_width \/ 2]);\r\n\t\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( x = [1.6, 10.4, 17.7]){\r\n\t\t\t\tcolor (\"Silver\")\r\n\t\t\t\ttranslate ([x, -ms_tab_length - ms_datyoffset, 0])\r\n\t\t\t\t\tterminal(ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/\r\n\/\/ Terminal module for solder pad. Other terminal types are available. \r\n\/\/\r\n\r\nmodule terminal (ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam){\r\n\trotate ([0,90,0]){\r\n\t\ttranslate ([ms_tab_width \/ -2,0,0]) {\r\n\t\t\tlinear_extrude(ms_tab_thickness, center=true){\r\n\t\t\t\tdifference (){\r\n\t\t\t\t\tsquare ([ms_tab_width , ms_tab_length]);\r\n\t\t\t\t\ttranslate ([ms_tab_width \/ 2, ms_tab_width \/ 2, 0])\r\n\t\t\t\t\t\tcircle (d = ms_tab_hole_diam, $fn = 32);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","old_contents":"\/\/ MicroSwitch v1.0 by Gyrobot\r\n\/\/ http:\/\/www.gyrobot.co.uk\r\n\/\/\r\n\/\/ Default values based upon :\r\n\/\/ Farnell P\/N : 2352329\r\n\/\/ Omron Electronic Components P\/N : SS-01GLT\r\n\/\/\r\n\/\/ Datum X is centre of mounting hole with X pointing away from mounting slot.\r\n\/\/ Datum Y is pointing away from terminals towards the lever.\r\n\/\/ Datum Z is in on base of model.\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ ms_length = Length of body in X.\r\n\/\/ ms_width = Width of body in Y.\r\n\/\/ ms_height = Height (thickness) of body in Z.\r\n\/\/ ms_datxoffset = X Position of lower left corner of body from Datum hole.\r\n\/\/ ms_datyoffset = Y Position of lower left corner of body from Datum hole.\r\n\/\/ ms_orientation = Defines whether the switch is mounted left or right (0:1).\r\n\/\/ ms_hole_diam = Size of Datum mounting hole and slot width of second hole.\r\n\/\/ ms_xholepitch = Mounting hole X pitch.\r\n\/\/ ms_yholepitch = Mounting hole Y pitch.\r\n\/\/ ms_hole_slot_length = Slot length of second mounting hole.\r\n\/\/ ms_lever_length = Length of lever.\r\n\/\/ ms_lever_width = Width of lever.\r\n\/\/ ms_lever_thickness = Thickness of lever.\r\n\/\/ ms_lever_height = Height of lever (OP) from Datum hole.\r\n\/\/ ms_tab_length = Length of terminal tab from Datum hole.\r\n\/\/ ms_tab_width = Width of terminal tab.\r\n\/\/ ms_tab_thickness = Thickness of terminal tab.\r\n\/\/ ms_tab_hole_diam = Diameter of terminal tab hole.\r\n\/\/\r\n\r\nmodule microswitch(ms_length = 19.8, ms_width = 10.2, ms_height = 6.4, ms_datxoffset = -14.6, ms_datyoffset = -2.5, ms_orientation = 0, ms_hole_diam = 2.35, ms_xholepitch = 9.5, ms_yholepitch = 0, ms_hole_slot_length = 0.15, ms_lever_length = 14.5, ms_lever_width = 3.6, ms_lever_thickness = 0.3, ms_lever_height = 8.8, ms_tab_length = 6.4, ms_tab_width = 3.2, ms_tab_thickness = 0.3, ms_tab_hole_diam = 1.6){\r\n\r\n\tcutout_offset = 0.7;\r\n\tfoot_offset = ms_datyoffset - 0.4;\r\n\r\n\tmirror ([ms_orientation, 0, 0]){\r\n\t\t\/\/ Mirror to provide a left or right mounted switch.\r\n\t\t\/\/\r\n\t\ttranslate ([ms_datxoffset, ms_datyoffset, ms_height \/ 2]){\r\n\t\t\t\/\/Move datum position.\r\n\t\t\t\/\/\r\n\t\t\tcolor(\"DarkSlateGray\")\r\n\t\t\tlinear_extrude(ms_height, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Body\r\n\t\t\t\t\/\/\r\n\t\t\t\tdifference(){\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/Main body cuboid.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Subtractive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\ttranslate ([ms_length \/ 2, ms_width - cutout_offset]) \/\/ Move corner cutout.\r\n\t\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/ Corner cutout.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset]) \/\/ Move datum hole.\r\n\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32); \/\/ Remove datum hole.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch]){ \/\/ Move second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/ Second mounting hole (slot)\r\n\t\t\t\t\t\t\thull(){\r\n\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t\ttranslate ([ms_hole_slot_length, 0]) \/\/ Move circle to create slot.\r\n\t\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcolor(\"Silver\")\r\n\t\t\tlinear_extrude(ms_lever_width, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Lever\r\n\t\t\t\t\/\/\r\n\t\t\t\ttranslate([2.5 ,+ ms_lever_height - ms_datyoffset,0]) \/\/ Move lever to position\r\n\t\t\t\t\tmirror([0, 1, 0]) \/\/ Mirror lever to invert shape\r\n\t\t\t\t\t\tunion (){\r\n\t\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\t\tsquare ([ms_lever_length + 2.5 , ms_lever_thickness]);\r\n\t\t\t\t\t\t\tsquare ([ms_lever_thickness,ms_width \/ 2]);\r\n\t\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( x = [1.6, 10.4, 17.7]){\r\n\t\t\t\tcolor (\"Silver\")\r\n\t\t\t\ttranslate ([x, -ms_tab_length - ms_datyoffset, 0])\r\n\t\t\t\t\tterminal(ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/\r\n\/\/ Terminal module for solder pad. Other terminal types are available. \r\n\/\/\r\n\r\nmodule terminal (ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam){\r\n\trotate ([0,90,0]){\r\n\t\ttranslate ([ms_tab_width \/ -2,0,0]) {\r\n\t\t\tlinear_extrude(ms_tab_thickness, center=true){\r\n\t\t\t\tdifference (){\r\n\t\t\t\t\tsquare ([ms_tab_width , ms_tab_length]);\r\n\t\t\t\t\ttranslate ([ms_tab_width \/ 2, ms_tab_width \/ 2, 0])\r\n\t\t\t\t\t\tcircle (d = ms_tab_hole_diam, $fn = 32);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d489ef9fd14861517d2dc699c4c1eefd6cbe6582","subject":"config: increase x carriage thickness","message":"config: increase x carriage thickness\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 12;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 12;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+1*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a3e044e982866867951d92b8b7fc1507c0a27281","subject":"tighten up for newer, lower spread printer","message":"tighten up for newer, lower spread printer\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/motorMount.scad","new_file":"Drawings\/motorMount.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/motorMount.scad $\n\/\/ $Id: motorMount.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\n\/\/ shape of small gearhead motor GA12YN20 from fasttech.com\nmodule gearheadMotorProxyGA12(pad) { union() {\ncube([10+pad,12+pad,9.2+pad],center=true);\ntranslate([0,0,-(9.2+pad)\/2-7.9]) difference() {\n cylinder(h=10,r=1.5,$fn=36);\n translate([1,-2,-.1]) cube([2,4,7.7]); }\nintersection() {\n translate([0,0,9.2\/2-1])cylinder(h=15+pad+1,r=(12+pad)\/2,$fn=48);\n cube([10+pad,12+pad,66],center=true); }\n}}\n\n\/\/ Slightly larger 60RPM gearhead motor.\n\/\/ same size? 35RPM GA16Y030 fasttech\nmodule gearheadMotorProxyGA16(pad) {\ndifference() { union(){\ntranslate([0,0,10-29]) cylinder(h=29,r=7.75+pad,$fn=64);\ncylinder(h=10+5,r=1.5,$fn=36);\n}\ntranslate([ 6 ,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([-6-5,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([1.5-(3-2.44),-2,1+10]) cube([2,4,5]);\n}}\n\n\/\/ larger 30RPM gearhead (as delivered) motor GA25Y310 fasttech\n\/\/ photo and specs on site do not match delivered product.\n\/\/ drawing is of delivered product, marked 25GA370-98, 30RPM\nmodule gearheadMotorProxyGA25(pad) {\ndifference() { union(){\ntranslate([0,0,-31]) cylinder(h=32,r=12.2+pad,$fn=64);\ncylinder(h=23.5,r=12.6+pad,$fn=64);\ntranslate([0,0,24]) cylinder(h=10,r=2,$fn=36);\ntranslate([0,0,23]) cylinder(h=2.5,r=3.5,$fn=36);\n}\ntranslate([1.5,-3,23.5+3]) cube([2,6,8]);\n}}\n\nbh=4;\nbr1=2;\nbr2=1.5;\n\nmodule ulc(dx,dy) { translate([-20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule urc(dx,dy) { translate([ 20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule llc() { translate([ -6, -30,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\nmodule lrc() { translate([ 6, -30,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\n\ndtFuzz = 0.08; \/\/ fuzz to add to dove tail slots\n\nmodule motorMount() {\n difference() {\n union() {\n hull() { ulc(0,0); urc(0,0); }\n hull() { ulc(2,-1); urc(-2,-1); }\n hull() { ulc(0,0); llc(); }\n hull() { urc(0,0); lrc(); }\n for (a=[-1,1]) hull() { \n translate([.6*a, -2,0]) cylinder(h=bh ,r1=2,r2=0.5,$fn=6);\n translate([ 7*a,-25,0]) cylinder(h=bh+2,r1=2,r2=0.5,$fn=6);\n }\n\n hull() for (a=[-1,1]) {\n translate([5*a,-24,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([4*a,-32,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n }\n }\n\n \/\/ dove-tail receivers, 2x as high as actual, with 2x radius reduction\n \/\/ so they have the same wall slope, but are extra long to make\n \/\/ sure they cut all the way through the top brace bar\n for (a=[-1,1]) translate([10*a,-1,1-0.1]) rotate([0,0,-30])\n cylinder(h=6,r2=5+dtFuzz,r1=3+dtFuzz,$fn=3);\n\n #translate([0,-30,3.9]) gearheadMotorProxyGA12(0.4);\n }\n}\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\n translate([-30,0,0]) cube([60,7,.4]);\n translate([-13,-42,0]) cube([26,.1,.4]); }\ntranslate([0,0,.2]) motorMount();\n}}\nelse { motorMount(); }\n\n\/\/%translate([0,30,0]) gearheadMotorProxyGA16(0);\n\/\/%translate([30,0,0]) gearheadMotorProxyGA12(0.2);\n\/\/%translate([-40,0,0]) gearheadMotorProxyGA25(0.2);","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/motorMount.scad $\n\/\/ $Id: motorMount.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\n\/\/ shape of small gearhead motor GA12YN20 from fasttech.com\nmodule gearheadMotorProxyGA12(pad) { union() {\ncube([10+pad,12+pad,9.2+pad],center=true);\ntranslate([0,0,-(9.2+pad)\/2-7.9]) difference() {\n cylinder(h=10,r=1.5,$fn=36);\n translate([1,-2,-.1]) cube([2,4,7.7]); }\nintersection() {\n translate([0,0,9.2\/2-1])cylinder(h=15+pad+1,r=(12+pad)\/2,$fn=48);\n cube([10+pad,12+pad,66],center=true); }\n}}\n\n\/\/ Slightly larger 60RPM gearhead motor.\n\/\/ same size? 35RPM GA16Y030 fasttech\nmodule gearheadMotorProxyGA16(pad) {\ndifference() { union(){\ntranslate([0,0,10-29]) cylinder(h=29,r=7.75+pad,$fn=64);\ncylinder(h=10+5,r=1.5,$fn=36);\n}\ntranslate([ 6 ,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([-6-5,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([1.5-(3-2.44),-2,1+10]) cube([2,4,5]);\n}}\n\n\/\/ larger 30RPM gearhead (as delivered) motor GA25Y310 fasttech\n\/\/ photo and specs on site do not match delivered product.\n\/\/ drawing is of delivered product, marked 25GA370-98, 30RPM\nmodule gearheadMotorProxyGA25(pad) {\ndifference() { union(){\ntranslate([0,0,-31]) cylinder(h=32,r=12.2+pad,$fn=64);\ncylinder(h=23.5,r=12.6+pad,$fn=64);\ntranslate([0,0,24]) cylinder(h=10,r=2,$fn=36);\ntranslate([0,0,23]) cylinder(h=2.5,r=3.5,$fn=36);\n}\ntranslate([1.5,-3,23.5+3]) cube([2,6,8]);\n}}\n\nbh=5;\nbr1=2.2;\nbr2=2;\n\nmodule ulc(dx,dy) { translate([-20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule urc(dx,dy) { translate([ 20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule llc() { translate([ -6, -30,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule lrc() { translate([ 6, -30,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\n\nmodule motorMount() { difference() { union() {\n\/\/hull() { translate([-22,-1.5,0]) cube([44,2,5]);\n\/\/ translate([ -8,-32 ,0]) cube([16,1,5]); }\nhull() { ulc(0,0); urc(0,0); }\nhull() { ulc(2,-2); urc(-2,-2); }\n\/\/hull() { llc(); lrc(); }\nhull() { ulc(0,0); llc(); }\nhull() { urc(0,0); lrc(); }\nhull() { translate([ 0, -3,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6);\n translate([-7,-22,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nhull() { translate([ 0, -3,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6);\n translate([ 7,-22,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\n\/\/translate([-17,-5,0]) cylinder(h=bh,r1=4.2,r2=4,$fn=6);\n\n\/\/translate([-8,-30,0]) cube([16,13,5]);\nhull() {\n translate([-5,-24,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([-4,-32,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n\n translate([ 5,-24,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([ 4,-32,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n}}\n#translate([0,-30,3.9]) gearheadMotorProxyGA12(0.4);\ntranslate([ 10,0,0.8]) rotate([0,0,-30]) cylinder(h=4.4,r2=4+.4,r1=3+.2,$fn=3);\ntranslate([-10,0,0.8]) rotate([0,0,-30]) cylinder(h=4.4,r2=4+.4,r1=3+.2,$fn=3);\n}}\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\n translate([-30,0,0]) cube([60,7,.4]);\n translate([-13,-42,0]) cube([26,.1,.4]); }\ntranslate([0,0,.2]) motorMount();\n}}\nelse { motorMount(); }\n\n\/\/%translate([0,30,0]) gearheadMotorProxyGA16(0);\n\/\/%translate([30,0,0]) gearheadMotorProxyGA12(0.2);\n\/\/%translate([-40,0,0]) gearheadMotorProxyGA25(0.2);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a8c460ab686e10b46ab4032020070d9e38dce0e1","subject":"bigger rail","message":"bigger rail\n","repos":"DamCB\/mush","old_file":"scad\/openscad\/grip.scad","new_file":"scad\/openscad\/grip.scad","new_contents":"module _lower_grip(){\n union(){\n difference(){\n union(){\n hull(){\n translate([0., -1.]) circle(0.5);\n translate([1.25, -1.]) circle(0.5);\n }\n translate([0., -1]) square([1.75, 1]);\n }\n hull(){\n circle(0.55);\n translate([-0.95, 0.5]) circle(0.05);\n translate([-1., -0.5]) square(1.);\n translate([-0.95, -0.5]) circle(0.05);\n }\n }\n }\n}\n\n\nmodule _upper_grip(){\n union(){\n difference(){\n union(){\n translate([-1.25, 0.5]) circle(1);\n translate([-1.5, 0.5]) square(0.5);\n hull(){\n translate([-1., 1.]) circle(0.5);\n translate([1.25, 1.]) circle(0.5);\n }\n translate([0., 0]) square([1.75, 1]);\n }\n hull(){\n circle(0.55);\n translate([-0.95, 0.5]) circle(0.05);\n translate([-1., -0.5]) square(1.);\n translate([-0.95, -0.5]) circle(0.05);\n }\n }\n }\n}\n\n\n\nmodule _grip(e=2.){\n union(){\n translate([0., -(e-1)\/2]) _lower_grip();\n translate([0.55, -(e-1)\/2]) square([1.2, e - 1]);\n translate([0., (e-1)\/2]) _upper_grip();\n }\n}\n\n\nmodule left_grip(e=2., phi_sphere=20., shift=1.){\n angle = (2*(shift+1.75) \/ phi_sphere) * 180\/3.1415926;\n\n rotate([0, 6, 0]) rotate([0, 0, 90]) rotate([0, -90, 0])\n rotate_extrude(angle=12){\n rotate([0, 0, angle])\n translate([phi_sphere\/2, 0])\n rotate([0, 0, -90]) _grip(e);\n }\n}\n\nmodule right_grip(e=2., phi_sphere=20., shift=1.){\n mirror([0, 1, 0]) left_grip(e=e, phi_sphere=phi_sphere, shift=shift);\n}\n\nmodule _hole(e=2., phi_sphere=20., clear=4.)\n{\n angle = (2*(clear\/2. + 1.75) \/ phi_sphere) * 180\/3.1415926;\n offset(r=0.15){\n union(){\n rotate([0, 0, angle])\n translate([phi_sphere\/2, 0])\n union(){\n rotate([0, 0, -90]) _grip(e=e);\n translate([-e\/2-1, -clear-1.]) square([2+e, clear]);\n }\n rotate([0, 0, -angle])\n translate([phi_sphere\/2, 0])\n mirror([0, 1, 0])\n union(){\n rotate([0, 0, -90]) _grip(e=e);\n translate([-e\/2-1, -clear-1.]) square([2+e, clear]);\n }\n translate([phi_sphere\/2+0.8, 0]) square([e+1, 2], center=true);\n }\n }\n}\n\/\/right_grip(e=2., phi_sphere=20., shift=3);\n\/\/left_grip(e=2., phi_sphere=20., shift=3);\n\nmodule sphere_hole(e=2, phi_sphere=20., clear=1, aperture=120){\n rotate([0, aperture\/2, 0])\n rotate([0, 0, 90])\n rotate([0, -90, 0])\n rotate_extrude(angle=aperture){\n _hole(e=e, phi_sphere=phi_sphere, clear=clear);\n }\n}\n","old_contents":"module _lower_grip(){\n union(){\n difference(){\n union(){\n hull(){\n translate([0., -1.]) circle(0.5);\n translate([1.25, -1.]) circle(0.5);\n }\n translate([0., -1]) square([1.75, 1]);\n }\n hull(){\n circle(0.55);\n translate([-0.95, 0.5]) circle(0.05);\n translate([-1., -0.5]) square(1.);\n translate([-0.95, -0.5]) circle(0.05);\n }\n }\n }\n}\n\n\nmodule _upper_grip(){\n union(){\n difference(){\n union(){\n translate([-1.25, 0.5]) circle(0.25);\n translate([-1.5, 0.5]) square(0.5);\n hull(){\n translate([-1., 1.]) circle(0.5);\n translate([1.25, 1.]) circle(0.5);\n }\n translate([0., 0]) square([1.75, 1]);\n }\n hull(){\n circle(0.55);\n translate([-0.95, 0.5]) circle(0.05);\n translate([-1., -0.5]) square(1.);\n translate([-0.95, -0.5]) circle(0.05);\n }\n }\n }\n}\n\n\n\nmodule _grip(e=2.){\n union(){\n translate([0., -(e-1)\/2]) _lower_grip();\n translate([0.55, -(e-1)\/2]) square([1.2, e - 1]);\n translate([0., (e-1)\/2]) _upper_grip();\n }\n}\n\n\nmodule left_grip(e=2., phi_sphere=20., shift=1.){\n angle = (2*(shift+1.75) \/ phi_sphere) * 180\/3.1415926;\n\n rotate([0, 6, 0]) rotate([0, 0, 90]) rotate([0, -90, 0])\n rotate_extrude(angle=12){\n rotate([0, 0, angle])\n translate([phi_sphere\/2, 0])\n rotate([0, 0, -90]) _grip(e);\n }\n}\n\nmodule right_grip(e=2., phi_sphere=20., shift=1.){\n mirror([0, 1, 0]) left_grip(e=e, phi_sphere=phi_sphere, shift=shift);\n}\n\nmodule _hole(e=2., phi_sphere=20., clear=4.)\n{\n angle = (2*(clear\/2. + 1.75) \/ phi_sphere) * 180\/3.1415926;\n offset(r=0.15){\n union(){\n rotate([0, 0, angle])\n translate([phi_sphere\/2, 0])\n union(){\n rotate([0, 0, -90]) _grip(e=e);\n translate([-e\/2-1, -clear-1.]) square([2+e, clear]);\n }\n rotate([0, 0, -angle])\n translate([phi_sphere\/2, 0])\n mirror([0, 1, 0])\n union(){\n rotate([0, 0, -90]) _grip(e=e);\n translate([-e\/2-1, -clear-1.]) square([2+e, clear]);\n }\n translate([phi_sphere\/2+0.8, 0]) square([e+1, 2], center=true);\n }\n }\n}\n\/\/right_grip(e=2., phi_sphere=20., shift=3);\n\/\/left_grip(e=2., phi_sphere=20., shift=3);\n\nmodule sphere_hole(e=2, phi_sphere=20., clear=1, aperture=120){\n rotate([0, aperture\/2, 0])\n rotate([0, 0, 90])\n rotate([0, -90, 0])\n rotate_extrude(angle=aperture){\n _hole(e=e, phi_sphere=phi_sphere, clear=clear);\n }\n}\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"22fbf9d8be113a50db2001d7cbeab4c877f40e26","subject":"Commented code was removed.","message":"Commented code was removed.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins-pendants-ornaments.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins-pendants-ornaments.scad","new_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/\n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a\n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach\n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\nuse ;\nuse <..\/shapes\/open-cylinder\/open-cylinder.scad>\n\n$fn=100;\n\nmodule ornament(height = 3,\n includeGimbal = \"yes\", \/\/ [yes, no]\n innerIcon = \"Batman\",\n innerIconXyScale = 1.10,\n innerIconOffsetY = -4,\n outerIcon = \"Nothing\", \/\/\"Tree\",\n outerIconXyScale = 0.2,\n outerIconCount = 10)\n{\n {\n coinScale = 0.2;\/\/0.199248\n\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n\n xyScale = 0.5;\n zTranslate = -height \/ 2.0;\n translate([0, -22, zTranslate])\n scale([xyScale, xyScale, 1])\n openCylinder(center=true);\n }\n\n difference()\n {\n color(\"blue\")\n scale([coinScale, -coinScale, 1])\n coin(innerIcon = innerIcon,\n innerIconXyScale = innerIconXyScale,\n innerIconOffsetY = innerIconOffsetY,\n outerIcon = outerIcon,\n outerIconCount = outerIconCount,\n outerIconXyScale = outerIconXyScale,\n radius = 55,\n height=height\n );\n\n clipOversizedImages(center=true);\n }\n }\n }\n}\n\nmodule clipOversizedImages()\n{\n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n\t color(\"pink\")\n \tcylinder(r=19.35, h=height, center=true);\n\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t color(\"grey\")\n\t\tcylinder(r=15.95, h=height, center=true);\n\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}\n","old_contents":"\/\/\n\/\/ This OpenScad script generates coins, pendants, and ornaments.\n\/\/\n\/\/ Author: Roberto Marquez - http:\/\/electronics.onebeartoe.org\/\n\/\/\n\/\/ This OpenSCAD script is a derivative of:\n\/\/\n\/\/ Customizable Gimbal v1.0\n\/\/ by TheNewHobbyist 2014 (http:\/\/thenewhobbyist.com)\n\/\/ http:\/\/www.thingiverse.com\/thing:340948\n\/\/ https:\/\/github.com\/thenewhobbyist\/OpenSCAD\/tree\/master\/Customizable%20Gimble\n\/\/\n\/\/ \"Customizable Gimbal\" as well as this script are licensed under a\n\/\/ Creative Commons Attribution-NonCommercial 3.0 Unported License.\n\/\/\n\/\/ TheNewHobbyist's Inspiration and attribution:\n\/\/\n\/\/ Printrbot Gimbal by DesignMakeTeach\n\/\/ http:\/\/www.thingiverse.com\/thing:317778\n\/\/ Licensed under the Creative Commons - Attribution - Share Alike license.\n\/\/\n\/\/ Stencil-o-Matic by Benjamin\n\/\/ http:\/\/www.thingiverse.com\/thing:55821\n\/\/ Licensed under the Creative Commons - Attribution - Non-Commercial license.\n\nuse ;\nuse <..\/shapes\/open-cylinder\/open-cylinder.scad>\n\n$fn=100;\n\n\/\/ornament();\n\nmodule ornament(height = 3,\n includeGimbal = \"yes\", \/\/ [yes, no]\n innerIcon = \"Batman\",\n innerIconXyScale = 1.10,\n innerIconOffsetY = -4,\n outerIcon = \"Nothing\", \/\/\"Tree\",\n outerIconXyScale = 0.2,\n outerIconCount = 10)\n{\n {\n coinScale = 0.2;\/\/0.199248\n\n union()\n {\n if(includeGimbal == \"yes\")\n {\n ring1(height);\n ring2(height);\n ring3(height);\n\n xyScale = 0.5;\n zTranslate = -height \/ 2.0;\n translate([0, -22, zTranslate])\n scale([xyScale, xyScale, 1])\n openCylinder(center=true);\n }\n\n difference()\n {\n color(\"blue\")\n scale([coinScale, -coinScale, 1])\n coin(innerIcon = innerIcon,\n innerIconXyScale = innerIconXyScale,\n innerIconOffsetY = innerIconOffsetY,\n outerIcon = outerIcon,\n outerIconCount = outerIconCount,\n outerIconXyScale = outerIconXyScale,\n radius = 55,\n height=height\n );\n\n clipOversizedImages(center=true);\n }\n }\n }\n}\n\nmodule clipOversizedImages()\n{\n\tdifference()\n\t{\n\t\tcylinder(r=200, h=10, center=true);\n\t\tcylinder(r=11, h=11, center=true);\n\t}\n}\n\nmodule ring1(height)\n{\n\tdifference()\n\t{\n\t color(\"pink\")\n \tcylinder(r=19.35, h=height, center=true);\n\n \tcylinder(r=17.35, h=56, center=true);\n \ttranslate([17.45,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n \ttranslate([-17.45,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring2(height)\n{\n\ttranslate([16.95,0,0]) rotate([0,90,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([-16.95,0,0]) rotate([0,270,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t color(\"grey\")\n\t\tcylinder(r=15.95, h=height, center=true);\n\n\t\tcylinder(r=13.95, h=56, center=true);\n\t\ttranslate([0,-14.2,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t\ttranslate([0,14.2,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\t}\n}\n\nmodule ring3(height)\n{\n\ttranslate([0,13.75,0]) rotate([270,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\ttranslate([0,-13.75,0]) rotate([90,0,0]) cylinder(r1=1.7, r2=0, h=2.1, center=true);\n\tdifference()\n\t{\n\t\tcylinder(r=12.75, h=height, center=true);\n\t\tcylinder(r=10.75, h=56, center=true);\n\t}\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"eeb10740381fd334cc4af26b1ce16f3d41bad355","subject":"Citosine","message":"Citosine","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([0, 0, 2.55]) cube ([x, y, z+3], center=true); \ncolor(\"lime\") translate ([-32, y\/200000, -4]) cylinder (z+10, y\/2+2, y\/2+2); \n \n } \n#rotate([0, 90, 0]) translate([-0.5,0,-23]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-25.9, -11, 5.1]) cube([53.5, 22, 8]);\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([13, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 36.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 36.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n #translate([1, 3, 0]) cube([2, 4.5, 2]);\n","old_contents":"x=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([0, 0, 0]) cube ([x, y, z-2], center=true); \ncolor(\"Red\") translate ([-30, y\/200000, -4]) cylinder (z, y\/2, y\/2); \n \n } \nrotate([0, 90, 0]) translate([0,0,-23]) cylinder(5,2.65,2.65); \ntranslate([-10, -10.5, 0]) cube([50, 21, 4]);\n}\n\n#rotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\n\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([12.5, 19, 7]);\n #rotate([0, 90, 0]) translate([0, 4.5, 36.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 36.5]) cylinder(9, 2.65, 2.65);\n}\n\n#rotate([90, 0, 0]) translate([27.4, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n #translate([1, 3, 0]) cube([2, 4.5, 2]);\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b1c632ca22ab9674b00626acfa1259a178a1ea6f","subject":"xaxis\/ends: Rework","message":"xaxis\/ends: Rework\n\nAdd stop for xrods on motor sid\nRemove side functionality, just mirror\nAdd show_bearing\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"599a71ec7a50c28b4b7a5b24907cd37b94ef578c","subject":"Fix typo and simplify computation of 2D polygons","message":"Fix typo and simplify computation of 2D polygons\n","repos":"jsconan\/camelSCAD","old_file":"shape\/2D\/polygon.scad","new_file":"shape\/2D\/polygon.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polygon shapes.\n *\n * @package shape\/2D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a rectangle shape.\n *\n * @param Number|Vector [size] - The size of the rectangle.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeRectangle(size, l, w) =\n let(\n size = apply2D(size, l, w)\n )\n [\n divisor(size[0]),\n divisor(size[1])\n ]\n;\n\n\/**\n * Computes the size of a chamfered rectangle shape.\n *\n * @param Number|Vector [size] - The size of the chamfered rectangle.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[] - Returns an array containing the size vector and the chamfer vector.\n *\/\nfunction sizeChamferedRectangle(size, chamfer, l, w, cl, cw) =\n let(\n s = apply2D(size, l, w),\n c = apply2D(chamfer, cl, cw),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2)\n ],\n chamfer = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, chamfer[0] && chamfer[1] ? chamfer : [0, 0] ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @returns Vector - Returns the size vector, as [a, b, w].\n *\/\nfunction sizeTrapezium(size, a, b, w) =\n let(\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2])\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, n].\n *\/\nfunction sizeRegularPolygon(size, n, l, w, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector2D(2 * divisor(s) \/ (2 * sin(STRAIGHT \/ n)))\n : apply2D(size, l, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStar(size, core, edges, l, w, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor2D(apply2D(size, l, w)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? size * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Computes the size of a cross shape.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the cross\n *\/\nfunction sizeCross(size, core, l, w, cl, cw) =\n let(\n size = divisor2D(apply2D(size, l, w)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of a rectangle shape.\n *\n * @param Number|Vector [size] - The size of the rectangle.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @returns Vector[]\n *\/\nfunction drawRectangle(size, l, w) =\n let(\n size = sizeRectangle(size=size, l=l, w=w) \/ 2\n )\n [\n [ size[0], size[1]],\n [-size[0], size[1]],\n [-size[0], -size[1]],\n [ size[0], -size[1]]\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of a chamfered rectangle shape.\n *\n * @param Number|Vector [size] - The size of the chamfered rectangle.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[]\n *\/\nfunction drawChamferedRectangle(size, chamfer, l, w, cl, cw) =\n let(\n specs = sizeChamferedRectangle(size=size, chamfer=chamfer, l=l, w=w, cl=cl, cw=cw),\n size = specs[0] \/ 2,\n chamfer = specs[1]\n )\n chamfer[0]\n ?[\n [ size[0], size[1] - chamfer[1]],\n [ size[0] - chamfer[0], size[1]],\n [-size[0] + chamfer[0], size[1]],\n [-size[0], size[1] - chamfer[1]],\n [-size[0], -size[1] + chamfer[1]],\n [-size[0] + chamfer[0], -size[1]],\n [ size[0] - chamfer[0], -size[1]],\n [ size[0], -size[1] + chamfer[1]]\n ]\n :[\n [ size[0], size[1]],\n [-size[0], size[1]],\n [-size[0], -size[1]],\n [ size[0], -size[1]]\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @returns Vector[w]\n *\/\nfunction drawTrapezium(size, a, b, w) =\n let(\n size = sizeTrapezium(size=size, a=a, b=b, w=w) \/ 2\n )\n [\n [ size[1], size[2]],\n [-size[1], size[2]],\n [-size[0], -size[2]],\n [ size[0], -size[2]]\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n * @returns Vector[]\n *\/\nfunction drawRegularPolygon(size, n, l, w, s) =\n let(\n size = sizeRegularPolygon(size=size, n=n, l=l, w=w, s=s),\n n = size[2],\n step = DEGREES \/ n,\n radius = size \/ 2\n )\n [\n for(i = [0 : n - 1])\n arcp(radius, i * step + RIGHT)\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of an hexagon.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n * @returns Vector[]\n *\/\nfunction drawHexagon(size, pointy, adjust, l, w, s) =\n let(\n n = 6,\n size = sizeRegularPolygon(size=size, n=n, l=l, w=w, s=s),\n step = DEGREES \/ n,\n radius = size \/ 2,\n adjust = float(adjust) \/ 2\n )\n pointy\n ?let(o = [0, adjust]) \/\/ pointy topped\n [\n arcp(radius, 30) + o,\n arcp(radius, 90) + o,\n arcp(radius, 150) + o,\n arcp(radius, 210) - o,\n arcp(radius, 270) - o,\n arcp(radius, 330) - o\n ]\n :let(o = [adjust, 0]) \/\/ flat topped\n [\n arcp(radius, 0) + o,\n arcp(radius, 60) + o,\n arcp(radius, 120) - o,\n arcp(radius, 180) - o,\n arcp(radius, 240) - o,\n arcp(radius, 300) + o\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[]\n *\/\nfunction drawStar(size, core, edges, l, w, cl, cw) =\n let(\n size = sizeStar(size=size, core=core, edges=edges, l=l, w=w, cl=cl, cw=cw),\n edges = size[2],\n inner = size[1],\n outer = size[0],\n angle = DEGREES \/ edges,\n step = angle \/ 2\n )\n [\n for (i = [0 : 2 * edges - 1])\n let(\n e = floor(i \/ 2),\n m = i % 2,\n a = angle * e + (m ? step : 0) + RIGHT\n )\n [\n cos(a) * (m ? inner[0] : outer[0]),\n sin(a) * (m ? inner[1] : outer[1])\n ]\n ]\n;\n\n\/**\n * Computes the points that draws the sketch of a cross shape.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[]\n *\/\nfunction drawCross(size, core, l, w, cl, cw) =\n let(\n size = sizeCross(size=size, core=core, l=l, w=w, cl=cl, cw=cw),\n outer = size[0] \/ 2,\n inner = size[1] \/ 2\n )\n inner == [0, 0] ?\n [\n [ outer[0], outer[1]],\n [-outer[0], outer[1]],\n [-outer[0], -outer[1]],\n [ outer[0], -outer[1]]\n ]\n :[\n [ inner[0], inner[1]],\n [ inner[0], outer[1]],\n [-inner[0], outer[1]],\n [-inner[0], inner[1]],\n [-outer[0], inner[1]],\n [-outer[0], -inner[1]],\n [-inner[0], -inner[1]],\n [-inner[0], -outer[1]],\n [ inner[0], -outer[1]],\n [ inner[0], -inner[1]],\n [ outer[0], -inner[1]],\n [ outer[0], inner[1]]\n ]\n;\n\n\/**\n * Creates a rectangle at the origin.\n *\n * @param Number|Vector [size] - The size of the rectangle.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n *\/\nmodule rectangle(size, l, w) {\n polygon(\n points = drawRectangle(size=size, l=l, w=w),\n convexity = 10\n );\n}\n\n\/**\n * Creates a chamfered rectangle at the origin.\n *\n * @param Number|Vector [size] - The size of the chamfered rectangle.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n *\/\nmodule chamferedRectangle(size, chamfer, l, w, cl, cw) {\n polygon(\n points = drawChamferedRectangle(size=size, chamfer=chamfer, l=l, w=w, cl=cl, cw=cw),\n convexity = 10\n );\n}\n\n\/**\n * Creates a trapezium at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n *\/\nmodule trapezium(size, a, b, w) {\n polygon(\n points = drawTrapezium(size=size, a=a, b=b, w=w),\n convexity = 10\n );\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n *\/\nmodule regularPolygon(size, n, l, w, s) {\n polygon(\n points = drawRegularPolygon(size=size, n=n, l=l, w=w, s=s),\n convexity = 10\n );\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n *\/\nmodule hexagon(size, pointy, adjust, l, w, s) {\n polygon(\n points = drawHexagon(size=size, pointy=pointy, adjust=adjust, l=l, w=w, s=s),\n convexity = 10\n );\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n *\/\nmodule star(size, core, edges, l, w, cl, cw) {\n polygon(\n points = drawStar(size=size, core=core, edges=edges, l=l, w=w, cl=cl, cw=cw),\n convexity = 10\n );\n}\n\n\/**\n * Creates a cross at the origin.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n *\/\nmodule regularCross(size, core, l, w, cl, cw) {\n polygon(\n points = drawCross(size=size, core=core, l=l, w=w, cl=cl, cw=cw),\n convexity = 10\n );\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n *\/\nmodule mesh(size, count, gap, pointy, linear, even, l, w, cx, cy, gx, gy) {\n size = apply2D(size, l, w);\n count = divisor2D(apply2D(count, cx, cy));\n gap = apply2D(gap, gx, gy);\n cell = sizeHexCell(size=size, count=count, pointy=pointy, linear=linear);\n inner = cell - gap;\n offset = offsetHexGrid(size=cell, count=count, pointy=pointy, linear=linear, even=even);\n\n for(hex = buildHexGrid(count=count, linear=linear)) {\n translate(offset + coordHexCell(hex=hex, size=cell, linear=linear, even=even, pointy=pointy)) {\n hexagon(size=inner, pointy=pointy);\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polygon shapes.\n *\n * @package shape\/2D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a rectangle shape.\n *\n * @param Number|Vector [size] - The size of the rectangle.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeRectangle(size, l, w) =\n let(\n size = apply2D(size, l, w)\n )\n [\n divisor(size[0]),\n divisor(size[1])\n ]\n;\n\n\/**\n * Computes the size of a chamfered rectangle shape.\n *\n * @param Number|Vector [size] - The size of the chamfered rectangle.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[] - Returns an array containing the size vector and the chamfer vector.\n *\/\nfunction sizeChamferedRectangle(size, chamfer, l, w, cl, cw) =\n let(\n s = apply2D(size, l, w),\n c = apply2D(chamfer, cl, cw),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2)\n ],\n chamfer = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, chamfer[0] && chamfer[1] ? chamfer : [0, 0] ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @returns Vector - Returns the size vector, as [a, b, w].\n *\/\nfunction sizeTrapezium(size, a, b, w) =\n let(\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2])\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, n].\n *\/\nfunction sizeRegularPolygon(size, n, l, w, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector2D(2 * divisor(s) \/ (2 * sin(STRAIGHT \/ n)))\n : apply2D(size, l, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStar(size, core, edges, l, w, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor2D(apply2D(size, l, w)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? size * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Computes the size of a cross shape.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the cross\n *\/\nfunction sizeCross(size, core, l, w, cl, cw) =\n let(\n size = divisor2D(apply2D(size, l, w)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of a rectangle shape.\n *\n * @param Number|Vector [size] - The size of the rectangle.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @returns Vector[]\n *\/\nfunction drawRectangle(size, l, w) =\n let(\n size = sizeRectangle(size=size, l=l, w=w),\n half = size \/ 2\n )\n [\n [ half[0], half[1]],\n [-half[0], half[1]],\n [-half[0], -half[1]],\n [ half[0], -half[1]]\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of a chamfered rectangle shape.\n *\n * @param Number|Vector [size] - The size of the chamfered rectangle.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[]\n *\/\nfunction drawChamferedRectangle(size, chamfer, l, w, cl, cw) =\n let(\n specs = sizeChamferedRectangle(size=size, chamfer=chamfer, l=l, w=w, cl=cl, cw=cw),\n size = specs[0],\n chamfer = specs[1],\n half = size \/ 2\n )\n chamfer[0]\n ?[\n [ half[0], half[1] - chamfer[1]],\n [ half[0] - chamfer[0], half[1]],\n [-half[0] + chamfer[0], half[1]],\n [-half[0], half[1] - chamfer[1]],\n [-half[0], -half[1] + chamfer[1]],\n [-half[0] + chamfer[0], -half[1]],\n [ half[0] - chamfer[0], -half[1]],\n [ half[0], -half[1] + chamfer[1]]\n ]\n :[\n [ half[0], half[1]],\n [-half[0], half[1]],\n [-half[0], -half[1]],\n [ half[0], -half[1]]\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @returns Vector[w]\n *\/\nfunction drawTrapezium(size, a, b, w) =\n let(\n size = sizeTrapezium(size=size, a=a, b=b, w=w),\n half = size \/ 2\n )\n [\n [ half[1], half[2]],\n [-half[1], half[2]],\n [-half[0], -half[2]],\n [ half[0], -half[2]]\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n * @returns Vector[]\n *\/\nfunction drawRegularPolygon(size, n, l, w, s) =\n let(\n size = sizeRegularPolygon(size=size, n=n, l=l, w=w, s=s),\n n = size[2],\n step = DEGREES \/ n,\n radius = size \/ 2\n )\n [\n for(i = [0 : n - 1])\n arcp(radius, i * step + RIGHT)\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of an hexagon.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n * @returns Vector[]\n *\/\nfunction drawHexagon(size, pointy, adjust, l, w, s) =\n let(\n n = 6,\n size = sizeRegularPolygon(size=size, n=n, l=l, w=w, s=s),\n step = DEGREES \/ n,\n radius = size \/ 2,\n adjust = float(adjust) \/ 2\n )\n pointy\n ?let(o = [0, adjust]) \/\/ pointy topped\n [\n arcp(radius, 30) + o,\n arcp(radius, 90) + o,\n arcp(radius, 150) + o,\n arcp(radius, 210) - o,\n arcp(radius, 270) - o,\n arcp(radius, 330) - o\n ]\n :let(o = [adjust, 0]) \/\/ flat topped\n [\n arcp(radius, 0) + o,\n arcp(radius, 60) + o,\n arcp(radius, 120) - o,\n arcp(radius, 180) - o,\n arcp(radius, 240) - o,\n arcp(radius, 300) + o\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[]\n *\/\nfunction drawStar(size, core, edges, l, w, cl, cw) =\n let(\n size = sizeStar(size=size, core=core, edges=edges, l=l, w=w, cl=cl, cw=cw),\n edges = size[2],\n inner = size[1],\n outer = size[0],\n angle = DEGREES \/ edges,\n step = angle \/ 2\n )\n [\n for (i = [0 : 2 * edges - 1])\n let(\n e = floor(i \/ 2),\n m = i % 2,\n a = angle * e + (m ? step : 0) + RIGHT\n )\n [\n cos(a) * (m ? inner[0] : outer[0]),\n sin(a) * (m ? inner[1] : outer[1])\n ]\n ]\n;\n\n\/**\n * Computes the points that draw the sketch of a cross shape.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[]\n *\/\nfunction drawCross(size, core, l, w, cl, cw) =\n let(\n size = sizeCross(size=size, core=core, l=l, w=w, cl=cl, cw=cw),\n outer = size[0] \/ 2,\n inner = size[1] \/ 2\n )\n inner == [0, 0] ?\n [\n [ outer[0], outer[1]],\n [-outer[0], outer[1]],\n [-outer[0], -outer[1]],\n [ outer[0], -outer[1]]\n ]\n :[\n [ inner[0], inner[1]],\n [ inner[0], outer[1]],\n [-inner[0], outer[1]],\n [-inner[0], inner[1]],\n [-outer[0], inner[1]],\n [-outer[0], -inner[1]],\n [-inner[0], -inner[1]],\n [-inner[0], -outer[1]],\n [ inner[0], -outer[1]],\n [ inner[0], -inner[1]],\n [ outer[0], -inner[1]],\n [ outer[0], inner[1]]\n ]\n;\n\n\/**\n * Creates a rectangle at the origin.\n *\n * @param Number|Vector [size] - The size of the rectangle.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n *\/\nmodule rectangle(size, l, w) {\n polygon(\n points = drawRectangle(size=size, l=l, w=w),\n convexity = 10\n );\n}\n\n\/**\n * Creates a chamfered rectangle at the origin.\n *\n * @param Number|Vector [size] - The size of the chamfered rectangle.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n *\/\nmodule chamferedRectangle(size, chamfer, l, w, cl, cw) {\n polygon(\n points = drawChamferedRectangle(size=size, chamfer=chamfer, l=l, w=w, cl=cl, cw=cw),\n convexity = 10\n );\n}\n\n\/**\n * Creates a trapezium at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n *\/\nmodule trapezium(size, a, b, w) {\n polygon(\n points = drawTrapezium(size=size, a=a, b=b, w=w),\n convexity = 10\n );\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n *\/\nmodule regularPolygon(size, n, l, w, s) {\n polygon(\n points = drawRegularPolygon(size=size, n=n, l=l, w=w, s=s),\n convexity = 10\n );\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [s] - The length of a side.\n *\/\nmodule hexagon(size, pointy, adjust, l, w, s) {\n polygon(\n points = drawHexagon(size=size, pointy=pointy, adjust=adjust, l=l, w=w, s=s),\n convexity = 10\n );\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n *\/\nmodule star(size, core, edges, l, w, cl, cw) {\n polygon(\n points = drawStar(size=size, core=core, edges=edges, l=l, w=w, cl=cl, cw=cw),\n convexity = 10\n );\n}\n\n\/**\n * Creates a cross at the origin.\n *\n * @param Number|Vector [size] - The outer size of the cross.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n *\/\nmodule regularCross(size, core, l, w, cl, cw) {\n polygon(\n points = drawCross(size=size, core=core, l=l, w=w, cl=cl, cw=cw),\n convexity = 10\n );\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n *\/\nmodule mesh(size, count, gap, pointy, linear, even, l, w, cx, cy, gx, gy) {\n size = apply2D(size, l, w);\n count = divisor2D(apply2D(count, cx, cy));\n gap = apply2D(gap, gx, gy);\n cell = sizeHexCell(size=size, count=count, pointy=pointy, linear=linear);\n inner = cell - gap;\n offset = offsetHexGrid(size=cell, count=count, pointy=pointy, linear=linear, even=even);\n\n for(hex = buildHexGrid(count=count, linear=linear)) {\n translate(offset + coordHexCell(hex=hex, size=cell, linear=linear, even=even, pointy=pointy)) {\n hexagon(size=inner, pointy=pointy);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7ed9a146d777bc396b337e79a73e4a78258667d4","subject":"z\/upper_gantry: misc fixes","message":"z\/upper_gantry: misc fixes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-upper-gantry-connector.scad","new_file":"z-axis-upper-gantry-connector.scad","new_contents":"include \ninclude \n\nmodule zaxis_upper_gantry_zrod_connector()\n{\n \/\/ how much bigger\/smaller is the upper gantry (on each side)\n upper_gantry_width_diff = (main_upper_width-main_width)\/2;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([zmotor_mount_rod_offset_x,0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n for(i=[-1,1])\n {\n translate([-.1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n screw_cut(\n nut=zmotor_mount_clamp_nut,\n h=zmotor_mount_rod_offset_x-(extrusion_size*2),\n orient=[-1,0,0],\n align=[-1,0,0]\n );\n }\n }\n\n translate([upper_gantry_width_diff\/2, 0, extrusion_size+gantry_connector_thickness])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, 0])\n {\n screw_cut(extrusion_nut, h=gantry_connector_thickness+.1, nut_offset=true, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([zmotor_mount_rod_offset_x,0,extrusion_size])\n cylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","old_contents":"include \n\nmodule zaxis_upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([extrusion_size\/2+zmotor_mount_rod_offset_x,0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-.1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n screw_cut(zmotor_mount_clamp_nut, h=200, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size+gantry_connector_thickness])\n \/*#cubea(align=[0,0,1])*\/\n\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, 0])\n {\n screw_cut(extrusion_nut, h=gantry_connector_thickness+.1, nut_offset=true, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n cylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"21bd00cc09c32792b886e41b06c3de03db54fd13","subject":"add the stand top","message":"add the stand top\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nmodule halfCirclePhoneStand(minkowskiSphereRadius = 0.5)\n{\n \n\n halfCirclePhoneStand_stand_base(minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_stand_base(minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = 19.125,\n innerRadius = 4.9,\n outerRadius = 5.59,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e322d5bfb582fe1b584aad940b3ec71b43f0e624","subject":"increase the internal cutout top radius","message":"increase the internal cutout top radius\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_contents":"\/\/ originially from:\n\/\/ Sine Cube Vase 1 by @Chompworks\n\/\/ Original at: https:\/\/www.thingiverse.com\/thing:2666281\n\/\/ Released under the Creative Commons CC - BY 3.0 licence\n\/\/ Details here: https:\/\/creativecommons.org\/licenses\/by\/3.0\/\n\/\/ customizer modifications by Roberto Marquez\n\/\/ https:\/\/www.thingiverse.com\/onebeartoe\/designs\n\ncubeOrCylinder = \"cylinder\"; \/\/ [cube, cylinder]\n\ninternalCutout_bottomRadius = 43; \/\/ [30 : 1 : 45]\n\n\/* [Hidden] *\/\n\nstep=4; \/\/ number of degrees to step for each cuboid element\n\nmaxlayers=100; \/\/ max number of layers. More layers slows down compilation on [F6], but makes the vase taller\n\nbasewidth=50; \/\/ basic length of a cuboid\n\ndifference() \/\/ Take away the two parts at the bottom\n{\n union() \/\/ this stitches all the cuboids together\n {\n translate([0,0,-80])\n for (layers=[1:maxlayers]) \/\/ make each slice\n {\n for (angle=[1:step:360])\n {\n translate([0,0,layers*2]) \/\/ move the cuboid up to where it needs to be!\n rotate([0,0,angle]) \/\/ rotate the cuboid\n rotate([45,-45,0]) \/\/ rotate the cuboid for the best effect\n translate([0,-1,0]) \/\/ move the cuboid. This minus 1 offset just worked well!\n\n if(cubeOrCylinder == \"cylinder\")\n {\n cylinderHeight = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n\t cylinder(r=2, h=cylinderHeight, $fn=20);\n }\n else\n {\n cube_xLength = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n \t\t\t\tcube([cube_xLength, 4, 4]);\n\n \/\/ lets explain this!\n \/\/ make a 4x4 square\n \/\/ then extrude it by:\n \/\/ basewidth - a constant. this is the minimum length of any cuboid\n \/\/ PLUS\n \/\/ (layers\/maxlayers*30) - this makes the vase taper outward as it gets taller. A sine function on this could make it act more like a pot\/urn [Thin, Fat, Thin]\n \/\/ PLUS\n \/\/ 10*cos(layers*15)*sin(angle*8) - this is a nasty bit of trig at first!\n \/\/ the sine function controls the bumps. Multiplying the angle by 8 means that rather than 1 bump, there are 8 for any given layer\n \/\/ the cosine function (layers*15) makes the bumps also occur in the Z axis as they go up. If you removed this, the vase becomes very straight\n }\n }\n }\n }\n\n \/\/this removes the cone base and leaves a flat base for the vase\n translate([-500,-500,-100])\n cube([1000,1000,100]);\n\n \/\/ this adds an internal hollow, 5mm up from the base\n internalCutout_TopRadius = internalCutout_bottomRadius + 22;\n translate([0,0,5])\n cylinder(r1 = internalCutout_bottomRadius, r2 = internalCutout_TopRadius, h = maxlayers * 2, $fn = 360\/step);\n}\n","old_contents":"\/\/ originially from:\n\/\/ Sine Cube Vase 1 by @Chompworks\n\/\/ Original at: https:\/\/www.thingiverse.com\/thing:2666281\n\/\/ Released under the Creative Commons CC - BY 3.0 licence\n\/\/ Details here: https:\/\/creativecommons.org\/licenses\/by\/3.0\/\n\/\/ customizer modifications by Roberto Marquez\n\/\/ https:\/\/www.thingiverse.com\/onebeartoe\/designs\n\ncubeOrCylinder = \"cylinder\"; \/\/ [cube, cylinder]\n\ninternalCutout_bottomRadius = 43; \/\/ [30 : 1 : 45]\n\n\/* [Hidden] *\/\n\nstep=4; \/\/ number of degrees to step for each cuboid element\n\nmaxlayers=100; \/\/ max number of layers. More layers slows down compilation on [F6], but makes the vase taller\n\nbasewidth=50; \/\/ basic length of a cuboid\n\ndifference() \/\/ Take away the two parts at the bottom\n{\n union() \/\/ this stitches all the cuboids together\n {\n translate([0,0,-80])\n for (layers=[1:maxlayers]) \/\/ make each slice\n {\n for (angle=[1:step:360])\n {\n translate([0,0,layers*2]) \/\/ move the cuboid up to where it needs to be!\n rotate([0,0,angle]) \/\/ rotate the cuboid\n rotate([45,-45,0]) \/\/ rotate the cuboid for the best effect\n translate([0,-1,0]) \/\/ move the cuboid. This minus 1 offset just worked well!\n\n if(cubeOrCylinder == \"cylinder\")\n {\n cylinderHeight = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n\t cylinder(r=2, h=cylinderHeight, $fn=20);\n }\n else\n {\n cube_xLength = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n \t\t\t\tcube([cube_xLength, 4, 4]);\n\n \/\/ lets explain this!\n \/\/ make a 4x4 square\n \/\/ then extrude it by:\n \/\/ basewidth - a constant. this is the minimum length of any cuboid\n \/\/ PLUS\n \/\/ (layers\/maxlayers*30) - this makes the vase taper outward as it gets taller. A sine function on this could make it act more like a pot\/urn [Thin, Fat, Thin]\n \/\/ PLUS\n \/\/ 10*cos(layers*15)*sin(angle*8) - this is a nasty bit of trig at first!\n \/\/ the sine function controls the bumps. Multiplying the angle by 8 means that rather than 1 bump, there are 8 for any given layer\n \/\/ the cosine function (layers*15) makes the bumps also occur in the Z axis as they go up. If you removed this, the vase becomes very straight\n }\n }\n }\n }\n\n \/\/this removes the cone base and leaves a flat base for the vase\n translate([-500,-500,-100])\n cube([1000,1000,100]);\n\n \/\/ this adds an internal hollow, 5mm up from the base\n internalCutout_TopRadius = internalCutout_bottomRadius + 15;\n translate([0,0,5])\n cylinder(r1 = internalCutout_bottomRadius, r2 = internalCutout_TopRadius, h = maxlayers * 2, $fn = 360\/step);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b573645c4bd90fba36db03109d8ec67f5350a402","subject":"moved motor down 1cm. belts could have been tighter","message":"moved motor down 1cm. belts could have been tighter\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/motorMount.scad","new_file":"Drawings\/motorMount.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/motorMount.scad $\n\/\/ $Id: motorMount.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\/\/ Distance from top edge of mount to center of motor axle:\n\/\/ at 30mm offset, belts were not as tight as I'd like.\n\/\/ ?? try 40?\nmotorOffset=40;\n\n\/\/ shape of small gearhead motor GA12YN20 from fasttech.com\nmodule gearheadMotorProxyGA12(pad) { union() {\ncube([10+pad,12+pad,9.2+pad],center=true);\ntranslate([0,0,-(9.2+pad)\/2-7.9]) difference() {\n cylinder(h=10,r=1.5,$fn=36);\n translate([1,-2,-.1]) cube([2,4,7.7]); }\nintersection() {\n translate([0,0,9.2\/2-1])cylinder(h=15+pad+1,r=(12+pad)\/2,$fn=48);\n cube([10+pad,12+pad,66],center=true); }\n}}\n\n\/\/ Slightly larger 60RPM gearhead motor.\n\/\/ same size? 35RPM GA16Y030 fasttech\nmodule gearheadMotorProxyGA16(pad) {\ndifference() { union(){\ntranslate([0,0,10-29]) cylinder(h=29,r=7.75+pad,$fn=64);\ncylinder(h=10+5,r=1.5,$fn=36);\n}\ntranslate([ 6 ,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([-6-5,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([1.5-(3-2.44),-2,1+10]) cube([2,4,5]);\n}}\n\n\/\/ larger 30RPM gearhead (as delivered) motor GA25Y310 fasttech\n\/\/ photo and specs on site do not match delivered product.\n\/\/ drawing is of delivered product, marked 25GA370-98, 30RPM\nmodule gearheadMotorProxyGA25(pad) {\ndifference() { union(){\ntranslate([0,0,-31]) cylinder(h=32,r=12.2+pad,$fn=64);\ncylinder(h=23.5,r=12.6+pad,$fn=64);\ntranslate([0,0,24]) cylinder(h=10,r=2,$fn=36);\ntranslate([0,0,23]) cylinder(h=2.5,r=3.5,$fn=36);\n}\ntranslate([1.5,-3,23.5+3]) cube([2,6,8]);\n}}\n\nbh=4;\nbr1=2;\nbr2=1.5;\n\nmodule ulc(dx,dy) { translate([-20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule urc(dx,dy) { translate([ 20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule llc() { translate([-6,-motorOffset-2,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\nmodule lrc() { translate([ 6,-motorOffset-2,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\n\ndtFuzz = 0.08; \/\/ fuzz to add to dove tail slots\n\nmodule motorMount() {\n difference() {\n union() {\n hull() { ulc(0,0); urc(0,0); }\n hull() { ulc(2,-1); urc(-2,-1); }\n hull() { ulc(0,0); llc(); }\n hull() { urc(0,0); lrc(); }\n for (a=[-1,1]) hull() { \n translate([.6*a, -2,0]) cylinder(h=bh ,r1=2,r2=0.5,$fn=6);\n translate([ 7*a,-motorOffset+2,0]) cylinder(h=bh+2,r1=2,r2=0.5,$fn=6);\n }\n\n hull() for (a=[-1,1]) {\n translate([5*a,-motorOffset+6,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([4*a,-motorOffset-2,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n }\n }\n\n \/\/ dove-tail receivers, 2x as high as actual, with 2x radius reduction\n \/\/ so they have the same wall slope, but are extra long to make\n \/\/ sure they cut all the way through the top brace bar\n for (a=[-1,1]) translate([10*a,-1,1-0.1]) rotate([0,0,-30])\n cylinder(h=6,r2=5+dtFuzz,r1=3+dtFuzz,$fn=3);\n\n \/\/ at 30mm offset, belts were not as tight as I'd like.\n \/\/ ?? try 40?\n #translate([0,-motorOffset,3.9]) gearheadMotorProxyGA12(0.4);\n }\n}\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\n translate([-30,0,0]) cube([60,7,.4]);\n translate([-13,-42,0]) cube([26,.1,.4]); }\ntranslate([0,0,.2]) motorMount();\n}}\nelse { motorMount(); }\n\n\/\/%translate([0,30,0]) gearheadMotorProxyGA16(0);\n\/\/%translate([30,0,0]) gearheadMotorProxyGA12(0.2);\n\/\/%translate([-40,0,0]) gearheadMotorProxyGA25(0.2);","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/motorMount.scad $\n\/\/ $Id: motorMount.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\n\/\/ shape of small gearhead motor GA12YN20 from fasttech.com\nmodule gearheadMotorProxyGA12(pad) { union() {\ncube([10+pad,12+pad,9.2+pad],center=true);\ntranslate([0,0,-(9.2+pad)\/2-7.9]) difference() {\n cylinder(h=10,r=1.5,$fn=36);\n translate([1,-2,-.1]) cube([2,4,7.7]); }\nintersection() {\n translate([0,0,9.2\/2-1])cylinder(h=15+pad+1,r=(12+pad)\/2,$fn=48);\n cube([10+pad,12+pad,66],center=true); }\n}}\n\n\/\/ Slightly larger 60RPM gearhead motor.\n\/\/ same size? 35RPM GA16Y030 fasttech\nmodule gearheadMotorProxyGA16(pad) {\ndifference() { union(){\ntranslate([0,0,10-29]) cylinder(h=29,r=7.75+pad,$fn=64);\ncylinder(h=10+5,r=1.5,$fn=36);\n}\ntranslate([ 6 ,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([-6-5,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([1.5-(3-2.44),-2,1+10]) cube([2,4,5]);\n}}\n\n\/\/ larger 30RPM gearhead (as delivered) motor GA25Y310 fasttech\n\/\/ photo and specs on site do not match delivered product.\n\/\/ drawing is of delivered product, marked 25GA370-98, 30RPM\nmodule gearheadMotorProxyGA25(pad) {\ndifference() { union(){\ntranslate([0,0,-31]) cylinder(h=32,r=12.2+pad,$fn=64);\ncylinder(h=23.5,r=12.6+pad,$fn=64);\ntranslate([0,0,24]) cylinder(h=10,r=2,$fn=36);\ntranslate([0,0,23]) cylinder(h=2.5,r=3.5,$fn=36);\n}\ntranslate([1.5,-3,23.5+3]) cube([2,6,8]);\n}}\n\nbh=4;\nbr1=2;\nbr2=1.5;\n\nmodule ulc(dx,dy) { translate([-20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule urc(dx,dy) { translate([ 20+dx,-1.5+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule llc() { translate([ -6, -30,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\nmodule lrc() { translate([ 6, -30,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\n\ndtFuzz = 0.08; \/\/ fuzz to add to dove tail slots\n\nmodule motorMount() {\n difference() {\n union() {\n hull() { ulc(0,0); urc(0,0); }\n hull() { ulc(2,-1); urc(-2,-1); }\n hull() { ulc(0,0); llc(); }\n hull() { urc(0,0); lrc(); }\n for (a=[-1,1]) hull() { \n translate([.6*a, -2,0]) cylinder(h=bh ,r1=2,r2=0.5,$fn=6);\n translate([ 7*a,-25,0]) cylinder(h=bh+2,r1=2,r2=0.5,$fn=6);\n }\n\n hull() for (a=[-1,1]) {\n translate([5*a,-24,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([4*a,-32,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n }\n }\n\n \/\/ dove-tail receivers, 2x as high as actual, with 2x radius reduction\n \/\/ so they have the same wall slope, but are extra long to make\n \/\/ sure they cut all the way through the top brace bar\n for (a=[-1,1]) translate([10*a,-1,1-0.1]) rotate([0,0,-30])\n cylinder(h=6,r2=5+dtFuzz,r1=3+dtFuzz,$fn=3);\n\n #translate([0,-30,3.9]) gearheadMotorProxyGA12(0.4);\n }\n}\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\n translate([-30,0,0]) cube([60,7,.4]);\n translate([-13,-42,0]) cube([26,.1,.4]); }\ntranslate([0,0,.2]) motorMount();\n}}\nelse { motorMount(); }\n\n\/\/%translate([0,30,0]) gearheadMotorProxyGA16(0);\n\/\/%translate([30,0,0]) gearheadMotorProxyGA12(0.2);\n\/\/%translate([-40,0,0]) gearheadMotorProxyGA25(0.2);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c28a9d22ac017cee32aa29ed6f4f9a2f9ac07c9c","subject":"main\/xcarriage: some minor work","message":"main\/xcarriage: some minor work\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = -225\/2*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n xcarriage_padding=10;\n xcarriage_width = xaxis_bearing[2]*2 + xaxis_bearing_dist + xcarriage_padding;\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n cubea([xcarriage_width, 5, xaxis_rod_distance+xaxis_bearing[1]+xcarriage_padding], align=[0,-1,0]);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2, 10, -17], [0,0,0]], extruder_conn_xcarriage)\n \/*#cubea([10,10,10]);*\/\n extruder();\n\n \/\/ x carriage bearings\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n\n translate([0, xaxis_zaxis_distance_y, -(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n rotate([90,0,0])\n bearing(yaxis_bearing);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = -225\/2*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n rotate([90,0,0])\n bearing(yaxis_bearing);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2f88c1c6d0c51e20fb810e5f5f4879cdb1fb3c51","subject":"added some more extra space to connect base with launcher end, and make sure there are no gaps in the print","message":"added some more extra space to connect base with launcher end, and make sure there are no gaps in the print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"pop_rocket\/launcher.scad","new_file":"pop_rocket\/launcher.scad","new_contents":"eps = 0.01;\nwall = 1.3;\n\nlaunch_side = 22;\nlaunch_h = 180;\n\nconn_phi = 25;\nconn_h = 20;\nconn_pipe_space = 4;\n\n\nmodule screw_mount(dl)\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s+dl, h]);\n translate([0, 0, -eps])\n cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangle_2d_int(side)\n{\n offset(r=-wall)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h, $fn=200)\n{\n cylinder(d=d, h=h);\n}\n\n\nmodule outer_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h)\n triangle_2d(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi, 20);\n \/\/ interconenction of both\n translate([-conn_phi\/2, -conn_phi-conn_pipe_space, 0])\n cube([conn_phi, conn_phi+conn_pipe_space+wall, dz]);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+2*eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h+4*eps)\n triangle_2d_int(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 20+eps);\n \/\/ smooth interconenction of both\n hull()\n {\n \/\/ launch side\n rotate([90, 0, 0])\n linear_extrude(height=eps)\n triangle_2d_int(launch_side);\n \/\/ top-level connection facing side\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 0.1, $fn=50);\n \/\/ gradual narrowing of the pipe\n denom = 10;\n translate([0, 0, dz-1.5])\n for(r=[0:5:60])\n rotate([r, 0, 0])\n translate([0, -(conn_phi-r\/denom)\/2, 0])\n pipe_connector(conn_phi-2*wall-r\/denom, 0.1, $fn=50);\n }\n}\n\n\nmodule launcher()\n{\n difference()\n {\n outer_pipe();\n inner_pipe();\n }\n \/\/ mount screw holes\n translate([0, -conn_phi-conn_pipe_space, 10])\n rotate([-90, 0, 0])\n for(dx=[-1,+1])\n translate([dx*(conn_phi\/2 + 10\/2), 0, 0])\n screw_mount(dl=10\/2);\n}\n\nlauncher();\n","old_contents":"eps = 0.01;\nwall = 1.3;\n\nlaunch_side = 22;\nlaunch_h = 180;\n\nconn_phi = 25;\nconn_h = 20;\nconn_pipe_space = 4;\n\n\nmodule screw_mount(dl)\n{\n s = 10;\n h = 5;\n difference()\n {\n translate([-s\/2, -s\/2, 0])\n cube([s, s+dl, h]);\n translate([0, 0, -eps])\n cylinder(d=4, h=h+2*eps, $fn=50);\n }\n}\n\n\nmodule triangle_2d(side)\n{\n dx = -side\/2;\n dy = 0;\n translate([dx, 0, 0])\n polygon( points=[\n [0, 0],\n [side, 0],\n [cos(60)*side, sin(60)*side]\n ] );\n}\n\n\nmodule triangle_2d_int(side)\n{\n offset(r=-wall)\n triangle_2d(side);\n}\n\n\nmodule pipe_connector(d, h, $fn=200)\n{\n cylinder(d=d, h=h);\n}\n\n\nmodule outer_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h)\n triangle_2d(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi, 20);\n \/\/ interconenction of both\n translate([-conn_phi\/2, -conn_phi-conn_pipe_space, 0])\n cube([conn_phi, conn_phi+conn_pipe_space, dz]);\n}\n\n\nmodule inner_pipe()\n{\n \/\/ rocket side\n translate([0, launch_h+2*eps, 0])\n rotate([90, 0, 0])\n linear_extrude(height=launch_h+4*eps)\n triangle_2d_int(launch_side);\n \/\/ rubber pipe side\n dz = launch_side * sin(60);\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 20+eps);\n \/\/ smooth interconenction of both\n hull()\n {\n \/\/ launch side\n rotate([90, 0, 0])\n linear_extrude(height=eps)\n triangle_2d_int(launch_side);\n \/\/ top-level connection facing side\n translate([0, -conn_phi\/2, dz])\n pipe_connector(conn_phi-2*wall, 0.1, $fn=50);\n \/\/ gradual narrowing of the pipe\n denom = 10;\n translate([0, 0, dz-1.5])\n for(r=[0:5:60])\n rotate([r, 0, 0])\n translate([0, -(conn_phi-r\/denom)\/2, 0])\n pipe_connector(conn_phi-2*wall-r\/denom, 0.1, $fn=50);\n }\n}\n\n\nmodule launcher()\n{\n difference()\n {\n outer_pipe();\n inner_pipe();\n }\n \/\/ mount screw holes\n translate([0, -conn_phi-conn_pipe_space, 10])\n rotate([-90, 0, 0])\n for(dx=[-1,+1])\n translate([dx*(conn_phi\/2 + 10\/2), 0, 0])\n screw_mount(dl=10\/2);\n}\n\nlauncher();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"06893f9125e5a5c7830bf9a29b034ee129eaef07","subject":"misc: add singlify","message":"misc: add singlify\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_key) = \n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0];\n\nfunction geth(S, col_key, row_index) = \nlet(col_index = header_col_index(S, col_key))\nS[row_index+1][col_index];\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n}\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_key) = \n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0];\n\nfunction geth(S, col_key, row_index) = \nlet(col_index = header_col_index(S, col_key))\nS[row_index+1][col_index];\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ae2bc9f41baaf499e7d6950eb6018d0ea3b8c892","subject":"added vslot_gantry_plate_test","message":"added vslot_gantry_plate_test\n","repos":"fponticelli\/smallbridges","old_file":"scad\/vslot_gantry_plate.scad","new_file":"scad\/vslot_gantry_plate.scad","new_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nvslot_gantry_plate_height = 3;\r\n\r\nvslot_gantry_plate_holes_big = [\r\n\t[-30.32, 49.85],\r\n\t[ 0.00, 49.85],\r\n\t[ 30.32, 49.85],\r\n\r\n\t[-30.32, 39.85],\r\n\t[ 0.00, 39.85],\r\n\t[ 30.32, 39.85],\r\n\r\n\t[-30.32, 29.85],\r\n\t[ 0.00, 29.85],\r\n\t[ 30.32, 29.85],\r\n\r\n\t[-30.32, 19.85],\r\n\t[ 0.00, 19.85],\r\n\t[ 30.32, 19.85],\r\n\r\n\t[-30.32,-49.85],\r\n\t[ 0.00,-49.85],\r\n\t[ 30.32,-49.85],\r\n\r\n\t[-30.32,-39.85],\r\n\t[ 0.00,-39.85],\r\n\t[ 30.32,-39.85],\r\n\r\n\t[-30.32,-29.85],\r\n\t[ 0.00,-29.85],\r\n\t[ 30.32,-29.85],\r\n\r\n\t[-30.32,-19.85],\r\n\t[ 0.00,-19.85],\r\n\t[ 30.32,-19.85]\r\n];\r\n\r\nvslot_gantry_plate_sizes =[[],\r\n\t[65.5,65.5],\r\n\t[127,88]\r\n];\r\n\r\nmodule vslot_gantry_plate_big() {\r\n\tbom(\"vslot_gantry_plate_big\", str(\"V-Slot Gantry Plate: \", vslot_gantry_plate_sizes[1][0], \"x\", vslot_gantry_plate_sizes[1][1], \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack) {\r\n\t\tlinear_extrude(height = vslot_gantry_plate_height, center = true, convexity = 10)\r\n \t\timport (file = \"..\/dxf\/vslot_gantry_plate.dxf\");\r\n\t}\r\n}\r\n\r\nmodule vslot_gantry_plate_test() {\r\n\tvslot_gantry_plate_big();\r\n}","old_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nvslot_gantry_plate_height = 3;\r\n\r\nvslot_gantry_plate_holes_big = [\r\n\t[-30.32, 49.85],\r\n\t[ 0.00, 49.85],\r\n\t[ 30.32, 49.85],\r\n\r\n\t[-30.32, 39.85],\r\n\t[ 0.00, 39.85],\r\n\t[ 30.32, 39.85],\r\n\r\n\t[-30.32, 29.85],\r\n\t[ 0.00, 29.85],\r\n\t[ 30.32, 29.85],\r\n\r\n\t[-30.32, 19.85],\r\n\t[ 0.00, 19.85],\r\n\t[ 30.32, 19.85],\r\n\r\n\t[-30.32,-49.85],\r\n\t[ 0.00,-49.85],\r\n\t[ 30.32,-49.85],\r\n\r\n\t[-30.32,-39.85],\r\n\t[ 0.00,-39.85],\r\n\t[ 30.32,-39.85],\r\n\r\n\t[-30.32,-29.85],\r\n\t[ 0.00,-29.85],\r\n\t[ 30.32,-29.85],\r\n\r\n\t[-30.32,-19.85],\r\n\t[ 0.00,-19.85],\r\n\t[ 30.32,-19.85]\r\n];\r\n\r\nvslot_gantry_plate_sizes =[[],\r\n\t[65.5,65.5],\r\n\t[127,88]\r\n];\r\n\r\nmodule vslot_gantry_plate_big() {\r\n\tbom(\"vslot_gantry_plate_big\", str(\"V-Slot Gantry Plate: \", vslot_gantry_plate_sizes[1][0], \"x\", vslot_gantry_plate_sizes[1][1], \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack) {\r\n\t\tlinear_extrude(height = vslot_gantry_plate_height, center = true, convexity = 10)\r\n \t\timport (file = \"..\/dxf\/vslot_gantry_plate.dxf\");\r\n\t}\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6d451e31d56e1cd318439929da32a4e5630d43bd","subject":"less space for screw (it pups out a bit too much on the other end)","message":"less space for screw (it pups out a bit too much on the other end)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toy_lid\/funcions.scad","new_file":"toy_lid\/funcions.scad","new_contents":"$fn=100;\n\nmodule con()\n{\n difference()\n {\n cylinder(h=20, r2=40\/2, r1=15\/2);\n translate([0,0,-3])\n cylinder(h=20+2*3, r=3.5\/2);\n translate([0,0,9.5])\n cylinder(h=20, r=6\/2);\n }\n}\n\nmodule lid(internal_diameter, external_diameter)\n{\n difference()\n {\n cylinder(r=external_diameter\/2, h=3);\n translate([0,0,-1])\n cylinder(r=3.5\/2, h=3+2*1);\n }\n difference()\n {\n cylinder(r=internal_diameter\/2+3, h=3+10);\n cylinder(r=internal_diameter\/2, h=3+10+1);\n }\n}\n\n\/\/con();\n\/\/lid(100);\n","old_contents":"$fn=100;\n\nmodule con()\n{\n difference()\n {\n cylinder(h=20, r2=40\/2, r1=15\/2);\n translate([0,0,-3])\n cylinder(h=20+2*3, r=3.5\/2);\n translate([0,0,8])\n cylinder(h=20, r=6\/2);\n }\n}\n\nmodule lid(internal_diameter, external_diameter)\n{\n difference()\n {\n cylinder(r=external_diameter\/2, h=3);\n translate([0,0,-1])\n cylinder(r=3.5\/2, h=3+2*1);\n }\n difference()\n {\n cylinder(r=internal_diameter\/2+3, h=3+10);\n cylinder(r=internal_diameter\/2, h=3+10+1);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"61b57d135598fa5655c9edba7690dd518d1d94d2","subject":"Rotate case for better printing","message":"Rotate case for better printing\n","repos":"adamf\/Moros,adamf\/Moros,adamf\/Moros,adamf\/Moros","old_file":"case\/case.scad","new_file":"case\/case.scad","new_contents":"\/\/ all values in mm\n\/\/ thickness of metal in mm\nwall_thickness = 1;\n\/\/ X\ncase_width = 140;\n\/\/ Y\ncase_thickness = 70;\n\/\/ Z\ncase_height = 50;\n\n\/\/ button holes\nbutton_sides = 14;\nbutton_distance_from_side = 15;\nbutton_distance_from_front = 45;\n\/\/ OLED panels\noled_screen_sides = 34;\noled_panel_width = 45;\noled_panel_height = 34;\noled_screw_to_screw_width = 39;\noled_screw_to_screw_height = 28; \noled_screw_hole_diameter = 4;\noled_distance_from_side = 10;\n\n\/\/ extra space to make the objects larger than what we subtract from\ntrim = 5;\n\n\n\/*\n\/\/ reference planes\ntranslate([0, 0, -10]) {\n cube([case_width, case_thickness, 1]);\n}\n*\/\n\n\/\/ the top\n\nrotate([0,-90,-90])\ncolor(\"white\")\ndifference() {\n\n\/\/ external shell\ndifference() {\ncube([case_width, case_thickness, case_height]);\n rotate([45,0,0]) {\n color(\"red\") {\n translate([-1,9,10]) cube([case_width + 2, case_thickness + 2, case_height]);\n }\n }\n}\n\n\n\/\/ subtract a copy of the shell from the inside\ntranslate([-wall_thickness,wall_thickness,-wall_thickness]) {\n difference() {\n color(\"green\") cube([case_width + trim, case_thickness - wall_thickness - wall_thickness, case_height]);\n rotate([45,0,0]) {\n color(\"blue\") {\n translate([-1,9,10]) cube([case_width + trim + 2, case_thickness - 18, 25]);\n }\n }\n }\n}\n\n\n\/\/ button holes\ntranslate([case_width - button_sides - button_distance_from_side, button_distance_from_front, case_height - 3]) {\n color(\"black\") cube([button_sides, button_sides, wall_thickness + trim]);\n}\ntranslate([button_distance_from_side, button_distance_from_front, case_height - 3]) {\n color(\"black\") cube([button_sides, button_sides, wall_thickness + trim]);\n}\n\n\nrotate([45,0,0]) {\n translate([case_width - oled_panel_width - oled_distance_from_side, 18, 0]) {\n color(\"purple\") cube([oled_panel_width, oled_panel_height, 30]);\n translate([-oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([-oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n }\n\n translate([oled_distance_from_side, 18, 0]) {\n color(\"purple\") cube([oled_panel_width, oled_panel_height, 30]);\n translate([-oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([-oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n }\n\n}\n \n\nrotate([90,0,0]) {\n\ttranslate([7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n translate([case_width - 7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\n translate([7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n translate([case_width - 7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\n\n}\n\n}\n\n\/\/ the bottom\n\n\n\/\/ shift everthing over\ncolor(\"white\")\ntranslate([180,1,0]) {\n\n\tdifference() {\n\t\tdifference() {\n\t\t cube([case_width, case_thickness - 2, case_height - 1]);\n\t\t rotate([45,0,0]) {\n\t\t color(\"red\") {\n\t\t translate([-1,9,10]) cube([case_width + 2, case_thickness + 2, case_height]);\n\t\t }\n\t\t }\n\t\t}\n\n\t\ttranslate([1,1,1]) {\n\t\t\tcolor(\"orange\") cube([case_width - 2, case_thickness - 4, case_height + trim]);\n translate([0,-trim,12]) cube([case_width-2, case_thickness + trim + trim, case_height + trim]);\n }\n\n\t\trotate([90,0,0]) {\n\t\t\ttranslate([7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t translate([case_width - 7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t\n\t\t translate([7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t translate([case_width - 7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t\n\t\t\n\t\t}\n\n\t}\n}\n","old_contents":"\/\/ all values in mm\n\/\/ thickness of metal in mm\nwall_thickness = 1;\n\/\/ X\ncase_width = 140;\n\/\/ Y\ncase_thickness = 70;\n\/\/ Z\ncase_height = 50;\n\n\/\/ button holes\nbutton_sides = 14;\nbutton_distance_from_side = 15;\nbutton_distance_from_front = 45;\n\/\/ OLED panels\noled_screen_sides = 34;\noled_panel_width = 45;\noled_panel_height = 34;\noled_screw_to_screw_width = 39;\noled_screw_to_screw_height = 28; \noled_screw_hole_diameter = 4;\noled_distance_from_side = 10;\n\n\/\/ extra space to make the objects larger than what we subtract from\ntrim = 5;\n\n\n\/*\n\/\/ reference planes\ntranslate([0, 0, -10]) {\n cube([case_width, case_thickness, 1]);\n}\n*\/\n\n\/\/ the top\ncolor(\"white\")\ndifference() {\n\n\/\/ external shell\ndifference() {\ncube([case_width, case_thickness, case_height]);\n rotate([45,0,0]) {\n color(\"red\") {\n translate([-1,9,10]) cube([case_width + 2, case_thickness + 2, case_height]);\n }\n }\n}\n\n\n\/\/ subtract a copy of the shell from the inside\ntranslate([-wall_thickness,wall_thickness,-wall_thickness]) {\n difference() {\n color(\"green\") cube([case_width + trim, case_thickness - wall_thickness - wall_thickness, case_height]);\n rotate([45,0,0]) {\n color(\"blue\") {\n translate([-1,9,10]) cube([case_width + trim + 2, case_thickness - 18, 25]);\n }\n }\n }\n}\n\n\n\/\/ button holes\ntranslate([case_width - button_sides - button_distance_from_side, button_distance_from_front, case_height - 3]) {\n color(\"black\") cube([button_sides, button_sides, wall_thickness + trim]);\n}\ntranslate([button_distance_from_side, button_distance_from_front, case_height - 3]) {\n color(\"black\") cube([button_sides, button_sides, wall_thickness + trim]);\n}\n\n\nrotate([45,0,0]) {\n translate([case_width - oled_panel_width - oled_distance_from_side, 18, 0]) {\n color(\"purple\") cube([oled_panel_width, oled_panel_height, 30]);\n translate([-oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([-oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n }\n\n translate([oled_distance_from_side, 18, 0]) {\n color(\"purple\") cube([oled_panel_width, oled_panel_height, 30]);\n translate([-oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([-oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\ttranslate([oled_panel_width + oled_screw_hole_diameter,oled_panel_height - oled_screw_hole_diameter,0]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n }\n\n}\n \n\nrotate([90,0,0]) {\n\ttranslate([7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n translate([case_width - 7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\n translate([7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n translate([case_width - 7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\n\n}\n\n}\n\n\/\/ the bottom\n\n\n\/\/ shift everthing over\ncolor(\"white\")\ntranslate([180,1,0]) {\n\n\tdifference() {\n\t\tdifference() {\n\t\t cube([case_width, case_thickness - 2, case_height - 1]);\n\t\t rotate([45,0,0]) {\n\t\t color(\"red\") {\n\t\t translate([-1,9,10]) cube([case_width + 2, case_thickness + 2, case_height]);\n\t\t }\n\t\t }\n\t\t}\n\n\t\ttranslate([1,1,1]) {\n\t\t\tcolor(\"orange\") cube([case_width - 2, case_thickness - 4, case_height + trim]);\n translate([0,-trim,12]) cube([case_width-2, case_thickness + trim + trim, case_height + trim]);\n }\n\n\t\trotate([90,0,0]) {\n\t\t\ttranslate([7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t translate([case_width - 7, 7, -5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t\n\t\t translate([7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t translate([case_width - 7, 7, -case_thickness - 5]) cylinder(r=oled_screw_hole_diameter\/2, h=20, $fn=100);\n\t\t\n\t\t\n\t\t}\n\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"720b8d2416a9c23dd10c12eab9bf0c8a1257034c","subject":"bearing: use tolerance factor for bearing h also","message":"bearing: use tolerance factor for bearing h also\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4337ff1b7958aa00cf7d2da325da4cdbec4aff55","subject":"x\/carriage: extruder wip, use proper spur gear calculation","message":"x\/carriage: extruder wip, use proper spur gear calculation\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+7*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.6];\nextruder_guidler_mount_off = [-.1*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(part=undef)\n{\n extruder_b_mount_thick = 5*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut, $fn=50);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut, $fn=50);\n }\n\n translate(extruder_guidler_mount_off)\n {\n hull()\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([-guidler_mount_d,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = house_h\/2 + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\n{\n \/*x_carriage_withmounts();*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n extruder_b(part=\"vit\");\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n x_extruder_hotend();\n\n \/\/filament path\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts();*\/\n\n rotate([-90,0,0])\n extruder_a();\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2+.5*mm;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+6*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.6];\nextruder_guidler_mount_off = [-.1*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(part=undef)\n{\n extruder_b_mount_thick = 5*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut, $fn=50);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut, $fn=50);\n }\n\n translate(extruder_guidler_mount_off)\n {\n hull()\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([-guidler_mount_d,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = house_h\/2 + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\n{\n \/*x_carriage_withmounts();*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n extruder_b(part=\"vit\");\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n x_extruder_hotend();\n\n \/\/filament path\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts();*\/\n\n rotate([-90,0,0])\n extruder_a();\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a0200e96d1e8c5a8ceecc1159b434f2e3d3cc233","subject":"Updated femur. Made a 2d projection.","message":"Updated femur. Made a 2d projection.\n\nSigned-off-by: Thomas Helmke ","repos":"Syralist\/yet-another-hexapod,Syralist\/yet-another-hexapod","old_file":"hexacad\/leg-parts.scad","new_file":"hexacad\/leg-parts.scad","new_contents":"use \r\nuse \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\nmodule femurconture()\r\n{\r\n\twall = 5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurbase();\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,20,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-60,20,-2])\r\n\t\t\t\trotate([0,0,-3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,99,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-40,-20,-2])\r\n\t\t\t\trotate([0,0,3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule femur()\r\n{\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurconture();\r\n\t\ttranslate([-16,radiuswheel+5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,radiuswheel+5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n}\r\n\r\n\r\n\/\/coxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();\r\nprojection(cut=true)\r\nfemur();\r\n\r\n","old_contents":"use \r\nuse \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\nmodule femurconture()\r\n{\r\n\twall = 5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurbase();\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,20,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-60,20,-2])\r\n\t\t\t\trotate([0,0,-3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,99,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-40,-20,-2])\r\n\t\t\t\trotate([0,0,3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule femur()\r\n{\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurconture();\r\n\t\ttranslate([-16,radiuswheel+5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,radiuswheel+5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n}\r\n\r\n\r\n\/\/coxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();\r\n\r\nfemur();\r\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4f9217ef94f5c5a61ef6d1d2f5c3593e323510a9","subject":"chilicorn raised leg","message":"chilicorn raised leg\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 18;\nhead_angle = 30;\n\nhorn_length = 18;\nhorn_radius = 3;\n\nneck_angle = 30;\nneck_radius = 4;\nneck_length = 5;\n\nbody_x = 15;\nbody_z = 27;\nbody_radius = 15;\nbody_length = 32;\n\nleg_length = 26 + body_radius;\nleg_radius = 4;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n sphere(r = body_radius);\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\nleg(theta=10);\ncolor(\"red\") cute_leg(theta=-10);\nleg(lengthwards = body_length, theta=20);\nleg(lengthwards = body_length, theta=-20);\n","old_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 13;\nhead_angle = 30;\n\nhorn_length = 18;\nhorn_radius = 3;\n\nneck_angle = 30;\nneck_radius = 5;\nneck_length = 10;\n\nbody_x = 15;\nbody_z = 29;\nbody_radius = 15;\nbody_length = 32;\n\nleg_length = 26 + body_radius;\nleg_radius = 4;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_radius);\n }\n}\n\nmodule leg(x=0, theta=20) {\n translate([body_x + x, 0, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\ncolor(\"red\") leg(theta=20);\ncolor(\"red\") leg(theta=-20);\ncolor(\"red\") leg(x = body_length, theta=20);\ncolor(\"red\") leg(x = body_length, theta=-20);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6f5801d58f3693d799aab40701fe36e09fbbe40c","subject":"Removed dodgy Explode","message":"Removed dodgy Explode\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t \n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\t\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[0, 12, 0],[0,0,-1], -90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-20, 16, 3],[0,0,1],180,0,0];\nLogoBot_Con_RightMotorDriver = [[20, 16, 3],[0,0,1],180,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false ) {\n\n Assembly(\"LogoBot\");\n\n\ttranslate([0, 0, GroundClearance]) {\n\t\n\t\t\/\/ Default Design Elements\n\t\t\/\/ -----------------------\n\t\n\t\t\/\/ Base\n\t\tLogoBotBase_STL();\n\n step(1, \n \"Connect the breadboard assembly to the underside of the base\", \n \"400 300 0 17 12 112 0 222 513\")\n\t\t attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n\t\t BreadboardAssembly();\n\t\n\t\t\/\/ Bumper assemblies (x2)\n\t\tstep(2, \"Connect the two bumper assemblies\", \"400 300 -6 7 19 64 1 212 625\" )\n\t\t for (x=[0,1], y=[0,1])\n\t\t\tmirror([0,y,0])\n\t\t\tmirror([x,0,0])\n\t\t\ttranslate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n\t\t\trotate([0,0,-30])\n\t\t\tMicroSwitch();\n\t\t\t\n\t\tstep(3, \"Push the two motor drivers onto the mounting posts\", \"400 300 -6 7 19 64 1 212 625\") {\n\t\t \/\/ Left Motor Driver\n\t\t attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t}\n\t\n\t\t\/\/ Motor + Wheel assemblies (x2)\n\t\tstep(4, \"Clip the two wheels assemblies onto the base and connect the motor leads to the the motor drivers\", \"400 300 -4 6 47 66 0 190 740\")\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n\t\t\n\t\t\/\/ Connect jumper wires\n\t\tstep(5, \n\t\t \"Connect the jumper wires between the motor drivers and the Arduino\", \n\t\t \"400 300 9 26 54 38 0 161 766\")\n\t\t {\n\t\t \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[34,43,10], [0,0,-1], 0,0,0],\n con2 = [[11.5,31.5, -6], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0.5,-1,0]\n );\n \n \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[-31.5,43,10], [0,0,-1], 0,0,0],\n con2 = [[-9,31.5, -6], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0,0,-1]\n );\n\t\t \n\t\t }\n\t\n\t\t\/\/ Battery assembly\n\t\tstep(6, \"Clip in the battery pack\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-25, -45, 12])\n\t\t\trotate([90, 0, 90])\n\t\t\tbattery_pack_double(2, 4);\n\t\n\t\t\/\/ Power Switch\n\t\n\t\t\/\/ LED\n\t\tstep(7, \"Clip the LED into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([0, -10, BaseDiameter\/2]) \n\t\t\tLED();\n\t\t\n\t\t\/\/ Piezo\n\t\tstep(8, \"Clip the piezo sounder into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-37, -32, 10])\n\t\t\tmurata_7BB_12_9();\n\t\n\t\n\t\t\/\/ Caster\n\t\t\/\/ Example of using attach\n\t\t\/\/ TODO: Correct ground clearance!\n\t\tstep(9, \"Push the caster assembly into the base so that it snaps into place\", \n\t\t \"400 300 -6 7 19 115 1 26 625\")\n\t\t attach(LogoBot_Con_Caster, MarbleCastor_Con_Default, ExplodeSpacing=15)\n\t\t\tMarbleCasterAssembly();\n\t\t\n\t\t\t\n\t\t\/\/ Conditional Design Elements\n\t\t\/\/ ---------------------------\n\t\t\t\n\t\t\/\/ PenLift\n\t\t\/\/ Placeholder of a micro servo to illustrate having conditional design elements\n\t\tif (PenLift) {\n\t\t\t\/\/ TODO: wrap into a PenLift sub-assembly\n\t\t\tstep(10, \"Fit the pen lift assembly\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t\t attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n\t\t\t\tMicroServo();\n\t\t}\n\t\t\n\t\t\n\t\t\/\/ Shell + fixings\n\t\tstep(PenLift ? 11 : 10, \n\t\t \"Push the shell down onto the base and twist to lock into place\", \n\t\t \"400 400 11 -23 65 66 0 217 1171\")\n\t attach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t BasicShell_STL();\n\t}\n\t\n\tEnd(\"LogoBot\");\n}\n\n\n\n\/*\n\tSTL: LogoBotBase_STL\n\t\n\tThe printable base plate for the robot.\n\t\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\t\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\nmodule LogoBotBase_STL() {\n\n STL(\"LogoBotBase\");\n \n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\t\n\t\/\/ Color it as a printed plastic part\n\tcolor(PlasticColor)\n\t if (UseSTL) {\n\t import(str(STLPath, \"LogoBotBase.stl\"));\n\t } else {\n\t union() {\n\t \/\/ Start with an extruded base plate, with all the relevant holes punched in it\n linear_extrude(BaseThickness)\n difference() {\n \/\/ Union together all the bits to make the plate\n union() {\n \/\/ Base plate\n circle(r=BaseDiameter\/2);\n }\n \n \/\/ hole for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170))\n difference() {\n translate([2,2,0])\n square([Breadboard_Width(Breadboard_170)-4, Breadboard_Depth(Breadboard_170)-4]);\n \n \/\/ attach mounting points, has the effect of not differencing them\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n rotate([0,0,180])\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n }\n \n \/\/ mounting holes for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170)) {\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n }\n \n \/\/ weight loss holes under the motor drivers\n attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft))\n roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight))\n\t\t\t roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\n \/\/ slots for wheels\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n rotate([-90, 0, 90]) {\n translate([-1,0,0])\n roundedSquare([WheelThickness + tw, WheelDiameter + tw], (WheelThickness + tw)\/2, center=true);\n }\n \n \/\/ weight loss under battery pack\n translate([-57\/2, -45])\n roundedSquare([57, 30], tw);\n \n \/\/ Centre hole for pen\n circle(r=PenHoleDiameter\/2);\n \n \/\/ Chevron at the front so we're clear where the front is!\n translate([0, BaseDiameter\/2 - 10, 0])\n Chevron(width=10, height=6, thickness=3);\n \n \/\/ Caster\n \/\/ Example of using attach to punch an appropriate fixing hole\n attach(LogoBot_Con_Caster, PlasticCastor_Con_Default)\n circle(r = connector_bore(PlasticCastor_Con_Default) \/ 2);\n \n \n \n \/\/ A load of fixing holes around the edge... just as an example of how to do it\n \/\/ NB: This is one of the examples we discussed during the wk1 session\n \/\/ TODO: Decide if we want these back...\n *for (i=[0:9])\n rotate([0, 0, i * 360\/10])\n translate([BaseDiameter\/2 - 5, 0, 0])\n circle(r=4.3\/2); \/\/ M4 fixing holes\n \n \/\/ Remove shell fittings\n Shell_TwistLockCutouts();\n }\n \n \/\/ Now union on any other bits (i.e. sticky-up bits!)\n \n \/\/ clips for the motors\n LogoBotBase_MotorClips();\n \n LogoBotBase_MotorDriverPosts();\n \n \n }\n }\n}\n\nmodule LogoBotBase_STL_View() {\n echo(\"400 300 0 0 0 58 0 225 681\");\n}\n\n\nmodule LogoBotBase_MotorClips() {\n \/\/ TODO: feed these local variables from the motor vitamin global vars\n mbr = 28\/2; \/\/ motor body radius\n mao = 8; \/\/ motor axle offset from centre of motor body\n mth = 7; \/\/ motor tab height\n\n \/\/ clips\n for (i=[0:1], j=[0,1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX - 6 - j*12, 0, MotorOffsetZ + mao])\n rotate([-90, 0, 90])\n rotate([0,0, 0])\n linear_extrude(5) {\n difference() {\n union() {\n \n difference() { \n hull() {\n \/\/ main circle\n circle(r=mbr + dw);\n \n \/\/ extension to correctly union to the base plate\n translate([-(mbr * 1.5)\/2, MotorOffsetZ + mao -1,0])\n square([mbr * 1.5, 1]);\n }\n \n \/\/ trim the top off\n rotate([0,0,180 + 30])\n sector2D(r=mbr+30, a=120);\n }\n\n \/\/ welcoming hands\n for (k=[0,1])\n mirror([k,0,0])\n rotate([0,0,180+30])\n translate([mbr, -dw, 0])\n polygon([[1.5,0],[4,5],[3,5],[0,dw]],4);\n }\n \n \/\/ hollow for the motor\n circle(r=mbr);\n \n }\n }\n}\n\nmodule LogoBotBase_MotorDriverPosts() {\n \/\/ mounting posts for motor drivers\n \/\/ left driver example\n \/\/ TODO: Replace this with a loop\n \/\/ using a mirror because the layout is symmetrical\n for (i=[0,1])\n mirror([i,0,0])\n attach(\n offsetConnector(invertConnector(LogoBot_Con_LeftMotorDriver), [0,0, -LogoBot_Con_LeftMotorDriver[0][2]]), \n ULN2003DriverBoard_Con_UpperLeft) \n {\n \/\/ Now we're inside the driver boards local coordinate system, which is relative to the LowerLeft mount point.\n \/\/ To position things relative to the local frame, we need to \"reverse\" attach them by swapping the order\n \/\/ of the connectors.\n attach(ULN2003DriverBoard_Con_UpperLeft, ULN2003DriverBoard_Con_LowerLeft)\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_UpperRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_LowerRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n \/\/ the lower left post doesn't need translating\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n }\n}\n\nmodule LogoBotBase_MountingPost(r1=5\/2, h1=3, r2=3\/2, h2=3) {\n cylinder(r=r1, h=h1);\n translate([0,0,h1-eta])\n cylinder(r1=r2, r2=r2 * 0.7, h=h2 +eta);\n}","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t \n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\t\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[0, 12, 0],[0,0,-1], -90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-20, 16, 3],[0,0,1],180,0,0];\nLogoBot_Con_RightMotorDriver = [[20, 16, 3],[0,0,1],180,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false ) {\n\n Assembly(\"LogoBot\");\n\n\ttranslate([0, 0, GroundClearance]) {\n\t\n\t\t\/\/ Default Design Elements\n\t\t\/\/ -----------------------\n\t\n\t\t\/\/ Base\n\t\tLogoBotBase_STL();\n\n step(1, \n \"Connect the breadboard assembly to the underside of the base\", \n \"400 300 0 17 12 112 0 222 513\")\n\t\t attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n\t\t BreadboardAssembly();\n\t\n\t\t\/\/ Bumper assemblies (x2)\n\t\tstep(2, \"Connect the two bumper assemblies\", \"400 300 -6 7 19 64 1 212 625\" )\n\t\t for (x=[0,1], y=[0,1])\n\t\t\tmirror([0,y,0])\n\t\t\tmirror([x,0,0])\n\t\t\ttranslate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n\t\t\trotate([0,0,-30])\n\t\t\tMicroSwitch();\n\t\t\t\n\t\tstep(3, \"Push the two motor drivers onto the mounting posts\", \"400 300 -6 7 19 64 1 212 625\") {\n\t\t \/\/ Left Motor Driver\n\t\t attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight), ExplodeSpacing=-20)\n\t\t\t ULN2003DriverBoard();\n\t\t}\n\t\n\t\t\/\/ Motor + Wheel assemblies (x2)\n\t\tstep(4, \"Clip the two wheels assemblies onto the base and connect the motor leads to the the motor drivers\", \"400 300 -4 6 47 66 0 190 740\")\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n\t\t\n\t\t\/\/ Connect jumper wires\n\t\tstep(5, \n\t\t \"Connect the jumper wires between the motor drivers and the Arduino\", \n\t\t \"400 300 9 26 54 38 0 161 766\")\n\t\t {\n\t\t \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[34,43,10], [0,0,-1], 0,0,0],\n con2 = [[11.5,31.5, -6], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0.5,-1,0]\n );\n \n \/\/ TODO: Insert appropriate connectors\n\t\t JumperWire(\n type = JumperWire_FM4,\n con1 = [[-31.5,43,10], [0,0,-1], 0,0,0],\n con2 = [[-9,31.5, -6], [0,0,-1], 0,0,0],\n length = 70,\n conVec1 = [1,0,0],\n conVec2 = [0,-1,0],\n midVec = [0,0,-1]\n );\n\t\t \n\t\t }\n\t\n\t\t\/\/ Battery assembly\n\t\tstep(6, \"Clip in the battery pack\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-25, -45, 12])\n\t\t\trotate([90, 0, 90])\n\t\t\tbattery_pack_double(2, 4);\n\t\n\t\t\/\/ Power Switch\n\t\n\t\t\/\/ LED\n\t\tstep(7, \"Clip the LED into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([0, -10, BaseDiameter\/2]) \n\t\t\tLED();\n\t\t\n\t\t\/\/ Piezo\n\t\tstep(8, \"Clip the piezo sounder into place\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t translate([-37, -32, 10])\n\t\t\tmurata_7BB_12_9();\n\t\n\t\n\t\t\/\/ Caster\n\t\t\/\/ Example of using attach\n\t\t\/\/ TODO: Correct ground clearance!\n\t\tstep(9, \"Push the caster assembly into the base so that it snaps into place\", \n\t\t \"400 300 -6 7 19 115 1 26 625\")\n\t\t attach(LogoBot_Con_Caster, MarbleCastor_Con_Default, Explode=Explode, ExplodeSpacing=15)\n\t\t\tMarbleCasterAssembly();\n\t\t\n\t\t\t\n\t\t\/\/ Conditional Design Elements\n\t\t\/\/ ---------------------------\n\t\t\t\n\t\t\/\/ PenLift\n\t\t\/\/ Placeholder of a micro servo to illustrate having conditional design elements\n\t\tif (PenLift) {\n\t\t\t\/\/ TODO: wrap into a PenLift sub-assembly\n\t\t\tstep(10, \"Fit the pen lift assembly\", \"400 300 -6 7 19 64 1 212 625\")\n\t\t\t attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n\t\t\t\tMicroServo();\n\t\t}\n\t\t\n\t\t\n\t\t\/\/ Shell + fixings\n\t\tstep(PenLift ? 11 : 10, \n\t\t \"Push the shell down onto the base and twist to lock into place\", \n\t\t \"400 400 11 -23 65 66 0 217 1171\")\n\t attach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t BasicShell_STL();\n\t}\n\t\n\tEnd(\"LogoBot\");\n}\n\n\n\n\/*\n\tSTL: LogoBotBase_STL\n\t\n\tThe printable base plate for the robot.\n\t\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\t\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\nmodule LogoBotBase_STL() {\n\n STL(\"LogoBotBase\");\n \n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\t\n\t\/\/ Color it as a printed plastic part\n\tcolor(PlasticColor)\n\t if (UseSTL) {\n\t import(str(STLPath, \"LogoBotBase.stl\"));\n\t } else {\n\t union() {\n\t \/\/ Start with an extruded base plate, with all the relevant holes punched in it\n linear_extrude(BaseThickness)\n difference() {\n \/\/ Union together all the bits to make the plate\n union() {\n \/\/ Base plate\n circle(r=BaseDiameter\/2);\n }\n \n \/\/ hole for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170))\n difference() {\n translate([2,2,0])\n square([Breadboard_Width(Breadboard_170)-4, Breadboard_Depth(Breadboard_170)-4]);\n \n \/\/ attach mounting points, has the effect of not differencing them\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon) {\n circle(r=4\/2 + dw);\n rotate([0,0,180])\n translate([0, -2 - dw, 0])\n square([10, 4 + 2*dw]);\n }\n }\n \n \/\/ mounting holes for breadboard\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170)) {\n attach(Breadboard_Con_BottomLeft(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n \n attach(Breadboard_Con_BottomRight(Breadboard_170),DefCon)\n circle(r=4.3\/2);\n }\n \n \/\/ weight loss holes under the motor drivers\n attach(LogoBot_Con_LeftMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperLeft))\n roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\t\t\n\t\t \/\/ Right Motor Driver\n\t\t attach(LogoBot_Con_RightMotorDriver, invertConnector(ULN2003DriverBoard_Con_UpperRight))\n\t\t\t roundedSquare([ULN2003Driver_BoardWidth - 2*ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2*ULN2003Driver_HoleInset], tw);\n\n \/\/ slots for wheels\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n rotate([-90, 0, 90]) {\n translate([-1,0,0])\n roundedSquare([WheelThickness + tw, WheelDiameter + tw], (WheelThickness + tw)\/2, center=true);\n }\n \n \/\/ weight loss under battery pack\n translate([-57\/2, -45])\n roundedSquare([57, 30], tw);\n \n \/\/ Centre hole for pen\n circle(r=PenHoleDiameter\/2);\n \n \/\/ Chevron at the front so we're clear where the front is!\n translate([0, BaseDiameter\/2 - 10, 0])\n Chevron(width=10, height=6, thickness=3);\n \n \/\/ Caster\n \/\/ Example of using attach to punch an appropriate fixing hole\n attach(LogoBot_Con_Caster, PlasticCastor_Con_Default)\n circle(r = connector_bore(PlasticCastor_Con_Default) \/ 2);\n \n \n \n \/\/ A load of fixing holes around the edge... just as an example of how to do it\n \/\/ NB: This is one of the examples we discussed during the wk1 session\n \/\/ TODO: Decide if we want these back...\n *for (i=[0:9])\n rotate([0, 0, i * 360\/10])\n translate([BaseDiameter\/2 - 5, 0, 0])\n circle(r=4.3\/2); \/\/ M4 fixing holes\n \n \/\/ Remove shell fittings\n Shell_TwistLockCutouts();\n }\n \n \/\/ Now union on any other bits (i.e. sticky-up bits!)\n \n \/\/ clips for the motors\n LogoBotBase_MotorClips();\n \n LogoBotBase_MotorDriverPosts();\n \n \n }\n }\n}\n\nmodule LogoBotBase_STL_View() {\n echo(\"400 300 0 0 0 58 0 225 681\");\n}\n\n\nmodule LogoBotBase_MotorClips() {\n \/\/ TODO: feed these local variables from the motor vitamin global vars\n mbr = 28\/2; \/\/ motor body radius\n mao = 8; \/\/ motor axle offset from centre of motor body\n mth = 7; \/\/ motor tab height\n\n \/\/ clips\n for (i=[0:1], j=[0,1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX - 6 - j*12, 0, MotorOffsetZ + mao])\n rotate([-90, 0, 90])\n rotate([0,0, 0])\n linear_extrude(5) {\n difference() {\n union() {\n \n difference() { \n hull() {\n \/\/ main circle\n circle(r=mbr + dw);\n \n \/\/ extension to correctly union to the base plate\n translate([-(mbr * 1.5)\/2, MotorOffsetZ + mao -1,0])\n square([mbr * 1.5, 1]);\n }\n \n \/\/ trim the top off\n rotate([0,0,180 + 30])\n sector2D(r=mbr+30, a=120);\n }\n\n \/\/ welcoming hands\n for (k=[0,1])\n mirror([k,0,0])\n rotate([0,0,180+30])\n translate([mbr, -dw, 0])\n polygon([[1.5,0],[4,5],[3,5],[0,dw]],4);\n }\n \n \/\/ hollow for the motor\n circle(r=mbr);\n \n }\n }\n}\n\nmodule LogoBotBase_MotorDriverPosts() {\n \/\/ mounting posts for motor drivers\n \/\/ left driver example\n \/\/ TODO: Replace this with a loop\n \/\/ using a mirror because the layout is symmetrical\n for (i=[0,1])\n mirror([i,0,0])\n attach(\n offsetConnector(invertConnector(LogoBot_Con_LeftMotorDriver), [0,0, -LogoBot_Con_LeftMotorDriver[0][2]]), \n ULN2003DriverBoard_Con_UpperLeft) \n {\n \/\/ Now we're inside the driver boards local coordinate system, which is relative to the LowerLeft mount point.\n \/\/ To position things relative to the local frame, we need to \"reverse\" attach them by swapping the order\n \/\/ of the connectors.\n attach(ULN2003DriverBoard_Con_UpperLeft, ULN2003DriverBoard_Con_LowerLeft)\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_UpperRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n attach(ULN2003DriverBoard_Con_LowerRight, ULN2003DriverBoard_Con_LowerLeft) \n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n \n \/\/ the lower left post doesn't need translating\n LogoBotBase_MountingPost(r1=(ULN2003Driver_HoleDia+2)\/2, h1 = LogoBot_Con_LeftMotorDriver[0][2], r2=ULN2003Driver_HoleDia\/2, h2=3);\n }\n}\n\nmodule LogoBotBase_MountingPost(r1=5\/2, h1=3, r2=3\/2, h2=3) {\n cylinder(r=r1, h=h1);\n translate([0,0,h1-eta])\n cylinder(r1=r2, r2=r2 * 0.7, h=h2 +eta);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"265aac9c40b65d23f516a778676a4db97f401f38","subject":"Changing roof","message":"Changing roof\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2350;\nshed_front_back = 2135;\nbase_timber = 47;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp,opp]);\n } \n}\n\nmodule breatherMembraneFront(x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo (\"lll\", x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) rotate([90,0,0]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([space_to_window_w,space_to_window_h,-100]) rotate([0,0,0]) cube([window_w,window_h,200]);\n translate([space_to_window_w*2+window_w,0,-100]) cube([door_w,door_h,200]);\n } \n}\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=timber_construct_w,timber_length=timber_construct_h, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_length,timber_width]);\n translate([0,0,z-timber_width]) cubeI([x,timber_length,timber_width]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2,timber_length, timber_width]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 34, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,7 );\n }\n}\n\nmodule insulate(space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, thickness=50, colour=\"White\")\n{\n translate([0,shed_width-thickness,0]) color(colour,0.5) cube([shed_length, thickness, shed_front_back]);\n\n opp = shed_front_height-shed_front_back;\n adj = shed_width - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n translate([0,-thickness,0]) color(colour,0.5) cube([shed_width, thickness, shed_front_back]); \n translate([0,-opp\/2,shed_front_height]) rotate([0,theta,0]) cube([shed_width+10,opp,opp]);\n }\n translate([shed_length-thickness,0,0]) rotate([0,0,90]) difference()\n {\n translate([0,-thickness,0]) color(colour,0.5) cube([shed_width, thickness, shed_front_back]); \n translate([0,-opp\/2,shed_front_height]) rotate([0,theta,0]) cube([shed_width+10,opp,opp]);\n }\n\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n translate([0,0,0]) color(colour,0.5) cube([shed_length, thickness, shed_front_height]);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n\n \n \n \n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\nannimate_step = 1\/20;\n\n\nif($t>annimate_step*1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>annimate_step*2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>annimate_step*3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>annimate_step*4) \n translate([0,shed_width-timber_construct_h,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>annimate_step*5) \n translate([timber_construct_h,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*6) \n translate([shed_length,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>annimate_step*8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>annimate_step*9) \n translate([0,shed_width+0.51,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>annimate_step*10) \n translate([-0.51,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*11) \n translate([shed_length+0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*12) \n translate([0,-0.5,timber_construct_h])\n breatherMembraneFront(shed_length,shed_front_height, thickness=0.5, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>annimate_step*13) \n translate([0,shed_width+3,timber_construct_h])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>annimate_step*14) \n translate([-3,0,timber_construct_h])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*15) \n translate([shed_length+3,0,timber_construct_h])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*16) \n translate([-3,0,timber_construct_h])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\nif($t>annimate_step*16) \n translate([0,0,timber_construct_h])\n insulate(space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/restOfGarden();","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2350;\nshed_front_back = 2135;\nbase_timber = 47;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 0.5) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\nmodule breatherMembrane(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n rotate([90,0,0]) floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n}\n\nmodule breatherMembraneSide(x,y, thickness=0.5)\n{\n \/\/ google timber frame breather membrane\n\n opp = y-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([90,0,90]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([0,y,-opp\/2]) rotate([0,0,-theta]) cube([x+10,opp,opp]);\n } \n}\n\nmodule breatherMembraneFront(x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo (\"lll\", x,y, thickness, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) rotate([90,0,0]) difference()\n {\n floorMembrane(x,y,thickness=thickness,color=\"Black\", overlap=thickness);\n translate([space_to_window_w,space_to_window_h,-100]) rotate([0,0,0]) cube([window_w,window_h,200]);\n translate([space_to_window_w*2+window_w,0,-100]) cube([door_w,door_h,200]);\n } \n}\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=timber_construct_w,timber_length=timber_construct_h, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_length,timber_width]);\n translate([0,0,z-timber_width]) cubeI([x,timber_length,timber_width]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2,timber_length, timber_width]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\nmodule cadding(x, board_height, board_width_b, board_width_s, degrees)\n{\n translate([0, -board_width_b, 0]) color(\"Peru\",0.6) rotate([-degrees,0,0])\n {\n cube([x, board_width_b - board_width_s, board_height]);\n translate([0,- board_width_s,0]) prism(x, board_width_s, board_height);\n }\n}\n\n\nmodule caddings(x, z, board_height = 150, board_width_b = 11, board_width_s = 6, overlap = 25, degrees=3)\n{\n panel_uplift = board_height - overlap;\n panels = round(-0.5+z\/panel_uplift);\n for(p = [0 : panels-1])\n {\n translate([0,0,panel_uplift * p]) \n cadding(x, board_height, board_width_b, board_width_s, degrees);\n }\n}\n\n\nmodule claddingBackWall(x,z)\n{\n translate([x,0,0]) rotate([0,0,180]) caddings(x, z);\n}\n\nmodule claddingLeftSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,x,0]) rotate([0,0,270]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z-opp]) rotate([0,-theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingRightSideWall(x,z)\n{\n opp = z-shed_front_back;\n adj = x - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n echo(\"Degrees: \", theta);\n translate([0,0,0]) rotate([0,0,90]) difference()\n {\n caddings(x, z);\n translate([0,-opp\/2,z]) rotate([0,theta,0]) cube([x+10,opp,opp]);\n }\n}\n\nmodule claddingFrontWall(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n translate([0,0,0]) rotate([0,0,0]) difference()\n {\n caddings(x, z);\n translate([space_to_window_w,-100,space_to_window_h]) rotate([0,0,0]) cube([window_w,200,window_h]);\n translate([space_to_window_w*2+window_w,-100,0]) rotate([0,0,0]) cube([door_w,200,door_h]);\n }\n}\n\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,7 );\n }\n}\n\nmodule restOfGarden(offset_x=-381, offset_y=+381 + shed_width)\n{\n garden_width= 5947.4;\n garden_length_shed_space = 2440;\n translate([offset_x, offset_y,0])\n {\n color(\"Green\") cube([garden_width, 10, 1830]);\n translate([0,-garden_length_shed_space-381,0]) color(\"Green\") cube([10, garden_length_shed_space+381, 1830]);\n translate([garden_width,-garden_length_shed_space,0]) color(\"Green\") cube([10, garden_length_shed_space, 1830]);\n }\n translate([-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\/\/ translate([garden_width-381,-3507.5-2592.5-381,0]) color(\"Green\") cube([10, +3507.5+2592.5+381, 1830]);\n\n translate([-381+0.1,-3507.5-381,0]) color(\"red\") cube([3202.5, 3507.5, 400]);\n translate([-381+0.1,-3507.5-2592.5-381,0]) color(\"red\") cube([4727.5,2592.5, 400]);\n\n }\n\n\nannimate_step = 1\/20;\n\n\nif($t>annimate_step*1) \n shedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\n\nif($t>annimate_step*2) \n translate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\n\nif($t>annimate_step*3) \n translate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\n\n\nif($t>annimate_step*4) \n translate([0,shed_width-timber_construct_h,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\nif($t>annimate_step*5) \n translate([timber_construct_h,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*6) \n translate([shed_length,timber_construct_h,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-timber_construct_h*2,shed_front_back,2, braces=1);\n\nif($t>annimate_step*7) \n translate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030, braces=0);\n\nif($t>annimate_step*8) \n roof(shed_length, shed_width,shed_front_height,shed_front_back);\n\nif($t>annimate_step*9) \n translate([0,shed_width+0.5,base_timber])\n breatherMembrane(shed_length, shed_front_back);\n\nif($t>annimate_step*10) \n translate([-0.5,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*11) \n translate([shed_length+3,0,base_timber])\n breatherMembraneSide(shed_width, shed_front_height);\n\nif($t>annimate_step*12) \n translate([-3,0,base_timber])\n breatherMembraneFront(shed_length,shed_front_height, thickness=0.5, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\nif($t>annimate_step*13) \n translate([0,shed_width+3,base_timber])\n claddingBackWall(shed_length, shed_front_back);\n\nif($t>annimate_step*14) \n translate([-3,0,base_timber])\n claddingLeftSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*15) \n translate([shed_length+3,0,base_timber])\n claddingRightSideWall(shed_width, shed_front_height);\n\nif($t>annimate_step*16) \n translate([-3,0,base_timber])\n claddingFrontWall(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, door_h=2030);\n\n\/\/restOfGarden();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7975ea919bbc10541ec87452bd67c25584d56466","subject":"updated holder element and rmeoved dead code","message":"updated holder element and rmeoved dead code\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"module rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*3); \/\/ TODO: r*10!\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\/\/ element for holding a single brush\nmodule holder()\n{\n translate([-3\/2, 0, 0])\n cube([3, 7, 17]);\n translate([0, 0, 17-2])\n {\n rotate([-90, 0, 0])\n cylinder(r=(8-1.5)\/2, h=7+2+7, $fn=50);\n translate([0, 7, 0])\n rotate([-90,0,0])\n cylinder(r=(3-1)\/2, h=14+2, $fn=30);\n }\n}\n\n\nmodule whole_holder(names)\n{\n \/\/ plate\n translate([0, 5+1, -5])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([36, 35], 3);\n cube([36, 5, 3*2]);\n }\n \/\/ back wall\n rounded_half_surface_([36, 50], 5);\n \/\/ holders\n for(i=[0:len(names)-1])\n translate([7+i*20, 25, 4])\n holder();\n}\n\n\nwhole_holder([\"John\", \"Jane\", \"Jackob\"]);\n","old_contents":"module rounded_surface_(size, r)\n{\n assert(len(size)==2);\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, r])\n sphere(r=r, $fn=r*3); \/\/ TODO: r*10!\n}\n\nmodule rounded_half_surface_(size, r)\n{\n assert(len(size)==2);\n translate([0, 0, -r])\n difference()\n {\n rounded_surface_(size, r);\n cube([size[0], size[1], r]);\n }\n}\n\n\n\n\n\/\/ element for holding a single brush\nmodule holder(size)\n{\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n}\n\n\nmodule whole_holder(names)\n{\n translate([0, 5+1, -5])\n rotate([90, 0, 0])\n difference()\n {\n rounded_surface_([36, 35], 3);\n cube([36, 5, 3*2]);\n }\n rounded_half_surface_([36, 50], 5);\n translate(1\/2*[36, 50, 0]) \/\/ TODO: temporary\n {\n for(dx=[-1, +1])\n translate([dx*20\/2-1, -1, 2])\n holder([3,25,18]);\n }\n}\n\n\nwhole_holder([\"John\", \"Jane\"]);\n\/\/rounded_surface_([36, 5, 30], 3\/2);\n\n\n\/\/rounded_surface_([30, 20], 3);\n\/\/rounded_half_surface_([30, 20], 5);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5017d330651c979df3d0ea1adefc47803a6b2c28","subject":"misc: add v_slice","message":"misc: add v_slice\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"538b47541525fe8c49868782d0ae324c8b6c3bfe","subject":"prototype forearm","message":"prototype forearm\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 160;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\nrender()\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n translate([-forearmLength + (bearingOD \/ 2) \/* + (boundingBox \/ 2)*\/, -(armWidth \/ 2) + boundingBoxHalf, 0])\n #cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\/\/ misc\nbaseDeckExtension = 50;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 120;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \nrender()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/render()\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength);\n\/*\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 8;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/ original\n \/\/ armWidth = bearingOD + bearingStep;\n \/\/ testing\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength) {\n rotate([180, 0, 0]) union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"427fa2e51fdbe2ad116795542aff0ba807635b5a","subject":"Move wire opening, fix bug in cutouts on vert face.","message":"Move wire opening, fix bug in cutouts on vert face.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 2.8; \/\/ 2.8mm = 0.110\" (looks good based on cut test piece for hardboard slotting into hardboard)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, depth\/2-70, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 2.8; \/\/ 2.8mm = 0.110\" (looks good based on cut test piece for hardboard slotting into hardboard)\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/2-50, z=height\/2);\n mock_rpi(x=width, y=depth\/2-60, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*2, y=depth\/2-50, z=height\/2+support_drop);\n }\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2,-overhang, 0])\n difference() {\n cube([face_thickness,depth+overhang*2,height]);\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,0,0])\n cube([100, real_overhang, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up);\n }\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3.2, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5eb4453c85d9ba8d56a134b6e33d96b041170f2e","subject":"more clearance for new main bar bracing blades","message":"more clearance for new main bar bracing blades\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/motorMount.scad","new_file":"Drawings\/motorMount.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/motorMount.scad $\n\/\/ $Id: motorMount.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\/\/ Distance from B-axis centerline to center of motor axle:\n\/\/ at 30+8mm offset, belts were not as tight as I'd like.\n\/\/ ?? try 45?\nmotorOffset=45;\ntopOffset=5; \/\/ top of mount is this far from B axis center\n\n\/\/ shape of small gearhead motor GA12YN20 from fasttech.com\nmodule gearheadMotorProxyGA12(pad) { union() {\ncube([10+pad,12+pad,9.2+pad],center=true);\ntranslate([0,0,-(9.2+pad)\/2-7.9]) difference() {\n cylinder(h=10,r=1.5,$fn=36);\n translate([1,-2,-.1]) cube([2,4,7.7]); }\nintersection() {\n translate([0,0,9.2\/2-1])cylinder(h=15+pad+1,r=(12+pad)\/2,$fn=48);\n cube([10+pad,12+pad,66],center=true); }\n}}\n\n\/\/ Slightly larger 60RPM gearhead motor.\n\/\/ same size? 35RPM GA16Y030 fasttech\nmodule gearheadMotorProxyGA16(pad) {\ndifference() { union(){\ntranslate([0,0,10-29]) cylinder(h=29,r=7.75+pad,$fn=64);\ncylinder(h=10+5,r=1.5,$fn=36);\n}\ntranslate([ 6 ,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([-6-5,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([1.5-(3-2.44),-2,1+10]) cube([2,4,5]);\n}}\n\n\/\/ larger 30RPM gearhead (as delivered) motor GA25Y310 fasttech\n\/\/ photo and specs on site do not match delivered product.\n\/\/ drawing is of delivered product, marked 25GA370-98, 30RPM\nmodule gearheadMotorProxyGA25(pad) {\ndifference() { union(){\ntranslate([0,0,-31]) cylinder(h=32,r=12.2+pad,$fn=64);\ncylinder(h=23.5,r=12.6+pad,$fn=64);\ntranslate([0,0,24]) cylinder(h=10,r=2,$fn=36);\ntranslate([0,0,23]) cylinder(h=2.5,r=3.5,$fn=36);\n}\ntranslate([1.5,-3,23.5+3]) cube([2,6,8]);\n}}\n\nbh=4;\nbr1=2;\nbr2=1.5;\n\nmodule ulc(dx,dy) { translate([-20+dx,-topOffset+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule urc(dx,dy) { translate([ 20+dx,-topOffset+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule llc() { translate([-6,-motorOffset-2,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\nmodule lrc() { translate([ 6,-motorOffset-2,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\n\ndtFuzz = 0.08; \/\/ fuzz to add to dove tail slots\n\ninclude \ninclude \/\/ for attachment cut-out\n\n\nmodule motorMount() {\n difference() {\n union() {\n hull() for(x=[-1,1]) {\n translate([x*22,-topOffset,0])\n sphereSection(4,3.8,ar=1,off=.1);\n translate([x*(tabX+4),-topOffset-2.5,0])\n sphereSection(3.4,3.8,ar=1,off=.1);\n }\n for(x=[-1,1]) {\n blade([x*21,-topOffset -1,.4],4,1.8,\n [x*5 ,-motorOffset-3,.4],2,2.2);\n blade([x*22,-topOffset -3,.8],1,3,\n [x*5 ,-motorOffset-3, 1],1.5,8,fn=17);\n\n blade([x*18,-topOffset -3,.4],1,3,\n [-x*8.5,-motorOffset+6,.8],1,7,fn=17);\n }\n\n hull() for (a=[-1,1]) {\n translate([5*a,-motorOffset+6,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([4*a,-motorOffset-2,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n }\n }\n\n \/\/ cut-out to fit main bar\n translate([0,0,4.1]) rotate([0,180,0]) \n mainBarBlade(30,2.4+.25+.15,fuzz=.15);\n hull() {\n translate([0,0,3]) scale([ 6,8,6]) sphere(1,$fn=12);\n cube([32,1,16],center=true);\n }\n\n \/\/ dove-tail receivers, 2x as high as actual, with 2x radius reduction\n \/\/ so they have the same wall slope, but are extra long to make\n \/\/ sure they cut all the way through the top brace bar\n for (a=[-1,1]) translate([10*a,-1,1-0.1]) rotate([0,0,-30])\n cylinder(h=6,r2=5+dtFuzz,r1=3+dtFuzz,$fn=3);\n\n \/\/ at 30mm offset, belts were not as tight as I'd like.\n \/\/ ?? try 40?\n #translate([0,-motorOffset,3.9]) gearheadMotorProxyGA12(0.4);\n\n translate([-40,-motorOffset-30,-20]) cube([80,50+motorOffset,20]);\n }\n}\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\n translate([-30,0,0]) cube([60,7,.4]);\n translate([-13,-42,0]) cube([26,.1,.4]); }\ntranslate([0,0,.2]) motorMount();\n}}\nelse { motorMount(); }\n\n\/\/%translate([0,30,0]) gearheadMotorProxyGA16(0);\n\/\/%translate([30,0,0]) gearheadMotorProxyGA12(0.2);\n\/\/%translate([-40,0,0]) gearheadMotorProxyGA25(0.2);","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/motorMount.scad $\n\/\/ $Id: motorMount.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Mount to attach to axles and hold motor drive module\n\n\/\/ Distance from B-axis centerline to center of motor axle:\n\/\/ at 30+8mm offset, belts were not as tight as I'd like.\n\/\/ ?? try 45?\nmotorOffset=45;\ntopOffset=5; \/\/ top of mount is this far from B axis center\n\n\/\/ shape of small gearhead motor GA12YN20 from fasttech.com\nmodule gearheadMotorProxyGA12(pad) { union() {\ncube([10+pad,12+pad,9.2+pad],center=true);\ntranslate([0,0,-(9.2+pad)\/2-7.9]) difference() {\n cylinder(h=10,r=1.5,$fn=36);\n translate([1,-2,-.1]) cube([2,4,7.7]); }\nintersection() {\n translate([0,0,9.2\/2-1])cylinder(h=15+pad+1,r=(12+pad)\/2,$fn=48);\n cube([10+pad,12+pad,66],center=true); }\n}}\n\n\/\/ Slightly larger 60RPM gearhead motor.\n\/\/ same size? 35RPM GA16Y030 fasttech\nmodule gearheadMotorProxyGA16(pad) {\ndifference() { union(){\ntranslate([0,0,10-29]) cylinder(h=29,r=7.75+pad,$fn=64);\ncylinder(h=10+5,r=1.5,$fn=36);\n}\ntranslate([ 6 ,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([-6-5,-10,10-29-1]) cube([5,20,29-10+1]);\ntranslate([1.5-(3-2.44),-2,1+10]) cube([2,4,5]);\n}}\n\n\/\/ larger 30RPM gearhead (as delivered) motor GA25Y310 fasttech\n\/\/ photo and specs on site do not match delivered product.\n\/\/ drawing is of delivered product, marked 25GA370-98, 30RPM\nmodule gearheadMotorProxyGA25(pad) {\ndifference() { union(){\ntranslate([0,0,-31]) cylinder(h=32,r=12.2+pad,$fn=64);\ncylinder(h=23.5,r=12.6+pad,$fn=64);\ntranslate([0,0,24]) cylinder(h=10,r=2,$fn=36);\ntranslate([0,0,23]) cylinder(h=2.5,r=3.5,$fn=36);\n}\ntranslate([1.5,-3,23.5+3]) cube([2,6,8]);\n}}\n\nbh=4;\nbr1=2;\nbr2=1.5;\n\nmodule ulc(dx,dy) { translate([-20+dx,-topOffset+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule urc(dx,dy) { translate([ 20+dx,-topOffset+dy,0]) cylinder(h=bh,r1=br1,r2=br2,$fn=6); }\nmodule llc() { translate([-6,-motorOffset-2,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\nmodule lrc() { translate([ 6,-motorOffset-2,0]) cylinder(h=bh+2,r1=br1,r2=.5,$fn=6); }\n\ndtFuzz = 0.08; \/\/ fuzz to add to dove tail slots\n\ninclude \ninclude \/\/ for attachment cut-out\n\n\nmodule motorMount() {\n difference() {\n union() {\n hull() for(x=[-1,1]) {\n translate([x*22,-topOffset,0])\n sphereSection(4,3.8,ar=1,off=.1);\n translate([x*(tabX+4),-topOffset-2.5,0])\n sphereSection(3.4,3.8,ar=1,off=.1);\n }\n for(x=[-1,1]) {\n blade([x*21,-topOffset -1,.4],4,1.8,\n [x*5 ,-motorOffset-3,.4],2,2.2);\n blade([x*22,-topOffset -3,.8],1,3,\n [x*5 ,-motorOffset-3, 1],1.5,8,fn=17);\n\n blade([x*18,-topOffset -3,.4],1,3,\n [-x*8.5,-motorOffset+6,.8],1,7,fn=17);\n }\n\n hull() for (a=[-1,1]) {\n translate([5*a,-motorOffset+6,0]) cylinder(h=bh*2,r1=3.2,r2=3,$fn=6);\n translate([4*a,-motorOffset-2,0]) cylinder(h=20 ,r1=4.6,r2=4,$fn=6);\n }\n }\n\n \/\/ cut-out to fit main bar\n translate([0,0,4.1]) rotate([0,180,0]) \n mainBarBlade(30,2.4+.25+.15,fuzz=.15);\n translate([0,0,3]) hull() {\n scale([ 6,8,5]) sphere(1,$fn=12);\n scale([18,1,6]) sphere(1,$fn=8);\n }\n\n \/\/ dove-tail receivers, 2x as high as actual, with 2x radius reduction\n \/\/ so they have the same wall slope, but are extra long to make\n \/\/ sure they cut all the way through the top brace bar\n for (a=[-1,1]) translate([10*a,-1,1-0.1]) rotate([0,0,-30])\n cylinder(h=6,r2=5+dtFuzz,r1=3+dtFuzz,$fn=3);\n\n \/\/ at 30mm offset, belts were not as tight as I'd like.\n \/\/ ?? try 40?\n #translate([0,-motorOffset,3.9]) gearheadMotorProxyGA12(0.4);\n\n translate([-40,-motorOffset-30,-20]) cube([80,50+motorOffset,20]);\n }\n}\n\nif (WITH_BRIM) {\nunion() { color(\"Cyan\") hull() {\n translate([-30,0,0]) cube([60,7,.4]);\n translate([-13,-42,0]) cube([26,.1,.4]); }\ntranslate([0,0,.2]) motorMount();\n}}\nelse { motorMount(); }\n\n\/\/%translate([0,30,0]) gearheadMotorProxyGA16(0);\n\/\/%translate([30,0,0]) gearheadMotorProxyGA12(0.2);\n\/\/%translate([-40,0,0]) gearheadMotorProxyGA25(0.2);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a30e68f3862ba37cf5b1a8d690c8f63d59f625c2","subject":"xaxis\/carriage: rewrite extruder_guidler to part pattern","message":"xaxis\/carriage: rewrite extruder_guidler to part pattern\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2303c922b2bd5a992c747cf483ed58c1f7370f7b","subject":"x\/carriage\/guidler: reduce tension screws length","message":"x\/carriage\/guidler: reduce tension screws length\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"18548ca08800185452d351a8d0baac4c22f5239a","subject":"main: add ramps model","message":"main: add ramps model\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(ycarriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(ycarriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"eebd8272371a608cf2a3ffa9c05fb6aae2f75d99","subject":"Add libraries and include tutorial","message":"Add libraries and include tutorial\n\nUses modules from MCAD\n","repos":"usedbytes\/openscad_tut","old_file":"tut7_libraries.scad","new_file":"tut7_libraries.scad","new_contents":"\/* Tutorial 7 - Using libraries *\/\n\n\/* You can \"include\" or \"use\" scad files to use the modules they contain *\/\n\ntranslate([0, 0, -20]) {\n\t\/* \"include\" is like pasting the file contents here *\/\n\tinclude \n}\n\n\/* \"use\" just makes the file's modules available *\/\n\n\/* OpenSCAD comes with MCAD - a library of useful modules\n * It contains many things - look here: https:\/\/github.com\/openscad\/MCAD *\/\ns = 20;\n\nuse \ntranslate([0, 0, 0]) {\n\tpentagon(5);\n\ttranslate([15, 0, 0]) nonagon_prism(10, 5);\n}\n\n\/* Gears *\/\nuse \ntranslate([0, s, 0]) scale(0.1) bevel_gear_pair();\n\n\/* Lego! *\/\nuse \ntranslate([2 * s, 0, 0])\n\tblock(4, 2, 1, reinforcement = true, solid_bottom = false);\n\n\/* *models* of bearings *\/\nuse \ntranslate([0, -s, 0]) bearing();\n\n\/* Stepper motor mounts *\/\nuse \ntranslate([-50, 0, 0]) stepper_motor_mount(23);\n\n\/* Have a look around the 'net for other libraries, or write your own! *\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tut7_libraries.scad' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"180090d06e84c8a71f0582d1c0443a4229395583","subject":"main: don't show lcd mount in preview mode","message":"main: don't show lcd mount in preview mode\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n\n\n for(x=axis_range_x)\n translate([x,0,0])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n\n\n for(x=axis_range_x)\n translate([x,0,0])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"354c3b7d022bf086ecb96c94d5ca004e6f33bd2f","subject":"main\/zmount: Improve z motor mount","message":"main\/zmount: Improve z motor mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \n\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule extrusion(h, w, l) {\n rotate([90, 0, 90]) {\n translate([2.5, 2.5, 0]) cube([h - 5, w - 5, l]);\n translate([0, 0, 0.1]) cube([h, w, l - 0.2]);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([extrusion_size,extrusion_size,main_height], align=[0,i,1]);\n\n translate([0, 0, main_height]) \n cubea([main_upper_width,extrusion_size,extrusion_size], align=[0,0,1]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n cubea([main_width,extrusion_size,extrusion_size], align=[0,i,-1]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([main_depth,extrusion_size,extrusion_size], align=[0,i,-1]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2),0,zaxis_motor_offset_z])\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n\n}\n\nmodule extrusion(h, w, l) {\n rotate([90, 0, 90]) {\n translate([2.5, 2.5, 0]) cube([h - 5, w - 5, l]);\n translate([0, 0, 0.1]) cube([h, w, l - 0.2]);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([extrusion_size,extrusion_size,main_height], align=[0,i,1]);\n\n translate([0, 0, main_height]) \n cubea([main_upper_width,extrusion_size,extrusion_size], align=[0,0,1]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n cubea([main_width,extrusion_size,extrusion_size], align=[0,i,-1]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([main_depth,extrusion_size,extrusion_size], align=[0,i,-1]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"525cf7f45d1fe13566c0c44bfad600f22768c9be","subject":"slightly reduce clearance and nut dia","message":"slightly reduce clearance and nut dia\n\nThe nut was a bit too wobbly\n","repos":"josephmjoy\/funstuff","old_file":"models\/hex_bolt_anchor\/hex_bolt_anchor.scad","new_file":"models\/hex_bolt_anchor\/hex_bolt_anchor.scad","new_contents":"\/\/ Hex Bolt Anchor\n\/\/ Anchor to prevent a hex bolt (or nut) from\n\/\/ rotating.\n\/\/ There are two styles:\n\/\/ style A: Concentric, with washer (the original). Must\n\/\/ be glued.\n\/\/ style B: Offset, without washer, and with hole for \n\/\/ retraining screw. The offset prevents\n\/\/ the bolt from rotating.\n\/\/\n\/\/ 3\/4\" - 18 nut dimensions:\n\/\/ nut height: 8.45mm \/\/ this can vary with nut\n\/\/ flat diameter: 14.21mm\n\/\/ vertex diameter: 16.23mm (measured)\n\/\/ vertex diameter: 16.41mm (calculated from flat diameter)\n\/\/ Note that the nut has slightly rounded corners.\n\/\/ washer thickness: 1.65mm\n\/\/ washer diameter: 20.92mm\n\n\/\/ ------- START OF PARAMETERS ---------------------\n\/\/ Horizontal clearances (mm) so parts drop in easily\nclearance = 0.4;\n\n\/\/ Exact height of nut\nnut_height = 8.45;\n\n\/\/ Vertex-to-vertex dia of nut\nhex_dia = 16.23;\n\n\/\/ Exact dia of washer (style A)\nwasher_dia = 20.92;\n\n\/\/ Exact height of washer\nwasher_height = 1.89;\n\n\/\/ Retaining screw shaft dia (style B only)\nscrew_dia = 3.53; \/\/ #6\n\/\/ Above is for a flat head screw with a\n\/\/ 45 degree angle for the head conic section.\n\n\/\/ Diameter of screw head (style B only)\nscrew_head_dia = 7;\n\n\/\/ Overall diameter\nitem_dia = 25.4; \/\/ 1 inch\n\n\/\/ Extra height above nut and screw\nextra_height = 0.2;\n\/\/ Above helps ensure that nothing sticks out\n\/\/ above the item - so the item can be made\n\/\/ flush with the surrounding wood.\n\n\/\/ Item style (A is glued, B is screwed)\nitem_style = \"A\"; \/\/ [A, B]\n\n\/\/ ------- END OF PARAMETERS --------------------\nmodule parameter_end(){} \/\/ End of customizer parameters\n\n_EPS = 0.1; \/\/ for CSG\n\n\/\/ Min arc length (for cylinders and spheres)\n\/\/ This is perfectly fine for 3D printed circles of dia 1\".\n$fs = 1; \ndo_A = (item_style == \"A\");\n\n\/\/ Overall height\nitem_height = nut_height + extra_height + (do_A ? washer_height: 0);\n\nmodule hex_hole() {\n dia = hex_dia + clearance;\n cylinder(h=item_height + _EPS, r=dia\/2, $fn=6);\n}\n\nmodule washer_hole() {\n dia = washer_dia + clearance;\n cylinder(washer_height + _EPS, r=dia\/2);\n}\n\nmodule screw_hole() {\n dia1 = screw_dia + clearance;\n dia2 = screw_head_dia + 2*extra_height;\n rdiff = (dia2 - dia1)\/2 + clearance;\n cylinder(h=item_height + _EPS, r=dia1\/2);\n translate([0, 0, item_height-rdiff+_EPS]) {\n cylinder(h=rdiff, r2=dia2\/2, r1=dia1\/2);\n}\n}\n\n\/\/ The unit without any holes\nmodule stock() {\n dia = item_dia - clearance;\n cylinder(h=item_height, r=dia\/2);\n}\n\n\nmodule cutout_A() { \n union() {\n translate([0, 0, -_EPS]) hex_hole();\n translate([0, 0, item_height - washer_height])\n washer_hole();\n } \n}\n\n\nmodule cutout_B() { \n union() {\n \/\/ The constants below were obtained by\n \/\/ trial-and-error so that the screw hole\n \/\/ (with conical section for head) fits\n \/\/ within the available space.\n screw_offset = -screw_head_dia*1.24;\n hex_offset = hex_dia*0.14;\n translate([0, hex_offset, -_EPS\/2]) hex_hole();\n translate([0, screw_offset, -_EPS\/2])screw_hole();\n } \n}\n\n\nmodule style_A() {\n difference() {\n stock();\n cutout_A();\n }\n}\n\nmodule style_B() {\n difference() {\n stock();\n cutout_B();\n }\n}\n\nif (do_A) {\n style_A();\n} else {\n style_B();\n}","old_contents":"\/\/ Hex Bolt Anchor\n\/\/ Anchor to prevent a hex bolt (or nut) from\n\/\/ rotating.\n\/\/ There are two styles:\n\/\/ style A: Concentric, with washer (the original). Must\n\/\/ be glued.\n\/\/ style B: Offset, without washer, and with hole for \n\/\/ retraining screw. The offset prevents\n\/\/ the bolt from rotating.\n\/\/\n\/\/ 3\/4\" - 18 nut dimensions:\n\/\/ nut height: 8.45mm \/\/ this can vary with nut\n\/\/ flat diameter: 14.21mm\n\/\/ vertex diameter: 16.23mm (measured)\n\/\/ vertex diameter: 16.41mm (calculated from flat diameter)\n\/\/ Note that the nut has slightly rounded corners.\n\/\/ washer thickness: 1.65mm\n\/\/ washer diameter: 20.92mm\n\n\/\/ ------- START OF PARAMETERS ---------------------\n\/\/ Horizontal clearances (mm) so parts drop in easily\nclearance = 0.5;\n\n\/\/ Exact height of nut\nnut_height = 8.45;\n\n\/\/ Vertex-to-vertex dia of nut\nhex_dia = 16.41;\n\n\/\/ Exact dia of washer (style A)\nwasher_dia = 20.92;\n\n\/\/ Exact height of washer\nwasher_height = 1.89;\n\n\/\/ Retaining screw shaft dia (style B only)\nscrew_dia = 3.53; \/\/ #6\n\/\/ Above is for a flat head screw with a\n\/\/ 45 degree angle for the head conic section.\n\n\/\/ Diameter of screw head (style B only)\nscrew_head_dia = 7;\n\n\/\/ Overall diameter\nitem_dia = 25.4; \/\/ 1 inch\n\n\/\/ Extra height above nut and screw\nextra_height = 0.2;\n\/\/ Above helps ensure that nothing sticks out\n\/\/ above the item - so the item can be made\n\/\/ flush with the surrounding wood.\n\n\/\/ Item style (A is glued, B is screwed)\nitem_style = \"A\"; \/\/ [A, B]\n\n\/\/ ------- END OF PARAMETERS --------------------\nmodule parameter_end(){} \/\/ End of customizer parameters\n\n_EPS = 0.1; \/\/ for CSG\n\n\/\/ Min arc length (for cylinders and spheres)\n\/\/ This is perfectly fine for 3D printed circles of dia 1\".\n$fs = 1; \ndo_A = (item_style == \"A\");\n\n\/\/ Overall height\nitem_height = nut_height + extra_height + (do_A ? washer_height: 0);\n\nmodule hex_hole() {\n dia = hex_dia + clearance;\n cylinder(h=item_height + _EPS, r=dia\/2, $fn=6);\n}\n\nmodule washer_hole() {\n dia = washer_dia + clearance;\n cylinder(washer_height + _EPS, r=dia\/2);\n}\n\nmodule screw_hole() {\n dia1 = screw_dia + clearance;\n dia2 = screw_head_dia + 2*extra_height;\n rdiff = (dia2 - dia1)\/2 + clearance;\n cylinder(h=item_height + _EPS, r=dia1\/2);\n translate([0, 0, item_height-rdiff+_EPS]) {\n cylinder(h=rdiff, r2=dia2\/2, r1=dia1\/2);\n}\n}\n\n\/\/ The unit without any holes\nmodule stock() {\n dia = item_dia - clearance;\n cylinder(h=item_height, r=dia\/2);\n}\n\n\nmodule cutout_A() { \n union() {\n translate([0, 0, -_EPS]) hex_hole();\n translate([0, 0, item_height - washer_height])\n washer_hole();\n } \n}\n\n\nmodule cutout_B() { \n union() {\n \/\/ The constants below were obtained by\n \/\/ trial-and-error so that the screw hole\n \/\/ (with conical section for head) fits\n \/\/ within the available space.\n screw_offset = -screw_head_dia*1.24;\n hex_offset = hex_dia*0.14;\n translate([0, hex_offset, -_EPS\/2]) hex_hole();\n translate([0, screw_offset, -_EPS\/2])screw_hole();\n } \n}\n\n\nmodule style_A() {\n difference() {\n stock();\n cutout_A();\n }\n}\n\nmodule style_B() {\n difference() {\n stock();\n cutout_B();\n }\n}\n\nif (do_A) {\n style_A();\n} else {\n style_B();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e06cb1702ae9adb48d877e22b15c46f072839ee5","subject":"block continued","message":"block continued\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"block\/block.scad","new_file":"block\/block.scad","new_contents":"$fn=50;\nholeTolerance=1.05;\nmodule side_flat() {\n difference() {\n square([37,34]);\n for(i=[3.5,37-3.5])translate([i,3.5])circle(r=3\/2);\n translate([37-3.5,11.5])circle(r=1.5*holeTolerance);\n translate([0,7])square([7,50]);\n translate([18,25.5])circle(r=7);\n translate([5,25.5])square([37,34]);\n translate([17,18.5])square([37,34]);\n }\n}\nmodule side_ext() {\n difference() {\n translate([0,13])rotate(a=[90,0,0])difference() {\n linear_extrude(height=13)side_flat();\n for(i=[3.5,37-3.5])translate([i,3.5,6])cylinder(r=5.4\/2,h=16);\n }\n translate([21.5,8])pipe();\n }\n}\nmodule pipe() {\n cylinder(r=3*holeTolerance,$fn=9,h=2);\n translate([0,0,2])cylinder(r=3*holeTolerance,$fn=6,h=6);\n translate([0,0,8])cylinder(r2=1*holeTolerance,r1=1.75*holeTolerance,h=4);\n translate([0,0,11])cylinder(r=1*holeTolerance,h=8);\n}\nside_ext();","old_contents":"$fn=50;\nmodule side_flat() {\n difference() {\n square([37,34]);\n for(i=[3.5,37-3.5])translate([i,3.5])circle(r=3\/2);\n translate([37-3.5,11.5])circle(r=8\/2);\n translate([0,7])square([7,50]);\n translate([18,25.5])circle(r=7);\n translate([5,25.5])square([37,34]);\n translate([17,18.5])square([37,34]);\n }\n}\nmodule side_ext() {\n difference() {\n translate([0,16])rotate(a=[90,0,0])difference() {\n linear_extrude(height=13)side_flat();\n for(i=[3.5,37-3.5])translate([i,3.5,2])cylinder(r=5.4\/2,h=16);\n }\n translate([21.5,11])pipe();\n }\n}\nmodule pipe() {\n \n cylinder(r=3,$fn=9,h=2);\n translate([0,0,2])cylinder(r=3,$fn=6,h=6);\n translate([0,0,8])cylinder(r2=1,r1=1.75,h=4);\n translate([0,0,11])cylinder(r=1,h=8);\n}\nside_ext();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ea08e03e5f1414ff060376cd4bad333e04141e70","subject":"visualization added","message":"visualization added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/all.scad","new_file":"tablet_toilet_mount\/all.scad","new_contents":"use \nuse \n\n\/\/support();\n\/\/wallMount();\n\n%wallMount();\n%translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n","old_contents":"use \nuse \n\nsupport();\n\ntranslate([10,0,0])\n wallMount();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8c737e2dae14ee2699f02b7c99413683dbdb5645","subject":"rounded corners on some parts","message":"rounded corners on some parts\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC\n\/\/ mainPulley, mainBar, motorPulley, braceBar\n\/\/\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ PART=\"motor\" to show motor-mount assembly\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"demo\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight-.2;\nacH1 = acH0+1.5;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage1(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\nmodule monoBracedLinkage(len) {\nlro = Drad+2; \/\/ outisde link radius\ndifference() {\n union() { \/\/------------------------ EF\n \/\/difference() {\n hull() { \/\/ main bar\n translate([0,0,0.3]) scale([Frad+.3,Frad+.3,1.8]) sphere(1,$fn=48);\n translate([len,0,0]) scale([2,rad4+1,2]) sphere(1,$fn=48);\n }\n *hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n \/\/}\n\n \/\/ non-braced (BED side) reinforcement \n translate([len,0,0]) {\n hull() { translate([-3*lro,0,0]) sphere(.2);\n translate([0,0,.4]) scale([lro,lro,2]) sphere(1,$fn=36);\n }\n hull() { translate([-2*lro,0,2]) sphere(.2);\n cylinder(r1=rad4+2,r2=rad4+1.3,h=ForkHeight,$fn=36);\n }\n }\n\n *hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n hull() { translate([1.7*Frad,0,1.5]) sphere(.2);\n cylinder(h=ForkHeight,r1=0.8*Frad,r2=rad4+1.4,$fn=48);\n }\n\n *cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n \/\/ out-of-plane ridge\/brace\n hull() for(x=[0,len]) translate([x,0,1]) scale([1,1,ForkHeight-1])\n sphere(r=1,$fn=16);\n }\n\n for(x=[0,len]) translate([x,0,0]) drillHole(rad4);\n translate([-20,-20,-20]) cube([len+40,40,20]);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage2(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) difference() {\n union() {\n hull() { translate([2*r0,0,.4]) sphere(.2);\n intersection() { translate([0,0,h0\/2]) cube([16,16,h0],center=true);\n translate([0,0,h0*.4]) scale([r0,r0,h0+1]) sphere(1,$fn=48);\n }\n }\n translate([len,0,0]) hull() { translate([-2.5*r1,0,.3]) sphere(.2);\n intersection() { translate([0,0,h1\/2]) cube([16,16,h1],center=true);\n translate([0,0,.5]) scale([r1,r1,h1]) sphere(1,$fn=48);\n }\n }\n\n hull() {\n translate([ 0 ,0,.6]) scale([3,r0-.2,BarHeight- .6]) sphere(1,$fn=24);\n translate([len,0,.6]) scale([2,d1+1 ,BarHeight-1.6]) sphere(1,$fn=24);\n }\n\n hull() {\n translate([ d0 ,0,2]) scale([1,1,h0-2]) sphere(1,$fn=24);\n translate([len-d1,0,0]) scale([.5,.5,BarHeight-.3]) sphere(1);\n }\n }\n\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n translate([-10,-10,-10]) cube([len+20,20,10]);\n}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\n\/*\nmodule brace1(len,h0,r0) {\nr1=r0+1.7;\ndifference() {\n union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n*\/\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() {\n union() {\n hull() for(x=[-1,1]) translate([x*len\/2,0,0.8])\n scale([1,r0+2,1.8]) sphere(1,$fn=24);\n\n for(x=[-1,1]) translate([x*len\/2,0,0]) hull() {\n intersection() {\n translate([0,0,h0\/2-.1]) cube([2*r0+8,2*r0+8,h0+0.2],center=true);\n translate([0,0,1]) scale([r0+2,r0+2,h0+4]) sphere(1,$fn=36);\n }\n translate([-x*h0*1.5,0,0]) sphere(.2);\n }\n\n hull() for(x=[-1,1]) translate([x*len\/2,0,0])\n scale([1,1,h0-.3]) sphere(1,$fn=24);\n }\n\n for(x=[-1,1]) translate([x*len\/2,0,0]) drillHole(r0);\n\n translate([0,0,-5]) cube([len+20,20,10],center=true);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + 1.5*HoleFuzz; \/\/ standoff countersink radius\n\n difference() {\n union() {\n pulley2(AC+5.5,ph,sr,0); \/\/ make with radius for standoff\n translate([0,0,0.1])\n cylinder(r=sr+1,h=ph-0.7,$fn=12); \/\/ fill back in for rod hole\n }\n\n translate([0,0,-1]) cylinder(r=rad4,h=ph+4,$fn=17); \/\/ drill hole for central rod\n for (y=[-1,1]) translate([0,AC*y,-1])\n cylinder(r=2,h=ph,$fn=36); \/\/ screw pass-through for crank arm\n }\n\n\/*\nsd=.8; \/\/ standoff countersink distance \n\n \/\/ countersink main pulley for standoffs a bit.\n difference() {\n union() {\n pulley(18,ph,rad4,0);\n \/\/ pulley hub was 1.3 mm higher than outher thickness. a little more for countersink\n cylinder(r1=5,r2=4,h=ph+1.5,$fn=36); \/\/ give pulley a wider hub\n }\n\n translate([0,0,-1]) {\n cylinder(r=rad4,h=ph+3,$fn=17); \/\/ main threaded rod hole\n \/\/cylinder(r=sr,h=1+sd+.2,$fn=28); \/\/ a little extra on bridged standoff depth\n }\n translate([0,0,ph+1.5-sd-.5]) cylinder(r=sr,h=3,$fn=28);\n }\n*\/\n\n}\n\n\/\/module motorPulley() pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz);\n\/\/ let small pulley be polygon to give it some \"teeth\"\nmodule motorPulley() pulley2(8,4,1.5+dHoleFuzz,1+dHoleFuzz,fn=12,fni=12);\n\nuse \nmodule motorMountDemo() {\npo=8; \/\/ main pulley offset\n translate([0,-Ay,0]) mainBar(Bx,Ay);\n translate([0,-Ay,22]) rotate([0,180,0]) mainBar(Bx,Ay);\n translate([0,-Ay-5.4,4]) rotate([0,180,0]) motorMount();\n translate([0,0,po]) mainPulley();\n #translate([0,0,po-12.7 ]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n #translate([0,0,po+6.6-.6]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n translate([0,-48.5,8]) motorPulley();\n translate([0,0,26.7]) rotate([0,0,90]) crankArmAC();\n}\n\nmodule crankArmAC() crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+2.5,BradFree+.2,3,Hrad+2.5,rad4);\nelse if (PART==\"AC\" ) crankArmAC(); \nelse if (PART==\"mainPulley\") { mainPulley(); }\nelse if (PART==\"motorPulley\") { motorPulley(); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad+.1); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\nelse if (PART==\"motor\") { motorMountDemo(); }\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n %translate([0,Ay,20]) mainPulley();\n translate([0,-50,0]) motorPulley();\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArmAC(); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n\n\n\/\/else if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7); translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\n\/\/else if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15); translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, mainPulley, mainBar, motorPulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\n\/\/ PART=\"motor\" to show motor-mount assembly\n\n\/\/ *** DEPRICATED\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\n\/\/\n\/\/ standoffs also DEPRICATED\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\n\/\/ *****\n\nPART=\"mainPulley\";\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight-.2;\nacH1 = acH0+1.5;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\n\nmodule mainPulley() {\nph=5; \/\/ pulley thickness\nsr=25.4 * 3\/16\/2 + 1.5*HoleFuzz; \/\/ standoff countersink radius\n\n difference() {\n union() {\n pulley2(AC+5.5,ph,sr,0); \/\/ make with radius for standoff\n translate([0,0,0.1])\n cylinder(r=sr+1,h=ph-0.7,$fn=12); \/\/ fill back in for rod hole\n }\n\n translate([0,0,-1]) cylinder(r=rad4,h=ph+4,$fn=17); \/\/ drill hole for central rod\n for (y=[-1,1]) translate([0,AC*y,-1])\n cylinder(r=2,h=ph,$fn=36); \/\/ screw pass-through for crank arm\n }\n\n\/*\nsd=.8; \/\/ standoff countersink distance \n\n \/\/ countersink main pulley for standoffs a bit.\n difference() {\n union() {\n pulley(18,ph,rad4,0);\n \/\/ pulley hub was 1.3 mm higher than outher thickness. a little more for countersink\n cylinder(r1=5,r2=4,h=ph+1.5,$fn=36); \/\/ give pulley a wider hub\n }\n\n translate([0,0,-1]) {\n cylinder(r=rad4,h=ph+3,$fn=17); \/\/ main threaded rod hole\n \/\/cylinder(r=sr,h=1+sd+.2,$fn=28); \/\/ a little extra on bridged standoff depth\n }\n translate([0,0,ph+1.5-sd-.5]) cylinder(r=sr,h=3,$fn=28);\n }\n*\/\n\n}\n\n\/\/module motorPulley() pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz);\n\/\/ let small pulley be polygon to give it some \"teeth\"\nmodule motorPulley() pulley2(8,4,1.5+dHoleFuzz,1+dHoleFuzz,fn=12,fni=12);\n\nuse \nmodule motorMountDemo() {\npo=8; \/\/ main pulley offset\n translate([0,-Ay,0]) mainBar(Bx,Ay);\n translate([0,-Ay,22]) rotate([0,180,0]) mainBar(Bx,Ay);\n translate([0,-Ay-5.4,4]) rotate([0,180,0]) motorMount();\n translate([0,0,po]) mainPulley();\n #translate([0,0,po-12.7 ]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n #translate([0,0,po+6.6-.6]) cylinder(r=25.4*3\/16\/2,h=25.4\/2,$fn=18);\n translate([0,-38.5,8]) motorPulley();\n translate([0,0,26.7]) rotate([0,0,90]) crankArmAC();\n}\n\nmodule crankArmAC() crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+2.5,BradFree+.2,3,Hrad+2.5,rad4);\nelse if (PART==\"AC\" ) crankArmAC(); \nelse if (PART==\"mainPulley\") { mainPulley(); }\nelse if (PART==\"motorPulley\") { motorPulley(); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad+.1); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\nelse if (PART==\"motor\") { motorMountDemo(); }\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n %translate([0,Ay,20]) mainPulley();\n translate([0,-50,0]) motorPulley();\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArmAC(); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n\n\n\/\/else if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7); translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\n\/\/else if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15); translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"afad4262164245b575330ecf248cca063bea5571","subject":"work in progress, arm joint","message":"work in progress, arm joint\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder - arm joint \ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + 7]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ arm joint pieces\nrender() \ncolor([.1, .7, .1]) \n translate([-armLength, 0, shoulderBaseHeight + 7 + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n \/\/ hardcoded values should be moved out\n baseDeckExtension = 50;\n \/\/ 8 is distance from shaft center to screw center on x axis\n \/\/ 35 is screw center to screw center on y axis\n shaftCenterToMountHoldCenterXAxis = 8;\n mountHoleCenterToMountHoleCenter = 35;\n leadScrewDiameter = 8;\n \/\/ end\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n union() {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingOD - 2 * bearingStep);\n }\n \/\/ screw holes for joining to joint\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .6;\n\n\/\/ size in mm of bearing interface step\nbearingStep = 2;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 9.1;\nmountScrewDiameter = 3.1;\nbearingStep = 2;\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 200;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder stepper\nrotate([0, 180, 0]) translate([-8, 0, 10]) StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep]) %bearing6807_2RS();\n\/\/ shoulder - arm joint \ncolor([1, .7, .7]) translate([0, 0, shoulderBaseHeight + 7]) armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n \/\/ hardcoded values should be moved out\n baseDeckExtension = 50;\n \/\/ 8 is distance from shaft center to screw center on x axis\n \/\/ 35 is screw center to screw center on y axis\n shaftCenterToMountHoldCenterXAxis = 8;\n mountHoleCenterToMountHoleCenter = 35;\n leadScrewDiameter = 8;\n \/\/ end\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n boundingBox = 12;\n boundingBoxHalf = boundingBox \/ 2;\n \/\/\n armWidth = bearingOD + bearingStep;\n \/\/render(convexivity = 3)\n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n \/\/translate([-armLength, 0, 2 * bearingStep])\n \/\/ rotate([180, 0, 0])\n \/\/ armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n }\n\/* \n difference() {\n \n linear_extrude(height = bearingStep * 2, center = false, convexivity = 10, twist = 0)\n polygon(points = [ [0, -armWidth\/2], [0, armWidth\/2], [-armLength, armWidth\/2], [-armLength, -armWidth\/2] ]);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n }\n intersection() {\n \n translate([-armLength + bearingOD \/ 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 : armWidth \/ 2 : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n *\/\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n union() {\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"f7545b5129f5d448c9f26806567cebcd5ad37a0b","subject":"new line at the end added","message":"new line at the end added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"door_hinge_fix\/door_hinge_fix.scad","new_file":"door_hinge_fix\/door_hinge_fix.scad","new_contents":"module distance_fixer(extra_d)\n{\n difference()\n {\n d_real=7;\n d=d_real+extra_d;\n cube([12, 40, 22-16]);\n for(dy = [5+d_real\/2, 40-6-d_real\/2])\n translate([12\/2, dy, -5])\n cylinder(r=d\/2, h=20, $fs=0.1);\n }\n}\n\ntranslate([0*15, 0, 0])\n distance_fixer(1);\n\ntranslate([1*15, 0, 0])\n distance_fixer(1.5);\n\ntranslate([2*15, 0, 0])\n distance_fixer(2);\n","old_contents":"module distance_fixer(extra_d)\n{\n difference()\n {\n d_real=7;\n d=d_real+extra_d;\n cube([12, 40, 22-16]);\n for(dy = [5+d_real\/2, 40-6-d_real\/2])\n translate([12\/2, dy, -5])\n cylinder(r=d\/2, h=20, $fs=0.1);\n }\n}\n\ntranslate([0*15, 0, 0])\n distance_fixer(1);\n\ntranslate([1*15, 0, 0])\n distance_fixer(1.5);\n\ntranslate([2*15, 0, 0])\n distance_fixer(2);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9da25828b6396b9aaba874f6340294a7c8d74712","subject":"rod-clamps: round","message":"rod-clamps: round\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n base_cut = -rod_d\/2 + clamp_tolerance;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n translate([base_cut,0,0])\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([base_cut,0,0])\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","old_contents":"include \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n base_cut = -rod_d\/2 + clamp_tolerance;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ base\n translate([base_cut,0,0])\n cubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([base_cut,0,0])\n cubea([outer_d\/2+.1, outer_d+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9f0d02e108f6ccc93ae54e63b260e529491080da","subject":"screws\/screw: rewrite to part system","message":"screws\/screw: rewrite to part system\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"button\")\n {\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"set\")\n {\n if(drive == \"hex\")\n {\n \/\/ set head uses -1*mm smaller hex\n tz(-head_h)\n cylindera(d = fn_radius(threadsize-1, 6), h = 1000, $fn = 6, align=Z);\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n difference()\n {\n union()\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=\"pos\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n }\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=\"neg\", head=head, thread=thread_, orient=Z, align=Z);\n }\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"button\")\n {\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"set\")\n {\n if(drive == \"hex\")\n {\n \/\/ set head uses -1*mm smaller hex\n tz(-head_h)\n cylindera(d = fn_radius(threadsize-1, 6), h = 1000, $fn = 6, align=Z);\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5e6a0e0d2f1e60147b5e1a8c2f85df6eebe67b27","subject":"Revert \"adjust buttons diameter again\"","message":"Revert \"adjust buttons diameter again\"\n\nThis reverts commit 4d08f24b96e21f3ca8a92ca791474b8490ea357c.\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 7 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b07c21602e1957c9d2ebdec14747a7edc98e24f1","subject":"Move render() call to fix rending issues","message":"Move render() call to fix rending issues\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/Wheel.scad","new_file":"hardware\/assemblies\/Wheel.scad","new_contents":"\/*\n\tAssembly: WheelAssembly\n\tCombined motor and wheel assembly\n\t\n\tLocal Frame: \n\t\tPlaces the motor default connector at the origin - i.e. use the motor default connector for attaching into a parent assembly\n\n*\/\n\n\/\/ Connectors\nWheel_Con_Default\t\t\t\t= [ [0, 0 ,0], [0, 0, 1], 90, 0, 0 ];\n\n\nmodule WheelAssembly( ) {\n\n assembly(\"assemblies\/Wheel.scad\", \"Drive Wheel\", str(\"WheelAssembly()\")) {\n \n if (DebugCoordinateFrames) frame();\n \n \/\/ debug connectors?\n if (DebugConnectors) {\n \n }\n \n \/\/ Vitamins\n logo_motor();\n \n \/\/ ribbon Cable :)\n if ($rightSide) {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [2.5, -23, 7],\n [10, -60, 10],\n [20, -30,15],\n [26,0, 13]\n ],\n vectors = [\n [-1, 0 ,0],\n [-0.5, 0.5, 1],\n [-0.5, 0.5, 0],\n [0, 0,1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n \n \n } else {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [-2.5, -23, 7],\n [10, -60, 10],\n [20, -30,25],\n [26,0, 30]\n ],\n vectors = [\n [1, 0 ,0],\n [0.5, 0.5, -1],\n [-0.5, 0.5, -1],\n [0, 0,-1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n }\n \n \/\/ STL\n step(1, \"Push the wheel onto the motor shaft \\n**Optional:** add a rubber band to wheel for extra grip.\") {\n view(t=[0, -3, 5], r=[349,102,178], d=500);\n\n attach(Wheel_Con_Default, [[0,0,2],[0,0,-1],0,0,0], ExplodeSpacing=20)\n Wheel_STL();\n }\n\t}\n}\n\n\nmodule Wheel_STL() {\n\n\tprintedPart(\"assemblies\/Wheel.scad\", \"Wheel\", \"Wheel_STL()\") {\n\t\n\t view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Wheel.stl\"));\n } else {\n\t\t\t\tWheelModel();\n }\n }\n\t}\n}\n\n\nmodule WheelModel()\n{\n\trimThickness = 4;\n\tspokeThickness = 5;\n\thubDiameter = 10;\n\n \/\/ Outer Rim\n rotate_extrude($fn=100)\n translate ([(WheelDiameter \/ 2) - rimThickness, 0, 0])\n difference()\n {\n square([rimThickness, WheelThickness]);\n\n translate([rimThickness , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n }\n\t\n\tlinear_extrude(WheelThickness)\n\tdifference() {\n\t\tunion() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\t\/\/ Cool, curvey spokes\n\t\t\tfor (i = [0, 120, 240])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([WheelDiameter \/ 4 - 1, 0 ])\n\t\t\t\tdifference() {\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2);\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2 - spokeThickness\/2);\n\t\t\t\t}\n\n\t\t\t\/\/ Boring straight spokes\t\n\t\t\t*for (i = [0, 90, 180, 270])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([hubDiameter \/ 2 - 1, -spokeThickness \/ 2, 0 ])\n\t\t\t\t\tsquare([(WheelDiameter \/ 2) - (hubDiameter \/ 2 - 1) - (rimThickness - 1), spokeThickness]);\n\t\t}\n\n\t\tMotorShaftSlot();\n\t}\n\n\trender()\n\tdifference() {\n\t\tlinear_extrude(6) \/\/ = motor_shaft_h - a bit?\n\t\tdifference() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\tMotorShaftSlot();\n\t\t}\n\n\t\t\/\/ Grub screw hole\n\t\t\/\/ TOOD: this works fine in OpenCSG render, but breaks quick rendering horribly\n\t\ttranslate([0, 0, 3.5])\n\t\trotate(a=90, v=[0, 1, 0])\n\t\t\tcylinder(r=1.5, h=hubDiameter\/2 + eta);\n\n\t}\n}\n\nmodule MotorShaftSlot()\n{\n\tdifference() {\n\t\tcircle(r = 5\/2); \/\/ = motor_shaft_r \/ 2\n\n\t\tfor(i = [0:1])\n\t\t\tmirror([i, 0, 0])\t\t\n\t\t\ttranslate([MotorShaftFlatThickness \/ 2, -MotorShaftDiameter \/ 2, 0])\n\t\t\t\tsquare([MotorShaftDiameter \/ 2, MotorShaftDiameter]);\n\t}\n}\n\nmodule Tyre_STL()\n{\n\ttyreThickness = 1.5;\n\tstretchAmount = 2; \/\/ Make tyre dia this much less than wheel so it is stretch to fit\n\n\tcolor(Grey80)\n\trotate_extrude($fn=100)\n\ttranslate ([(WheelDiameter - stretchAmount) \/ 2, 0, 0]) {\n square([tyreThickness, WheelThickness]);\n\n translate([0 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n\t}\n}\n","old_contents":"\/*\n\tAssembly: WheelAssembly\n\tCombined motor and wheel assembly\n\t\n\tLocal Frame: \n\t\tPlaces the motor default connector at the origin - i.e. use the motor default connector for attaching into a parent assembly\n\n*\/\n\n\/\/ Connectors\nWheel_Con_Default\t\t\t\t= [ [0, 0 ,0], [0, 0, 1], 90, 0, 0 ];\n\n\nmodule WheelAssembly( ) {\n\n assembly(\"assemblies\/Wheel.scad\", \"Drive Wheel\", str(\"WheelAssembly()\")) {\n \n if (DebugCoordinateFrames) frame();\n \n \/\/ debug connectors?\n if (DebugConnectors) {\n \n }\n \n \/\/ Vitamins\n logo_motor();\n \n \/\/ ribbon Cable :)\n if ($rightSide) {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [2.5, -23, 7],\n [10, -60, 10],\n [20, -30,15],\n [26,0, 13]\n ],\n vectors = [\n [-1, 0 ,0],\n [-0.5, 0.5, 1],\n [-0.5, 0.5, 0],\n [0, 0,1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n \n \n } else {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [-2.5, -23, 7],\n [10, -60, 10],\n [20, -30,25],\n [26,0, 30]\n ],\n vectors = [\n [1, 0 ,0],\n [0.5, 0.5, -1],\n [-0.5, 0.5, -1],\n [0, 0,-1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n }\n \n \/\/ STL\n step(1, \"Push the wheel onto the motor shaft \\n**Optional:** add a rubber band to wheel for extra grip.\") {\n view(t=[0, -3, 5], r=[349,102,178], d=500);\n\n attach(Wheel_Con_Default, [[0,0,2],[0,0,-1],0,0,0], ExplodeSpacing=20)\n Wheel_STL();\n }\n\t}\n}\n\n\nmodule Wheel_STL() {\n\n\tprintedPart(\"assemblies\/Wheel.scad\", \"Wheel\", \"Wheel_STL()\") {\n\t\n\t view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\t\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Wheel.stl\"));\n } else {\n\t\t\t\tWheelModel();\n }\n }\n\t}\n}\n\n\nmodule WheelModel()\n{\n\trimThickness = 4;\n\tspokeThickness = 5;\n\thubDiameter = 10;\n\n \/\/ Outer Rim\n rotate_extrude($fn=100)\n translate ([(WheelDiameter \/ 2) - rimThickness, 0, 0])\n difference()\n {\n square([rimThickness, WheelThickness]);\n\n translate([rimThickness , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n }\n\t\n\tlinear_extrude(WheelThickness)\n\tdifference() {\n\t\tunion() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\t\/\/ Cool, curvey spokes\n\t\t\tfor (i = [0, 120, 240])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([WheelDiameter \/ 4 - 1, 0 ])\n\t\t\t\tdifference() {\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2);\n\t\t\t\t\tcircle(r=WheelDiameter \/ 4 - 2 - spokeThickness\/2);\n\t\t\t\t}\n\n\t\t\t\/\/ Boring straight spokes\t\n\t\t\t*for (i = [0, 90, 180, 270])\n\t\t\t\trotate(i)\n\t\t\t\ttranslate([hubDiameter \/ 2 - 1, -spokeThickness \/ 2, 0 ])\n\t\t\t\t\tsquare([(WheelDiameter \/ 2) - (hubDiameter \/ 2 - 1) - (rimThickness - 1), spokeThickness]);\n\t\t}\n\n\t\tMotorShaftSlot();\n\t}\n\n\tdifference() {\n\t\trender()\n\t\tlinear_extrude(6) \/\/ = motor_shaft_h - a bit?\n\t\tdifference() {\n\t\t\t\/\/ Center Hub\n\t\t\tcircle(r=hubDiameter \/ 2);\n\n\t\t\tMotorShaftSlot();\n\t\t}\n\n\t\t\/\/ Grub screw hole\n\t\t\/\/ TOOD: this works fine in OpenCSG render, but breaks quick rendering horribly\n\t\ttranslate([0, 0, 3.5])\n\t\trotate(a=90, v=[0, 1, 0])\n\t\t\tcylinder(r=1.5, h=hubDiameter\/2 + eta);\n\n\t}\n}\n\nmodule MotorShaftSlot()\n{\n\tdifference() {\n\t\tcircle(r = 5\/2); \/\/ = motor_shaft_r \/ 2\n\n\t\tfor(i = [0:1])\n\t\t\tmirror([i, 0, 0])\t\t\n\t\t\ttranslate([MotorShaftFlatThickness \/ 2, -MotorShaftDiameter \/ 2, 0])\n\t\t\t\tsquare([MotorShaftDiameter \/ 2, MotorShaftDiameter]);\n\t}\n}\n\nmodule Tyre_STL()\n{\n\ttyreThickness = 1.5;\n\tstretchAmount = 2; \/\/ Make tyre dia this much less than wheel so it is stretch to fit\n\n\tcolor(Grey80)\n\trotate_extrude($fn=100)\n\ttranslate ([(WheelDiameter - stretchAmount) \/ 2, 0, 0]) {\n square([tyreThickness, WheelThickness]);\n\n translate([0 , WheelThickness \/ 2])\n circle(r = WheelThickness \/ 4);\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8b0c49c2e55eb5c69c67b04638e494633134a3ea","subject":"Start of a first attempt at a complete enclosure design in openscad.","message":"Start of a first attempt at a complete enclosure design in openscad.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\r\nthickness = 0.5;\r\n\r\nwidth = 20;\r\nlength = 20;\r\nheight = 10;\r\n\r\nvert_faces();\r\nside_supports();\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=length);\r\n\t\t}\r\n\t\tscale([1,1,0.5]) {\r\n\t\t\tside_support_base(clearance=0.1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,0,0])\r\n\t\tcube([thickness,width,height]);\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tside_support_base();\r\n\t\tvert_faces();\r\n\t}\r\n}\r\n\r\nmodule side_support_base(clearance=0) {\r\n\tunion() {\r\n\t\tside_support(y=2, clearance=clearance);\r\n\t\tside_support(y=width-2, clearance=clearance);\r\n\t}\r\n}\r\n\r\nmodule side_support(y, clearance) {\r\n\toverhang = 1;\r\n\theight = 2;\r\n\ttranslate([-overhang,y-thickness\/2-clearance\/2,0])\r\n\t\tcube([length+overhang*2, thickness+clearance, height+clearance]);\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'designs\/fishbox.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f1899fced61590fd90b242dd316f7f804c71894c","subject":"mounting of the catch is now thicker","message":"mounting of the catch is now thicker\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_case\/top_aa.scad","new_file":"battery_case\/top_aa.scad","new_contents":"use \nuse \ninclude \n\nholeR = (screwDiameter+1)\/2;\n\nmodule topAA()\n{\n gondola();\n \/\/ hinge\n difference()\n {\n translate([sizeOX, (sizeOY+2)\/2-4, 0])\n {\n cube([7, 4, sizeOZ\/2]);\n translate([1,0,sizeOZ\/2])\n {\n cube([2*holeR+2*1, 4, 1+holeR]);\n translate([holeR+1, 4, holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR+1, h=4, $fs=0.01);\n }\n }\n \/\/ hole\n translate([sizeOX+holeR+2, (sizeOY+2)\/2+18\/2, sizeOZ\/2+holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR, h=18, $fs=0.01);\n }\n \/\/ catch\n translate([-1, (sizeOY+2)\/2-(6+2*3)\/2, 0])\n {\n difference()\n {\n union()\n {\n cube([1, 6+2*3, sizeOZ-4]);\n translate([-1, 0, sizeOZ\/2+3])\n cube([1, 6+2*3, sizeOZ\/2-3]);\n }\n translate([-1, 2, sizeOZ\/2+0.2])\n cube([1+2*1, 6+2*1, 1+2*0.5]);\n }\n }\n}\n\ntopAA();\n%batteriesPack([margin, margin, margin]);\n","old_contents":"use \nuse \ninclude \n\nholeR = (screwDiameter+1)\/2;\n\nmodule topAA()\n{\n gondola();\n \/\/ hinge\n difference()\n {\n translate([sizeOX, (sizeOY+2)\/2-4, 0])\n {\n cube([7, 4, sizeOZ\/2]);\n translate([1,0,sizeOZ\/2])\n {\n cube([2*holeR+2*1, 4, 1+holeR]);\n translate([holeR+1, 4, holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR+1, h=4, $fs=0.01);\n }\n }\n \/\/ hole\n translate([sizeOX+holeR+2, (sizeOY+2)\/2+18\/2, sizeOZ\/2+holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR, h=18, $fs=0.01);\n }\n \/\/ catch\n translate([-1, (sizeOY+2)\/2-(6+2*2)\/2, 0])\n {\n difference()\n {\n union()\n {\n cube([1, 6+2*2, sizeOZ-4]);\n translate([-1, 0, sizeOZ\/2+3])\n cube([1, 6+2*2, sizeOZ\/2-3]);\n }\n translate([-1, 1, sizeOZ\/2+0.2])\n cube([1+2*1, 6+2*1, 1+2*0.5]);\n }\n }\n}\n\ntopAA();\n%batteriesPack([margin, margin, margin]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5089dea1b8e5d10dfe9b2256a41205c0caa9175f","subject":"y\/idler: fix screw_cut align\/orient bug","message":"y\/idler: fix screw_cut align\/orient bug\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\nuse \n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n }\n\n difference()\n {\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n cylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n }\n }\n\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[1000, 1000, 1000],\n align=[0,0,-1]\n );\n }\n\n\n }\n }\n\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n translate([0, i*mount_screw_dist\/2, 0])\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=X, align=X);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X,\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n for(i=[-1,1])\n translate([0, i*(yaxis_idler_mount_thread_dia*2.5), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=X, align=-X); \n }\n }\n }\n}\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*cylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=Z, align=N);*\/\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extrasize=[20*mm,0,0], extrasize_align=X\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n }\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"include \n\nuse \n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n }\n\n difference()\n {\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n cylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X\n );\n }\n }\n\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[1000, 1000, 1000],\n align=[0,0,-1]\n );\n }\n\n\n }\n }\n\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n translate([0, i*mount_screw_dist\/2, 0])\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=X, align=X);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=X,\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n for(i=[-1,1])\n translate([0, i*(yaxis_idler_mount_thread_dia*2.5), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=[-1,0,0], align=[-1,0,0]); \n }\n }\n }\n}\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*cylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=Z, align=N);*\/\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extrasize=[20*mm,0,0], extrasize_align=X\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n }\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8dfb340b10762ebf2857968c3647b2c67328d026","subject":"fixup! misc: add v_cumsum","message":"fixup! misc: add v_cumsum\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) sum_vec(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8115782156236a77f263b525db821d68bff226b8","subject":"xaxis\/carriage: increase guidler bearing cutout a bit","message":"xaxis\/carriage: increase guidler bearing cutout a bit\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"85b969e787871c7866162487f31a00207020e021","subject":"first commit","message":"first commit\n","repos":"vishnubob\/rockit","old_file":"rockit.scad","new_file":"rockit.scad","new_contents":"\/\/ Rockit - Model Rocket Construction Kit\n\/\/\n\/\/ Giles Hall (C) 2012,2013\n\/\/\n\/\/ Tail fin code based on:\n\/\/ - Lutz Paelke (lpaelke) - http:\/\/www.thingiverse.com\/thing:26508\/\n\nfunction in2mm(in) = in \/ 0.0393701;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Engine Dimensions\n\/\/ http:\/\/www2.estesrockets.com\/pdf\/Estes_Model_Rocket_Engines.pdf\n\/\/ mini engine\nmini_engine_pad = 0.2;\nmini_engine_gap = in2mm(.5);\nmini_engine_length = in2mm(1.75);\nmini_engine_dia = in2mm(.5);\n\/\/ standard engine\nstandard_engine_pad = 0.2;\nstandard_engine_gap = in2mm(.5);\nstandard_engine_length = in2mm(2.75);\nstandard_engine_dia = in2mm(.69);\n\/\/ D engine\nd_engine_pad = 0.2;\nd_engine_gap = in2mm(1);\nd_engine_length = in2mm(2.75);\nd_engine_dia = in2mm(.95);\n\/\/ E engine\ne_engine_pad = 0.2;\ne_engine_gap = in2mm(.5);\ne_engine_length = in2mm(3.75);\ne_engine_dia = in2mm(.95);\n\/\/ engine selection\nengine_length = standard_engine_length;\nengine_dia = standard_engine_dia;\nengine_gap = standard_engine_gap;\nengine_pad = standard_engine_pad;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Global\nwall_thickness = 2;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Engine Holder\nengine_holder_enabled = 1;\nengine_holder_inner_dia = engine_dia + engine_pad;\nengine_holder_outer_dia = engine_dia + wall_thickness;\nengine_holder_length = engine_length + engine_pad;\nengine_holder_offset = in2mm(.1);\nengine_holder_firewall_length = engine_holder_length * .4;\nengine_holder_firewall_offset = in2mm(.25);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Body\nbody_enabled = 1;\nbody_height = engine_holder_length + in2mm(.2);\nbody_inner_dia = engine_dia + engine_gap;\nbody_outer_dia = body_inner_dia + wall_thickness;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Fins\nfin_enabled = 1;\nfins = 6;\nfin_span = body_outer_dia * 3.5;\nfin_thickness = wall_thickness;\nfin_endchord = body_height * .2;\nfin_sym_flag = 1;\n\/\/fin_offset = fin_endchord;\nfin_offset = 0;\nfin_coverage = .99;\nfin_height = (body_height - fin_offset) * fin_coverage;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Collar\ncollar_enabled = 1;\ncollar_height = in2mm(.5);\ncollar_overlap = collar_height * .5;\ncollar_fit = .001;\ncollar_outer_dia = body_inner_dia * (1 - collar_fit);\ncollar_inner_dia = collar_outer_dia - wall_thickness;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Guide\nguide_enabled = 1;\nguide_inner_dia = 4.6;\nguide_outer_dia = guide_inner_dia + 1;\nguide_height = in2mm(2);\nguide_offset = in2mm(.5);\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Quality\ncircle_segments = 120;\n\nmodule fin(angle, deflection)\n{\n translate([0,0,fin_offset])\n rotate([0,0,angle])\n polyhedron(points=[\n \/\/ inner-bottom\n [body_inner_dia \/ 2, fin_thickness \/ 2 + deflection, 0], \n [body_inner_dia \/ 2, -fin_thickness \/ 2 + deflection, 0],\n \/\/ outer-bottom\n [fin_span \/ 2, fin_thickness \/ 2 + deflection, fin_sym_flag ? -fin_endchord : 0], \n [fin_span \/ 2, -fin_thickness \/ 2 + deflection, fin_sym_flag ? -fin_endchord : 0],\n \/\/ outer-top\n [fin_span \/ 2, fin_thickness \/ 2 - deflection, fin_height - fin_endchord], \n [fin_span \/ 2, -fin_thickness \/ 2 - deflection, fin_height - fin_endchord],\n \/\/ inner-top\n [body_inner_dia \/ 2, fin_thickness \/ 2 - deflection, fin_height],\n [body_inner_dia \/ 2, -fin_thickness \/ 2 - deflection, fin_height]],\n triangles=[[0, 1, 2], [1, 3, 2], \n [2, 3, 4], [3, 5, 4], \n [4, 5, 6], [5, 7, 6], \n [6, 7, 0], [7, 1, 0], \n [0, 2, 6], [2, 4, 6], \n [1, 7, 3], [3, 7, 5]]);\n}\n\nmodule tube(length, outer_dia, inner_dia)\n{\n echo(\"Tube - Length: \", length, \" Outer Dia: \", outer_dia, \" Inner Dia:\", inner_dia);\n difference()\n {\n \/\/ outer\n cylinder(h=length, r=outer_dia \/ 2, $fn=circle_segments);\n \/\/ inner\n cylinder(h=length, r=inner_dia \/ 2, $fn=circle_segments);\n }\n}\n\nmodule make_guide() \n{\n if (guide_enabled)\n {\n\t\trotate([0, 0, 180 \/ fins]) \n translate([body_outer_dia \/ 2 + guide_inner_dia \/ 2, 0, guide_offset])\n tube(guide_height, guide_outer_dia, guide_inner_dia);\n }\n}\n\nmodule make_fins() \n{\n if (fin_enabled)\n {\n\t\tfor (i = [0:fins - 1])\n {\n fin(i * (360 \/ fins), 0);\n }\n }\n}\n\nmodule make_collar()\n{\n if (collar_enabled)\n {\n translate([0, 0, body_height - collar_overlap]) \n tube(collar_height + collar_overlap, collar_outer_dia, collar_inner_dia);\n }\n}\n\nmodule make_engine_holder()\n{\n if (engine_holder_enabled)\n {\n union()\n {\n translate([0, 0, engine_holder_offset])\n tube(engine_holder_length, engine_holder_outer_dia, engine_holder_inner_dia);\n translate([0, 0, engine_holder_length - engine_holder_firewall_length - engine_holder_firewall_offset])\n tube(engine_holder_firewall_length, body_outer_dia, engine_holder_inner_dia);\n }\n }\n}\n\nmodule make_body()\n{\n if (body_enabled)\n {\n tube(body_height, body_outer_dia, body_inner_dia);\n }\n}\n\nmodule make_rocket()\n{\n union()\n {\n \/\/ outer\n make_body();\n make_collar();\n make_guide();\n make_fins();\n make_engine_holder();\n }\n}\n","old_contents":"","returncode":128,"stderr":"fatal: invalid reference: FETCH_HEAD^\n","license":"mit","lang":"OpenSCAD"} {"commit":"c3adef85399817c820a4f5ee42a34222b0c83dca","subject":"Initial commit of Arduino Pro Mini\/Micro vitamin","message":"Initial commit of Arduino Pro Mini\/Micro vitamin\n\nTodo: All features other than header holes","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ProMicro.scad","new_file":"hardware\/vitamins\/ProMicro.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro(type = \"mini\") {\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n }\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/vitamins\/ProMicro.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e3acb0371da99e8790a2ea5dbca605692ffa9246","subject":"misc: add v_sign","message":"misc: add v_sign\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3fb4c23c3b75d5a58a4a03394b6bec0d49897e81","subject":"This is just whitespace changes.","message":"This is just whitespace changes.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8e4d3288ebd118b4727396a69dfdf76d7e824eb9","subject":"x\/ends: fix belt debug preview","message":"x\/ends: fix belt debug preview\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=true)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_end_width(with_motor), d=xaxis_rod_d_support, orient=X, align=X);\n\n \/\/ endstops mount support\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate(X*5*mm)\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate(X*-7*mm)\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extra_size = with_motor?0*mm:0*mm;\n extra_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n material(Mat_Plastic)\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ z smooth bearing mounts support\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts cut\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n difference()\n {\n material(Mat_PlasticBlack)\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n material(zaxis_nut_mat)\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*100*mm,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=true)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_end_width(with_motor), d=xaxis_rod_d_support, orient=X, align=X);\n\n \/\/ endstops mount support\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate(X*5*mm)\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate(X*-7*mm)\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extra_size = with_motor?0*mm:0*mm;\n extra_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n material(Mat_Plastic)\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ z smooth bearing mounts support\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts cut\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n difference()\n {\n material(Mat_PlasticBlack)\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n material(zaxis_nut_mat)\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*100*mm,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d0061f9caea26d887a36eb17285718f22ac95e2d","subject":"x\/ends: tweak nut mount screw length","message":"x\/ends: tweak nut mount screw length\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+5*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nxaxis_z_bearing_mount_dir = XAXIS;\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n difference()\n {\n cylindera(h=h, d=d, orient=[0,0,1], align=[0,0,0], round_radius=2);\n cubea(size=[d,d,h], orient=[0,0,1], align=-xaxis_z_bearing_mount_dir, round_radius=2);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n cubea(size=[d,d,h], orient=[0,0,1], align=-xaxis_z_bearing_mount_dir, round_radius=2);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=ZAXIS,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+5*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nxaxis_z_bearing_mount_dir = XAXIS;\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n difference()\n {\n cylindera(h=h, d=d, orient=[0,0,1], align=[0,0,0], round_radius=2);\n cubea(size=[d,d,h], orient=[0,0,1], align=-xaxis_z_bearing_mount_dir, round_radius=2);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n cubea(size=[d,d,h], orient=[0,0,1], align=-xaxis_z_bearing_mount_dir, round_radius=2);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=ZAXIS,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fa2de11d61c3e486da2b6215669946cea1bf2296","subject":"x\/carriage: don't show sensor pos unless sensor","message":"x\/carriage: don't show sensor pos unless sensor\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], N];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ bearing mount top\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount top cutout\n hull()\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=Y);\n }\n }\n\n\n \/\/ bearing mount bottom\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount bottom cutout\n hull()\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=X);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=X);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, Z];\nhotend_conn = [[0,21.3,0], Y];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, Y];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, X];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], N];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ bearing mount top\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount top cutout\n hull()\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=Y);\n }\n }\n\n\n \/\/ bearing mount bottom\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount bottom cutout\n hull()\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=X);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=X);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, Z];\nhotend_conn = [[0,21.3,0], Y];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, Y];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, X];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"817742e76b5b204d27907b5fa361ed8d6f052d24","subject":"add holes for phone and ioio","message":"add holes for phone and ioio\n","repos":"depperson\/dronedroid","old_file":"hardware\/rustler-plate.scad","new_file":"hardware\/rustler-plate.scad","new_contents":"\/\/ rustler-plate.scad: an electronics tray for Traxxas Rustler\n\/\/ Daniel Epperson, 2015\n\n\/\/ main surface \nlinear_extrude(height = 3, center = true) \ndifference() {\n\n \/\/ plate\n polygon(points=[[0,5], [5,0],\n [70,0], [130,15],\n [135,35], [150,20],\n [210,35], [210,105],\n [70,140],\n [5,140], [0,135],\n [0,105], [40,105],\n [40,35], [0,35]\n ]);\n \n \/\/ ESC hole\n translate([40, 70])\n circle(12, $fn=50);\n \n \/\/ right bolt hole\n translate([15, 15])\n circle(3, $fn=50);\n \n \/\/ left bolt hole\n translate([15, 125])\n circle(3, $fn=50);\n \n \/\/ front bolt hole\n translate([177, 100])\n circle(3, $fn=50);\n \n \/\/ ioio holes\n translate([140, 105]) circle(2, $fn=50);\n translate([133, 82]) circle(2, $fn=50);\n translate([75, 120]) circle(2, $fn=50);\n translate([68, 97]) circle(2, $fn=50); \n \n \/\/ phone mounts\n translate([205, 80]) circle(2, $fn=50); \n translate([205, 60]) circle(2, $fn=50); \n translate([75, 30]) circle(2, $fn=50);\n\n}\n\n\n\/\/ rear supports\ndifference()\n{\n translate([0,0,-25])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right \n translate([15, 15])\n circle(6, $fn=50);\n\n \/\/ left \n translate([15, 125])\n circle(6, $fn=50);\n }\n translate([0,0,-22])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right tunnel\n translate([15, 15])\n circle(3, $fn=50);\n\n \/\/ left tunnel\n translate([15, 125])\n circle(3, $fn=50);\n }\n}\n\n\n\/\/ front support\ndifference()\n{\n \/\/ front\n translate([0,0,-10])\n linear_extrude(height = 20, center = true) \n translate([177, 100])\n circle(6, $fn=50);\n \n \/\/ front tunnel\n translate([0,0,-7])\n linear_extrude(height = 20, center = true) \n translate([177, 100])\n circle(3, $fn=50);\n}\n","old_contents":"\/\/ rustler-plate.scad: an electronics tray for Traxxas Rustler\n\/\/ Daniel Epperson, 2015\n\n\/\/ main surface \nlinear_extrude(height = 3, center = true) \ndifference() {\n\n \/\/ plate\n polygon(points=[[0,5], [5,0],\n [70,0], [130,15],\n [135,35], [150,20],\n [210,35], [210,105],\n [70,140],\n [5,140], [0,135],\n [0,105], [40,105],\n [40,35], [0,35]\n ]);\n \n \/\/ ESC hole\n translate([40, 70])\n circle(12, $fn=50);\n \n \/\/ right bolt hole\n translate([15, 15])\n circle(3, $fn=50);\n \n \/\/ left bolt hole\n translate([15, 125])\n circle(3, $fn=50);\n \n \/\/ front bolt hole\n translate([177, 100])\n circle(3, $fn=50);\n}\n\n\n\/\/ rear supports\ndifference()\n{\n translate([0,0,-25])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right \n translate([15, 15])\n circle(6, $fn=50);\n\n \/\/ left \n translate([15, 125])\n circle(6, $fn=50);\n }\n translate([0,0,-22])\n linear_extrude(height = 50, center = true) \n {\n\n \/\/ right tunnel\n translate([15, 15])\n circle(3, $fn=50);\n\n \/\/ left tunnel\n translate([15, 125])\n circle(3, $fn=50);\n }\n}\n\n\n\/\/ front support\ndifference()\n{\n \/\/ front\n translate([0,0,-10])\n linear_extrude(height = 20, center = true) \n translate([177, 100])\n circle(6, $fn=50);\n \n \/\/ front tunnel\n translate([0,0,-7])\n linear_extrude(height = 20, center = true) \n translate([177, 100])\n circle(3, $fn=50);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1aa8888ba498ebd9d13221d73cf5b88c0df5df04","subject":"\u0421\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430, \u0431\u0443\u043a\u0432\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f","message":"\u0421\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043a\u043e\u0434, \u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430, \u0431\u0443\u043a\u0432\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430\u044f","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Adenin.scad","new_file":"3D-models\/SCAD\/Adenin.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([0, 0, 0]) cube ([x, y, z], center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -10.5, 2]) cube([50, 21, 5]);\n } \n\n }\n #rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n translate([-13, -10.5, -1]) cube([39, 21, 5]);\n } \n } \n}\ndifference() {\n\n translate([34, -10.5, -3.45]) cube([13, 21, 7]);\n #rotate([0, 90, 0]) translate([0, -5, 44]) cylinder(5, 2.67, 2.67);\n #rotate([0, 90, 0]) translate([0, 5, 44]) cylinder(5, 2.67, 2.67);\n }\n #rotate([90, 0, 0]) translate([-3, 0, -10.5]) cylinder(21, 3.5, 3.5);\n #rotate([90, 0, 0]) translate([34, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([0, 0, 0]) cube ([x, y, z],center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10],center=true);\n\n translate([-10, -10.5, 2]) cube([50, 21, 5]);\n } \n\n\n }\n #rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(6, 2.65, 2.65);\n translate([-13, -10.5, -1]) cube([39, 21, 5]);\n } \n } \n}\ndifference() {\n\n#translate([34, -10.5, -3.45]) cube([13, 21, 7]);\n#rotate([0, 90, 0]) translate([0, -5, 45]) cylinder(5, 2.65, 2.65);\n#rotate([0, 90, 0]) translate([0, 5, 45]) cylinder(5, 2.65, 2.65);\n}\n#rotate([90, 0, 0]) translate([-3, 0, -10.5]) cylinder(21, 3.5, 3.5);\n#rotate([90, 0, 0]) translate([34, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410\n translate([p, -7.55, 0-1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2-1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0-1]) cube ([9, 2, 2]);\n\n\n\n \n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"420c70494b5e03befef9682069f9311f4052b901","subject":"The z location was corrected.","message":"The z location was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/shapes\/spurs\/spurs-a.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/shapes\/spurs\/spurs-a.scad","new_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule spur(zLength)\r\n{\r\n scale([25.4\/90, -25.4\/90, 2])\r\n translate([0, 0, -1])\r\n\/\/ union()\r\n {\r\n linear_extrude(height = zLength)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule spur(zLength)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1])\r\n union()\r\n {\r\n linear_extrude(height = zLength)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5d73fe8dc5633543ed7e80fdc0f46854f2eafa87","subject":"Fix some issues.","message":"Fix some issues.\n","repos":"jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets","old_file":"openscad\/raspicam.scad","new_file":"openscad\/raspicam.scad","new_contents":"\/\/ Raspicam\n\n\/\/ Copyright (c) 2014, J\u00e9r\u00e9mie Decock (jd.jdhp@gmail.com)\n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {\n difference() {\n union() {\n difference() {\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n\n #union() {\n translate([-board_width\/2 + 10, 0, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([board_width\/2 - camera_screw_holes_spacing_x\/2 - 10, 0, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n translate([-camera_screw_holes_spacing_x\/2, 0, 0]){\n body_camera_holes(camera_holes_width, screw_hole_depth);\n }\n }\n }\n }\n translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n #translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n cube([hinge_radius_out * 2 + 2, hinge_slot_length, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n \/\/\tcylinder(r=radius, h=depth, center=true);\n \/\/}\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([i*spacing, 0, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_holes(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n\n translate([15, 0, 0]) {\n difference() {\n cylinder(r=head_radius, h=head_length, $fn=8);\n #translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n }\n }\n}\n\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {\n difference() {\n feet_main_board(board_width, board_height, board_depth, board_corner_radius);\n #feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);\n #feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);\n }\n\n translate([board_width\/2 + hinge_shelf_width\/2, 0, 0]) {\n cube([hinge_shelf_width, hinge_length, board_depth], center=true);\n }\n\n translate([board_width\/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);\n }\n }\n}\n\nmodule feet_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule feet_ventilation_holes(radius, depth) {\n\t$fn=50;\n\t\n translate([0, 0, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n}\n\nmodule feet_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n\t\/\/\tcylinder(r=radius, h=depth, center=true);\n\t\/\/}\n}\n\nmodule feet_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nassign(feet_board_width=98,\n feet_board_height=65,\n feet_board_depth=3,\n feet_board_corner_radius=3,\n feet_screw_holes_radius=1.5,\n feet_screw_holes_spacing_x=70,\n feet_screw_holes_spacing_y=30,\n feet_screw_hole_depth=10,\n feet_hinge_shelf_width=20,\n feet_ventilation_holes_radius=3,\n body_board_width=100,\n body_board_height=40,\n body_board_depth=3,\n body_board_corner_radius=3,\n body_screw_hole_radius=1.5,\n body_screw_hole_spacing=5,\n body_screw_hole_depth=10,\n body_num_screw_holes=9,\n body_camera_screw_holes_radius=1,\n body_camera_screw_holes_spacing_x=12,\n body_camera_screw_holes_spacing_y=20,\n body_camera_holes_width=8,\n hinge_radius=1.5,\n hinge_head_radius=4.6,\n hinge_head_length=5) {\n\n color([0,0,1]) {\n translate([0, 50, body_board_depth\/2]) {\n body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_slot_length=body_board_height \/ 3 + 1);\n }\n }\n\n color([1,0,0]) {\n translate([0, -50, feet_board_depth\/2]) {\n feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height\/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);\n }\n }\n\n color([0,1,0]) {\n translate([-50, 0, 0]) {\n hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);\n }\n }\n}\n\n","old_contents":"\/\/ Raspicam\n\n\/\/ Copyright (c) 2014, J\u00e9r\u00e9mie Decock (jd.jdhp@gmail.com)\n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_holes_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {\n difference() {\n union() {\n difference() {\n translate([0, board_width\/2, 0]){ \/\/ TODO: REMOVE THIS LINE!\n rotate(a=[0,0,90]){ \/\/ TODO: REMOVE THIS LINE!\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n }\n }\n\n union() {\n translate([0, board_width - num_screw_holes * screw_hole_spacing - 12.5, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([0, camera_screw_holes_spacing_y\/2 + 10, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n translate([0, camera_screw_holes_spacing_y\/2, 0]){\n body_camera_holes(camera_holes_width, screw_hole_depth);\n }\n }\n }\n }\n translate([0, board_width, hinge_radius_out - board_depth\/2]) {\n rotate(a=[0,90,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n translate([0, board_width, hinge_radius_out - board_depth\/2]) {\n cube([hinge_slot_length, hinge_radius_out * 2 + 2, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n \/\/\tcylinder(r=radius, h=depth, center=true);\n \/\/}\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([0, i*spacing, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_holes(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n translate([0, 0, 0]) {\n cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n }\n}\n\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n\n translate([15, 0, 0]) {\n difference() {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n }\n }\n}\n\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {\n difference() {\n feet_main_board(board_width, board_height, board_depth, board_corner_radius);\n feet_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);\n feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);\n }\n\n translate([board_width\/2 + hinge_shelf_width\/2, 0, 0]) {\n cube([hinge_shelf_width, hinge_length, board_depth], center=true);\n }\n\n translate([board_width\/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);\n }\n }\n}\n\nmodule feet_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule feet_ventilation_holes(radius, depth) {\n\t$fn=50;\n\t\n translate([0, 0, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n}\n\nmodule feet_main_board(width, height, depth, radius) {\n\t$fn=50;\n\t\/\/minkowski()\n\t\/\/{\n\t\tcube([width, height, depth], center=true);\n\t\/\/\tcylinder(r=radius, h=depth, center=true);\n\t\/\/}\n}\n\nmodule feet_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n translate([0, 0, 0]) {\n cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nassign(feet_board_width=98,\n feet_board_height=65,\n feet_board_depth=3,\n feet_board_corner_radius=3,\n feet_screw_holes_radius=1.5,\n feet_screw_holes_spacing_x=70,\n feet_screw_holes_spacing_y=30,\n feet_screw_hole_depth=10,\n feet_hinge_shelf_width=20,\n feet_ventilation_holes_radius=3,\n body_board_width=100,\n body_board_height=40,\n body_board_depth=3,\n body_board_corner_radius=3,\n body_screw_hole_radius=1.5,\n body_screw_hole_spacing=5,\n body_screw_hole_depth=10,\n body_num_screw_holes=9,\n body_camera_screw_holes_radius=1,\n body_camera_screw_holes_spacing_x=20,\n body_camera_screw_holes_spacing_y=12,\n body_camera_holes_width=8,\n body_hinge_radius_out=4.6,\n hinge_radius=1.5,\n hinge_head_radius=4.6,\n hinge_head_length=5) {\n\n color([1,0,0]) {\n translate([0, -50, feet_board_depth\/2]) {\n feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height\/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=body_hinge_radius_out, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);\n }\n }\n\n color([0,0,1]) {\n translate([0, 0, body_board_depth\/2]) {\n body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_holes_width=body_camera_holes_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=body_hinge_radius_out, hinge_slot_length=body_board_height \/ 3 + 1);\n }\n }\n\n color([0,1,0]) {\n translate([-50, 0, 0]) {\n hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"092e1c6ab7f71e69075e5b3d24e16288b6563f22","subject":"xaxis\/carriage: misc debug stuff (remove colors etc)","message":"xaxis\/carriage: misc debug stuff (remove colors etc)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"625ddbebfcd9679edab33a12dd3e1c2f79ce7f8b","subject":"fixed screws mounting location","message":"fixed screws mounting location\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_hinge_cover\/closet_hinge.scad","new_file":"closet_hinge_cover\/closet_hinge.scad","new_contents":"\n\nmodule closet_hinge()\n{\n \/\/ lower cross\n cube([21, 41, 4]);\n translate([-51\/2 + 21\/2, 41-18-10])\n cube([51, 18, 4]);\n \/\/ hinge upper part\n translate([(21-16)\/2, 0, 4])\n {\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [16, 0, 0], \/\/ 1\n [ 0, 0, 16], \/\/ 2\n [16, 0, 16], \/\/ 3\n [ 0, 41, 0], \/\/ 4\n [16, 41, 0], \/\/ 5\n [ 0, 41, 10], \/\/ 6\n [16, 41, 10] \/\/ 7\n ], \n faces = [\n [0,2,1],\n [1,2,3],\n [1,3,7],\n [7,5,1],\n [6,2,0],\n [0,4,6],\n [4,5,6],\n [7,6,5],\n [6,3,2],\n [3,6,7],\n [0,1,4],\n [5,4,1]\n ]\n );\n }\n \/\/ side mounting screws\n translate([0, 41-10-18\/2, 0])\n {\n for(offsetOX = [-15\/2, 21+15\/2])\n translate([offsetOX, 0, 0])\n cylinder(r=7\/2, h=6, $fs=2);\n }\n \/\/ main positioning screw\n translate([21\/2, 41-3-7\/2, 0])\n cylinder(r=7\/2, h=18, $fs=2);\n}\n\ncloset_hinge();","old_contents":"\n\nmodule closet_hinge()\n{\n \/\/ lower cross\n cube([21, 41, 4]);\n translate([-51\/2 + 21\/2, 41-18-10])\n cube([51, 18, 4]);\n \/\/ hinge upper part\n translate([(21-16)\/2, 0, 4])\n {\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [16, 0, 0], \/\/ 1\n [ 0, 0, 16], \/\/ 2\n [16, 0, 16], \/\/ 3\n [ 0, 41, 0], \/\/ 4\n [16, 41, 0], \/\/ 5\n [ 0, 41, 10], \/\/ 6\n [16, 41, 10] \/\/ 7\n ], \n faces = [\n [0,2,1],\n [1,2,3],\n [1,3,7],\n [7,5,1],\n [6,2,0],\n [0,4,6],\n [4,5,6],\n [7,6,5],\n [6,3,2],\n [3,6,7],\n [0,1,4],\n [5,4,1]\n ]\n );\n }\n \/\/ side mounting screws\n translate([0, 41-10-18\/2, 0])\n {\n for(offsetOX = [-19\/2, 21+19\/2])\n translate([offsetOX, 0, 0])\n cylinder(r=7\/2, h=6, $fs=2);\n }\n \/\/ main positioning screw\n translate([21\/2, 41-3-7\/2, 0])\n cylinder(r=7\/2, h=18, $fs=2);\n}\n\ncloset_hinge();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0eb2912caae36e3216999e3a913c08d91f4786bb","subject":"xaxis\/carriage: tweaks and refactoring","message":"xaxis\/carriage: tweaks and refactoring\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/*translate([0,-between_bearing_and_gear,0])*\/\n \/*translate([0,-extruder_a_bearing[2],0])*\/\n \/*extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\n\/*explode=[0,0,0];*\/\nexplode=[0,10,0];\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n }\n\n rotate([-90,0,0])\n extruder_b(with_sensormount=false);\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR105;\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*45,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=7*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-45,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,45,0])\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,45,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,50,0];*\/\n\nmodule x_carriage_full()\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n }\n\n rotate([-90,0,0])\n extruder_b(with_sensormount=false);\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1d4510fad87e1e4b121cada450a1fbe83952f0dd","subject":"most of the mount elements are now done","message":"most of the mount elements are now done\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roll_handle\/kite_roll_handle.scad","new_file":"kite_roll_handle\/kite_roll_handle.scad","new_contents":"$fn=120;\n\nmodule main_handle_()\n{\n cylinder(r=18\/2, h=120);\n translate([0, 0, 120])\n {\n translate([0, 0, -10])\n cylinder(r1=18\/2, r2=30\/2, h=10);\n cylinder(r=(8.5-0.5)\/2, h=22+2+10);\n }\n}\n\nmodule nut_(h)\n{\n block_size=[3.5, 5.5, h];\n n=3;\n hull()\n for(i=[0:n-1])\n rotate(i*[0, 0, 360\/n\/2])\n translate([block_size[0], block_size[1], 0]*-1\/2)\n cube(block_size);\n}\n\nmodule nut_space_()\n{\n scale([1.2, 1.2, 1.2])\n nut_(2.5);\n}\n\nmodule block_()\n{\n difference()\n {\n union()\n {\n cylinder(r=30\/2, h=0.6);\n cylinder(r=15\/2, h=10);\n }\n cylinder(r=8.5\/2, h=20);\n translate([0, 0, 5])\n rotate([0, 90, 0])\n {\n translate([0, 0, 5])\n #nut_space_();\n translate([0, 0, -10])\n cylinder(r=3.5\/2, h=20);\n }\n }\n}\n\nblock_();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kite_roll_handle\/kite_roll_handle.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"28fd1ff6f1e285cffc218e6cc4a922eb64debd2a","subject":"do away with all that stuff, simple z-axis screw connector","message":"do away with all that stuff, simple z-axis screw connector\n","repos":"abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev","old_file":"projects\/pcbcnc\/attachments\/zaxis-housing\/src\/zaxis_limit_structure.0.3.1.scad","new_file":"projects\/pcbcnc\/attachments\/zaxis-housing\/src\/zaxis_limit_structure.0.3.1.scad","new_contents":"MATERIAL_THICKNESS = 3;\n\n\/\/MOTOR_D = 41.81;\n\/\/MOTOR_D = 43;\nMOTOR_D = 44.5;\nMOTOR_R = MOTOR_D\/2;\nZAXIS_OUTER_W = 59;\nZAXIS_W = 63.97;\nZAXIS_DEPTH = 50.63;\nZAXIS_H = 35.38;\n\nBT_OVERHANG_EDGE = 25;\nBT_OVERHANG_FRONT = 60;\n\nFINGER_W = 14;\nFINGER_H = MATERIAL_THICKNESS;\n\nZLIMIT_W = 28;\nZLIMIT_H = 16;\n\nz_limit_w = 20;\nz_limit_h = 9.75;\nz_limit_d = 6;\n\n\/\/BACK_PLATE_W = ZAXIS_W + 2*ZLIMIT_W + 2*8;\nBACK_PLATE_W = ZAXIS_W + 2*8;\nBACK_PLATE_H = 35;\n\nzbp_depth = 20;\nzbp_height = 12;\nz_plate_overhang = 30;\nzbp_finger_0 = 6;\nzbp_finger_1 = 6;\n\nzbp_support_len = 10;\nzbp_side_len = zbp_depth + 4 + z_limit_w;\n\n module regular_polygon(order, r=1){\n \tangles=[ for (i = [0:order-1]) i*(360\/order) ];\n \tcoords=[ for (th=angles) [r*cos(th), r*sin(th)] ];\n \tpolygon(coords);\n}\n\nmodule z_top_cross_support() {\n w = ZAXIS_OUTER_W;\n oh_w = z_plate_overhang;\n th = MATERIAL_THICKNESS;\n\n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n \n \/*\n translate([-90,-30])\n union() {\n square([ dx, 2]);\n translate([dx - 2, 0]) square([2, dy]);\n polygon([[0,2], [dx-2,dy], [dx, 2]]);\n \n color([1,0,0]) translate([dx\/2, -th\/2]) square([zbp_finger_1, th], center=true);\n color([0,1,0]) translate([dx + th\/2, dy\/2]) square([th,zbp_finger_1], center=true);\n }\n *\/\n\n \n b = 20;\n s = 20;\n union() {\n \n \/\/ center cross brace\n \/\/\n square([w, s], center=true);\n \n \/\/ side portion\n \/\/\n difference() {\n translate([-w\/2 - oh_w\/2, -s\/2-b\/2]) square([b,b], center=true);\n \n \/\/ tab holes\n \/\/\n translate([-w\/2 - oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n translate([-w\/2 - 2*oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n }\n \n difference() {\n translate([ w\/2 + oh_w\/2, -s\/2-b\/2]) square([b,b], center=true);\n \n \/\/ tab holes\n \/\/\n translate([ w\/2 + oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n translate([ w\/2 + 2*oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n }\n \n \/\/ tab\n \/\/\n translate([-w\/2 - oh_w\/2, -s\/2-b - th\/2]) square([zbp_finger_1, th], center=true);\n translate([ w\/2 + oh_w\/2, -s\/2-b - th\/2]) square([zbp_finger_1, th], center=true);\n \n \/\/triangle connector\n \/\/\n polygon([ [-w\/2, s\/2], [-w\/2 - oh_w\/2 - b\/2, -s\/2], [-w\/2 - oh_w\/2 + b\/2, -s\/2], [-w\/2, -s\/2]]);\n polygon([ [ w\/2, s\/2], [ w\/2 + oh_w\/2 + b\/2, -s\/2], [ w\/2 + oh_w\/2 - b\/2, -s\/2], [ w\/2, -s\/2]]);\n }\n}\n\n\/\/ debug\n\/\/translate([50,-60])z_top_cross_support();\n\n\nmodule z_top_plate() {\n th = MATERIAL_THICKNESS;\n w1 = ZAXIS_OUTER_W\/2 + th;\n \n sl = zbp_support_len;\n w = ZAXIS_OUTER_W;\n h0 = 20;\n h1 = 30;\n \n ox = 10;\n oy = 25;\n \n oh_w = z_plate_overhang;\n oh_l = 30;\n \n h2 = 10;\n\n ohs_w = z_plate_overhang - 3;\n \n h3 = 40;\n h4 = 20;\n \n zspacer_nut_r = (36.30 - 24.5)\/4;\n zspacer_nut_x = 24.5\/2 + zspacer_nut_r;\n\n\n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n oh_w = z_plate_overhang;\n\n overhang_w = ZAXIS_OUTER_W;\n \/\/DEBUG\n \/* \n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n \n translate([-70, -h0 - oy - oh_l - 2*h2])\n rotate(90, [0,0,1])\n union() {\n square([ dx, 2]);\n translate([dx - 2, 0]) square([2, dy]);\n polygon([[0,2], [dx-2,dy], [dx, 2]]);\n \n color([1,0,0]) translate([dx\/2, -th\/2]) square([zbp_finger_1, th], center=true);\n color([0,1,0]) translate([dx + th\/2, dy\/2]) square([th,zbp_finger_1], center=true);\n }\n *\/\n \/\/DEBUG\n\n difference() {\n\n union() {\n \n \/\/ back\n \/\/\n square([w, h0], center=true);\n \n \/\/ back to be cut out\n \/\/\n translate([0,-h0\/2]) square([w, h1], center=true);\n \n \/\/ side connector\n \/\/\n translate([-w\/2 - ox, -h0\/2 -oy]) polygon([[0,0], [ox,oy],[ox,0]]);\n translate([ w\/2, -h0\/2]) polygon([[0,0], [ox,-oy],[0,-oy]]);\n \n \/\/ nut connector plate\n \/\/\n translate([-w\/2 - oh_w\/2, -h0\/2 - oy - oh_l\/2]) square([oh_w, oh_l], center=true);\n translate([ w\/2 + oh_w\/2, -h0\/2 - oy - oh_l\/2]) square([oh_w, oh_l], center=true);\n \n \/\/ brace connector\n \/\/\n translate([-w\/2 - oh_w\/2 - 3\/2, -h0\/2 - oy - oh_l - h2\/2]) square([oh_l - 3, h2], center=true);\n translate([ w\/2 + oh_w\/2 + 3\/2, -h0\/2 - oy - oh_l - h2\/2]) square([oh_l - 3, h2], center=true);\n \n \/\/ side connector (still?)\n \/\/\n polygon([ [-w\/2, -h0\/2], [-(zspacer_nut_x+zspacer_nut_r), -h0\/2], [-w\/2,-(h0+h1\/2)] ]);\n polygon([ [ w\/2, -h0\/2], [ (zspacer_nut_x+zspacer_nut_r), -h0\/2], [ w\/2,-(h0+h1\/2)] ]);\n \n \/\/ brace support connector\n \/\/\n translate([-w\/2 - oh_w\/2 - 3\/2, -h0\/2 - oy - oh_l - h2 - h3\/2]) square([oh_l - 3, h3], center=true);\n translate([ w\/2 + oh_w\/2 + 3\/2, -h0\/2 - oy - oh_l - h2 - h3\/2]) square([oh_l - 3, h3], center=true);\n\n\n \/\/ front connection\n \/\/\n translate([0,-h0\/2 - oy - oh_l - h2 - h3- h4\/2]) square([w + oh_w*2,h4], center=true);\n\n }\n \n \/\/ left hole tabs\n \/\/\n translate([-w\/2 - th - 2,-h0-oy-5]) {\n \n translate([-0, 0]) square([th,zbp_finger_0],center=true);\n translate([-0 - sl - th, zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([-0 - sl - th, -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n }\n \n \/\/ right hole tabs\n \/\/\n translate([ w\/2 + th + 2, -h0-oy-5]) {\n\n translate([(0), 0]) square([th,zbp_finger_0],center=true);\n translate([(0 + sl + th), zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([(0 + sl + th), -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n\n }\n \n \/\/ cross brace hole tabs\n \/\/\n translate([-w\/2 - oh_w\/2, -h0\/2 - oy - oh_l - h2\/2]) square([zbp_finger_1, th], center=true);\n translate([ w\/2 + oh_w\/2, -h0\/2 - oy - oh_l - h2\/2]) square([zbp_finger_1, th], center=true);\n \n \n \/\/ cross brace support hole tabs (left)\n \/\/\n translate([-overhang_w\/2 - 2*oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n translate([-overhang_w\/2 - oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n \n \/\/ cross brace support hole tabs (right)\n \/\/\n translate([ overhang_w\/2 + 2*oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n translate([ overhang_w\/2 + oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n\n \/\/ circle cutouts\n \/\/\n hull() {\n translate([zspacer_nut_x, -h0]) circle(zspacer_nut_r);\n translate([zspacer_nut_x, -h0-h1-zspacer_nut_r]) circle(zspacer_nut_r);\n }\n hull() {\n translate([-zspacer_nut_x, -h0]) circle(zspacer_nut_r);\n translate([-zspacer_nut_x, -h0-h1-zspacer_nut_r]) circle(zspacer_nut_r);\n }\n \n hull() {\n translate([0,-h0-3]) circle(9);\n translate([0, -h0-h1-5]) circle(9);\n \n }\n\n }\n\n}\n\nmodule z_top_all() {\n translate([-50,10]) rotate(90, [0,0,1]) z_top_plate();\n \n translate([0,30]) z_side();\n translate([24,13]) rotate(180, [0,0,1]) z_side();\n \n translate([-25,-6]) z_support();\n translate([15,-7]) rotate(180, [0,0,1]) z_support();\n \n translate([8,-3]) rotate(-10, [0,0,1]) z_support();\n translate([47,-9]) rotate(180, [0,0,1]) z_support();\n\n translate([102,-00]) rotate(90, [0,0,1]) z_support();\n translate([90,-00]) rotate(-90, [0,0,1]) z_support();\n\n translate([-16,5]) rotate(80, [0,0,1]) z_support();\n translate([64,30]) mirror([1,0,0]) z_support();\n \n translate([41,20]) z_guide_housing();\n translate([54,20]) z_guide_housing();\n \n translate([41,8]) z_nut_housing();\n translate([54,8]) z_nut_housing();\n\n translate([120,5]) rotate(-90, [0,0,1]) z_top_cross_support();\n\n}\n\n\/\/z_side();\n\n\/\/translate([60,50]) z_top_all();\n\/\/z_top_plate();\n\n\nmodule z_bottom_plate() {\n bottom_plate_width = ZAXIS_OUTER_W + 2*z_plate_overhang;\n th = MATERIAL_THICKNESS;\n w = ZAXIS_OUTER_W\/2 + th;\n sl = zbp_support_len;\n difference() {\n square([bottom_plate_width, zbp_depth], center=true);\n \n translate([w, 0]) square([th,zbp_finger_0],center=true);\n translate([w + sl + th, zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([w + sl + th, -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n\n translate([-(w), 0]) square([th,zbp_finger_0],center=true);\n translate([-(w + sl + th), zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([-(w + sl + th), -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n }\n}\n\nmodule z_support() {\n th = MATERIAL_THICKNESS;\n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n union() {\n square([ dx, 2]);\n translate([dx - 2, 0]) square([2, dy]);\n polygon([[0,2], [dx-2,dy], [dx, 2]]);\n \n translate([dx\/2, -th\/2]) square([zbp_finger_1, th], center=true);\n translate([dx + th\/2, dy\/2]) square([th,zbp_finger_1], center=true);\n }\n}\n\n\nmodule z_side_x() {\n \n qq = zbp_depth\/2 - 3;\n th = MATERIAL_THICKNESS;\n m2_ds = (2*(zbp_depth\/2 - 3) - th)\/2 - 2;\n difference() {\n\n union() {\n translate([zbp_side_len\/2 - zbp_depth\/2, 0]) square([zbp_side_len, zbp_height], center=true);\n \/\/translate([0,-zbp_height\/2 - th\/2]) square([zbp_finger_0, th], center=true);\n };\n \n\n \/\/translate([m2_ds, m2_ds]) circle(1, $fn=16);\n \/\/translate([-m2_ds,-m2_ds]) circle(1, $fn=16);\n \n \/\/translate([qq,0]) square([th, zbp_finger_1], center=true);\n \/\/translate([-qq,0]) square([th, zbp_finger_1], center=true);\n \/\/circle(2.5, $fn=16);\n \n translate([zbp_depth + th,0]) switch_holes2();\n translate([th*0,0]) switch_holes2();\n }\n}\n\nz_side_x();\n\nmodule z_side() {\n \n qq = zbp_depth\/2 - 3;\n th = MATERIAL_THICKNESS;\n m2_ds = (2*(zbp_depth\/2 - 3) - th)\/2 - 2;\n difference() {\n union() {\n translate([zbp_side_len\/2 - zbp_depth\/2, 0]) square([zbp_side_len, zbp_height], center=true);\n translate([0,-zbp_height\/2 - th\/2]) square([zbp_finger_0, th], center=true);\n };\n \n translate([m2_ds, m2_ds]) circle(1, $fn=16);\n translate([-m2_ds,-m2_ds]) circle(1, $fn=16);\n \n translate([qq,0]) square([th, zbp_finger_1], center=true);\n translate([-qq,0]) square([th, zbp_finger_1], center=true);\n circle(2.5, $fn=16);\n \n translate([zbp_depth + th,0]) switch_holes2();\n }\n}\n\nmodule z_nut_housing() {\n th = MATERIAL_THICKNESS;\n dx = 2*(zbp_depth\/2 - 3) - th;\n dy = dx;\n \n m2_x = dx\/2 - 2;\n m2_y = dx\/2 - 2;\n difference() {\n square([dx,dy], center=true);\n translate([ m2_x, m2_y]) circle(1, $fn=16);\n translate([-m2_x,-m2_y]) circle(1, $fn=16);\n \n regular_polygon(6, r=9\/2);\n\n }\n}\n\nmodule z_guide_housing() {\n th = MATERIAL_THICKNESS;\n dx = 2*(zbp_depth\/2 - 3) - th;\n dy = dx;\n \n m2_x = dx\/2 - 2;\n m2_y = dx\/2 - 2;\n difference() {\n square([dx,dy], center=true);\n translate([-m2_x, m2_y]) circle(1, $fn=16);\n translate([ m2_x,-m2_y]) circle(1, $fn=16);\n circle(2.5, $fn=16);\n\n }\n\n}\n\nmodule z_bottom_all() {\n z_bottom_plate();\n \n translate([57,15]) mirror([1,0,0]) z_support();\n translate([30,30]) z_support();\n translate([-50,15]) z_support();\n translate([-50,30]) z_support();\n \n translate([-10,21]) z_side();\n translate([70,0]) rotate(90, [0,0,1]) z_side();\n \/\/translate([85,20]) rotate(90, [0,0,1]) z_bottom_side();\n \/\/translate([0,51]) z_bottom_side();\n \n translate([-10,35]) z_nut_housing();\n translate([5,35]) z_nut_housing();\n \n translate([20, 35]) z_guide_housing();\n translate([85, 0]) z_guide_housing();\n}\n\n\/\/translate([60,10]) z_bottom_all();\n\nmodule side_holder_bottom() {\n w = 20;\n s = 40;\n t = FINGER_H;\n \n xx = 10;\n d=5;\n\n difference() {\n union() {\n square([s,w], center=true);\n translate([ (s\/2 - FINGER_H\/2) + t, w\/3]) square([FINGER_H,w\/3], center=true);\n translate([ (s\/2 - FINGER_H\/2) + t,-w\/3]) square([FINGER_H,w\/3], center=true);\n };\n translate([-(5*s\/12 - d\/2),0]) circle(d\/2, $fn=16);\n translate([-(1*s\/12 - d\/2),0]) circle(d\/2, $fn=16);\n translate([ (s\/2 - FINGER_W), (w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ (s\/2 - FINGER_W),-(w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ (s\/2 - FINGER_H\/2) + t, 0]) square([FINGER_H, w\/3], center=true);\n }\n \n}\n\nmodule side_holder_up() {\n w = 20;\n s = 40;\n d=5;\n t = FINGER_H;\n difference() {\n union() {\n square([s,w], center=true);\n translate([ (s\/2 + FINGER_H\/2), 0]) square([FINGER_H, w\/3], center=true);\n };\n translate([-7*s\/24,0]) switch_holes2();\n translate([ (s\/2 - FINGER_W), (w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ (s\/2 - FINGER_W),-(w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n \n }\n \n}\n\nmodule side_holder_connect(h=0) {\n s = 3*FINGER_W\/2;\n t = MATERIAL_THICKNESS;\n union() {\n polygon([[0,0],[s,s],[s,0]]);\n \/\/polygon([[0,0],[s,s],[s,t], [s-FINGER_W\/2,t], [s-FINGER_W\/2,0],[s,0]]);\n translate([0,-FINGER_H-h]) square([FINGER_W,FINGER_H]);\n translate([s,FINGER_W\/2-h]) square([FINGER_H, FINGER_W]);\n }\n}\n\nmodule top_holder() {\n w = 40;\n s = 20;\n ofx = -0;\n ofy = -10;\n \n difference() {\n union() {\n \/\/square([30,10]);\n square([w,s]);\n \/\/translate([-10,-20,0]) square([10,20]);\n translate([ofx-s\/2,ofy-w\/2,0]) square([10,20]);\n \/\/polygon( points=[[0,w\/2],[-s\/2,0],[0,-s\/8],[w\/8,0]], paths=[[0,1,2,3,0]]);\n polygon( points=[[0,w\/2],[ofx-s\/2,ofy],[ofx,ofy-s\/8],[w\/8,0]], paths=[[0,1,2,3,0]]);\n }\n translate([w\/3,s\/2]) circle(2.5,$fn=16);\n translate([3*w\/4,s\/2]) circle(2.5, $fn=16);\n \/\/translate([-4,-12]) rotate(90, [0,0,1]) switch_holes2();\n translate([ofx-4,ofy-12]) rotate(90, [0,0,1]) switch_holes2();\n }\n}\n\n\nmodule side_plate() {\n cable_slot_w = 4.75;\n cable_slot_h = 2;\n \n ofst = 50;\n \n w = ZAXIS_W - ofst;\n h = ZAXIS_H + 3*cable_slot_h;\n \n difference() {\n \/\/ main body\n \/\/\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n union() {\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n square([ZAXIS_W, h], center=true);\n \/\/translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W\/2, ZAXIS_H], center=true);\n translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W, h], center=true);\n }\n \n translate([ZAXIS_W\/2 + 6,h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n translate([ZAXIS_W\/2 + 6,-h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n \n \/\/ platform slots\n \/\/\n translate([-(FINGER_W-ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([-(FINGER_W-ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n \n \/\/ cable tile slots\n \/\/\n \/*\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n *\/\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n \n \/\/ center access\n \/\/\n square([ZAXIS_W\/2, 4], center=true);\n circle(cable_slot_h*3, $fn=16);\n \n translate([ofst,0]) square([ZAXIS_W\/2, 4], center=true);\n translate([ofst,0]) circle(cable_slot_h*3, $fn=16);\n \n \/\/ center cable tie\n \/\/\n translate([-(ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n translate([ (ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n }\n}\n\n\n\nmodule side_plate_bottom() {\n cable_slot_w = 4.75;\n cable_slot_h = 2;\n \n \/\/ofst = 33;\n ofst = 28;\n \n w = ZAXIS_W - ofst;\n h = ZAXIS_H + 3*cable_slot_h;\n \n difference() {\n \/\/ main body\n \/\/\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n union() {\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n square([ZAXIS_W, h], center=true);\n \/\/translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W\/2, ZAXIS_H], center=true);\n translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W, h], center=true);\n }\n \n translate([ZAXIS_W\/2 + 6,h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n translate([ZAXIS_W\/2 + 6,-h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n \n translate([-ZAXIS_W\/4 + 2, h\/2]) square([ZAXIS_W\/4, 4*cable_slot_h], center=true);\n translate([-ZAXIS_W\/4 + 2, -h\/2]) square([ZAXIS_W\/4, 4*cable_slot_h], center=true);\n \n \/\/ platform slots\n \/\/\n translate([-(FINGER_W-ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([-(FINGER_W-ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n \n \/\/ cable tile slots\n \/\/\n \/*\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n *\/\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n \n \/\/ center access\n \/\/\n translate([ofst,0]) square([ZAXIS_W\/2, 4], center=true);\n translate([ofst,0]) circle(cable_slot_h*3, $fn=16);\n \n \/\/translate([ofst,0]) square([ZAXIS_W\/2, 4], center=true);\n \/\/translate([ofst,0]) circle(cable_slot_h*3, $fn=16);\n \n \/\/ center cable tie\n \/\/\n translate([-(ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n translate([ (ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n }\n}\n\n\/\/ 15 , 5\nmodule platform() {\n platform_w = ZAXIS_W-18;\n platform_h = ZAXIS_H;\n difference() {\n \n \/\/main body\n \/\/\n square([platform_w, platform_h], center=true);\n \n translate([-platform_w\/2,0]) circle(2.5);\n translate([ platform_w\/2,0]) circle(2.5);\n \n \/\/support slots\n \/\/\n translate([-FINGER_W, platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n translate([-FINGER_W,-platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n translate([ FINGER_W, platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n translate([ FINGER_W,-platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n \n \/\/ limit switch holes\n \/\/\n \/\/translate([-5, (platform_h\/2 - ZLIMIT_H\/2)]) mirror([1,0,0]) switch_holes();\n \/\/translate([-5,-(platform_h\/2 - ZLIMIT_H\/2)])switch_holes();\n \n translate([ 0, (platform_h\/2 - ZLIMIT_H\/2)])\n mirror([1,0,0]) switch_holes();\n translate([ 0,-(platform_h\/2 - ZLIMIT_H\/2)])\n switch_holes();\n \n \n translate([-(platform_w\/2 - ZLIMIT_W\/2), (platform_h\/2 - ZLIMIT_H\/2)])\n mirror([1,0,0]) switch_holes();\n translate([-(platform_w\/2 - ZLIMIT_W\/2),-(platform_h\/2 - ZLIMIT_H\/2)])\n switch_holes();\n translate([ (platform_w\/2 - ZLIMIT_W\/2),-(platform_h\/2 - ZLIMIT_H\/2)])\n switch_holes();\n translate([ (platform_w\/2 - ZLIMIT_W\/2), (platform_h\/2 - ZLIMIT_H\/2)])\n mirror([1,0,0]) switch_holes(); \n }\n}\n\nmodule platform_support(support_base_h=2) {\n \/\/a=90\/4;\n a=90\/2;\n support_base_w = 3*FINGER_W;\n \/\/support_base_h = 10;\n \/\/support_base_h = 2;\n C0=30;\n C1=15;\n \n xh = sin(a) * support_base_w;\n difference() {\n union() {\n \n \/\/ bottom half with fingers\n \/\/\n square([support_base_w, support_base_h], center=true);\n translate([-FINGER_W, -(support_base_h\/2 + FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ FINGER_W, -(support_base_h\/2 + FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n \n \/\/ triangular upper half\n \/\/\n translate([-support_base_w\/2, support_base_h\/2])\n intersection() {\n rotate(a, [0,0,1]) mirror([0,1,0]) square([2*support_base_w, C0*support_base_h]);\n \/\/color([1,0,0]) square([support_base_w, C1*support_base_h]);\n square([support_base_w, xh]);\n };\n \n \/\/ fingers for triangular upper half\n \/\/\n translate([-(support_base_w\/2), support_base_h\/2])\n rotate(a, [0,0,1])\n square([FINGER_W, FINGER_H]);\n\n translate([-3*FINGER_W\/2,support_base_h\/2])\n rotate(a, [0,0,1])\n translate([2*FINGER_W,0])\n square([FINGER_W, FINGER_H]);\n }\n \n translate([0,-support_base_h\/2]) circle(FINGER_W\/3);\n }\n}\n\n\nmodule switch_holes() {\n diam = 3.2;\n w = ZLIMIT_W;\n h = ZLIMIT_H;\n topl_offset = 1.45;\n topu_offset = 1.53;\n \n rightr_offset = 1.45;\n rightb_offset = 1.3;\n \n translate([-w\/2+topl_offset+diam\/2, h\/2 - topu_offset - diam\/2]) circle(diam\/2, $fn=16);\n translate([ w\/2-rightr_offset-diam\/2, -h\/2 + rightb_offset + diam\/2]) circle(diam\/2, $fn=16);\n}\n\nmodule switch_holes2() {\n \/\/ w=20, h=10\n \/\/ top hole to top = 5.78\n \/\/ bot hole to bot = 1.78\n \/\/ side hole to side = 4\n \/\/ inside hole to inside hole = 7\n \/\/ hole diam = 2.5\n diam = 2.5;\n w = 20;\n h = 10;\n x_from_cent = 7\/2+diam\/2;\n y_from_cent = 5.75-(h\/2)+diam\/2;\n \n translate([x_from_cent,y_from_cent]) circle(diam\/2, $fn=16);\n translate([-x_from_cent, y_from_cent]) circle(diam\/2, $fn=16);\n \n}\n\n\nmodule switch_spacer2() {\n \/\/ w=20, h=10\n \/\/ top hole to top = 5.78\n \/\/ bot hole to bot = 1.78\n \/\/ side hole to side = 4\n \/\/ inside hole to inside hole = 7\n \/\/ hole diam = 2.5\n diam = 2.5;\n w = 20;\n h = 10;\n x_from_cent = 7\/2+diam\/2;\n y_from_cent = 5.75-(h\/2)+diam\/2;\n \n difference() {\n square([w,h], center=true);\n translate([x_from_cent,y_from_cent]) circle(diam\/2, $fn=16);\n translate([-x_from_cent, y_from_cent]) circle(diam\/2, $fn=16);\n }\n \n}\n\nmodule all() {\n side_plate();\n translate([0,40]) side_plate();\n \n \/\/translate([65,0]) platform();\n \/\/translate([65,40]) platform();\n\n translate([245,0]) platform();\n translate([245,40]) platform();\n\n\n translate([-8,65]) platform_support();\n translate([40,65]) platform_support();\n\n translate([87,65]) platform_support();\n\n translate([100,2]) rotate(-90, [0,0,1]) platform_support();\n \n translate([135,10]) rotate(45,[0,0,1]) top_holder();\n translate([175,30]) rotate(-135, [0,0,1]) top_holder();\n \n translate([162,70]) rotate(90, [0,0,1]) switch_spacer2();\n translate([165,90]) switch_spacer2();\n \n\n\n translate([131,68]) side_holder_bottom();\n translate([190,0]) rotate(45, [0,0,1]) side_holder_bottom();\n \n translate([130,90]) side_holder_up();\n translate([195,50]) rotate(90,[0,0,1]) side_holder_up();\n \n translate([98,50]) rotate(-90, [0,0,1]) side_holder_connect();\n translate([115,35]) rotate(90, [0,0,1]) side_holder_connect();\n translate([145,53]) rotate(180, [0,0,1]) side_holder_connect();\n translate([193,80]) rotate(180,[0,0,1]) side_holder_connect();\n}\n\n\nmodule platforms() {\n dx= 120;\n dy = 45;\n side_plate();\n translate([0,dy]) side_plate_bottom();\n \n translate([0.95*dx,0]) platform();\n translate([0.95*dx,dy]) platform();\n\n translate([-8,1.8*dy]) platform_support(10);\n translate([0.95*dy,1.6*dy]) platform_support(10);\n\n translate([dx,1.6*dy]) platform_support();\n translate([2*dy,2.2*dy]) rotate(-180, [0,0,1]) platform_support();\n \n \/\/translate([1.3*dx,70]) switch_spacer2();\n \/\/translate([1.3*dx,50]) switch_spacer2();\n\n}\n\nmodule platform_side_bottom_only() {\n dx= 120;\n dy = 30;\n translate([0,0]) side_plate_bottom();\n \n translate([-7,dy]) platform_support(10);\n translate([48,dy]) platform_support(10);\n\n}\n\n\nmodule all() {\n \n dx= 120;\n dy = 30;\n translate([0,0]) side_plate_bottom();\n \n translate([-7,dy]) platform_support(10);\n translate([48,dy]) platform_support(10);\n \n translate([dx,0]) side_plate();\n translate([dx,dy]) platform_support();\n translate([dx + 50,dy]) platform_support();\n \n \n \n translate([0,4*dy]) rotate(45,[0,0,1]) top_holder();\n translate([45,4*dy]) rotate(-135, [0,0,1]) top_holder();\n \n translate([162,170]) rotate(90, [0,0,1]) switch_spacer2();\n translate([165,190]) switch_spacer2();\n \n\n\n translate([101,108]) side_holder_bottom();\n translate([150,100]) rotate(45, [0,0,1]) side_holder_bottom();\n \n translate([130,190]) side_holder_up();\n translate([195,150]) rotate(90,[0,0,1]) side_holder_up();\n \n translate([98,150]) rotate(-90, [0,0,1]) side_holder_connect();\n translate([115,135]) rotate(90, [0,0,1]) side_holder_connect();\n translate([145,153]) rotate(180, [0,0,1]) side_holder_connect();\n translate([193,180]) rotate(180,[0,0,1]) side_holder_connect();\n\n}\n\n\/\/translate([60,40]) all();\n\/\/translate([60,40]) platforms();\n\/\/translate([36,25]) platform_side_bottom_only();\n\n\/\/all();\n","old_contents":"MATERIAL_THICKNESS = 3;\n\n\/\/MOTOR_D = 41.81;\n\/\/MOTOR_D = 43;\nMOTOR_D = 44.5;\nMOTOR_R = MOTOR_D\/2;\nZAXIS_OUTER_W = 59;\nZAXIS_W = 63.97;\nZAXIS_DEPTH = 50.63;\nZAXIS_H = 35.38;\n\nBT_OVERHANG_EDGE = 25;\nBT_OVERHANG_FRONT = 60;\n\nFINGER_W = 14;\nFINGER_H = MATERIAL_THICKNESS;\n\nZLIMIT_W = 28;\nZLIMIT_H = 16;\n\nz_limit_w = 20;\nz_limit_h = 9.75;\nz_limit_d = 6;\n\n\/\/BACK_PLATE_W = ZAXIS_W + 2*ZLIMIT_W + 2*8;\nBACK_PLATE_W = ZAXIS_W + 2*8;\nBACK_PLATE_H = 35;\n\nzbp_depth = 20;\nzbp_height = 12;\nz_plate_overhang = 30;\nzbp_finger_0 = 6;\nzbp_finger_1 = 6;\n\nzbp_support_len = 10;\nzbp_side_len = zbp_depth + 4 + z_limit_w;\n\n module regular_polygon(order, r=1){\n \tangles=[ for (i = [0:order-1]) i*(360\/order) ];\n \tcoords=[ for (th=angles) [r*cos(th), r*sin(th)] ];\n \tpolygon(coords);\n}\n\nmodule z_top_cross_support() {\n w = ZAXIS_OUTER_W;\n oh_w = z_plate_overhang;\n th = MATERIAL_THICKNESS;\n\n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n \n \/*\n translate([-90,-30])\n union() {\n square([ dx, 2]);\n translate([dx - 2, 0]) square([2, dy]);\n polygon([[0,2], [dx-2,dy], [dx, 2]]);\n \n color([1,0,0]) translate([dx\/2, -th\/2]) square([zbp_finger_1, th], center=true);\n color([0,1,0]) translate([dx + th\/2, dy\/2]) square([th,zbp_finger_1], center=true);\n }\n *\/\n\n \n b = 20;\n s = 20;\n union() {\n \n \/\/ center cross brace\n \/\/\n square([w, s], center=true);\n \n \/\/ side portion\n \/\/\n difference() {\n translate([-w\/2 - oh_w\/2, -s\/2-b\/2]) square([b,b], center=true);\n \n \/\/ tab holes\n \/\/\n translate([-w\/2 - oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n translate([-w\/2 - 2*oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n }\n \n difference() {\n translate([ w\/2 + oh_w\/2, -s\/2-b\/2]) square([b,b], center=true);\n \n \/\/ tab holes\n \/\/\n translate([ w\/2 + oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n translate([ w\/2 + 2*oh_w\/3, -s\/2-b + dy\/2]) square([th, zbp_finger_1], center=true);\n }\n \n \/\/ tab\n \/\/\n translate([-w\/2 - oh_w\/2, -s\/2-b - th\/2]) square([zbp_finger_1, th], center=true);\n translate([ w\/2 + oh_w\/2, -s\/2-b - th\/2]) square([zbp_finger_1, th], center=true);\n \n \/\/triangle connector\n \/\/\n polygon([ [-w\/2, s\/2], [-w\/2 - oh_w\/2 - b\/2, -s\/2], [-w\/2 - oh_w\/2 + b\/2, -s\/2], [-w\/2, -s\/2]]);\n polygon([ [ w\/2, s\/2], [ w\/2 + oh_w\/2 + b\/2, -s\/2], [ w\/2 + oh_w\/2 - b\/2, -s\/2], [ w\/2, -s\/2]]);\n }\n}\n\n\/\/ debug\n\/\/translate([50,-60])z_top_cross_support();\n\n\nmodule z_top_plate() {\n th = MATERIAL_THICKNESS;\n w1 = ZAXIS_OUTER_W\/2 + th;\n \n sl = zbp_support_len;\n w = ZAXIS_OUTER_W;\n h0 = 20;\n h1 = 30;\n \n ox = 10;\n oy = 25;\n \n oh_w = z_plate_overhang;\n oh_l = 30;\n \n h2 = 10;\n\n ohs_w = z_plate_overhang - 3;\n \n h3 = 40;\n h4 = 20;\n \n zspacer_nut_r = (36.30 - 24.5)\/4;\n zspacer_nut_x = 24.5\/2 + zspacer_nut_r;\n\n\n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n oh_w = z_plate_overhang;\n\n overhang_w = ZAXIS_OUTER_W;\n \/\/DEBUG\n \/* \n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n \n translate([-70, -h0 - oy - oh_l - 2*h2])\n rotate(90, [0,0,1])\n union() {\n square([ dx, 2]);\n translate([dx - 2, 0]) square([2, dy]);\n polygon([[0,2], [dx-2,dy], [dx, 2]]);\n \n color([1,0,0]) translate([dx\/2, -th\/2]) square([zbp_finger_1, th], center=true);\n color([0,1,0]) translate([dx + th\/2, dy\/2]) square([th,zbp_finger_1], center=true);\n }\n *\/\n \/\/DEBUG\n\n difference() {\n\n union() {\n \n \/\/ back\n \/\/\n square([w, h0], center=true);\n \n \/\/ back to be cut out\n \/\/\n translate([0,-h0\/2]) square([w, h1], center=true);\n \n \/\/ side connector\n \/\/\n translate([-w\/2 - ox, -h0\/2 -oy]) polygon([[0,0], [ox,oy],[ox,0]]);\n translate([ w\/2, -h0\/2]) polygon([[0,0], [ox,-oy],[0,-oy]]);\n \n \/\/ nut connector plate\n \/\/\n translate([-w\/2 - oh_w\/2, -h0\/2 - oy - oh_l\/2]) square([oh_w, oh_l], center=true);\n translate([ w\/2 + oh_w\/2, -h0\/2 - oy - oh_l\/2]) square([oh_w, oh_l], center=true);\n \n \/\/ brace connector\n \/\/\n translate([-w\/2 - oh_w\/2 - 3\/2, -h0\/2 - oy - oh_l - h2\/2]) square([oh_l - 3, h2], center=true);\n translate([ w\/2 + oh_w\/2 + 3\/2, -h0\/2 - oy - oh_l - h2\/2]) square([oh_l - 3, h2], center=true);\n \n \/\/ side connector (still?)\n \/\/\n polygon([ [-w\/2, -h0\/2], [-(zspacer_nut_x+zspacer_nut_r), -h0\/2], [-w\/2,-(h0+h1\/2)] ]);\n polygon([ [ w\/2, -h0\/2], [ (zspacer_nut_x+zspacer_nut_r), -h0\/2], [ w\/2,-(h0+h1\/2)] ]);\n \n \/\/ brace support connector\n \/\/\n translate([-w\/2 - oh_w\/2 - 3\/2, -h0\/2 - oy - oh_l - h2 - h3\/2]) square([oh_l - 3, h3], center=true);\n translate([ w\/2 + oh_w\/2 + 3\/2, -h0\/2 - oy - oh_l - h2 - h3\/2]) square([oh_l - 3, h3], center=true);\n\n\n \/\/ front connection\n \/\/\n translate([0,-h0\/2 - oy - oh_l - h2 - h3- h4\/2]) square([w + oh_w*2,h4], center=true);\n\n }\n \n \/\/ left hole tabs\n \/\/\n translate([-w\/2 - th - 2,-h0-oy-5]) {\n \n translate([-0, 0]) square([th,zbp_finger_0],center=true);\n translate([-0 - sl - th, zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([-0 - sl - th, -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n }\n \n \/\/ right hole tabs\n \/\/\n translate([ w\/2 + th + 2, -h0-oy-5]) {\n\n translate([(0), 0]) square([th,zbp_finger_0],center=true);\n translate([(0 + sl + th), zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([(0 + sl + th), -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n\n }\n \n \/\/ cross brace hole tabs\n \/\/\n translate([-w\/2 - oh_w\/2, -h0\/2 - oy - oh_l - h2\/2]) square([zbp_finger_1, th], center=true);\n translate([ w\/2 + oh_w\/2, -h0\/2 - oy - oh_l - h2\/2]) square([zbp_finger_1, th], center=true);\n \n \n \/\/ cross brace support hole tabs (left)\n \/\/\n translate([-overhang_w\/2 - 2*oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n translate([-overhang_w\/2 - oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n \n \/\/ cross brace support hole tabs (right)\n \/\/\n translate([ overhang_w\/2 + 2*oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n translate([ overhang_w\/2 + oh_w\/3, -h0\/2 - oy - oh_l - h2 - 3 - dy\/2])\n square([th, zbp_finger_1], center=true);\n\n \/\/ circle cutouts\n \/\/\n hull() {\n translate([zspacer_nut_x, -h0]) circle(zspacer_nut_r);\n translate([zspacer_nut_x, -h0-h1-zspacer_nut_r]) circle(zspacer_nut_r);\n }\n hull() {\n translate([-zspacer_nut_x, -h0]) circle(zspacer_nut_r);\n translate([-zspacer_nut_x, -h0-h1-zspacer_nut_r]) circle(zspacer_nut_r);\n }\n \n hull() {\n translate([0,-h0-3]) circle(9);\n translate([0, -h0-h1-5]) circle(9);\n \n }\n\n }\n\n}\n\nmodule z_top_all() {\n translate([-50,10]) rotate(90, [0,0,1]) z_top_plate();\n \n translate([0,30]) z_side();\n translate([24,13]) rotate(180, [0,0,1]) z_side();\n \n translate([-25,-6]) z_support();\n translate([15,-7]) rotate(180, [0,0,1]) z_support();\n \n translate([8,-3]) rotate(-10, [0,0,1]) z_support();\n translate([47,-9]) rotate(180, [0,0,1]) z_support();\n\n translate([102,-00]) rotate(90, [0,0,1]) z_support();\n translate([90,-00]) rotate(-90, [0,0,1]) z_support();\n\n translate([-16,5]) rotate(80, [0,0,1]) z_support();\n translate([64,30]) mirror([1,0,0]) z_support();\n \n translate([41,20]) z_guide_housing();\n translate([54,20]) z_guide_housing();\n \n translate([41,8]) z_nut_housing();\n translate([54,8]) z_nut_housing();\n\n translate([120,5]) rotate(-90, [0,0,1]) z_top_cross_support();\n\n}\n\ntranslate([60,50]) z_top_all();\n\/\/z_top_plate();\n\n\nmodule z_bottom_plate() {\n bottom_plate_width = ZAXIS_OUTER_W + 2*z_plate_overhang;\n th = MATERIAL_THICKNESS;\n w = ZAXIS_OUTER_W\/2 + th;\n sl = zbp_support_len;\n difference() {\n square([bottom_plate_width, zbp_depth], center=true);\n \n translate([w, 0]) square([th,zbp_finger_0],center=true);\n translate([w + sl + th, zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([w + sl + th, -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n\n translate([-(w), 0]) square([th,zbp_finger_0],center=true);\n translate([-(w + sl + th), zbp_depth\/2 - 3]) square([zbp_finger_1, th], center=true);\n translate([-(w + sl + th), -(zbp_depth\/2 - 3)]) square([zbp_finger_1, th], center=true);\n }\n}\n\nmodule z_support() {\n th = MATERIAL_THICKNESS;\n dx = 2*zbp_support_len - th + zbp_finger_0;\n dy = zbp_height;\n union() {\n square([ dx, 2]);\n translate([dx - 2, 0]) square([2, dy]);\n polygon([[0,2], [dx-2,dy], [dx, 2]]);\n \n translate([dx\/2, -th\/2]) square([zbp_finger_1, th], center=true);\n translate([dx + th\/2, dy\/2]) square([th,zbp_finger_1], center=true);\n }\n}\n\nmodule z_side() {\n \n qq = zbp_depth\/2 - 3;\n th = MATERIAL_THICKNESS;\n m2_ds = (2*(zbp_depth\/2 - 3) - th)\/2 - 2;\n difference() {\n union() {\n translate([zbp_side_len\/2 - zbp_depth\/2, 0]) square([zbp_side_len, zbp_height], center=true);\n translate([0,-zbp_height\/2 - th\/2]) square([zbp_finger_0, th], center=true);\n };\n \n translate([m2_ds, m2_ds]) circle(1, $fn=16);\n translate([-m2_ds,-m2_ds]) circle(1, $fn=16);\n \n translate([qq,0]) square([th, zbp_finger_1], center=true);\n translate([-qq,0]) square([th, zbp_finger_1], center=true);\n circle(2.5, $fn=16);\n \n translate([zbp_depth + th,0]) switch_holes2();\n }\n}\n\nmodule z_nut_housing() {\n th = MATERIAL_THICKNESS;\n dx = 2*(zbp_depth\/2 - 3) - th;\n dy = dx;\n \n m2_x = dx\/2 - 2;\n m2_y = dx\/2 - 2;\n difference() {\n square([dx,dy], center=true);\n translate([ m2_x, m2_y]) circle(1, $fn=16);\n translate([-m2_x,-m2_y]) circle(1, $fn=16);\n \n regular_polygon(6, r=9\/2);\n\n }\n}\n\nmodule z_guide_housing() {\n th = MATERIAL_THICKNESS;\n dx = 2*(zbp_depth\/2 - 3) - th;\n dy = dx;\n \n m2_x = dx\/2 - 2;\n m2_y = dx\/2 - 2;\n difference() {\n square([dx,dy], center=true);\n translate([-m2_x, m2_y]) circle(1, $fn=16);\n translate([ m2_x,-m2_y]) circle(1, $fn=16);\n circle(2.5, $fn=16);\n\n }\n\n}\n\nmodule z_bottom_all() {\n z_bottom_plate();\n \n translate([57,15]) mirror([1,0,0]) z_support();\n translate([30,30]) z_support();\n translate([-50,15]) z_support();\n translate([-50,30]) z_support();\n \n translate([-10,21]) z_side();\n translate([70,0]) rotate(90, [0,0,1]) z_side();\n \/\/translate([85,20]) rotate(90, [0,0,1]) z_bottom_side();\n \/\/translate([0,51]) z_bottom_side();\n \n translate([-10,35]) z_nut_housing();\n translate([5,35]) z_nut_housing();\n \n translate([20, 35]) z_guide_housing();\n translate([85, 0]) z_guide_housing();\n}\n\n\/\/translate([60,10]) z_bottom_all();\n\nmodule side_holder_bottom() {\n w = 20;\n s = 40;\n t = FINGER_H;\n \n xx = 10;\n d=5;\n\n difference() {\n union() {\n square([s,w], center=true);\n translate([ (s\/2 - FINGER_H\/2) + t, w\/3]) square([FINGER_H,w\/3], center=true);\n translate([ (s\/2 - FINGER_H\/2) + t,-w\/3]) square([FINGER_H,w\/3], center=true);\n };\n translate([-(5*s\/12 - d\/2),0]) circle(d\/2, $fn=16);\n translate([-(1*s\/12 - d\/2),0]) circle(d\/2, $fn=16);\n translate([ (s\/2 - FINGER_W), (w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ (s\/2 - FINGER_W),-(w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ (s\/2 - FINGER_H\/2) + t, 0]) square([FINGER_H, w\/3], center=true);\n }\n \n}\n\nmodule side_holder_up() {\n w = 20;\n s = 40;\n d=5;\n t = FINGER_H;\n difference() {\n union() {\n square([s,w], center=true);\n translate([ (s\/2 + FINGER_H\/2), 0]) square([FINGER_H, w\/3], center=true);\n };\n translate([-7*s\/24,0]) switch_holes2();\n translate([ (s\/2 - FINGER_W), (w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ (s\/2 - FINGER_W),-(w\/2 - FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n \n }\n \n}\n\nmodule side_holder_connect(h=0) {\n s = 3*FINGER_W\/2;\n t = MATERIAL_THICKNESS;\n union() {\n polygon([[0,0],[s,s],[s,0]]);\n \/\/polygon([[0,0],[s,s],[s,t], [s-FINGER_W\/2,t], [s-FINGER_W\/2,0],[s,0]]);\n translate([0,-FINGER_H-h]) square([FINGER_W,FINGER_H]);\n translate([s,FINGER_W\/2-h]) square([FINGER_H, FINGER_W]);\n }\n}\n\nmodule top_holder() {\n w = 40;\n s = 20;\n ofx = -0;\n ofy = -10;\n \n difference() {\n union() {\n \/\/square([30,10]);\n square([w,s]);\n \/\/translate([-10,-20,0]) square([10,20]);\n translate([ofx-s\/2,ofy-w\/2,0]) square([10,20]);\n \/\/polygon( points=[[0,w\/2],[-s\/2,0],[0,-s\/8],[w\/8,0]], paths=[[0,1,2,3,0]]);\n polygon( points=[[0,w\/2],[ofx-s\/2,ofy],[ofx,ofy-s\/8],[w\/8,0]], paths=[[0,1,2,3,0]]);\n }\n translate([w\/3,s\/2]) circle(2.5,$fn=16);\n translate([3*w\/4,s\/2]) circle(2.5, $fn=16);\n \/\/translate([-4,-12]) rotate(90, [0,0,1]) switch_holes2();\n translate([ofx-4,ofy-12]) rotate(90, [0,0,1]) switch_holes2();\n }\n}\n\n\nmodule side_plate() {\n cable_slot_w = 4.75;\n cable_slot_h = 2;\n \n ofst = 50;\n \n w = ZAXIS_W - ofst;\n h = ZAXIS_H + 3*cable_slot_h;\n \n difference() {\n \/\/ main body\n \/\/\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n union() {\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n square([ZAXIS_W, h], center=true);\n \/\/translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W\/2, ZAXIS_H], center=true);\n translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W, h], center=true);\n }\n \n translate([ZAXIS_W\/2 + 6,h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n translate([ZAXIS_W\/2 + 6,-h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n \n \/\/ platform slots\n \/\/\n translate([-(FINGER_W-ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([-(FINGER_W-ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n \n \/\/ cable tile slots\n \/\/\n \/*\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n *\/\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n \n \/\/ center access\n \/\/\n square([ZAXIS_W\/2, 4], center=true);\n circle(cable_slot_h*3, $fn=16);\n \n translate([ofst,0]) square([ZAXIS_W\/2, 4], center=true);\n translate([ofst,0]) circle(cable_slot_h*3, $fn=16);\n \n \/\/ center cable tie\n \/\/\n translate([-(ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n translate([ (ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n }\n}\n\n\n\nmodule side_plate_bottom() {\n cable_slot_w = 4.75;\n cable_slot_h = 2;\n \n \/\/ofst = 33;\n ofst = 28;\n \n w = ZAXIS_W - ofst;\n h = ZAXIS_H + 3*cable_slot_h;\n \n difference() {\n \/\/ main body\n \/\/\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n union() {\n \/\/square([ZAXIS_W, ZAXIS_H], center=true);\n square([ZAXIS_W, h], center=true);\n \/\/translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W\/2, ZAXIS_H], center=true);\n translate([ZAXIS_W\/2 + ZAXIS_W\/4,0]) square([ZAXIS_W, h], center=true);\n }\n \n translate([ZAXIS_W\/2 + 6,h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n translate([ZAXIS_W\/2 + 6,-h\/2]) square([ZAXIS_W, 4*cable_slot_h], center=true);\n \n translate([-ZAXIS_W\/4 + 2, h\/2]) square([ZAXIS_W\/4, 4*cable_slot_h], center=true);\n translate([-ZAXIS_W\/4 + 2, -h\/2]) square([ZAXIS_W\/4, 4*cable_slot_h], center=true);\n \n \/\/ platform slots\n \/\/\n translate([-(FINGER_W-ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([-(FINGER_W-ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst), ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n translate([ (FINGER_W+ofst),-ZAXIS_H\/4]) square( [FINGER_W, FINGER_H], center=true);\n \n \/\/ cable tile slots\n \/\/\n \/*\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(ZAXIS_H\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(ZAXIS_H\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n *\/\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([-(ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h), (h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ (ZAXIS_W\/2 - 2*cable_slot_h),-(h\/2 - 1.5*cable_slot_h)])\n square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0, (h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n translate([ 0,-(h\/2 - 1.5*cable_slot_h)]) square([cable_slot_w, cable_slot_h], center=true);\n \n \/\/ center access\n \/\/\n translate([ofst,0]) square([ZAXIS_W\/2, 4], center=true);\n translate([ofst,0]) circle(cable_slot_h*3, $fn=16);\n \n \/\/translate([ofst,0]) square([ZAXIS_W\/2, 4], center=true);\n \/\/translate([ofst,0]) circle(cable_slot_h*3, $fn=16);\n \n \/\/ center cable tie\n \/\/\n translate([-(ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n translate([ (ZAXIS_W\/2 - 1.5*cable_slot_h), 0]) square([3*cable_slot_h, cable_slot_w], center=true);\n }\n}\n\n\/\/ 15 , 5\nmodule platform() {\n platform_w = ZAXIS_W-18;\n platform_h = ZAXIS_H;\n difference() {\n \n \/\/main body\n \/\/\n square([platform_w, platform_h], center=true);\n \n translate([-platform_w\/2,0]) circle(2.5);\n translate([ platform_w\/2,0]) circle(2.5);\n \n \/\/support slots\n \/\/\n translate([-FINGER_W, platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n translate([-FINGER_W,-platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n translate([ FINGER_W, platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n translate([ FINGER_W,-platform_h\/4]) square([FINGER_W, FINGER_H], center=true);\n \n \/\/ limit switch holes\n \/\/\n \/\/translate([-5, (platform_h\/2 - ZLIMIT_H\/2)]) mirror([1,0,0]) switch_holes();\n \/\/translate([-5,-(platform_h\/2 - ZLIMIT_H\/2)])switch_holes();\n \n translate([ 0, (platform_h\/2 - ZLIMIT_H\/2)])\n mirror([1,0,0]) switch_holes();\n translate([ 0,-(platform_h\/2 - ZLIMIT_H\/2)])\n switch_holes();\n \n \n translate([-(platform_w\/2 - ZLIMIT_W\/2), (platform_h\/2 - ZLIMIT_H\/2)])\n mirror([1,0,0]) switch_holes();\n translate([-(platform_w\/2 - ZLIMIT_W\/2),-(platform_h\/2 - ZLIMIT_H\/2)])\n switch_holes();\n translate([ (platform_w\/2 - ZLIMIT_W\/2),-(platform_h\/2 - ZLIMIT_H\/2)])\n switch_holes();\n translate([ (platform_w\/2 - ZLIMIT_W\/2), (platform_h\/2 - ZLIMIT_H\/2)])\n mirror([1,0,0]) switch_holes(); \n }\n}\n\nmodule platform_support(support_base_h=2) {\n \/\/a=90\/4;\n a=90\/2;\n support_base_w = 3*FINGER_W;\n \/\/support_base_h = 10;\n \/\/support_base_h = 2;\n C0=30;\n C1=15;\n \n xh = sin(a) * support_base_w;\n difference() {\n union() {\n \n \/\/ bottom half with fingers\n \/\/\n square([support_base_w, support_base_h], center=true);\n translate([-FINGER_W, -(support_base_h\/2 + FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n translate([ FINGER_W, -(support_base_h\/2 + FINGER_H\/2)]) square([FINGER_W, FINGER_H], center=true);\n \n \/\/ triangular upper half\n \/\/\n translate([-support_base_w\/2, support_base_h\/2])\n intersection() {\n rotate(a, [0,0,1]) mirror([0,1,0]) square([2*support_base_w, C0*support_base_h]);\n \/\/color([1,0,0]) square([support_base_w, C1*support_base_h]);\n square([support_base_w, xh]);\n };\n \n \/\/ fingers for triangular upper half\n \/\/\n translate([-(support_base_w\/2), support_base_h\/2])\n rotate(a, [0,0,1])\n square([FINGER_W, FINGER_H]);\n\n translate([-3*FINGER_W\/2,support_base_h\/2])\n rotate(a, [0,0,1])\n translate([2*FINGER_W,0])\n square([FINGER_W, FINGER_H]);\n }\n \n translate([0,-support_base_h\/2]) circle(FINGER_W\/3);\n }\n}\n\n\nmodule switch_holes() {\n diam = 3.2;\n w = ZLIMIT_W;\n h = ZLIMIT_H;\n topl_offset = 1.45;\n topu_offset = 1.53;\n \n rightr_offset = 1.45;\n rightb_offset = 1.3;\n \n translate([-w\/2+topl_offset+diam\/2, h\/2 - topu_offset - diam\/2]) circle(diam\/2, $fn=16);\n translate([ w\/2-rightr_offset-diam\/2, -h\/2 + rightb_offset + diam\/2]) circle(diam\/2, $fn=16);\n}\n\nmodule switch_holes2() {\n \/\/ w=20, h=10\n \/\/ top hole to top = 5.78\n \/\/ bot hole to bot = 1.78\n \/\/ side hole to side = 4\n \/\/ inside hole to inside hole = 7\n \/\/ hole diam = 2.5\n diam = 2.5;\n w = 20;\n h = 10;\n x_from_cent = 7\/2+diam\/2;\n y_from_cent = 5.75-(h\/2)+diam\/2;\n \n translate([x_from_cent,y_from_cent]) circle(diam\/2, $fn=16);\n translate([-x_from_cent, y_from_cent]) circle(diam\/2, $fn=16);\n \n}\n\n\nmodule switch_spacer2() {\n \/\/ w=20, h=10\n \/\/ top hole to top = 5.78\n \/\/ bot hole to bot = 1.78\n \/\/ side hole to side = 4\n \/\/ inside hole to inside hole = 7\n \/\/ hole diam = 2.5\n diam = 2.5;\n w = 20;\n h = 10;\n x_from_cent = 7\/2+diam\/2;\n y_from_cent = 5.75-(h\/2)+diam\/2;\n \n difference() {\n square([w,h], center=true);\n translate([x_from_cent,y_from_cent]) circle(diam\/2, $fn=16);\n translate([-x_from_cent, y_from_cent]) circle(diam\/2, $fn=16);\n }\n \n}\n\nmodule all() {\n side_plate();\n translate([0,40]) side_plate();\n \n \/\/translate([65,0]) platform();\n \/\/translate([65,40]) platform();\n\n translate([245,0]) platform();\n translate([245,40]) platform();\n\n\n translate([-8,65]) platform_support();\n translate([40,65]) platform_support();\n\n translate([87,65]) platform_support();\n\n translate([100,2]) rotate(-90, [0,0,1]) platform_support();\n \n translate([135,10]) rotate(45,[0,0,1]) top_holder();\n translate([175,30]) rotate(-135, [0,0,1]) top_holder();\n \n translate([162,70]) rotate(90, [0,0,1]) switch_spacer2();\n translate([165,90]) switch_spacer2();\n \n\n\n translate([131,68]) side_holder_bottom();\n translate([190,0]) rotate(45, [0,0,1]) side_holder_bottom();\n \n translate([130,90]) side_holder_up();\n translate([195,50]) rotate(90,[0,0,1]) side_holder_up();\n \n translate([98,50]) rotate(-90, [0,0,1]) side_holder_connect();\n translate([115,35]) rotate(90, [0,0,1]) side_holder_connect();\n translate([145,53]) rotate(180, [0,0,1]) side_holder_connect();\n translate([193,80]) rotate(180,[0,0,1]) side_holder_connect();\n}\n\n\nmodule platforms() {\n dx= 120;\n dy = 45;\n side_plate();\n translate([0,dy]) side_plate_bottom();\n \n translate([0.95*dx,0]) platform();\n translate([0.95*dx,dy]) platform();\n\n translate([-8,1.8*dy]) platform_support(10);\n translate([0.95*dy,1.6*dy]) platform_support(10);\n\n translate([dx,1.6*dy]) platform_support();\n translate([2*dy,2.2*dy]) rotate(-180, [0,0,1]) platform_support();\n \n \/\/translate([1.3*dx,70]) switch_spacer2();\n \/\/translate([1.3*dx,50]) switch_spacer2();\n\n}\n\nmodule platform_side_bottom_only() {\n dx= 120;\n dy = 30;\n translate([0,0]) side_plate_bottom();\n \n translate([-7,dy]) platform_support(10);\n translate([48,dy]) platform_support(10);\n\n}\n\n\nmodule all() {\n \n dx= 120;\n dy = 30;\n translate([0,0]) side_plate_bottom();\n \n translate([-7,dy]) platform_support(10);\n translate([48,dy]) platform_support(10);\n \n translate([dx,0]) side_plate();\n translate([dx,dy]) platform_support();\n translate([dx + 50,dy]) platform_support();\n \n \n \n translate([0,4*dy]) rotate(45,[0,0,1]) top_holder();\n translate([45,4*dy]) rotate(-135, [0,0,1]) top_holder();\n \n translate([162,170]) rotate(90, [0,0,1]) switch_spacer2();\n translate([165,190]) switch_spacer2();\n \n\n\n translate([101,108]) side_holder_bottom();\n translate([150,100]) rotate(45, [0,0,1]) side_holder_bottom();\n \n translate([130,190]) side_holder_up();\n translate([195,150]) rotate(90,[0,0,1]) side_holder_up();\n \n translate([98,150]) rotate(-90, [0,0,1]) side_holder_connect();\n translate([115,135]) rotate(90, [0,0,1]) side_holder_connect();\n translate([145,153]) rotate(180, [0,0,1]) side_holder_connect();\n translate([193,180]) rotate(180,[0,0,1]) side_holder_connect();\n\n}\n\n\/\/translate([60,40]) all();\n\/\/translate([60,40]) platforms();\n\/\/translate([36,25]) platform_side_bottom_only();\n\n\/\/all();\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6bff2d479ff27b48553c172f835ead42221c3032","subject":"re-design for wider knee (F) joint","message":"re-design for wider knee (F) joint\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\nr38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\n\/\/translate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ntranslate([xC,yC,linkOffset-.5]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/translate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ntranslate([xC,yC,linkOffset+1.8]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n translate([4,0,0]) cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.05,4.45]) rotate([0,0,(z>0)?25:0]) hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,1.5*z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,1.5*z])cylinder(r=1,h=.4,center=true);\n }\n\n\n \/\/ hinge holders at H\n for (z=[-.2,5.1]) translate([FGleft,FGperp,z]) rotate([0,0,0]) {\n translate([0,-6.5,0]) cube([2.6,6,2.6],center=true);\n color([.3,.3,.4,.6])\n translate([0,-1.5,0]) cube([2.4,6,2.4],center=true);\n }\n\n translate([FGleft,FGperp-6,2.5]) cube([8,2.6,2.6],center=true);\n\n\/*\n \/\/ hinge holders at H on GH segment\n *for (z=[-.2,5.1]) translate([FGleft,FGperp,z]) rotate([0,0,52]) {\n translate([0,-6.5,0]) cube([2.6,6,2.6],center=true);\n color([.3,.3,.4,.6]) translate([0,-1.5,0]) cube([2.4,6,2.4],center=true);\n }\n\n \/\/ H side of FH link blocks. No hinge attachment at this time\n *for (z=[0,-5]) translate([FGleft,FGperp,3.5]) rotate([0,0,-130])\n translate([3,-2.54\/2,z]) cube([6,2.6,2.6]);\n\n translate([FGleft,FGperp-4,2.5]) cube([15,2.6,2.6],center=true);\n color([.3,.3,.4,.4]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n*\/\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,3.9]) cube([2.6,2.6,5.1],center=true);\n hull() { \/\/ gusset\n translate([ 4,-1,1]) cylinder(r=.3,h=5.4,$fn=12);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=12);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.8]) hull() {\n translate([3,1,z]) sphere(.8);\n translate([FGleft-1,FGperp-5,z]) sphere(.8);\n }\n hull() { \/\/ diga brace. Could be gusset?\n translate([3,1,5.7]) sphere(.8);\n translate([13,10.5,-.3]) sphere(.8);\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) sphere(.8);\n translate([FGleft+1,FGperp-5,-.3]) sphere(.8);\n }\n hull() {\n translate([FG-10,0,0]) sphere(.8);\n translate([FGleft+1,FGperp-5,5.8]) sphere(.8);\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-9,5.7]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-9,-.3]) sphere(.8);\n translate([FGleft,0,-.3]) sphere(.8);\n }\n\n \/\/ extra truss braces\n hull() {\n translate([48,13,2]) sphere(.8);\n translate([35, 0,0]) sphere(.8);\n }\n *hull() {\n translate([5,1,5.8]) sphere(.8);\n translate([40,0,.8]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=20,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() difference() {\n \/* old style, with forks ground from square tube : \n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n *\/\n union() {\n translate([DE\/2,0,0]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) cylinder(r=1.4,h=7.2,$fn=36); \/\/ axle\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n }\n\n \/\/ pivot holes\n for (x=[0,DE]) translate([x,0,0]) cylinder(r=r38,h=11,center=true);\n}\n\nmodule eFork() for(z=[-1,1]) hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n}\n\nmodule crankLink(dx=CD) {\n cylinder(r=1.4,h=.7,$fn=24,center=true);\n color([0.3,0.3,0.4,0.9]) translate([dx-1,0,.6]) difference() {\n cube([5,2.7,2.2],center=true);\n #translate([1,0,0]) cylinder(r=.64,h=11,center=true);\n }\n translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\n\nmodule EFlink() difference() {\n union() {\n color([.4,.4,.5,.9]) {\n \/\/translate([ 1.5,0,0]) cube([6,3,2.5],center=true);\n translate([EF-1.5,0,0]) cube([6,3,2.5],center=true);\n }\n translate([EF\/2-1.5,0,0]) cube([EF-2,2.6,2.6],center=true);\n\n translate([0,0,2*2.54\/2]) cylinder(r=1.5,h=2.54*3,$fn=48,center=true);\n\n hull() {\n translate([0,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,1, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/cylinder(r=r38,h=55,center=true);\n cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\nmodule EFlink2() difference() {\n union() {\n color([.4,.4,.5,.9]) {\n translate([ 1.5,0,0]) cube([6,3,2.5],center=true);\n translate([EF-1.5,0,0]) cube([6,3,2.5],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-4,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=r38,h=3,center=true);\n cylinder(r=r38,h=5,center=true);\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() {\n translate([0,0,2.4]) cylinder(r=1.4,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([4,4,7.9],center=true);\n }\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-3,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,0.5,-2.4]) sphere(.8);\n translate([BH-5,1, 6 ]) sphere(.8); \n }\n hull() {\n translate([ 4,-.5, 7]) sphere(.8);\n translate([BH-5, -1, -2 ]) sphere(.8); \n }\n\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\nr38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\n\/\/translate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ntranslate([xC,yC,linkOffset-.5]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/translate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ntranslate([xC,yC,linkOffset+1.8]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() difference() {\n \/* old style, with forks ground from square tube : \n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n *\/\n union() {\n translate([DE\/2,0,0]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) cylinder(r=1.4,h=7.2,$fn=36); \/\/ axle\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n }\n\n \/\/ pivot holes\n for (x=[0,DE]) translate([x,0,0]) cylinder(r=r38,h=11,center=true);\n}\n\nmodule eFork() for(z=[-1,1]) hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n}\n\nmodule crankLink(dx=CD) {\n cylinder(r=1.4,h=.7,$fn=24,center=true);\n color([0.3,0.3,0.4,0.9]) translate([dx-1,0,.6]) difference() {\n cube([5,2.7,2.2],center=true);\n #translate([1,0,0]) cylinder(r=.64,h=11,center=true);\n }\n translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\n\nmodule EFlink() difference() {\n union() {\n color([.4,.4,.5,.9]) {\n translate([ 1.5,0,0]) cube([6,3,2.5],center=true);\n translate([EF-1.5,0,0]) cube([6,3,2.5],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-4,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=r38,h=3,center=true);\n cylinder(r=r38,h=5,center=true);\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() {\n translate([0,0,2.4]) cylinder(r=1.4,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([4,4,7.9],center=true);\n }\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-3,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,0.5,-2.4]) sphere(.8);\n translate([BH-5,1, 6 ]) sphere(.8); \n }\n hull() {\n translate([ 4,-.5, 7]) sphere(.8);\n translate([BH-5, -1, -2 ]) sphere(.8); \n }\n\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0d0435dffa4bfdea6300c0a1ad38ca88a15bffc3","subject":"add a TODO","message":"add a TODO\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/name-tags\/examples\/fish\/ira\/ira-fish-name-tag.scad","new_file":"openscad\/models\/src\/main\/openscad\/name-tags\/examples\/fish\/ira\/ira-fish-name-tag.scad","new_contents":"\n\/\/TODO: see the error file on the desktop\n\nuse <..\/..\/..\/name-tag.scad>\n\nicons_xOffset = 30;\nicons_xyScale = 0.879;\nicons_yOffset = 4;\n\nnametag(baseColor = \"Blue\",\n\t baseHeight = 12,\n baseThickness = 2,\n baseWidth = 76,\n \tbottomText = \"Andrea's Fish\",\n bottomTextColor = \"white\",\n bottomTextFont = \"Bauhaus 93\", \/\/ \"Arial\", \"Wingdings\",\n bottomTextOffsetX = 0,\n bottomTextOffsetY = -7,\n \tbottomTextSize = 7,\n chainLoop = false,\n\t\txIconOffset = icons_xOffset,\n\t\tyIconOffset = icons_yOffset,\n\t\tleftIconHeight = 3,\n \tleftIconType = \"Fish\",\n\t\tleftIconXyScale = icons_xyScale,\n letterThickness = 3,\n \trightIconType = \"Fish\",\n rightIconHeight = 3,\n\t\trightIconXyScale = icons_xyScale,\n\t\trightIconOffsetY = icons_yOffset,\n roundedCorners = true,\n showBorder = \"No\",\n topText = \"Ira\",\n \ttopTextOffsetY = 4,\n topTextSize = 11,\n topTextColor = \"white\",\n topTextFont = \"Bauhaus 93\"); \/\/ \"Bauhaus 93\" \"Helvetica\");\n","old_contents":"\nuse <..\/..\/..\/name-tag.scad>\n\nicons_xOffset = 30;\nicons_xyScale = 0.879;\nicons_yOffset = 4;\n\nnametag(baseColor = \"Blue\",\n\t baseHeight = 12,\n baseThickness = 2,\n baseWidth = 76,\n \tbottomText = \"Andrea's Fish\",\n bottomTextColor = \"white\",\n bottomTextFont = \"Bauhaus 93\", \/\/ \"Arial\", \"Wingdings\",\n bottomTextOffsetX = 0,\n bottomTextOffsetY = -7,\n \tbottomTextSize = 7,\n chainLoop = false,\n\t\txIconOffset = icons_xOffset,\n\t\tyIconOffset = icons_yOffset,\n\t\tleftIconHeight = 3,\n \tleftIconType = \"Fish\",\n\t\tleftIconXyScale = icons_xyScale,\n letterThickness = 3,\n \trightIconType = \"Fish\",\n rightIconHeight = 3,\n\t\trightIconXyScale = icons_xyScale,\n\t\trightIconOffsetY = icons_yOffset,\n roundedCorners = true,\n showBorder = \"No\",\n topText = \"Ira\",\n \ttopTextOffsetY = 4,\n topTextSize = 11,\n topTextColor = \"white\",\n topTextFont = \"Bauhaus 93\"); \/\/ \"Bauhaus 93\" \"Helvetica\");\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"510dd170eac121dafdd08b4db12b57db8e7c47e5","subject":"rack updated 3","message":"rack updated 3\n","repos":"rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru","old_file":"org\/lrn\/openscad\/rack.scad","new_file":"org\/lrn\/openscad\/rack.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f852b3169c0072663c141212b0fcc45344075ee6","subject":"bearing\/linear\/mount: make mount_dir_align default U, assert != U","message":"bearing\/linear\/mount: make mount_dir_align default U, assert != U\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part=part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part=part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=X, mount_style=\"open\")\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"39cf606a9768c64b5e44cc2ce151b252849b3348","subject":"Add a barrel sample","message":"Add a barrel sample\n","repos":"jsconan\/camelSCAD","old_file":"samples\/barrel.scad","new_file":"samples\/barrel.scad","new_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * A parametric closed barrel.\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ As we need to use some shapes, use the right entry point of the library\nuse <..\/shapes.scad>\ninclude <..\/core\/constants.scad>\n\n\/\/ We will render the object using the specifications of this mode\nrenderMode = MODE_PROD;\n\n\/\/ Defines the dimensions of the object\ndiameter = 40;\nheight = 60;\nfillet = ceil(min(diameter, height) \/ 20);\n\n\/\/ Sets the minimum facet angle and size using the defined render mode.\napplyMode(renderMode) {\n peg([diameter, diameter, height], r=fillet);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/barrel.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"14b4754af8b6acf0c535e41c2275e6f2c960a251","subject":"Row spacing was added.","message":"Row spacing was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/pencil-holder-with-cutouts\/spur-vase-b.scad","new_file":"OpenSCAD\/pencil-holder-with-cutouts\/spur-vase-b.scad","new_contents":"spurStl = \"..\/lamp-shade-scallops\/spur\/spurs-a.stl\";\r\n\r\nlittleSpurCount = 6;\r\n\r\nlittleSpurScale = 0.125;\r\n\r\nrowSpacing = 30;\r\n\r\ndifference()\r\n{\r\n \/\/ vase\r\n difference()\r\n {\r\n \/\/ outer vase\r\n translate([0,0,0])\r\n cylinder (h = 70, r=55, center = true, $fn=100);\r\n \r\n \/\/ remvoed inner vasecentered spur\r\n translate([0,0,5])\r\n cylinder (h = 70, r=50, center = true, $fn=100);\r\n }\r\n \r\n \/\/ outer spurs\r\n for ( i = [0 : 5] )\r\n {\r\n rotate([\r\n 90, \r\n 0,\r\n i * 360 \/ 6\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, 15+(z*rowSpacing), 30])\r\n scale([littleSpurScale, littleSpurScale, 20.2])\r\n import(spurStl);\r\n }\r\n}","old_contents":"spurStl = \"..\/lamp-shade-scallops\/spur\/spurs-a.stl\";\r\n\r\nlittleSpurCount = 6;\r\n\r\nlittleSpurScale = 0.125;\r\n\r\ndifference()\r\n{\r\n \/\/ vase\r\n difference()\r\n {\r\n \/\/ outer vase\r\n translate([0,0,0])\r\n cylinder (h = 70, r=55, center = true, $fn=100);\r\n \r\n \/\/ remvoed inner vasecentered spur\r\n translate([0,0,5])\r\n cylinder (h = 70, r=50, center = true, $fn=100);\r\n }\r\n \r\n \/\/ outer spurs\r\n for ( i = [0 : 5] )\r\n {\r\n rotate([\r\n 90, \r\n 0,\r\n i * 360 \/ 6\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, 0, 30])\r\n scale([littleSpurScale, littleSpurScale, 20.2])\r\n import(spurStl);\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"53a4160ddc9c8dca607c312f551e17575c66a620","subject":"Add a visual indicator when an assertion fails","message":"Add a visual indicator when an assertion fails\n","repos":"jsconan\/camelSCAD","old_file":"util\/test.scad","new_file":"util\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"12cb58b93e6fe248f1361888e00099e446955e14","subject":"Creating top lid for case","message":"Creating top lid for case\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/pantilt2.scad","new_file":"hardware\/pantilt2.scad","new_contents":"\/\/$fn = 100;\n\n\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\ninclude ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nscrewDiam\t= 3;\nscrewLenght = 10;\nscrewTolerance = 0.2;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLenght = Pilength + mik + 3;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\n\n\n\n\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif (application == \"servo\") {\n\t\t\ttranslate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n\t\t\ttranslate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n\t\t\ttranslate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n\t\t\ttranslate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n\t\t}\n\t}\n}\n\n\/\/Baseplate for pan mechanism\nmodule base(servo) {\n\tdifference(){\n\t\t\n\t {\n\t\tminkowski() {\n\t\t\tcylinder(r = R + mik, h = supportBaseHeight);\n\t\t\trotate([90, 0, 0]) cylinder(r = mik, h = 1);\n\t\t}\n\n\t\t\/\/This to create a anchorign mechanism with the pan base\n\t\t\/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n\t}\n\t\tif(servo == true) translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n\t}\n}\n\/\/-------------------------\n\n\nmodule supportSection() {\n\tintersection() {\n\t\tdifference() {\n\t\t\tsphere(R);\n\t\t\tcube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n\t\t}\n\t\ttranslate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n\t}\n}\n\/\/-------------------------\n\nmodule tiltSupport()\n\/\/This creates the supporting pillar for the camera shell\n {\n\tunion(){\ndifference() {\n\t\tsphere(R);\n\t\tcube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\t\ttranslate([-gimballWidth,0,0])cube([2 * gimballWidth,2 * gimballWidth,2 * gimballWidth], center=true);\n\n\t}\n\n\thull() {\n\t\ttranslate([0, 0, -5]) supportSection();\n\t\ttranslate([0, 0, -supportZ]) supportSection();\n\t}}\n\n}\n\n\nmodule servoTiltSupport(xPos) {\n\t\/\/Need to center the servo shaft, the seconf figure is the distance form border\n\tsupportPosition = xPos;\n\teccentricity = 22.2 \/ 2 - 5;\n\tservoBodySupport = 20;\n\t\/\/Need to adjust the clearance to account for the Xpos\n\tservoClerance = 31 - 16 - servoHornThickness;\n\tsupportCurvature = 30;\n\n\trotate([-0, 0, 0]) difference() {\n\n\t\tunion() {\n\n\t\t\tdifference() {\n\t\t\t\ttranslate([-shellThickness \/ 2 + supportPosition, 0, 15]) {\n\t\t\t\t\tcube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\t\t\t\t}\n\t\t\t\tdifference() {\n\t\t\t\t\ttranslate([-shellThickness \/ 2 + supportPosition, 0, 15]) cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\n\n\t\t\t\t\t\/\/The size of the sphere governs where the servo support will be cut. Need to add tolerance if you wnat to print as one piece with the shell.\n\t\t\t\t\tsphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttranslate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n\t\t\t\t\/\/This is the servo box\n\t\t\t\tdifference() {\n\t\t\t\t\tcube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n\t\t\t\t\tcube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n\t\t\t\t\t\/\/Servo cable slot\n\t\t\t\t\ttranslate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\/\/This is the slot in the servo arm\n\t\ttranslate([servoClerance + 10, 0, eccentricity]) {\n\n\t\t\tcube([20+1, 12, 32.2+1], center = true);\n\t\t\ttranslate([-31 \/ 2, 0, 0]) cube([31+1, 12, 22.2+1], center = true);\n\n\t\t}\n\t}\n\n\ntranslate([0, 0, 0])\n\t\t\tdifference() {\n\t\ttranslate([3, 0,+ RatX(xPos)-10])\n\t\tdifference() {\n\t\t\tcube([20, 20, 20], center = true);\n\t\t\ttranslate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20);\n\t\t}\n\n\t\tdifference() {\n\t\t\tsphere(RatX(gimballWidth \/ 2) + 10 * shellThickness + tolerance);\n\n\t\t\tsphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\t\t}\n\t}\n\n}\n\/\/-------------------------\nmodule cameraSupport() {\n\tdifference() {\n\t\tdifference() {\n\t\t\tsphere(R);\n\t\t\tsphere(R - shellThickness);\n\t\t}\n\n\t\ttranslate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n\t\ttranslate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n\t\t\/\/Creates camera support\n\t\ttranslate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n\t\ttranslate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n\t\t\/\/Slot for camera wires\n\t\ttranslate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n\t\t\/\/Hole for the camera\n\t\ttranslate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + tolerance, 10, PIcameraDiam + tolerance], center = true);\n\t}\n\n\t\/\/Need to hardwire the servo dimensions\n\n\t{\n\t\tservoTiltSupport(gimballWidth \/ 2);\n\n\n\t}\n\t\/\/pivot mechanism\n\ttranslate([-gimballWidth \/ 2, 0, 0]) {\n\t\tdifference() {\n\t\t\trotate([0, 90, 0]) cylinder(r = panSupport, h = shellThickness);\n\t\t\tgimballPivot(1);\n\t\t\trotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n\t\t}\n\t\tgimballPivot(1);\n\t}\n}\n\/\/-------------------------\n\nmodule servoHorn(type) {\n\tcube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n\tif (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n}\n\/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n\trotate([0, 90, 0])\n\tdifference() {\n\t\tcylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n\t\tcylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n\t}\n}\n\/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance)\/R;\n\t\t\t\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n SUB_servocableDuct();\n }\n\n\t\/\/Need to cut holes in the base for servo and camera cables and the screws\n\ttranslate([0,0,-supportBaseHeight\/2])\n\tdifference(){\n\t\t\n\t\t{\n\t\t\tcolor(\"blue\",0.5)translate([0, 0, -supportZ - supportBaseHeight])base(true);\n\t\t\tSUB_cameracableDuct();\n\t\t\tSUB_servocableDuct();\n\t\t\ttranslate([0,0,+supportBaseHeight\/2])mirror([1, 0, 0])tiltSupport();\n\t\t\tSUB_mountedPillarScrewHoles();\n\t\t}\n\n\t}\n}\n\nmodule mountedPillar(){\n \/\/Pillar for camera. This one needs to be mounted separately\n\tdifference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n\t\tSUB_mountedPillarScrewHoles();\n }\n\n }\n}\n\nmodule SUB_screw(tolerance)\n{\n\tcylinder(r= screwDiam\/2+tolerance, h = screwLenght);\n\ttranslate([0,0,-3])cylinder(r= 2*screwDiam\/2+screwTolerance, h = 3);\n}\n\nmodule SUB_mountedPillarScrewHoles()\n{\n\tcolor(\"blue\",0.5)translate([-R+supportX\/2+2,0,-supportZ-screwLenght\/2])\n\t{\n\ttranslate([0, 0.5 * panSupport,0])SUB_screw(-screwTolerance);\n\tmirror([0,1,0])translate([0, 0.5 * panSupport,0])SUB_screw(-screwTolerance);\n\t}\t\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n translate([+gimballWidth \/ 2 + supportX \/ 4 + 2, -supportX\/3, -3]) {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 4, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 4, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 170]) cylinder(r = supportX \/ 4, h = 0.8 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct()\n {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n}\n\/\/---------------------------\n\n\n\n\n\nmodule connectionSocket ()\n{\n\ncylinder(r=3, h=5);\ntranslate([-9,-3\/2,0])cube([10,3,5]);\n\n}\n\nmodule mhole ()\n\t{\n\tcylinder (r=3\/2-0.2, h=2*Piheight+8, $fs=0.1);\n\t}\n\n\n\nmodule case(){\ntranslate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n\tdifference(){\n\tminkowski()\n\t{\n\t\tbox(boxLength, boxDepth, boxHeight, shellThickness - mik, \"PI\");\n\t\t\/\/sphere(r = mik);\n\t\tcylinder(r=mik, h=2);\n\t}\ntranslate([R-10 , -Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([-R+10 , -Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([R-10 , Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([-R+10 , Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([0, 0,-boxHeight \/ 2 - 5\/2 ])cylinder(r=3,h=5);\n\n\n\ttranslate([-Pilength \/ 2, -Piwidth \/ 2, -boxHeight \/ 2 + 5 + shellThickness]) {\n\t\trpi();\t\t\n\t}\n}\ntranslate([-Pilength \/ 2, -Piwidth \/ 2, -boxHeight \/ 2 + 5 + shellThickness])\n{\n translate([25.5, 18, -(+5 + shellThickness)]) mhole();\n translate([length - 5, width - 12.5, -(+5 + shellThickness)]) mhole();\n\n }\n}\n}\n \n\n\/\/mountedPillar();\n\/\/mirror([1, 0, 0])tiltSupport();\n\/\/SUB_mountedPillarScrewHoles();\n\/\/servoTiltSupport(15);\n\/\/cameraSupport();\n\n\/\/translate([-10, 0, 0])\n\/\/support();\n\n\ntopCoverHeight = 15;\ndifference()\n{\n{\ntranslate([0, 0, -supportZ-supportBaseHeight-topCoverHeight\/2])\tcube([boxLenght+mik,boxDepth,topCoverHeight], center=true);\ntranslate([0, 0, -supportZ - supportBaseHeight]){\nbase(\"false\");\nscale([0.8,0.8,30])base(\"false\");\n}\n}\n}\n\n","old_contents":"\/\/$fn = 100;\n\n\n\/\/Need to fix servo tilt suport issue. The spheric part does not move with the arm when you change xPos parameter\ninclude ;\nPIcameraDiam = 8;\nPIcameraX = 25;\nPIcameraY = 25;\n\nmik = 2;\nshellThickness = 3;\nsupportBaseHeight = 5;\n\/\/5.4 is the height of the \nbaseHeight = 31 + shellThickness - 5.4;\ntolerance = 1.5;\ngimballWidth = 45; \/\/for 50 gives R = 86\n\nR = sqrt(3 * gimballWidth * gimballWidth) \/ 2;\npanSupport = sqrt(R * R - (gimballWidth * gimballWidth \/ 4));\ngimballPivotR = R \/ 2;\nsupportY = 2 * sqrt(R * R - (gimballWidth \/ 2) * (gimballWidth \/ 2));\nsupportX = R - gimballWidth \/ 2;\nsupportZ = 1.1 * R;\n\nservoHornThickness = 5.5;\nservoHornWidth = 8;\nservoHornLenght = 32;\n\nscrewDiam\t= 3;\nscrewLenght = 10;\nscrewTolerance = 0.2;\n\nPiwidth = 56;\nPilength = 85;\nPiheight = 1.5;\n\nboxLenght = Pilength + mik + 3;\nboxDepth = 2 * R + 10;\nboxHeight = 48;\n\n\n\n\n\nfunction RatX(x) = sqrt(R * R - (x * x));\n\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif (application == \"servo\") {\n\t\t\ttranslate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n\t\t\ttranslate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n\t\t\ttranslate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n\t\t\ttranslate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n\t\t}\n\t}\n}\n\n\nmodule base(servo) {\n\tdifference(){\n\t\ttranslate([0, 0, -supportZ - supportBaseHeight]) {\n\t\tminkowski() {\n\t\t\tcylinder(r = R + mik, h = supportBaseHeight);\n\t\t\trotate([90, 0, 0]) cylinder(r = mik, h = 1);\n\t\t}\n\n\t\t\/\/This to create a anchorign mechanism with the pan base\n\t\t\/\/translate([0, 0,-mik])cylinder(r = R + mik+3, h = 2);\n\t}\n\t\tif(servo == true) translate([0, 0, -supportZ - servoHornThickness]) rotate([0, 90, 0]) servoHorn(\"cross\");\n\t}\n}\n\/\/-------------------------\n\nmodule bottom()\n\/\/This creates a support for the pan mechanism if the gimball is to be used to be used standalone\n {\n\ttranslate([0, 0, -supportZ - supportBaseHeight - baseHeight]) {\n\t\tdifference() {\n\n\t\t\tdifference() {\n\t\t\t\tminkowski() {\n\t\t\t\t\tcylinder(r = R + 6, h = baseHeight);\n\t\t\t\t\trotate([90, 0, 0]) cylinder(r = mik, h = 1);\n\t\t\t\t}\n\n\t\t\t\ttranslate([0, 0, 5]) cylinder(r = (R + mik) - 2 * shellThickness, h = 10 * baseHeight);\n\t\t\t}\n\t\t\ttranslate([0, 0, baseHeight - supportBaseHeight]) cylinder(r = R + mik + tolerance, h = 10 * supportBaseHeight);\n\t\t\ttranslate([0, 0, 0]) cylinder(r = 0.7 * R + mik + 2, h = 10 * supportBaseHeight);\n\n\t\t}\n\n\t\ttranslate([0, 0, 17 - 3]) box(24.5, 13, 17, 3, \"servo\");\n\t}\n}\n\/\/-------------------------\n\nmodule supportSection() {\n\tintersection() {\n\t\tdifference() {\n\t\t\tsphere(R);\n\t\t\tcube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\n\t\t}\n\t\ttranslate([R - supportX \/ 2, 0, 0]) cube([supportX, supportY, 10], center = true);\n\t}\n}\n\/\/-------------------------\n\nmodule tiltSupport()\n\/\/This creates the supporting pillar for the camera shell\n {\n\tunion(){\ndifference() {\n\t\tsphere(R);\n\t\tcube([gimballWidth, 2 * gimballWidth, 2 * gimballWidth], center = true);\n\t\ttranslate([-gimballWidth,0,0])cube([2 * gimballWidth,2 * gimballWidth,2 * gimballWidth], center=true);\n\n\t}\n\n\thull() {\n\t\ttranslate([0, 0, -5]) supportSection();\n\t\ttranslate([0, 0, -supportZ]) supportSection();\n\t}}\n\n}\n\n\nmodule servoTiltSupport(xPos) {\n\t\/\/Need to center the servo shaft, the seconf figure is the distance form border\n\tsupportPosition = xPos;\n\teccentricity = 22.2 \/ 2 - 5;\n\tservoBodySupport = 20;\n\t\/\/Need to adjust the clearance to account for the Xpos\n\tservoClerance = 31 - 16 - servoHornThickness;\n\tsupportCurvature = 30;\n\n\trotate([-0, 0, 0]) difference() {\n\n\t\tunion() {\n\n\t\t\tdifference() {\n\t\t\t\ttranslate([-shellThickness \/ 2 + supportPosition, 0, 15]) {\n\t\t\t\t\tcube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\t\t\t\t}\n\t\t\t\tdifference() {\n\t\t\t\t\ttranslate([-shellThickness \/ 2 + supportPosition, 0, 15]) cube([shellThickness, 20, 2 * RatX(gimballWidth \/ 2)], center = true);\n\n\n\t\t\t\t\t\/\/The size of the sphere governs where the servo support will be cut. Need to add tolerance if you wnat to print as one piece with the shell.\n\t\t\t\t\tsphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttranslate([-servoBodySupport \/ 2 + supportPosition, 0, eccentricity]) {\n\t\t\t\t\/\/This is the servo box\n\t\t\t\tdifference() {\n\t\t\t\t\tcube([servoBodySupport, 12 + 1 + shellThickness, 22.2 + 1 + shellThickness], center = true);\n\t\t\t\t\tcube([servoBodySupport, 12 + 1, 22.2 + 1], center = true);\n\n\t\t\t\t\t\/\/Servo cable slot\n\t\t\t\t\ttranslate([0, 0, -2 * eccentricity]) cube([100, 3, 3], center = true);\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\/\/This is the slot in the servo arm\n\t\ttranslate([servoClerance + 10, 0, eccentricity]) {\n\n\t\t\tcube([20+1, 12, 32.2+1], center = true);\n\t\t\ttranslate([-31 \/ 2, 0, 0]) cube([31+1, 12, 22.2+1], center = true);\n\n\t\t}\n\t}\n\n\ntranslate([0, 0, 0])\n\t\t\tdifference() {\n\t\ttranslate([3, 0,+ RatX(xPos)-10])\n\t\tdifference() {\n\t\t\tcube([20, 20, 20], center = true);\n\t\t\ttranslate([-supportCurvature, 0, -supportCurvature]) sphere(r = supportCurvature + 20);\n\t\t}\n\n\t\tdifference() {\n\t\t\tsphere(RatX(gimballWidth \/ 2) + 10 * shellThickness + tolerance);\n\n\t\t\tsphere(RatX(gimballWidth \/ 2) + shellThickness + tolerance);\n\t\t}\n\t}\n\n}\n\/\/-------------------------\nmodule cameraSupport() {\n\tdifference() {\n\t\tdifference() {\n\t\t\tsphere(R);\n\t\t\tsphere(R - shellThickness);\n\t\t}\n\n\t\ttranslate([R + gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n\t\ttranslate([-R - gimballWidth \/ 2, 0, 0]) cube([2 * R, 2 * R, 2 * R], center = true);\n\t\t\/\/Creates camera support\n\t\ttranslate([0, R - 7, 0]) cube([PIcameraX + tolerance, 3, PIcameraY + tolerance], center = true);\n\t\ttranslate([0, R - 7, 0]) cube([2, 3, PIcameraY], center = true);\n\t\t\/\/Slot for camera wires\n\t\ttranslate([0, R - 8, -PIcameraY \/ 2 - 2]) cube([PIcameraX - 5, 3, 3], center = true);\n\n\n\t\t\/\/Hole for the camera\n\t\ttranslate([0, R, 0]) rotate([90, 0, 0]) cube([PIcameraDiam + tolerance, 10, PIcameraDiam + tolerance], center = true);\n\t}\n\n\t\/\/Need to hardwire the servo dimensions\n\n\t{\n\t\tservoTiltSupport(gimballWidth \/ 2);\n\n\n\t}\n\t\/\/pivot mechanism\n\ttranslate([-gimballWidth \/ 2, 0, 0]) {\n\t\tdifference() {\n\t\t\trotate([0, 90, 0]) cylinder(r = panSupport, h = shellThickness);\n\t\t\tgimballPivot(1);\n\t\t\trotate([0, 90, 0]) cylinder(r = gimballPivotR - shellThickness, h = shellThickness);\n\n\t\t}\n\t\tgimballPivot(1);\n\t}\n}\n\/\/-------------------------\n\nmodule servoHorn(type) {\n\tcube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n\tif (type == \"cross\") rotate([90, 0, 0]) cube([servoHornThickness, servoHornWidth, servoHornLenght], center = true);\n}\n\/\/-------------------------\n\nmodule gimballPivot(tolerance) {\n\trotate([0, 90, 0])\n\tdifference() {\n\t\tcylinder(r = gimballPivotR - tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n\t\tcylinder(r = gimballPivotR - 3 + tolerance \/ 2, h = gimballPivotR \/ 2, center = true);\n\t}\n}\n\/\/-------------------------\n\nmodule support() {\n scaleFactor = (R + tolerance)\/R;\n\t\t\t\n difference() {\n tiltSupport();\n\n translate([gimballWidth \/ 2 + servoHornThickness \/ 2, 0, 0]) rotate([45, 0, 0]) servoHorn(\"line\");\n SUB_servocableDuct();\n }\n\n\t\/\/Need to cut holes in the base for servo and camera cables and the screws\n\ttranslate([0,0,-supportBaseHeight\/2])\n\tdifference(){\n\t\t\n\t\t{\n\t\t\tcolor(\"blue\",0.5)base(true);\n\t\t\tSUB_cameracableDuct();\n\t\t\tSUB_servocableDuct();\n\t\t\ttranslate([0,0,+supportBaseHeight\/2])mirror([1, 0, 0])tiltSupport();\n\t\t\tSUB_mountedPillarScrewHoles();\n\t\t}\n\n\t}\n}\n\nmodule mountedPillar(){\n \/\/Pillar for camera. This one needs to be mounted separately\n\tdifference() {\n mirror([1, 0, 0]) tiltSupport();\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(0);\n translate([-gimballWidth \/ 2, 0, 0]) gimballPivot(3); {\n SUB_cameracableDuct();\n\t\tSUB_mountedPillarScrewHoles();\n }\n\n }\n}\n\nmodule SUB_screw(tolerance)\n{\n\tcylinder(r= screwDiam\/2+tolerance, h = screwLenght);\n\ttranslate([0,0,-3])cylinder(r= 2*screwDiam\/2+screwTolerance, h = 3);\n}\n\nmodule SUB_mountedPillarScrewHoles()\n{\n\tcolor(\"blue\",0.5)translate([-R+supportX\/2+2,0,-supportZ-screwLenght\/2])\n\t{\n\ttranslate([0, 0.5 * panSupport,0])SUB_screw(-screwTolerance);\n\tmirror([0,1,0])translate([0, 0.5 * panSupport,0])SUB_screw(-screwTolerance);\n\t}\t\n}\n\nmodule SUB_servocableDuct() {\n \/\/Duct for servo cable\n translate([+gimballWidth \/ 2 + supportX \/ 4 + 2, -supportX\/3, -3]) {\n translate([0, 0, -supportZ + supportX]) cylinder(r = supportX \/ 4, h = supportZ + supportX \/ 2, center = true);\n translate([-supportX, 0, 0]) rotate([0, 120, 0]) cylinder(r = supportX \/ 4, h = supportX, center = false);\n translate([0, 0, -supportZ - supportX \/ 3]) rotate([0, 90, 170]) cylinder(r = supportX \/ 4, h = 0.8 * R, center = false);\n }\n\n}\n\nmodule SUB_cameracableDuct()\n {\n \/\/Duct for camera connetion\n translate([-gimballWidth \/ 2 - 0.5 * supportX, 0, 0]) rotate([0, 0, 90]) {\n translate([0, 0, 0]) rotate([90, 0, 0]) cylinder(r = 26 \/ 2, h = 0.6 * supportX);\n translate([0, 0, -supportZ \/ 2]) cube([20, 3, supportZ + 1.1 * supportBaseHeight], center = true);\n translate([0, -R * 0.5 + 13, -supportZ - supportBaseHeight]) rotate([90, 0, 0]) cube([20, 5, R * 0.5], center = true);\n\n }\n}\n\/\/---------------------------\n\n\n\n\n\nmodule connectionSocket ()\n{\n\ncylinder(r=3, h=5);\ntranslate([-9,-3\/2,0])cube([10,3,5]);\n\n}\n\nmodule mhole ()\n\t{\n\tcylinder (r=3\/2-0.2, h=2*Piheight+8, $fs=0.1);\n\t}\n\n\n\nmodule case(){\ntranslate([0, 0, -boxHeight \/ 2 - supportZ - 2 * supportBaseHeight]) {\n\tdifference(){\n\tminkowski()\n\t{\n\t\tbox(boxLength, boxDepth, boxHeight, shellThickness - mik, \"PI\");\n\t\t\/\/sphere(r = mik);\n\t\tcylinder(r=mik, h=2);\n\t}\ntranslate([R-10 , -Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([-R+10 , -Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([R-10 , Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([-R+10 , Piwidth \/ 2,-boxHeight \/ 2 - 5\/2 ])connectionSocket ();\ntranslate([0, 0,-boxHeight \/ 2 - 5\/2 ])cylinder(r=3,h=5);\n\n\n\ttranslate([-Pilength \/ 2, -Piwidth \/ 2, -boxHeight \/ 2 + 5 + shellThickness]) {\n\t\trpi();\t\t\n\t}\n}\ntranslate([-Pilength \/ 2, -Piwidth \/ 2, -boxHeight \/ 2 + 5 + shellThickness])\n{\n translate([25.5, 18, -(+5 + shellThickness)]) mhole();\n translate([length - 5, width - 12.5, -(+5 + shellThickness)]) mhole();\n\n }\n}\n}\n \n\n\/\/mountedPillar();\n\/\/mirror([1, 0, 0])tiltSupport();\n\/\/SUB_mountedPillarScrewHoles();\n\/\/servoTiltSupport(15);\n\/\/cameraSupport();\n\n\/\/translate([-10, 0, 0])\n\/\/support();\ntopCoverHeight = 15;\ndifference()\n{\n{\ntranslate([0, 0, -supportZ-supportBaseHeight-topCoverHeight\/2])\tcube([boxLenght+mik,boxDepth,topCoverHeight], center=true);\n\n}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"976f90ba440aeaa5fb374511c790ab443e4d4dbe","subject":"PrinterBotZStop.scad: create multiple to explore interior hole adjustments","message":"PrinterBotZStop.scad: create multiple to explore interior hole adjustments\n","repos":"tschutter\/printrbot","old_file":"things\/PrinterBotZStop.scad","new_file":"things\/PrinterBotZStop.scad","new_contents":"\/\/ Various Z stop parts.\n\nfor (i = [0:5]) {\n translate([i * 25, 0, 0]) {\n BottomNutCapture(19, 14, 8, 13.2, 9 + i * 0.2, 3, 2 + i * 0.2);\n }\n}\n\nmodule BottomNutCapture(width, length, height, slotWidth, nutDiameter, nutHeight, screwDiameter) {\n \/\/ width = width in mm\n \/\/ length = length in mm\n \/\/ height = height in mm\n\n difference() {\n \/\/ body\n cube([width, length, height], center=true);\n\n \/\/ slot\n translate([0, -1, 10]) {\n cube([slotWidth, length + 3, 20], center=true);\n }\n\n \/\/ nut\n translate([0, 0, -nutHeight]) {\n cylinder(h = nutHeight + 1, d = nutDiameter, $fn=6, center=false);\n }\n\n \/\/ screw hole\n cylinder(h = height + 2, d = screwDiameter, $fn=30, center=true);\n }\n}\n","old_contents":"\/\/ Various Z stop parts.\n\nBottomNutCapture(19, 14, 8, 13, 7, 3, 2);\n\nmodule BottomNutCapture(width, length, height, slotWidth, nutDiameter, nutHeight, screwDiameter) {\n \/\/ width = width in mm\n \/\/ length = length in mm\n \/\/ height = height in mm\n\n difference() {\n \/\/ body\n cube([width, length, height], center=true);\n\n \/\/ slot\n translate([0, -1, 10]) {\n cube([slotWidth, length + 3, 20], center=true);\n }\n\n \/\/ nut\n translate([0, 0, -nutHeight]) {\n cylinder(h = nutHeight + 1, d = nutDiameter, $fn=6, center=false);\n }\n\n \/\/ screw hole\n cylinder(h = height + 2, d = screwDiameter, $fn=30, center=true);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"2ca3782bbc5c3a32d1ada3df9d894ee672de5c1b","subject":"Adding shedshed.scad","message":"Adding shedshed.scad\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\n\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=1)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\nmodule shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\n{\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n \n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n for(support_windows = [0 : 1])\n {\n translate([space_to_window_w+(support_windows*window_w\/2),0,0]) verticalStruts(window_w\/2,space_to_window_h, braces = braces);\n }\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\n\nshedBase(shed_length, shed_width, number_x=4,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+5.5]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([0,0,base_timber+1+5.5]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=shed_front_height-610-610, window_w=1830, window_h=610, door_w=870, , door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shedshed.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e5947ea7867eb6e9e4821954bfde1c274b352662","subject":"cube size increased, to avoid small-model issues, when printing","message":"cube size increased, to avoid small-model issues, when printing\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/3d_cube.scad","new_file":"3d_cube\/3d_cube.scad","new_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([50, 30, 10]);\n","old_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([30, 20, 10]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4dfdb07117503ad8b37fbabf46e4cff90149c82f","subject":"A 3d test piece designed to be pulled apart to measure part strength","message":"A 3d test piece designed to be pulled apart to measure part strength\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"3dprinting\/openscad\/test-models\/pull-v1.scad","new_file":"3dprinting\/openscad\/test-models\/pull-v1.scad","new_contents":"\/\/ A strain test by pulling on each end\n\/\/ Author: Joseph M. Joy\n\/\/\nEPSILON = 0.001;\ntestDia = 6; \/\/ diameter of the thin, center cylinder\ntestHeight = 4; \/\/ height of thin cylinder\ncapDia = 12; \/\/ diameter of the thicker end-caps\ncapHeight = 8;\ntransitionHeight = 3; \/\/ Height of truncated transition cone from cap to test\n\npinHoleDia = 3; \/\/ diameter of hole in end-cap for pin\npinHoleCenterHeight = 3;\ncordDia = 3; \/\/ Nominal diameter of cord (actually it is slightly larger than cord)\n\n\n\/\/ The cord is attached to this end cap - looped over a pin inserted into\n\/\/ the pin hole. There is one one each side of the test piece.\nmodule endCap() {\n difference() {\n cylinder(d=capDia, capHeight);\n negativeCapSpace();\n }\n}\n\n\n\/\/ The composite holes for the pin and cord - designed to be\n\/\/ subtracted from the end cap solid.\nmodule negativeCapSpace() {\n pinLen = 2*capDia;\n cx = (cordDia + 0.6*pinHoleDia)\/2;\n ch = pinHoleCenterHeight + pinHoleDia\/2 + cordDia;\n union() {\n translate([0, pinLen\/2, pinHoleCenterHeight]) rotate([90, 0, 0]) \n cylinder(d=pinHoleDia, pinLen);\n translate([-cx, 0, -EPSILON]) cylinder(d=cordDia, ch);\n translate([cx, 0, -EPSILON]) cylinder(d=cordDia, ch);\n translate([-cx, -cordDia\/2, -EPSILON]) cube([2*cx, cordDia, ch]);\n }\n}\n\n\n\/\/ Truncated cone transition from end cap to the thinner central test cylinder.\nmodule transition() {\n cylinder(d1=capDia, d2=testDia, transitionHeight);\n}\n\n\n\/\/ The thin central cylinder - designed to be the piece that fails under\n\/\/ the test load\nmodule center() {\n cylinder(d=testDia, testHeight);\n}\n\n\n\/\/ The final test piece\nmodule pullTestPiece() {\n endCap();\n z1 = capHeight;\n translate([0,0,capHeight]) transition();\n z2 = z1 + transitionHeight;\n translate([0,0, capHeight+transitionHeight]) center();\n z3 = z2 + testHeight;\n translate([0,0,z3 + transitionHeight]) rotate([180,0,0]) transition();\n z4 = z3 + transitionHeight;\n translate([0,0,z4 + capHeight]) rotate([180,0,0]) endCap();\n}\n\n\n$fn = 100;\n\/\/endCap();\n\/\/transition();\n\/\/center();\npullTestPiece();\n\/\/negativeCapSpace();\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3dprinting\/openscad\/test-models\/pull-v1.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"95db6d664f18f5485002cb144b336a078cb95c1e","subject":"The whitepace was updated.","message":"The whitepace was updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/spur\/spurs-rotated\/spurs-rotated.scad.teporarily.banned.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/spur\/spurs-rotated\/spurs-rotated.scad.teporarily.banned.scad","new_contents":"\r\nuse <..\/..\/coin.scad>;\r\n\r\ncoin(innerIcon = \"Spur\",\r\n innerIconXyScale = 0.4,\r\n outerIcon = \"Spur\",\r\n outerIconCount = 10,\r\n outerIconXyScale = 0.125,\r\n radius = 55,\r\n height=5);\r\n","old_contents":"\r\nuse <..\/..\/coin.scad>;\r\n\r\ncoin(innerIcon = \"Spur\",\r\n\t innerIconXyScale = 0.4,\r\n\t outerIcon = \"Spur\",\r\n outerIconCount = 10,\r\n outerIconXyScale = 0.125,\r\n radius = 55,\r\n height=5);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b147d337fae2e4b19295f8c0274ddac1eda2ff89","subject":"The icon paramters were organized.","message":"The icon paramters were organized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/customizer\/name-tag-test.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/customizer\/name-tag-test.scad","new_contents":"\r\n\/* [Base] *\/\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness = 2; \/\/ [1 : 5]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth = 228;\t\/\/ [228:600]\r\n\r\n\/\/ This determines the height of the name tag.\r\nbaseHeight = 15; \/\/ [54:150]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Fun Enthusiast\";\r\nbottomTextFont = \"Arial\"; \/\/ \"Wingdings\";\r\nbottomTextOffsetX = 0; \/\/ [-315 : 315]\r\nbottomTextOffsetY = -15; \/\/ [-315 : 315]\r\nbottomTextSize = 12; \/\/ [0 : 40]\r\n\r\n\/* [Chain Loop]*\/\r\nchainLoop = true;\r\nchainLoopLengthZ = 6;\r\nchainLoopType = \"square\"; \/\/ [rounded, square]\r\nchainLoopPosition = \"bottom\"; \/\/ [bottom, top]\r\n\r\n\/* [General] *\/\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/\/ This is the x off set of the icons\r\nxIconOffset = -100; \/\/ [10:200]\r\n\r\n\/\/ This is the y off set of the icons\r\nyIconOffset = 3; \/\/ [1:200]\r\n\r\n\/* [Left Icon] *\/\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nleftIconType = \"Moon\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.99; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 2.5; \/\/ [0.1: 0.1 :5]\r\n\r\n\/* [Right Icon] *\/\r\nrightIconHeight = 4.0; \/\/ [0.1: 0.1 :5]\r\n\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nrightIconType = \"Sun\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\nrightIconXyScale = 1.3; \/\/ [0.1 : 0.05 : 5]\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Firstnesto Lastquez\";\r\ntopTextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\ntopTextFont = \"Bauhaus 93\";\r\ntopTextSize = 15; \/\/ [0 : 40]\r\n\r\n\/* [Hidden] *\/\r\n\r\nuse <..\/name-tag.scad>\r\n\r\nnametag(baseColor = baseColor,\r\n baseThickness = baseThickness,\r\n borderColor = borderColor,\r\n chainLoop = chainLoop,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\tchainLoopType = chainLoopType,\r\n iconColor = iconColor,\r\n letterThickness = letterThickness,\r\n roundedCorners = true,\r\n topText = topText,\r\n\t\ttopTextOffsetY = 6,\r\n topTextSize = topTextSize,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n\t\tbottomTextSize = bottomTextSize,\r\n\t\tleftIconXyScale = leftIconXyScale,\r\n leftIconType = leftIconType,\r\n leftIconHeight = leftIconHeight,\r\n rightIconHeight = rightIconHeight,\r\n\t\trightIconXyScale = rightIconXyScale,\r\n rightIconType = rightIconType,\r\n xIconOffset = xIconOffset,\r\n yIconOffset = yIconOffset,\r\n baseWidth = baseWidth,\r\n showBorder = showBorder);\r\n","old_contents":"\r\n\/* [Base] *\/\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness = 2; \/\/ [1 : 5]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth = 228;\t\/\/ [228:600]\r\n\r\n\/\/ This determines the height of the name tag.\r\nbaseHeight = 15; \/\/ [54:150]\r\n\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\n\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Fun Enthusiast\";\r\nbottomTextFont = \"Arial\"; \/\/ \"Wingdings\";\r\nbottomTextOffsetX = 0; \/\/ [-315 : 315]\r\nbottomTextOffsetY = -15; \/\/ [-315 : 315]\r\nbottomTextSize = 12; \/\/ [0 : 40]\r\n\r\n\/* [Chain Loop]*\/\r\nchainLoop = true;\r\nchainLoopLengthZ = 6;\r\nchainLoopType = \"square\"; \/\/ [rounded, square]\r\nchainLoopPosition = \"bottom\"; \/\/ [bottom, top]\r\n\r\n\/* [General] *\/\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nleftIconType = \"Moon\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\nrightIconType = \"Sun\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\n\/\/ This is the x off set of the icons\r\nxIconOffset = -100; \/\/ [10:200]\r\n\r\n\/\/ This is the y off set of the icons\r\nyIconOffset = 3; \/\/ [1:200]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.99; \/\/ [0.1 : 0.05 : 5]\r\n\r\nrightIconXyScale = 1.3; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 2.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 4.0; \/\/ [0.1: 0.1 :5]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Firstnesto Lastquez\";\r\ntopTextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\ntopTextFont = \"Bauhaus 93\";\r\ntopTextSize = 15; \/\/ [0 : 40]\r\n\r\n\/* [Hidden] *\/\r\n\r\nuse <..\/name-tag.scad>\r\n\r\nnametag(baseColor = baseColor,\r\n baseThickness = baseThickness,\r\n borderColor = borderColor,\r\n chainLoop = chainLoop,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\tchainLoopType = chainLoopType,\r\n iconColor = iconColor,\r\n letterThickness = letterThickness,\r\n roundedCorners = true,\r\n topText = topText,\r\n\t\ttopTextOffsetY = 6,\r\n topTextSize = topTextSize,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n\t\tbottomTextSize = bottomTextSize,\r\n\t\tleftIconXyScale = leftIconXyScale,\r\n leftIconType = leftIconType,\r\n leftIconHeight = leftIconHeight,\r\n rightIconHeight = rightIconHeight,\r\n\t\trightIconXyScale = rightIconXyScale,\r\n rightIconType = rightIconType,\r\n xIconOffset = xIconOffset,\r\n yIconOffset = yIconOffset,\r\n baseWidth = baseWidth,\r\n showBorder = showBorder);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7a3ffc59e4f5ef0f6abd78db2f9106dc53c7c599","subject":"This is what is on http:\/\/www.thingiverse.com\/thing:1143325 at commit time.","message":"This is what is on http:\/\/www.thingiverse.com\/thing:1143325 at commit time.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad-CUTOMIZER-2017-03-11.scad","new_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad-CUTOMIZER-2017-03-11.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Mark\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad-CUTOMIZER-2017-03-11.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"98f9ddc3819fba25d0955738c3d5df09fe1b3fe2","subject":"Overhaul, added an offset option","message":"Overhaul, added an offset option\n\nThis is a major overhaul. Now there are two options (A and B). A is the original; the new one (B) has the bolt offset and a hole for a retaining screw. No glue required. Option A or B can be chosen via the customizer.\nAlso fixed customizer parameter comments and hid non-customizable variables.\n","repos":"josephmjoy\/funstuff","old_file":"models\/hex_bolt_anchor\/hex_bolt_anchor.scad","new_file":"models\/hex_bolt_anchor\/hex_bolt_anchor.scad","new_contents":"\/\/ Hex Bolt Anchor\n\/\/ Anchor to prevent a hex bolt (or nut) from\n\/\/ rotating.\n\/\/ There are two styles:\n\/\/ style A: Concentric, with washer (the original). Must\n\/\/ be glued.\n\/\/ style B: Offset, without washer, and with hole for \n\/\/ retraining screw. The offset prevents\n\/\/ the bolt from rotating.\n\/\/\n\/\/ 3\/4\" - 18 nut dimensions:\n\/\/ nut height: 8.45mm \/\/ this can vary with nut\n\/\/ flat diameter: 14.21mm\n\/\/ vertex diameter: 16.23mm (measured)\n\/\/ vertex diameter: 16.41mm (calculated from flat diameter)\n\/\/ Note that the nut has slightly rounded corners.\n\/\/ washer thickness: 1.65mm\n\/\/ washer diameter: 20.92mm\n\n\/\/ ------- START OF PARAMETERS ---------------------\n\/\/ Horizontal clearances (mm) so parts drop in easily\nclearance = 0.5;\n\n\/\/ Exact height of nut\nnut_height = 8.45;\n\n\/\/ Vertex-to-vertex dia of nut\nhex_dia = 16.41;\n\n\/\/ Exact dia of washer (style A)\nwasher_dia = 20.92;\n\n\/\/ Exact height of washer\nwasher_height = 1.89;\n\n\/\/ Retaining screw shaft dia (style B only)\nscrew_dia = 3.53; \/\/ #6\n\/\/ Above is for a flat head screw with a\n\/\/ 45 degree angle for the head conic section.\n\n\/\/ Diameter of screw head (style B only)\nscrew_head_dia = 7;\n\n\/\/ Overall diameter\nitem_dia = 25.4; \/\/ 1 inch\n\n\/\/ Extra height above nut and screw\nextra_height = 0.2;\n\/\/ Above helps ensure that nothing sticks out\n\/\/ above the item - so the item can be made\n\/\/ flush with the surrounding wood.\n\n\/\/ Item style (A is glued, B is screwed)\nitem_style = \"A\"; \/\/ [A, B]\n\n\/\/ ------- END OF PARAMETERS --------------------\nmodule parameter_end(){} \/\/ End of customizer parameters\n\n_EPS = 0.1; \/\/ for CSG\n\n\/\/ Min arc length (for cylinders and spheres)\n\/\/ This is perfectly fine for 3D printed circles of dia 1\".\n$fs = 1; \ndo_A = (item_style == \"A\");\n\n\/\/ Overall height\nitem_height = nut_height + extra_height + (do_A ? washer_height: 0);\n\nmodule hex_hole() {\n dia = hex_dia + clearance;\n cylinder(h=item_height + _EPS, r=dia\/2, $fn=6);\n}\n\nmodule washer_hole() {\n dia = washer_dia + clearance;\n cylinder(washer_height + _EPS, r=dia\/2);\n}\n\nmodule screw_hole() {\n dia1 = screw_dia + clearance;\n dia2 = screw_head_dia + 2*extra_height;\n rdiff = (dia2 - dia1)\/2 + clearance;\n cylinder(h=item_height + _EPS, r=dia1\/2);\n translate([0, 0, item_height-rdiff+_EPS]) {\n cylinder(h=rdiff, r2=dia2\/2, r1=dia1\/2);\n}\n}\n\n\/\/ The unit without any holes\nmodule stock() {\n dia = item_dia - clearance;\n cylinder(h=item_height, r=dia\/2);\n}\n\n\nmodule cutout_A() { \n union() {\n translate([0, 0, -_EPS]) hex_hole();\n translate([0, 0, item_height - washer_height])\n washer_hole();\n } \n}\n\n\nmodule cutout_B() { \n union() {\n \/\/ The constants below were obtained by\n \/\/ trial-and-error so that the screw hole\n \/\/ (with conical section for head) fits\n \/\/ within the available space.\n screw_offset = -screw_head_dia*1.24;\n hex_offset = hex_dia*0.14;\n translate([0, hex_offset, -_EPS\/2]) hex_hole();\n translate([0, screw_offset, -_EPS\/2])screw_hole();\n } \n}\n\n\nmodule style_A() {\n difference() {\n stock();\n cutout_A();\n }\n}\n\nmodule style_B() {\n difference() {\n stock();\n cutout_B();\n }\n}\n\nif (do_A) {\n style_A();\n} else {\n style_B();\n}","old_contents":"\/\/ Hex Bolt Anchor\n\/\/ Anchor to prevent a hex bolt (or nut) from\n\/\/ rotating.\n\/\/\n$fs=1;\n\n\/\/ 3\/4\" - 24 nut dimensions:\n\/\/ nut height: 8.27mm\n\/\/ flat diameter: 14.21mm\n\/\/ vertex diameter: 16.23mm (measured)\n\/\/ vertex diameter: 16.41mm (calculated from flat diameter)\n\/\/ Note that the nut has slightly rounded corners.\n\/\/ washer thickness: 1.65mm\n\/\/ washer diameter: 20.92mm\n\/\/ Model dimensions below add\nclearance = 0.5; \/\/ mm\nnut_height = 8.27;\nhex_dia = 16.41+clearance; \/\/ Vertex-to-vertex\nwasher_dia = 20.92+clearance;\nwasher_height = 1.89; \/\/ no vertical clearance - so washer is flush\nbase_dia = 25.5-clearance; \/\/ 1 inch\nbase_height = nut_height + washer_height;\n\neps=0.1; \/\/ for CSG\n\nmodule hex(dia, h) {\n cylinder(h=h, r=dia\/2, $fn=6);\n}\n\nmodule washer(dia, h) {\n cylinder(h=h, r=dia\/2);\n}\n\n\nmodule base() {\n cylinder(h=base_height, r=base_dia\/2);\n}\n\n\nmodule cutout() { \n union() {\n translate([0, 0, -eps]) hex(hex_dia, base_height+eps);\n translate([0, 0, base_height-washer_height])\n washer(washer_dia, washer_height+eps);\n } \n}\n\n\nmodule draw0() {\ndifference() {\n base();\n cutout();\n}\n}\n\n\n\ndraw0();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"649bc9eff5a71144510271b44ca00a502b8f5367","subject":"Addign sheshedshed","message":"Addign sheshedshed\n","repos":"bmsleight\/shedshed","old_file":"shedshedshed.scad","new_file":"shedshedshed.scad","new_contents":"shed_length = 5184;\nshed_width = 1981;\nshed_front_height = 2350;\nshed_back_height = 2135;\n\nwindow_w=1830;\nwindow_h=610; \ndoor_w=870; \ndoor_h=2030;\n\nspace_to_window_w=window_w\/2;\nspace_to_window_h=door_h-window_h;\nspace_to_door_w=window_w + 2*space_to_window_w;\n\n\n\nbase_timber_w = 47;\nbase_timber_h = 75;\ntimber_construct_w = 38;\ntimber_construct_h = 63;\ntimber_length_unit=2400;\nbase_sheet_t = 18;\nsheet_width = 1220;\nsheet_length = 2440;\n\nwrap_t = 1;\n\n\nopp = shed_front_height-shed_back_height;\nadj = shed_width -timber_construct_h;\nhyp = sqrt(opp*opp+adj*adj);\ntheta = atan(opp\/adj);\nthin_opp = tan(theta) * timber_construct_h;\n\n\nmodule cubeI(size,comment=\"\/\/\", center=false)\n{\n if (comment != \"\/\/\")\n echo(comment);\n \/\/ Cube - but will echo dimensions in order of size\n if( (size[0]>size[1]) && (size[1]>=size[2]) )\n echo( size[0], size[1], size[2]);\n if( (size[0]>size[2]) && (size[2]>size[1]) )\n echo( size[0], size[2], size[1]);\n \n if( (size[1]>size[0]) && (size[0]>=size[2]) )\n echo( size[1], size[0], size[2]);\n if( (size[1]>size[2]) && (size[2]>size[0]) )\n echo( size[1], size[2], size[0]);\n \n if( (size[2]>size[0]) && (size[0]>=size[1]) )\n echo( size[2], size[0], size[1]);\n if( (size[2]>size[1]) && (size[1]>size[0]) )\n echo( size[2], size[1], size[0]);\n\n cube(size, center=center);\n}\n\nmodule houseWrapLayer(width,length, overlap=100)\n{\n echo(\"House Wrap\",width+overlap,length+overlap);\n color(\"Black\",1)\n {\n cube([width, length, wrap_t]);\n cube([width, wrap_t, overlap]);\n translate([0,length-wrap_t,0]) cube([width, wrap_t, overlap]);\n cube([wrap_t, length, overlap]);\n translate([width-wrap_t,0,0]) cube([wrap_t, length, overlap]);\n }\n}\n\nmodule OSB(size,center=false)\n{\n echo(\"OSB\");\n cubeI(size,center=center);\n}\n\n\nmodule floorPanel(width,length)\n{\n\/*\n echo(\"Timber\");\n \/\/Timber supporting base along left side\n cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base along right side\n translate([width-base_timber_w,0,0]) cubeI([base_timber_w, length, base_timber_h]);\n \/\/Timber supporting base Middle of I\n translate([base_timber_w,(length-base_timber_h)\/2,base_timber_h-base_timber_w]) cubeI([width-base_timber_w*2, base_timber_h, base_timber_w]);\n*\/\n \/\/DuPont Tyvek Housewrap - 100m 1.4m\n translate([0,0,base_timber_h]) houseWrapLayer(width,length,overlap=25);\n\n \/\/OSB Board - although the board is not cut by 1 mm (wrap_t) in each\n \/\/ direction for drawing purposes it is shaved\n translate([wrap_t,wrap_t,base_timber_h+wrap_t]) OSB([width-wrap_t*2,length-wrap_t*2,base_sheet_t]); \n}\n\nmodule floorBeams(width = shed_width, length = shed_length, overlap = 150, cross_beams=5)\n{\n \/\/ from one end along the front\n translate([0,0,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, 0, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, base_timber_w, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Again at the back\n \/\/ from one end along the front\n translate([0,width-base_timber_w,0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n \/\/ from oother end along the front\n translate([length-timber_length_unit, width-base_timber_w, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit-overlap, width-base_timber_w*2, 0]) cubeI([length-2*(timber_length_unit-overlap), base_timber_w, base_timber_h]);\n\n \/\/Each end of shed\n translate([0, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n translate([length-base_timber_h, base_timber_w, base_timber_h-base_timber_w]) cubeI([base_timber_h, width-base_timber_w*2, base_timber_w]);\n\n \/\/ Middle suport\n translate([base_timber_h, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([length-base_timber_h-timber_length_unit, (width-base_timber_w)\/2, 0]) cubeI([timber_length_unit, base_timber_w, base_timber_h]);\n translate([timber_length_unit+base_timber_h-overlap, (width-base_timber_w)\/2+base_timber_w, 0]) cubeI([length-2*timber_length_unit+overlap, base_timber_w, base_timber_h]);\n\n \/\/ Middle Cross beams0\n translate([(length-base_timber_w)\/2-base_timber_h\/2, base_timber_w*2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2, base_timber_w]);\n translate([(length-base_timber_w)\/2+base_timber_h\/2, base_timber_w*3+(width-3*base_timber_w)\/2, base_timber_h-base_timber_w]) cubeI([base_timber_h, (width-3*base_timber_w)\/2-2*base_timber_w, base_timber_w]);\n \n}\n\n\nmodule floorPanels(width = shed_width, length = shed_length)\n{\n sheet_width_inc_wrap = sheet_width + 2*wrap_t;\n num_width_panels = round(-0.5+length\/sheet_width_inc_wrap);\n for(base_x = [0 : num_width_panels-1])\n {\n translate([base_x*sheet_width_inc_wrap, 0, 0]) floorPanel(sheet_width_inc_wrap,width);\n }\n full_panels_width = sheet_width_inc_wrap*num_width_panels;\n translate([full_panels_width, 0, 0]) floorPanel(length-full_panels_width,width);\n}\n\nmodule verticalStruts(width, height, beams=0, extra_struct=0)\n{\n cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,height-timber_construct_w]) cubeI([width,timber_construct_h,timber_construct_w]);\n translate([0,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n translate([width-timber_construct_w,0,timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-timber_construct_w*2]);\n\n if(beams>0 && extra_struct==0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing = middle_height\/(beams+1);\n for(loop=[1:beams])\n {\n translate([timber_construct_w, 0, beam_spacing*loop]) cubeI([width-timber_construct_w*2,timber_construct_h,timber_construct_w]);\n }\n }\n if(beams==0 && extra_struct>0)\n {\n middle_width = width-timber_construct_w*1;\n beam_spacing = middle_width\/(extra_struct+1);\n for(loop=[1:extra_struct])\n {\n translate([beam_spacing*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n }\n }\n if(beams>0 && extra_struct>0)\n {\n middle_height = height-timber_construct_w*2;\n beam_spacing_h = middle_height\/(beams+1);\n middle_width = width-timber_construct_w*1;\n beam_spacing_w = middle_width\/(extra_struct+1);\n\n \/\/ Wee need to off set, so we divide by mod 2\n \/\/ move the all the beams down by timber_construct_w\n \/\/ but add loop mod 2 * timber_construct_w \n \/\/ (hence odd move up, even remain down\n \n for(loop=[0:extra_struct])\n {\n if (loop>0)\n translate([beam_spacing_w*loop, 0, timber_construct_w]) cubeI([timber_construct_w,timber_construct_h,height-2*timber_construct_w]);\n for(loop_b=[1:beams])\n {\n offset = - timber_construct_w + (timber_construct_w * (loop%2));\n translate([timber_construct_w+beam_spacing_w*loop, 0, beam_spacing_h*loop_b+offset]) cubeI([beam_spacing_w-timber_construct_w,timber_construct_h,timber_construct_w]);\n }\n } \n }\n}\n\nmodule backStructs(width = shed_length, height = shed_back_height, structs_sets=3, beams=2, extra_struct=1)\n{\n translate([wrap_t,shed_width-timber_construct_h-wrap_t,base_timber_h+wrap_t+base_sheet_t]) \n {\n struct_set_w = (width-wrap_t*2)\/structs_sets;\n for(structs=[0:structs_sets-1])\n {\n translate([structs*struct_set_w,0,0]) verticalStruts(struct_set_w, height, beams=beams, extra_struct=extra_struct);\n }\n }\n \n}\n\nmodule sideStructs(width = shed_width, height = shed_back_height, beams=2, extra_struct=2)\n{\n echo(\"SideStructs\");\n translate([timber_construct_h+wrap_t,timber_construct_h,base_timber_h+wrap_t+base_sheet_t])\n {\n rotate([0,0,90]) verticalStruts(width-timber_construct_h*2, height, beams=beams, extra_struct=extra_struct);\n } \n}\n\n\nmodule leftSideStructs()\n{\n sideStructs();\n}\n\n\nmodule rightSideStructs()\n{\n translate([shed_length-timber_construct_h-wrap_t*2,0,0]) sideStructs();\n}\n\n\nmodule frontStructs()\n{\n translate([wrap_t,-wrap_t,base_timber_h+wrap_t+base_sheet_t+1]) \n {\n verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=0);\n translate([space_to_window_w,0,0]) verticalStruts(window_w, space_to_window_h, beams=1, extra_struct=1);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w, door_h, beams=2, extra_struct=1);\n translate([space_to_door_w+door_w,0,0]) verticalStruts(shed_length-(space_to_door_w+door_w), door_h, beams=2, extra_struct=0);\n \/\/ top part, which is longer than a standard timber_length_unit \n gap = (space_to_door_w - timber_length_unit)\/2;\n remainder = shed_length - timber_length_unit - gap;\n translate([0,0,door_h]) verticalStruts(gap, shed_front_height-door_h, beams=0, extra_struct=0);\n translate([gap,0,door_h]) verticalStruts(timber_length_unit, shed_front_height-door_h, beams=0, extra_struct=2);\n translate([timber_length_unit + gap,0,door_h]) verticalStruts(remainder, shed_front_height-door_h, beams=0, extra_struct=2);\n }\n}\n\nmodule roof()\n{\n \/\/ hyp\n inner_width = hyp+timber_construct_h;\n flat_offset = (sheet_length - inner_width)\/2;\n\n translate([-flat_offset,-wrap_t,shed_front_height+ base_timber_h+wrap_t+base_sheet_t +1 +thin_opp ]) rotate([-theta,0,0]) frameSheet( sheet_front_offset=-flat_offset*1.5, front_offset=0, back_offset=flat_offset*2, left_offset=flat_offset);\n}\n\nmodule frameSheet(left_offset=0, right_offset=0, front_offset=0, back_offset=0, sheet_left_offset=0, sheet_right_offset=0, sheet_front_offset=0, sheet_back_offset=0, sw=sheet_width, sl = sheet_length)\n{\n translate([left_offset, front_offset, 0]) cubeI([sw-left_offset-right_offset, timber_construct_h, timber_construct_w]);\n translate([left_offset, sl - back_offset-timber_construct_h, 0]) cubeI([sw-left_offset-right_offset, timber_construct_h, timber_construct_w]);\n translate([left_offset, front_offset+timber_construct_h, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset-2*timber_construct_h, timber_construct_w]);\n translate([sw-right_offset-timber_construct_h, front_offset+timber_construct_h, 0]) cubeI([timber_construct_h, sl-front_offset-back_offset-2*timber_construct_h, timber_construct_w]);\n translate([sheet_left_offset, sheet_front_offset, timber_construct_w]) cubeI([sw-sheet_back_offset,sl-sheet_right_offset, base_sheet_t]);\n}\n\n\nfloorBeams();\n\nfloorPanels();\n\nbackStructs();\n\nleftSideStructs();\nrightSideStructs();\n\nfrontStructs();\nroof();","old_contents":"","returncode":1,"stderr":"error: pathspec 'shedshedshed.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"39944a9ab3a53a6b48760f93a1e2cc747ec7c409","subject":"Test 3d shapes to measure the strength of 3d printed parts.","message":"Test 3d shapes to measure the strength of 3d printed parts.\n\n6x10cyl.scad - simple cylinder, the latest version - goes into a part made of polycarb. A shearing force causes it to break.\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"3dprinting\/openscad\/test-models\/6x10cyl.scad","new_file":"3dprinting\/openscad\/test-models\/6x10cyl.scad","new_contents":"$fn=100;\ncylinder(d=6, 10);","old_contents":"","returncode":1,"stderr":"error: pathspec '3dprinting\/openscad\/test-models\/6x10cyl.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"27704156e63a46638b5cc8a9e5bc060751570e2f","subject":"extruder: use dict_replace_multiple where applicable","message":"extruder: use dict_replace_multiple where applicable\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"extruder-direct.scad","new_file":"extruder-direct.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = dict_replace_multiple(Nema17, \n [\n [NemaFrontAxleLength, 22*mm]\n ]);\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x-1,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 5*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 22*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x-1,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"90cb8ebbdf3c7adcbef542236f7cd3808e55f1de","subject":"support plane reorganization","message":"support plane reorganization\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"names=[\"John\", \"Jane\"];\n\n\nmodule rounded_surface_(size)\n{\n r=size[2]\/2;\n translate([0, 0, r])\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, 0])\n sphere(r=r, $fn=r*10); \/\/ TODO: r*20!\n}\n\nmodule rounded_half_surface_(size)\n{\n translate([0, 0, -size[2]\/2])\n difference()\n {\n rounded_surface_(size);\n translate(size[2]\/2*[0,0,-1])\n cube(size);\n }\n}\n\n\n\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(size)\n{\n hull()\n difference()\n {\n #for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(size)\n{\n translate([0, 0, size[1]\/2])\n rotate([90,0,0])\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(size)\n{\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n}\n\n\nmodule brush_holder()\n{\n translate([0, -23.25, 0])\n rotate([90, 0, 0])\n rounded_surface_([36-2*2, 29, 2]);\n translate(1\/2*[36, 50, 0]) \/\/ TODO: temporary\n {\n translate(-1\/2*[36,50, 0]) \/\/ TODO: to be removed\n rounded_half_surface_([36, 50, 5]);\n\n for(dx=[-1, +1])\n translate([dx*20\/2-1, -1, 2])\n holder([3,25,18]);\n }\n}\n\n\nbrush_holder();\n\n\n\/\/rounded_surface_([20,30,5]);\n\/\/rounded_half_surface_([20,30,5]);\n","old_contents":"names=[\"John\", \"Jane\"];\n\n\nmodule rounded_surface_(size)\n{\n r=size[2]\/2;\n translate([0, 0, r])\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, 0])\n sphere(r=r, $fn=30);\n}\n\nmodule rounded_half_surface_(size)\n{\n translate([0, 0, -size[2]\/2])\n difference()\n {\n rounded_surface_(size);\n translate(size[2]\/2*[0,0,-1])\n cube(size);\n }\n}\n\n\n\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(size)\n{\n hull()\n difference()\n {\n #for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(size)\n{\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n}\n\n\nmodule brush_holder()\n{\n wall([36,50,2]);\n plane([0,16.5,50\/2-2], [36-2*2,29,2]);\n for(dx=[-1, +1])\n translate([dx*20\/2-1, -1, 2])\n holder([3,25,18]);\n}\n\n\nbrush_holder();\n\n\n\/\/rounded_surface_([20,30,5]);\n\/\/rounded_half_surface_([20,30,5]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"edc831f27522114a08a2ab4ce4c1c050b2ed4106","subject":"higher side wall + printing just 1 element at a time","message":"higher side wall + printing just 1 element at a time\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"w=119;\ns=21;\nh=2.5;\n\n\nmodule wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\n\nmodule fence(width, height)\n{\n cube([width, 119, height-h]);\n translate([0,0,1])\n wedge(width=w, span=1, height=h);\n}\n\n\nmodule support()\n{\n translate([1,0,0])\n {\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n }\n\n \/\/ side walls\n for(i=[0, s+1])\n translate(i*[1,0,0])\n fence(width=1, height=h+2);\n}\n\nsupport(2.5);\n","old_contents":"w=119;\ns=21;\nh=2.5;\n\n\nmodule wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\n\nmodule fence(width, height)\n{\n cube([width, 119, height-h]);\n translate([0,0,1])\n wedge(width=w, span=1, height=h);\n}\n\n\nmodule support()\n{\n translate([1,0,0])\n {\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n }\n\n \/\/ side walls\n for(i=[0, s+1])\n translate(i*[1,0,0])\n fence(width=1, height=h+1);\n}\n\nfor(i=[0:2])\n translate(i*[25, 0, 0])\n support(2.5);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4d4c0143cb39c9b8dd0a839dc89849357065144e","subject":"y-rod-clamp: fix print orientation","message":"y-rod-clamp: fix print orientation\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-rod-clamps.scad","new_file":"y-rod-clamps.scad","new_contents":"use \ninclude \n\ninclude \n\nmodule part_y_rod_clamp()\n{\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_mount_thread, align=Z+X, orient=-Z);\n}\n","old_contents":"use \ninclude \n\ninclude \n\nmodule part_y_rod_clamp()\n{\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_mount_thread, align=Z+X, orient=-X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9a043b0e3d99373da323e2b3054298457e9582ec","subject":"Adding AssemblyJoint.scad","message":"Adding AssemblyJoint.scad\n","repos":"bmsleight\/shedshed","old_file":"AssemblyJoint.scad","new_file":"AssemblyJoint.scad","new_contents":"\ntimber_construct_w = 37;\ntimber_construct_h = 63;\nbase_sheet_t = 18;\nd_hole = 5;\n\n\nhyp = sqrt(((timber_construct_w\/2)*(timber_construct_w\/2))+((timber_construct_w\/2)*(timber_construct_w\/2)));\n$fn=60;\n\nmodule prism(l, w, h)\n{\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\n\n\ndifference()\n{\n union()\n {\n cube([timber_construct_w,d_hole,d_hole*3]);\n cube([d_hole,timber_construct_w,d_hole*3]);\n translate([d_hole,timber_construct_w\/2+d_hole,0]) rotate([90,-90,90]) prism(d_hole*3,timber_construct_w\/2,timber_construct_w\/2);\n }\n translate([timber_construct_w*3\/4, d_hole*2, d_hole*1.5]) rotate([90,0,0]) cylinder(h=5*d_hole, d=d_hole);\n translate([-d_hole*2, timber_construct_w*3\/4, d_hole*1.5]) rotate([0,90,0]) cylinder(h=5*d_hole, d=d_hole);\n\n translate([-2.5, 0, -d_hole*1.5]) rotate([30,0,0]) cube([timber_construct_w+2.5+2.5,d_hole,d_hole*3]);\n translate([0, -2.5, -d_hole*1.5]) rotate([0,-30,0]) cube([d_hole,timber_construct_w+2.5+2.5,d_hole*3]);\n\n translate([-2.5, d_hole, d_hole*4.25]) rotate([-30,180,180]) cube([timber_construct_w+2.5+2.5,d_hole,d_hole*3]);\n translate([d_hole, -2.5, d_hole*4.25]) rotate([180,-30,180]) cube([d_hole,timber_construct_w+2.5+2.5,d_hole*3]);\n \n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AssemblyJoint.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"4d08f24b96e21f3ca8a92ca791474b8490ea357c","subject":"adjust buttons diameter again","message":"adjust buttons diameter again\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 7 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f4c9cd43dccf312149f5f301d3528b2e40d5c66e","subject":"support element added","message":"support element added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"sink_pipe_support\/sink_pipe_support.scad","new_file":"sink_pipe_support\/sink_pipe_support.scad","new_contents":"use \n\nh=180;\nd=41+5;\nr=50;\n\nrotate([90, 0, 0])\n{\n \/\/ bottom part - just for visualization\n %rotate([0, 0, 90])\n holder();\n\n \/\/ main rod\n difference()\n {\n translate([-15, -15, 5+2])\n cube([30, 30, h-5-2]);\n translate([0, -60\/2, 35])\n rotate([0, 90, 90])\n cylinder(r=5+2, h=60);\n }\n\n \/\/ pipe holer's top part\n translate([0, 30\/2, d\/2+h])\n rotate([90, 0, 0])\n {\n difference()\n {\n cylinder(h=30, r=d\/2+5);\n cylinder(h=30, r=d\/2);\n translate([-30, 0, 0])\n cube([2*30, 30, 30]);\n }\n }\n}","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cb90055cc0b2029a047e1ea6a6815ccde261295d","subject":"put some useful small modules in an easier file to include","message":"put some useful small modules in an easier file to include\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/util.scad","new_file":"Drawings\/util.scad","new_contents":"\/\/ miscelaneous utilility modules\n\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) translate([0,0,-.03]) cylinder(h=22,r=holeRad,$fn=80);\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n\nmodule sphereSection(r,h,ar=1.5,off=-.3,fn=64) translate([0,0,h\/2]) intersection() {\n cube([2*r,2*r,h],center=true);\n translate([0,0,off*h]) scale([1,1,ar]) sphere(r,$fn=fn);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Drawings\/util.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1983e50ee59391d2ecbd247be36ab5e51814f19d","subject":"small holder added, that latches to just 1 corner ECD board","message":"small holder added, that latches to just 1 corner ECD board\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"electrical_cable_distributor\/holder\/ecd_holder_small.scad","new_file":"electrical_cable_distributor\/holder\/ecd_holder_small.scad","new_contents":"eps = 0.01;\nN = 2;\nM = 1;\n\nmodule ecd_holder()\n{\n difference()\n {\n translate([-8\/2, -9\/2, 0])\n {\n cube([8, 9, 5+1.5]);\n translate([8, 0, 0])\n cube([9, 9, 1.5]);\n }\n \/\/ screw hole\n translate([0, 0, -eps])\n cylinder(d=3.5, h=10, $fn=40);\n }\n}\n\nfor(iy=[0:M-1])\n for(ix=[0:N-1])\n translate([ix*20, iy*12, 0])\n ecd_holder();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'electrical_cable_distributor\/holder\/ecd_holder_small.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8c2febf96853ae74f67d659235c2455443c99ebf","subject":"fix: take care of the h parameter in buildVolume","message":"fix: take care of the h parameter in buildVolume\n","repos":"jsconan\/camelSCAD","old_file":"shape\/context\/build-box.scad","new_file":"shape\/context\/build-box.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Build box visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of the build plate.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBuildPlate(size, cell, l, w, cl, cw) =\n let(\n size = apply2D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w),\n cell = apply2D(uor(cell, DEFAULT_BUILD_PLATE_CELL), cl, cw),\n nb = [\n cell.x ? floor(size.x \/ cell.x) : 0,\n cell.y ? floor(size.y \/ cell.y) : 0\n ],\n count = [\n nb.x + 1,\n nb.y + 1\n ],\n offset = [\n cell.x ? -nb.x * cell.x \/ 2 : 0,\n cell.y ? -nb.y * cell.y \/ 2 : 0\n ]\n )\n [ size, cell, count, offset ]\n;\n\n\/**\n * Creates a build plate visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildPlate(size=DEFAULT_BUILD_PLATE_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, cl, cw, center=false) {\n size = sizeBuildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n plateSize = size[0];\n cellSize = size[1];\n cellCount = size[2];\n cellOffset = size[3];\n\n plateHeight = TESTBED_THICKNESS;\n lineWidth = .5;\n\n testbedExtrude(.2) {\n translate(center ? -plateSize \/ 2 : [0, 0]) {\n square(plateSize);\n }\n }\n testbedExtrude(.2) {\n translate(center ? [cellOffset.x, -plateSize.y \/ 2, 0] : ORIGIN_3D) {\n repeat(count=cellCount.x, intervalX=cellSize.x) {\n square([lineWidth, plateSize.y]);\n }\n }\n translate(center ? [-plateSize.x \/ 2, cellOffset.y, 0] : ORIGIN_3D) {\n repeat(count=cellCount.y, intervalY=cellSize.y) {\n square([plateSize.x, lineWidth]);\n }\n }\n }\n}\n\n\/**\n * Creates a build volume visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildVolume(size=DEFAULT_BUILD_VOLUME_SIZE, l, w, h, center=false) {\n testbedColor(.1) {\n size = apply3D(size, l, w, h);\n translate(center ? apply3D(-size \/ 2, z=0) : ORIGIN_3D) {\n cube(size);\n }\n }\n}\n\n\/**\n * Creates a build box visualization at the origin.\n * A build box contains visualizations for a build plate and a build volume.\n *\n * @param Number|Vector [size] - The size of the build volume.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildBox(size=DEFAULT_BUILD_VOLUME_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, h, cl, cw, center=false) {\n buildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw, center=center);\n buildVolume(size=size, l=l, w=w, h=h, center=center);\n\n children();\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Build box visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of the build plate.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBuildPlate(size, cell, l, w, cl, cw) =\n let(\n size = apply2D(uor(size, DEFAULT_BUILD_PLATE_SIZE), l, w),\n cell = apply2D(uor(cell, DEFAULT_BUILD_PLATE_CELL), cl, cw),\n nb = [\n cell.x ? floor(size.x \/ cell.x) : 0,\n cell.y ? floor(size.y \/ cell.y) : 0\n ],\n count = [\n nb.x + 1,\n nb.y + 1\n ],\n offset = [\n cell.x ? -nb.x * cell.x \/ 2 : 0,\n cell.y ? -nb.y * cell.y \/ 2 : 0\n ]\n )\n [ size, cell, count, offset ]\n;\n\n\/**\n * Creates a build plate visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build plate.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildPlate(size=DEFAULT_BUILD_PLATE_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, cl, cw, center=false) {\n size = sizeBuildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw);\n plateSize = size[0];\n cellSize = size[1];\n cellCount = size[2];\n cellOffset = size[3];\n\n plateHeight = TESTBED_THICKNESS;\n lineWidth = .5;\n\n testbedExtrude(.2) {\n translate(center ? -plateSize \/ 2 : [0, 0]) {\n square(plateSize);\n }\n }\n testbedExtrude(.2) {\n translate(center ? [cellOffset.x, -plateSize.y \/ 2, 0] : ORIGIN_3D) {\n repeat(count=cellCount.x, intervalX=cellSize.x) {\n square([lineWidth, plateSize.y]);\n }\n }\n translate(center ? [-plateSize.x \/ 2, cellOffset.y, 0] : ORIGIN_3D) {\n repeat(count=cellCount.y, intervalY=cellSize.y) {\n square([plateSize.x, lineWidth]);\n }\n }\n }\n}\n\n\/**\n * Creates a build volume visualization at the origin.\n *\n * @param Number|Vector [size] - The size of the build box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildVolume(size=DEFAULT_BUILD_VOLUME_SIZE, l, w, h, center=false) {\n testbedColor(.1) {\n size = apply3D(size, l, w, w);\n translate(center ? apply3D(-size \/ 2, z=0) : ORIGIN_3D) {\n cube(size);\n }\n }\n}\n\n\/**\n * Creates a build box visualization at the origin.\n * A build box contains visualizations for a build plate and a build volume.\n *\n * @param Number|Vector [size] - The size of the build volume.\n * @param Number|Vector [cell] - The size of each cell on the build plate.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of a cell.\n * @param Number [cw] - The width of cell.\n * @param Boolean [center] - The shape is centered vertically.\n *\/\nmodule buildBox(size=DEFAULT_BUILD_VOLUME_SIZE, cell=DEFAULT_BUILD_PLATE_CELL, l, w, h, cl, cw, center=false) {\n buildPlate(size=size, cell=cell, l=l, w=w, cl=cl, cw=cw, center=center);\n buildVolume(size=size, l=l, w=w, h=h, center=center);\n\n children();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"77563078f444f36ecae2ead412bb4d0a5b583c7c","subject":"[3d] Add slopes to the threaded insert opening","message":"[3d] Add slopes to the threaded insert opening\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d=5.6+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d=5.6, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"99802c1a4a285dc27d0ac51f2e9ae04ff57bfa4a","subject":"bigger support","message":"bigger support\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"video_camera_holder\/vch.scad","new_file":"video_camera_holder\/vch.scad","new_contents":"module holder()\n{\n translate([0,0,110])\n rotate([90,0,0])\n difference()\n {\n translate([-70\/2, -110, 0])\n cube([70, 140, 5]);\n cylinder(r=30\/2, h=5, $fs=0.01);\n for(deg = [0, 120, 240])\n rotate(deg)\n #translate([0, 21.25, -1])\n cylinder(r=3.5\/2, h=5+2*1, $fs=0.1);\n }\n}\n\nrotate([-90, 0, 0])\n{\n holder();\n translate([-120\/2, -110, 0])\n cube([120, 110, 5]);\n}","old_contents":"module holder()\n{\n translate([0,0,110])\n rotate([90,0,0])\n difference()\n {\n translate([-70\/2, -110, 0])\n cube([70, 140, 5]);\n cylinder(r=30\/2, h=5, $fs=0.01);\n for(deg = [0, 120, 240])\n rotate(deg)\n #translate([0, 21.25, -1])\n cylinder(r=3.5\/2, h=5+2*1, $fs=0.1);\n }\n}\n\nrotate([-90, 0, 0])\n{\n holder();\n translate([-90\/2, -110, 0])\n cube([90, 110, 5]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4208451f73f42f290d57f4b3a8da34acbd09973e","subject":"Added chassis holder for WLtoys A333 RC car","message":"Added chassis holder for WLtoys A333 RC car\n","repos":"ksuszka\/3d-projects","old_file":"small\/wltoys_a333_parts.scad","new_file":"small\/wltoys_a333_parts.scad","new_contents":"$fn=60;\n\nmodule chassis_holder(width, hole_angle, pin_angle) {\n column_height = 19;\n hole_dia=1.5;\n for(x=[-15,15]) {\n translate([x,0,0]) {\n difference() {\n cylinder(d=4,h=column_height); \n translate([0,0,5]) rotate([90,0,0]) cylinder(d=hole_dia,h=10,center=true);\n }\n }\n }\n translate([0,0,column_height]) {\n for(x=[-1,1]) {\n translate([x*width\/2,0,0]) {\n translate([0,0,8]) rotate([pin_angle,0,0]) translate([0,5,0]) {\n difference() {\n union() {\n cylinder(d=4,h=6); \n translate([0,0,6]) sphere(d=4);\n }\n translate([0,0,5]) rotate([hole_angle,90,0]) cylinder(d=hole_dia,h=10,center=true);\n }\n \n }\n hull() {\n translate([0,0,8]) rotate([pin_angle,0,0]) translate([0,5,0]) cylinder(d=10,h=2);\n translate([0,0,4]) translate([x*1,0,0]) cylinder(d=4,h=6);\n translate([0,0,4]) translate([x*-2,0,0])cylinder(d=4,h=6);\n }\n translate([x*1,0,0]) cylinder(d=4,h=6);\n }\n }\n }\n translate([0,0,column_height+2]) cube([width+2,4,4],true);\n}\n\nmodule chassis_back_holder() {\n chassis_holder(width=80,hole_angle=0,pin_angle=0);\n}\n\nmodule chassis_front_holder() {\n chassis_holder(width=70,hole_angle=90,pin_angle=10);\n}\n\nrotate([90,0,0]) chassis_back_holder();\ntranslate([5,-17,0]) rotate([90,0,180]) chassis_front_holder();","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/wltoys_a333_parts.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"591f6e7096a8cbdfa086568c5db5d92ae0d04e67","subject":"Update phosfor_1.scad","message":"Update phosfor_1.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/phosfor_1.scad","new_file":"3D-models\/SCAD\/phosfor_1.scad","new_contents":"z=9; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0444\u043e\u0441\u0444\u043e\u0440\ntranslate ([25,-46,0]) {\ndifference () {\ntranslate ([5,30,0])cube ([10,45,z]);\ntranslate ([-5,125,1]) {\ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\n}\ntranslate([-5,30,-1])cylinder(z+2,20,20,$fn=6);\ntranslate([-5,75,-1])cylinder(z+2,20,20,$fn=6);\ntranslate ([4,40,4.5])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,4.5])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n }\n\/\/\u0432\u044b\u0440\u0435\u0437\u0430\u043d\u0438\u0435 \u0434\u044b\u0440\u043a\u0438 \u0438\u0437 \u0434\u043e\u043f \u0447\u0430\u0441\u0442\u0438 \u043e\u0442 \u0444\u043e\u0441\u0444\u0440\u0430\ndifference () {\ntranslate ([15,30,0])cube ([5,45,z]);\ntranslate ([-5,125,1]) {\ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\n}\ntranslate ([9.7-5,-9+g,0]) {\ntranslate ([4,37.5,4.5])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \n }\n }\n}\n\n \n","old_contents":"z=7; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0444\u043e\u0441\u0444\u043e\u0440\ntranslate ([25,-46,0]) {\ndifference () {\ntranslate ([5,30,0])cube ([10,45,z]);\ntranslate ([-5,125,0]) {\ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\n}\ntranslate([-5,30,-1])cylinder(z+2,20,20,$fn=6);\ntranslate([-5,75,-1])cylinder(z+2,20,20,$fn=6);\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,3.5])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n }\n\/\/\u0432\u044b\u0440\u0435\u0437\u0430\u043d\u0438\u0435 \u0434\u044b\u0440\u043a\u0438 \u0438\u0437 \u0434\u043e\u043f \u0447\u0430\u0441\u0442\u0438 \u043e\u0442 \u0444\u043e\u0441\u0444\u0440\u0430\ndifference () {\ntranslate ([15,30,0])cube ([5,45,z]);\ntranslate ([-5,125,0]) {\ntranslate ([9.3,-62.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,3.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\n}\ntranslate ([9.7-5,-9+g,0]) {\ntranslate ([4,37.5,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fd92aa41d8bc64a1d913578c15842f763e67a394","subject":"increasing segment count so circles aren't so jagged","message":"increasing segment count so circles aren't so jagged\n","repos":"abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev","old_file":"projects\/maslowcnc\/vision\/camera-mount\/camera-mount.scad","new_file":"projects\/maslowcnc\/vision\/camera-mount\/camera-mount.scad","new_contents":"\/\/ License: CC0\n\nOUTER_DIAM = 110;\nINNER_DIAM = 92;\nCAM_DIAM = 8.75;\n\nSCREW_DIAM = 2;\n\nCAM_FIX_W = 20;\nCAM_FIX_H = 35;\nCAM_FIX_SPACE = 2;\n\nFS=0.25;\nFN=1000;\n\nmodule outer_plate() {\n difference() {\n circle(OUTER_DIAM\/2, $fn=FN);\n \n circle(CAM_FIX_W+5, $fn=FN);\n\n outer_ds = INNER_DIAM\/2 - 5;\n translate([outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([0, outer_ds]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([-outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([0, -outer_ds]) circle(SCREW_DIAM\/2, $fn=FN);\n \n square([CAM_FIX_W+8, INNER_DIAM-20], center=true);\n \n \n }\n}\n\nmodule inner_plate() {\n difference() {\n cam_r = CAM_DIAM\/2;\n circle(INNER_DIAM\/2, $fn=FN);\n circle(cam_r, $fn=FN);\n \n dx = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n dy = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n translate([-dx, dy]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([ dx, dy]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([ dx, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([-dx, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n \n translate([0, -(CAM_FIX_H - CAM_FIX_W) - 5]) square([CAM_FIX_W+8, 15], center=true);\n \n outer_ds = INNER_DIAM\/2 - 5;\n translate([outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([0, outer_ds]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([-outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([0, -outer_ds]) circle(SCREW_DIAM\/2, $fn=FN);\n \n };\n}\n\nmodule holder() {\n \n ds = (CAM_FIX_H - CAM_FIX_W)\/2;\n difference() {\n translate([0,-ds]) square([CAM_FIX_W, CAM_FIX_H], center=true);\n \n dx = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n dy = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n translate([-dx, dy]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([ dx, dy]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([ dx, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n translate([-dx, 0]) circle(SCREW_DIAM\/2, $fn=FN);\n \n circle(CAM_DIAM\/2);\n \n translate([0,-CAM_FIX_W]) square([CAM_FIX_SPACE, CAM_FIX_H], center=true);\n \n translate([-CAM_FIX_W\/2, -(ds + CAM_FIX_H\/2 - 8)]) circle(5);\n translate([ CAM_FIX_W\/2, -(ds + CAM_FIX_H\/2 - 8)]) circle(5);\n };\n \n}\n\ninner_plate();\ntranslate([OUTER_DIAM\/2 + INNER_DIAM\/2 + 5, 0]) outer_plate();\n\ntranslate([0, 60]) rotate(90, [0,0,1]) holder();\ntranslate([45, 60]) holder();\n","old_contents":"\/\/ License: CC0\n\nOUTER_DIAM = 110;\nINNER_DIAM = 92;\nCAM_DIAM = 8.75;\n\nSCREW_DIAM = 2;\n\nCAM_FIX_W = 20;\nCAM_FIX_H = 35;\nCAM_FIX_SPACE = 2;\n\nmodule outer_plate() {\n difference() {\n circle(OUTER_DIAM\/2, $fn=50);\n \n circle(CAM_FIX_W+5, $fn=30);\n\n outer_ds = INNER_DIAM\/2 - 5;\n translate([outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=20);\n translate([0, outer_ds]) circle(SCREW_DIAM\/2, $fn=20);\n translate([-outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=20);\n translate([0, -outer_ds]) circle(SCREW_DIAM\/2, $fn=20);\n \n square([CAM_FIX_W+8, INNER_DIAM-20], center=true);\n \n \n }\n}\n\nmodule inner_plate() {\n difference() {\n cam_r = CAM_DIAM\/2;\n circle(INNER_DIAM\/2, $fn=50);\n circle(cam_r, $fn=40);\n \n dx = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n dy = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n translate([-dx, dy]) circle(SCREW_DIAM\/2, $fn=20);\n translate([ dx, dy]) circle(SCREW_DIAM\/2, $fn=20);\n translate([ dx, 0]) circle(SCREW_DIAM\/2, $fn=20);\n translate([-dx, 0]) circle(SCREW_DIAM\/2, $fn=20);\n \n translate([0, -(CAM_FIX_H - CAM_FIX_W) - 5]) square([CAM_FIX_W+8, 15], center=true);\n \n outer_ds = INNER_DIAM\/2 - 5;\n translate([outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=20);\n translate([0, outer_ds]) circle(SCREW_DIAM\/2, $fn=20);\n translate([-outer_ds, 0]) circle(SCREW_DIAM\/2, $fn=20);\n translate([0, -outer_ds]) circle(SCREW_DIAM\/2, $fn=20);\n \n };\n}\n\nmodule holder() {\n \n ds = (CAM_FIX_H - CAM_FIX_W)\/2;\n difference() {\n translate([0,-ds]) square([CAM_FIX_W, CAM_FIX_H], center=true);\n \n dx = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n dy = CAM_FIX_W\/2 - SCREW_DIAM\/2 - 2;\n translate([-dx, dy]) circle(SCREW_DIAM\/2, $fn=20);\n translate([ dx, dy]) circle(SCREW_DIAM\/2, $fn=20);\n translate([ dx, 0]) circle(SCREW_DIAM\/2, $fn=20);\n translate([-dx, 0]) circle(SCREW_DIAM\/2, $fn=20);\n \n circle(CAM_DIAM\/2);\n \n translate([0,-CAM_FIX_W]) square([CAM_FIX_SPACE, CAM_FIX_H], center=true);\n \n translate([-CAM_FIX_W\/2, -(ds + CAM_FIX_H\/2 - 8)]) circle(5);\n translate([ CAM_FIX_W\/2, -(ds + CAM_FIX_H\/2 - 8)]) circle(5);\n };\n \n}\n\ninner_plate();\ntranslate([0,OUTER_DIAM\/2 + INNER_DIAM\/2 + 5]) outer_plate();\n\ntranslate([60,-0]) holder();\ntranslate([60,40]) holder();\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7ac68677faa1145e1145f4a95b7d96c57626b9af","subject":"added internal parts","message":"added internal parts\n","repos":"beckdac\/zynthian-build","old_file":"case\/zynthian-case.scad","new_file":"case\/zynthian-case.scad","new_contents":"$fn = 64;\n\nuse \n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 119;\ndisplayScreenHeight = 72;\ndisplayScreenThickness = 3;\ndisplayScreenYOffset = 3.5;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 79;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2 + displayScreenYOffset, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\ndisplayMountThickness = displayBoardThickness;\ndisplayMountScrewOffset = 2;\nmodule display_mount() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayMountThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness])\n cylinder(h=2 * displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, d = displayScrewDiameter + iFitAdjust_d * 2);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule lid() {\n \/\/display_mount_tabs();\n \n difference() {\n \/\/ face plate\n union() {\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n display_mount();\n }\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * (encoderWidth * 1.1), j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=20, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\nmcp23017BoardWidth = 40;\nmcp23017BoardLength = 60;\nmcp23017BoardHeight = 1.4;\nmcp23017BoardScrewDiameter = 2;\nmcp23017BoardScrewInset = 1.7;\nheader40PinWidth = 4.8;\nheader40PinLength = 51;\nheader40PinHeight = 11;\nheader40pinInsetL = 4.5;\nheader40pinInsetW = 4.5;\nmcpToHifiOffset = 10.2;\nhifiBoardWidth = 56;\nhifiBoardLength = 65.3;\nhifiBoardHeight = 1.4;\nhifiBoardCutoutWidth = lidThickness * 3;\nhifiBoardCutoutLength = 46;\nhifiBoardCutoutHeight = 14.5;\nhifiBoardScrewDiameter = 4;\nhifiBoardScrewInset = 3.7;\nhifiMcpWidth = mcp23017BoardWidth - mcpToHifiOffset + hifiBoardWidth;\nmodule hifi_mcp23017_boards() {\n \/\/ mcp23017 protoboard\n color(\"limegreen\")\n difference() {\n \/\/ board\n cube([mcp23017BoardWidth, mcp23017BoardLength, mcp23017BoardHeight]);\n \/\/ screw holes\n translate([mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n translate([mcp23017BoardWidth - mcp23017BoardScrewInset, mcp23017BoardLength - mcp23017BoardScrewInset, -.1])\n cylinder(d=mcp23017BoardScrewDiameter, h=mcp23017BoardHeight + .2);\n }\n \/\/ 40 pin header\n color(\"black\")\n translate([header40pinInsetL, header40pinInsetW, mcp23017BoardHeight])\n cube([header40PinWidth, header40PinLength, header40PinHeight]);\n \/\/ sainsmart pifi dac board\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset, 0, mcp23017BoardHeight + header40PinHeight])\n difference() {\n \/\/ board\n cube([hifiBoardWidth, hifiBoardLength, hifiBoardHeight]);\n \/\/ screw holes\n translate([hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n translate([hifiBoardWidth - hifiBoardScrewInset, hifiBoardLength - hifiBoardScrewInset, -.1])\n cylinder(d=hifiBoardScrewDiameter, h=hifiBoardHeight + .2);\n }\n color(\"darkgrey\") \n translate([-hifiBoardWidth + mcpToHifiOffset - hifiBoardCutoutWidth \/ 2, hifiBoardLength \/ 2 - hifiBoardCutoutLength \/ 2, mcp23017BoardHeight + header40PinHeight])\n cube([hifiBoardCutoutWidth, hifiBoardCutoutLength, hifiBoardCutoutHeight]);\n}\n\nanker7PortHubHeight = 44.5;\nanker7PortHubLength = 110;\nanker7PortHubWidth = 23;\nmodule anker_7port_usb_hub() {\n color(\"black\")\n translate([0, 0, boxThickness])\n cube([anker7PortHubWidth, anker7PortHubLength, anker7PortHubHeight]);\n}\n\n\/\/ box with pi mounts and holes\nrPi3BottomSpacer = 4;\nrPi3Length = 85;\nrpi3Width = 56;\nboxHeight = 80;\nboxThickness = lidThickness;\nhifiMcpSpacer = 4;\nmodule box() {\n\n \/\/ bottom\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, boxThickness]);\n \/\/ pi mount holes\n translate([(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - rPi3Length \/ 2, (displayBoardHeight * 1.25 + encoderLength)\/2 - 29, boxThickness + rPi3BottomSpacer])\n pi3();\n \/\/ sides\n for (i = [-1, 1])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -i * (displayBoardHeight * 1.25 + encoderLength)\/2 - (i == -1 ? boxThickness : 0), 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, boxThickness, boxHeight]);\n for (i = [-1, 1])\n translate([-i * (displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 - (i == -1 ? boxThickness : 0), -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([boxThickness, displayBoardHeight * 1.25 + encoderLength, boxHeight]);\n \/\/ pi usb \/ ethernet cutou\n\n \/\/ hifi audio out board with mcp23017 board\n rotate([0, 0, 90])\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2 + hifiMcpWidth, 0, boxThickness + hifiMcpSpacer])\n hifi_mcp23017_boards();\n \/\/ anker usb power hub\n anker_7port_usb_hub();\n \/\/ translate([0,0,boxHeight + 2])\n \/\/ lid();\n}\n\n\/\/display();\n\/\/encoder();\n\/\/lid();\n\/\/display_mount_tabs();\nbox();","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n}\n\ndisplayMountThickness = displayBoardThickness;\ndisplayMountScrewOffset = 2;\nmodule display_mount() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayMountThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness])\n cylinder(h=2 * displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\ndisplayMountTabThickness = 3;\ndisplayMountTabWidth = 15;\ndisplayMountTabHeight = 20;\nmodule display_mount_tabs() {\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * displayMountScrewOffset, j * displayBoardHeight\/2 + j * displayMountScrewOffset, -displayBoardThickness - displayMountTabThickness \/ 2])\n difference() {\n cube([displayMountTabWidth, displayMountTabHeight, displayMountTabThickness], center=true);\n translate([i * 2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nlidThickness = displayScreenThickness - .5;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule lid() {\n \/\/display_mount_tabs();\n \n difference() {\n \/\/ face plate\n union() {\n translate([-(displayBoardWidth * 1.5 + encoderWidth * 1.1)\/2, -(displayBoardHeight * 1.25 + encoderLength)\/2, 0])\n cube([displayBoardWidth * 1.5 + encoderWidth * 1.1, displayBoardHeight * 1.25 + encoderLength, lidThickness]);\n display_mount();\n }\n \/\/ screen cutout\n display();\n \/\/ encoder cutout\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2 + i * (encoderWidth * 1.1), j * displayBoardHeight\/2, - encoderShaftHeight \/ 2 + 2])\n encoder();\n }\n \/\/ screw holes\n #for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * (displayBoardWidth * 1.5 + encoderWidth * 1.1 - lidScrewBoundaryOffset) \/ 2, j * (displayBoardHeight * 1.25 + encoderLength - lidScrewBoundaryOffset) \/ 2, - encoderShaftHeight \/ 2 + 2])\n cylinder(h=20, d=lidScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}\n\n\/\/display();\n\/\/encoder();\nlid();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f3362a70132a37eb241cbc02ef60557f3e9cbd3a","subject":"dimensions","message":"dimensions\n","repos":"DanNixon\/Alice,DanNixon\/Alice","old_file":"CAD\/box\/parts\/top.scad","new_file":"CAD\/box\/parts\/top.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"37cafe40e0daa0daa1933a568a8af9c4b9c193f5","subject":"Better type management in hex.scad","message":"Better type management in hex.scad\n","repos":"jsconan\/camelSCAD","old_file":"core\/hex.scad","new_file":"core\/hex.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017-2019 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Operations on hex grids.\r\n *\r\n * @package core\/hex\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Computes the number of ranges in a radial hex grid based on the number of cells.\r\n *\r\n * @param Vector|Number count - The number of cells.\r\n * @returns Number - The number of ranges.\r\n *\/\r\nfunction radialHexRange(count) =\r\n let( number = isArray(count) && len(count) ? min(count) : float(count) )\r\n floor((abs(divisor(number)) - 1) \/ 2)\r\n;\r\n\r\n\/**\r\n * Computes the number of cells in a radial hex grid based on the number of ranges.\r\n *\r\n * @param Number range - The number of ranges.\r\n * @returns Vector - The number of cells.\r\n *\/\r\nfunction radialHexCount(range) = vector2D(float(range) * 2 + 1);\r\n\r\n\/**\r\n * Computes the logical coordinates of cells placed on a hex grid.\r\n * A radial hex grid is built from several hexagons put aside and has the shape of a bigger hexagon.\r\n * If the count contains 2 dimensions, the lower value will be used to define the radial range.\r\n * The number of ranges will define the size of the grid.\r\n * The number of hexagons will be `1 + 3 * range * (range + 1)`.\r\n *\r\n * @param Vector|Number count - The number of cells in the hex grid.\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector[] - Will return an array of 2D coordinates.\r\n *\/\r\nfunction buildHexGrid(count, linear, cx, cy) =\r\n let(\r\n count = apply2D(count, cx, cy)\r\n )\r\n linear\r\n ?let(\r\n count = vabs(divisor2D(count))\r\n )\r\n [\r\n for (x = [0 : count[0] - 1])\r\n for (y = [0 : count[1] - 1])\r\n [x, y]\r\n ]\r\n :let(\r\n n = radialHexRange(count)\r\n )\r\n [\r\n for(x = [-n : n])\r\n for(y = [max(-n, -x - n) : min(n, -x + n)])\r\n [x, -x - y]\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the offset of a hex grid in order to center it.\r\n *\r\n * @param Vector|Number [size] - The size of a cell in the hex grid.\r\n * @param Vector|Number [count] - The number of cells in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\r\n * @param Number [l] - The length of a cell in the hex grid.\r\n * @param Number [w] - The width of a cell in the hex grid.\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector - The size of the overall hex grid.\r\n *\/\r\nfunction offsetHexGrid(size, count, pointy, linear, even, l, w, cx, cy) =\r\n !linear\r\n ?[0, 0]\r\n :let(\r\n size = apply2D(size, l, w),\r\n count = divisor2D(apply2D(count, cx, cy)),\r\n even = even ? 2 : 1,\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n size[0] * SQRT3 * ((even - (count[0] + linear))) \/ 4,\r\n -size[1] * (count[1] - 1) * 3 \/ 8,\r\n ]\r\n :[\r\n -size[0] * (count[0] - 1) * 3 \/ 8,\r\n size[1] * SQRT3 * ((even - (count[1] + linear))) \/ 4,\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the size of a hex grid based on the size of one cell and the number of cells.\r\n *\r\n * @param Vector|Number [size] - The size of a cell in the hex grid.\r\n * @param Vector|Number [count] - The number of cells in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [l] - The length of a cell in the hex grid.\r\n * @param Number [w] - The width of a cell in the hex grid.\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector - The size of the overall hex grid.\r\n *\/\r\nfunction sizeHexGrid(size, count, pointy, linear, l, w, cx, cy) =\r\n let(\r\n size = apply2D(size, l, w),\r\n count = divisor2D(apply2D(count, cx, cy)),\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n size[0] * SQRT3 * (count[0] + linear) \/ 2,\r\n size[1] * (4 + 3 * (count[1] - 1)) \/ 4,\n ]\r\n :[\r\n size[0] * (4 + 3 * (count[0] - 1)) \/ 4,\r\n size[1] * SQRT3 * (count[1] + linear) \/ 2\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the size of a cell in a hex grid based on the size of the grid and the number of cells.\r\n *\r\n * @param Vector|Number [size] - The size of the hex grid.\r\n * @param Vector|Number [count] - The number of cells in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [l] - The length of the hex grid.\r\n * @param Number [w] - The width of the hex grid.\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector - The size of the overall hex grid.\r\n *\/\r\nfunction sizeHexCell(size, count, pointy, linear, l, w, cx, cy) =\r\n let(\r\n size = apply2D(size, l, w),\r\n count = divisor2D(apply2D(count, cx, cy)),\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n size[0] * 2 \/ (count[0] + linear) \/ SQRT3,\r\n size[1] * 4 \/ (4 + 3 * (count[1] - 1))\r\n ]\r\n :[\r\n size[0] * 4 \/ (4 + 3 * (count[0] - 1)),\r\n size[1] * 2 \/ (count[1] + linear) \/ SQRT3\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the number of cells in a hex grid that fits the provided size.\r\n *\r\n * @param Vector|Number [size] - The size of the hex grid.\r\n * @param Vector|Number [cell] - The size of a cell in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [l] - The length of the hex grid.\r\n * @param Number [w] - The width of the hex grid.\r\n * @param Number [cl] - The length of a cell.\r\n * @param Number [cw] - The width of a cell.\r\n * @returns Vector - The number of cells in the hex grid.\r\n *\/\r\nfunction countHexCell(size, cell, pointy, linear, l, w, cl, cw) =\r\n let(\r\n size = divisor2D(apply2D(size, l, w)),\r\n cell = divisor2D(apply2D(cell, cl, cw)),\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n floor(size[0] * 2 \/ cell[0] \/ SQRT3 - linear),\r\n floor((size[1] * 4 \/ cell[1] - 1) \/ 3)\r\n ]\r\n :[\r\n floor((size[0] * 4 \/ cell[0] - 1) \/ 3),\r\n floor(size[1] * 2 \/ cell[1] \/ SQRT3 - linear)\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the physical coordinates of a cell in a hex grid based on its logical coordinates.\r\n *\r\n * @param Vector|Number hex - The logical coordinates in the hex grid.\r\n * @param Vector|Number [size] - The size the cell.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Boolean [even] - Tells if the first hexagons should be below the line (default: false).\r\n * @param Number [x] - The logical X-coordinate in the hex grid.\r\n * @param Number [y] - The logical Y-coordinate in the hex grid.\r\n * @param Number [l] - The length of the cell.\r\n * @param Number [w] - The width of the cell.\r\n * @returns Vector - Physical coordinates.\r\n *\/\r\nfunction coordHexCell(hex, size, pointy, linear, even, x, y, l, w) =\r\n let(\r\n hex = apply2D(hex, x, y),\r\n size = divisor2D(apply2D(size, l, w)) \/ 2,\r\n factor = linear && even ? -0.5 : 0.5\r\n )\r\n pointy\r\n ?[\r\n size[0] * SQRT3 * (hex[0] + factor * (linear ? hex[1] % 2 : hex[1])),\r\n size[1] * hex[1] * 1.5\r\n ]\r\n :[\r\n size[0] * hex[0] * 1.5,\r\n size[1] * SQRT3 * (hex[1] + factor * (linear ? hex[0] % 2 : hex[0]))\r\n ]\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Operations on hex grids.\r\n *\r\n * @package core\/hex\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Computes the number of ranges in a radial hex grid based on the number of cells.\r\n *\r\n * @param Vector|Number count - The number of cells.\r\n * @returns Number - The number of ranges.\r\n *\/\r\nfunction radialHexRange(count) = floor((abs(divisor(min(count))) - 1) \/ 2);\r\n\r\n\/**\r\n * Computes the number of cells in a radial hex grid based on the number of ranges.\r\n *\r\n * @param Number range - The number of ranges.\r\n * @returns Vector - The number of cells.\r\n *\/\r\nfunction radialHexCount(range) = vector2D(float(range) * 2 + 1);\r\n\r\n\/**\r\n * Computes the logical coordinates of cells placed on a hex grid.\r\n * A radial hex grid is built from several hexagons put aside and has the shape of a bigger hexagon.\r\n * If the count contains 2 dimensions, the lower value will be used to define the radial range.\r\n * The number of ranges will define the size of the grid.\r\n * The number of hexagons will be `1 + 3 * range * (range + 1)`.\r\n *\r\n * @param Vector|Number count - The number of cells in the hex grid.\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector[] - Will return an array of 2D coordinates.\r\n *\/\r\nfunction buildHexGrid(count, linear, cx, cy) =\r\n let(\r\n count = apply2D(count, cx, cy)\r\n )\r\n linear\r\n ?let(\r\n count = vabs(divisor2D(count))\r\n )\r\n [\r\n for (x = [0 : count[0] - 1])\r\n for (y = [0 : count[1] - 1])\r\n [x, y]\r\n ]\r\n :let(\r\n n = radialHexRange(count)\r\n )\r\n [\r\n for(x = [-n : n])\r\n for(y = [max(-n, -x - n) : min(n, -x + n)])\r\n [x, -x - y]\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the offset of a hex grid in order to center it.\r\n *\r\n * @param Vector|Number [size] - The size of a cell in the hex grid.\r\n * @param Vector|Number [count] - The number of cells in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\r\n * @param Number [l] - The length of a cell in the hex grid.\r\n * @param Number [w] - The width of a cell in the hex grid.\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector - The size of the overall hex grid.\r\n *\/\r\nfunction offsetHexGrid(size, count, pointy, linear, even, l, w, cx, cy) =\r\n !linear\r\n ?[0, 0]\r\n :let(\r\n size = apply2D(size, l, w),\r\n count = divisor2D(apply2D(count, cx, cy)),\r\n even = even ? 2 : 1,\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n size[0] * SQRT3 * ((even - (count[0] + linear))) \/ 4,\r\n -size[1] * (count[1] - 1) * 3 \/ 8,\r\n ]\r\n :[\r\n -size[0] * (count[0] - 1) * 3 \/ 8,\r\n size[1] * SQRT3 * ((even - (count[1] + linear))) \/ 4,\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the size of a hex grid based on the size of one cell and the number of cells.\r\n *\r\n * @param Vector|Number [size] - The size of a cell in the hex grid.\r\n * @param Vector|Number [count] - The number of cells in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [l] - The length of a cell in the hex grid.\r\n * @param Number [w] - The width of a cell in the hex grid.\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector - The size of the overall hex grid.\r\n *\/\r\nfunction sizeHexGrid(size, count, pointy, linear, l, w, cx, cy) =\r\n let(\r\n size = apply2D(size, l, w),\r\n count = divisor2D(apply2D(count, cx, cy)),\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n size[0] * SQRT3 * (count[0] + linear) \/ 2,\r\n size[1] * (4 + 3 * (count[1] - 1)) \/ 4,\n ]\r\n :[\r\n size[0] * (4 + 3 * (count[0] - 1)) \/ 4,\r\n size[1] * SQRT3 * (count[1] + linear) \/ 2\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the size of a cell in a hex grid based on the size of the grid and the number of cells.\r\n *\r\n * @param Vector|Number [size] - The size of the hex grid.\r\n * @param Vector|Number [count] - The number of cells in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [l] - The length of the hex grid.\r\n * @param Number [w] - The width of the hex grid.\r\n * @param Number [cx] - The number of cells per lines.\r\n * @param Number [cy] - The number of cells per columns.\r\n * @returns Vector - The size of the overall hex grid.\r\n *\/\r\nfunction sizeHexCell(size, count, pointy, linear, l, w, cx, cy) =\r\n let(\r\n size = apply2D(size, l, w),\r\n count = divisor2D(apply2D(count, cx, cy)),\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n size[0] * 2 \/ (count[0] + linear) \/ SQRT3,\r\n size[1] * 4 \/ (4 + 3 * (count[1] - 1))\r\n ]\r\n :[\r\n size[0] * 4 \/ (4 + 3 * (count[0] - 1)),\r\n size[1] * 2 \/ (count[1] + linear) \/ SQRT3\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the number of cells in a hex grid that fits the provided size.\r\n *\r\n * @param Vector|Number [size] - The size of the hex grid.\r\n * @param Vector|Number [cell] - The size of a cell in the hex grid.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Number [l] - The length of the hex grid.\r\n * @param Number [w] - The width of the hex grid.\r\n * @param Number [cl] - The length of a cell.\r\n * @param Number [cw] - The width of a cell.\r\n * @returns Vector - The number of cells in the hex grid.\r\n *\/\r\nfunction countHexCell(size, cell, pointy, linear, l, w, cl, cw) =\r\n let(\r\n size = divisor2D(apply2D(size, l, w)),\r\n cell = divisor2D(apply2D(cell, cl, cw)),\r\n linear = linear ? .5 : 0\r\n )\r\n pointy\r\n ?[\r\n floor(size[0] * 2 \/ cell[0] \/ SQRT3 - linear),\r\n floor((size[1] * 4 \/ cell[1] - 1) \/ 3)\r\n ]\r\n :[\r\n floor((size[0] * 4 \/ cell[0] - 1) \/ 3),\r\n floor(size[1] * 2 \/ cell[1] \/ SQRT3 - linear)\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes the physical coordinates of a cell in a hex grid based on its logical coordinates.\r\n *\r\n * @param Vector|Number hex - The logical coordinates in the hex grid.\r\n * @param Vector|Number [size] - The size the cell.\r\n * @param Boolean [pointy] - Tells if the hexagons in the grid are pointy topped (default: false, Flat topped).\r\n * @param Boolean [linear] - Tells if the grid is linear instead of radial (default: false).\r\n * @param Boolean [even] - Tells if the first hexagons should be below the line (default: false).\r\n * @param Number [x] - The logical X-coordinate in the hex grid.\r\n * @param Number [y] - The logical Y-coordinate in the hex grid.\r\n * @param Number [l] - The length of the cell.\r\n * @param Number [w] - The width of the cell.\r\n * @returns Vector - Physical coordinates.\r\n *\/\r\nfunction coordHexCell(hex, size, pointy, linear, even, x, y, l, w) =\r\n let(\r\n hex = apply2D(hex, x, y),\r\n size = divisor2D(apply2D(size, l, w)) \/ 2,\r\n factor = linear && even ? -0.5 : 0.5\r\n )\r\n pointy\r\n ?[\r\n size[0] * SQRT3 * (hex[0] + factor * (linear ? hex[1] % 2 : hex[1])),\r\n size[1] * hex[1] * 1.5\r\n ]\r\n :[\r\n size[0] * hex[0] * 1.5,\r\n size[1] * SQRT3 * (hex[1] + factor * (linear ? hex[0] % 2 : hex[0]))\r\n ]\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a3bc25a04c903232e06e4484e8baf5fb5b48053b","subject":"Flipped fadecandy so that the USB connector is accessible and added hole for power button. Layout untested so far!","message":"Flipped fadecandy so that the USB connector is accessible and added hole for power button. Layout untested so far!\n","repos":"sarahemm\/senbike","old_file":"cad\/brc2014bike-powerboard.scad","new_file":"cad\/brc2014bike-powerboard.scad","new_contents":"$quality = 25;\n\nslot_long = 20;\nslot_short = 5;\nslot_rounding = 0.5;\n\nmodule powerboost(x, y) {\n\twide_hole_spacing = 16.5;\n\tclose_hole_spacing = 13;\n\tholes_apart_spacing = 23;\n\n translate([x,y]) {\n\t\ttranslate([-(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-10.75, -8])\n\t\t\tsquare([5, 15], r=slot_rounding);\n }\n}\n\n\nmodule powerboost_rev(x, y) {\n\twide_hole_spacing = 13;\n\tclose_hole_spacing = 16.5;\n\tholes_apart_spacing = 23;\n\n translate([x,y]) {\n\t\ttranslate([-(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+5.75, -7])\n\t\t\tsquare([5, 15], r=slot_rounding);\n }\n}\n\n\nmodule powercell(x, y) {\n\tholes_y_spacing = 17.5;\n\tholes_x_spacing = 20.5;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-12.75, -5])\n\t\t\tsquare([5, 10], r=slot_rounding);\n\t\ttranslate([+7.75, -5])\n\t\t\tsquare([5, 10], r=slot_rounding);\n\t}\n}\n\n\nmodule charger(x, y) {\n\tholes_y_spacing = 35.5;\n\tholes_x_spacing = 25.5;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-5, +8])\n\t\t\tsquare([10, 10], r=slot_rounding);\n\t}\n}\n\nmodule fadecandy(x, y) {\n\tholes_y_spacing = 20.5;\n\tholes_x_spacing = 19.5;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([13, -10.5])\n\t\t\tsquare([5, 21], r=slot_rounding);\n\t}\n}\n\nmodule battery(x, y) {\n\tholes_y_spacing = 38;\n\tholes_x_spacing = 53;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t}\n}\n\n\ndifference(r=slot_rounding) {\n\t\/\/ positive things\n\tunion(r=5) {\n\t\ttranslate([-20, -15])\n\t\t\tsquare([160, 130], r=5);\n\t}\n\t\/\/ negative things\n\tunion() {\n\t\tpowercell(20, 14);\n\t\tpowerboost(50, 14);\n\n\t\tcharger(50, 50);\n\t\tfadecandy(14, 60);\n\n\t\tpowercell(20, 86);\n\t\tpowerboost_rev(50, 86);\n\n\t\tbattery(100,50);\n\n\t\t\/\/ hole for the power switch\n\t\ttranslate([100, 90])\n\t\t\tcircle(5);\n\n\t\t\/\/ slots to mount onto rack or solar mounting plate\n\t\ttranslate([-10, -2]) {\n\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t\ttranslate([0, 83])\n\t\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t}\n\t\ttranslate([+125, -2]) {\n\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t\ttranslate([0, 83])\n\t\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t}\n\t}\n}\n","old_contents":"$quality = 25;\n\nslot_long = 20;\nslot_short = 5;\nslot_rounding = 0.5;\n\nmodule powerboost(x, y) {\n\twide_hole_spacing = 16.5;\n\tclose_hole_spacing = 13;\n\tholes_apart_spacing = 23;\n\n translate([x,y]) {\n\t\ttranslate([-(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-10.75, -8])\n\t\t\tsquare([5, 15], r=slot_rounding);\n }\n}\n\n\nmodule powerboost_rev(x, y) {\n\twide_hole_spacing = 13;\n\tclose_hole_spacing = 16.5;\n\tholes_apart_spacing = 23;\n\n translate([x,y]) {\n\t\ttranslate([-(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(wide_hole_spacing\/2), -(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(close_hole_spacing\/2), +(holes_apart_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+5.75, -7])\n\t\t\tsquare([5, 15], r=slot_rounding);\n }\n}\n\n\nmodule powercell(x, y) {\n\tholes_y_spacing = 17.5;\n\tholes_x_spacing = 20.5;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-12.75, -5])\n\t\t\tsquare([5, 10], r=slot_rounding);\n\t\ttranslate([+7.75, -5])\n\t\t\tsquare([5, 10], r=slot_rounding);\n\t}\n}\n\n\nmodule charger(x, y) {\n\tholes_y_spacing = 35.5;\n\tholes_x_spacing = 25.5;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-5, +8])\n\t\t\tsquare([10, 10], r=slot_rounding);\n\t}\n}\n\nmodule fadecandy(x, y) {\n\tholes_y_spacing = 19.5;\n\tholes_x_spacing = 20.5;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-10.5, 13])\n\t\t\tsquare([21, 5], r=slot_rounding);\n\t}\n}\n\nmodule battery(x, y) {\n\tholes_y_spacing = 38;\n\tholes_x_spacing = 53;\n\n\ttranslate([x,y]) {\n\t\ttranslate([-(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([-(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), -(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t\ttranslate([+(holes_x_spacing\/2), +(holes_y_spacing \/ 2)])\n\t circle(1.5);\n\t}\n}\n\n\ndifference(r=slot_rounding) {\n\t\/\/ positive things\n\tunion(r=5) {\n\t\ttranslate([-20, -15])\n\t\t\tsquare([160, 130], r=5);\n\t}\n\t\/\/ negative things\n\tunion() {\n\t\tpowercell(20, 14);\n\t\tpowerboost(50, 14);\n\n\t\tcharger(50, 50);\n\t\tfadecandy(14, 50);\n\n\t\tpowercell(20, 86);\n\t\tpowerboost_rev(50, 86);\n\n\t\tbattery(100,50);\n\n\t\t\/\/ slots to mount onto rack or solar mounting plate\n\t\ttranslate([-10, -2]) {\n\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t\ttranslate([0, 83])\n\t\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t}\n\t\ttranslate([+125, -2]) {\n\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t\ttranslate([0, 83])\n\t\t\t\tsquare([slot_short, slot_long], r=slot_rounding);\n\t\t}\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"45d34cb29e1dfc8bdbc6c53fb8d545c5630ec744","subject":"added switch","message":"added switch\n","repos":"coreyabshire\/marv,coreyabshire\/marv","old_file":"scad\/switches.scad","new_file":"scad\/switches.scad","new_contents":"module big_toggle_switch () {\n cd = [12.7, 7, 10]; \/\/ cube dimensions\n bh = 9; \/\/ barrel height\n \/\/ bottom part\n color(\"red\") translate([-cd[0] \/ 2, -cd[1] \/ 2, 0]) \n cube(cd);\n \/\/ barrel part\n color(\"silver\") translate([0, 0, cd[2]]) \n cylinder(d=6.09, h=bh);\n \/\/ toggle part\n color(\"silver\") translate([0, 0, cd[2]+bh-1]) rotate([0,15,0]) \n cylinder(d=3, h=10+1);\n}\n\nbig_toggle_switch();","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/switches.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9158711d98800b36f2ca22e90b9be07ea41c754a","subject":"The is a sample .scad file created by the onebeartoe Native Customizer.","message":"The is a sample .scad file created by the onebeartoe Native Customizer.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/office\/keyboard\/keycaps\/cherry-mx\/letter-key-test.scad-CUSTOMIZER.scad","new_file":"OpenSCAD\/src\/main\/openscad\/office\/keyboard\/keycaps\/cherry-mx\/letter-key-test.scad-CUSTOMIZER.scad","new_contents":"\r\n\r\n\/\/ font list from:\r\n\/\/ http:\/\/worknotes.scripting.com\/february2012\/22612ByDw\/listOfGoogleFonts\r\n\/\/ http:\/\/static.scripting.com\/google\/webFontNames.txt\r\nfont = \"Arial:style=Bold\"; \/\/ [\"Arial:style=Bold\", \"ABeeZee\", \"Abel\", \"Abril Fatface\", \"Aclonica\", \"Acme\", \"Actor\", \"Adamina\", \"Advent Pro\", \"Aguafina Script\", \"Akronim\", \"Aladin\", \"Aldrich\", \"Alef\", \"Alegreya\", \"Alegreya SC\", \"Alegreya Sans\", \"Alegreya Sans SC\", \"Alex Brush\", \"Alfa Slab One\", \"Alice\", \"Alike\", \"Alike Angular\", \"Allan\", \"Allerta\", \"Allerta Stencil\", \"Allura\", \"Almendra\", \"Almendra Display\", \"Almendra SC\", \"Amarante\", \"Amaranth\", \"Amatic SC\", \"Amethysta\", \"Amiri\", \"Amita\", \"Anaheim\", \"Andada\", \"Andika\", \"Angkor\", \"Annie Use Your Telescope\", \"Anonymous Pro\", \"Antic\", \"Antic Didone\", \"Antic Slab\", \"Anton\", \"Arapey\", \"Arbutus\", \"Arbutus Slab\", \"Architects Daughter\", \"Archivo Black\", \"Archivo Narrow\", \"Arimo\", \"Arizonia\", \"Armata\", \"Artifika\", \"Arvo\", \"Arya\", \"Asap\", \"Asar\", \"Asset\", \"Astloch\", \"Asul\", \"Atomic Age\", \"Aubrey\", \"Audiowide\", \"Autour One\", \"Average\", \"Average Sans\", \"Averia Gruesa Libre\", \"Averia Libre\", \"Averia Sans Libre\", \"Averia Serif Libre\", \"Bad Script\", \"Balthazar\", \"Bangers\", \"Basic\", \"Battambang\", \"Baumans\", \"Bayon\", \"Belgrano\", \"Belleza\", \"BenchNine\", \"Bentham\", \"Berkshire Swash\", \"Bevan\", \"Bigelow Rules\", \"Bigshot One\", \"Bilbo\", \"Bilbo Swash Caps\", \"Biryani\", \"Bitter\", \"Black Ops One\", \"Bokor\", \"Bonbon\", \"Boogaloo\", \"Bowlby One\", \"Bowlby One SC\", \"Brawler\", \"Bree Serif\", \"Bubblegum Sans\", \"Bubbler One\", \"Buda\", \"Buenard\", \"Butcherman\", \"Butterfly Kids\", \"Cabin\", \"Cabin Condensed\", \"Cabin Sketch\", \"Caesar Dressing\", \"Cagliostro\", \"Calligraffitti\", \"Cambay\", \"Cambo\", \"Candal\", \"Cantarell\", \"Cantata One\", \"Cantora One\", \"Capriola\", \"Cardo\", \"Carme\", \"Carrois Gothic\", \"Carrois Gothic SC\", \"Carter One\", \"Catamaran\", \"Caudex\", \"Caveat\", \"Caveat Brush\", \"Cedarville Cursive\", \"Ceviche One\", \"Changa One\", \"Chango\", \"Chau Philomene One\", \"Chela One\", \"Chelsea Market\", \"Chenla\", \"Cherry Cream Soda\", \"Cherry Swash\", \"Chewy\", \"Chicle\", \"Chivo\", \"Chonburi\", \"Cinzel\", \"Cinzel Decorative\", \"Clicker Script\", \"Coda\", \"Coda Caption\", \"Codystar\", \"Combo\", \"Comfortaa\", \"Coming Soon\", \"Concert One\", \"Condiment\", \"Content\", \"Contrail One\", \"Convergence\", \"Cookie\", \"Copse\", \"Corben\", \"Courgette\", \"Cousine\", \"Coustard\", \"Covered By Your Grace\", \"Crafty Girls\", \"Creepster\", \"Crete Round\", \"Crimson Text\", \"Croissant One\", \"Crushed\", \"Cuprum\", \"Cutive\", \"Cutive Mono\", \"Damion\", \"Dancing Script\", \"Dangrek\", \"Dawning of a New Day\", \"Days One\", \"Dekko\", \"Delius\", \"Delius Swash Caps\", \"Delius Unicase\", \"Della Respira\", \"Denk One\", \"Devonshire\", \"Dhurjati\", \"Didact Gothic\", \"Diplomata\", \"Diplomata SC\", \"Domine\", \"Donegal One\", \"Doppio One\", \"Dorsa\", \"Dosis\", \"Dr Sugiyama\", \"Droid Sans\", \"Droid Sans Mono\", \"Droid Serif\", \"Duru Sans\", \"Dynalight\", \"EB Garamond\", \"Eagle Lake\", \"Eater\", \"Economica\", \"Eczar\", \"Ek Mukta\", \"Electrolize\", \"Elsie\", \"Elsie Swash Caps\", \"Emblema One\", \"Emilys Candy\", \"Engagement\", \"Englebert\", \"Enriqueta\", \"Erica One\", \"Esteban\", \"Euphoria Script\", \"Ewert\", \"Exo\", \"Exo 2\", \"Expletus Sans\", \"Fanwood Text\", \"Fascinate\", \"Fascinate Inline\", \"Faster One\", \"Fasthand\", \"Fauna One\", \"Federant\", \"Federo\", \"Felipa\", \"Fenix\", \"Finger Paint\", \"Fira Mono\", \"Fira Sans\", \"Fjalla One\", \"Fjord One\", \"Flamenco\", \"Flavors\", \"Fondamento\", \"Fontdiner Swanky\", \"Forum\", \"Francois One\", \"Freckle Face\", \"Fredericka the Great\", \"Fredoka One\", \"Freehand\", \"Fresca\", \"Frijole\", \"Fruktur\", \"Fugaz One\", \"GFS Didot\", \"GFS Neohellenic\", \"Gabriela\", \"Gafata\", \"Galdeano\", \"Galindo\", \"Gentium Basic\", \"Gentium Book Basic\", \"Geo\", \"Geostar\", \"Geostar Fill\", \"Germania One\", \"Gidugu\", \"Gilda Display\", \"Give You Glory\", \"Glass Antiqua\", \"Glegoo\", \"Gloria Hallelujah\", \"Goblin One\", \"Gochi Hand\", \"Gorditas\", \"Goudy Bookletter 1911\", \"Graduate\", \"Grand Hotel\", \"Gravitas One\", \"Great Vibes\", \"Griffy\", \"Gruppo\", \"Gudea\", \"Gurajada\", \"Habibi\", \"Halant\", \"Hammersmith One\", \"Hanalei\", \"Hanalei Fill\", \"Handlee\", \"Hanuman\", \"Happy Monkey\", \"Headland One\", \"Henny Penny\", \"Herr Von Muellerhoff\", \"Hind\", \"Hind Siliguri\", \"Hind Vadodara\", \"Holtwood One SC\", \"Homemade Apple\", \"Homenaje\", \"IM Fell DW Pica\", \"IM Fell DW Pica SC\", \"IM Fell Double Pica\", \"IM Fell Double Pica SC\", \"IM Fell English\", \"IM Fell English SC\", \"IM Fell French Canon\", \"IM Fell French Canon SC\", \"IM Fell Great Primer\", \"IM Fell Great Primer SC\", \"Iceberg\", \"Iceland\", \"Imprima\", \"Inconsolata\", \"Inder\", \"Indie Flower\", \"Inika\", \"Inknut Antiqua\", \"Irish Grover\", \"Istok Web\", \"Italiana\", \"Italianno\", \"Itim\", \"Jacques Francois\", \"Jacques Francois Shadow\", \"Jaldi\", \"Jim Nightshade\", \"Jockey One\", \"Jolly Lodger\", \"Josefin Sans\", \"Josefin Slab\", \"Joti One\", \"Judson\", \"Julee\", \"Julius Sans One\", \"Junge\", \"Jura\", \"Just Another Hand\", \"Just Me Again Down Here\", \"Kadwa\", \"Kalam\", \"Kameron\", \"Kantumruy\", \"Karla\", \"Karma\", \"Kaushan Script\", \"Kavoon\", \"Kdam Thmor\", \"Keania One\", \"Kelly Slab\", \"Kenia\", \"Khand\", \"Khmer\", \"Khula\", \"Kite One\", \"Knewave\", \"Kotta One\", \"Koulen\", \"Kranky\", \"Kreon\", \"Kristi\", \"Krona One\", \"Kurale\", \"La Belle Aurore\", \"Laila\", \"Lakki Reddy\", \"Lancelot\", \"Lateef\", \"Lato\", \"League Script\", \"Leckerli One\", \"Ledger\", \"Lekton\", \"Lemon\", \"Libre Baskerville\", \"Life Savers\", \"Lilita One\", \"Lily Script One\", \"Limelight\", \"Linden Hill\", \"Lobster\", \"Lobster Two\", \"Londrina Outline\", \"Londrina Shadow\", \"Londrina Sketch\", \"Londrina Solid\", \"Lora\", \"Love Ya Like A Sister\", \"Loved by the King\", \"Lovers Quarrel\", \"Luckiest Guy\", \"Lusitana\", \"Lustria\", \"Macondo\", \"Macondo Swash Caps\", \"Magra\", \"Maiden Orange\", \"Mako\", \"Mallanna\", \"Mandali\", \"Marcellus\", \"Marcellus SC\", \"Marck Script\", \"Margarine\", \"Marko One\", \"Marmelad\", \"Martel\", \"Martel Sans\", \"Marvel\", \"Mate\", \"Mate SC\", \"Maven Pro\", \"McLaren\", \"Meddon\", \"MedievalSharp\", \"Medula One\", \"Megrim\", \"Meie Script\", \"Merienda\", \"Merienda One\", \"Merriweather\", \"Merriweather Sans\", \"Metal\", \"Metal Mania\", \"Metamorphous\", \"Metrophobic\", \"Michroma\", \"Milonga\", \"Miltonian\", \"Miltonian Tattoo\", \"Miniver\", \"Miss Fajardose\", \"Modak\", \"Modern Antiqua\", \"Molengo\", \"Molle\", \"Monda\", \"Monofett\", \"Monoton\", \"Monsieur La Doulaise\", \"Montaga\", \"Montez\", \"Montserrat\", \"Montserrat Alternates\", \"Montserrat Subrayada\", \"Moul\", \"Moulpali\", \"Mountains of Christmas\", \"Mouse Memoirs\", \"Mr Bedfort\", \"Mr Dafoe\", \"Mr De Haviland\", \"Mrs Saint Delafield\", \"Mrs Sheppards\", \"Muli\", \"Mystery Quest\", \"NTR\", \"Neucha\", \"Neuton\", \"New Rocker\", \"News Cycle\", \"Niconne\", \"Nixie One\", \"Nobile\", \"Nokora\", \"Norican\", \"Nosifer\", \"Nothing You Could Do\", \"Noticia Text\", \"Noto Sans\", \"Noto Serif\", \"Nova Cut\", \"Nova Flat\", \"Nova Mono\", \"Nova Oval\", \"Nova Round\", \"Nova Script\", \"Nova Slim\", \"Nova Square\", \"Numans\", \"Nunito\", \"Odor Mean Chey\", \"Offside\", \"Old Standard TT\", \"Oldenburg\", \"Oleo Script\", \"Oleo Script Swash Caps\", \"Open Sans\", \"Open Sans Condensed\", \"Oranienbaum\", \"Orbitron\", \"Oregano\", \"Orienta\", \"Original Surfer\", \"Oswald\", \"Over the Rainbow\", \"Overlock\", \"Overlock SC\", \"Ovo\", \"Oxygen\", \"Oxygen Mono\", \"PT Mono\", \"PT Sans\", \"PT Sans Caption\", \"PT Sans Narrow\", \"PT Serif\", \"PT Serif Caption\", \"Pacifico\", \"Palanquin\", \"Palanquin Dark\", \"Paprika\", \"Parisienne\", \"Passero One\", \"Passion One\", \"Pathway Gothic One\", \"Patrick Hand\", \"Patrick Hand SC\", \"Patua One\", \"Paytone One\", \"Peddana\", \"Peralta\", \"Permanent Marker\", \"Petit Formal Script\", \"Petrona\", \"Philosopher\", \"Piedra\", \"Pinyon Script\", \"Pirata One\", \"Plaster\", \"Play\", \"Playball\", \"Playfair Display\", \"Playfair Display SC\", \"Podkova\", \"Poiret One\", \"Poller One\", \"Poly\", \"Pompiere\", \"Pontano Sans\", \"Poppins\", \"Port Lligat Sans\", \"Port Lligat Slab\", \"Pragati Narrow\", \"Prata\", \"Preahvihear\", \"Press Start 2P\", \"Princess Sofia\", \"Prociono\", \"Prosto One\", \"Puritan\", \"Purple Purse\", \"Quando\", \"Quantico\", \"Quattrocento\", \"Quattrocento Sans\", \"Questrial\", \"Quicksand\", \"Quintessential\", \"Qwigley\", \"Racing Sans One\", \"Radley\", \"Rajdhani\", \"Raleway\", \"Raleway Dots\", \"Ramabhadra\", \"Ramaraja\", \"Rambla\", \"Rammetto One\", \"Ranchers\", \"Rancho\", \"Ranga\", \"Rationale\", \"Ravi Prakash\", \"Redressed\", \"Reenie Beanie\", \"Revalia\", \"Rhodium Libre\", \"Ribeye\", \"Ribeye Marrow\", \"Righteous\", \"Risque\", \"Roboto\", \"Roboto Condensed\", \"Roboto Mono\", \"Roboto Slab\", \"Rochester\", \"Rock Salt\", \"Rokkitt\", \"Romanesco\", \"Ropa Sans\", \"Rosario\", \"Rosarivo\", \"Rouge Script\", \"Rozha One\", \"Rubik\", \"Rubik Mono One\", \"Rubik One\", \"Ruda\", \"Rufina\", \"Ruge Boogie\", \"Ruluko\", \"Rum Raisin\", \"Ruslan Display\", \"Russo One\", \"Ruthie\", \"Rye\", \"Sacramento\", \"Sahitya\", \"Sail\", \"Salsa\", \"Sanchez\", \"Sancreek\", \"Sansita One\", \"Sarala\", \"Sarina\", \"Sarpanch\", \"Satisfy\", \"Scada\", \"Scheherazade\", \"Schoolbell\", \"Seaweed Script\", \"Sevillana\", \"Seymour One\", \"Shadows Into Light\", \"Shadows Into Light Two\", \"Shanti\", \"Share\", \"Share Tech\", \"Share Tech Mono\", \"Shojumaru\", \"Short Stack\", \"Siemreap\", \"Sigmar One\", \"Signika\", \"Signika Negative\", \"Simonetta\", \"Sintony\", \"Sirin Stencil\", \"Six Caps\", \"Skranji\", \"Slabo 13px\", \"Slabo 27px\", \"Slackey\", \"Smokum\", \"Smythe\", \"Sniglet\", \"Snippet\", \"Snowburst One\", \"Sofadi One\", \"Sofia\", \"Sonsie One\", \"Sorts Mill Goudy\", \"Source Code Pro\", \"Source Sans Pro\", \"Source Serif Pro\", \"Special Elite\", \"Spicy Rice\", \"Spinnaker\", \"Spirax\", \"Squada One\", \"Sree Krushnadevaraya\", \"Stalemate\", \"Stalinist One\", \"Stardos Stencil\", \"Stint Ultra Condensed\", \"Stint Ultra Expanded\", \"Stoke\", \"Strait\", \"Sue Ellen Francisco\", \"Sumana\", \"Sunshiney\", \"Supermercado One\", \"Sura\", \"Suranna\", \"Suravaram\", \"Suwannaphum\", \"Swanky and Moo Moo\", \"Syncopate\", \"Tangerine\", \"Taprom\", \"Tauri\", \"Teko\", \"Telex\", \"Tenali Ramakrishna\", \"Tenor Sans\", \"Text Me One\", \"The Girl Next Door\", \"Tienne\", \"Tillana\", \"Timmana\", \"Tinos\", \"Titan One\", \"Titillium Web\", \"Trade Winds\", \"Trocchi\", \"Trochut\", \"Trykker\", \"Tulpen One\", \"Ubuntu\", \"Ubuntu Condensed\", \"Ubuntu Mono\", \"Ultra\", \"Uncial Antiqua\", \"Underdog\", \"Unica One\", \"UnifrakturCook\", \"UnifrakturMaguntia\", \"Unkempt\", \"Unlock\", \"Unna\", \"VT323\", \"Vampiro One\", \"Varela\", \"Varela Round\", \"Vast Shadow\", \"Vesper Libre\", \"Vibur\", \"Vidaloka\", \"Viga\", \"Voces\", \"Volkhov\", \"Vollkorn\", \"Voltaire\", \"Waiting for the Sunrise\", \"Wallpoet\", \"Walter Turncoat\", \"Warnes\", \"Wellfleet\", \"Wendy One\", \"Wire One\", \"Work Sans\", \"Yanone Kaffeesatz\", \"Yantramanav\", \"Yellowtail\", \"Yeseva One\", \"Yesteryear\", \"Zeyada\"]\r\nrowSpacing = -50;\r\nxLowercaseOffset = -37;\r\nxUppercaseOffset = xLowercaseOffset - 0.5;\r\n\r\nsingleLetter = \"D\";\r\n\t\r\n\/\/showHellowWorld = true;\r\n\/\/showLowercase = true;\r\n\/\/showUppercase = true;\r\n\/\/showWindings = true;\r\n\/\/showNumbers = true;\r\nshowIconKeys = true;\r\n\/\/showSingleKeycap = true;\r\nif(showHellowWorld)\r\n{\r\n\tkeyCapString([\"H\", \"e\",\"l\",\"l\",\"o\",\" \", \"w\",\"o\",\"r\",\"l\",\"d\"], xOffset=xUppercaseOffset);\r\n}\r\n\r\nif(showLowercase)\r\n{\r\n\ttranslate([0, rowSpacing, 0])\r\n\taphabetKeycaps(xLowercaseOffset);\r\n}\r\n\r\nif(showUppercase)\r\n{\r\n\t\r\n\ttranslate([0, rowSpacing*2, 0])\r\n\tuppercaseAphabetCaps(xUppercaseOffset);\r\n}\r\n\r\nif(showWindings)\r\n{\r\n\tfont = \"Wingdings\";\/\/:style=Italic\";\r\n\ttranslate([0, rowSpacing*3, 0])\r\n\tuppercaseAphabetCaps(xOffset=xUppercaseOffset, font=font);\t\t\r\n}\r\n\r\n\r\nif(showNumbers)\r\n{\r\n\ttranslate([0, rowSpacing*4, 0])\r\n\tkeyCapString([\"0\", \"1\",\"2\",\"3\",\"4\",\"5\", \"6\",\"7\",\"8\",\"9\"], xOffset=xUppercaseOffset);\r\n}\r\n\r\nif(showIconKeys)\r\n{\r\n\t\/\/ Next are the keycaps with icons as the legend (thanks Michael Hall for letting me know that the symbol on the key is referred to a as the 'legend'.\r\n\ttranslate([0, rowSpacing*5, 0])\r\n\ticonKeycapDemo();\r\n}\r\n\r\nif(showSingleKeycap)\r\n{\r\n\ttranslate([0, rowSpacing*6, 0])\r\n\tkeyCapString([singleLetter], xOffset=xUppercaseOffset);\r\n}\r\n\r\nshowBassClef = 1;\r\nshowBatman = 1;\r\nshowCat = 1;\r\nshowHeart = 1;\r\nshowLuigi = 1;\r\nshowOshw = 1;\r\nshowRebel = 1;\r\nshowStar = 1;\r\nshowTrebleClef = 1;\r\nshowThundercat = 1;\r\nshowTrooper = 1;\r\nmodule iconKeycapDemo()\r\n{\r\n\tif(showBassClef)\r\n\t{\r\n\t\ticonKeycap(\"Bass Clef\", xOffset=-34, yOffset=2, xyScale=0.4);\r\n\t}\r\n\r\n\tif(showBatman)\r\n\t{\r\n\t\ttranslate([rowSpacing*10, 0, 0])\r\n\t\ticonKeycap(\"Batman\", xOffset=-33.7, yOffset=2.4, xyScale=0.52);\r\n\t}\t\r\n\t\r\n\tif(showCat)\r\n\t{\r\n\t\ttranslate([rowSpacing, 0, 0])\r\n\t\ticonKeycap(\"Cat\", xOffset=-34, yOffset=2, xyScale=0.53);\r\n\t}\r\n\t\r\n\trowSpacing = 30;\r\n\t\r\n\tif(showLuigi)\r\n\t{\r\n\t\ttranslate([rowSpacing*2, 0, 0])\r\n\t\ticonKeycap(\"Luigi\", xOffset=-34, yOffset=2.5, xyScale=0.59, iconHeight=1.2);\r\n\t}\r\n\t\r\n\tif(showThundercat)\r\n\t{\r\n\t\ttranslate([rowSpacing*3, 0, 0])\r\n\t\ticonKeycap(\"Thundercat\", xOffset=-34, yOffset=2, xyScale=0.5);\r\n\t}\r\n\t\r\n\tif(showTrebleClef)\r\n\t{\r\n\t\ttranslate([rowSpacing*4, 0, 0])\r\n\t\ticonKeycap(\"Treble Clef\", xOffset=-34, yOffset=2, xyScale=0.5);\r\n\t}\r\n\t\r\n\tif(showTrooper)\r\n\t{\r\n\t\ttranslate([rowSpacing*5, 0, 0])\r\n\t\ticonKeycap(\"Trooper\", xOffset=-34, yOffset=2.4, xyScale=0.6);\t\t\r\n\t}\r\n\t\r\n\tif(showRebel)\r\n\t{\r\n\t\ttranslate([rowSpacing*6, 0, 0])\r\n\t\ticonKeycap(\"Rebel\", xOffset=-34, yOffset=2.4, xyScale=0.53);\t\t\r\n\t}\r\n\t\r\n\tif(showStar)\r\n\t{\r\n\t\ttranslate([rowSpacing*7, 0, 0])\r\n\t\ticonKeycap(\"Star\", xOffset=-34, yOffset=2.4, xyScale=0.58);\r\n\t}\r\n\t\r\n\tif(showHeart)\r\n\t{\r\n\t\ttranslate([rowSpacing*8, 0, 0])\r\n\t\ticonKeycap(\"Heart\", xOffset=-33.7, yOffset=2.4, xyScale=0.52);\t\t\r\n\t}\r\n\t\r\n\tif(showOshw)\r\n\t{\r\n\t\ttranslate([rowSpacing*9, 0, 0])\r\n\t\ticonKeycap(\"OSHW\", xOffset=-33.7, yOffset=2.4, xyScale=0.52);\r\n\t}\r\n}\r\n\r\n\r\n\r\n\r\nmodule aphabetKeycaps(xOffset, font)\r\n{\r\n\talphabet = [\"a\", \"b\", \"c\", \"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\r\n\t\r\n\tkeyCapString(alphabet, xOffset, font);\r\n}\r\n\r\nmodule blankKey()\r\n{\r\n\/\/\ttranslate([0, 0, 11])\r\n\/\/\trotate([180,0,0])\r\n\tblankKeycap();\r\n}\r\n\r\nmodule iconKeycap(name, xOffset, yOffset, xyScale, iconColor, iconHeight=1)\r\n{\r\n\tunion()\r\n\t{\r\n\t\ttranslate([0, 1, 9.5])\r\n\t\toneIcon(iconType=name, iconXyScale=xyScale, iconHeight=iconHeight, xOffset=xOffset, yOffset=yOffset, iconColor=\"green\");\r\n\t\t\r\n\t\tblankKey();\r\n\t}\r\n}\r\n\r\nmodule keyCapString(keyString, xOffset, font)\r\n{\r\n\tstrlen = len(keyString); \r\n\t\r\n\tfor(i = [0 : strlen-1])\r\n\t{\r\n\t\tl = keyString[i];\r\n\t\ttranslate([i*30, 0, 0])\r\n\t\toneAlphanumericKey(l, xOffset, font);\r\n\t}\r\n}\r\n\r\nmodule oneAlphanumericKey(letter, xOffset, font)\r\n{\t\r\n\tunion()\r\n\t{\r\n\t\tfontSize = 7.5;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([xOffset, 1, 9.5])\r\n\t\tlinear_extrude(height=2)\r\n\t\ttext(letter, font=font, size=fontSize);\r\n\t\t\r\n\t\tblankKey();\r\n\t}\t\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset, yOffset, iconColor)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbassClefThumbnail();\r\n }\r\n else if(iconType == \"Batman\")\r\n {\r\n \tbatmanLogoThumbnail();\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n \tcatThumbnail();\r\n }\r\n else if(iconType == \"Heart\")\r\n {\r\n \theartThumbnail();\r\n }\r\n\telse if(iconType == \"Luigi\")\r\n\t{\r\n\t\tluigiThumbnail();\r\n\t}\r\n\telse if(iconType == \"OSHW\")\r\n\t{\r\n\t\toshwLogoThumbnail();\r\n\t}\r\n\telse if(iconType == \"Rebel\")\r\n\t{\r\n\t\trebelAllianceThumbnail();\r\n\t} \r\n else if(iconType == \"Star\")\r\n {\r\n \tstarThumbnail();\r\n } \r\n\telse if(iconType== \"Treble Clef\")\r\n\t{\r\n\t\ttrebleClefScaledDownThumbnail();\r\n\t}\r\n\telse if(iconType == \"Trooper\")\r\n\t{\r\n\t\tscrumTrooperThumbnail();\r\n\t}\r\n\telse if(iconType == \"Thundercat\")\r\n\t{\r\n\t\tthundercatsLogoThumbnail();\r\n\t}\r\n else\r\n {\r\n echo(\"drawing no icons\", iconType);\r\n }\r\n}\t\r\n\r\nmodule uppercaseAphabetCaps(xOffset, font)\r\n{\r\n\talphabet = [\"A\", \"B\", \"C\", \"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"];\r\n\t\r\n\tkeyCapString(alphabet, xOffset, font);\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule cat(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule catThumbnail()\r\n{\r\n\txyScale = .37;\r\n\tscale([xyScale, xyScale, 1])\t\r\n\tcat();\r\n}\r\n\r\nmodule batmanLogo(height=1)\r\n{\r\n color([0.15,0.15,0.15])\r\n linear_extrude(height = height, center = true, convexity = 10, twist = 0)\r\n difference()\r\n {\r\n \r\n translate([0,20,0])\r\n polygon(points=[[-9.8, -14], [9.8,-14],[3.8, 14],[-3.8, 14] ],paths=[[0,1,2,3]], convexity=10);\r\n \r\n translate([0,30,0])\r\n polygon(points=[[-2, -8], [2,-8],[12, 8],[-12, 8] ],paths=[[0,1,2,3]], convexity=10);\r\n }\r\n \r\n color([0.15,0.15,0.15])\r\n linear_extrude(height = height, center = true, convexity = 10, twist = 0)\r\n difference()\r\n {\r\n projection(cut=true) \r\n rotate([0,50,0])\r\n cylinder(r=30, h=200, center=true);\r\n \r\n translate([-8,-23,0]) \r\n rotate([0,0,-60])\r\n projection(cut=true)\r\n rotate([0,62,0])\r\n cylinder(r=7, h=200, center=true);\r\n \r\n translate([8,-23,0]) \r\n rotate([0,0,60])\r\n projection(cut=true)\r\n rotate([0,62,0])\r\n cylinder(r=7, h=200, center=true);\r\n \r\n translate([-18,-24,0]) \r\n rotate([0,0,-50])\r\n projection(cut=true)\r\n rotate([0,67,0])\r\n cylinder(r=7, h=200, center=true);\r\n \r\n translate([18,-24,0]) \r\n rotate([0,0,50])\r\n projection(cut=true)\r\n rotate([0,67,0])\r\n cylinder(r=7, h=200, center=true);\r\n \r\n union()\r\n {\r\n \r\n translate([-7,25,0]) \r\n rotate([0,0,30])\r\n projection(cut=true)\r\n rotate([0,45,0])\r\n cylinder(r=13, h=200, center=true);\r\n \r\n translate([7,25,0]) \r\n rotate([0,0,-30])\r\n projection(cut=true)\r\n rotate([0,45,0])\r\n cylinder(r=13, h=200, center=true);\r\n }\r\n }\r\n}\r\n\r\nmodule batmanLogoThumbnail()\r\n{\r\n\txyScale = 0.27;\r\n\ttranslate([0.4, -0.3, 0])\r\n\tscale([xyScale, xyScale, 2.78])\t\r\n\tbatmanLogo();\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule luigi(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigiThumbnail()\r\n{\r\n\txyScale = 0.084;\r\n\tscale([xyScale, xyScale, 1])\r\n\tluigi();\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\n\/**\r\n * this is the bass clef scalled down to 15% of the original\r\n *\/\r\nmodule bassClef(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule bassClefThumbnail()\r\n{\r\n\txyScale = 0.489;\r\n\tscale([xyScale, xyScale, 1])\r\n\tbassClef(h=1);\t\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule trebleClefScaledDown(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDownThumbnail()\r\n{\r\n\txyScale = 0.18;\r\n\tscale([xyScale, xyScale, 1])\r\n\ttrebleClefScaledDown();\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule oshwLogo(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-16.500000,-266.590625],[31.500000,-266.590625],[35.913750,-266.534375],[38.183906,-266.198281],[40.020000,-265.420625],[41.923281,-262.160625],[43.351250,-256.703125],[45.100000,-246.590625],[52.700000,-205.590625],[56.200000,-188.630625],[58.567813,-185.469375],[61.927500,-183.260625],[69.500000,-180.170625],[109.500000,-163.940625],[111.590645,-163.768535],[113.705781,-164.161406],[117.908750,-166.156875],[125.500000,-171.590625],[163.500000,-197.590625],[172.651250,-204.133125],[177.878906,-206.627187],[180.314082,-207.006445],[182.500000,-206.550625],[185.527031,-204.348437],[189.556250,-200.603125],[196.500000,-193.590625],[226.500000,-163.590625],[233.782500,-156.415625],[236.459063,-152.104375],[236.948320,-149.859687],[236.640000,-147.590625],[232.182500,-140.150625],[226.840000,-132.590625],[204.170000,-99.590625],[198.735000,-91.575625],[195.943438,-86.959688],[194.530000,-83.590625],[194.728750,-80.508125],[195.790000,-77.590625],[211.220000,-41.590625],[214.612500,-33.441875],[216.859063,-29.472969],[219.610000,-26.680625],[222.902969,-25.382031],[227.661250,-24.241875],[236.500000,-22.590625],[276.500000,-15.190625],[286.612500,-13.441875],[292.070000,-12.013906],[295.330000,-10.110625],[296.107656,-8.274531],[296.443750,-6.004375],[296.500000,-1.590625],[296.500000,61.409375],[296.451250,65.389375],[295.480000,69.129375],[294.216465,70.392695],[292.297969,71.428438],[287.243750,72.941875],[277.500000,74.609375],[241.500000,81.329375],[231.588750,83.055625],[222.540000,85.389375],[219.320156,88.367812],[216.851250,92.544375],[213.300000,101.409375],[196.980000,142.409375],[196.633398,144.880859],[196.950313,147.303125],[199.030000,151.971875],[205.160000,160.409375],[229.160000,195.409375],[234.117500,202.710625],[236.329062,206.919531],[237.050000,210.409375],[235.319687,214.041250],[231.757500,218.276875],[224.500000,225.409375],[196.500000,253.409375],[189.608750,260.354375],[185.617031,264.009687],[182.500000,266.189375],[180.431699,266.602383],[178.116719,266.266563],[173.136250,264.024375],[164.500000,257.989375],[130.500000,234.549375],[123.356250,229.544375],[119.259844,227.577187],[115.500000,227.209375],[96.500000,236.989375],[91.782500,239.339375],[89.162188,240.012813],[86.720000,239.769375],[84.989063,238.543438],[83.657500,236.621875],[81.780000,232.409375],[72.700000,210.409375],[42.900000,138.409375],[35.080000,119.409375],[33.190000,114.981875],[32.260000,110.419375],[32.972891,108.478281],[34.582500,106.401250],[39.522500,102.131875],[49.500000,95.179375],[57.860156,87.966563],[64.533750,80.444375],[70.125469,72.097188],[75.240000,62.409375],[77.913306,56.103069],[79.938008,49.652520],[81.332534,43.096531],[82.115312,36.473906],[81.919336,23.183965],[79.497500,10.093125],[74.997227,-2.488184],[68.565938,-14.249531],[60.351055,-24.880488],[50.500000,-34.070625],[44.132363,-38.671934],[37.722656,-42.482344],[31.219434,-45.552832],[24.571250,-47.934375],[17.726660,-49.677949],[10.634219,-50.834531],[-4.500000,-51.590625],[-12.808906,-50.868750],[-20.983750,-49.033125],[-28.916719,-46.286250],[-36.500000,-42.830625],[-43.849888,-38.623169],[-50.622070,-33.779414],[-56.794077,-28.357280],[-62.343437,-22.414687],[-67.247681,-16.009556],[-71.484336,-9.199805],[-75.030933,-2.043354],[-77.865000,5.401875],[-79.964067,13.077964],[-81.305664,20.926992],[-81.867319,28.891040],[-81.626563,36.912188],[-80.560923,44.932515],[-78.647930,52.894102],[-75.865112,60.739028],[-72.190000,68.409375],[-66.680937,77.253594],[-60.562500,84.788125],[-53.585312,91.540781],[-45.500000,98.039375],[-37.368750,103.516875],[-33.598906,106.893125],[-32.412598,108.660234],[-31.930000,110.449375],[-33.132500,115.478125],[-35.220000,120.409375],[-42.700000,138.409375],[-72.080000,209.409375],[-80.700000,230.409375],[-82.777500,235.313125],[-84.204375,237.720469],[-85.890000,239.369375],[-88.556094,240.028281],[-91.356250,239.390625],[-96.500000,236.719375],[-115.500000,227.149375],[-118.082500,227.133125],[-120.500000,228.069375],[-162.500000,256.739375],[-170.973750,262.574375],[-175.838281,265.477812],[-179.500000,266.789375],[-181.384844,266.498496],[-183.401875,265.566719],[-187.562500,262.415625],[-194.500000,255.409375],[-226.500000,223.409375],[-232.957500,216.975625],[-235.795312,213.122656],[-236.880000,209.409375],[-235.567031,205.754688],[-232.661250,200.879375],[-226.830000,192.409375],[-205.500000,161.409375],[-200.568750,154.221875],[-196.440000,147.409375],[-196.385938,143.771719],[-197.605000,139.390625],[-200.900000,131.409375],[-217.910000,89.449375],[-221.127969,86.020938],[-225.211250,84.229375],[-234.500000,82.609375],[-277.500000,74.609375],[-287.240000,72.863125],[-292.338750,71.331406],[-295.480000,69.129375],[-296.451250,65.389375],[-296.500000,61.409375],[-296.500000,-1.590625],[-296.447500,-5.591875],[-295.480000,-9.360625],[-294.130527,-10.698750],[-292.007969,-11.819375],[-286.333750,-13.505625],[-275.500000,-15.340625],[-233.500000,-23.170625],[-228.029687,-24.003906],[-223.090000,-25.066875],[-218.810313,-27.286719],[-215.320000,-31.590625],[-198.500000,-70.590625],[-195.253750,-77.966875],[-194.330469,-81.892656],[-194.820000,-85.590625],[-206.780000,-103.590625],[-227.360000,-133.590625],[-233.807500,-142.723125],[-236.275625,-148.018750],[-236.677656,-150.451875],[-236.280000,-152.590625],[-232.905156,-157.004062],[-226.726250,-163.508125],[-215.500000,-174.590625],[-191.500000,-198.590625],[-186.401250,-203.671875],[-183.398594,-205.983281],[-180.500000,-207.140625],[-177.010156,-206.419688],[-172.801250,-204.208125],[-165.500000,-199.250625],[-127.500000,-173.170625],[-118.897500,-167.035625],[-113.974688,-164.522188],[-111.640898,-163.903555],[-109.500000,-163.900625],[-92.500000,-170.590625],[-61.520000,-183.410625],[-58.996719,-185.205820],[-57.110000,-187.397812],[-54.785000,-192.665625],[-52.700000,-204.590625],[-44.700000,-247.590625],[-43.212500,-257.161875],[-41.800313,-261.775469],[-39.220000,-265.570625],[-34.366406,-266.527344],[-28.178750,-266.789375],[-16.500000,-266.590625]]);\r\n }\r\n}\r\n\r\nmodule oshwLogoThumbnail()\r\n{\r\n\txyScale = 0.162;\r\n\ttranslate([0, -0.5, 0])\r\n\tscale([xyScale, xyScale, 1])\r\n\toshwLogo();\t\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule rebelAlliance(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAllianceThumbnail()\r\n{\r\n\txyScale = .044;\r\n\tscale([xyScale, xyScale, 1])\r\n rebelAlliance();\r\n}\r\n\r\nmodule heart(h=1)\r\n{\r\n rotate ([0, 0, 45])\r\n linear_extrude(height=h)\r\n flatHeart();\r\n}\r\n\r\nmodule heartThumbnail()\r\n{\t\r\n\txyScale = 0.725;\r\n\ttranslate([0, -1.5, 0])\r\n\tscale([xyScale, xyScale, 1])\r\n\theart();\r\n}\r\n\r\nmodule flatHeart()\r\n{\r\n\tsquare(20, center = true);\r\n\t\r\n\ttranslate([10,0,0])\t\r\n\tcircle(10, center = true, color=\"red\" );\r\n\t\r\n\ttranslate([0,10,0]) \r\n\tcircle(10, center = true);\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule star(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[9.080000,-22.000000],[10.922500,-17.093750],[12.213125,-14.728281],[13.890000,-13.020000],[15.773906,-12.298125],[18.041250,-12.022500],[22.500000,-11.910000],[34.390000,-10.968750],[40.862812,-10.133906],[45.500000,-9.000000],[28.500000,4.610000],[21.270000,12.170000],[22.870000,22.000000],[27.500000,43.000000],[8.500000,31.580000],[-0.500000,27.200000],[-10.500000,32.320000],[-28.500000,43.000000],[-22.870000,21.000000],[-21.690000,11.090000],[-28.500000,4.130000],[-45.500000,-11.000000],[-11.500000,-13.000000],[-0.500000,-43.000000],[2.289219,-38.828594],[4.908750,-33.096250],[9.080000,-22.000000]]);\r\n }\r\n}\r\n\r\nmodule starThumbnail(height = 1)\r\n{\r\n\txyScale = 0.9544;\r\n\tscale([xyScale, xyScale, height])\r\n\tstar();\t\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule thundercatsLogo(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule thundercatsLogoThumbnail()\r\n{\r\n\txyScale = 0.1592;\r\n\tscale([xyScale, xyScale, 1])\r\n\tthundercatsLogo();\r\n}\r\n\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule scrumTrooper(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumTrooperThumbnail()\r\n{\r\n\txyScale = .74;\r\n\tscale([xyScale, xyScale, 1])\t\r\n\tscrumTrooper();\t\r\n}\r\n\r\nmodule blankKeycap()\r\n{\r\n\ttranslate([0, 0, 11])\r\n\trotate([180,0,0])\r\n\tpolyhedron(\r\n\t\tpoints=[\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.25],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.25],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.25],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.25],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.25],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.25],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.25],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.25],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.25],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.25],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.25],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.25],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.25],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.25],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.25],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.25],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.25],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.25],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.25],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.25],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.25],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.25],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.25],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.25],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.25],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.25],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.25],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.25],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.25],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.25],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.25],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.25],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.25],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.25],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.25],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.25],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.25],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.25],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.25],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.25],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.25],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.25],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.25],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.25],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.25],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.25],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.25],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.25],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.25],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.25],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.25],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.25],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.25],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.25],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.25],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.25],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.25],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.25],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.25],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.25],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.25],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.25],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.25],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.25],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.25],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.25],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.25],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.25],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.25],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.25],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.25],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.25],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.25],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.25],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.25],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.25],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.25],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.25],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.25],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.25],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.25],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.25],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.25],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.25],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.25],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.25],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.25],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.25],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.25],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.25],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.25],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.25],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.25],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.25],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.25],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.25],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.25],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.25],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.25],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.25],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.25],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.25],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.25],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.25],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.25],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.25],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.25],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.25],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.25],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.25],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.25],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.25],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.25],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.25],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.25],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.25],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.25],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.25],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.25],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.25],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.25],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.25],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.25],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.25],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.25],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.25],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.25],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.25],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.25],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.25],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.25],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.25],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.25],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.25],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.25],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.25],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.25],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.25],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.25],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.25],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.25],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.25],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.25],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.25],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.25],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.25],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.25],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.25],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.25],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.25],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.25],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.25],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.25],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.25],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.25],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.25],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.25],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.25],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.25],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.25],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.25],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.25],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.25],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.25],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.25],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.25],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.25],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.25],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.25],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-36.448020935058594, -2.151909351348877, 9.25],\r\n\t\t\t[-36.450321197509766, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-36.450321197509766, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-36.48029327392578, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-36.48029327392578, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-36.48990249633789, -2.017145872116089, 9.25],\r\n\t\t\t[-36.48990249633789, -2.017145872116089, 9.25],\r\n\t\t\t[-36.48029327392578, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-36.49051284790039, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-36.48990249633789, -2.017145872116089, 9.25],\r\n\t\t\t[-36.49051284790039, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-36.486907958984375, -1.9516050815582275, 9.25],\r\n\t\t\t[-36.486907958984375, -1.9516050815582275, 9.25],\r\n\t\t\t[-36.49051284790039, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-36.48029327392578, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-36.486907958984375, -1.9516050815582275, 9.25],\r\n\t\t\t[-36.48029327392578, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.48029327392578, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.450321197509766, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-36.43290328979492, -1.8212249279022217, 9.25],\r\n\t\t\t[-36.43290328979492, -1.8212249279022217, 9.25],\r\n\t\t\t[-36.450321197509766, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-36.43290328979492, -1.8212249279022217, 9.25],\r\n\t\t\t[-36.402645111083984, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-36.38031005859375, -1.7656630277633667, 9.25],\r\n\t\t\t[-36.38031005859375, -1.7656630277633667, 9.25],\r\n\t\t\t[-36.402645111083984, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.38031005859375, -1.7656630277633667, 9.25],\r\n\t\t\t[-36.34051513671875, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.315372467041016, -1.7252109050750732, 9.25],\r\n\t\t\t[-36.315372467041016, -1.7252109050750732, 9.25],\r\n\t\t\t[-36.34051513671875, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.315372467041016, -1.7252109050750732, 9.25],\r\n\t\t\t[-36.26816177368164, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.24231719970703, -1.7024993896484375, 9.25],\r\n\t\t\t[-36.24231719970703, -1.7024993896484375, 9.25],\r\n\t\t\t[-36.26816177368164, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -1.6979931592941284, 9.979999542236328],\r\n\t\t\t[-36.24231719970703, -1.7024993896484375, 9.25],\r\n\t\t\t[-36.190513610839844, -1.6979931592941284, 9.979999542236328],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-36.190513610839844, -1.6979931592941284, 9.979999542236328],\r\n\t\t\t[-36.11286926269531, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-36.11286926269531, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.091064453125, -1.714956521987915, 9.25],\r\n\t\t\t[-36.091064453125, -1.714956521987915, 9.25],\r\n\t\t\t[-36.11286926269531, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.0405158996582, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.091064453125, -1.714956521987915, 9.25],\r\n\t\t\t[-36.0405158996582, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.022708892822266, -1.7493150234222412, 9.25],\r\n\t\t\t[-36.022708892822266, -1.7493150234222412, 9.25],\r\n\t\t\t[-36.0405158996582, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-35.9783821105957, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-36.022708892822266, -1.7493150234222412, 9.25],\r\n\t\t\t[-35.9783821105957, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-35.96526336669922, -1.7998465299606323, 9.25],\r\n\t\t\t[-35.96526336669922, -1.7998465299606323, 9.25],\r\n\t\t\t[-35.9783821105957, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-35.93070602416992, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-35.96526336669922, -1.7998465299606323, 9.25],\r\n\t\t\t[-35.93070602416992, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-35.92247009277344, -1.863264560699463, 9.25],\r\n\t\t\t[-35.92247009277344, -1.863264560699463, 9.25],\r\n\t\t\t[-35.93070602416992, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-35.90073776245117, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-35.92247009277344, -1.863264560699463, 9.25],\r\n\t\t\t[-35.90073776245117, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-35.8971061706543, -1.9354448318481445, 9.25],\r\n\t\t\t[-35.8971061706543, -1.9354448318481445, 9.25],\r\n\t\t\t[-35.90073776245117, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-35.8905143737793, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-35.8971061706543, -1.9354448318481445, 9.25],\r\n\t\t\t[-35.8905143737793, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-35.89082717895508, -2.011693000793457, 9.25],\r\n\t\t\t[-35.89082717895508, -2.011693000793457, 9.25],\r\n\t\t\t[-35.8905143737793, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-35.90073776245117, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-35.89082717895508, -2.011693000793457, 9.25],\r\n\t\t\t[-35.90073776245117, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-35.90403747558594, -2.087050199508667, 9.25],\r\n\t\t\t[-35.90403747558594, -2.087050199508667, 9.25],\r\n\t\t\t[-35.90073776245117, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-35.93070602416992, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-35.90403747558594, -2.087050199508667, 9.25],\r\n\t\t\t[-35.93070602416992, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-35.93587875366211, -2.1566154956817627, 9.25],\r\n\t\t\t[-35.93587875366211, -2.1566154956817627, 9.25],\r\n\t\t\t[-35.93070602416992, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-35.9783821105957, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-35.93587875366211, -2.1566154956817627, 9.25],\r\n\t\t\t[-35.9783821105957, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-35.98427963256836, -2.215864658355713, 9.25],\r\n\t\t\t[-35.98427963256836, -2.215864658355713, 9.25],\r\n\t\t\t[-35.9783821105957, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-36.0405158996582, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-35.98427963256836, -2.215864658355713, 9.25],\r\n\t\t\t[-36.0405158996582, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.04609680175781, -2.260944366455078, 9.25],\r\n\t\t\t[-36.04609680175781, -2.260944366455078, 9.25],\r\n\t\t\t[-36.0405158996582, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.11286926269531, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.04609680175781, -2.260944366455078, 9.25],\r\n\t\t\t[-36.11286926269531, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.11730194091797, -2.2889227867126465, 9.25],\r\n\t\t\t[-36.11730194091797, -2.2889227867126465, 9.25],\r\n\t\t\t[-36.11286926269531, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -2.2979931831359863, 9.979999542236328],\r\n\t\t\t[-36.11730194091797, -2.2889227867126465, 9.25],\r\n\t\t\t[-36.190513610839844, -2.2979931831359863, 9.979999542236328],\r\n\t\t\t[-36.19327163696289, -2.297980546951294, 9.25],\r\n\t\t\t[-36.19327163696289, -2.297980546951294, 9.25],\r\n\t\t\t[-36.190513610839844, -2.2979931831359863, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.19327163696289, -2.297980546951294, 9.25],\r\n\t\t\t[-36.26816177368164, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.26905822753906, -2.2875282764434814, 9.25],\r\n\t\t\t[-36.26905822753906, -2.2875282764434814, 9.25],\r\n\t\t\t[-36.26816177368164, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.26905822753906, -2.2875282764434814, 9.25],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.33974075317383, -2.2582459449768066, 9.25],\r\n\t\t\t[-36.33974075317383, -2.2582459449768066, 9.25],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.40071487426758, -2.2120378017425537, 9.25],\r\n\t\t\t[-36.40071487426758, -2.2120378017425537, 9.25],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-36.40071487426758, -2.2120378017425537, 9.25],\r\n\t\t\t[-36.402645111083984, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-36.448020935058594, -2.151909351348877, 9.25],\r\n\t\t\t[-36.448020935058594, -2.151909351348877, 9.25],\r\n\t\t\t[-36.402645111083984, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.47415542602539, -1.9527058601379395, 9.25],\r\n\t\t\t[-36.486907958984375, -1.9516050815582275, 9.25],\r\n\t\t\t[-36.486907958984375, -1.9516050815582275, 9.25],\r\n\t\t\t[-36.47415542602539, -1.9527058601379395, 9.25],\r\n\t\t\t[-36.48990249633789, -2.017145872116089, 9.25],\r\n\t\t\t[-36.48990249633789, -2.017145872116089, 9.25],\r\n\t\t\t[-36.47415542602539, -1.9527058601379395, 9.25],\r\n\t\t\t[-36.47710418701172, -2.0172131061553955, 9.25],\r\n\t\t\t[-36.48990249633789, -2.017145872116089, 9.25],\r\n\t\t\t[-36.47710418701172, -2.0172131061553955, 9.25],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.25],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.25],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.25],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.25],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.25],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.25],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.25],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.25],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.25],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.25],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.25],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.25],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.25],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.25],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.25],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.25],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.25],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.25],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.25],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.25],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.25],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.25],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.25],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.25],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.25],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.25],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.25],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.25],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.25],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.25],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.25],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.25],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.25],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.25],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.25],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.25],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.25],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.25],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.25],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.25],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.25],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.25],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.25],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.25],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.25],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.25],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.25],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.25],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.25],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.25],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.25],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.25],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.25],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.25],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.25],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.25],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.25],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.25],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.25],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.25],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.25],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.25],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.25],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.25],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.25],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.25],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.25],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.25],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.25],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.25],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.25],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.25],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.25],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.25],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.25],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.25],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.25],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.25],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.25],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.25],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.25],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.25],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.25],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.25],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.25],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.25],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.25],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.25],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.25],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.25],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.25],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.25],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.25],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.25],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.25],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.25],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.25],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.25],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.25],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.25],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.25],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.25],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.25],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.25],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.25],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.25],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.25],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.25],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.25],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.25],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.25],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.25],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.25],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.25],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-33.34684371948242, -4.854170799255371, 9.25],\r\n\t\t\t[-33.350128173828125, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.350128173828125, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.380096435546875, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.380096435546875, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.413299560546875, -4.986621856689453, 9.25],\r\n\t\t\t[-33.413299560546875, -4.986621856689453, 9.25],\r\n\t\t\t[-33.380096435546875, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.413299560546875, -4.986621856689453, 9.25],\r\n\t\t\t[-33.427772521972656, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.46732711791992, -5.035416603088379, 9.25],\r\n\t\t\t[-33.46732711791992, -5.035416603088379, 9.25],\r\n\t\t\t[-33.427772521972656, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.489906311035156, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.46732711791992, -5.035416603088379, 9.25],\r\n\t\t\t[-33.489906311035156, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.531517028808594, -5.069760322570801, 9.25],\r\n\t\t\t[-33.531517028808594, -5.069760322570801, 9.25],\r\n\t\t\t[-33.489906311035156, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.562259674072266, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.531517028808594, -5.069760322570801, 9.25],\r\n\t\t\t[-33.562259674072266, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.602088928222656, -5.0876312255859375, 9.25],\r\n\t\t\t[-33.602088928222656, -5.0876312255859375, 9.25],\r\n\t\t\t[-33.562259674072266, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -5.090023994445801, 9.979999542236328],\r\n\t\t\t[-33.602088928222656, -5.0876312255859375, 9.25],\r\n\t\t\t[-33.6399040222168, -5.090023994445801, 9.979999542236328],\r\n\t\t\t[-33.674888610839844, -5.087977409362793, 9.25],\r\n\t\t\t[-33.674888610839844, -5.087977409362793, 9.25],\r\n\t\t\t[-33.6399040222168, -5.090023994445801, 9.979999542236328],\r\n\t\t\t[-33.717552185058594, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.674888610839844, -5.087977409362793, 9.25],\r\n\t\t\t[-33.717552185058594, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.745628356933594, -5.070777416229248, 9.25],\r\n\t\t\t[-33.745628356933594, -5.070777416229248, 9.25],\r\n\t\t\t[-33.717552185058594, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.745628356933594, -5.070777416229248, 9.25],\r\n\t\t\t[-33.7899055480957, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.810142517089844, -5.037045001983643, 9.25],\r\n\t\t\t[-33.810142517089844, -5.037045001983643, 9.25],\r\n\t\t\t[-33.7899055480957, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.85203552246094, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.810142517089844, -5.037045001983643, 9.25],\r\n\t\t\t[-33.85203552246094, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.86463165283203, -4.988766193389893, 9.25],\r\n\t\t\t[-33.86463165283203, -4.988766193389893, 9.25],\r\n\t\t\t[-33.85203552246094, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.89971160888672, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.86463165283203, -4.988766193389893, 9.25],\r\n\t\t\t[-33.89971160888672, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.89971160888672, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.929683685302734, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.932342529296875, -4.85695219039917, 9.25],\r\n\t\t\t[-33.932342529296875, -4.85695219039917, 9.25],\r\n\t\t\t[-33.929683685302734, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.939903259277344, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.932342529296875, -4.85695219039917, 9.25],\r\n\t\t\t[-33.939903259277344, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.939762115478516, -4.780763149261475, 9.25],\r\n\t\t\t[-33.939762115478516, -4.780763149261475, 9.25],\r\n\t\t\t[-33.939903259277344, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.939762115478516, -4.780763149261475, 9.25],\r\n\t\t\t[-33.929683685302734, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.92765808105469, -4.705177307128906, 9.25],\r\n\t\t\t[-33.92765808105469, -4.705177307128906, 9.25],\r\n\t\t\t[-33.929683685302734, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.89971160888672, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.92765808105469, -4.705177307128906, 9.25],\r\n\t\t\t[-33.89971160888672, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.89681625366211, -4.635115146636963, 9.25],\r\n\t\t\t[-33.89681625366211, -4.635115146636963, 9.25],\r\n\t\t\t[-33.89971160888672, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.85203552246094, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.89681625366211, -4.635115146636963, 9.25],\r\n\t\t\t[-33.85203552246094, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.849246978759766, -4.57513952255249, 9.25],\r\n\t\t\t[-33.849246978759766, -4.57513952255249, 9.25],\r\n\t\t\t[-33.85203552246094, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.849246978759766, -4.57513952255249, 9.25],\r\n\t\t\t[-33.7899055480957, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.78805160522461, -4.529154300689697, 9.25],\r\n\t\t\t[-33.78805160522461, -4.529154300689697, 9.25],\r\n\t\t\t[-33.7899055480957, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.717552185058594, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.78805160522461, -4.529154300689697, 9.25],\r\n\t\t\t[-33.717552185058594, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.71720504760742, -4.500154495239258, 9.25],\r\n\t\t\t[-33.71720504760742, -4.500154495239258, 9.25],\r\n\t\t\t[-33.717552185058594, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.64133071899414, -4.49002742767334, 9.25],\r\n\t\t\t[-33.64133071899414, -4.49002742767334, 9.25],\r\n\t\t\t[-33.717552185058594, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -4.490024089813232, 9.979999542236328],\r\n\t\t\t[-33.64133071899414, -4.49002742767334, 9.25],\r\n\t\t\t[-33.6399040222168, -4.490024089813232, 9.979999542236328],\r\n\t\t\t[-33.56536102294922, -4.4994330406188965, 9.25],\r\n\t\t\t[-33.56536102294922, -4.4994330406188965, 9.25],\r\n\t\t\t[-33.6399040222168, -4.490024089813232, 9.979999542236328],\r\n\t\t\t[-33.562259674072266, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.56536102294922, -4.4994330406188965, 9.25],\r\n\t\t\t[-33.562259674072266, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.49424362182617, -4.527758598327637, 9.25],\r\n\t\t\t[-33.49424362182617, -4.527758598327637, 9.25],\r\n\t\t\t[-33.562259674072266, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.489906311035156, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.49424362182617, -4.527758598327637, 9.25],\r\n\t\t\t[-33.489906311035156, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.432613372802734, -4.573160171508789, 9.25],\r\n\t\t\t[-33.432613372802734, -4.573160171508789, 9.25],\r\n\t\t\t[-33.489906311035156, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.432613372802734, -4.573160171508789, 9.25],\r\n\t\t\t[-33.427772521972656, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.38447570800781, -4.632681369781494, 9.25],\r\n\t\t\t[-33.38447570800781, -4.632681369781494, 9.25],\r\n\t\t\t[-33.427772521972656, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.380096435546875, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.38447570800781, -4.632681369781494, 9.25],\r\n\t\t\t[-33.380096435546875, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.35297393798828, -4.702446937561035, 9.25],\r\n\t\t\t[-33.35297393798828, -4.702446937561035, 9.25],\r\n\t\t\t[-33.380096435546875, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.35297393798828, -4.702446937561035, 9.25],\r\n\t\t\t[-33.350128173828125, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.34014892578125, -4.777914524078369, 9.25],\r\n\t\t\t[-33.34014892578125, -4.777914524078369, 9.25],\r\n\t\t\t[-33.350128173828125, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.33990478515625, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.34014892578125, -4.777914524078369, 9.25],\r\n\t\t\t[-33.33990478515625, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.34684371948242, -4.854170799255371, 9.25],\r\n\t\t\t[-33.34684371948242, -4.854170799255371, 9.25],\r\n\t\t\t[-33.33990478515625, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.86463165283203, -4.988766193389893, 9.25],\r\n\t\t\t[-33.86463165283203, -4.988766193389893, 9.25],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.810142517089844, -5.037045001983643, 9.25],\r\n\t\t\t[-33.810142517089844, -5.037045001983643, 9.25],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.745628356933594, -5.070777416229248, 9.25],\r\n\t\t\t[-33.745628356933594, -5.070777416229248, 9.25],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.674888610839844, -5.087977409362793, 9.25],\r\n\t\t\t[-33.674888610839844, -5.087977409362793, 9.25],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.674888610839844, -5.087977409362793, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.602088928222656, -5.0876312255859375, 9.25],\r\n\t\t\t[-33.602088928222656, -5.0876312255859375, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.531517028808594, -5.069760322570801, 9.25],\r\n\t\t\t[-33.531517028808594, -5.069760322570801, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.46732711791992, -5.035416603088379, 9.25],\r\n\t\t\t[-33.46732711791992, -5.035416603088379, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.413299560546875, -4.986621856689453, 9.25],\r\n\t\t\t[-33.413299560546875, -4.986621856689453, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.2154655456543, 0.7521229982376099, 9.25],\r\n\t\t\t[-33.20870590209961, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.20870590209961, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.198482513427734, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.198482513427734, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.20264434814453, 0.6028211712837219, 9.25],\r\n\t\t\t[-33.20264434814453, 0.6028211712837219, 9.25],\r\n\t\t\t[-33.198482513427734, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.20264434814453, 0.6028211712837219, 9.25],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.223350524902344, 0.5330230593681335, 9.25],\r\n\t\t\t[-33.223350524902344, 0.5330230593681335, 9.25],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.23867416381836, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.223350524902344, 0.5330230593681335, 9.25],\r\n\t\t\t[-33.23867416381836, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.26026153564453, 0.4702684283256531, 9.25],\r\n\t\t\t[-33.26026153564453, 0.4702684283256531, 9.25],\r\n\t\t\t[-33.23867416381836, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.28635025024414, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.26026153564453, 0.4702684283256531, 9.25],\r\n\t\t\t[-33.28635025024414, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.31120300292969, 0.4182531535625458, 9.25],\r\n\t\t\t[-33.31120300292969, 0.4182531535625458, 9.25],\r\n\t\t\t[-33.28635025024414, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.31120300292969, 0.4182531535625458, 9.25],\r\n\t\t\t[-33.34848403930664, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.373172760009766, 0.3800407350063324, 9.25],\r\n\t\t\t[-33.373172760009766, 0.3800407350063324, 9.25],\r\n\t\t\t[-33.34848403930664, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.42083740234375, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.373172760009766, 0.3800407350063324, 9.25],\r\n\t\t\t[-33.42083740234375, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.44252395629883, 0.35788166522979736, 9.25],\r\n\t\t\t[-33.44252395629883, 0.35788166522979736, 9.25],\r\n\t\t\t[-33.42083740234375, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.49848175048828, 0.35261648893356323, 9.979999542236328],\r\n\t\t\t[-33.44252395629883, 0.35788166522979736, 9.25],\r\n\t\t\t[-33.49848175048828, 0.35261648893356323, 9.979999542236328],\r\n\t\t\t[-33.51517105102539, 0.35308098793029785, 9.25],\r\n\t\t\t[-33.51517105102539, 0.35308098793029785, 9.25],\r\n\t\t\t[-33.49848175048828, 0.35261648893356323, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.51517105102539, 0.35308098793029785, 9.25],\r\n\t\t\t[-33.57612991333008, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.58683395385742, 0.3659214675426483, 9.25],\r\n\t\t\t[-33.58683395385742, 0.3659214675426483, 9.25],\r\n\t\t\t[-33.57612991333008, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.64848327636719, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.58683395385742, 0.3659214675426483, 9.25],\r\n\t\t\t[-33.64848327636719, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.65329360961914, 0.3956468403339386, 9.25],\r\n\t\t\t[-33.65329360961914, 0.3956468403339386, 9.25],\r\n\t\t\t[-33.64848327636719, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.65329360961914, 0.3956468403339386, 9.25],\r\n\t\t\t[-33.71061706542969, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.710636138916016, 0.4405064582824707, 9.25],\r\n\t\t\t[-33.710636138916016, 0.4405064582824707, 9.25],\r\n\t\t\t[-33.71061706542969, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.75548553466797, 0.49785828590393066, 9.25],\r\n\t\t\t[-33.75548553466797, 0.49785828590393066, 9.25],\r\n\t\t\t[-33.71061706542969, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.7582893371582, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.75548553466797, 0.49785828590393066, 9.25],\r\n\t\t\t[-33.7582893371582, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.78519821166992, 0.5643246173858643, 9.25],\r\n\t\t\t[-33.78519821166992, 0.5643246173858643, 9.25],\r\n\t\t\t[-33.7582893371582, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.78519821166992, 0.5643246173858643, 9.25],\r\n\t\t\t[-33.78826141357422, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.79802322387695, 0.6359909176826477, 9.25],\r\n\t\t\t[-33.79802322387695, 0.6359909176826477, 9.25],\r\n\t\t\t[-33.78826141357422, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.798484802246094, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.79802322387695, 0.6359909176826477, 9.25],\r\n\t\t\t[-33.798484802246094, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-33.798484802246094, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-33.78826141357422, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.76869583129883, 0.7829445600509644, 9.25],\r\n\t\t\t[-33.76869583129883, 0.7829445600509644, 9.25],\r\n\t\t\t[-33.78826141357422, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.7582893371582, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.76869583129883, 0.7829445600509644, 9.25],\r\n\t\t\t[-33.7582893371582, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.72580337524414, 0.848386824131012, 9.25],\r\n\t\t\t[-33.72580337524414, 0.848386824131012, 9.25],\r\n\t\t\t[-33.7582893371582, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.72580337524414, 0.848386824131012, 9.25],\r\n\t\t\t[-33.71061706542969, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.66744613647461, 0.9005112648010254, 9.25],\r\n\t\t\t[-33.66744613647461, 0.9005112648010254, 9.25],\r\n\t\t\t[-33.71061706542969, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.64848327636719, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.66744613647461, 0.9005112648010254, 9.25],\r\n\t\t\t[-33.64848327636719, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.59759521484375, 0.9357720017433167, 9.25],\r\n\t\t\t[-33.59759521484375, 0.9357720017433167, 9.25],\r\n\t\t\t[-33.64848327636719, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.59759521484375, 0.9357720017433167, 9.25],\r\n\t\t\t[-33.57612991333008, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.520999908447266, 0.9517702460289001, 9.25],\r\n\t\t\t[-33.520999908447266, 0.9517702460289001, 9.25],\r\n\t\t\t[-33.57612991333008, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.49848175048828, 0.9526165127754211, 9.979999542236328],\r\n\t\t\t[-33.520999908447266, 0.9517702460289001, 9.25],\r\n\t\t\t[-33.49848175048828, 0.9526165127754211, 9.979999542236328],\r\n\t\t\t[-33.442874908447266, 0.9474177360534668, 9.25],\r\n\t\t\t[-33.442874908447266, 0.9474177360534668, 9.25],\r\n\t\t\t[-33.49848175048828, 0.9526165127754211, 9.979999542236328],\r\n\t\t\t[-33.42083740234375, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.442874908447266, 0.9474177360534668, 9.25],\r\n\t\t\t[-33.42083740234375, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.368534088134766, 0.923010528087616, 9.25],\r\n\t\t\t[-33.368534088134766, 0.923010528087616, 9.25],\r\n\t\t\t[-33.42083740234375, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.368534088134766, 0.923010528087616, 9.25],\r\n\t\t\t[-33.34848403930664, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.30303192138672, 0.8802089691162109, 9.25],\r\n\t\t\t[-33.30303192138672, 0.8802089691162109, 9.25],\r\n\t\t\t[-33.34848403930664, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.28635025024414, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.30303192138672, 0.8802089691162109, 9.25],\r\n\t\t\t[-33.28635025024414, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.250823974609375, 0.8219248652458191, 9.25],\r\n\t\t\t[-33.250823974609375, 0.8219248652458191, 9.25],\r\n\t\t\t[-33.28635025024414, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.23867416381836, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.250823974609375, 0.8219248652458191, 9.25],\r\n\t\t\t[-33.23867416381836, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.2154655456543, 0.7521229982376099, 9.25],\r\n\t\t\t[-33.2154655456543, 0.7521229982376099, 9.25],\r\n\t\t\t[-33.23867416381836, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.2154655456543, 0.7521229982376099, 9.25],\r\n\t\t\t[-33.2154655456543, 0.7521229982376099, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.250823974609375, 0.8219248652458191, 9.25],\r\n\t\t\t[-33.250823974609375, 0.8219248652458191, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.30303192138672, 0.8802089691162109, 9.25],\r\n\t\t\t[-33.30303192138672, 0.8802089691162109, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.368534088134766, 0.923010528087616, 9.25],\r\n\t\t\t[-33.368534088134766, 0.923010528087616, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.442874908447266, 0.9474177360534668, 9.25],\r\n\t\t\t[-33.442874908447266, 0.9474177360534668, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.520999908447266, 0.9517702460289001, 9.25],\r\n\t\t\t[-33.520999908447266, 0.9517702460289001, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.520999908447266, 0.9517702460289001, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.59759521484375, 0.9357720017433167, 9.25],\r\n\t\t\t[-33.59759521484375, 0.9357720017433167, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.66744613647461, 0.9005112648010254, 9.25],\r\n\t\t\t[-33.66744613647461, 0.9005112648010254, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.72580337524414, 0.848386824131012, 9.25],\r\n\t\t\t[-33.72580337524414, 0.848386824131012, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.76869583129883, 0.7829445600509644, 9.25],\r\n\t\t\t[-33.76869583129883, 0.7829445600509644, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 11.199999809265137],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 11.199999809265137],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 11.199999809265137],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 11.199999809265137],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 11.199999809265137],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 11.199999809265137],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 11.199999809265137],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 11.199999809265137],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 11.199999809265137],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 11.199999809265137],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 11.199999809265137],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 11.199999809265137],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 11.199999809265137],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 11.199999809265137],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 11.199999809265137],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 11.199999809265137],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 11.199999809265137],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 11.199999809265137],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 11.199999809265137],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -4.2110724449157715, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, -4.553174018859863, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, -4.855224609375, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, -5.112264633178711, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, 0.7616331577301025, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, 0.48151227831840515, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, 0.1587730050086975, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -0.20128530263900757, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -3.6352694034576416, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-30.764158248901367, -4.026734352111816, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-31.03287696838379, -4.3867926597595215, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-31.34543228149414, -4.709532260894775, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-31.696693420410156, -4.98965311050415, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, -5.222555637359619, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-33.33990478515625, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.33990478515625, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, -5.404416561126709, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-33.380096435546875, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.380096435546875, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, -5.5322489738464355, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-33.489906311035156, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.489906311035156, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-33.562259674072266, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.562259674072266, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -5.090023994445801, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -5.090023994445801, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, -5.603953838348389, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -5.090023994445801, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-33.717552185058594, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.717552185058594, -5.0798020362854, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, -5.618353843688965, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -5.049831867218018, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-33.85203552246094, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-33.85203552246094, -5.0021562576293945, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-33.89971160888672, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-33.89971160888672, -4.940024375915527, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, -5.575212478637695, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.867670059204102, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-33.939903259277344, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-33.939903259277344, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.939903259277344, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.929683685302734, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.89971160888672, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.89971160888672, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.85203552246094, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.85203552246094, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.7899055480957, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.717552185058594, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.717552185058594, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -4.490024089813232, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -4.490024089813232, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.6399040222168, -4.490024089813232, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.562259674072266, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.562259674072266, -4.500246524810791, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.489906311035156, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.489906311035156, -4.530216693878174, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.427772521972656, -4.577892303466797, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.380096435546875, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.380096435546875, -4.640024185180664, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.350128173828125, -4.71237850189209, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.33990478515625, -4.790024280548096, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -3.218825101852417, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -2.7842397689819336, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.979999542236328],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -2.3386495113372803, 9.979999542236328],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-30.203676223754883, -1.8893704414367676, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-30.26112937927246, -1.4437799453735352, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.979999542236328],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -1.224660038948059, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -1.6979931592941284, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -1.6979931592941284, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -1.6979931592941284, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-36.11286926269531, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-36.11286926269531, -1.7082154750823975, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-36.0405158996582, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-36.0405158996582, -1.7381855249404907, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.9783821105957, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-35.9783821105957, -1.7858611345291138, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.93070602416992, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-35.93070602416992, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.90073776245117, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-35.90073776245117, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.8905143737793, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-35.8905143737793, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.8905143737793, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.90073776245117, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-35.90073776245117, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.93070602416992, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-35.93070602416992, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.9783821105957, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-35.9783821105957, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-36.0405158996582, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.0405158996582, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-36.11286926269531, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.11286926269531, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -2.2979931831359863, 9.979999542236328],\r\n\t\t\t[-36.190513610839844, -2.2979931831359863, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-36.26816177368164, -2.287770986557007, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-36.34051513671875, -2.257800817489624, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-36.402645111083984, -2.210125207901001, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -2.562365770339966, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -2.1479930877685547, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-36.48029327392578, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-36.48029327392578, -2.075638771057129, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-36.49051284790039, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-36.49051284790039, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-37.208763122558594, -2.1140098571777344, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-36.49051284790039, -1.9979931116104126, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-36.48029327392578, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-36.48029327392578, -1.9203474521636963, 9.979999542236328],\r\n\t\t\t[-37.17997741699219, -1.665653944015503, 9.979999542236328],\r\n\t\t\t[-36.450321197509766, -1.8479931354522705, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.979999542236328],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.979999542236328],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-36.512489318847656, -0.016947511583566666, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-36.221256256103516, 0.3251541554927826, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.88866424560547, 0.6272048354148865, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-35.52017593383789, 0.8842447996139526, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-33.7582893371582, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.64848327636719, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.64848327636719, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.49848175048828, 0.35261648893356323, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.49848175048828, 0.35261648893356323, 9.979999542236328],\r\n\t\t\t[-33.42083740234375, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.42083740234375, 0.3628387451171875, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.3928088843822479, 9.979999542236328],\r\n\t\t\t[-33.28635025024414, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.28635025024414, 0.4404844641685486, 9.979999542236328],\r\n\t\t\t[-33.23867416381836, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.23867416381836, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.1118278503418, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-32.08089065551758, 0.9945360422134399, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.198482513427734, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-33.198482513427734, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-32.49171829223633, 1.1763967275619507, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-33.20870590209961, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.23867416381836, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-33.23867416381836, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.28635025024414, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.28635025024414, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-32.922428131103516, 1.3042289018630981, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.34848403930664, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.42083740234375, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.42083740234375, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.49848175048828, 0.9526165127754211, 9.979999542236328],\r\n\t\t\t[-33.49848175048828, 0.9526165127754211, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.36594772338867, 1.3759338855743408, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-33.57612991333008, 0.9423942565917969, 9.979999542236328],\r\n\t\t\t[-33.64848327636719, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-33.64848327636719, 0.9124240875244141, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.81499481201172, 1.390333890914917, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-33.71061706542969, 0.8647485375404358, 9.979999542236328],\r\n\t\t\t[-33.7582893371582, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-33.7582893371582, 0.8026164770126343, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-34.26219940185547, 1.3471927642822266, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.7302622199058533, 9.979999542236328],\r\n\t\t\t[-33.798484802246094, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-33.798484802246094, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.798484802246094, 0.6526165008544922, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-33.78826141357422, 0.5749707818031311, 9.979999542236328],\r\n\t\t\t[-33.7582893371582, 0.5026164650917053, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -0.7982692718505859, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -0.39348289370536804, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, 1.0920535326004028, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, 1.2472188472747803, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -0.005017448682337999, 9.979999542236328],\r\n\t\t\t[-30.543689727783203, -0.5927504897117615, 9.979999542236328],\r\n\t\t\t[-30.375089645385742, -1.0091947317123413, 9.979999542236328],\r\n\t\t\t[-31.613895416259766, -1.4970167875289917, 9.979999542236328],\r\n\t\t\t[-34.70021438598633, -5.475238800048828, 9.979999542236328],\r\n\t\t\t[-35.12184524536133, -5.32007360458374, 9.979999542236328],\r\n\t\t\t[-34.28330612182617, -4.179225444793701, 9.979999542236328],\r\n\t\t\t[-36.75758743286133, -3.8345370292663574, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-35.774200439453125, -2.6738672256469727, 9.979999542236328],\r\n\t\t\t[-36.95252227783203, -3.429750442504883, 9.979999542236328],\r\n\t\t\t[-37.094093322753906, -3.003359794616699, 9.979999542236328],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-34.0548210144043, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-34.0548210144043, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.72819519042969, -4.939144611358643, 9.25],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.550201416015625, -4.93829870223999, 9.25],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-33.25041580200195, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-33.25041580200195, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-33.25041580200195, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-32.85639953613281, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-32.85639953613281, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-32.58504104614258, -4.7307586669921875, 9.25],\r\n\t\t\t[-32.58504104614258, -4.7307586669921875, 9.25],\r\n\t\t\t[-32.85639953613281, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-32.47859573364258, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-32.58504104614258, -4.7307586669921875, 9.25],\r\n\t\t\t[-32.47859573364258, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-32.47859573364258, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-32.12468719482422, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-32.12468719482422, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-32.12468719482422, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-31.8018856048584, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-31.8018856048584, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.8018856048584, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-31.516759872436523, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.516759872436523, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.516759872436523, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-31.27511215209961, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.27511215209961, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.27511215209961, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-31.081865310668945, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.081865310668945, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-30.96909523010254, -3.0004630088806152, 9.25],\r\n\t\t\t[-30.96909523010254, -3.0004630088806152, 9.25],\r\n\t\t\t[-31.081865310668945, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-30.940950393676758, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-30.96909523010254, -3.0004630088806152, 9.25],\r\n\t\t\t[-30.940950393676758, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.940950393676758, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.85523796081543, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.85523796081543, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-30.826473236083984, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.826473236083984, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.826473236083984, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.85523796081543, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-30.85523796081543, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-30.940950393676758, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-30.940950393676758, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-30.940950393676758, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-31.081865310668945, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-31.081865310668945, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.081865310668945, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-31.27511215209961, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.27511215209961, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.27511215209961, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-31.516759872436523, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.516759872436523, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-31.516759872436523, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-31.8018856048584, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-31.8018856048584, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-31.8018856048584, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-32.12468719482422, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-32.12468719482422, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-32.12468719482422, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-32.47859573364258, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-32.47859573364258, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-32.47859573364258, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-32.85639953613281, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-32.85639953613281, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-32.85639953613281, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-33.25041580200195, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.25041580200195, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.25041580200195, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-33.39636993408203, 0.7004944086074829, 9.25],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.59464645385742, 0.711540699005127, 9.25],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-34.0548210144043, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-34.0548210144043, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-34.0548210144043, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-34.44883346557617, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-34.44883346557617, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-34.589717864990234, 0.5522490739822388, 9.25],\r\n\t\t\t[-34.589717864990234, 0.5522490739822388, 9.25],\r\n\t\t\t[-34.44883346557617, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-34.82664108276367, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-34.589717864990234, 0.5522490739822388, 9.25],\r\n\t\t\t[-34.82664108276367, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-34.82664108276367, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-35.180545806884766, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-35.180545806884766, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.180545806884766, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-35.50334930419922, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.50334930419922, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.50334930419922, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-35.788475036621094, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.788475036621094, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-35.788475036621094, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-36.030120849609375, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-36.030120849609375, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-36.030120849609375, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-36.22336959838867, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-36.22336959838867, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-36.28937530517578, -1.0968533754348755, 9.25],\r\n\t\t\t[-36.28937530517578, -1.0968533754348755, 9.25],\r\n\t\t\t[-36.22336959838867, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-36.36428451538086, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-36.28937530517578, -1.0968533754348755, 9.25],\r\n\t\t\t[-36.36428451538086, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.36428451538086, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-36.44999694824219, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.44999694824219, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.44999694824219, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.47415542602539, -1.9527058601379395, 9.25],\r\n\t\t\t[-36.47415542602539, -1.9527058601379395, 9.25],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.47710418701172, -2.0172131061553955, 9.25],\r\n\t\t\t[-36.47710418701172, -2.0172131061553955, 9.25],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.44999694824219, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.44999694824219, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.44999694824219, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-36.36428451538086, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.36428451538086, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-36.26045608520508, -3.203174114227295, 9.25],\r\n\t\t\t[-36.26045608520508, -3.203174114227295, 9.25],\r\n\t\t\t[-36.36428451538086, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-36.22336959838867, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-36.26045608520508, -3.203174114227295, 9.25],\r\n\t\t\t[-36.22336959838867, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-36.22336959838867, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-36.030120849609375, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-36.030120849609375, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-36.030120849609375, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-35.788475036621094, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-35.788475036621094, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.788475036621094, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-35.50334930419922, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.50334930419922, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-35.50334930419922, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-35.180545806884766, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-35.180545806884766, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-35.180545806884766, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-34.82664108276367, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-34.82664108276367, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-34.65108871459961, -4.757899284362793, 9.25],\r\n\t\t\t[-34.65108871459961, -4.757899284362793, 9.25],\r\n\t\t\t[-34.82664108276367, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-34.44883346557617, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-34.65108871459961, -4.757899284362793, 9.25],\r\n\t\t\t[-34.44883346557617, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-34.44883346557617, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-34.0548210144043, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 3.5],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 3.5],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 3.5],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 3.5],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 3.5],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 3.5],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 3.5],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 3.5],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 3.5],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 3.5],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 3.5],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 3.5],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 3.5],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 3.5],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 3.5],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 3.5],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 3.5],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 3.5],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 3.5],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 3.5],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 3.5],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 3.5],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 3.5],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 3.5],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 3.5],\r\n\t\t\t[-36.46973419189453, -1.8882830142974854, 9.25],\r\n\t\t\t[-36.43290328979492, -1.8212249279022217, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.43290328979492, -1.8212249279022217, 9.25],\r\n\t\t\t[-36.38031005859375, -1.7656630277633667, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.38031005859375, -1.7656630277633667, 9.25],\r\n\t\t\t[-36.315372467041016, -1.7252109050750732, 9.25],\r\n\t\t\t[-36.315372467041016, -1.7252109050750732, 9.25],\r\n\t\t\t[-36.24231719970703, -1.7024993896484375, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.24231719970703, -1.7024993896484375, 9.25],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-36.40811538696289, -1.4860591888427734, 9.25],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-36.28937530517578, -1.0968533754348755, 9.25],\r\n\t\t\t[-36.28937530517578, -1.0968533754348755, 9.25],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-36.28937530517578, -1.0968533754348755, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.25],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.25],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.25],\r\n\t\t\t[-36.165889739990234, -1.6990054845809937, 9.25],\r\n\t\t\t[-36.091064453125, -1.714956521987915, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-36.091064453125, -1.714956521987915, 9.25],\r\n\t\t\t[-36.022708892822266, -1.7493150234222412, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-36.022708892822266, -1.7493150234222412, 9.25],\r\n\t\t\t[-35.96526336669922, -1.7998465299606323, 9.25],\r\n\t\t\t[-35.96526336669922, -1.7998465299606323, 9.25],\r\n\t\t\t[-35.92247009277344, -1.863264560699463, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.92247009277344, -1.863264560699463, 9.25],\r\n\t\t\t[-35.8971061706543, -1.9354448318481445, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.8971061706543, -1.9354448318481445, 9.25],\r\n\t\t\t[-35.89082717895508, -2.011693000793457, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.89082717895508, -2.011693000793457, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.89082717895508, -2.011693000793457, 9.25],\r\n\t\t\t[-35.90403747558594, -2.087050199508667, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.90403747558594, -2.087050199508667, 9.25],\r\n\t\t\t[-35.93587875366211, -2.1566154956817627, 9.25],\r\n\t\t\t[-35.93587875366211, -2.1566154956817627, 9.25],\r\n\t\t\t[-35.98427963256836, -2.215864658355713, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.98427963256836, -2.215864658355713, 9.25],\r\n\t\t\t[-36.04609680175781, -2.260944366455078, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-36.04609680175781, -2.260944366455078, 9.25],\r\n\t\t\t[-36.11730194091797, -2.2889227867126465, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-36.11730194091797, -2.2889227867126465, 9.25],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.11730194091797, -2.2889227867126465, 9.25],\r\n\t\t\t[-36.19327163696289, -2.297980546951294, 9.25],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.19327163696289, -2.297980546951294, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.19327163696289, -2.297980546951294, 9.25],\r\n\t\t\t[-36.26905822753906, -2.2875282764434814, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.26905822753906, -2.2875282764434814, 9.25],\r\n\t\t\t[-36.33974075317383, -2.2582459449768066, 9.25],\r\n\t\t\t[-36.33974075317383, -2.2582459449768066, 9.25],\r\n\t\t\t[-36.40071487426758, -2.2120378017425537, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.40071487426758, -2.2120378017425537, 9.25],\r\n\t\t\t[-36.448020935058594, -2.151909351348877, 9.25],\r\n\t\t\t[-36.45697021484375, -2.4643149375915527, 9.25],\r\n\t\t\t[-36.448020935058594, -2.151909351348877, 9.25],\r\n\t\t\t[-36.478580474853516, -2.081770658493042, 9.25],\r\n\t\t\t[-36.383811950683594, -2.8404204845428467, 9.25],\r\n\t\t\t[-36.26045608520508, -3.203174114227295, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-36.26045608520508, -3.203174114227295, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.25],\r\n\t\t\t[-36.26045608520508, -3.203174114227295, 9.25],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-35.37900161743164, -3.368703842163086, 9.25],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.25],\r\n\t\t\t[-35.40896987915039, -3.4410581588745117, 9.25],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.25],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.25],\r\n\t\t\t[-36.08916473388672, -3.545908212661743, 9.25],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-35.419193267822266, -3.5187039375305176, 9.25],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.25],\r\n\t\t\t[-35.40896987915039, -3.5963494777679443, 9.25],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.25],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.25],\r\n\t\t\t[-35.87308883666992, -3.862323522567749, 9.25],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.37900161743164, -3.66870379447937, 9.25],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.25],\r\n\t\t\t[-35.33132553100586, -3.7308359146118164, 9.25],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.25],\r\n\t\t\t[-35.269195556640625, -3.7785115242004395, 9.25],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.6161994934082, -4.146603584289551, 9.25],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-35.19683837890625, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.25],\r\n\t\t\t[-35.11919403076172, -3.8187038898468018, 9.25],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.25],\r\n\t\t\t[-35.323219299316406, -4.393523693084717, 9.25],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-35.04154968261719, -3.8084816932678223, 9.25],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.25],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.25],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.96919250488281, -3.7785115242004395, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.25],\r\n\t\t\t[-34.90706253051758, -3.7308359146118164, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.25],\r\n\t\t\t[-34.8593864440918, -3.66870379447937, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.25],\r\n\t\t\t[-34.82941436767578, -3.5963494777679443, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.81919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.25],\r\n\t\t\t[-34.82941436767578, -3.4410581588745117, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.25],\r\n\t\t\t[-34.8593864440918, -3.368703842163086, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.25],\r\n\t\t\t[-34.90706253051758, -3.3065717220306396, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.25],\r\n\t\t\t[-34.96919250488281, -3.2588961124420166, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.25],\r\n\t\t\t[-35.04154968261719, -3.228926181793213, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.25],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.25],\r\n\t\t\t[-34.23330307006836, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.11919403076172, -3.2187037467956543, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.25],\r\n\t\t\t[-35.19683837890625, -3.228926181793213, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.269195556640625, -3.2588961124420166, 9.25],\r\n\t\t\t[-35.72420120239258, -2.6738672256469727, 9.25],\r\n\t\t\t[-35.33132553100586, -3.3065717220306396, 9.25],\r\n\t\t\t[-34.999534606933594, -4.598545074462891, 9.25],\r\n\t\t\t[-34.65108871459961, -4.757899284362793, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.65108871459961, -4.757899284362793, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-33.89681625366211, -4.635115146636963, 9.25],\r\n\t\t\t[-33.89681625366211, -4.635115146636963, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-33.92765808105469, -4.705177307128906, 9.25],\r\n\t\t\t[-33.92765808105469, -4.705177307128906, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-33.939762115478516, -4.780763149261475, 9.25],\r\n\t\t\t[-33.939762115478516, -4.780763149261475, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-33.932342529296875, -4.85695219039917, 9.25],\r\n\t\t\t[-33.932342529296875, -4.85695219039917, 9.25],\r\n\t\t\t[-34.28429412841797, -4.86865758895874, 9.25],\r\n\t\t\t[-33.9058837890625, -4.928783893585205, 9.249999046325684],\r\n\t\t\t[-33.89681625366211, -4.635115146636963, 9.25],\r\n\t\t\t[-33.849246978759766, -4.57513952255249, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-33.849246978759766, -4.57513952255249, 9.25],\r\n\t\t\t[-33.78805160522461, -4.529154300689697, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-33.78805160522461, -4.529154300689697, 9.25],\r\n\t\t\t[-33.71720504760742, -4.500154495239258, 9.25],\r\n\t\t\t[-33.71720504760742, -4.500154495239258, 9.25],\r\n\t\t\t[-33.64133071899414, -4.49002742767334, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-34.23330307006836, -4.179225444793701, 9.25],\r\n\t\t\t[-33.64133071899414, -4.49002742767334, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.64133071899414, -4.49002742767334, 9.25],\r\n\t\t\t[-33.56536102294922, -4.4994330406188965, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.56536102294922, -4.4994330406188965, 9.25],\r\n\t\t\t[-33.49424362182617, -4.527758598327637, 9.25],\r\n\t\t\t[-33.49424362182617, -4.527758598327637, 9.25],\r\n\t\t\t[-33.432613372802734, -4.573160171508789, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.432613372802734, -4.573160171508789, 9.25],\r\n\t\t\t[-33.38447570800781, -4.632681369781494, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.38447570800781, -4.632681369781494, 9.25],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-33.38447570800781, -4.632681369781494, 9.25],\r\n\t\t\t[-33.35297393798828, -4.702446937561035, 9.25],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-33.35297393798828, -4.702446937561035, 9.25],\r\n\t\t\t[-33.34014892578125, -4.777914524078369, 9.25],\r\n\t\t\t[-33.34014892578125, -4.777914524078369, 9.25],\r\n\t\t\t[-33.34684371948242, -4.854170799255371, 9.25],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-33.34684371948242, -4.854170799255371, 9.25],\r\n\t\t\t[-33.372615814208984, -4.926250457763672, 9.249999046325684],\r\n\t\t\t[-32.97177505493164, -4.856919288635254, 9.25],\r\n\t\t\t[-32.58504104614258, -4.7307586669921875, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-32.58504104614258, -4.7307586669921875, 9.25],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.25],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.25],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.25],\r\n\t\t\t[-32.169193267822266, -3.7785115242004395, 9.25],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.25],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.25],\r\n\t\t\t[-32.220420837402344, -4.5503830909729, 9.25],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-32.096839904785156, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.25],\r\n\t\t\t[-32.019195556640625, -3.8187038898468018, 9.25],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.885478973388672, -4.319529056549072, 9.25],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.941547393798828, -3.8084816932678223, 9.25],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.25],\r\n\t\t\t[-31.86919403076172, -3.7785115242004395, 9.25],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.25],\r\n\t\t\t[-31.80706214904785, -3.7308359146118164, 9.25],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.25],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.25],\r\n\t\t\t[-31.587146759033203, -4.042980194091797, 9.25],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.75938606262207, -3.66870379447937, 9.25],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.25],\r\n\t\t\t[-31.729415893554688, -3.5963494777679443, 9.25],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.25],\r\n\t\t\t[-31.331607818603516, -3.7264654636383057, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.719194412231445, -3.5187039375305176, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.25],\r\n\t\t\t[-31.729415893554688, -3.4410581588745117, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.25],\r\n\t\t\t[-31.75938606262207, -3.368703842163086, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.25],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.80706214904785, -3.3065717220306396, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.25],\r\n\t\t\t[-31.86919403076172, -3.2588961124420166, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.25],\r\n\t\t\t[-31.941547393798828, -3.228926181793213, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.25],\r\n\t\t\t[-32.019195556640625, -3.2187037467956543, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.25],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.096839904785156, -3.228926181793213, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.25],\r\n\t\t\t[-32.169193267822266, -3.2588961124420166, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.25],\r\n\t\t\t[-32.231327056884766, -3.3065717220306396, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.25],\r\n\t\t\t[-32.27900314331055, -3.368703842163086, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.25],\r\n\t\t\t[-32.3089714050293, -3.4410581588745117, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-33.06182861328125, -2.6738672256469727, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-32.31919479370117, -3.5187039375305176, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.25],\r\n\t\t\t[-32.3089714050293, -3.5963494777679443, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.25],\r\n\t\t\t[-32.27900314331055, -3.66870379447937, 9.25],\r\n\t\t\t[-33.06182861328125, -4.179225444793701, 9.25],\r\n\t\t\t[-32.231327056884766, -3.7308359146118164, 9.25],\r\n\t\t\t[-31.12415885925293, -3.3765430450439453, 9.25],\r\n\t\t\t[-30.96909523010254, -3.0004630088806152, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-30.96909523010254, -3.0004630088806152, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.25],\r\n\t\t\t[-30.96909523010254, -3.0004630088806152, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-31.147872924804688, -2.4394145011901855, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.25],\r\n\t\t\t[-31.070228576660156, -2.429192304611206, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.25],\r\n\t\t\t[-30.997873306274414, -2.3992221355438232, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.25],\r\n\t\t\t[-30.935741424560547, -2.3515465259552, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.25],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.25],\r\n\t\t\t[-30.86962890625, -2.6060168743133545, 9.25],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.888065338134766, -2.289414644241333, 9.25],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.25],\r\n\t\t\t[-30.858095169067383, -2.2170603275299072, 9.25],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.25],\r\n\t\t\t[-30.84787368774414, -2.1394145488739014, 9.25],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.25],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.25],\r\n\t\t\t[-30.827823638916016, -2.2013769149780273, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.858095169067383, -2.0617687702178955, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.25],\r\n\t\t\t[-30.888065338134766, -1.9894145727157593, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.25],\r\n\t\t\t[-30.935741424560547, -1.927282452583313, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.25],\r\n\t\t\t[-30.997873306274414, -1.8796069622039795, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.25],\r\n\t\t\t[-30.84454345703125, -1.7949270009994507, 9.25],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-31.070228576660156, -1.8496367931365967, 9.25],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.25],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.25],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.147872924804688, -1.8394144773483276, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.22551918029785, -1.8496367931365967, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.297874450683594, -1.8796069622039795, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.25],\r\n\t\t\t[-31.36000633239746, -1.927282452583313, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.25],\r\n\t\t\t[-31.40768051147461, -1.9894145727157593, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.25],\r\n\t\t\t[-31.437650680541992, -2.0617687702178955, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.25],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.447874069213867, -2.1394145488739014, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.25],\r\n\t\t\t[-31.437650680541992, -2.2170603275299072, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.25],\r\n\t\t\t[-31.40768051147461, -2.289414644241333, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.25],\r\n\t\t\t[-31.36000633239746, -2.3515465259552, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.25],\r\n\t\t\t[-31.297874450683594, -2.3992221355438232, 9.25],\r\n\t\t\t[-31.56389617919922, -2.6738672256469727, 9.25],\r\n\t\t\t[-31.22551918029785, -2.429192304611206, 9.25],\r\n\t\t\t[-30.919443130493164, -1.3950879573822021, 9.25],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.25],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.25],\r\n\t\t\t[-31.80706214904785, -0.8308358788490295, 9.25],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.25],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.25],\r\n\t\t\t[-31.050968170166016, -1.0101439952850342, 9.25],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.75938606262207, -0.7687038779258728, 9.25],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.25],\r\n\t\t\t[-31.729415893554688, -0.696349561214447, 9.25],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.25],\r\n\t\t\t[-31.236398696899414, -0.6480705142021179, 9.25],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.719194412231445, -0.6187038421630859, 9.25],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.25],\r\n\t\t\t[-31.729415893554688, -0.5410581231117249, 9.25],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.25],\r\n\t\t\t[-31.75938606262207, -0.46870383620262146, 9.25],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.25],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.25],\r\n\t\t\t[-31.471887588500977, -0.3163691461086273, 9.25],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-31.80706214904785, -0.40657180547714233, 9.25],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.25],\r\n\t\t\t[-31.86919403076172, -0.3588962256908417, 9.25],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.25],\r\n\t\t\t[-31.941547393798828, -0.32892611622810364, 9.25],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.25],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.25],\r\n\t\t\t[-31.7525577545166, -0.02191232144832611, 9.25],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-32.019195556640625, -0.31870386004447937, 9.25],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.096839904785156, -0.32892611622810364, 9.25],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.25],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.25],\r\n\t\t\t[-32.07259750366211, 0.22919926047325134, 9.25],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-32.169193267822266, -0.3588962256908417, 9.25],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.25],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.25],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-32.231327056884766, -0.40657180547714233, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.25],\r\n\t\t\t[-32.27900314331055, -0.46870383620262146, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.25],\r\n\t\t\t[-32.3089714050293, -0.5410581231117249, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.31919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.25],\r\n\t\t\t[-32.3089714050293, -0.696349561214447, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.25],\r\n\t\t\t[-32.27900314331055, -0.7687038779258728, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.25],\r\n\t\t\t[-32.231327056884766, -0.8308358788490295, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.25],\r\n\t\t\t[-32.169193267822266, -0.8785114884376526, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.25],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.25],\r\n\t\t\t[-33.06182861328125, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.096839904785156, -0.9084815979003906, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.25],\r\n\t\t\t[-32.019195556640625, -0.9187038540840149, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.25],\r\n\t\t\t[-31.941547393798828, -0.9084815979003906, 9.25],\r\n\t\t\t[-31.56389617919922, -1.4970167875289917, 9.25],\r\n\t\t\t[-31.86919403076172, -0.8785114884376526, 9.25],\r\n\t\t\t[-32.42536926269531, 0.4317629039287567, 9.25],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-33.26026153564453, 0.4702684283256531, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.26026153564453, 0.4702684283256531, 9.25],\r\n\t\t\t[-33.31120300292969, 0.4182531535625458, 9.25],\r\n\t\t\t[-33.19935989379883, 0.6755519509315491, 9.25],\r\n\t\t\t[-33.20264434814453, 0.6028211712837219, 9.25],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-33.20264434814453, 0.6028211712837219, 9.25],\r\n\t\t\t[-33.223350524902344, 0.5330230593681335, 9.25],\r\n\t\t\t[-32.80356979370117, 0.5815818309783936, 9.25],\r\n\t\t\t[-33.223350524902344, 0.5330230593681335, 9.25],\r\n\t\t\t[-33.26026153564453, 0.4702684283256531, 9.25],\r\n\t\t\t[-33.31120300292969, 0.4182531535625458, 9.25],\r\n\t\t\t[-33.373172760009766, 0.3800407350063324, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.373172760009766, 0.3800407350063324, 9.25],\r\n\t\t\t[-33.44252395629883, 0.35788166522979736, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.44252395629883, 0.35788166522979736, 9.25],\r\n\t\t\t[-33.51517105102539, 0.35308098793029785, 9.25],\r\n\t\t\t[-33.06182861328125, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.51517105102539, 0.35308098793029785, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.51517105102539, 0.35308098793029785, 9.25],\r\n\t\t\t[-33.58683395385742, 0.3659214675426483, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.58683395385742, 0.3659214675426483, 9.25],\r\n\t\t\t[-33.65329360961914, 0.3956468403339386, 9.25],\r\n\t\t\t[-33.65329360961914, 0.3956468403339386, 9.25],\r\n\t\t\t[-33.710636138916016, 0.4405064582824707, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.710636138916016, 0.4405064582824707, 9.25],\r\n\t\t\t[-33.75548553466797, 0.49785828590393066, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-33.75548553466797, 0.49785828590393066, 9.25],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-33.75548553466797, 0.49785828590393066, 9.25],\r\n\t\t\t[-33.78519821166992, 0.5643246173858643, 9.25],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-33.78519821166992, 0.5643246173858643, 9.25],\r\n\t\t\t[-33.79802322387695, 0.6359909176826477, 9.25],\r\n\t\t\t[-33.79802322387695, 0.6359909176826477, 9.25],\r\n\t\t\t[-33.79320526123047, 0.7086363434791565, 9.25],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-34.197105407714844, 0.6591883301734924, 9.25],\r\n\t\t\t[-34.589717864990234, 0.5522490739822388, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.589717864990234, 0.5522490739822388, 9.25],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.25],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.25],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.25],\r\n\t\t\t[-34.96290588378906, 0.3900355398654938, 9.25],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.04154968261719, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.25],\r\n\t\t\t[-35.11919403076172, -0.31870386004447937, 9.25],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.19683837890625, -0.32892611622810364, 9.25],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.30892562866211, 0.1759105771780014, 9.25],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.269195556640625, -0.3588962256908417, 9.25],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.25],\r\n\t\t\t[-35.33132553100586, -0.40657180547714233, 9.25],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.25],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.25],\r\n\t\t\t[-35.62061309814453, -0.08568680286407471, 9.25],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-35.37900161743164, -0.46870383620262146, 9.25],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.25],\r\n\t\t\t[-35.40896987915039, -0.5410581231117249, 9.25],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.25],\r\n\t\t\t[-35.419193267822266, -0.6187038421630859, 9.25],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.25],\r\n\t\t\t[-35.40896987915039, -0.696349561214447, 9.25],\r\n\t\t\t[-35.89149856567383, -0.3893333971500397, 9.25],\r\n\t\t\t[-36.115970611572266, -0.7287343144416809, 9.25],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.81919479370117, -0.6187038421630859, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.25],\r\n\t\t\t[-34.82941436767578, -0.5410581231117249, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.25],\r\n\t\t\t[-34.8593864440918, -0.46870383620262146, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.25],\r\n\t\t\t[-34.90706253051758, -0.40657180547714233, 9.25],\r\n\t\t\t[-34.23330307006836, -0.005017448682337999, 9.25],\r\n\t\t\t[-34.96919250488281, -0.3588962256908417, 9.25],\r\n\t\t\t[-34.82941436767578, -0.696349561214447, 9.25],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.8593864440918, -0.7687038779258728, 9.25],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.90706253051758, -0.8308358788490295, 9.25],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.25],\r\n\t\t\t[-34.96919250488281, -0.8785114884376526, 9.25],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.04154968261719, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.25],\r\n\t\t\t[-34.23330307006836, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.11919403076172, -0.9187038540840149, 9.25],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.19683837890625, -0.9084815979003906, 9.25],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.25],\r\n\t\t\t[-35.269195556640625, -0.8785114884376526, 9.25],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.72420120239258, -1.4970167875289917, 9.25],\r\n\t\t\t[-35.33132553100586, -0.8308358788490295, 9.25],\r\n\t\t\t[-35.37900161743164, -0.7687038779258728, 9.25],\r\n\t\t\t[-40.080570220947266, -10.780425071716309, 0.5109779238700867],\r\n\t\t\t[-39.957366943359375, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-39.957366943359375, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-39.66337966918945, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-39.66337966918945, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-39.66337966918945, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-39.3605842590332, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-39.3605842590332, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-39.049415588378906, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-39.049415588378906, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-39.3605842590332, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-39.3605842590332, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-39.049415588378906, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-39.3605842590332, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-39.049415588378906, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-39.049415588378906, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-39.3605842590332, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-39.24418258666992, 3.8777143955230713, 0.6705551147460938],\r\n\t\t\t[-39.049415588378906, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-39.24418258666992, 3.8777143955230713, 0.6705551147460938],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-39.957366943359375, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-40.080570220947266, -10.780425071716309, 0.5109779238700867],\r\n\t\t\t[-40.242122650146484, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-40.242122650146484, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-40.080570220947266, -10.780425071716309, 0.5109779238700867],\r\n\t\t\t[-40.322052001953125, -10.705615043640137, 0.45798635482788086],\r\n\t\t\t[-40.242122650146484, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-40.322052001953125, -10.705615043640137, 0.45798635482788086],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.322052001953125, -10.705615043640137, 0.45798635482788086],\r\n\t\t\t[-40.54357147216797, -10.582905769348145, 0.4061286151409149],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.54357147216797, -10.582905769348145, 0.4061286151409149],\r\n\t\t\t[-40.732460021972656, -10.423222541809082, 0.3593369126319885],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.732460021972656, -10.423222541809082, 0.3593369126319885],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-40.732460021972656, -10.423222541809082, 0.3593369126319885],\r\n\t\t\t[-40.886634826660156, -10.229643821716309, 0.3191690742969513],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-40.886634826660156, -10.229643821716309, 0.3191690742969513],\r\n\t\t\t[-41.036991119384766, -4.474867343902588, 0.27821236848831177],\r\n\t\t\t[-41.036991119384766, -4.474867343902588, 0.27821236848831177],\r\n\t\t\t[-40.886634826660156, -10.229643821716309, 0.3191690742969513],\r\n\t\t\t[-41.00541305541992, -10.002063751220703, 0.28697243332862854],\r\n\t\t\t[-41.036991119384766, -4.474867343902588, 0.27821236848831177],\r\n\t\t\t[-41.00541305541992, -10.002063751220703, 0.28697243332862854],\r\n\t\t\t[-41.07758712768555, -9.75425910949707, 0.266848087310791],\r\n\t\t\t[-41.10144805908203, -9.504133224487305, 0.26006585359573364],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.07758712768555, -9.75425910949707, 0.266848087310791],\r\n\t\t\t[-41.07758712768555, -9.75425910949707, 0.266848087310791],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.036991119384766, -4.474867343902588, 0.27821236848831177],\r\n\t\t\t[-41.036991119384766, -4.474867343902588, 0.27821236848831177],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.036991119384766, 1.8639496564865112, 0.27821236848831177],\r\n\t\t\t[-41.036991119384766, 1.8639496564865112, 0.27821236848831177],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.07951354980469, 2.710343599319458, 0.26630499958992004],\r\n\t\t\t[-41.036991119384766, 1.8639496564865112, 0.27821236848831177],\r\n\t\t\t[-41.07951354980469, 2.710343599319458, 0.26630499958992004],\r\n\t\t\t[-41.01322937011719, 2.960737466812134, 0.2848127484321594],\r\n\t\t\t[-41.01322937011719, 2.960737466812134, 0.2848127484321594],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-41.036991119384766, 1.8639496564865112, 0.27821236848831177],\r\n\t\t\t[-41.036991119384766, 1.8639496564865112, 0.27821236848831177],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-41.036991119384766, 1.8639496564865112, 0.27821236848831177],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-41.036991119384766, -4.474867343902588, 0.27821236848831177],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-40.78232192993164, 1.8639496564865112, 0.3465495705604553],\r\n\t\t\t[-40.78232192993164, 1.8639496564865112, 0.3465495705604553],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-40.7587776184082, 3.398878812789917, 0.3526104688644409],\r\n\t\t\t[-40.78232192993164, 1.8639496564865112, 0.3465495705604553],\r\n\t\t\t[-40.7587776184082, 3.398878812789917, 0.3526104688644409],\r\n\t\t\t[-40.58185958862305, 3.5702271461486816, 0.39684468507766724],\r\n\t\t\t[-40.78232192993164, 1.8639496564865112, 0.3465495705604553],\r\n\t\t\t[-40.58185958862305, 3.5702271461486816, 0.39684468507766724],\r\n\t\t\t[-40.51723861694336, 1.8639496564865112, 0.41248562932014465],\r\n\t\t\t[-40.51723861694336, 1.8639496564865112, 0.41248562932014465],\r\n\t\t\t[-40.58185958862305, 3.5702271461486816, 0.39684468507766724],\r\n\t\t\t[-40.3699836730957, 3.708836793899536, 0.4470369219779968],\r\n\t\t\t[-40.51723861694336, 1.8639496564865112, 0.41248562932014465],\r\n\t\t\t[-40.3699836730957, 3.708836793899536, 0.4470369219779968],\r\n\t\t\t[-40.242122650146484, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-40.242122650146484, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-40.3699836730957, 3.708836793899536, 0.4470369219779968],\r\n\t\t\t[-40.13410186767578, 3.8011467456817627, 0.49953368306159973],\r\n\t\t\t[-40.242122650146484, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-40.13410186767578, 3.8011467456817627, 0.49953368306159973],\r\n\t\t\t[-39.957366943359375, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-39.957366943359375, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-40.13410186767578, 3.8011467456817627, 0.49953368306159973],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-39.957366943359375, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-39.66337966918945, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-39.66337966918945, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-39.24418258666992, 3.8777143955230713, 0.6705551147460938],\r\n\t\t\t[-39.66337966918945, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-39.24418258666992, 3.8777143955230713, 0.6705551147460938],\r\n\t\t\t[-39.3605842590332, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-37.84473419189453, 3.9370944499969482, 0.8702793717384338],\r\n\t\t\t[-38.07015609741211, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-38.07015609741211, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-38.40373611450195, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-38.40373611450195, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-38.73031234741211, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-38.73031234741211, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-38.40373611450195, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-38.40373611450195, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-38.73031234741211, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-38.40373611450195, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-38.73031234741211, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-38.73031234741211, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-38.40373611450195, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-38.515708923339844, -10.80894660949707, 0.7837849259376526],\r\n\t\t\t[-38.73031234741211, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-38.515708923339844, -10.80894660949707, 0.7837849259376526],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-37.099891662597656, 3.960418939590454, 0.9487308859825134],\r\n\t\t\t[-37.3838996887207, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-37.84473419189453, 3.9370944499969482, 0.8702793717384338],\r\n\t\t\t[-37.84473419189453, 3.9370944499969482, 0.8702793717384338],\r\n\t\t\t[-37.3838996887207, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-37.73004913330078, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-37.84473419189453, 3.9370944499969482, 0.8702793717384338],\r\n\t\t\t[-37.73004913330078, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-38.07015609741211, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-38.07015609741211, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-37.73004913330078, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-37.73004913330078, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-38.07015609741211, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-37.73004913330078, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-38.07015609741211, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-38.07015609741211, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-37.73004913330078, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-37.805091857910156, -10.810272216796875, 0.8749025464057922],\r\n\t\t\t[-38.07015609741211, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-37.805091857910156, -10.810272216796875, 0.8749025464057922],\r\n\t\t\t[-38.515708923339844, -10.80894660949707, 0.7837849259376526],\r\n\t\t\t[-36.331451416015625, 3.979285717010498, 1.01218843460083],\r\n\t\t\t[-36.675472259521484, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-37.099891662597656, 3.960418939590454, 0.9487308859825134],\r\n\t\t\t[-37.099891662597656, 3.960418939590454, 0.9487308859825134],\r\n\t\t\t[-36.675472259521484, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-37.03220748901367, 1.8639496564865112, 0.9550096392631531],\r\n\t\t\t[-37.099891662597656, 3.960418939590454, 0.9487308859825134],\r\n\t\t\t[-37.03220748901367, 1.8639496564865112, 0.9550096392631531],\r\n\t\t\t[-37.3838996887207, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-37.3838996887207, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-37.03220748901367, 1.8639496564865112, 0.9550096392631531],\r\n\t\t\t[-37.03220748901367, -4.474867343902588, 0.9550096392631531],\r\n\t\t\t[-37.3838996887207, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-37.03220748901367, -4.474867343902588, 0.9550096392631531],\r\n\t\t\t[-37.3838996887207, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-37.3838996887207, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-37.03220748901367, -4.474867343902588, 0.9550096392631531],\r\n\t\t\t[-37.06682586669922, -10.811391830444336, 0.9518154263496399],\r\n\t\t\t[-37.3838996887207, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-37.06682586669922, -10.811391830444336, 0.9518154263496399],\r\n\t\t\t[-37.805091857910156, -10.810272216796875, 0.8749025464057922],\r\n\t\t\t[-35.544464111328125, 3.993570327758789, 1.060234546661377],\r\n\t\t\t[-35.948936462402344, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-36.331451416015625, 3.979285717010498, 1.01218843460083],\r\n\t\t\t[-36.331451416015625, 3.979285717010498, 1.01218843460083],\r\n\t\t\t[-35.948936462402344, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-36.314208984375, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-36.331451416015625, 3.979285717010498, 1.01218843460083],\r\n\t\t\t[-36.314208984375, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-36.675472259521484, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-36.675472259521484, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-36.314208984375, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-36.314208984375, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-36.675472259521484, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-36.314208984375, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-36.675472259521484, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-36.675472259521484, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-36.314208984375, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-36.305660247802734, -10.812296867370605, 1.0140280723571777],\r\n\t\t\t[-36.675472259521484, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-36.305660247802734, -10.812296867370605, 1.0140280723571777],\r\n\t\t\t[-37.06682586669922, -10.811391830444336, 0.9518154263496399],\r\n\t\t\t[-34.74410629272461, 4.003178596496582, 1.092552900314331],\r\n\t\t\t[-35.20844650268555, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-35.544464111328125, 3.993570327758789, 1.060234546661377],\r\n\t\t\t[-35.544464111328125, 3.993570327758789, 1.060234546661377],\r\n\t\t\t[-35.20844650268555, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-35.580169677734375, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-35.544464111328125, 3.993570327758789, 1.060234546661377],\r\n\t\t\t[-35.580169677734375, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-35.948936462402344, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-35.948936462402344, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-35.580169677734375, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-35.580169677734375, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-35.948936462402344, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-35.580169677734375, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-35.948936462402344, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-35.948936462402344, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-35.580169677734375, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-35.52650451660156, -10.812982559204102, 1.061139464378357],\r\n\t\t\t[-35.948936462402344, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-35.52650451660156, -10.812982559204102, 1.061139464378357],\r\n\t\t\t[-36.305660247802734, -10.812296867370605, 1.0140280723571777],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-34.458248138427734, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-34.74410629272461, 4.003178596496582, 1.092552900314331],\r\n\t\t\t[-34.74410629272461, 4.003178596496582, 1.092552900314331],\r\n\t\t\t[-34.458248138427734, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-34.834293365478516, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-34.74410629272461, 4.003178596496582, 1.092552900314331],\r\n\t\t\t[-34.834293365478516, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-35.20844650268555, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-35.20844650268555, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-34.834293365478516, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-34.834293365478516, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-35.20844650268555, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-34.834293365478516, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-35.20844650268555, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-35.20844650268555, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-34.834293365478516, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-34.734378814697266, -10.813444137573242, 1.092846155166626],\r\n\t\t\t[-35.20844650268555, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-34.734378814697266, -10.813444137573242, 1.092846155166626],\r\n\t\t\t[-35.52650451660156, -10.812982559204102, 1.061139464378357],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-33.70263671875, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-33.70263671875, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-34.080848693847656, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-34.080848693847656, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-34.458248138427734, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-34.458248138427734, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-34.080848693847656, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-34.080848693847656, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-34.458248138427734, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-34.080848693847656, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-34.458248138427734, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-34.458248138427734, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-34.080848693847656, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-34.458248138427734, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-34.734378814697266, -10.813444137573242, 1.092846155166626],\r\n\t\t\t[-32.31575012207031, 4.003472328186035, 1.0935399532318115],\r\n\t\t\t[-32.568546295166016, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-32.568546295166016, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-32.945945739746094, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-32.945945739746094, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-33.324153900146484, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.324153900146484, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-32.945945739746094, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-32.945945739746094, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-33.324153900146484, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-32.945945739746094, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-33.324153900146484, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.324153900146484, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-32.945945739746094, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-33.324153900146484, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-33.70263671875, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.70263671875, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-33.70263671875, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-34.080848693847656, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-31.514957427978516, 3.9940571784973145, 1.0618724822998047],\r\n\t\t\t[-31.818347930908203, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-32.31575012207031, 4.003472328186035, 1.0935399532318115],\r\n\t\t\t[-32.31575012207031, 4.003472328186035, 1.0935399532318115],\r\n\t\t\t[-31.818347930908203, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-32.192501068115234, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-32.31575012207031, 4.003472328186035, 1.0935399532318115],\r\n\t\t\t[-32.192501068115234, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-32.568546295166016, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-32.568546295166016, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-32.192501068115234, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-32.192501068115234, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-32.568546295166016, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-32.192501068115234, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-32.568546295166016, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-32.568546295166016, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-32.192501068115234, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-32.33142852783203, -10.813461303710938, 1.0939985513687134],\r\n\t\t\t[-32.568546295166016, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-32.33142852783203, -10.813461303710938, 1.0939985513687134],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-30.727317810058594, 3.9799628257751465, 1.0144665241241455],\r\n\t\t\t[-31.077857971191406, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-31.514957427978516, 3.9940571784973145, 1.0618724822998047],\r\n\t\t\t[-31.514957427978516, 3.9940571784973145, 1.0618724822998047],\r\n\t\t\t[-31.077857971191406, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-31.446622848510742, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-31.514957427978516, 3.9940571784973145, 1.0618724822998047],\r\n\t\t\t[-31.446622848510742, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-31.818347930908203, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-31.818347930908203, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-31.446622848510742, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-31.446622848510742, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-31.818347930908203, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-31.446622848510742, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-31.818347930908203, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-31.818347930908203, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-31.446622848510742, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-31.53879737854004, -10.813010215759277, 1.0630519390106201],\r\n\t\t\t[-31.818347930908203, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-31.53879737854004, -10.813010215759277, 1.0630519390106201],\r\n\t\t\t[-32.33142852783203, -10.813461303710938, 1.0939985513687134],\r\n\t\t\t[-29.9580135345459, 3.961282253265381, 0.9516340494155884],\r\n\t\t\t[-30.351320266723633, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-30.727317810058594, 3.9799628257751465, 1.0144665241241455],\r\n\t\t\t[-30.727317810058594, 3.9799628257751465, 1.0144665241241455],\r\n\t\t\t[-30.351320266723633, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-30.712583541870117, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-30.727317810058594, 3.9799628257751465, 1.0144665241241455],\r\n\t\t\t[-30.712583541870117, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-31.077857971191406, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-31.077857971191406, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-30.712583541870117, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-30.712583541870117, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-31.077857971191406, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-30.712583541870117, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-31.077857971191406, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-31.077857971191406, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-30.712583541870117, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-30.758888244628906, -10.812335968017578, 1.0166881084442139],\r\n\t\t\t[-31.077857971191406, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-30.758888244628906, -10.812335968017578, 1.0166881084442139],\r\n\t\t\t[-31.53879737854004, -10.813010215759277, 1.0630519390106201],\r\n\t\t\t[-29.212108612060547, 3.9381377696990967, 0.873788595199585],\r\n\t\t\t[-29.642892837524414, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-29.9580135345459, 3.961282253265381, 0.9516340494155884],\r\n\t\t\t[-29.9580135345459, 3.961282253265381, 0.9516340494155884],\r\n\t\t\t[-29.642892837524414, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-29.994890213012695, 1.8639496564865112, 0.955037534236908],\r\n\t\t\t[-29.9580135345459, 3.961282253265381, 0.9516340494155884],\r\n\t\t\t[-29.994890213012695, 1.8639496564865112, 0.955037534236908],\r\n\t\t\t[-30.351320266723633, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-30.351320266723633, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-29.994890213012695, 1.8639496564865112, 0.955037534236908],\r\n\t\t\t[-29.99580955505371, -4.474867343902588, 0.9551218748092651],\r\n\t\t\t[-30.351320266723633, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-29.99580955505371, -4.474867343902588, 0.9551218748092651],\r\n\t\t\t[-30.351320266723633, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-30.351320266723633, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-29.99580955505371, -4.474867343902588, 0.9551218748092651],\r\n\t\t\t[-29.996728897094727, -10.811441421508789, 0.9552060961723328],\r\n\t\t\t[-30.351320266723633, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-29.996728897094727, -10.811441421508789, 0.9552060961723328],\r\n\t\t\t[-30.758888244628906, -10.812335968017578, 1.0166881084442139],\r\n\t\t\t[-28.494508743286133, 3.910682439804077, 0.781442403793335],\r\n\t\t\t[-28.956636428833008, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-29.212108612060547, 3.9381377696990967, 0.873788595199585],\r\n\t\t\t[-29.212108612060547, 3.9381377696990967, 0.873788595199585],\r\n\t\t\t[-28.956636428833008, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-29.29674530029297, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-29.212108612060547, 3.9381377696990967, 0.873788595199585],\r\n\t\t\t[-29.29674530029297, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-29.642892837524414, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-29.642892837524414, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-29.29674530029297, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-29.29674530029297, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-29.642892837524414, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-29.29674530029297, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-29.642892837524414, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-29.642892837524414, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-29.29674530029297, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-29.25722885131836, -10.810332298278809, 0.8790019154548645],\r\n\t\t\t[-29.642892837524414, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-29.25722885131836, -10.810332298278809, 0.8790019154548645],\r\n\t\t\t[-29.996728897094727, -10.811441421508789, 0.9552060961723328],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-28.29648208618164, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-28.494508743286133, 3.910682439804077, 0.781442403793335],\r\n\t\t\t[-28.494508743286133, 3.910682439804077, 0.781442403793335],\r\n\t\t\t[-28.29648208618164, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-28.623056411743164, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-28.494508743286133, 3.910682439804077, 0.781442403793335],\r\n\t\t\t[-28.623056411743164, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-28.956636428833008, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-28.956636428833008, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-28.623056411743164, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-28.623056411743164, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-28.956636428833008, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-28.623056411743164, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-28.956636428833008, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-28.956636428833008, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-28.623056411743164, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-28.545150756835938, -10.809016227722168, 0.7885666489601135],\r\n\t\t\t[-28.956636428833008, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-28.545150756835938, -10.809016227722168, 0.7885666489601135],\r\n\t\t\t[-29.25722885131836, -10.810332298278809, 0.8790019154548645],\r\n\t\t\t[-27.564794540405273, 3.840742349624634, 0.6322844624519348],\r\n\t\t\t[-27.666208267211914, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-27.666208267211914, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-27.977378845214844, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-27.977378845214844, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-28.29648208618164, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-28.29648208618164, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-27.977378845214844, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-27.977378845214844, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-28.29648208618164, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-27.977378845214844, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-28.29648208618164, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-28.29648208618164, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-27.977378845214844, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145],\r\n\t\t\t[-28.29648208618164, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145],\r\n\t\t\t[-28.545150756835938, -10.809016227722168, 0.7885666489601135],\r\n\t\t\t[-27.666208267211914, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-27.564794540405273, 3.840742349624634, 0.6322844624519348],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.564794540405273, 3.840742349624634, 0.6322844624519348],\r\n\t\t\t[-27.32778549194336, 3.751084089279175, 0.588144838809967],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.32778549194336, 3.751084089279175, 0.588144838809967],\r\n\t\t\t[-27.11457061767578, 3.614898681640625, 0.5459926128387451],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.11457061767578, 3.614898681640625, 0.5459926128387451],\r\n\t\t\t[-27.069425582885742, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-27.069425582885742, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-27.11457061767578, 3.614898681640625, 0.5459926128387451],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-27.069425582885742, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-26.784671783447266, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.784671783447266, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.784671783447266, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-26.79065704345703, 3.2426905632019043, 0.4772442579269409],\r\n\t\t\t[-26.79065704345703, 3.2426905632019043, 0.4772442579269409],\r\n\t\t\t[-26.784671783447266, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.61396026611328, 2.761353015899658, 0.4371478855609894],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-26.61396026611328, 2.761353015899658, 0.4371478855609894],\r\n\t\t\t[-26.5920467376709, 2.5120368003845215, 0.4320164620876312],\r\n\t\t\t[-26.616003036499023, -9.756340026855469, 0.43762320280075073],\r\n\t\t\t[-26.688413619995117, -10.003666877746582, 0.45427384972572327],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-26.688413619995117, -10.003666877746582, 0.45427384972572327],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.688413619995117, -10.003666877746582, 0.45427384972572327],\r\n\t\t\t[-26.807796478271484, -10.2311429977417, 0.481032133102417],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.807796478271484, -10.2311429977417, 0.481032133102417],\r\n\t\t\t[-26.96327781677246, -10.425240516662598, 0.5146366953849792],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.96327781677246, -10.425240516662598, 0.5146366953849792],\r\n\t\t\t[-27.069425582885742, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-27.069425582885742, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-26.96327781677246, -10.425240516662598, 0.5146366953849792],\r\n\t\t\t[-27.15293312072754, -10.584622383117676, 0.553747296333313],\r\n\t\t\t[-27.069425582885742, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-27.15293312072754, -10.584622383117676, 0.553747296333313],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.15293312072754, -10.584622383117676, 0.553747296333313],\r\n\t\t\t[-27.375879287719727, -10.707438468933105, 0.5973300337791443],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.375879287719727, -10.707438468933105, 0.5973300337791443],\r\n\t\t\t[-27.619003295898438, -10.782312393188477, 0.6419953107833862],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.619003295898438, -10.782312393188477, 0.6419953107833862],\r\n\t\t\t[-27.666208267211914, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-27.666208267211914, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-27.619003295898438, -10.782312393188477, 0.6419953107833862],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145],\r\n\t\t\t[-27.666208267211914, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145],\r\n\t\t\t[-27.977378845214844, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-29.996728897094727, -10.811441421508789, 0.9552060961723328],\r\n\t\t\t[-29.99580955505371, -4.474867343902588, 0.9551218748092651],\r\n\t\t\t[-29.642892837524414, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-29.642892837524414, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-29.99580955505371, -4.474867343902588, 0.9551218748092651],\r\n\t\t\t[-29.994890213012695, 1.8639496564865112, 0.955037534236908],\r\n\t\t\t[-29.642892837524414, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-29.994890213012695, 1.8639496564865112, 0.955037534236908],\r\n\t\t\t[-29.642892837524414, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-30.758888244628906, -10.812335968017578, 1.0166881084442139],\r\n\t\t\t[-30.712583541870117, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-30.351320266723633, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-30.351320266723633, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-30.712583541870117, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-30.712583541870117, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-30.351320266723633, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-30.712583541870117, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-30.351320266723633, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-31.53879737854004, -10.813010215759277, 1.0630519390106201],\r\n\t\t\t[-31.446622848510742, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-31.077857971191406, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-31.077857971191406, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-31.446622848510742, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-31.446622848510742, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-31.077857971191406, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-31.446622848510742, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-31.077857971191406, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-32.33142852783203, -10.813461303710938, 1.0939985513687134],\r\n\t\t\t[-32.192501068115234, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-31.818347930908203, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-31.818347930908203, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-32.192501068115234, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-32.192501068115234, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-31.818347930908203, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-32.192501068115234, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-31.818347930908203, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-32.945945739746094, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-32.568546295166016, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-32.568546295166016, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-32.945945739746094, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-32.945945739746094, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-32.568546295166016, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-32.945945739746094, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-32.568546295166016, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-33.324153900146484, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.70263671875, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.70263671875, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.324153900146484, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.324153900146484, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.70263671875, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-33.324153900146484, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.70263671875, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-37.06682586669922, -10.811391830444336, 0.9518154263496399],\r\n\t\t\t[-37.03220748901367, -4.474867343902588, 0.9550096392631531],\r\n\t\t\t[-36.675472259521484, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-36.675472259521484, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-37.03220748901367, -4.474867343902588, 0.9550096392631531],\r\n\t\t\t[-37.03220748901367, 1.8639496564865112, 0.9550096392631531],\r\n\t\t\t[-36.675472259521484, -4.474867343902588, 0.9858734011650085],\r\n\t\t\t[-37.03220748901367, 1.8639496564865112, 0.9550096392631531],\r\n\t\t\t[-36.675472259521484, 1.8639496564865112, 0.9858734011650085],\r\n\t\t\t[-37.805091857910156, -10.810272216796875, 0.8749025464057922],\r\n\t\t\t[-37.73004913330078, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-37.3838996887207, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-37.3838996887207, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-37.73004913330078, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-37.73004913330078, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-37.3838996887207, -4.474867343902588, 0.9208731651306152],\r\n\t\t\t[-37.73004913330078, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-37.3838996887207, 1.8639496564865112, 0.9208731651306152],\r\n\t\t\t[-38.515708923339844, -10.80894660949707, 0.7837849259376526],\r\n\t\t\t[-38.40373611450195, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-38.07015609741211, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-38.07015609741211, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-38.40373611450195, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-38.40373611450195, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-38.07015609741211, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-38.40373611450195, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-38.07015609741211, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-38.73031234741211, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-39.049415588378906, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-39.049415588378906, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-38.73031234741211, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-38.73031234741211, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-39.049415588378906, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-38.73031234741211, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-39.049415588378906, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-39.049415588378906, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-38.73031234741211, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-39.66337966918945, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-39.66337966918945, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-39.957366943359375, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-39.957366943359375, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-39.66337966918945, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-39.957366943359375, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-39.957366943359375, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-39.957366943359375, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-40.242122650146484, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-40.242122650146484, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-39.957366943359375, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-40.242122650146484, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-40.242122650146484, 1.8639496564865112, 0.47592613101005554],\r\n\t\t\t[-40.242122650146484, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-40.51723861694336, 1.8639496564865112, 0.41248562932014465],\r\n\t\t\t[-40.51723861694336, 1.8639496564865112, 0.41248562932014465],\r\n\t\t\t[-40.242122650146484, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.51723861694336, 1.8639496564865112, 0.41248562932014465],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.78232192993164, 1.8639496564865112, 0.3465495705604553],\r\n\t\t\t[-40.78232192993164, 1.8639496564865112, 0.3465495705604553],\r\n\t\t\t[-40.51723861694336, -4.474867343902588, 0.41248562932014465],\r\n\t\t\t[-40.78232192993164, -4.474867343902588, 0.3465495705604553],\r\n\t\t\t[-39.3605842590332, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-39.3605842590332, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-39.66337966918945, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-39.66337966918945, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-39.3605842590332, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-39.66337966918945, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-35.948936462402344, 1.8639496564865112, 1.037610650062561],\r\n\t\t\t[-35.948936462402344, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-36.314208984375, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-36.314208984375, 1.8639496564865112, 1.0134202241897583],\r\n\t\t\t[-35.948936462402344, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-36.314208984375, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-35.948936462402344, -4.474867343902588, 1.037610650062561],\r\n\t\t\t[-36.305660247802734, -10.812296867370605, 1.0140280723571777],\r\n\t\t\t[-36.314208984375, -4.474867343902588, 1.0134202241897583],\r\n\t\t\t[-35.580169677734375, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-35.580169677734375, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-35.20844650268555, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-35.20844650268555, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-35.580169677734375, 1.8639496564865112, 1.0584100484848022],\r\n\t\t\t[-35.20844650268555, 1.8639496564865112, 1.0757886171340942],\r\n\t\t\t[-34.458248138427734, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-34.734378814697266, -10.813444137573242, 1.092846155166626],\r\n\t\t\t[-34.834293365478516, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-35.52650451660156, -10.812982559204102, 1.061139464378357],\r\n\t\t\t[-35.580169677734375, -4.474867343902588, 1.0584100484848022],\r\n\t\t\t[-35.20844650268555, -4.474867343902588, 1.0757886171340942],\r\n\t\t\t[-34.834293365478516, -4.474867343902588, 1.089721441268921],\r\n\t\t\t[-34.834293365478516, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-34.458248138427734, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-34.458248138427734, -4.474867343902588, 1.1001884937286377],\r\n\t\t\t[-34.834293365478516, 1.8639496564865112, 1.089721441268921],\r\n\t\t\t[-34.458248138427734, 1.8639496564865112, 1.1001884937286377],\r\n\t\t\t[-34.080848693847656, -4.474867343902588, 1.1071748733520508],\r\n\t\t\t[-34.080848693847656, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-33.70263671875, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-33.70263671875, -4.474867343902588, 1.1106706857681274],\r\n\t\t\t[-34.080848693847656, 1.8639496564865112, 1.1071748733520508],\r\n\t\t\t[-33.70263671875, 1.8639496564865112, 1.1106706857681274],\r\n\t\t\t[-28.956636428833008, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-29.25722885131836, -10.810332298278809, 0.8790019154548645],\r\n\t\t\t[-29.29674530029297, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-28.956636428833008, 1.8639496564865112, 0.8429821729660034],\r\n\t\t\t[-28.956636428833008, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-29.29674530029297, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-29.29674530029297, 1.8639496564865112, 0.8835127949714661],\r\n\t\t\t[-28.956636428833008, -4.474867343902588, 0.8429821729660034],\r\n\t\t\t[-29.29674530029297, -4.474867343902588, 0.8835127949714661],\r\n\t\t\t[-28.29648208618164, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-28.545150756835938, -10.809016227722168, 0.7885666489601135],\r\n\t\t\t[-28.623056411743164, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-28.29648208618164, 1.8639496564865112, 0.7526466846466064],\r\n\t\t\t[-28.29648208618164, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-28.623056411743164, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-28.623056411743164, 1.8639496564865112, 0.7993392944335938],\r\n\t\t\t[-28.29648208618164, -4.474867343902588, 0.7526466846466064],\r\n\t\t\t[-28.623056411743164, -4.474867343902588, 0.7993392944335938],\r\n\t\t\t[-27.977378845214844, -4.474867343902588, 0.7029712796211243],\r\n\t\t\t[-27.977378845214844, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-27.666208267211914, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-27.666208267211914, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-27.977378845214844, 1.8639496564865112, 0.7029712796211243],\r\n\t\t\t[-27.666208267211914, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-27.666208267211914, -4.474867343902588, 0.6503841280937195],\r\n\t\t\t[-27.666208267211914, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.666208267211914, 1.8639496564865112, 0.6503841280937195],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.363412857055664, -4.474867343902588, 0.594960629940033],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.069425582885742, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-27.069425582885742, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-27.363412857055664, 1.8639496564865112, 0.594960629940033],\r\n\t\t\t[-27.069425582885742, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-27.069425582885742, -4.474867343902588, 0.5367801785469055],\r\n\t\t\t[-27.069425582885742, 1.8639496564865112, 0.5367801785469055],\r\n\t\t\t[-26.784671783447266, -4.474867343902588, 0.47592613101005554],\r\n\t\t\t[-26.61396026611328, 2.761353015899658, 0.4371478855609894],\r\n\t\t\t[-26.132558822631836, 3.5628113746643066, 3.3575024604797363],\r\n\t\t\t[-26.5920467376709, 2.5120368003845215, 0.4320164620876312],\r\n\t\t\t[-26.5920467376709, 2.5120368003845215, 0.4320164620876312],\r\n\t\t\t[-26.132558822631836, 3.5628113746643066, 3.3575024604797363],\r\n\t\t\t[-25.487762451171875, 4.752615928649902, 7.359392166137695],\r\n\t\t\t[-26.5920467376709, 2.5120368003845215, 0.4320164620876312],\r\n\t\t\t[-25.487762451171875, 4.752615928649902, 7.359392166137695],\r\n\t\t\t[-24.857074737548828, 5.713472843170166, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, 5.713472843170166, 11.199999809265137],\r\n\t\t\t[-25.487762451171875, 4.752615928649902, 7.359392166137695],\r\n\t\t\t[-24.88094139099121, 5.969139099121094, 11.199999809265137],\r\n\t\t\t[-24.88094139099121, 5.969139099121094, 11.199999809265137],\r\n\t\t\t[-25.487762451171875, 4.752615928649902, 7.359392166137695],\r\n\t\t\t[-25.563142776489258, 5.00596809387207, 7.296213626861572],\r\n\t\t\t[-24.88094139099121, 5.969139099121094, 11.199999809265137],\r\n\t\t\t[-25.563142776489258, 5.00596809387207, 7.296213626861572],\r\n\t\t\t[-24.95167350769043, 6.213308811187744, 11.199999809265137],\r\n\t\t\t[-24.95167350769043, 6.213308811187744, 11.199999809265137],\r\n\t\t\t[-25.563142776489258, 5.00596809387207, 7.296213626861572],\r\n\t\t\t[-25.690473556518555, 5.240942478179932, 7.246869087219238],\r\n\t\t\t[-24.95167350769043, 6.213308811187744, 11.199999809265137],\r\n\t\t\t[-25.690473556518555, 5.240942478179932, 7.246869087219238],\r\n\t\t\t[-25.066709518432617, 6.437131404876709, 11.199999809265137],\r\n\t\t\t[-25.066709518432617, 6.437131404876709, 11.199999809265137],\r\n\t\t\t[-25.690473556518555, 5.240942478179932, 7.246869087219238],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-25.066709518432617, 6.437131404876709, 11.199999809265137],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-25.22187614440918, 6.632493019104004, 11.199999809265137],\r\n\t\t\t[-25.22187614440918, 6.632493019104004, 11.199999809265137],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-25.41155242919922, 6.7923126220703125, 11.199999809265137],\r\n\t\t\t[-25.41155242919922, 6.7923126220703125, 11.199999809265137],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-26.076704025268555, 5.615931034088135, 7.1976118087768555],\r\n\t\t\t[-25.41155242919922, 6.7923126220703125, 11.199999809265137],\r\n\t\t\t[-26.076704025268555, 5.615931034088135, 7.1976118087768555],\r\n\t\t\t[-25.628860473632812, 6.910796165466309, 11.199999809265137],\r\n\t\t\t[-25.628860473632812, 6.910796165466309, 11.199999809265137],\r\n\t\t\t[-26.076704025268555, 5.615931034088135, 7.1976118087768555],\r\n\t\t\t[-26.318721771240234, 5.739556789398193, 7.199851036071777],\r\n\t\t\t[-25.628860473632812, 6.910796165466309, 11.199999809265137],\r\n\t\t\t[-26.318721771240234, 5.739556789398193, 7.199851036071777],\r\n\t\t\t[-25.865924835205078, 6.983649253845215, 11.199999809265137],\r\n\t\t\t[-25.865924835205078, 6.983649253845215, 11.199999809265137],\r\n\t\t\t[-26.318721771240234, 5.739556789398193, 7.199851036071777],\r\n\t\t\t[-26.579669952392578, 5.812743186950684, 7.220136642456055],\r\n\t\t\t[-25.865924835205078, 6.983649253845215, 11.199999809265137],\r\n\t\t\t[-26.579669952392578, 5.812743186950684, 7.220136642456055],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-26.579669952392578, 5.812743186950684, 7.220136642456055],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-26.579669952392578, 5.812743186950684, 7.220136642456055],\r\n\t\t\t[-27.22446632385254, 4.622938632965088, 3.2182466983795166],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-27.22446632385254, 4.622938632965088, 3.2182466983795166],\r\n\t\t\t[-27.564794540405273, 3.840742349624634, 0.6322844624519348],\r\n\t\t\t[-27.564794540405273, 3.840742349624634, 0.6322844624519348],\r\n\t\t\t[-27.22446632385254, 4.622938632965088, 3.2182466983795166],\r\n\t\t\t[-26.963520050048828, 4.549752235412598, 3.1979613304138184],\r\n\t\t\t[-27.564794540405273, 3.840742349624634, 0.6322844624519348],\r\n\t\t\t[-26.963520050048828, 4.549752235412598, 3.1979613304138184],\r\n\t\t\t[-27.32778549194336, 3.751084089279175, 0.588144838809967],\r\n\t\t\t[-27.32778549194336, 3.751084089279175, 0.588144838809967],\r\n\t\t\t[-26.963520050048828, 4.549752235412598, 3.1979613304138184],\r\n\t\t\t[-26.721500396728516, 4.426126480102539, 3.1957216262817383],\r\n\t\t\t[-27.32778549194336, 3.751084089279175, 0.588144838809967],\r\n\t\t\t[-26.721500396728516, 4.426126480102539, 3.1957216262817383],\r\n\t\t\t[-27.11457061767578, 3.614898681640625, 0.5459926128387451],\r\n\t\t\t[-27.11457061767578, 3.614898681640625, 0.5459926128387451],\r\n\t\t\t[-26.721500396728516, 4.426126480102539, 3.1957216262817383],\r\n\t\t\t[-26.508989334106445, 4.25746488571167, 3.2116260528564453],\r\n\t\t\t[-27.11457061767578, 3.614898681640625, 0.5459926128387451],\r\n\t\t\t[-26.508989334106445, 4.25746488571167, 3.2116260528564453],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-26.508989334106445, 4.25746488571167, 3.2116260528564453],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-26.936405181884766, 3.4455204010009766, 0.5089297294616699],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-26.79065704345703, 3.2426905632019043, 0.4772442579269409],\r\n\t\t\t[-26.79065704345703, 3.2426905632019043, 0.4772442579269409],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-26.20793914794922, 3.8161635398864746, 3.294323444366455],\r\n\t\t\t[-26.680355072021484, 3.0102999210357666, 0.4524354934692383],\r\n\t\t\t[-26.20793914794922, 3.8161635398864746, 3.294323444366455],\r\n\t\t\t[-26.61396026611328, 2.761353015899658, 0.4371478855609894],\r\n\t\t\t[-26.61396026611328, 2.761353015899658, 0.4371478855609894],\r\n\t\t\t[-26.20793914794922, 3.8161635398864746, 3.294323444366455],\r\n\t\t\t[-26.132558822631836, 3.5628113746643066, 3.3575024604797363],\r\n\t\t\t[-25.563142776489258, 5.00596809387207, 7.296213626861572],\r\n\t\t\t[-25.487762451171875, 4.752615928649902, 7.359392166137695],\r\n\t\t\t[-26.132558822631836, 3.5628113746643066, 3.3575024604797363],\r\n\t\t\t[-25.690473556518555, 5.240942478179932, 7.246869087219238],\r\n\t\t\t[-25.563142776489258, 5.00596809387207, 7.296213626861572],\r\n\t\t\t[-26.20793914794922, 3.8161635398864746, 3.294323444366455],\r\n\t\t\t[-26.20793914794922, 3.8161635398864746, 3.294323444366455],\r\n\t\t\t[-25.563142776489258, 5.00596809387207, 7.296213626861572],\r\n\t\t\t[-26.132558822631836, 3.5628113746643066, 3.3575024604797363],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-25.690473556518555, 5.240942478179932, 7.246869087219238],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-25.690473556518555, 5.240942478179932, 7.246869087219238],\r\n\t\t\t[-26.20793914794922, 3.8161635398864746, 3.294323444366455],\r\n\t\t\t[-26.076704025268555, 5.615931034088135, 7.1976118087768555],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-26.508989334106445, 4.25746488571167, 3.2116260528564453],\r\n\t\t\t[-26.508989334106445, 4.25746488571167, 3.2116260528564453],\r\n\t\t\t[-25.86419105529785, 5.447268962860107, 7.2135162353515625],\r\n\t\t\t[-26.33527183532715, 4.051137924194336, 3.2449793815612793],\r\n\t\t\t[-26.318721771240234, 5.739556789398193, 7.199851036071777],\r\n\t\t\t[-26.076704025268555, 5.615931034088135, 7.1976118087768555],\r\n\t\t\t[-26.721500396728516, 4.426126480102539, 3.1957216262817383],\r\n\t\t\t[-26.721500396728516, 4.426126480102539, 3.1957216262817383],\r\n\t\t\t[-26.076704025268555, 5.615931034088135, 7.1976118087768555],\r\n\t\t\t[-26.508989334106445, 4.25746488571167, 3.2116260528564453],\r\n\t\t\t[-26.579669952392578, 5.812743186950684, 7.220136642456055],\r\n\t\t\t[-26.318721771240234, 5.739556789398193, 7.199851036071777],\r\n\t\t\t[-26.963520050048828, 4.549752235412598, 3.1979613304138184],\r\n\t\t\t[-26.963520050048828, 4.549752235412598, 3.1979613304138184],\r\n\t\t\t[-26.318721771240234, 5.739556789398193, 7.199851036071777],\r\n\t\t\t[-26.721500396728516, 4.426126480102539, 3.1957216262817383],\r\n\t\t\t[-27.22446632385254, 4.622938632965088, 3.2182466983795166],\r\n\t\t\t[-26.579669952392578, 5.812743186950684, 7.220136642456055],\r\n\t\t\t[-26.963520050048828, 4.549752235412598, 3.1979613304138184],\r\n\t\t\t[-27.809938430786133, 3.879096269607544, 0.6752032041549683],\r\n\t\t\t[-28.494508743286133, 3.910682439804077, 0.781442403793335],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-28.494508743286133, 3.910682439804077, 0.781442403793335],\r\n\t\t\t[-29.212108612060547, 3.9381377696990967, 0.873788595199585],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-29.212108612060547, 3.9381377696990967, 0.873788595199585],\r\n\t\t\t[-29.9580135345459, 3.961282253265381, 0.9516340494155884],\r\n\t\t\t[-29.9580135345459, 3.961282253265381, 0.9516340494155884],\r\n\t\t\t[-30.727317810058594, 3.9799628257751465, 1.0144665241241455],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-30.727317810058594, 3.9799628257751465, 1.0144665241241455],\r\n\t\t\t[-31.514957427978516, 3.9940571784973145, 1.0618724822998047],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-31.514957427978516, 3.9940571784973145, 1.0618724822998047],\r\n\t\t\t[-32.31575012207031, 4.003472328186035, 1.0935399532318115],\r\n\t\t\t[-32.31575012207031, 4.003472328186035, 1.0935399532318115],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-33.124420166015625, 4.008146286010742, 1.1092605590820312],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-33.93565368652344, 4.008048057556152, 1.1089308261871338],\r\n\t\t\t[-34.74410629272461, 4.003178596496582, 1.092552900314331],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-34.74410629272461, 4.003178596496582, 1.092552900314331],\r\n\t\t\t[-35.544464111328125, 3.993570327758789, 1.060234546661377],\r\n\t\t\t[-35.544464111328125, 3.993570327758789, 1.060234546661377],\r\n\t\t\t[-36.331451416015625, 3.979285717010498, 1.01218843460083],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-36.331451416015625, 3.979285717010498, 1.01218843460083],\r\n\t\t\t[-37.099891662597656, 3.960418939590454, 0.9487308859825134],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-37.099891662597656, 3.960418939590454, 0.9487308859825134],\r\n\t\t\t[-37.84473419189453, 3.9370944499969482, 0.8702793717384338],\r\n\t\t\t[-37.84473419189453, 3.9370944499969482, 0.8702793717384338],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-38.56106948852539, 3.909465789794922, 0.7773502469062805],\r\n\t\t\t[-39.24418258666992, 3.8777143955230713, 0.6705551147460938],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-39.24418258666992, 3.8777143955230713, 0.6705551147460938],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-40.13410186767578, 3.8011467456817627, 0.49953368306159973],\r\n\t\t\t[-40.39201736450195, 4.444929599761963, 2.619811534881592],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-40.39201736450195, 4.444929599761963, 2.619811534881592],\r\n\t\t\t[-41.06989288330078, 5.723543643951416, 6.92041015625],\r\n\t\t\t[-39.88958740234375, 3.8420495986938477, 0.5505967140197754],\r\n\t\t\t[-41.06989288330078, 5.723543643951416, 6.92041015625],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.06989288330078, 5.723543643951416, 6.92041015625],\r\n\t\t\t[-41.81645584106445, 6.983618259429932, 11.199999809265137],\r\n\t\t\t[-41.81645584106445, 6.983618259429932, 11.199999809265137],\r\n\t\t\t[-41.06989288330078, 5.723543643951416, 6.92041015625],\r\n\t\t\t[-41.33094024658203, 5.6504807472229, 6.900985240936279],\r\n\t\t\t[-41.81645584106445, 6.983618259429932, 11.199999809265137],\r\n\t\t\t[-41.33094024658203, 5.6504807472229, 6.900985240936279],\r\n\t\t\t[-42.05360412597656, 6.910674571990967, 11.199999809265137],\r\n\t\t\t[-42.05360412597656, 6.910674571990967, 11.199999809265137],\r\n\t\t\t[-41.33094024658203, 5.6504807472229, 6.900985240936279],\r\n\t\t\t[-41.573020935058594, 5.526970863342285, 6.899548053741455],\r\n\t\t\t[-42.05360412597656, 6.910674571990967, 11.199999809265137],\r\n\t\t\t[-41.573020935058594, 5.526970863342285, 6.899548053741455],\r\n\t\t\t[-42.27101516723633, 6.79204797744751, 11.199999809265137],\r\n\t\t\t[-42.27101516723633, 6.79204797744751, 11.199999809265137],\r\n\t\t\t[-41.573020935058594, 5.526970863342285, 6.899548053741455],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-42.27101516723633, 6.79204797744751, 11.199999809265137],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-42.460792541503906, 6.632042407989502, 11.199999809265137],\r\n\t\t\t[-42.460792541503906, 6.632042407989502, 11.199999809265137],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-42.616058349609375, 6.436466693878174, 11.199999809265137],\r\n\t\t\t[-42.616058349609375, 6.436466693878174, 11.199999809265137],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-41.959266662597656, 5.152170658111572, 6.950098991394043],\r\n\t\t\t[-42.616058349609375, 6.436466693878174, 11.199999809265137],\r\n\t\t\t[-41.959266662597656, 5.152170658111572, 6.950098991394043],\r\n\t\t\t[-42.731170654296875, 6.212418556213379, 11.199999809265137],\r\n\t\t\t[-42.731170654296875, 6.212418556213379, 11.199999809265137],\r\n\t\t\t[-41.959266662597656, 5.152170658111572, 6.950098991394043],\r\n\t\t\t[-42.0865478515625, 4.917260646820068, 6.999877452850342],\r\n\t\t\t[-42.731170654296875, 6.212418556213379, 11.199999809265137],\r\n\t\t\t[-42.0865478515625, 4.917260646820068, 6.999877452850342],\r\n\t\t\t[-42.80195236206055, 5.968029499053955, 11.199999809265137],\r\n\t\t\t[-42.80195236206055, 5.968029499053955, 11.199999809265137],\r\n\t\t\t[-42.0865478515625, 4.917260646820068, 6.999877452850342],\r\n\t\t\t[-42.161842346191406, 4.663949012756348, 7.063321590423584],\r\n\t\t\t[-42.80195236206055, 5.968029499053955, 11.199999809265137],\r\n\t\t\t[-42.161842346191406, 4.663949012756348, 7.063321590423584],\r\n\t\t\t[-42.82583236694336, 5.712170124053955, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, 5.712170124053955, 11.199999809265137],\r\n\t\t\t[-42.161842346191406, 4.663949012756348, 7.063321590423584],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-42.161842346191406, 4.663949012756348, 7.063321590423584],\r\n\t\t\t[-41.483970642089844, 3.3853354454040527, 2.762723207473755],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.483970642089844, 3.3853354454040527, 2.762723207473755],\r\n\t\t\t[-41.07951354980469, 2.710343599319458, 0.26630499958992004],\r\n\t\t\t[-41.07951354980469, 2.710343599319458, 0.26630499958992004],\r\n\t\t\t[-41.483970642089844, 3.3853354454040527, 2.762723207473755],\r\n\t\t\t[-41.40867614746094, 3.6386470794677734, 2.6992790699005127],\r\n\t\t\t[-41.07951354980469, 2.710343599319458, 0.26630499958992004],\r\n\t\t\t[-41.40867614746094, 3.6386470794677734, 2.6992790699005127],\r\n\t\t\t[-41.01322937011719, 2.960737466812134, 0.2848127484321594],\r\n\t\t\t[-41.01322937011719, 2.960737466812134, 0.2848127484321594],\r\n\t\t\t[-41.40867614746094, 3.6386470794677734, 2.6992790699005127],\r\n\t\t\t[-41.281394958496094, 3.8735568523406982, 2.6495003700256348],\r\n\t\t\t[-41.01322937011719, 2.960737466812134, 0.2848127484321594],\r\n\t\t\t[-41.281394958496094, 3.8735568523406982, 2.6495003700256348],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-41.281394958496094, 3.8735568523406982, 2.6495003700256348],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-40.90345001220703, 3.194594144821167, 0.31468039751052856],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-40.7587776184082, 3.398878812789917, 0.3526104688644409],\r\n\t\t\t[-40.7587776184082, 3.398878812789917, 0.3526104688644409],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-40.58185958862305, 3.5702271461486816, 0.39684468507766724],\r\n\t\t\t[-40.58185958862305, 3.5702271461486816, 0.39684468507766724],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-40.89514923095703, 4.24835729598999, 2.598949670791626],\r\n\t\t\t[-40.58185958862305, 3.5702271461486816, 0.39684468507766724],\r\n\t\t\t[-40.89514923095703, 4.24835729598999, 2.598949670791626],\r\n\t\t\t[-40.3699836730957, 3.708836793899536, 0.4470369219779968],\r\n\t\t\t[-40.3699836730957, 3.708836793899536, 0.4470369219779968],\r\n\t\t\t[-40.89514923095703, 4.24835729598999, 2.598949670791626],\r\n\t\t\t[-40.6530647277832, 4.3718671798706055, 2.600386619567871],\r\n\t\t\t[-40.3699836730957, 3.708836793899536, 0.4470369219779968],\r\n\t\t\t[-40.6530647277832, 4.3718671798706055, 2.600386619567871],\r\n\t\t\t[-40.13410186767578, 3.8011467456817627, 0.49953368306159973],\r\n\t\t\t[-40.13410186767578, 3.8011467456817627, 0.49953368306159973],\r\n\t\t\t[-40.6530647277832, 4.3718671798706055, 2.600386619567871],\r\n\t\t\t[-40.39201736450195, 4.444929599761963, 2.619811534881592],\r\n\t\t\t[-41.33094024658203, 5.6504807472229, 6.900985240936279],\r\n\t\t\t[-41.06989288330078, 5.723543643951416, 6.92041015625],\r\n\t\t\t[-40.39201736450195, 4.444929599761963, 2.619811534881592],\r\n\t\t\t[-41.573020935058594, 5.526970863342285, 6.899548053741455],\r\n\t\t\t[-41.33094024658203, 5.6504807472229, 6.900985240936279],\r\n\t\t\t[-40.6530647277832, 4.3718671798706055, 2.600386619567871],\r\n\t\t\t[-40.6530647277832, 4.3718671798706055, 2.600386619567871],\r\n\t\t\t[-41.33094024658203, 5.6504807472229, 6.900985240936279],\r\n\t\t\t[-40.39201736450195, 4.444929599761963, 2.619811534881592],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-41.573020935058594, 5.526970863342285, 6.899548053741455],\r\n\t\t\t[-40.89514923095703, 4.24835729598999, 2.598949670791626],\r\n\t\t\t[-40.89514923095703, 4.24835729598999, 2.598949670791626],\r\n\t\t\t[-41.573020935058594, 5.526970863342285, 6.899548053741455],\r\n\t\t\t[-40.6530647277832, 4.3718671798706055, 2.600386619567871],\r\n\t\t\t[-41.959266662597656, 5.152170658111572, 6.950098991394043],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-41.785560607910156, 5.35841178894043, 6.91616153717041],\r\n\t\t\t[-40.89514923095703, 4.24835729598999, 2.598949670791626],\r\n\t\t\t[-42.0865478515625, 4.917260646820068, 6.999877452850342],\r\n\t\t\t[-41.959266662597656, 5.152170658111572, 6.950098991394043],\r\n\t\t\t[-41.281394958496094, 3.8735568523406982, 2.6495003700256348],\r\n\t\t\t[-41.281394958496094, 3.8735568523406982, 2.6495003700256348],\r\n\t\t\t[-41.959266662597656, 5.152170658111572, 6.950098991394043],\r\n\t\t\t[-41.107688903808594, 4.079798221588135, 2.615562915802002],\r\n\t\t\t[-42.161842346191406, 4.663949012756348, 7.063321590423584],\r\n\t\t\t[-42.0865478515625, 4.917260646820068, 6.999877452850342],\r\n\t\t\t[-41.40867614746094, 3.6386470794677734, 2.6992790699005127],\r\n\t\t\t[-41.40867614746094, 3.6386470794677734, 2.6992790699005127],\r\n\t\t\t[-42.0865478515625, 4.917260646820068, 6.999877452850342],\r\n\t\t\t[-41.281394958496094, 3.8735568523406982, 2.6495003700256348],\r\n\t\t\t[-41.483970642089844, 3.3853354454040527, 2.762723207473755],\r\n\t\t\t[-42.161842346191406, 4.663949012756348, 7.063321590423584],\r\n\t\t\t[-41.40867614746094, 3.6386470794677734, 2.6992790699005127],\r\n\t\t\t[-41.10144805908203, -9.504133224487305, 0.26006585359573364],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-41.10144805908203, 2.459611177444458, 0.26006585359573364],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, 5.712170124053955, 11.199999809265137],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-36.44999694824219, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-36.478763580322266, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-36.44999694824219, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-36.44999694824219, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-36.36428451538086, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-36.36428451538086, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-36.22336959838867, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-36.22336959838867, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-36.030120849609375, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-36.030120849609375, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-35.788475036621094, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-35.788475036621094, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-35.50334930419922, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-35.50334930419922, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-35.180545806884766, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-35.180545806884766, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-34.82664108276367, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-34.82664108276367, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-34.44883346557617, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-34.44883346557617, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-34.0548210144043, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-34.0548210144043, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, 0.7121353149414062, 1.7000000476837158],\r\n\t\t\t[-33.25041580200195, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-33.25041580200195, 0.6833692789077759, 1.7000000476837158],\r\n\t\t\t[-32.85639953613281, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-32.85639953613281, 0.5976566076278687, 1.7000000476837158],\r\n\t\t\t[-32.47859573364258, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-32.47859573364258, 0.45674222707748413, 1.7000000476837158],\r\n\t\t\t[-32.12468719482422, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-32.12468719482422, 0.2634947597980499, 1.7000000476837158],\r\n\t\t\t[-31.8018856048584, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-31.8018856048584, 0.0218481607735157, 1.7000000476837158],\r\n\t\t\t[-31.516759872436523, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-31.516759872436523, -0.26327836513519287, 1.7000000476837158],\r\n\t\t\t[-31.27511215209961, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-31.27511215209961, -0.5860804319381714, 1.7000000476837158],\r\n\t\t\t[-31.081865310668945, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-31.081865310668945, -0.9399867653846741, 1.7000000476837158],\r\n\t\t\t[-30.940950393676758, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-30.940950393676758, -1.3177927732467651, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -1.7118074893951416, 1.7000000476837158],\r\n\t\t\t[-30.826473236083984, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-30.826473236083984, -2.1140098571777344, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-30.85523796081543, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-30.940950393676758, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-30.940950393676758, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-31.081865310668945, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-31.081865310668945, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-31.27511215209961, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-31.27511215209961, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-31.516759872436523, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-31.516759872436523, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-31.8018856048584, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-31.8018856048584, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-32.12468719482422, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-32.12468719482422, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-32.47859573364258, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-32.47859573364258, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-32.85639953613281, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-32.85639953613281, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-33.25041580200195, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-33.25041580200195, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-33.652618408203125, -4.940155029296875, 1.7000000476837158],\r\n\t\t\t[-34.0548210144043, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-34.0548210144043, -4.911388874053955, 1.7000000476837158],\r\n\t\t\t[-34.44883346557617, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-34.44883346557617, -4.825676441192627, 1.7000000476837158],\r\n\t\t\t[-34.82664108276367, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-34.82664108276367, -4.684762001037598, 1.7000000476837158],\r\n\t\t\t[-35.180545806884766, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-35.180545806884766, -4.491514682769775, 1.7000000476837158],\r\n\t\t\t[-35.50334930419922, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-35.50334930419922, -4.249867916107178, 1.7000000476837158],\r\n\t\t\t[-35.788475036621094, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-35.788475036621094, -3.9647414684295654, 1.7000000476837158],\r\n\t\t\t[-36.030120849609375, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-36.030120849609375, -3.641939401626587, 1.7000000476837158],\r\n\t\t\t[-36.22336959838867, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-36.22336959838867, -3.2880330085754395, 1.7000000476837158],\r\n\t\t\t[-36.36428451538086, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-36.36428451538086, -2.910227060317993, 1.7000000476837158],\r\n\t\t\t[-36.44999694824219, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-36.44999694824219, -2.516212224960327, 1.7000000476837158],\r\n\t\t\t[-39.70866012573242, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-28.008380889892578, 2.514561653137207, 1.7000000476837158],\r\n\t\t\t[-28.008380889892578, -9.2221097946167, 1.7000000476837158],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145],\r\n\t\t\t[-26.842252731323242, -10.865645408630371, 5.76376485824585],\r\n\t\t\t[-26.842252731323242, -10.865645408630371, 5.76376485824585],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145],\r\n\t\t\t[-27.619003295898438, -10.782312393188477, 0.6419953107833862],\r\n\t\t\t[-26.842252731323242, -10.865645408630371, 5.76376485824585],\r\n\t\t\t[-27.619003295898438, -10.782312393188477, 0.6419953107833862],\r\n\t\t\t[-26.58300018310547, -10.795008659362793, 5.723021507263184],\r\n\t\t\t[-26.58300018310547, -10.795008659362793, 5.723021507263184],\r\n\t\t\t[-27.619003295898438, -10.782312393188477, 0.6419953107833862],\r\n\t\t\t[-27.375879287719727, -10.707438468933105, 0.5973300337791443],\r\n\t\t\t[-26.58300018310547, -10.795008659362793, 5.723021507263184],\r\n\t\t\t[-27.375879287719727, -10.707438468933105, 0.5973300337791443],\r\n\t\t\t[-26.34379005432129, -10.671358108520508, 5.686278820037842],\r\n\t\t\t[-26.34379005432129, -10.671358108520508, 5.686278820037842],\r\n\t\t\t[-27.375879287719727, -10.707438468933105, 0.5973300337791443],\r\n\t\t\t[-27.15293312072754, -10.584622383117676, 0.553747296333313],\r\n\t\t\t[-26.34379005432129, -10.671358108520508, 5.686278820037842],\r\n\t\t\t[-27.15293312072754, -10.584622383117676, 0.553747296333313],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-27.15293312072754, -10.584622383117676, 0.553747296333313],\r\n\t\t\t[-26.96327781677246, -10.425240516662598, 0.5146366953849792],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-26.96327781677246, -10.425240516662598, 0.5146366953849792],\r\n\t\t\t[-26.807796478271484, -10.2311429977417, 0.481032133102417],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-26.807796478271484, -10.2311429977417, 0.481032133102417],\r\n\t\t\t[-25.965978622436523, -10.288714408874512, 5.630972862243652],\r\n\t\t\t[-25.965978622436523, -10.288714408874512, 5.630972862243652],\r\n\t\t\t[-26.807796478271484, -10.2311429977417, 0.481032133102417],\r\n\t\t\t[-26.688413619995117, -10.003666877746582, 0.45427384972572327],\r\n\t\t\t[-25.965978622436523, -10.288714408874512, 5.630972862243652],\r\n\t\t\t[-26.688413619995117, -10.003666877746582, 0.45427384972572327],\r\n\t\t\t[-25.843889236450195, -10.0464448928833, 5.6148271560668945],\r\n\t\t\t[-25.843889236450195, -10.0464448928833, 5.6148271560668945],\r\n\t\t\t[-26.688413619995117, -10.003666877746582, 0.45427384972572327],\r\n\t\t\t[-26.616003036499023, -9.756340026855469, 0.43762320280075073],\r\n\t\t\t[-25.843889236450195, -10.0464448928833, 5.6148271560668945],\r\n\t\t\t[-26.616003036499023, -9.756340026855469, 0.43762320280075073],\r\n\t\t\t[-25.774145126342773, -9.783876419067383, 5.607410430908203],\r\n\t\t\t[-25.774145126342773, -9.783876419067383, 5.607410430908203],\r\n\t\t\t[-26.616003036499023, -9.756340026855469, 0.43762320280075073],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-25.774145126342773, -9.783876419067383, 5.607410430908203],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-24.88230323791504, -9.916616439819336, 11.199999809265137],\r\n\t\t\t[-25.774145126342773, -9.783876419067383, 5.607410430908203],\r\n\t\t\t[-25.774145126342773, -9.783876419067383, 5.607410430908203],\r\n\t\t\t[-24.88230323791504, -9.916616439819336, 11.199999809265137],\r\n\t\t\t[-25.843889236450195, -10.0464448928833, 5.6148271560668945],\r\n\t\t\t[-24.88230323791504, -9.916616439819336, 11.199999809265137],\r\n\t\t\t[-24.95701789855957, -10.160016059875488, 11.199999809265137],\r\n\t\t\t[-25.843889236450195, -10.0464448928833, 5.6148271560668945],\r\n\t\t\t[-25.843889236450195, -10.0464448928833, 5.6148271560668945],\r\n\t\t\t[-24.95701789855957, -10.160016059875488, 11.199999809265137],\r\n\t\t\t[-25.965978622436523, -10.288714408874512, 5.630972862243652],\r\n\t\t\t[-24.95701789855957, -10.160016059875488, 11.199999809265137],\r\n\t\t\t[-25.07835578918457, -10.384271621704102, 11.199999809265137],\r\n\t\t\t[-25.965978622436523, -10.288714408874512, 5.630972862243652],\r\n\t\t\t[-25.965978622436523, -10.288714408874512, 5.630972862243652],\r\n\t\t\t[-25.07835578918457, -10.384271621704102, 11.199999809265137],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-25.07835578918457, -10.384271621704102, 11.199999809265137],\r\n\t\t\t[-25.241670608520508, -10.580789566040039, 11.199999809265137],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-25.241670608520508, -10.580789566040039, 11.199999809265137],\r\n\t\t\t[-25.440702438354492, -10.74204158782959, 11.199999809265137],\r\n\t\t\t[-26.13504981994629, -10.500072479248047, 5.65513801574707],\r\n\t\t\t[-25.440702438354492, -10.74204158782959, 11.199999809265137],\r\n\t\t\t[-26.34379005432129, -10.671358108520508, 5.686278820037842],\r\n\t\t\t[-26.34379005432129, -10.671358108520508, 5.686278820037842],\r\n\t\t\t[-25.440702438354492, -10.74204158782959, 11.199999809265137],\r\n\t\t\t[-25.66782569885254, -10.861848831176758, 11.199999809265137],\r\n\t\t\t[-26.34379005432129, -10.671358108520508, 5.686278820037842],\r\n\t\t\t[-25.66782569885254, -10.861848831176758, 11.199999809265137],\r\n\t\t\t[-26.58300018310547, -10.795008659362793, 5.723021507263184],\r\n\t\t\t[-26.58300018310547, -10.795008659362793, 5.723021507263184],\r\n\t\t\t[-25.66782569885254, -10.861848831176758, 11.199999809265137],\r\n\t\t\t[-25.914339065551758, -10.935619354248047, 11.199999809265137],\r\n\t\t\t[-26.58300018310547, -10.795008659362793, 5.723021507263184],\r\n\t\t\t[-25.914339065551758, -10.935619354248047, 11.199999809265137],\r\n\t\t\t[-26.842252731323242, -10.865645408630371, 5.76376485824585],\r\n\t\t\t[-26.842252731323242, -10.865645408630371, 5.76376485824585],\r\n\t\t\t[-25.914339065551758, -10.935619354248047, 11.199999809265137],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.5920467376709, -9.506699562072754, 0.4320164620876312],\r\n\t\t\t[-26.5920467376709, 2.5120368003845215, 0.4320164620876312],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-26.5920467376709, 2.5120368003845215, 0.4320164620876312],\r\n\t\t\t[-24.857074737548828, 5.713472843170166, 11.199999809265137],\r\n\t\t\t[-41.07758712768555, -9.75425910949707, 0.266848087310791],\r\n\t\t\t[-41.52873229980469, -9.746952056884766, 3.072197437286377],\r\n\t\t\t[-41.10144805908203, -9.504133224487305, 0.26006585359573364],\r\n\t\t\t[-41.10144805908203, -9.504133224487305, 0.26006585359573364],\r\n\t\t\t[-41.52873229980469, -9.746952056884766, 3.072197437286377],\r\n\t\t\t[-42.16926574707031, -9.8060884475708, 7.13589334487915],\r\n\t\t\t[-41.10144805908203, -9.504133224487305, 0.26006585359573364],\r\n\t\t\t[-42.16926574707031, -9.8060884475708, 7.13589334487915],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-42.16926574707031, -9.8060884475708, 7.13589334487915],\r\n\t\t\t[-42.800621032714844, -9.9165620803833, 11.199999809265137],\r\n\t\t\t[-42.800621032714844, -9.9165620803833, 11.199999809265137],\r\n\t\t\t[-42.16926574707031, -9.8060884475708, 7.13589334487915],\r\n\t\t\t[-42.099491119384766, -10.06865406036377, 7.143070697784424],\r\n\t\t\t[-42.800621032714844, -9.9165620803833, 11.199999809265137],\r\n\t\t\t[-42.099491119384766, -10.06865406036377, 7.143070697784424],\r\n\t\t\t[-42.7259407043457, -10.159972190856934, 11.199999809265137],\r\n\t\t\t[-42.7259407043457, -10.159972190856934, 11.199999809265137],\r\n\t\t\t[-42.099491119384766, -10.06865406036377, 7.143070697784424],\r\n\t\t\t[-41.97734069824219, -10.310921669006348, 7.158798694610596],\r\n\t\t\t[-42.7259407043457, -10.159972190856934, 11.199999809265137],\r\n\t\t\t[-41.97734069824219, -10.310921669006348, 7.158798694610596],\r\n\t\t\t[-42.60466003417969, -10.384238243103027, 11.199999809265137],\r\n\t\t\t[-42.60466003417969, -10.384238243103027, 11.199999809265137],\r\n\t\t\t[-41.97734069824219, -10.310921669006348, 7.158798694610596],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-42.60466003417969, -10.384238243103027, 11.199999809265137],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-42.44142532348633, -10.580767631530762, 11.199999809265137],\r\n\t\t\t[-42.44142532348633, -10.580767631530762, 11.199999809265137],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-42.24249267578125, -10.74202823638916, 11.199999809265137],\r\n\t\t\t[-42.24249267578125, -10.74202823638916, 11.199999809265137],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-41.599334716796875, -10.69355583190918, 7.212813377380371],\r\n\t\t\t[-42.24249267578125, -10.74202823638916, 11.199999809265137],\r\n\t\t\t[-41.599334716796875, -10.69355583190918, 7.212813377380371],\r\n\t\t\t[-42.015480041503906, -10.861842155456543, 11.199999809265137],\r\n\t\t\t[-42.015480041503906, -10.861842155456543, 11.199999809265137],\r\n\t\t\t[-41.599334716796875, -10.69355583190918, 7.212813377380371],\r\n\t\t\t[-41.3599967956543, -10.81719970703125, 7.248739242553711],\r\n\t\t\t[-42.015480041503906, -10.861842155456543, 11.199999809265137],\r\n\t\t\t[-41.3599967956543, -10.81719970703125, 7.248739242553711],\r\n\t\t\t[-41.76909255981445, -10.93561840057373, 11.199999809265137],\r\n\t\t\t[-41.76909255981445, -10.93561840057373, 11.199999809265137],\r\n\t\t\t[-41.3599967956543, -10.81719970703125, 7.248739242553711],\r\n\t\t\t[-41.10060501098633, -10.887829780578613, 7.288597583770752],\r\n\t\t\t[-41.76909255981445, -10.93561840057373, 11.199999809265137],\r\n\t\t\t[-41.10060501098633, -10.887829780578613, 7.288597583770752],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-41.10060501098633, -10.887829780578613, 7.288597583770752],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-41.10060501098633, -10.887829780578613, 7.288597583770752],\r\n\t\t\t[-40.4600715637207, -10.828693389892578, 3.2249014377593994],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-40.4600715637207, -10.828693389892578, 3.2249014377593994],\r\n\t\t\t[-40.080570220947266, -10.780425071716309, 0.5109779238700867],\r\n\t\t\t[-40.080570220947266, -10.780425071716309, 0.5109779238700867],\r\n\t\t\t[-40.4600715637207, -10.828693389892578, 3.2249014377593994],\r\n\t\t\t[-40.71946334838867, -10.758063316345215, 3.1850433349609375],\r\n\t\t\t[-40.080570220947266, -10.780425071716309, 0.5109779238700867],\r\n\t\t\t[-40.71946334838867, -10.758063316345215, 3.1850433349609375],\r\n\t\t\t[-40.322052001953125, -10.705615043640137, 0.45798635482788086],\r\n\t\t\t[-40.322052001953125, -10.705615043640137, 0.45798635482788086],\r\n\t\t\t[-40.71946334838867, -10.758063316345215, 3.1850433349609375],\r\n\t\t\t[-40.95880126953125, -10.634418487548828, 3.1491174697875977],\r\n\t\t\t[-40.322052001953125, -10.705615043640137, 0.45798635482788086],\r\n\t\t\t[-40.95880126953125, -10.634418487548828, 3.1491174697875977],\r\n\t\t\t[-40.54357147216797, -10.582905769348145, 0.4061286151409149],\r\n\t\t\t[-40.54357147216797, -10.582905769348145, 0.4061286151409149],\r\n\t\t\t[-40.95880126953125, -10.634418487548828, 3.1491174697875977],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-40.54357147216797, -10.582905769348145, 0.4061286151409149],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-40.732460021972656, -10.423222541809082, 0.3593369126319885],\r\n\t\t\t[-40.732460021972656, -10.423222541809082, 0.3593369126319885],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-40.886634826660156, -10.229643821716309, 0.3191690742969513],\r\n\t\t\t[-40.886634826660156, -10.229643821716309, 0.3191690742969513],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-41.33680725097656, -10.251784324645996, 3.0951030254364014],\r\n\t\t\t[-40.886634826660156, -10.229643821716309, 0.3191690742969513],\r\n\t\t\t[-41.33680725097656, -10.251784324645996, 3.0951030254364014],\r\n\t\t\t[-41.00541305541992, -10.002063751220703, 0.28697243332862854],\r\n\t\t\t[-41.00541305541992, -10.002063751220703, 0.28697243332862854],\r\n\t\t\t[-41.33680725097656, -10.251784324645996, 3.0951030254364014],\r\n\t\t\t[-41.45895767211914, -10.009517669677734, 3.0793750286102295],\r\n\t\t\t[-41.00541305541992, -10.002063751220703, 0.28697243332862854],\r\n\t\t\t[-41.45895767211914, -10.009517669677734, 3.0793750286102295],\r\n\t\t\t[-41.07758712768555, -9.75425910949707, 0.266848087310791],\r\n\t\t\t[-41.07758712768555, -9.75425910949707, 0.266848087310791],\r\n\t\t\t[-41.45895767211914, -10.009517669677734, 3.0793750286102295],\r\n\t\t\t[-41.52873229980469, -9.746952056884766, 3.072197437286377],\r\n\t\t\t[-42.099491119384766, -10.06865406036377, 7.143070697784424],\r\n\t\t\t[-42.16926574707031, -9.8060884475708, 7.13589334487915],\r\n\t\t\t[-41.52873229980469, -9.746952056884766, 3.072197437286377],\r\n\t\t\t[-41.97734069824219, -10.310921669006348, 7.158798694610596],\r\n\t\t\t[-42.099491119384766, -10.06865406036377, 7.143070697784424],\r\n\t\t\t[-41.45895767211914, -10.009517669677734, 3.0793750286102295],\r\n\t\t\t[-41.45895767211914, -10.009517669677734, 3.0793750286102295],\r\n\t\t\t[-42.099491119384766, -10.06865406036377, 7.143070697784424],\r\n\t\t\t[-41.52873229980469, -9.746952056884766, 3.072197437286377],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-41.97734069824219, -10.310921669006348, 7.158798694610596],\r\n\t\t\t[-41.33680725097656, -10.251784324645996, 3.0951030254364014],\r\n\t\t\t[-41.33680725097656, -10.251784324645996, 3.0951030254364014],\r\n\t\t\t[-41.97734069824219, -10.310921669006348, 7.158798694610596],\r\n\t\t\t[-41.45895767211914, -10.009517669677734, 3.0793750286102295],\r\n\t\t\t[-41.599334716796875, -10.69355583190918, 7.212813377380371],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-41.80807876586914, -10.522381782531738, 7.182401657104492],\r\n\t\t\t[-41.33680725097656, -10.251784324645996, 3.0951030254364014],\r\n\t\t\t[-41.3599967956543, -10.81719970703125, 7.248739242553711],\r\n\t\t\t[-41.599334716796875, -10.69355583190918, 7.212813377380371],\r\n\t\t\t[-40.95880126953125, -10.634418487548828, 3.1491174697875977],\r\n\t\t\t[-40.95880126953125, -10.634418487548828, 3.1491174697875977],\r\n\t\t\t[-41.599334716796875, -10.69355583190918, 7.212813377380371],\r\n\t\t\t[-41.16746520996094, -10.463326454162598, 3.1187169551849365],\r\n\t\t\t[-41.10060501098633, -10.887829780578613, 7.288597583770752],\r\n\t\t\t[-41.3599967956543, -10.81719970703125, 7.248739242553711],\r\n\t\t\t[-40.71946334838867, -10.758063316345215, 3.1850433349609375],\r\n\t\t\t[-40.71946334838867, -10.758063316345215, 3.1850433349609375],\r\n\t\t\t[-41.3599967956543, -10.81719970703125, 7.248739242553711],\r\n\t\t\t[-40.95880126953125, -10.634418487548828, 3.1491174697875977],\r\n\t\t\t[-40.4600715637207, -10.828693389892578, 3.2249014377593994],\r\n\t\t\t[-41.10060501098633, -10.887829780578613, 7.288597583770752],\r\n\t\t\t[-40.71946334838867, -10.758063316345215, 3.1850433349609375],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.81645584106445, 6.983618259429932, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.81645584106445, 6.983618259429932, 11.199999809265137],\r\n\t\t\t[-42.05360412597656, 6.910674571990967, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, 5.713472843170166, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, 5.713472843170166, 11.199999809265137],\r\n\t\t\t[-24.88094139099121, 5.969139099121094, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-25.914339065551758, -10.935619354248047, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-42.800621032714844, -9.9165620803833, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-42.800621032714844, -9.9165620803833, 11.199999809265137],\r\n\t\t\t[-42.7259407043457, -10.159972190856934, 11.199999809265137],\r\n\t\t\t[-25.914339065551758, -10.935619354248047, 11.199999809265137],\r\n\t\t\t[-25.66782569885254, -10.861848831176758, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-25.66782569885254, -10.861848831176758, 11.199999809265137],\r\n\t\t\t[-25.440702438354492, -10.74204158782959, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-25.440702438354492, -10.74204158782959, 11.199999809265137],\r\n\t\t\t[-25.241670608520508, -10.580789566040039, 11.199999809265137],\r\n\t\t\t[-25.241670608520508, -10.580789566040039, 11.199999809265137],\r\n\t\t\t[-25.07835578918457, -10.384271621704102, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-25.07835578918457, -10.384271621704102, 11.199999809265137],\r\n\t\t\t[-24.95701789855957, -10.160016059875488, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-24.95701789855957, -10.160016059875488, 11.199999809265137],\r\n\t\t\t[-24.88230323791504, -9.916616439819336, 11.199999809265137],\r\n\t\t\t[-24.88230323791504, -9.916616439819336, 11.199999809265137],\r\n\t\t\t[-24.857074737548828, -9.663399696350098, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-24.88094139099121, 5.969139099121094, 11.199999809265137],\r\n\t\t\t[-24.95167350769043, 6.213308811187744, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-24.95167350769043, 6.213308811187744, 11.199999809265137],\r\n\t\t\t[-25.066709518432617, 6.437131404876709, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-25.066709518432617, 6.437131404876709, 11.199999809265137],\r\n\t\t\t[-25.22187614440918, 6.632493019104004, 11.199999809265137],\r\n\t\t\t[-25.22187614440918, 6.632493019104004, 11.199999809265137],\r\n\t\t\t[-25.41155242919922, 6.7923126220703125, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-25.41155242919922, 6.7923126220703125, 11.199999809265137],\r\n\t\t\t[-25.628860473632812, 6.910796165466309, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-25.628860473632812, 6.910796165466309, 11.199999809265137],\r\n\t\t\t[-25.865924835205078, 6.983649253845215, 11.199999809265137],\r\n\t\t\t[-25.865924835205078, 6.983649253845215, 11.199999809265137],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-26.477710723876953, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-26.11414909362793, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-41.568180084228516, 7.008230209350586, 11.199999809265137],\r\n\t\t\t[-42.05360412597656, 6.910674571990967, 11.199999809265137],\r\n\t\t\t[-42.27101516723633, 6.79204797744751, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-42.27101516723633, 6.79204797744751, 11.199999809265137],\r\n\t\t\t[-42.460792541503906, 6.632042407989502, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-42.460792541503906, 6.632042407989502, 11.199999809265137],\r\n\t\t\t[-42.616058349609375, 6.436466693878174, 11.199999809265137],\r\n\t\t\t[-42.616058349609375, 6.436466693878174, 11.199999809265137],\r\n\t\t\t[-42.731170654296875, 6.212418556213379, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-42.731170654296875, 6.212418556213379, 11.199999809265137],\r\n\t\t\t[-42.80195236206055, 5.968029499053955, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-42.80195236206055, 5.968029499053955, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, 5.712170124053955, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, 5.712170124053955, 11.199999809265137],\r\n\t\t\t[-42.82583236694336, -9.663335800170898, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, 5.339012622833252, 11.199999809265137],\r\n\t\t\t[-42.7259407043457, -10.159972190856934, 11.199999809265137],\r\n\t\t\t[-42.60466003417969, -10.384238243103027, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-42.60466003417969, -10.384238243103027, 11.199999809265137],\r\n\t\t\t[-42.44142532348633, -10.580767631530762, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-42.44142532348633, -10.580767631530762, 11.199999809265137],\r\n\t\t\t[-42.24249267578125, -10.74202823638916, 11.199999809265137],\r\n\t\t\t[-42.24249267578125, -10.74202823638916, 11.199999809265137],\r\n\t\t\t[-42.015480041503906, -10.861842155456543, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-42.015480041503906, -10.861842155456543, 11.199999809265137],\r\n\t\t\t[-41.76909255981445, -10.93561840057373, 11.199999809265137],\r\n\t\t\t[-41.20608139038086, -9.360358238220215, 11.199999809265137],\r\n\t\t\t[-41.76909255981445, -10.93561840057373, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-39.83586883544922, -10.805709838867188, 0.5613717436790466],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-39.194091796875, -10.807422637939453, 0.6790497303009033],\r\n\t\t\t[-38.515708923339844, -10.80894660949707, 0.7837849259376526],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-38.515708923339844, -10.80894660949707, 0.7837849259376526],\r\n\t\t\t[-37.805091857910156, -10.810272216796875, 0.8749025464057922],\r\n\t\t\t[-37.805091857910156, -10.810272216796875, 0.8749025464057922],\r\n\t\t\t[-37.06682586669922, -10.811391830444336, 0.9518154263496399],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-37.06682586669922, -10.811391830444336, 0.9518154263496399],\r\n\t\t\t[-36.305660247802734, -10.812296867370605, 1.0140280723571777],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-36.305660247802734, -10.812296867370605, 1.0140280723571777],\r\n\t\t\t[-35.52650451660156, -10.812982559204102, 1.061139464378357],\r\n\t\t\t[-35.52650451660156, -10.812982559204102, 1.061139464378357],\r\n\t\t\t[-34.734378814697266, -10.813444137573242, 1.092846155166626],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-34.734378814697266, -10.813444137573242, 1.092846155166626],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-41.51276397705078, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-33.934383392333984, -10.813678741455078, 1.1089439392089844],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-33.131675720214844, -10.81368350982666, 1.1093288660049438],\r\n\t\t\t[-32.33142852783203, -10.813461303710938, 1.0939985513687134],\r\n\t\t\t[-32.33142852783203, -10.813461303710938, 1.0939985513687134],\r\n\t\t\t[-31.53879737854004, -10.813010215759277, 1.0630519390106201],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-31.53879737854004, -10.813010215759277, 1.0630519390106201],\r\n\t\t\t[-30.758888244628906, -10.812335968017578, 1.0166881084442139],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-30.758888244628906, -10.812335968017578, 1.0166881084442139],\r\n\t\t\t[-29.996728897094727, -10.811441421508789, 0.9552060961723328],\r\n\t\t\t[-29.996728897094727, -10.811441421508789, 0.9552060961723328],\r\n\t\t\t[-29.25722885131836, -10.810332298278809, 0.8790019154548645],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-29.25722885131836, -10.810332298278809, 0.8790019154548645],\r\n\t\t\t[-28.545150756835938, -10.809016227722168, 0.7885666489601135],\r\n\t\t\t[-26.170793533325195, -10.960528373718262, 11.199999809265137],\r\n\t\t\t[-28.545150756835938, -10.809016227722168, 0.7885666489601135],\r\n\t\t\t[-27.865087509155273, -10.807501792907715, 0.6844828724861145]\r\n\t\t],\r\n\t\tfaces=[\r\n\t\t\t[0, 1, 2],\r\n\t\t\t[3, 4, 5],\r\n\t\t\t[6, 7, 8],\r\n\t\t\t[9, 10, 11],\r\n\t\t\t[12, 13, 14],\r\n\t\t\t[15, 16, 17],\r\n\t\t\t[18, 19, 20],\r\n\t\t\t[21, 22, 23],\r\n\t\t\t[24, 25, 26],\r\n\t\t\t[27, 28, 29],\r\n\t\t\t[30, 31, 32],\r\n\t\t\t[33, 34, 35],\r\n\t\t\t[36, 37, 38],\r\n\t\t\t[39, 40, 41],\r\n\t\t\t[42, 43, 44],\r\n\t\t\t[45, 46, 47],\r\n\t\t\t[48, 49, 50],\r\n\t\t\t[51, 52, 53],\r\n\t\t\t[54, 55, 56],\r\n\t\t\t[57, 58, 59],\r\n\t\t\t[60, 61, 62],\r\n\t\t\t[63, 64, 65],\r\n\t\t\t[66, 67, 68],\r\n\t\t\t[69, 70, 71],\r\n\t\t\t[72, 73, 74],\r\n\t\t\t[75, 76, 77],\r\n\t\t\t[78, 79, 80],\r\n\t\t\t[81, 82, 83],\r\n\t\t\t[84, 85, 86],\r\n\t\t\t[87, 88, 89],\r\n\t\t\t[90, 91, 92],\r\n\t\t\t[93, 94, 95],\r\n\t\t\t[96, 97, 98],\r\n\t\t\t[99, 100, 101],\r\n\t\t\t[102, 103, 104],\r\n\t\t\t[105, 106, 107],\r\n\t\t\t[108, 109, 110],\r\n\t\t\t[111, 112, 113],\r\n\t\t\t[114, 115, 116],\r\n\t\t\t[117, 118, 119],\r\n\t\t\t[120, 121, 122],\r\n\t\t\t[123, 124, 125],\r\n\t\t\t[126, 127, 128],\r\n\t\t\t[129, 130, 131],\r\n\t\t\t[132, 133, 134],\r\n\t\t\t[135, 136, 137],\r\n\t\t\t[138, 139, 140],\r\n\t\t\t[141, 142, 143],\r\n\t\t\t[144, 145, 146],\r\n\t\t\t[147, 148, 149],\r\n\t\t\t[150, 151, 152],\r\n\t\t\t[153, 154, 155],\r\n\t\t\t[156, 157, 158],\r\n\t\t\t[159, 160, 161],\r\n\t\t\t[162, 163, 164],\r\n\t\t\t[165, 166, 167],\r\n\t\t\t[168, 169, 170],\r\n\t\t\t[171, 172, 173],\r\n\t\t\t[174, 175, 176],\r\n\t\t\t[177, 178, 179],\r\n\t\t\t[180, 181, 182],\r\n\t\t\t[183, 184, 185],\r\n\t\t\t[186, 187, 188],\r\n\t\t\t[189, 190, 191],\r\n\t\t\t[192, 193, 194],\r\n\t\t\t[195, 196, 197],\r\n\t\t\t[198, 199, 200],\r\n\t\t\t[201, 202, 203],\r\n\t\t\t[204, 205, 206],\r\n\t\t\t[207, 208, 209],\r\n\t\t\t[210, 211, 212],\r\n\t\t\t[213, 214, 215],\r\n\t\t\t[216, 217, 218],\r\n\t\t\t[219, 220, 221],\r\n\t\t\t[222, 223, 224],\r\n\t\t\t[225, 226, 227],\r\n\t\t\t[228, 229, 230],\r\n\t\t\t[231, 232, 233],\r\n\t\t\t[234, 235, 236],\r\n\t\t\t[237, 238, 239],\r\n\t\t\t[240, 241, 242],\r\n\t\t\t[243, 244, 245],\r\n\t\t\t[246, 247, 248],\r\n\t\t\t[249, 250, 251],\r\n\t\t\t[252, 253, 254],\r\n\t\t\t[255, 256, 257],\r\n\t\t\t[258, 259, 260],\r\n\t\t\t[261, 262, 263],\r\n\t\t\t[264, 265, 266],\r\n\t\t\t[267, 268, 269],\r\n\t\t\t[270, 271, 272],\r\n\t\t\t[273, 274, 275],\r\n\t\t\t[276, 277, 278],\r\n\t\t\t[279, 280, 281],\r\n\t\t\t[282, 283, 284],\r\n\t\t\t[285, 286, 287],\r\n\t\t\t[288, 289, 290],\r\n\t\t\t[291, 292, 293],\r\n\t\t\t[294, 295, 296],\r\n\t\t\t[297, 298, 299],\r\n\t\t\t[300, 301, 302],\r\n\t\t\t[303, 304, 305],\r\n\t\t\t[306, 307, 308],\r\n\t\t\t[309, 310, 311],\r\n\t\t\t[312, 313, 314],\r\n\t\t\t[315, 316, 317],\r\n\t\t\t[318, 319, 320],\r\n\t\t\t[321, 322, 323],\r\n\t\t\t[324, 325, 326],\r\n\t\t\t[327, 328, 329],\r\n\t\t\t[330, 331, 332],\r\n\t\t\t[333, 334, 335],\r\n\t\t\t[336, 337, 338],\r\n\t\t\t[339, 340, 341],\r\n\t\t\t[342, 343, 344],\r\n\t\t\t[345, 346, 347],\r\n\t\t\t[348, 349, 350],\r\n\t\t\t[351, 352, 353],\r\n\t\t\t[354, 355, 356],\r\n\t\t\t[357, 358, 359],\r\n\t\t\t[360, 361, 362],\r\n\t\t\t[363, 364, 365],\r\n\t\t\t[366, 367, 368],\r\n\t\t\t[369, 370, 371],\r\n\t\t\t[372, 373, 374],\r\n\t\t\t[375, 376, 377],\r\n\t\t\t[378, 379, 380],\r\n\t\t\t[381, 382, 383],\r\n\t\t\t[384, 385, 386],\r\n\t\t\t[387, 388, 389],\r\n\t\t\t[390, 391, 392],\r\n\t\t\t[393, 394, 395],\r\n\t\t\t[396, 397, 398],\r\n\t\t\t[399, 400, 401],\r\n\t\t\t[402, 403, 404],\r\n\t\t\t[405, 406, 407],\r\n\t\t\t[408, 409, 410],\r\n\t\t\t[411, 412, 413],\r\n\t\t\t[414, 415, 416],\r\n\t\t\t[417, 418, 419],\r\n\t\t\t[420, 421, 422],\r\n\t\t\t[423, 424, 425],\r\n\t\t\t[426, 427, 428],\r\n\t\t\t[429, 430, 431],\r\n\t\t\t[432, 433, 434],\r\n\t\t\t[435, 436, 437],\r\n\t\t\t[438, 439, 440],\r\n\t\t\t[441, 442, 443],\r\n\t\t\t[444, 445, 446],\r\n\t\t\t[447, 448, 449],\r\n\t\t\t[450, 451, 452],\r\n\t\t\t[453, 454, 455],\r\n\t\t\t[456, 457, 458],\r\n\t\t\t[459, 460, 461],\r\n\t\t\t[462, 463, 464],\r\n\t\t\t[465, 466, 467],\r\n\t\t\t[468, 469, 470],\r\n\t\t\t[471, 472, 473],\r\n\t\t\t[474, 475, 476],\r\n\t\t\t[477, 478, 479],\r\n\t\t\t[480, 481, 482],\r\n\t\t\t[483, 484, 485],\r\n\t\t\t[486, 487, 488],\r\n\t\t\t[489, 490, 491],\r\n\t\t\t[492, 493, 494],\r\n\t\t\t[495, 496, 497],\r\n\t\t\t[498, 499, 500],\r\n\t\t\t[501, 502, 503],\r\n\t\t\t[504, 505, 506],\r\n\t\t\t[507, 508, 509],\r\n\t\t\t[510, 511, 512],\r\n\t\t\t[513, 514, 515],\r\n\t\t\t[516, 517, 518],\r\n\t\t\t[519, 520, 521],\r\n\t\t\t[522, 523, 524],\r\n\t\t\t[525, 526, 527],\r\n\t\t\t[528, 529, 530],\r\n\t\t\t[531, 532, 533],\r\n\t\t\t[534, 535, 536],\r\n\t\t\t[537, 538, 539],\r\n\t\t\t[540, 541, 542],\r\n\t\t\t[543, 544, 545],\r\n\t\t\t[546, 547, 548],\r\n\t\t\t[549, 550, 551],\r\n\t\t\t[552, 553, 554],\r\n\t\t\t[555, 556, 557],\r\n\t\t\t[558, 559, 560],\r\n\t\t\t[561, 562, 563],\r\n\t\t\t[564, 565, 566],\r\n\t\t\t[567, 568, 569],\r\n\t\t\t[570, 571, 572],\r\n\t\t\t[573, 574, 575],\r\n\t\t\t[576, 577, 578],\r\n\t\t\t[579, 580, 581],\r\n\t\t\t[582, 583, 584],\r\n\t\t\t[585, 586, 587],\r\n\t\t\t[588, 589, 590],\r\n\t\t\t[591, 592, 593],\r\n\t\t\t[594, 595, 596],\r\n\t\t\t[597, 598, 599],\r\n\t\t\t[600, 601, 602],\r\n\t\t\t[603, 604, 605],\r\n\t\t\t[606, 607, 608],\r\n\t\t\t[609, 610, 611],\r\n\t\t\t[612, 613, 614],\r\n\t\t\t[615, 616, 617],\r\n\t\t\t[618, 619, 620],\r\n\t\t\t[621, 622, 623],\r\n\t\t\t[624, 625, 626],\r\n\t\t\t[627, 628, 629],\r\n\t\t\t[630, 631, 632],\r\n\t\t\t[633, 634, 635],\r\n\t\t\t[636, 637, 638],\r\n\t\t\t[639, 640, 641],\r\n\t\t\t[642, 643, 644],\r\n\t\t\t[645, 646, 647],\r\n\t\t\t[648, 649, 650],\r\n\t\t\t[651, 652, 653],\r\n\t\t\t[654, 655, 656],\r\n\t\t\t[657, 658, 659],\r\n\t\t\t[660, 661, 662],\r\n\t\t\t[663, 664, 665],\r\n\t\t\t[666, 667, 668],\r\n\t\t\t[669, 670, 671],\r\n\t\t\t[672, 673, 674],\r\n\t\t\t[675, 676, 677],\r\n\t\t\t[678, 679, 680],\r\n\t\t\t[681, 682, 683],\r\n\t\t\t[684, 685, 686],\r\n\t\t\t[687, 688, 689],\r\n\t\t\t[690, 691, 692],\r\n\t\t\t[693, 694, 695],\r\n\t\t\t[696, 697, 698],\r\n\t\t\t[699, 700, 701],\r\n\t\t\t[702, 703, 704],\r\n\t\t\t[705, 706, 707],\r\n\t\t\t[708, 709, 710],\r\n\t\t\t[711, 712, 713],\r\n\t\t\t[714, 715, 716],\r\n\t\t\t[717, 718, 719],\r\n\t\t\t[720, 721, 722],\r\n\t\t\t[723, 724, 725],\r\n\t\t\t[726, 727, 728],\r\n\t\t\t[729, 730, 731],\r\n\t\t\t[732, 733, 734],\r\n\t\t\t[735, 736, 737],\r\n\t\t\t[738, 739, 740],\r\n\t\t\t[741, 742, 743],\r\n\t\t\t[744, 745, 746],\r\n\t\t\t[747, 748, 749],\r\n\t\t\t[750, 751, 752],\r\n\t\t\t[753, 754, 755],\r\n\t\t\t[756, 757, 758],\r\n\t\t\t[759, 760, 761],\r\n\t\t\t[762, 763, 764],\r\n\t\t\t[765, 766, 767],\r\n\t\t\t[768, 769, 770],\r\n\t\t\t[771, 772, 773],\r\n\t\t\t[774, 775, 776],\r\n\t\t\t[777, 778, 779],\r\n\t\t\t[780, 781, 782],\r\n\t\t\t[783, 784, 785],\r\n\t\t\t[786, 787, 788],\r\n\t\t\t[789, 790, 791],\r\n\t\t\t[792, 793, 794],\r\n\t\t\t[795, 796, 797],\r\n\t\t\t[798, 799, 800],\r\n\t\t\t[801, 802, 803],\r\n\t\t\t[804, 805, 806],\r\n\t\t\t[807, 808, 809],\r\n\t\t\t[810, 811, 812],\r\n\t\t\t[813, 814, 815],\r\n\t\t\t[816, 817, 818],\r\n\t\t\t[819, 820, 821],\r\n\t\t\t[822, 823, 824],\r\n\t\t\t[825, 826, 827],\r\n\t\t\t[828, 829, 830],\r\n\t\t\t[831, 832, 833],\r\n\t\t\t[834, 835, 836],\r\n\t\t\t[837, 838, 839],\r\n\t\t\t[840, 841, 842],\r\n\t\t\t[843, 844, 845],\r\n\t\t\t[846, 847, 848],\r\n\t\t\t[849, 850, 851],\r\n\t\t\t[852, 853, 854],\r\n\t\t\t[855, 856, 857],\r\n\t\t\t[858, 859, 860],\r\n\t\t\t[861, 862, 863],\r\n\t\t\t[864, 865, 866],\r\n\t\t\t[867, 868, 869],\r\n\t\t\t[870, 871, 872],\r\n\t\t\t[873, 874, 875],\r\n\t\t\t[876, 877, 878],\r\n\t\t\t[879, 880, 881],\r\n\t\t\t[882, 883, 884],\r\n\t\t\t[885, 886, 887],\r\n\t\t\t[888, 889, 890],\r\n\t\t\t[891, 892, 893],\r\n\t\t\t[894, 895, 896],\r\n\t\t\t[897, 898, 899],\r\n\t\t\t[900, 901, 902],\r\n\t\t\t[903, 904, 905],\r\n\t\t\t[906, 907, 908],\r\n\t\t\t[909, 910, 911],\r\n\t\t\t[912, 913, 914],\r\n\t\t\t[915, 916, 917],\r\n\t\t\t[918, 919, 920],\r\n\t\t\t[921, 922, 923],\r\n\t\t\t[924, 925, 926],\r\n\t\t\t[927, 928, 929],\r\n\t\t\t[930, 931, 932],\r\n\t\t\t[933, 934, 935],\r\n\t\t\t[936, 937, 938],\r\n\t\t\t[939, 940, 941],\r\n\t\t\t[942, 943, 944],\r\n\t\t\t[945, 946, 947],\r\n\t\t\t[948, 949, 950],\r\n\t\t\t[951, 952, 953],\r\n\t\t\t[954, 955, 956],\r\n\t\t\t[957, 958, 959],\r\n\t\t\t[960, 961, 962],\r\n\t\t\t[963, 964, 965],\r\n\t\t\t[966, 967, 968],\r\n\t\t\t[969, 970, 971],\r\n\t\t\t[972, 973, 974],\r\n\t\t\t[975, 976, 977],\r\n\t\t\t[978, 979, 980],\r\n\t\t\t[981, 982, 983],\r\n\t\t\t[984, 985, 986],\r\n\t\t\t[987, 988, 989],\r\n\t\t\t[990, 991, 992],\r\n\t\t\t[993, 994, 995],\r\n\t\t\t[996, 997, 998],\r\n\t\t\t[999, 1000, 1001],\r\n\t\t\t[1002, 1003, 1004],\r\n\t\t\t[1005, 1006, 1007],\r\n\t\t\t[1008, 1009, 1010],\r\n\t\t\t[1011, 1012, 1013],\r\n\t\t\t[1014, 1015, 1016],\r\n\t\t\t[1017, 1018, 1019],\r\n\t\t\t[1020, 1021, 1022],\r\n\t\t\t[1023, 1024, 1025],\r\n\t\t\t[1026, 1027, 1028],\r\n\t\t\t[1029, 1030, 1031],\r\n\t\t\t[1032, 1033, 1034],\r\n\t\t\t[1035, 1036, 1037],\r\n\t\t\t[1038, 1039, 1040],\r\n\t\t\t[1041, 1042, 1043],\r\n\t\t\t[1044, 1045, 1046],\r\n\t\t\t[1047, 1048, 1049],\r\n\t\t\t[1050, 1051, 1052],\r\n\t\t\t[1053, 1054, 1055],\r\n\t\t\t[1056, 1057, 1058],\r\n\t\t\t[1059, 1060, 1061],\r\n\t\t\t[1062, 1063, 1064],\r\n\t\t\t[1065, 1066, 1067],\r\n\t\t\t[1068, 1069, 1070],\r\n\t\t\t[1071, 1072, 1073],\r\n\t\t\t[1074, 1075, 1076],\r\n\t\t\t[1077, 1078, 1079],\r\n\t\t\t[1080, 1081, 1082],\r\n\t\t\t[1083, 1084, 1085],\r\n\t\t\t[1086, 1087, 1088],\r\n\t\t\t[1089, 1090, 1091],\r\n\t\t\t[1092, 1093, 1094],\r\n\t\t\t[1095, 1096, 1097],\r\n\t\t\t[1098, 1099, 1100],\r\n\t\t\t[1101, 1102, 1103],\r\n\t\t\t[1104, 1105, 1106],\r\n\t\t\t[1107, 1108, 1109],\r\n\t\t\t[1110, 1111, 1112],\r\n\t\t\t[1113, 1114, 1115],\r\n\t\t\t[1116, 1117, 1118],\r\n\t\t\t[1119, 1120, 1121],\r\n\t\t\t[1122, 1123, 1124],\r\n\t\t\t[1125, 1126, 1127],\r\n\t\t\t[1128, 1129, 1130],\r\n\t\t\t[1131, 1132, 1133],\r\n\t\t\t[1134, 1135, 1136],\r\n\t\t\t[1137, 1138, 1139],\r\n\t\t\t[1140, 1141, 1142],\r\n\t\t\t[1143, 1144, 1145],\r\n\t\t\t[1146, 1147, 1148],\r\n\t\t\t[1149, 1150, 1151],\r\n\t\t\t[1152, 1153, 1154],\r\n\t\t\t[1155, 1156, 1157],\r\n\t\t\t[1158, 1159, 1160],\r\n\t\t\t[1161, 1162, 1163],\r\n\t\t\t[1164, 1165, 1166],\r\n\t\t\t[1167, 1168, 1169],\r\n\t\t\t[1170, 1171, 1172],\r\n\t\t\t[1173, 1174, 1175],\r\n\t\t\t[1176, 1177, 1178],\r\n\t\t\t[1179, 1180, 1181],\r\n\t\t\t[1182, 1183, 1184],\r\n\t\t\t[1185, 1186, 1187],\r\n\t\t\t[1188, 1189, 1190],\r\n\t\t\t[1191, 1192, 1193],\r\n\t\t\t[1194, 1195, 1196],\r\n\t\t\t[1197, 1198, 1199],\r\n\t\t\t[1200, 1201, 1202],\r\n\t\t\t[1203, 1204, 1205],\r\n\t\t\t[1206, 1207, 1208],\r\n\t\t\t[1209, 1210, 1211],\r\n\t\t\t[1212, 1213, 1214],\r\n\t\t\t[1215, 1216, 1217],\r\n\t\t\t[1218, 1219, 1220],\r\n\t\t\t[1221, 1222, 1223],\r\n\t\t\t[1224, 1225, 1226],\r\n\t\t\t[1227, 1228, 1229],\r\n\t\t\t[1230, 1231, 1232],\r\n\t\t\t[1233, 1234, 1235],\r\n\t\t\t[1236, 1237, 1238],\r\n\t\t\t[1239, 1240, 1241],\r\n\t\t\t[1242, 1243, 1244],\r\n\t\t\t[1245, 1246, 1247],\r\n\t\t\t[1248, 1249, 1250],\r\n\t\t\t[1251, 1252, 1253],\r\n\t\t\t[1254, 1255, 1256],\r\n\t\t\t[1257, 1258, 1259],\r\n\t\t\t[1260, 1261, 1262],\r\n\t\t\t[1263, 1264, 1265],\r\n\t\t\t[1266, 1267, 1268],\r\n\t\t\t[1269, 1270, 1271],\r\n\t\t\t[1272, 1273, 1274],\r\n\t\t\t[1275, 1276, 1277],\r\n\t\t\t[1278, 1279, 1280],\r\n\t\t\t[1281, 1282, 1283],\r\n\t\t\t[1284, 1285, 1286],\r\n\t\t\t[1287, 1288, 1289],\r\n\t\t\t[1290, 1291, 1292],\r\n\t\t\t[1293, 1294, 1295],\r\n\t\t\t[1296, 1297, 1298],\r\n\t\t\t[1299, 1300, 1301],\r\n\t\t\t[1302, 1303, 1304],\r\n\t\t\t[1305, 1306, 1307],\r\n\t\t\t[1308, 1309, 1310],\r\n\t\t\t[1311, 1312, 1313],\r\n\t\t\t[1314, 1315, 1316],\r\n\t\t\t[1317, 1318, 1319],\r\n\t\t\t[1320, 1321, 1322],\r\n\t\t\t[1323, 1324, 1325],\r\n\t\t\t[1326, 1327, 1328],\r\n\t\t\t[1329, 1330, 1331],\r\n\t\t\t[1332, 1333, 1334],\r\n\t\t\t[1335, 1336, 1337],\r\n\t\t\t[1338, 1339, 1340],\r\n\t\t\t[1341, 1342, 1343],\r\n\t\t\t[1344, 1345, 1346],\r\n\t\t\t[1347, 1348, 1349],\r\n\t\t\t[1350, 1351, 1352],\r\n\t\t\t[1353, 1354, 1355],\r\n\t\t\t[1356, 1357, 1358],\r\n\t\t\t[1359, 1360, 1361],\r\n\t\t\t[1362, 1363, 1364],\r\n\t\t\t[1365, 1366, 1367],\r\n\t\t\t[1368, 1369, 1370],\r\n\t\t\t[1371, 1372, 1373],\r\n\t\t\t[1374, 1375, 1376],\r\n\t\t\t[1377, 1378, 1379],\r\n\t\t\t[1380, 1381, 1382],\r\n\t\t\t[1383, 1384, 1385],\r\n\t\t\t[1386, 1387, 1388],\r\n\t\t\t[1389, 1390, 1391],\r\n\t\t\t[1392, 1393, 1394],\r\n\t\t\t[1395, 1396, 1397],\r\n\t\t\t[1398, 1399, 1400],\r\n\t\t\t[1401, 1402, 1403],\r\n\t\t\t[1404, 1405, 1406],\r\n\t\t\t[1407, 1408, 1409],\r\n\t\t\t[1410, 1411, 1412],\r\n\t\t\t[1413, 1414, 1415],\r\n\t\t\t[1416, 1417, 1418],\r\n\t\t\t[1419, 1420, 1421],\r\n\t\t\t[1422, 1423, 1424],\r\n\t\t\t[1425, 1426, 1427],\r\n\t\t\t[1428, 1429, 1430],\r\n\t\t\t[1431, 1432, 1433],\r\n\t\t\t[1434, 1435, 1436],\r\n\t\t\t[1437, 1438, 1439],\r\n\t\t\t[1440, 1441, 1442],\r\n\t\t\t[1443, 1444, 1445],\r\n\t\t\t[1446, 1447, 1448],\r\n\t\t\t[1449, 1450, 1451],\r\n\t\t\t[1452, 1453, 1454],\r\n\t\t\t[1455, 1456, 1457],\r\n\t\t\t[1458, 1459, 1460],\r\n\t\t\t[1461, 1462, 1463],\r\n\t\t\t[1464, 1465, 1466],\r\n\t\t\t[1467, 1468, 1469],\r\n\t\t\t[1470, 1471, 1472],\r\n\t\t\t[1473, 1474, 1475],\r\n\t\t\t[1476, 1477, 1478],\r\n\t\t\t[1479, 1480, 1481],\r\n\t\t\t[1482, 1483, 1484],\r\n\t\t\t[1485, 1486, 1487],\r\n\t\t\t[1488, 1489, 1490],\r\n\t\t\t[1491, 1492, 1493],\r\n\t\t\t[1494, 1495, 1496],\r\n\t\t\t[1497, 1498, 1499],\r\n\t\t\t[1500, 1501, 1502],\r\n\t\t\t[1503, 1504, 1505],\r\n\t\t\t[1506, 1507, 1508],\r\n\t\t\t[1509, 1510, 1511],\r\n\t\t\t[1512, 1513, 1514],\r\n\t\t\t[1515, 1516, 1517],\r\n\t\t\t[1518, 1519, 1520],\r\n\t\t\t[1521, 1522, 1523],\r\n\t\t\t[1524, 1525, 1526],\r\n\t\t\t[1527, 1528, 1529],\r\n\t\t\t[1530, 1531, 1532],\r\n\t\t\t[1533, 1534, 1535],\r\n\t\t\t[1536, 1537, 1538],\r\n\t\t\t[1539, 1540, 1541],\r\n\t\t\t[1542, 1543, 1544],\r\n\t\t\t[1545, 1546, 1547],\r\n\t\t\t[1548, 1549, 1550],\r\n\t\t\t[1551, 1552, 1553],\r\n\t\t\t[1554, 1555, 1556],\r\n\t\t\t[1557, 1558, 1559],\r\n\t\t\t[1560, 1561, 1562],\r\n\t\t\t[1563, 1564, 1565],\r\n\t\t\t[1566, 1567, 1568],\r\n\t\t\t[1569, 1570, 1571],\r\n\t\t\t[1572, 1573, 1574],\r\n\t\t\t[1575, 1576, 1577],\r\n\t\t\t[1578, 1579, 1580],\r\n\t\t\t[1581, 1582, 1583],\r\n\t\t\t[1584, 1585, 1586],\r\n\t\t\t[1587, 1588, 1589],\r\n\t\t\t[1590, 1591, 1592],\r\n\t\t\t[1593, 1594, 1595],\r\n\t\t\t[1596, 1597, 1598],\r\n\t\t\t[1599, 1600, 1601],\r\n\t\t\t[1602, 1603, 1604],\r\n\t\t\t[1605, 1606, 1607],\r\n\t\t\t[1608, 1609, 1610],\r\n\t\t\t[1611, 1612, 1613],\r\n\t\t\t[1614, 1615, 1616],\r\n\t\t\t[1617, 1618, 1619],\r\n\t\t\t[1620, 1621, 1622],\r\n\t\t\t[1623, 1624, 1625],\r\n\t\t\t[1626, 1627, 1628],\r\n\t\t\t[1629, 1630, 1631],\r\n\t\t\t[1632, 1633, 1634],\r\n\t\t\t[1635, 1636, 1637],\r\n\t\t\t[1638, 1639, 1640],\r\n\t\t\t[1641, 1642, 1643],\r\n\t\t\t[1644, 1645, 1646],\r\n\t\t\t[1647, 1648, 1649],\r\n\t\t\t[1650, 1651, 1652],\r\n\t\t\t[1653, 1654, 1655],\r\n\t\t\t[1656, 1657, 1658],\r\n\t\t\t[1659, 1660, 1661],\r\n\t\t\t[1662, 1663, 1664],\r\n\t\t\t[1665, 1666, 1667],\r\n\t\t\t[1668, 1669, 1670],\r\n\t\t\t[1671, 1672, 1673],\r\n\t\t\t[1674, 1675, 1676],\r\n\t\t\t[1677, 1678, 1679],\r\n\t\t\t[1680, 1681, 1682],\r\n\t\t\t[1683, 1684, 1685],\r\n\t\t\t[1686, 1687, 1688],\r\n\t\t\t[1689, 1690, 1691],\r\n\t\t\t[1692, 1693, 1694],\r\n\t\t\t[1695, 1696, 1697],\r\n\t\t\t[1698, 1699, 1700],\r\n\t\t\t[1701, 1702, 1703],\r\n\t\t\t[1704, 1705, 1706],\r\n\t\t\t[1707, 1708, 1709],\r\n\t\t\t[1710, 1711, 1712],\r\n\t\t\t[1713, 1714, 1715],\r\n\t\t\t[1716, 1717, 1718],\r\n\t\t\t[1719, 1720, 1721],\r\n\t\t\t[1722, 1723, 1724],\r\n\t\t\t[1725, 1726, 1727],\r\n\t\t\t[1728, 1729, 1730],\r\n\t\t\t[1731, 1732, 1733],\r\n\t\t\t[1734, 1735, 1736],\r\n\t\t\t[1737, 1738, 1739],\r\n\t\t\t[1740, 1741, 1742],\r\n\t\t\t[1743, 1744, 1745],\r\n\t\t\t[1746, 1747, 1748],\r\n\t\t\t[1749, 1750, 1751],\r\n\t\t\t[1752, 1753, 1754],\r\n\t\t\t[1755, 1756, 1757],\r\n\t\t\t[1758, 1759, 1760],\r\n\t\t\t[1761, 1762, 1763],\r\n\t\t\t[1764, 1765, 1766],\r\n\t\t\t[1767, 1768, 1769],\r\n\t\t\t[1770, 1771, 1772],\r\n\t\t\t[1773, 1774, 1775],\r\n\t\t\t[1776, 1777, 1778],\r\n\t\t\t[1779, 1780, 1781],\r\n\t\t\t[1782, 1783, 1784],\r\n\t\t\t[1785, 1786, 1787],\r\n\t\t\t[1788, 1789, 1790],\r\n\t\t\t[1791, 1792, 1793],\r\n\t\t\t[1794, 1795, 1796],\r\n\t\t\t[1797, 1798, 1799],\r\n\t\t\t[1800, 1801, 1802],\r\n\t\t\t[1803, 1804, 1805],\r\n\t\t\t[1806, 1807, 1808],\r\n\t\t\t[1809, 1810, 1811],\r\n\t\t\t[1812, 1813, 1814],\r\n\t\t\t[1815, 1816, 1817],\r\n\t\t\t[1818, 1819, 1820],\r\n\t\t\t[1821, 1822, 1823],\r\n\t\t\t[1824, 1825, 1826],\r\n\t\t\t[1827, 1828, 1829],\r\n\t\t\t[1830, 1831, 1832],\r\n\t\t\t[1833, 1834, 1835],\r\n\t\t\t[1836, 1837, 1838],\r\n\t\t\t[1839, 1840, 1841],\r\n\t\t\t[1842, 1843, 1844],\r\n\t\t\t[1845, 1846, 1847],\r\n\t\t\t[1848, 1849, 1850],\r\n\t\t\t[1851, 1852, 1853],\r\n\t\t\t[1854, 1855, 1856],\r\n\t\t\t[1857, 1858, 1859],\r\n\t\t\t[1860, 1861, 1862],\r\n\t\t\t[1863, 1864, 1865],\r\n\t\t\t[1866, 1867, 1868],\r\n\t\t\t[1869, 1870, 1871],\r\n\t\t\t[1872, 1873, 1874],\r\n\t\t\t[1875, 1876, 1877],\r\n\t\t\t[1878, 1879, 1880],\r\n\t\t\t[1881, 1882, 1883],\r\n\t\t\t[1884, 1885, 1886],\r\n\t\t\t[1887, 1888, 1889],\r\n\t\t\t[1890, 1891, 1892],\r\n\t\t\t[1893, 1894, 1895],\r\n\t\t\t[1896, 1897, 1898],\r\n\t\t\t[1899, 1900, 1901],\r\n\t\t\t[1902, 1903, 1904],\r\n\t\t\t[1905, 1906, 1907],\r\n\t\t\t[1908, 1909, 1910],\r\n\t\t\t[1911, 1912, 1913],\r\n\t\t\t[1914, 1915, 1916],\r\n\t\t\t[1917, 1918, 1919],\r\n\t\t\t[1920, 1921, 1922],\r\n\t\t\t[1923, 1924, 1925],\r\n\t\t\t[1926, 1927, 1928],\r\n\t\t\t[1929, 1930, 1931],\r\n\t\t\t[1932, 1933, 1934],\r\n\t\t\t[1935, 1936, 1937],\r\n\t\t\t[1938, 1939, 1940],\r\n\t\t\t[1941, 1942, 1943],\r\n\t\t\t[1944, 1945, 1946],\r\n\t\t\t[1947, 1948, 1949],\r\n\t\t\t[1950, 1951, 1952],\r\n\t\t\t[1953, 1954, 1955],\r\n\t\t\t[1956, 1957, 1958],\r\n\t\t\t[1959, 1960, 1961],\r\n\t\t\t[1962, 1963, 1964],\r\n\t\t\t[1965, 1966, 1967],\r\n\t\t\t[1968, 1969, 1970],\r\n\t\t\t[1971, 1972, 1973],\r\n\t\t\t[1974, 1975, 1976],\r\n\t\t\t[1977, 1978, 1979],\r\n\t\t\t[1980, 1981, 1982],\r\n\t\t\t[1983, 1984, 1985],\r\n\t\t\t[1986, 1987, 1988],\r\n\t\t\t[1989, 1990, 1991],\r\n\t\t\t[1992, 1993, 1994],\r\n\t\t\t[1995, 1996, 1997],\r\n\t\t\t[1998, 1999, 2000],\r\n\t\t\t[2001, 2002, 2003],\r\n\t\t\t[2004, 2005, 2006],\r\n\t\t\t[2007, 2008, 2009],\r\n\t\t\t[2010, 2011, 2012],\r\n\t\t\t[2013, 2014, 2015],\r\n\t\t\t[2016, 2017, 2018],\r\n\t\t\t[2019, 2020, 2021],\r\n\t\t\t[2022, 2023, 2024],\r\n\t\t\t[2025, 2026, 2027],\r\n\t\t\t[2028, 2029, 2030],\r\n\t\t\t[2031, 2032, 2033],\r\n\t\t\t[2034, 2035, 2036],\r\n\t\t\t[2037, 2038, 2039],\r\n\t\t\t[2040, 2041, 2042],\r\n\t\t\t[2043, 2044, 2045],\r\n\t\t\t[2046, 2047, 2048],\r\n\t\t\t[2049, 2050, 2051],\r\n\t\t\t[2052, 2053, 2054],\r\n\t\t\t[2055, 2056, 2057],\r\n\t\t\t[2058, 2059, 2060],\r\n\t\t\t[2061, 2062, 2063],\r\n\t\t\t[2064, 2065, 2066],\r\n\t\t\t[2067, 2068, 2069],\r\n\t\t\t[2070, 2071, 2072],\r\n\t\t\t[2073, 2074, 2075],\r\n\t\t\t[2076, 2077, 2078],\r\n\t\t\t[2079, 2080, 2081],\r\n\t\t\t[2082, 2083, 2084],\r\n\t\t\t[2085, 2086, 2087],\r\n\t\t\t[2088, 2089, 2090],\r\n\t\t\t[2091, 2092, 2093],\r\n\t\t\t[2094, 2095, 2096],\r\n\t\t\t[2097, 2098, 2099],\r\n\t\t\t[2100, 2101, 2102],\r\n\t\t\t[2103, 2104, 2105],\r\n\t\t\t[2106, 2107, 2108],\r\n\t\t\t[2109, 2110, 2111],\r\n\t\t\t[2112, 2113, 2114],\r\n\t\t\t[2115, 2116, 2117],\r\n\t\t\t[2118, 2119, 2120],\r\n\t\t\t[2121, 2122, 2123],\r\n\t\t\t[2124, 2125, 2126],\r\n\t\t\t[2127, 2128, 2129],\r\n\t\t\t[2130, 2131, 2132],\r\n\t\t\t[2133, 2134, 2135],\r\n\t\t\t[2136, 2137, 2138],\r\n\t\t\t[2139, 2140, 2141],\r\n\t\t\t[2142, 2143, 2144],\r\n\t\t\t[2145, 2146, 2147],\r\n\t\t\t[2148, 2149, 2150],\r\n\t\t\t[2151, 2152, 2153],\r\n\t\t\t[2154, 2155, 2156],\r\n\t\t\t[2157, 2158, 2159],\r\n\t\t\t[2160, 2161, 2162],\r\n\t\t\t[2163, 2164, 2165],\r\n\t\t\t[2166, 2167, 2168],\r\n\t\t\t[2169, 2170, 2171],\r\n\t\t\t[2172, 2173, 2174],\r\n\t\t\t[2175, 2176, 2177],\r\n\t\t\t[2178, 2179, 2180],\r\n\t\t\t[2181, 2182, 2183],\r\n\t\t\t[2184, 2185, 2186],\r\n\t\t\t[2187, 2188, 2189],\r\n\t\t\t[2190, 2191, 2192],\r\n\t\t\t[2193, 2194, 2195],\r\n\t\t\t[2196, 2197, 2198],\r\n\t\t\t[2199, 2200, 2201],\r\n\t\t\t[2202, 2203, 2204],\r\n\t\t\t[2205, 2206, 2207],\r\n\t\t\t[2208, 2209, 2210],\r\n\t\t\t[2211, 2212, 2213],\r\n\t\t\t[2214, 2215, 2216],\r\n\t\t\t[2217, 2218, 2219],\r\n\t\t\t[2220, 2221, 2222],\r\n\t\t\t[2223, 2224, 2225],\r\n\t\t\t[2226, 2227, 2228],\r\n\t\t\t[2229, 2230, 2231],\r\n\t\t\t[2232, 2233, 2234],\r\n\t\t\t[2235, 2236, 2237],\r\n\t\t\t[2238, 2239, 2240],\r\n\t\t\t[2241, 2242, 2243],\r\n\t\t\t[2244, 2245, 2246],\r\n\t\t\t[2247, 2248, 2249],\r\n\t\t\t[2250, 2251, 2252],\r\n\t\t\t[2253, 2254, 2255],\r\n\t\t\t[2256, 2257, 2258],\r\n\t\t\t[2259, 2260, 2261],\r\n\t\t\t[2262, 2263, 2264],\r\n\t\t\t[2265, 2266, 2267],\r\n\t\t\t[2268, 2269, 2270],\r\n\t\t\t[2271, 2272, 2273],\r\n\t\t\t[2274, 2275, 2276],\r\n\t\t\t[2277, 2278, 2279],\r\n\t\t\t[2280, 2281, 2282],\r\n\t\t\t[2283, 2284, 2285],\r\n\t\t\t[2286, 2287, 2288],\r\n\t\t\t[2289, 2290, 2291],\r\n\t\t\t[2292, 2293, 2294],\r\n\t\t\t[2295, 2296, 2297],\r\n\t\t\t[2298, 2299, 2300],\r\n\t\t\t[2301, 2302, 2303],\r\n\t\t\t[2304, 2305, 2306],\r\n\t\t\t[2307, 2308, 2309],\r\n\t\t\t[2310, 2311, 2312],\r\n\t\t\t[2313, 2314, 2315],\r\n\t\t\t[2316, 2317, 2318],\r\n\t\t\t[2319, 2320, 2321],\r\n\t\t\t[2322, 2323, 2324],\r\n\t\t\t[2325, 2326, 2327],\r\n\t\t\t[2328, 2329, 2330],\r\n\t\t\t[2331, 2332, 2333],\r\n\t\t\t[2334, 2335, 2336],\r\n\t\t\t[2337, 2338, 2339],\r\n\t\t\t[2340, 2341, 2342],\r\n\t\t\t[2343, 2344, 2345],\r\n\t\t\t[2346, 2347, 2348],\r\n\t\t\t[2349, 2350, 2351],\r\n\t\t\t[2352, 2353, 2354],\r\n\t\t\t[2355, 2356, 2357],\r\n\t\t\t[2358, 2359, 2360],\r\n\t\t\t[2361, 2362, 2363],\r\n\t\t\t[2364, 2365, 2366],\r\n\t\t\t[2367, 2368, 2369],\r\n\t\t\t[2370, 2371, 2372],\r\n\t\t\t[2373, 2374, 2375],\r\n\t\t\t[2376, 2377, 2378],\r\n\t\t\t[2379, 2380, 2381],\r\n\t\t\t[2382, 2383, 2384],\r\n\t\t\t[2385, 2386, 2387],\r\n\t\t\t[2388, 2389, 2390],\r\n\t\t\t[2391, 2392, 2393],\r\n\t\t\t[2394, 2395, 2396],\r\n\t\t\t[2397, 2398, 2399],\r\n\t\t\t[2400, 2401, 2402],\r\n\t\t\t[2403, 2404, 2405],\r\n\t\t\t[2406, 2407, 2408],\r\n\t\t\t[2409, 2410, 2411],\r\n\t\t\t[2412, 2413, 2414],\r\n\t\t\t[2415, 2416, 2417],\r\n\t\t\t[2418, 2419, 2420],\r\n\t\t\t[2421, 2422, 2423],\r\n\t\t\t[2424, 2425, 2426],\r\n\t\t\t[2427, 2428, 2429],\r\n\t\t\t[2430, 2431, 2432],\r\n\t\t\t[2433, 2434, 2435],\r\n\t\t\t[2436, 2437, 2438],\r\n\t\t\t[2439, 2440, 2441],\r\n\t\t\t[2442, 2443, 2444],\r\n\t\t\t[2445, 2446, 2447],\r\n\t\t\t[2448, 2449, 2450],\r\n\t\t\t[2451, 2452, 2453],\r\n\t\t\t[2454, 2455, 2456],\r\n\t\t\t[2457, 2458, 2459],\r\n\t\t\t[2460, 2461, 2462],\r\n\t\t\t[2463, 2464, 2465],\r\n\t\t\t[2466, 2467, 2468],\r\n\t\t\t[2469, 2470, 2471],\r\n\t\t\t[2472, 2473, 2474],\r\n\t\t\t[2475, 2476, 2477],\r\n\t\t\t[2478, 2479, 2480],\r\n\t\t\t[2481, 2482, 2483],\r\n\t\t\t[2484, 2485, 2486],\r\n\t\t\t[2487, 2488, 2489],\r\n\t\t\t[2490, 2491, 2492],\r\n\t\t\t[2493, 2494, 2495],\r\n\t\t\t[2496, 2497, 2498],\r\n\t\t\t[2499, 2500, 2501],\r\n\t\t\t[2502, 2503, 2504],\r\n\t\t\t[2505, 2506, 2507],\r\n\t\t\t[2508, 2509, 2510],\r\n\t\t\t[2511, 2512, 2513],\r\n\t\t\t[2514, 2515, 2516],\r\n\t\t\t[2517, 2518, 2519],\r\n\t\t\t[2520, 2521, 2522],\r\n\t\t\t[2523, 2524, 2525],\r\n\t\t\t[2526, 2527, 2528],\r\n\t\t\t[2529, 2530, 2531],\r\n\t\t\t[2532, 2533, 2534],\r\n\t\t\t[2535, 2536, 2537],\r\n\t\t\t[2538, 2539, 2540],\r\n\t\t\t[2541, 2542, 2543],\r\n\t\t\t[2544, 2545, 2546],\r\n\t\t\t[2547, 2548, 2549],\r\n\t\t\t[2550, 2551, 2552],\r\n\t\t\t[2553, 2554, 2555],\r\n\t\t\t[2556, 2557, 2558],\r\n\t\t\t[2559, 2560, 2561],\r\n\t\t\t[2562, 2563, 2564],\r\n\t\t\t[2565, 2566, 2567],\r\n\t\t\t[2568, 2569, 2570],\r\n\t\t\t[2571, 2572, 2573],\r\n\t\t\t[2574, 2575, 2576],\r\n\t\t\t[2577, 2578, 2579],\r\n\t\t\t[2580, 2581, 2582],\r\n\t\t\t[2583, 2584, 2585],\r\n\t\t\t[2586, 2587, 2588],\r\n\t\t\t[2589, 2590, 2591],\r\n\t\t\t[2592, 2593, 2594],\r\n\t\t\t[2595, 2596, 2597],\r\n\t\t\t[2598, 2599, 2600],\r\n\t\t\t[2601, 2602, 2603],\r\n\t\t\t[2604, 2605, 2606],\r\n\t\t\t[2607, 2608, 2609],\r\n\t\t\t[2610, 2611, 2612],\r\n\t\t\t[2613, 2614, 2615],\r\n\t\t\t[2616, 2617, 2618],\r\n\t\t\t[2619, 2620, 2621],\r\n\t\t\t[2622, 2623, 2624],\r\n\t\t\t[2625, 2626, 2627],\r\n\t\t\t[2628, 2629, 2630],\r\n\t\t\t[2631, 2632, 2633],\r\n\t\t\t[2634, 2635, 2636],\r\n\t\t\t[2637, 2638, 2639],\r\n\t\t\t[2640, 2641, 2642],\r\n\t\t\t[2643, 2644, 2645],\r\n\t\t\t[2646, 2647, 2648],\r\n\t\t\t[2649, 2650, 2651],\r\n\t\t\t[2652, 2653, 2654],\r\n\t\t\t[2655, 2656, 2657],\r\n\t\t\t[2658, 2659, 2660],\r\n\t\t\t[2661, 2662, 2663],\r\n\t\t\t[2664, 2665, 2666],\r\n\t\t\t[2667, 2668, 2669],\r\n\t\t\t[2670, 2671, 2672],\r\n\t\t\t[2673, 2674, 2675],\r\n\t\t\t[2676, 2677, 2678],\r\n\t\t\t[2679, 2680, 2681],\r\n\t\t\t[2682, 2683, 2684],\r\n\t\t\t[2685, 2686, 2687],\r\n\t\t\t[2688, 2689, 2690],\r\n\t\t\t[2691, 2692, 2693],\r\n\t\t\t[2694, 2695, 2696],\r\n\t\t\t[2697, 2698, 2699],\r\n\t\t\t[2700, 2701, 2702],\r\n\t\t\t[2703, 2704, 2705],\r\n\t\t\t[2706, 2707, 2708],\r\n\t\t\t[2709, 2710, 2711],\r\n\t\t\t[2712, 2713, 2714],\r\n\t\t\t[2715, 2716, 2717],\r\n\t\t\t[2718, 2719, 2720],\r\n\t\t\t[2721, 2722, 2723],\r\n\t\t\t[2724, 2725, 2726],\r\n\t\t\t[2727, 2728, 2729],\r\n\t\t\t[2730, 2731, 2732],\r\n\t\t\t[2733, 2734, 2735],\r\n\t\t\t[2736, 2737, 2738],\r\n\t\t\t[2739, 2740, 2741],\r\n\t\t\t[2742, 2743, 2744],\r\n\t\t\t[2745, 2746, 2747],\r\n\t\t\t[2748, 2749, 2750],\r\n\t\t\t[2751, 2752, 2753],\r\n\t\t\t[2754, 2755, 2756],\r\n\t\t\t[2757, 2758, 2759],\r\n\t\t\t[2760, 2761, 2762],\r\n\t\t\t[2763, 2764, 2765],\r\n\t\t\t[2766, 2767, 2768],\r\n\t\t\t[2769, 2770, 2771],\r\n\t\t\t[2772, 2773, 2774],\r\n\t\t\t[2775, 2776, 2777],\r\n\t\t\t[2778, 2779, 2780],\r\n\t\t\t[2781, 2782, 2783],\r\n\t\t\t[2784, 2785, 2786],\r\n\t\t\t[2787, 2788, 2789],\r\n\t\t\t[2790, 2791, 2792],\r\n\t\t\t[2793, 2794, 2795],\r\n\t\t\t[2796, 2797, 2798],\r\n\t\t\t[2799, 2800, 2801],\r\n\t\t\t[2802, 2803, 2804],\r\n\t\t\t[2805, 2806, 2807],\r\n\t\t\t[2808, 2809, 2810],\r\n\t\t\t[2811, 2812, 2813],\r\n\t\t\t[2814, 2815, 2816],\r\n\t\t\t[2817, 2818, 2819],\r\n\t\t\t[2820, 2821, 2822],\r\n\t\t\t[2823, 2824, 2825],\r\n\t\t\t[2826, 2827, 2828],\r\n\t\t\t[2829, 2830, 2831],\r\n\t\t\t[2832, 2833, 2834],\r\n\t\t\t[2835, 2836, 2837],\r\n\t\t\t[2838, 2839, 2840],\r\n\t\t\t[2841, 2842, 2843],\r\n\t\t\t[2844, 2845, 2846],\r\n\t\t\t[2847, 2848, 2849],\r\n\t\t\t[2850, 2851, 2852],\r\n\t\t\t[2853, 2854, 2855],\r\n\t\t\t[2856, 2857, 2858],\r\n\t\t\t[2859, 2860, 2861],\r\n\t\t\t[2862, 2863, 2864],\r\n\t\t\t[2865, 2866, 2867],\r\n\t\t\t[2868, 2869, 2870],\r\n\t\t\t[2871, 2872, 2873],\r\n\t\t\t[2874, 2875, 2876],\r\n\t\t\t[2877, 2878, 2879],\r\n\t\t\t[2880, 2881, 2882],\r\n\t\t\t[2883, 2884, 2885],\r\n\t\t\t[2886, 2887, 2888],\r\n\t\t\t[2889, 2890, 2891],\r\n\t\t\t[2892, 2893, 2894],\r\n\t\t\t[2895, 2896, 2897],\r\n\t\t\t[2898, 2899, 2900],\r\n\t\t\t[2901, 2902, 2903],\r\n\t\t\t[2904, 2905, 2906],\r\n\t\t\t[2907, 2908, 2909],\r\n\t\t\t[2910, 2911, 2912],\r\n\t\t\t[2913, 2914, 2915],\r\n\t\t\t[2916, 2917, 2918],\r\n\t\t\t[2919, 2920, 2921],\r\n\t\t\t[2922, 2923, 2924],\r\n\t\t\t[2925, 2926, 2927],\r\n\t\t\t[2928, 2929, 2930],\r\n\t\t\t[2931, 2932, 2933],\r\n\t\t\t[2934, 2935, 2936],\r\n\t\t\t[2937, 2938, 2939],\r\n\t\t\t[2940, 2941, 2942],\r\n\t\t\t[2943, 2944, 2945],\r\n\t\t\t[2946, 2947, 2948],\r\n\t\t\t[2949, 2950, 2951],\r\n\t\t\t[2952, 2953, 2954],\r\n\t\t\t[2955, 2956, 2957],\r\n\t\t\t[2958, 2959, 2960],\r\n\t\t\t[2961, 2962, 2963],\r\n\t\t\t[2964, 2965, 2966],\r\n\t\t\t[2967, 2968, 2969],\r\n\t\t\t[2970, 2971, 2972],\r\n\t\t\t[2973, 2974, 2975],\r\n\t\t\t[2976, 2977, 2978],\r\n\t\t\t[2979, 2980, 2981],\r\n\t\t\t[2982, 2983, 2984],\r\n\t\t\t[2985, 2986, 2987],\r\n\t\t\t[2988, 2989, 2990],\r\n\t\t\t[2991, 2992, 2993],\r\n\t\t\t[2994, 2995, 2996],\r\n\t\t\t[2997, 2998, 2999],\r\n\t\t\t[3000, 3001, 3002],\r\n\t\t\t[3003, 3004, 3005],\r\n\t\t\t[3006, 3007, 3008],\r\n\t\t\t[3009, 3010, 3011],\r\n\t\t\t[3012, 3013, 3014],\r\n\t\t\t[3015, 3016, 3017],\r\n\t\t\t[3018, 3019, 3020],\r\n\t\t\t[3021, 3022, 3023],\r\n\t\t\t[3024, 3025, 3026],\r\n\t\t\t[3027, 3028, 3029],\r\n\t\t\t[3030, 3031, 3032],\r\n\t\t\t[3033, 3034, 3035],\r\n\t\t\t[3036, 3037, 3038],\r\n\t\t\t[3039, 3040, 3041],\r\n\t\t\t[3042, 3043, 3044],\r\n\t\t\t[3045, 3046, 3047],\r\n\t\t\t[3048, 3049, 3050],\r\n\t\t\t[3051, 3052, 3053],\r\n\t\t\t[3054, 3055, 3056],\r\n\t\t\t[3057, 3058, 3059],\r\n\t\t\t[3060, 3061, 3062],\r\n\t\t\t[3063, 3064, 3065],\r\n\t\t\t[3066, 3067, 3068],\r\n\t\t\t[3069, 3070, 3071],\r\n\t\t\t[3072, 3073, 3074],\r\n\t\t\t[3075, 3076, 3077],\r\n\t\t\t[3078, 3079, 3080],\r\n\t\t\t[3081, 3082, 3083],\r\n\t\t\t[3084, 3085, 3086],\r\n\t\t\t[3087, 3088, 3089],\r\n\t\t\t[3090, 3091, 3092],\r\n\t\t\t[3093, 3094, 3095],\r\n\t\t\t[3096, 3097, 3098],\r\n\t\t\t[3099, 3100, 3101],\r\n\t\t\t[3102, 3103, 3104],\r\n\t\t\t[3105, 3106, 3107],\r\n\t\t\t[3108, 3109, 3110],\r\n\t\t\t[3111, 3112, 3113],\r\n\t\t\t[3114, 3115, 3116],\r\n\t\t\t[3117, 3118, 3119],\r\n\t\t\t[3120, 3121, 3122],\r\n\t\t\t[3123, 3124, 3125],\r\n\t\t\t[3126, 3127, 3128],\r\n\t\t\t[3129, 3130, 3131],\r\n\t\t\t[3132, 3133, 3134],\r\n\t\t\t[3135, 3136, 3137],\r\n\t\t\t[3138, 3139, 3140],\r\n\t\t\t[3141, 3142, 3143],\r\n\t\t\t[3144, 3145, 3146],\r\n\t\t\t[3147, 3148, 3149],\r\n\t\t\t[3150, 3151, 3152],\r\n\t\t\t[3153, 3154, 3155],\r\n\t\t\t[3156, 3157, 3158],\r\n\t\t\t[3159, 3160, 3161],\r\n\t\t\t[3162, 3163, 3164],\r\n\t\t\t[3165, 3166, 3167],\r\n\t\t\t[3168, 3169, 3170],\r\n\t\t\t[3171, 3172, 3173],\r\n\t\t\t[3174, 3175, 3176],\r\n\t\t\t[3177, 3178, 3179],\r\n\t\t\t[3180, 3181, 3182],\r\n\t\t\t[3183, 3184, 3185],\r\n\t\t\t[3186, 3187, 3188],\r\n\t\t\t[3189, 3190, 3191],\r\n\t\t\t[3192, 3193, 3194],\r\n\t\t\t[3195, 3196, 3197],\r\n\t\t\t[3198, 3199, 3200],\r\n\t\t\t[3201, 3202, 3203],\r\n\t\t\t[3204, 3205, 3206],\r\n\t\t\t[3207, 3208, 3209],\r\n\t\t\t[3210, 3211, 3212],\r\n\t\t\t[3213, 3214, 3215],\r\n\t\t\t[3216, 3217, 3218],\r\n\t\t\t[3219, 3220, 3221],\r\n\t\t\t[3222, 3223, 3224],\r\n\t\t\t[3225, 3226, 3227],\r\n\t\t\t[3228, 3229, 3230],\r\n\t\t\t[3231, 3232, 3233],\r\n\t\t\t[3234, 3235, 3236],\r\n\t\t\t[3237, 3238, 3239],\r\n\t\t\t[3240, 3241, 3242],\r\n\t\t\t[3243, 3244, 3245],\r\n\t\t\t[3246, 3247, 3248],\r\n\t\t\t[3249, 3250, 3251],\r\n\t\t\t[3252, 3253, 3254],\r\n\t\t\t[3255, 3256, 3257],\r\n\t\t\t[3258, 3259, 3260],\r\n\t\t\t[3261, 3262, 3263],\r\n\t\t\t[3264, 3265, 3266],\r\n\t\t\t[3267, 3268, 3269],\r\n\t\t\t[3270, 3271, 3272],\r\n\t\t\t[3273, 3274, 3275],\r\n\t\t\t[3276, 3277, 3278],\r\n\t\t\t[3279, 3280, 3281],\r\n\t\t\t[3282, 3283, 3284],\r\n\t\t\t[3285, 3286, 3287],\r\n\t\t\t[3288, 3289, 3290],\r\n\t\t\t[3291, 3292, 3293],\r\n\t\t\t[3294, 3295, 3296],\r\n\t\t\t[3297, 3298, 3299],\r\n\t\t\t[3300, 3301, 3302],\r\n\t\t\t[3303, 3304, 3305],\r\n\t\t\t[3306, 3307, 3308],\r\n\t\t\t[3309, 3310, 3311],\r\n\t\t\t[3312, 3313, 3314],\r\n\t\t\t[3315, 3316, 3317],\r\n\t\t\t[3318, 3319, 3320],\r\n\t\t\t[3321, 3322, 3323],\r\n\t\t\t[3324, 3325, 3326],\r\n\t\t\t[3327, 3328, 3329],\r\n\t\t\t[3330, 3331, 3332],\r\n\t\t\t[3333, 3334, 3335],\r\n\t\t\t[3336, 3337, 3338],\r\n\t\t\t[3339, 3340, 3341],\r\n\t\t\t[3342, 3343, 3344],\r\n\t\t\t[3345, 3346, 3347],\r\n\t\t\t[3348, 3349, 3350],\r\n\t\t\t[3351, 3352, 3353],\r\n\t\t\t[3354, 3355, 3356],\r\n\t\t\t[3357, 3358, 3359],\r\n\t\t\t[3360, 3361, 3362],\r\n\t\t\t[3363, 3364, 3365],\r\n\t\t\t[3366, 3367, 3368],\r\n\t\t\t[3369, 3370, 3371],\r\n\t\t\t[3372, 3373, 3374],\r\n\t\t\t[3375, 3376, 3377],\r\n\t\t\t[3378, 3379, 3380],\r\n\t\t\t[3381, 3382, 3383],\r\n\t\t\t[3384, 3385, 3386],\r\n\t\t\t[3387, 3388, 3389],\r\n\t\t\t[3390, 3391, 3392],\r\n\t\t\t[3393, 3394, 3395],\r\n\t\t\t[3396, 3397, 3398],\r\n\t\t\t[3399, 3400, 3401],\r\n\t\t\t[3402, 3403, 3404],\r\n\t\t\t[3405, 3406, 3407],\r\n\t\t\t[3408, 3409, 3410],\r\n\t\t\t[3411, 3412, 3413],\r\n\t\t\t[3414, 3415, 3416],\r\n\t\t\t[3417, 3418, 3419],\r\n\t\t\t[3420, 3421, 3422],\r\n\t\t\t[3423, 3424, 3425],\r\n\t\t\t[3426, 3427, 3428],\r\n\t\t\t[3429, 3430, 3431],\r\n\t\t\t[3432, 3433, 3434],\r\n\t\t\t[3435, 3436, 3437],\r\n\t\t\t[3438, 3439, 3440],\r\n\t\t\t[3441, 3442, 3443],\r\n\t\t\t[3444, 3445, 3446],\r\n\t\t\t[3447, 3448, 3449],\r\n\t\t\t[3450, 3451, 3452],\r\n\t\t\t[3453, 3454, 3455],\r\n\t\t\t[3456, 3457, 3458],\r\n\t\t\t[3459, 3460, 3461],\r\n\t\t\t[3462, 3463, 3464],\r\n\t\t\t[3465, 3466, 3467],\r\n\t\t\t[3468, 3469, 3470],\r\n\t\t\t[3471, 3472, 3473],\r\n\t\t\t[3474, 3475, 3476],\r\n\t\t\t[3477, 3478, 3479],\r\n\t\t\t[3480, 3481, 3482],\r\n\t\t\t[3483, 3484, 3485],\r\n\t\t\t[3486, 3487, 3488],\r\n\t\t\t[3489, 3490, 3491],\r\n\t\t\t[3492, 3493, 3494],\r\n\t\t\t[3495, 3496, 3497],\r\n\t\t\t[3498, 3499, 3500],\r\n\t\t\t[3501, 3502, 3503],\r\n\t\t\t[3504, 3505, 3506],\r\n\t\t\t[3507, 3508, 3509],\r\n\t\t\t[3510, 3511, 3512],\r\n\t\t\t[3513, 3514, 3515],\r\n\t\t\t[3516, 3517, 3518],\r\n\t\t\t[3519, 3520, 3521],\r\n\t\t\t[3522, 3523, 3524],\r\n\t\t\t[3525, 3526, 3527],\r\n\t\t\t[3528, 3529, 3530],\r\n\t\t\t[3531, 3532, 3533],\r\n\t\t\t[3534, 3535, 3536],\r\n\t\t\t[3537, 3538, 3539],\r\n\t\t\t[3540, 3541, 3542],\r\n\t\t\t[3543, 3544, 3545],\r\n\t\t\t[3546, 3547, 3548],\r\n\t\t\t[3549, 3550, 3551],\r\n\t\t\t[3552, 3553, 3554],\r\n\t\t\t[3555, 3556, 3557],\r\n\t\t\t[3558, 3559, 3560],\r\n\t\t\t[3561, 3562, 3563],\r\n\t\t\t[3564, 3565, 3566],\r\n\t\t\t[3567, 3568, 3569],\r\n\t\t\t[3570, 3571, 3572],\r\n\t\t\t[3573, 3574, 3575],\r\n\t\t\t[3576, 3577, 3578],\r\n\t\t\t[3579, 3580, 3581],\r\n\t\t\t[3582, 3583, 3584],\r\n\t\t\t[3585, 3586, 3587],\r\n\t\t\t[3588, 3589, 3590],\r\n\t\t\t[3591, 3592, 3593],\r\n\t\t\t[3594, 3595, 3596],\r\n\t\t\t[3597, 3598, 3599],\r\n\t\t\t[3600, 3601, 3602],\r\n\t\t\t[3603, 3604, 3605],\r\n\t\t\t[3606, 3607, 3608],\r\n\t\t\t[3609, 3610, 3611],\r\n\t\t\t[3612, 3613, 3614],\r\n\t\t\t[3615, 3616, 3617],\r\n\t\t\t[3618, 3619, 3620],\r\n\t\t\t[3621, 3622, 3623],\r\n\t\t\t[3624, 3625, 3626],\r\n\t\t\t[3627, 3628, 3629],\r\n\t\t\t[3630, 3631, 3632],\r\n\t\t\t[3633, 3634, 3635],\r\n\t\t\t[3636, 3637, 3638],\r\n\t\t\t[3639, 3640, 3641],\r\n\t\t\t[3642, 3643, 3644],\r\n\t\t\t[3645, 3646, 3647],\r\n\t\t\t[3648, 3649, 3650],\r\n\t\t\t[3651, 3652, 3653],\r\n\t\t\t[3654, 3655, 3656],\r\n\t\t\t[3657, 3658, 3659],\r\n\t\t\t[3660, 3661, 3662],\r\n\t\t\t[3663, 3664, 3665],\r\n\t\t\t[3666, 3667, 3668],\r\n\t\t\t[3669, 3670, 3671],\r\n\t\t\t[3672, 3673, 3674],\r\n\t\t\t[3675, 3676, 3677],\r\n\t\t\t[3678, 3679, 3680],\r\n\t\t\t[3681, 3682, 3683],\r\n\t\t\t[3684, 3685, 3686],\r\n\t\t\t[3687, 3688, 3689],\r\n\t\t\t[3690, 3691, 3692],\r\n\t\t\t[3693, 3694, 3695],\r\n\t\t\t[3696, 3697, 3698],\r\n\t\t\t[3699, 3700, 3701],\r\n\t\t\t[3702, 3703, 3704],\r\n\t\t\t[3705, 3706, 3707],\r\n\t\t\t[3708, 3709, 3710],\r\n\t\t\t[3711, 3712, 3713],\r\n\t\t\t[3714, 3715, 3716],\r\n\t\t\t[3717, 3718, 3719],\r\n\t\t\t[3720, 3721, 3722],\r\n\t\t\t[3723, 3724, 3725],\r\n\t\t\t[3726, 3727, 3728],\r\n\t\t\t[3729, 3730, 3731],\r\n\t\t\t[3732, 3733, 3734],\r\n\t\t\t[3735, 3736, 3737],\r\n\t\t\t[3738, 3739, 3740],\r\n\t\t\t[3741, 3742, 3743],\r\n\t\t\t[3744, 3745, 3746],\r\n\t\t\t[3747, 3748, 3749],\r\n\t\t\t[3750, 3751, 3752],\r\n\t\t\t[3753, 3754, 3755],\r\n\t\t\t[3756, 3757, 3758],\r\n\t\t\t[3759, 3760, 3761],\r\n\t\t\t[3762, 3763, 3764],\r\n\t\t\t[3765, 3766, 3767],\r\n\t\t\t[3768, 3769, 3770],\r\n\t\t\t[3771, 3772, 3773],\r\n\t\t\t[3774, 3775, 3776],\r\n\t\t\t[3777, 3778, 3779],\r\n\t\t\t[3780, 3781, 3782],\r\n\t\t\t[3783, 3784, 3785],\r\n\t\t\t[3786, 3787, 3788],\r\n\t\t\t[3789, 3790, 3791],\r\n\t\t\t[3792, 3793, 3794],\r\n\t\t\t[3795, 3796, 3797],\r\n\t\t\t[3798, 3799, 3800],\r\n\t\t\t[3801, 3802, 3803],\r\n\t\t\t[3804, 3805, 3806],\r\n\t\t\t[3807, 3808, 3809],\r\n\t\t\t[3810, 3811, 3812],\r\n\t\t\t[3813, 3814, 3815],\r\n\t\t\t[3816, 3817, 3818],\r\n\t\t\t[3819, 3820, 3821],\r\n\t\t\t[3822, 3823, 3824],\r\n\t\t\t[3825, 3826, 3827],\r\n\t\t\t[3828, 3829, 3830],\r\n\t\t\t[3831, 3832, 3833],\r\n\t\t\t[3834, 3835, 3836],\r\n\t\t\t[3837, 3838, 3839],\r\n\t\t\t[3840, 3841, 3842],\r\n\t\t\t[3843, 3844, 3845],\r\n\t\t\t[3846, 3847, 3848],\r\n\t\t\t[3849, 3850, 3851],\r\n\t\t\t[3852, 3853, 3854],\r\n\t\t\t[3855, 3856, 3857],\r\n\t\t\t[3858, 3859, 3860],\r\n\t\t\t[3861, 3862, 3863],\r\n\t\t\t[3864, 3865, 3866],\r\n\t\t\t[3867, 3868, 3869],\r\n\t\t\t[3870, 3871, 3872],\r\n\t\t\t[3873, 3874, 3875],\r\n\t\t\t[3876, 3877, 3878],\r\n\t\t\t[3879, 3880, 3881],\r\n\t\t\t[3882, 3883, 3884],\r\n\t\t\t[3885, 3886, 3887],\r\n\t\t\t[3888, 3889, 3890],\r\n\t\t\t[3891, 3892, 3893],\r\n\t\t\t[3894, 3895, 3896],\r\n\t\t\t[3897, 3898, 3899],\r\n\t\t\t[3900, 3901, 3902],\r\n\t\t\t[3903, 3904, 3905],\r\n\t\t\t[3906, 3907, 3908],\r\n\t\t\t[3909, 3910, 3911],\r\n\t\t\t[3912, 3913, 3914],\r\n\t\t\t[3915, 3916, 3917],\r\n\t\t\t[3918, 3919, 3920],\r\n\t\t\t[3921, 3922, 3923],\r\n\t\t\t[3924, 3925, 3926],\r\n\t\t\t[3927, 3928, 3929],\r\n\t\t\t[3930, 3931, 3932],\r\n\t\t\t[3933, 3934, 3935],\r\n\t\t\t[3936, 3937, 3938],\r\n\t\t\t[3939, 3940, 3941],\r\n\t\t\t[3942, 3943, 3944],\r\n\t\t\t[3945, 3946, 3947],\r\n\t\t\t[3948, 3949, 3950],\r\n\t\t\t[3951, 3952, 3953],\r\n\t\t\t[3954, 3955, 3956],\r\n\t\t\t[3957, 3958, 3959],\r\n\t\t\t[3960, 3961, 3962],\r\n\t\t\t[3963, 3964, 3965],\r\n\t\t\t[3966, 3967, 3968],\r\n\t\t\t[3969, 3970, 3971],\r\n\t\t\t[3972, 3973, 3974],\r\n\t\t\t[3975, 3976, 3977],\r\n\t\t\t[3978, 3979, 3980],\r\n\t\t\t[3981, 3982, 3983],\r\n\t\t\t[3984, 3985, 3986],\r\n\t\t\t[3987, 3988, 3989],\r\n\t\t\t[3990, 3991, 3992],\r\n\t\t\t[3993, 3994, 3995],\r\n\t\t\t[3996, 3997, 3998],\r\n\t\t\t[3999, 4000, 4001],\r\n\t\t\t[4002, 4003, 4004],\r\n\t\t\t[4005, 4006, 4007],\r\n\t\t\t[4008, 4009, 4010],\r\n\t\t\t[4011, 4012, 4013],\r\n\t\t\t[4014, 4015, 4016],\r\n\t\t\t[4017, 4018, 4019],\r\n\t\t\t[4020, 4021, 4022],\r\n\t\t\t[4023, 4024, 4025],\r\n\t\t\t[4026, 4027, 4028],\r\n\t\t\t[4029, 4030, 4031],\r\n\t\t\t[4032, 4033, 4034],\r\n\t\t\t[4035, 4036, 4037],\r\n\t\t\t[4038, 4039, 4040],\r\n\t\t\t[4041, 4042, 4043],\r\n\t\t\t[4044, 4045, 4046],\r\n\t\t\t[4047, 4048, 4049],\r\n\t\t\t[4050, 4051, 4052],\r\n\t\t\t[4053, 4054, 4055],\r\n\t\t\t[4056, 4057, 4058],\r\n\t\t\t[4059, 4060, 4061],\r\n\t\t\t[4062, 4063, 4064],\r\n\t\t\t[4065, 4066, 4067],\r\n\t\t\t[4068, 4069, 4070],\r\n\t\t\t[4071, 4072, 4073],\r\n\t\t\t[4074, 4075, 4076],\r\n\t\t\t[4077, 4078, 4079],\r\n\t\t\t[4080, 4081, 4082],\r\n\t\t\t[4083, 4084, 4085],\r\n\t\t\t[4086, 4087, 4088],\r\n\t\t\t[4089, 4090, 4091],\r\n\t\t\t[4092, 4093, 4094],\r\n\t\t\t[4095, 4096, 4097],\r\n\t\t\t[4098, 4099, 4100],\r\n\t\t\t[4101, 4102, 4103],\r\n\t\t\t[4104, 4105, 4106],\r\n\t\t\t[4107, 4108, 4109],\r\n\t\t\t[4110, 4111, 4112],\r\n\t\t\t[4113, 4114, 4115],\r\n\t\t\t[4116, 4117, 4118],\r\n\t\t\t[4119, 4120, 4121],\r\n\t\t\t[4122, 4123, 4124],\r\n\t\t\t[4125, 4126, 4127],\r\n\t\t\t[4128, 4129, 4130],\r\n\t\t\t[4131, 4132, 4133],\r\n\t\t\t[4134, 4135, 4136],\r\n\t\t\t[4137, 4138, 4139],\r\n\t\t\t[4140, 4141, 4142],\r\n\t\t\t[4143, 4144, 4145],\r\n\t\t\t[4146, 4147, 4148],\r\n\t\t\t[4149, 4150, 4151],\r\n\t\t\t[4152, 4153, 4154],\r\n\t\t\t[4155, 4156, 4157],\r\n\t\t\t[4158, 4159, 4160],\r\n\t\t\t[4161, 4162, 4163],\r\n\t\t\t[4164, 4165, 4166],\r\n\t\t\t[4167, 4168, 4169],\r\n\t\t\t[4170, 4171, 4172],\r\n\t\t\t[4173, 4174, 4175],\r\n\t\t\t[4176, 4177, 4178],\r\n\t\t\t[4179, 4180, 4181],\r\n\t\t\t[4182, 4183, 4184],\r\n\t\t\t[4185, 4186, 4187],\r\n\t\t\t[4188, 4189, 4190],\r\n\t\t\t[4191, 4192, 4193],\r\n\t\t\t[4194, 4195, 4196],\r\n\t\t\t[4197, 4198, 4199],\r\n\t\t\t[4200, 4201, 4202],\r\n\t\t\t[4203, 4204, 4205],\r\n\t\t\t[4206, 4207, 4208],\r\n\t\t\t[4209, 4210, 4211],\r\n\t\t\t[4212, 4213, 4214],\r\n\t\t\t[4215, 4216, 4217],\r\n\t\t\t[4218, 4219, 4220],\r\n\t\t\t[4221, 4222, 4223],\r\n\t\t\t[4224, 4225, 4226],\r\n\t\t\t[4227, 4228, 4229],\r\n\t\t\t[4230, 4231, 4232],\r\n\t\t\t[4233, 4234, 4235],\r\n\t\t\t[4236, 4237, 4238],\r\n\t\t\t[4239, 4240, 4241],\r\n\t\t\t[4242, 4243, 4244],\r\n\t\t\t[4245, 4246, 4247],\r\n\t\t\t[4248, 4249, 4250],\r\n\t\t\t[4251, 4252, 4253],\r\n\t\t\t[4254, 4255, 4256],\r\n\t\t\t[4257, 4258, 4259],\r\n\t\t\t[4260, 4261, 4262],\r\n\t\t\t[4263, 4264, 4265],\r\n\t\t\t[4266, 4267, 4268],\r\n\t\t\t[4269, 4270, 4271],\r\n\t\t\t[4272, 4273, 4274],\r\n\t\t\t[4275, 4276, 4277],\r\n\t\t\t[4278, 4279, 4280],\r\n\t\t\t[4281, 4282, 4283],\r\n\t\t\t[4284, 4285, 4286],\r\n\t\t\t[4287, 4288, 4289],\r\n\t\t\t[4290, 4291, 4292],\r\n\t\t\t[4293, 4294, 4295],\r\n\t\t\t[4296, 4297, 4298],\r\n\t\t\t[4299, 4300, 4301],\r\n\t\t\t[4302, 4303, 4304],\r\n\t\t\t[4305, 4306, 4307],\r\n\t\t\t[4308, 4309, 4310],\r\n\t\t\t[4311, 4312, 4313],\r\n\t\t\t[4314, 4315, 4316],\r\n\t\t\t[4317, 4318, 4319],\r\n\t\t\t[4320, 4321, 4322],\r\n\t\t\t[4323, 4324, 4325],\r\n\t\t\t[4326, 4327, 4328],\r\n\t\t\t[4329, 4330, 4331],\r\n\t\t\t[4332, 4333, 4334],\r\n\t\t\t[4335, 4336, 4337],\r\n\t\t\t[4338, 4339, 4340],\r\n\t\t\t[4341, 4342, 4343],\r\n\t\t\t[4344, 4345, 4346],\r\n\t\t\t[4347, 4348, 4349],\r\n\t\t\t[4350, 4351, 4352],\r\n\t\t\t[4353, 4354, 4355],\r\n\t\t\t[4356, 4357, 4358],\r\n\t\t\t[4359, 4360, 4361],\r\n\t\t\t[4362, 4363, 4364],\r\n\t\t\t[4365, 4366, 4367],\r\n\t\t\t[4368, 4369, 4370],\r\n\t\t\t[4371, 4372, 4373],\r\n\t\t\t[4374, 4375, 4376],\r\n\t\t\t[4377, 4378, 4379],\r\n\t\t\t[4380, 4381, 4382],\r\n\t\t\t[4383, 4384, 4385],\r\n\t\t\t[4386, 4387, 4388],\r\n\t\t\t[4389, 4390, 4391],\r\n\t\t\t[4392, 4393, 4394],\r\n\t\t\t[4395, 4396, 4397],\r\n\t\t\t[4398, 4399, 4400],\r\n\t\t\t[4401, 4402, 4403],\r\n\t\t\t[4404, 4405, 4406],\r\n\t\t\t[4407, 4408, 4409],\r\n\t\t\t[4410, 4411, 4412],\r\n\t\t\t[4413, 4414, 4415],\r\n\t\t\t[4416, 4417, 4418],\r\n\t\t\t[4419, 4420, 4421],\r\n\t\t\t[4422, 4423, 4424],\r\n\t\t\t[4425, 4426, 4427],\r\n\t\t\t[4428, 4429, 4430],\r\n\t\t\t[4431, 4432, 4433],\r\n\t\t\t[4434, 4435, 4436],\r\n\t\t\t[4437, 4438, 4439],\r\n\t\t\t[4440, 4441, 4442],\r\n\t\t\t[4443, 4444, 4445],\r\n\t\t\t[4446, 4447, 4448],\r\n\t\t\t[4449, 4450, 4451],\r\n\t\t\t[4452, 4453, 4454],\r\n\t\t\t[4455, 4456, 4457],\r\n\t\t\t[4458, 4459, 4460],\r\n\t\t\t[4461, 4462, 4463],\r\n\t\t\t[4464, 4465, 4466],\r\n\t\t\t[4467, 4468, 4469],\r\n\t\t\t[4470, 4471, 4472],\r\n\t\t\t[4473, 4474, 4475],\r\n\t\t\t[4476, 4477, 4478],\r\n\t\t\t[4479, 4480, 4481],\r\n\t\t\t[4482, 4483, 4484],\r\n\t\t\t[4485, 4486, 4487],\r\n\t\t\t[4488, 4489, 4490],\r\n\t\t\t[4491, 4492, 4493],\r\n\t\t\t[4494, 4495, 4496],\r\n\t\t\t[4497, 4498, 4499],\r\n\t\t\t[4500, 4501, 4502],\r\n\t\t\t[4503, 4504, 4505],\r\n\t\t\t[4506, 4507, 4508],\r\n\t\t\t[4509, 4510, 4511],\r\n\t\t\t[4512, 4513, 4514],\r\n\t\t\t[4515, 4516, 4517],\r\n\t\t\t[4518, 4519, 4520],\r\n\t\t\t[4521, 4522, 4523],\r\n\t\t\t[4524, 4525, 4526],\r\n\t\t\t[4527, 4528, 4529],\r\n\t\t\t[4530, 4531, 4532],\r\n\t\t\t[4533, 4534, 4535],\r\n\t\t\t[4536, 4537, 4538],\r\n\t\t\t[4539, 4540, 4541],\r\n\t\t\t[4542, 4543, 4544],\r\n\t\t\t[4545, 4546, 4547],\r\n\t\t\t[4548, 4549, 4550],\r\n\t\t\t[4551, 4552, 4553],\r\n\t\t\t[4554, 4555, 4556],\r\n\t\t\t[4557, 4558, 4559],\r\n\t\t\t[4560, 4561, 4562],\r\n\t\t\t[4563, 4564, 4565],\r\n\t\t\t[4566, 4567, 4568],\r\n\t\t\t[4569, 4570, 4571],\r\n\t\t\t[4572, 4573, 4574],\r\n\t\t\t[4575, 4576, 4577],\r\n\t\t\t[4578, 4579, 4580],\r\n\t\t\t[4581, 4582, 4583],\r\n\t\t\t[4584, 4585, 4586],\r\n\t\t\t[4587, 4588, 4589],\r\n\t\t\t[4590, 4591, 4592],\r\n\t\t\t[4593, 4594, 4595],\r\n\t\t\t[4596, 4597, 4598],\r\n\t\t\t[4599, 4600, 4601],\r\n\t\t\t[4602, 4603, 4604],\r\n\t\t\t[4605, 4606, 4607],\r\n\t\t\t[4608, 4609, 4610],\r\n\t\t\t[4611, 4612, 4613],\r\n\t\t\t[4614, 4615, 4616],\r\n\t\t\t[4617, 4618, 4619],\r\n\t\t\t[4620, 4621, 4622],\r\n\t\t\t[4623, 4624, 4625],\r\n\t\t\t[4626, 4627, 4628],\r\n\t\t\t[4629, 4630, 4631],\r\n\t\t\t[4632, 4633, 4634],\r\n\t\t\t[4635, 4636, 4637],\r\n\t\t\t[4638, 4639, 4640],\r\n\t\t\t[4641, 4642, 4643],\r\n\t\t\t[4644, 4645, 4646],\r\n\t\t\t[4647, 4648, 4649],\r\n\t\t\t[4650, 4651, 4652],\r\n\t\t\t[4653, 4654, 4655],\r\n\t\t\t[4656, 4657, 4658],\r\n\t\t\t[4659, 4660, 4661],\r\n\t\t\t[4662, 4663, 4664],\r\n\t\t\t[4665, 4666, 4667],\r\n\t\t\t[4668, 4669, 4670],\r\n\t\t\t[4671, 4672, 4673],\r\n\t\t\t[4674, 4675, 4676],\r\n\t\t\t[4677, 4678, 4679],\r\n\t\t\t[4680, 4681, 4682],\r\n\t\t\t[4683, 4684, 4685],\r\n\t\t\t[4686, 4687, 4688],\r\n\t\t\t[4689, 4690, 4691],\r\n\t\t\t[4692, 4693, 4694],\r\n\t\t\t[4695, 4696, 4697],\r\n\t\t\t[4698, 4699, 4700],\r\n\t\t\t[4701, 4702, 4703],\r\n\t\t\t[4704, 4705, 4706],\r\n\t\t\t[4707, 4708, 4709],\r\n\t\t\t[4710, 4711, 4712],\r\n\t\t\t[4713, 4714, 4715],\r\n\t\t\t[4716, 4717, 4718],\r\n\t\t\t[4719, 4720, 4721],\r\n\t\t\t[4722, 4723, 4724],\r\n\t\t\t[4725, 4726, 4727],\r\n\t\t\t[4728, 4729, 4730],\r\n\t\t\t[4731, 4732, 4733],\r\n\t\t\t[4734, 4735, 4736],\r\n\t\t\t[4737, 4738, 4739],\r\n\t\t\t[4740, 4741, 4742],\r\n\t\t\t[4743, 4744, 4745],\r\n\t\t\t[4746, 4747, 4748],\r\n\t\t\t[4749, 4750, 4751],\r\n\t\t\t[4752, 4753, 4754],\r\n\t\t\t[4755, 4756, 4757],\r\n\t\t\t[4758, 4759, 4760],\r\n\t\t\t[4761, 4762, 4763],\r\n\t\t\t[4764, 4765, 4766],\r\n\t\t\t[4767, 4768, 4769],\r\n\t\t\t[4770, 4771, 4772],\r\n\t\t\t[4773, 4774, 4775],\r\n\t\t\t[4776, 4777, 4778],\r\n\t\t\t[4779, 4780, 4781],\r\n\t\t\t[4782, 4783, 4784],\r\n\t\t\t[4785, 4786, 4787],\r\n\t\t\t[4788, 4789, 4790],\r\n\t\t\t[4791, 4792, 4793],\r\n\t\t\t[4794, 4795, 4796],\r\n\t\t\t[4797, 4798, 4799],\r\n\t\t\t[4800, 4801, 4802],\r\n\t\t\t[4803, 4804, 4805],\r\n\t\t\t[4806, 4807, 4808],\r\n\t\t\t[4809, 4810, 4811],\r\n\t\t\t[4812, 4813, 4814],\r\n\t\t\t[4815, 4816, 4817],\r\n\t\t\t[4818, 4819, 4820],\r\n\t\t\t[4821, 4822, 4823],\r\n\t\t\t[4824, 4825, 4826],\r\n\t\t\t[4827, 4828, 4829],\r\n\t\t\t[4830, 4831, 4832],\r\n\t\t\t[4833, 4834, 4835],\r\n\t\t\t[4836, 4837, 4838],\r\n\t\t\t[4839, 4840, 4841],\r\n\t\t\t[4842, 4843, 4844],\r\n\t\t\t[4845, 4846, 4847],\r\n\t\t\t[4848, 4849, 4850],\r\n\t\t\t[4851, 4852, 4853],\r\n\t\t\t[4854, 4855, 4856],\r\n\t\t\t[4857, 4858, 4859],\r\n\t\t\t[4860, 4861, 4862],\r\n\t\t\t[4863, 4864, 4865],\r\n\t\t\t[4866, 4867, 4868],\r\n\t\t\t[4869, 4870, 4871],\r\n\t\t\t[4872, 4873, 4874],\r\n\t\t\t[4875, 4876, 4877],\r\n\t\t\t[4878, 4879, 4880],\r\n\t\t\t[4881, 4882, 4883],\r\n\t\t\t[4884, 4885, 4886],\r\n\t\t\t[4887, 4888, 4889],\r\n\t\t\t[4890, 4891, 4892],\r\n\t\t\t[4893, 4894, 4895],\r\n\t\t\t[4896, 4897, 4898],\r\n\t\t\t[4899, 4900, 4901],\r\n\t\t\t[4902, 4903, 4904],\r\n\t\t\t[4905, 4906, 4907],\r\n\t\t\t[4908, 4909, 4910],\r\n\t\t\t[4911, 4912, 4913],\r\n\t\t\t[4914, 4915, 4916],\r\n\t\t\t[4917, 4918, 4919],\r\n\t\t\t[4920, 4921, 4922],\r\n\t\t\t[4923, 4924, 4925],\r\n\t\t\t[4926, 4927, 4928],\r\n\t\t\t[4929, 4930, 4931],\r\n\t\t\t[4932, 4933, 4934],\r\n\t\t\t[4935, 4936, 4937],\r\n\t\t\t[4938, 4939, 4940],\r\n\t\t\t[4941, 4942, 4943],\r\n\t\t\t[4944, 4945, 4946],\r\n\t\t\t[4947, 4948, 4949],\r\n\t\t\t[4950, 4951, 4952],\r\n\t\t\t[4953, 4954, 4955],\r\n\t\t\t[4956, 4957, 4958],\r\n\t\t\t[4959, 4960, 4961],\r\n\t\t\t[4962, 4963, 4964],\r\n\t\t\t[4965, 4966, 4967],\r\n\t\t\t[4968, 4969, 4970],\r\n\t\t\t[4971, 4972, 4973],\r\n\t\t\t[4974, 4975, 4976],\r\n\t\t\t[4977, 4978, 4979],\r\n\t\t\t[4980, 4981, 4982],\r\n\t\t\t[4983, 4984, 4985],\r\n\t\t\t[4986, 4987, 4988],\r\n\t\t\t[4989, 4990, 4991],\r\n\t\t\t[4992, 4993, 4994],\r\n\t\t\t[4995, 4996, 4997],\r\n\t\t\t[4998, 4999, 5000],\r\n\t\t\t[5001, 5002, 5003],\r\n\t\t\t[5004, 5005, 5006],\r\n\t\t\t[5007, 5008, 5009],\r\n\t\t\t[5010, 5011, 5012],\r\n\t\t\t[5013, 5014, 5015],\r\n\t\t\t[5016, 5017, 5018],\r\n\t\t\t[5019, 5020, 5021],\r\n\t\t\t[5022, 5023, 5024],\r\n\t\t\t[5025, 5026, 5027],\r\n\t\t\t[5028, 5029, 5030],\r\n\t\t\t[5031, 5032, 5033],\r\n\t\t\t[5034, 5035, 5036],\r\n\t\t\t[5037, 5038, 5039],\r\n\t\t\t[5040, 5041, 5042],\r\n\t\t\t[5043, 5044, 5045],\r\n\t\t\t[5046, 5047, 5048],\r\n\t\t\t[5049, 5050, 5051],\r\n\t\t\t[5052, 5053, 5054],\r\n\t\t\t[5055, 5056, 5057],\r\n\t\t\t[5058, 5059, 5060],\r\n\t\t\t[5061, 5062, 5063],\r\n\t\t\t[5064, 5065, 5066],\r\n\t\t\t[5067, 5068, 5069],\r\n\t\t\t[5070, 5071, 5072],\r\n\t\t\t[5073, 5074, 5075],\r\n\t\t\t[5076, 5077, 5078],\r\n\t\t\t[5079, 5080, 5081],\r\n\t\t\t[5082, 5083, 5084],\r\n\t\t\t[5085, 5086, 5087],\r\n\t\t\t[5088, 5089, 5090],\r\n\t\t\t[5091, 5092, 5093],\r\n\t\t\t[5094, 5095, 5096],\r\n\t\t\t[5097, 5098, 5099],\r\n\t\t\t[5100, 5101, 5102],\r\n\t\t\t[5103, 5104, 5105],\r\n\t\t\t[5106, 5107, 5108],\r\n\t\t\t[5109, 5110, 5111],\r\n\t\t\t[5112, 5113, 5114],\r\n\t\t\t[5115, 5116, 5117],\r\n\t\t\t[5118, 5119, 5120],\r\n\t\t\t[5121, 5122, 5123],\r\n\t\t\t[5124, 5125, 5126],\r\n\t\t\t[5127, 5128, 5129],\r\n\t\t\t[5130, 5131, 5132],\r\n\t\t\t[5133, 5134, 5135],\r\n\t\t\t[5136, 5137, 5138],\r\n\t\t\t[5139, 5140, 5141],\r\n\t\t\t[5142, 5143, 5144],\r\n\t\t\t[5145, 5146, 5147],\r\n\t\t\t[5148, 5149, 5150],\r\n\t\t\t[5151, 5152, 5153],\r\n\t\t\t[5154, 5155, 5156],\r\n\t\t\t[5157, 5158, 5159],\r\n\t\t\t[5160, 5161, 5162],\r\n\t\t\t[5163, 5164, 5165],\r\n\t\t\t[5166, 5167, 5168],\r\n\t\t\t[5169, 5170, 5171],\r\n\t\t\t[5172, 5173, 5174],\r\n\t\t\t[5175, 5176, 5177],\r\n\t\t\t[5178, 5179, 5180],\r\n\t\t\t[5181, 5182, 5183],\r\n\t\t\t[5184, 5185, 5186],\r\n\t\t\t[5187, 5188, 5189],\r\n\t\t\t[5190, 5191, 5192],\r\n\t\t\t[5193, 5194, 5195],\r\n\t\t\t[5196, 5197, 5198],\r\n\t\t\t[5199, 5200, 5201],\r\n\t\t\t[5202, 5203, 5204],\r\n\t\t\t[5205, 5206, 5207],\r\n\t\t\t[5208, 5209, 5210],\r\n\t\t\t[5211, 5212, 5213],\r\n\t\t\t[5214, 5215, 5216],\r\n\t\t\t[5217, 5218, 5219],\r\n\t\t\t[5220, 5221, 5222],\r\n\t\t\t[5223, 5224, 5225],\r\n\t\t\t[5226, 5227, 5228],\r\n\t\t\t[5229, 5230, 5231],\r\n\t\t\t[5232, 5233, 5234],\r\n\t\t\t[5235, 5236, 5237],\r\n\t\t\t[5238, 5239, 5240],\r\n\t\t\t[5241, 5242, 5243],\r\n\t\t\t[5244, 5245, 5246],\r\n\t\t\t[5247, 5248, 5249],\r\n\t\t\t[5250, 5251, 5252],\r\n\t\t\t[5253, 5254, 5255],\r\n\t\t\t[5256, 5257, 5258],\r\n\t\t\t[5259, 5260, 5261],\r\n\t\t\t[5262, 5263, 5264],\r\n\t\t\t[5265, 5266, 5267],\r\n\t\t\t[5268, 5269, 5270],\r\n\t\t\t[5271, 5272, 5273],\r\n\t\t\t[5274, 5275, 5276],\r\n\t\t\t[5277, 5278, 5279]\r\n\t\t]\r\n\t);\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/src\/main\/openscad\/office\/keyboard\/keycaps\/cherry-mx\/letter-key-test.scad-CUSTOMIZER.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4756e31149d0b437febb0858392ab1094a52d40d","subject":"Updating lasercut.scad - adding twisted to gernerating file","message":"Updating lasercut.scad - adding twisted to gernerating file\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"23999994f3bc4f125b5227f7e4e01b6861e71c53","subject":"cable guide support element","message":"cable guide support element\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"anycubic_chiron\/cable_guide_support\/cable_guide_support.scad","new_file":"anycubic_chiron\/cable_guide_support\/cable_guide_support.scad","new_contents":"eps=0.01;\nh=30;\n\ndifference()\n{\n cube([10+47, 10+20.6+10+35, h]);\n \/\/ profile cut-in\n translate([10, 10, -eps])\n cube([47+eps, 20.6+eps, h+2*eps]);\n \/\/ top cut-in\n translate([10, 10+20.6+10, -eps])\n cube([47+eps, 35+eps, h+2*eps]);\n \/\/ cable guide screws\n for(dz=[2.5, 10.4])\n translate([-eps, 10+20.6+10+35 - 19\/2, dz+1.5])\n rotate([0, 90, 0])\n #cylinder(r=3.5\/2, h=10+2*eps, $fn=50);\n \/\/ tightening screws\n for(dz=[10\/2, h-10\/2])\n translate([10+47 - 7\/2, -eps, dz])\n rotate([-90, 0, 0])\n cylinder(r=3.5\/2, h=10+20.8+10+2*eps, $fn=50);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'anycubic_chiron\/cable_guide_support\/cable_guide_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"495b62135de76f983c92f6112a86736e81c4b1e3","subject":"Corn gets a tail","message":"Corn gets a tail\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"b9e1ecb6d9cf94d2725dafd696211cecb542bdde","subject":"Tweak hardboard thickness\/tolerance; tweak mask opening\/design; add finger hole to tank support acrylic.","message":"Tweak hardboard thickness\/tolerance; tweak mask opening\/design; add finger hole to tank support acrylic.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.2;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.2mm for just a smidge more...\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 180 + thickness; \/\/ z = 18cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Grey\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n translate([0,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n\/*\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n*\/\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\n\/\/ [Currently unused -- 2016-02-26]\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 180 + thickness; \/\/ z = 18cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 29;\nview_opening_height = 90;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=0, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness;\n width2 = mask_loc - thickness;\n color(\"Grey\", alpha=0.5)\n union() {\n translate([0,-outset,height-thickness])\n difference() {\n translate([mask_loc+thickness\/2,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"975da5931f761f8f6da3f63749cd2901884fe82e","subject":"belt_fastener: increase\/fix belt path cuts","message":"belt_fastener: increase\/fix belt path cuts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"belt_fastener.scad","new_file":"belt_fastener.scad","new_contents":"include ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\nuse \nuse \n\n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=U, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*Y)\n translate(-1*11*mm*X)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n\n translate(-1*11*mm*X)\n nut_trap_cut(nut=tension_screw_nut, screw_offset=3*mm, cut_screw=true, orient=-X, trap_axis=Y);\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extrasize=[0,1000,1*mm], extrasize_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extrasize=1000*Y, extrasize_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","old_contents":"include ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\ninclude ;\nuse \nuse \n\n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=U, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*Y)\n translate(-1*11*mm*X)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n\n translate(-1*11*mm*X)\n nut_trap_cut(nut=tension_screw_nut, screw_offset=3*mm, cut_screw=true, orient=-X, trap_axis=Y);\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2]);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"39a93351948b3886bf52651fc2a7f126a946996b","subject":"Added files via upload","message":"Added files via upload","repos":"pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey","old_file":"hardware\/power.scad","new_file":"hardware\/power.scad","new_contents":"Zdim = 45;\nXdim = 60;\nYdim = 67;\nthickness = 2;\nsupportDiam = 5;\nbuttonDiam = 16;\nXT60X = 15.54;\nXT60Y = 8.16 + 0.5;\nXT60Z = 16.10 + 0.5;\n\ntextHV = \"HVDC\";\ntextLV = \"5V\";\n$fn=80;\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n\n }\n }\n\n\n\nmodule support(shape, D1, H1, D1H, D2, H2, D2H, offsetval, tolerance) {\n difference() {\n union() {\n\n if (shape == \"square\") {\n \/\/ translate([0,0,H1\/2])\n cube([D1, D1, H1], center = true);\n translate([offsetval, 0, (H2 \/ 2 + (H2 + H1) \/ 3)]) cube([D2, D2, H2], center = true);\n\n } else {\n cylinder(r = (D1 \/ 2), h = H1, center = false);\n translate([offsetval, 0, H1]) cylinder(r = (D2 \/ 2), h = H2, center = false);\n }\n\n if (offsetval != 0) {\n translate([0, 0, H1 - (H1 + H2) \/ 6])\n hull() { \/\/Connecition\n if (shape == \"square\") {\n translate([0, 0, (H1 + H2) \/ 9]) cube([D1, D1, (H1 + H2) \/ 3], center = true);\n translate([offsetval, 0, (H1 + H2) \/ 9]) cube([D2, D2, (H1 + H2) \/ 3], center = true);\n\n } else {\n cylinder(r = (D1 \/ 2), h = (H1 + H2) \/ 3, center = false);\n translate([offsetval, 0, 0]) cylinder(r = D2 \/ 2, h = (H1 + H2) \/ 3, center = false);\n }\n }\n }\n }\n \/\/Holes\n cylinder(r = D1H \/ 2 + tolerance, h = 3 * H1, center = false);\n translate([offsetval, 0, H1 - (H1 + H2) \/ 2]) cylinder(r = D2H \/ 2 + tolerance, h = 3 * H2, center = false);\n }\n\n}\n\n\nmodule SUB_pillars() {\n translate([-Xdim \/ 2 + supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([(Xdim \/ 2 - supportDiam \/ 2), (Ydim \/ 2 - supportDiam \/ 2), 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([Xdim \/ 2 - supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([-Xdim \/ 2 + supportDiam \/ 2, Ydim \/ 2 - supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n}\n\nmodule SUB_regulatorSupport() {\n translate([0, 0, 0]) support(\"round\", supportDiam, 8, 2, 0, 0, 0, 0, 0.2);\n translate([16, 33, 0]) support(\"round\", supportDiam, 8, 2, 0, 0, 0, 0, 0.2);\n\n\n}\n\nmodule powerPlant() {\n difference() {\n box(Xdim, Ydim, Zdim, thickness, \"box\");\n \/\/Button Holes\n translate([Xdim \/ 4, Ydim \/ 2, -buttonDiam\/2-3]) rotate([90, 0, 0]) {\n\n cylinder(r = buttonDiam \/ 2, h = 10, center = true);\n translate([0, buttonDiam + 5, 0]) cylinder(r = buttonDiam \/ 2, h = 10, center = true);\n }\n }\n SUB_pillars();\n\n\n translate([-Xdim \/ 3, -Ydim \/ 5+2, -Zdim \/ 2]) SUB_regulatorSupport();\n\n \/\/XT60 holder\n translate([0, -Ydim \/ 2 + XT60Y \/ 2, 0]) box(XT60X, XT60Y, Zdim, thickness, \"servo\");\n\n\n}\n\nmodule labelVoltage(textL) {\n\n translate([0, 0, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(textL, font = \"Liberation Sans\", size = 4);\n translate([4, 3, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(\"+\", font = \"Liberation Sans\", size = 2);\n translate([0, 3, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(\"-\", font = \"Liberation Sans\", size = 2);\n}\n\nmodule topLid() {\n\n translate([0, 0, 0])\n difference() {\n cube([Xdim + thickness, Ydim + thickness, thickness \/ 2], center = true);\n SUB_lidHoles(0.5);\n }\n translate([-Xdim \/ 4, -Ydim \/ 4, 0]) labelVoltage(textHV);\n translate([-Xdim \/ 4 - 12, -Ydim \/ 4, 0]) labelVoltage(textLV);\n\n}\n\n\nmodule SUB_lidHoles(T) {\n translate([-Xdim \/ 2 + supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, -5]) cylinder(r = (2.5 + T) \/ 2, h = 10);\n translate([(Xdim \/ 2 - supportDiam \/ 2), (Ydim \/ 2 - supportDiam \/ 2), -5]) cylinder(r = (2.5 + T) \/ 2, h = 10);\n translate([Xdim \/ 2 - supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, -5]) cylinder(r = (2.5 + T) \/ 2, h = 10);\n translate([-Xdim \/ 2 + supportDiam \/ 2, Ydim \/ 2 - supportDiam \/ 2, -5]) cylinder(r = (2.5 + T) \/ 2, h = 10);\n\n \/\/Holes to power the lines, need to check the geomety. For now visually adjusted\n translate([-Xdim \/ 4 + 3, -Ydim \/ 6, -5]) cylinder(r = 4 \/ 2, h = 10);\n translate([-Xdim \/ 4 - 9, -Ydim \/ 6, -5]) cylinder(r = 4 \/ 2, h = 10);\n\n\n \/\/XT60 hole\n translate([0, -Ydim \/ 2 + XT60Y \/ 2, 0]) cube([1 * XT60X, 1 * XT60Y, Zdim], center = true);\n\n}\n\npowerPlant();\n\n\/\/translate([0, 0, 0]) topLid();\n","old_contents":"Zdim = 40;\nXdim = 60;\nYdim = 67;\nthickness = 2;\nsupportDiam = 5;\nbuttonDiam = 16;\nXT60X = 15.54;\nXT60Y = 8.16;\nXT60Z = 16.10;\n\ntextHV = \"HVDC\";\ntextLV = \"5V\";\n$fn=80;\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n\n }\n }\n\n\n\nmodule support(shape, D1, H1, D1H, D2, H2, D2H, offsetval, tolerance) {\n difference() {\n union() {\n\n if (shape == \"square\") {\n \/\/ translate([0,0,H1\/2])\n cube([D1, D1, H1], center = true);\n translate([offsetval, 0, (H2 \/ 2 + (H2 + H1) \/ 3)]) cube([D2, D2, H2], center = true);\n\n } else {\n cylinder(r = (D1 \/ 2), h = H1, center = false);\n translate([offsetval, 0, H1]) cylinder(r = (D2 \/ 2), h = H2, center = false);\n }\n\n if (offsetval != 0) {\n translate([0, 0, H1 - (H1 + H2) \/ 6])\n hull() { \/\/Connecition\n if (shape == \"square\") {\n translate([0, 0, (H1 + H2) \/ 9]) cube([D1, D1, (H1 + H2) \/ 3], center = true);\n translate([offsetval, 0, (H1 + H2) \/ 9]) cube([D2, D2, (H1 + H2) \/ 3], center = true);\n\n } else {\n cylinder(r = (D1 \/ 2), h = (H1 + H2) \/ 3, center = false);\n translate([offsetval, 0, 0]) cylinder(r = D2 \/ 2, h = (H1 + H2) \/ 3, center = false);\n }\n }\n }\n }\n \/\/Holes\n cylinder(r = D1H \/ 2 + tolerance, h = 3 * H1, center = false);\n translate([offsetval, 0, H1 - (H1 + H2) \/ 2]) cylinder(r = D2H \/ 2 + tolerance, h = 3 * H2, center = false);\n }\n\n}\n\n\nmodule SUB_pillars() {\n translate([-Xdim \/ 2 + supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([(Xdim \/ 2 - supportDiam \/ 2), (Ydim \/ 2 - supportDiam \/ 2), 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([Xdim \/ 2 - supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([-Xdim \/ 2 + supportDiam \/ 2, Ydim \/ 2 - supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n}\n\nmodule SUB_regulatorSupport() {\n translate([0, 0, 0]) support(\"round\", supportDiam, 8, 2, 0, 0, 0, 0, 0.2);\n translate([11, 33, 0]) support(\"round\", supportDiam, 8, 2, 0, 0, 0, 0, 0.2);\n\n\n}\n\nmodule powerPlant() {\n difference() {\n box(Xdim, Ydim, Zdim, thickness, \"box\");\n \/\/Button Holes\n translate([Xdim \/ 4, Ydim \/ 2, -buttonDiam \/ 2]) rotate([90, 0, 0]) {\n\n cylinder(r = buttonDiam \/ 2, h = 10, center = true);\n translate([0, buttonDiam + 3, 0]) cylinder(r = buttonDiam \/ 2, h = 10, center = true);\n }\n }\n SUB_pillars();\n\n\n translate([-Xdim \/ 4, -Ydim \/ 5, -Zdim \/ 2]) SUB_regulatorSupport();\n\n \/\/XT60 holder\n translate([0, -Ydim \/ 2 + XT60Y \/ 2, 0]) box(XT60X, XT60Y, Zdim, thickness, \"servo\");\n\n\n}\n\nmodule labelVoltage(textL) {\n\n translate([0, 0, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(textL, font = \"Liberation Sans\", size = 4);\n translate([4, 3, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(\"+\", font = \"Liberation Sans\", size = 2);\n translate([0, 3, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(\"-\", font = \"Liberation Sans\", size = 2);\n}\n\nmodule topLid() {\n\n translate([0, 0, 0])\n difference() {\n cube([Xdim + thickness, Ydim + thickness, thickness \/ 2], center = true);\n SUB_lidHoles();\n }\n translate([-Xdim \/ 4, -Ydim \/ 4, 0]) labelVoltage(textHV);\n translate([-Xdim \/ 4 - 12, -Ydim \/ 4, 0]) labelVoltage(textLV);\n\n}\n\n\nmodule SUB_lidHoles() {\n translate([-Xdim \/ 2 + supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, -5]) cylinder(r = 2.5 \/ 2, h = 10);\n translate([(Xdim \/ 2 - supportDiam \/ 2), (Ydim \/ 2 - supportDiam \/ 2), -5]) cylinder(r = 2.5 \/ 2, h = 10);\n translate([Xdim \/ 2 - supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, -5]) cylinder(r = 2.5 \/ 2, h = 10);\n translate([-Xdim \/ 2 + supportDiam \/ 2, Ydim \/ 2 - supportDiam \/ 2, -5]) cylinder(r = 2.5 \/ 2, h = 10);\n\n \/\/Holes to power the lines, need to check the geomety. Fro now visually adjuste\n translate([-Xdim \/ 4 + 3, -Ydim \/ 6, -5]) cylinder(r = 4 \/ 2, h = 10);\n translate([-Xdim \/ 4 - 9, -Ydim \/ 6, -5]) cylinder(r = 4 \/ 2, h = 10);\n\n\n \/\/XT60 hole\n translate([0, -Ydim \/ 2 + XT60Y \/ 2, 0]) cube([1 * XT60X, 1 * XT60Y, Zdim], center = true);\n\n}\n\npowerPlant();\n\n\/\/translate([0, 0, 0]) topLid();\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"58355f62fdb482146d2fbd9e3b5d72a316a395d7","subject":"Customizer parameters","message":"Customizer parameters\n","repos":"kintel\/OpenSCAD-models","old_file":"horn.scad","new_file":"horn.scad","new_contents":"INCHES = 25.4;\n\n\/\/ Number of colors\nNUMBER = 5; \/\/ [2:5]\n\n\/\/ Diameter of the base shape\nDIAMETER = 60; \/\/ [10:200]\n\n\/\/ Height of the object\nHEIGHT = 120; \/\/ [20:300]\n\n\/\/ Twist in degress\nTWIST = 180; \/\/ [0:720]\n\n\/\/ Relative displacement of base shapes\nDISTANCE = 0.7; \/\/ [0:1]\n\n\/\/ Scale of the tip relative to the base\nSCALE = 5\/8; \/\/ [0:2]\n\n\/\/ Should the object be hollow?\nHOLLOW = false; \/\/ [true, false]\n\n\/\/ If not hollow, What color should the inside have?\nINSIDE_COLOR = 1; \/\/ [0:5]\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST, scale=[SCALE, SCALE], convexity=3) child();\n}\n\nmodule basepart(item) {\n extrudepart() baseitem(item);\n translate([0,0,HEIGHT]) rotate([0,0,TWIST])\n scale(SCALE) rotate([0,0,item*360\/NUMBER])\n translate([DIAMETER\/2*DISTANCE,0]) \n sphere(DIAMETER\/2);\n}\n \nmodule part(item) {\n color(COLORS[item%NUM_COLORS]) {\n render() difference() {\n basepart(item);\n for (i=[0:NUMBER-1]) if (i!=item) basepart(i);\n }\n if (!HOLLOW && INSIDE_COLOR == item) inside();\n }\n}\n\nmodule inside() {\n extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n if (!HOLLOW) color(COLORS[INSIDE_COLOR]) inside();\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\n","old_contents":"INCHES = 25.4;\n\nNUMBER = 5;\nDIAMETER = 60;\nHEIGHT = 120;\nTWIST = 0.5;\nDISTANCE = 0.7;\nSCALE = 5\/8;\n\nHOLLOW = false;\nINSIDE_COLOR = 1;\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST*360, scale=[SCALE, SCALE], convexity=3) child();\n}\n\nmodule basepart(item) {\n extrudepart() baseitem(item);\n translate([0,0,HEIGHT]) rotate([0,0,TWIST*360])\n scale(SCALE) rotate([0,0,item*360\/NUMBER])\n translate([DIAMETER\/2*DISTANCE,0]) \n sphere(DIAMETER\/2);\n}\n \nmodule part(item) {\n color(COLORS[item%NUM_COLORS]) {\n render() difference() {\n basepart(item);\n for (i=[0:NUMBER-1]) if (i!=item) basepart(i);\n }\n if (!HOLLOW && INSIDE_COLOR == item) inside();\n }\n}\n\nmodule inside() {\n extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n if (!HOLLOW) color(COLORS[INSIDE_COLOR]) inside();\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"be0e096d911b4284e0240dcfbefa54a9d5be69f5","subject":"Setup for 1\/4\" thickness, fix two issues exposed by thicker material setting.","message":"Setup for 1\/4\" thickness, fix two issues exposed by thicker material setting.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\ni_height = 180; \/\/ z (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*3;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\ni_height = 180; \/\/ z (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness*2, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness*2, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f884865ad39d8ca99047c75fef1ae9df61f849bc","subject":"dimension update","message":"dimension update\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/Multirotors,DanNixon\/BubbleCopter","old_file":"Komachi\/config.scad","new_file":"Komachi\/config.scad","new_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0; \/\/For the JAS laser at Maker Space\n\/* MACHINE_TOLERANCE = 0.1; \/\/For most other lasers *\/\n\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* General *\/\nCORNER = 1;\nHALF_CORNER = CORNER \/ 2;\nSPACER_TAB_WIDTH_FACTOR = 0.35;\n\n\/* Base plate *\/\nBASE_DIMENSIONS = [180, 240];\nBASE_FRONT_CORNER_RADIUS = BASE_DIMENSIONS[0] \/ 2;\nBASE_REAR_CORNER_RADIUS = 30;\n\n\/* Lift fan duct mount *\/\nLIFT_FAN_DUCT_DIMENSIONS = [71, 28]; \/\/ [diameter, length]\nLIFT_FAN_DUCT_MOUNT_PADDING = 30;\nLIFT_FAN_DUCT_POSITION = [0, (BASE_DIMENSIONS[1] \/ 2) - LIFT_FAN_DUCT_DIMENSIONS[0]];\nLIFT_FAN_DUCT_MOUNT_SPACING = 18;\nLIFT_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\n\n\/* Thrust fan duct mount *\/\nTHRUST_FAN_DUCT_DIMENSIONS = [70, 48]; \/\/ [diameter, length]\nTHRUST_FAN_DUCT_HEIGHT = 60;\nTHRUST_FAN_DUCT_MOUNT_PADDING = 30;\nTHRUST_FAN_DUCT_MOUNT_POSITION = [0, -40];\nTHRUST_FAN_DUCT_MOUNT_SPACING = THRUST_FAN_DUCT_DIMENSIONS[1] - 8;\nTHRUST_FAN_DUCT_MOUNT_WIDTH = BASE_DIMENSIONS[0] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\nTHRUST_FAN_DUCT_MOUNT_TAB_POSITIONS = [-THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4, 0, THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4];\nTHRUST_FAN_DUCT_MOUNT_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_DIM = [25, THRUST_FAN_DUCT_HEIGHT * 0.95];\nTHRUST_FAN_DUCT_MOUNT_BRACE_SPACING = THRUST_FAN_DUCT_MOUNT_WIDTH * 0.7;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[1] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_WIDTH = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.75;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.5;\n\n\/* Rudder *\/\nRUDDER_DIMENSIONS = [20, THRUST_FAN_DUCT_DIMENSIONS[0] * 0.9];\nRUDDER_CORNER_RADIUS = 2;\nRUDDER_PIVOT_LENGTH = 5;\nRUDDER_SPACING = THRUST_FAN_DUCT_DIMENSIONS[0] * 0.45;\nRUDDER_ARM_HOLE_POSITION = [RUDDER_DIMENSIONS[0] * 0.4, -RUDDER_DIMENSIONS[1] * 0.45];\nRUDDER_ARM_HOLE_DIAM = 2;\n\n\/* Rudder mount *\/\nRUDDER_MOUNT_DIMENSIONS = [THRUST_FAN_DUCT_DIMENSIONS[0] * 0.8, 10];\nRUDDER_MOUNT_CORNER_RADIUS = 5;\nRUDDER_MOUNT_OFFSET = (RUDDER_DIMENSIONS[1] \/ 2) + MATERIAL_THICKNESS;\nRUDDER_MOUNT_TAB_WIDTH = 5;\nRUDDER_MOUNT_TAB_OFFSET = (RUDDER_MOUNT_DIMENSIONS[0] - RUDDER_MOUNT_TAB_WIDTH) \/ 2;\n\n\/* Skirt clamp *\/\nSKIRT_CLAMP_PADDING = 10;\nSKIRT_CLAMP_HOLE_DIAM = 3;\n\n\/* Lower skirt mount *\/\nLOWER_SKIRT_MOUNT_SCALE = 0.6;\n","old_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0.1;\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* General *\/\nCORNER = 1;\nHALF_CORNER = CORNER \/ 2;\nSPACER_TAB_WIDTH_FACTOR = 0.35;\n\n\/* Base plate *\/\nBASE_DIMENSIONS = [180, 240];\nBASE_FRONT_CORNER_RADIUS = BASE_DIMENSIONS[0] \/ 2;\nBASE_REAR_CORNER_RADIUS = 30;\n\n\/* Lift fan duct mount *\/\nLIFT_FAN_DUCT_DIMENSIONS = [71, 59]; \/\/ [diameter, length]\nLIFT_FAN_DUCT_MOUNT_PADDING = 30;\nLIFT_FAN_DUCT_POSITION = [0, (BASE_DIMENSIONS[1] \/ 2) - LIFT_FAN_DUCT_DIMENSIONS[0]];\nLIFT_FAN_DUCT_MOUNT_SPACING = 30;\nLIFT_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\n\n\/* Thrust fan duct mount *\/\nTHRUST_FAN_DUCT_DIMENSIONS = [70, 61]; \/\/ [diameter, length]\nTHRUST_FAN_DUCT_HEIGHT = 60;\nTHRUST_FAN_DUCT_MOUNT_PADDING = 30;\nTHRUST_FAN_DUCT_MOUNT_POSITION = [0, -35];\nTHRUST_FAN_DUCT_MOUNT_SPACING = 40;\nTHRUST_FAN_DUCT_MOUNT_WIDTH = BASE_DIMENSIONS[0] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\nTHRUST_FAN_DUCT_MOUNT_TAB_POSITIONS = [-THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4, 0, THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4];\nTHRUST_FAN_DUCT_MOUNT_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_DIM = [25, THRUST_FAN_DUCT_HEIGHT * 0.95];\nTHRUST_FAN_DUCT_MOUNT_BRACE_SPACING = THRUST_FAN_DUCT_MOUNT_WIDTH * 0.7;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[1] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_WIDTH = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.75;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.5;\n\n\/* Rudder *\/\nRUDDER_DIMENSIONS = [20, THRUST_FAN_DUCT_DIMENSIONS[0] * 0.9];\nRUDDER_CORNER_RADIUS = 2;\nRUDDER_PIVOT_LENGTH = 5;\nRUDDER_SPACING = THRUST_FAN_DUCT_DIMENSIONS[0] * 0.45;\nRUDDER_ARM_HOLE_POSITION = [RUDDER_DIMENSIONS[0] * 0.4, -RUDDER_DIMENSIONS[1] * 0.45];\nRUDDER_ARM_HOLE_DIAM = 2;\n\n\/* Rudder mount *\/\nRUDDER_MOUNT_DIMENSIONS = [THRUST_FAN_DUCT_DIMENSIONS[0] * 0.8, 10];\nRUDDER_MOUNT_CORNER_RADIUS = 5;\nRUDDER_MOUNT_OFFSET = (RUDDER_DIMENSIONS[1] \/ 2) + MATERIAL_THICKNESS;\nRUDDER_MOUNT_TAB_WIDTH = 5;\nRUDDER_MOUNT_TAB_OFFSET = (RUDDER_MOUNT_DIMENSIONS[0] - RUDDER_MOUNT_TAB_WIDTH) \/ 2;\n\n\/* Skirt clamp *\/\nSKIRT_CLAMP_PADDING = 10;\nSKIRT_CLAMP_HOLE_DIAM = 3;\n\n\/* Lower skirt mount *\/\nLOWER_SKIRT_MOUNT_SCALE = 0.6;\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0e5884203ce1546bae68f514d73ee3c95da96e53","subject":"Allow assigning different materials to the window.","message":"Allow assigning different materials to the window.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials\nwindow_thickness = acrylic_thickness;\n\/\/window_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cbc2ed7f6adc3a0008ebc1b15507e274b6e2d917","subject":"main: fix x axis range","message":"main: fix x axis range\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - zaxis_rod_d\/2 - xaxis_end_width_right(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2-extruder_b_hotend_mount_offset.x);\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9d44586f79c35ef4af6d5638dd388ff36b8c06ff","subject":"rotated string for easier placement","message":"rotated string for easier placement\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"118a74b56a330b0dbf8f82d89ed0490873aa405f","subject":"Use ArduinoPro for module and variables prefix","message":"Use ArduinoPro for module and variables prefix","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ProMicro.scad","new_file":"hardware\/vitamins\/ProMicro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_Hole_Diam = 1.25; \/\/ hole diameter\nArduinoPro_Hole_Space = 2.54; \/\/ spacing of the holes\nArduinoPro_Hole_Inset = ArduinoPro_Hole_Space\/2; \/\/ Inset from board edge\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255];\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n height = 2.7;\n area = [7.7, 5.2];\n colour = [220\/255, 220\/255, 220\/255];\n move_x = ArduinoPro_PCB_Width\/2 - ArduinoPro_Hole_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space;\n move_z = ArduinoPro_PCB_Height;\n\n color(colour)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square(size = area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n circle(r = ArduinoPro_Hole_Diam\/2);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_Hole_Space : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_Hole_Inset : ArduinoPro_Hole_Space : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\nArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\n\/\/ Pro Micro\/Mini\nboard_colour = [26\/255, 90\/255, 160\/255];\nmetal_colour = [220\/255, 220\/255, 220\/255];\n\n\/\/ Show board clearance area for components\nboard_clearance = 3;\nshow_clearance = true;\n\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n micro_usb_area = [7.7, 5.2];\n micro_usb_height = 2.7;\n\n color(metal_colour)\n translate([pcbWidth\/2 - holeInset, pcbLength - holeSpace, pcbHeight])\n linear_extrude(height=2.7)\n square(size = micro_usb_area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(board_colour)\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (show_clearance)\n color(board_colour, 0.1)\n translate([-holeInset, -holeInset, pcbHeight])\n linear_extrude(height=board_clearance)\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3f40c75ea3c0c6bb69860ebc3ebdb42f113d3bb5","subject":"add parameters for customization","message":"add parameters for customization\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/cat\/cat.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/cat\/cat.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d7b31d711bc3990841a75487f83d4b01ae2ad114","subject":"Updated dumplings cutter to use Bezier curves","message":"Updated dumplings cutter to use Bezier curves\n","repos":"ksuszka\/3d-projects","old_file":"small\/dumplings_cutter.scad","new_file":"small\/dumplings_cutter.scad","new_contents":"draft = false;\n\nshow_intersection = false;\n\nform_r = 25;\nflange_width = 5;\nflange_height = 3;\nflange_notches_count = floor(form_r*1.1);\nflange_notch_r = 1.5;\ninner_r = form_r - flange_width;\nouter_r = form_r + 1;\nhandle_top = 50;\nhandle_bottom = 0.99;\nhandle_bottom_width = outer_r-inner_r;\nhandle_bottom_x = (outer_r+inner_r)\/2;\n\nhandle_control_points =[[handle_bottom_x,-1000,handle_bottom_width],\n [handle_bottom_x,0,handle_bottom_width],\n [handle_bottom_x-15,30,2],\n [handle_bottom_x-5,48,8]\n ];\n\n\n$fs = draft ? 2 : 0.2;\n$fa = draft ? 12 : 2 ;\nsteps_per_bezier = draft ? 10 : 40;\nrotate_extrude_steps = draft ? 60 : 360;\n\n\nmodule flange() {\n module flange_shell() {\n rotate_extrude() {\n polygon([\n [inner_r, 0],\n [inner_r, 1],\n [outer_r, 1],\n [outer_r, -flange_height\/2],\n [(form_r + outer_r)\/2, -flange_height],\n [form_r, -flange_height],\n [form_r, 0]\n ]);\n }\n }\n module flange_notches() {\n intersection() {\n for(i=[0:360\/flange_notches_count:359]) {\n rotate([0,0,i])\n translate([inner_r,0,0]) {\n intersection() {\n union() {\n translate([flange_notch_r,0,0])\n sphere(r=flange_notch_r);\n translate([flange_width\/2+flange_notch_r,0,0])\n rotate([0,90,0])\n cylinder(r=flange_notch_r,h=flange_width,center=true);\n }\n }\n }\n }\n translate([0,0,-4.5]) cylinder(r=form_r+0.1,h=10,center=true);\n }\n }\n flange_shell();\n flange_notches();\n}\n\nmodule handle_silhouette() {\n intersection() {\n Line2d(Curve(handle_control_points));\n translate([0,handle_bottom])\n scale([1000,handle_top-handle_bottom])\n translate([-0.5,0])\n square(1);\n }\n}\n\nmodule handle() {\n rotate_extrude() {\n handle_silhouette();\n }\n}\n\nmodule cutter() {\n handle();\n flange();\n}\n\nintersection() {\n cutter();\n if (show_intersection) cube([1000,1,1000],true);\n}\n\n\/\/--------------------------------------------------------------------------\n\/\/ Helpers\n\/\/--------------------------------------------------------------------------\n\n\/\/ Bezier functions taken from http:\/\/www.thingiverse.com\/thing:8443\/\nfunction BEZ03(u) = pow((1-u), 3);\nfunction BEZ13(u) = 3*u*(pow((1-u),2));\nfunction BEZ23(u) = 3*(pow(u,2))*(1-u);\nfunction BEZ33(u) = pow(u,3);\n\nfunction PointAlongBez4(p0, p1, p2, p3, u) = [\n\tBEZ03(u)*p0[0]+BEZ13(u)*p1[0]+BEZ23(u)*p2[0]+BEZ33(u)*p3[0],\n\tBEZ03(u)*p0[1]+BEZ13(u)*p1[1]+BEZ23(u)*p2[1]+BEZ33(u)*p3[1],\n\tBEZ03(u)*p0[2]+BEZ13(u)*p1[2]+BEZ23(u)*p2[2]+BEZ33(u)*p3[2],];\n\nfunction length(v) = sqrt(v*v);\n\nfunction Curve(points, steps=steps_per_bezier) = [\n for (i = [ 0 : len(points) - 2 ])\n let ( prev = points[i>0?i-1:i],\n p0 = points[i], \n p3 = points[i+1],\n next = points[i+2\nuse \n\n\/\/ required quantities. adjust according to your needs.\n\/\/ (note: you need two identical elements per functional part)\nfixes = 2;\nlimiters = 3;\n\n\/\/ ball-size\nr=(3+1)\/2;\n\nif(fixes)\n for(i = [0:2*fixes-1])\n translate([0, 10*i, 0])\n rollup_string_fix(r);\n\nif(limiters)\n for(i = [0:2*limiters-1])\n translate([20, 10*i, 0])\n rollup_string_limiter(r);\n","old_contents":"use \nuse \n\n\/\/ required quantities. adjust according to your needs.\n\/\/ (note: you need two identical elements per functional part)\nfixes = 2*2;\nlimiters = 3*2;\n\n\/\/ ball-size\nr=(3+1)\/2;\n\nif(fixes)\n for(i = [0:fixes])\n translate([0, 10*i, 0])\n rollup_string_fix(r);\n\nif(limiters)\n for(i = [0:limiters-1])\n translate([20, 10*i, 0])\n rollup_string_limiter(r);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2daa78599233857abd1ecdcc01b762bf01a8c067","subject":"fdm Insel","message":"fdm Insel\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"fdm_insel.scad","new_file":"fdm_insel.scad","new_contents":"\/\/FDM Insel\n\/\/Halter an Platte\nrRohr = 14;\nmodule plattenHalter() {\n difference() {\n linear_extrude(height=80, scale=0.2)square(150,center=true);\n cylinder(r=rRohr,h=101);\n tr_xy(x=64) {\n cylinder(r=2.5,h=25);\n translate([0,0,10])cylinder(r=7,h=25);\n }\n } \n}\n\/\/Verbidnungsst\u00fcck\nrRohr2=10;\nrRohr3=8;\nlength=100;\nwall=10;\ndistance=28;\nmodule verbindung() {\n translate([135\/2-25,105\/2-25])linear_extrude(height=5)platte();\n difference() {\n hull() {\n cube([2*rRohr+wall,2*rRohr+wall,length]);\n cube([2*rRohr2+wall,80,2*rRohr2+wall]);\n cube([110,2*rRohr3+wall,2*rRohr3+wall]);\n }\n translate([rRohr+wall\/2,rRohr+wall\/2],0)cylinder(h=length,r=rRohr);\n translate([rRohr2+wall\/2,distance,rRohr2+wall\/2])rotate([-90,0,0])cylinder(h=length,r=rRohr2);\n translate([distance,rRohr3+wall\/2,rRohr3+wall\/2])rotate([0,90,0])cylinder(h=length,r=rRohr3);\n \n }\n}\n\n\n*plattenHalter();\nverbindung();\n\n\/\/Helper Modules\nmodule platte() {\n difference() {\n square([135,105],center=true);\n tr_xy(x=105\/2,y=80\/2)circle(r=5);\n }\n}\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'fdm_insel.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"231c583d2205920e80d5cc8da77539cc3810d1f0","subject":"A different font is used.","message":"A different font is used.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/strings\/string-iteration.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/strings\/string-iteration.scad","new_contents":"\r\nfont = \"Bauhaus 93:style=Regular\";\r\nfont = \"Arial\";\r\n\r\nstrings = [[\"ABC\", \"1234\", \"QRS\"], [\"+-=\", \"foo\", \"bar\"]];\r\n\r\noneString = strings[0][1];\r\necho(oneString);\r\n\r\nendIndex = len(oneString) - 1;\r\nfor(i = [0 : endIndex])\r\n{\r\n element = oneString;\r\n \r\n \/\/ print a single character\r\n ch = element[i];\r\n echo(ch);\r\n \r\n translate([i*6, 0, 0])\r\n linear_extrude(height=4)\r\n text(ch, font=font, size=6);\r\n}\r\n","old_contents":"\r\nfont = \"Bauhaus 93:style=Regular\";\r\nstrings = [[\"ABC\", \"1234\", \"QRS\"], [\"+-=\", \"foo\", \"bar\"]];\r\n\r\noneString = strings[0][1];\r\necho(oneString);\r\n\r\nendIndex = len(oneString) - 1;\r\nfor(i = [0 : endIndex])\r\n{\r\n element = oneString;\r\n \r\n \/\/ print a single character\r\n ch = element[i];\r\n echo(ch);\r\n \r\n translate([i*6, 0, 0])\r\n linear_extrude(height=4)\r\n text(ch, font=font, size=6);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"218314fd9673bb84bffe93317d5eb261eb15f31a","subject":"model of all the elements","message":"model of all the elements\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"dry_box_filament_mounts\/dry_box_filament_mounts.scad","new_file":"dry_box_filament_mounts\/dry_box_filament_mounts.scad","new_contents":"eps=0.01;\n\nmodule external()\n{\n w = 48 + 2*5;\n l = 50;\n h = 3;\n r_hole = (3+0.5)\/2;\n spacing = 3+r_hole;\n difference()\n {\n cube([w, l, h]);\n for(dx=[spacing, w-spacing])\n for(dy=[spacing, l-spacing])\n translate([dx,dy,-eps])\n cylinder(r=r_hole, h=3+2*eps, $fn=60);\n }\n}\n\nmodule internal(blocker)\n{\n wall = 3;\n r_int = 42\/2;\n r_ext = r_int + wall;\n h = 25;\n\n external();\n\n translate([5, 0, 3])\n {\n \/\/ main holder round cut-in\n translate([48\/2, r_ext, 0])\n {\n difference()\n {\n cylinder(r=r_ext, h=h, $fn=180);\n cylinder(r=r_int, h=h+eps, $fn=180);\n translate([-eps-r_ext, 0, -eps])\n cube([2*(r_ext+eps), r_ext+eps, h+2*eps]);\n }\n }\n \/\/ side wall, to prevent rod from falling out\n for(dx=[0, 2*r_ext-wall])\n translate([dx, r_ext, 0])\n cube([wall, r_int*2\/3, h]);\n \/\/ element to prevent rod from rolling.\n if(blocker)\n translate([r_ext-wall\/2, wall, 0])\n cube([wall, 10, h*2\/3]);\n }\n}\n\nmodule repel_disc()\n{\n r_int=(40.5+0.8)\/2;\n difference()\n {\n union()\n {\n cylinder(r=100\/2, h=2, $fn=120);\n cylinder(r=r_int+3, h=2+5, $fn=30);\n }\n translate([0, 0, -eps])\n cylinder(r=r_int, h=2+5+2*eps, $fn=360);\n }\n}\n\n\nfor(set=[[true, 0], [false, 60]])\n translate([set[1], 0, 0])\n {\n internal(blocker=set[0]);\n translate([0, -53, 0])\n external();\n }\n\nfor(i=[0:1])\n translate([170-i*30, i*100, 0])\n repel_disc();","old_contents":"","returncode":1,"stderr":"error: pathspec 'dry_box_filament_mounts\/dry_box_filament_mounts.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"3695d5af7ddc8f7b7872fa7116b75c5c0c2c0271","subject":"slot added","message":"slot added\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library2d.scad","new_file":"library2d.scad","new_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\nmodule round_square(x,y=0,r=0) {\n if(y==0) {\n hull()tr_xy(x=x\/2-r)circle(r=r);\n } else {\n hull()tr_xy(x=x\/2-r,y=y\/2-r)circle(r=r);\n }\n}\nmodule slot(x,r,o) {\n hull()for(i=[-1,1])rotate(o)translate([x\/2*i,0])circle(r=r);\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Hollowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule honeycomb_drainholes(x=10,y=10,r=0.7,d=0.1,fn=6,o1=1,o2=1,ra=0.25) {\n for(k=[-1,1])for(l=[0:(2*(r+r*sin(30)-d))*o1:x]){\n for(i=[1,-1])for(j=[0:(2*r*cos(30)-d)*o2:y]) {\n translate([k*l,i*j])circle(r=ra);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])circle(r=ra);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\nmodule negativ_sq() {\n difference() {\n hull()children();\n children();\n }\n}","old_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\nmodule round_square(x,y=0,r=0) {\n if(y==0) {\n hull()tr_xy(x=x\/2-r)circle(r=r);\n } else {\n hull()tr_xy(x=x\/2-r,y=y\/2-r)circle(r=r);\n }\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Hollowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule honeycomb_drainholes(x=10,y=10,r=0.7,d=0.1,fn=6,o1=1,o2=1,ra=0.25) {\n for(k=[-1,1])for(l=[0:(2*(r+r*sin(30)-d))*o1:x]){\n for(i=[1,-1])for(j=[0:(2*r*cos(30)-d)*o2:y]) {\n translate([k*l,i*j])circle(r=ra);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])circle(r=ra);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\nmodule negativ_sq() {\n difference() {\n hull()children();\n children();\n }\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ab9ffd56f2f6d681ebe35c1530a77961d9112fcd","subject":"LCD case draft","message":"LCD case draft\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/lcd.scad","new_file":"lcd_case_for_prusa_i3\/lcd.scad","new_contents":"module lcdBoard()\n{\n difference()\n {\n union()\n {\n \/\/ lower plate\n cube([98,60,2]);\n \/\/ LCD itself\n translate([0.5, 10, 2])\n cube([97,40,10]);\n \/\/ cables\n translate([9, 60-5, -2])\n cube([39,10,2]);\n }\n \/\/ drills\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=4, $fs=1);\n }\n }\n}\n\nlcdBoard();","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c80002fa278c37c236d7a971cae9b4f8bc66ceb8","subject":"Adding circles and slits","message":"Adding circles and slits\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,0,0]) cube([thickness*3, thickness, thickness]); \n translate([-thickness\/2-thickness*4,0,0]) cube([thickness*3, thickness, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a)\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove);\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [1],\n circles_remove = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,0,0]) cube([thickness*3, thickness, thickness]); \n translate([-thickness\/2-thickness*4,0,0]) cube([thickness*3, thickness, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5]);\n }\n}\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"f4ffbd8e741f5e96cf3f005bbb23498417a34e4c","subject":"The baseline images were updated.","message":"The baseline images were updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/external-resources\/pacman\/pacman.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/external-resources\/pacman\/pacman.scad","new_contents":" \nmodule pacman(height=5)\n{\n difference()\n {\n cylinder(r=20, center=true, h=height);\n\n linear_extrude(height=50, center=true, convexity = 10, twist = 0)\n {\n polygon(points=[[0,0],[100,60],[100,-60]], paths=[[0,1,2]]);\n }\n }\n}\n\nmodule pacmanThumbnail(height = 1)\n{\n xyScale = 0.6;\n scale([xyScale,xyScale, 1])\n pacman(height);\n}\n","old_contents":"\n\/\/ TODO: move this to external-resources\/\n \nmodule pacman(height=5)\n{\n difference() \n {\n cylinder(r=20, center=true, h=height);\n\n linear_extrude(height=50, center=true, convexity = 10, twist = 0) \n {\n polygon(points=[[0,0],[100,60],[100,-60]], paths=[[0,1,2]]);\n }\n }\n}\n\nmodule pacmanThumbnail(height = 1)\n{\n xyScale = 0.6;\n scale([xyScale,xyScale, 1])\n pacman(height);\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5c2503dc9483ad613c31d9ac0ac77be6ead35f07","subject":"rotated foot H fork a bit","message":"rotated foot H fork a bit\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\nwithBrace=0; \/\/ use wobble braces at knee as fork\nHforkAngle=155; \/\/ angle of SI8 fork at H\n\n \/\/ FG (shin)\n if (withBrace) {\n hull() { \/\/ FG (shin)\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true); \/\/ foot\n }\n } else {\n \/\/ knee end fork cut out of square tube\n difference() {\n hull() {\n cube([4,2.54,2.54],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.54,$fn=24,center=true); \/\/ foot\n }\n\n #cylinder(r=.4,h=4,$fn=17,center=true);\n translate([-.5,.2,0]) cube([4,2.54,2.1],center=true);\n }\n }\n\n \/\/ knee braces\/fork\n *%color([0,1,1,.2])\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,HforkAngle]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for(z=[0,1]) hull() {\n translate([FGleft+4,FGperp-3,z?-2.5:7]) barEnd1();\n translate([ 3 , 0 ,z?-1:1]) barEnd1();\n }\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n for (z=[0,1]) hull() { \/\/ GH braces\n translate([FG-9,0,z?-1:1]) barEnd1();\n translate([FGleft+6,FGperp-1.5,z?-2:6.7]) barEnd1();\n }\n\n for (z=[0,1]) hull() { \/\/ perp brace\n translate([FGleft+5.5,FGperp-3,z? 7:-2]) barEnd1();\n translate([FGleft+5.5, 0 ,z?.5:-1]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([47,16,4.2]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft,FGperp,2.4]) rotate([0,0,HforkAngle])\n translate([-4.8,0,0])\n cube([.75*2.54,.75*2.54,10],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\nsquareTop=1; \/\/ 1==let top tube be square, no additional fork pieces\n\n if (squareTop) {\n \/\/ crank link width with flange bearings is a little over 1\"\n \/\/ so go with 1.25\" square top tube\n *difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,1.25*2.54,1.25*2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,3.2,2.8],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,3.2,2.8],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n \/\/ Even though , technically, the crank link hits the\n \/\/ edge with a 1\" top tube, I think there is enough slop\n \/\/ with the heim joint to use a 1\" top tube anyway.\n \/\/ also... if needed, we can shift the top tube\n \/\/ up or down 1\/8\" depending in which side we are, and make it work.\n \/\/ have slightly uneven spacers at F, and we are fine\n difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,2.54,2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,2.6,2.2],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,2.6,2.2],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n } else {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n }\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n if (squareTop==0) {\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n\n \/\/ main bars for BH link.\n \/\/ may want to fabricate these first, then add the extra\n \/\/ bracing, in place, on a working (but wobbly?) leg\n translate([0,0,7.8]) rotate([180,0,0]) BHbar();\n translate([0,0,-3]) BHbar();\n\n \/\/ do these last, after leg assembly, improvised\n color([0,.5,1,.5]) {\n BHcrosses();\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n }\n}\n\nmodule BHbar() {\n difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=2.8,$fn=42,center=true);\n translate([BH\/2+1,0,.14]) difference() {\n cube([BH+2,2.54,2.54],center=true); \/\/ sq. tube\n cube([BH+3,2.2,2.2],center=true);\n\n \/\/ carve out for H bolt\n translate([BH\/2,0,-1.4]) rotate([0,-30,0])\n cube([6,3,3],center=true);\n }\n\n \/\/ weld extra plate for strength at H node\n translate([BH,0,2.54\/2+.3]) cube([3,3,.4],center=true);\n }\n\n cylinder(r=3.7\/2+.1,h=3,$fn=19,center=true);\n #translate([BH,0,0]) cylinder(r=.4,h=7,$fn=13);\n }\n}\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\nmodule barEnd1() sphere(.8,$fn=12);\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\nwithBrace=0; \/\/ use wobble braces at knee as fork\n\n \/\/ FG (shin)\n if (withBrace) {\n hull() { \/\/ FG (shin)\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true); \/\/ foot\n }\n } else {\n \/\/ knee end fork cut out of square tube\n difference() {\n hull() {\n cube([4,2.54,2.54],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.54,$fn=24,center=true); \/\/ foot\n }\n\n #cylinder(r=.4,h=4,$fn=17,center=true);\n translate([-.5,.2,0]) cube([4,2.54,2.1],center=true);\n }\n }\n\n \/\/ knee braces\/fork\n *%color([0,1,1,.2])\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for (z=[-.3]) hull() {\n translate([ 3 , 1 ,]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() {\n translate([FGleft+4.5,FGperp-4,6]) barEnd1();\n translate([7,4.4,0]) barEnd1();\n }\n\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\nsquareTop=1; \/\/ 1==let top tube be square, no additional fork pieces\n\n if (squareTop) {\n \/\/ crank link width with flange bearings is a little over 1\"\n \/\/ so go with 1.25\" square top tube\n *difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,1.25*2.54,1.25*2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,3.2,2.8],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,3.2,2.8],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n \/\/ Even though , technically, the crank link hits the\n \/\/ edge with a 1\" top tube, I think there is enough slop\n \/\/ with the heim joint to use a 1\" top tube anyway.\n \/\/ also... if needed, we can shift the top tube\n \/\/ up or down 1\/8\" depending in which side we are, and make it work.\n \/\/ have slightly uneven spacers at F, and we are fine\n difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,2.54,2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,2.6,2.2],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,2.6,2.2],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n } else {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n }\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n if (squareTop==0) {\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n\n \/\/ main bars for BH link.\n \/\/ may want to fabricate these first, then add the extra\n \/\/ bracing, in place, on a working (but wobbly?) leg\n translate([0,0,7.8]) rotate([180,0,0]) BHbar();\n translate([0,0,-3]) BHbar();\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n BHcrosses();\n}\n\nmodule BHbar() {\n difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=2.8,$fn=42,center=true);\n translate([BH\/2+1,0,.14]) difference() {\n cube([BH+2,2.54,2.54],center=true); \/\/ sq. tube\n cube([BH+3,2.2,2.2],center=true);\n\n \/\/ carve out for H bolt\n translate([BH\/2,0,-1.4]) rotate([0,-30,0])\n cube([6,3,3],center=true);\n }\n\n \/\/ weld extra plate for strength at H node\n translate([BH,0,2.54\/2+.3]) cube([3,3,.4],center=true);\n }\n\n cylinder(r=3.7\/2+.1,h=3,$fn=19,center=true);\n #translate([BH,0,0]) cylinder(r=.4,h=7,$fn=13);\n }\n}\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\nmodule barEnd1() sphere(.8,$fn=12);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b7c414ffd618598d6cb24ea505b99e9b54181668","subject":"The base block now has some cutouts on the sides.","message":"The base block now has some cutouts on the sides.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/cosplay\/star-trek\/borg\/eye-piece\/eye-piece.scad","new_file":"OpenSCAD\/src\/main\/openscad\/cosplay\/star-trek\/borg\/eye-piece\/eye-piece.scad","new_contents":"\r\nuse <..\/..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nblockHeight = 12;\r\nblockSideX = 49.5;\r\nblockSideY = 43.50;\r\n\r\ncylinderHeight = 17.5;\r\n\r\ninnerRingOuterRadius = 14.5;\r\n\r\nringTranslate = [23.0, 22.0, 0];\r\n\r\nringThickness = 2.1;\r\n\r\n\/\/ this one is the reference version\r\n\/\/translate([282, 0, 0])\r\n\/\/stlVersion();\r\n\r\n\/\/ this one is inside the openscad version (for sizing)\r\n\/\/color(\"green\")\r\n\/\/translate([282, -65, 0])\r\n\/\/stlVersion();\r\n\r\neyePiece();\r\n\r\nmodule attachmentSlantCutout()\r\n{\r\n\tcolor(\"orange\")\r\n\t\r\n\trotate([0, -35, 0])\r\n\ttranslate([-3.2, -9, -6.0])\r\n\tcube([10,130, 20]);\t\r\n}\r\n\r\nmodule block()\r\n{\r\n\tx = blockSideX;\r\n\ty = blockSideY;\r\n\tz = blockHeight;\r\n\t\r\n\tcube([x, y, z]);\t\r\n}\r\n\r\nmodule blockCutouts()\r\n{\r\n\ttranslate([0,0,-0.01])\r\n\teyeCutout();\r\n\t\r\n\tattachmentSlantCutout();\r\n\t\r\n\tblockCutout1();\r\n\t\r\n\tblockCutout2();\r\n}\r\n\r\nmodule blockCutout1()\r\n{\r\n\ttrnaslateX = 40;\r\n\ttranslateY = 0;\r\n\tcolor(\"pink\")\r\n\trotate([0,0,-20])\r\n\ttranslate([trnaslateX, translateY, -0.01])\r\n\tcube([15, blockSideY, blockHeight+1]);\r\n}\r\n\r\nmodule blockCutout2()\r\n{\r\n\ttrnaslateX = 28;\r\n\ttranslateY = 18;\r\n\tcolor(\"green\")\r\n\trotate([0,0,-43])\r\n\ttranslate([trnaslateX, translateY, -0.01])\r\n\tcube([15, blockSideY, blockHeight+1]);\t\t\r\n}\r\n\r\nmodule eyepieceBlock()\r\n{\r\n\t\/\/ comment this next line to see the cutout pieces\r\n\tdifference()\r\n\t{\r\n\t\tblock();\r\n\t\t\r\n\t\tblockCutouts();\r\n\t}\r\n}\r\n\r\nmodule eyepieceBlockAdornments()\r\n{\r\n\touterRing();\r\n\t\r\n\tinnerRing();\r\n\t\r\n\teyeStrapLoop();\r\n}\r\n\r\nmodule eyeCutout()\r\n{\r\n\tradius = innerRingOuterRadius - ringThickness;\t\r\n\ttranslate(ringTranslate)\r\n\tcylinder(r=radius, h=30);\t\r\n}\r\n\r\nmodule eyePiece()\r\n{\r\n\tunion()\r\n\t{\r\n\t\teyepieceBlock();\r\n\t\t\r\n\t\teyepieceBlockAdornments();\r\n\t}\r\n}\r\n\r\nmodule eyeStrapLoop()\r\n{\r\n\theight = 2;\r\n\tside = 14;\r\n\t\r\n\tdifference()\r\n\t{\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([49, 29.5, 0])\r\n\t\tcube([side, side, height]);\r\n\t\t\r\n\t\ttranslate([51,32,-0.1])\r\n\t\tcube([9, 9, height+1]);\r\n\t}\r\n}\r\n\r\nmodule innerRing()\r\n{\r\n\tinnerR = innerRingOuterRadius - ringThickness;\r\n\ttranslate(ringTranslate)\r\n\topenCylinder(height=cylinderHeight, outerRadius=innerRingOuterRadius, innerRadius=innerR);\r\n}\r\n\r\nmodule outerRing()\r\n{\r\n\tdifference()\r\n\t{\r\n\t\touterR = 20.0;\r\n\t\tinnerR = outerR - ringThickness; \r\n\t\ttranslate(ringTranslate)\r\n\t\topenCylinder(height=cylinderHeight, outerRadius=outerR, innerRadius=innerR);\r\n\t\t\r\n\t\tblockCutouts();\r\n\t}\r\n}\r\n\t\r\nmodule stlVersion()\r\n{\r\n\t\/\/\r\n\timport(\"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\wearables\\\\el-wire-cyborg-eye\\\\Fiore9\\\\El_Wire_Cyborg_Eye\\\\files\\\\cyborg_eye_right.stl\");\r\n}\r\n","old_contents":"\r\nuse <..\/..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\ncylinderHeight = 17.5;\r\n\r\ninnerRingOuterRadius = 14.5;\r\n\r\nringTranslate = [23.0, 22.0, 0];\r\n\r\nringThickness = 2.1;\r\n\r\n\/\/ this one is the reference version\r\n\/\/translate([282, 0, 0])\r\n\/\/stlVersion();\r\n\r\n\/\/ this one is inside the openscad version (for sizing)\r\n\/\/color(\"green\")\r\n\/\/translate([282, -65, 0])\r\n\/\/stlVersion();\r\n\r\neyePiece();\r\n\r\nmodule basePiece()\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tblock();\r\n\t\t\r\n\t\tblockCutouts();\r\n\t}\r\n}\r\n\r\nmodule baseAdornments()\r\n{\r\n\touterRing();\r\n\t\r\n\tinnerRing();\r\n}\t\t\r\n\r\nmodule block()\r\n{\r\n\tx = 49.5;\r\n\ty = 43.50;\r\n\tz = 12;\r\n\t\r\n\tcube([x, y, z]);\t\r\n}\r\n\r\nmodule blockCutouts()\r\n{\r\n\ttranslate([0,0,-0.01])\r\n\teyeCutout();\r\n\t\r\n\t\r\n}\r\n\r\nmodule eyeCutout()\r\n{\r\n\tradius = innerRingOuterRadius - ringThickness;\t\r\n\ttranslate(ringTranslate)\r\n\tcylinder(r=radius, h=30);\t\r\n}\r\n\r\nmodule eyePiece()\r\n{\r\n\tunion()\r\n\t{\r\n\t\tbasePiece();\r\n\t\t\r\n\t\tbaseAdornments();\r\n\t}\r\n}\r\n\r\nmodule innerRing()\r\n{\r\n\tinnerR = innerRingOuterRadius - ringThickness;\r\n\ttranslate(ringTranslate)\r\n\topenCylinder(height=cylinderHeight, outerRadius=innerRingOuterRadius, innerRadius=innerR);\r\n}\r\n\r\nmodule outerRing()\r\n{\r\n\touterR = 20.0;\r\n\tinnerR = outerR - ringThickness; \r\n\ttranslate(ringTranslate)\r\n\topenCylinder(height=cylinderHeight, outerRadius=outerR, innerRadius=innerR);\r\n}\r\n\t\r\nmodule stlVersion()\r\n{\r\n\t\/\/\r\n\timport(\"C:\\\\home\\\\world\\\\versioning\\\\beto-land-world\\\\3d-printing\\\\wearables\\\\el-wire-cyborg-eye\\\\Fiore9\\\\El_Wire_Cyborg_Eye\\\\files\\\\cyborg_eye_right.stl\");\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5a245ea8a6a475be1d2ae4a04778ee77cff68c90","subject":"Better bathroom box shape","message":"Better bathroom box shape\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/3d-iot-case-models\/bathroom-sensor-case.scad","new_file":"3d-models\/3d-iot-case-models\/bathroom-sensor-case.scad","new_contents":"\/\/ Bathroom Sensor 3D Model with methane sensor, 2 motion sensors and Arduino Yun\n\n$fn = 8;\n\ncube_side = 140;\ncube_tip_clip = 10;\nwall_width = 26;\n\nskin = 10;\ninner_skin = 8;\nthin_skin = 0.1;\n\nyun_y = -wall_width;\nyun_z = -20;\n\ndifference() {\n color(\"red\") box();\n union() {\n methane_moved_skin();\n motion_moved_skin(-40, 0);\n motion_moved_skin(40, 90);\n }\n}\n\nyun_moved();\nmethane_moved();\n\/\/motion_moved(-40, 0);\n\/\/motion_moved(40, 90);\n\ncolor(\"blue\") yun_holder();\n\nmodule motion_moved(y=0, theta=0) {\n translate([95, y, -20]) rotate([36, 137, theta]) {\n motion();\n }\n}\n\nmodule motion_moved_skin(y=0, theta=0) {\n minkowski() {\n motion_moved(y, theta);\n sphere(r=thin_skin);\n }\n}\n\nmodule yun_moved() {\n translate([-skin, yun_y, yun_z])\n rotate([180, 0, 0]) {\n yun();\n }\n}\n\nmodule yun_moved_skin() {\n minkowski() {\n yun_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule yun_holder() {\n intersection() {\n translate([-skin\/2, -cube_side - wall_width\/2, -33])\n cube([50, cube_side, 5]);\n poly(cube_tip_clip);\n }\n}\n\nmodule methane_moved() {\n translate([cube_side + skin - cube_tip_clip*2, 0, 0])\n rotate([0, 90, 0]) {\n methane();\n }\n}\n\nmodule methane_moved_skin() {\n minkowski() {\n methane_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule poly(clip = 0) {\n difference() {\n polyhedron(\n points=[[0,cube_side,0],\n [0,0,-cube_side],\n [0,-cube_side,0],\n [0,0,cube_side],\n [cube_side,0]],\n faces=[[0,1,4],[1,2,4],[2,3,4],[3,0,4],[1,0,3],[2,1,3]]);\n union() {\n translate([-2*cube_side, -2*cube_side, clip\/.85])\n cube([cube_side*4, cube_side*4, cube_side]);\n translate([cube_side - clip\/2, 0, 0])\n cube([clip*2, clip*3, clip*3], center = true);\n side_block(wall_width*2.5, 180);\n side_block(wall_width*2.5, 0);\n }\n }\n}\n\nmodule wall_tunnel() {\n translate([-2*cube_side, -wall_width\/2, -2*cube_side - cube_tip_clip\/.7])\n cube([4*cube_side, wall_width, 2*cube_side]);\n}\n\nmodule box() {\n difference() {\n minkowski() {\n union() {\n poly(cube_tip_clip);\n intersection() {\n hull() {\n poly(cube_tip_clip);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin);\n }\n }\n }\n sphere(r=skin);\n }\n union() {\n methane_moved_skin();\n difference() {\n minkowski() {\n translate([-skin, 0, 0])\n poly(cube_tip_clip\/2);\n sphere(r=inner_skin);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin - inner_skin);\n }\n }\n wall_tunnel();\n }\n }\n}\n\nmodule side_block(y=0, theta=0) {\n rotate([theta, 0, 0]) {\n translate([-2*cube_side, y, -2*cube_side])\n cube([4*cube_side, 3*wall_width, 4*cube_side]);\n }\n}\n\nmodule yun() {\n include <..\/3d-iot-component-models\/arduino-yun-mini.scad>\n}\n\nmodule methane() {\n include <..\/3d-iot-component-models\/methane-sensor.scad>\n}\n\nmodule motion() {\n include <..\/3d-iot-component-models\/pir-motion-sensor.scad>\n}\n\n","old_contents":"\/\/ Bathroom Sensor 3D Model with methane sensor, 2 motion sensors and Arduino Yun\n\n$fn = 8;\n\ncube_side = 140;\ncube_tip_clip = 10;\nwall_width = 26;\n\nskin = 10;\ninner_skin = 8;\nthin_skin = 0.05;\n\ndifference() {\n color(\"red\") box();\n union() {\n methane_moved_skin();\n motion_moved_skin(-40, 0);\n motion_moved_skin(40, 90);\n }\n}\n\nyun_moved();\nmethane_moved();\nmotion_moved(-40, 0);\nmotion_moved(40, 90);\n\ncolor(\"blue\") yun_holder();\n\nmodule motion_moved(y=0, theta=0) {\n translate([90, y, -25]) rotate([36, 137, theta]) {\n motion();\n }\n}\n\nmodule motion_moved_skin(y=0, theta=0) {\n minkowski() {\n motion_moved(y, theta);\n sphere(r=thin_skin);\n }\n}\n\nyun_y = -wall_width;\nyun_z = -wall_width;\n\nmodule yun_moved() {\n translate([-skin, yun_y, yun_z])\n rotate([180, 0, 0]) {\n yun();\n }\n}\n\nmodule yun_moved_skin() {\n minkowski() {\n yun_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule yun_holder() {\n intersection() {\n translate([-skin\/2, -cube_side - wall_width\/2, -38])\n cube([70, cube_side, 5]);\n poly(cube_tip_clip);\n }\n}\n\nmodule methane_moved() {\n translate([cube_side + skin - cube_tip_clip*2, 0, 0])\n rotate([0, 90, 0]) {\n methane();\n }\n}\n\nmodule methane_moved_skin() {\n minkowski() {\n methane_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule poly(clip = 0) {\n difference() {\n polyhedron(\n points=[[0,cube_side,0],\n [0,0,-cube_side],\n [0,-cube_side,0],\n [0,0,cube_side],\n [cube_side,0]],\n faces=[[0,1,4],[1,2,4],[2,3,4],[3,0,4],[1,0,3],[2,1,3]]);\n union() {\n translate([-2*cube_side, -2*cube_side, clip\/.85])\n cube([cube_side*4, cube_side*4, cube_side]);\n translate([cube_side - clip\/2, 0, 0])\n cube([clip*2, clip*3, clip*3], center = true);\n }\n }\n}\n\nmodule wall_tunnel() {\n translate([-2*cube_side, -wall_width\/2, -2*cube_side - cube_tip_clip\/.7])\n cube([4*cube_side, wall_width, 2*cube_side]);\n}\n\nmodule box() {\n difference() {\n minkowski() {\n union() {\n poly(cube_tip_clip);\n intersection() {\n hull() {\n poly(cube_tip_clip);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin);\n }\n }\n }\n sphere(r=skin);\n }\n union() {\n methane_moved_skin();\n difference() {\n minkowski() {\n translate([-skin, 0, 0])\n poly(cube_tip_clip\/2);\n sphere(r=inner_skin);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin - inner_skin);\n }\n }\n wall_tunnel();\n }\n }\n}\n\nmodule yun() {\n include <..\/3d-iot-component-models\/arduino-yun-mini.scad>\n}\n\nmodule methane() {\n include <..\/3d-iot-component-models\/methane-sensor.scad>\n}\n\nmodule motion() {\n include <..\/3d-iot-component-models\/pir-motion-sensor.scad>\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4b5e66c7b3fbe96e93d54c11529b780ea66d8da8","subject":"holder for the ECD board, to screw to wooden elements","message":"holder for the ECD board, to screw to wooden elements\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"electrical_cable_distributor\/holder\/ecd_holder.scad","new_file":"electrical_cable_distributor\/holder\/ecd_holder.scad","new_contents":"eps = 0.01;\nN = 2;\nM = 1;\n\nmodule ecd_holder()\n{\n difference()\n {\n translate([-8\/2, -40\/2, 0])\n {\n cube([8, 40, 5+1.5]);\n for(dy=[0, 40-9])\n translate([8, dy, 0])\n cube([9, 9, 1.5]);\n }\n \/\/ screw hole\n translate([0, 0, -eps])\n cylinder(d=3.5, h=10, $fn=40);\n }\n}\n\nfor(iy=[0:M-1])\nfor(ix=[0:N-1])\n translate([ix*20, iy*45, 0])\n ecd_holder();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'electrical_cable_distributor\/holder\/ecd_holder.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"bdb33e45acd45e31c4563ff2d8ee161ac1ce9e6c","subject":"fixed indentation","message":"fixed indentation\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"electrical_cable_distributor\/holder\/ecd_holder.scad","new_file":"electrical_cable_distributor\/holder\/ecd_holder.scad","new_contents":"eps = 0.01;\nN = 2;\nM = 1;\n\nmodule ecd_holder()\n{\n difference()\n {\n translate([-8\/2, -40\/2, 0])\n {\n cube([8, 40, 5+1.5]);\n for(dy=[0, 40-9])\n translate([8, dy, 0])\n cube([9, 9, 1.5]);\n }\n \/\/ screw hole\n translate([0, 0, -eps])\n cylinder(d=3.5, h=10, $fn=40);\n }\n}\n\nfor(iy=[0:M-1])\n for(ix=[0:N-1])\n translate([ix*20, iy*45, 0])\n ecd_holder();\n","old_contents":"eps = 0.01;\nN = 2;\nM = 1;\n\nmodule ecd_holder()\n{\n difference()\n {\n translate([-8\/2, -40\/2, 0])\n {\n cube([8, 40, 5+1.5]);\n for(dy=[0, 40-9])\n translate([8, dy, 0])\n cube([9, 9, 1.5]);\n }\n \/\/ screw hole\n translate([0, 0, -eps])\n cylinder(d=3.5, h=10, $fn=40);\n }\n}\n\nfor(iy=[0:M-1])\nfor(ix=[0:N-1])\n translate([ix*20, iy*45, 0])\n ecd_holder();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c898c1a1daf1a7bca6dfcc610a22235aaad31731","subject":"misc: Add rotation matrix functions and hadamard function","message":"misc: Add rotation matrix functions and hadamard function\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c1b7416d99687eca18eb7796608f8b979eec3499","subject":"water-catching plane","message":"water-catching plane\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"brown_oral_b_brush_holder\/brush_holder.scad","new_file":"brown_oral_b_brush_holder\/brush_holder.scad","new_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=10;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,14.5,50\/2-2], [36-2*2,25,2]);\nholder([0,0,0], [1,1,1]);\n","old_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=10;\n\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t=[ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ])\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"16bba5a3571f514538b534de16df46a9a8df5ea4","subject":"helper script with multiple junction_boxes at once","message":"helper script with multiple junction_boxes at once\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/multi_junction.scad","new_file":"led_controler_junction_box\/multi_junction.scad","new_contents":"use ;\n\nfor(i = [0:2])\n translate(i*[0, 83, 0])\n junction_box();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led_controler_junction_box\/multi_junction.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c067c857986c2846d7e8f14a8ab18a147d5ad4f9","subject":"main\/yaxis: Add ycarriage print plate","message":"main\/yaxis: Add ycarriage print plate\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"11862736a99f720e08e7405400e8fd5f35b01b84","subject":"fixup! main\/y-axis: Add y-axis rod clamps","message":"fixup! main\/y-axis: Add y-axis rod clamps\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n if(!preview_mode)\n {\n belt_path(main_depth-yaxis_motor_offset*2, 6, yaxis_pulley_d, orient=[0,1,0]);\n }\n\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n if(!preview_mode)\n {\n belt_path(main_depth-yaxis_motor_offset*2, 6, yaxis_pulley_d, orient=[0,1,0]);\n }\n\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"35008a232972f8051e567824cbc0b8f01207ec9a","subject":"The outerIconTranslateY was paramterized.","message":"The outerIconTranslateY was paramterized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/coin.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/coin.scad","new_contents":"\r\nuse <..\/..\/external-resources\/africa\/africa-outline-hi.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>\r\n\r\nuse <..\/..\/shapes\/balloon\/balloon.scad>\r\nuse <..\/..\/shapes\/blue-moon\/blue-moon.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/disk\/disk.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/hourglass\/hourglass.scad>\r\nuse <..\/..\/shapes\/horseshoe\/horseshoe.scad>\r\nuse <..\/..\/shapes\/oval\/oval.scad>\r\nuse <..\/..\/shapes\/religion\/christianity\/crucifixion-cross\/crucifixion-cross.scad>\r\nuse <..\/..\/shapes\/religion\/judaism\/star-of-david\/star-of-david.scad>\r\nuse <..\/..\/shapes\/religion\/islam\/crescent-star\/crescent-star.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>\r\nuse <..\/..\/shapes\/texas\/texas.scad>\r\nuse <..\/..\/shapes\/throwie-cutout\/throwie-cutout.scad>\r\nuse <..\/..\/shapes\/trees\/christmas\/christmas-tree.scad>\r\n\r\nmodule coin(innerIcon,\r\n innerIconXyScale,\r\n innerIconOffsetY,\r\n outerIcon,\r\n outerIconCount,\r\n outerIconXyScale,\r\n\t\t\touterIconTranslateY = 43,\r\n radius,\r\n height)\r\n{\r\n difference()\r\n {\r\n \/\/ main disk\r\n cylinder (h = height, r=radius, center = true, $fn=100);\r\n\r\n \/\/ inner icon\r\n translate([0, innerIconOffsetY, -5])\r\n scale([innerIconXyScale, innerIconXyScale, 16.5])\r\n coinIcon(innerIcon, height);\r\n\r\n \/\/ outer icons\r\n for ( i = [0 : outerIconCount] )\r\n {\r\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\r\n translate([0, outerIconTranslateY, -5])\r\n scale([outerIconXyScale, outerIconXyScale, 13.0])\r\n coinIcon(outerIcon, height);\r\n }\r\n }\r\n}\r\n\r\nmodule coinIcon(iconName, height)\r\n{\r\n if(iconName == \"Cross\")\r\n {\r\n crucifixionCcross(height);\r\n }\r\n\telse if(iconName == \"Spur\")\r\n\t{\r\n\t\tspur();\r\n\t}\r\n else if(iconName == \"Throwie\")\r\n {\r\n throwieCutout(height=height);\r\n }\r\n else if(iconName == \"Star of David\")\r\n {\r\n starOfDavid();\r\n }\r\n else if(iconName == \"Crescent Star\")\r\n {\r\n crescentStar();\r\n }\r\n else if(iconName == \"Star\")\r\n {\r\n star(height);\r\n }\r\n else if(iconName == \"Blue Moon\")\r\n {\r\n blueMoon();\r\n }\r\n else if(iconName == \"Clover\")\r\n {\r\n clover();\r\n }\r\n else if(iconName == \"Heart\")\r\n {\r\n heart();\r\n }\r\n else if(iconName == \"Horseshoe\")\r\n {\r\n horseshoe();\r\n }\r\n else if(iconName == \"Hourglass\")\r\n {\r\n hourglass();\r\n }\r\n else if(iconName == \"OSHW\")\r\n {\r\n oshwLogo();\r\n }\r\n else if(iconName == \"Texas\")\r\n {\r\n texas();\r\n }\r\n else if(iconName == \"Africa\")\r\n {\r\n africa();\r\n }\r\n else if(iconName == \"Oval\")\r\n {\r\n oval();\r\n }\r\n else if(iconName == \"Balloon\")\r\n {\r\n balloon();\r\n }\r\n else if(iconName == \"Circle\")\r\n {\r\n disk();\r\n }\r\n else if(iconName == \"Batman\")\r\n {\r\n batmanLogo();\r\n }\r\n else if(iconName == \"Tree\")\r\n {\r\n christmasTree(height);\r\n }\r\n else\r\n {\r\n \/\/ default is to do nothing\r\n\/\/ echo(\"no coin used\");\r\n }\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/africa\/africa-outline-hi.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>\r\n\r\nuse <..\/..\/shapes\/balloon\/balloon.scad>\r\nuse <..\/..\/shapes\/blue-moon\/blue-moon.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/disk\/disk.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/hourglass\/hourglass.scad>\r\nuse <..\/..\/shapes\/horseshoe\/horseshoe.scad>\r\nuse <..\/..\/shapes\/oval\/oval.scad>\r\nuse <..\/..\/shapes\/religion\/christianity\/crucifixion-cross\/crucifixion-cross.scad>\r\nuse <..\/..\/shapes\/religion\/judaism\/star-of-david\/star-of-david.scad>\r\nuse <..\/..\/shapes\/religion\/islam\/crescent-star\/crescent-star.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>\r\nuse <..\/..\/shapes\/texas\/texas.scad>\r\nuse <..\/..\/shapes\/throwie-cutout\/throwie-cutout.scad>\r\nuse <..\/..\/shapes\/trees\/christmas\/christmas-tree.scad>\r\n\r\nmodule coin(innerIcon,\r\n innerIconXyScale,\r\n innerIconOffsetY,\r\n outerIcon,\r\n outerIconCount,\r\n outerIconXyScale,\r\n radius,\r\n height)\r\n{\r\n difference()\r\n {\r\n \/\/ main disk\r\n cylinder (h = height, r=radius, center = true, $fn=100);\r\n\r\n \/\/ inner icon\r\n translate([0, innerIconOffsetY, -5])\r\n scale([innerIconXyScale, innerIconXyScale, 16.5])\r\n coinIcon(innerIcon, height);\r\n\r\n \/\/ outer icons\r\n for ( i = [0 : outerIconCount] )\r\n {\r\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\r\n translate([0, 43, -5])\r\n scale([outerIconXyScale, outerIconXyScale, 13.0])\r\n coinIcon(outerIcon, height);\r\n }\r\n }\r\n}\r\n\r\nmodule coinIcon(iconName, height)\r\n{\r\n if(iconName == \"Cross\")\r\n {\r\n crucifixionCcross(height);\r\n }\r\n\telse if(iconName == \"Spur\")\r\n\t{\r\n\t\tspur();\r\n\t}\r\n else if(iconName == \"Throwie\")\r\n {\r\n throwieCutout(height=height);\r\n }\r\n else if(iconName == \"Star of David\")\r\n {\r\n starOfDavid();\r\n }\r\n else if(iconName == \"Crescent Star\")\r\n {\r\n crescentStar();\r\n }\r\n else if(iconName == \"Star\")\r\n {\r\n star(height);\r\n }\r\n else if(iconName == \"Blue Moon\")\r\n {\r\n blueMoon();\r\n }\r\n else if(iconName == \"Clover\")\r\n {\r\n clover();\r\n }\r\n else if(iconName == \"Heart\")\r\n {\r\n heart();\r\n }\r\n else if(iconName == \"Horseshoe\")\r\n {\r\n horseshoe();\r\n }\r\n else if(iconName == \"Hourglass\")\r\n {\r\n hourglass();\r\n }\r\n else if(iconName == \"OSHW\")\r\n {\r\n oshwLogo();\r\n }\r\n else if(iconName == \"Texas\")\r\n {\r\n texas();\r\n }\r\n else if(iconName == \"Africa\")\r\n {\r\n africa();\r\n }\r\n else if(iconName == \"Oval\")\r\n {\r\n oval();\r\n }\r\n else if(iconName == \"Balloon\")\r\n {\r\n balloon();\r\n }\r\n else if(iconName == \"Circle\")\r\n {\r\n disk();\r\n }\r\n else if(iconName == \"Batman\")\r\n {\r\n batmanLogo();\r\n }\r\n else if(iconName == \"Tree\")\r\n {\r\n christmasTree(height);\r\n }\r\n else\r\n {\r\n \/\/ default is to do nothing\r\n\/\/ echo(\"no coin used\");\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ca5b37e30b63367332168086f7cea1e890506626","subject":"added cable guide hole and screw holes","message":"added cable guide hole and screw holes\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n menuKnob();\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n resetButton();\n \/\/ cable guide drill\n translate([boxSize[0]-75-5, 40+16+10, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 30, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, 0])\n cylinder(r=5\/2, h=6+7, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \n\n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n menuKnob();\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n resetButton();\n }\n\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b27821c81b66fcf7933c439b317386137f0cab8a","subject":"A second icon was added.","message":"A second icon was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n icon1 = \"\",\r\n icon1_scale = 1,\r\n icon1_x = 0,\r\n icon1_y = 0,\r\n icon2 = \"\",\r\n icon2_scale = 1.0,\r\n icon2_x = 0,\r\n icon2_y = 0,\r\n text1 = \"\",\r\n text1_fontSize = 7.5,\r\n text1_x = 0,\r\n text1_y = 0,\r\n text2 = \"\",\r\n text2_fontSize = 7.5,\r\n text2_x = 0,\r\n text2_y = 0)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\n\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\nfunction lightSignal_stlBaseInnerRadius() = 18.5;\r\n\r\nfunction lightSignal_stlBaseOuterRadius() = lightSignal_stlBaseInnerRadius() + 2.5;\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y)\r\n{\r\n lightSignal_oneIconCutout(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y);\r\n\r\n lightSignal_oneIconCutout(icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_oneIconCutout(\r\n icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y)\r\n{\r\n if(icon1 == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n zScale = 3;\r\n translate([icon1_x, icon1_y, -1.01])\r\n if(icon1 == \"heart\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n heartThumbnail();\r\n }\r\n else if(icon1 == \"bat\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n batmanLogoThumbnail();\r\n }\r\n }\r\n}\r\n\r\nmodule lightSignal_oneTextCutout(text, fontSize, x, y)\r\n{\r\n if(text == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n extrudeHeight = 6;\r\n zTranslate = -3;\r\n fontName = \"Bauhaus 93:style=Regular\";\r\n\r\n translate([x, y, zTranslate])\r\n linear_extrude(height = extrudeHeight)\r\n text(text = text, font = fontName, size = fontSize);\r\n }\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\r\n\tstlBaseInnerRadius = lightSignal_stlBaseInnerRadius();\r\n\tstlBaseOuterRadius = lightSignal_stlBaseOuterRadius();\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n lightSignal_oneTextCutout(text1, text1_fontSize, text1_x, text1_y);\r\n\r\n lightSignal_oneTextCutout(text2, text2_fontSize, text2_x, text2_y);\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n icon1 = \"\",\r\n icon1_scale = 1,\r\n icon1_x = 0,\r\n icon1_y = 0,\r\n text1 = \"\",\r\n text1_fontSize = 7.5,\r\n text1_x = 0,\r\n text1_y = 0,\r\n text2 = \"\",\r\n text2_fontSize = 7.5,\r\n text2_x = 0,\r\n text2_y = 0)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\n\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\nfunction lightSignal_stlBaseInnerRadius() = 18.5;\r\n\r\nfunction lightSignal_stlBaseOuterRadius() = lightSignal_stlBaseInnerRadius() + 2.5;\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1, icon1_scale, icon1_x,\r\n\t\ticon1_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y)\r\n{\r\n\tif(icon1 == \"\")\r\n\t{\r\n\t\t\/\/ do nothing\r\n\t}\r\n\telse\r\n\t{\r\n\t\tzScale = 3;\r\n\t\ttranslate([icon1_x, icon1_y, -1.01])\r\n\t\tif(icon1 == \"heart\")\r\n\t\t{\r\n\t\t\tscale([icon1_scale, icon1_scale, zScale])\r\n\t\t\theartThumbnail();\r\n\t\t}\r\n\t\telse if(icon1 == \"bat\")\r\n\t\t{\r\n\t\t\tscale([icon1_scale, icon1_scale, zScale])\r\n\t\t\tbatmanLogoThumbnail();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule lightSignal_oneTextCutout(text, fontSize, x, y)\r\n{\r\n\tif(text == \"\")\r\n\t{\r\n\t\t\/\/ do nothing\r\n\t}\r\n\telse\r\n\t{\r\n\t\textrudeHeight = 6;\r\n\t\tzTranslate = -3;\r\n\t\tfontName = \"Bauhaus 93:style=Regular\";\r\n\r\n\t\ttranslate([x, y, zTranslate])\r\n\t\tlinear_extrude(height = extrudeHeight)\r\n\t\ttext(text = text, font = fontName, size = fontSize);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\r\n\tstlBaseInnerRadius = lightSignal_stlBaseInnerRadius();\r\n\tstlBaseOuterRadius = lightSignal_stlBaseOuterRadius();\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontSize,\r\n\t\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\t\ttext1_y,\r\n\t\t\t\t\t\t\t text2,\r\n\t\t\t\t\t\t\t\ttext2_fontSize,\r\n\t\t\t\t\t\t\t text2_x,\r\n\t\t\t\t\t\t\t text2_y)\r\n{\r\n\tlightSignal_oneTextCutout(text1, text1_fontSize, text1_x, text1_y);\r\n\r\n\tlightSignal_oneTextCutout(text2, text2_fontSize, text2_x, text2_y);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b9a8f846e3d5bc494102936368936e0c84efbc83","subject":"buttons","message":"buttons\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 20;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 2;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 21;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bc1a57099fcbb67180a0c5f285e7e3b24bf06546","subject":"[3d] Fix convexity of locklip_p, extend all the way to edge now, add more front tabs","message":"[3d] Fix convexity of locklip_p, extend all the way to edge now, add more front tabs\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1a2c0a1f91408b14bdb34ffc4eab1c793a488a7f","subject":"refactor","message":"refactor\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/pencil-holder-with-cutouts\/rows\/one-row-single-charm\/one-row-single-charm.scad","new_file":"OpenSCAD\/pencil-holder-with-cutouts\/rows\/one-row-single-charm\/one-row-single-charm.scad","new_contents":"\r\ninclude <..\/..\/..\/cutouts\/rotated-spiral-cutouts.scad>;\r\n","old_contents":"\r\ninclude <..\/..\/..\/cutouts\/rotated-spiral-cutouts.scad>;\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d647a16c884c1350811a0efa3b0e43098512e1f2","subject":"transforms: add mx\/my\/mz","message":"transforms: add mx\/my\/mz\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(is_bool(m));\n mirror(X*m)\n children();\n}\n\nmodule my(m=true)\n{\n assert(is_bool(m));\n mirror(Y*m)\n children();\n}\n\nmodule mz(m=true)\n{\n assert(is_bool(m));\n mirror(Z*m)\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ba76f32221bedd252e484b43988f2cbd55709648","subject":"config: fix Z bearings (two bearings stacked)","message":"config: fix Z bearings (two bearings stacked)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 500*mm;\nmain_depth = 420*mm;\nmain_height = 420*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\ngantry_upper_offset_y = -25;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=1;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10L;\nxaxis_bearing_bottom = LinearBearingLM10;;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = 5*mm;\n\nyaxis_motor_offset_z = yaxis_belt_path_offset_z - 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_offset =\n Z*get(LinearBearingInnerDiameter, yaxis_bearing)\/2;\n\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,0*mm,0];\nzaxis_bearing = LinearBearingLMH12;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n [NemaAxleFlatDepth, 0*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5*mm;\nzmotor_mount_thickness_h = 7*mm;\nzmotor_mount_motor_offset = 5*mm;\n\n\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3.5;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);*\/\nzaxis_rod_screw_distance_x = -zaxis_rod_d\/2 -extrusion_size -zmotor_mount_motor_offset -lookup(NemaSideSize,zaxis_motor)\/2;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zaxis_rod_screw_distance_x;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 500*mm;\nmain_depth = 420*mm;\nmain_height = 420*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\ngantry_upper_offset_y = -25;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=1;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10L;\nxaxis_bearing_bottom = LinearBearingLM10;;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = 5*mm;\n\nyaxis_motor_offset_z = yaxis_belt_path_offset_z - 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_offset =\n Z*get(LinearBearingInnerDiameter, yaxis_bearing)\/2;\n\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,0*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n [NemaAxleFlatDepth, 0*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5*mm;\nzmotor_mount_thickness_h = 7*mm;\nzmotor_mount_motor_offset = 5*mm;\n\n\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3.5;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);*\/\nzaxis_rod_screw_distance_x = -zaxis_rod_d\/2 -extrusion_size -zmotor_mount_motor_offset -lookup(NemaSideSize,zaxis_motor)\/2;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zaxis_rod_screw_distance_x;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"630db0b24df9e895351b255e906d50c6bcaa6216","subject":"back to square tubes on BH","message":"back to square tubes on BH\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\nwithBrace=0; \/\/ use wobble braces at knee as fork\n\n \/\/ FG (shin)\n if (withBrace) {\n hull() { \/\/ FG (shin)\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true); \/\/ foot\n }\n } else {\n \/\/ knee end fork cut out of square tube\n difference() {\n hull() {\n cube([4,2.54,2.54],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.54,$fn=24,center=true); \/\/ foot\n }\n\n #cylinder(r=.4,h=4,$fn=17,center=true);\n translate([-.5,.2,0]) cube([4,2.54,2.1],center=true);\n }\n }\n\n \/\/ knee braces\/fork\n *%color([0,1,1,.2])\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for (z=[-.3]) hull() {\n translate([ 3 , 1 ,]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() {\n translate([FGleft+4.5,FGperp-4,6]) barEnd1();\n translate([7,4.4,0]) barEnd1();\n }\n\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\nsquareTop=1; \/\/ 1==let top tube be square, no additional fork pieces\n\n if (squareTop) {\n \/\/ crank link width with flange bearings is a little over 1\"\n \/\/ so go with 1.25\" square top tube\n *difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,1.25*2.54,1.25*2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,3.2,2.8],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,3.2,2.8],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n \/\/ Even though , technically, the crank link hits the\n \/\/ edge with a 1\" top tube, I think there is enough slop\n \/\/ with the heim joint to use a 1\" top tube anyway.\n \/\/ also... if needed, we can shift the top tube\n \/\/ up or down 1\/8\" depending in which side we are, and make it work.\n \/\/ have slightly uneven spacers at F, and we are fine\n difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,2.54,2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,2.6,2.2],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,2.6,2.2],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n } else {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n }\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n if (squareTop==0) {\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n\n \/\/ main bars for BH link.\n \/\/ may want to fabricate these first, then add the extra\n \/\/ bracing, in place, on a working (but wobbly?) leg\n translate([0,0,7.8]) rotate([180,0,0]) BHbar();\n translate([0,0,-3]) BHbar();\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n BHcrosses();\n}\n\nmodule BHbar() {\n difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=2.8,$fn=42,center=true);\n translate([BH\/2+1,0,.14]) difference() {\n cube([BH+2,2.54,2.54],center=true); \/\/ sq. tube\n cube([BH+3,2.2,2.2],center=true);\n\n \/\/ carve out for H bolt\n translate([BH\/2,0,-1.4]) rotate([0,-30,0])\n cube([6,3,3],center=true);\n }\n\n \/\/ weld extra plate for strength at H node\n translate([BH,0,2.54\/2+.3]) cube([3,3,.4],center=true);\n }\n\n cylinder(r=3.7\/2+.1,h=3,$fn=19,center=true);\n #translate([BH,0,0]) cylinder(r=.4,h=7,$fn=13);\n }\n}\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\nmodule barEnd1() sphere(.8,$fn=12);\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\nwithBrace=0; \/\/ use wobble braces at knee as fork\n\n \/\/ FG (shin)\n if (withBrace) {\n hull() { \/\/ FG (shin)\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true); \/\/ foot\n }\n } else {\n \/\/ knee end fork cut out of square tube\n difference() {\n hull() {\n cube([4,2.54,2.54],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.54,$fn=24,center=true); \/\/ foot\n }\n\n #cylinder(r=.4,h=4,$fn=17,center=true);\n translate([-.5,.2,0]) cube([4,2.54,2.1],center=true);\n }\n }\n\n \/\/ knee braces\/fork\n *%color([0,1,1,.2])\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for (z=[-.3]) hull() {\n translate([ 3 , 1 ,]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() {\n translate([FGleft+4.5,FGperp-4,6]) barEnd1();\n translate([7,4.4,0]) barEnd1();\n }\n\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\nsquareTop=1; \/\/ 1==let top tube be square, no additional fork pieces\n\n if (squareTop) {\n \/\/ crank link width with flange bearings is a little over 1\"\n \/\/ so go with 1.25\" square top tube\n *difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,1.25*2.54,1.25*2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,3.2,2.8],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,3.2,2.8],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n \/\/ Even though , technically, the crank link hits the\n \/\/ edge with a 1\" top tube, I think there is enough slop\n \/\/ with the heim joint to use a 1\" top tube anyway.\n \/\/ also... if needed, we can shift the top tube\n \/\/ up or down 1\/8\" depending in which side we are, and make it work.\n \/\/ have slightly uneven spacers at F, and we are fine\n difference() {\n translate([DE\/2,0,0]) \/\/ top tube\n cube([DE+4,2.54,2.54],center=true);\n\n translate([-1,-.3,0]) cube([5,2.6,2.2],center=true);\n #cylinder(r=.4,h=4,$fn=12,center=true);\n translate([DE,-.3,0]) cube([5,2.6,2.2],center=true);\n #translate([DE,0,0]) cylinder(r=.4,h=4,$fn=12,center=true);\n }\n\n } else {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n }\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n if (squareTop==0) {\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"92839eb854005fa7079455fb0bfb27cb4a206068","subject":"reduce fuzz for spread around holes. current printer does not spread that much","message":"reduce fuzz for spread around holes. current printer does not spread that much\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"HipA\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\nelse if (PART==\"BHs\" ) BHs(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"FootA\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.2; \/\/ extra radius (mm) to add to holes to account for printer slop\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\nelse if (PART==\"BHs\" ) BHs(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+.3,1+.3); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+.3,1+.3); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c396d80560550a1cb8762c4cc95a1d529816899c","subject":"axis\/carriage+extruder: wip","message":"axis\/carriage+extruder: wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cuberounda([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*cuberounda([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cuberounda([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n cuberounda([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#cuberounda([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n cuberounda([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n cuberounda([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*cuberounda([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*cuberounda([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*cuberounda([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_shaft_d = 5*mm;\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_a_h = 14*mm;\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n cuberounda([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*cuberounda([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_guilder_bearing = bearing_625;\nextruder_b_bearing = bearing_MR105;\nmodule extruder_b(show_vitamins=false)\n{\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n difference()\n {\n hull()\n {\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n translate([0,-extruder_b_bearing[2]-5*mm,0])\n cylindera(d=extruder_b_bearing[1]+5*mm, h=abs(extruder_filapath_offset[1]), align=[0,-1,0], orient=[0,1,0]);\n\n }\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0]+3*mm, h=extruder_b_w+1);\n }\n }\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+1*mm, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n scale([1.03,1,1.03])\n bearing(extruder_b_bearing, override_h=6*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([hobbed_gear_d_inner\/2+extruder_guilder_bearing[1]\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([extruder_guilder_bearing[1]+1*mm,extruder_guilder_bearing[2]+1*mm,extruder_guilder_bearing[1]*2], align=[0,0,1]);\n cylindera(d=extruder_guilder_bearing[1]+1*mm, h=extruder_guilder_bearing[2]+1*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 - 2*mm])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=extruder_b_w+1);\n }\n\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([extruder_b_w\/2,0,0])\n translate([0,0,-hobbed_gear_d_outer\/2])\n hotmount_clamp();\n \n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base();\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0]);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n\n \/*if(false)*\/\n translate(extruder_offset)\n {\n extruder_b(show_vitamins=true);\n\n translate(extruder_offset_a)\n {\n %extruder_a(show_vitamins=true);\n }\n }\n\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n\n hotend_conn =[[0,0,30],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\n\/*if(false)*\/\n{\n\/*extruder_a(show_vitamins=true);*\/\n x_carriage();\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z,0], [0,0,0]];\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cuberounda([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*#cubea([top_width,xaxis_carriage_bearing_offset_z,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cuberounda([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n {\n difference()\n {\n translate([0,0,xaxis_pulley_inner_d\/2])\n cuberounda([50, xaxis_carriage_teeth_height, 10], align=[0,0,-1]);\n }\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n translate([0,0,-xaxis_pulley_inner_d\/2])\n cubea([500,xaxis_carriage_teeth_height,5], align=[0,0,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);\n\n belt_thickness=1.5;\n for(i=[-1,1])\n translate([i*30,0,0])\n cubea([15,xaxis_carriage_teeth_height,15-belt_thickness], align=[0,0,0]);\n\n \/\/ Cut in the middle for belt\n cubea([7,xaxis_carriage_teeth_height+.1,15], align=[0,0,0]);\n\n translate([0,0,xaxis_pulley_inner_d\/2])\n {\n \/\/ Belt slit\n cubea([500,xaxis_carriage_teeth_height,belt_thickness], align=[0,0,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 2;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);\n }\n }\n\n }\n\n\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),0,0])\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, -xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n \/\/ Extruder mounting holes\n translate([0,0,xaxis_carriage_mount_offset_z])\n for(j=[-1,1])\n for(i=[-1,1])\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])\n {\n screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);\n cylindera(d=screw_dia, h=100, orient=[0,1,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_holes();\n }\n\n if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([j*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, 0, xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([0, 0, -xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n for(i=[-1,1])\n translate([i*50,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nif(false)\n{\n x_carriage();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7281e335d439e242e470d662b9f1d5b2f992564f","subject":"belt-fastener: minor cleanup in preview","message":"belt-fastener: minor cleanup in preview\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"belt_fastener.scad","new_file":"belt_fastener.scad","new_contents":"include \nuse \nuse \nuse \n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=N, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extra_size=1000*Y, extra_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*mm*Y)\n translate(-12*mm*X)\n {\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n nut_trap_cut(nut=tension_screw_nut, screw_l=6*mm, cut_screw=true, orient=-X, trap_axis=Y);\n }\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extra_size=[0,1000,1*mm], extra_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extra_size=1000*Y, extra_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=xaxis_beltpath_z_offsets)\n {\n tz(z)\n {\n ty(xaxis_carriage_beltpath_offset_y)\n tx(-main_width\/2)\n rx(90)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*proj_extrude_axis(axis=-Y)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)>1?1:0])\n mirror([sign(z)<1?1:0,0,0])\n belt_fastener();\n }\n }\n}\n","old_contents":"include \nuse \nuse \nuse \n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=N, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extra_size=1000*Y, extra_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*mm*Y)\n translate(-12*mm*X)\n {\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n nut_trap_cut(nut=tension_screw_nut, screw_l=6*mm, cut_screw=true, orient=-X, trap_axis=Y);\n }\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extra_size=[0,1000,1*mm], extra_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extra_size=1000*Y, extra_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"76e375872e55af05f2f8cc4c78235ac23f1f2fc6","subject":"first version of box (ugly)","message":"first version of box (ugly)\n","repos":"MrBagheera\/electronic-experiments,MrBagheera\/electronic-experiments","old_file":"LaserAlarm\/Hardware\/Box.scad","new_file":"LaserAlarm\/Hardware\/Box.scad","new_contents":"include \n\nmodule roundedCase(dimensions, wallThickness=3, mountingHoleDepth = 10, mountingHoleR = 1.25) {\n outherDimensions = [dimensions[0] + wallThickness * 4, dimensions[1] + wallThickness * 4, dimensions[2] + wallThickness];\n boardBase = [wallThickness * 2, wallThickness * 2, wallThickness];\n\n difference() {\n \/\/ case\n roundedCube(dimensions = outherDimensions, cornerRadius = wallThickness);\n translate([wallThickness * 2, wallThickness, wallThickness]) cube(size=[dimensions[0], dimensions[1] + wallThickness * 2, dimensions[2] + 1], center=false);\n translate([wallThickness, wallThickness * 2, wallThickness]) cube(size=[dimensions[0] + wallThickness * 2, dimensions[1], dimensions[2] + 1], center=false);\n \/\/ lid mounting holes\n translate([wallThickness, wallThickness, outherDimensions[2] - mountingHoleDepth]) cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n translate([wallThickness, dimensions[1] + wallThickness * 3, outherDimensions[2] - mountingHoleDepth]) cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n translate([dimensions[0] + wallThickness * 3, wallThickness, outherDimensions[2] - mountingHoleDepth]) cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n translate([dimensions[0] + wallThickness * 3, dimensions[1] + wallThickness * 3, outherDimensions[2] - mountingHoleDepth]) cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n \/\/ USB and power jack holes\n translate(boardBase) components(boardType = UNO, component = USB, extension = wallThickness * 2 + 1);\n translate(boardBase) components(boardType = UNO, component = POWER, extension = wallThickness * 2 + 1);\n }\n \/\/ pillars\n translate(boardBase) standoffs(boardType=UNO, height=height, bottomRadius=1.5, topRadius=1.5, holeRadius=0.75);\n}\n\n\nmodule roundedCover(dimensions, wallThickness=3, mountingHoleR = 1.25) {\n outherDimensions = [dimensions[0] + wallThickness * 4, dimensions[1] + wallThickness * 4, wallThickness];\n boardBase = [wallThickness * 2, wallThickness * 2, pcbHeight - dimensions[2]];\n mountingHoleDepth = wallThickness+2;\n\n difference() {\n \/\/ cover\n roundedCube(dimensions = outherDimensions, cornerRadius = wallThickness);\n \/\/ mounting holes\n translate([wallThickness, wallThickness, outherDimensions[2] - mountingHoleDepth]) \n cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n translate([wallThickness, dimensions[1] + wallThickness * 3, outherDimensions[2] - mountingHoleDepth]) \n cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n translate([dimensions[0] + wallThickness * 3, wallThickness, outherDimensions[2] - mountingHoleDepth]) \n cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n translate([dimensions[0] + wallThickness * 3, dimensions[1] + wallThickness * 3, outherDimensions[2] - mountingHoleDepth]) \n cylinder(r = mountingHoleR, $fn = 32, h = mountingHoleDepth + 1);\n }\n}\n\nmodule cylindersCircle(pathRadius, num, r, h) {\n for (i=[1:num]) {\n translate([pathRadius*cos(i*(360\/num)),pathRadius*sin(i*(360\/num)),0]) cylinder(r=r, h=h, $fn=20);\n } \n}\n\n\nwidth=53.3;\ndepth=100;\nheight=20;\nwallThickness=3;\n\n\/\/ case\ntranslate([-wallThickness * 2, -wallThickness * 2, -wallThickness]) roundedCase(dimensions = [width, depth, height], wallThickness = wallThickness);\n\n\/\/ cover\n!translate([-wallThickness * 2, -wallThickness * 2, height]) difference() {\n roundedCover(dimensions = [width, depth, height], wallThickness = wallThickness);\n \/\/ button\n translate([28-7\/2, 55-7\/2, -1]) \n cylinder(d=8, h=wallThickness+2);\n \/\/ 3 LEDs\n translate([38-22, 69-5\/2, -1]) \n roundedCube(dimensions = [23, 6, wallThickness+2], cornerRadius = 3);\n \/\/ 2 alarm LEDs\n translate([10, 90, -1])\n cylinder(d=5, h=wallThickness+2);\n translate([width + wallThickness * 4 - 10, 90, -1])\n cylinder(d=5, h=wallThickness+2);\n \/\/ speaker\n translate([width \/2 + wallThickness * 2, 85 + wallThickness * 2, -1]) {\n cylindersCircle(pathRadius = 12.5, num = 8, r = 0.5, h = wallThickness + 2);\n cylindersCircle(pathRadius = 7.5, num = 8, r = 0.5, h = wallThickness + 2);\n cylindersCircle(pathRadius = 2.5, num = 4, r = 0.5, h = wallThickness + 2);\n }\n}\n\n\n\/\/ sample arduino\n%arduino();\n\n\/\/ sample speaker\n%translate([width \/ 2, 85, height]) rotate([0,180,0]) union() {\n color(\"DarkGray\") { \n cylinder(h=4, d = 30);\n translate([0,0,4]) cylinder(h=4, d = 15);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LaserAlarm\/Hardware\/Box.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c6d360a0b7ed854da047ab9c900e8692d3404a7b","subject":"screw mounts are now put deeper + internal box size is 3mm wider, to fit the box with the screw passes as well","message":"screw mounts are now put deeper + internal box size is 3mm wider, to fit the box with the screw passes as well\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/junction_box.scad","new_file":"led_controler_junction_box\/junction_box.scad","new_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [73, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw holes\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center,\n wall+int_size[1]\/2,\n wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-4);\n translate([(12\/2\/2+2)*(dx-1), -10\/2, 0])\n cube([12\/2+3, 10, int_size[2]-4]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-4-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[0]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","old_contents":"use \nuse \n\nmodule side_bruse_impl()\n{\n for(sig = [-1, +1])\n for(i = [1, 2, 3])\n translate([0, i*18, -1])\n rotate([sig*20, 0, 0])\n cube([3, 2, 26]);\n}\n\nmodule junction_box_impl()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [70, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw holes\n dist_from_center = 59\/2;\n for(dx = [-1, +1])\n {\n translate([(int_size[0]+2*wall)\/2+dx*dist_from_center,\n wall+int_size[1]\/2,\n wall])\n {\n difference()\n {\n \/\/ main screw corridor\n union()\n {\n cylinder(r=10\/2, h=int_size[2]-2);\n translate([12\/2\/2*(dx-1), -10\/2, 0])\n cube([12\/2, 10, int_size[2]-2]);\n }\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n \/\/ nut cut-in\n translate([0, 0, int_size[2]-2-13])\n scale(1.1)\n hull()\n {\n screw();\n translate([0, 9, 0])\n screw();\n translate([0, 9, 7])\n screw();\n }\n }\n }\n }\n\n \/\/ side bruses for better mounting - left\/right\n for(dx = [-3, int_size[0]+2*wall])\n translate([dx, 0, 0])\n side_bruse_impl();\n \/\/ side bruses for better mounting - up\/down\n for(dy = [-3, int_size[0]+2*wall])\n translate([75, dy, 0])\n rotate([0, 0, 90])\n side_bruse_impl();\n}\n\nmodule junction_box()\n{\n difference()\n {\n junction_box_impl();\n translate([-10, -10, -5])\n cube([100,100,5]);\n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"aa0b89be32b61c879669e881b53d3450a2764652","subject":"yaxis\/bearing_mount: reduce ziptie dist","message":"yaxis\/bearing_mount: reduce ziptie dist\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-carriage-bearing-mount.scad","new_file":"y-axis-carriage-bearing-mount.scad","new_contents":"use \ninclude \ninclude \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule yaxis_carriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick;*\/\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n rcubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=4, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,1]];*\/\n\/*attach(c1,yaxis_carriage_bearing_mount_conn_bottom)*\/\n\/*{*\/\n \/*yaxis_carriage_bearing_mount();*\/\n \/*#connector(yaxis_carriage_bearing_mount_conn_bottom);*\/\n\/*}*\/\n","old_contents":"use \ninclude \ninclude \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule yaxis_carriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick;*\/\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n rcubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) cylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,1]];*\/\n\/*attach(c1,yaxis_carriage_bearing_mount_conn_bottom)*\/\n\/*{*\/\n \/*yaxis_carriage_bearing_mount();*\/\n \/*#connector(yaxis_carriage_bearing_mount_conn_bottom);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3b288c3d1cd248dd8c8e4b05e778061f587233e8","subject":"sphere is a weapon","message":"sphere is a weapon\n","repos":"JoeSuber\/QuickerPicker","old_file":"ringpusher.scad","new_file":"ringpusher.scad","new_contents":"cardthick= 41.18\/134;\necho(\"one card thickness (mm) =\", cardthick);\ncardsize=\t[88.05, 63.19, cardthick];\ncardcorner= 5;\nscoopheight=29;\ncardcenter=\tcardsize\/2;\ncardedge=\t[cardsize[0]-cardcorner, cardsize[1]-cardcorner];\necho(\"cardedge =\",cardedge);\n\nmodule singlecard(){\n\tminkowski(){\n\t\tsquare(cardedge, center=true);\n\t\tcircle(cardcorner\/2, $fn=36);\n\t}\n}\n\nmodule squaremm(size, border=3, ht=scoopheight){\n\tdifference(){\n\t\tcube([size, size*cardsize[1]\/cardsize[0], ht], center=true);\n\t\tcube([size-border, size*cardsize[1]\/cardsize[0]-border, ht+.1], center=true);\n\t\techo(\"measurement frame outside is = \",[size,size]);\n\t\techo(\"thickness of walls of frame: \", border\/2); \n\t\techo(\"measurement frame inside is = \",[size-border, size-border]);\n\t\techo(\"height is = \", ht);\n\t}\n}\n\nmodule tray(floorthk=0, scaledif=.05, sideslope=1.4, scooph=scoopheight){\n\ttranslate([0,0,0])\n\tdifference(){\n\t\tunion(){\n\t\t\tlinear_extrude (height=scooph, center=true, convexity=10, twist=0, scale=sideslope){\n\t\t\t\tscale([1+scaledif,1+scaledif,1])\n\t\t\t\t\tsinglecard();\n\t\t\t}\n\t\t\tfor (i=[-cardedge[0]\/2, cardedge[0]\/2]){\n\t\t\t\ttranslate([i,0,0])\n\t\t\t\t\tcube([scooph*(sideslope+scaledif) - scooph*sideslope, \n\t\t\t\t\t\tsideslope*cardsize[1]*(1+scaledif),\n\t\t\t\t\t\tscooph], center=true);\n\t\t\t}\n\t\t}\n\t\ttranslate([0,0,floorthk])\n\t\t\tlinear_extrude (height=scooph*(1+scaledif)+.01, \n\t\t\t\t\t\t\tcenter=true, \n\t\t\t\t\t\t\tconvexity=10,\n\t\t\t\t\t\t\ttwist=0, scale=sideslope){\n\t\t\t\tscale([1,1,1])\n\t\t\t\t\tsinglecard();\n\t\t\t}\n\t\t\/\/singlecard();\t\n\t}\n}\n\n\ntranslate([0,0,0]) minkowski(){ squaremm(cardsize[0]*1.4+3); sphere(r=2, h=3, $fn=36, center=true);}\ntray();\n\n\t\t\n\t","old_contents":"cardthick= 41.18\/134;\necho(\"one card thickness (mm) =\", cardthick);\ncardsize=\t[88.05, 63.19, cardthick];\ncardcorner= 5;\nscoopheight=29;\ncardcenter=\tcardsize\/2;\ncardedge=\t[cardsize[0]-cardcorner, cardsize[1]-cardcorner];\necho(\"cardedge =\",cardedge);\n\nmodule singlecard(){\n\tminkowski(){\n\t\tsquare(cardedge, center=true);\n\t\tcircle(cardcorner\/2, $fn=36);\n\t}\n}\n\nmodule squaremm(size, border=3, ht=scoopheight){\n\tdifference(){\n\t\tcube([size, size*cardsize[1]\/cardsize[0], ht], center=true);\n\t\tcube([size-border, size*cardsize[1]\/cardsize[0]-border, ht+.1], center=true);\n\t\techo(\"measurement frame outside is = \",[size,size]);\n\t\techo(\"thickness of walls of frame: \", border\/2); \n\t\techo(\"measurement frame inside is = \",[size-border, size-border]);\n\t\techo(\"height is = \", ht);\n\t}\n}\n\nmodule tray(floorthk=0, scaledif=.05, sideslope=1.4, scooph=scoopheight){\n\ttranslate([0,0,0])\n\tdifference(){\n\t\tunion(){\n\t\t\tlinear_extrude (height=scooph, center=true, convexity=10, twist=0, scale=sideslope){\n\t\t\t\tscale([1+scaledif,1+scaledif,1])\n\t\t\t\t\tsinglecard();\n\t\t\t}\n\t\t\tfor (i=[-cardedge[0]\/2, cardedge[0]\/2]){\n\t\t\t\ttranslate([i,0,0])\n\t\t\t\t\tcube([scooph*(sideslope+scaledif) - scooph*sideslope, \n\t\t\t\t\t\tsideslope*cardsize[1]*(1+scaledif),\n\t\t\t\t\t\tscooph], center=true);\n\t\t\t}\n\t\t}\n\t\ttranslate([0,0,floorthk])\n\t\t\tlinear_extrude (height=scooph*(1+scaledif)+.01, \n\t\t\t\t\t\t\tcenter=true, \n\t\t\t\t\t\t\tconvexity=10,\n\t\t\t\t\t\t\ttwist=0, scale=sideslope){\n\t\t\t\tscale([1,1,1])\n\t\t\t\t\tsinglecard();\n\t\t\t}\n\t\t\/\/singlecard();\t\n\t}\n}\n\n\ntranslate([0,0,-scoopheight\/2]) squaremm(cardsize[0]);\ntray();\n\n\t\t\n\t","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4fa2099f1c033f951a6ccea6ac4dcd973e80ac16","subject":"screw moved so that it starts at h=0","message":"screw moved so that it starts at h=0\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/screw.scad","new_file":"led_controler_junction_box\/screw.scad","new_contents":"module screw()\n{\n size = 6;\n height=3;\n translate([0, 0, height\/2])\n intersection()\n {\n cube([size, size, height], center=true);\n rotate([0,0,45])\n cube([size, size, height], center=true);\n }\n}\n\n%screw();\n","old_contents":"module screw()\n{\n intersection()\n {\n size = 6;\n height=3;\n cube([size, size, height], center=true);\n rotate([0,0,45])\n cube([size, size, height], center=true);\n }\n}\n\n%screw();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"659393552eb4d445c2342ed044e4f5f19620c77b","subject":"transforms: add spread","message":"transforms: add spread\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(is_bool(m));\n mirror(X*m)\n children();\n}\n\nmodule my(m=true)\n{\n assert(is_bool(m));\n mirror(Y*m)\n children();\n}\n\nmodule mz(m=true)\n{\n assert(is_bool(m));\n mirror(Z*m)\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule spread(axis=N, dist=0, iter=[-1,1])\n{\n assert(is_list(axis));\n assert(is_num(dist));\n assert(is_list(iter));\n\n for(i=iter)\n translate(i*axis*dist)\n children();\n}\n\nmodule spreadx(dist=0)\n{\n spread(axis=X,dist=dist)\n children();\n}\n\nmodule spready(dist=0)\n{\n spread(axis=Y,dist=dist)\n children();\n}\n\nmodule spreadz(dist=0)\n{\n spread(axis=Z,dist=dist)\n children();\n}\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(is_bool(m));\n mirror(X*m)\n children();\n}\n\nmodule my(m=true)\n{\n assert(is_bool(m));\n mirror(Y*m)\n children();\n}\n\nmodule mz(m=true)\n{\n assert(is_bool(m));\n mirror(Z*m)\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"446045a2c03f200c68b0c7af48eb5e20a4b5b5f6","subject":"Fisrt version of a 3D model","message":"Fisrt version of a 3D model\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"kite.scad","new_file":"kite.scad","new_contents":"yaw = 90;\nroll = 0;\npitch=0;\nlineLength=20;\nbearing =90;\nelevation = 45;\nuseNED=-1;\n rotate(a=bearing, v=[0,0,1*useNED]) rotate(a=elevation, v=[0,1*useNED,0]) translate(v=[lineLength,0,0]) rotate(a=-1*elevation, v=[0,1*useNED,0]) rotate(a=-1*bearing, v=[0,0,1*useNED]) rotate(a=yaw ,v=[0,0,1*useNED]) rotate(a=pitch, v=[0,1*useNED,0]) rotate(a=roll, v=[1,0,0]) cube(size=[1,3,0.1]); ","old_contents":"","returncode":1,"stderr":"error: pathspec 'kite.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c04eee9db7c8ade5f1cec509fcc3a8b74490e24a","subject":"add the top end","message":"add the top end\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f96d742e4d536f8fd1a5141e1a6fd18963345783","subject":"main: fix x belts","message":"main: fix x belts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate(90*X)\n belt_path(\n len=main_width+2*(zrod_offset)+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"31203b6dbed7466467f2c1506884fe0ecfd2df6e","subject":"rocket fins added","message":"rocket fins added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/fins.scad","new_file":"water_rocket_launcher\/fins.scad","new_contents":"module fin()\n{\n translate([1\/2, 0, 1])\n rotate([0, -90, 0])\n linear_extrude(1)\n polygon(points=[\n [ 0, 0],\n [40, 0],\n [40, 10],\n [ 0, 30]\n ]);\n \/\/ base\n translate([-4\/2, 0, 0])\n cube([4, 30, 1]);\n}\n\nfor(i=[0:3])\n translate([i*6, 0, 0])\n fin();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'water_rocket_launcher\/fins.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f364961cfd6cc89e7a6451994bb213c8c6d754ef","subject":"Remove rogue echo statement.","message":"Remove rogue echo statement.\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/BumperDev.scad","new_file":"hardware\/sandbox\/BumperDev.scad","new_contents":"include <..\/config\/config.scad>\r\n\r\nDebugCoordinateFrames = true;\r\nDebugConnectors = true;\r\nUseSTL = false;\r\n\r\nshowOtherParts = true;\r\n\r\nif (showOtherParts) {\r\nLogoBotBase_STL();\r\nBasicShell_STL();\r\n}\r\n\r\n\/\/ From MicroSwitch model\r\ndatxoffset = -9.6;\r\ndatyoffset = -1.25;\r\nwidth = 6.6;\r\n\r\nattach(DefConUp, DefConUp, ExplodeSpacing=20)\r\n for (x=[0,1], y=[0,1])\r\n mirror([0,y,0])\r\n mirror([x,0,0])\r\n translate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -17 ])\r\n rotate([0,0,-45])\r\n translate([12.7,8,8]) {\r\n rotate(a=180, v=[0,0,1]) {\r\n MicroSwitchHolder_STL();\r\n\r\n translate([-datxoffset + dw + (Bumper_Pin_Width + 1), datyoffset + width, dw])\r\n mirror([0,1,0])\r\n MicroSwitch();\r\n }\r\n }\r\n\r\nfor (i=[0,1])\r\nmirror([0,i,0])\r\ntranslate([0,0,-7])\r\n Bumper_STL();\r\n\r\n","old_contents":"include <..\/config\/config.scad>\r\n\r\nDebugCoordinateFrames = true;\r\nDebugConnectors = true;\r\nUseSTL = false;\r\n\r\nshowOtherParts = true;\r\n\r\nif (showOtherParts) {\r\nLogoBotBase_STL();\r\nBasicShell_STL();\r\n}\r\n\r\n\/\/ From MicroSwitch model\r\ndatxoffset = -9.6;\r\ndatyoffset = -1.25;\r\nwidth = 6.6;\r\n\r\nattach(DefConUp, DefConUp, ExplodeSpacing=20)\r\n for (x=[0,1], y=[0,1])\r\n mirror([0,y,0])\r\n mirror([x,0,0])\r\n translate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -17 ])\r\n rotate([0,0,-45])\r\n translate([12.7,8,8]) {\r\n rotate(a=180, v=[0,0,1]) {\r\n MicroSwitchHolder_STL();\r\n\r\n translate([-datxoffset + dw + (Bumper_Pin_Width + 1), datyoffset + width, dw])\r\n mirror([0,1,0])\r\n MicroSwitch();\r\n }\r\n }\r\necho(-datxoffset + dw + (Bumper_Pin_Width + 1));\r\nfor (i=[0,1])\r\nmirror([0,i,0])\r\ntranslate([0,0,-7])\r\n Bumper_STL();\r\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1b6e630fef2ff8e29df422208c38534a0abdeed4","subject":"x\/carriage: use rounded cylinders","message":"x\/carriage: use rounded cylinders\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n {\n hull()\n {\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n \/*rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);*\/\n }\n }\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])*\/\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n {\n hull()\n {\n cylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n \/*rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);*\/\n }\n }\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])*\/\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"10dbbccf628dee9d3a88371d3353b9c68ea1e9c0","subject":"pulley: add pulley_height function","message":"pulley: add pulley_height function\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"pulley.scad","new_file":"pulley.scad","new_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nfunction pulley_height(pulley) = pulley[1]==undef?pulley[0]:pulley[1];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?undef:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n cylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n cylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n cylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n cylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n cylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\nif(false)\n{\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);*\/\n pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,-1], flip=false);\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n}\n","old_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?undef:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n cylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n cylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n cylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n cylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n cylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\nif(false)\n{\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);*\/\n pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,-1], flip=false);\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7ee2d383f296713b0282babf27c2ba4c737f2ce8","subject":"shapes\/cuberound: Simplify","message":"shapes\/cuberound: Simplify\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[20,20,20], rounding_radius=1, fn=32)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius, $fn=fn);\n}\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_r = r__;\n\n fn_=fn==undef?(floor(2*(r__)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n fncylindera(h=h, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n fncylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n fncylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n fncylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n\/*fncylindera(h=10, r1=5, r2=10, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\/*fncylindera(h=10, d1=5, d2=30, orient=[0,0,1], align=[0,0,1]);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[10,10,10], facets=32, rounding_radius=1)\n{\n translate(-size\/2)\n hull()\n {\n translate([rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n }\n}\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_r = r__;\n\n fn_=fn==undef?(floor(2*(r__)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n fncylindera(h=h, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n fncylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n fncylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n fncylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n\/*fncylindera(h=10, r1=5, r2=10, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\/*fncylindera(h=10, d1=5, d2=30, orient=[0,0,1], align=[0,0,1]);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"df7fd61c44fe2b1ff4cddd1252fef1ba72f3d68e","subject":"Fix wrong parameter name applied to align() in negativeExtrude()","message":"Fix wrong parameter name applied to align() in negativeExtrude()\n","repos":"jsconan\/camelSCAD","old_file":"operator\/extrude\/negative.scad","new_file":"operator\/extrude\/negative.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that extrude children modules with respect to particular rules.\n *\n * @package operator\/extrude\n * @author jsconan\n *\/\n\n\/**\n * Extrudes linearly the children modules, and apply a wall adjustment to ensure\n * the final object will not produce artifacts after a `difference()` operation.\n *\n * @param Number [height] - The height of the extrusion. If the value is negative,\n * the extrusion will be made top to bottom (below the origin).\n * @param Number|String [direction] - Tells on what sides adjust the height to make sure\n * the difference won't produce dummy walls.\n * @param Boolean [center] - Whether or not center the extrusion on the vertical axis.\n * @param Number [convexity] - If the extrusion fails for a non-trivial 2D shape,\n * try setting the convexity parameter.\n * @param Number [twist] - The number of degrees of through which the shape is extruded.\n * @param Number [slices] - Defines the number of intermediate points along the Z axis\n * of the extrusion.\n * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of\n * the extrusion.\n *\/\nmodule negativeExtrude(height, direction, center, convexity, twist, slices, scale) {\n center = boolean(center);\n convexity = numberOr(convexity, 10);\n height = align(value=height, direction=direction, center=center);\n\n translateZ(height[1]) {\n linear_extrude(height=height[0], center=center, convexity=convexity, twist=twist, slices=slices, scale=scale) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that extrude children modules with respect to particular rules.\n *\n * @package operator\/extrude\n * @author jsconan\n *\/\n\n\/**\n * Extrudes linearly the children modules, and apply a wall adjustment to ensure\n * the final object will not produce artifacts after a `difference()` operation.\n *\n * @param Number [height] - The height of the extrusion. If the value is negative,\n * the extrusion will be made top to bottom (below the origin).\n * @param Number|String [direction] - Tells on what sides adjust the height to make sure\n * the difference won't produce dummy walls.\n * @param Boolean [center] - Whether or not center the extrusion on the vertical axis.\n * @param Number [convexity] - If the extrusion fails for a non-trivial 2D shape,\n * try setting the convexity parameter.\n * @param Number [twist] - The number of degrees of through which the shape is extruded.\n * @param Number [slices] - Defines the number of intermediate points along the Z axis\n * of the extrusion.\n * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of\n * the extrusion.\n *\/\nmodule negativeExtrude(height, direction, center, convexity, twist, slices, scale) {\n center = boolean(center);\n convexity = numberOr(convexity, 10);\n height = align(height=height, direction=direction, center=center);\n\n translateZ(height[1]) {\n linear_extrude(height=height[0], center=center, convexity=convexity, twist=twist, slices=slices, scale=scale) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"03a32713c382e70994b9f4b2b34e0faa32eba04c","subject":"Create CornerMount.scad","message":"Create CornerMount.scad","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"CornerMount.scad","new_file":"CornerMount.scad","new_contents":"\/*\n Modeus 20mm corner mount\n*\/\n\nmodule Cornermount (){\n$fn=50;\n union (){\n difference (){\n \n \n color( \"DarkGray\", 1 ) {\n cube ([39,39,18]) ; \n}\n \n \n \n\/\/ difference starts here \n translate ([2,2,3]){\n cube ([39,39,18]) ;\n } \n \n translate ([39,2,-1]){\n rotate ([0,0,45]){\n cube ([55,55,22]) ;\n }}\n \n hull() {\n translate ([9,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }} \n translate ([14,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }}} \n \n hull() {\n translate ([27,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }} \n translate ([32,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }}} \n \n rotate ([0,0,90]){\n hull() {\n translate ([9,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }} \n translate ([14,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }}} \n \n hull() {\n translate ([27,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }} \n translate ([32,-3,9]){\n rotate ([270,0,0]){\n cylinder(h = 20, d = 5, center = false);\n }}} \n }\n \n \n}\n\n\n\/\/ bults\n translate ([12,5,9]){\n rotate ([90,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n }\n \n }}\n translate ([30,5,9]){\n rotate ([90,0,0]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n } \n }}\n translate ([5,30,9]){\n rotate ([270,0,90]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n } \n }}\n translate ([5,12,9]){\n rotate ([270,0,90]){\n difference (){ \n \n union (){\n color( \"Silver\", 1 ) {\n cylinder(h = 3, d = 8, center = false); \n cylinder(h = 12, d = 4, center = false); \n }}\n translate ([0,0,-2]){\n cylinder(h = 4, d = 5, $fn=6, center = false);\n \n }\n } \n }}\n \n \n}\n}\n\n\/*\nplacing mounts\n*\/\ntranslate ([20,1,35]) {\nrotate ([90,270,180]){\nCornermount ();\n}}\ntranslate ([20,1,105]) {\nrotate ([90,270,180]){\nCornermount ();\n}}\n\ntranslate ([420,1,35]) {\nrotate ([90,0,180]){\nCornermount ();\n}}\ntranslate ([420,1,105]) {\nrotate ([90,0,180]){\nCornermount ();\n}}\n\ntranslate ([20,1,300]) {\nrotate ([90,180,180]){\nCornermount ();\n}}\ntranslate ([420,1,300]) {\nrotate ([90,90,180]){\nCornermount ();\n}}\n\ntranslate ([20,339,35]) {\nrotate ([90,0,0]){\nCornermount ();\n}}\n\ntranslate ([420,339,35]) {\nrotate ([90,270,0]){\nCornermount ();\n}}\n\n\ntranslate ([20,339,300]) {\nrotate ([90,90,0]){\nCornermount ();\n}}\ntranslate ([420,339,300]) {\nrotate ([90,180,0]){\nCornermount ();\n}}\n\n\ntranslate ([1,20,105]) {\nrotate ([90,0,90]){\nCornermount ();\n}}\ntranslate ([1,320,300]) {\nrotate ([270,0,270]){\nCornermount ();\n}}\n\ntranslate ([1,20,300]) {\nrotate ([90,90,90]){\nCornermount ();\n}}\ntranslate ([1,320,105]) {\nrotate ([90,270,90]){\nCornermount ();\n}}\n\n\ntranslate ([439,319,300]) {\nrotate ([270,90,90]){\nCornermount ();\n}}\ntranslate ([439,20,105]) {\nrotate ([270,270,90]){\nCornermount ();\n}}\ntranslate ([439,20,300]) {\nrotate ([270,0,90]){\nCornermount ();\n}}\ntranslate ([439,319,105]) {\nrotate ([270,180,90]){\nCornermount ();\n}}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CornerMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"8b125fa13779ddd5790fa47b0b4ae29c6e18ccab","subject":"cadcorn update","message":"cadcorn update\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"vor-3d-models\/cadcorn.scad","new_file":"vor-3d-models\/cadcorn.scad","new_contents":"\/\/ Cadcorn, a parametric model of a 3D-printable unicorn\n\/\/ \u00a92015 Paul Houghton, paul.houghton@futurice.com, CC-attribution-sharealike license, http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\nlow_poly = 8;\nhigh_poly = 128;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nhair_thickness = mane_thickness \/ 8;\nhair_spacing = mane_thickness \/ 2;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\ntail_thickness = mane_thickness;\ntail_radius = 10 * hair_thickness;\ntail_x = 2*body_x + body_length - tail_radius;\ntail_height = -body_z + 1.7*tail_radius;\ntail_tip_length = 29*scale;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\ncadcorn(poly=low_poly);\n\nmodule cadcorn(poly=high_poly) {\n union() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head(p=poly);\n\/\/ horn(); \/\/ Uncomment either horn() or chili_horn or neither\n color(\"red\") chili_horn();\n neck(p=poly);\n mane(p=poly);\n body(p=poly);\n leg(p=poly, theta=5, sideways=3*scale);\n cute_leg(p=poly, theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(p=poly, lengthwards = body_length, sideways=2*scale, theta=15);\n leg(p=poly, lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail(p=poly);\n }\n base(p=poly);\n }\n}\n\nmodule head(p=high_poly) {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere($fn=p, r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere($fn=p, r=head_small_radius); \n }\n }\n}\n\nmodule horn(p=high_poly) {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder($fn=p, h=horn_length, r1=horn_radius, r2=0);\n }\n}\n\nmodule chili_horn(p=high_poly) {\n rotate([0, -head_angle, 0]) {\n z = 1.1*scale + head_big_radius - .2*scale;\n translate([0, 0, z])\n hull() {\n sphere($fn=p, r=horn_radius);\n translate([0, 0, horn_length\/3])\n sphere($fn=p, r=horn_radius*.8);\n }\n translate([0, 0, z + horn_length\/3])\n hull() {\n sphere($fn=p, r=horn_radius*.8);\n rotate([0, -10, 0]) {\n translate([0, 0, 3*horn_length\/6])\n sphere($fn=p, r=horn_radius*.6);\n }\n }\n }\n}\n\nmodule neck(p=high_poly) {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder($fn=p, h=head_big_radius - .2*scale, r1=neck_radius, r2=neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere($fn=p, r=body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule hair_line(p=high_poly, x=0, z=0, hair_radius=mane_radius, delta_x=body_x, delta_z=body_z) {\n translate([x, 0, z])\n difference() {\n hull() {\n cylinder($fn=p, h=mane_thickness, r=hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder($fn=p, h=mane_thickness, r=hair_radius);\n }\n hull() {\n cylinder($fn=p, h=mane_thickness, r=hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder($fn=p, h=mane_thickness, r=hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane(p=high_poly) {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder($fn=p, h=mane_thickness - 2*hair_thickness, r=mane_radius);\n translate([body_x, -body_z, 0])\n cylinder($fn=p, h=mane_thickness - 2*hair_thickness, r=mane_radius);\n }\n hair_line(p=p);\n hair_line(p=p, hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body(p=high_poly) {\n translate([body_x, 0, -body_z])\n hull() {\n sphere($fn=p, r=body_radius);\n translate([body_length, 0, 0]) \n sphere($fn=p, r=body_back_radius);\n }\n}\n\nmodule leg(p=high_poly, lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder($fn=p, h=leg_length, r1=leg_radius, r2=leg_radius);\n }\n}\n\nmodule cute_leg(p=high_poly, lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder($fn=p, h=leg_length*cute_leg_first_ratio, r1=leg_radius, r2=leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere($fn = 2*p, r=leg_radius);\n rotate([0, 90, 0]) {\n cylinder($fn=p, h=leg_length*cute_leg_second_ratio, r1=leg_radius, r2=leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere($fn=2*p, r=leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder($fn=p, h=leg_length*cute_leg_third_ratio, r1=leg_radius, r2=leg_radius);\n }\n }\n }\n }\n}\n\nmodule tail_outer_hair(p=high_poly) {\n translate([0, 0, -hair_thickness])\n difference() {\n hull() {\n cylinder($fn=p, h=tail_thickness, r=tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness]);\n }\n }\n hull() {\n cylinder($fn=p, h=tail_thickness, r=tail_radius - hair_spacing);\n translate([body_x + 2*hair_spacing, -1.2*body_z + hair_spacing, 0]) rotate([0, 0, 11]) {\n cube([tail_tip_length - 2.8*hair_spacing, tail_tip_length - 2.8*hair_spacing, tail_thickness]);\n }\n }\n }\n}\n\nmodule tail_single_hair(p=high_poly, n=1) {\n translate([0, -4.5*n, -hair_thickness])\n rotate([0, 0, -15*n]) {\n difference() {\n hull() {\n cylinder($fn=p, h=tail_thickness, r=tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness]);\n }\n }\n union() {\n hull() {\n cylinder($fn=p, h=tail_thickness, r=tail_radius - hair_spacing);\n translate([body_x + 2*hair_spacing, -1.2*body_z + hair_spacing, 0]) rotate([0, 0, 11]) {\n cube([tail_tip_length - 2.8*hair_spacing, tail_tip_length - 2.8*hair_spacing, tail_thickness]);\n }\n }\n rotate([50, 90, 0]) {\n translate([-3*scale, -7*scale, 0]) cylinder($fn=p, r=6*scale, h=40*scale);\n }\n }\n }\n }\n}\n\nmodule tail(p=high_poly) {\n translate([tail_x, tail_thickness\/2 - hair_thickness, tail_height])\n rotate([90, 0, 0]) {\n intersection() {\n union() {\n hull() {\n cylinder($fn=p, h=tail_thickness - 2*hair_thickness, r=tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness - 2*hair_thickness]);\n }\n }\n tail_outer_hair(p=p);\n tail_single_hair(p=p, n=1);\n tail_single_hair(p=p, n=2);\n }\n translate([0, 0, -hair_thickness])\n cylinder($fn = 2*p, h=10*scale+tail_thickness, r=tail_tip_length*1.25);\n }\n }\n}\n\nmodule base(p=high_poly) {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder($fn=p, h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n","old_contents":"\/\/ Cadcorn, a parametric model of a 3D-printable unicorn\n\/\/ \u00a92015 Paul Houghton, paul.houghton@futurice.com, CC-attribution-sharealike license, http:\/\/creativecommons.org\/licenses\/by-sa\/4.0\/\nlow_poly = 8;\nhigh_poly = 64;\nlow_poly_joint = 16;\nhigh_poly_joint = 64;\n\n$fn=low_poly; \/\/ low_poly or high_poly\njoint_poly = low_poly_joint; \/\/ low_poly_join or high_poly_joint\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nhair_thickness = mane_thickness \/ 8;\nhair_spacing = mane_thickness \/ 2;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\ntail_thickness = mane_thickness;\ntail_radius = 10 * hair_thickness;\ntail_x = 2*body_x + body_length - tail_radius;\ntail_height = -body_z + 1.7*tail_radius;\ntail_tip_length = 29*scale;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule chili_horn() {\n rotate([0, -head_angle, 0]) {\n z = 1.1*scale + head_big_radius - .2*scale;\n translate([0, 0, z])\n hull() {\n sphere(r = horn_radius);\n translate([0, 0, horn_length\/3])\n sphere(r = horn_radius * .8);\n }\n translate([0, 0, z + horn_length\/3])\n hull() {\n sphere(r = horn_radius * .8);\n rotate([0, -10, 0]) {\n translate([0, 0, 3*horn_length\/6])\n sphere(r = horn_radius * .6);\n }\n }\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule hair_line(x = 0, z = 0, hair_radius = mane_radius, delta_x = body_x, delta_z = body_z) {\n translate([x, 0, z])\n difference() {\n hull() {\n cylinder(h = mane_thickness, r = hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius);\n }\n hull() {\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n }\n hair_line();\n hair_line(hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere($fn = joint_poly, r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere($fn = joint_poly, r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nmodule tail_outer_hair() {\n translate([0, 0, -hair_thickness])\n difference() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness]);\n }\n }\n hull() {\n cylinder(h = tail_thickness, r = tail_radius - hair_spacing);\n translate([body_x + 2*hair_spacing, -1.2*body_z + hair_spacing, 0]) rotate([0, 0, 11]) {\n cube([tail_tip_length - 2.8*hair_spacing, tail_tip_length - 2.8*hair_spacing, tail_thickness]);\n }\n }\n }\n}\n\nmodule tail_single_hair(n=1) {\n translate([0, -4.5*n, -hair_thickness])\n rotate([0, 0, -15*n]) {\n difference() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness]);\n }\n }\n union() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius - hair_spacing);\n translate([body_x + 2*hair_spacing, -1.2*body_z + hair_spacing, 0]) rotate([0, 0, 11]) {\n cube([tail_tip_length - 2.8*hair_spacing, tail_tip_length - 2.8*hair_spacing, tail_thickness]);\n }\n }\n rotate([50, 90, 0]) {\n translate([-3*scale, -7*scale, 0]) cylinder(r = 6*scale, h = 40*scale);\n }\n }\n }\n }\n}\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2 - hair_thickness, tail_height])\n rotate([90, 0, 0]) {\n intersection() {\n union() {\n hull() {\n cylinder(h = tail_thickness - 2*hair_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness - 2*hair_thickness]);\n }\n }\n tail_outer_hair();\n tail_single_hair(n=1);\n tail_single_hair(n=2);\n }\n translate([0, 0, -hair_thickness])\n cylinder($fn = 16, h = 10*scale+tail_thickness, r = tail_tip_length*1.25);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder($fn = joint_poly, h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n\nunion() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n\/\/ horn(); \/\/ Uncomment either horn() or chili_horn or neither\n color(\"red\") chili_horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n base();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b387a96fcc28363f19a166905cbecdf126a868b9","subject":"parameterize the x and y scale","message":"parameterize the x and y scale\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/christmas-story-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/christmas-story-lamp-shade.scad","new_contents":"\nuse <..\/..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nuse <..\/..\/lamp-shade.scad>\n\nmodule legLampShade(squareLength, \n outerRadius,\n xScale,\n yScale)\n{\n bottomHeight = 5;\n\n union(outerRadius)\n {\n translate([0, 0, bottomHeight])\n legLamp_shade_top(squareLength = squareLength, \n outerRadius = outerRadius,\n xScale = xScale,\n yScale = yScale);\n\n color(\"purple\")\n legLamp_shade_bottom(height = bottomHeight, outerRadius = outerRadius * 2);\n }\n}\n\nmodule legLamp_shade_bottom(height, outerRadius)\n{\n innerRadius = outerRadius - 1;\n\n openCylinder(height = height,\n innerRadius = innerRadius,\n outerRadius = outerRadius);\n}\n\nmodule legLamp_shade_top(squareLength, outerRadius, xScale, yScale)\n{\n zTranslate = outerRadius * yScale;\n\n translate([0, 0, zTranslate])\n lampShade(outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n}\n","old_contents":"\nuse <..\/..\/..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nuse <..\/..\/lamp-shade.scad>\n\nmodule legLampShade(squareLength, \n outerRadius,\n xScale,\n yScale)\n{\n bottomHeight = 5;\n\n union(outerRadius)\n {\n translate([0, 0, bottomHeight])\n legLamp_shade_top(squareLength = squareLength, \n outerRadius = outerRadius,\n xScale = xScale,\n yScale = yScale);\n\n color(\"purple\")\n legLamp_shade_bottom(height = bottomHeight, outerRadius = outerRadius * 2);\n }\n}\n\nmodule legLamp_shade_bottom(height, outerRadius)\n{\n innerRadius = outerRadius - 1;\n\n openCylinder(height = height,\n innerRadius = innerRadius,\n outerRadius = outerRadius);\n}\n\nmodule legLamp_shade_top(squareLength, outerRadius, xScale, yScale)\n{\n zTranslate = outerRadius * 0.7; \/\/ 2.0 ;\/\/ + ( 10 \/ 2.0 );\n\n translate([0, 0, zTranslate])\n lampShade(outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = 0.3,\n yScale = 0.7);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"72222c93b96b6b23a5d5aafdbc6fa1245a160865","subject":"spelling","message":"spelling\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library2d.scad","new_file":"library2d.scad","new_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Hollowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\n","old_contents":"\/\/Simple Objects\nmodule ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\n\/\/Translation Modules\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x=0,rotation=90,off=0) {\n\tfor(i=[0:360\/rotation-1])rotate(a=[0,0,rotation*i+off])translate([x,0])children();\n}\n\/\/Support for Holowed Models\nmodule support(comb=false) {\n intersection() {\n if(comb==false)support_raw();\n if(comb==true)support_honeycomb();\n children();\n }\n}\nmodule support_raw(x=20,y=20,d=1.1,t=0.15) {\n for(i=[-1,1])for(j=[0:d:x\/2])translate([i*j,0])square([t,y],center=true);\n for(i=[-1,1])for(j=[0:d:x\/2])translate([0,i*j])square([x,t],center=true);\n}\nmodule support_honeycomb(x=10,y=10,r=0.7,d=0.1,fn=6) {\n for(k=[-1,1])for(l=[0:2*(r+r*sin(30)-d):x]){\n for(i=[1,-1])for(j=[0:2*r*cos(30)-d:y]) {\n translate([k*l,i*j])comb(r,d,fn);\n translate([k*(l+r+r*sin(30)-d),i*(j+cos(30)*r-0.5*d)])comb(r,d,fn);\n }\n }\n}\nmodule comb(r,d,fn) {\n difference() {\n circle(r=r,$fn=fn);\n circle(r=r-d,$fn=fn);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"7134b85fa34c272b5226c61779fb5cc1b06e2c2f","subject":"tow line blocker + additional wall thickness","message":"tow line blocker + additional wall thickness\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"anycubic_chiron\/tow_line_blocker\/tow_line_blocker.scad","new_file":"anycubic_chiron\/tow_line_blocker\/tow_line_blocker.scad","new_contents":"eps = 0.1;\nth0 = 2.4; \/\/ original thickness\ndth = 4; \/\/ extra thickness for the model\nth = th0 + dth;\nh = 10;\n\nfi = 3.5; \/\/ fi of screw\nx1 = 18.5;\ny2 = 16.75;\nx3 = 12.4;\n\n\/\/ screw block\ntranslate([0, -th, 0])\n difference()\n {\n cube([x1, th, h]);\n translate([x1 - 10.5 - fi\/2, -eps, h\/2])\n rotate([-90, 0, 0])\n cylinder(r=fi\/2, h=th+2*eps, $fn=30);\n }\n\n\/\/ connector\ntranslate([x1-th, -y2, 0])\n cube([th, y2, h]);\n\n\/\/ block\ntranslate([-dth, 0, 0])\n translate([x1-th0, -y2-th+th0, 0])\n cube([x3+dth, th, h]);\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2bc285ffbefbc17e7c98172813e79917bdd9f448","subject":"preparing structure","message":"preparing structure\n","repos":"fponticelli\/smallbridges","old_file":"resin\/structure.scad","new_file":"resin\/structure.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n$detailed = false;\n\noffset_depth = 50;\n\ntranslate([0, 0, -offset_depth])\n center_projector() {\n Acer_Plate(200, 120, 60, 100);\n Acer_H6510BD(true);\n }\n\nwidth = 480;\noffset = 5;\nheight = 500;\nbeam_width = width - 2 * (20 + offset);\n\ntranslate([0, 0, -offset_depth]) {\n translate([-beam_width\/2,-60,-10])\n rotate([90,90,90])\n profile_20x60(beam_width);\n\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile_20x40(height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile_20x40(height);\n}\n\n\/\/ base\nbase_depth = 400;\nmodule base(width, depth, sections = 2) {\n profile_height = sections * 20;\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n}\n\nbottom_sections = 4;\ntranslate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\nmiddle_sections = 2;\ntranslate([0,(height+middle_sections*20)\/2,0])\n base(width, base_depth, middle_sections);\n\n\n\/\/ support towers\ntower_pos = base_depth \/ 2 - 20;\ntranslate([-width\/2,-height\/2,-tower_pos])\n rotate([-90,0,0])\n profile_20x40(height);\ntranslate([width\/2,-height\/2,-tower_pos])\n rotate([-90,0,0])\n profile_20x40(height);\n\n\/*\nlen = 270;\ntranslate([-20,60,-len])\n profile_20x20(len);\ntranslate([-20,140,-len])\n profile_20x20(len);\n\ntranslate([50, 0, 0])\n profile_20x40(100);\n\ntranslate([100, 0, 0])\n profile_20x60(100);\n\ntranslate([150, 0, 0])\n profile_20x80(100);\n*\/","old_contents":"use ;\nuse ;\ninclude ;\n\n$detailed = false;\n\ntranslate([0,0,0]) {\n Acer_Plate(200, 120, 60, 100);\n Acer_H6510BD(true);\n}\n\n\/*\nlen = 270;\ntranslate([-20,60,-len])\n profile_20x20(len);\ntranslate([-20,140,-len])\n profile_20x20(len);\n\ntranslate([50, 0, 0])\n profile_20x40(100);\n\ntranslate([100, 0, 0])\n profile_20x60(100);\n\ntranslate([150, 0, 0])\n profile_20x80(100);\n*\/","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c1cd5c2a59fa9f83e4b6c07fdb8354ec12adf0e6","subject":"screw diamater - 1mm of spacing instead of 0.5mm, to make sure screwing it in will not deform hole and create weaknesses","message":"screw diamater - 1mm of spacing instead of 0.5mm, to make sure screwing it in will not deform hole and create weaknesses\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"loudspeaker_mount\/loudspeaker_mount.scad","new_file":"loudspeaker_mount\/loudspeaker_mount.scad","new_contents":"eps=0.1;\n\nmodule mount()\n{\n wall=5;\n screw_d=3.5+1;\n ls_dim=[236+1, 162+1];\n ls_border=11.6-2;\n mount_len=60;\n mount_size=[30, 2*wall, mount_len+wall];\n\n module body_mount()\n {\n difference()\n {\n cube([ls_dim[0]+2*wall, ls_dim[1]+1*wall, mount_len+wall]);\n translate(wall*[1,1,1])\n cube([ls_dim[0], ls_dim[1]+eps, mount_len+eps]);\n translate(wall*[2,2,0]-[0,0,eps])\n cube([ls_dim[0]-2*wall, ls_dim[1]-1*wall+eps, wall+2*eps]);\n }\n }\n\n module screw_mount()\n {\n module screw()\n {\n rotate([-90, 0, 0])\n union()\n {\n $fn=50;\n cylinder(r1=(2*screw_d)\/2, r2=screw_d\/2, h=5);\n translate([0, 0, 5-eps])\n cylinder(r=screw_d\/2, h=5+eps+10);\n }\n }\n\n translate([-mount_size[0], 0, 0])\n difference()\n {\n cube(mount_size);\n for(i=[-1,0,+1])\n translate([mount_size[0]\/2, -eps, mount_size[2]\/2+i*18])\n screw();\n }\n }\n\n body_mount();\n for(i=[0,1])\n translate([i*(ls_dim[0]+2*wall+mount_size[0]), ls_dim[1]-wall, 0])\n screw_mount();\n}\n\nmount();\n","old_contents":"eps=0.1;\n\nmodule mount()\n{\n wall=5;\n screw_d=4;\n ls_dim=[236+1, 162+1];\n ls_border=11.6-2;\n mount_len=60;\n mount_size=[30, 2*wall, mount_len+wall];\n\n module body_mount()\n {\n difference()\n {\n cube([ls_dim[0]+2*wall, ls_dim[1]+1*wall, mount_len+wall]);\n translate(wall*[1,1,1])\n cube([ls_dim[0], ls_dim[1]+eps, mount_len+eps]);\n translate(wall*[2,2,0]-[0,0,eps])\n cube([ls_dim[0]-2*wall, ls_dim[1]-1*wall+eps, wall+2*eps]);\n }\n }\n\n module screw_mount()\n {\n module screw()\n {\n rotate([-90, 0, 0])\n union()\n {\n $fn=50;\n cylinder(r1=(2*screw_d)\/2, r2=screw_d\/2, h=5);\n translate([0, 0, 5-eps])\n cylinder(r=screw_d\/2, h=5+eps+10);\n }\n }\n\n translate([-mount_size[0], 0, 0])\n difference()\n {\n cube(mount_size);\n for(i=[-1,0,+1])\n translate([mount_size[0]\/2, -eps, mount_size[2]\/2+i*18])\n screw();\n }\n }\n\n body_mount();\n for(i=[0,1])\n translate([i*(ls_dim[0]+2*wall+mount_size[0]), ls_dim[1]-wall, 0])\n screw_mount();\n}\n\nmount();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5da68aedc901028a223b443372e7f6599cb2d053","subject":"Some todo items were documented.","message":"Some todo items were documented.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/name-tags\/nametag.scad","new_file":"OpenSCAD\/name-tags\/nametag.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\n\/\/TODO: rename this to leftIconType, and make a new one that is rightIconType\r\n\/\/ then pass in the iconType as part of the parameters to the oneIcon() module\r\niconType = \"Trooper\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat]\r\n\r\n\/\/TODO: update the logic to look out for two a left and right icon scale\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n","old_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconType = \"Trooper\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat]\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"033222e87ec18804fbceb122ada3ed1f06359d82","subject":"Edited header, and removed module call up.","message":"Edited header, and removed module call up.\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/MicroSwitch.scad","new_file":"hardware\/vitamins\/MicroSwitch.scad","new_contents":"\/\/ MicroSwitch v1.0 by Gyrobot\r\n\/\/ http:\/\/www.gyrobot.co.uk\r\n\/\/\r\n\/\/ Default values based upon :\r\n\/\/ Farnell P\/N : 2352329\r\n\/\/ Omron Electronic Components P\/N : SS-01GLT\r\n\/\/\r\n\/\/ Datum X is centre of mounting hole with X pointing away from mounting slot.\r\n\/\/ Datum Y is pointing away from terminals towards the lever.\r\n\/\/ Datum Z is in on base of model.\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ ms_length = Length of body in X.\r\n\/\/ ms_width = Width of body in Y.\r\n\/\/ ms_height = Height (thickness) of body in Z.\r\n\/\/ ms_datxoffset = X Position of lower left corner of body from Datum hole.\r\n\/\/ ms_datyoffset = Y Position of lower left corner of body from Datum hole.\r\n\/\/ ms_orientation = Defines whether the switch is mounted left or right (0:1).\r\n\/\/ ms_hole_diam = Size of Datum mounting hole and slot width of second hole.\r\n\/\/ ms_xholepitch = Mounting hole X pitch.\r\n\/\/ ms_yholepitch = Mounting hole Y pitch.\r\n\/\/ ms_hole_slot_length = Slot length of second mounting hole.\r\n\/\/ ms_lever_length = Length of lever.\r\n\/\/ ms_lever_width = Width of lever.\r\n\/\/ ms_lever_thickness = Thickness of lever.\r\n\/\/ ms_lever_height = Height of lever (OP) from Datum hole.\r\n\/\/ ms_tab_length = Length of terminal tab from Datum hole.\r\n\/\/ ms_tab_width = Width of terminal tab.\r\n\/\/ ms_tab_thickness = Thickness of terminal tab.\r\n\/\/ ms_tab_hole_diam = Diameter of terminal tab hole.\r\n\/\/\r\n\r\nmodule microswitch(ms_length = 19.8, ms_width = 10.2, ms_height = 6.4, ms_datxoffset = -14.6, ms_datyoffset = -2.5, ms_orientation = 0, ms_hole_diam = 2.35, ms_xholepitch = 9.5, ms_yholepitch = 0, ms_hole_slot_length = 0.15, ms_lever_length = 14.5, ms_lever_width = 3.6, ms_lever_thickness = 0.3, ms_lever_height = 8.8, ms_tab_length = 6.4, ms_tab_width = 3.2, ms_tab_thickness = 0.3, ms_tab_hole_diam = 1.6){\r\n\r\n\tcutout_offset = 0.7;\r\n\tfoot_offset = ms_datyoffset - 0.4;\r\n\r\n\tmirror ([ms_orientation, 0, 0]){\r\n\t\t\/\/ Mirror to provide a left or right mounted switch.\r\n\t\t\/\/\r\n\t\ttranslate ([ms_datxoffset, ms_datyoffset, ms_height \/ 2]){\r\n\t\t\t\/\/Move datum position.\r\n\t\t\t\/\/\r\n\t\t\tcolor(\"DarkSlateGray\")\r\n\t\t\tlinear_extrude(ms_height, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Body\r\n\t\t\t\t\/\/\r\n\t\t\t\tdifference(){\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/Main body cuboid.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Subtractive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\ttranslate ([ms_length \/ 2, ms_width - cutout_offset]) \/\/ Move corner cutout.\r\n\t\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/ Corner cutout.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset]) \/\/ Move datum hole.\r\n\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32); \/\/ Remove datum hole.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch]){ \/\/ Move second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/ Second mounting hole (slot)\r\n\t\t\t\t\t\t\thull(){\r\n\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t\ttranslate ([ms_hole_slot_length, 0]) \/\/ Move circle to create slot.\r\n\t\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcolor(\"Silver\")\r\n\t\t\tlinear_extrude(ms_lever_width, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Lever\r\n\t\t\t\t\/\/\r\n\t\t\t\ttranslate([2.5 ,+ ms_lever_height - ms_datyoffset,0]) \/\/ Move lever to position\r\n\t\t\t\t\tmirror([0, 1, 0]) \/\/ Mirror lever to invert shape\r\n\t\t\t\t\t\tunion (){\r\n\t\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\t\tsquare ([ms_lever_length + 2.5 , ms_lever_thickness]);\r\n\t\t\t\t\t\t\tsquare ([ms_lever_thickness,ms_width \/ 2]);\r\n\t\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( x = [1.6, 10.4, 17.7]){\r\n\t\t\t\tcolor (\"Silver\")\r\n\t\t\t\ttranslate ([x, -ms_tab_length - ms_datyoffset, 0])\r\n\t\t\t\t\tterminal(ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/\r\n\/\/ Terminal module for solder pad. Other terminal types are available. \r\n\/\/\r\n\r\nmodule terminal (ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam){\r\n\trotate ([0,90,0]){\r\n\t\ttranslate ([ms_tab_width \/ -2,0,0]) {\r\n\t\t\tlinear_extrude(ms_tab_thickness, center=true){\r\n\t\t\t\tdifference (){\r\n\t\t\t\t\tsquare ([ms_tab_width , ms_tab_length]);\r\n\t\t\t\t\ttranslate ([ms_tab_width \/ 2, ms_tab_width \/ 2, 0])\r\n\t\t\t\t\t\tcircle (d = ms_tab_hole_diam, $fn = 32);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n","old_contents":"\/\/ MicroSwitch v1.0 by Gyrobot\r\n\/\/ http:\/\/www.gyrobot.co.uk\r\n\/\/\r\n\/\/ Default values based upon :\r\n\/\/ Farnell P\/N : 2352329\r\n\/\/ Omron Electronic Components P\/N : SS-01GLT\r\n\/\/\r\n\/\/ Datum X is centre of mounting hole with X pointing away from mounting slot.\r\n\/\/ Datum Y is pointing away from terminals towards the lever.\r\n\/\/ Datum Z is in on base of model.\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ ms_length \t\t\t= Length of body in X.\r\n\/\/ ms_width \t\t\t= Width of body in Y.\r\n\/\/ ms_height \t\t\t= Height (thickness) of body in Z.\r\n\/\/ ms_datxoffset\t\t= X Position of lower left corner of body from Datum hole.\r\n\/\/ ms_datyoffset \t\t= Y Position of lower left corner of body from Datum hole.\r\n\/\/ ms_orientation\t\t= Defines whether the switch is mounted left or right (0:1).\r\n\/\/ ms_hole_diam\t\t= Size of Datum mounting hole and slot width of second hole.\r\n\/\/ ms_xholepitch\t\t= Mounting hole X pitch.\r\n\/\/ ms_yholepitch\t\t= Mounting hole Y pitch.\r\n\/\/ ms_hole_slot_length\t= Slot length of second mounting hole.\r\n\/\/ ms_lever_length\t\t= Length of lever.\r\n\/\/ ms_lever_width\t\t= Width of lever.\r\n\/\/ ms_lever_thickness\t= Thickness of lever.\r\n\/\/ ms_lever_height\t\t= Height of lever (OP) from Datum hole.\r\n\/\/ ms_tab_length\t\t= Length of terminal tab from Datum hole.\r\n\/\/ ms_tab_width\t\t= Width of terminal tab.\r\n\/\/ ms_tab_thickness\t= Thickness of terminal tab.\r\n\/\/ ms_tab_hole_diam\t= Diameter of terminal tab hole.\r\n\/\/\r\n\r\nmodule microswitch(ms_length = 19.8, ms_width = 10.2, ms_height = 6.4, ms_datxoffset = -14.6, ms_datyoffset = -2.5, ms_orientation = 0, ms_hole_diam = 2.35, ms_xholepitch = 9.5, ms_yholepitch = 0, ms_hole_slot_length = 0.15, ms_lever_length = 14.5, ms_lever_width = 3.6, ms_lever_thickness = 0.3, ms_lever_height = 8.8, ms_tab_length = 6.4, ms_tab_width = 3.2, ms_tab_thickness = 0.3, ms_tab_hole_diam = 1.6){\r\n\r\n\tcutout_offset = 0.7;\r\n\tfoot_offset = ms_datyoffset - 0.4;\r\n\r\n\tmirror ([ms_orientation, 0, 0]){\r\n\t\t\/\/ Mirror to provide a left or right mounted switch.\r\n\t\t\/\/\r\n\t\ttranslate ([ms_datxoffset, ms_datyoffset, ms_height \/ 2]){\r\n\t\t\t\/\/Move datum position.\r\n\t\t\t\/\/\r\n\t\t\tcolor(\"DarkSlateGray\")\r\n\t\t\tlinear_extrude(ms_height, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Body\r\n\t\t\t\t\/\/\r\n\t\t\t\tdifference(){\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/Main body cuboid.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch])\r\n\t\t\t\t\t\t\tsquare ([ms_hole_diam, foot_offset * -2], center=true);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tunion(){\r\n\t\t\t\t\t\t\/\/Add all Subtractive profiles together, place any extras here.\r\n\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\ttranslate ([ms_length \/ 2, ms_width - cutout_offset]) \/\/ Move corner cutout.\r\n\t\t\t\t\t\t\tsquare ([ms_length, ms_width]); \/\/ Corner cutout.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset, -ms_datyoffset]) \/\/ Move datum hole.\r\n\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32); \/\/ Remove datum hole.\r\n\t\t\t\t\t\ttranslate ([-ms_datxoffset - ms_xholepitch - ms_hole_slot_length \/ 2, -ms_datyoffset + ms_yholepitch]){ \/\/ Move second mounting hole (slot)\r\n\t\t\t\t\t\t\t\/\/ Second mounting hole (slot)\r\n\t\t\t\t\t\t\thull(){\r\n\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t\ttranslate ([ms_hole_slot_length, 0]) \/\/ Move circle to create slot.\r\n\t\t\t\t\t\t\t\t\tcircle (d = ms_hole_diam, $fn = 32);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcolor(\"Silver\")\r\n\t\t\tlinear_extrude(ms_lever_width, center=true){\r\n\t\t\t\t\/\/\r\n\t\t\t\t\/\/ Lever\r\n\t\t\t\t\/\/\r\n\t\t\t\ttranslate([2.5 ,+ ms_lever_height - ms_datyoffset,0]) \/\/ Move lever to position\r\n\t\t\t\t\tmirror([0, 1, 0]) \/\/ Mirror lever to invert shape\r\n\t\t\t\t\t\tunion (){\r\n\t\t\t\t\t\t\t\/\/Add all Additive profiles together, place any extras here.\r\n\t\t\t\t\t\t\t\/\/\r\n\t\t\t\t\t\t\tsquare ([ms_lever_length + 2.5 , ms_lever_thickness]);\r\n\t\t\t\t\t\t\tsquare ([ms_lever_thickness,ms_width \/ 2]);\r\n\t\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( x = [1.6, 10.4, 17.7]){\r\n\t\t\t\tcolor (\"Silver\")\r\n\t\t\t\ttranslate ([x, -ms_tab_length - ms_datyoffset, 0])\r\n\t\t\t\t\tterminal(ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/\r\n\/\/ Terminal module for solder pad. Other terminal types are available. \r\n\/\/\r\n\r\nmodule terminal (ms_tab_length, ms_tab_width, ms_tab_thickness, ms_tab_hole_diam){\r\n\trotate ([0,90,0]){\r\n\t\ttranslate ([ms_tab_width \/ -2,0,0]) {\r\n\t\t\tlinear_extrude(ms_tab_thickness, center=true){\r\n\t\t\t\tdifference (){\r\n\t\t\t\t\tsquare ([ms_tab_width , ms_tab_length]);\r\n\t\t\t\t\ttranslate ([ms_tab_width \/ 2, ms_tab_width \/ 2, 0])\r\n\t\t\t\t\t\tcircle (d = ms_tab_hole_diam, $fn = 32);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmicroswitch(ms_orientation=0);\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d86deac9b9bce1e9d443ff789011d25cbdfbdb96","subject":"cable protection board","message":"cable protection board\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"joystick_cable_fix\/joystick_cable_fix.scad","new_file":"joystick_cable_fix\/joystick_cable_fix.scad","new_contents":"module cable_fix()\n{\n difference()\n {\n \/\/ main block\n cube([15+14, 11.5+1+2*1, 1.5+2]);\n \/\/ main cut\n translate([0, 1, 1.5])\n cube([15+14, 11.5+1, 1.5+2]);\n \/\/ cut for center elements\n translate([2, (11.5+1+2*1)\/2 - 10\/2, 0])\n cube([14-4-2, 10, 1.5]);\n }\n}\n\n\ncable_fix();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'joystick_cable_fix\/joystick_cable_fix.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b07a64271658a0d08aac68ebed1f3728fa2f22f3","subject":"fanduct: only show controls in debug_mode","message":"fanduct: only show controls in debug_mode\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"fanduct.scad","new_file":"fanduct.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($debug_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n \/*showcontrols(A);*\/\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nif(false)\n{\n $debug_mode=true;\n fanduct();\n}\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction nSpline_header(S, N) =\nlet(slice = v_slice(S,start=1))\nconcat(\n [S[0]],\n nSpline(slice, N)\n );\n\n\/\/ data for duct geometry\n\/\/ ss parameter is initial size of duct (e.g. for fan throat\/output)\n\/\/ returned data has a header row\n\/\/ warning, don't set r to 0 or rendering breaks!\nfunction gen_data(ss) = [\n [ \"Tx\",\"Ty\",\"Tz\", \"Sx\", \"Sy\", \"Rx\", \"Ry\", \"r\"],\n [ ss.x\/4, -27, 55, ss.x\/2, ss.y, 13, 0, .01],\n [ 2.5+ss.x\/4, -25, 49, 5+ss.x\/2, 1+ss.y, 13, 0, .1 ],\n [ 15, -18, 40, 11, 20, 13, 0, .4 ],\n [ 17, -8, 20, 11, 17, 11, -10, .5 ],\n [ 14, -3, 10, 8, 15, 8, -25, .7 ],\n [ 11, 0, 4, 6, 13, 0, -45, .8 ],\n];\n\nfanduct_data = gen_data(fanduct_throat_size_withwall);\n\nmodule duct(A, fanduct_wallthick=2, N=100, d=2)\n{\n \/\/ rounded bugs out when rendering if r value is 0 :\/\n function shape_profile(size,r) = rounded_rectangle_profile(size=size,r=r);\n \/*function shape_profile(size,r) = rectangle_profile(size);*\/\n\n module showcontrols(V)\n {\n function gen_T(V) = \n [\n for (i=[0:len(V)-2])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n translation(T)*rotation(v_mul(R,[1,-1,1]))\n ];\n\n T = gen_T(A);\n for (i=[0:len(T)-1])\n let(t=T[i])\n multmatrix(t)\n color(\"red\")\n let(S = [geth(A,\"Sx\",i),geth(A,\"Sy\",i)])\n let(r = geth(A,\"r\",i))\n let(r_ = [.5*r*S.x, .5*r*S.y])\n let(h=.5)\n difference()\n {\n linear_extrude(height=h,center=true)\n polygon(shape_profile(size=S+[1,1], r=r_));\n\n linear_extrude(height=h+.1,center=true)\n polygon(shape_profile(size=S, r=r_));\n\n \/*torus(r=a[3], radial_width=1.5);*\/\n }\n\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(circle_profile(r=.5))))\n T_(T.x,T.y,T.z, dat)\n ];\n outer = gen_dat(nSpline_header(A,N)); \/\/ outer skin\n skin(outer, close = true, slices = true);\n }\n\n \/\/ generate transformed shapes\n function gen_dat(V) =\n [\n for (i=[0:len(V)-2])\n let(S = geth(V,[\"Sx\",\"Sy\"],i))\n let(r = [S.x*.5*geth(V,\"r\",i), S.y*.5*geth(V,\"r\",i)])\n let(R = vec3(geth(V,[\"Rx\",\"Ry\"],i)))\n let(T = geth(V,[\"Tx\",\"Ty\",\"Tz\"],i))\n let(dat = R_(R.x, R.y, R.z, v=to_3d(shape_profile(size=S,r=r))))\n T_(T.x,T.y,T.z, dat)\n ];\n\n \/\/ inner skin data: modify tube diameter\n function modify_inner(S, subtract) = array_header_col_subtract(S, [\"Sx\", \"Sy\"], subtract);\n\n module sweepshape(V_outer,interp=true)\n {\n \/\/ inner skin is outer, but smaller size and reversed (so it will go back to start and join)\n V_inner = modify_inner(reverse_header(V_outer), fanduct_wallthick);\n if(interp)\n {\n outer = gen_dat(nSpline_header(V_outer,N)); \/\/ outer skin\n inner = gen_dat(nSpline_header(V_inner,N)); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = false);\n \/*sweep(outer, close = true, showslices = false);*\/\n \/*skin(concat(outer, inner), loop=true);*\/\n }\n else\n {\n outer = gen_dat(V_outer); \/\/ outer skin\n inner = gen_dat(V_inner); \/\/ inner skin\n sweep(concat(outer, inner), close = true, showslices = true);\n }\n }\n\n function mirrorshape(S, size) =\n let(cols = header_col_index(S,[\"Tx\",\"Rx\",\"Ry\"]))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n v_contains(cols,j) ? -S[i][j] :\n S[i][j]\n ]\n ]);\n\n \/\/ debug experiment, mirror + join path for both duct arms\n \/*A_ = mirrorshape(A);*\/\n \/*A__ = reverse_header(A_);*\/\n \/*A___ = concat_header(A__,A);*\/\n \/*sweepshape(A___,true);*\/\n\n if($preview_mode)\n {\n \/*tx(15)*\/\n \/*sweep(gen_dat(A), close = false, slices = true);*\/\n\n \/*tx(-15)*\/\n showcontrols(A);\n }\n\n material(Mat_Plastic)\n sweepshape(A,true);\n}\n\nmodule mirrorcopy(axis)\n{\n children();\n mirror(axis)\n children();\n}\n\nmodule fanduct_throat(throat_seal_h)\n{\n difference()\n {\n union()\n {\n hull()\n {\n ty((fanduct_throat_size_withwall.y)\/2)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,throat_seal_h]+XY*fanduct_wallthick,align=Z-Y);\n\n tz(seal_height)\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=fanduct_throat_size_withwall.x, d=7, orient=X);\n }\n\n }\n\n tz(-.1)\n cubea([fanduct_throat_size.x,fanduct_throat_size.y,1000],align=Z);\n\n seal_height = 4;\n tz(seal_height)\n {\n ty((fanduct_throat_size.y)\/2)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n ty(-(fanduct_throat_size_withwall.y)\/2)\n tz(-5)\n cubea([fanduct_throat_size.x,1000,1000],align=Z-Y, extra_size=.1*Y, extra_align=-Z);\n\n tz(-seal_height+2*mm)\n cubea([3.8,1000,1000],align=Z+Y);\n\n ty(fanduct_throat_size.y\/2 - 47)\n tz(11.34\/2)\n cylindera(h=1000, d=3.65, orient=X);\n }\n }\n\n ry(45)\n cubea([fanduct_wallthick\/sqrt(2),fanduct_throat_size_withwall.y,fanduct_wallthick\/sqrt(2)]);\n}\n\nmodule fanduct(part)\n{\n $fn=is_build?$fn:48;\n\n A = fanduct_data;\n\n mirrorcopy(X)\n {\n duct(A=A, fanduct_wallthick=fanduct_wallthick, N=$fn, debug=true);\n }\n\n tx(-geth(A,\"Tx\",0))\n t(geth(A,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(geth(A,[\"Rx\",\"Ry\",\"Rz\"],0))\n {\n throat_seal_h = 13*mm;\n\n material(Mat_Plastic)\n fanduct_throat(throat_seal_h);\n\n fanduct_conn_fan = [N,-Z];\n tz(2)\n attach(fanduct_conn_fan, fan_5015S_conn_flowoutput, 0)\n fan_5015S();\n }\n}\n\nmodule part_fanduct()\n{\n ry(180)\n t(-13)\n t(-geth(fanduct_data,[\"Tx\",\"Ty\",\"Tz\"],0))\n r(-geth(fanduct_data,[\"Rx\",\"Ry\",\"Rz\"],0))\n difference()\n fanduct();\n}\n\nfanduct();\n\/*part_fanduct();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f591de4d856930fc954fae4d514ccab3231e7992","subject":"xcarriage: More work","message":"xcarriage: More work\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z,0], [0,0,0]];\n\nmodule horizontal_bearing_holes(bearing_type)\n{\n translate([0,bearing_type[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[1,0,0]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate([i*bearing_type[3]\/2,0,0])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[1,0,0]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[1,0,0]);\n }\n\n \/\/ for linear rod\n fncylindera(d=xaxis_rod_d*1.5, h=100, orient=[1,0,0]);\n }\n}\n\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*#cubea([top_width,xaxis_carriage_bearing_offset_z,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n {\n difference()\n {\n translate([0,0,xaxis_pulley_d\/2])\n cubea([50, xaxis_carriage_teeth_height, 10], align=[0,0,-1]);\n }\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n translate([0,0,-xaxis_pulley_d\/2])\n cubea([500,xaxis_carriage_teeth_height,5], align=[0,0,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);\n\n belt_thickness=1.5;\n for(i=[-1,1])\n translate([i*30,0,0])\n cubea([15,xaxis_carriage_teeth_height,15-belt_thickness], align=[0,0,0]);\n\n \/\/ Cut in the middle for belt\n cubea([7,xaxis_carriage_teeth_height+.1,15], align=[0,0,0]);\n\n translate([0,0,xaxis_pulley_d\/2])\n {\n \/\/ Belt slit\n cubea([500,xaxis_carriage_teeth_height,belt_thickness], align=[0,0,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 2;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);\n }\n }\n\n for(i=[-1,1])\n translate([i*50,0,0])\n %fncylindera(d=xaxis_pulley_d, h=xaxis_belt_width*1.2, orient=[0,1,0], align=[0,0,0]);\n }\n\n\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),0,0])\n translate([0,0,xaxis_rod_distance\/2])\n horizontal_bearing_holes(xaxis_bearing);\n\n translate([0,0,-xaxis_rod_distance\/2])\n horizontal_bearing_holes(xaxis_bearing);\n\n \/\/ Extruder mounting holes\n translate([0,0,xaxis_carriage_mount_offset_z])\n for(j=[-1,1])\n for(i=[-1,1])\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])\n {\n screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);\n fncylindera(d=screw_dia, h=100, orient=[0,1,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_holes();\n }\n\n %if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([j*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, 0, xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([0, 0, -xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\n\/*x_carriage();*\/\n","old_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 6;\nxaxis_carriage_padding = 3;\nxaxis_carriage_mount_distance = 30;\nxaxis_carriage_mount_offset_z = 15;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z, 0],[0,1,0]];\n\nmodule horizontal_bearing_holes(bearing_type)\n{\n translate([0,0,bearing_type[1]\/2 + xaxis_carriage_bearing_offset_z])\n {\n \/\/ Main bearing cut\n difference()\n {\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[1,0,0]);\n }\n\n difference()\n {\n union()\n {\n for(i=[-1,1])\n translate(v=[i*bearing_type[3]\/2,0,0])\n fncylindera(h=ziptie_width, d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness, orient=[1,0,0]);\n }\n fncylindera(h=bearing_type[2], d=bearing_type[1]+ziptie_bearing_distance, orient=[1,0,0]);\n }\n\n \/\/ for linear rod\n fncylindera(d=xaxis_rod_d*1.5, h=100, orient=[1,0,0]);\n }\n}\n\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n hull()\n {\n \/\/ top bearings\n translate([0,xaxis_rod_distance\/2,0])\n cubea(size = [top_width, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2, thickness], align=[0,0,1]);\n\n cubea([top_width,xaxis_rod_distance\/2,xaxis_carriage_bearing_offset_z], align=[0,0,1]);\n\n translate([0,0,xaxis_carriage_beltpath_offset])\n cubea([top_width,xaxis_rod_distance\/2,xaxis_carriage_teeth_height], align=[0,0,0]);\n\n \/\/ bottom bearing\n translate([0,-xaxis_rod_distance\/2,0]) \n cubea(size = [bottom_width, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2, thickness], align=[0,0,1]);\n\n }\n}\n\nmodule x_carriage_beltcut()\n{\n translate([0,0,xaxis_carriage_beltpath_offset+.1])\n {\n \/\/ Cut in the middle for belt\n cubea([4.5,13,xaxis_carriage_teeth_height], align=[0,0,0]);\n\n \/\/ Cut clearing space for the belt\n translate([0,-xaxis_pulley_d\/2,0]) cubea([500,10,xaxis_carriage_teeth_height], align=[0,0,0]);\n\n \/\/xaxis pulleys\n \/*translate([0,0,xaxis_carriage_beltpath_offset])*\/\n for(i=[-1,1])\n translate([i*50,0,0])\n %fncylindera(d=xaxis_pulley_d, h=xaxis_belt_width*1.2, orient=[0,0,1], align=[0,0,0]);\n\n translate([0,xaxis_pulley_d\/2,0])\n {\n \/\/ Belt slit\n cubea([500,1,xaxis_carriage_teeth_height], align=[0,1,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 3;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,teeth_height,xaxis_carriage_teeth_height], align=[0,-1,0]);\n }\n }\n }\n}\n\n\nmodule x_carriage_holes(bearing_type){\n\n for ( i = [-1,1] )\n translate([i*(bearing_type[2]\/2+xaxis_bearing_distance\/2),0,0])\n translate([0,xaxis_rod_distance\/2,0]) \n horizontal_bearing_holes(xaxis_bearing);\n\n\n translate([0,-xaxis_rod_distance\/2,0]) \n horizontal_bearing_holes(xaxis_bearing);\n\n \/\/ Extruder mounting holes\n translate([0,xaxis_carriage_mount_offset_z,0])\n for ( i = [-1,1] )\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,0])\n {\n fncylindera(r=1.7, h=100);\n \/*fncylindera(r=3.3, h=20, fn=6, align=[0,0,1]);*\/\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_beltcut();\n x_carriage_holes(xaxis_bearing);\n }\n\n %if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z])\n translate([j*(xaxis_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, xaxis_rod_distance\/2, 0])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z])\n translate([0, -xaxis_rod_distance\/2, 0])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nx_carriage();\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"72fc01c19543b31471064c23cd7620a07760af71","subject":"Add operator repeatRotateMap()","message":"Add operator repeatRotateMap()\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/rotate.scad","new_file":"operator\/repeat\/rotate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2020 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = [0, 0, 1],\n interval = [0, 0, 0],\n origin = [0, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : [0, 0, 0];\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n axisZ = [1, 0, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n originZ = [0, 0, 0],\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats the children modules on every angle given in the `map`.\n *\n * @param Vector[] map - The list of angles at which place the children.\n * @param Vector [offset] - An offset to add before the ratation is applied.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatRotateMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n rotate(vector3D(at)) {\n translate(offset) {\n children();\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = [0, 0, 1],\n interval = [0, 0, 0],\n origin = [0, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : [0, 0, 0];\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = [0, 0, 1],\n axisY = [0, 1, 0],\n axisZ = [1, 0, 0],\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n originX = [0, 0, 0],\n originY = [0, 0, 0],\n originZ = [0, 0, 0],\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ded6b6f3a019eada4b5f68125f768abd2351ac76","subject":"screws: tweak tolerances","message":"screws: tweak tolerances\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n translate([0,0,-nut_thick-.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n translate([0,0,-nut_thick-.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e4eb1e2205296dfee612fb6d1eaffd81171a846b","subject":"attach: Attempt bugfix for the attach 1,-1 case (vector cross = 0, no rotation)","message":"attach: Attempt bugfix for the attach 1,-1 case (vector cross = 0, no rotation)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"attach.scad","new_file":"attach.scad","new_contents":"use \nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn, fnr=0.4)\n{\n fn_= fn==undef ? (floor(2*(r)*PI\/fnr)) : fn;\n translate(p)\n sphere(r=r,$fn=fn_);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false, fnr)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n fncylindera(r1=2\/2, r2=0.2, h=l_arrow, fnr=fnr);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate([1,0,0])\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n fncylindera(r=1\/2, h=lb, center=true, fnr=fnr);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2, fnr);\n}\n\n\/\/-----------------------------------------------------------------\n\/\/-- ORIENTATE OPERATOR\n\/\/--\n\/\/-- Orientate an object to the direction given by the vector v\n\/\/-- Parameters:\n\/\/-- v : Target orientation\n\/\/-- vref: Vector reference. It is the vector of the local frame\n\/\/-- of the object that want to be poiting in the direction\n\/\/-- of v\n\/\/-- roll: Rotation of the object around the v axis\n\/\/-------------------------------------------------------------------\nmodule orientate(v,vref=[0,0,1], roll=0)\n{\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==[0,0,0]?[1,0,0]:raxis;\n\n \/\/-- Rotate the child!\n rotate(a=roll, v=v)\n rotate(a=ang, v=raxis_)\n orient(v)\n child(0);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = [0,0,1];\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==[0,0,0]?[1,0,0]:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v=v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n raxis_=ang==180&&raxis==[0,0,0]?[1,0,0]:raxis;\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis_)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","old_contents":"use \nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn, fnr=0.4)\n{\n fn_= fn==undef ? (floor(2*(r)*PI\/fnr)) : fn;\n translate(p)\n sphere(r=r,$fn=fn_);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false, fnr)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n fncylindera(r1=2\/2, r2=0.2, h=l_arrow, fnr=fnr);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate([1,0,0])\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n fncylindera(r=1\/2, h=lb, center=true, fnr=fnr);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2, fnr);\n}\n\n\/\/-----------------------------------------------------------------\n\/\/-- ORIENTATE OPERATOR\n\/\/--\n\/\/-- Orientate an object to the direction given by the vector v\n\/\/-- Parameters:\n\/\/-- v : Target orientation\n\/\/-- vref: Vector reference. It is the vector of the local frame\n\/\/-- of the object that want to be poiting in the direction\n\/\/-- of v\n\/\/-- roll: Rotation of the object around the v axis\n\/\/-------------------------------------------------------------------\nmodule orientate(v,vref=[0,0,1], roll=0)\n{\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n \/\/-- Rotate the child!\n rotate(a=roll, v=v)\n rotate(a=ang, v=raxis)\n child(0);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = [0,0,1];\n raxis = v_cross(vref,v);\n \n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"31bfd985c0b286b9837c9a38642c76397c2c8b28","subject":"belt_fastener: fix nut trap axis","message":"belt_fastener: fix nut trap axis\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"belt_fastener.scad","new_file":"belt_fastener.scad","new_contents":"include \n\nuse \nuse \n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=U, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*mm*Y)\n translate(-12*mm*X)\n {\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n nut_trap_cut(nut=tension_screw_nut, screw_l=6*mm, cut_screw=true, orient=-X, trap_axis=Y);\n }\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extrasize=[0,1000,1*mm], extrasize_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extrasize=1000*Y, extrasize_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","old_contents":"include \n\nuse \nuse \n\nmodule belt_fastener(part, belt=TimingBelt_GT2_2, belt_width=6*mm, belt_dist=pulley_2GT_20T[2], width=55*mm, with_tensioner=true, align=U, orient=X)\n{\n belt_t2 = belt_t2_thickness(belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n height = belt_dist + belt_t2 + angle_screw_dia + 3*mm;\n slide_width=20*mm;\n depth = belt_width + 10*mm;\n\n s= [width, depth, height];\n size_align(size=s, orient=orient, align=align, orient_ref=-X)\n {\n if(part==undef)\n {\n difference()\n {\n belt_fastener(\"pos\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n belt_fastener(\"neg\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n %belt_fastener(\"vit\", belt=belt, belt_width=belt_width, belt_dist=belt_dist, width=width, with_tensioner=with_tensioner, align=align, orient=orient);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n translate(-belt_dist\/2*Z)\n {\n \/\/ support for belt path\n rcubea([width, belt_width, belt_t2*2 + angle_screw_dia]);\n\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n rcubea([width, angle_screw_dia+2*mm, belt_t2*2 + angle_screw_dia]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate(-belt_dist\/2*Z)\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*X)\n cylindera(d=angle_screw_dia+belt_t2, h=belt_width+.1, extra_h=1000, extra_align=Y, orient=Y);\n }\n\n hull()\n {\n for(i=[-1,1])\n translate(i*slide_width\/2*X)\n translate(-belt_width*Y)\n translate(-angle_screw_dia*Y)\n translate(-.1*Y)\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=Y, align=Y);\n }\n\n translate(-belt_width*Y)\n {\n \/\/ cut for angle screw\n translate(-1*mm*Y)\n translate(-12*mm*X)\n {\n cylindera(d=angle_screw_dia+.3*mm, h=1000, orient=X, align=X);\n nut_trap_cut(nut=tension_screw_nut, screw_l=6*mm, cut_screw=true, orient=-X, trap_axis=-Y);\n }\n }\n }\n\n }\n else\n {\n cubea([1000, belt_width+3*mm, belt_t2*1.8], extrasize=[0,1000,1*mm], extrasize_align=Y+Z);\n }\n\n translate(belt_dist\/2*Z)\n cubea([1000, belt_width+3*mm, belt_t2*2], extrasize=1000*Y, extrasize_align=Y);\n }\n else if(part==\"vit\")\n {\n if(with_tensioner)\n {\n \/*translate(-belt_dist\/2*Z)*\/\n \/*translate(-belt_width*Y)*\/\n \/*translate(screw_offset_x*X)*\/\n \/*screw(nut=tension_screw_nut, h=25*mm, with_head=true, with_nut=false, head_embed=true, with_nut=false, orient=X, align=X);*\/\n\n \/\/ 90 angle metal screw\n \/*translate(screw_offset_x*X)*\/\n translate(-belt_dist\/2*Z)\n translate(-belt_width*Y)\n translate(-angle_screw_dia\/2*Y)\n {\n cylindera(d=angle_screw_dia+.2*mm, h=20*mm, orient=X, align=X);\n cylindera(d=angle_screw_dia+.2*mm, h=11*mm, orient=Y, align=Y+X);\n }\n }\n }\n }\n}\n\nif(false)\n{\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n {\n translate([0, 0, z])\n {\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n translate([-main_width\/2, 0, 0])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n proj_extrude_axis(axis=-Y)\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([0,0,sign(z)>1?1:0])\n \/*mirror(X)*\/\n belt_fastener();\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3cde088d60a9b828f8714714d469311cfa18bcd2","subject":"chassis created","message":"chassis created\n","repos":"dviejo\/freeSlotTrackDesigner","old_file":"chasis\/rally.scad","new_file":"chasis\/rally.scad","new_contents":"\/**\n * rally.scad\n * \n * Created by Diego Viejo\n * \n * 11\/Dic\/2015\n * \n * This is my attemp on creating a chassis for a rally slot car\n * \n *\/\n\n\/\/guide arm's holder\n\/\/work in progress: check for all the sizes is still needed\nnumSlots = 3;\nguideWidth = 40;\nguideInternalWidth = 30;\nguideHeight = 6;\nguideHoleHeight = 3;\nguideSupportLength = 7;\nguideLength = guideSupportLength + 2 + numSlots*4;\n\nmodule guide()\ndifference()\n{\n cube([guideWidth, guideLength, guideHeight], center=true);\n \n translate([0, guideSupportLength, 0]) cube([guideInternalWidth, guideLength, guideHeight+2], center=true);\n translate([0, 0, guideHeight\/2]) cube([guideInternalWidth, guideLength+2, guideHeight], center=true);\n \n for(i=[1:10])\n {\n translate([-guideWidth\/2-1, -guideLength\/2 + guideSupportLength +i*4, -guideHeight\/2+guideHoleHeight])\n rotate([0, 90, 0]) cylinder(d=2, h=guideWidth+2);\n }\n}\n\nguide();","old_contents":"","returncode":1,"stderr":"error: pathspec 'chasis\/rally.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"606d3028a392e6e9e0a659b83a074baec68c579e","subject":"screws: use material module","message":"screws: use material module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n }\n else\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference() {\n \/*translate([0, 0, d])*\/\n #spherea(r = r, align=-Z);\n\n translate([0, 0, -r])\n cubea(r*2);\n\n translate([0, 0, f\/3])\n cylinder(r = hexRadius(threadsize), h = f, $fn = 6);\n\n } \/\/ end difference\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n material(Mat_Steel)\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n }\n else\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference() {\n \/*translate([0, 0, d])*\/\n #spherea(r = r, align=-Z);\n\n translate([0, 0, -r])\n cubea(r*2);\n\n translate([0, 0, f\/3])\n cylinder(r = hexRadius(threadsize), h = f, $fn = 6);\n\n } \/\/ end difference\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\nfunction hex_radius(hexSize) = hexSize\/2\/sin(60);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6382fb4abd7d8bb77cfa3d32b0fbcc11558c6bf5","subject":"Corn base","message":"Corn base\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Unicorn by Paul Houghton \u00a92015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=45;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50*scale;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nneck_radius = 2*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (28 + body_radius)*scale;\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.65;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 70*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule mane() {\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.2*body_length, 0, -leg_length - body_z])\n minkowski() {\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n body();\n leg(theta=5, sideways=3);\n cute_leg(theta=-5, sideways=-3, downwards=3);\n leg(lengthwards = body_length, sideways=2, theta=15);\n leg(lengthwards = body_length, sideways=-2, theta=-15);\n }\n # base();\n}","old_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 4.5;\nhead_spacing = 18;\nhead_angle = 50;\n\nhorn_length = 20;\nhorn_radius = 2.8;\n\nneck_radius = 2;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3;\n\nbody_x = 15;\nbody_z = 28;\nbody_radius = 15;\nbody_back_radius = 13;\nbody_length = 33;\n\nleg_length = 28 + body_radius;\nleg_radius = 4;\n\ncute_leg_first_ratio = 0.65;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\nleg(theta=5, sideways=3);\ncute_leg(theta=-5, sideways=-3, downwards=3);\nleg(lengthwards = body_length, sideways=2, theta=15);\nleg(lengthwards = body_length, sideways=-2, theta=-15);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"64f9e5d6444ee713976a6259c58e19d2ef43ab3f","subject":"Better tail","message":"Better tail\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Unicorn by Paul Houghton \u00a9 2015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=8;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nhair_thickness = mane_thickness \/ 8;\nhair_spacing = mane_thickness \/ 2;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\ntail_thickness = mane_thickness;\ntail_radius = 10 * hair_thickness;\ntail_x = 2*body_x + body_length - tail_radius;\ntail_height = -body_z + 1.7*tail_radius;\ntail_tip_length = 30;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule hair_line(x = 0, z = 0, hair_radius = mane_radius, delta_x = body_x, delta_z = body_z) {\n translate([x, 0, z])\n difference() {\n hull() {\n cylinder(h = mane_thickness, r = hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius);\n }\n hull() {\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n }\n hair_line();\n hair_line(hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere($fn = 16, r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere($fn = 16, r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nmodule tailhair_line(x = 0, z = 0, delta_x = body_x, delta_z = 1.2*body_z) {\n translate([x, 0, z - hair_thickness])\n difference() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius);\n translate([delta_x, -delta_z, 0])\n cube([tail_tip_length, tail_tip_length - hair_thickness, tail_thickness]);\n }\n hull() {\n cylinder(h = tail_thickness, r = tail_radius - hair_spacing);\n translate([delta_x + hair_spacing, -delta_z + hair_spacing, 0])\n cube([tail_tip_length, tail_tip_length - hair_thickness, tail_thickness]);\n } \n }\n}\n\nmodule t_hair() {\n translate([0, 0, -2*hair_thickness])\n difference() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0]) rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness]);\n }\n }\n hull() {\n cylinder(h = tail_thickness, r = tail_radius - hair_spacing);\n translate([body_x + hair_spacing, -1.2*body_z, 0]) rotate([0, 0, 11]) {\n cube([tail_tip_length - hair_spacing, tail_tip_length - hair_spacing, tail_thickness]);\n }\n }\n }\n}\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2 - hair_thickness, tail_height])\n rotate([90, 0, 0]) {\n intersection() {\n union() {\n hull() {\n cylinder(h = tail_thickness - 2*hair_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0])\n rotate([0, 0, 11]) {\n cube([tail_tip_length, tail_tip_length, tail_thickness - 2*hair_thickness]);\n }\n }\n t_hair();\n }\n translate([0, 0, -hair_thickness])\n cylinder($fn = 16, h = tail_thickness, r = tail_tip_length*1.25);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n base();\n}","old_contents":"\/\/ Unicorn by Paul Houghton \u00a9 2015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=12;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nhair_thickness = mane_thickness \/ 8;\nhair_spacing = mane_thickness \/ 2;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\ntail_thickness = mane_thickness;\ntail_radius = 1.5 * body_back_radius \/ 3;\ntail_x = 2*body_x + body_length - tail_radius;\ntail_height = -body_z + 1.7*tail_radius;\ntail_tip_length = 30;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule hair_line(x = 0, z = 0, hair_radius = mane_radius, delta_x = body_x, delta_z = body_z) {\n translate([x, 0, z])\n difference() {\n hull() {\n cylinder(h = mane_thickness, r = hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius);\n }\n hull() {\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n }\n hair_line();\n hair_line(hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nmodule tailhair_line(x = 0, z = 0, delta_x = body_x, delta_z = 1.2*body_z) {\n translate([x, 0, z - hair_thickness])\n difference() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius);\n translate([delta_x, -delta_z, 0])\n cube([tail_tip_length, tail_tip_length - hair_thickness, tail_thickness]);\n }\n hull() {\n cylinder(h = tail_thickness, r = tail_radius - hair_spacing);\n translate([delta_x + hair_spacing, -delta_z + hair_spacing, 0])\n # cube([tail_tip_length, tail_tip_length - hair_thickness, tail_thickness]);\n } \n }\n}\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2 - hair_thickness, tail_height])\n rotate([90, 0, 0]) {\n intersection() {\n union() {\n hull() {\n cylinder(h = tail_thickness - 2*hair_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0])\n cube([tail_tip_length, tail_tip_length, tail_thickness - 2*hair_thickness]);\n }\ncolor(\"blue\") tailhair_line();\n }\n cylinder(h = tail_thickness, r = tail_tip_length*1.25);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n base();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"71af20a37ddef37607a5eeb0ac4d851046d713cd","subject":"fixed height of internal element for keeping oring","message":"fixed height of internal element for keeping oring\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/adapter_nozzle_top.scad","new_file":"water_rocket_launcher\/adapter_nozzle_top.scad","new_contents":"use \n\nmodule oring(d_in, d_r)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n}\n\nmodule oring_slot(d_in, d_r, d_ext, d_r_ext)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n hull()\n {\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n translate([d_ext\/2+d_r_ext\/2, 0, 0])\n circle(d=d_r_ext, $fn=fn(40));\n }\n}\n\n\nmodule nozzle()\n{\n module body()\n {\n h1 = 5;\n cylinder(d1=32, d2=21, h=h1, $fn=fn(200));\n translate([0,0,h1])\n {\n h2 = 18;\n difference()\n {\n cylinder(d=21, h=h2, $fn=fn(200));\n translate([0, 0, h2\/2])\n {\n d_in = 17-0.5;\n d_r = 2.5;\n oring_slot(d_in=d_in, d_r=d_r, d_ext=d_in+1.5, d_r_ext=d_r+0.75);\n %oring(d_in=d_in, d_r=d_r);\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nnozzle();\n","old_contents":"use \n\nmodule oring(d_in, d_r)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n}\n\nmodule oring_slot(d_in, d_r, d_ext, d_r_ext)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n hull()\n {\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n translate([d_ext\/2+d_r_ext\/2, 0, 0])\n circle(d=d_r_ext, $fn=fn(40));\n }\n}\n\n\nmodule nozzle()\n{\n module body()\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n {\n difference()\n {\n cylinder(d=16+5, h=10, $fn=fn(200));\n translate([0, 0, 6])\n {\n d_in = 17-0.5;\n d_r = 2.5;\n oring_slot(d_in=d_in, d_r=d_r, d_ext=d_in+1.5, d_r_ext=d_r+0.75);\n %oring(d_in=d_in, d_r=d_r);\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nnozzle();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2cf41746946e04132a54a58948ed0fc42385de44","subject":"Fix serial header holes not being drawn","message":"Fix serial header holes not being drawn\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin() {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Serial_Pins);\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Header_Pins);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin() {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout();\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Serial_Pins);\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Header_Pins);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a39d8b82fb8c0521fdb962d1b7c413de02085734","subject":"main cap part (no mountings yet)","message":"main cap part (no mountings yet)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"u-lock_kryptonite_cap\/u-lock_kryptonite_cap.scad","new_file":"u-lock_kryptonite_cap\/u-lock_kryptonite_cap.scad","new_contents":"wall=2;\nspacing=0.5;\nr_int=30.5\/2;\nr_round=wall;\nh=25;\n$fn=1\/3*360;\n\n\nmodule ring_(r_ring, r_round)\n{\n\/\/ $fn=200;\n rotate_extrude()\n translate([r_ring-r_round, 0, 0])\n circle(r=r_round);\n}\n\nmodule rounded_cylinder_(r_cyl, r_round, h)\n{\n translate(r_round*[0,0,1])\n {\n for(dz=[0,h-2*r_round])\n translate([0,0,dz])\n hull()\n ring_(r_cyl, r_round);\n cylinder(r=r_cyl, h=h-2*r_round);\n }\n}\n\nmodule empty_cylinder_()\n{\n \n difference()\n {\n rounded_cylinder_(r_int + spacing + wall, r_round, h);\n translate(wall*[0,0,1])\n rounded_cylinder_(r_int + spacing, r_round, h);\n }\n}\n\n\nempty_cylinder_();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'u-lock_kryptonite_cap\/u-lock_kryptonite_cap.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"fbdbae86a151cd2634fe962e5b1ab34182afa363","subject":"removed scale echo from openscad conversion","message":"removed scale echo from openscad conversion\n","repos":"nwaring\/buildyourown,cheapjack\/buildyourown","old_file":"cad\/src\/scaling.scad","new_file":"cad\/src\/scaling.scad","new_contents":"measurement = 55;\n\nSCALE = (measurement + 5)\/55;\n","old_contents":"measurement = 55;\n\nSCALE = (measurement + 5)\/55;\n\necho(SCALE=SCALE);\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"cef8ca22f417d39eacc5d0a0406a2578a4ab4af6","subject":"Move SMT components into own module","message":"Move SMT components into own module\n\n- Refine some component measurements\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 4 - ArduinoPro_PCB_Height;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5 * 25.4, ArduinoPro_PCB_Height])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Reset switch for Pro Mini\n if (type == ArduinoPro_Mini) {\n translate([moveX, 0.15 * 25.4, ArduinoPro_PCB_Height])\n union() {\n color(\"silver\")\n linear_extrude(height=1.7)\n square([6, 3.5], center=true);\n color(\"darkorange\")\n translate([0, 0, 1.7])\n linear_extrude(height=1.0)\n square([3, 2], center=true);\n }\n }\n\n \/\/ Crystal for Pro Micro\n if (type == ArduinoPro_Micro) {\n color(\"silver\")\n translate([moveX, 0.15 * 25.4, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n square([6, 3.5], center=true);\n }\n\n \/\/ Capacitors etc.\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=2)\n union() {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n union() {\n square([1, 2.5], center=true);\n translate([0, 3, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\nmodule ArduinoPro_MicroUSB() {\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole() {\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0) {\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.54; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout() {\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0) {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Distance to middle from origin\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5*25.4, ArduinoPro_PCB_Height])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(2*sqrt(.4*25.4), center=true);\n\n \/\/ Reset switch (or crystal for Pro Micro)\n color(\"silver\")\n translate([moveX, 0.15*25.4, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n square([5, 3.5], center=true);\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=2)\n union() {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, ArduinoPro_PCB_Height])\n linear_extrude(height=1)\n union() {\n square([1, 2.5], center=true);\n translate([0, 3, 0])\n square([2.5, 1.5], center=true);\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show && !headerpins) {\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0.5])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d59b0c72e4f4bb360b27c418aa0f85463834a87c","subject":"Add some commenting to the switch mount scad file","message":"Add some commenting to the switch mount scad file\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 14.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"$fn=100;\n\nbutton_radius = 49;\nhole_radius = 14.5;\ntable_padding = 40;\nextra_padding = 2;\nbottom_padding = 30;\n\nwall_thickness = 3;\n\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\nfont = \"monaco.dxf\";\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/\/ difference() {\n\/\/ translate([0, 0, mount_depth-wall_thickness])\n\/\/ cover();\n\/\/ cover_screws();\n\/\/ project();\n\/\/ }\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8beaa1b3b7dbb543d6b0e7a30ef49a109ea690aa","subject":"bearing_data: add some sf1 bushings","message":"bearing_data: add some sf1 bushings\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"32fc3639b8ff712cc5fed6946ffffa8e1f83cd4f","subject":"body: top_shoulder position","message":"body: top_shoulder position\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n \n correction_diameter = (2 * BORDER_RADIUS_BODY);\n diameter_base = DIAMETER_BODY - correction_diameter;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n position_ring_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position_ring = [0,0,position_ring_z];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n position_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\n\nmodule body()\n{ \n top_surface();\n top_shoulder();\n \n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n \n correction_diameter_base = (2 * BORDER_RADIUS_BODY);\n diameter_base = DIAMETER_BODY - correction_diameter_base;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n translate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\n\nmodule body()\n{ \n top_surface();\n top_shoulder();\n \n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7626b89504b97d283d38cb82f4e8f775dcf22d31","subject":"holder's draft","message":"holder's draft\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"video_camera_holder\/vch.scad","new_file":"video_camera_holder\/vch.scad","new_contents":"module holder()\n{\n translate([0,0,110])\n rotate([90,0,0])\n difference()\n {\n translate([-70\/2, -110, 0])\n cube([70, 140, 5]);\n cylinder(r=30\/2, h=5, $fs=0.01);\n for(deg = [0, 120, 240])\n rotate(deg)\n #translate([0, 21.25, -1])\n cylinder(r=3.5\/2, h=5+2*1, $fs=0.1);\n }\n}\n\nrotate([-90, 0, 0])\n{\n holder();\n translate([-90\/2, -110, 0])\n cube([90, 110, 5]);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'video_camera_holder\/vch.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"5f682ee1c6272ebefb7794790df38d7c00528c85","subject":"bearing: support align param","message":"bearing: support align param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, extra_h=0, override_h=undef, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, align=[0,0,0], orient=[0,0,1], ziptie_dist=undef, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+2*mm, h=100, orient=[0,0,1]);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+2*mm, h=100, orient=[0,0,1]);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e7b6a5a40daafeffa9c8d6268ebacb27a869315e","subject":"=> rules coding","message":"=> rules coding","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Timin.scad","new_file":"3D-models\/SCAD\/Timin.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=26; \nz=7; \nt=0; \nedge=0.71*y; \ndx=edge*1.41; \n\/\/\u0422\u0438\u043c\u0438\u043d \ntranslate ([dx\/2,t,0]) { \n color(\"Lime\") translate ([0,0,0]) cube ([x-dx\/2,y,z]); \n color(\"Lime\") rotate ([0,0,45]) cube ([edge,edge,z]); \n} \n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f:\nx=60;\ny=26;\nz=7;\nt=0;\nedge=0.71*y;\ndx=edge*1.41;\n\/\/\u0422\u0438\u043c\u0438\u043d\ntranslate ([dx\/2,t,0]){\n color(\"Lime\") translate ([0,0,0]) cube ([x-dx\/2,y,z]);\n color(\"Lime\") rotate ([0,0,45]) cube ([edge,edge,z]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"089296e34568d7c2a9504ad7cd1eda1cfcda13ef","subject":"re-enable the cube and a customizer option for cube or cylinder","message":"re-enable the cube and a customizer option for cube or cylinder\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e6292b8352c5e9b7a63a244eb8d61e34e6a14a13","subject":"added hub feature","message":"added hub feature\n","repos":"mseminatore\/mdsSpurGear","old_file":"mdsSpurGear.scad","new_file":"mdsSpurGear.scad","new_contents":"\/\/===================================================================================\n\/\/ Parameteric Spur Gear SCAD script\n\/\/\n\/\/ Based on Boston Gear design rules https:\/\/www.bostongear.com\/pdf\/gear_theory.pdf\n\/\/\n\/\/ Copyright (c) 2016 Mark David Seminatore\n\/\/\n\/\/ Refer to included LICENSE.txt for usage rights and restrictions\n\/\/===================================================================================\n\/\/\n\n$fs = 0.01;\n\n\/\/ Example 24 tooth gear with default options\nmdsSpurGear(teeth = 24);\n\n\/\/\n\/\/\n\/\/\nmodule mdsSpurGear(teeth = 24, diametral_pitch = 24, pressure_angle = 20, shaft_dia = 0.125, thickness = 0.125, major_holes = true, minor_holes = true, num_holes = 4, hub_thickness = 1.25, debug_echo = false) {\n\n \/\/ calculate basic gear parameters\n pitch_dia = teeth \/ diametral_pitch;\n pitch_radius = pitch_dia \/ 2;\n \n addendum = 1 \/ diametral_pitch;\n \n outer_dia = pitch_dia + 2 * addendum;\n outer_radius = outer_dia \/ 2;\n \n whole_depth = 2.2 \/ diametral_pitch + 0.002;\n dedendum = whole_depth - addendum;\n \n root_dia = pitch_dia - 2 * dedendum;\n root_radius = root_dia \/ 2;\n \n base_dia = pitch_dia * cos(pressure_angle);\n base_radius = base_dia \/ 2;\n \n r_mid_point = root_radius \/ 2 + shaft_dia \/ 4;\n \n if (debug_echo) {\n echo(root_dia=root_dia,base_dia=base_dia,pitch_dia=pitch_dia,outer_dia=outer_dia,whole_depth=whole_depth, addendum=addendum,dedendum=dedendum);\n echo(r_mid_point = r_mid_point);\n }\n \n \/\/ draw rim if present\n linear_extrude(height = hub_thickness * thickness)\n union() {\n difference() {\n circle($fn = teeth*3, d = root_dia);\n circle($fn = teeth*3, d = 0.9 * root_dia);\n }\n \n pitch_to_base_angle = involuteIntersectionAngle( base_radius, pitch_radius );\n outer_to_base_angle = involuteIntersectionAngle( base_radius, outer_radius );\n \n half_angle = 360 \/ (4 * teeth);\n \n base_angle = pitch_to_base_angle + half_angle;\n \n if (debug_echo)\n echo(half_angle=half_angle,pitch_to_base_angle=pitch_to_base_angle,base_angle=base_angle);\n\n \/\/ draw teeth\n for (i = [1 : teeth]) {\n \n \/\/ pitch_angle = \n \n \/\/ coordinates of tooth base\n b1 = fromPolar(root_radius, base_angle);\n b2 = fromPolar(root_radius, -base_angle);\n\n \/\/ coordinates of tooth at pitch diameter\n p1 = b1 + fromPolar(dedendum, pitch_to_base_angle);\n p2 = b2 + fromPolar(dedendum, pitch_to_base_angle);\n \n \/\/ coordinates of tooth at outer diameter\n o1 = p1 + fromPolar(addendum, -pressure_angle);\n o2 = p2 + fromPolar(addendum, pressure_angle);\n \n rotate([0, 0, i * 360 \/ teeth])\n polygon([b1, p1, o1, o2, p2, b2]);\n } \n }\n \n \/\/ draw the main disc\n translate([0, 0, (hub_thickness * thickness - thickness)\/2])\n linear_extrude(height = thickness)\n union() {\n \n difference() {\n \/\/ draw root circle\n circle($fn = teeth*3, d = root_dia);\n \n \/\/ subtract shaft\n circle(d = shaft_dia);\n \n \/\/ draw major holes\n if (major_holes && r_mid_point >= 0.125) {\n echo(\"Draw major holes\");\n angle_inc = 360 \/ num_holes;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc])\n translate([r_mid_point, 0, 0])\n circle(d = 0.85 * r_mid_point);\n }\n }\n \n \/\/ draw minor hollows\n if (minor_holes && r_mid_point >= 0.25) {\n echo(\"Draw minor holes\");\n angle_inc = 360 \/ num_holes;\n\n inner_minor_dia = r_mid_point \/ 4;\n inner_minor_ctr = r_mid_point \/ 3;\n outer_minor_dia = r_mid_point \/ 2;\n outer_minor_ctr = r_mid_point * 1.2;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc + angle_inc \/ 2]) {\n \/\/ selectively draw inner minor holes\n if (inner_minor_ctr - inner_minor_dia \/ 2 > shaft_dia \/ 2 + 0.125)\n {\n translate([inner_minor_ctr, 0, 0])\n circle(d = inner_minor_dia);\n } \n \n \/\/ selectively draw outer minor holes\n translate([outer_minor_ctr, 0, 0])\n circle(d = outer_minor_dia);\n }\n }\n }\n }\n }\n}\n\n\/\/\nfunction involuteIntersectionAngle(base_radius, radius) = sqrt( pow(radius \/ base_radius,2) - 1);\n\n\/\/\nfunction fromPolar(r, theta) = [r * cos(theta), r * sin(theta)];","old_contents":"\/\/===================================================================================\n\/\/ Parameteric Spur Gear SCAD script\n\/\/\n\/\/ Based on Boston Gear design rules https:\/\/www.bostongear.com\/pdf\/gear_theory.pdf\n\/\/\n\/\/ Copyright (c) 2016 Mark David Seminatore\n\/\/\n\/\/ Refer to included LICENSE.txt for usage rights and restrictions\n\/\/===================================================================================\n\/\/\n\n$fs = 0.01;\n\n\/\/ Example 24 tooth gear with default options\nmdsSpurGear(teeth = 24);\n\n\/\/\n\/\/\n\/\/\nmodule mdsSpurGear(teeth = 24, diametral_pitch = 24, pressure_angle = 20, shaft_dia = 0.125, thickness = 0.125, major_holes = true, minor_holes = true, num_holes = 4, debug_echo = false) {\n\n \/\/ calculate basic gear parameters\n pitch_dia = teeth \/ diametral_pitch;\n pitch_radius = pitch_dia \/ 2;\n \n addendum = 1 \/ diametral_pitch;\n \n outer_dia = pitch_dia + 2 * addendum;\n outer_radius = outer_dia \/ 2;\n \n whole_depth = 2.2 \/ diametral_pitch + 0.002;\n dedendum = whole_depth - addendum;\n \n root_dia = pitch_dia - 2 * dedendum;\n root_radius = root_dia \/ 2;\n \n base_dia = pitch_dia * cos(pressure_angle);\n base_radius = base_dia \/ 2;\n \n r_mid_point = root_radius \/ 2 + shaft_dia \/ 4;\n \n if (debug_echo) {\n echo(root_dia=root_dia,base_dia=base_dia,pitch_dia=pitch_dia,outer_dia=outer_dia,whole_depth=whole_depth, addendum=addendum,dedendum=dedendum);\n echo(r_mid_point = r_mid_point);\n }\n \n linear_extrude(height = thickness)\n union() {\n pitch_to_base_angle = involuteIntersectionAngle( base_radius, pitch_radius );\n outer_to_base_angle = involuteIntersectionAngle( base_radius, outer_radius );\n \n half_angle = 360 \/ (4 * teeth);\n \n base_angle = pitch_to_base_angle + half_angle;\n \n echo(half_angle=half_angle,pitch_to_base_angle=pitch_to_base_angle,base_angle=base_angle);\n\n \/\/ draw teeth\n for (i = [1 : teeth]) {\n \n \/\/ pitch_angle = \n \n \/\/ coordinates of tooth base\n b1 = fromPolar(root_radius, base_angle);\n b2 = fromPolar(root_radius, -base_angle);\n\n \/\/ coordinates of tooth at pitch diameter\n p1 = b1 + fromPolar(dedendum, pitch_to_base_angle);\n p2 = b2 + fromPolar(dedendum, pitch_to_base_angle);\n \n \/\/ coordinates of tooth at outer diameter\n o1 = p1 + fromPolar(addendum, -pressure_angle);\n o2 = p2 + fromPolar(addendum, pressure_angle);\n \n rotate([0, 0, i * 360 \/ teeth])\n polygon([b1, p1, o1, o2, p2, b2]);\n }\n \n difference() {\n \/\/ draw root circle\n circle($fn = teeth*3, d = root_dia);\n \n \/\/ subtract shaft\n circle(d = shaft_dia);\n \n \/\/ draw major holes\n if (major_holes && r_mid_point >= 0.125) {\n echo(\"Draw major holes\");\n angle_inc = 360 \/ num_holes;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc])\n translate([r_mid_point, 0, 0])\n circle(d = r_mid_point);\n }\n }\n \n \/\/ draw minor hollows\n if (minor_holes && r_mid_point >= 0.25) {\n echo(\"Draw minor holes\");\n angle_inc = 360 \/ num_holes;\n\n inner_minor_dia = r_mid_point \/ 4;\n inner_minor_ctr = r_mid_point \/ 3;\n outer_minor_dia = r_mid_point \/ 2;\n outer_minor_ctr = 4 * r_mid_point \/ 3;\n \n for (i = [1 : num_holes]) {\n rotate([0, 0, i * angle_inc + angle_inc \/ 2]) {\n \/\/ selectively draw inner minor holes\n if (inner_minor_ctr - inner_minor_dia \/ 2 > shaft_dia \/ 2 + 0.125)\n {\n translate([inner_minor_ctr, 0, 0])\n circle(d = inner_minor_dia);\n } \n \n \/\/ selectively draw outer minor holes\n translate([outer_minor_ctr, 0, 0])\n circle(d = outer_minor_dia);\n }\n }\n }\n }\n }\n}\n\n\/\/\nfunction involuteIntersectionAngle(base_radius, radius) = sqrt( pow(radius \/ base_radius,2) - 1);\n\n\/\/\nfunction fromPolar(r, theta) = [r * cos(theta), r * sin(theta)];","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"983569a22ca6c8baf4f70e73a8e077724032d191","subject":"Removed finger and thumb pinhole columns, which proved unnecessary (with the hard uPrint plastic) and took up valuable space. Also made divider walls thinner.","message":"Removed finger and thumb pinhole columns, which proved unnecessary (with the hard uPrint plastic) and took up valuable space. Also made divider walls thinner.\n","repos":"joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn","old_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 5;\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = thumbNotchDepth * 2\/3;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + buttonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + buttonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1.0001]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\n\ntactileSwitchWellWidth = 7;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 5;\nbuttonWidth = tactileSwitchWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = thumbNotchDepth * 2\/3;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + buttonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + buttonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-tactileSwitchLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, tactileSwitchHeight - tactileSwitchWellDepth]);\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1.0001]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"161634cb9a4dd7f7f21f6066eebc86ad66d9f0fc","subject":"cut-in beneath side mounting wing increased","message":"cut-in beneath side mounting wing increased\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+10, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+10, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 30, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7c99f80386d83495bd5ce085c5febdd14b954c24","subject":"Use values for slide switch FH35Q","message":"Use values for slide switch FH35Q","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/SlideSwitch.scad","new_file":"hardware\/vitamins\/SlideSwitch.scad","new_contents":"\/*\n Vitamin: SlideSwitch\n Model of various Slide Switches\n\n Derived from: http:\/\/www.maplin.co.uk\/p\/double-pole-sub-miniature-fh35q\n see also: http:\/\/www.edutronic.co.uk\/examples\/catalog.htm\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is through the centre of the bottom hole\n\n Parameters: none\n\n Returns:\n Model of a slide switch with mounting holes\n*\/\n\n\nmodule SlideSwitch()\n{\n\n plate_w = 7.0;\n plate_l = 23.0;\n plate_h = 1.0; \/\/ FIXME: ASSUMED VALUE\n plate_r = 1.0; \/\/ FIXME: ASSUMED VALUE\n centres = 19.0; \/\/ distance between mounting holes\n holedia = 2.5; \/\/ clearance for M2\n\n tang_w = 4.0; \/\/ FIXME: ASSUMED VALUE\n tang_d = 4.0; \/\/ FIXME: ASSUMED VALUE\n tang_h = 7.5;\n tthrow = 3.5; \/\/ amount tang moves to actuate switch\n\n body_w = 15.0;\n body_d = 7.0;\n body_h = 7.5;\n\n tags_w = 1.5;\n tags_h = 3.0;\n tags_d = 1.0; \/\/ FIXME: ASSUMED VALUE\n tags_x = 4.0; \/\/ FIXME: ASSUMED VALUE\n tags_y = 4.0; \/\/ FIXME: ASSUMED VALUE\n\n tags_a = 2; \/\/ amount of tags across\n tags_b = 3; \/\/ amount of tags down\n\n \/\/ Mounting Plate\n\n color(Grey60)\n translate([0, centres\/2, 0]) \/\/ move origin to bottom hole\n linear_extrude(plate_h)\n {\n difference()\n {\n \/\/ mounting plate\n \/\/ TODO: Show rounded corners?\n roundedSquare(size=[plate_w, plate_l], radius=plate_r, center=true);\n\n \/\/ mounting holes\n translate([0, centres\/2, 0])\n circle(d=holedia);\n translate([0, -centres\/2, 0])\n circle(d=holedia);\n\n \/\/ tang hole\n square(size=[tang_w, tang_d + tthrow], center=true);\n }\n }\n\n \/\/ Switch Tang\n\n color(Grey50)\n translate([0, centres\/2 + tthrow\/2, 0])\n linear_extrude(tang_h)\n {\n square(size=[tang_w, tang_d], center=true);\n }\n\n \/\/ Switch Body\n\n color(Grey50)\n translate([0, centres\/2, -body_h])\n linear_extrude(body_h)\n {\n square(size=[body_d, body_w], center=true);\n }\n\n \/\/ Switch Tags\n\n color(\"silver\")\n translate([-tags_x * (tags_a-1)\/2, centres\/2-tags_y*(tags_b-1)\/2, -body_h - tags_h])\n linear_extrude(tags_h)\n {\n for (x=[0 : tags_a-1], y=[0 : tags_b-1]) {\n translate([x * tags_x, y * tags_y, 0]) {\n square(size=[tags_d, tags_w], center=true);\n }\n }\n }\n}\n\n\n\/\/ Example Usage\n\/\/ SlideSwitch();\n","old_contents":"\/*\n Vitamin: SlideSwitch\n Model of various Slide Switches\n\n Derived from: http:\/\/www.maplin.co.uk\/p\/double-pole-miniature-fh36p\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is through the centre of the bottom hole\n\n Parameters: none\n\n Returns:\n Model of a slide switch with mounting holes\n*\/\n\n\nmodule SlideSwitch()\n{\n\n plate_w = 12.5;\n plate_l = 35.0;\n plate_h = 1.0; \/\/ FIXME: ASSUMED VALUE\n centres = 28.0; \/\/ distance between mounting holes\n\n tang_w = 5.0; \/\/ FIXME: ASSUMED VALUE\n tang_d = 5.0; \/\/ FIXME: ASSUMED VALUE\n tang_h = 10.0;\n tthrow = 5.5; \/\/ amount tang moves to actuate switch\n\n body_w = 24.0; \/\/ FIXME: ASSUMED VALUE\n body_d = 12.5; \/\/ FIXME: ASSUMED VALUE\n body_h = 8.0; \/\/ FIXME: ASSUMED VALUE\n\n tags_w = 2.5;\n tags_h = 5.0;\n tags_d = 1.0; \/\/ FIXME: ASSUMED VALUE\n tags_x = 8.0; \/\/ FIXME: ASSUMED VALUE\n tags_y = 8.0; \/\/ FIXME: ASSUMED VALUE\n\n tags_a = 2; \/\/ switch poles\n tags_b = 3; \/\/ switch throw\n\n \/\/ Mounting Plate\n\n color(Grey60)\n translate([0, centres\/2, 0]) \/\/ move origin to bottom hole\n linear_extrude(plate_h)\n {\n difference()\n {\n \/\/ mounting plate\n \/\/ TODO: Show rounded corners?\n roundedSquare(size=[plate_w, plate_l], radius=2, center=true);\n\n \/\/ mounting holes (M3 tapped)\n translate([0, centres\/2, 0])\n circle(d=3);\n translate([0, -centres\/2, 0])\n circle(d=3);\n\n \/\/ tang hole\n square(size=[tang_w, tang_d + tthrow], center=true);\n }\n }\n\n \/\/ Switch Tang\n\n color(Grey50)\n translate([0, centres\/2 + tthrow\/2, 0])\n linear_extrude(tang_h)\n {\n square(size=[tang_w, tang_d], center=true);\n }\n\n \/\/ Switch Body\n\n color(Grey50)\n translate([0, centres\/2, -body_h])\n linear_extrude(body_h)\n {\n square(size=[body_d, body_w], center=true);\n }\n\n \/\/ Switch Tags\n\n color(\"silver\")\n translate([-tags_x * (tags_a-1)\/2, centres\/2-tags_y*(tags_b-1)\/2, -body_h - tags_h])\n linear_extrude(tags_h)\n {\n for (x=[0 : tags_a-1], y=[0 : tags_b-1]) {\n translate([x * tags_x, y * tags_y, 0]) {\n square(size=[tags_d, tags_w], center=true);\n }\n }\n }\n}\n\n\n\/\/ Example Usage\n\/\/ SlideSwitch();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"87f090b96b5ca5780451684c6f62e73b289f7bb8","subject":"Add a scale bar.","message":"Add a scale bar.\n\nMeasurement need additional files (TextGenerator.scad and dimlines.scad)\nwhich you can get via http:\/\/is.gd\/f541Om\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/OmmatiDiag.scad","new_file":"DetectorMockup\/OmmatiDiag.scad","new_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.25;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n }\n \/\/ box front walls, can (and should be turned off for increased visibility)\n \/\/~ color (\"gray\", 0.6) {\n \/\/~ translate(v = [0, unitlength + padding, 0]) {\n \/\/~ cube([unitlength + padding, 1, height]);\n \/\/~ }\n \/\/~ translate(v = [unitlength + padding, 0, 0]) {\n \/\/~ cube([1, unitlength + padding, height]); \/\/\n \/\/~ }\n \/\/~ }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\", semitransparent)\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\",nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2])CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","old_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.25;\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n }\n \/\/ box front walls, can (and should be turned off for increased visibility)\n \/\/~ color (\"gray\", 0.6) {\n \/\/~ translate(v = [0, unitlength + padding, 0]) {\n \/\/~ cube([unitlength + padding, 1, height]);\n \/\/~ }\n \/\/~ translate(v = [unitlength + padding, 0, 0]) {\n \/\/~ cube([1, unitlength + padding, height]); \/\/\n \/\/~ }\n \/\/~ }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\", semitransparent)\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\",nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2])CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"739233167f72cc393251dbc5869591a4f8170df3","subject":"Reduce space around potentiom\u00e8tre Add a third layer","message":"Reduce space around potentiom\u00e8tre\nAdd a third layer\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/potentiometer_support.scad","new_file":"Hardware\/potentiometer_support.scad","new_contents":"width = 15;\nbeam_size = 10;\nbeam_thickness = 5;\nthickness = 3;\nbridge_length = 32;\npotentiometer_width = 16.1;\ntotal_length = bridge_length+2*width+2*thickness;\n\nmodule bottom_beam(){\ndifference(){\nunion(){\n\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tminkowski(){\n\t\t\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness\/2], center=true);\n\t\t\tcylinder(r= thickness, h=beam_thickness\/2,center=true);\n}\n\t}\n\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\n\t\n}\nmodule top_beam(){\ndifference(){\n\tunion(){\n\t\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\t}\n\t\tcylinder(r= 5+thickness, h= beam_thickness, center=true);\n\t}\n\tcylinder(r= 5, h= 2* beam_thickness, center=true);\n}\n}\n\nprojection() difference(){\n\tbottom_beam();\n\ttranslate([0 , potentiometer_width\/2],0) cube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\nprojection() translate([0, 23, beam_thickness+1]) bottom_beam();\n\nprojection() translate([0, 44, 2*beam_thickness+2])top_beam();\n\ntranslate([0, 0, 2* beam_thickness+2]) difference(){\n \tcylinder(r=3+thickness,h=beam_thickness, center=true);\n\tcylinder(r=3, h=2*beam_thickness, center=true);\n}\n\n\n","old_contents":"width = 15;\nbeam_size = 10;\nbeam_thickness = 5;\nthickness = 3;\nbridge_length = 32;\npotentiometer_width = 17;\ntotal_length = bridge_length+2*width+2*thickness;\n\nmodule bottom_beam(){\ndifference(){\nunion(){\n\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tminkowski(){\n\t\t\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness\/2], center=true);\n\t\t\tcylinder(r= thickness, h=beam_thickness\/2,center=true);\n}\n\t}\n\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n\ttranslate([0 , potentiometer_width\/2],0) cube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\n\t\n}\nmodule top_beam(){\ndifference(){\n\tunion(){\n\t\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [bridge_length+2*thickness, beam_size, beam_thickness], center=true);\n\t\t\t\n\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tcylinder(r= 5+thickness, h= beam_thickness, center=true);\n\t}\n\tcylinder(r= 5, h= 2* beam_thickness, center=true);\n}\n}\n\nprojection() translate([0, 12, beam_thickness+1]) rotate([0,0, 90]) top_beam();\nprojection() bottom_beam();\n\ntranslate([0, 0, 2* beam_thickness+2]) difference(){\n \tcylinder(r=3+thickness,h=beam_thickness, center=true);\n\tcylinder(r=3, h=2*beam_thickness, center=true);\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fad14d4650f6c74fa0f92b9ccdf16cbd96f4627e","subject":"main\/yaxis: add y axis motor mount","message":"main\/yaxis: add y axis motor mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3d102945bac76858526388c664e07c22a22bbeef","subject":"Do not put the battery and arduino on this part anymore, put on one of the two arm (to be done)","message":"Do not put the battery and arduino on this part anymore, put on one of the two arm (to be done)\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/line_support.scad","new_file":"Hardware\/line_support.scad","new_contents":"RF_module_length = 30;\n9V_battery_length = 50;\nlength_for_arduino_nano = 30;\ntotal_length = RF_module_length +9V_battery_length+0*length_for_arduino_nano; \nwidth = 15; \/\/ Based on arduino nano length between \"legs\"\nthickness = 5;\n\nprojection() embedded_support();\n\nmodule embedded_support(){\n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([total_length\/2+10,0,0]) cylinder(r=15, h=thickness, center=true);\n\t\t\t\/\/ Main support\n\t\t\tcube(size = [total_length +20, width, thickness], center = true);\n\t\t\t\/\/translate([30,0,0]) cube(size = [length_for_arduino_nano, length_for_arduino_nano, thickness], center = true);\n\t\t\t\n\t\t\t\/\/ Right plate to attach strap\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,0,0]) cube(size = [30, width+20, thickness], center = true);\n\t\n\t\t\t\/\/ Left plate to attach strap\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,0,0]) cube(size = [30, width+20, thickness], center = true);\n\t\t}\n\t\t\t\t\/\/ Right holes to attach strap\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,-7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\n\t\t\t\/\/ Left holes to attach strap\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,-7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([total_length\/2+10,0,0]) cylinder(r=2.5, h=thickness, center=true);\n\n\t}\n}","old_contents":"RF_module_length = 30;\n9V_battery_length = 50;\nlength_for_arduino_nano = 30;\ntotal_length = RF_module_length +9V_battery_length+length_for_arduino_nano; \nwidth = 15; \/\/ Based on arduino nano length between \"legs\"\nthickness = 5;\n\nprojection() embedded_support();\n\nmodule embedded_support(){\n\tdifference(){\n\t\tunion(){\n\t\t\ttranslate([total_length\/2+10,0,0]) cylinder(r=15, h=thickness, center=true);\n\t\t\t\/\/ Main support\n\t\t\tcube(size = [total_length +20, width, thickness], center = true);\n\t\t\ttranslate([30,0,0]) cube(size = [length_for_arduino_nano, length_for_arduino_nano, thickness], center = true);\n\t\t\t\n\t\t\t\/\/ Right plate to attach strap\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,0,0]) cube(size = [30, width+20, thickness], center = true);\n\t\n\t\t\t\/\/ Left plate to attach strap\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,0,0]) cube(size = [30, width+20, thickness], center = true);\n\t\t}\n\t\t\t\t\/\/ Right holes to attach strap\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([total_length\/2+20\/2-30\/2,-7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\n\t\t\t\/\/ Left holes to attach strap\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([-total_length\/2-20\/2+30\/2,-7.5,0]) cube(size = [20, 5, 2*thickness], center = true);\n\t\t\ttranslate([total_length\/2+10,0,0]) cylinder(r=2.5, h=thickness, center=true);\n\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fbbc5eacb4d9d7254fc43983bc61a87b3dd1f143","subject":"[scad] reduce wall thickness to 1mm","message":"[scad] reduce wall thickness to 1mm\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 1;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","old_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"911319c59f0bb368995ac3633be36647a759e680","subject":"nor cchnage.# Your branch is ahead of 'origin\/master' by 2 commits.","message":"nor cchnage.# Your branch is ahead of 'origin\/master' by 2 commits.\n","repos":"chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella,chuckcoughlin\/sarah-bella","old_file":"cad\/mezzanine.scad","new_file":"cad\/mezzanine.scad","new_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes supports for a breadboard and\n\/\/ rivet holes for a battery. The breadboard is\n\/\/ centered on the origin. y is positive toward the RPi.\nthickness = 4;\n\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nstart_cutout_x = 40; \/\/ 1\/2 width of cutout around the helper board\nend_cutout_x = 65; \/\/ 1\/2 width of cutout around the helper board\nnarrow_x= 45; \/\/ 1\/2 width of the battery holder\n\nmin_y = 18; \/\/ beginning of \"wing\ncutout_y = 0; \/\/ close edge of the cutout\nwide_y = -26; \/\/ The near edge the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = -86; \/\/ Greatest extent of the plate\n\nbreadboard_width = 164; \/\/ \nbreadboard_height = 26; \/\/ Chopped\nbreadboard_thickness = 10;\nbreadboard_z = 10; \/\/ Base to bottom of breadboard\n\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = -20; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\n\nbattery_rivet_x = 28; \/\/ On centerline\nbattery_rivet_y = 16; \/\/ On centerline, 16mm from rim.\nrivet2_x = 60;\nrivet_y = 8;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ Make 4 holders for the breadboard corners plus 1 at midpoint on battery edge\nmodule tub(z,rwidth) {\n \/\/linear_extrude(height=z,center=false,convexity=10) {\n \/\/ difference() {\n \/\/ square([breadboard_x+2*rwidth,breadboard_y+2*rwidth],true);\n \/\/ square([breadboard_x,breadboard_y],true);\n \/\/ }\n \/\/}\n}\n\/\/ Subtract this from the base platform\n\/\/ These are the posts\nmodule post_holes(z) {\n for(i=[[pillar_x,pillar_y],[-pillar_x,pillar_y]]) {\n translate(i)\n rotate(22.5,0,0)\n cylinder(r=4,h=z,$fn=6);\n }\n}\n\n\/\/ These are the various holes for battery rivets.\n\/\/ z - thickness\nmodule rivet_holes(z) {\n for(i=[[rivet1_x,-rivet_y],[rivet2_x,-rivet_y],\n [-rivet1_x,-rivet_y],[-rivet2_x,-rivet_y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the edge of the helper\n\/\/ board next to the RPi GPIO header. This object cannot be translated once created.\n\/\/ y is positive towards the RPi. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate. There should be no rim where hulls join.\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius and rim\n \/\/ There is no rim on joint.\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\ndifference() {\n base(thickness);\n rivet_holes(thickness);\n post_holes(thickness);\n}\ntranslate([0,0,thickness\/2])\ndifference() {\n color(\"red\")\n base(thickness);\n base_cutout(thickness,rim);\n}\n \/\/translate([0,-breadboard_y\/2,thickness\/2])\n \/\/tub(thickness,rim);\n \n","old_contents":"\/\/ OpenSCAD for a \"mezzanine\" extension for a Turtlebot3 burger\n\/\/ It includes supports for a breadboard and\n\/\/ rivet holes for a battery. The breadboard is\n\/\/ centered on the origin. y is positive toward the RPi.\nthickness = 4;\n\nwide_x = 110; \/\/ 1\/2 width of the \"wings\"\nstart_cutout_x = 40; \/\/ 1\/2 width of cutout around the helper board\nend_cutout_x = 65; \/\/ 1\/2 width of cutout around the helper board\nnarrow_x= 45; \/\/ 1\/2 width of the battery holder\n\nmin_y = 18; \/\/ beginning of \"wing\ncutout_y = 0; \/\/ close edge of the cutout\nwide_y = -26; \/\/ The near edge the wide rectangular portion\nfillet_side= 16; \/\/ End of flare to narrow\nfull_y = -86; \/\/ Greatest extent of the plate\n\nbreadboard_width = 164; \/\/ \nbreadboard_height = 26; \/\/ Chopped\nbreadboard_thickness = 10;\nbreadboard_z = 10; \/\/ Base to bottom of breadboard\n\npillar_x = 24; \/\/ Center-line to center of pillar\npillar_y = 20; \/\/ Baseline to center of pillar\nrim = 3; \/\/ Width of rim\n\nrivet1_x = 54;\nrivet2_x = 60;\nrivet_y = 8;\nrivet_radius = 2.5; \/\/ Hole radius for rivet attachment\nround_radius = 2; \/\/ Radius of the corner arcs\n\n\/\/ Make 4 holders for the breadboard corners plus 1 at midpoint on battery edge\nmodule tub(z,rwidth) {\n \/\/linear_extrude(height=z,center=false,convexity=10) {\n \/\/ difference() {\n \/\/ square([breadboard_x+2*rwidth,breadboard_y+2*rwidth],true);\n \/\/ square([breadboard_x,breadboard_y],true);\n \/\/ }\n \/\/}\n}\n\/\/ Subtract this from the base platform\n\/\/ These are the posts\nmodule post_holes(z) {\n for(i=[[pillar_x,-pillar_y],[-pillar_x,-pillar_y]]) {\n translate(i)\n rotate(22.5,0,0)\n cylinder(r=4,h=z,$fn=6);\n }\n}\n\n\/\/ These are the various holes for rivets\n\/\/ z - thickness\nmodule rivet_holes(z) {\n for(i=[[rivet1_x,-rivet_y],[rivet2_x,-rivet_y],\n [-rivet1_x,-rivet_y],[-rivet2_x,-rivet_y]]) {\n translate(i)\n cylinder(r=rivet_radius,h=z);\n }\n}\n\/\/ 0,0 is upper left corner\nmodule fillet(radius,angle) {\n rotate(angle,[0,0,1])\n difference() {\n square(radius,false);\n translate([radius,radius,0])\n circle(r=radius);\n }\n \n}\n\/\/ This is the basic plate. The baseline is y=0 along the edge of the helper\n\/\/ board next to the RPi GPIO header. This object cannot be translated once created.\n\/\/ y is positive towards the RPi. Couldn't make a single hull work.\nmodule base(z) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, wide_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, full_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2, wide_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2, min_y+round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y+round_radius\/2, 0])\n circle(r=round_radius);\n }\n translate([narrow_x,wide_y,0]) \n fillet(fillet_side,270); \n translate([-narrow_x,wide_y,0]) \n fillet(fillet_side,180);\n }\n}\n\n\/\/ This is the basic plate less a rim width all around. This is meant to\n\/\/ be subtracted from the standard plate. There should be no rim where hulls join.\nmodule base_cutout(z,rwidth) {\n $fn=100;\n linear_extrude(height=z,center=false,convexity=10) {\n \/\/ place circles in the corners, account for the rounding radius and rim\n \/\/ There is no rim on joint.\n union() {\n \/\/ Breadboard rectangular area.\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, wide_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n }\n };\n \/\/ Battery area\n hull() {\n translate([narrow_x-round_radius\/2-rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n \n translate([narrow_x-round_radius\/2-rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, full_y+round_radius\/2+rwidth, 0])\n circle(r=round_radius);\n \n translate([-narrow_x+round_radius\/2+rwidth, wide_y+round_radius, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip left\n hull() {\n translate([-wide_x+round_radius\/2+rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([-wide_x+round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-end_cutout_x+round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([-start_cutout_x+round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n }\n \/\/ Wingtip right\n hull() {\n translate([wide_x-round_radius\/2-rwidth, cutout_y-round_radius\/2, 0])\n circle(r=round_radius);\n \n translate([wide_x-round_radius\/2-rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([end_cutout_x-round_radius\/2+rwidth, min_y+round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n \n translate([start_cutout_x-round_radius\/2, cutout_y-round_radius\/2-rwidth, 0])\n circle(r=round_radius);\n } \n translate([narrow_x-rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,270); \n translate([-narrow_x+rwidth,-wide_y+rwidth,0]) \n fillet(fillet_side,180); \n }\n}\n\n\/\/ --------------------- Final Assembly ----------------------\n\/\/ Baseplate\ntranslate([0,0,-thickness\/2])\ndifference() {\n base(thickness);\n rivet_holes(thickness);\n post_holes(thickness);\n}\ntranslate([0,0,thickness\/2])\ndifference() {\n color(\"red\")\n base(thickness);\n base_cutout(thickness,rim);\n}\n \/\/translate([0,-breadboard_y\/2,thickness\/2])\n \/\/tub(thickness,rim);\n \n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ad50025d61c40e982710ecc9a5d62a2feafb5e15","subject":"change material thickness","message":"change material thickness\n","repos":"kak-bo-che\/zen_toolworks_quelab","old_file":"src\/power_supplies\/power_supply.scad","new_file":"src\/power_supplies\/power_supply.scad","new_contents":"include <..\/util\/slots.scad>\ninclude <..\/util\/rounded_square.scad>\n$fn=20;\npower_supply_length=215;\npower_supply_width=115;\npower_supply_height=50;\n\noverall_length=300;\noverall_height=70;\nstepper_power_width=30;\n\npart_separation=5;\nmaterial_thickness=3.04;\ncorner_radius=10;\nhole_size=3.2;\n\nbase_plate_length=150 + 70;\nbase_plate_width=power_supply_width + 2*corner_radius+material_thickness;\nmodule m4_holes(){\n hole_radius = 4.2\/2;\n x_offset = 150\/2;\n y_offset = 50\/2;\n translate([x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([x_offset, -y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, -y_offset]){\n circle(hole_radius);\n }\n\n}\nmodule power_supply(){\n difference(){\n %square([215, 115], center=true);\n m4_holes();\n }\n}\nmodule power_supply_side_holes(){\n hole_diameter = 4.2;\n x_offset = 150\/2;\n y_offset = 13;\n translate([x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n translate([-x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n}\nmodule power_supply_side(){\n difference(){\n %square([215, 50], center=true);\n power_supply_side_holes();\n }\n}\n\nmodule nema(){\n square([27, 42.3], center=true);\n}\n\nmodule vent_legs(count=3, radius=10){\n for(x=[1:count]){\n translate([x*overall_length\/(count + 1), 0]){\n hull(){\n translate([-1.5*radius, 0])circle(radius);\n translate([1.5*radius, 0]) circle(radius);\n }\n }\n }\n}\n\nmodule power_switch(){\n circle(12);\n %square([30, 37], center=true);\n}\n\nmodule stepper_power(){\n square([stepper_power_width, 110]);\n}\n\nmodule stepper_power_side_dc(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 9]) circle(d=10);\n}\n\nmodule stepper_power_side_ac(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 15.5]) square([15,20], center=true);\n}\n\nmodule ac_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_ac();\n translate([material_thickness + stepper_power_width + 25, power_supply_height\/2 + 10]) rotate(90) nema();\n translate([material_thickness + stepper_power_width + 10, 9]) circle(d=7.5);\n }\n}\n\n\nmodule dc_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_dc();\n translate([material_thickness + stepper_power_width + 25, 2*power_supply_height\/3]) circle(d=19.7);\n translate([material_thickness + stepper_power_width + 5, 17]) circle(d=7.5);\n }\n}\n\nmodule screw_terminal(n=2){\n terminal_height=18.6;\n divider_height=21.8;\n\n hole_locations = [[ 2, 28.7], [3, 38.2], [4, 47.7], [5, 57.2], [6, 66.7], [7, 76.2], [8, 85.7]];\n lengths = [[2, 36.2], [3, 45.7], [4, 55.2], [5, 64.7], [6, 74.2], [7, 83.7], [8, 93.2]];\n hole_distance = lookup(n, hole_locations);\n length = lookup(n, lengths);\n \/\/ translate([length\/2, divider_height\/2]){\n %square([length, divider_height], center=true);\n translate([-hole_distance\/2, 4]) circle(d=4);\n translate([-hole_distance\/2, -4]) circle(d=4);\n translate([hole_distance\/2, 4]) circle(d=4);\n translate([hole_distance\/2, -4]) circle(d=4);\n \/\/ }\n}\n\nmodule side(){\n leg_holes = floor(overall_length\/5);\n difference(){\n square([overall_length, overall_height]);\n make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, overall_height]) vent_legs();\n translate([material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([material_thickness, power_supply_height + 1.5]) make_slots(overall_length - power_supply_length - material_thickness, 5, material_thickness, true);\n translate([overall_length - power_supply_length, 0]){\n translate([power_supply_length\/2, power_supply_height\/2]) rotate(180) power_supply_side();\n }\n }\n}\n\nmodule front(){\n translate([0, material_thickness]) square([power_supply_width, overall_height - material_thickness]);\n translate([power_supply_width + material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([0, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n make_slots(power_supply_width, 5, material_thickness, true);\n}\n\nmodule top(){\n difference(){\n union(){\n square([overall_length - power_supply_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n }\n translate([material_thickness, 0]) rotate(90) make_slots(power_supply_width, 5, material_thickness, true);\n translate([(overall_length - power_supply_length + 13)\/2, 2.4*power_supply_width\/5]) power_switch();\n translate([(overall_length - power_supply_length + 30)\/2, 4*power_supply_width\/5]) screw_terminal(2);\n % translate([material_thickness, 0]) stepper_power();\n }\n}\n\nmodule bottom(){\n bottom_length = overall_length - power_supply_length - material_thickness;\n square([bottom_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(bottom_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(bottom_length, 5, material_thickness, true);\n}\n\nac_side();\ntranslate([0, -part_separation]) mirror([0,1,0]) dc_side();\ntranslate([0, -(overall_height + power_supply_width + 2* part_separation)]) top();\ntranslate([-power_supply_width - part_separation, 0]) front();\ntranslate([material_thickness, overall_height + part_separation]) bottom();\n","old_contents":"include <..\/util\/slots.scad>\ninclude <..\/util\/rounded_square.scad>\n$fn=20;\npower_supply_length=215;\npower_supply_width=115;\npower_supply_height=50;\n\noverall_length=300;\noverall_height=70;\nstepper_power_width=30;\n\npart_separation=5;\nmaterial_thickness=3.1;\ncorner_radius=10;\nhole_size=3.2;\n\nbase_plate_length=150 + 70;\nbase_plate_width=power_supply_width + 2*corner_radius+material_thickness;\nmodule m4_holes(){\n hole_radius = 4.2\/2;\n x_offset = 150\/2;\n y_offset = 50\/2;\n translate([x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, y_offset]){\n circle(hole_radius);\n }\n translate([x_offset, -y_offset]){\n circle(hole_radius);\n }\n translate([-x_offset, -y_offset]){\n circle(hole_radius);\n }\n\n}\nmodule power_supply(){\n difference(){\n %square([215, 115], center=true);\n m4_holes();\n }\n}\nmodule power_supply_side_holes(){\n hole_diameter = 4.2;\n x_offset = 150\/2;\n y_offset = 13;\n translate([x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n translate([-x_offset, y_offset]){\n circle(d=hole_diameter);\n }\n}\nmodule power_supply_side(){\n difference(){\n %square([215, 50], center=true);\n power_supply_side_holes();\n }\n}\n\nmodule nema(){\n square([27, 42.3], center=true);\n}\n\nmodule vent_legs(count=3, radius=10){\n for(x=[1:count]){\n translate([x*overall_length\/(count + 1), 0]){\n hull(){\n translate([-1.5*radius, 0])circle(radius);\n translate([1.5*radius, 0]) circle(radius);\n }\n }\n }\n}\n\nmodule power_switch(){\n circle(12);\n %square([30, 37], center=true);\n}\n\nmodule stepper_power(){\n square([stepper_power_width, 110]);\n}\n\nmodule stepper_power_side_dc(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 9]) circle(d=10);\n}\n\nmodule stepper_power_side_ac(){\n %square([stepper_power_width, 48]);\n translate([stepper_power_width\/2, 15.5]) square([15,20], center=true);\n}\n\nmodule ac_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_ac();\n translate([material_thickness + stepper_power_width + 25, power_supply_height\/2 + 10]) rotate(90) nema();\n translate([material_thickness + stepper_power_width + 10, 9]) circle(d=7.5);\n }\n}\n\n\nmodule dc_side(){\n difference(){\n side();\n translate([material_thickness, material_thickness]) stepper_power_side_dc();\n translate([material_thickness + stepper_power_width + 25, 2*power_supply_height\/3]) circle(d=19.7);\n translate([material_thickness + stepper_power_width + 5, 17]) circle(d=7.5);\n }\n}\n\nmodule screw_terminal(n=2){\n terminal_height=18.6;\n divider_height=21.8;\n\n hole_locations = [[ 2, 28.7], [3, 38.2], [4, 47.7], [5, 57.2], [6, 66.7], [7, 76.2], [8, 85.7]];\n lengths = [[2, 36.2], [3, 45.7], [4, 55.2], [5, 64.7], [6, 74.2], [7, 83.7], [8, 93.2]];\n hole_distance = lookup(n, hole_locations);\n length = lookup(n, lengths);\n \/\/ translate([length\/2, divider_height\/2]){\n %square([length, divider_height], center=true);\n translate([-hole_distance\/2, 4]) circle(d=4);\n translate([-hole_distance\/2, -4]) circle(d=4);\n translate([hole_distance\/2, 4]) circle(d=4);\n translate([hole_distance\/2, -4]) circle(d=4);\n \/\/ }\n}\n\nmodule side(){\n leg_holes = floor(overall_length\/5);\n difference(){\n square([overall_length, overall_height]);\n make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, overall_height]) vent_legs();\n translate([material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([material_thickness, power_supply_height + 1.5]) make_slots(overall_length - power_supply_length - material_thickness, 5, material_thickness, true);\n translate([overall_length - power_supply_length, 0]){\n translate([power_supply_length\/2, power_supply_height\/2]) rotate(180) power_supply_side();\n }\n }\n}\n\nmodule front(){\n translate([0, material_thickness]) square([power_supply_width, overall_height - material_thickness]);\n translate([power_supply_width + material_thickness, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n translate([0, 0]) rotate(90) make_slots(overall_height, 5, material_thickness, true);\n make_slots(power_supply_width, 5, material_thickness, true);\n}\n\nmodule top(){\n difference(){\n union(){\n square([overall_length - power_supply_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(overall_length - power_supply_length, 5, material_thickness, true);\n }\n translate([material_thickness, 0]) rotate(90) make_slots(power_supply_width, 5, material_thickness, true);\n translate([(overall_length - power_supply_length + 13)\/2, 2.4*power_supply_width\/5]) power_switch();\n translate([(overall_length - power_supply_length + 30)\/2, 4*power_supply_width\/5]) screw_terminal(2);\n % translate([material_thickness, 0]) stepper_power();\n }\n}\n\nmodule bottom(){\n bottom_length = overall_length - power_supply_length - material_thickness;\n square([bottom_length, power_supply_width]);\n translate([0, power_supply_width]) make_slots(bottom_length, 5, material_thickness, true);\n translate([0, -material_thickness]) make_slots(bottom_length, 5, material_thickness, true);\n}\n\nac_side();\ntranslate([0, -part_separation]) mirror([0,1,0]) dc_side();\ntranslate([0, -(overall_height + power_supply_width + 2* part_separation)]) top();\ntranslate([-power_supply_width - part_separation, 0]) front();\ntranslate([material_thickness, overall_height + part_separation]) bottom();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"879d6e4531b4fe399adf80521211cd51640b8629","subject":"Bugfixes.","message":"Bugfixes.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ace07d4499038810e9db8d7b690cc1ab2e6c8e8d","subject":"bottom_surface","message":"bottom_surface\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\nHEIGHT_COVER = 2 * BORDER_RADIUS_BODY;\n\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n diameter_base = DIAMETER_BODY - HEIGHT_COVER;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule shoulder(position_z)\n{\n position_ring = [0,0,position_z];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n posision_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(posision_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{ \n position = [0,0,main_position_z()];\n \n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_COVER);\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\nmodule bottom_surface()\n{\n position = [0,0,-HEIGHT_BODY];\n diameter = DIAMETER_BODY - HEIGHT_COVER;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter,\n $fn = FINE); \n}\n\nmodule body()\n{ \n top_surface();\n shoulder(top_position_z()); \n \n main_cylinder();\n \n shoulder(main_position_z()); \n bottom_surface();\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nHEIGHT_TOP = 2 * BORDER_RADIUS_BODY;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n diameter_base = DIAMETER_BODY - HEIGHT_TOP;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule shoulder(position_z)\n{\n position_ring = [0,0,position_z];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n posision_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(posision_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{ \n position = [0,0,main_position_z()];\n \n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_TOP);\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\n\nmodule body()\n{ \n top_surface();\n shoulder(top_position_z()); \n \n main_cylinder();\n shoulder(main_position_z()); \n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6422f38c70ea8041d3e88470f0a4813e75507cae","subject":"added wire channel in case top (had to manually cut with last version)","message":"added wire channel in case top (had to manually cut with last version)\n","repos":"tedyapo\/serial-dmm-adapter","old_file":"hardware\/adapter_case.scad","new_file":"hardware\/adapter_case.scad","new_contents":"\/\/ Serial DMM adapter case\n\/\/ designed to fit an Arduino nano clone and a DB-9 male plug\n\/\/\n\/\/ Copyright (C) 2016 Theodore C. Yapo\n\nlayout = \"printing\";\n\/\/layout = \"exploded\";\n\n\nboard_width = 18.5;\nboard_length = 44.5;\nboard_thickness = 1.85;\nusb_lip = 2;\nusb_height = 4.25;\nusb_width = 8;\nusb_length = 9;\n\nmodule nano_board()\n{\n translate([-board_length\/2, -board_width\/2, 0]){\n color(\"blue\") cube([board_length, board_width, board_thickness]);\n }\n translate([-board_length\/2-2.5, -usb_width\/2, board_thickness]){\n color([0.85, 0.85, 0.85]) cube([usb_length, usb_width, usb_height]);\n }\n}\n\ndb9_hole_spacing = 25;\nmodule db9_profile()\n{\n corner_r = 3;\n top_w = 19.5;\n bottom_w = 17.5;\n height = 9.5;\n length = 7;\n back_length = 9;\n flange_w = 33.5;\n flange_h = 20;\n flange_r = 1;\n flange_thickness = 1.25;\n fn = 13;\n epsilon = 0.1;\n\n \/\/ pin shroud\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([+(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n }\n }\n\n \/\/ back body\n b_corner_r = 3;\n b_top_w = 22;\n b_bottom_w = 19;\n b_height = 12;\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([+(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n }\n }\n\n \/\/ flange\n hull(){\n translate([+(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([+(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n }\n\n\n}\n\nheight = 20;\nlength = 64;\nwidth = 22;\nboard_lip = 2;\nconnector_width = 40;\nconnector_length = 18;\nconnector_recess = 5;\nconnector_height = 13;\nbulge_length = 10;\nbottom_thickness = 3;\nnut_dist = 6;\nscrew_hole_d = 3.25;\nscrew_hole_x = length\/2 - connector_length + 5;\nscrew_hole_y = (connector_width + width) \/ 4;\n\nmodule case_bottom()\n{\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height\/2]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n \/\/ board recess\n translate([-length\/2 + usb_lip,\n -board_width\/2,\n height\/2 - board_thickness]){\n cube([board_length,\n board_width,\n height\/2]);\n }\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n db9_profile();\n }\n }\n }\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n\n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n \/\/ DB connector screw holes\n translate([length\/2 -15, -db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n translate([length\/2 -15, +db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n\n }\n}\n\nmodule case_top()\n{\n epsilon = 1;\n\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, height-connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ DB9 connector bulge trim\n tol = 0.5;\n translate([length\/2 - connector_length - tol,\n -connector_width\/2,\n height-connector_height]){\n cube([connector_length+epsilon+tol, connector_width, connector_height]);\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height - connector_height]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, 90]){\n db9_profile();\n }\n }\n }\n\n \/\/ usb slot\n translate([-length\/2-5, -usb_width\/2, height\/2-usb_height]){\n cube([10, usb_width, usb_height+epsilon]);\n }\n\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n \n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n}\n\n\nif (layout == \"exploded\"){ \n exploded_dist = 10;\n \n case_bottom();\n translate([0, 0, 4*exploded_dist]){\n mirror([0, 0, 1]){\n case_top();\n }\n }\n translate([-(length - board_length)\/2 + usb_lip,\n 0,\n height\/2 - board_thickness + exploded_dist]){\n nano_board();\n }\n translate([length\/2-connector_recess + exploded_dist,\n 0,\n height\/2 + exploded_dist]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n color([0.85, 0.85, 0.85]) db9_profile();\n }\n }\n }\n}\n\nif (layout == \"printing\"){\n s = 25;\n\n translate([0, +s, 0]){\n case_bottom();\n }\n translate([0, -s, 0]){\n rotate([0, 0, 180]){\n case_top();\n }\n }\n}\n","old_contents":"\/\/ Serial DMM adapter case\n\/\/ designed to fit an Arduino nano clone and a DB-9 male plug\n\/\/\n\/\/ Copyright (C) 2016 Theodore C. Yapo\n\nlayout = \"printing\";\n\/\/layout = \"exploded\";\n\n\nboard_width = 18.5;\nboard_length = 44.5;\nboard_thickness = 1.85;\nusb_lip = 2;\nusb_height = 4.25;\nusb_width = 8;\nusb_length = 9;\n\nmodule nano_board()\n{\n translate([-board_length\/2, -board_width\/2, 0]){\n color(\"blue\") cube([board_length, board_width, board_thickness]);\n }\n translate([-board_length\/2-2.5, -usb_width\/2, board_thickness]){\n color([0.85, 0.85, 0.85]) cube([usb_length, usb_width, usb_height]);\n }\n}\n\ndb9_hole_spacing = 25;\nmodule db9_profile()\n{\n corner_r = 3;\n top_w = 19.5;\n bottom_w = 17.5;\n height = 9.5;\n length = 7;\n back_length = 9;\n flange_w = 33.5;\n flange_h = 20;\n flange_r = 1;\n flange_thickness = 1.25;\n fn = 13;\n epsilon = 0.1;\n\n \/\/ pin shroud\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([+(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-bottom_w\/2 + corner_r), -(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n translate([-(-top_w\/2 + corner_r), +(-height\/2 + corner_r), 0]){\n cylinder($fn = fn, r = corner_r, h = length);\n }\n }\n }\n\n \/\/ back body\n b_corner_r = 3;\n b_top_w = 22;\n b_bottom_w = 19;\n b_height = 12;\n translate([0, 0, -back_clearance]){\n hull(){\n translate([+(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([+(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_bottom_w\/2 + b_corner_r),\n -(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n translate([-(-b_top_w\/2 + b_corner_r),\n +(-b_height\/2 + b_corner_r),\n -back_length-epsilon]){\n cylinder($fn = fn, r = b_corner_r, h = back_length+2*epsilon);\n }\n }\n }\n\n \/\/ flange\n hull(){\n translate([+(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([+(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), +(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n translate([-(-flange_w\/2 + flange_r), -(-flange_h\/2 + flange_r), 0]){\n cylinder($fn = fn, r = flange_r, h = flange_thickness);\n }\n }\n\n\n}\n\nheight = 20;\nlength = 64;\nwidth = 22;\nboard_lip = 2;\nconnector_width = 40;\nconnector_length = 18;\nconnector_recess = 5;\nconnector_height = 13;\nbulge_length = 10;\nbottom_thickness = 3;\nnut_dist = 6;\nscrew_hole_d = 3.25;\nscrew_hole_x = length\/2 - connector_length + 5;\nscrew_hole_y = (connector_width + width) \/ 4;\n\nmodule case_bottom()\n{\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ wire channel\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n height\/2]){\n cube([length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n \/\/ board recess\n translate([-length\/2 + usb_lip,\n -board_width\/2,\n height\/2 - board_thickness]){\n cube([board_length,\n board_width,\n height\/2]);\n }\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n db9_profile();\n }\n }\n }\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n\n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n\n \/\/ DB connector screw holes\n translate([length\/2 -15, -db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n translate([length\/2 -15, +db9_hole_spacing\/2, height\/2]){\n rotate([0, 90, 0]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n\n }\n}\n\nmodule case_top()\n{\n epsilon = 1;\n\n difference(){\n union(){\n \/\/ body\n translate([-length\/2, -width\/2, 0]){\n cube([length, width, height\/2]);\n }\n \/\/ DB9 connector bulge\n translate([length\/2 - connector_length, -connector_width\/2, 0]){\n cube([connector_length, connector_width, height-connector_height]);\n }\n \/\/ screw clamp bulge\n translate([-length\/2, -connector_width\/2, 0]){\n cube([bulge_length, connector_width, height\/2]);\n }\n }\n\n \/\/ DB9 connector bulge trim\n tol = 0.5;\n translate([length\/2 - connector_length - tol,\n -connector_width\/2,\n height-connector_height]){\n cube([connector_length+epsilon+tol, connector_width, connector_height]);\n }\n\n \/\/ below-board hollow\n translate([-length\/2 + usb_lip,\n -board_width\/2 + board_lip,\n bottom_thickness]){\n cube([board_length - board_lip,\n board_width - 2*board_lip,\n height\/2]);\n }\n\n \/\/ DB9 opening\n translate([length\/2-connector_recess, 0, height\/2]){\n rotate([0, 90, 0]){\n rotate([0, 0, 90]){\n db9_profile();\n }\n }\n }\n\n \/\/ usb slot\n translate([-length\/2-5, -usb_width\/2, height\/2-usb_height]){\n cube([10, usb_width, usb_height+epsilon]);\n }\n\n \/\/ nut slots\n translate([length\/2-nut_dist, -db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n translate([length\/2-nut_dist, +db9_hole_spacing\/2, height\/2]){\n rotate([0, -90, 0]){\n hull(){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n translate([20, 0, 0]){\n cylinder($fn = 6, d = 6.25 \/ cos(30), h = 3); \n }\n }\n }\n }\n \n \/\/ screw holes\n epsilon = 1;\n screw_hole_d = 3.25;\n screw_hole_x1 = length\/2 - connector_length + 5;\n screw_hole_y = (connector_width + width) \/ 4;\n translate([screw_hole_x1, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x1, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n screw_hole_x2 = -length\/2 + 5;\n translate([screw_hole_x2, -screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n translate([screw_hole_x2, +screw_hole_y, -epsilon]){\n cylinder($fn = 8, d = screw_hole_d, h = height);\n }\n }\n}\n\n\nif (layout == \"exploded\"){ \n exploded_dist = 10;\n \n case_bottom();\n translate([0, 0, 4*exploded_dist]){\n mirror([0, 0, 1]){\n case_top();\n }\n }\n translate([-(length - board_length)\/2 + usb_lip,\n 0,\n height\/2 - board_thickness + exploded_dist]){\n nano_board();\n }\n translate([length\/2-connector_recess + exploded_dist,\n 0,\n height\/2 + exploded_dist]){\n rotate([0, 90, 0]){\n rotate([0, 0, -90]){\n color([0.85, 0.85, 0.85]) db9_profile();\n }\n }\n }\n}\n\nif (layout == \"printing\"){\n s = 25;\n\n translate([0, +s, 0]){\n case_bottom();\n }\n translate([0, -s, 0]){\n rotate([0, 0, 180]){\n case_top();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"57743fa40efcb08ae165c939008d31059f1dcff5","subject":"y\/idler: minor debug tweak","message":"y\/idler: minor debug tweak\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n tx(extrusion_size\/2)\n tx(yaxis_idler_mount_thickness\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head_embed=false, h=extrusion_size\/2+yaxis_idler_mount_thickness, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", cut_screw=true, screw_l=20*mm, trap_axis=-Z, orient=-X);\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, -X], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,-X], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n tx(extrusion_size\/2)\n tx(yaxis_idler_mount_thickness\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head_embed=false, h=extrusion_size\/2+yaxis_idler_mount_thickness, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", cut_screw=true, screw_l=20*mm, trap_axis=-Z, orient=-X);\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, -X], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"119e0b2c5534d818fd359139b922abd91486fdb6","subject":"todo: arm spacers and elbow screw holes","message":"todo: arm spacers and elbow screw holes\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 4, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 4, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"d35a3c4d5e9758578d5e6aa79adb3f0c362e41fa","subject":"orientation du trou de vis vers le m\u00e9plat.","message":"orientation du trou de vis vers le m\u00e9plat.\n","repos":"RoseTeam\/Futurakart,RoseTeam\/Futurakart,RoseTeam\/Futurakart","old_file":"m\u00e9ca\/pignon.scad","new_file":"m\u00e9ca\/pignon.scad","new_contents":"\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule poly_path3386(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-33.987888,392.697738],[-49.999310,390.711858],[-59.408529,387.759464],[-62.169828,385.621300],[-63.919597,382.882078],[-65.236568,375.121218],[-66.075386,368.025598],[-69.612998,363.966368],[-75.641290,360.729031],[-85.746118,357.799868],[-111.487888,350.589118],[-126.487888,345.885178],[-133.362888,343.136938],[-147.737888,337.085178],[-157.863998,332.485828],[-164.846488,330.701288],[-170.294780,330.708022],[-175.074868,333.991018],[-179.072268,338.673768],[-181.414938,341.632408],[-185.685749,343.830842],[-190.868628,343.507162],[-198.252756,340.299062],[-209.127318,333.844238],[-230.448268,319.469238],[-236.816338,315.216468],[-241.605968,311.992958],[-255.237888,300.282038],[-276.197684,280.902674],[-297.748008,257.716468],[-298.530303,255.253976],[-297.985943,251.665674],[-296.274140,247.498817],[-293.554108,243.300658],[-290.862888,238.172888],[-289.612888,236.466468],[-288.346295,235.346986],[-288.737353,232.323879],[-293.874928,222.578828],[-315.508307,189.979131],[-328.660668,166.464348],[-334.679480,155.121539],[-339.878817,147.272869],[-344.441620,142.685292],[-348.550827,141.125758],[-357.238139,141.989078],[-362.568678,142.272016],[-366.253002,139.918628],[-369.103974,135.468962],[-372.568990,127.608501],[-378.458152,108.966468],[-382.039590,95.216468],[-386.570862,75.937019],[-388.362674,61.883128],[-388.726847,58.082357],[-389.602112,56.258128],[-391.015580,52.091468],[-392.189853,40.841468],[-394.100952,19.812536],[-393.980025,5.169928],[-392.459216,0.609433],[-389.174474,-2.373812],[-382.078520,-4.778852],[-377.267507,-6.033233],[-373.305582,-9.551489],[-370.455026,-14.988789],[-368.978122,-22.000302],[-367.142514,-42.283532],[-364.946418,-60.813713],[-359.644638,-86.658532],[-356.658329,-102.349650],[-356.277549,-112.058453],[-357.144447,-115.253946],[-358.758987,-117.655211],[-364.359335,-121.010192],[-367.800635,-123.147476],[-370.286114,-126.319423],[-371.661458,-130.242452],[-371.772355,-134.632982],[-369.555734,-143.205617],[-366.366540,-149.158532],[-362.128939,-159.158532],[-352.481307,-181.485303],[-338.773760,-206.321192],[-335.862888,-211.619542],[-328.362888,-222.808232],[-320.862888,-234.171412],[-318.701653,-237.972675],[-313.739350,-244.218646],[-308.258081,-250.230726],[-304.539948,-253.330322],[-300.524921,-253.523447],[-294.107398,-250.884992],[-285.055768,-247.283532],[-281.342092,-248.322538],[-276.132718,-251.803957],[-258.457168,-268.280432],[-237.668561,-287.813311],[-216.589368,-304.158532],[-206.175438,-311.969502],[-201.863048,-314.782006],[-195.613048,-318.384906],[-176.487888,-328.778513],[-157.554116,-338.984662],[-152.454413,-342.806714],[-148.903618,-346.657918],[-146.227438,-351.212924],[-147.007528,-356.174767],[-147.980833,-360.671210],[-147.839054,-364.505963],[-146.374777,-367.833411],[-143.380588,-370.807942],[-138.649072,-373.583940],[-131.972817,-376.315793],[-111.956428,-382.264607],[-96.331428,-386.989347],[-84.376198,-389.037092],[-74.764528,-389.874043],[-71.563698,-385.163620],[-68.362888,-378.328482],[-67.222176,-376.015643],[-64.479608,-373.438631],[-61.985849,-371.922180],[-59.053443,-371.206801],[-46.042108,-371.596801],[-27.112888,-373.080517],[-0.174899,-374.079236],[26.316772,-373.378646],[34.262300,-372.876069],[39.695595,-373.884667],[43.189146,-376.646225],[45.315442,-381.402528],[47.481279,-386.406379],[50.460362,-390.478716],[54.883834,-393.323097],[63.140352,-393.666307],[78.512112,-391.668918],[101.012112,-386.023358],[122.438302,-379.673143],[130.204252,-376.693748],[136.903062,-374.385826],[145.387112,-371.033532],[153.824612,-367.761976],[162.574612,-364.062149],[173.637002,-359.062149],[181.305742,-356.033532],[184.043617,-354.282157],[185.819957,-349.486589],[186.493708,-342.334663],[185.923812,-333.514213],[185.856340,-328.301367],[188.189602,-324.624654],[194.854652,-319.062196],[220.163902,-300.145732],[223.550902,-298.533532],[230.072402,-293.846032],[237.935402,-287.099502],[253.512112,-273.610492],[261.945906,-266.212899],[267.661434,-262.993267],[273.095571,-263.319133],[280.685192,-266.558032],[288.844482,-269.783532],[292.121154,-267.792961],[297.220829,-263.319239],[301.780198,-258.609354],[303.435952,-255.910292],[303.295944,-255.114517],[303.937232,-254.783532],[315.745882,-240.621644],[328.084902,-222.973622],[330.587762,-219.783532],[331.637112,-217.970642],[333.199612,-215.158142],[336.146670,-211.890367],[339.305722,-206.033532],[343.711952,-197.283532],[353.700972,-177.908532],[361.785692,-163.741872],[362.887112,-161.480592],[363.290995,-160.413157],[364.299272,-160.508762],[365.163542,-160.673747],[365.103752,-159.645032],[365.520872,-155.134892],[365.820871,-152.622646],[364.319842,-150.759892],[359.720102,-145.094432],[357.384580,-142.015011],[355.102952,-140.318342],[352.964857,-138.790648],[351.048642,-135.973866],[349.151872,-128.908112],[351.299975,-117.356137],[357.863222,-93.533532],[364.197575,-63.379653],[367.887112,-36.197342],[368.854739,-32.841599],[371.287934,-29.544194],[374.482170,-27.032411],[377.732922,-26.033532],[381.391420,-25.082045],[386.064132,-22.762623],[390.366923,-19.877823],[392.915652,-17.230202],[394.100952,-2.053212],[392.307452,33.356571],[389.362822,61.466468],[385.449962,78.341468],[378.388502,107.226396],[375.838083,114.104678],[373.343672,117.892278],[370.376340,120.591025],[367.645231,122.023864],[364.698150,122.329223],[361.082902,121.645528],[356.582250,121.076053],[352.351451,121.830888],[348.623518,123.829426],[345.631462,126.991058],[342.887112,133.032538],[341.637112,135.841468],[340.387112,138.440078],[337.262112,145.216468],[334.137112,151.744528],[328.143839,165.435862],[320.781192,178.091078],[319.137112,181.375528],[317.262112,185.216468],[315.387112,187.942818],[311.684162,193.727268],[304.789602,204.591468],[302.602607,210.094453],[301.189431,215.933839],[300.776791,220.782478],[301.591402,223.313218],[306.461342,229.524908],[309.310295,234.804256],[309.192742,239.344808],[308.145957,243.047161],[306.214850,246.708069],[295.387112,260.520288],[263.520422,292.091468],[250.458152,303.987729],[242.398202,310.091388],[240.387112,311.407318],[231.637112,317.782388],[222.887112,324.118938],[214.865227,328.168506],[204.255962,331.207718],[201.056942,331.432934],[198.779370,330.922332],[193.453362,325.984268],[188.468610,321.307977],[184.584512,320.779658],[170.650860,324.930919],[165.120474,327.416670],[162.887112,329.261348],[161.738622,330.216468],[148.926122,335.732308],[126.637112,344.774008],[115.387112,348.945668],[112.262112,349.962968],[99.385522,353.567898],[91.160241,356.705014],[86.116402,360.368411],[83.582521,365.321631],[82.887112,372.328218],[82.624029,377.293749],[81.508472,380.619268],[79.050986,383.100175],[74.762112,385.531868],[63.867735,388.561793],[47.461562,390.937928],[32.887112,392.663488],[1.199152,393.666307],[-33.987888,392.697788]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[26.252372,105.125118],[34.690422,103.966468],[39.035151,103.455062],[41.637112,102.091468],[44.882602,100.216468],[56.487952,95.216468],[67.166562,90.216468],[73.318872,84.591468],[77.739067,80.618812],[80.797832,78.966468],[82.273385,78.428606],[82.887112,77.135448],[83.571600,75.475957],[85.217272,74.057358],[93.281489,66.966307],[99.137112,60.010518],[101.620332,58.966468],[103.913926,57.923144],[105.848382,54.903968],[110.552662,47.740608],[113.199612,43.678108],[115.387112,40.216468],[117.887112,35.816628],[121.028092,26.186788],[123.590945,17.601082],[124.895312,7.152608],[126.260462,-5.185372],[127.153307,-13.654833],[125.809472,-23.373682],[124.137112,-31.860982],[121.814202,-40.770832],[117.276502,-52.569262],[115.392917,-57.429122],[113.974422,-59.057982],[113.160612,-59.155836],[112.730862,-60.334762],[110.315122,-68.138792],[108.515207,-71.113213],[106.524462,-72.675182],[104.366632,-74.489284],[102.165002,-78.069922],[95.235152,-87.908532],[84.957959,-99.184096],[81.637112,-103.757322],[75.765345,-107.349189],[64.449612,-112.390792],[61.637112,-114.826372],[61.261959,-115.551272],[60.359982,-115.391772],[57.649685,-115.947016],[52.926822,-118.390332],[43.651959,-122.414063],[31.373902,-125.422209],[17.831128,-127.099320],[4.762112,-127.129942],[-20.711670,-123.990051],[-29.596237,-121.629860],[-36.698118,-118.580862],[-44.833098,-116.033532],[-48.999588,-114.764592],[-53.955438,-111.752642],[-58.197253,-109.215908],[-62.755159,-105.336239],[-66.757669,-100.954667],[-69.333298,-96.912222],[-70.862888,-89.974722],[-72.136328,-85.260092],[-75.854488,-75.947592],[-81.456048,-58.682412],[-84.612888,-45.494912],[-86.145818,-40.000612],[-87.951618,-33.188112],[-89.106696,-24.313042],[-91.043118,-19.713512],[-92.379448,-15.651012],[-93.596288,-12.283532],[-93.797048,-10.361972],[-93.829575,-8.375973],[-94.943168,-6.299472],[-97.455118,0.216468],[-98.952438,7.716468],[-101.878959,20.100288],[-102.687098,30.113118],[-102.334379,36.258386],[-101.175388,38.654778],[-99.612888,40.751908],[-97.112888,44.591468],[-94.612888,48.535208],[-94.022825,49.722593],[-92.604148,50.216468],[-91.288903,50.726058],[-91.384288,52.272238],[-91.301995,54.309300],[-90.144711,56.507019],[-88.497601,58.078843],[-86.945828,58.238218],[-86.179178,58.429774],[-85.856678,59.830188],[-82.641258,65.841468],[-80.662133,67.941041],[-80.410348,67.722978],[-78.453734,69.050904],[-72.375758,74.867378],[-63.362888,84.872678],[-60.732088,87.508068],[-58.943494,88.406549],[-59.031078,87.646578],[-59.265019,86.685833],[-58.224388,86.720968],[-56.331638,88.758128],[-56.019138,91.558118],[-55.266183,92.370482],[-53.675388,92.439588],[-51.507370,92.807327],[-49.366728,94.337708],[-47.543320,95.802187],[-46.138038,96.011518],[-40.554598,98.368488],[-35.916154,100.702139],[-31.049478,102.041838],[-20.868158,104.735208],[-15.120311,106.168498],[-7.976978,106.130408],[2.887112,106.531908],[14.224757,106.932697],[26.252372,105.125118]]);\n }\n }\n}\n\nheight = 95;\n\nmodule pignon(h, s=.155)\n{\nscale([s,s,s])\npoly_path3386(h);\n}\next_radius = 34.6\/2;\n\nmodule dents(){\nrotate([0,0,-12])\ntranslate([0,-.2,0]){\n union()\n {\n cylindre(12,15);\n pignon(height);\n }\n}\n}\n\n\nmodule cylindre(r, h=1){\nlinear_extrude(height=h)\n circle(r);\n}\n\nmodule carreau(r, h=1){\nlinear_extrude(height=h)\n square(r,center=true);\n}\n\nmodule axe(sca=1.10, h=40)\n{\n scale([sca, sca, sca])\n rotate([0,0,90])\n difference(){\n cylindre(5.6,h);\n translate([0,-8.6,0]){\n carreau(9.7,h);\n }\n \n }\n}\n\ndifference()\n{\n difference(){\n dents();\n axe();\n };\n translate([0,0,4])\n rotate([0,90,0])\n cylindre(r=2,h=35);\n}\n\/\/cercle(ext_radius);\n\n","old_contents":"\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\nfudge = 0.1;\n\nmodule poly_path3386(h)\n{\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-33.987888,392.697738],[-49.999310,390.711858],[-59.408529,387.759464],[-62.169828,385.621300],[-63.919597,382.882078],[-65.236568,375.121218],[-66.075386,368.025598],[-69.612998,363.966368],[-75.641290,360.729031],[-85.746118,357.799868],[-111.487888,350.589118],[-126.487888,345.885178],[-133.362888,343.136938],[-147.737888,337.085178],[-157.863998,332.485828],[-164.846488,330.701288],[-170.294780,330.708022],[-175.074868,333.991018],[-179.072268,338.673768],[-181.414938,341.632408],[-185.685749,343.830842],[-190.868628,343.507162],[-198.252756,340.299062],[-209.127318,333.844238],[-230.448268,319.469238],[-236.816338,315.216468],[-241.605968,311.992958],[-255.237888,300.282038],[-276.197684,280.902674],[-297.748008,257.716468],[-298.530303,255.253976],[-297.985943,251.665674],[-296.274140,247.498817],[-293.554108,243.300658],[-290.862888,238.172888],[-289.612888,236.466468],[-288.346295,235.346986],[-288.737353,232.323879],[-293.874928,222.578828],[-315.508307,189.979131],[-328.660668,166.464348],[-334.679480,155.121539],[-339.878817,147.272869],[-344.441620,142.685292],[-348.550827,141.125758],[-357.238139,141.989078],[-362.568678,142.272016],[-366.253002,139.918628],[-369.103974,135.468962],[-372.568990,127.608501],[-378.458152,108.966468],[-382.039590,95.216468],[-386.570862,75.937019],[-388.362674,61.883128],[-388.726847,58.082357],[-389.602112,56.258128],[-391.015580,52.091468],[-392.189853,40.841468],[-394.100952,19.812536],[-393.980025,5.169928],[-392.459216,0.609433],[-389.174474,-2.373812],[-382.078520,-4.778852],[-377.267507,-6.033233],[-373.305582,-9.551489],[-370.455026,-14.988789],[-368.978122,-22.000302],[-367.142514,-42.283532],[-364.946418,-60.813713],[-359.644638,-86.658532],[-356.658329,-102.349650],[-356.277549,-112.058453],[-357.144447,-115.253946],[-358.758987,-117.655211],[-364.359335,-121.010192],[-367.800635,-123.147476],[-370.286114,-126.319423],[-371.661458,-130.242452],[-371.772355,-134.632982],[-369.555734,-143.205617],[-366.366540,-149.158532],[-362.128939,-159.158532],[-352.481307,-181.485303],[-338.773760,-206.321192],[-335.862888,-211.619542],[-328.362888,-222.808232],[-320.862888,-234.171412],[-318.701653,-237.972675],[-313.739350,-244.218646],[-308.258081,-250.230726],[-304.539948,-253.330322],[-300.524921,-253.523447],[-294.107398,-250.884992],[-285.055768,-247.283532],[-281.342092,-248.322538],[-276.132718,-251.803957],[-258.457168,-268.280432],[-237.668561,-287.813311],[-216.589368,-304.158532],[-206.175438,-311.969502],[-201.863048,-314.782006],[-195.613048,-318.384906],[-176.487888,-328.778513],[-157.554116,-338.984662],[-152.454413,-342.806714],[-148.903618,-346.657918],[-146.227438,-351.212924],[-147.007528,-356.174767],[-147.980833,-360.671210],[-147.839054,-364.505963],[-146.374777,-367.833411],[-143.380588,-370.807942],[-138.649072,-373.583940],[-131.972817,-376.315793],[-111.956428,-382.264607],[-96.331428,-386.989347],[-84.376198,-389.037092],[-74.764528,-389.874043],[-71.563698,-385.163620],[-68.362888,-378.328482],[-67.222176,-376.015643],[-64.479608,-373.438631],[-61.985849,-371.922180],[-59.053443,-371.206801],[-46.042108,-371.596801],[-27.112888,-373.080517],[-0.174899,-374.079236],[26.316772,-373.378646],[34.262300,-372.876069],[39.695595,-373.884667],[43.189146,-376.646225],[45.315442,-381.402528],[47.481279,-386.406379],[50.460362,-390.478716],[54.883834,-393.323097],[63.140352,-393.666307],[78.512112,-391.668918],[101.012112,-386.023358],[122.438302,-379.673143],[130.204252,-376.693748],[136.903062,-374.385826],[145.387112,-371.033532],[153.824612,-367.761976],[162.574612,-364.062149],[173.637002,-359.062149],[181.305742,-356.033532],[184.043617,-354.282157],[185.819957,-349.486589],[186.493708,-342.334663],[185.923812,-333.514213],[185.856340,-328.301367],[188.189602,-324.624654],[194.854652,-319.062196],[220.163902,-300.145732],[223.550902,-298.533532],[230.072402,-293.846032],[237.935402,-287.099502],[253.512112,-273.610492],[261.945906,-266.212899],[267.661434,-262.993267],[273.095571,-263.319133],[280.685192,-266.558032],[288.844482,-269.783532],[292.121154,-267.792961],[297.220829,-263.319239],[301.780198,-258.609354],[303.435952,-255.910292],[303.295944,-255.114517],[303.937232,-254.783532],[315.745882,-240.621644],[328.084902,-222.973622],[330.587762,-219.783532],[331.637112,-217.970642],[333.199612,-215.158142],[336.146670,-211.890367],[339.305722,-206.033532],[343.711952,-197.283532],[353.700972,-177.908532],[361.785692,-163.741872],[362.887112,-161.480592],[363.290995,-160.413157],[364.299272,-160.508762],[365.163542,-160.673747],[365.103752,-159.645032],[365.520872,-155.134892],[365.820871,-152.622646],[364.319842,-150.759892],[359.720102,-145.094432],[357.384580,-142.015011],[355.102952,-140.318342],[352.964857,-138.790648],[351.048642,-135.973866],[349.151872,-128.908112],[351.299975,-117.356137],[357.863222,-93.533532],[364.197575,-63.379653],[367.887112,-36.197342],[368.854739,-32.841599],[371.287934,-29.544194],[374.482170,-27.032411],[377.732922,-26.033532],[381.391420,-25.082045],[386.064132,-22.762623],[390.366923,-19.877823],[392.915652,-17.230202],[394.100952,-2.053212],[392.307452,33.356571],[389.362822,61.466468],[385.449962,78.341468],[378.388502,107.226396],[375.838083,114.104678],[373.343672,117.892278],[370.376340,120.591025],[367.645231,122.023864],[364.698150,122.329223],[361.082902,121.645528],[356.582250,121.076053],[352.351451,121.830888],[348.623518,123.829426],[345.631462,126.991058],[342.887112,133.032538],[341.637112,135.841468],[340.387112,138.440078],[337.262112,145.216468],[334.137112,151.744528],[328.143839,165.435862],[320.781192,178.091078],[319.137112,181.375528],[317.262112,185.216468],[315.387112,187.942818],[311.684162,193.727268],[304.789602,204.591468],[302.602607,210.094453],[301.189431,215.933839],[300.776791,220.782478],[301.591402,223.313218],[306.461342,229.524908],[309.310295,234.804256],[309.192742,239.344808],[308.145957,243.047161],[306.214850,246.708069],[295.387112,260.520288],[263.520422,292.091468],[250.458152,303.987729],[242.398202,310.091388],[240.387112,311.407318],[231.637112,317.782388],[222.887112,324.118938],[214.865227,328.168506],[204.255962,331.207718],[201.056942,331.432934],[198.779370,330.922332],[193.453362,325.984268],[188.468610,321.307977],[184.584512,320.779658],[170.650860,324.930919],[165.120474,327.416670],[162.887112,329.261348],[161.738622,330.216468],[148.926122,335.732308],[126.637112,344.774008],[115.387112,348.945668],[112.262112,349.962968],[99.385522,353.567898],[91.160241,356.705014],[86.116402,360.368411],[83.582521,365.321631],[82.887112,372.328218],[82.624029,377.293749],[81.508472,380.619268],[79.050986,383.100175],[74.762112,385.531868],[63.867735,388.561793],[47.461562,390.937928],[32.887112,392.663488],[1.199152,393.666307],[-33.987888,392.697788]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[26.252372,105.125118],[34.690422,103.966468],[39.035151,103.455062],[41.637112,102.091468],[44.882602,100.216468],[56.487952,95.216468],[67.166562,90.216468],[73.318872,84.591468],[77.739067,80.618812],[80.797832,78.966468],[82.273385,78.428606],[82.887112,77.135448],[83.571600,75.475957],[85.217272,74.057358],[93.281489,66.966307],[99.137112,60.010518],[101.620332,58.966468],[103.913926,57.923144],[105.848382,54.903968],[110.552662,47.740608],[113.199612,43.678108],[115.387112,40.216468],[117.887112,35.816628],[121.028092,26.186788],[123.590945,17.601082],[124.895312,7.152608],[126.260462,-5.185372],[127.153307,-13.654833],[125.809472,-23.373682],[124.137112,-31.860982],[121.814202,-40.770832],[117.276502,-52.569262],[115.392917,-57.429122],[113.974422,-59.057982],[113.160612,-59.155836],[112.730862,-60.334762],[110.315122,-68.138792],[108.515207,-71.113213],[106.524462,-72.675182],[104.366632,-74.489284],[102.165002,-78.069922],[95.235152,-87.908532],[84.957959,-99.184096],[81.637112,-103.757322],[75.765345,-107.349189],[64.449612,-112.390792],[61.637112,-114.826372],[61.261959,-115.551272],[60.359982,-115.391772],[57.649685,-115.947016],[52.926822,-118.390332],[43.651959,-122.414063],[31.373902,-125.422209],[17.831128,-127.099320],[4.762112,-127.129942],[-20.711670,-123.990051],[-29.596237,-121.629860],[-36.698118,-118.580862],[-44.833098,-116.033532],[-48.999588,-114.764592],[-53.955438,-111.752642],[-58.197253,-109.215908],[-62.755159,-105.336239],[-66.757669,-100.954667],[-69.333298,-96.912222],[-70.862888,-89.974722],[-72.136328,-85.260092],[-75.854488,-75.947592],[-81.456048,-58.682412],[-84.612888,-45.494912],[-86.145818,-40.000612],[-87.951618,-33.188112],[-89.106696,-24.313042],[-91.043118,-19.713512],[-92.379448,-15.651012],[-93.596288,-12.283532],[-93.797048,-10.361972],[-93.829575,-8.375973],[-94.943168,-6.299472],[-97.455118,0.216468],[-98.952438,7.716468],[-101.878959,20.100288],[-102.687098,30.113118],[-102.334379,36.258386],[-101.175388,38.654778],[-99.612888,40.751908],[-97.112888,44.591468],[-94.612888,48.535208],[-94.022825,49.722593],[-92.604148,50.216468],[-91.288903,50.726058],[-91.384288,52.272238],[-91.301995,54.309300],[-90.144711,56.507019],[-88.497601,58.078843],[-86.945828,58.238218],[-86.179178,58.429774],[-85.856678,59.830188],[-82.641258,65.841468],[-80.662133,67.941041],[-80.410348,67.722978],[-78.453734,69.050904],[-72.375758,74.867378],[-63.362888,84.872678],[-60.732088,87.508068],[-58.943494,88.406549],[-59.031078,87.646578],[-59.265019,86.685833],[-58.224388,86.720968],[-56.331638,88.758128],[-56.019138,91.558118],[-55.266183,92.370482],[-53.675388,92.439588],[-51.507370,92.807327],[-49.366728,94.337708],[-47.543320,95.802187],[-46.138038,96.011518],[-40.554598,98.368488],[-35.916154,100.702139],[-31.049478,102.041838],[-20.868158,104.735208],[-15.120311,106.168498],[-7.976978,106.130408],[2.887112,106.531908],[14.224757,106.932697],[26.252372,105.125118]]);\n }\n }\n}\n\nheight = 95;\n\nmodule pignon(h, s=.155)\n{\nscale([s,s,s])\npoly_path3386(h);\n}\next_radius = 34.6\/2;\n\nmodule dents(){\nrotate([0,0,-12])\ntranslate([0,-.2,0]){\n color(\"White\", .5)\n {\n cylindre(6,6.2);\n pignon(height);\n }\n}\n}\n\n\nmodule cylindre(r, h=1){\nlinear_extrude(height=h)\n circle(r);\n}\n\nmodule carreau(r, h=1){\nlinear_extrude(height=h)\n square(r,center=true);\n}\n\nmodule axe(sca=1.10, h=16)\n{\n scale([sca, sca, sca])\n rotate([0,0,-90])\n difference(){\n cylindre(5.6,h);\n translate([0,-9.7,0]){\n carreau(9.7,h);\n }\n \n }\n}\n\ndifference()\n{\n difference(){\n dents();\n axe();\n };\n translate([0,0,4])\n rotate([0,90,0])\n cylindre(r=2,h=35);\n}\n\/\/cercle(ext_radius);\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ac471ae0a5f82bd320af5a973cfc99e5e59afe68","subject":"Round slots for easier cnc routing","message":"Round slots for easier cnc routing\n","repos":"google\/makerspace-auth,google\/makerspace-auth,thatch\/makerspace-auth,thatch\/makerspace-auth","old_file":"docs\/tool-connection\/epilog_mini_24\/plates\/one_box_mount_lib.scad","new_file":"docs\/tool-connection\/epilog_mini_24\/plates\/one_box_mount_lib.scad","new_contents":"box_center = [120,160];\nbox_size = [192,188];\nbox_front_size = [100,188];\n\n\/\/ Non-square pattern intentional; avoid colliding with pi bracket and reduce\n\/\/ number of possible wrong orientations by half.\nbox_hole_pattern = [\n [70, 60],\n [70, -60],\n [-70, 60],\n [-70, -60],\n];\n\nbox_hole_locations=[\n for (p = box_hole_pattern) box_center + p\n];\n\nframe_hole_locations=[\n [20,7.5],\n [62,292.5],\n];\n\nplate_width=235;\nplate_height=300;\n\narcade_button_hole_size=24;\narcade_button_pos = [18+27,15+42];\nbadge_reader_hole_size=17;\n\nmodule Plate(cap_size) {\n difference() {\n square([plate_width, plate_height]);\n translate([0,plate_height-30]) rotate(atan2(30, 40)) square([100,100]);\n for(p = box_hole_locations)\n translate(p) circle(d=cap_size);\n for(p = frame_hole_locations)\n translate(p) circle(d=4.5);\n }\n}\n\nmodule Main() {\n Plate(cap_size=25,$fn=128);\n translate([plate_width+4,0])\n Plate(cap_size=4.2,$fn=128);\n}\n\nmodule CapHead(d,h) {\n color([0.8,0.5,0.5]) {\n translate([0,0,-h]) cylinder(d=d,h=h);\n cylinder(d=d*1.5,h=d);\n }\n}\n\nmodule Leader(h) {\n color([0.5,0.5,0.5,0.3]) cylinder(d=1,h=h);\n}\n\nmodule GhostBox(dims) {\n color([0.5,0.5,0.5,0.3]) cube(dims);\n}\n\nmodule Exploded() {\n linear_extrude(height=6) Inner();\n translate([0,0,80]) linear_extrude(height=6) Outer();\n for(p = box_hole_locations) {\n translate(p) {\n translate([0,0,-60]) scale([1,1,-1]) CapHead(4,20,$fn=32);\n translate([0,0,-40]) Leader(160);\n }\n }\n for(p = frame_hole_locations) {\n translate(p) {\n translate([0,0,130]) CapHead(4,20,$fn=32);\n translate([0,0,-20]) Leader(130);\n }\n }\n translate([box_center[0],box_center[1],120]) translate([-100,-100]) GhostBox([box_size[0],box_size[1],90]);\n}\n\nmodule Slot(d, dist) {\n hull() for(y=[dist\/2,-dist\/2]) translate([0,y]) circle(d=d);\n}\n\nmodule ZiptieMount() {\n for(x=[200,210]) translate([x,30]) Slot(3, 7, $fn=16);\n}\n\nmodule Inner() {\n difference() {\n Plate(cap_size=25,$fn=128);\n hull() ZiptieMount();\n }\n}\n\nmodule Outer() {\n difference() {\n Plate(cap_size=4.2,$fn=128);\n ZiptieMount();\n }\n}\n\nmodule HoleTemplate() {\n $fn=32;\n difference() {\n square(box_size, center=true);\n for(p = box_hole_pattern) {\n translate(p) circle(d=3);\n }\n translate([-90,0]) text(\"A\", halign=\"left\", size=5);\n translate([90,0]) text(\"B\", halign=\"right\", size=5);\n translate([0,60]) text(\"4x 4.2mm\", halign=\"center\", size=5);\n translate([80,40]) text(\"Front ->\", halign=\"right\", size=5);\n translate([-80,40]) text(\"<- Back\", halign=\"left\", size=5);\n translate([0,10]) text(\"(place on back of box)\", halign=\"center\", size=8);\n translate([0,-10]) text(\"(verify interior 5 holes at sides)\", halign=\"center\", size=8);\n }\n}\n\nmodule CrosshairCircle(d) {\n difference() {\n circle(d=d);\n square([1,d*0.7], center=true);\n square([d*0.7, 1], center=true);\n }\n}\n\nmodule LidHoleTemplate() {\n $fn=32;\n difference() {\n square(box_size, center=true);\n translate([-box_size[0]\/2+3,0]) text(\"C\", halign=\"left\", size=5);\n translate([box_size[0]\/2-3,0]) text(\"D\", halign=\"right\", size=5);\n for(y_scale=[1,-1])\n scale([1,y_scale])\n translate([-box_size[0]\/2+arcade_button_pos[0],\n -box_size[1]\/2+arcade_button_pos[1]])\n CrosshairCircle(arcade_button_hole_size);\n }\n}\n\nmodule FrontHoleTemplate() {\n $fn=32;\n difference() {\n square(box_front_size, center=true);\n translate([box_front_size[0]\/2-20, 0]) square([1,box_front_size[1]-2], center=true);\n text(\"Front\", halign=\"center\", size=5);\n translate([-box_front_size[0]\/2+3,0]) text(\"B\", halign=\"left\", size=5);\n translate([box_front_size[0]\/2-3,0]) text(\"C\", halign=\"right\", size=5);\n translate([0,60]) CrosshairCircle(badge_reader_hole_size);\n }\n}\n\nmodule BackHoleTemplate() {\n $fn=32;\n difference() {\n square(box_front_size, center=true);\n translate([-box_front_size[0]\/2+20, 0]) square([1,box_front_size[1]-2], center=true);\n text(\"Back\", halign=\"center\", size=5);\n translate([box_front_size[0]\/2-3,0]) text(\"A\", halign=\"right\", size=5);\n translate([-box_front_size[0]\/2+3,0]) text(\"D\", halign=\"left\", size=5);\n translate([box_front_size[0]\/2-35,box_front_size[1]\/2-35])\n CrosshairCircle(8); \/\/ power\n translate([box_front_size[0]\/2-50,box_front_size[1]\/2-35])\n CrosshairCircle(8); \/\/ actuator cables\n translate([box_front_size[0]\/2-80+4,box_front_size[1]\/2-35])\n CrosshairCircle(8); \/\/ actuator cables\n }\n}\n","old_contents":"box_center = [120,160];\nbox_size = [192,188];\nbox_front_size = [100,188];\n\n\/\/ Non-square pattern intentional; avoid colliding with pi bracket and reduce\n\/\/ number of possible wrong orientations by half.\nbox_hole_pattern = [\n [70, 60],\n [70, -60],\n [-70, 60],\n [-70, -60],\n];\n\nbox_hole_locations=[\n for (p = box_hole_pattern) box_center + p\n];\n\nframe_hole_locations=[\n [20,7.5],\n [62,292.5],\n];\n\nplate_width=235;\nplate_height=300;\n\narcade_button_hole_size=24;\narcade_button_pos = [18+27,15+42];\nbadge_reader_hole_size=17;\n\nmodule Plate(cap_size) {\n difference() {\n square([plate_width, plate_height]);\n translate([0,plate_height-30]) rotate(atan2(30, 40)) square([100,100]);\n for(p = box_hole_locations)\n translate(p) circle(d=cap_size);\n for(p = frame_hole_locations)\n translate(p) circle(d=4.5);\n }\n}\n\nmodule Main() {\n Plate(cap_size=25,$fn=128);\n translate([plate_width+4,0])\n Plate(cap_size=4.2,$fn=128);\n}\n\nmodule CapHead(d,h) {\n color([0.8,0.5,0.5]) {\n translate([0,0,-h]) cylinder(d=d,h=h);\n cylinder(d=d*1.5,h=d);\n }\n}\n\nmodule Leader(h) {\n color([0.5,0.5,0.5,0.3]) cylinder(d=1,h=h);\n}\n\nmodule GhostBox(dims) {\n color([0.5,0.5,0.5,0.3]) cube(dims);\n}\n\nmodule Exploded() {\n linear_extrude(height=6) Inner();\n translate([0,0,80]) linear_extrude(height=6) Outer();\n for(p = box_hole_locations) {\n translate(p) {\n translate([0,0,-60]) scale([1,1,-1]) CapHead(4,20,$fn=32);\n translate([0,0,-40]) Leader(160);\n }\n }\n for(p = frame_hole_locations) {\n translate(p) {\n translate([0,0,130]) CapHead(4,20,$fn=32);\n translate([0,0,-20]) Leader(130);\n }\n }\n translate([box_center[0],box_center[1],120]) translate([-100,-100]) GhostBox([box_size[0],box_size[1],90]);\n}\n\nmodule ZiptieMount() {\n for(x=[200,210]) translate([x,30]) square([3,6.5], center=true);\n}\n\nmodule Inner() {\n difference() {\n Plate(cap_size=25,$fn=128);\n hull() ZiptieMount();\n }\n}\n\nmodule Outer() {\n difference() {\n Plate(cap_size=4.2,$fn=128);\n ZiptieMount();\n }\n}\n\nmodule HoleTemplate() {\n $fn=32;\n difference() {\n square(box_size, center=true);\n for(p = box_hole_pattern) {\n translate(p) circle(d=3);\n }\n translate([-90,0]) text(\"A\", halign=\"left\", size=5);\n translate([90,0]) text(\"B\", halign=\"right\", size=5);\n translate([0,60]) text(\"4x 4.2mm\", halign=\"center\", size=5);\n translate([80,40]) text(\"Front ->\", halign=\"right\", size=5);\n translate([-80,40]) text(\"<- Back\", halign=\"left\", size=5);\n translate([0,10]) text(\"(place on back of box)\", halign=\"center\", size=8);\n translate([0,-10]) text(\"(verify interior 5 holes at sides)\", halign=\"center\", size=8);\n }\n}\n\nmodule CrosshairCircle(d) {\n difference() {\n circle(d=d);\n square([1,d*0.7], center=true);\n square([d*0.7, 1], center=true);\n }\n}\n\nmodule LidHoleTemplate() {\n $fn=32;\n difference() {\n square(box_size, center=true);\n translate([-box_size[0]\/2+3,0]) text(\"C\", halign=\"left\", size=5);\n translate([box_size[0]\/2-3,0]) text(\"D\", halign=\"right\", size=5);\n for(y_scale=[1,-1])\n scale([1,y_scale])\n translate([-box_size[0]\/2+arcade_button_pos[0],\n -box_size[1]\/2+arcade_button_pos[1]])\n CrosshairCircle(arcade_button_hole_size);\n }\n}\n\nmodule FrontHoleTemplate() {\n $fn=32;\n difference() {\n square(box_front_size, center=true);\n translate([box_front_size[0]\/2-20, 0]) square([1,box_front_size[1]-2], center=true);\n text(\"Front\", halign=\"center\", size=5);\n translate([-box_front_size[0]\/2+3,0]) text(\"B\", halign=\"left\", size=5);\n translate([box_front_size[0]\/2-3,0]) text(\"C\", halign=\"right\", size=5);\n translate([0,60]) CrosshairCircle(badge_reader_hole_size);\n }\n}\n\nmodule BackHoleTemplate() {\n $fn=32;\n difference() {\n square(box_front_size, center=true);\n translate([-box_front_size[0]\/2+20, 0]) square([1,box_front_size[1]-2], center=true);\n text(\"Back\", halign=\"center\", size=5);\n translate([box_front_size[0]\/2-3,0]) text(\"A\", halign=\"right\", size=5);\n translate([-box_front_size[0]\/2+3,0]) text(\"D\", halign=\"left\", size=5);\n translate([box_front_size[0]\/2-35,box_front_size[1]\/2-35])\n CrosshairCircle(8); \/\/ power\n translate([box_front_size[0]\/2-50,box_front_size[1]\/2-35])\n CrosshairCircle(8); \/\/ actuator cables\n translate([box_front_size[0]\/2-80+4,box_front_size[1]\/2-35])\n CrosshairCircle(8); \/\/ actuator cables\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"f56d3c23747e16a9b37055c74d9dee6c3f5a484b","subject":"fixed projector distance","message":"fixed projector distance\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 60 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = false;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 60 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6e60d7b905d1f9c708605ddee3973b5fc16755e8","subject":"main: don't add bearings for x-ends","message":"main: don't add bearings for x-ends\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(YAXIS*90)\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(YAXIS*90)\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"eff4bdf8009af840db728f095733d219dad5b7dd","subject":"Move gaiki up","message":"Move gaiki up\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 2;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 6;\nsocket_int = 15.6;\nstart_socket_x = 6 + shift_x;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 31;\ndynamic_r = 10;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = shift_y + volume_center_y - volume_w\/2;\nvolume_h = 5;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ gaika\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + th + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 2;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 6;\nsocket_int = 15.6;\nstart_socket_x = 6 + shift_x;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 3;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 31;\ndynamic_r = 10;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = shift_y + volume_center_y - volume_w\/2;\nvolume_h = 5;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + th + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"00b5237ee1d02fbd42a6fde238e54853f2870109","subject":"This is a whitespace change.","message":"This is a whitespace change.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/ornaments\/circle\/circle-ornament.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/ornaments\/circle\/circle-ornament.scad","new_contents":"\r\nuse <..\/..\/coins-pendants-ornaments.scad>;\r\n\r\nornament(innerIcon = \"Circle\",\r\n innerIconXyScale = 2.8,\r\n innerIconOffsetY = 0,\r\n outerIcon = \"Clover\",\r\n outerIconCount = 6,\r\n outerIconXyScale = 0.31);\r\n","old_contents":"\r\nuse <..\/..\/coins-pendants-ornaments.scad>;\r\n\r\nornament(innerIcon = \"Circle\",\r\n innerIconXyScale = 2.8,\r\n innerIconOffsetY = 0,\r\n outerIcon = \"Clover\",\r\n outerIconCount = 6,\r\n outerIconXyScale = 0.31);","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f4a45aa232f7128ccc751095eed252e4bca93405","subject":"main: use shorthand transforms","message":"main: use shorthand transforms\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-1+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage();\n\n translate([0,0,10*mm])\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-1+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage();\n\n translate([0,0,10*mm])\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5aa82b165f13b6d6fc9a99e15a290541107ddba8","subject":"main: Minor cleanup\/refactor","message":"main: Minor cleanup\/refactor\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zaxis_motor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10, orient=[0,0,1])\n{\n belt=tGT2_2;\n orient(orient)\n orient([1,0,0])\n orient([0,1,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10, orient=[0,0,1])\n{\n belt=tGT2_2;\n orient(orient)\n orient([1,0,0])\n orient([0,1,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d7861e8ada2b5e364192d17c5ccf7b05b97907f4","subject":"A TODO was added for code cleanup.","message":"A TODO was added for code cleanup.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_contents":"\r\n\/\/ preview[view:south, tilt:top]\r\n\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473\r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\/adafruit\/fidget-spinner\/ada-spinner-flat.scad>\r\nuse <..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/time-bandits\/fidget-outline.scad> \r\nuse <..\/..\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>;\r\nuse <..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\r\nuse <..\/..\/external-resources\/star-trek\/logo\/star-trek-logo.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/pacman\/pacman.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\r\ncutoutName = \"Star\"; \/\/ [Adafruit, Aqua Dude, Bat, Clover, Fidget (Time Bandits), Heart, Pacman, OSHW, Rebel Alliance, Spur, Star, Star Trek]\r\n\r\ncutoutHolderType = \"Knurl\"; \/\/ [Cylinder, Knurl]\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 3; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/* [Hidden] *\/\r\n\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/ TODO: Remove unused (coin) code.\r\n\/\/Allocate coin data\r\n\r\n\/\/ !!!!!to make the spoke count this is needed, so far. or maybe not!!!!\r\n\/\/coinName = coin == 1 ? \"AU $2\" :\r\n\/\/ (coin == 2 ? \"AU 5c\" :\r\n\/\/ (coin == 3 ? \"US 10c\" :\r\n\/\/ (coin == 4 ? \"UK \u00a31\" :\r\n\/\/ (coin == 5 ? \"UK 5p\" :\r\n\/\/ (coin == 6 ? \"EU \u20ac1\" :\r\n\/\/ (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule cutout()\r\n{\r\n if(cutoutName == \"Adafruit\")\r\n {\r\n scale([0.3, 0.3, 5])\r\n AdaSpinnerFlat_001();\r\n }\r\n if(cutoutName == \"Aqua Dude\")\r\n {\r\n aquamanThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Bat\")\r\n {\r\n translate([0, 0, 4])\r\n scale([1, 1, 4])\r\n batmanLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Clover\")\r\n {\r\n translate([0, 0, -1])\r\n cloverThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Fidget (Time Bandits)\")\r\n {\r\n fidgetOutlineThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Heart\")\r\n {\r\n heartThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Rebel Alliance\")\r\n {\r\n rebelAllianceThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"OSHW\")\r\n {\r\n translate(0,0,10)\r\n scale([1, 1, 17])\r\n oshwLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Pacman\")\r\n {\r\n translate([0, 0, 8])\r\n pacmanThumbnail(height = 15);\r\n }\r\n else if(cutoutName == \"Spur\")\r\n {\r\n scale([0.17, 0.17, 1])\r\n spur(height = 10);\r\n }\r\n else if(cutoutName == \"Star\")\r\n {\r\n \tstarThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Star Trek\")\r\n {\r\n xyScale = 0.35;\r\n \r\n scale([xyScale, xyScale, 1])\r\n Star_Trek_Logo_Blank_fixed();\r\n }\r\n}\r\n\r\nmodule cutoutHolder()\r\n{\r\n if(cutoutHolderType == \"Cylinder\")\r\n {\r\n cylinder(h=holder_z, d=holder_d);\r\n }\r\n else if( cutoutHolderType == \"Knurl\")\r\n {\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n }\r\n else\r\n {\r\n \/\/ Rounded Cylinder\r\n }\r\n}\r\n\r\nmodule dollarHolder() \r\n{\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() \r\n {\r\n \/\/ TODO: this next item looks like where the knurl can be swapped out for\r\n \/\/ a regular cylinder or rounded cylinder.\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n cutoutHolder();\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n cutout();\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalize\r\n\r\nmodule plus() \r\n{\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() \r\n{\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() \r\n{\r\n plus();\r\n minus();\r\n}","old_contents":"\r\n\/\/ preview[view:south, tilt:top]\r\n\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\/adafruit\/fidget-spinner\/ada-spinner-flat.scad>\r\nuse <..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/time-bandits\/fidget-outline.scad> \r\nuse <..\/..\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>;\r\nuse <..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\r\nuse <..\/..\/external-resources\/star-trek\/logo\/star-trek-logo.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/pacman\/pacman.scad> \r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\r\ncutoutName = \"Star\"; \/\/ [Adafruit, Aqua Dude, Bat, Clover, Fidget (Time Bandits), Heart, Pacman, OSHW, Rebel Alliance, Spur, Star, Star Trek]\r\n\r\ncutoutHolderType = \"Knurl\"; \/\/ [Cylinder, Knurl]\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 3; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/* [Hidden] *\/\r\n\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/Allocate coin data\r\n\r\n\/\/ !!!!!to make the spoke count this is needed, so far. or maybe not!!!!\r\n\/\/coinName = coin == 1 ? \"AU $2\" :\r\n\/\/ (coin == 2 ? \"AU 5c\" :\r\n\/\/ (coin == 3 ? \"US 10c\" :\r\n\/\/ (coin == 4 ? \"UK \u00a31\" :\r\n\/\/ (coin == 5 ? \"UK 5p\" :\r\n\/\/ (coin == 6 ? \"EU \u20ac1\" :\r\n\/\/ (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule cutout()\r\n{\r\n if(cutoutName == \"Adafruit\")\r\n {\r\n scale([0.3, 0.3, 5])\r\n AdaSpinnerFlat_001();\r\n }\r\n if(cutoutName == \"Aqua Dude\")\r\n {\r\n aquamanThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Bat\")\r\n {\r\n translate([0, 0, 4])\r\n scale([1, 1, 4])\r\n batmanLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Clover\")\r\n {\r\n translate([0, 0, -1])\r\n cloverThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Fidget (Time Bandits)\")\r\n {\r\n fidgetOutlineThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Heart\")\r\n {\r\n heartThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Rebel Alliance\")\r\n {\r\n rebelAllianceThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"OSHW\")\r\n {\r\n translate(0,0,10)\r\n scale([1, 1, 17])\r\n oshwLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Pacman\")\r\n {\r\n translate([0, 0, 8])\r\n pacmanThumbnail(height = 15);\r\n }\r\n else if(cutoutName == \"Spur\")\r\n {\r\n scale([0.17, 0.17, 1])\r\n spur(height = 10);\r\n }\r\n else if(cutoutName == \"Star\")\r\n {\r\n \tstarThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Star Trek\")\r\n {\r\n xyScale = 0.35;\r\n \r\n scale([xyScale, xyScale, 1])\r\n Star_Trek_Logo_Blank_fixed();\r\n }\r\n}\r\n\r\nmodule cutoutHolder()\r\n{\r\n if(cutoutHolderType == \"Cylinder\")\r\n {\r\n cylinder(h=holder_z, d=holder_d);\r\n }\r\n else if( cutoutHolderType == \"Knurl\")\r\n {\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n }\r\n else\r\n {\r\n \/\/ Rounded Cylinder\r\n }\r\n}\r\n\r\nmodule dollarHolder() \r\n{\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() \r\n {\r\n \/\/ TODO: this next item looks like where the knurl can be swapped out for\r\n \/\/ a regular cylinder or rounded cylinder.\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n cutoutHolder();\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n cutout();\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalize\r\n\r\nmodule plus() \r\n{\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() \r\n{\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() \r\n{\r\n plus();\r\n minus();\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c5ff8efdba1916816584494217f8a1fe2c9fd471","subject":"misc: add fn_from_{r,d}","message":"misc: add fn_from_{r,d}\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d10ba07bdcbad2d89f811ae5264c70ca2473f43e","subject":"main\/zaxis: Tweak upper gantry\/zrod holder piece (add screw holes)","message":"main\/zaxis: Tweak upper gantry\/zrod holder piece (add screw holes)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, -1])\n {\n fncylindera(d=extrusion_thread_dia, h=100, orient=[0,0,1], align=[1,0,1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"99478269a1cf681fc3a94db67cca799a0e4f4a81","subject":"going back to thin knee","message":"going back to thin knee\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\nthin=1;\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,thin?1.6:7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for thin knee\n translate([-5,2,z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n\n \/\/ wider knee shouldn't need brace\n \/\/translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=thin?4:17,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n if (thin==0) {\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n }\n\n \/\/ FH segment bracing\n if (thin) {\n for (z=[-.3]) hull() {\n translate([ 3 , 1 ,]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() {\n translate([FGleft+4.5,FGperp-4,6]) barEnd1();\n translate([7,4.4,0]) barEnd1();\n }\n\n\n } else {\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n }\n\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n #translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\nthin=1;\n\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n\n if (thin) {\n rotate([0,0,180]) SI8onBolt();\n\n \/\/ main tube\n translate([EF\/2,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-9,$fn=13,center=true);\n\n } else {\n\n \/\/ main tube\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=16,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"be33f2eaeea7f4b026895aeba35cf308b407287f","subject":"correct the height","message":"correct the height\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/trooper\/scrum-trooper.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/trooper\/scrum-trooper.scad","new_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule scrumTrooper(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumTrooperThumbnail(height = 1)\r\n{\r\n\txyScale = .74;\r\n\tscale([xyScale, xyScale, 1])\t\r\n\tscrumTrooper(h = height);\t\r\n}\r\n","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\r\n\/\/ in the z dimension than the polygon being subtracted from. This helps\r\n\/\/ keep the resulting .stl file manifold.\r\nfudge = 0.1;\r\n\r\nmodule scrumTrooper(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumTrooperThumbnail(height)\r\n{\r\n\txyScale = .74;\r\n\tscale([xyScale, xyScale, 1])\t\r\n\tscrumTrooper(h = height);\t\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ae265ab455a3e82823919ee3b1307aa2be46eac3","subject":"The code was added.","message":"The code was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/samples\/rectangular\/rectangular-water-pump-filter.scad","new_file":"openscad\/models\/src\/main\/openscad\/filters\/water-pump\/samples\/rectangular\/rectangular-water-pump-filter.scad","new_contents":"\nuse <..\/..\/water-pump-filter.scad>\n\nwaterPumpFilter();\n","old_contents":"","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ad944bc1197189becc71049d24928b07392aafc3","subject":"adjust the cutout","message":"adjust the cutout\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = 4.2; \n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = 4.2; \n\n xTranslate = bed_xTranslate;\n yTranslate = bed_yTranslate;\n zTranslate = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3d43565e404d1331ebbd2f4e4b144bfd0683ace7","subject":"added air guitar strings","message":"added air guitar strings\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nmodule case() {\n \/\/spoke_lid();\n string_lid();\n}\n\ncase();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n #translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n \/\/string();\n \n}\n\nspoke_lid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"99f7b9fa859a5e97ca0cecb066fd04d8f7d88ab1","subject":"Colorising batteries.. (my OpenSCAD isn't a fan of \"gold\")","message":"Colorising batteries..\n(my OpenSCAD isn't a fan of \"gold\")\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/BatteryPack.scad","new_file":"hardware\/vitamins\/BatteryPack.scad","new_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\/\/ len includes the positive-end button\nBattery_dia = 14.5;\nBattery_len = 50.5;\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery() {\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n \n\n\n}\n\nmodule battery_pack_linear(battery_sep, battery_count) {\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n }\n}\n\nmodule battery_pack_double(battery_sep, battery_count) {\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n battery();\n }\n}\n\n*battery_pack_linear(2,4);\n*battery_pack_double(2, 4);\n","old_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\/\/ len includes the positive-end button\nBattery_dia = 14.5;\nBattery_len = 50.5;\n\nmodule battery() {\n\n linear_extrude(height=Battery_len) {\n circle(r=Battery_dia\/2);\n }\n}\n\nmodule battery_pack_linear(battery_sep, battery_count) {\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n }\n}\n\nmodule battery_pack_double(battery_sep, battery_count) {\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n battery();\n }\n}\n\n*battery_pack_linear(2,4);\n*battery_pack_double(2, 4);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ecd9ee7919e51ca3aa1bed0b1f9a1a30f45f18bc","subject":"main\/xends: show motor etc","message":"main\/xends: show motor etc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = 80;\/\/axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = 80;\/\/axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b491cd7e3cb7e51724d344597a80b35fd20eabbe","subject":"added moreShapes library","message":"added moreShapes library\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/utils\/moreShapes.scad","new_file":"hardware\/utils\/moreShapes.scad","new_contents":"\/\/ moreShapes library\n\/\/ 2D and 3D utility shape functions\n\n\/\/ some borrowed from nophead \/ Mendel90 utils.scad\n\ninclude \ninclude \n\n\/\/ fudge\neta = 0.01;\n\n\nmodule line(start, end, r) {\n\thull() {\n\t\ttranslate(start) sphere(r=r);\n\t\ttranslate(end) sphere(r=r);\n\t}\n}\n\nmodule roundedRect(size, radius, center=false, shell=0) {\n\tx = size[0];\n\ty = size[1];\n\tz = size[2];\n\t\n\ttranslate([center?-x\/2:0, center?-y\/2:0, center?-z\/2:0])\n\tlinear_extrude(height=z) \n\tdifference() {\n\t\thull() {\n\t\t\ttranslate([radius, radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius, radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t\n\t\tif (shell > 0) {\n\t\t\thull() {\n\t\t\ttranslate([radius + shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius - shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius - shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([radius + shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t}\n\t}\n}\n\nmodule roundedRectX(size, radius, center=false, shell=0) {\n\t\/\/ X-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([0,90,0]) roundedRect([size[2],size[1],size[0]], radius, center, shell);\n}\n\nmodule roundedRectY(size, radius, center=false, shell=0) {\n\t\/\/ Y-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([-90,0,0]) roundedRect([size[0],size[2],size[1]], radius, center, shell);\n}\n\nmodule allRoundedRect(size, radius, center=false) {\n\t\/\/ lazy implementation - must do better\n\t\/\/ runs VERY slow\n\ttranslate([center?-size[0]\/2:0, center?-size[1]\/2:0, center?-size[2]\/2:0])\n\thull() {\n\t\tfor (x=[0,size[0]], y=[0,size[1]], z=[0,size[2]]) {\n\t\t\ttranslate([x,y,z]) sphere(r=radius);\n\t\t}\n\t}\n}\n\nmodule chamferedRect(size, chamfer, center=false) {\n\thull() {\n\t\ttranslate([0,center?0:chamfer,0])\n\t\t\tsquare([size[0],size[1]-2*chamfer],center);\n\t\t\t\n\t\ttranslate([center?0:chamfer,0,0])\n\t\t\tsquare([size[0]-2*chamfer,size[1]],center);\n\t}\n}\n\n\/\/ Extended rotational extrude, allows control of start\/end angle\n\n\/\/ Child 2D shape is used for the rotational extrusion\n\/\/ Child 2D shape should lie in xy plane, centred on z axis\n\/\/ Child y axis will be aligned to z axis in the extrusion\n\n\/\/ NB: Internal render command is necessary to correclty display\n\/\/ complex child objects (e.g. differences)\n\n\/\/ r = Radius of rotational extrusion\n\/\/ childH = height of child object (approx)\n\/\/ childW = width of child object (approx)\n\n\/\/ Example usage:\n\n\/\/ rotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\/\/\t\t\tdifference() {\n\/\/\t\t\t\tsquare([20,20],center=true);\n\/\/\t\t\t\ttranslate([10,0,0]) circle(5);\n\/\/\t\t\t}\n\/\/\t\t}\n\nmodule rotate_extrude_ext(r, childW, childH, convexity) {\n\tor = (r + childW\/2) * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n\t\trender()\n intersection() {\n\t\t\trotate_extrude(convexity=convexity) translate([r,0,0]) child(0);\n\n\t\t\ttranslate([0,0,-childH\/2 - 1])\n\t\t\tlinear_extrude(height=childH+2)\n \t\tpolygon([\n\t\t [0,0],\n\t\t [or * cos(a0), or * sin(a0)],\n\t\t [or * cos(a1), or * sin(a1)],\n\t\t [or * cos(a2), or * sin(a2)],\n\t\t [or * cos(a3), or * sin(a3)],\n\t\t [or * cos(a4), or * sin(a4)],\n\t\t [0,0]\n\t\t ]);\n }\n}\n\n\n\nmodule torusSlice(r1, r2, start_angle, end_angle, convexity=10, r3=0, $fn=64) {\n\tdifference() {\n\t\trotate_extrude_ext(r=r1, childH=2*r2, childW=2*r2, start_angle=start_angle, end_angle=end_angle, convexity=convexity) difference() circle(r2, $fn=$fn\/4);\n\n\t\trotate_extrude(convexity) translate([r1,0,0]) circle(r3, $fn=$fn\/4);\n\t}\n}\n\nmodule torus(r1, r2, $fn=64) {\n\trotate_extrude() \n\t\ttranslate([r1,0,0]) \n\t\tcircle(r2, $fn=$fn\/4);\n}\n\n\nmodule trapezoid(a,b,h,aOffset=0,center=false) {\n\t\/\/ lies in x\/y plane\n\t\/\/ edges a,b are parallel to x axis\n\t\/\/ h is in direction of y axis\t\n\t\/\/ b is anchored at origin, extends along positive x axis\n\t\/\/ a is offset along y by h, extends along positive x axis\n\t\/\/ a if offset along x axis, from y axis, by aOffset\n\t\/\/ centering is relative to edge b\n\n\ttranslate([center?-b\/2:0, center?-h\/2:0, 0]) \n\tpolygon(points=[\t[0,0],\n\t\t\t\t\t[aOffset,h],\n\t\t\t\t\t[aOffset + a, h],\n\t\t\t\t\t[b,0]]); \n}\n\nmodule trapezoidPrism(a,b,h,aOffset,height,center=false) {\n\ttranslate([0,0, center?-height\/2:0]) linear_extrude(height=height) trapezoid(a,b,h,aOffset,center);\n}\n\n\nmodule arrangeShapesOnAxis(axis=[1,0,0], spacing=50) {\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([spacing * axis[0] *i,\n\t\t\t\t\tspacing * axis[1]*i,\n\t\t\t\t\tspacing * axis[2]*i]) child(i);\n\t}\n}\n\nmodule arrangeShapesOnGrid(xSpacing=50, ySpacing=50, cols=3, showLocalAxes=false) {\t\n\t\/\/ layout is cols, rows\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([(i - floor(i \/ cols)*cols) * xSpacing, floor(i \/ cols) * ySpacing, 0]) {\n\t\t\tchild(i);\n\n\t\t\tif (showLocalAxes) {\n\t\t\t\tcolor(\"red\") line([0,0,0], [xSpacing\/2,0,0], 0.2);\n\t\t\t\tcolor(\"green\") line([0,0,0], [0, ySpacing\/2,0], 0.2);\n\t\t\t\tcolor(\"blue\") line([0,0,0], [0, 0,xSpacing], 0.2);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule slot(h, r, l, center = true)\n linear_extrude(height = h, convexity = 6, center = center)\n hull() {\n translate([l\/2,0,0])\n circle(r = r, center = true);\n translate([-l\/2,0,0])\n circle(r = r, center = true);\n }\n\n\n\nmodule fillet(r, h) {\n\t\/\/ ready to be unioned onto another part, eta fudge included\n\t\/\/ extends along x, y, z\n\n translate([r \/ 2, r \/ 2, 0])\n difference() {\n cube([r + eta, r + eta, h], center = true);\n translate([r\/2, r\/2, 0])\n cylinder(r = r, h = h + 1, center = true);\n }\n}\n\nmodule right_triangle(width, height, h, center = true) {\n linear_extrude(height = h, center = center)\n polygon(points = [[0,0], [width, 0], [0, height]]);\n}\n\nmodule roundedRightTriangle(width, height, h, r=[1,1,1], center = true, $fn=12) {\n linear_extrude(height = h, center = center)\n \thull() {\n \ttranslate([r[0],r[0],0]) circle(r[0]);\n \ttranslate([width-r[1],r[1],0]) circle(r[1]);\n \ttranslate([r[2],height-r[2],0]) circle(r[2]);\n }\n}\n\n\nmodule rounded_square(w, h, r, center=true)\n{\n\t\/\/ 2D\n union() {\n translate([center?0:r,0,0])\n \tsquare([w - 2 * r, h], center=center);\n translate([0,center?0:r,0])\n \tsquare([w, h - 2 * r], center=center);\n for(x = [(center?-w\/2:0) + r, (center?w\/2:w) - r])\n for(y = [(center?-h\/2:0) + r, (center?h\/2:h) - r])\n translate([x, y])\n circle(r = r);\n }\n}\n\n\/\/\n\/\/ Cylinder with rounded ends\n\/\/\nmodule rounded_cylinder(r, h, r2, roundBothEnds=false)\n{\n rotate_extrude()\n union() {\n square([r - r2, h]);\n translate([0,roundBothEnds?r2:0,0]) square([r, roundBothEnds? h-2*r2 : h - r2]);\n translate([r - r2, h - r2])\n circle(r = r2);\n\t\t\tif (roundBothEnds) {\n\t\t\t\ttranslate([r - r2, r2])\n circle(r = r2);\n\t\t\t}\n\t\t\t\n }\n}\n\nmodule sector(r, a, h, center = true) {\n linear_extrude(height = h, center = center)\n sector2D(r=r, a=a, center=center);\n}\n\nmodule sector2D(r, a, center = true) {\n intersection() {\n circle(r = r, center = true);\n polygon(points = [\n [0, 0],\n [2 * r * cos(0), 2 * r * sin(0)],\n [2 * r * cos(a * 0.2), 2 * r * sin(a * 0.2)],\n [2 * r * cos(a * 0.4), 2 * r * sin(a * 0.4)],\n [2 * r * cos(a * 0.6), 2 * r * sin(a * 0.6)],\n [2 * r * cos(a * 0.8), 2 * r * sin(a * 0.8)],\n [2 * r * cos(a), 2 * r * sin(a)],\n ]);\n }\n}\n\nmodule donutSector2D(or,ir,a, center=true) {\n\tdifference() {\n\t\tsector2D(or,a,center);\n\t\t\n\t\tcircle(ir);\n\t}\n\n}\n\nmodule tube(or, ir, h, center = true) {\n linear_extrude(height = h, center = center, convexity = 5)\n difference() {\n circle(or);\n circle(ir);\n }\n}\n\n\/\/ tube that tapers\nmodule conicalTube(or1,ir1,or2,ir2,h) {\n\tdifference() {\n\t\tcylinder(r1=or1, r2=or2, h=h);\n\t\t\n\t\ttranslate([0,0,-eta])\n\t\t\tcylinder(r1=ir1, r2=ir2, h=h+2*eta);\n\t}\n}\n\n\nmodule moreShapesExamples() {\n\tarrangeShapesOnGrid(xSpacing=100, ySpacing=80, cols=4, showLocalAxes=true) {\n\t\troundedRect([50,30,20], 5);\n\t\troundedRectX([50,30,20], 5);\n\t\troundedRectY([50,30,20], 5);\n\t\t\/\/allRoundedRect([50,30,20], 5);\n\n\t\troundedRect([50,30,20], 5, true);\n\t\troundedRectX([50,30,20], 5, true);\n\t\troundedRectY([50,30,20], 5, true);\n\t\t\/\/allRoundedRect([50,30,20], 5, true);\n\n\n\t\ttorusSlice(50, 6, 0, 120, $fn=64);\n\t\ttorusSlice(r1=50, r2=6, r3=4, start_angle=0, end_angle=120, $fn=64); \/\/ define r3 for a hollow torus\n\n\t\ttrapezoidPrism(20,50,20,10,20);\n\t\ttrapezoidPrism(20,50,20,10,20,true);\n\n\t\t\/\/ to be differenced\n\t\tslot(h=20, r=5, l=10);\n\n\t\t\/\/ to be unioned\n\t\tfillet(r=5, h=50);\n\n\t\tright_triangle(width=30, height=20, h=10, center = false);\n\t\trounded_square(w=30, h=20, r=5);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=false);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=true);\n\t\t\n\t\t\/\/ same as extruded pieSlice\n\t\tsector(r=10, a=70, h=20, center = false);\n\n\t\ttube(or=10, ir=5, h=50, center = false);\n\n\t\trotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\t\t\tdifference() {\n\t\t\t\tsquare([20,20],center=true);\n\t\t\t\ttranslate([10,0,0]) circle(5);\n\t\t\t}\n\t\t}\n\t}\n}\n\n*moreShapesExamples();\n\nmodule overhangFreeCircle(r, ang) {\n\t\/\/ produces a circle with no overhang ready for extrusion\n\t\/\/ overhang infill is along y axis\n\n\tx1 = r*cos(ang);\n\ty1 = r*sin(ang);\n\tx2 = tan(ang) * (r-y1);\n\n\tunion() {\n\t\tcircle(r);\n\n\t\tfor (i=[0,1])\n\t\t\tmirror([0,i,0])\n\t\t\tpolygon(points=[[0,0],[x1,y1],[x1-x2,r],[-x1+x2,r],[-x1,y1]]);\n\t}\n}\n\n\/\/ supports span x axis\nmodule minSupportBeam(size=[0,0,0], bridge=5, air=0, center=false) {\n\tw = size[0] > bridge ? (size[0] - bridge)\/2 : 0;\n\th = w > air ? air : w;\n\t\n\tunion() {\n\t\tcube(size, center=center);\n\t\n\t\t\/\/ triangular supports\n\t\tfor (i=[0,1])\n\t\t\ttranslate([i*size[0],0,eta])\n\t\t\tmirror([i,0,0]) {\n\t\t\t\ttranslate([w-h, 0, 0])\n\t\t\t\t\trotate([-90,0,0])\n\t\t\t\t\tright_triangle(h, h, size[1], center=false);\n\t\t\t\t\t\n\t\t\t\ttranslate([0, 0, -h])\n\t\t\t\t\tcube([w-h+eta, size[1], h+eta]);\n\t\t\t\n\t\t\t}\n\t}\n}\n\nmodule minSupportBeamY(size=[0,0,0], bridge=5, air=0, center=false) {\n\ttranslate([size[0], 0, 0])\n\t\trotate([0,0,90])\n\t\tminSupportBeam([size[1], size[0], size[2]], bridge, air, center=center);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/utils\/moreShapes.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a4c462d6798058ca7b9bef6778286140ffb9af72","subject":"Integrating pins into build system","message":"Integrating pins into build system\n\nwhich involves adding a suitable printedPart() call\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/utils\/pins.scad","new_file":"hardware\/utils\/pins.scad","new_contents":"\/\/ Pin Connectors for LogoBot\r\n\/\/ Derived from Emmett Lalish Pin Connectors V3 : http:\/\/www.thingiverse.com\/thing:33790\r\n\/\/ Modified for @snhack LogoBot by Gyrobot\r\n\/\/\r\n\/\/ Modules to call = pin(), pinpeg(), pintack(), pinhole()\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ h = Length or height of pin\/hole.\r\n\/\/ r = radius of pin body (Default = PinDiameter\/2).\r\n\/\/ lh = Height of lip.\r\n\/\/ lt = Thickness of lip (Also adjusts slot width to allow legs to close).\r\n\/\/ t = Pin tolerance.\r\n\/\/ bh = Base Height (pintack only).\r\n\/\/ br = Base Radius (pintack only).\r\n\/\/ tight = Hole friction, set to false if you want a joint that spins easily (pinhole only)\r\n\/\/ fixed = Hole Twist, set to true so pins can't spin (pinhole only)\r\n\/\/\tSide = Orientates pins on their side for printing : true\/false (not pinhole).\r\n\r\nmodule pinhole(h=10, r=PinDiameter\/2, lh=3, lt=1, t=0.3, tight=true, fixed=false) {\r\n\r\n\tintersection(){\r\n\t union() {\r\n\tif (tight == true || fixed == true) {\r\n\t pin_solid(h, r, lh, lt);\r\n\t\t translate([0,0,-t\/2])cylinder(h=h+t, r=r, $fn=30);\r\n\t\t} else {\r\n\t\t pin_solid(h, r+t\/2, lh, lt);\r\n\t\t translate([0,0,-t\/2])cylinder(h=h+t, r=r+t\/2, $fn=30);\r\n\t\t}\r\n\r\n\t \/\/ widen the entrance hole to make insertion easier\r\n\t \/\/translate([0, 0, -0.1]) cylinder(h=lh\/3, r2=r, r1=r+(t\/2)+(lt\/2),$fn=30);\r\n\t }\r\n\t if (fixed == true) {\r\n\t\ttranslate([-r*2, -r*0.75, -1])cube([r*4, r*1.5, h+2]);\r\n\t }\r\n\t}\r\n}\r\nmodule pin(h=10, r=PinDiameter\/2, lh=3, lt=1, t=0.2, side=false) {\r\n \/\/ h = shaft height\r\n \/\/ r = shaft radius\r\n \/\/ lh = lip height\r\n \/\/ lt = lip thickness\r\n \/\/ side = set to true if you want it printed horizontally\r\n\r\n if (side) {\r\n pin_horizontal(h, r, lh, lt, t);\r\n } else {\r\n pin_vertical(h, r, lh, lt, t);\r\n }\r\n}\r\n\r\nmodule pintack(h=10, r=PinDiameter\/2, lh=3, lt=1, t=0.2, bh=3, br=6, side=false) {\r\n \/\/ bh = base_height\r\n \/\/ br = base_radius\r\n\r\n printedPart(\r\n \"utils\/pins.scad\",\r\n \"Pintack\",\r\n str(\"pintack(side=\",side,\",h=\",h,\",bh=\",bh,\")\")\r\n ) {\r\n\r\n flip=(side==false) ? 1 : 0;\r\n\r\n translate ([0,flip*(r*1.5-t)\/2,0])\r\n rotate ([flip*90,0,0])\r\n union() {\r\n pin(h, r, lh, lt, t, side=true);\r\n intersection(){\r\n translate([0, 0, r\/1.5]) rotate([90,0,0]) cylinder(h=bh, r=br);\r\n translate([-br*2, -bh-1, 0])cube([br*4, bh+2, r*1.5-t]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule pinpeg(h=20, r=PinDiameter\/2, lh=3, lt=1, t=0.2, side=false) {\r\n\tflipy=(side==false) ? 1 : 0;\r\n\tflipz=(side==true) ? 1 : 0;\r\n union() {\r\n\t\ttranslate([0, flipz*-0.05, flipy*-0.05]) pin(h\/2+0.1, r, lh, lt, t, side);\r\n\t\ttranslate([0, flipz*0.05, flipy*0.05]) rotate([0, flipy*180, flipz*180]) pin(h\/2+0.1, r, lh, lt, t, side);\r\n }\r\n}\r\n\r\n\/\/ just call pin instead, I made this module because it was easier to do the rotation option this way\r\n\/\/ since openscad complains of recursion if I did it all in one module\r\nmodule pin_vertical(h=10, r=4, lh=3, lt=1, t=0.2) {\r\n \/\/ h = shaft height\r\n \/\/ r = shaft radius\r\n \/\/ lh = lip height\r\n \/\/ lt = lip thickness\r\n\r\n difference() {\r\n pin_solid(h, r-t\/2, lh, lt);\r\n\r\n \/\/ center cut\r\n translate([-lt*3\/2, -(r*2+lt*2)\/2, h\/5+lt*3\/2]) cube([lt*3, r*2+lt*2, h]);\r\n \/\/translate([0, 0, h\/4]) cylinder(h=h+lh, r=r\/2.5, $fn=20);\r\n \/\/ center curve\r\n translate([0, 0, h\/5+lt*3\/2]) rotate([90, 0, 0]) cylinder(h=r*2, r=lt*3\/2, center=true, $fn=20);\r\n\r\n \/\/ side cuts\r\n translate([-r*2, -r-r*0.75+t\/2, -1]) cube([r*4, r, h+2]);\r\n translate([-r*2, r*0.75-t\/2, -1]) cube([r*4, r, h+2]);\r\n }\r\n}\r\n\r\n\/\/ call pin with side=true instead of this\r\nmodule pin_horizontal(h=10, r=4, lh=3, lt=1, t=0.2) {\r\n \/\/ h = shaft height\r\n \/\/ r = shaft radius\r\n \/\/ lh = lip height\r\n \/\/ lt = lip thickness\r\n translate([0, 0, r*0.75-t\/2]) rotate([-90, 0, 0]) pin_vertical(h, r, lh, lt, t);\r\n}\r\n\r\n\/\/ this is mainly to make the pinhole module easier\r\nmodule pin_solid(h=10, r=4, lh=3, lt=1) {\r\n union() {\r\n \/\/ shaft\r\n cylinder(h=h-lh, r=r, $fn=30);\r\n \/\/ lip\r\n translate([0, 0, h-lh]) cylinder(h=lh*0.25, r1=r, r2=r+(lt\/2), $fn=30);\r\n translate([0, 0, h-lh+lh*0.25]) cylinder(h=lh*0.25, r=r+(lt\/2), $fn=30);\r\n translate([0, 0, h-lh+lh*0.50]) cylinder(h=lh*0.50, r1=r+(lt\/2), r2=r-(lt\/2), $fn=30);\r\n }\r\n}\r\n","old_contents":"\/\/ Pin Connectors for LogoBot\r\n\/\/ Derived from Emmett Lalish Pin Connectors V3 : http:\/\/www.thingiverse.com\/thing:33790\r\n\/\/ Modified for @snhack LogoBot by Gyrobot\r\n\/\/\r\n\/\/ Modules to call = pin(), pinpeg(), pintack(), pinhole()\r\n\/\/\r\n\/\/ Parameters :\r\n\/\/\r\n\/\/ h = Length or height of pin\/hole.\r\n\/\/ r = radius of pin body (Default = PinDiameter\/2).\r\n\/\/ lh = Height of lip.\r\n\/\/ lt = Thickness of lip (Also adjusts slot width to allow legs to close).\r\n\/\/ t = Pin tolerance.\r\n\/\/ bh = Base Height (pintack only).\r\n\/\/ br = Base Radius (pintack only).\r\n\/\/ tight = Hole friction, set to false if you want a joint that spins easily (pinhole only)\r\n\/\/ fixed = Hole Twist, set to true so pins can't spin (pinhole only)\r\n\/\/\tSide = Orientates pins on their side for printing : true\/false (not pinhole).\r\n\r\nmodule pinhole(h=10, r=PinDiameter\/2, lh=3, lt=1, t=0.3, tight=true, fixed=false) {\r\n \r\n\tintersection(){\r\n\t union() {\r\n\tif (tight == true || fixed == true) {\r\n\t pin_solid(h, r, lh, lt);\r\n\t\t translate([0,0,-t\/2])cylinder(h=h+t, r=r, $fn=30);\r\n\t\t} else {\r\n\t\t pin_solid(h, r+t\/2, lh, lt);\r\n\t\t translate([0,0,-t\/2])cylinder(h=h+t, r=r+t\/2, $fn=30);\r\n\t\t}\r\n \r\n\t \/\/ widen the entrance hole to make insertion easier\r\n\t \/\/translate([0, 0, -0.1]) cylinder(h=lh\/3, r2=r, r1=r+(t\/2)+(lt\/2),$fn=30);\r\n\t }\r\n\t if (fixed == true) {\r\n\t\ttranslate([-r*2, -r*0.75, -1])cube([r*4, r*1.5, h+2]);\r\n\t }\r\n\t}\r\n}\r\nmodule pin(h=10, r=PinDiameter\/2, lh=3, lt=1, t=0.2, side=false) {\r\n \/\/ h = shaft height\r\n \/\/ r = shaft radius\r\n \/\/ lh = lip height\r\n \/\/ lt = lip thickness\r\n \/\/ side = set to true if you want it printed horizontally\r\n\r\n if (side) {\r\n pin_horizontal(h, r, lh, lt, t);\r\n } else {\r\n pin_vertical(h, r, lh, lt, t);\r\n }\r\n}\r\n\r\nmodule pintack(h=10, r=PinDiameter\/2, lh=3, lt=1, t=0.2, bh=3, br=6, side=false) {\r\n \/\/ bh = base_height\r\n \/\/ br = base_radius\r\n \r\nflip=(side==false) ? 1 : 0;\r\n\r\ntranslate ([0,flip*(r*1.5-t)\/2,0])\r\nrotate ([flip*90,0,0])\r\n union() {\r\n\tpin(h, r, lh, lt, t, side=true);\r\n\tintersection(){\r\n\t\ttranslate([0, 0, r\/1.5]) rotate([90,0,0]) cylinder(h=bh, r=br);\r\n\t\ttranslate([-br*2, -bh-1, 0])cube([br*4, bh+2, r*1.5-t]);\r\n\t}\r\n }\r\n}\r\n\r\nmodule pinpeg(h=20, r=PinDiameter\/2, lh=3, lt=1, t=0.2, side=false) {\r\n\tflipy=(side==false) ? 1 : 0;\r\n\tflipz=(side==true) ? 1 : 0;\r\n union() {\r\n\t\ttranslate([0, flipz*-0.05, flipy*-0.05]) pin(h\/2+0.1, r, lh, lt, t, side);\r\n\t\ttranslate([0, flipz*0.05, flipy*0.05]) rotate([0, flipy*180, flipz*180]) pin(h\/2+0.1, r, lh, lt, t, side);\r\n }\r\n}\r\n\r\n\/\/ just call pin instead, I made this module because it was easier to do the rotation option this way\r\n\/\/ since openscad complains of recursion if I did it all in one module\r\nmodule pin_vertical(h=10, r=4, lh=3, lt=1, t=0.2) {\r\n \/\/ h = shaft height\r\n \/\/ r = shaft radius\r\n \/\/ lh = lip height\r\n \/\/ lt = lip thickness\r\n\r\n difference() {\r\n pin_solid(h, r-t\/2, lh, lt);\r\n \r\n \/\/ center cut\r\n translate([-lt*3\/2, -(r*2+lt*2)\/2, h\/5+lt*3\/2]) cube([lt*3, r*2+lt*2, h]);\r\n \/\/translate([0, 0, h\/4]) cylinder(h=h+lh, r=r\/2.5, $fn=20);\r\n \/\/ center curve\r\n translate([0, 0, h\/5+lt*3\/2]) rotate([90, 0, 0]) cylinder(h=r*2, r=lt*3\/2, center=true, $fn=20);\r\n \r\n \/\/ side cuts\r\n translate([-r*2, -r-r*0.75+t\/2, -1]) cube([r*4, r, h+2]);\r\n translate([-r*2, r*0.75-t\/2, -1]) cube([r*4, r, h+2]);\r\n }\r\n}\r\n\r\n\/\/ call pin with side=true instead of this\r\nmodule pin_horizontal(h=10, r=4, lh=3, lt=1, t=0.2) {\r\n \/\/ h = shaft height\r\n \/\/ r = shaft radius\r\n \/\/ lh = lip height\r\n \/\/ lt = lip thickness\r\n translate([0, 0, r*0.75-t\/2]) rotate([-90, 0, 0]) pin_vertical(h, r, lh, lt, t);\r\n}\r\n\r\n\/\/ this is mainly to make the pinhole module easier\r\nmodule pin_solid(h=10, r=4, lh=3, lt=1) {\r\n union() {\r\n \/\/ shaft\r\n cylinder(h=h-lh, r=r, $fn=30);\r\n \/\/ lip\r\n translate([0, 0, h-lh]) cylinder(h=lh*0.25, r1=r, r2=r+(lt\/2), $fn=30);\r\n translate([0, 0, h-lh+lh*0.25]) cylinder(h=lh*0.25, r=r+(lt\/2), $fn=30); \r\n translate([0, 0, h-lh+lh*0.50]) cylinder(h=lh*0.50, r1=r+(lt\/2), r2=r-(lt\/2), $fn=30); \r\n }\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7a6531431d07d6dacf60b1f49f902cd9b5a3c2ad","subject":"Add operator repeatShape2D","message":"Add operator repeatShape2D\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/translate.scad","new_file":"operator\/repeat\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape on two directions.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n *\/\nmodule repeatShape2D(size, count = 1) {\n size = vector2D(size);\n count = vector2D(count);\n\n translate(-vmul(size, count - [1, 1]) \/ 2) {\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0]\n ) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e55c25877672b0aa814d748db18297ebcaa4f106","subject":"Add a couple supports midway up the box","message":"Add a couple supports midway up the box\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0cd14d0752e6c2a07a0f6038467c763caa87f175","subject":"enshorten the segments a bit","message":"enshorten the segments a bit\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/segment.scad","new_file":"models\/segment.scad","new_contents":"radius = 18;\nheight = 22;\nlength = 70;\nwall = 2;\n\n$fn=100;\n\nmodule post() {\n difference() {\n cylinder(r=4, h=height-wall);\n cylinder(r=1.5, h=4);\n }\n}\n\n\ndifference() {\n hull() {\n cylinder(r=radius, h=height);\n\n translate([0, length, 0])\n cylinder(r=radius, h=height);\n }\n\n hull() {\n translate(0, wall, 0)\n cylinder(r=radius-wall, h=height-wall);\n\n translate([0, length, 0])\n cylinder(r=radius-wall, h=height-wall);\n }\n}\n\ntranslate([0, -(radius+wall)\/2-2*wall, 0])\npost();\n\ntranslate([0, length + ((radius+wall)\/2+2*wall), 0])\npost();","old_contents":"radius = 18;\nheight = 30;\nlength = 70;\nwall = 2;\n\n$fn=100;\n\nmodule post() {\n difference() {\n cylinder(r=4, h=height-wall);\n cylinder(r=1.5, h=4);\n }\n}\n\n\ndifference() {\n hull() {\n cylinder(r=radius, h=height);\n\n translate([0, length, 0])\n cylinder(r=radius, h=height);\n }\n\n hull() {\n translate(0, wall, 0)\n cylinder(r=radius-wall, h=height-wall);\n\n translate([0, length, 0])\n cylinder(r=radius-wall, h=height-wall);\n }\n}\n\ntranslate([0, -(radius+wall)\/2-2*wall, 0])\npost();\n\ntranslate([0, length + ((radius+wall)\/2+2*wall), 0])\npost();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0698c9c675c57ad8be628665231c681d56045b80","subject":"raised platform to avoid interference with car details","message":"raised platform to avoid interference with car details\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false); \n \/\/ servo \n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n \n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n \n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20) \n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n \n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n polygon([\n [-50,-35], [50,-35], \n [50,-30], [60,-15],[60,15], [50,30],\n [50,35], [-50,35],\n [-50,30], [-55,20],[-55,-20], [-50,-30]\n ])\n \n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true); translate ([-45, 35, 0]) circle(r=7.5, center=true); translate ([ 45, 35, 0]) circle(r=7.5, center=true); }\n \n } \n square(size=[162,120], center=true);\n }\n \n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points \n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front \n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n \n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n \/\/translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n \/\/translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n \n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \n \n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true); \n \n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \n }\n arrangebottom(30) hbaseholes(center=true);\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n \n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 47]) cube(size=[90, 70, 1.2], center=true); \n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 47+5]) cube(size=[20, 63, 10], center=true); \n \n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 47+5]) cube(size=[20, 20, 10], center=true); \n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true); \n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = false)\n{\n translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false); \n if (!center) { \n translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false); \n translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false); \n }\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n \n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 22], center=false);\n translate ([0, 43, 22]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n translate ([0, 5, 22]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n }\n \n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n \n \/\/ sonar\n translate([16\/2+1,18\/2+1,1.3]) cylinder(d=16.5, h=15);\n translate([16\/2+27+1,18\/2+1,1.3]) cylinder(d=16.5, h=15); \n \n \/\/xtal(s)\n translate([45\/2-3.25,20-4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=5, h=5);\n translate([6.5,0,0]) cylinder(d=5, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=5, h=5);\n translate([6.5,0,0]) cylinder(d=5, h=5);\n }\n \n \/\/ screws\n translate([2.5,2.5,4.5]) screw2x6bore();\n translate([2.5+40,2.5+15,4.5]) screw2x6bore();\n translate([2.5+40,2.5,4.5]) screw2x6bore();\n translate([2.5,2.5+15,4.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10]) \n cube(size=[5, 20, 9], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n #hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2, h=6);\n translate ([0, 0, -1.3]) \n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n \n hmount(); \n \n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n \n \/\/translate ([10, -23, 35]) esc(); \n translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n \n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar(); \n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar(); \n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n \n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar(); \n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar(); \n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) children();\n translate ([45, 45, 57]) rotate([0, 0, a]) children();\n translate ([45, -45, 57]) rotate([0, 0, -a]) children();\n \n translate ([0, 52.5, 42]) rotate([180, 0, 2*a]) children();\n translate ([0, -52.5, 42]) rotate([180, 0, -2*a]) children(); \n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\nplatform();\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","old_contents":"$fs = 0.1;\n$fa = 5;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false); \n \/\/ servo \n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n \n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n \n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20) \n polygon([\n [-200,25], [-70,25],[-44,60],[44,60],[70,23], [200,23],\n [200,-23], [70,-23],[44,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n \n offset(5) offset(-5) translate ([-2.5, 0, 0]) difference() {\n square(size=[90,70], center=true);\n translate ([-45, -35, 0]) circle(r=7.5, center=true);\n translate ([ 45, -35, 0]) circle(r=7.5, center=true); translate ([-45, 35, 0]) circle(r=7.5, center=true); translate ([ 45, 35, 0]) circle(r=7.5, center=true); }\n \n } \n square(size=[162,120], center=true);\n }\n \n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points \n \/\/ rear\n #translate ([-81, -25, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) { hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n \/\/ front \n #translate ([81-4, -46\/2, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n #translate ([81-4, 46\/2-7, 0]) hull() {\n cube(size=[4, 7, 8-3.5], center=false);\n translate ([4\/2, 7-3.5, 8-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n }}\n }\n \n \/\/ board mount holes\n translate ([-(45-2.5)-2.5, (35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([-(45-2.5)-2.5, -(35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, (35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n translate ([ (45-2.5)-2.5, -(35-2.5), 0]) cylinder(d=2.2, h=10, center=true);\n\n \/\/ servo wire hole\n translate ([55, -20, 0]) cylinder(d=10, h=10, center=true);\n translate ([55, 20, 0]) cylinder(d=10, h=10, center=true);\n \n \/\/ mount holes\n \/\/ front\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \n \n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=6.1, h=5, center=true); \n \n \/\/ rear\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true); \n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true); \n }\n arrangebottom(30) hbaseholes(center=true);\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n \n \/\/ base\n color(\"yellow\") translate ([-2.5, 0, 43]) cube(size=[90, 70, 1.2], center=true); \n\n \/\/ teensy\n color(\"green\") translate ([-25, 0, 43+5]) cube(size=[20, 63, 10], center=true); \n \n \/\/ MPU-9250\n color(\"red\") translate ([0, 15, 43+5]) cube(size=[20, 20, 10], center=true); \n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true); \n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n \n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = false)\n{\n translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false); \n if (!center) { \n translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false); \n translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false); \n }\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n \n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 22], center=false);\n translate ([0, 43, 22]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n translate ([0, 5, 22]) rotate([90, 0, 90]) cylinder(r=5, h=3, center=false);\n }\n \n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n \n \/\/ sonar\n translate([16\/2+1,18\/2+1,1.3]) cylinder(d=16.5, h=15);\n translate([16\/2+27+1,18\/2+1,1.3]) cylinder(d=16.5, h=15); \n \n \/\/xtal(s)\n translate([45\/2-3.25,20-4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=5, h=5);\n translate([6.5,0,0]) cylinder(d=5, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n translate([0,0,0]) cylinder(d=5, h=5);\n translate([6.5,0,0]) cylinder(d=5, h=5);\n }\n \n \/\/ screws\n translate([2.5,2.5,4.5]) screw2x6bore();\n translate([2.5+40,2.5+15,4.5]) screw2x6bore();\n translate([2.5+40,2.5,4.5]) screw2x6bore();\n translate([2.5,2.5+15,4.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10]) \n cube(size=[5, 20, 9], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n #hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2, h=6);\n translate ([0, 0, -1.3]) \n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n \n hmount(); \n \n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule car()\n{\n base();\n platform();\n board();\n \n \/\/translate ([10, -23, 35]) esc(); \n translate ([-10, 0, 40]) rotate([0, 0, 180]) esc();\n}\n\n\/\/ full model - vertical sonars\nmodule fullv() {\n car();\n \n translate ([68, 0, 55]) vsonar();\n translate ([60, 25, 55]) rotate([0, 0, 30]) vsonar();\n translate ([60, -25, 55]) rotate([0, 0, -30]) vsonar(); \n translate ([35, 35, 55]) rotate([0, 0, 60]) vsonar();\n translate ([35, -35, 55]) rotate([0, 0, -60]) vsonar(); \n}\n\n\/\/ full model - horizontal sonars\nmodule fullh() {\n car();\n \n translate ([68, 0, 55]) hsonar();\n translate ([40, 35, 55]) rotate([0, 0, 30]) hsonar();\n translate ([40, -35, 55]) rotate([0, 0, -30]) hsonar(); \n translate ([-10, 35, 55]) rotate([0, 0, 60]) hsonar();\n translate ([-10, -35, 55]) rotate([0, 0, -60]) hsonar(); \n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) children();\n translate ([40, 40, 57]) rotate([0, 0, a]) children();\n translate ([40, -40, 57]) rotate([0, 0, -a]) children();\n \n translate ([5, 52.5, 42]) rotate([180, 0, 2*a]) children();\n translate ([5, -52.5, 42]) rotate([180, 0, -2*a]) children(); \n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n}\n\nplatform();\n\n\/\/fullb();\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\/\/screw2x6bore();\n\n\/\/projection(cut=true) translate ([0, 0, -47]) platform();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"44bd526fc5a37403c581bc5b48631cf2baf3d074","subject":"A height parameter was added.","message":"A height parameter was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/shapes\/star\/star.scad","new_file":"OpenSCAD\/src\/main\/openscad\/shapes\/star\/star.scad","new_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule star(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[9.080000,-22.000000],[10.922500,-17.093750],[12.213125,-14.728281],[13.890000,-13.020000],[15.773906,-12.298125],[18.041250,-12.022500],[22.500000,-11.910000],[34.390000,-10.968750],[40.862812,-10.133906],[45.500000,-9.000000],[28.500000,4.610000],[21.270000,12.170000],[22.870000,22.000000],[27.500000,43.000000],[8.500000,31.580000],[-0.500000,27.200000],[-10.500000,32.320000],[-28.500000,43.000000],[-22.870000,21.000000],[-21.690000,11.090000],[-28.500000,4.130000],[-45.500000,-11.000000],[-11.500000,-13.000000],[-0.500000,-43.000000],[2.289219,-38.828594],[4.908750,-33.096250],[9.080000,-22.000000]]);\r\n }\r\n}\r\n\r\nmodule starThumbnail(height = 1)\r\n{\r\n\txyScale = 0.9544;\r\n\tscale([xyScale, xyScale, height])\r\n\tstar();\t\r\n}","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nmodule star(h=1)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[9.080000,-22.000000],[10.922500,-17.093750],[12.213125,-14.728281],[13.890000,-13.020000],[15.773906,-12.298125],[18.041250,-12.022500],[22.500000,-11.910000],[34.390000,-10.968750],[40.862812,-10.133906],[45.500000,-9.000000],[28.500000,4.610000],[21.270000,12.170000],[22.870000,22.000000],[27.500000,43.000000],[8.500000,31.580000],[-0.500000,27.200000],[-10.500000,32.320000],[-28.500000,43.000000],[-22.870000,21.000000],[-21.690000,11.090000],[-28.500000,4.130000],[-45.500000,-11.000000],[-11.500000,-13.000000],[-0.500000,-43.000000],[2.289219,-38.828594],[4.908750,-33.096250],[9.080000,-22.000000]]);\r\n }\r\n}\r\n\r\nmodule starThumbnail()\r\n{\r\n\txyScale = 0.9544;\r\n\tscale([xyScale, xyScale, 1])\r\n\tstar();\t\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b95dd903f67e5d5b9b26d4c6df645cc81b485d0c","subject":"misc: add v_yz","message":"misc: add v_yz\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1038082d9a2ef30ef03300c183fd09ef3569f099","subject":"cmd 12pm","message":"cmd 12pm\n","repos":"JoeSuber\/QuickerPicker","old_file":"gear_ups.scad","new_file":"gear_ups.scad","new_contents":"use ;\nuse ;\nuse ;\n\n\/\/ EXAMPLES OF gear() USE:\n\n\/\/gear (circular_pitch=700,\n\/\/\tgear_thickness = 12,\n\/\/\trim_thickness = 15,\n\/\/\thub_thickness = 17,\n\/\/\tcircles=8);\n\/\/ or...\n\/*\nmodule gear (\n\tnumber_of_teeth=15,\n\tcircular_pitch=false, diametral_pitch=false,\n\tpressure_angle=28,\n\tclearance = 0.2,\n\tgear_thickness=5,\n\trim_thickness=8,\n\trim_width=5,\n\thub_thickness=10,\n\thub_diameter=15,\n\tbore_diameter=5,\n\tcircles=0,\n\tbacklash=0,\n\ttwist=0,\n\tinvolute_facets=0,\n\tflat=false)\n{\n*\/ \/\/ END EXAMPLES \/\/\n\n\n$fn=80;\nmeasurebox= 26.69;\nmbigbox=62.5;\n\n\/\/ used for visually checking scale of generated gears\nmodule mbox(mb=measurebox){\n\tdifference(){\n\t\tcube([mb,mb,.6], center=true);\n\t\tcube([.93*mb,.93*mb,1.1], center=true);\n\t}\n}\n\nmbox();\n\ngear (number_of_teeth=21,\n\tcircular_pitch=2*23.2*3.141592654,\n\tgear_thickness = 1.46,\n\trim_thickness = 2,\n\thub_thickness = 5,\n\tpressure_angle=23,\n\tclearance = 0.3,\n\trim_width=3,\n\thub_diameter=9,\n\tbore_diameter=5.6,\n\tcircles=0,\n\tbacklash=0,\n\ttwist=0,\n\tinvolute_facets=0,\n\tflat=false);\n\nmodule airgear(mbig=mbigbox, holescale=0.78, tranz=0, spin=0){\n\ttranslate([16,0,7+tranz]) rotate([180,0,spin]){\n\t\t\/\/mbox(mb=mbig);\n\t\tdifference(){\n\t\t\tgear (number_of_teeth=75,\n\t\t\t\tcircular_pitch=2*23.2*3.141592654,\n\t\t\t\tgear_thickness = 1.46,\n\t\t\t\trim_thickness = 2,\n\t\t\t\thub_thickness = 7,\n\t\t\t\tpressure_angle=23,\n\t\t\t\tclearance = 0.3,\n\t\t\t\trim_width=40,\n\t\t\t\thub_diameter=mbig,\n\t\t\t\tbore_diameter=0,\n\t\t\t\tcircles=0,\n\t\t\t\tbacklash=0,\n\t\t\t\ttwist=0,\n\t\t\t\tinvolute_facets=0,\n\t\t\t\tflat=false);\n\t\t\t\/\/ air holes\n\t\t\tscale([holescale,holescale,1])\n\t\t\tlinear_extrude(height = 14.2, center = true, convexity = 10, twist = 0, slices = 30, scale = 1){\n\t\t\t\tpieslice(incoming=mbigbox, rimin=5.1, angin=55);\n\t\t\t}\n\t\t\t\/\/ switch bumper track-ring\n\t\t\ttranslate([0,0,6]) rotate([0,180,30])\n\t\t\t\tvolcano();\n\t\t\ttranslate([0,0,6]) rotate([0,180,60])\n\t\t\t\tvolcano();\n\t\t\t\t\/\/difference(){\n\t\t\t\t\/\/\tcylinder(r=conebase\/3, h=7, center=true, $fn=128);\n\t\t\t\t\/\/\tcylinder(r=cubein\/3, h=7.1, center=true, $fn=128);\n\t\t\t\t\/\/}\n\t\t}\n\t}\n}\n\nairgear();\n\n\n\n\/\/for alignment checking\n\/\/airgear(tranz=7, spin=90);\n\t\n\n\n","old_contents":"use ;\nuse ;\nuse ;\n\n\/\/ EXAMPLES OF gear() USE:\n\n\/\/gear (circular_pitch=700,\n\/\/\tgear_thickness = 12,\n\/\/\trim_thickness = 15,\n\/\/\thub_thickness = 17,\n\/\/\tcircles=8);\n\/\/ or...\n\/*\nmodule gear (\n\tnumber_of_teeth=15,\n\tcircular_pitch=false, diametral_pitch=false,\n\tpressure_angle=28,\n\tclearance = 0.2,\n\tgear_thickness=5,\n\trim_thickness=8,\n\trim_width=5,\n\thub_thickness=10,\n\thub_diameter=15,\n\tbore_diameter=5,\n\tcircles=0,\n\tbacklash=0,\n\ttwist=0,\n\tinvolute_facets=0,\n\tflat=false)\n{\n*\/ \/\/ END EXAMPLES \/\/\n\n\n$fn=80;\nmeasurebox= 26.69;\nmbigbox=62.5;\n\n\/\/ used for visually checking scale of generated gears\nmodule mbox(mb=measurebox){\n\tdifference(){\n\t\tcube([mb,mb,.6], center=true);\n\t\tcube([.93*mb,.93*mb,1.1], center=true);\n\t}\n}\n\nmbox();\n\ngear (number_of_teeth=21,\n\tcircular_pitch=2*23.2*3.141592654,\n\tgear_thickness = 1.46,\n\trim_thickness = 2,\n\thub_thickness = 5,\n\tpressure_angle=23,\n\tclearance = 0.3,\n\trim_width=3,\n\thub_diameter=9,\n\tbore_diameter=5.6,\n\tcircles=0,\n\tbacklash=0,\n\ttwist=0,\n\tinvolute_facets=0,\n\tflat=false);\n\nmodule airgear(mbig=mbigbox, holescale=0.78, tranz=0, spin=0){\n\ttranslate([46,0,7+tranz]) rotate([180,0,spin]){\n\t\t\/\/mbox(mb=mbig);\n\t\tdifference(){\n\t\t\tgear (number_of_teeth=75,\n\t\t\t\tcircular_pitch=2*23.2*3.141592654,\n\t\t\t\tgear_thickness = 1.46,\n\t\t\t\trim_thickness = 7,\n\t\t\t\thub_thickness = 7,\n\t\t\t\tpressure_angle=23,\n\t\t\t\tclearance = 0.3,\n\t\t\t\trim_width=40,\n\t\t\t\thub_diameter=mbig,\n\t\t\t\tbore_diameter=0,\n\t\t\t\tcircles=0,\n\t\t\t\tbacklash=0,\n\t\t\t\ttwist=0,\n\t\t\t\tinvolute_facets=0,\n\t\t\t\tflat=false);\n\t\t\t\/\/ air holes\n\t\t\tscale([holescale,holescale,1])\n\t\t\tlinear_extrude(height = 14.2, center = true, convexity = 10, twist = 0, slices = 30, scale = 1){\n\t\t\t\tpieslice(incoming=mbigbox, rimin=5.1, angin=55);\n\t\t\t}\n\t\t\t\/\/ switch bumper track-ring\n\t\t\ttranslate([0,0,6]) rotate([0,180,30])\n\t\t\t\tvolcano();\n\t\t\ttranslate([0,0,6]) rotate([0,180,60])\n\t\t\t\tvolcano();\n\t\t\t\t\/\/difference(){\n\t\t\t\t\/\/\tcylinder(r=conebase\/3, h=7, center=true, $fn=128);\n\t\t\t\t\/\/\tcylinder(r=cubein\/3, h=7.1, center=true, $fn=128);\n\t\t\t\t\/\/}\n\t\t}\n\t}\n}\n\nairgear();\n\n\n\n\/\/for alignment checking\n\/\/airgear(tranz=7, spin=90);\n\t\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e5b40825f5cb322c2a0f0af8523714fb20802335","subject":"assembled","message":"assembled\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/tank.scad","new_file":"resin\/tank\/tank.scad","new_contents":"module glass(w,d,h) {\n color([1,1,1,0.35])\n cube([w,d,h], center=true);\n}\n\nmodule side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n color([1,0.1,0.0,0.85])\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.4,0.1,0.85])\n difference() {\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\nheight = 80;\nglass_thickness = 8;\nwall_height = 30;\nwall_thickness = 3;\ncut_depth = 1;\nsupport_height = 2;\n\nglass(width, height, glass_thickness);\n\nrotate([-90,0,0])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(height+wall_thickness)\/2])\n side1(width + cut_depth * 0, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n\nrotate([90,180,0])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(height+wall_thickness)\/2])\n side1(width + cut_depth * 0, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n\nrotate([-90,0,90])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(width+wall_thickness)\/2])\n side2(height+(wall_thickness-cut_depth)*2, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n\nrotate([90,180,90])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(width+wall_thickness)\/2])\n side2(height+(wall_thickness-cut_depth)*2, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n","old_contents":"module glass(w,d,h) {\n color([1,1,1,0.25])\n cube([w,d,h], center=true);\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n color([1,0.1,0.0,0.75])\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.1,0.0,0.75])\n difference() {\n side1(width, height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nwidth = 120;\nheight = 80;\nglass_thickness = 8;\nwall_height = 30;\nwall_thickness = 3;\ncut_depth = 1;\nsupport_height = 1;\n\nglass(width, height, glass_thickness);\nrotate([-90,0,0])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(height+wall_thickness)\/2])\n side1(width, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\nrotate([90,180,0])\n translate([0,support_height+glass_thickness\/2-wall_height\/2,cut_depth-(height+wall_thickness)\/2])\n side1(width, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n\/\/ side2(width, 30, wall_thickness, cut_depth, glass_thickness);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"960146c282d8d725a3ef6fdae667bcf3dbfa7e7c","subject":"fork made smaller, to better fit typical filament roll size","message":"fork made smaller, to better fit typical filament roll size\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filament_holder\/fork_mk2.scad","new_file":"filament_holder\/fork_mk2.scad","new_contents":"h=11; \/\/ height\nw=14; \/\/ width\nd=(5+1.5)\/2; \/\/ diameter of the holes\n\ndifference()\n{\n union()\n {\n \/\/ lower arc\n difference()\n {\n cylinder(h=h, r=(50+2*w)\/2);\n translate([-(50+2*w)\/2, 0, 0])\n cube([50+2*w, (50+2*w)\/2, h]);\n cylinder(h=h, r=(50)\/2);\n }\n\n \/\/ leg\n translate([-w\/2,-80-50\/2,0])\n cube([w, 80, h]);\n\n \/\/ forks\n translate([25, 0, 0])\n cube([w, 30, h]);\n translate([-25-w, 0, 0])\n cube([w, 30, h]);\n }\n\n \/\/ lower hole for screw\n translate([0, -80-19.5, -1])\n cylinder(h=h+2, r=d);\n \/\/ higher hole for screw\n translate([0, -80-19.5+11, -1])\n cylinder(h=h+2, r=d);\n}\n","old_contents":"h=11; \/\/ height\nw=14; \/\/ width\nd=(5+1.5)\/2; \/\/ diameter of the holes\n\ndifference()\n{\n union()\n {\n \/\/ lower arc\n difference()\n {\n cylinder(h=h, r=(80+2*w)\/2);\n translate([-(80+2*w)\/2, 0, 0])\n cube([80+2*w, (80+2*w)\/2, h]);\n cylinder(h=h, r=(80)\/2);\n }\n\n \/\/ leg\n translate([-w\/2,-80-80\/2,0])\n cube([w, 80, h]);\n\n \/\/ forks\n translate([40, 0, 0])\n cube([w, 40, h]);\n translate([-40-w, 0, 0])\n cube([w, 40, h]);\n }\n\n \/\/ lower hole for screw\n translate([0, -80-34.5, -1])\n cylinder(h=h+2, r=d);\n \/\/ higher hole for screw\n translate([0, -80-34.5+11, -1])\n cylinder(h=h+2, r=d);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8433762a68a852b4a02713fe1c488fd11b2ffbe6","subject":"main: move main function","message":"main: move main function\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ee8a526ae06aa4a01e285be1880ed934dc61a721","subject":"Adding more roof","message":"Adding more roof\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roofJoist(y,timber_width=75,timber_length=47)\n{\n cubeI([timber_width,y,timber_length]);\n}\n\nmodule roofJoists(x,y,number_x,timber_width=75,timber_length=47)\n{\n x_inside = x - timber_length*2 - timber_width;\n x_inside_part = x_inside \/ number_x; \n for(base_x = [0 : number_x])\n {\n translate([timber_length+(x_inside_part*base_x),0,-timber_length]) roofJoist(y);\n }\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n translate([overhang,overhang,0]) roofJoists(x,y,6 );\n }\n}\n\n\n\nshedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\ntranslate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\ntranslate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nroof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n overhang_flat = cos(theta) * overhang;\n overhang_up = sin(theta) * overhang;\n \n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust, overhang_flat, overhang_up);\n translate([-overhang_flat,-overhang_flat,z_front+base_timber+panel_slf_t+height_adjust+overhang_up]) rotate([-theta,0,0]) \n {\n shedLowerFloor(x+overhang_flat*2,panel_slf_l);\n }\n}\n\n\n\nshedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\ntranslate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\ntranslate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nroof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1834c6c732959d73fad602eb8042b4ae8ac2563b","subject":"initial draft of holder","message":"initial draft of holder\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"orp_orze\u0142_model_holder\/holder.scad","new_file":"orp_orze\u0142_model_holder\/holder.scad","new_contents":"eps = 0.01;\nspacing = 4;\nsize = [74.1+2*spacing, 32.2+2*spacing];\nrounding = 5;\n\nmodule holder_()\n{\n z=2;\n x=74.1;\n y=32.2;\n w=3.08;\n for(dx=[0, x-w])\n translate([dx,0,0])\n {\n cube([w, y, z]);\n translate(6*[0, 1\/2, 0])\n cube([w, y-6, z+20]);\n }\n translate([0, y\/2-w\/2, z])\n cube([x, w, z]);\n}\n\nmodule holder_space_()\n{\n space=2;\n z=2-0.5;\n x=74.1;\n y=32.2+2*space;\n w=3.08+2*space;\n for(dx=[0, x-w+2*space])\n translate([dx, 0, 0])\n cube([w, y, z]);\n}\n\nmodule main_block_()\n{\n \/\/ desk mount\n difference()\n {\n cube([size[0], 19+2*2, 20+4]);\n translate([-eps, 2, 4])\n cube([size[0]+2*eps, 19, 20+1]);\n }\n \/\/ main surface\n for(i=[0, size[0]-rounding*2-1])\n translate([i, 0, 0])\n hull()\n {\n cube([2*rounding+1, 1, 3]);\n for(j=[0, 1])\n translate(spacing*[1,0,0] + [j+1, size[1], 0])\n cylinder(r=rounding, h=3, $fn=120);\n }\n}\n\n\nmodule holder()\n{\n difference()\n {\n main_block_();\n translate([2, spacing, 0])\n #holder_space_();\n translate(2*[1, 1, 0] + [size[0]-spacing-2, spacing, 1.5])\n rotate([0, 180, 0])\n %holder_();\n }\n}\n\nholder();\n","old_contents":"eps = 0.01;\nspacing = 4;\nsize = [74.1+2*spacing, 32.2+2*spacing];\nrounding = 5;\n\nmodule holder_()\n{\n z=2;\n x=74.1;\n y=32.2;\n w=3.08;\n for(dx=[0, x-w])\n translate([dx,0,0])\n {\n cube([w, y, z]);\n translate(6*[0, 1\/2, 0])\n cube([w, y-6, z+20]);\n }\n translate([0, y\/2-w\/2, z])\n cube([x, w, z]);\n}\n\nmodule holder_space_()\n{\n space=2;\n z=2-0.5;\n x=74.1;\n y=32.2+2*space;\n w=3.08+2*space;\n for(dx=[0, x-w+2*space])\n translate([dx, 0, 0])\n cube([w, y, z]);\n}\n\nmodule main_block_()\n{\n \/\/ desk mount\n\/\/ difference()\n\/\/ {\n\/\/ cube([size[0], 19+2*2, 20+4]);\n\/\/ translate([-eps, 2, 4])\n\/\/ cube([size[0]+2*eps, 19, 20+1]);\n\/\/ }\n \/\/ main surface\n for(i=[0])\/\/, size[0]-rounding])\n translate([i, 0, 0])\n hull()\n {\n cube([2*rounding+2, 1, 3]);\n for(j=[0, spacing])\n #translate(spacing*[1,0,0] + [j+1, size[1], 0])\n cylinder(r=rounding, h=3, $fn=120);\n }\n}\n\n\nmodule holder()\n{\n difference()\n {\n main_block_();\n translate([2, spacing, 0])\n #holder_space_();\n translate(2*[1, 1, 0] + [size[0]-spacing-2, spacing, 1.5])\n rotate([0, 180, 0])\n %holder_();\n }\n}\n\nholder();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ffc6b60dc08ce524bd38142d216a4c1cc4bfaa8a","subject":"The stand base was made a little wider.","message":"The stand base was made a little wider.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/stand\/light-signal-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/stand\/light-signal-stand.scad","new_contents":"\nuse <..\/light-signal.scad>\n\nmodule lightSignalStand()\n{\n\tdifference()\n\t{\n\t\tpostHeight = 75;\n\n\t\tlightSignalStand_base(postHeight);\n\n\t\tlightSignalStand_mountingHoles(postHeight);\n\t}\n}\n\n\/** Support functions and modules follow. **\/\n\nmodule lightSignalStand_base(postHeight)\n{\n\tunion()\n\t{\n\t\tradius = lightSignal_stlBaseOuterRadius() + 5;\n\t\tcylinder(r=radius, h=5, center=true);\n\n\t\txLength = 12;\n\t\txTranslate = -xLength \/ 2.0;\n\t\tyTranslate = radius - 5;\n\t\ttranslate([xTranslate, yTranslate, 0])\n\t\tcube([xLength, 5, postHeight]);\n\n\t\tyTranslate2 = -yTranslate - 5;\n\t\ttranslate([xTranslate, yTranslate2, 0])\n\t\tcube([xLength, 5, postHeight]);\n\t}\n}\n\nmodule lightSignalStand_mountingHoles(postHeight)\n{\n\tradius = lightSignal_mountingPostRadius() + 0.6;\n\tzTranslate = postHeight * 0.7;\n\ttranslate([0, 0, zTranslate])\n\trotate([90,0,0])\n\tcylinder(r=radius, h=100, center=true);\n}\n","old_contents":"\nuse <..\/light-signal.scad>\n\nmodule lightSignalStand()\n{\n\tdifference()\n\t{\n\t\tpostHeight = 75;\n\n\t\tlightSignalStand_base(postHeight);\n\n\t\tlightSignalStand_mountingHoles(postHeight);\n\t}\n}\n\n\/** Support functions and modules follow. **\/\n\nmodule lightSignalStand_base(postHeight)\n{\n\tunion()\n\t{\n\t\tradius = lightSignal_stlBaseOuterRadius() + 5;\n\t\tcylinder(r=radius, h=5, center=true);\n\n\t\txLength = 10;\n\t\txTranslate = -xLength \/ 2.0;\n\t\tyTranslate = radius - 5;\n\t\ttranslate([xTranslate, yTranslate, 0])\n\t\tcube([xLength, 5, postHeight]);\n\n\t\tyTranslate2 = -yTranslate - 5;\n\t\ttranslate([xTranslate, yTranslate2, 0])\n\t\tcube([xLength, 5, postHeight]);\n\t}\n}\n\nmodule lightSignalStand_mountingHoles(postHeight)\n{\n\tradius = lightSignal_mountingPostRadius() + 0.6;\n\tzTranslate = postHeight * 0.7;\n\ttranslate([0, 0, zTranslate])\n\trotate([90,0,0])\n\tcylinder(r=radius, h=100, center=true);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"64d23c18fbf45f6d6e1ea7965856b696015613aa","subject":"Sandbox for ArduinoPro","message":"Sandbox for ArduinoPro","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/ArduinoProDev.scad","new_file":"hardware\/sandbox\/ArduinoProDev.scad","new_contents":"\/*\n\n\tPlayground for developing the vitamins\/ArduinoPro.scad library\n\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ include the ArduinoPro.scad library\ninclude <..\/vitamins\/ArduinoPro.scad>\n\n\/\/ Hide clearance box for board components\nArduinoPro_PCB_Clearance_Show = false;\n\n\/\/ Set custom board properties\n\/\/ ArduinoPro_PCB_Width = 0.7 * 25.4;\n\/\/ ArduinoPro_PCB_Length = 1.3 * 25.4;\n\/\/ ArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255];\n\n\n\/\/ Create an Arduino Pro Micro\ntranslate([ArduinoPro_PCB_Pitch, 0, 0])\n ArduinoPro(\"micro\");\n\n\/\/ Create an Arduino Pro Mini\ntranslate([-ArduinoPro_PCB_Width, 0, 0])\n ArduinoPro(\"mini\");\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/sandbox\/ArduinoProDev.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"22cf0fabcbadb9ec97209862ae84f8aea807ae84","subject":"rearranged buttons","message":"rearranged buttons\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n #translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n \/\/string();\n \n}\n\nspoke_lid();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2, 0, 0])\n latch_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength * 1.2, 0, 0])\n rotate([0, 0, 90])\n encoder();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n \/\/string();\n \n}\n\nspoke_lid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"12d30f6617aecd4af74720de56c040c6b1dc4475","subject":"Add access to battery connector, rework straps","message":"Add access to battery connector, rework straps\n","repos":"kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot","old_file":"Prototype-UR2\/assets\/3d\/enclosure.scad","new_file":"Prototype-UR2\/assets\/3d\/enclosure.scad","new_contents":"use ;\nwidth=40;\nlength=66;\nheight=17.5;\nlid_height=8;\nwall=1;\nradius_xy=wall*4;\nradius_z=wall*2;\ninset=0.75;\nstrap_height=13;\n\n\/\/ debug: check all objects sit on the bed platform\n\/\/projection(cut=true) {\ntranslate([width\/3,0,-1]) %cube([width*4, length+20, 2], center=true);\nunion() {\n offset_x=5;\n enclosure_base([-1*(width\/2+offset_x),0,height\/2+wall\/2]);\n enclosure_lid([width\/2+offset_x,0,lid_height\/2+wall\/2]);\n enclosure_straps([width+offset_x*2+20,0,0]);\n}\n\/\/}\n\n\/\/ the base\nmodule enclosure_base(offsets) {\n translate(offsets) {\n difference() {\n union() {\n hinged_box(width, length, height, 1);\n\n \/\/ lanyard attach point\n translate([0,-0.5*length-6, -0.5*(height+wall)+2.5]) {\n difference() {\n cylinder(r=9, h=5, center=true);\n union() {\n cylinder(r=5, h=5, center=true);\n translate([0, 8.5, 0]) cube([18, 5, 5], center=true);\n }\n }\n }\n \/\/ lip\n union() {\n translate([width\/2-wall+0.25,-length\/2+12,wall+height\/2]) cube([wall, 16, 8], center=true);\n #translate([-width\/2+0.25,-length\/2+18,wall+height\/2]) cube([wall, 16, 8], [0,2,0], center=true);\n translate([width\/2-wall+0.25,-length\/2+52,wall+height\/2]) cube([wall, 10, 8], center=true);\n translate([-width\/2+0.25,-length\/2+50,wall+height\/2]) #cube([wall, 10, 8], center=true);\n }\n }\n union() {\n \/\/ aperture for the usb port\n translate([-width\/2-wall, -length\/2+37, height\/2-1]) {\n rotate(90) charge_port(10, 5, wall*2);\n }\n *translate([width\/2+wall-1, -length\/2+32, height\/2-5]) {\n #cube(5);\n }\n translate([width\/2+wall-1, -length\/2+32, height\/2-1]) {\n rotate(90) #charge_port(10, 5, wall*2);\n }\n \/\/ latch push\n translate([0, length\/2+width\/4-1.25, width\/4-2]) rotate([90,0,0]) #cylinder(r=7, h=inset*2, center=true);\n }\n }\n }\n}\n\n\/\/ the lid\nmodule enclosure_lid(offsets) {\n translate(offsets) rotate([0,180,0]) {\n difference() {\n union() {\n hinged_box(width, length, lid_height, -1);\n }\n #translate([0,12,lid_height\/2]) rotate(180) button(10,36,wall*2);\n }\n\n }\n}\n\nmodule enclosure_straps(offsets) {\n \/\/ the strap\n length=60;\n translate(offsets) {\n union() {\n translate([0,0,0]) cube([8, length, 1.5], center=true);\n #translate([0,-length\/2+20,0.75]) cube([width-3, 1.5, 1.5], center=true);\n translate([0,-length\/2+22,0]) cube([width, 8, 1.5], center=true);\n translate([0,length\/2-4,0]) cube([width, 8, 1.5], center=true);\n translate([0,length\/2-0.75,1]) cube([width, 1.5, 3], center=true);\n }\n }\n}\n\nmodule retainer(dims, center=false) {\n xdim=dims[0];\n ydim=dims[1];\n zdim=dims[2];\n half_z=zdim\/2;\n translate([0, 0, center? half_z\/2 : 0]) {\n cube([xdim, ydim, half_z], center=center);\n translate([0,0,half_z]) {\n if (center) {\n cube([xdim-zdim*2, ydim, half_z], center=center);\n }\n else {\n translate([zdim, 0, half_z]) cube([xdim-zdim*2, ydim, half_z], center=center);\n }\n }\n }\n\n}\n\nmodule outer_ridges(radius, length, bounds) {\n translate([-1*(bounds[0]\/2+radius\/2), 0]) {\n rotate([180,0,0]) ridge(radius, length, 1);\n }\n translate([bounds[0]\/2+radius\/2, 0]) {\n rotate([180,0,0]) ridge(radius, length, -1);\n }\n}\nmodule ridge(radius, length, orient=1) {\n rotate([0,0,orient<0?0:180])\n translate([-radius\/2, 0, radius\/2]) difference() {\n rotate([90,0,0]) cylinder(r=radius, h=length, center=true, $fn=12);\n union() {\n translate([0,0,radius\/2]) cube([radius*2, length, radius], center=true);\n translate([-radius\/2,0,0]) cube([radius, length, radius*2], center=true);\n }\n }\n}\n\nmodule hinged_oval_box(width, length, height, orient) {\n \/\/ WIP\/not in use\n hull() {\n translate([0, -length\/2+5, 2]) {\n resize(newsize=[width, width\/2, height]) sphere(d=width, center=true);\n }\n translate([0, +length\/2-5, 2]) {\n resize(newsize=[width*1.25, width\/2, height]) sphere(d=width, center=true);\n }\n }\n}\nmodule hinged_box(width, length, height, orient) {\n hinge_radius=4;\n hinge_y_offset=length\/2+radius_xy+hinge_radius\/2;\n difference() {\n union() {\n difference() {\n shell(width, length, height, orient);\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[0,90,0]) translate([0,0,0.25]) {\n \/\/ add clearance for opposite hinge barrels\n #cylinder(r=hinge_radius,\n h=width*.66+orient*-hinge_radius*2,\n center=true);\n }\n }\n\n }\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[90,180,0]) translate([0,0,0.25]) {\n _pin_hinge(width*.66, hinge_radius, orient>0?0:1);\n }\n }\n \/\/ the latch\n translate([0,length\/2+8.5,orient*(height\/2-3)]) {\n translate([0,-1.5,0]) cube([20, wall, 6], center=true);\n }\n if (orient > 0) {\n translate([0,length\/2+7.25,height\/2+4.5]) {\n translate([0,-1,-4.5]) cube([10, wall*1.5, 10], center=true);\n rotate([90, 90, 0]) ridge(1, 10, 1);\n }\n }\n }\n union() {\n if (orient < 0) {\n \/\/ lid latch receiver\n translate([0,length\/2+7.25,height\/2-3]) {\n difference() {\n translate([0,0,-1.5]) #cube([10, wall*1.5, 2], center=true);\n *translate([0,-1,-4.5]) cube([10, wall*1.5, 10], center=true);\n }\n }\n }\n }\n }\n}\n\nmodule _pin_hinge(h, radius, is_top=0, clearance=0) {\n fingers=5;\n pin_radius=1.5;\n gap=0.25;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n rotate([-90,0,0]) rotate([0,90,0]) translate([0,-radius,-1*(h\/2)+unit_h\/2]) {\n for(i=[0:fingers-1]) {\n if (i%2>0 && is_top) {\n translate([-0.5,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i, gap);\n translate([radius,radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n if (i%2==0 && !is_top) {\n translate([0.5,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i);\n translate([-1*(radius),radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n }\n }\n}\n\nmodule shell(width, length, height, orient=1) {\n difference() {\n union() {\n \/\/cube([2,length, 2], center=true);\n hull() {\n linear_extrude(height=height+wall, center=true) {\n offset(radius_xy) square([width-radius_xy*2+wall*2, length], center=true);\n }\n translate([0,length\/2-wall,0]) {\n difference() {\n resize([width, width\/2, height]) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4,0]) cube([width, width\/2, height], center=true);\n }\n }\n }\n }\n translate([0,0,orient*wall]) {\n translate([0,length\/2-inset, orient*wall]) {\n difference() {\n resize([width-wall, width\/2-wall*4, height+2*wall], auto=true) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4+wall*2,0]) cube([width-wall, width\/2-wall*4, height], center=true);\n }\n }\n cube([width, length, height], center=true);\n }\n }\n translate([0,length\/2+wall,0]) {\n #cube([width*0.66, wall*2, height], center=true);\n }\n}\n\nmodule radiused_cube(dims, radii, center=true) {\n \/\/ radiused box sized to *outer* dimensions\n \/\/ flatten the radii to 1\/2 height\n rad_x=radii[0];\n rad_y=radii[1];\n rad_z=radii[2];\n w=dims[0]; l=dims[1]; h=dims[2];\n\n translate([-w\/2,-l\/2,-h\/2]) hull() {\n for(z=[0:1]) {\n translate([rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n }\n }\n}\n\nmodule button(radius, length, depth) {\n gap=1;\n difference() {\n linear_extrude(height=depth, twist=0, center=true) {\n difference() {\n offset(r=radius_xy+gap) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n offset(r=radius_xy) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n }\n }\n translate([0, radius*2.5, 0]) cube([radius*2, radius_xy+gap, depth], center=true);\n }\n}\n\nmodule charge_port(width, height, wall) {\n radius=height\/2;\n translate([0, -wall\/2, 0]) rotate([90, 0, 0]) hull() {\n linear_extrude(height=wall, center=true) {\n offset(r=2) square([width-4, height-2], center=true);\n }\n }\n}\n\n\n","old_contents":"use ;\nwidth=40;\nlength=66;\nheight=17.5;\nlid_height=9;\nwall=1;\nradius_xy=wall*4;\nradius_z=wall*2;\ninset=0.75;\nstrap_height=13;\n\n\/\/ debug: check all objects sit on the bed platform\n\/\/projection(cut=true) {\n*translate([width\/3,0,-1]) cube([width*4, length+20, 2], center=true);\nunion() {\n offset_x=5;\n enclosure_base([-1*(width\/2+offset_x),0,height\/2+wall\/2]);\n enclosure_lid([width\/2+offset_x,0,lid_height\/2+wall\/2]);\n enclosure_strap([width+offset_x*2+height\/2,0,width\/6]);\n}\n\/\/}\n\n\/\/ the base\nmodule enclosure_base(offsets) {\n translate(offsets) {\n difference() {\n union() {\n hinged_box(width, length, height, 1);\n translate([-width\/2+wall\/2,-2,height\/2-6]) #cube([1.5, 20, 1.5], center=true);\n \/\/ lanyard attach point\n translate([0,-0.5*length-6, -0.5*(height+wall)+2.5]) {\n difference() {\n cylinder(r=9, h=5, center=true);\n union() {\n cylinder(r=5, h=5, center=true);\n translate([0, 8.5, 0])#cube([18, 5, 5], center=true);\n }\n }\n }\n }\n union() {\n \/\/ aperture for the usb port\n translate([-width\/2-wall, -length\/2+47.5, height\/2-3]) {\n #rotate(90) charge_port(12, 7, wall);\n }\n \/\/ top strap receiver+lateral wiggle room\n translate([0,0,-0.5*(height-strap_height)+wall]) top_strap(width\/3+4, strap_height);\n }\n }\n }\n}\n\n\/\/ the lid\nmodule enclosure_lid(offsets) {\n translate(offsets) rotate([0,180,0]) {\n difference() {\n union() {\n hinged_box(width, length, lid_height, -1);\n }\n #translate([0,12,lid_height\/2]) rotate(180) button(10,36,wall*2);\n }\n\n }\n}\n\nmodule enclosure_strap(offsets) {\n \/\/ the strap\n translate(offsets) {\n rotate([0,90,0]) {\n fudge=0;\n translate([13\/2-wall\/2+fudge,0,-13\/2]) #cube([wall, length-4, 5], center=true);\n top_strap(width\/3, 13);\n }\n }\n}\n\nmodule top_strap(strap_w, h) {\n strap_len=length+inset;\n wall=1;\n thickness=1;\n translate([0,0,inset*2]) difference() {\n union() {\n cube([strap_w, strap_len, h], center=true);\n translate([0,0,+h\/2-thickness\/2]) {\n rotate([0,0,90]) outer_ridges(thickness, strap_w, [strap_len, strap_w, h]);\n }\n }\n translate([0,0,+wall\/2]) cube([strap_w, strap_len-2*wall, h-wall], center=true);\n }\n}\nmodule outer_ridges(radius, length, bounds) {\n translate([-1*(bounds[0]\/2+radius\/2), 0]) {\n rotate([180,0,0]) ridge(radius, length, 1);\n }\n translate([bounds[0]\/2+radius\/2, 0]) {\n rotate([180,0,0]) ridge(radius, length, -1);\n }\n}\nmodule ridge(radius, length, orient=1) {\n rotate([0,0,orient<0?0:180])\n translate([-radius\/2, 0, radius\/2]) difference() {\n rotate([90,0,0]) cylinder(r=radius, h=length, center=true, $fn=12);\n union() {\n translate([0,0,radius\/2]) cube([radius*2, length, radius], center=true);\n translate([-radius\/2,0,0]) cube([radius, length, radius*2], center=true);\n }\n }\n}\n\nmodule hinged_oval_box(width, length, height, orient) {\n \/\/ WIP\/not in use\n hull() {\n translate([0, -length\/2+5, 2]) {\n resize(newsize=[width, width\/2, height]) sphere(d=width, center=true);\n }\n translate([0, +length\/2-5, 2]) {\n resize(newsize=[width*1.25, width\/2, height]) sphere(d=width, center=true);\n }\n }\n}\nmodule hinged_box(width, length, height, orient) {\n hinge_radius=4;\n hinge_y_offset=length\/2+radius_xy+hinge_radius\/2;\n difference() {\n union() {\n difference() {\n shell(width, length, height, orient);\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[0,90,0]) translate([0,0,0.25]) {\n \/\/ add clearance for opposite hinge barrels\n #cylinder(r=hinge_radius,\n h=width*.66+orient*-hinge_radius*2,\n center=true);\n }\n }\n\n }\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[90,180,0]) translate([0,0,0.25]) {\n _pin_hinge(width*.66, hinge_radius, orient>0?0:1);\n }\n }\n \/\/ the latch\n translate([0,length\/2+8.5,orient*(height\/2-3)]) {\n translate([0,-1.5,0]) #cube([20, wall, 6], center=true);\n }\n if (orient > 0) {\n translate([0,length\/2+7.25,height\/2+4.5]) {\n translate([0,-1.5,-4.5]) cube([10, wall*2, 10], center=true);\n rotate([90, 90, 0]) ridge(1, 10, 1);\n }\n }\n }\n union() {\n if (orient < 0) {\n \/\/ lid latch receiver\n translate([0,length\/2+7.25,height\/2-3]) {\n translate([0,-1.5,-4.5]) cube([10, wall*2, 10], center=true);\n rotate([90, 90, 0]) ridge(1, 10, 1);\n }\n }\n }\n }\n}\n\nmodule _pin_hinge(h, radius, is_top=0, clearance=0) {\n fingers=5;\n pin_radius=1.5;\n gap=0.25;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n rotate([-90,0,0]) rotate([0,90,0]) translate([0,-radius,-1*(h\/2)+unit_h\/2]) {\n for(i=[0:fingers-1]) {\n if (i%2>0 && is_top) {\n translate([0,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i, gap);\n translate([radius-1,radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n if (i%2==0 && !is_top) {\n translate([0,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i);\n translate([-1*(radius-1),radius*2,0]) cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n }\n }\n}\n\nmodule shell(width, length, height, orient=1) {\n difference() {\n union() {\n \/\/cube([2,length, 2], center=true);\n hull() {\n linear_extrude(height=height+wall, center=true) {\n offset(radius_xy) square([width-radius_xy*2+wall*2, length], center=true);\n }\n translate([0,length\/2-wall,0]) {\n difference() {\n resize([width, width\/2, height]) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4,0]) cube([width, width\/2, height], center=true);\n }\n }\n }\n }\n translate([0,0,orient*wall]) {\n translate([0,length\/2-inset, orient*wall]) {\n difference() {\n resize([width-wall, width\/2-wall*4, height+2*wall], auto=true) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4+wall*2,0]) cube([width-wall, width\/2-wall*4, height], center=true);\n }\n }\n cube([width, length, height], center=true);\n }\n }\n translate([0,length\/2+wall,0]) {\n cube([width*0.75, wall*2, height], center=true);\n }\n}\n\nmodule radiused_cube(dims, radii, center=true) {\n \/\/ radiused box sized to *outer* dimensions\n \/\/ flatten the radii to 1\/2 height\n rad_x=radii[0];\n rad_y=radii[1];\n rad_z=radii[2];\n w=dims[0]; l=dims[1]; h=dims[2];\n\n translate([-w\/2,-l\/2,-h\/2]) hull() {\n for(z=[0:1]) {\n translate([rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n }\n }\n}\n\nmodule button(radius, length, depth) {\n gap=1;\n difference() {\n linear_extrude(height=depth, twist=0, center=true) {\n difference() {\n offset(r=radius_xy+gap) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n offset(r=radius_xy) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n }\n }\n translate([0, radius*2.5, 0]) cube([radius*2, radius_xy+gap, depth], center=true);\n }\n}\n\nmodule charge_port(width, height, wall) {\n radius=height\/2;\n translate([0, -wall\/2, 0]) rotate([90, 0, 0]) hull() {\n linear_extrude(height=wall, center=true) {\n offset(r=2) square([width-4, height-2], center=true);\n }\n }\n}\n\n\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"610348cf720bc82d24d205495fd28951dba15a05","subject":"The rotate angle is now customizable.","message":"The rotate angle is now customizable.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/customizer\/customizable-rainmaker.scad","new_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/customizer\/customizable-rainmaker.scad","new_contents":"\nuse <..\/..\/..\/connectors\/end-cap\/endcap.scad>\n\nuse <..\/rainmaker.scad>\n\n\/* [Shell] *\/\n\nheight = 380; \/\/ [140 : 380]\n\ninnerRadius = 20; \/\/ [30 : 40]\n\nouterRadius = 24; \/\/ [34 : 46]\n\nshellDecoration = \"none\"; \/\/ [none, bumps]\n\n\/* [Rungs] *\/\n\nrungsPerLevel = 2; \/\/ [1 : 4]\n\nstepRadius = 1; \/\/ [1 : 5]\n\nzDistanceBetweenRungs = 5; \/\/ [1:150]\n\nzRotateAngle = 25; \/\/ [5 : 180]\n\n\/* [Endcap] *\/\n\ngenerateEndcap = true; \/\/ [false:true]\n\n\/* [Hidden] *\/\n\ni = 3; \/\/ [1:100]\n\nrainmaker(height = height,\n outerRadius = outerRadius,\n innerRadius = innerRadius,\n\t\t rungsPerLevel = rungsPerLevel,\n\t\t shellDecoration = shellDecoration,\n\t \t stepRadius = stepRadius,\n\t \t zDistanceBetweenRungs = zDistanceBetweenRungs,\n\t \t zRotateAngle = zRotateAngle);\n\nif(generateEndcap)\n{\n\txTranslate = outerRadius * 2 + 10;\n\n\tendcapHeight = 6;\n\n\tendcapOuterRadius = outerRadius + 4;\n\n\ttranslate([xTranslate, 0, 0])\n\tendcap(height = endcapHeight,\n\t\t\tinnerRadius = outerRadius,\n\t\t\touterRadius = endcapOuterRadius);\n\n}\n","old_contents":"\nuse <..\/..\/..\/connectors\/end-cap\/endcap.scad>\n\nuse <..\/rainmaker.scad>\n\n\/* [Shell] *\/\n\nheight = 380; \/\/ [140 : 380]\n\ninnerRadius = 20; \/\/ [30 : 40]\n\nouterRadius = 24; \/\/ [34 : 46]\n\nshellDecoration = \"none\"; \/\/ [none, bumps]\n\n\/* [Rungs] *\/\n\nrungsPerLevel = 2; \/\/ [1 : 4]\n\nstepRadius = 1; \/\/ [1 : 5]\n\nzDistanceBetweenRungs = 5; \/\/ [1:150]\n\n\/* [Endcap] *\/\n\ngenerateEndcap = true; \/\/ [false:true]\n\n\/* [Hidden] *\/\n\ni = 3; \/\/ [1:100]\n\nrainmaker(height = height,\n outerRadius = outerRadius,\n innerRadius = innerRadius,\n\t\t rungsPerLevel = rungsPerLevel,\n\t\t shellDecoration = shellDecoration,\n\t \t stepRadius = stepRadius,\n\t \t zDistanceBetweenRungs = zDistanceBetweenRungs);\n\nif(generateEndcap)\n{\n\txTranslate = outerRadius * 2 + 10;\n\n\tendcapHeight = 6;\n\n\tendcapOuterRadius = outerRadius + 4;\n\n\ttranslate([xTranslate, 0, 0])\n\tendcap(height = endcapHeight,\n\t\t\tinnerRadius = outerRadius,\n\t\t\touterRadius = endcapOuterRadius);\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0c920cdb4213ce7f7fcf7347a4f664b0a1c1fc27","subject":"added connectors to stepper-motors","message":"added connectors to stepper-motors\n","repos":"Axford\/AFRo,Axford\/AFRo,Axford\/AFRo,Axford\/AFRo,Axford\/AFRo,Axford\/AFRo","old_file":"hardware\/vitamins\/stepper-motors.scad","new_file":"hardware\/vitamins\/stepper-motors.scad","new_contents":"\/\/\n\/\/ Mendel90\n\/\/\n\/\/ GNU GPL v2\n\/\/ nop.head@gmail.com\n\/\/ hydraraptor.blogspot.com\n\/\/\n\/\/ NEMA stepper motor model\n\/\/\n\n\/\/ corner body boss boss shaft\n\/\/ side, length, radius, radius, radius, depth, shaft, length, holes, typesuffix\nNEMA17 = [42.3, 47, 53.6\/2, 25, 11, 2, 5, 24, 31, \"17\"];\nNEMA17S = [42.3, 34, 53.6\/2, 25, 11, 2, 5, 24, 31, \"17S\" ];\nNEMA14 = [35.2, 36, 46.4\/2, 21, 11, 2, 5, 21, 26, \"14\" ];\nNEMA11 = [28.2, 51, 18, 18, 22\/2, 2, 5, 21, 23, \"11\" ];\n\nstepper_body_color = grey20;\nstepper_cap_color = grey80;\n\nfunction NEMA_width(motor) = motor[0];\nfunction NEMA_length(motor) = motor[1];\nfunction NEMA_radius(motor) = motor[2];\nfunction NEMA_holes(motor) = [-motor[8]\/2, motor[8]\/2];\nfunction NEMA_big_hole(motor) = motor[4] + 0.2;\nfunction NEMA_shaft_dia(motor) = motor[6];\nfunction NEMA_shaft_length(motor) = motor[7];\nfunction NEMA_hole_pitch(motor) = motor[8];\n\n\/\/ connectors\nNEMA_Con_Default = [[0,0,0], [0,0,-1], 0,0,0];\n\nfunction NEMA_Con_Fixings(m) = [\n [[m[8]\/2, m[8]\/2, 0], [0,0,-1], 0,0,0],\n [[m[8]\/2, -m[8]\/2, 0], [0,0,-1], 0,0,0],\n [[-m[8]\/2, -m[8]\/2, 0], [0,0,-1], 0,0,0],\n [[-m[8]\/2, m[8]\/2, 0], [0,0,-1], 0,0,0]\n];\n\nmodule NEMA(motor) {\n side = NEMA_width(motor);\n length = NEMA_length(motor);\n body_rad = motor[3];\n boss_rad = motor[4];\n boss_height = motor[5];\n shaft_rad = NEMA_shaft_dia(motor) \/ 2;\n cap = 8;\n \/\/vitamin(str(\"NEMA\", round(motor[0] \/ 2.54), length * 10, \": NEMA\", round(motor[0] \/ 2.54), \" x \", length, \"mm stepper motor\"));\n \n tn = motor[9];\n vitamin(\"vitamins\/stepper-motors.scad\", str(\"NEMA\",tn,\" Stepper Motor\"), str(\"NEMA(NEMA\",tn,\")\")) {\n view(t=[0,-7,-12]);\n }\n \n if (DebugCoordinateFrames) frame();\n if (DebugConnectors) {\n connector(NEMA_Con_Default);\n for (i=[0:3])\n connector(NEMA_Con_Fixings(motor)[i]);\n }\n \n union() {\n color(stepper_body_color) render() \/\/ black laminations\n translate([0,0, -length \/ 2])\n intersection() {\n cube([side, side, length - cap * 2],center = true);\n cylinder(r = body_rad, h = 2 * length, center = true);\n }\n color(stepper_cap_color) render() { \/\/ aluminium end caps\n difference() {\n union() {\n intersection() {\n union() {\n translate([0,0, -cap \/ 2])\n cube([side,side,cap], center = true);\n translate([0,0, -length + cap \/ 2])\n cube([side,side,cap], center = true);\n }\n cylinder(r = NEMA_radius(motor), h = 3 * length, center = true);\n }\n difference() {\n cylinder(r = boss_rad, h = boss_height * 2, center = true); \/\/ raised boss\n cylinder(r = shaft_rad + 2, h = boss_height * 2 + 1, center = true);\n }\n cylinder(r = shaft_rad, h = NEMA_shaft_length(motor) * 2, center = true); \/\/ shaft\n }\n for(x = NEMA_holes(motor))\n for(y = NEMA_holes(motor))\n translate([x, y, 0])\n cylinder(r = 3\/2, h = 9, center = true);\n }\n }\n\n translate([0, side \/ 2, -length + cap \/ 2])\n rotate([90, 0, 0])\n for(i = [0:3])\n rotate([0, 0, 225 + i * 90])\n color([\"red\", \"blue\",\"green\",\"black\"][i]) render()\n translate([1, 0, 0])\n cylinder(r = 1.5 \/ 2, h = 12, center = true);\n\n\n }\n}\n\nmodule NEMA_screws(motor, n = 4, screw_length = 8, screw_type = M3_pan_screw) {\n for(a = [0: 90 : 90 * (n - 1)])\n rotate([0, 0, a])\n translate([motor[8]\/2, motor[8]\/2, 0])\n screw_and_washer(screw_type, screw_length, true);\n}\n","old_contents":"\/\/\n\/\/ Mendel90\n\/\/\n\/\/ GNU GPL v2\n\/\/ nop.head@gmail.com\n\/\/ hydraraptor.blogspot.com\n\/\/\n\/\/ NEMA stepper motor model\n\/\/\n\n\/\/ corner body boss boss shaft\n\/\/ side, length, radius, radius, radius, depth, shaft, length, holes, typesuffix\nNEMA17 = [42.3, 47, 53.6\/2, 25, 11, 2, 5, 24, 31, \"17\"];\nNEMA17S = [42.3, 34, 53.6\/2, 25, 11, 2, 5, 24, 31, \"17S\" ];\nNEMA14 = [35.2, 36, 46.4\/2, 21, 11, 2, 5, 21, 26, \"14\" ];\nNEMA11 = [28.2, 51, 18, 18, 22\/2, 2, 5, 21, 23, \"11\" ];\n\nstepper_body_color = grey20;\nstepper_cap_color = grey80;\n\nfunction NEMA_width(motor) = motor[0];\nfunction NEMA_length(motor) = motor[1];\nfunction NEMA_radius(motor) = motor[2];\nfunction NEMA_holes(motor) = [-motor[8]\/2, motor[8]\/2];\nfunction NEMA_big_hole(motor) = motor[4] + 0.2;\nfunction NEMA_shaft_dia(motor) = motor[6];\nfunction NEMA_shaft_length(motor) = motor[7];\nfunction NEMA_hole_pitch(motor) = motor[8];\n\nmodule NEMA(motor) {\n side = NEMA_width(motor);\n length = NEMA_length(motor);\n body_rad = motor[3];\n boss_rad = motor[4];\n boss_height = motor[5];\n shaft_rad = NEMA_shaft_dia(motor) \/ 2;\n cap = 8;\n \/\/vitamin(str(\"NEMA\", round(motor[0] \/ 2.54), length * 10, \": NEMA\", round(motor[0] \/ 2.54), \" x \", length, \"mm stepper motor\"));\n \n tn = motor[9];\n vitamin(\"vitamins\/stepper-motors.scad\", str(\"NEMA\",tn,\" Stepper Motor\"), str(\"NEMA(NEMA\",tn,\")\")) {\n view(t=[0,-7,-12]);\n }\n \n union() {\n color(stepper_body_color) render() \/\/ black laminations\n translate([0,0, -length \/ 2])\n intersection() {\n cube([side, side, length - cap * 2],center = true);\n cylinder(r = body_rad, h = 2 * length, center = true);\n }\n color(stepper_cap_color) render() { \/\/ aluminium end caps\n difference() {\n union() {\n intersection() {\n union() {\n translate([0,0, -cap \/ 2])\n cube([side,side,cap], center = true);\n translate([0,0, -length + cap \/ 2])\n cube([side,side,cap], center = true);\n }\n cylinder(r = NEMA_radius(motor), h = 3 * length, center = true);\n }\n difference() {\n cylinder(r = boss_rad, h = boss_height * 2, center = true); \/\/ raised boss\n cylinder(r = shaft_rad + 2, h = boss_height * 2 + 1, center = true);\n }\n cylinder(r = shaft_rad, h = NEMA_shaft_length(motor) * 2, center = true); \/\/ shaft\n }\n for(x = NEMA_holes(motor))\n for(y = NEMA_holes(motor))\n translate([x, y, 0])\n cylinder(r = 3\/2, h = 9, center = true);\n }\n }\n\n translate([0, side \/ 2, -length + cap \/ 2])\n rotate([90, 0, 0])\n for(i = [0:3])\n rotate([0, 0, 225 + i * 90])\n color([\"red\", \"blue\",\"green\",\"black\"][i]) render()\n translate([1, 0, 0])\n cylinder(r = 1.5 \/ 2, h = 12, center = true);\n\n\n }\n}\n\nmodule NEMA_screws(motor, n = 4, screw_length = 8, screw_type = M3_pan_screw) {\n for(a = [0: 90 : 90 * (n - 1)])\n rotate([0, 0, a])\n translate([motor[8]\/2, motor[8]\/2, 0])\n screw_and_washer(screw_type, screw_length, true);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b0e803b54e880a472e9407a7629c1b0492376966","subject":"new model CITOSINE","message":"new model CITOSINE","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([2, 0, 2.55]) cube ([x+3, y, z+3], center=true); \ncolor(\"lime\") translate ([-27, y\/200000, -4]) cylinder (z+9, y\/2, y\/2); \n \n } \nrotate([0, 90, 0]) translate([-0.5,0,-18.9]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-27.9, -11, 5.1]) cube([53.5, 22, 8]); \/\/\u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([15, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 38.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 38.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n #translate([1, 3, 0]) cube([2, 4.5, 2]);\n \n \n \n","old_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([0, 0, 2.55]) cube ([x, y, z+3], center=true); \ncolor(\"lime\") translate ([-32, y\/200000, -4]) cylinder (z+10, y\/2+2, y\/2+2); \n \n } \n#rotate([0, 90, 0]) translate([-0.5,0,-23]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-25.9, -11, 5.1]) cube([53.5, 22, 8]);\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([13, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 36.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 36.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n #translate([1, 3, 0]) cube([2, 4.5, 2]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e728f277f041745b93f1a0918bd52505b2199c3f","subject":"Change to Pro Mini with serial header pins","message":"Change to Pro Mini with serial header pins\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\n\/\/ dynamic connector for a given fixing in the grid\nfunction LogoBot_Con_GridFixing(x,y,r) = [[x*10, y*10, dw], [0,0,-1], r, 0,0];\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftWheel = [[-40,-20, dw],[0,0,-1],90,0,0];\nLogoBot_Con_RightWheel = [[40,20, dw],[0,0,-1],-90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-46, 16, 10],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[46, 16, 10],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift_Front = [ [0, -20, 2], [0,0,1], 0, 0, 0];\nLogoBot_Con_PenLift_Rear = [ [0, 20, 2], [0,0,1], 0, 0, 0];\nLogoBot_Con_PenLiftServo = [[-12, -6, -6], [1, 0, 0], 90, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false, Shell=true ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n *step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n step(1, \"Plug the Pro Mini Clips into the base and then snap the Arduino Pro Mini into them\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n\n attach(LogoBot_Con_GridFixing(1,4,90), DefConUp)\n ProMiniClip_STL();\n\n attach(LogoBot_Con_GridFixing(-1,4,90), DefConUp)\n ProMiniClip_STL();\n\n attach(offsetConnector(LogoBot_Con_GridFixing(0,4,-90), [0,0,3]), ArduinoPro_Con_Center, ExplodeSpacing=20)\n ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Opposite, true);\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies using four of the push pins with flat heads\" ) {\n view(t=[0,0,0], r=[63,0,146], d=400);\n\t\t\t\t\tfor (i=[0,1])\n\t\t\t\t\ttranslate([0, 0, -8])\n\t\t\t\t\trotate([0, 0, i*180]) {\n\t\t\t\t\t\tattach([Bumper_Con_LeftPin[0], Bumper_Con_LeftPin[1], 0, 0, 0], Bumper_Con_LeftPin, ExplodeSpacing=20)\n\t\t\t\t\t\t\tBumperAssembly();\n\n\t\t\t\t\t\tattachWithOffset(DefCon, DefCon, [0, 0, -6*layers])\n\t\t\t\t\t\t\tBumperStabiliser_STL();\n\n\t\t\t\t\t\tattach(Bumper_Con_LeftPin, DefConDown, ExplodeSpacing=-20, offset=[0,0,20])\n\t\t\t\t\t\t\tpintack(side=false, h=7.8+2+2.5+6*layers, bh=2);\n\n\t\t\t\t\t\tattach(Bumper_Con_RightPin, DefConDown, ExplodeSpacing=-20)\n\t\t\t\t\t\t\tpintack(side=false, h=7.8+2+2.5+6*layers, bh=2);\n\t\t\t\t\t}\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n\n \/\/LogoBot_Con_LeftWheel\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n attach(LogoBot_Con_LeftWheel, MotorClip_Con_Fixing1, ExplodeSpacing = 40)\n LeftWheelAssembly();\n\n attach(LogoBot_Con_RightWheel, MotorClip_Con_Fixing1, ExplodeSpacing = 40)\n RightWheelAssembly();\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FF4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_GridFixing(0,4,-90),\n DefConDown,\n [[-7.5, -5, 7],[0,0,-1],0,0,0],\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FF4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_GridFixing(0,4,-90),\n DefConDown,\n [[-7.5, -15, 7],[0,0,-1],0,0,0],\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n\n \/\/ TODO: Add velcro or to hold down battery pack\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ TODO: Replace with toggle switch\n \/\/Power Switch\n *step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ TODO: LED\n *step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ TODO: Piezo\n *step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n step(10, \"Align the caster assembly with the base, then insert a short pin to lock it to the base\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n attach(offsetConnector(invertConnector(LogoBot_Con_Caster), [0,0,dw]), MarbleCaster_Con_Default)\n pintack(side=false, h=dw+0.6+2+1.5, lh=2, bh=2);\n }\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n step(12, \"Fit the pen lift assembly using two of the pins and zip tie the servo under the base.\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n\t\t\t\t\tattach(LogoBot_Con_PenLift_Front, PenLiftSlider_Con_BaseFront)\n\t\t\t\t\t\tPenLiftAssembly();\n\n\t\t\t\t\tattach(LogoBot_Con_PenLift_Front, offsetConnector(DefConDown, [0, 0, 2 + 2.5]))\n\t\t\t\t\t\tpintack(side=false, h=2.5+4+2.5, bh=2);\n\t\t\t\t\tattach(LogoBot_Con_PenLift_Rear, offsetConnector(DefConDown, [0, 0, 2 + 2.5]))\n\t\t\t\t\t\tpintack(side=false, h=2.5+4+2.5, bh=2);\n\n attach(LogoBot_Con_PenLiftServo, MicroServo_Con_Horn) {\n\t\t\t\t\t\tMicroServo();\n\t\t\t\t\t\tattach(MicroServo_Con_Horn, ServoHorn_Con_Default)\n\t\t\t\t\t\t\tServoHorn();\n\t\t\t\t\t}\n }\n }\n\n\n \/\/ Shell + fixings\n\t\t\tif (Shell) {\n\t\t\t\tstep(PenLift ? 13 : 12,\n\t\t\t\t\t\"Push the shell down onto the base and twist to lock into place\") {\n\t\t\t\t\tview(t=[11,-23,65], r=[66,0,217], d=625);\n\n\t\t\t\t\tattach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t\t\t\t\t\tShellAssembly(PenLift? false : true);\n\t\t\t\t}\n }\n }\n\n\t}\n}\n","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\n\/\/ dynamic connector for a given fixing in the grid\nfunction LogoBot_Con_GridFixing(x,y,r) = [[x*10, y*10, dw], [0,0,-1], r, 0,0];\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftWheel = [[-40,-20, dw],[0,0,-1],90,0,0];\nLogoBot_Con_RightWheel = [[40,20, dw],[0,0,-1],-90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-46, 16, 10],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[46, 16, 10],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift_Front = [ [0, -20, 2], [0,0,1], 0, 0, 0];\nLogoBot_Con_PenLift_Rear = [ [0, 20, 2], [0,0,1], 0, 0, 0];\nLogoBot_Con_PenLiftServo = [[-12, -6, -6], [1, 0, 0], 90, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false, Shell=true ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n *step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n step(1, \"Plug the Pro Mini Clips into the base and then snap the Arduino Pro Mini into them\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n\n attach(LogoBot_Con_GridFixing(1,4,90), DefConUp)\n ProMiniClip_STL();\n\n attach(LogoBot_Con_GridFixing(-1,4,90), DefConUp)\n ProMiniClip_STL();\n\n attach(offsetConnector(LogoBot_Con_GridFixing(0,4,-90), [0,0,3]), ArduinoPro_Con_Center, ExplodeSpacing=20)\n ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Opposite);\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies using four of the push pins with flat heads\" ) {\n view(t=[0,0,0], r=[63,0,146], d=400);\n\t\t\t\t\tfor (i=[0,1])\n\t\t\t\t\ttranslate([0, 0, -8])\n\t\t\t\t\trotate([0, 0, i*180]) {\n\t\t\t\t\t\tattach([Bumper_Con_LeftPin[0], Bumper_Con_LeftPin[1], 0, 0, 0], Bumper_Con_LeftPin, ExplodeSpacing=20)\n\t\t\t\t\t\t\tBumperAssembly();\n\n\t\t\t\t\t\tattachWithOffset(DefCon, DefCon, [0, 0, -6*layers])\n\t\t\t\t\t\t\tBumperStabiliser_STL();\n\n\t\t\t\t\t\tattach(Bumper_Con_LeftPin, DefConDown, ExplodeSpacing=-20, offset=[0,0,20])\n\t\t\t\t\t\t\tpintack(side=false, h=7.8+2+2.5+6*layers, bh=2);\n\n\t\t\t\t\t\tattach(Bumper_Con_RightPin, DefConDown, ExplodeSpacing=-20)\n\t\t\t\t\t\t\tpintack(side=false, h=7.8+2+2.5+6*layers, bh=2);\n\t\t\t\t\t}\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n\n \/\/LogoBot_Con_LeftWheel\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n attach(LogoBot_Con_LeftWheel, MotorClip_Con_Fixing1, ExplodeSpacing = 40)\n LeftWheelAssembly();\n\n attach(LogoBot_Con_RightWheel, MotorClip_Con_Fixing1, ExplodeSpacing = 40)\n RightWheelAssembly();\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FF4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_GridFixing(0,4,-90),\n DefConDown,\n [[-7.5, -5, 7],[0,0,-1],0,0,0],\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FF4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_GridFixing(0,4,-90),\n DefConDown,\n [[-7.5, -15, 7],[0,0,-1],0,0,0],\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n\n \/\/ TODO: Add velcro or to hold down battery pack\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ TODO: Replace with toggle switch\n \/\/Power Switch\n *step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ TODO: LED\n *step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ TODO: Piezo\n *step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n step(10, \"Align the caster assembly with the base, then insert a short pin to lock it to the base\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n\n attach(offsetConnector(invertConnector(LogoBot_Con_Caster), [0,0,dw]), MarbleCaster_Con_Default)\n pintack(side=false, h=dw+0.6+2+1.5, lh=2, bh=2);\n }\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n step(12, \"Fit the pen lift assembly using two of the pins and zip tie the servo under the base.\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n\t\t\t\t\tattach(LogoBot_Con_PenLift_Front, PenLiftSlider_Con_BaseFront)\n\t\t\t\t\t\tPenLiftAssembly();\n\n\t\t\t\t\tattach(LogoBot_Con_PenLift_Front, offsetConnector(DefConDown, [0, 0, 2 + 2.5]))\n\t\t\t\t\t\tpintack(side=false, h=2.5+4+2.5, bh=2);\n\t\t\t\t\tattach(LogoBot_Con_PenLift_Rear, offsetConnector(DefConDown, [0, 0, 2 + 2.5]))\n\t\t\t\t\t\tpintack(side=false, h=2.5+4+2.5, bh=2);\n\n attach(LogoBot_Con_PenLiftServo, MicroServo_Con_Horn) {\n\t\t\t\t\t\tMicroServo();\n\t\t\t\t\t\tattach(MicroServo_Con_Horn, ServoHorn_Con_Default)\n\t\t\t\t\t\t\tServoHorn();\n\t\t\t\t\t}\n }\n }\n\n\n \/\/ Shell + fixings\n\t\t\tif (Shell) {\n\t\t\t\tstep(PenLift ? 13 : 12,\n\t\t\t\t\t\"Push the shell down onto the base and twist to lock into place\") {\n\t\t\t\t\tview(t=[11,-23,65], r=[66,0,217], d=625);\n\n\t\t\t\t\tattach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t\t\t\t\t\tShellAssembly(PenLift? false : true);\n\t\t\t\t}\n }\n }\n\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6b0b85e6dfcf35c2a09e5509b42748f5710f2b4b","subject":"Create R2-3D.scad","message":"Create R2-3D.scad\n\nthe main compile file, just includes everything","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"R2-3D.scad","new_file":"R2-3D.scad","new_contents":"include \ninclude \ninclude \ninclude \n","old_contents":"","returncode":1,"stderr":"error: pathspec 'R2-3D.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"f17b64cf6a1cc2cc8dfdf44cfb0d0d786bd2c22e","subject":"The ring width was parameterized.","message":"The ring width was parameterized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/toys\/fidget-spinners\/nested-rings\/switchborg\/nested-rings.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/toys\/fidget-spinners\/nested-rings\/switchborg\/nested-rings.scad","new_contents":"\/\/ source: https:\/\/www.thingiverse.com\/thing:2989760\n\necho(\"hello nrs\");\n\n\/\/ Variables' comments formatted for Thingiverse Customizer.\n\n\/\/ Cut a notch out of the rings to preview how the interior fits. Disable before printing!\npreview_cut = false;\n\n\/\/ Style of rings. Biconical rings can slide axially as well as tumbling; spherical rings are close-fitting and more likely to jam.\ntype = \"biconical\"; \/\/ [biconical:Biconical, spherical:Spherical, spherical_one_hole:Spherical (closed on top)]\n\n\/\/ For biconical rings, the faces of the rings will have a radius this many millimeters smaller than the center. Ignored for spherical rings.\nbicone_opening_reduction = 3.1;\n\n\/\/ For spherical rings, the width of a centered thinner band of each ring, in millimeters. This is intended for rings printed with transparent material in that band. Set to zero to disable.\nspherical_thin_band_width = 0;\n\n\/\/ For spherical rings, the thickness of a centered thinner band of each ring, in millimeters. This is intended for rings printed with transparent material in that band. Cannot be larger than the ring thickness. Ignored if thin band width is zero.\nspherical_thin_band_thickness = 0.6;\n\n\/\/ For spherical rings, the amount of space between adjacent rings, in millimeters. Set this as low as you can without the surfaces fusing when printed.\nspherical_gap = 0.6;\n\n\/* [Hidden] *\/\n\nspherical = type == \"spherical\" || type == \"spherical_one_hole\";\n\n\/\/ Chosen constants and not-exposed calculations\nSMOOTH_FACETS = 240;\n\n\/\/gap = spherical ? spherical_gap : bicone_gap;\n\nfacets = spherical ? SMOOTH_FACETS \/ 2 : SMOOTH_FACETS; \/\/ make spheres somewhat less super-expensive\n\n\/\/ Derived values \/ aliases\nzradius = stockNestedRings_ringWidth() \/ 2;\n\n\nmodule nestedRings(outer_radius, ring_count)\n{\n difference()\n\t{\n main(outer_radius = outer_radius,\n\t\t\t ring_count = ring_count);\n\n if (preview_cut)\n translate([0, 0, -500])\n cube([1000, 1000, 1000]);\n }\n}\n\nmodule main(outer_radius,\n\t\t ring_count)\n{\n\tstep = stockNestedRings_step();\n\n\tring_thickness = stockNestedRings_ringThickness();\n\n\/\/\tring_count = 1;\n\n for (i = [0:ring_count - 1])\n\t{\n radius = outer_radius - i * step;\n\n unit(r2 = radius,\n\t\t\t ring_thickness = ring_thickness);\n }\n}\n\nmodule unit(r2, ring_thickness) {\n if (spherical) {\n rotate_extrude($fn = facets)\n intersection() {\n difference() {\n circle(r = r2, $fn = facets);\n circle(r = r2 - ring_thickness, $fn = facets);\n\n if (spherical_thin_band_width > 0) {\n minkowski() {\n intersection() {\n circle(r = r2 - ring_thickness, $fn = facets);\n\n translate([0, -spherical_thin_band_width \/ 2])\n square([r2 * 1.5, spherical_thin_band_width]);\n }\n\n \/\/ diamond shape to create 45\u00b0 overhangs\n circle(r=ring_thickness - spherical_thin_band_thickness, $fn=4);\n }\n }\n }\n\n translate([0, -zradius])\n square([r2 * 1.5, type == \"spherical_one_hole\" ? 1000 : zradius * 2]);\n }\n\n } else if (type == \"biconical\") {\n r1 = r2 - bicone_opening_reduction;\n \/\/linear_extrude(2)\n rotate_extrude($fn = facets)\n polygon([\n [r1, zradius],\n [r2, 0],\n [r1, -zradius],\n [r1 - ring_thickness, -zradius],\n [r2 - ring_thickness, 0],\n [r1 - ring_thickness, zradius],\n ]);\n\n } else {\n echo(\"Error: ring type not valid\");\n }\n}\n\n\/\/ Constants and derived values follow\n\n\/\/ Thickness of each ring, in millimeters. Setting this too low will result in rings which pop apart too easily.\nfunction stockNestedRings_ringThickness() = 1.4;\n\n\/\/ Radius of the midline of the largest ring, in millimeters.\nfunction stockNestedRings_outerRadius() = 33;\n\n\/\/ Number of rings to generate. The size is determined starting from the center, so more rings is larger.\nfunction stockNestedRings_ringCount() = 6;\n\n\/\/ Width of the rings (z axis height as printed), in millimeters.\nfunction stockNestedRings_ringWidth() = 20;\n\n\/\/ For biconical rings, the amount of space between adjacent rings (when they are concentric), in millimeters. Must be smaller than Bicone Opening Reduction to prevent the rings from just falling apart.\nfunction stockNestedRings_biconeGap() = 2;\n\nfunction stockNestedRings_step() = stockNestedRings_biconeGap() + stockNestedRings_ringThickness();\n","old_contents":"\/\/ source: https:\/\/www.thingiverse.com\/thing:2989760\n\necho(\"hello nrs\");\n\n\/\/ Variables' comments formatted for Thingiverse Customizer.\n\n\/\/ Cut a notch out of the rings to preview how the interior fits. Disable before printing!\npreview_cut = false;\n\n\/\/ Style of rings. Biconical rings can slide axially as well as tumbling; spherical rings are close-fitting and more likely to jam.\ntype = \"biconical\"; \/\/ [biconical:Biconical, spherical:Spherical, spherical_one_hole:Spherical (closed on top)]\n\n\/\/ Width of the rings (z axis height as printed), in millimeters.\nring_width = 20;\n\n\/\/ For biconical rings, the faces of the rings will have a radius this many millimeters smaller than the center. Ignored for spherical rings.\nbicone_opening_reduction = 3.1;\n\n\n\n\/\/ For spherical rings, the width of a centered thinner band of each ring, in millimeters. This is intended for rings printed with transparent material in that band. Set to zero to disable.\nspherical_thin_band_width = 0;\n\n\/\/ For spherical rings, the thickness of a centered thinner band of each ring, in millimeters. This is intended for rings printed with transparent material in that band. Cannot be larger than the ring thickness. Ignored if thin band width is zero.\nspherical_thin_band_thickness = 0.6;\n\n\/\/ For spherical rings, the amount of space between adjacent rings, in millimeters. Set this as low as you can without the surfaces fusing when printed.\nspherical_gap = 0.6;\n\n\/* [Hidden] *\/\n\nspherical = type == \"spherical\" || type == \"spherical_one_hole\";\n\n\/\/ Chosen constants and not-exposed calculations\nSMOOTH_FACETS = 240;\n\n\/\/gap = spherical ? spherical_gap : bicone_gap;\n\nfacets = spherical ? SMOOTH_FACETS \/ 2 : SMOOTH_FACETS; \/\/ make spheres somewhat less super-expensive\n\n\/\/ Derived values \/ aliases\nzradius = ring_width \/ 2;\n\n\nmodule nestedRings(outer_radius, ring_count)\n{\n\techo(\"hello nr\");\n\n difference()\n\t{\n main(outer_radius = outer_radius,\n\t\t\t ring_count = ring_count);\n\n if (preview_cut)\n translate([0, 0, -500])\n cube([1000, 1000, 1000]);\n }\n}\n\nmodule main(outer_radius,\n\t\t ring_count)\n{\n\techo(\"hello m\");\n\n\tstep = stockNestedRings_step();\n\n\tring_thickness = stockNestedRings_ringThickness();\n\n for (i = [0:ring_count - 1])\n\t{\n radius = outer_radius - i * step;\n\n unit(r2 = radius,\n\t\t\t ring_thickness = ring_thickness);\n }\n}\n\nmodule unit(r2, ring_thickness) {\n if (spherical) {\n rotate_extrude($fn = facets)\n intersection() {\n difference() {\n circle(r = r2, $fn = facets);\n circle(r = r2 - ring_thickness, $fn = facets);\n\n if (spherical_thin_band_width > 0) {\n minkowski() {\n intersection() {\n circle(r = r2 - ring_thickness, $fn = facets);\n\n translate([0, -spherical_thin_band_width \/ 2])\n square([r2 * 1.5, spherical_thin_band_width]);\n }\n\n \/\/ diamond shape to create 45\u00b0 overhangs\n circle(r=ring_thickness - spherical_thin_band_thickness, $fn=4);\n }\n }\n }\n\n translate([0, -zradius])\n square([r2 * 1.5, type == \"spherical_one_hole\" ? 1000 : zradius * 2]);\n }\n\n } else if (type == \"biconical\") {\n r1 = r2 - bicone_opening_reduction;\n \/\/linear_extrude(2)\n rotate_extrude($fn = facets)\n polygon([\n [r1, zradius],\n [r2, 0],\n [r1, -zradius],\n [r1 - ring_thickness, -zradius],\n [r2 - ring_thickness, 0],\n [r1 - ring_thickness, zradius],\n ]);\n\n } else {\n echo(\"Error: ring type not valid\");\n }\n}\n\n\/\/ Constants and derived values follow\n\n\/\/ Thickness of each ring, in millimeters. Setting this too low will result in rings which pop apart too easily.\nfunction stockNestedRings_ringThickness() = 1.4;\n\n\/\/ Radius of the midline of the largest ring, in millimeters.\nfunction stockNestedRings_outerRadius() = 33;\n\n\/\/ Number of rings to generate. The size is determined starting from the center, so more rings is larger.\nfunction stockNestedRings_ringCount() = 6;\n\n\/\/ For biconical rings, the amount of space between adjacent rings (when they are concentric), in millimeters. Must be smaller than Bicone Opening Reduction to prevent the rings from just falling apart.\nfunction stockNestedRings_biconeGap() = 2;\n\nfunction stockNestedRings_step() = stockNestedRings_biconeGap() + stockNestedRings_ringThickness();\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8b8c61f896e32275235c51f94847f58102a41b94","subject":"Checkpoint scad file","message":"Checkpoint scad file\n","repos":"clydemcqueen\/orca,clydemcqueen\/orca,clydemcqueen\/orca","old_file":"orca_vision\/cad\/orca_camera.scad","new_file":"orca_vision\/cad\/orca_camera.scad","new_contents":"\/\/ in mm\n\n\/\/ Tube module -- radius is outer radius\nmodule tube(height, radius, wall) {\n difference() {\n cylinder(h=height, r=radius);\n translate([0, 0, -1]) cylinder(h=height+2, r=radius-wall);\n }\n}\n\n\/\/ Flange module\nmodule flange() {\n color(\"gray\") tube(6, 57\/2, 7\/2+12\/2);\n translate([0, 0, 6]) color(\"gray\") tube(21.5-6, 50\/2, 12\/2);\n}\n\n\/\/ --- main unit --\n\n\/\/ Top flange\nflange();\n\n\/\/ Flange connector\ntranslate([0, 0, 31\/2+6]) color(\"blue\") tube(4, 50\/2, 12\/2);\n\/\/ TODO add screw holes\n\n\/\/ Camera\ntranslate([0, 0, -2]) union() {\n translate([-25\/2+2.5, -10, 22.3]) cube([20, 5, 2.5]);\n translate([-25\/2, -10, 22.3]) cube([25, 24.5, 1]);\n cylinder(h=22.3, r=8.3);\n}\n\n\/\/ Camera sled\n\/\/translate([2.5, 0, 59-19]) cube([25, 24.5, 2]);\n\n\/\/ Electronics sled\n\/\/translate([2.5, 0, 59-19]) cube([15, 11, 19]);\n\n\/\/ Pi Zero\ntranslate([-15, -4, 35]) cube([30, 1, 65]);\n\n\/\/ Ethernet\ntranslate([-10, 2, 35+65-59]) union() {\n cube([20, 1, 59]);\n translate([2.5, 0, 59-19]) cube([15, 11, 19]);\n}\n\n\/\/ Power supply\ntranslate([-9, 6, 35]) cube([18, 5, 17]);\n\n\/\/ -- tube and bottom flange, attached later --\n\n\/\/ Bottom flange\ntranslate([0, 0, 132]) rotate([0, 180, 0]) flange();\n\n\/\/ Tube\ncolor(\"white\", 0.1) translate([0, 0, 6]) tube(120, 57.2\/2, 3.2);\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'orca_vision\/cad\/orca_camera.scad' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"2cf6cd2a0d91d9da133602b4de6150864381bb73","subject":"cleanup","message":"cleanup\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3; \/\/ 40.57\n yTranslate = -2.5; \/\/ -2.0\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57, \/\/ 3\n r2 = 2.57, \/\/ 3\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ae08c98b49a940d9f10cea92262ceee5a7f56f58","subject":"transforms: add spreadxy\/xyz\/zx\/yz","message":"transforms: add spreadxy\/xyz\/zx\/yz\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(X*(m?1:0))\n children();\n}\n\nmodule my(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(Y*(m?1:0))\n children();\n}\n\nmodule mz(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(Z*(m?1:0))\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule spread(axis=N, dist=0, iter=[-1,1])\n{\n assert(is_list(axis));\n assert(is_num(dist));\n assert(is_list(iter));\n\n for(i=iter)\n translate(i*axis*dist)\n children();\n}\n\nmodule spreadx(dist=0)\n{\n spread(axis=X,dist=dist)\n children();\n}\n\nmodule spreadxy(dist=0)\n{\n spreadx(dist)\n spready(dist)\n children();\n}\n\nmodule spreadxyz(dist=0)\n{\n spreadx(dist)\n spready(dist)\n spreadz(dist)\n children();\n}\n\nmodule spreadxz(dist=0)\n{\n spreadx(dist)\n spready(dist)\n children();\n}\n\nmodule spready(dist=0)\n{\n spread(axis=Y,dist=dist)\n children();\n}\n\nmodule spreadyz(dist=0)\n{\n spready(dist)\n spreadz(dist)\n children();\n}\n\nmodule spreadz(dist=0)\n{\n spread(axis=Z,dist=dist)\n children();\n}\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\n\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"t(): dist==U\");\n assert(is_list(dist), dist);\n assert(len(dist)==3, \"t(): len(dist)!=3\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"tx(): dist==U\");\n assert(is_num(dist), \"tx(): dist is not a number\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"ty(): dist==U\");\n assert(is_num(dist), \"ty(): dist is not a number\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"tz(): dist==U\");\n assert(is_num(dist), \"tz(): dist is not a number\");\n translate(Z*dist)\n children();\n}\n\nmodule txy(off)\n{\n assert(off!=U, \"txy(): off==U\");\n assert(len(off)==3, \"txy(): len(off)!=3\");\n tx(off.x)\n ty(off.y)\n children();\n}\n\nmodule txz(off)\n{\n assert(off!=U, \"txz(): off==U\");\n assert(len(off)==3, \"txz(): len(off)!=3\");\n tx(off.x)\n tz(off.z)\n children();\n}\n\nmodule tyz(off)\n{\n assert(off!=U, \"tyz(): off==U\");\n assert(len(off)==3, \"tyz(): len(off)!=3\");\n ty(off.y)\n tz(off.z)\n children();\n}\n\nmodule r(a, v)\n{\n if(is_list(a))\n {\n assert(is_undef(v), v);\n assert_v3n(a);\n rotate(a)\n children();\n }\n else\n {\n assert(is_num(a), a);\n assert_v3n(v);\n rotate(a,v)\n children();\n }\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\nmodule mx(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(X*(m?1:0))\n children();\n}\n\nmodule my(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(Y*(m?1:0))\n children();\n}\n\nmodule mz(m=true)\n{\n assert(!is_undef(m));\n assert(is_bool(m));\n mirror(Z*(m?1:0))\n children();\n}\n\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\nmodule spread(axis=N, dist=0, iter=[-1,1])\n{\n assert(is_list(axis));\n assert(is_num(dist));\n assert(is_list(iter));\n\n for(i=iter)\n translate(i*axis*dist)\n children();\n}\n\nmodule spreadx(dist=0)\n{\n spread(axis=X,dist=dist)\n children();\n}\n\nmodule spready(dist=0)\n{\n spread(axis=Y,dist=dist)\n children();\n}\n\nmodule spreadz(dist=0)\n{\n spread(axis=Z,dist=dist)\n children();\n}\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(orient != N);\n assert_v3n(align);\n assert_v3n(orient);\n assert_v3n(size);\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n assert_v3n(t);\n assert_v3n(extra_t);\n \/*assert(extra_t[0] < 0 && extra_t[0] == 0 && extra_t[0] > 0 || extra_t[);*\/\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\nmodule proj_extrude_axis_part(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n {\n orient_(axis=axis, axis_ref=Z)\n {\n hull()\n linear_extrude(offset, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nif(false)\n{\n tz(10)\n proj_extrude_axis_part(axis=Z, offset=10)\n {\n x = 15;\n cylinder(d=5, h=20);\n\n tx(x)\n cylinder(d=5, h=20);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"140dbf140fe350c11b3217bef4f62ef3ac9be686","subject":"misc: add factorial","message":"misc: add factorial\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + v_sum(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5f8525dbb123d340f9a6e71c3d6a4d0dbc49304a","subject":"shapes\/rcylinder: fix extra_d param","message":"shapes\/rcylinder: fix extra_d param\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r\/2, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extrasize=N, extrasize_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_,r2_];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r\/2, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n orient(axis=$axis, axis_ref=Z)\n translate(Z*10)\n rcylindera(r1=5, r2=3, h=10);\n}\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n \/*rcylindera(h=20, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3ec8c0589bccf137940195e3f3f49194eebeca1f","subject":"main: fix x carriage pos","message":"main: fix x carriage pos\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/\/ x carriage\n for(x=[-1,1])\n translate([axis_pos_x+x*151,0,0])\n {\n xo = x==-1? 255*mm : 0*mm;\n\n translate([xo,0,0])\n\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*152,0,0])\n {\n \/\/ x carriage\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9ce81ba161faa2c541930a199a6efe918f640e7d","subject":"\u0422\u0438\u043c\u0438\u043d \u0441 \u0431\u0443\u043a\u0432\u043e\u0439 \u0438 \u0441 \u0437\u0430\u0434\u043d\u0438\u043c \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u043c \u0434\u043b\u044f *\u0414\u041e\u0420","message":"\u0422\u0438\u043c\u0438\u043d \u0441 \u0431\u0443\u043a\u0432\u043e\u0439 \u0438 \u0441 \u0437\u0430\u0434\u043d\u0438\u043c \u043c\u0430\u0433\u043d\u0438\u0442\u043e\u043c \u0434\u043b\u044f *\u0414\u041e\u0420\n\n*\u0414\u041e\u0420-\u0434\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Timin_v2.scad","new_file":"3D-models\/SCAD\/Timin_v2.scad","new_contents":"$fn=128;\n\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=19; \nz=7; \nt=0; \nz2=2.5;\nedge=0.71*y; \ndx=edge*1.41; \n\/\/\u0422\u0438\u043c\u0438\u043d \ndifference(){\ntranslate ([dx\/2,t,0]) { \n color() translate ([0,0,0]) cube ([x-dx\/2,y,z], center=true); \n translate([-25,0,0]) color() rotate ([0,0,45]) cube ([edge,edge,z], center=true); \n} \ntranslate([-32,0,0]) cube([21,21,10],center=true);\n#rotate([0,90,0]) translate([0,0,-22]) cylinder(5,2.7,2.7);\ntranslate([-10,-10.5,0]) cube([50,21,5]);\n}\n\nrotate([90,0,0]) translate([-10.5,0,-9.5]) cylinder(19,3.5,3.5);\n\/\/\u0417\u0430\u0434\u043d\u0438\u0439 \u043c\u0430\u0433\u043d\u0438\u0442\ndifference() {\ntranslate([24.78,-9.5,-1]) cube([10,19,5]);\n#rotate([0,90,0]) translate([0,0,30.4]) cylinder(5,2.7,2.7);\n}\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u043e\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\n translate([8,-6,0]) cube([xx,e+2,xx]);\n translate([3,-6,0]) cube([e,xx,xx]);\n \n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/Timin_v2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"5226cd56426e2366399f5903d256b7e0ae8a658b","subject":"feat: add an operator to animate a resizing","message":"feat: add an operator to animate a resizing\n","repos":"jsconan\/camelSCAD","old_file":"operator\/animate\/resize.scad","new_file":"operator\/animate\/resize.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that animate child modules with respect to particular rules.\n *\n * @package operator\/animate\n * @author jsconan\n *\/\n\n\/**\n * Resizes the child modules, interpolating the sizes with respect to the `$t` variable.\n *\n * @param Vector [from] - The sizes from where starts the interpolation.\n * @param Vector [to] - The sizes to where ends the interpolation.\n * @param Number [start] - The start threshold under what the from-sizes will persist and above what it will be interpolated.\n * @param Number [end] - The end threshold above what the to-sizes will persist and under what it will be interpolated.\n * @param Number [domain] - The percentage domain used to compute the thresholds (default: 100).\n * @param Vector [values] - A list of sizes composing the range to interpolate.\n * @param Vector [range] - A pre-built interpolation range. If missing, it will be built from the parameters `from`, `to`, `start`, `end`, `domain`.\n * @param Boolean [auto] - When set to `true`, it auto-scales any 0-dimensions to match. It can also be used to auto-scale a single dimension and leave the other as-is.\n * @returns Number\n *\/\nmodule resizeAnimate(from, to, start, end, domain, auto, values, range) {\n resize(interpolateStep3D(step=$t, low=from, high=to, start=start, end=end, domain=domain, values=values, range=range), auto=auto) {\n children();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'operator\/animate\/resize.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"2f05c59bfcba54572ec528bf9c14af59ccf590d8","subject":"bearing\/data: add MR125","message":"bearing\/data: add MR125\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR115 = [5,11,4];\nbearing_MR105 = [5,10,4];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7fe9948ed8281b31566885625034b18ce987d4ab","subject":"elementsrotate by 90 deg so that element naturaly fits the printer","message":"elementsrotate by 90 deg so that element naturaly fits the printer\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"spices_holder_mount\/mount.scad","new_file":"spices_holder_mount\/mount.scad","new_contents":"hh = 25; \/\/ hooks height\npl = 259-2*2; \/\/ plane length\nsw = 10; \/\/ support width\n\n\/\/ main plane (to be glued to the wall)\ncube([45, pl, 1.5]);\n\/\/ support shelf\ntranslate([10, 0, 1.5])\n cube([10, pl, 8]);\n\n\/\/ hooks\nfor(y = [45, pl\/2-sw\/2, pl-45-sw])\n translate([10, y, 1.5+8])\n cube([10+7, 10, 5]);\n","old_contents":"hh = 25; \/\/ hooks height\npl = 259-2*2; \/\/ plane length\nsw = 10; \/\/ support width\n\n\/\/ main plane (to be glued to the wall)\ncube([pl, 45, 1.5]);\n\/\/ support shelf\ntranslate([0, 10, 1.5])\n cube([pl, 10, 8]);\n\n\/\/ hooks\nfor(x = [45, pl\/2-sw\/2, pl-45-sw])\n translate([x, 10, 1.5+8])\n cube([10, 10+7, 5]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0f13fb85a52542d4fe6054d880a889c45dd43e9c","subject":"Adds an openscad model for the chassis","message":"Adds an openscad model for the chassis\n\nThis allows you to print the chassis on any 3d printer. It is not\ncurrently designed to be manufactuable by other means other than 3d\nprinting.\n","repos":"james147\/drifter","old_file":"models\/chassis.scad","new_file":"models\/chassis.scad","new_contents":"\/\/cylinder(h = 3, r1 = 120, r2 = 120, center = true);\n\nmodule caster_mask() {\n rotate([0,0,0]) union() {\n translate([ 0, 0, -5]) cylinder(h = 10, r = 8.5, center = true, $fs = 0.01);\n translate([ 7.5, 0, -5]) cylinder(h = 10, r = 3.5, center = true, $fs = 0.01);\n translate([-7.5, 0, -5]) cylinder(h = 10, r = 3.5, center = true, $fs = 0.01);\n translate([ 7.5, 0, 5]) cylinder(h = 10, r = 1.2, center = true, $fs = 0.01);\n translate([-7.5, 0, 5]) cylinder(h = 10, r = 1.2, center = true, $fs = 0.01);\n #translate([ 6.5, 0, 5]) cylinder(h = 10, r = 1.2, center = true, $fs = 0.01);\n #translate([-6.5, 0, 5]) cylinder(h = 10, r = 1.2, center = true, $fs = 0.01);\n #translate([7, 0, 5]) cube([1.25, 2.4, 10], center = true);\n #translate([-7, 0, 5]) cube([1.25, 2.4, 10], center = true);\n }\n}\n\nmodule motor_mask() {\n union(){\n translate([0, 0, 5.5]) cube([35,12.5,11], center = true);\n translate([13, -25, -15.6]) cube([15,50,50]);\n translate([0, 10, 0]) cylinder(h = 22.5, r = 1.65, center = true, $fs = 0.01);\n translate([0, -10, 0]) cylinder(h = 22.5, r = 1.65, center = true, $fs = 0.01);\n }\n}\n\nmodule battery() {\n union() {\n cube([76, 40, 2], center = true);\n translate([-38, -20, 0]) cube([76, 2, 15]);\n translate([-38, 18, 0]) cube([76, 2, 15]);\n translate([-38, -13, 0]) cube([2, 26, 15]);\n translate([36, -20, 0]) cube([2, 40, 15]);\n translate([-15, -18, 0]) cube([30, 4, 6]);\n translate([-15, 14, 0]) cube([30, 4, 6]);\n translate([-36, -13, 0]) cube([4, 26, 6]);\n translate([32, -20, 0]) cube([4, 40, 6]);\n }\n}\n\nmodule rover() {\n difference() {\n union() {\n translate([0, 0, 1]) cylinder(h = 1.5, r = 60, center = true, $fn=100);\n translate([0, 40,1.25]) battery();\n }\n #translate([0, 45, -0.01]) caster_mask();\n #translate([0, -30,-0.01]) caster_mask();\n #translate([-35, 0, 2.01]) rotate([0, 0, 180]) motor_mask();\n #translate([ 35, 0, 2.01]) motor_mask();\n #translate([ 45, 30, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #translate([ 45, -25, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #translate([-45, 30, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #translate([-45, -25, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 0]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 20]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, -20]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 40]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, -40]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 55]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, -55]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 130]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, -130]) translate([0, -58, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n\n\n #rotate([0, 0, 0]) translate([0, -52, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 20]) translate([0, -52, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, -20]) translate([0, -52, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, 40]) translate([0, -52, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n #rotate([0, 0, -40]) translate([0, -52, 0]) cylinder(h = 20, r = 1.6, center = true, $fs = 0.01);\n }\n}\n\nmodule top_prototype() {\n\tdifference() {\n union() {\n translate([0, 0, 1]) cylinder(h = 2, r = 60, center = true, $fn=100);\n\t\tdifference() {\n\t\t\ttranslate([0, 0, 5]) cube([84, 119.5, 10], center = true);\n\t\t\ttranslate([0, 0, 7.002]) cube([82, 117.5, 10], center = true);\n\t\t\ttranslate([28,-60,2.001]) cube([5, 2, 10]);\n\t\t\ttranslate([-33,-60,2.001]) cube([5, 2, 10]);\n\t\t\ttranslate([-42.1,42.75,2.001]) cube([2, 5, 10]);\n\t\t\ttranslate([-42.1,-42.75,2.001]) cube([2, 5, 10]);\n\t\t}\n }\n #translate([ 45, 30, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #translate([ 45, -25, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #translate([-45, 30, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n #translate([-45, -25, 20]) cylinder(h = 50, r = 1.6, center = true, $fs = 0.01);\n\n #translate([20, -48.47, 20]) cylinder(h = 50, r = 1.1, center = true, $fs = 0.01);\n #translate([-20, -48.47, 20]) cylinder(h = 50, r = 1.1, center = true, $fs = 0.01);\n #translate([20, 28.25, 20]) cylinder(h = 50, r = 1.1, center = true, $fs = 0.01);\n #translate([-20, 28.25, 20]) cylinder(h = 50, r = 1.1, center = true, $fs = 0.01);\n\t}\n}\n\ntranslate([0, -80, 0]) rover();\ntranslate([0, 80, 0]) top_prototype();","old_contents":"","returncode":1,"stderr":"error: pathspec 'models\/chassis.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b03e6d275d69d813458357658f3bf15ea8599c1d","subject":"Thickness update for new material.","message":"Thickness update for new material.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 8;\nsupport_drop = 4;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/3, z=height\/2);\n mock_rpi(x=width, y=depth\/3-10, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*3, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*3, y=depth\/3, z=height\/2+support_drop);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 8;\nsupport_drop = 4;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=depth\/3, z=height\/2);\n mock_rpi(x=width, y=depth\/3-10, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n camera_supports(x=width+thickness*3, y=depth\/2, z=height\/2+support_drop);\n rpi_support(x=width+thickness*3, y=depth\/3, z=height\/2+support_drop);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule rpi_support(x, y, z) {\n hanging_support(x, y, z, out=3, up=85);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"21efb2f340927499d7fd48848d50a44ae08d2e11","subject":"attach: fix","message":"attach: fix\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"attach.scad","new_file":"attach.scad","new_contents":"use \nuse \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn, fnr=0.4)\n{\n fn_= fn==undef ? (floor(2*(r)*PI\/fnr)) : fn;\n translate(p)\n sphere(r=r,$fn=fn_);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false, fnr)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n fncylindera(r1=2\/2, r2=0.2, h=l_arrow, fnr=fnr);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate([1,0,0])\n cubea([2,0.3,l_arrow*0.8]);\n }\n\n \/\/-- Draw the body\n fncylindera(r=1\/2, h=lb, center=true, fnr=fnr);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2, fnr);\n}\n\n\/\/-----------------------------------------------------------------\n\/\/-- ORIENTATE OPERATOR\n\/\/--\n\/\/-- Orientate an object to the direction given by the vector v\n\/\/-- Parameters:\n\/\/-- v : Target orientation\n\/\/-- vref: Vector reference. It is the vector of the local frame\n\/\/-- of the object that want to be poiting in the direction\n\/\/-- of v\n\/\/-- roll: Rotation of the object around the v axis\n\/\/-------------------------------------------------------------------\nmodule orientate(v,vref=[0,0,1], roll=0)\n{\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n \/\/-- Rotate the child!\n rotate(a=roll, v=v)\n rotate(a=ang, v=raxis)\n child(0);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = [0,0,1];\n raxis = v_cross(vref,v);\n \n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(v_unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","old_contents":"use \n\n\/\/ From Obiscad\n\/\/----------------------------------------------------------\n\/\/-- Draw a point in the position given by the vector p \n\/\/----------------------------------------------------------\nmodule point(p, r=0.7, fn, fnr=0.4)\n{\n fn_= fn==undef ? (floor(2*(r)*PI\/fnr)) : fn;\n translate(p)\n sphere(r=r,$fn=fn_);\n}\n\n\/\/------------------------------------------------------------------\n\/\/-- Draw a vector poiting to the z axis\n\/\/-- This is an auxiliary module for implementing the vector module\n\/\/--\n\/\/-- Parameters:\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/-- mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/------------------------------------------------------------------\nmodule vectorz(l=10, l_arrow=4, mark=false, fnr)\n{\n \/\/-- vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/-- The vector is locatead at 0,0,0\n translate([0,0,lb\/2])\n union() {\n\n \/\/-- Draw the arrow\n translate([0,0,lb\/2])\n fncylinder(r1=2\/2, r2=0.2, h=l_arrow, fnr);\n\n \/\/-- Draw the mark\n if (mark) {\n translate([0,0,lb\/2+l_arrow\/2])\n translate([1,0,0])\n cube([2,0.3,l_arrow*0.8],center=true);\n }\n\n \/\/-- Draw the body\n cylinder(r=1\/2, h=lb, center=true, fnr);\n }\n\n \/\/-- Draw a sphere in the vector base\n sphere(r=1\/2, fnr);\n}\n\n\/\/-----------------------------------------------------------------\n\/\/-- ORIENTATE OPERATOR\n\/\/--\n\/\/-- Orientate an object to the direction given by the vector v\n\/\/-- Parameters:\n\/\/-- v : Target orientation\n\/\/-- vref: Vector reference. It is the vector of the local frame\n\/\/-- of the object that want to be poiting in the direction\n\/\/-- of v\n\/\/-- roll: Rotation of the object around the v axis\n\/\/-------------------------------------------------------------------\nmodule orientate(v,vref=[0,0,1], roll=0)\n{\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n \/\/-- Rotate the child!\n rotate(a=roll, v=v)\n rotate(a=ang, v=raxis)\n child(0);\n}\n\n\/\/ From Obiscad,\n\/\/---------------------------------------------------------------------------\n\/\/-- Draw a vector\n\/\/--\n\/\/-- There are two modes of drawing the vector\n\/\/-- * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/-- to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/-- be 0 (l=0)\n\/\/-- * Mode 2: Give by direction and length\n\/\/-- A vector of length l pointing to the direction given by\n\/\/-- v is drawn\n\/\/---------------------------------------------------------------------------\n\/\/-- Parameters:\n\/\/-- v: Vector cartesian coordinates\n\/\/-- l: total vector length (line + arrow)\n\/\/-- l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/-- a visual reference of the rolling angle\n\/\/---------------------------------------------------------------------------\n\nmodule vector(v,l=0, l_arrow=4, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = [0,0,1];\n raxis = v_cross(vref,v);\n \n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n rotate(a=ang, v=raxis)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n else\n rotate(a=ang, v=raxis)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(\"Gray\") vector(unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\/\/ From Obiscad,\n\/\/ modified to take roll parameter as param in module instead of attachment points\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a, b, roll=0)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n\n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f4a068b439a3aa5e583d894f1b330972710f6628","subject":"\u043a\u043e\u043c\u0435\u043d\u0442","message":"\u043a\u043e\u043c\u0435\u043d\u0442","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/ADENIN.scad","new_file":"3D-models\/SCAD\/ADENIN.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=18.5; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, -1]) cube([42, 24, 9]); \/\/\u043a\u0443\u0431 \u0434\u043b\u044f \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n } \n } \n}\ndifference() {\n\n #translate([39, -9.5, -4.29]) cube([12.5, 19, 8.55]);\n rotate([0, 90, 0]) translate([0, -5, 47.12]) cylinder(5, 2.67, 2.67); \n rotate([0, 90, 0]) translate([0, 5, 47.12]) cylinder(5, 2.67, 2.67);\n }\n rotate([90, 0, 0]) translate([1.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n rotate([90, 0, 0]) translate([40.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=18.5; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([3, 0, 0]) cube ([x+7, y-2, z+1.55], center=true); \/\/\u0442\u0435\u043b\u043e \n rotate([180, 180, 0]) translate([41.2, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-24.9, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+8], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n translate([-10, -9.5, 2]) cube([50, 19, 5]);\n } \n\n }\n rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(6, 2.67, 2.67);\n #translate([-8.5, -12, -1]) cube([42, 24, 9]); \/\/space\n } \n } \n}\ndifference() {\n\n #translate([39, -9.5, -4.29]) cube([12.5, 19, 8.55]);\n rotate([0, 90, 0]) translate([0, -5, 47.12]) cylinder(5, 2.67, 2.67);\n rotate([0, 90, 0]) translate([0, 5, 47.12]) cylinder(5, 2.67, 2.67);\n }\n rotate([90, 0, 0]) translate([1.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n rotate([90, 0, 0]) translate([40.4, 0, -9.5]) cylinder(19, 4.29, 4.29);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, -1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, -1]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1a4758b4d8a8dff22814540538681fbebcb3c224","subject":"config\/zaxis: switch to LMH12L bearing","message":"config\/zaxis: switch to LMH12L bearing\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1.4;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = [\n [LinearBearingModel, \"PSM101612\"],\n [LinearBearingInnerDiameter, 10*mm],\n [LinearBearingOuterDiameter, 16*mm],\n [LinearBearingLength, 12*mm],\n];\nxaxis_bearing_bottom = [\n [LinearBearingModel, \"PSM101618\"],\n [LinearBearingInnerDiameter, 10*mm],\n [LinearBearingOuterDiameter, 16*mm],\n [LinearBearingLength, 18*mm],\n];\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\n\/*xaxis_endstop_type = \"SWITCH\"*\/\nxaxis_endstop_type = \"SN04\";\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1.4;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = [\n [LinearBearingModel, \"PSM101612\"],\n [LinearBearingInnerDiameter, 10*mm],\n [LinearBearingOuterDiameter, 16*mm],\n [LinearBearingLength, 12*mm],\n];\nxaxis_bearing_bottom = [\n [LinearBearingModel, \"PSM101618\"],\n [LinearBearingInnerDiameter, 10*mm],\n [LinearBearingOuterDiameter, 16*mm],\n [LinearBearingLength, 18*mm],\n];\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\n\/*xaxis_endstop_type = \"SWITCH\"*\/\nxaxis_endstop_type = \"SN04\";\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing= [\n [LinearBearingModel, \"PSM121818\"],\n [LinearBearingInnerDiameter, 12*mm],\n [LinearBearingOuterDiameter, 18*mm],\n [LinearBearingLength, 18*mm],\n];\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e2a797ce8f0803d9541c788a6b3058d39945b9b6","subject":"config: add show_vit entry","message":"config: add show_vit entry\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8a2130c74f91cf77ad561df1ab84a5909ccba2c5","subject":"Add camera supports, top cover, and wire opening.","message":"Add camera supports, top cover, and wire opening.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\nheight = 180; \/\/ z\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = 10;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ height of side supports\nside_support_height = height\/2; \/\/ full side walls\n\/\/side_support_height = 20;\n\n\/\/ amount faces extend past each other at corners\noverhang = 10;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ components to include (comment out unwanted)\nvert_faces();\nside_supports();\ntank_base();\nlight_bar();\ncamera_supports(x=width, y=depth\/2, z=height\/2, spacing=20);\ntop_cover();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_faces() {\n\tdifference() {\n\t\tunion() {\n\t\t\tvert_face(x=0);\n difference() {\n vert_face(x=width);\n camera_opening();\n camera_supports(x=width+10, y=depth\/2, z=height\/2+10, spacing=20);\n }\n\t\t}\n\t\tside_support_base(height_scale=0.5);\n\t\tside_support_top(height_scale=0.5);\n\t}\n}\n\nmodule vert_face(x) {\n\ttranslate([x-thickness\/2,-overhang,0])\n\t\tcube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, spacing) {\n camera_support(x, y + spacing\/2, z);\n camera_support(x, y - spacing\/2, z);\n}\n\nmodule camera_support(x, y, z) {\n inner_w = 20;\n inner_h = 30;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([thickness\/2,-outset,height-thickness])\n difference() {\n cube([width-thickness,depth+outset*2,thickness]);\n\t\tcutouts(5,width-thickness,outset,far_side=false);\n\t\tcutouts(5,width-thickness,outset,far_side=true);\n }\n}\n\nmodule tank_base() {\n\ttranslate([thickness,-outset,base_height])\n\tdifference() {\n\t\tcube([base_width, depth+outset*2, thickness]);\n\t\tcutouts(5,base_width,outset,far_side=false);\n cutouts(5,base_width,outset,far_side=true);\n\t}\n}\n\nmodule light_bar() {\n\ttranslate([light_pos_x-light_bar_width\/2, -outset, light_height])\n\tdifference() {\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\n cutouts(2,light_bar_width,outset,far_side=true);\n\t}\n}\n\nmodule cutouts(num, width, outset, far_side=false) {\n w = width \/ ((num-1) * 2);\n y = far_side ? depth+outset-thickness\/2 : 0;\n for (i = [0 : num-1]) {\n translate([-w\/2 + i*2*w, y, -epsilon])\n cube([w, outset+thickness\/2, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side_supports() {\n\tdifference() {\n\t\tunion() {\n\t\t\tside_support_base();\n\t\t\tside_support_top();\n\t\t}\n\t\tvert_faces();\n\t\ttank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n\t}\n}\n\nmodule side_support_top(height_scale=1) {\n\ttranslate([0,0,height])\n side_support_base(height_scale=-height_scale);\n}\n\nmodule side_support_base(height_scale=1) {\n\tscale([1,1,height_scale])\n\t\tunion() {\n\t\t\tside_support(y=0);\n\t\t\tside_support(y=depth);\n\t\t}\n}\n\nmodule side_support(y) {\n\ttranslate([-overhang,y-thickness\/2,0])\n\t\tcube([width+overhang*2, thickness, side_support_height]);\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\nheight = 180; \/\/ z\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = 10;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ height of side supports\nside_support_height = height\/2; \/\/ full side walls\n\/\/side_support_height = 20;\n\n\/\/ amount faces extend past each other at corners\noverhang = 10;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ components to include (comment out unwanted)\nvert_faces();\nside_supports();\ntank_base();\nlight_bar();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_faces() {\n\tdifference() {\n\t\tunion() {\n\t\t\tvert_face(x=0);\n\t\t\tvert_face(x=width);\n\t\t}\n\t\tside_support_base(height_scale=0.5);\n\t\tside_support_top(height_scale=0.5);\n\t}\n}\n\nmodule vert_face(x) {\n\ttranslate([x-thickness\/2,-overhang,0])\n\t\tcube([thickness,depth+overhang*2,height]);\n}\n\nmodule tank_base() {\n\ttranslate([thickness,-outset,base_height])\n\tdifference() {\n\t\tcube([base_width, depth+outset*2, thickness]);\n\t\tcutouts(5,base_width,outset,far_side=false);\n cutouts(5,base_width,outset,far_side=true);\n\t}\n}\n\nmodule light_bar() {\n\ttranslate([light_pos_x,-outset,light_height])\n\tdifference() {\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\n cutouts(2,light_bar_width,outset,far_side=true);\n\t}\n}\n\nmodule cutouts(num, width, outset, far_side=False) {\n w = width \/ ((num-1) * 2);\n y = far_side ? depth+outset-thickness\/2 : 0;\n for (i = [0 : num-1]) {\n translate([-w\/2 + i*2*w,y,0])\n cube([w, outset+thickness\/2, thickness]);\n }\n}\n\nmodule side_supports() {\n\tdifference() {\n\t\tunion() {\n\t\t\tside_support_base();\n\t\t\tside_support_top();\n\t\t}\n\t\tvert_faces();\n\t\ttank_base();\n light_bar();\n\t}\n}\n\nmodule side_support_top(height_scale=1) {\n\ttranslate([0,0,height])\n side_support_base(height_scale=-height_scale);\n}\n\nmodule side_support_base(height_scale=1) {\n\tscale([1,1,height_scale])\n\t\tunion() {\n\t\t\tside_support(y=0);\n\t\t\tside_support(y=depth);\n\t\t}\n}\n\nmodule side_support(y) {\n\ttranslate([-overhang,y-thickness\/2,0])\n\t\tcube([width+overhang*2, thickness, side_support_height]);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d908385a1a55bb869f9f7b8c688cded0d61a031f","subject":"added gantry plates","message":"added gantry plates\n","repos":"fponticelli\/smallbridges","old_file":"scad\/or_gantry_plate.scad","new_file":"scad\/or_gantry_plate.scad","new_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nor_gantry_plate_height=3.175;\r\n\r\nd71 = 7.1;\r\nd52 = 5.2;\r\n\r\ni100 = 10;\r\ni200 = 20;\r\ni223 = 22.3;\r\ni263 = 26.3;\r\ni300 = 30;\r\ni323 = 32.3;\r\ni350 = 35;\r\ni400 = 40;\r\ni423 = 42.3;\r\ni523 = 52.3;\r\ni550 = 55;\r\ni623 = 62.3;\r\n\r\nor_gantry_plate_holes = [\r\n\t[],\r\n\t[\r\n\t\t\/\/ 80x80\r\n\t\t[[-i223,0],d71],[[-i223,i223],d71],[[-i223,-i223],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i223,0],d52],[[i223,i223],d52],[[i223,-i223],d52],[[0,i223],d52],[[0,-i223],d52]\r\n\t], [\r\n\t\t\/\/ 100x120\r\n\t\t[[-i323,0],d71],\r\n\t\t[[-i223,i423],d71],[[-i323,i423],d71],[[-i223,-i423],d71],[[-i323,-i423],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,i100],d52],[[i200,-i100],d52],[[-i200,i100],d52],[[-i200,-i100],d52],\r\n\t\t[[i100,i200],d52],[[i100,-i200],d52],[[-i100,i200],d52],[[-i100,-i200],d52],\r\n\t\t[[i100,i300],d52],[[i100,-i300],d52],[[-i100,i300],d52],[[-i100,-i300],d52],\r\n\t\t[[i323,0],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[0,i423],d52],[[0,-i423],d52],[[i100,i423],d52],[[i100,-i423],d52],[[-i100,i423],d52],[[-i100,-i423],d52],\r\n\t\t[[i223,i423],d52],[[i323,i423],d52],[[i223,-i423],d52],[[i323,-i423],d52]\r\n\t], [\r\n\t\t\/\/ 120x140\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,0],d52],[[i300,0],d52],[[-i200,0],d52],[[-i300,0],d52],\r\n\t\t[[0,i200],d52],[[0,i300],d52],[[0,-i200],d52],[[0,-i300],d52],\r\n\t\t[[i200,i300],d52],[[i200,-i300],d52],[[-i200,i300],d52],[[-i200,-i300],d52],\r\n\t\t[[i300,i200],d52],[[i300,-i200],d52],[[-i300,i200],d52],[[-i300,-i200],d52],\r\n\r\n\t\t[[i400,0],d52],[[i423,i100],d52],[[i423,-i100],d52],\r\n\t\t[[i400,i263],d52],[[i400,-i263],d52],\r\n\r\n\t\t[[-i400,0],d71],[[-i423,i100],d52],[[-i423,-i100],d52],\r\n\t\t[[-i400,i263],d71],[[-i400,-i263],d71],\r\n\t\t[[0,i523],d52],[[i100,i523],d52],[[i223,i523],d52],[[i323,i523],d52],[[i423,i523],d52],\r\n\t\t[[0,-i523],d52],[[i100,-i523],d52],[[i223,-i523],d52],[[i323,-i523],d52],[[i423,-i523],d52],\r\n\t\t[[0,i523],d52],[[-i100,i523],d52],[[-i223,i523],d71],[[-i323,i523],d71],[[-i423,i523],d71],\r\n\t\t[[0,-i523],d52],[[-i100,-i523],d52],[[-i223,-i523],d71],[[-i323,-i523],d71],[[-i423,-i523],d71]\r\n\t], [\r\n\t\t\/\/ 140x160\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i300,0],d52],[[0,i300],d52],[[-i300,0],d52],[[0,-i300],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[i100,i400],d52],[[i100,-i400],d52],[[-i100,i400],d52],[[-i100,-i400],d52],\r\n\t\t[[i300,i400],d52],[[i300,-i400],d52],[[-i300,i400],d52],[[-i300,-i400],d52],\r\n\t\t[[i400,i300],d52],[[i400,-i300],d52],[[-i400,i300],d52],[[-i400,-i300],d52],\r\n\t\t[[i100,i550],d52],[[i100,-i550],d52],[[-i100,i550],d52],[[-i100,-i550],d52],\r\n\t\t[[i523,0],d52],[[-i523,0],d71],\r\n\t\t[[i523,i350],d52],[[-i523,i350],d71],[[i523,-i350],d52],[[-i523,-i350],d71],\r\n\t\t[[0,i623],d52],[[i100,i623],d52],[[i223,i623],d52],[[i323,i623],d52],[[i423,i623],d52],[[i523,i623],d52],[[-i100,i623],d52],[[-i223,i623],d71],[[-i323,i623],d71],[[-i423,i623],d71],[[-i523,i623],d71],\r\n\t\t[[0,-i623],d52],[[i100,-i623],d52],[[i223,-i623],d52],[[i323,-i623],d52],[[i423,-i623],d52],[[i523,-i623],d52],[[-i100,-i623],d52],[[-i223,-i623],d71],[[-i323,-i623],d71],[[-i423,-i623],d71],[[-i523,-i623],d71]\r\n\t]\r\n];\r\n\r\nmodule or_gantry_plate(mod = 1) {\r\n\t$fn=50;\r\n\tr=10;\r\n\tw=80;\r\n\th=80;\r\n\tsizes=[[-1,-1],[80,80],[100,120],[120,140],[140,160]];\r\n\tmw = sizes[mod][0];\r\n\tmh = sizes[mod][1];\r\n\r\n\tbom(str(\"ORGP_\",mod), str(\"OpenRail Gantry Plate: \", mw, \"x\", mh, \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack)\r\n\t\trotate([0,0,90]) difference() {\r\n\t\t\thull()\r\n\t\t\t\tfor(x = [-1,1], y = [-1,1])\r\n\t\t\t\t\ttranslate([x*(mw\/2-10),y*(mh\/2-10),-or_gantry_plate_height\/2])\r\n\t\t\t\t\t\tcylinder(r=r,h=or_gantry_plate_height);\r\n\t\t\ttranslate([0,0,-or_gantry_plate_height]) {\r\n\t\t\t\tfor(p = or_gantry_plate_holes[mod])\r\n\t\t\t\t\ttranslate (p[0])\r\n\t\t\t\t\t\tcylinder(r=p[1]\/2,h=or_gantry_plate_height*2);\r\n\t\t\t}\r\n\t\t}\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/or_gantry_plate.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"d84fbf86e22b1f196ac2a23e2983dffd953b965a","subject":"Quick model of a bunch of murata piezo speakers\/diaphrams\/sounders.","message":"Quick model of a bunch of murata piezo speakers\/diaphrams\/sounders.\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/murata-piezos.scad","new_file":"hardware\/vitamins\/murata-piezos.scad","new_contents":"$fs=0.1;\n\nmurata_PKM12EPYH4002_B0();\n\n\/\/ page 7: diaphram, external drive type\nmodule murata_7BB_12_9 () {murata_7series(12.0, 9.0, 8.0, 0.22, 0.10);} \/\/ Brass\nmodule murata_7BB_15_6 () {murata_7series(15.0, 10.0, 9.0, 0.22, 0.10);} \/\/ Brass\nmodule murata_7BB_20_3 () {murata_7series(20.0, 14.0, 12.8, 0.22, 0.10);} \/\/ Brass\nmodule murata_7BB_20_6 () {murata_7series(20.0, 14.0, 12.8, 0.42, 0.20);} \/\/ Brass\nmodule murata_7BB_20_6L0() {murata_7series(20.0, 14.0, 12.8, 0.42, 0.20);} \/\/ Brass (with Lead Wire: AWG32 Length 50mm)\nmodule murata_7BB_27_4 () {murata_7series(27.0, 19.7, 18.2, 0.54, 0.30);} \/\/ Brass\nmodule murata_7BB_27_4L0() {murata_7series(27.0, 19.7, 18.2, 0.54, 0.30);} \/\/ Brass (with Lead Wire:AWG32 Length 50mm)\nmodule murata_7BB_35_3 () {murata_7series(35.0, 25.0, 23.0, 0.53, 0.30);} \/\/ Brass\nmodule murata_7BB_35_3L0() {murata_7series(35.0, 25.0, 23.0, 0.53, 0.30);} \/\/ Brass (with Lead Wire:AWG32 Length 50mm)\nmodule murata_7BB_41_2 () {murata_7series(41.0, 25.0, 23.0, 0.63, 0.40);} \/\/ Brass\nmodule murata_7BB_41_2L0() {murata_7series(41.0, 25.0, 23.0, 0.63, 0.40);} \/\/ Brass (with Lead Wire:AWG32 Length 50mm)\nmodule murata_7NB_31R2_1() {murata_7series(31.2, 19.7, 18.2, 0.22, 0.10);} \/\/ Iron Nickel Alloy\n\n\/\/ page 8: diaphram, self drive type\nmodule murata_7BB_20_6C() {murata_7series(20.0, 14.0, 12.8, 0.42, 0.20);} \/\/ Brass\nmodule murata_7BB_20_6CL0() {murata_7series(20.0, 14.0, 12.8, 0.42, 0.20);} \/\/ Brass (with Lead Wire: AWG32 Length 50mm)\nmodule murata_7BB_27_4C() {murata_7series(27.0, 19.7, 18.2, 0.54, 0.30);} \/\/ Brass\nmodule murata_7BB_27_4CL0() {murata_7series(27.0, 19.7, 18.2, 0.54, 0.30);} \/\/ Brass (with Lead Wire: AWG32 Length 50mm)\nmodule murata_7BB_35_3C() {murata_7series(35.0, 25.0, 23.0, 0.53, 0.30);} \/\/ Brass\nmodule murata_7BB_35_3CL0() {murata_7series(35.0, 25.0, 23.0, 0.53, 0.30);} \/\/ Brass (with Lead Wire:AWG32 Length 50mm)\nmodule murata_7BB_41_2C() {murata_7series(41.0, 25.0, 23.0, 0.63, 0.40);} \/\/ Brass\nmodule murata_7BB_41_2CL0() {murata_7series(41.0, 25.0, 23.0, 0.63, 0.40);} \/\/ Brass (with Lead Wire: AWG32 Length 50mm)\nmodule murata_7SB_34R7_3C() {murata_7series(34.7, 25.0, 23.4, 0.50, 0.25);} \/\/ Stainless\n\n\/\/ names are from http:\/\/docs-europe.electrocomponents.com\/webdocs\/0873\/0900766b808736e6.pdf page 7\n\/\/ D: plate size diameter (of lower bit)\n\/\/ a: element size (thin plastic bit between the two metalic bits)\n\/\/ b: electrode size (top metal bit)\n\/\/ T: thickness (overall)\n\/\/ t: plate thickness (top -- unclear if includes electrode)\nmodule murata_7series(D, a, b, T, t) {\n plate_thick = t;\n element_thick = (T-t)\/2;\n electrode_thick = (T-t)\/2;\n cylinder(r=D\/2, h=plate_thick);\n translate([0, 0, plate_thick])\n cylinder(r=a\/2, h=element_thick);\n translate([0, 0, plate_thick+element_thick])\n cylinder(r=b\/2, h=plate_thick);\n}\n\n\n\n\/\/ page 10: sounders, external drive, pin type\n\/\/ These, somewhat oddly, don't have named parameters, just diagrams for each one, so the \n\/\/ parameter names here are my own invention.\nmodule murata_PKM12EPYH4002_B0() {\n murata_PKM_cyl_type(od = 12.6, height_to_pcb = 6.9, height_gap = 0.9, lead_sep = 5.0, lead_dia = 0.5, lead_top_dia = 2.5, lead_len = 3.5, nub_dia = 1, nub_sep = 7.5);\n}\n\nmodule murata_PKM17EPP_2002_B0() {\n murata_PKM_cyl_type(od = 17.0, height_to_pcb = 8.6, height_gap = 1.2, lead_sep = 10.0, lead_dia = 0.5, lead_top_dia = 3.5, lead_len = 3.5, nub_dia = 1.2, nub_sep = 11);\n}\n\n\n\nmodule murata_PKM_cyl_type(od, height_to_pcb, height_gap, lead_sep, lead_dia, lead_top_dia, lead_len, nub_dia, nub_sep) {\n translate([0, 0, height_gap])\n cylinder(r=od\/2, h=height_to_pcb-height_gap);\n\n \/\/ leads\n for (side=[-1, 1]) {\n translate([side * lead_sep\/2, 0, 0]) {\n translate([0, 0, -lead_len+height_gap])\n cylinder(r=lead_dia\/2, h=lead_len);\n cylinder(r=lead_top_dia\/2, h=height_gap);\n }\n }\n\n \/\/ nubs\n for (side=[-1, 1]) {\n translate([0, side * nub_sep\/2, 0]) {\n cylinder(r=nub_dia\/2, h=height_gap);\n }\n }\n}\n\nmurata_PKM12EPYH4002_B0();","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/vitamins\/murata-piezos.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"2cfe58bc9e3a0b3096be632dc03da42c4d2f85a2","subject":"Update static\/vendors\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","message":"Update static\/vendors\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad\n\nSigned-off-by: Bernard Ojengwa \n","repos":"apipanda\/openssl,apipanda\/openssl,apipanda\/openssl,apipanda\/openssl","old_file":"static\/vendors\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","new_file":"static\/vendors\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","new_contents":"\/\/ ace can highlight scad!\nmodule Element(xpos, ypos, zpos){\n\ttranslate([xpos,ypos,zpos]){\n\t\tunion(){\n\t\t\tcube([10,10,4],true);\n\t\t\tcylinder(10,15,5);\n\t\t\ttranslate([0,0,10])sphere(5);\n\t\t}\n\t}\n}\n\nunion(){\n\tfor(i=[0:30]){\n\t\t# Element(0,0,0);\n\t\tElement(15*i,0,0);\n\t}\n}\n\nfor (i = [3, 5, 7, 11]){\n\trotate([i*10,0,0])scale([1,1,i])cube(10);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'static\/vendors\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a995f0f0989b46a5738877feba7530662cd2221f","subject":"Adjust base depth Fix warning message","message":"Adjust base depth\nFix warning message\n","repos":"mbouyer\/marine_chartplotter,mbouyer\/marine_chartplotter,mbouyer\/marine_chartplotter,mbouyer\/marine_chartplotter","old_file":"hardware\/CAD\/cover-wp11.scad","new_file":"hardware\/CAD\/cover-wp11.scad","new_contents":"$fn=100;\nlongueur = 150.5;\nlargeur = 110.5;\nhauteur = 42;\nrayon = 20;\nbase_ep = 1.5;\nmurs_ep = 1.5;\n\nlongueur_e = longueur+murs_ep*2;\nlargeur_e = largeur+murs_ep*2;\nrayon_e = rayon + murs_ep;\n\nlongueur_c = longueur \/ 2 - rayon;\nlargeur_c = largeur \/ 2 - rayon;\n\nconge = murs_ep * 2;\n\nmodule quart_tore() {\n\trotate_extrude(angle = 90, convexity=10) translate([rayon, 0, 0])\n\t difference() {\n\t\ttranslate([-conge\/2, conge\/2, 0]) square([conge, conge], center=true);\n\t\ttranslate([-conge, conge, 0]) circle(r=conge, $fn=500);\n\t };\n}\n\nmodule quart_rond(l) {\n\tdifference() {\n\t\ttranslate([-conge\/2, -conge\/2, 0]) cube([conge, conge, l], center=true);\n\t\ttranslate([-conge, -conge, 0]) cylinder(r=conge, h=l, center=true, $fn=500);\n\t}\n}\n\nmodule quart_tube() {\n\tintersection() {\n\t\tdifference() {\n\t\t\tcylinder(r = rayon_e, h = hauteur, center=true, $fn = 500);\n\t\t\tcylinder(r = rayon - 0.001, h = hauteur, center=true, $fn = 500);\n\t\t};\n\t\ttranslate([rayon_e\/2, rayon_e\/2, 0]) cube([rayon_e, rayon_e, hauteur], center=true);\n\t};\n}\n\nmodule base () {\n\tunion() {\n\t\tdifference() {\n\t\t\tcube([longueur_e, largeur_e, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t} ;\n\t\ttranslate([longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([-longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([-longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\n\t};\n}\n\nmodule murs() {\n\ttranslate([0,0,base_ep\/2 + hauteur\/2]) union() {\n\t\ttranslate([(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep + 0.0001, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([-(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep + 0.0001, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([0, (largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep + 0.0001, hauteur], center = true);\n\t\ttranslate([0, -(largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep + 0.0001, hauteur], center = true);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tube();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tube();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tube();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tube();\n\t};\n}\n\nmodule conges() {\n\ttranslate([0,0,base_ep]) union() {\n\t\ttranslate([longueur\/2, 0, 0]) rotate([90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([-longueur\/2, 0, 0]) rotate([-90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([0, largeur\/2, 0]) rotate([0,90,0]) quart_rond(longueur-rayon*2);\n\t\ttranslate([0, -largeur\/2, 0]) rotate([90,90,-90]) quart_rond(longueur-rayon*2);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tore();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tore();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tore();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tore();\n\t};\n}\n\nmodule all() {\n\tunion() {\n\t\tbase();\n\t\tmurs();\n\t\tconges();\n\n\t};\n}\n\nall();\n\n\/\/ difference() {\n\/\/ \tall ();\n\/\/ \tcube([longueur+10, largeur+10, (hauteur-5) * 2], center=true);\n\/\/ }\n\/\/ projection(cut=true) translate([0,0, -(base_ep+conge+0.1)]) all();\n","old_contents":"$fn=100;\nlongueur = 150.5;\nlargeur = 110.5;\nhauteur = 42;\nrayon = 20;\nbase_ep = 2;\nmurs_ep = 1.5;\n\nlongueur_e = longueur+murs_ep*2;\nlargeur_e = largeur+murs_ep*2;\nrayon_e = rayon + murs_ep;\n\nlongueur_c = longueur \/ 2 - rayon;\nlargeur_c = largeur \/ 2 - rayon;\n\nconge = murs_ep * 2;\n\nmodule quart_tore() {\n\trotate_extrude(angle = 90, convexity=10) translate([rayon, 0, 0])\n\t difference() {\n\t\ttranslate([-conge\/2, conge\/2, 0]) square([conge, conge], center=true);\n\t\ttranslate([-conge, conge, 0]) circle(r=conge, $fn=500);\n\t };\n}\n\nmodule quart_rond(l) {\n\tdifference() {\n\t\ttranslate([-conge\/2, -conge\/2, 0]) cube([conge, conge, l], center=true);\n\t\ttranslate([-conge, -conge, 0]) cylinder(r=conge, h=l, center=true, $fn=500);\n\t}\n}\n\nmodule quart_tube() {\n\tintersection() {\n\t\tdifference() {\n\t\t\tcylinder(r = rayon_e, h = hauteur, center=true, $fn = 500);\n\t\t\tcylinder(r = rayon, h = hauteur, center=true, $fn = 500);\n\t\t};\n\t\ttranslate([rayon_e\/2, rayon_e\/2, 0]) cube([rayon_e, rayon_e, hauteur], center=true);\n\t};\n}\n\nmodule base () {\n\tunion() {\n\t\tdifference() {\n\t\t\tcube([longueur_e, largeur_e, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t} ;\n\t\ttranslate([longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true);\n\t\ttranslate([-longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true);\n\t\ttranslate([-longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true);\n\t\ttranslate([longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true);\n\n\t};\n}\n\nmodule murs() {\n\ttranslate([0,0,base_ep\/2 + hauteur\/2]) union() {\n\t\ttranslate([(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([-(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([0, (largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep, hauteur], center = true);\n\t\ttranslate([0, -(largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep, hauteur], center = true);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tube();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tube();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tube();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tube();\n\t};\n}\n\nmodule conges() {\n\ttranslate([0,0,base_ep]) union() {\n\t\ttranslate([longueur\/2, 0, 0]) rotate([90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([-longueur\/2, 0, 0]) rotate([-90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([0, largeur\/2, 0]) rotate([0,90,0]) quart_rond(longueur-rayon*2);\n\t\ttranslate([0, -largeur\/2, 0]) rotate([90,90,-90]) quart_rond(longueur-rayon*2);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tore();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tore();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tore();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tore();\n\t};\n}\n\nmodule all() {\n\tunion() {\n\t\tbase();\n\t\tmurs();\n\t\tconges();\n\n\t};\n}\n\nall();\n\n\/\/ difference() {\n\/\/ \tall ();\n\/\/ \tcube([longueur+10, largeur+10, (hauteur-5) * 2], center=true);\n\/\/ }\n\/\/ projection(cut=true) translate([0,0, -(base_ep+conge+0.1)]) all();\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"0f6c83adc2de92f3376665cc61418cabe7547fb6","subject":"screws\/head_cut: don't cut head for set screw","message":"screws\/head_cut: don't cut head for set screw\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"78a551285ee6848ba28b5a3b52e15a104fa3279e","subject":"shaper: rewrite to avoid v_fallback (gives warnings in new openscad)","message":"shaper: rewrite to avoid v_fallback (gives warnings in new openscad)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n \/*extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);*\/\n extra_d_ = !is_undef(extra_d)?extra_d:!is_undef(extra_r)?extra_r*2:0;\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n \/*d1_ = v_fallback(d1, [r*2, r1*2]);*\/\n d1_ = !is_undef(d1)?d1:!is_undef(r)?r*2:!is_undef(r1)?r1*2:U;\n \/*d2_ = v_fallback(d2, [r*2, r2*2]);*\/\n d2_ = !is_undef(d2)?d2:!is_undef(r)?r*2:!is_undef(r2)?r2*2:U;\n\n \/*r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);*\/\n r1_ = !is_undef(r1)?r1:!is_undef(d1_)?d1_\/2:!is_undef(d)?d\/2:r;\n \/*r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);*\/\n r2_ = !is_undef(r2)?r2:!is_undef(d2_)?d2_\/2:!is_undef(d)?d\/2:r;\n\n \/*r_max = v_fallback(r, [max(r1_,r2_)]);*\/\n r_max = !is_undef(r)?r:max(r1_,r2_);\n\n \/*extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);*\/\n extra_r_ = !is_undef(extra_r)?extra_r:!is_undef(extra_d)?extra_d\/2:0;\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n\n \/*d1_ = v_fallback(d1, [r*2, r1*2]);*\/\n d1_ = !is_undef(d1)?d1:!is_undef(r)?r*2:!is_undef(r1)?r1*2:U;\n \/*d2_ = v_fallback(d2, [r*2, r2*2]);*\/\n d2_ = !is_undef(d2)?d2:!is_undef(r)?r*2:!is_undef(r2)?r2*2:U;\n\n \/*r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);*\/\n r1_ = !is_undef(r1)?r1:!is_undef(d1_)?d1_\/2:!is_undef(d)?d\/2:r;\n \/*r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);*\/\n r2_ = !is_undef(r2)?r2:!is_undef(d2_)?d2_\/2:!is_undef(d)?d\/2:r;\n\n \/*r_max = v_fallback(r, [max(r1_,r2_)]);*\/\n r_max = !is_undef(r)?r:max(r1_,r2_);\n\n \/*extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);*\/\n extra_r_ = !is_undef(extra_r)?extra_r:!is_undef(extra_d)?extra_d\/2:0;\n\n h_ = h+extra_h;\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fa=$fa) = [for (i=[0:fa-1]) [r*sin(i*360\/fa), r*cos(i*360\/fa)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(1)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n \/*r_= v_fallback(r, [d\/2]);*\/\n r_= !is_undef(r)?r:d\/2;\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fa=$fa) = [for (i=[0:fa-1]) [r*sin(i*360\/fa), r*cos(i*360\/fa)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(1)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e9bdb2154b5e5b92a7449bf695712dcc067bb5b7","subject":"shapes: minor cleanup","message":"shapes: minor cleanup\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extra_size, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extra_size, round_r=round_r);\n }\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n \/*cube(size=size, center=true);*\/\n sphere(d=d_+extra_d_, center=true);\n }\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a7d0def06c6531cb21de74a275d28a0771bf0047","subject":"shapes\/cylindera+teardrop: use v_fallback","message":"shapes\/cylindera+teardrop: use v_fallback\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n size_align(size=[sizexy,sizexy,h], extra_size=[extra_sizexy, extra_sizexy, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_=d==undef?r:d\/2;\n d_=r==undef?d:r*2;\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0eb2e0ebc2d315a8b48dc20dc05a07620c971518","subject":"x\/carriage\/extruder\/guidler: tweak port hole","message":"x\/carriage\/extruder\/guidler: tweak port hole\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6ec74dac9bcdea3cb4a551292bfa8212dea086f7","subject":"x\/carriage: Tweak extruder b body size (bearing pos was wrong)","message":"x\/carriage: Tweak extruder b body size (bearing pos was wrong)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"05d2bab61870ff73019c6c0b9b68aa187971216d","subject":"cable support elements","message":"cable support elements\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"cable_support\/cable_support.scad","new_file":"cable_support\/cable_support.scad","new_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[0:2])\n translate([0, i*12, 0])\n element();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cable_support\/cable_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b1173170098cd83e62139e348e90d0ab19eff1a9","subject":"Added Tibia.","message":"Added Tibia.\n\nSigned-off-by: Thomas Helmke ","repos":"Syralist\/yet-another-hexapod,Syralist\/yet-another-hexapod","old_file":"hexacad\/leg-parts.scad","new_file":"hexacad\/leg-parts.scad","new_contents":"use \r\nuse \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\nmodule legconture()\r\n{\r\n\twall = 5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurbase();\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,20,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-60,20,-2])\r\n\t\t\t\trotate([0,0,-3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,99,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-40,-20,-2])\r\n\t\t\t\trotate([0,0,3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule femur()\r\n{\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tdifference()\r\n\t{\r\n\t\tlegconture();\r\n\t\ttranslate([-16,radiuswheel+5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,radiuswheel+5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n}\r\n\r\nmodule tibia()\r\n{\r\n\twall = 5;\r\n\tservowidth = 20;\r\n\tservolength = 41;\r\n\tdifference()\r\n\t{\r\n\t\tlegconture();\r\n\t\ttranslate([-11-servowidth\/2,120-servolength-12,-2])\r\n\t\t\trotate([0,0,7])\r\n\t\t\t\tcube([servowidth, servolength, wall+4]);\r\n\t}\r\n}\r\n\r\n\r\n\/\/coxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();\r\n\/\/projection(cut=true)\r\n\/\/femur();\r\ntibia();\r\n\r\n","old_contents":"use \r\nuse \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\nmodule femurconture()\r\n{\r\n\twall = 5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurbase();\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,20,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-60,20,-2])\r\n\t\t\t\trotate([0,0,-3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tfemurbase();\r\n\t\t\ttranslate([-15,99,-2])\r\n\t\t\t\tcylinder(r=20.5,h=wall+4);\r\n\t\t\ttranslate([-40,-20,-2])\r\n\t\t\t\trotate([0,0,3.5])\r\n\t\t\t\t\tcube([70,120,wall+4]);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule femur()\r\n{\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tdifference()\r\n\t{\r\n\t\tfemurconture();\r\n\t\ttranslate([-16,radiuswheel+5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,radiuswheel+5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,0])\r\n\t\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([-16,120-radiuswheel-5,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n}\r\n\r\n\r\n\/\/coxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();\r\nprojection(cut=true)\r\nfemur();\r\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6663aaf17b56f45af4f9cc40fab2b2716fd99f2b","subject":"x\/carriage: use\/fix use of improved bearing mount module","message":"x\/carriage: use\/fix use of improved bearing mount module\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n translate(-h*Y)\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n screw_cut(nut=motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n \/*x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);*\/\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n {\n translate([\n x,\n xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n linear_bearing_mount(bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X);\n }\n }\n\n \/\/ bearing mount top cutout\n translate([0,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n cubea([1000,xaxis_bearing_top_OD\/2+10,xaxis_bearing_top_OD+1*mm], align=Y);\n\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n {\n translate([\n x,\n xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n linear_bearing_mount(bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X);\n }\n }\n\n \/\/ bearing mount bottom cutout\n translate([0,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n cubea([1000,xaxis_bearing_bottom_OD\/2+10,xaxis_bearing_bottom_OD+1*mm], align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n translate(-h*Y)\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n screw_cut(nut=motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n \/*x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);*\/\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a1befbb4347abbfa6f59c135f4acdc77f2a5d750","subject":"Finished with this mofo","message":"Finished with this mofo\n","repos":"agupta231\/fractal_prints","old_file":"infinite_shelves.scad","new_file":"infinite_shelves.scad","new_contents":"\/\/ www.github.com\/agupta231\n\n\/\/ user set variables\ninitial_side_length = 100;\ninitial_side_height = 100;\npadding_ratio = .07;\n\nknob_ratio = .2;\n\nmax_iterations = 3;\n\ntop_opening_ratio = .3;\nbottom_opening_ratio = .8;\n\necho(version());\n\nmodule shelf(length, depth, height) {\n union() {\n difference() {\n cube([length, depth, height], center = true);\n\n translate([0, 0, length * padding_ratio]) {\n cube([(1 - padding_ratio) * length, depth - length * padding_ratio, height], center = true);\n }\n }\n\n translate([0, (1 + knob_ratio \/ 2) * depth \/ 2 ,0])\n cube([length * knob_ratio, depth * knob_ratio \/ 2, height * knob_ratio], center = true);\n }\n}\n\nmodule pattern(current_iteration, starting_pos, length, height) {\n len_padding = length * padding_ratio;\n height_padding = height * padding_ratio;\n\n length_new = length - 2 * len_padding;\n height_new = (height - 3 * height_padding) \/ 2;\n\n if(current_iteration % 2 == 0) {\n translate(starting_pos + [0, (length_new * top_opening_ratio) \/ 2, (height_new + height_padding) \/ 2]) {\n shelf(length_new, length_new * top_opening_ratio, height_new);\n }\n\n translate(starting_pos + [0, (length_new * bottom_opening_ratio) \/ 2, -(height_new + height_padding) \/ 2]) {\n shelf(length_new, length_new * bottom_opening_ratio, height_new);\n }\n\n if(current_iteration < max_iterations) {\n new_pos = starting_pos + [length_new \/ 2, length_new * bottom_opening_ratio \/ 2, -(height_new + height_padding) \/ 2];\n\n pattern(current_iteration + 1, new_pos, length_new * bottom_opening_ratio, height_new);\n }\n }\n else if(current_iteration % 2 == 1) {\n translate(starting_pos + [(length_new * top_opening_ratio) \/ 2, 0, (height_new + height_padding) \/ 2]) {\n rotate([0, 0, -90]) {\n shelf(length_new, length_new * top_opening_ratio, height_new);\n }\n }\n\n translate(starting_pos + [(length_new * bottom_opening_ratio) \/ 2, 0, -(height_new + height_padding) \/ 2]) {\n rotate([0, 0, -90]) {\n shelf(length_new, length_new * bottom_opening_ratio, height_new);\n }\n }\n\n if(current_iteration < max_iterations) {\n new_pos = starting_pos + [length_new * bottom_opening_ratio \/ 2, length_new \/ 2, -(height_new + height_padding) \/ 2];\n\n pattern(current_iteration + 1, new_pos, length_new * bottom_opening_ratio, height_new);\n }\n }\n}\n\nshelf(initial_side_length, initial_side_length * bottom_opening_ratio, initial_side_height);\n\npattern(1, [initial_side_length \/ 2, 0, 0], initial_side_length * bottom_opening_ratio, initial_side_height);\n","old_contents":"\/\/ www.github.com\/agupta231\n\n\/\/ user set variables\ninitial_side_length = 100;\ninitial_side_height = 30;\npadding_ratio = .07;\n\nknob_ratio = .2;\n\nmax_iterations = 3;\n\ntop_opening_ratio = .3;\nbottom_opening_ratio = .7;\n\necho(version());\n\nmodule shelf(length, depth, height) {\n difference() {\n cube([length, depth, height], center = true);\n\n translate([0, 0, length * padding_ratio]) {\n cube([(1 - padding_ratio) * length, depth - length * padding_ratio, height], center = true);\n }\n }\n\n translate([0, (1 + knob_ratio \/ 2) * depth \/ 2 ,0])\n cube([length * knob_ratio, depth * knob_ratio \/ 2, height * knob_ratio], center = true);\n}\n\nmodule pattern(current_iteration, starting_pos, length, depth, height) {\n len_padding = length * padding_ratio;\n height_padding = height * padding_ratio;\n\n length_new = length \/ 2 - len_padding;\n height_new = (height - 3 * height_padding) \/ 2;\n\n echo(height);\n echo(height_new);\n\n if(current_iteration % 2 == 0) {\n echo(starting_pos + [0, depth \/ 2, 0]);\n\n translate(starting_pos + [0, (length_new * top_opening_ratio) \/ 2, (height_new + 3\/2 * height_padding) \/ 2]) {\n shelf(length_new, length_new * top_opening_ratio, height_new);\n }\n\n translate(starting_pos + [0, (length_new * bottom_opening_ratio) \/ 2, -(height_new + 3\/2 * height_padding) \/ 2]) {\n shelf(length_new, length_new * bottom_opening_ratio, height_new);\n }\n }\n else if(current_iteration % 2 == 1) {\n\n }\n}\n\n#shelf(initial_side_length, initial_side_length * bottom_opening_ratio, initial_side_height);\n\npattern(0, [0, 35, 0], initial_side_length, initial_side_length, initial_side_height);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"53a1b943db3b31e4fd33cb4d10e0f9d6a2e68dde","subject":"x\/ends: tweak motor screws inset (1mm)","message":"x\/ends: tweak motor screws inset (1mm)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"171496f9a3909aa5e76beed825281da411b561d1","subject":"lcd2004: define part","message":"lcd2004: define part\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"lcd2004.scad","new_file":"lcd2004.scad","new_contents":"use \nuse \ninclude \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror([0,1,0])\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=[0,0,1]);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=[0,0,1]);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=[0,0,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=[0,0,1], align=[0,0,0])\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=[0,0,1], align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s, rounding_radius=3);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=[0,0,1], orient=[0,0,1]);\n }\n}\n\nlcd2004_offset = [0, -34.2*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=[0,0,1], align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=[0,0,1], align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\nmodule part_lcd2004_mount()\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\nif(false)\n{\n mount_lcd2004(show_gantry=true);\n}\n","old_contents":"use \nuse \ninclude \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror([0,1,0])\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=[0,0,1]);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=[0,0,1]);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=[0,0,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=[0,0,1]);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=[0,0,1], align=[0,0,0])\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=[0,0,1], align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s, rounding_radius=3);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=[0,0,1], orient=[0,0,1]);\n }\n}\n\nlcd2004_offset = [0, -34.2*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=[0,0,1], align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=[0,0,1], align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\n\/*$show_vit=true;*\/\n\n\/*if(false)*\/\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\nif(false)\n{\n mount_lcd2004(show_gantry=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ef8fcb77829414496fd99b3c38ba89ade52a6d62","subject":"Temporairly hack into main model","message":"Temporairly hack into main model\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-45, 16, 8],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[45, 16, 8],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false, Shell=true ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies\" ) {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\t\t\t\tattach(DefConUp, DefConUp, ExplodeSpacing=20)\n\t\t\t\t\tfor (x=[0,1], y=[0,1])\n\t\t\t\t\t\tmirror([0,y,0])\n\t\t\t\t\t\tmirror([x,0,0])\n\t\t\t\t\t\ttranslate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -17 ])\n\t\t\t\t\t\trotate([0,0,-45])\n\t\t\t\t\t\ttranslate([9,8,5]) {\n\t\t\t\t\t\t\trotate(a=180, v=[0,0,1]) {\n\t\t\t\t\t\t\tMicroSwitchHolder_STL();\n\n\t\t\t\t\t\t\ttranslate([12.7, 5.3, 3 + 3])\n\t\t\t\t\t\t\tmirror([0,1,0])\n\t\t\t\t\t\t\t\tMicroSwitch();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\tfor (i=[0,1])\n\t\t\t\tmirror([0,i,0])\n\t\t\t\ttranslate([0,0,-10])\n\t\t\t\t\tBumper_STL();\n }\n\n step(3, \"Push the two motor drivers onto the mounting posts\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \/\/ Left Motor Driver\n attach(LogoBot_Con_LeftMotorDriver, ULN2003DriverBoard_Con_UpperLeft, ExplodeSpacing=20)\n ULN2003DriverBoard();\n\n \/\/ Right Motor Driver\n attach(LogoBot_Con_RightMotorDriver, ULN2003DriverBoard_Con_UpperRight, ExplodeSpacing=20)\n ULN2003DriverBoard();\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=6, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=10, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ Power Switch\n step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ LED\n step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ Piezo\n step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n step(10, \"Push the caster assembly into the base so that it snaps into place\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n }\n\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n \/\/ TODO: wrap into a PenLift sub-assembly\n step(11, \"Fit the pen lift assembly\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n MicroServo();\n }\n }\n\n\n \/\/ Shell + fixings\n\t\t\tif (Shell) {\n\t\t\t\tstep(PenLift ? 12 : 11,\n\t\t\t\t\t\"Push the shell down onto the base and twist to lock into place\") {\n\t\t\t\t\tview(t=[11,-23,65], r=[66,0,217], d=1171);\n\n\t\t\t\t\tattach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t\t\t\t\t\tBasicShell_STL();\n\t\t\t\t}\n }\n }\n\n\t}\n}\n","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-45, 16, 8],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[45, 16, 8],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false, Shell=true ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies\" ) {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n attach(DefConUp, DefConUp, ExplodeSpacing=20)\n for (x=[0,1], y=[0,1])\n mirror([0,y,0])\n mirror([x,0,0])\n translate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n rotate([0,0,-30])\n MicroSwitch();\n }\n\n step(3, \"Push the two motor drivers onto the mounting posts\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \/\/ Left Motor Driver\n attach(LogoBot_Con_LeftMotorDriver, ULN2003DriverBoard_Con_UpperLeft, ExplodeSpacing=20)\n ULN2003DriverBoard();\n\n \/\/ Right Motor Driver\n attach(LogoBot_Con_RightMotorDriver, ULN2003DriverBoard_Con_UpperRight, ExplodeSpacing=20)\n ULN2003DriverBoard();\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=6, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=10, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ Power Switch\n step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ LED\n step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ Piezo\n step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n step(10, \"Push the caster assembly into the base so that it snaps into place\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n }\n\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n \/\/ TODO: wrap into a PenLift sub-assembly\n step(11, \"Fit the pen lift assembly\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n MicroServo();\n }\n }\n\n\n \/\/ Shell + fixings\n\t\t\tif (Shell) {\n\t\t\t\tstep(PenLift ? 12 : 11,\n\t\t\t\t\t\"Push the shell down onto the base and twist to lock into place\") {\n\t\t\t\t\tview(t=[11,-23,65], r=[66,0,217], d=1171);\n\n\t\t\t\t\tattach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n\t\t\t\t\t\tBasicShell_STL();\n\t\t\t\t}\n }\n }\n\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4397d4830be85d79924991969e26127e04a07128","subject":"initial phi increased from 6 to 7 and step changed from 0.5 to 0.3","message":"initial phi increased from 6 to 7 and step changed from 0.5 to 0.3\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toilet_paper_holder_stop\/tp_holder_stop.scad","new_file":"toilet_paper_holder_stop\/tp_holder_stop.scad","new_contents":"$fs=0.01;\nh=7;\nspacing=20;\n\nmodule holderStop(phi)\n{\n difference()\n {\n cylinder(r=phi\/2+3, h=h);\n cylinder(r=phi\/2, h=h);\n }\n}\n\n\n\/\/ make different sizes\nfor(i = [0, 1, 2])\n \/\/ pack of 2 for each end of the holder\n for(j = [0, spacing])\n translate([j, i*spacing, 0])\n holderStop(6+1 + i*1\/3);\n","old_contents":"$fs=0.01;\nh=7;\nspacing=20;\n\nmodule holderStop(phi)\n{\n difference()\n {\n cylinder(r=phi\/2+3, h=h);\n cylinder(r=phi\/2, h=h);\n }\n}\n\n\n\/\/ make different sizes\nfor(i = [0, 1, 2])\n \/\/ pack of 2 for each end of the holder\n for(j = [0, spacing])\n translate([j, i*spacing, 0])\n holderStop(6 + i*0.5);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d0034e760de607e9c718a3a33868cfc71c8b40ed","subject":"Standardise parents, brackets and spaces","message":"Standardise parents, brackets and spaces\n","repos":"brodykenrick\/text_on_OpenSCAD","old_file":"text_on.scad","new_file":"text_on.scad","new_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t = \"text_on\";\r\ndefault_size = 4; \/\/ TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/ Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\"; \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false; \/\/ default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/ mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0; \/\/ mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth = 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/ TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/ (mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/ write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/ Internal values - don't play with these :)\r\n\/\/ This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi = 3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2 = internal_pi * 2;\r\n\r\n\/\/ Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/ Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/ ---- Helper Functions ----\r\n\/\/ String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/ NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/ They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char(size, spacing) = size * internal_space_fudge * spacing;\r\nfunction width_of_text_string_num_length(length, size, spacing) = width_of_text_char(size, spacing) * length;\r\nfunction width_of_text_string(t, size, spacing) = width_of_text_string_num_length(len(t), size, spacing);\r\n\r\nfunction cylinder_center_adjusted_top(height, center) = (center == true) ? height \/ 2 : height;\r\nfunction cylinder_center_adjusted_bottom(height, center) = (center == true) ? height \/ 2 : 0;\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0) = (width_of_text_char( size, spacing ) \/ (internal_pi2 * r)) * 360 * (1 - abs(rotate) \/ 90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering \r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string(t, size, spacing, r, rotate, center) = (center) ? (width_of_text_string_num_length(len(t) - 1, size, spacing) \/ 2 \/ (internal_pi2 * r) * 360) : 0;\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate(t, size, spacing,r,rotate,center) = ((center) ? (width_of_text_string(t, size, spacing) \/ 2 \/ (internal_pi2 * r) * 360) : 1) * (1 - abs(rotate) \/ 90);\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t = default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,\r\n r1,\r\n r2,\r\n h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign != undef) || (halign != undef)) {\r\n echo(str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n if((face == \"top\") || (face == \"bottom\")) {\r\n \/\/Work on a circle\r\n locn_offset_vec = (face == \"top\" ) ? [0, 0, cylinder_center_adjusted_top(h, cylinder_center)] : [0, 0, cylinder_center_adjusted_bottom(h, cylinder_center)];\r\n rotation_angle = (face == \"top\" ) ? 0 : 180;\r\n int_radius = (r == undef) ? ((face == \"top\" ) ? r2 : r1 ) : r; \/\/Use the top\/bottom radius for slanty-cylinders\r\n rotate(rotation_angle, [1, 0, 0])\r\n text_on_circle(t,\r\n locn_vec + locn_offset_vec,\r\n r = int_radius-size,\r\n font = font,size=size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n eastwest = eastwest,\r\n middle = middle,\r\n ccw = ccw);\r\n } else {\r\n if((middle != undef) && (middle != default_circle_middle)) {\r\n \/\/TODO: Which others?\r\n \/\/TODO: Which side things aren't supported on the circle\r\n echo(str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n }\r\n \/\/Work on the side\r\n locn_offset_vec = (cylinder_center == true) ? [0, 0, 0] : [0, 0, h \/ 2]; \r\n rotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing, r, rotate, center), [0, 0, 1])\r\n translate(locn_vec + locn_offset_vec)\r\n __internal_text_on_cylinder_side(t,\r\n locn_vec,\r\n r = r,\r\n h = h,\r\n r1 = r1,\r\n r2 = r2,\r\n cylinder_center = cylinder_center,\r\n center = center,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n face = face,\r\n updown = updown,\r\n eastwest = eastwest);\r\n }\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0, 0, 0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign != undef) || (halign != undef)) {\r\n echo(str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n ccw_sign = (ccw == true) ? 1 : -1;\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n rotate_z_outer = -rotate + ccw_sign * eastwest;\r\n rotate_z_inner = -rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, r-middle, rotate, center);\r\n rotate(rotate_z_outer, [0, 0, 1] )\r\n rotate(rotate_z_inner, [0, 0, 1] )\r\n translate(locn_vec)\r\n for(l = [0 : len(t) - 1]) {\r\n \/\/TTB\/BTT means no per letter rotation\r\n rotate_z_inner2 = -ccw_sign * 90 + ttb_btt_inaction * rtl_sign * ccw_sign * l * rotation_for_character(size, spacing, r - middle, rotate = 0); \/\/Bottom out=-270+r\r\n \/\/TTB means we go toward center, BTT means away\r\n vert_x_offset = (direction == \"ttb\" || direction == \"btt\") ? (l * size * ((direction == \"btt\") ? -1 : 1)) : 0;\r\n rotate(rotate_z_inner2, [0, 0, 1])\r\n translate([r - middle - vert_x_offset, 0, 0])\r\n rotate(-ccw_sign * 270, [0, 0, 1]) \/\/ flip text (botom out = -270)\r\n text_extrude(t[l],\r\n center = true,\r\n font = font,\r\n size = size,\r\n rotate = undef,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height);\r\n }\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0, 0, 0],\r\n r,\r\n r1,\r\n r2,\r\n h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign != undef) || (halign != undef)) {\r\n echo(str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1, r2, h_total, h_offset) = r1 + ((r2 - r1) * (h_total - h_offset) \/ h_total);\r\n \r\n \/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1, r2, h, length, rotate, updown) = h \/ 2 - updown + length * rotate \/ 90 * cos(atan((r2 - r1) \/ h));\r\n\r\n function calc_radius_at_length(r1, r2, h, length, rotate, updown) = calc_radius_at_height_offset(r1, r2, h, calc_height_offset_at_length(r1, r2, h, length, rotate, updown));\r\n \r\n if(r == undef) {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction == \"btt\") || (direction == \"ttb\")) {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo(str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\"));\r\n }\r\n if(center == true) {\r\n echo(str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\"));\r\n }\r\n }\r\n\r\n r1 = (r1 != undef) ? r1 : r;\r\n r2 = (r2 != undef) ? r2 : r;\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n rr1 = (center) ? r1 - extrusion_height \/ 2 : r1;\r\n rr2 = (center) ? r2 - extrusion_height \/ 2 : r2;\r\n \r\n ccenter = (r != undef) ? center : false; \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n ddirection = ((r == undef) && ((direction == \"ttb\") || (direction == \"btt\"))) ? \"ltr\" : direction; \/\/We don't do ttb or btt directions on slanty\r\n rtl_sign = (ddirection == \"rtl\") ? -1 : 1;\r\n\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0, 0, updown])\r\n rotate(eastwest, [0, 0, 1])\r\n for(l = [0 : len(t) - 1]) {\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n length_to_center_of_char = width_of_text_string_num_length(l + 0.5, size, spacing);\r\n radius_here = calc_radius_at_length(rr1, rr2, h, length_to_center_of_char, rotate, updown);\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, radius_here, rotate) * ((ddirection == \"ttb\" || ddirection== \"btt\") ? 0 : l);\r\n rotate(rotate_z_inner, [0, 0, 1]) {\r\n \/\/Positioning - based on (somewhat innacurate) string length\r\n \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n vert_z_char_offset = (ddirection == \"ttb\" || ddirection == \"btt\") ? (l * size * ((ddirection == \"ttb\") ? -1 : 1 )) : 0 ;\r\n \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n vert_z_half_text_offset_tmp = (len(t) -1) \/ 2 * (rotate \/ 90 * wid);\r\n vert_z_half_text_offset = ((ddirection == \"ttb\" || ddirection == \"btt\") || (ccenter == false)) ? 0 : vert_z_half_text_offset_tmp;\r\n translate([ radius_here , 0, vert_z_char_offset - l * (rotate \/ 90 * wid) + vert_z_half_text_offset])\r\n\r\n \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n rotate(atan((rr2 - rr1) \/h), [0, 1, 0])\r\n \/\/Flip onto face of \"normal\" cylinder\r\n rotate(90, [1, 0, 0])\r\n rotate(90, [0, 1, 0])\r\n\r\n \/\/Modify the offset of the baselined text to center\r\n translate([0, (ccenter) ? -size \/ 2 : 0, 0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n extrusion_height = extrusion_height);\r\n }\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign != undef) || (halign != undef)) {\r\n echo(str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n \/\/If we are centered - we sink the radius by half the\r\n \/\/extrusion height to draw \"just below the surface\"\r\n rr = (center) ? r - extrusion_height \/ 2 : r ;\r\n \r\n rotate(eastwest, [0, 0, 1])\r\n rotate(-northsouth, [1, 0, 0])\r\n rotate(spin, [0, 1, 0]) {\r\n \/\/This tries to center the text (for RTL text).\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n rotate(-rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, rr, rotate, center), [0, 0, 1]) {\r\n translate(locn_vec)\r\n if (rounded == false) {\r\n __internal_text_on_sphere_helper(t = t,\r\n r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height);\r\n } else {\r\n \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n intersection() {\r\n __internal_text_on_sphere_helper(t = t,\r\n r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height * 2); \/\/Make it proud to clip it off.\r\n \/\/Shell - bounding inner and outer\r\n difference() { \/\/rounded outside\r\n sphere(rr + extrusion_height);\r\n \/\/ rounded inside for indented text\r\n sphere( rr );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t = default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n ttb_btt_action = (direction == \"ttb\" || direction == \"btt\") ? 1 : 0;\r\n \r\n for(l = [0 : len(t) - 1]) {\r\n rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0);\r\n translate_sign = (direction == \"ttb\" || direction == \"btt\") ? ((direction == \"btt\") ? 1 : -1) : 0 ;\r\n \/\/translate_effect = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0 ;\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n rotate(rotate_z_inner, [0, 0, 1])\r\n translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l)])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l) \/ 90 , [0, 1, 0])\r\n \/\/Flip character into position to be flush against sphere\r\n rotate(90, [1, 0, 0])\r\n rotate(90, [0, 1, 0])\r\n \r\n \/\/Modify the offset of the baselined text to center\r\n translate([0, (center) ? -size \/ 2 : 0 , 0])\r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height = extrusion_height);\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t = default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0, 0, 0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign != undef) || (halign != undef)) {\r\n echo(str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n int_cube_size = (str(cube_size)[0] != \"[\") ? [cube_size, cube_size, cube_size] : cube_size;\r\n rotate_x = ((face == \"front\") || (face == \"back\") || (face == \"left\") || (face == \"right\")) ? 90 : ((face == \"bottom\") ? 180 : 0); \/\/ Top is zero\r\n rotate_y = ((face == \"back\") || (face == \"left\") || (face == \"right\")) ? (face == \"back\") ? 180 : ((face == \"left\") ? -90 : 90) : 0 ; \/\/ Right is 90, Top, bottom, front are zero\r\n locn_vec_offset =\r\n (face == \"front\") ? [+rightleft, -int_cube_size[1] \/ 2, +updown]\r\n : ((face == \"back\") ? [+rightleft, +int_cube_size[1] \/ 2, +updown]\r\n : ((face== \"left\") ? [-int_cube_size[0] \/ 2, +rightleft, +updown]\r\n : ((face == \"right\") ? [+int_cube_size[0] \/ 2, +rightleft, +updown]\r\n : ((face == \"top\") ? [+rightleft, +updown, +int_cube_size[2] \/ 2]\r\n : [+rightleft, -updown, -int_cube_size[2] \/ 2]\r\n )))); \/\/ bottom\r\n \r\n translate(locn_vec + locn_vec_offset)\r\n rotate(rotate_x, [1, 0, 0])\r\n rotate(rotate_y, [0, 1, 0]) \/\/ rotate around the y axis (z before rotation)\r\n text_extrude(t,\r\n center = center,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction, \/\/ Does this misalign inside text()? the individual character modules do.\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height );\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val != undef) ? val : default_val;\r\n\r\n\/\/ Print a single character or a string at the desired extrusion height\r\n\/\/ Passes on values to text() that are passed in\r\n\/\/ TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t = default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/ Fudgy. YMMV. \/\/ TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/ For scaling by different on axes (for widening etc)\r\n \/\/ Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing) {\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center == true) {\r\n if((halign != undef) || (valign != undef)) {\r\n echo(str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/ As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/ we need to check and replace any that we don't want to be undef\r\n t = default_if_undef(t, default_t);\r\n font = default_if_undef(font, default_font);\r\n extrusion_height = default_if_undef(extrusion_height, default_extrusion_height);\r\n center = default_if_undef(center, default_center);\r\n rotate = default_if_undef(rotate, default_rotate);\r\n spacing = default_if_undef(spacing, default_spacing);\r\n size = default_if_undef(size, default_size);\r\n \r\n halign = (center) ? \"center\" : halign ;\r\n valign = (center) ? \"center\" : valign ;\r\n extrusion_center = (center) ? true : false ;\r\n \r\n scale(scale)\r\n rotate(rotate, [0, 0, -1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n linear_extrude(height = extrusion_height, convexity = 10, center = extrusion_center)\r\n text(text = t,\r\n size = size,\r\n $fn = 40,\r\n font = font,\r\n direction = direction,\r\n spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language = language,\r\n script = script);\r\n}\r\n\r\n","old_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t = \"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\"; \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false; \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0; \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth = 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi = 3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2 = internal_pi * 2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = (center==true) ? height \/ 2 : height;\r\nfunction cylinder_center_adjusted_bottom( height, center ) = (center==true) ? height \/ 2 : 0;\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0) = ( width_of_text_char( size, spacing ) \/(internal_pi2 * r)) * 360 * (1 - abs(rotate) \/ 90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering \r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing, r, rotate, center) = (center) ? (width_of_text_string_num_length( len(t) - 1, size, spacing ) \/ 2 \/ (internal_pi2 * r) * 360) : 0;\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center) = ((center) ? (width_of_text_string( t, size, spacing ) \/ 2 \/ (internal_pi2 * r) * 360) : 1) * (1 - abs(rotate) \/ 90);\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t = default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,\r\n r1,\r\n r2,\r\n h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n if ((face == \"top\") || (face == \"bottom\")){\r\n \/\/Work on a circle\r\n locn_offset_vec = (face == \"top\" ) ? [0, 0, cylinder_center_adjusted_top(h, cylinder_center)] : [0, 0, cylinder_center_adjusted_bottom(h, cylinder_center)];\r\n rotation_angle = (face == \"top\" ) ? 0 : 180;\r\n int_radius = (r == undef) ? ((face == \"top\" ) ? r2 : r1 ) : r; \/\/Use the top\/bottom radius for slanty-cylinders\r\n rotate(rotation_angle, [1, 0, 0])\r\n text_on_circle(t,\r\n locn_vec + locn_offset_vec,\r\n r = int_radius-size,\r\n font = font,size=size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n eastwest = eastwest,\r\n middle = middle,\r\n ccw = ccw);\r\n }else{\r\n if((middle != undef) && (middle != default_circle_middle))\r\n {\r\n \/\/TODO: Which others?\r\n \/\/TODO: Which side things aren't supported on the circle\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n }\r\n \/\/Work on the side\r\n locn_offset_vec = (cylinder_center == true) ? [0, 0, 0] : [0, 0, h \/ 2]; \r\n rotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing, r, rotate, center), [0, 0, 1])\r\n translate(locn_vec + locn_offset_vec)\r\n __internal_text_on_cylinder_side(t,\r\n locn_vec,\r\n r = r,\r\n h = h,\r\n r1 = r1,\r\n r2 = r2,\r\n cylinder_center = cylinder_center,\r\n center = center,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n face = face,\r\n updown = updown,\r\n eastwest = eastwest);\r\n }\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0, 0, 0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n ccw_sign = (ccw == true) ? 1 : -1;\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n rotate_z_outer = -rotate + ccw_sign * eastwest;\r\n rotate_z_inner = -rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, r-middle, rotate, center);\r\n rotate( rotate_z_outer, [0, 0, 1] )\r\n rotate( rotate_z_inner, [0, 0, 1] )\r\n translate(locn_vec)\r\n for (l = [0 : len(t) - 1]){\r\n \/\/TTB\/BTT means no per letter rotation\r\n rotate_z_inner2 = -ccw_sign * 90 + ttb_btt_inaction * rtl_sign * ccw_sign * l * rotation_for_character(size, spacing, r - middle, rotate = 0); \/\/Bottom out=-270+r\r\n \/\/TTB means we go toward center, BTT means away\r\n vert_x_offset = (direction == \"ttb\" || direction == \"btt\") ? (l * size * ((direction == \"btt\") ? -1 : 1)) : 0;\r\n rotate( rotate_z_inner2, [0, 0, 1] )\r\n translate([r - middle - vert_x_offset, 0, 0])\r\n rotate(-ccw_sign * 270, [0, 0, 1]) \/\/ flip text (botom out = -270)\r\n text_extrude(t[l],\r\n center = true,\r\n font = font,\r\n size = size,\r\n rotate = undef,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height);\r\n }\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n r1,\r\n r2,\r\n h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1, r2, h_total, h_offset) = ( r1 + ((r2 - r1) * (h_total - h_offset) \/ h_total) );\r\n \r\n \/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1, r2, h, length, rotate, updown) = ( h \/ 2 - updown + length * rotate \/ 90 * cos( atan( (r2 - r1) \/ h ) ) );\r\n\r\n function calc_radius_at_length(r1, r2, h, length, rotate, updown) = ( calc_radius_at_height_offset(r1, r2, h, calc_height_offset_at_length(r1, r2, h, length, rotate, updown)));\r\n \r\n if(r == undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction == \"btt\") || (direction == \"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\"));\r\n }\r\n if(center == true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n r1 = (r1 != undef) ? r1 : r;\r\n r2 = (r2 != undef) ? r2 : r;\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n rr1 = (center) ? r1 - extrusion_height \/ 2 : r1;\r\n rr2 = (center) ? r2 - extrusion_height \/ 2 : r2;\r\n \r\n ccenter = (r != undef) ? center : false; \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n ddirection = ((r == undef) && ((direction == \"ttb\") || (direction == \"btt\"))) ? \"ltr\" : direction; \/\/We don't do ttb or btt directions on slanty\r\n rtl_sign = (ddirection == \"rtl\") ? -1 : 1;\r\n\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0, 0, updown])\r\n rotate(eastwest, [0, 0, 1])\r\n for (l = [0 : len(t) - 1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n length_to_center_of_char = width_of_text_string_num_length(l + 0.5, size, spacing);\r\n radius_here = calc_radius_at_length(rr1, rr2, h, length_to_center_of_char, rotate, updown);\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, radius_here, rotate) * ((ddirection == \"ttb\" || ddirection== \"btt\") ? 0 : l);\r\n rotate(rotate_z_inner, [0, 0, 1])\r\n {\r\n \/\/Positioning - based on (somewhat innacurate) string length\r\n \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n vert_z_char_offset = (ddirection == \"ttb\" || ddirection == \"btt\") ? (l * size * ((ddirection == \"ttb\") ? -1 : 1 )) : 0 ;\r\n \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n vert_z_half_text_offset_tmp = (len(t) -1) \/ 2 * (rotate \/ 90 * wid);\r\n vert_z_half_text_offset = ((ddirection == \"ttb\" || ddirection == \"btt\") || (ccenter == false)) ? 0 : vert_z_half_text_offset_tmp;\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate) \/ 90 * wid) + vert_z_half_text_offset])\r\n\r\n \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n rotate( atan( (rr2 - rr1) \/h), [0, 1, 0])\r\n \/\/Flip onto face of \"normal\" cylinder\r\n rotate(90, [1, 0, 0])\r\n rotate(90, [0, 1, 0])\r\n\r\n \/\/Modify the offset of the baselined text to center\r\n translate([0, (ccenter) ? -size \/ 2 : 0, 0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n extrusion_height = extrusion_height\r\n );\r\n }\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n \/\/If we are centered - we sink the radius by half the\r\n \/\/extrusion height to draw \"just below the surface\"\r\n rr = (center) ? r - extrusion_height \/ 2 : r ;\r\n \r\n rotate(eastwest, [0, 0, 1])\r\n rotate(-northsouth, [1, 0, 0])\r\n rotate(spin, [0, 1, 0])\r\n {\r\n \/\/This tries to center the text (for RTL text).\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n rotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, rr, rotate, center), [0, 0, 1])\r\n {\r\n translate(locn_vec)\r\n if ( rounded == false ){\r\n __internal_text_on_sphere_helper(t = t,\r\n r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height\r\n );\r\n }else{\r\n \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n intersection()\r\n {\r\n __internal_text_on_sphere_helper(t = t,\r\n r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height * 2 \/\/Make it proud to clip it off.\r\n );\r\n\r\n \/\/Shell - bounding inner and outer\r\n difference()\r\n { \/\/rounded outside\r\n sphere(rr + extrusion_height);\r\n \/\/ rounded inside for indented text\r\n sphere( rr );\r\n }\r\n\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t = default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n ttb_btt_action = (direction == \"ttb\" || direction == \"btt\") ? 1 : 0;\r\n \r\n for (l = [0 : len(t) - 1]){\r\n rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0);\r\n \r\n rotate( rotate_z_inner, [0, 0, 1] )\r\n {\r\n translate_sign = (direction == \"ttb\" || direction == \"btt\") ? ((direction == \"btt\") ? 1 : -1) : 0 ;\r\n \/\/translate_effect = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0 ;\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ) \/ 90 , [0, 1, 0])\r\n \/\/Flip character into position to be flush against sphere\r\n rotate(90, [1, 0, 0])\r\n rotate(90, [0, 1, 0])\r\n \r\n \/\/Modify the offset of the baselined text to center\r\n translate([0, (center) ? -size \/ 2 : 0 , 0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height = extrusion_height );\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t = default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0, 0, 0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n int_cube_size = (str(cube_size)[0] != \"[\") ? [cube_size, cube_size, cube_size] : cube_size;\r\n rotate_x = ( (face == \"front\") || (face == \"back\") || (face == \"left\") || (face == \"right\") ) ? 90\r\n : ((face == \"bottom\") ? 180 : 0) ; \/\/Top is zero\r\n rotate_y = ( (face == \"back\") || (face == \"left\") || (face == \"right\") ) ? (face == \"back\") ? 180 : ((face == \"left\") ? -90 : 90) \/\/Right is 90\r\n : 0 ; \/\/Top, bottom, front are zero\r\n locn_vec_offset =\r\n (face == \"front\") ? [+rightleft, -int_cube_size[1] \/ 2, +updown]\r\n :((face == \"back\") ? [+rightleft, +int_cube_size[1] \/ 2, +updown]\r\n : ((fac e== \"left\") ? [-int_cube_size[0] \/ 2, +rightleft, +updown]\r\n : ((face == \"right\") ? [+int_cube_size[0] \/ 2, +rightleft, +updown]\r\n : ((face == \"top\") ? [+rightleft, +updown, +int_cube_size[2] \/ 2]\r\n : [+rightleft, -updown, -int_cube_size[2] \/ 2]\r\n )))); \/\/bottom\r\n \r\n translate(locn_vec + locn_vec_offset)\r\n rotate(rotate_x, [1, 0, 0])\r\n rotate(rotate_y, [0, 1, 0]) \/\/ rotate around the y axis (z before rotation)\r\n text_extrude(t,\r\n center = center,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height );\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val != undef) ? val : default_val;\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t = default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center == true)\r\n {\r\n if((halign != undef) || (valign != undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n t = default_if_undef(t, default_t);\r\n font = default_if_undef(font, default_font);\r\n extrusion_height = default_if_undef(extrusion_height, default_extrusion_height);\r\n center = default_if_undef(center, default_center);\r\n rotate = default_if_undef(rotate, default_rotate);\r\n spacing = default_if_undef(spacing, default_spacing);\r\n size = default_if_undef(size, default_size);\r\n \r\n halign = (center) ? \"center\" : halign ;\r\n valign = (center) ? \"center\" : valign ;\r\n extrusion_center = (center) ? true : false ;\r\n \r\n scale( scale )\r\n rotate(rotate, [0, 0, -1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n {\r\n linear_extrude(height = extrusion_height, convexity = 10, center = extrusion_center)\r\n text(text = t,\r\n size = size,\r\n $fn = 40,\r\n font = font,\r\n direction = direction,\r\n spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language = language,\r\n script = script);\r\n }\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"48a4aff67b8793be3b6031c14768e48d9a4ae590","subject":"main: move axis","message":"main: move axis\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = 80;\/\/axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4bc547ee820414290124f821241fa38c03594059","subject":"y\/idler: fix nut trap","message":"y\/idler: fix nut trap\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2),\n align=N,\n orient=X\n );\n \/*rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);*\/\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n tz(extrusion_size\/2+yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", h=extrusion_size+yaxis_idler_mount_thickness+10*mm, head_embed=false, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n washer_h=.8*mm + .1*mm;\n h = yaxis_idler_pulley_h + 2*washer_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2), orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n\n \/\/ pulley+washers cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5+2*washer_h],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n {\n tx(yaxis_idler_pulley_tight_len\/2)\n tx(9*mm)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, screw_l=10*mm, trap_axis=-Z, orient=-X, align=X);\n\n screw_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, screw_l=10*mm, with_nut=false, trap_axis=-Z, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n \/\/ TODO: add washers\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, Z], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\nif(false)\n{\n yaxis_idler();\n yaxis_idler_pulleyblock();\n}\n\nif(false)\n{\n attach([N,-X], yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n}\n","old_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2),\n align=N,\n orient=X\n );\n \/*rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);*\/\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n tz(extrusion_size\/2+yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", h=extrusion_size+yaxis_idler_mount_thickness+10*mm, head_embed=false, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n washer_h=.8*mm + .1*mm;\n h = yaxis_idler_pulley_h + 2*washer_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2), orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n\n \/\/ pulley+washers cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5+2*washer_h],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n {\n tx(yaxis_idler_pulley_tight_len\/2)\n tx(5*mm)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, screw_l=12*mm, trap_axis=-Z, orient=-X, align=X);\n\n tx(-yaxis_idler_pulley_tight_len\/2)\n screw_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, h=7*mm, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n \/\/ TODO: add washers\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, Z], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\nif(false)\n{\n yaxis_idler();\n yaxis_idler_pulleyblock();\n}\n\nif(false)\n{\n attach([N,-X], yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"19b04226d6614d1b63d4eb994eeef4184130d976","subject":"[3d] Pi mounting screw location now based on position from front wall instead of back","message":"[3d] Pi mounting screw location now based on position from front wall instead of back\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height (19.1+ headless Zero, 22.4 headless Pi3)\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+38.8,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \/\/translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-56.5,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \/\/translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f82a9ef4f7fa5d53919ce880824c126cea518757","subject":"shape_gears: add","message":"shape_gears: add\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shape_gears.scad","new_file":"shape_gears.scad","new_contents":"\/\/ gears.scad\r\n\/\/ library for parametric involute gears \r\n\/\/ Author: Rudolf Huttary, Berlin \r\n\/\/ last update: June 2016\r\n\r\niterations = 150; \/\/ increase for enhanced resolution beware: large numbers will take lots of time!\r\nverbose = false; \/\/ set to false if no console output is desired\r\n\r\n\/\/ help(); \/\/ display module prototypes\r\n\/\/ default values\r\n\/\/ z = 10; \/\/ teeth - beware: large numbers may take lots of time!\r\n\/\/ m = 1; \/\/ modulus\r\n\/\/ x = 0; \/\/ profile shift\r\n\/\/ h = 4; \/\/ face_width\trespectively axial height\r\n\/\/ w = 20; \/\/ profile angle\r\n\/\/ clearance \/\/ assymmetry of tool to clear tooth head and foot\r\n\/\/ = 0.1; \/\/ for external splines\r\n\/\/ = -.1 \/\/ for internal splines \r\n\/\/ w_bevel = 45; \/\/ axial pitch angle\r\n\/\/ w_helix = 45; \/\/ radial pitch angle \r\n\r\n\/\/ use this prototype:\r\n\/\/ gear(m = modulus, z = Z, x = profile_shift, w = alpha, h = face_width);\r\n\r\n\/\/==== external splines with default values ===\r\n\/\/ gear(); \r\n\/\/ gear_helix(); \r\n\/\/ gear_herringbone(); \r\n\/\/ gear_bevel(); \r\n\r\n\/\/==== internal splines with default values ===\r\n\/\/ Gear(); \r\n\/\/ Gear_helix(); \r\n\/\/ Gear_herringbone(); \r\n\/\/ Gear_bevel(); \r\n\/\/ \r\n\r\n\/\/==== internal splines - usage and more examples ===\r\n\/\/ gear(z = 25, m = 1, x = -.5, h = 4); \r\n\/\/ gear_bevel(z = 26, m = 1, x = .5, h = 3, w_bevel = 45, w_helix = -45); \r\n\/\/ gear_helix(z = 16, m = 0.5, h = 4, w_helix = -20, clearance = 0.1); \r\n\/\/ gear_herringbone(z = 16, m = 0.5, h = 4, w_helix = -45, clearance = 0.1); \/\/ twist independent from height\r\n\/\/ gear_herringbone(z = 16, m = 0.5, h = 4, w_abs = -20, clearance = 0.1); \/\/ twist absolute\r\n\r\n\r\n\/\/==== external splines - usage and more examples ===\r\n\/\/ D ist calculated automatically, but can also be specified\r\n\/\/\r\n\/\/ Gear(z = 10, m = 1.1, x = 0, h = 2, w = 20, D=18, clearance = -0.2); \r\n\/\/ gear(z = 10, m = 1, x = .5, h = 4, w = 20, clearance = 0.2); \r\n\r\n\/\/ Gear_herringbone(z = 40, m = 1, h = 4, w_helix = 45, clearance = -0.2, D = 49); \r\n\/\/ gear_herringbone(z = 40, m = 1, h = 4, w_helix = 45, clearance = 0.2); \r\n\r\n\/\/ Gear_helix(z = 20, m=1.3, h = 15, w_helix = 45, clearance = -0.2); \r\n\/\/ gear_helix(z = 20, m=1.3, h = 15, w_helix = 45, clearance = 0.2); \r\n\r\n\r\n\/\/ ==== grouped examples ===\r\n\/\/\tdi = 18; \/\/axial displacement\r\n\/\/\ttranslate([di, di]) Gear(z = 25, D=32); \r\n\/\/\ttranslate([-di, di]) Gear_helix(z = 25, D=32); \r\n\/\/\ttranslate([-di, -di]) Gear_herringbone(z = 25, D=32); \r\n\/\/\ttranslate([di, -di]) Gear_bevel(z = 25, D=32); \r\n\t\r\n\/\/\tdi = 8; \/\/axial displacement\r\n\/\/\ttranslate([di, di]) gear(); \r\n\/\/\ttranslate([-di, di]) gear_helix(); \r\n\/\/\ttranslate([-di, -di]) gear_herringbone(); \r\n\/\/\ttranslate([di, -di]) gear_bevel(); \r\n\r\n\/\/ profile shift examples\r\n\/\/\tdi = 9.5; \/\/axial displacement\r\n\/\/\tgear(z = 20, x = -.5); \r\n\/\/\ttranslate([0, di+3]) rotate([0, 0, 0]) gear(z = 7, x = 0, clearance = .2); \r\n\/\/\ttranslate([di+3.4, 0]) rotate([0, 0, 0]) gear(z = 6, x = .25); \r\n\/\/\ttranslate([0, -di-3]) rotate([0, 0, 36]) gear(z = 5, x = .5); \r\n\/\/\ttranslate([-di-3.675, 0]) rotate([0, 0, 22.5]) gear(z = 8, x = -.25); \r\n \r\n\r\n\/\/ tooth cutting principle - dumping frames for video\r\n\/\/\ts = PI\/6; \r\n\/\/\tT= $t*360; \r\n\/\/ U = 10*PI; \r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ circle(6); \/\/ workpiece\r\n\/\/ for(i=[0:s:T])\r\n\/\/ rotate([0, 0, -i])\r\n\/\/ translate([-i\/360*U, 0, 0])\r\n\/\/ Rack(); \/\/ Tool\r\n\/\/ }\r\n\/\/\trotate([0, 0, -T])\r\n\/\/\ttranslate([-T\/360*U, 0, 0])\r\n\/\/\tcolor(\"red\")\r\n\/\/ Rack(); \/\/ Tool\r\n\r\n\r\n\r\n\r\n\/\/ === modules for internal splines\r\nmodule help()\r\n{\r\nhelpstr = \r\n\"gears library \\n\r\n iterations = 150;\\n\r\n verbose = true;\\n\r\n help();\\n\r\n gear(m = 1, z = 10, x = 0, h = 4, w = 20, clearance = 0.1, center = true);\\n\r\n gear_helix(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs = 0, clearance = 0.1, center = true, verbose = true);\\n\r\n gear_herringbone(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs = 0, clearance = 0.1, center = true);\\n\r\n gear_bevel(m = 1, z = 10, x = 0, h = 4, w = 20, w_bevel = 45, w_helix = 45, w_abs = 0, clearance = 0.1, center = true);\\n\r\n gear_info(m = 1, z = 10, x = 0, h = 0, w = 20, w_bevel = 0, w_helix = 0, w_abs=0, clearance = 0.1, center=true);\\n\r\nannular-toothed;\\n\r\n Gear(m = 1, z = 10, x = 0, h = 4, w = 20, D = 0, clearance = -.1, center = true);\\n\r\n Gear_herringbone(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs = 0, D = 0, clearance = -.1, center = true);\\n\r\n Gear_helix(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs=0, D = 0, clearance = -.1, center = true);\\n\r\n Gear_bevel(m = 1, z = 10, x = 0, h = 4, w = 20, w_bevel = 45, w_helix = 0, w_abs = 0, D = 0, clearance = -0.1, center = true);\\n\r\n2D primitives\\n\r\n gear2D(m = 1, z = 10, x = 0, w = 20, clearance = 0.1);\\n\r\n Rack(m = 1, z = 10, x = 0, w = 20, clearance = 0);\\n\r\n \";\r\n echo(helpstr); \r\n}\r\n\r\nmodule Gear(m = 1, z = 10, x = 0, h = 4, w = 20, D = 0, clearance = -.1, center = true) \r\n{\r\n D_= D==0 ? m*(z+x+4):D; \r\n difference()\r\n {\r\n\t\tcylinder(r = D_\/2, h = h, center = center);\r\n\t\tgear(m, z, x, h+1, w, center = center, clearance = clearance); \r\n\t}\r\n if(verbose) echo(str(\"Ring (D) = \", D_)); \r\n}\r\n\r\nmodule Gear_herringbone(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs = 0, D = 0, clearance = -.1, center = true) \r\n{\r\n D_= D==0 ? m*(z+x+4):D; \r\n difference()\r\n {\r\n\t\tcylinder(r = D_\/2, h = h, center = center); \/\/ CSG!\r\n translate([0, 0, -.001]) \r\n\t\tgear_herringbone(m, z, x, h+.01, w, w_helix, w_abs, clearance = clearance, center = center); \r\n\t}\r\n if(verbose) echo(str(\"Ring (D) = \", D_)); \r\n}\r\n\r\nmodule Gear_helix(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs=0, D = 0, clearance = -.1, center = true) \r\n{\r\n D_= D==0 ? m*(z+x+4):D; \r\n difference()\r\n {\r\n\t\tcylinder(r = D_\/2, h = h-.01, center = center); \/\/ CSG!\r\n\t\tgear_helix(m, z, x, h, w, w_helix, w_abs, clearance, center); \r\n\t}\r\n if(verbose) echo(str(\"Ring (D) = \", D_)); \r\n}\r\n\r\nmodule Gear_bevel(m = 1, z = 10, x = 0, h = 4, w = 20, w_bevel = 45, w_helix = 0, w_abs = 0, D = 0, clearance = -0.1, center = true)\r\n{\r\n D_= D==0 ? m*(z+x+4):D; \r\n rotate([0, 180, 0])\r\n difference()\r\n {\r\n\t\tcylinder(r = D_\/2, h = h-.01, center = center); \/\/ CSG!\r\n\t\tgear_bevel(m, z, x, h, w, w_bevel, w_helix, w_abs, clearance = clearance, center = center); \r\n\t}\r\n if(verbose) echo(str(\"Ring (D) = \", D_)); \r\n}\r\n\r\n\r\n\/\/ === modules for external splines\r\nmodule gear_herringbone(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs = 0, clearance = 0.1, center = true)\r\n{\r\n gear_info(\"herringbone\", m, z, x, h, w, undef, w_abs==0?w_helix:undef, w_abs==0?undef:w_abs, clearance, center);\r\n translate([0, 0, center?0:h\/2])\r\n for(i=[0, 1])\r\n mirror([0,0,i])\r\n gear_helix(m, z, x, h\/2, w, w_helix, w_abs, center = false, clearance = clearance, center = false, verbose = false); \r\n}\r\n\r\nmodule gear_helix(m = 1, z = 10, x = 0, h = 4, w = 20, w_helix = 45, w_abs = 0, clearance = 0.1, center = true, verbose = true)\r\n{\r\n if(verbose)\r\n gear_info(\"helix\", m, z, x, h, w, undef, w_abs==0?w_helix:undef, w_abs==0?undef:w_abs, clearance, center);\r\n\tr_wk = m*z\/2 + x; \r\n tw = w_abs==0?h\/tan(90-w_helix)\/PI*180\/r_wk:w_abs;\r\n sl = abs(tw)>0?ceil(2*h):1; \r\n\tlinear_extrude(height = h, center = center, twist = tw, slices = sl, convexity = z, center = center)\r\n gear2D(m, z, x, w, clearance); \r\n}\r\n\r\nmodule gear_bevel(m = 1, z = 10, x = 0, h = 4, w = 20, w_bevel = 45, w_helix = 0, w_abs = 0, clearance = 0.1, center = true)\r\n{\r\n gear_info(\"bevel\", m, z, x, h, w, w_bevel, w_abs==0?w_helix:undef, w_abs==0?undef:w_abs, clearance, center);\r\n\tr_wk = m*z\/2 + x; \r\n sc = (r_wk-tan(w_bevel)*h)\/r_wk; \r\n tw = w_abs==0?h\/tan(90-w_helix)\/PI*180\/r_wk:w_abs;\r\n sl = abs(tw)>0?ceil(2*h):1; \r\n\tlinear_extrude(height = h, center = center, twist = tw, scale = [sc, sc], slices = sl, convexity = z)\r\n gear2D(m, z, x, w, clearance); \r\n}\r\n\r\nmodule gear(m = 1, z = 10, x = 0, h = 4, w = 20, clearance = 0.1, center = true)\r\n{\r\n gear_info(\"spur\", m, z, x, h, w, undef, undef, undef, clearance, center); \r\n\tlinear_extrude(height = h, center = center, convexity = z)\r\n gear2D(m, z, x, w, clearance); \r\n}\r\n\r\nmodule gear_info(type = \"\", m = 1, z = 10, x = 0, h = 0, w = 20, w_bevel = 0, w_helix = 0, w_abs=0, clearance = 0.1, center=true, D=undef)\r\n{\r\n \tr_wk = m*z\/2 + x; \r\n \tdy = m; \r\n \tr_kk = r_wk + dy; \r\n \tr_fk = r_wk - dy; \r\n \tr_kkc = r_wk + dy *(1-clearance\/2); \r\n \tr_fkc = r_wk - dy *(1+clearance\/2); \r\n if(verbose) \r\n {\r\n echo(str (\"\\n\")); \r\n echo(str (type, \" gear\")); \r\n echo(str (\"modulus (m) = \", m)); \r\n echo(str (\"teeth (z) = \", z)); \r\n echo(str (\"profile angle (w) = \", w, \"\u00b0\")); \r\n echo(str (\"pitch (d) = \", 2*r_wk)); \r\n echo(str (\"d_outer = \", 2*r_kk, \"mm\")); \r\n echo(str (\"d_inner = \", 2*r_fk, \"mm\")); \r\n echo(str (\"height (h) = \", h, \"mm\")); \r\n echo(str (\"clearance factor = \", clearance)); \r\n echo(str (\"d_outer_cleared = \", 2*r_kkc, \"mm\")); \r\n echo(str (\"d_inner_cleared = \", 2*r_fkc, \"mm\")); \r\n echo(str (\"helix angle (w_helix) = \", w_helix, \"\u00b0\")); \r\n echo(str (\"absolute angle (w_abs) = \", w_abs, \"\u00b0\")); \r\n echo(str (\"bevel angle (w_bevel) = \", w_bevel, \"\u00b0\")); \r\n echo(str (\"center = \", center)); \r\n }\r\n}\r\n\r\n\/\/ === from here 2D stuff == \r\nmodule gear2D(m = 1, z = 10, x = 0, w = 20, clearance = 0.1)\r\n{\r\n \tr_wk = m*z\/2 + x; \r\n U = m*z*PI; \r\n \tdy = m; \r\n \tr_fkc = r_wk + dy *(1-clearance\/2); \r\n s = 360\/iterations; \r\n difference()\r\n {\r\n circle(r_fkc, $fn=300); \/\/ workpiece\r\n for(i=[0:s:360])\r\n rotate([0, 0, -i])\r\n translate([-i\/360*U, 0, 0])\r\n Rack(m, z, x, w, clearance); \/\/ Tool\r\n }\r\n}\r\n\r\nmodule Rack(m = 1, z = 10, x = 0, w = 20, clearance = 0)\r\n {\r\n p = m*PI; \r\n dy = 2*m; \r\n dx = dy * tan(w); \r\n ddx = dx\/2 * clearance\/2; \r\n ddy = dy\/2 * clearance\/2; \r\n r_wk = m*z\/2 + x; \r\n y0 = r_wk+dy; \r\n y1 = r_wk+dy\/2-ddy; \r\n y2 = r_wk+dy\/2 - ddy; \r\n y3 = r_wk-dy\/2 - ddy; \r\n x0 = p\/4-dx\/2 + ddx; \r\n x1 = p\/4+dx\/2 + ddx; \r\n x2 = 3*p\/4-dx\/2 - ddx; \r\n x3 = 3*p\/4+dx\/2 - ddx; \r\n polygon(points = tooth(z));\r\n \r\n function tooth(z = 10) = concat([[-p, y0],[-p, y1]], \r\n\t\t[for(i=[-1:z], j=[0:3]) to(i*p)[j]], [[(z+1)*p, y1], [(z+1)*p, y0]]); \r\n \r\n function to(dx) = [[dx+x0, y2], [dx+x1, y3], [dx+x2, y3], [dx+x3, y2]]; \r\n}\r\n\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'shape_gears.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2c5de596a04d1d52acf371c4aedb460f1978a416","subject":"shapes: fixes for rcube and rcylinder","message":"shapes: fixes for rcube and rcylinder\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/*triangle_a(45, 5, 5);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(10, 15, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2)\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/*triangle_a(45, 5, 5);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(10, 15, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"31cee32ba1f2194dfbc3e363b73e84c4e509f99d","subject":"=> rules coding","message":"=> rules coding","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/skeleton.scad","new_file":"3D-models\/SCAD\/skeleton.scad","new_contents":"\/\/\u041a\u0430\u0440\u043a\u0430\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0414\u041d\u041a \n$fn=190; \nx=9; \ny=90; \nz=90; \ndz=-45; \ncylinder(x,y,z); \ntranslate([0,0,dz]) cylinder(x*5,y\/10,z\/10); \n\n\n\n","old_contents":"\/\/\u041a\u0430\u0440\u043a\u0430\u0441 \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u0447\u0430\u0441\u0442\u043a\u0430 \u0414\u041d\u041a\n$fn=190;\nx=9;\ny=90;\nz=90;\ndz=-45;\ncylinder(x,y,z);\ntranslate([0,0,dz]) cylinder(x*5,y\/10,z\/10);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4202c9004aa89d317badb53c60b347010f71ea44","subject":"bearing\/data: Add more (bronze and LM-series)","message":"bearing\/data: Add more (bronze and LM-series)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,10,16];\nbearing_bronze_10_16_18 = [10,16,18,14,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4c50318b13cf62f8d6e30a9c9ca6cb4cee7ac755","subject":"screw: add","message":"screw: add\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n fncylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n fncylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n fncylindera(fn=6, d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n fncylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'metric-screw.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"546e86eb0b24e0867884cd2f7f73bd41269f1c8a","subject":"Tweak rpi enclosure design. Still need correct outlet for camera cable.","message":"Tweak rpi enclosure design. Still need correct outlet for camera cable.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/RaspberryPi_v15.scad","new_file":"designs\/RaspberryPi_v15.scad","new_contents":"\/\/ Raspberry Pi Case\r\n\/\/ Hans Harder 2012\r\n\/\/\r\n\/\/ Warning: this is based on the Beta board dimensions...\r\n\/\/ so production models can be slightly different\r\n\/\/ for instance SD card holder height and USB socket dimensions\r\n\/\/\r\n\/\/ Since all connectors stick out, case is split on HDMI height\r\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\r\n\/\/\r\n\/\/ v2: Adapted version after some suggestions from David...\r\n\/\/ removed feet, made both surface flat\r\n\/\/ v3: Added fliptop option and smooth the corners of the box\r\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\r\n\/\/ Looks strange but it fits...\r\n\/\/ Added frame mode (so no bottom and top deck)\r\n\/\/ Moved screw locations due to split and added some support structures\r\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\r\n\/\/ v5 relocated a lot of code in modules\r\n\/\/ SDslot location was not calculated correctly\r\n\/\/ v6 Added pcb drawing\r\n\/\/ Added colors\r\n\/\/ Cut out better so there is no debris around\r\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\r\n\/\/ Make a low as possible case, let USB stick out\r\n\/\/ v7 PCB options\r\n\/\/ Low level case optimisations\r\n\/\/ SD card location alterations\r\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\r\n\/\/ adapted support studs, moved some due to component location\r\n\/\/ components locations adapted\r\n\/\/ v9 Added logo in seperate dxf file\r\n\/\/ Option added to put logo in middle or using whole deck\r\n\/\/ beautified code, kr style\r\n\/\/ v10 Added logosunken and bottomsupport structures\r\n\/\/ Bottom supports are located where no components are located\r\n\/\/ so the pcb is not only supported from the sides\r\n\/\/ Well got my case, so based on what I see I changed:\r\n\/\/ case split level changed, should be better when printed on a reprap\r\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\r\n\/\/ Made frontstud a little thicker\r\n\/\/ v11 Different splitlevel (more simple) on back\r\n\/\/ keep a little margin on back split, so that top and bottom always fit\r\n\/\/ added openlogo option\r\n\/\/ v12 Different component locations\/sizes\r\n\/\/ keep a little margin on component holes\r\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\r\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\r\n\/\/ v13 skip this one.... :)\r\n\/\/ v14 Production board measurements...\r\n\/\/\t small differences, sometimes components are soldered differently\r\n\/\/ keep more space\r\n\/\/ should fit like a glove...\r\n\/\/ v15 moved the rca and snd a bit to get them more centered\r\n\/\/ Thanks to lincomatic at Thingiverse\r\n\/\/ Added option for GPIO side hole in bottom or top\r\n\/\/ Added showing GPIO pins with component drawing\r\n\/\/\r\n\/\/ All parts are draw as default just disable the ones you don't want\r\nDRAWfull = 0;\r\nDRAWtop = 1;\r\nDRAWbottom = 1;\r\nDRAWtopinlet = 0;\r\nDRAWbottominlet = 0;\r\nDRAWpcb = 0;\r\n\r\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\r\nGPIOsize = 2; \/\/ define height of gpiohole\r\n\r\n\/\/ select how the case should look like\r\ntopframe = false; \/\/ if false, underneath values determines how\r\ntopinlet = false; \/\/ false is outside, otherwise it is with an indent\r\ntopholes = true;\r\n\/\/ ---- top holes sizes\r\n\/\/holeofs=5;\t\t\t\t\t\t\/\/ 2 for fish1, 10 for fish2, 5 for holes\r\n\/\/holesiz=2;\r\n\/\/holelen=30;\r\n\/\/holestep=5.2;\r\n\/\/noholes=12;\r\n\/\/holeangle1=[0,0, 0];\t\t \/\/ , 30] for fish1 and ,-30] for fish2 ,0] for holes\r\n\/\/holeangle2=[0,0, 0];\t\t \/\/ ,-30] for fish1 and , 30] for fish2 ,0] for holes\r\n\/\/ ---- bottom holes sizes\r\nholeofs=5;\r\nholesiz=2.5;\r\nholestep=6;\r\nnoholes=12;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\r\nholelen=50;\r\nholeangle1=[0,0, 0];\r\ntopmiddle = false;\r\ntoplogo = false;\r\ntoplogopc = -1; \/\/ 0 0 placement correction of logo\r\ntoplogoxm = 0; \/\/ 3 6 leftmargin of logo\r\ntoplogotm = -1; \/\/ 12 15 topmargin of logo\r\ntoplogohole = false;\r\ntoplogosunken=false; \/\/ true or false, no idea if this works on a reprap\r\n\r\nbottomframe = false; \/\/ if false, underneath values determines how\r\nbottominlet = false;\r\nbottomholes = false;\r\nbottomscrew = false;\r\nbottomfeet = false; \/\/ MHL: conflict w\/ various through-hole components\r\nbottomsupport = false; \/\/ Added extra support locations for pcb\r\nbottomclick = true;\r\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\r\n\r\nbox_thickness = 2.0; \/\/ minimum = 1.0\r\ninside_h = 12.1; \/\/ 12.1 = lowprofile 16.5 is full height\r\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\r\n\r\n\/\/ just some colors to see the difference\r\nCASEcolor=\"Maroon\";\r\nCONNcolor=\"Silver\";\r\nLOGOcolor=\"White\";\r\n\r\n\/\/ Define Raspberry Pi pcb dimensions in mm\r\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\r\ninside_w = 57.0; \/\/56.17 is largest width reported, so a bit room on each side\r\npcb_thickness = 1.6;\r\n\r\n\/\/ Coordinates based on RJ45 corner = 0,0,0\r\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\r\n\r\n\/\/ Connectors\r\nCrj45_x=2.0;\t\t\t \/\/2.0\r\nCrj45_y=-1;\r\nCrj45_w=16.4;\t\t\t\/\/ 15.4\r\nCrj45_d=21.5; \/\/21.8\r\nCrj45_h=13;\r\n\r\nCusb_x=24.5; \/\/ 23.9\r\nCusb_y=-7.7;\r\nCusb_w=13.9; \/\/ 13.3\r\nCusb_d=19.0;\t\t\t\/\/ 17.2\r\nCusb_h=15.4;\r\n\r\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\r\nCpwr_y=80.9;\r\nCpwr_w=8.6;\t\t\t\t\/\/ 7.8 7.6\r\nCpwr_d=5.6;\r\nCpwr_h=2.5;\r\n\r\nCsd_x=16.7;\r\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\r\nCsd_w=27.8;\r\nCsd_d=29.0;\r\nCsd_h=3.4; \/\/ under pcb\r\n\r\nChdmi_x=-1.2;\r\nChdmi_y=32.0; \/\/ 32.4 if 15.1\r\nChdmi_w=11.4;\r\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\r\nChdmi_h=6.4;\r\n\r\nCsnd_x=inside_w - 11.4;\r\nCsnd_y=16.0;\r\nCsnd_w=11.4;\r\nCsnd_d=10.0;\r\nCsnd_h=10.5;\r\nCsnd_r=6.7;\r\nCsnd_z=3.0;\r\nCsnd_l=3.4;\r\n\r\nCrca_x=inside_w - 10.0 - 2.1;\r\nCrca_y=34.2; \/\/ 34.6 was 35.2\r\nCrca_w=10.0;\r\nCrca_d=10.4; \/\/ 9.8\r\nCrca_h=13.0;\r\nCrca_r=8.6;\r\nCrca_z=4;\r\nCrca_l=10; \/\/ wild guess\r\n\r\n\r\n\r\npcb_c = pcb_h + pcb_thickness; \/\/ component height\r\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\r\necho(\"casesplit=\",casesplit);\r\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\r\n\r\n\/\/ side stud sizes for supporting pcb\r\nstud_w = 2;\r\nstud_l = 4;\r\n\r\n\/\/ calculate box size\r\nbox_l = inside_l + (box_thickness * 2);\r\nbox_w = inside_w + (box_thickness * 2);\r\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\r\nbox_w1 = box_thickness;\r\nbox_w2 = box_w - box_thickness;\r\nbox_l1 = box_thickness;\r\nbox_l2 = box_l - box_thickness;\r\nbox_wc = box_w \/ 2; \/\/ center width\r\nbox_lc = box_l \/ 2; \/\/ center length\r\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\r\nmiddle = true;\r\n\/\/ rounded corners\r\ncorner_radius = box_thickness*2;\r\n\r\n\r\n\r\n\/\/ count no of items to draw\r\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom + DRAWtopinlet + DRAWbottominlet;\r\n\r\n\/\/ ====================================================== DRAW items\r\n\/\/ if one draw it centered\r\nif (DRAWtotal == 1) {\r\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\r\n if (DRAWfull ) {\r\n draw_case(0,1);\r\n translate(v=[0,0,0.2]) draw_case(1,0);\r\n }\r\n if (DRAWtop ) {\r\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\r\n }\r\n if (DRAWbottom) draw_case(1,0);\r\n if (DRAWtopinlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo);\r\n if (DRAWbottominlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew,logo=false);\r\n }\r\n} else {\r\n\/\/ draw each one on there one location\r\n if (DRAWfull) {\r\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\r\n draw_case(1,0);\r\n translate(v=[0,0,0.2]) draw_case(0,1);\r\n }\r\n }\r\n if (DRAWbottom) {\r\n translate(v = [ 5, 5, 0]) draw_case(1,0);\r\n }\r\n if (DRAWtop) {\r\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\r\n }\r\n if (DRAWtopinlet) {\r\n translate(v = [ -box_w-5, -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo);\r\n }\r\n if (DRAWbottominlet) {\r\n translate(v = [ 5 , -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 10,3,5 , holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew,logo=false);\r\n }\r\n}\r\n\r\n\/\/ ======================================================= END of draw\r\n\/\/ Module sections\r\n\r\nmodule put_pilogo(w,h,mx,mh,mt) {\r\n fn=\"raspberrypi_logo.dxf\";\r\n \/\/ calculate the scale and which offset to use\r\n scx=(w- (mx*2)) \/ 155.0;\r\n ofsy= (h - mh) - (205.0*scx);\r\n\r\n translate(v=[mx+toplogopc,ofsy-toplogotm,0]) linear_extrude(height=mt) import(file=fn, scale=scx);\r\n}\r\n\r\nmodule make_deckholes(no,w,d,step,v) {\r\nfor ( i = [0 : 1 : no - 1] ) {\r\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) rotate(a=v) cube([w,d, box_thickness+18], center=true);\r\n }\r\n}\r\n\r\n\r\n\/\/ create a deck or insert\r\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\r\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\r\n ofs1=4;\r\n ofs2=w - ofs1 - hole_w;\r\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\r\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\r\n color(CASEcolor) {\r\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\r\n difference() {\r\n cube([w, d, box_thickness], center = false);\r\n if (top && !logo && holes && hole_size>0) {\r\n\/\/ if (holeangle1 != [0,0,0]) {\r\n\/\/ translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle1);\r\n\/\/ translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle2);\r\n\/\/ } else {\r\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle1);\r\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle2);\r\n\/\/ }\r\n }\r\n if (screwholes) {\r\n \/\/ --- 2x screw holes in bottom for mounting\r\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\r\n \/\/ 2nd screw hole\r\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\r\n if (!holes) {\r\n \/\/ middle screw hole\r\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\r\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\r\n }\r\n }\r\n if (holes && !top) {\r\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep,holeangle1);\r\n }\r\n if (logo) {\r\n if (toplogohole) {\r\n if (!topholes) {\r\n translate(v=[0,0,-1],center=false) put_pilogo(w,d,2,4,box_thickness+1.2);\r\n } else {\r\n if (!middle) {\r\n translate(v=[0,0,-1],center=false) put_pilogo(w,d-14,5,0,box_thickness+3.2);\r\n }\r\n }\r\n } else {\r\n if (toplogosunken) {\r\n color(LOGOcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) {\r\n translate(v=[2,0,0],center=false) scale([ 0.1, 0.1, 1 ]) linear_extrude(height = 0.32) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n } else {\r\n translate(v=[10,14,box_thickness-0.3],center=false) scale([ 0.2, 0.2, 1 ]) linear_extrude(height = 0.32) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n }\r\n } else {\r\n color(CASEcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) cube([20,20, 30], center = false);\r\n } else {\r\n translate(v=[(w-30)\/2,14,box_thickness-0.3],center=false) cube([30,d-41, 30], center = false);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (logo && topholes) {\r\nfor ( i = [d-17 : hole_step : d - hole_ofs] ) {\r\n \/\/ thru hole\r\n translate(v = [ofs1,box_thickness+i+3,-1]) {\r\n cube([hole_w, hole_size-1, box_thickness+3], center = false);\r\n }\r\n translate(v = [ofs2,box_thickness+i+3,-1]) {\r\n cube([hole_w, hole_size-1, box_thickness+3], center = false);\r\n }\r\n }\r\n }\r\n }\r\n color(CASEcolor) {\r\n if (feet) {\r\n translate(v=[3,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[3,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n }\r\n if (top && !logo && holes) {\r\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\r\n }\r\n if (middle) {\r\n \/\/ --- solid area for sticker\r\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\r\n if (logo) {\r\n cube([20,20, box_thickness-0.3], center = false);\r\n } else {\r\n cube([20,20, box_thickness], center = false);\r\n }\r\n }\r\n }\r\n }\r\n if (logo && !toplogohole) {\r\n if (!toplogosunken) {\r\n color(LOGOcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) {\r\n translate(v=[2,0,0],center=false) scale([ 0.1, 0.1, 1 ]) linear_extrude(height = 0.3) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n } else {\r\n translate(v=[10.5,14,box_thickness-0.3],center=false) scale([ 0.2, 0.2, 1 ]) linear_extrude(height = 0.3) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\r\n translate(v = [x, y, -1]) {\r\n difference() {\r\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\r\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\r\n }\r\n }\r\n}\r\n\r\n\r\nmodule make_topcomponents() {\r\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\r\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\r\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\r\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\r\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\r\n\r\n \/\/SND\r\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\r\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\r\n\r\n \/\/RCA\r\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\r\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\r\n }\r\n for ( i = [0 : 1 : 12] ) {\r\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n\r\n }\r\n}\r\n\r\nmodule make_connholes() {\r\n \/\/ =================================== cut outs, offset from 0,0\r\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\r\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\r\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\r\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\r\n\r\n \/\/power: 3.4mm offset, 8mm width, 3mm height\r\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\r\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\r\n if (pcb_h >= (Csd_h+1.5) ) {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\r\n } else {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\r\n }\r\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\r\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\r\n\r\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\r\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\r\n\r\n \/\/ RCA: 35mm offset, 10mm width 10mm height\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\r\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\r\n }\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\r\n cube([5,Crca_r+2,Crca_r\/2+1]);\r\n }\r\n}\r\n\r\nmodule make_pcb() {\r\n translate(v=[box_w1,box_l1,pcb_h]) {\r\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\r\n }\r\n color(CONNcolor) {\r\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\r\n }\r\n make_topcomponents();\r\n}\r\n\r\n\/\/ put extra supports on free spaces, used beta board image\r\nmodule make_supports() {\r\n if (!bottomframe) {\r\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n }\r\n}\r\n\r\n\/\/ width,depth,height,boxthickness,ledgethickness\r\nmodule make_case(w,d,h,bt,lt) {\r\n dt=bt+lt; \/\/ box+ledge thickness\r\n bt2=bt+bt; \/\/ 2x box thickness\r\n \/\/ Now we just substract the shape we have created in the four corners\r\n color(CASEcolor) difference() {\r\n cube([w,d,h], center=false);\r\n if (rounded) {\r\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\r\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\r\n }\r\n \/\/ empty inside, but keep a ledge for strength\r\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\r\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\r\n \/\/ remove bottom and top deck\r\n translate(v = [box_thickness+5, box_thickness+5,-2]) {\r\n cube([inside_w-10, inside_l-10, box_h+4], center = false);\r\n }\r\n }\r\n if (!topframe) {\r\n if (!topinlet) {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo,top=true);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness*2, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo,top=true);\r\n }\r\n }\r\n if (!bottomframe) {\r\n if (!bottominlet) {\r\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,logo=false,top=false);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_thickness, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,logo=false,top=false);\r\n }\r\n if (bottomsupport) {\r\n make_supports();\r\n }\r\n }\r\n}\r\n\r\nmodule make_stud(x,y,z,w,h,l) {\r\n translate(v = [x, y, z]) cube([w, l, h], center = false);\r\n}\r\n\r\nmodule set_cutout(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\r\n}\r\n\r\nmodule set_cutoutv(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\r\n}\r\n\r\nmodule draw_pcbhold() {\r\n if (bottomclick) {\r\n color(CASEcolor) {\r\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([0.9, 3,2]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([0.9,3,2]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([0.9, 3,3]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([0.9,3,3]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule split_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w1+Csd_x - 5; \/\/ min 16.5+28\r\n split4=box_w2 - 7;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\r\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\r\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\r\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\r\n}\r\n\r\nmodule remove_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7;\r\n possd1=box_w1 + Csd_x - 0.3;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\r\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\r\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\r\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\r\n if (bottompcb) {\r\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\r\n }\r\n}\r\n\r\nmodule remove_bottom() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7.1;\r\n possd1=box_w1 + Csd_x - 0.2;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\r\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\r\n}\r\n\r\nmodule draw_case(bottom, top) {\r\n difference() {\r\n union() {\r\n \/\/ make empty case\r\n difference() {\r\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\r\n if (top != 0 && bottom == 0) remove_bottom();\r\n if (top == 0 && bottom != 0) remove_top();\r\n }\r\n color(CASEcolor) {\r\n if (bottom != 0 ) {\r\n \/\/ add bottom studs for pcb\r\n \/\/ add bottom studs for pcb\r\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\r\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\r\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\r\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\r\n\r\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\r\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\r\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\r\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\r\n\r\n\r\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n\r\n draw_pcbhold();\r\n }\r\n\r\n if (top != 0) {\r\n \/\/ --- screw connection plates\r\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\r\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\r\n }\r\n translate(v = [box_w2-10, box_l2 - 1.5, casesplit - 5.4]) {\r\n cube([10, 1.5, box_h-(casesplit-5.4)], center = false);\r\n }\r\n \/\/ extra support for shell\r\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\r\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\r\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\r\n\t\t\t\t\t }\r\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\r\n cube([stud_w,10, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n }\r\n } \/\/ color\r\n } \/\/ end union\r\n \/\/ conn plate hole\r\n color(CASEcolor) {\r\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n if (GPIOHOLE == 1 && bottom != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \r\n }\r\n if (GPIOHOLE == 2 && top != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \r\n }\r\n }\r\n if (bottom != 0) {\r\n if (top == 0) {\r\n remove_top();\r\n } else {\r\n split_top();\r\n }\r\n }\r\n make_connholes();\r\n }\r\n if (bottom) {\r\n draw_pcbhold();\r\n if (DRAWpcb == 1) make_pcb();\r\n }\r\n} \/\/ end module\r\n","old_contents":"\/\/ Raspberry Pi Case\r\n\/\/ Hans Harder 2012\r\n\/\/\r\n\/\/ Warning: this is based on the Beta board dimensions...\r\n\/\/ so production models can be slightly different\r\n\/\/ for instance SD card holder height and USB socket dimensions\r\n\/\/\r\n\/\/ Since all connectors stick out, case is split on HDMI height\r\n\/\/ so the power and sdcard holder goes in first and then the pcb drops into place.\r\n\/\/\r\n\/\/ v2: Adapted version after some suggestions from David...\r\n\/\/ removed feet, made both surface flat\r\n\/\/ v3: Added fliptop option and smooth the corners of the box\r\n\/\/ v4: Different levels of case split (make it 3d printable, thx David)\r\n\/\/ Looks strange but it fits...\r\n\/\/ Added frame mode (so no bottom and top deck)\r\n\/\/ Moved screw locations due to split and added some support structures\r\n\/\/ Unsure about 2nd screw location in combination with GPIO pins\r\n\/\/ v5 relocated a lot of code in modules\r\n\/\/ SDslot location was not calculated correctly\r\n\/\/ v6 Added pcb drawing\r\n\/\/ Added colors\r\n\/\/ Cut out better so there is no debris around\r\n\/\/ DRAwvars and options seperated, so it is easier to do 1 part\r\n\/\/ Make a low as possible case, let USB stick out\r\n\/\/ v7 PCB options\r\n\/\/ Low level case optimisations\r\n\/\/ SD card location alterations\r\n\/\/ v8 adapted pcb dimensions, board is really 56mm width\r\n\/\/ adapted support studs, moved some due to component location\r\n\/\/ components locations adapted\r\n\/\/ v9 Added logo in seperate dxf file\r\n\/\/ Option added to put logo in middle or using whole deck\r\n\/\/ beautified code, kr style\r\n\/\/ v10 Added logosunken and bottomsupport structures\r\n\/\/ Bottom supports are located where no components are located\r\n\/\/ so the pcb is not only supported from the sides\r\n\/\/ Well got my case, so based on what I see I changed:\r\n\/\/ case split level changed, should be better when printed on a reprap\r\n\/\/ Removed screwholes (far to small) for fastening top and added some more studs\r\n\/\/ Made frontstud a little thicker\r\n\/\/ v11 Different splitlevel (more simple) on back\r\n\/\/ keep a little margin on back split, so that top and bottom always fit\r\n\/\/ added openlogo option\r\n\/\/ v12 Different component locations\/sizes\r\n\/\/ keep a little margin on component holes\r\n\/\/ pcbsize to 57.0 x 86.0 (actual it is 56.17 x 85.0)\r\n\/\/ made casestuds wider and added 2 minor holes for self tapping screws\r\n\/\/ v13 skip this one.... :)\r\n\/\/ v14 Production board measurements...\r\n\/\/\t small differences, sometimes components are soldered differently\r\n\/\/ keep more space\r\n\/\/ should fit like a glove...\r\n\/\/ v15 moved the rca and snd a bit to get them more centered\r\n\/\/ Thanks to lincomatic at Thingiverse\r\n\/\/ Added option for GPIO side hole in bottom or top\r\n\/\/ Added showing GPIO pins with component drawing\r\n\/\/\r\n\/\/ All parts are draw as default just disable the ones you don't want\r\nDRAWfull = 0;\r\nDRAWtop = 1;\r\nDRAWbottom = 1;\r\nDRAWtopinlet = 0;\r\nDRAWbottominlet = 0;\r\nDRAWpcb = 0;\r\n\r\nGPIOHOLE = 2; \/\/ GPIO opening in : 1=bottom 2=top\r\nGPIOsize = 2; \/\/ define height of gpiohole\r\n\r\n\/\/ select how the case should look like\r\ntopframe = false; \/\/ if false, underneath values determines how\r\ntopinlet = false; \/\/ false is outside, otherwise it is with an indent\r\ntopholes = true;\r\n\/\/ ---- top holes sizes\r\n\/\/holeofs=5;\t\t\t\t\t\t\/\/ 2 for fish1, 10 for fish2, 5 for holes\r\n\/\/holesiz=2;\r\n\/\/holelen=30;\r\n\/\/holestep=5.2;\r\n\/\/noholes=12;\r\n\/\/holeangle1=[0,0, 0];\t\t \/\/ , 30] for fish1 and ,-30] for fish2 ,0] for holes\r\n\/\/holeangle2=[0,0, 0];\t\t \/\/ ,-30] for fish1 and , 30] for fish2 ,0] for holes\r\n\/\/ ---- bottom holes sizes\r\nholeofs=5;\r\nholesiz=2.5;\r\nholestep=6;\r\nnoholes=12;\t\t\t\t\t\/\/ 12 for top, 20 for bottom\r\nholelen=30;\r\nholeangle1=[0,0, 0];\r\ntopmiddle = false;\r\ntoplogo = false;\r\ntoplogopc = -1; \/\/ 0 0 placement correction of logo\r\ntoplogoxm = 0; \/\/ 3 6 leftmargin of logo\r\ntoplogotm = -1; \/\/ 12 15 topmargin of logo\r\ntoplogohole = false;\r\ntoplogosunken=false; \/\/ true or false, no idea if this works on a reprap\r\n\r\nbottomframe = false; \/\/ if false, underneath values determines how\r\nbottominlet = false;\r\nbottomholes = false;\r\nbottomscrew = false;\r\nbottomfeet = true;\r\nbottomsupport = false; \/\/ Added extra support locations for pcb\r\nbottomclick = true;\r\nbottompcb = false;\t\t \/\/ just a pcb holder without a top\r\n\r\nbox_thickness = 2.0; \/\/ minimum = 1.0\r\ninside_h = 12.1; \/\/ 12.1 = lowprofile 16.5 is full height\r\npcb_h = 5.6; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/pcb_h = box_thickness+3.5; \/\/ height needed for SD holder and solder points of pcb\r\n\/\/ 4.1 = no deck, box_thickness+3.5 is with deck\r\n\r\n\/\/ just some colors to see the difference\r\nCASEcolor=\"Maroon\";\r\nCONNcolor=\"Silver\";\r\nLOGOcolor=\"White\";\r\n\r\n\/\/ Define Raspberry Pi pcb dimensions in mm\r\ninside_l = 86.0; \/\/85.00 is largest length reported, so a bit room on each side\r\ninside_w = 57.0; \/\/56.17 is largest width reported, so a bit room on each side\r\npcb_thickness = 1.6;\r\n\r\n\/\/ Coordinates based on RJ45 corner = 0,0,0\r\n\/\/ pcb connectors and locations. Based on Beta Board measurements of Gert and a real RPi\r\n\r\n\/\/ Connectors\r\nCrj45_x=2.0;\t\t\t \/\/2.0\r\nCrj45_y=-1;\r\nCrj45_w=16.4;\t\t\t\/\/ 15.4\r\nCrj45_d=21.5; \/\/21.8\r\nCrj45_h=13;\r\n\r\nCusb_x=24.5; \/\/ 23.9\r\nCusb_y=-7.7;\r\nCusb_w=13.9; \/\/ 13.3\r\nCusb_d=19.0;\t\t\t\/\/ 17.2\r\nCusb_h=15.4;\r\n\r\nCpwr_x=3.25;\t\t\t\t\/\/ 3.5 3.6\r\nCpwr_y=80.9;\r\nCpwr_w=8.6;\t\t\t\t\/\/ 7.8 7.6\r\nCpwr_d=5.6;\r\nCpwr_h=2.5;\r\n\r\nCsd_x=16.7;\r\nCsd_y=inside_l-24.0; \/\/ 30 mm is the length of a sdcard\r\nCsd_w=27.8;\r\nCsd_d=29.0;\r\nCsd_h=3.4; \/\/ under pcb\r\n\r\nChdmi_x=-1.2;\r\nChdmi_y=32.0; \/\/ 32.4 if 15.1\r\nChdmi_w=11.4;\r\nChdmi_d=17.8;\t\t\t\t \/\/ 15.7 15.3\r\nChdmi_h=6.4;\r\n\r\nCsnd_x=inside_w - 11.4;\r\nCsnd_y=16.0;\r\nCsnd_w=11.4;\r\nCsnd_d=10.0;\r\nCsnd_h=10.5;\r\nCsnd_r=6.7;\r\nCsnd_z=3.0;\r\nCsnd_l=3.4;\r\n\r\nCrca_x=inside_w - 10.0 - 2.1;\r\nCrca_y=34.2; \/\/ 34.6 was 35.2\r\nCrca_w=10.0;\r\nCrca_d=10.4; \/\/ 9.8\r\nCrca_h=13.0;\r\nCrca_r=8.6;\r\nCrca_z=4;\r\nCrca_l=10; \/\/ wild guess\r\n\r\n\r\n\r\npcb_c = pcb_h + pcb_thickness; \/\/ component height\r\ncasesplit = pcb_c + Chdmi_h; \/\/ split case at top of hdmi connector\r\necho(\"casesplit=\",casesplit);\r\necho(\"case dimensions: w=\",box_w,\" l=\",box_l,\" h=\",box_h);\r\n\r\n\/\/ side stud sizes for supporting pcb\r\nstud_w = 2;\r\nstud_l = 4;\r\n\r\n\/\/ calculate box size\r\nbox_l = inside_l + (box_thickness * 2);\r\nbox_w = inside_w + (box_thickness * 2);\r\nbox_h = pcb_c + (pcb_thickness * 2) + inside_h;\r\nbox_w1 = box_thickness;\r\nbox_w2 = box_w - box_thickness;\r\nbox_l1 = box_thickness;\r\nbox_l2 = box_l - box_thickness;\r\nbox_wc = box_w \/ 2; \/\/ center width\r\nbox_lc = box_l \/ 2; \/\/ center length\r\nbox_t2 = box_thickness \/ 2.0; \/\/ half box_thickness\r\nmiddle = true;\r\n\/\/ rounded corners\r\ncorner_radius = box_thickness*2;\r\n\r\n\r\n\r\n\/\/ count no of items to draw\r\nDRAWtotal = DRAWfull + DRAWtop + DRAWbottom + DRAWtopinlet + DRAWbottominlet;\r\n\r\n\/\/ ====================================================== DRAW items\r\n\/\/ if one draw it centered\r\nif (DRAWtotal == 1) {\r\n translate(v = [ -box_w\/2, -box_l \/ 2, 0]) {\r\n if (DRAWfull ) {\r\n draw_case(0,1);\r\n translate(v=[0,0,0.2]) draw_case(1,0);\r\n }\r\n if (DRAWtop ) {\r\n rotate(a=[0,180,0]) translate(v=[-box_w,0,-box_h]) draw_case(0,1);\r\n }\r\n if (DRAWbottom) draw_case(1,0);\r\n if (DRAWtopinlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo);\r\n if (DRAWbottominlet) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew,logo=false);\r\n }\r\n} else {\r\n\/\/ draw each one on there one location\r\n if (DRAWfull) {\r\n translate(v = [ box_w+20, -box_l \/ 2, 0]) {\r\n draw_case(1,0);\r\n translate(v=[0,0,0.2]) draw_case(0,1);\r\n }\r\n }\r\n if (DRAWbottom) {\r\n translate(v = [ 5, 5, 0]) draw_case(1,0);\r\n }\r\n if (DRAWtop) {\r\n translate(v = [ - 5, 5, box_h]) rotate(a=[0,180,0]) draw_case(0,1);\r\n }\r\n if (DRAWtopinlet) {\r\n translate(v = [ -box_w-5, -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo);\r\n }\r\n if (DRAWbottominlet) {\r\n translate(v = [ 5 , -box_l-5, 0]) make_deck(inside_w-5,inside_l-5,0, 10,3,5 , holes=bottomholes,feet=true,middle=false,screwholes=bottomscrew,logo=false);\r\n }\r\n}\r\n\r\n\/\/ ======================================================= END of draw\r\n\/\/ Module sections\r\n\r\nmodule put_pilogo(w,h,mx,mh,mt) {\r\n fn=\"raspberrypi_logo.dxf\";\r\n \/\/ calculate the scale and which offset to use\r\n scx=(w- (mx*2)) \/ 155.0;\r\n ofsy= (h - mh) - (205.0*scx);\r\n\r\n translate(v=[mx+toplogopc,ofsy-toplogotm,0]) linear_extrude(height=mt) import(file=fn, scale=scx);\r\n}\r\n\r\nmodule make_deckholes(no,w,d,step,v) {\r\nfor ( i = [0 : 1 : no - 1] ) {\r\n translate(v=[w\/2,(i*step)+(step\/2),box_thickness\/2]) rotate(a=v) cube([w,d, box_thickness+18], center=true);\r\n }\r\n}\r\n\r\n\r\n\/\/ create a deck or insert\r\nmodule make_deck(w,d,z,hole_no,hole_size,hole_step) {\r\n hole_w=(w - 12) \/ 2; \/\/ change 12 for middle piece size\r\n ofs1=4;\r\n ofs2=w - ofs1 - hole_w;\r\n hole_ofs= ((d - hole_no*hole_step) \/ 2) - box_thickness\/2;\r\n translate(v = [(box_w-w)\/2, (box_l-d)\/2,z]) {\r\n color(CASEcolor) {\r\n echo(\"deck : z=\",z,\" w=\",w+0.01,\" d=\",d+0.01);\r\n difference() {\r\n cube([w, d, box_thickness], center = false);\r\n if (top && !logo && holes && hole_size>0) {\r\n\/\/ if (holeangle1 != [0,0,0]) {\r\n\/\/ translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle1);\r\n\/\/ translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle2);\r\n\/\/ } else {\r\n translate(v=[-1,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle1);\r\n translate(v=[w\/2-2,hole_ofs+holeofs,-0.1]) make_deckholes(noholes,holelen,holesiz,holestep,holeangle2);\r\n\/\/ }\r\n }\r\n if (screwholes) {\r\n \/\/ --- 2x screw holes in bottom for mounting\r\n translate(v = [w\/2 - 4, 10-4, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 - 4, 10-3, -1]) cylinder(r=3, h=8, $fn=100, center=true);\r\n \/\/ 2nd screw hole\r\n translate(v = [w\/2 - 3, d - 10 +3, -1]) cube([8, 3, 5], center = false);\r\n translate(v = [w\/2 + 4, d - 10 +4, -1]) cylinder(r=3, h=8, $fn=100);\r\n if (!holes) {\r\n \/\/ middle screw hole\r\n translate(v = [w\/2 - 4, d\/2 , -1]) cube([8, 2, 5], center = false);\r\n translate(v = [w\/2 - 4, d\/2 + 1, -1]) cylinder(r=2, h=8, $fn=100);\r\n }\r\n }\r\n if (holes && !top) {\r\n translate(v=[(w-hole_w)\/2,holeofs,-0.1]) make_deckholes(noholes,hole_w,holesiz,holestep,holeangle1);\r\n }\r\n if (logo) {\r\n if (toplogohole) {\r\n if (!topholes) {\r\n translate(v=[0,0,-1],center=false) put_pilogo(w,d,2,4,box_thickness+1.2);\r\n } else {\r\n if (!middle) {\r\n translate(v=[0,0,-1],center=false) put_pilogo(w,d-14,5,0,box_thickness+3.2);\r\n }\r\n }\r\n } else {\r\n if (toplogosunken) {\r\n color(LOGOcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) {\r\n translate(v=[2,0,0],center=false) scale([ 0.1, 0.1, 1 ]) linear_extrude(height = 0.32) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n } else {\r\n translate(v=[10,14,box_thickness-0.3],center=false) scale([ 0.2, 0.2, 1 ]) linear_extrude(height = 0.32) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n }\r\n } else {\r\n color(CASEcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) cube([20,20, 30], center = false);\r\n } else {\r\n translate(v=[(w-30)\/2,14,box_thickness-0.3],center=false) cube([30,d-41, 30], center = false);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (logo && topholes) {\r\nfor ( i = [d-17 : hole_step : d - hole_ofs] ) {\r\n \/\/ thru hole\r\n translate(v = [ofs1,box_thickness+i+3,-1]) {\r\n cube([hole_w, hole_size-1, box_thickness+3], center = false);\r\n }\r\n translate(v = [ofs2,box_thickness+i+3,-1]) {\r\n cube([hole_w, hole_size-1, box_thickness+3], center = false);\r\n }\r\n }\r\n }\r\n }\r\n color(CASEcolor) {\r\n if (feet) {\r\n translate(v=[3,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,3,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[3,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n translate(v=[w-3-8,d-3-8,0]) cube([8, 8, box_thickness+4], center = false);\r\n }\r\n if (top && !logo && holes) {\r\n translate(v = [w\/2-box_thickness,12,0]) cube([4,d-13, box_thickness], center = false);\r\n }\r\n if (middle) {\r\n \/\/ --- solid area for sticker\r\n translate(v = [w\/2-10,d\/2-5-box_thickness\/2,0]) {\r\n if (logo) {\r\n cube([20,20, box_thickness-0.3], center = false);\r\n } else {\r\n cube([20,20, box_thickness], center = false);\r\n }\r\n }\r\n }\r\n }\r\n if (logo && !toplogohole) {\r\n if (!toplogosunken) {\r\n color(LOGOcolor) {\r\n if (middle) {\r\n translate(v = [(w-20)\/2,(d-20)\/2,box_thickness-0.3]) {\r\n translate(v=[2,0,0],center=false) scale([ 0.1, 0.1, 1 ]) linear_extrude(height = 0.3) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n } else {\r\n translate(v=[10.5,14,box_thickness-0.3],center=false) scale([ 0.2, 0.2, 1 ]) linear_extrude(height = 0.3) import_dxf(file = \"raspberrypi_logo.dxf\");\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule rounded_corner(x,y,rx,ry,cx,cy) {\r\n translate(v = [x, y, -1]) {\r\n difference() {\r\n translate(v=[rx,ry,0]) cube([corner_radius,corner_radius,box_h+2], center=false);\r\n translate(v=[cx, cy, -1]) cylinder(r=corner_radius, h=box_h+2, $fn=100);\r\n }\r\n }\r\n}\r\n\r\n\r\nmodule make_topcomponents() {\r\n color(CONNcolor) translate(v=[box_w1,box_l1,pcb_c]) {\r\n translate(v=[Crj45_x,Crj45_y,0]) cube([Crj45_w,Crj45_d,Crj45_h],center=false);\r\n translate(v=[Cusb_x,Cusb_y,0]) cube([Cusb_w,Cusb_d,Cusb_h],center=false);\r\n translate(v=[Cpwr_x,Cpwr_y,0]) cube([Cpwr_w,Cpwr_d,Cpwr_h],center=false);\r\n translate(v=[Chdmi_x,Chdmi_y,0]) cube([Chdmi_w,Chdmi_d,Chdmi_h],center=false);\r\n\r\n \/\/SND\r\n translate(v=[Csnd_x,Csnd_y,0]) cube([Csnd_w+0.1,Csnd_d,Csnd_h],center=false);\r\n translate(v=[Csnd_x+Csnd_w,Csnd_y+Csnd_d\/2,Csnd_z+Csnd_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Csnd_r\/2, h=Csnd_l, $fn=100);\r\n\r\n \/\/RCA\r\n translate(v=[Crca_x,Crca_y,0]) cube([Crca_w+0.2,Crca_d,Crca_h],center=false);\r\n translate(v=[Crca_x+Crca_w,Crca_y+Crca_d\/2,Crca_z+Crca_r\/2]) rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2, h=Crca_l+0.1, $fn=100);\r\n }\r\n for ( i = [0 : 1 : 12] ) {\r\n color(\"black\") translate(v=[box_w2-6.6,box_l2-1-34+(i*2.54),pcb_c]) cube([5.08,2.53,2.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+0.97,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n color(\"Gainsboro\") translate(v=[box_w2-6.6+3.61,box_l2-1-34+(i*2.54)+0.95,pcb_c-3]) cube([0.6,0.6,11.5]);\r\n\r\n }\r\n}\r\n\r\nmodule make_connholes() {\r\n \/\/ =================================== cut outs, offset from 0,0\r\n \/\/RJ45: 2mm offset, 15.5mm width, 13.1mm height\r\n set_cutout(box_w1+Crj45_x,box_l1+Crj45_y-3,pcb_c, Crj45_w+0.1,Crj45_d+3,Crj45_h);\r\n \/\/usb: 23.9mm offset, 13.3mm width, 15.4mm height\r\n set_cutout(box_w1+Cusb_x,box_l1+Cusb_y,pcb_c, Cusb_w,Cusb_d,Cusb_h+0.1);\r\n\r\n \/\/power: 3.4mm offset, 8mm width, 3mm height\r\n set_cutout(box_w1+Cpwr_x,box_l1+Cpwr_y,pcb_c, Cpwr_w,Cpwr_d+4,Cpwr_h+0.01);\r\n \/\/sd: 15mm offset, 28mm width, 3.5mm height under pcb\r\n if (pcb_h >= (Csd_h+1.5) ) {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-28,pcb_h-Csd_h,Csd_w+0.6,box_thickness+30,Csd_h+0.1);\r\n } else {\r\n set_cutout(box_w1+Csd_x-0.3,box_l2-32,pcb_h-20,Csd_w+0.6,40,20.01);\r\n }\r\n \/\/HDMI: 32.9mm offset, 15.3mm width, 6.3mm height\r\n set_cutoutv(box_w1+Chdmi_x-3,box_l1+Chdmi_y,pcb_c, Chdmi_w+3.1,Chdmi_d,Chdmi_h+0.1);\r\n\r\n \/\/ snd: 14mm offset, 12mm width, 8.2 mm height\r\n set_cutout(box_w1+Csnd_x,box_l1+Csnd_y,pcb_c+2, Csnd_w+7,Csnd_d,Csnd_h-2);\r\n\r\n \/\/ RCA: 35mm offset, 10mm width 10mm height\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+Crca_d\/2,pcb_c+Crca_z+Crca_r\/2]) {\r\n rotate(a=90,v=[0,1,0]) cylinder(r=Crca_r\/2+1, h=Crca_l, $fn=100);\r\n }\r\n translate(v=[box_w1+Crca_x+Crca_w,box_l1+Crca_y+(Crca_d-Crca_r)\/2-1,pcb_c+Crca_z-1]) {\r\n cube([5,Crca_r+2,Crca_r\/2+1]);\r\n }\r\n}\r\n\r\nmodule make_pcb() {\r\n translate(v=[box_w1,box_l1,pcb_h]) {\r\n color(\"darkgreen\") cube([inside_w,inside_l,pcb_thickness], center=false);\r\n }\r\n color(CONNcolor) {\r\n translate(v=[box_w1+Csd_x,box_l1+Csd_y,pcb_h-Csd_h]) cube([Csd_w,Csd_d,Csd_h],center=false);\r\n }\r\n make_topcomponents();\r\n}\r\n\r\n\/\/ put extra supports on free spaces, used beta board image\r\nmodule make_supports() {\r\n if (!bottomframe) {\r\n translate(v=[box_w1+10 ,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n translate(v=[box_w2-7.5,box_l1+28,0.1]) cube([3, 2,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+7 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n translate(v=[box_w2-13 ,box_l2-35,0.1]) cube([5, 5,pcb_h-0.1]);\r\n\r\n translate(v=[box_w1+12 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n translate(v=[box_w2-9 ,box_l2-16,0.1]) cube([1.5 ,5,pcb_h-0.1]);\r\n }\r\n}\r\n\r\n\/\/ width,depth,height,boxthickness,ledgethickness\r\nmodule make_case(w,d,h,bt,lt) {\r\n dt=bt+lt; \/\/ box+ledge thickness\r\n bt2=bt+bt; \/\/ 2x box thickness\r\n \/\/ Now we just substract the shape we have created in the four corners\r\n color(CASEcolor) difference() {\r\n cube([w,d,h], center=false);\r\n if (rounded) {\r\n rounded_corner(-0.1,d+0.1, 0 ,-corner_radius, corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,d+0.1, -corner_radius,-corner_radius, -corner_radius,-corner_radius);\r\n rounded_corner(w+0.1,-0.1, -corner_radius,0 , -corner_radius, corner_radius);\r\n rounded_corner(-0.1,-0.1, 0 ,0 , corner_radius, corner_radius);\r\n }\r\n \/\/ empty inside, but keep a ledge for strength\r\n translate(v = [bt, bt, dt]) cube([w-bt2, d-bt2, h-(dt*2)], center = false);\r\n translate(v = [dt,dt,bt]) cube([w-(dt*2), d-(dt*2), h-bt2], center = false);\r\n \/\/ remove bottom and top deck\r\n translate(v = [box_thickness+5, box_thickness+5,-2]) {\r\n cube([inside_w-10, inside_l-10, box_h+4], center = false);\r\n }\r\n }\r\n if (!topframe) {\r\n if (!topinlet) {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo,top=true);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_h-box_thickness*2, 12,3,5, holes=topholes,feet=false,middle=topmiddle,screwholes=false,logo=toplogo,top=true);\r\n }\r\n }\r\n if (!bottomframe) {\r\n if (!bottominlet) {\r\n make_deck(inside_w-4,inside_l-4,0, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,logo=false,top=false);\r\n } else {\r\n make_deck(inside_w-4,inside_l-4,box_thickness, 12,3,5, holes=bottomholes,feet=bottomfeet,screwholes=bottomscrew,middle=false,logo=false,top=false);\r\n }\r\n if (bottomsupport) {\r\n make_supports();\r\n }\r\n }\r\n}\r\n\r\nmodule make_stud(x,y,z,w,h,l) {\r\n translate(v = [x, y, z]) cube([w, l, h], center = false);\r\n}\r\n\r\nmodule set_cutout(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.4, l+0.2, h+0.2], center = true);\r\n}\r\n\r\nmodule set_cutoutv(x,y,z,w,l,h) {\r\n color(CASEcolor) translate(v = [x+(w\/2), y+(l\/2), z+(h\/2)]) cube([w+0.2, l+0.4, h+0.2], center = true);\r\n}\r\n\r\nmodule draw_pcbhold() {\r\n if (bottomclick) {\r\n color(CASEcolor) {\r\n translate(v=[0 ,22,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w1-0.1 ,22.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([0.9, 3,2]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[0 ,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w1-0.1 ,61.5,pcb_c+0.1]) {\r\n difference() {\r\n cube([0.9,3,2]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,29.5,2]) cube([box_thickness,4,pcb_c]);\r\n translate(v=[box_w2+0.1 ,30+3,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([0.9, 3,3]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n translate(v=[box_w2,60.5,2]) cube([box_thickness,5,pcb_c]);\r\n translate(v=[box_w2+0.1 ,61+3.5,pcb_c+0.1]) {\r\n rotate(a=180, v=[0,0,1]) difference() {\r\n cube([0.9,3,3]);\r\n translate(v=[0.9,-0.1,0]) rotate(a=-30, v=[0,1,0]) cube([1.6, 3.2, 4]);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule split_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w1+Csd_x - 5; \/\/ min 16.5+28\r\n split4=box_w2 - 7;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit-0.2]) cube([box_w+2, 21, 0.4], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, casesplit-0.2]) cube([split1+1 , box_l, 0.4], center = false);\r\n translate(v = [split2, 20, pcb_c-0.2]) cube([split3-split2, box_l, 0.4], center = false);\r\n translate(v = [split3, 20, pcb_h-0.2]) cube([split4-split3, box_l, 0.4], center = false);\r\n translate(v = [split4, 20, casesplit-0.2]) cube([20 , box_l, 0.4], center = false);\r\n}\r\n\r\nmodule remove_top() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7;\r\n possd1=box_w1 + Csd_x - 0.3;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, casesplit]) cube([100,100, box_h], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [split1, 20, pcb_c]) cube([split3-split1, box_l, box_h], center = false);\r\n translate(v = [possd1, 60, pcb_h-0.1]) cube([widesd1, box_l, 2], center = false);\r\n\/\/ translate(v = [split1, 20, pcb_c]) cube([20, box_l, box_h], center = false);\r\n\/\/ translate(v = [split2, 20, pcb_h]) cube([split3-split2, box_l, box_h], center = false);\r\n if (bottompcb) {\r\n translate(v = [-1, -1, pcb_c]) cube([100,100, box_h], center = false);\r\n }\r\n}\r\n\r\nmodule remove_bottom() {\r\n split1=box_w1+Cpwr_x;\r\n split2=split1+Cpwr_w;\r\n split3=box_w2 - 7.1;\r\n possd1=box_w1 + Csd_x - 0.2;\r\n widesd1=Csd_w+0.6;\r\n \/\/ Different splitlevels for the shells\r\n \/\/ 1st half on split level\r\n translate(v = [-1, -1, -1]) cube([box_w+2, box_l-6, casesplit+1], center = false);\r\n \/\/ back on 3 different levels\r\n translate(v = [-1, 20, -1]) cube([box_w+2 , box_l, pcb_c+1.1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split1+1.1 , box_l, casesplit+1], center = false);\r\n translate(v = [-1, 20, -1]) cube([split2+1.1 , box_l, pcb_c+Cpwr_h+1.1], center = false);\r\n translate(v = [split3, 20, -1]) cube([20 , box_l, casesplit+1], center = false);\r\n}\r\n\r\nmodule draw_case(bottom, top) {\r\n difference() {\r\n union() {\r\n \/\/ make empty case\r\n difference() {\r\n make_case(box_w,box_l,box_h, box_thickness,stud_w, rounded=true);\r\n if (top != 0 && bottom == 0) remove_bottom();\r\n if (top == 0 && bottom != 0) remove_top();\r\n }\r\n color(CASEcolor) {\r\n if (bottom != 0 ) {\r\n \/\/ add bottom studs for pcb\r\n \/\/ add bottom studs for pcb\r\n make_stud(box_w1 , box_l1 , 0, 4,pcb_h,4); \/\/ rj45\r\n make_stud(box_w1 , box_lc-stud_l\/2, 0, stud_w,pcb_h,stud_l); \/\/ hdmi\r\n make_stud(box_w1, box_lc\/2, 0, 4,pcb_h,stud_l);\r\n make_stud(box_w1, box_lc+(box_lc\/2)-5, 0, 4,pcb_h,stud_l);\r\n\r\n make_stud(box_w1, box_l2-stud_l-8, 0, stud_w,pcb_h,stud_l); \/\/ BEFORE pwr\r\n make_stud(box_w2-stud_w, box_l1 , 0, stud_w,pcb_h,stud_l); \/\/ leds\r\n make_stud(box_w2-4, box_lc-stud_l\/2, 0, 4,pcb_h,stud_l); \/\/ RCA\r\n make_stud(box_w2-stud_w, box_l2-stud_l , 0, stud_w,pcb_h,stud_l); \/\/ GPIO\r\n\r\n\r\n translate(v=[box_w1+Cusb_x-6,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n translate(v=[box_w2-15.8 ,box_l1,1]) cube([3.0, 4,pcb_h-1.1]);\r\n\r\n draw_pcbhold();\r\n }\r\n\r\n if (top != 0) {\r\n \/\/ --- screw connection plates\r\n translate(v = [box_w1 + Crj45_x+Crj45_w, box_l1, casesplit - 5.4]) {\r\n cube([10, 3, box_h-(casesplit-5.4)], center = false);\r\n }\r\n translate(v = [box_w2-10, box_l2 - 1.5, casesplit - 5.4]) {\r\n cube([10, 1.5, box_h-(casesplit-5.4)], center = false);\r\n }\r\n \/\/ extra support for shell\r\n translate(v = [box_w1, box_l1, pcb_c+0.4]) {\r\n cube([stud_w, 8, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w1, box_l2-10, pcb_c+0.4]) {\r\n \t cube([stud_w, 10, box_h-pcb_c-1], center = false) ;\r\n\t\t\t\t\t }\r\n translate(v = [box_w1, box_l1+Chdmi_y+Chdmi_d+1.5, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1, pcb_c+0.4]) {\r\n cube([stud_w,10, box_h-pcb_c-1], center = false);\r\n }\r\n translate(v = [box_w2-stud_w, box_l1+Crca_y+Crca_d+1, pcb_c+0.4]) {\r\n cube([stud_w, 4, box_h-pcb_c-1], center = false);\r\n }\r\n }\r\n } \/\/ color\r\n } \/\/ end union\r\n \/\/ conn plate hole\r\n color(CASEcolor) {\r\n translate(v = [box_w1-5, box_l2-5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n translate(v = [box_w2-5, box_l1+5, casesplit-3]) {\r\n\t\t\t\trotate([0,90,0]) cylinder(r=0.5, h=10, $fn=100);\r\n\t\t }\r\n if (GPIOHOLE == 1 && bottom != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-GPIOsize]) cube([10,33.2,GPIOsize+0.1]); \r\n }\r\n if (GPIOHOLE == 2 && top != 0) {\r\n\t\t translate(v = [box_w2-5, box_l1+51, casesplit-0.1]) cube([10,33.2,GPIOsize]); \r\n }\r\n }\r\n if (bottom != 0) {\r\n if (top == 0) {\r\n remove_top();\r\n } else {\r\n split_top();\r\n }\r\n }\r\n make_connholes();\r\n }\r\n if (bottom) {\r\n draw_pcbhold();\r\n if (DRAWpcb == 1) make_pcb();\r\n }\r\n} \/\/ end module\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b8e3f8904227911e5f7c853c4fca88b1f63d4db2","subject":"First shot at a simple test of cuts\/kerf widths on the laser cutter.","message":"First shot at a simple test of cuts\/kerf widths on the laser cutter.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/cut_test.scad","new_file":"designs\/cut_test.scad","new_contents":"\/\/ Dimensions are in mm\nheight = 10;\nmincut = 0.05;\nmaxcut = 0.3;\ncutstep = 0.025;\ncutshift = maxcut + 0.5;\nnumcuts = ((maxcut - mincut) \/ cutstep + 1);\nwidth = cutshift * numcuts;\n\nprojection(cut=false) testobj();\n\nmodule testobj() {\n difference () {\n cube([width, height, 0.1]);\n for (i = [0 : numcuts]) {\n translate([cutshift * (i+1), 0, -50])\n cube([mincut + cutstep*i, height\/2, 100]);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'designs\/cut_test.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c66199a4f8560335a84db04467b9716df9fe0ad4","subject":"xaxis\/ends: Don't need to support entire z nut","message":"xaxis\/ends: Don't need to support entire z nut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+5*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-3*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, trap_axis=[1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=100, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n cylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2, 0,0])\n cylindera(h=width\/2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=100, orient=[1,0,0], align=[1,0,0]);\n\n translate([width\/2-1*mm, 0,0])\n hull()\n {\n rotate([90,0,0])\n translate([0,0,-1])\n screw_nut(MHexNutM4, tolerance=1.15, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,-10,0])\n rotate([90,0,0])\n screw_nut(MHexNutM4, tolerance=1.15, orient=[1,0,0], align=[-1,0,0]);\n }\n\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+5*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-3*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, trap_axis=[1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=100, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n cylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2, 0,0])\n cylindera(h=width\/2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=100, orient=[1,0,0], align=[1,0,0]);\n\n translate([width\/2-1*mm, 0,0])\n hull()\n {\n rotate([90,0,0])\n translate([0,0,-1])\n screw_nut(MHexNutM4, tolerance=1.15, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,-10,0])\n rotate([90,0,0])\n screw_nut(MHexNutM4, tolerance=1.15, orient=[1,0,0], align=[-1,0,0]);\n }\n\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1f8ea2abde8fa5125b2c8bae30f45b418268f31a","subject":"x\/carriage: extruder wip","message":"x\/carriage: extruder wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nif(false)\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\nextruder_b_mount_offsets=[\n [-1*(extruder_b_w\/2+4*mm),0,0],\n [+1*(extruder_b_w\/2+4*mm),0,0],\n [-4*mm,0,44.5*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut, $fn=50);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut, $fn=50);\n }\n\n translate(extruder_guidler_mount_off)\n {\n hull()\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([-guidler_mount_d,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nif(false)\n{\n \/*x_carriage_withmounts(show_vitamins=true);*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n \/*difference()*\/\n \/*{*\/\n \/*extruder_b(part=\"pos\");*\/\n\n \/*extruder_b(part=\"neg\");*\/\n \/*}*\/\n \/*extruder_b(part=\"vit\");*\/\n\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=true);*\/\n \/*}*\/\n\n \/*x_extruder_hotend();*\/\n\n \/*\/\/filament path*\/\n \/*translate(extruder_filapath_offset)*\/\n \/*cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);*\/\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n rotate([-90,0,0])\n extruder_a();\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2bfe62361921b2fe12212496843959fc78832aa3","subject":"Add sample to demo the render modes feature","message":"Add sample to demo the render modes feature\n","repos":"jsconan\/camelSCAD","old_file":"samples\/render-modes.scad","new_file":"samples\/render-modes.scad","new_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * Rendering mode.\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ Only include the core of the library as only the render mode helpers are needed\nuse <..\/core.scad>\n\n\/\/ Defines the list of shapes sizes\nDEMO_RANGE = [1 : 10];\n\n\/\/ The space between each shape on the same line\nDEMO_STEP = 5;\n\n\/\/ The start offset of a line\nDEMO_OFFSET_X = 20;\n\n\/\/ The space between two lines\nDEMO_OFFSET_Y = 30;\n\n\/\/ The size of the displayed text (the name of illustrated render mode)\nDEMO_FONT_SIZE = 10;\n\n\/\/ The list of render modes to illustrate\nDEMO_MODES = [\n [[.5, 0, 0], \"dirty\"],\n [[0, .5, 0], \"dev\"],\n [[0, 0, .5], \"prod\"],\n];\n\n\/**\n * Will illustrate the current render mode by drawing some shapes\n * @param String mode\n *\/\nmodule demo(mode) {\n \/\/ Draw some shapes\n for(i = DEMO_RANGE) {\n translate([DEMO_OFFSET_X + DEMO_STEP * i, 0, 0]) {\n sphere(i);\n }\n }\n\n \/\/ Display the mode name\n text(mode, DEMO_FONT_SIZE, halign=\"center\", valign=\"center\");\n}\n\n\/**\n * Sets the minimum facet angle and size using the default render mode.\n *\/\n$fa = facetAngle();\n$fs = facetSize();\n\n\/**\n * Will apply each render mode and will illustrate them by drawing some shapes\n *\/\ntranslate([DEMO_OFFSET_X, 0, 0]) {\n demo(\"default\");\n}\nfor (i = [0 : len(DEMO_MODES) - 1]) {\n translate([DEMO_OFFSET_X, (i + 1) * DEMO_OFFSET_Y, 0]) {\n color(DEMO_MODES[i][0]) {\n mode = DEMO_MODES[i][1];\n\n $fa = facetAngle(mode);\n $fs = facetSize(mode);\n\n demo(mode);\n }\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/render-modes.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"424eee347238e7607790da62ab0e4ebb85e110c1","subject":"add a version of the Customizer for Thingiverse","message":"add a version of the Customizer for Thingiverse\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/christmas-story\/lamp-shade\/customizer\/inlined\/lamp-shade-customizer.scad-inlined.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/christmas-story\/lamp-shade\/customizer\/inlined\/lamp-shade-customizer.scad-inlined.scad","new_contents":"\nouterRadius = 15; \/\/ [10 : 60]\nsquareLength = 20; \/\/ [10 : 30]\nxScale = 0.5; \/\/ [0.1 : 0.1 : 2.0]\nyScale = 0.7; \/\/ [0.1 : 0.1 : 2.0]\n\n\nlampShade(outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n\nmodule lampShade(fn = 160,\n intersection_xTranslate = -20,\n outerRadius = 10,\n squareLength = 10,\n xScale = 1.0,\n yScale = 1.0)\n{\n $fn = fn;\n\n innerRadius = outerRadius - 2.0;\n\n rotate_extrude(angle = 360)\n translate([intersection_xTranslate, 0, 0])\n intersection()\n {\n difference()\n {\n scale([xScale, yScale, 1])\n circle(r = outerRadius, $fn = fn);\n\n scale([xScale, yScale, 1])\n circle(r = innerRadius, $fn = fn);\n }\n\n \/\/ use a value of of 0 to invert the shade (widder top)\n translate([0, -squareLength, 0])\n square([squareLength, squareLength]);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/models\/src\/main\/openscad\/lamps\/christmas-story\/lamp-shade\/customizer\/inlined\/lamp-shade-customizer.scad-inlined.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2440bfc0c59b1fe4d5adf878e458b14ae1c973f6","subject":"screws: add set screws and with_nut_cut","message":"screws: add set screws and with_nut_cut\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nfunction get_screw_head_d(head, thread) =\n(head==\"socket\" || head == \"button\") ?\n 2 * get(ThreadSize, thread)\n:\nhead == \"set\" ? 0\n:\n0;\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_cut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U && with_nut_cut)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n else if(part==\"neg\")\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f);\n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"set\")\n {\n }\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head=\"socket\", trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, head=head, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4b1ce1c316d77a73be29bccb5ca874fac10abb94","subject":"movida function","message":"movida function\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/base.scad","new_file":"class1\/exercise\/refactor\/base.scad","new_contents":"include ;\n\nDIAMETER_BASE = 6;\nDIAMETER_OUTER_RING = 0.6;\nTHICKNESS = 0.3; \n\nfunction radius(diameter) = diameter \/ 2;\n\nmodule base()\n{\n surface();\n border();\n}\n\nmodule surface()\n{\n offset_z = - HEIGHT_BODY - THICKNESS;\n offset = [0, 0, offset_z];\n \n diameter_total = DIAMETER_BASE - DIAMETER_OUTER_RING;\n \n color(GREY)\n translate(offset)\n cylinder(h = THICKNESS, d = diameter_total, $fn = FINE);\n}\n\nmodule border()\n{\n offset_z = -HEIGHT_BODY;\n offset_base = [0, 0, offset_z];\n \n offset_x = radius(DIAMETER_BASE) - radius(DIAMETER_OUTER_RING);\n offset_border = [offset_x, 0, 0];\n \n color(GREY)\n translate(offset_base)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(offset_border)\n circle(r = THICKNESS, $fn = FINE);\n}\n\nbase();","old_contents":"include ;\n\nDIAMETER_BASE = 6;\nDIAMETER_OUTER_RING = 0.6;\nTHICKNESS = 0.3; \n\nmodule base()\n{\n surface();\n border();\n}\n\nmodule surface()\n{\n offset_z = - HEIGHT_BODY - THICKNESS;\n offset = [0, 0, offset_z];\n \n diameter_total = DIAMETER_BASE - DIAMETER_OUTER_RING;\n \n color(GREY)\n translate(offset)\n cylinder(h = THICKNESS, d = diameter_total, $fn = FINE);\n}\n\nmodule border()\n{\n offset_z = -HEIGHT_BODY;\n offset_base = [0, 0, offset_z];\n \n offset_x = radius(DIAMETER_BASE) - radius(DIAMETER_OUTER_RING);\n offset_border = [offset_x, 0, 0];\n \n color(GREY)\n translate(offset_base)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(offset_border)\n circle(r = THICKNESS, $fn = FINE);\n}\n\nbase();\n\nfunction radius(diameter) = diameter \/ 2;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"aef30f3dd48d093d4c052b16600f3ecfc9210c25","subject":"shapes: Fix pie_slice orient","message":"shapes: Fix pie_slice orient\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=undef, align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,0], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, align=align)\n translate([0,0,-h\/2])\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n \/*stack(dist=10, axis=[0,0,-1])*\/\n \/*{*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=-180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n \/*}*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"982079793a1157ee522b25df4bcabd641f7ebf87","subject":"Optional number of fingers in box","message":"Optional number of fingers in box\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=4,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"0b0c55d6e04dd7af292dd8078f5cbc30dc3b4d42","subject":"added extra spacing for hinge","message":"added extra spacing for hinge\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_case\/top_aa.scad","new_file":"battery_case\/top_aa.scad","new_contents":"use \nuse \ninclude \n\nholeR = (screwDiameter+1)\/2;\n\nmodule topAA()\n{\n gondola();\n \/\/ hinge\n difference()\n {\n translate([sizeOX, (sizeOY+2)\/2-4-0.5, 0])\n {\n cube([7, 4, sizeOZ\/2]);\n translate([1,0,sizeOZ\/2])\n {\n cube([2*holeR+2*1, 4, 1+holeR]);\n translate([holeR+1, 4, holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR+1, h=4, $fs=0.01);\n }\n }\n \/\/ hole\n translate([sizeOX+holeR+2, (sizeOY+2)\/2+18\/2-0.5, sizeOZ\/2+holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR, h=18, $fs=0.01);\n }\n \/\/ catch\n translate([-1, (sizeOY+2)\/2-(6+2*3)\/2, 0])\n {\n difference()\n {\n union()\n {\n cube([1, 6+2*3, sizeOZ-4]);\n translate([-1, 0, sizeOZ\/2+3])\n cube([1, 6+2*3, sizeOZ\/2-3]);\n }\n translate([-1, 2, sizeOZ\/2])\n cube([1+2*1, 6+2*1, 2+2*0.5]);\n }\n }\n}\n\ntopAA();\n%batteriesPack([margin, margin, margin]);\n","old_contents":"use \nuse \ninclude \n\nholeR = (screwDiameter+1)\/2;\n\nmodule topAA()\n{\n gondola();\n \/\/ hinge\n difference()\n {\n translate([sizeOX, (sizeOY+2)\/2-4, 0])\n {\n cube([7, 4, sizeOZ\/2]);\n translate([1,0,sizeOZ\/2])\n {\n cube([2*holeR+2*1, 4, 1+holeR]);\n translate([holeR+1, 4, holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR+1, h=4, $fs=0.01);\n }\n }\n \/\/ hole\n translate([sizeOX+holeR+2, (sizeOY+2)\/2+18\/2, sizeOZ\/2+holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR, h=18, $fs=0.01);\n }\n \/\/ catch\n translate([-1, (sizeOY+2)\/2-(6+2*3)\/2, 0])\n {\n difference()\n {\n union()\n {\n cube([1, 6+2*3, sizeOZ-4]);\n translate([-1, 0, sizeOZ\/2+3])\n cube([1, 6+2*3, sizeOZ\/2-3]);\n }\n translate([-1, 2, sizeOZ\/2])\n cube([1+2*1, 6+2*1, 2+2*0.5]);\n }\n }\n}\n\ntopAA();\n%batteriesPack([margin, margin, margin]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5d38bb951163c90221dc560d53c02a3f77608166","subject":"Remove excessive path parameter on calling to polygon()","message":"Remove excessive path parameter on calling to polygon()\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, paths=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"0865eff3ed0da80ae9342a747f7438959e414dd9","subject":"fixed internal tube depth, decreased spacing a bit and increased rounding of edges","message":"fixed internal tube depth, decreased spacing a bit and increased rounding of edges\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"u-lock_kryptonite_cap\/u-lock_kryptonite_cap.scad","new_file":"u-lock_kryptonite_cap\/u-lock_kryptonite_cap.scad","new_contents":"wall=2;\nspacing=0.4;\nr_int=30.5\/2;\nr_round=4;\nr_tube=16.5\/2;\nh=25;\nmagnet_size=[5, 5, 2];\n$fn=1\/3*360;\n\n\nmodule ring_(r_ring, r_round)\n{\n\/\/ $fn=200;\n rotate_extrude()\n translate([r_ring-r_round, 0, 0])\n circle(r=r_round);\n}\n\nmodule rounded_cylinder_(r_cyl, r_round, h)\n{\n translate(r_round*[0,0,1])\n {\n for(dz=[0,h-2*r_round])\n translate([0,0,dz])\n hull()\n ring_(r_cyl, r_round);\n cylinder(r=r_cyl, h=h-2*r_round);\n }\n}\n\nmodule empty_cylinder_()\n{\n \n difference()\n {\n rounded_cylinder_(r_int + spacing + wall, r_round, h);\n translate(wall*[0,0,1])\n rounded_cylinder_(r_int + spacing, r_round, h);\n }\n}\n\nmodule internal_tube_()\n{\n rts=r_tube - spacing;\n th=5.5+spacing;\n sp_size=magnet_size + spacing*[2,2,0];\n difference()\n {\n cylinder(r=rts, h=th);\n for(dy=[-1,1])\n translate(dy*[0, 3.5, 0]) \/\/ offset\n translate([-sp_size[0]\/2, -sp_size[1]\/2, th-sp_size[2]]) \/\/ center\n cube(sp_size);\n }\n}\n\nmodule cap()\n{\n empty_cylinder_();\n translate(wall*[0,0,1])\n internal_tube_();\n}\n\n\ncap();\n","old_contents":"wall=2;\nspacing=0.5;\nr_int=30.5\/2;\nr_round=wall;\nr_tube=16.5\/2;\nh=25;\nmagnet_size=[5, 5, 2];\n$fn=1\/3*360;\n\n\nmodule ring_(r_ring, r_round)\n{\n\/\/ $fn=200;\n rotate_extrude()\n translate([r_ring-r_round, 0, 0])\n circle(r=r_round);\n}\n\nmodule rounded_cylinder_(r_cyl, r_round, h)\n{\n translate(r_round*[0,0,1])\n {\n for(dz=[0,h-2*r_round])\n translate([0,0,dz])\n hull()\n ring_(r_cyl, r_round);\n cylinder(r=r_cyl, h=h-2*r_round);\n }\n}\n\nmodule empty_cylinder_()\n{\n \n difference()\n {\n rounded_cylinder_(r_int + spacing + wall, r_round, h);\n translate(wall*[0,0,1])\n rounded_cylinder_(r_int + spacing, r_round, h);\n }\n}\n\nmodule internal_tube_()\n{\n rts=r_tube - spacing;\n th=3.5+spacing;\n sp_size=magnet_size + spacing*[2,2,0];\n difference()\n {\n cylinder(r=rts, h=th);\n for(dy=[-1,1])\n translate(dy*[0, 3.5, 0]) \/\/ offset\n translate([-sp_size[0]\/2, -sp_size[1]\/2, th-sp_size[2]]) \/\/ center\n cube(sp_size);\n }\n}\n\nmodule cap()\n{\n empty_cylinder_();\n translate(wall*[0,0,1])\n internal_tube_();\n}\n\n\ncap();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bb281c7e3b48d8772c507fa309335a386b4275be","subject":"Print-ready form of Typeatron Mark 1. Will double-check all measurements and clean up the code a bit before printing.","message":"Print-ready form of Typeatron Mark 1. Will double-check all measurements and clean up the code a bit before printing.\n","repos":"joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn","old_file":"typeatron\/mark1\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/typeatron-mark1.scad","new_contents":"\/\/ The origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\n\/\/ with the thumb to the north (the y axis), the fingers of the left hand to the left\n\/\/ (the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\n\/\/ away from the palm.\n\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = error + 0.1;\n\npinHoleRes = 10;\n\/*\ncornerRoundingRes = 100;\nconnectorPinRes = 100;\nledHoleRes = 100;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nconnectorPinRes = 10;\nledHoleRes = 10;\n\/\/*\/\ncontainmentWallThick = 1;\ncontainmentShelfThick = 1;\n\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFingerWell = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nhorizontalOffsetBeforeThumbWell = 25.0;\nbuttonBodySeparation = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoUsbCableWidth = 9.7;\nnanoUsbCableHeight = 6.7;\nnanoUsbCableOffsetFromPerfboard = 3.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nnanoOuterWallOffset = nanoOffset + nanoWidth + 2*foreignPartClearance;\nchargerHeaderOffset = nanoOuterWallOffset + containmentWallThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + error2 + 5;\n\nledDomeRadius = 2.50;\nledRimRadius = 2.95;\nledRimThick = 1.10;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nlidThick = 1.5;\nfloorThick = 1.5;\n\ncaseWidth = 70;\ncaseLength = 120;\nthickestComponent = 7.9;\ncaseHeight = lidThick + floorThick + thickestComponent + 1;\n\nwallThick = caseHeight\/2;\ncaseCornerRadius = wallThick; \/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\n\ntopYOfFingerWells = caseLength - offsetFromTopEdgeToFirstFingerWell + buttonBodySeparation\/2;\nbottomYOfFingerWells = caseLength - offsetFromTopEdgeToFirstFingerWell - 4*fingerWidth - buttonBodySeparation\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0;\npushButtonBaseThick = 1.5;\n\nfingerWellDepth = 5;\nthumbWellDepth = 5;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - buttonBodySeparation;\nthumbButtonLength = thumbWidth - buttonBodySeparation;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = error; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonThick + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonThick + pushButtonHeight;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\ncavityHeight = caseHeight-floorThick-lidThick;\n\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"wallThick: \", wallThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + containmentWallThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + containmentWallThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n \n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\nmodule button(length) {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n }\n translate([length-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([length-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1.5,0, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1.5,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([length,buttonWidth,buttonThick+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([length-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n\/\/ translate([-totalWellDepth-pushButtonBaseThick, -buttonLength-buttonBodySeparation, lidThick]) {\n\/\/ translate([-totalWellDepth-pushButtonBaseThick, 0, lidThick]) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-buttonBodySeparation, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*buttonBodySeparation, caseHeight-lidThick]);\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude(convexity = 10) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius));\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude(convexity = 10) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius));\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius);\n } \n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n } \n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbCurveRadius - wallThick*2\/3)\/4,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([wallThick*2\/3,wallThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-wallThick*2\/3,wallThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-wallThick-pinHoleRadius,caseLength-wallThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-wallThick*2\/3,caseLength-wallThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-wallThick-pinHoleRadius,wallThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([wallThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*containmentWallThick+2*foreignPartClearance+pinHoleRadius,wallThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+wallThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+wallThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+wallThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - wallThick) + topYOfFingerWells) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1));\n translate([-lightSensorRadius, -(lightSensorWireThick + error)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + error, wallThick + 2]);\n }\n }}\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=(caseHeight - lidThick - floorThick));\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nthumbWellDepression = 2;\n\nmodule thumbButtonContainer() {\n r = thumbCurveRadius;\n x = r - horizontalOffsetBeforeThumbWell;\n y = sqrt(r*r - x*x);\n translate([horizontalOffsetBeforeThumbWell, caseLength - r + y - thumbWellDepression, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+buttonBodySeparation)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n r = thumbCurveRadius;\n x = r - horizontalOffsetBeforeThumbWell;\n y = sqrt(r*r - x*x);\n translate([horizontalOffsetBeforeThumbWell, caseLength - r + y - thumbWellDepression, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+buttonBodySeparation)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([wallThick,wallThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-wallThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,wallThick,0]) {\n cube([cavityWidth+wallThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([wallThick+cavityWidth - 0.001,topYOfFingerWells,0]) {\n cube([caseWidth - 2*wallThick - cavityWidth, offsetFromTopEdgeToFirstFingerWell - wallThick - buttonBodySeparation\/2, cavityHeight]);\n }\n translate([wallThick+cavityWidth - 0.001,wallThick,0]) {\n cube([caseWidth - 2*wallThick - cavityWidth, bottomYOfFingerWells - wallThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFingerWell - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n \/\/ hole for status LED\n translate([caseWidth - wallThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=wallThick,r=ledDomeRadius+foreignPartClearance, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+wallThick]) {\n cylinder(h=10,r=ledRimRadius+foreignPartClearance, $fn=20);\n }\n }\n }\n\n \/\/ holes for ports\/controls on bottom edge\n translate([wallThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+foreignPartClearance+nanoWidth\/2-nanoUsbWidth\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+2*foreignPartClearance,wallThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+foreignPartClearance+nanoWidth\/2-nanoUsbCableWidth\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight\/2-nanoUsbCableHeight\/2-foreignPartClearance]) {\n cube([nanoUsbCableWidth+2*foreignPartClearance,wallThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-error2)\/2]) {\n cube([chargerHeaderWidth+error2,wallThick+1,chargerHeaderLength+error2]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+containmentWallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+error2,wallThick+1,powerSwitchWidth+error2]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - wallThick - 1, bottomYOfFingerWells - laserWidth - foreignPartClearance*2, lidThick]) {\n cube([wallThick + 2, laserWidth + foreignPartClearance*2, laserThick + foreignPartClearance*2]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,(caseHeight-buttonWidth)\/2 - lidThick]);\n translate([error, error, 0]) {\n cube([alignmentPegWidth-error2,alignmentPegWidth-error2,alignmentPegHeight]);\n }\n}\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([wallThick+cavityWidth,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([wallThick, wallThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-wallThick-alignmentPegWidth, wallThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-wallThick-alignmentPegWidth, caseLength-wallThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([caseWidth + 15,bottomYOfFingerWells+buttonBodySeparation,10]) {\n for (i = [0:3]) {\n translate([0,i*(fingerButtonLength+buttonBodySeparation),0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }} \n }\n}\ntranslate([horizontalOffsetBeforeThumbWell+thumbButtonLength+buttonBodySeparation,caseLength+12,10]) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([nanoWidth+2*foreignPartClearance,0,0]) {\n cube([containmentWallThick,nanoLength+2*foreignPartClearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([0,nanoLength+2*foreignPartClearance,0]) {\n cube([nanoWidth+2*foreignPartClearance+containmentWallThick,containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n translate([containmentWallThick+powerSwitchLength+error2,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([0,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([0,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingerWells - laserWidth - 2*foreignPartClearance - wallThick, lidThick + laserThick + 2 * foreignPartClearance]) {\n cube([caseWidth-2*wallThick-cavityWidth, laserWidth + 2*foreignPartClearance, containmentShelfThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([21.4,13.8,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","old_contents":"\/\/ The origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\n\/\/ with the thumb to the north (the y axis), the fingers of the left hand to the left\n\/\/ (the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\n\/\/ away from the palm.\n\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = true;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\npinHoleRes = 10;\n\/*\ncornerRoundingRes = 100;\nconnectorPinRes = 100;\nledHoleRes = 100;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nconnectorPinRes = 10;\nledHoleRes = 10;\n\/\/*\/\ncontainmentWallThick = 1;\n\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFingerWell = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nhorizontalOffsetBeforeThumbWell = 25.0;\nbuttonBodySeparation = 1.5;\nthumbButtonTiltDegrees = 5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nnanoOuterWallOffset = nanoOffset + nanoWidth + 2*clearance;\nchargerHeaderOffset = nanoOuterWallOffset + containmentWallThick;\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + error2;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.95;\nledRimThick = 1.0;\n\nlidThick = 1.5;\nfloorThick = 1.5;\n\ncaseWidth = 70;\ncaseLength = 130;\nthickestComponent = 7.9;\ncaseHeight = lidThick + floorThick + thickestComponent + 1;\n\nwallThick = caseHeight\/2;\ncaseCornerRadius = wallThick; \/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\n\necho(\"caseHeight: \", caseHeight);\necho(\"wallThick: \", wallThick);\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0;\npushButtonBaseThick = 1.5;\n\nfingerWellDepth = 5;\nthumbWellDepth = 5;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - buttonBodySeparation;\nthumbButtonLength = thumbWidth - buttonBodySeparation;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = 0.3; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonThick + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonThick + pushButtonHeight;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = nanoOffset + nanoWidth + containmentWallThick + 1;\nmodemVizOffsetY = 1;\nmotionSensorVizOffsetX = 1;\nmotionSensorVizOffsetY = nanoLength + containmentWallThick + 1;\nbatteryVizOffsetX = modemVizOffsetX;\nbatteryVizOffsetY = motionSensorVizOffsetY;\ntransducerVizOffsetX = cavityWidth - 15;\ntransducerVizOffsetY = batteryVizOffsetY + 47 + 1;\n \n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\nmodule button(length) {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n }\n translate([length-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([length-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1.5,0, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1.5,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([length,buttonWidth,buttonThick+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([length-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n\/\/ translate([-totalWellDepth-pushButtonBaseThick, -buttonLength-buttonBodySeparation, lidThick]) {\n\/\/ translate([-totalWellDepth-pushButtonBaseThick, 0, lidThick]) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-buttonBodySeparation, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*buttonBodySeparation, caseHeight-lidThick]);\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude(convexity = 10) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius));\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude(convexity = 10) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius));\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius);\n } \n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n } \n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n for (i = [1:4]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbCurveRadius - wallThick*2\/3)\/4,0]) {\n pinHole();\n }\n }\n \/\/ pinhole on right edge close to the lower right corner\n translate([wallThick*2\/3,10,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([10,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-8,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2+8,wallThick*2\/3,0]) {\n pinHole();\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=(caseHeight - lidThick - floorThick));\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nthumbWellDepression = 2;\n\nmodule thumbButtonContainer() {\n r = thumbCurveRadius;\n x = r - horizontalOffsetBeforeThumbWell;\n y = sqrt(r*r - x*x);\n translate([horizontalOffsetBeforeThumbWell, caseLength - r + y - thumbWellDepression, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+buttonBodySeparation)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n r = thumbCurveRadius;\n x = r - horizontalOffsetBeforeThumbWell;\n y = sqrt(r*r - x*x);\n translate([horizontalOffsetBeforeThumbWell, caseLength - r + y - thumbWellDepression, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+buttonBodySeparation)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-wallThick+0.001,caseHeight-floorThick-lidThick]);\n }\n translate([thumbCurveRadius,wallThick,lidThick]) {\n cube([cavityWidth+wallThick-thumbCurveRadius,cavityLength,caseHeight-floorThick-lidThick]);\n }\n }\n\n thumbButtonContainer();\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFingerWell - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n } \n }\n\n thumbButtonWell();\n\n \/\/ hole for status LED\n translate([0,40,caseHeight\/2]) {\n \t rotate(a=[0,90,0]) {\n cylinder(h=wallThick,r=ledDomeRadius+error, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+wallThick]) {\n\/\/ translate([0,0,-1+wallThick+ledRimThick]) {\n cylinder(h=10,r=ledRimRadius+clearance, $fn=20);\n }\n } \n }\n\n \/\/ holes for ports\/controls on bottom edge\n translate([wallThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+clearance+nanoWidth\/2-nanoUsbWidth\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick+1,nanoUsbHeight+clearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-error2)\/2]) {\n cube([chargerHeaderWidth+error2,wallThick+1,chargerHeaderLength+error2]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+containmentWallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+error2,wallThick+1,powerSwitchWidth+error2]);\n }\n }\n }\n}\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n \/\/ matching holes for alignment pegs\n translate([caseWidth-wallThick, wallThick, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error, $fn=connectorPinRes);\n }\n translate([caseWidth-wallThick, caseLength-wallThick, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error, $fn=connectorPinRes);\n }\n\n \/\/ screwdriver\/leverage slots\n translate([wallThick,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,caseLength-wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([-60,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([caseWidth-wallThick, wallThick, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([caseWidth-wallThick, caseLength-wallThick, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n}\n\n\n\/\/tmp\n\/*\n r = thumbCurveRadius;\n x = r - horizontalOffsetBeforeThumbWell;\n y = sqrt(r*r - x*x);\n translate([horizontalOffsetBeforeThumbWell, caseLength - r + y, 0]) {\n cube([10,20,40]);\n }\n*\/\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([-10,0,10]) {\n for (i = [0:3]) {\n translate([0,i*(fingerButtonLength+2),0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }} \n }\n}\ntranslate([-2,caseLength-35,10]) {\n rotate([90,180,-90]) {\n button(thumbButtonLength);\n } \n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([nanoWidth+2*clearance,0,0]) {\n cube([containmentWallThick,nanoLength+2*clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([0,nanoLength+2*clearance,0]) {\n cube([nanoWidth+2*clearance+containmentWallThick,containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n translate([containmentWallThick+powerSwitchLength+error2,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([0,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([0,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"658215791ab073cb9b9914b8cfbfc55c41f926f8","subject":"added possiblity of not specifiying given elements","message":"added possiblity of not specifiying given elements\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"rollup_string_fix\/print.scad","new_file":"rollup_string_fix\/print.scad","new_contents":"use \nuse \n\n\/\/ required quantities. adjust according to your needs.\n\/\/ (note: you need two identical elements per functional part)\nfixes = 2*2;\nlimiters = 3*2;\n\n\/\/ ball-size\nr=(3+2)\/2;\n\nif(fixes)\n for(i = [0:fixes])\n translate([0, 10*i, 0])\n rollup_string_fix(r);\n\nif(limiters)\n for(i = [0:limiters-1])\n translate([20, 10*i, 0])\n rollup_string_limiter(r);\n","old_contents":"use \nuse \n\n\/\/ required quantities. adjust according to your needs.\n\/\/ (note: you need two identical elements per functional part)\nfixes = 2*2;\nlimiters = 3*2;\n\n\/\/ ball-size\nr=(3+2)\/2;\n\nfor(i = [0:fixes-1])\n translate([0, 10*i, 0])\n rollup_string_fix(r);\n\nfor(i = [0:limiters-1])\n translate([20, 10*i, 0])\n rollup_string_limiter(r);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"74b717287deaceb4988d2edcf8e0fac5f6776a08","subject":"changed BOM to be JSON parable","message":"changed BOM to be JSON parable\n","repos":"fponticelli\/smallbridges","old_file":"scad\/bom.scad","new_file":"scad\/bom.scad","new_contents":"module bom(code, desc, category) {\n\techo(str(\n \"BOM: { \\\"code\\\" : \\\"\",\n code,\n \"\\\", \\\"description\\\" : \\\"\",\n desc,\n \"\\\", \\\"categories\\\" : \",\n category,\n \" }\"\n ));\n}","old_contents":"module bom(code, desc, category) {\n\techo(str(\"BOM: \",code,\" - \", desc, \"; \", category));\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"673d4b8c0b7ccd6ea5b6f01c5462c4243f3bf23f","subject":"nut\/data: add some knurl nuts (M2)","message":"nut\/data: add some knurl nuts (M2)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"nut-data.scad","new_file":"nut-data.scad","new_contents":"\/\/ THIS FILE HAS BEEN GENERATED\n\/\/ DO NOT MODIFY DIRECTLY\n\ninclude \ninclude \n\nNutHoleDia = 0;\nNutWidthMin = 1;\nNutThickness = 2;\nNutWidthMax = 3;\nNutThread = 4;\nNutFacets = 5;\n\nNutHexM1_2 = [\n [NutHoleDia, 1.2*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_2],\n [NutFacets, 6],\n];\n\nNutHexM1_4 = [\n [NutHoleDia, 1.4*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_4],\n [NutFacets, 6],\n];\n\nNutHexM1_6 = [\n [NutHoleDia, 1.6*mm],\n [NutWidthMin, 3.2*mm],\n [NutThickness, 1.3*mm],\n [NutWidthMax, 3.48*mm],\n [NutThread, ThreadM1_6],\n [NutFacets, 6],\n];\n\nNutHexM1_8 = [\n [NutHoleDia, 1.8*mm],\n [NutWidthMin, 3.5*mm],\n [NutThickness, 1.4*mm],\n [NutWidthMax, 3.82*mm],\n [NutThread, ThreadM1_8],\n [NutFacets, 6],\n];\n\nNutHexM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 2.4*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2.8*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 4.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 5.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexM7 = [\n [NutHoleDia, 7*mm],\n [NutWidthMin, 11*mm],\n [NutThickness, 5.5*mm],\n [NutWidthMax, 12.12*mm],\n [NutThread, ThreadM7],\n [NutFacets, 6],\n];\n\nNutHexM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 6.8*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 8.4*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 10.8*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 12.8*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 14.8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 15.8*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 19.4*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 21.5*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 23.8*mm],\n [NutWidthMax, 45.29*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexM30 = [\n [NutHoleDia, 30*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 25.6*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 28.7*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 31*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 33.4*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 34*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 36*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 38*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexM52 = [\n [NutHoleDia, 52*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 42*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 45*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 48*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 51*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutHexThinM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexThinM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexThinM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 1.8*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexThinM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexThinM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 2.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexThinM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 2.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexThinM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexThinM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexThinM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexThinM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexThinM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 7*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexThinM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexThinM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 9*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexThinM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 10*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexThinM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 11*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexThinM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 12*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexThinM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 13.5*mm],\n [NutWidthMax, 45.2*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexThinM30 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 15*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexThinM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 16.5*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexThinM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexThinM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 19.5*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexThinM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 21*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexThinM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 22.5*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexThinM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 24*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexThinM52 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 26*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexThinM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 28*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexThinM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 30*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexThinM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 32*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutKnurlM2_4_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM2_6_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM3_8_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_3_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 3*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nAllNut = [NutHexM1_2,\nNutHexM1_4,\nNutHexM1_6,\nNutHexM1_8,\nNutHexM2,\nNutHexM2_5,\nNutHexM3,\nNutHexM3_5,\nNutHexM4,\nNutHexM5,\nNutHexM6,\nNutHexM7,\nNutHexM8,\nNutHexM10,\nNutHexM12,\nNutHexM14,\nNutHexM16,\nNutHexM18,\nNutHexM20,\nNutHexM22,\nNutHexM24,\nNutHexM27,\nNutHexM30,\nNutHexM33,\nNutHexM36,\nNutHexM39,\nNutHexM42,\nNutHexM45,\nNutHexM48,\nNutHexM52,\nNutHexM56,\nNutHexM60,\nNutHexM64,\nNutHexThinM2,\nNutHexThinM2_5,\nNutHexThinM3,\nNutHexThinM3_5,\nNutHexThinM4,\nNutHexThinM5,\nNutHexThinM6,\nNutHexThinM8,\nNutHexThinM10,\nNutHexThinM12,\nNutHexThinM14,\nNutHexThinM16,\nNutHexThinM18,\nNutHexThinM20,\nNutHexThinM22,\nNutHexThinM24,\nNutHexThinM27,\nNutHexThinM30,\nNutHexThinM33,\nNutHexThinM36,\nNutHexThinM39,\nNutHexThinM42,\nNutHexThinM45,\nNutHexThinM48,\nNutHexThinM52,\nNutHexThinM56,\nNutHexThinM60,\nNutHexThinM64,\nNutKnurlM2_4_42,\nNutKnurlM2_6_42,\nNutKnurlM3_5_42,\nNutKnurlM3_3_42,\n];\n","old_contents":"\/\/ THIS FILE HAS BEEN GENERATED\n\/\/ DO NOT MODIFY DIRECTLY\n\ninclude \ninclude \n\nNutHoleDia = 0;\nNutWidthMin = 1;\nNutThickness = 2;\nNutWidthMax = 3;\nNutThread = 4;\nNutFacets = 5;\n\nNutHexM1_2 = [\n [NutHoleDia, 1.2*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_2],\n [NutFacets, 6],\n];\n\nNutHexM1_4 = [\n [NutHoleDia, 1.4*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_4],\n [NutFacets, 6],\n];\n\nNutHexM1_6 = [\n [NutHoleDia, 1.6*mm],\n [NutWidthMin, 3.2*mm],\n [NutThickness, 1.3*mm],\n [NutWidthMax, 3.48*mm],\n [NutThread, ThreadM1_6],\n [NutFacets, 6],\n];\n\nNutHexM1_8 = [\n [NutHoleDia, 1.8*mm],\n [NutWidthMin, 3.5*mm],\n [NutThickness, 1.4*mm],\n [NutWidthMax, 3.82*mm],\n [NutThread, ThreadM1_8],\n [NutFacets, 6],\n];\n\nNutHexM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 2.4*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2.8*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 4.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 5.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexM7 = [\n [NutHoleDia, 7*mm],\n [NutWidthMin, 11*mm],\n [NutThickness, 5.5*mm],\n [NutWidthMax, 12.12*mm],\n [NutThread, ThreadM7],\n [NutFacets, 6],\n];\n\nNutHexM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 6.8*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 8.4*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 10.8*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 12.8*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 14.8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 15.8*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 19.4*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 21.5*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 23.8*mm],\n [NutWidthMax, 45.29*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexM30 = [\n [NutHoleDia, 30*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 25.6*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 28.7*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 31*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 33.4*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 34*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 36*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 38*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexM52 = [\n [NutHoleDia, 52*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 42*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 45*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 48*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 51*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutHexThinM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexThinM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexThinM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 1.8*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexThinM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexThinM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 2.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexThinM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 2.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexThinM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexThinM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexThinM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexThinM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexThinM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 7*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexThinM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexThinM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 9*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexThinM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 10*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexThinM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 11*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexThinM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 12*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexThinM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 13.5*mm],\n [NutWidthMax, 45.2*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexThinM30 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 15*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexThinM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 16.5*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexThinM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexThinM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 19.5*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexThinM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 21*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexThinM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 22.5*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexThinM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 24*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexThinM52 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 26*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexThinM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 28*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexThinM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 30*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexThinM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 32*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutKnurlM3_8_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_3_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 3*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nAllNut = [NutHexM1_2,\nNutHexM1_4,\nNutHexM1_6,\nNutHexM1_8,\nNutHexM2,\nNutHexM2_5,\nNutHexM3,\nNutHexM3_5,\nNutHexM4,\nNutHexM5,\nNutHexM6,\nNutHexM7,\nNutHexM8,\nNutHexM10,\nNutHexM12,\nNutHexM14,\nNutHexM16,\nNutHexM18,\nNutHexM20,\nNutHexM22,\nNutHexM24,\nNutHexM27,\nNutHexM30,\nNutHexM33,\nNutHexM36,\nNutHexM39,\nNutHexM42,\nNutHexM45,\nNutHexM48,\nNutHexM52,\nNutHexM56,\nNutHexM60,\nNutHexM64,\nNutHexThinM2,\nNutHexThinM2_5,\nNutHexThinM3,\nNutHexThinM3_5,\nNutHexThinM4,\nNutHexThinM5,\nNutHexThinM6,\nNutHexThinM8,\nNutHexThinM10,\nNutHexThinM12,\nNutHexThinM14,\nNutHexThinM16,\nNutHexThinM18,\nNutHexThinM20,\nNutHexThinM22,\nNutHexThinM24,\nNutHexThinM27,\nNutHexThinM30,\nNutHexThinM33,\nNutHexThinM36,\nNutHexThinM39,\nNutHexThinM42,\nNutHexThinM45,\nNutHexThinM48,\nNutHexThinM52,\nNutHexThinM56,\nNutHexThinM60,\nNutHexThinM64,\nNutKnurlM3_5_42,\nNutKnurlM3_3_42,\n];","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1b3b21552e4d9e745481c083a9562bb705b15357","subject":"model is now simple (manifold)","message":"model is now simple (manifold)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"\/*\n * configuration\n *\/\n\nbrushes_count = 2;\n\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, 20+4, 0])\n difference()\n {\n cylinder(h=10+3, r=20);\n translate([0,0,3])\n cylinder(h=10+3, r2=20, r1=16);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, 24+5, 0])\n difference()\n {\n cylinder(h=16, r=24+5);\n cylinder(h=16, r=24+0);\n }\n}\n\n\nmodule back_wall()\n{\n translate([0,0,0])\n {\n \/\/ lower part\n translate([-70\/2, 0, 0])\n cube([70, 3, 20]);\n \/\/ upper part\n translate([-70\/2, 0, 100-16+13])\n cube([70, 3, 20]);\n \/\/ connector\n translate([-20\/2, 0, 0])\n cube([20, 3, 100]);\n }\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-30\/2, 3, 0])\n cube([30, 10, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100])\n {\n difference()\n {\n translate([-40\/2, 3, 0])\n cube([40, 10, 16]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nfor(offset = [0:brushes_count-1])\n{\n translate(offset * [60, 0, 0])\n brush_holder();\n}\n","old_contents":"\/*\n * configuration\n *\/\nbrushes_count = 2;\n\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, 20+4, 0])\n difference()\n {\n cylinder(h=10+3, r=20);\n translate([0,0,3])\n cylinder(h=10+3, r2=20, r1=16);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, 24+5, 0])\n difference()\n {\n cylinder(h=16, r=24+5);\n cylinder(h=16, r=24+0);\n }\n}\n\nmodule back_wall()\n{\n translate([0,0,0])\n {\n \/\/ lower part\n translate([-70\/2, 0, 0])\n cube([70, 3, 20]);\n \/\/ upper part\n translate([-70\/2, 0, 100-16+13])\n cube([70, 3, 20]);\n \/\/ connector\n translate([-20\/2, 0, 0])\n cube([20, 3, 100]);\n }\n}\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-30\/2, 3, 0])\n cube([30, 10, 10+3]);\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100])\n {\n difference()\n {\n translate([-40\/2, 3, 0])\n cube([40, 10, 16]);\n hull()\n upper_ring();\n }\n }\n}\n\n\/*\n * main program\n *\/\nfor(offset = [0:brushes_count-1])\n{\n translate(offset * [60, 0, 0])\n brush_holder();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3b0ff1c1341e6a057d5ae9ad4e5b3220e71c9559","subject":"updated plunger spring holder","message":"updated plunger spring holder\n","repos":"wyolum\/uControl_v3,wyolum\/uControl_v3","old_file":"fabricate\/plunger_holder.scad","new_file":"fabricate\/plunger_holder.scad","new_contents":"inch = 25.4;\n$fn=25;\n\nmodule nix(){\n translate([0, 0, -3])\n rotate(a=-45, v=[0, 0, 1])\n intersection(){\n cylinder(r=5, h=62 + 3 - l);\n cube([50, 50, 100]);\n }\n}\n\nnix();\nintersection(){\n difference(){\n translate([0, -4, -6.])cube([15, 8, 10.]);\n translate([0, -4-1, -2.])cube([12.85, 10, 2]);\n translate([0, 0, -1])cylinder(r=17\/2, h=20);\n }\n translate([0, 0, -20])\n rotate(a=-45, v=[0, 0, 1])\n intersection(){\n cylinder(r=50, h=62);\n cube([50, 50, 100]);\n }\n \n}\n\ntranslate([15, 0, -6])\ndifference(){\n cylinder(r=4, h=10); \n translate([-8, -4, -.1])cube([8, 8, 11]);\n}\n\nd = 3.81;\nD = 6;\nl = 15;\n\ntranslate([d\/2, 0, 62 - 2 * l])\nunion(){\n translate([0, 0, l])cylinder(r=d\/2, h=l);\n}\n\n","old_contents":"inch = 25.4;\n\nmodule nix(){\n translate([0, 0, -3])\n rotate(a=-45, v=[0, 0, 1])\n intersection(){\n cylinder(r=5, h=62 + 3 - l);\n cube([50, 50, 100]);\n }\n}\n\nnix();\nintersection(){\n difference(){\n translate([0, -4, -6.])cube([15, 8, 10.]);\n translate([0, -4-1, -2.])cube([12.85, 10, 2]);\n translate([0, 0, -1])cylinder(r=17\/2, h=20);\n }\n translate([0, 0, -20])\n rotate(a=-45, v=[0, 0, 1])\n intersection(){\n cylinder(r=50, h=62);\n cube([50, 50, 100]);\n }\n \n}\n\nd = 3.81;\nD = 6;\nl = 15;\n\ntranslate([d\/2, 0, 62 - 2 * l])\nunion(){\n translate([0, 0, l])cylinder(r=d\/2, h=l);\n translate([0, 0, 0])cylinder(r=D\/2, h=l);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8d695f4541347ed6d27d8d2df54e08d59e62117d","subject":"main: Only render PSU's in detail mode","message":"main: Only render PSU's in detail mode\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, -1])\n {\n fncylindera(d=extrusion_thread_dia, h=100, orient=[0,0,1], align=[1,0,1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, -1])\n {\n fncylindera(d=extrusion_thread_dia, h=100, orient=[0,0,1], align=[1,0,1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b3ece704a8a1d1d941220bc3693463a1358634a1","subject":"font.scad is now a module as well","message":"font.scad is now a module as well\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \ninclude \n\nmodule front()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ LCD mounting drills\n translate(lcdOffset)\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}\n\n\/\/rotate([180, 0, 0])\n front();\n","old_contents":"use \nuse \nuse \nuse \nuse \nuse \ninclude \n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ LCD mounting drills\n translate(lcdOffset)\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"422a75e8373e6bb12c936d71221107d989369275","subject":"misc: add fallback and v_fallback","message":"misc: add fallback and v_fallback\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"941d875f1e6e046091ec1716e6ae532d3beb371d","subject":"Add documentation","message":"Add documentation\n","repos":"OregonTechPrint3D\/Wintermute,OregonTechPrint3D\/Wintermute,OregonTechPrint3D\/Wintermute","old_file":"models\/experimental\/Wintermute_Travel_Bracket\/Travel_Brkt_Solid.scad","new_file":"models\/experimental\/Wintermute_Travel_Bracket\/Travel_Brkt_Solid.scad","new_contents":"\/\/ Module containing code for revised Travel Bracket for Wintermute Delta Printer\nmodule TravelBracket()\n{\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\t\/\/ Import base HIMAWIRI STL from approved directory\n\t\t\timport(\"..\/\/..\/\/approved\/\/TRV_BRKT.stl\");\n\t\t\n\t\t\t\/\/ Fill in unneeded holes\n\t\t\t\/\/ These aspects of the original HIMAWRI base printer are not used on\n\t\t\t\/\/ the Wintermute fork\n\t\t\ttranslate([16,17,3])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\t\ttranslate([16,17,11])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\t\ttranslate([22,9,0])cube([6,8,14]);\n\t\t\ttranslate([-22,9,0])mirror([1,0,0])cube([6,8,14]);\n\t\t\ttranslate([22,-9,0])mirror([0,1,0])cube([6,6,14]);\n\t\t\ttranslate([-22,-9,0])mirror([1,1,0])cube([6,6,14]);\n\t\t\ttranslate([13,11,0])cube([6,3,14]);\n\n\t\t\t\/\/ Linear bearing holes\n\t\t\tdifference()\n\t\t\t{\n\t\t\t\t\/\/ Cylinder defining the outer shell\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\ttranslate([25,0,0])cylinder(h=16,r=10,$fn=40);\t\/\/ Left\n\t\t\t\t\ttranslate([-25,0,0])cylinder(h=16,r=10,$fn=40);\t\/\/ Right\n\t\t\t\t}\n\n\t\t\t\t\/\/ Cylider defining the inner section to be removed\n\t\t\t\t\/\/ (Where the linear bearings will fit)\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\ttranslate([25,0,-1])cylinder(h=18,r=8,$fn=40);\t\/\/ Left\n\t\t\t\t\ttranslate([-25,0,-1])cylinder(h=18,r=8,$fn=40);\t\/\/ Right\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\t\t\n\t\t\/\/ Holes for set screws to add further support for linear bearings\n\t\ttranslate([-25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\n\t\ttranslate([25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\t\t\n\t}\n}\n\n\/\/ Module defining the shape of a M3 Nut for screw mounts\nmodule NutSocket(width,depth,height)\n{\n\tside_length=sqrt(pow(width,2)\/2);\n\ttranslate([0,0,height\/2])cube([width,depth,height],center=true);\n\trotate([0,45,0])cube([side_length,depth,side_length],center=true);\n}\n\ndifference()\n{\n\tTravelBracket();\n\n\tunion()\n{\n\t\ttranslate([-25,12.5,5.5])NutSocket(6,3,14);\n\t\ttranslate([25,12.5,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([-25,11,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([25,11,5.5])NutSocket(6,3,14);\n\t}\n}","old_contents":"module TravelBracket(){\ndifference(){\n\tunion(){\n\t\timport(\"..\/\/..\/\/approved\/\/TRV_BRKT.stl\");\n\t\t\n\t\t\/\/ Fill in unneeded holes\n\t\tcolor([255,0,0])translate([16,17,3])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\tcolor([255,0,0])translate([16,17,11])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\n\t\ttranslate([22,9,0])cube([6,8,14]);\n\t\ttranslate([-22,9,0])mirror([1,0,0])cube([6,8,14]);\n\t\ttranslate([22,-9,0])mirror([0,1,0])cube([6,6,14]);\n\t\ttranslate([-22,-9,0])mirror([1,1,0])cube([6,6,14]);\n\n\t\ttranslate([13,11,0])cube([6,3,14]);\n\n\t\t\/\/ Linear bearing holes\n\t\tdifference(){\n\t\t\tunion(){\n\t\t\t\ttranslate([25,0,0])cylinder(h=16,r=10,$fn=40);\n\t\t\t\ttranslate([-25,0,0])cylinder(h=16,r=10,$fn=40);\n\t\t\t}\n\n\t\t\tunion(){\n\t\t\t\ttranslate([25,0,-1])cylinder(h=18,r=8,$fn=40);\n\t\t\t\ttranslate([-25,0,-1])cylinder(h=18,r=8,$fn=40);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}\n\t\t\n\t\t\/\/ Mount screw Linear bearing\n\t\ttranslate([-25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\n\t\ttranslate([25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\t\t\n\n}\n\n\n}\n\nmodule NutSocket(width,depth,height)\n{\n\tside_length=sqrt(pow(width,2)\/2);\n\ttranslate([0,0,height\/2])cube([width,depth,height],center=true);\n\trotate([0,45,0])cube([side_length,depth,side_length],center=true);\n}\n\ndifference(){\n\tTravelBracket();\n\n\tunion(){\n\t\ttranslate([-25,12.5,5.5])NutSocket(6,3,14);\n\t\ttranslate([25,12.5,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([-25,11,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([25,11,5.5])NutSocket(6,3,14);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"92030ca71418ba480bd053bc8ef25ac19f0315bb","subject":"doc: fix typo","message":"doc: fix typo\n","repos":"jsconan\/camelSCAD","old_file":"core\/constants.scad","new_file":"core\/constants.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = RIGHT;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = STRAIGHT;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = DEGREES - RIGHT;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = DEGREES;\n\n\/**\n * 2D-vector for the origin coordinates.\n * @type Number\n *\/\nORIGIN_2D = [0, 0];\n\n\/**\n * 3D-vector for the origin coordinates.\n * @type Number\n *\/\nORIGIN_3D = [0, 0, 0];\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * The distance tolerance that will apply to $fs to check if we still need to subdivide the curve.\n * @type Number\n *\/\nBEZIER_TOLERANCE = .25;\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * The maximum recursion depth\n * @type Number\n *\/\nMAX_RECURSE = 32;\n\n\/**\n * A value representing the Infinity.\n * @type Number\n *\/\nINFINITY = 1e200 * 1e200;\n\n\/**\n * Not A Number.\n * @type Number\n *\/\nNAN = 0\/0;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = RIGHT;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = STRAIGHT;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = DEGREES - RIGHT;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = DEGREES;\n\n\/**\n * 2D-vector for the orgigin coordinates.\n * @type Number\n *\/\nORIGIN_2D = [0, 0];\n\n\/**\n * 3D-vector for the orgigin coordinates.\n * @type Number\n *\/\nORIGIN_3D = [0, 0, 0];\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * The distance tolerance that will apply to $fs to check if we still need to subdivide the curve.\n * @type Number\n *\/\nBEZIER_TOLERANCE = .25;\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * The maximum recursion depth\n * @type Number\n *\/\nMAX_RECURSE = 32;\n\n\/**\n * A value representing the Infinity.\n * @type Number\n *\/\nINFINITY = 1e200 * 1e200;\n\n\/**\n * Not A Number.\n * @type Number\n *\/\nNAN = 0\/0;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"84520e59e92de473fcd0cafb2bac0ad56ed7e5fc","subject":"Tri at my age","message":"Tri at my age\n","repos":"bmsleight\/shedshed","old_file":"shedshed.scad","new_file":"shedshed.scad","new_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\nbase_sheet_t = 18;\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=10)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\n\/\/module shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\nmodule shedLowerFloor(x,y, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t, panel_min_dimentions = 100)\n{\n\/\/ echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-General-Purpose-OSB3-Board-18x1220x2440mm\/p\/110517\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n echo(y_panels);\n if(y_panels>0) \/\/ Panel is Not longer than width\n {\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n }\n else \/\/ Panel is longer than width\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,0,0]) cubeI([panel_slf_w, y,panel_slf_t]); \n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,0,0]) cubeI([x-(panel_slf_w*x_panels), y,panel_slf_t]); \n }\n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0, beams=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n }\n }\n if(beams> 0)\n {\n middle_x = x - timber_length*2;\n part_x = middle_x\/(beams+1);\n for(loop=[1 : beams ])\n {\n translate([timber_length\/(beams+1) + (loop*part_x),0,timber_width]) cubeI([timber_length, timber_width,z-timber_length*2]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\nmodule sideWallStruts(x,z,number_x, braces=1)\n{\n echo(\"sideWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n rotate([0,0,90]) backWallStruts(x,z,number_x, braces);\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w, braces)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h, braces);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w,0,0]) verticalStruts(window_w,space_to_window_h, braces = braces, beams=1);\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces, beams=2);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n if(door_h-(space_to_window_h+window_h>0)) translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces, beams=2);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\nmodule roof(x,y,z_front,z_back, panel_slf_w = 1220, panel_slf_l = 2440, panel_slf_t = base_sheet_t)\n{\n opp = z_front-z_back;\n adj = y - base_timber;\n hyp = sqrt(opp*opp+adj*adj);\n theta = atan(opp\/adj);\n overhang = (panel_slf_l-hyp)\/2;\n \/\/ Want it to line up with front of timber truct not back\n height_adjust = base_timber * tan(theta);\n echo(\"overhang\", overhang, opp, hyp, theta, height_adjust);\n translate([0,0,z_front+base_timber+panel_slf_t+height_adjust])\n {\n rotate([-theta,0,0]) cubeI([panel_slf_w,panel_slf_l, panel_slf_t]);\n }\n}\n\n\n\nshedBase(shed_length, shed_width, number_x=5,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+base_sheet_t]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([base_timber,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\ntranslate([shed_length,base_timber,base_timber+1+base_sheet_t]) sideWallStruts(shed_width-base_timber*2,shed_front_back,2, braces=1);\n\ntranslate([0,0,base_timber+1+base_sheet_t]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=2030-610, window_w=1830, window_h=610, door_w=870, , door_h=2030, braces=0);\n\nroof(shed_length, shed_width,shed_front_height,shed_front_back);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","old_contents":"\nshed_length = 5184;\nshed_width = 1829+305\/2;\nshed_front_height = 2400;\nshed_front_back = 2135;\nbase_timber = 47;\n\n\n\n\nmodule cubeI(size,center=false)\n{\n echo(\"Dim: \",size);\n cube(size, center=center);\n}\n\n\nmodule shedBaseSection(x,y,timber_width=75,timber_length=47, braces=0)\n{\n echo(\"shedBaseSection: x,y,timber_width,timber_length, braces \", x,y,timber_width,timber_length, braces);\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47X75-x-3000mm-Single\/p\/107186#tab-DynamicDeliveryWebTab_content\");\n cubeI([x,timber_width,timber_length]);\n translate([0,y-timber_width,0]) cubeI([x,timber_width,timber_length]);\n translate([0,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n translate([x-timber_width,timber_width,0]) cubeI([timber_width,y-timber_width*2,timber_length]);\n if(braces > 0)\n {\n middle_y = y - timber_width*2;\n part_y = middle_y\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,timber_width\/(braces+1) + (loop*part_y),0]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule shedBase(x,y,number_x,number_y, braces=1)\n{\n for(base_y = [0 : number_y-1])\n {\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),base_y*(y\/number_y),0]) shedBaseSection(x\/number_x,y\/number_y, braces = braces);\n }\n }\n}\n\n\nmodule floorMembrane(x,y,thickness,color=\"Black\", overlap=1)\n{\n echo(\"x,y,thickness=1,color, overlap=1\",x,y,thickness,color, overlap);\n echo(\"http:\/\/www.screwfix.com\/p\/dmp-damp-proof-membrane-black-1000ga-3-x-4m\/50464#product_additional_details_container\");\n translate([-overlap,-overlap,0]) color(color, 1) cube([x+overlap*2,y+overlap*2, thickness]);\n}\n\n\nmodule shedLowerFloor(x,y, panel_slf_w = 607, panel_slf_l = 1829, panel_slf_t = 5.5, panel_min_dimentions = 100)\n{\n echo(\"http:\/\/www.wickes.co.uk\/Wickes-Non-Structural-Hardwood-Plywood-5-5x607x1829mm\/p\/111196\");\n x_panels = round(-0.5+x\/panel_slf_w);\n y_panels = round(-0.5+y\/panel_slf_l);\n for(base_y = [0 : y_panels-1]) \/\/Truncate not round\n {\n for(base_x = [0 : x_panels-1])\n {\n translate([base_x*panel_slf_w,base_y*panel_slf_l,0]) cubeI([panel_slf_w, panel_slf_l,panel_slf_t]);\n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([base_x*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([panel_slf_w, y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n if(x-(panel_slf_w*x_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,(y_panels-1)*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), panel_slf_l,panel_slf_t]); \n if(y-(panel_slf_l*y_panels) > panel_min_dimentions)\n translate([(x_panels)*panel_slf_w,y_panels*panel_slf_l,0]) cubeI([x-(panel_slf_w*x_panels), y-(panel_slf_l*y_panels),panel_slf_t]);\n }\n \n}\n\n\nmodule verticalStruts(x,z,timber_width=47,timber_length=47, braces=0)\n{\n\/\/ echo(\"shedBaseSection(x,z,timber_width,timber_length, braces\",x,z,timber_width,timber_length, braces);\n\/\/ echo(\"Walls - http:\/\/www.wickes.co.uk\/Wickes-Sawn-Kiln-Dried-47-x-47-x-2400mm-Pack-6\/p\/107114\");\n cubeI([x,timber_width,timber_length]);\n translate([0,0,z-timber_width]) cubeI([x,timber_width,timber_length]);\n translate([0,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n translate([x-timber_width,0,timber_width]) cubeI([timber_width,timber_length,z-timber_width*2]);\n if(braces > 0)\n {\n middle_z = z - timber_width*2;\n part_z = middle_z\/(braces+1);\n for(loop=[1 : braces ])\n {\n translate([timber_width,0,timber_width\/(braces+1) + (loop*part_z)]) cubeI([x-timber_width*2, timber_width,timber_length]); \n } \n }\n}\n\n\nmodule backWallStruts(x,z,number_x, braces=1)\n{\n echo(\"backWallStruts(x,z,number_x, braces)\",x,z,number_x, braces);\n for(base_x = [0 : number_x-1])\n {\n translate([base_x*(x\/number_x),0,0]) verticalStruts(x\/number_x,z, braces = braces);\n }\n}\n\n\nmodule frontWallStruts(x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h)\n{\n echo(\"frontWallStruts(x,z,space_to_window_w, space_to_window_h, window_w, window_h, door_w)\", x,z, space_to_window_w, space_to_window_h, window_w, window_h, door_w, door_h);\n translate([0,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n for(support_windows = [0 : 1])\n {\n translate([space_to_window_w+(support_windows*window_w\/2),0,0]) verticalStruts(window_w\/2,space_to_window_h, braces = braces);\n }\n translate([0,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2,0,space_to_window_h+window_h]) verticalStruts(window_w+space_to_window_w,z-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w+window_w,0,0]) verticalStruts(space_to_window_w,space_to_window_h+window_h, braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,space_to_window_h+window_h]) verticalStruts(space_to_window_w\/2,door_h-(space_to_window_h+window_h), braces = braces);\n translate([space_to_window_w\/2+window_w+space_to_window_w,0,door_h]) verticalStruts(x-(space_to_window_w\/2+window_w+space_to_window_w),z-door_h, braces = braces);\n translate([space_to_window_w+window_w+space_to_window_w+door_w,0,0]) verticalStruts(x-(space_to_window_w+window_w+space_to_window_w+door_w),door_h, braces = braces);\n}\n\n\nshedBase(shed_length, shed_width, number_x=4,number_y=1, braces=1);\ntranslate([0,0,base_timber]) floorMembrane(shed_length, shed_width, thickness = 1);\ntranslate([0,0,base_timber+1]) shedLowerFloor(shed_length, shed_width);\ntranslate([0,shed_width-base_timber,base_timber+1+5.5]) backWallStruts(shed_length, shed_front_back, 5);\ntranslate([0,0,base_timber+1+5.5]) frontWallStruts(shed_length,shed_front_height, space_to_window_w=1830\/2, space_to_window_h=shed_front_height-610-610, window_w=1830, window_h=610, door_w=870, , door_h=2030);\n\n\/\/shedBaseSection(shed_length\/6,shed_width, braces = 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"142c7a35113feadd34e2122ccbca62eb3e9d802c","subject":"Strip clearance (use thickness), add light bar, fix width\/length\/depth, simplify code.","message":"Strip clearance (use thickness), add light bar, fix width\/length\/depth, simplify code.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\r\n\/\/ Set thickness to account for thickness of material\r\n\/\/ PLUS needed clearance for cuts into which material should fit.\r\nthickness = 0.25;\r\n\r\nwidth = 20; \/\/ x\r\ndepth = 20; \/\/ y\r\nheight = 10; \/\/ z\r\n\r\n\/\/ width and height of tank base plate\r\nbase_width = width\/5;\r\nbase_height = 1;\r\nlight_bar_width = 1;\r\nlight_height = height-1;\r\n\r\n\/\/ height of side supports\r\n\/\/side_support_height = height\/2; \/\/ full side walls\r\nside_support_height = 2;\r\n\r\n\/\/ amount faces extend past each other at corners\r\noverhang = 1;\r\n\r\n\/\/ components to include (comment out unwanted)\r\nvert_faces();\r\nside_supports();\r\ntank_base();\r\nlight_bar();\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ Module definitions\r\n\/\/\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=width);\r\n\t\t}\r\n\t\tside_support_base(height_scale=0.5);\r\n\t\tside_support_top(height_scale=0.5);\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,0,0])\r\n\t\tcube([thickness,depth,height]);\r\n}\r\n\r\nmodule tank_base() {\r\n\ttranslate([thickness,0,base_height])\r\n\tdifference() {\r\n\t\tcube([base_width, depth, thickness]);\r\n\t\tcutouts(3,base_width);\r\n\t\ttranslate([0,depth-overhang-thickness\/2,0])\r\n\t\t\tcutouts(3,base_width);\r\n\t}\r\n}\r\n\r\nmodule light_bar() {\r\n\ttranslate([thickness+base_width-light_bar_width,0,light_height])\r\n\tdifference() {\r\n\t\tcube([light_bar_width, depth, thickness]);\r\n\t\tcutouts(2,light_bar_width);\r\n\t\ttranslate([0,depth-overhang-thickness\/2,0])\r\n\t\t\tcutouts(2,light_bar_width);\r\n\t}\r\n}\r\n\r\nmodule cutouts(num, width) {\r\n w = width \/ ((num-1) * 2);\r\n for (i = [0 : num-1]) {\r\n translate([-w\/2 + i*2*w,0,0])\r\n cube([w, overhang+thickness\/2, thickness]);\r\n }\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tside_support_base();\r\n\t\t\tside_support_top();\r\n\t\t}\r\n\t\tvert_faces();\r\n\t\ttank_base();\r\n light_bar();\r\n\t}\r\n}\r\n\r\nmodule side_support_top(height_scale=1) {\r\n\ttranslate([0,0,height])\r\n\tside_support_base(height_scale=-height_scale);\r\n}\r\n\r\nmodule side_support_base(height_scale=1) {\r\n\tscale([1,1,height_scale])\r\n\t\tunion() {\r\n\t\t\tside_support(y=overhang);\r\n\t\t\tside_support(y=depth-overhang);\r\n\t\t}\r\n}\r\n\r\nmodule side_support(y) {\r\n\ttranslate([-overhang,y-thickness\/2,0])\r\n\t\tcube([width+overhang*2, thickness, side_support_height]);\r\n}\r\n","old_contents":"\r\nthickness = 0.25;\r\n\r\nwidth = 20;\r\nlength = 20;\r\nheight = 10;\r\n\r\n\/\/ width and height of tank base plate\r\nbase_width = width\/4;\r\nbase_height = 1;\r\n\r\n\/\/ height of side supports\r\n\/\/side_support_height = height\/2; \/\/ full side walls\r\nside_support_height = 2;\r\n\r\n\/\/ amount faces extend past each other at corners\r\noverhang = 1;\r\n\r\n\/\/ for minor corrections\r\nepsilon = 0.01;\r\n\r\nvert_faces();\r\nside_supports();\r\ntank_base();\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=length);\r\n\t\t}\r\n\t\tside_support_base(clearance=0.1, height_scale=0.5);\r\n\t\tside_support_top(clearance=0.1, height_scale=0.5);\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,0,0])\r\n\t\tcube([thickness,width,height]);\r\n}\r\n\r\nmodule tank_base(clearance=0) {\r\n\ttranslate([thickness,0,base_height])\r\n\tdifference() {\r\n\t\tcube([base_width, length, thickness + clearance]);\r\n\t\ttank_base_cutouts(clearance);\r\n\t\ttranslate([0,length-overhang-thickness\/2,0])\r\n\t\t\ttank_base_cutouts(clearance);\r\n\t}\r\n}\r\n\r\nmodule tank_base_cutouts(clearance=0) {\r\n\tcube([base_width\/8, overhang+thickness\/2, thickness+clearance]);\r\n\ttranslate([3*base_width\/8,0,0])\r\n\t\tcube([base_width\/4, overhang+thickness\/2, thickness+clearance]);\r\n\ttranslate([7*base_width\/8,0,0])\r\n\t\tcube([base_width\/8+epsilon, overhang+thickness\/2, thickness+clearance]);\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tside_support_base();\r\n\t\t\tside_support_top();\r\n\t\t}\r\n\t\tvert_faces();\r\n\t\ttank_base(clearance=0.1);\r\n\t}\r\n}\r\n\r\nmodule side_support_top(clearance=0, height_scale=1) {\r\n\ttranslate([0,0,height])\r\n\tside_support_base(clearance=clearance, height_scale=-height_scale);\r\n}\r\n\r\nmodule side_support_base(clearance=0, height_scale=1) {\r\n\tscale([1,1,height_scale])\r\n\t\tunion() {\r\n\t\t\tside_support(y=overhang, clearance=clearance);\r\n\t\t\tside_support(y=width-overhang, clearance=clearance);\r\n\t\t}\r\n}\r\n\r\nmodule side_support(y, clearance) {\r\n\ttranslate([-overhang,y-thickness\/2-clearance\/2,0])\r\n\t\tcube([length+overhang*2, thickness+clearance, side_support_height+clearance]);\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8bc55cdec96f95dd74611b1f7d968e8cc5d267c5","subject":"feat: add a module for simple test elements","message":"feat: add a module for simple test elements\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element.\n * @param String|Vector c - The color of the element.\n * @param Number|Vector size - The size of the element.\n *\/\nmodule testElement(c, size=1) {\n color(c) {\n cube(size);\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8853d78eb021e102c0ec4e7e9fefdda21a1c82d5","subject":"added connector and TODO for connector slot on the other end","message":"added connector and TODO for connector slot on the other end\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"wooden_tracks\/wooden_line_tracks.scad","new_file":"wooden_tracks\/wooden_line_tracks.scad","new_contents":"length = 144.5;\nheight = 12;\nspan = 40;\n\nmodule main_block()\n{\n cube([length, span, height]);\n}\n\nmodule connector()\n{\n translate([-6.5, -6.5\/2, 0])\n cube([6.5, 6.5, height]);\n translate([-6.5-11.5\/2+1, 0, 0])\n cylinder(r=11.5\/2, h=height);\n}\n\nmodule connector_slot()\n{\n \/\/ TODO\n}\n\nmodule main_track()\n{\n difference()\n {\n union()\n {\n main_block();\n translate([0, 40\/2, 0])\n connector();\n }\n #connector_slot();\n }\n}\n\nmain_track();\n","old_contents":"length = 144.5;\n\nmodule main_track()\n{\n cube([length, 40, 12]);\n}\n\nmain_track();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bce53895234264a00282bd63f173a050c828c4c0","subject":"fixed an issue where spokes were rubbing on inner ring of bearing","message":"fixed an issue where spokes were rubbing on inner ring of bearing\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n\/\/$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\n\/\/render()\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\n\/\/render()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight * 1.2]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight * .8], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\nsharpieDiameter = 13;\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = sharpieDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + sharpieDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n\/\/$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\n\/\/render()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\nsharpieDiameter = 13;\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = sharpieDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + sharpieDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"2315c31e0a479df6944a8aabc8d44aa58d1827a6","subject":"Recursion actually works, but there is a minor offset problem.","message":"Recursion actually works, but there is a minor offset problem.\n\nThe cube centers are not adjusted for, so the later iterations screw.\nWorking to fix that now.\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 3;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n next_square_center = corner + ev_mult(translation_vectors[i], [connector_size \/ sqrt(2), connector_size \/ sqrt(2)]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n\n if(i == 0) {\n pattern(next_square_center, \"bottom_left\", current_iteration + 1);\n }\n else if(i == 1) {\n pattern(next_square_center, \"top_right\", current_iteration + 1);\n }\n else if(i == 2) {\n pattern(next_square_center, \"bottom_right\", current_iteration + 1);\n }\n else if(i == 3){\n pattern(next_square_center, \"top_left\", current_iteration + 1);\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3] , current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7cf92743a4d6f3cc1203e4f286d72a33af946ae1","subject":"Updating lasercut.scad - clips","message":"Updating lasercut.scad - clips\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,0,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n}\n\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"5b6196a21119230b9c128d579c13c3053e796d87","subject":"main: Ensure main model is placed at z=0","message":"main: Ensure main model is placed at z=0\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \n\ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n zmotor_mount_rod_clamp();\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n zmotor_mount_rod_clamp();\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount_rod_clamp()\n{\n difference()\n {\n union()\n {\n \/*cubea([zaxis_rod_d, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);*\/\n difference()\n {\n fncylindera(d=zaxis_rod_d*2, h=zmotor_mount_thickness_h, orient=[0,0,1], align=[0,0,0]);\n cubea([zaxis_rod_d+1, zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*2, zmotor_mount_thickness_h+1], align=[-1,0,0]);\n }\n cubea([zaxis_rod_d\/2, zmotor_mount_clamp_width, zmotor_mount_thickness_h], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*zmotor_mount_clamp_dist\/2, 0])\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=zmotor_mount_thickness*3, orient=[1,0,0]);\n\n \/\/ cut zrod\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \n\ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n zmotor_mount_rod_clamp();\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n zmotor_mount_rod_clamp();\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount_rod_clamp()\n{\n difference()\n {\n union()\n {\n \/*cubea([zaxis_rod_d, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);*\/\n difference()\n {\n fncylindera(d=zaxis_rod_d*2, h=zmotor_mount_thickness_h, orient=[0,0,1], align=[0,0,0]);\n cubea([zaxis_rod_d+1, zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*2, zmotor_mount_thickness_h+1], align=[-1,0,0]);\n }\n cubea([zaxis_rod_d\/2, zmotor_mount_clamp_width, zmotor_mount_thickness_h], align=[1,0,0]);\n }\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*zmotor_mount_clamp_dist\/2, 0])\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=zmotor_mount_thickness*3, orient=[1,0,0]);\n\n \/\/ cut zrod\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n }\n}\n\nmodule zmotor_mount()\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule belt_path(len=200, belt_width=6, pulley_d=10)\n{\n belt=tGT2_2;\n rotate([90,0,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmain();\n\n%enclosure();\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2-main_lower_dist_z-extrusion_size*2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8b966104f45275b550fef6bdfdc71edd8f81afd4","subject":"The parameter were alphabetized.","message":"The parameter were alphabetized.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube\/examples\/a\/rounded-cube-basic.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube\/examples\/a\/rounded-cube-basic.scad","new_contents":"\r\nuse <..\/..\/rounded-cube.scad>\r\n\r\nboardLength = 150;\r\nboardWidth = 100;\r\nsize = [boardLength, boardWidth, 1];\r\n\r\nroundedCube(size=[boardLength, boardWidth, 1],\r\n sides=5,\r\n sides=20);\r\n\r\ntranslate([0, 130, 0])\r\nroundedCube(cornerRadius = 5,\r\n sides=20,\r\n sidesOnly=true,\r\n size=size);\r\n","old_contents":"\r\nuse <..\/..\/rounded-cube.scad>\r\n\r\nboardLength = 150;\r\nboardWidth = 100;\r\nsize = [boardLength, boardWidth, 1];\r\n\r\nroundedCube(size=[boardLength, boardWidth, 1],\r\n\t sides=5,\r\n\t\t\tsides=20);\r\n\r\ntranslate([0, 130, 0])\r\nroundedCube(cornerRadius = 5,\r\n\t\t\tsides=20,\r\n\t\t\tsidesOnly=true,\r\n\t\t\tsize=size);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"19827915eb06232e2c0caee49237f0e5885ea8f3","subject":"fixed dimensions","message":"fixed dimensions\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/modules.scad","new_file":"resin\/tank\/modules.scad","new_contents":"inch = 25.4;\nwidth = inch * 9;\nheight = inch * 6;\nglass_thickness = inch \/ 5;\nwall_thickness = inch \/ 8;\ncut_depth = 1;\ntank_depth = 40;\nsupport_height = 2;\nwall_height = tank_depth + support_height + glass_thickness;\n\nmodule glass(w,d,h) {\n color([1,1,1,0.35])\n cube([w,d,h], center=true);\n}\n\nmodule side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n color([1,0.1,0.0,0.85])\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.4,0.1,0.85])\n difference() {\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nmodule sideA() {\n side1(width + cut_depth * 0, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule sideB() {\n side2(height+(wall_thickness-cut_depth)*2, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n","old_contents":"width = 120;\nheight = 80;\nglass_thickness = 6;\nwall_height = 30;\nwall_thickness = 3;\ncut_depth = 1;\nsupport_height = 2;\n\nmodule glass(w,d,h) {\n color([1,1,1,0.35])\n cube([w,d,h], center=true);\n}\n\nmodule side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n color([1,0.1,0.0,0.85])\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.4,0.1,0.85])\n difference() {\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nmodule sideA() {\n side1(width + cut_depth * 0, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule sideB() {\n side2(height+(wall_thickness-cut_depth)*2, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"21ab037af21ecabebcd852cf671e200bc1431463","subject":"Some documentation on where knurl is used was added.","message":"Some documentation on where knurl is used was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_contents":"\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\/adafruit\/fidget-spinner\/ada-spinner-flat.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad> \r\nuse <..\/..\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>;\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\ncutoutName = \"Bat\"; \/\/ [Adafruit, Aqua Dude, Bat, Heart, OSHW, Spur, Star]\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 3; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/Allocate coin data\r\n\r\n\/\/ !!!!!to make the spoke count this is needed, so far. or maybe not!!!!\r\n\/\/coinName = coin == 1 ? \"AU $2\" :\r\n\/\/ (coin == 2 ? \"AU 5c\" :\r\n\/\/ (coin == 3 ? \"US 10c\" :\r\n\/\/ (coin == 4 ? \"UK \u00a31\" :\r\n\/\/ (coin == 5 ? \"UK 5p\" :\r\n\/\/ (coin == 6 ? \"EU \u20ac1\" :\r\n\/\/ (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule cutout()\r\n{\r\n if(cutoutName == \"Adafruit\")\r\n {\r\n scale([0.3, 0.3, 5])\r\n AdaSpinnerFlat_001();\r\n }\r\n else if(cutoutName == \"Bat\")\r\n {\r\n translate([0, 0, 4])\r\n scale([1, 1, 4])\r\n batmanLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Heart\")\r\n {\r\n heartThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Spur\")\r\n {\r\n scale([0.17, 0.17, 1])\r\n spur(height = 10);\r\n }\r\n else if(cutoutName == \"Star\")\r\n {\r\n \tstarThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"OSHW\")\r\n {\r\n translate(0,0,10)\r\n scale([1, 1, 17])\r\n oshwLogoThumbnail();\r\n }\r\n}\r\n\r\nmodule dollarHolder() \r\n{\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() \r\n {\r\n \/\/ TODO: this next item looks like where the knurl can be swapped out for\r\n \/\/ a regular cylinder or rounded cylinder.\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n cutout();\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalize\r\n\r\nmodule plus() \r\n{\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() \r\n{\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() \r\n{\r\n plus();\r\n minus();\r\n}\r\n","old_contents":"\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\/adafruit\/fidget-spinner\/ada-spinner-flat.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad> \r\nuse <..\/..\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>;\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\ncutoutName = \"Bat\"; \/\/ [Adafruit, Aqua Dude, Bat, Heart, OSHW, Spur, Star]\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 3; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/Allocate coin data\r\n\r\n\/\/ !!!!!to make the spoke count this is needed, so far. or maybe not!!!!\r\n\/\/coinName = coin == 1 ? \"AU $2\" :\r\n\/\/ (coin == 2 ? \"AU 5c\" :\r\n\/\/ (coin == 3 ? \"US 10c\" :\r\n\/\/ (coin == 4 ? \"UK \u00a31\" :\r\n\/\/ (coin == 5 ? \"UK 5p\" :\r\n\/\/ (coin == 6 ? \"EU \u20ac1\" :\r\n\/\/ (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule cutout()\r\n{\r\n if(cutoutName == \"Adafruit\")\r\n {\r\n scale([0.3, 0.3, 5])\r\n AdaSpinnerFlat_001();\r\n }\r\n else if(cutoutName == \"Bat\")\r\n {\r\n translate([0, 0, 4])\r\n scale([1, 1, 4])\r\n batmanLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Heart\")\r\n {\r\n heartThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Spur\")\r\n {\r\n scale([0.17, 0.17, 1])\r\n spur(height = 10);\r\n }\r\n else if(cutoutName == \"Star\")\r\n {\r\n \tstarThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"OSHW\")\r\n {\r\n translate(0,0,10)\r\n scale([1, 1, 17])\r\n oshwLogoThumbnail();\r\n }\r\n}\r\n\r\nmodule dollarHolder() \r\n{\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() {\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n cutout();\r\n\/\/ starThumbnail(height = 10);\r\n\/\/ cylinder(d=coin_d,h=holder_z+4,center=true);\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalize\r\n\r\nmodule plus() \r\n{\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() \r\n{\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() \r\n{\r\n plus();\r\n minus();\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5434c4cb4f9c3514d0a42cef9963fb1e11b29f4a","subject":"fixed spacing and added few elements, as an example","message":"fixed spacing and added few elements, as an example\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bash_coin\/bash_coin.scad","new_file":"bash_coin\/bash_coin.scad","new_contents":"N=2;\nM=3;\n\nmodule coin()\n{\n cylinder(r=25\/2, h=1, $fs=0.1);\n\n translate([-9, -7, 1])\n linear_extrude(height=1.5)\n text(text=str(\"#!\"), size=16, halign=[0,\"left\"]);\n}\n\n\n\nfor(i = [0:N-1])\n for(j = [0:M-1])\n translate([i*30, j*30, 0])\n coin();\n","old_contents":"N=1;\nM=1;\n\nmodule coin()\n{\n cylinder(r=25\/2, h=1, $fs=0.1);\n\n translate([-9, -7, 1])\n linear_extrude(height=1.5)\n text(text=str(\"#!\"), size=16, halign=[0,\"left\"]);\n}\n\n\n\/*\nfor(i = [0:N-1])\n for(j = [0:M-1])\n translate([i*20, j*20, 0])\n*\/\n coin();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8f8403931661af7ad141fefca85bf05d37ee684f","subject":"top part (incomplete yet)","message":"top part (incomplete yet)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_case\/top_aa.scad","new_file":"battery_case\/top_aa.scad","new_contents":"use \nuse \ninclude \n\nholeR = (screwDiameter+1)\/2;\n\nmodule topAA()\n{\n gondola();\n difference()\n {\n translate([sizeOX, (sizeOY+2)\/2-4, 0])\n {\n cube([7, 4, sizeOZ\/2]);\n translate([1,0,sizeOZ\/2])\n {\n cube([2*holeR+2*1, 4, 1+holeR]);\n translate([holeR+1, 4, holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR+1, h=4, $fs=0.01);\n }\n }\n \/\/ hole\n translate([sizeOX+holeR+2, (sizeOY+2)\/2+18\/2, sizeOZ\/2+holeR+1])\n rotate([90,0,0])\n cylinder(r=holeR, h=18, $fs=0.01);\n }\n}\n\ntopAA();\n%batteriesPack([margin, margin, margin]);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'battery_case\/top_aa.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"6ac3078b40c0020e65103027043a4f084fa6c292","subject":"junciton box - main part","message":"junciton box - main part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/junction_box.scad","new_file":"led_controler_junction_box\/junction_box.scad","new_contents":"use \n\nmodule junction_box()\n{\n wall = 2;\n extra_depth = 5;\n int_size = [70, 70, 24+3+extra_depth];\n\n difference()\n {\n \/\/ main box\n cube(int_size + [2,2,1]*wall);\n translate([1,1,1]*wall)\n cube(int_size);\n \/\/ place for cables\n cable_cut_in = [20, 10, wall];\n #translate([(int_size[0]+2*wall-cable_cut_in[0])\/2, wall, 0])\n cube(cable_cut_in);\n }\n\n \/\/ screw drivers\n dist_from_center = 59\/2;\n translate([-20, 0, 0]) \n for(dx = [-dist_from_center, +dist_from_center])\n {\n translate([(int_size[0]+2*wall)\/2+dx, wall+30, wall])\n difference()\n {\n cylinder(r=9\/2, h=int_size[2]-2);\n cylinder(r=(3+1)\/2, h=int_size[2]-2, $fs=1);\n #hull()\n {\n cube([9, 6, 3]);\n }\n }\n \n }\n}\n\nif(false)\n translate([-7, -6, 10*2])\n controller();\n\njunction_box();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led_controler_junction_box\/junction_box.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"03743fbb30d7dd435986d328278c600e44d865fd","subject":"[3d] Add MeterMonitor 3d model","message":"[3d] Add MeterMonitor 3d model\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/MeterMonitor.scad","new_file":"3d\/MeterMonitor.scad","new_contents":"wall = 1.3;\r\nwall_o = 1.9;\r\nwall_t = 1.45;\r\n\r\nlid_h = wall_t;\r\n\r\nlcd_w = 67;\r\nlcd_d = 28;\r\nlcd_s_w = 60; \/\/ width between screws\r\nlcd_s_d = 22;\r\nlcd_s_h = 8.5;\r\nlcd_s_dia = 3.1;\r\nlcd_a_w = 50; \/\/ width of actual 7-segment area\r\nlcd_a_d = 17.5; \/\/19\r\nlcd_ex_w = 0;\r\nlcd_ex_d = 2;\r\nlcd_window_offset = 2;\r\n\r\noa_w = 2*lcd_w+2*lcd_ex_w;\r\noa_d = 3*lcd_d+3*lcd_ex_d;\r\noa_h = 15;\r\n\r\nmain();\r\n\/\/translate([-oa_w\/2, oa_d\/2+wall_o+5, 0]) lid();\r\n\r\nmodule main() {\r\n difference() {\r\n union() {\r\n translate([-oa_w\/2-wall_o, -oa_d\/2-wall_o, 0])\r\n cube_bchamfer([oa_w+2*lcd_window_offset+2*wall_o, oa_d+2*wall_o, oa_h+wall_t+lid_h+wall_t\/2], r=5, bottom=1);\r\n } \/\/ union\r\n \r\n \/\/ main cutout\r\n translate([-oa_w\/2, -oa_d\/2, wall_t])\r\n cube_bchamfer([oa_w+2*lcd_window_offset, oa_d, oa_h+e], r=5-wall, bottom=1, top=lid_h);\r\n \/\/ lid cutout\r\n translate([-oa_w\/2,-oa_d\/2-wall_o-e,wall_t+oa_h])\r\n cube_fillet([oa_w+2*lcd_window_offset, oa_d+wall_o+e, lid_h+wall_t+e],\r\n vertical=[2,2], top=[lid_h,lid_h,0,lid_h], $fn=4);\r\n \r\n \/\/ LCD holes\r\n lcd_places() lcd_mount_n();\r\n \r\n \/\/ USB power hole\r\n wemos_place() translate([-5.9, -35.2\/2-1.2-wall_o-e, 2.3+2-0.5]) \r\n cube_fillet([13, 10, 6+1.5], top=[0,1,0,1]);\r\n\r\n \/\/branding();\r\n } \/\/ diff\r\n\r\n lcd_places() lcd_mount_p();\r\n wemos_place() wemos_mount(2);\r\n}\r\n\r\nmodule lid() {\r\n ww = oa_w+2*lcd_window_offset+0.2;\r\n dd = oa_d+wall_o-0.2;\r\n difference() {\r\n cube_fillet([ww, dd, lid_h], bottom=[0.5, 0.5, 0, 0.5], vertical=[1.5, 1.5 ,1.5, 1.5]);\r\n \/\/ vent holes\r\n \/\/translate([15, dd\/2, 0])\r\n \/\/ for (X=[0:3])\r\n \/\/ translate([X*(ww-30)\/3, 0, -e]) rotate(90) cylcyl(d*0.7, 2, lid_h+2*e, $fn=12);\r\n }\r\n \/\/ lock bump\r\n \/\/translate([wall_o+wall_t+0.5, dd\/2-4*wall, lid_h-e]) cube_fillet([2*wall, 8*wall, 0.6], top=[0.6,0,0.6,0]);\r\n translate([ww\/4, wall_o+wall_t+0.5, lid_h-e]) cube_fillet([ww\/2, 2*wall, 0.6], top=[0,0.6,0,0.6]);\r\n}\r\n\r\nmodule lcd_places() {\r\n \/\/ center two\r\n translate([lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n translate([-lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n \/\/ top\/bottom\r\n mirror2([0,1,0]) translate([-lcd_w\/2,lcd_d+lcd_ex_d,0])\r\n children();\r\n}\r\n\r\nmodule lcd_mount_p() {\r\n mirror2([1,0,0]) mirror2([0,1,0]) translate([lcd_s_w\/2, lcd_s_d\/2, wall_t]) {\r\n difference() {\r\n cylinder(lcd_s_h, d=lcd_s_dia+2*wall, $fn=16);\r\n translate([0,0,-e]) cylinder(lcd_s_h+2*e, d=lcd_s_dia, $fn=16);\r\n }\r\n }\r\n}\r\n\r\nmodule lcd_mount_n() {\r\n translate([-lcd_a_w\/2+lcd_window_offset-wall_t, -lcd_a_d\/2-wall_t, -e])\r\n cube_bchamfer([lcd_a_w+2*wall_t, lcd_a_d+2*wall_t, wall_t+2*e], r=3, top=wall_t, $fn=12);\r\n}\r\n\r\nmodule wemos_place() {\r\n translate([oa_w\/2+2*lcd_window_offset+wall-20, -lcd_d-lcd_ex_d, wall_t]) rotate(90) children();\r\n}\r\n\r\nmodule wemos_mount(extra_h) {\r\n we_w=25.9;\r\n we_d=35.2;\r\n we_h=6;\r\n we_rad=2.4;\r\n we_wall=1.2;\r\n \r\n difference() {\r\n translate([-we_w\/2-we_wall, -we_d\/2-we_wall, 0])\r\n cube_fillet([we_w+2*we_wall, we_d+2*we_wall, we_h+extra_h],\r\n vertical=[we_rad+we_wall*0.5855,we_rad+we_wall*0.5855]);\r\n \r\n translate([0,0,extra_h]) {\r\n \/\/ Big hole\r\n translate([-we_w\/2, -we_d\/2, 3])\r\n cube_fillet([we_w, we_d, we_h+2*e], vertical=[we_rad,we_rad]);\r\n \/\/ USB jack\r\n translate([-5.9, -we_d\/2-we_wall-e, 2.3]) \r\n cube([13, 10, we_h]);\r\n \/\/ Reset button\r\n translate([we_w\/2-e, -we_d\/2+1.8, 3.5]) \r\n cube([we_wall+2*e, 5, we_h]);\r\n \/\/ Bottom small hole\r\n translate([-21\/2, -31\/2, -e])\r\n cube([21, 31, we_h+2*e]);\r\n \/\/ wifi antenna\r\n translate([-18\/2, we_d\/2-(we_d-31)\/2-e, 3-1.3]) \r\n cube([18, (we_d-31)\/2+e, 1.3+e]);\r\n }\r\n } \/\/ diff\r\n \r\n \/\/ Grab notches\r\n translate([0,0,extra_h]) {\r\n translate([we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n translate([-we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n }\r\n}\r\n\r\nmodule branding() {\r\n translate([lcd_w\/2-3,lcd_d+lcd_ex_d,-e]) mirror([1,0,0]) linear_extrude(0.24+e)\r\n text(\"HeaterMeter\", halign=\"center\", valign=\"center\", font=\"Impact\",\r\n spacing=1.3, size=7);\r\n}\r\n\r\n\/********************************** LIBRARY CODE BELOW HERE **********************\/\r\n\r\ne = 0.01;\r\n\r\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\r\n \/\/ bottom beaded area\r\n if (bottom != 0) hull(){\r\n translate([r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n }\r\n \/\/ center\r\n translate([0,0,bottom]) hull(){\r\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n }\r\n \/\/ top beaded area\r\n if (top != 0) translate([0,0,dim[2]-top-e]) hull(){\r\n translate([r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n }\r\n}\r\n\r\nmodule mirror2(dim) {\r\n \/\/ Create both item and mirror of item\r\n children();\r\n mirror(dim) children();\r\n}\r\n\r\nmodule fillet(radius, height=100, $fn=$fn) {\r\n if (radius > 0) {\r\n \/\/this creates acutal fillet\r\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\r\n cube([radius * 2, radius * 2, height + 0.04]);\r\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\r\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\r\n } else {\r\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\r\n }\r\n\r\n }\r\n }\r\n}\r\n\r\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\r\n if (center) {\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n } else {\r\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n }\r\n}\r\n\r\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n j=[1,0,1,0];\r\n\r\n fn_V = $fn[0] == undef ? $fn : $fn[0];\r\n fn_T = $fn[1] == undef ? $fn : $fn[1];\r\n fn_B = $fn[2] == undef ? $fn : $fn[2];\r\n \r\n for (i=[0:3]) {\r\n if (radius > -1) {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\r\n } else {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\r\n }\r\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\r\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\r\n\r\n }\r\n}\r\n\r\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n \/\/makes CENTERED cube with round corners\r\n \/\/ if you give it radius, it will fillet vertical corners.\r\n \/\/othervise use vertical, top, bottom arrays\r\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\r\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\r\n\r\n if (radius == 0) {\r\n cube(size, center=true);\r\n } else {\r\n difference() {\r\n cube(size, center=true);\r\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\r\n }\r\n }\r\n}\r\n\r\n\/\/cube_fillet([10,10,10]);","old_contents":"","returncode":1,"stderr":"error: pathspec '3d\/MeterMonitor.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"40e2daf56250c70c514468e28a90a5e38feee5a9","subject":"main: fix bad iteration (i,j) variable names","message":"main: fix bad iteration (i,j) variable names\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n gantry_upper_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(x=[-1,1])\n translate([0,x*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n gantry_upper_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fda5b8dc4dc7258c208ea05fee3b2e435b8452c7","subject":"added 2 instances by default","message":"added 2 instances by default\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roll_handle\/kite_roll_handle.scad","new_file":"kite_roll_handle\/kite_roll_handle.scad","new_contents":"$fn=120;\n\nmodule main_handle_()\n{\n cylinder(r=18\/2, h=120);\n translate([0, 0, 120])\n {\n translate([0, 0, -10])\n cylinder(r1=18\/2, r2=30\/2, h=10);\n difference()\n {\n cylinder(r=(8.5-0.5)\/2, h=22+2+10);\n translate([-5, 0, 22+2+5])\n rotate([0, 90, 0])\n cylinder(r=(3+0.5)\/2, h=10);\n }\n }\n}\n\nmodule nut_(h)\n{\n block_size=[3.5, 5.5, h];\n n=3;\n hull()\n for(i=[0:n-1])\n rotate(i*[0, 0, 360\/n\/2])\n translate([block_size[0], block_size[1], 0]*-1\/2)\n cube(block_size);\n}\n\nmodule nut_space_()\n{\n scale([1.2, 1.2, 1.2])\n nut_(2.5);\n}\n\nmodule block_()\n{\n difference()\n {\n union()\n {\n cylinder(r=30\/2, h=0.6);\n cylinder(r=15\/2, h=10);\n }\n cylinder(r=8.5\/2, h=20);\n translate([0, 0, 5])\n rotate([0, 90, 0])\n {\n translate([0, 0, 5])\n nut_space_();\n translate([0, 0, -10])\n cylinder(r=3.5\/2, h=20);\n }\n }\n}\n\nfor(i=[0:1])\n translate(i*[0, 35, 0])\n {\n main_handle_();\n translate([27, 0, 0])\n block_();\n }\n","old_contents":"$fn=120;\n\nmodule main_handle_()\n{\n cylinder(r=18\/2, h=120);\n translate([0, 0, 120])\n {\n translate([0, 0, -10])\n cylinder(r1=18\/2, r2=30\/2, h=10);\n difference()\n {\n cylinder(r=(8.5-0.5)\/2, h=22+2+10);\n translate([-5, 0, 22+2+5])\n rotate([0, 90, 0])\n cylinder(r=(3+0.5)\/2, h=10);\n }\n }\n}\n\nmodule nut_(h)\n{\n block_size=[3.5, 5.5, h];\n n=3;\n hull()\n for(i=[0:n-1])\n rotate(i*[0, 0, 360\/n\/2])\n translate([block_size[0], block_size[1], 0]*-1\/2)\n cube(block_size);\n}\n\nmodule nut_space_()\n{\n scale([1.2, 1.2, 1.2])\n nut_(2.5);\n}\n\nmodule block_()\n{\n difference()\n {\n union()\n {\n cylinder(r=30\/2, h=0.6);\n cylinder(r=15\/2, h=10);\n }\n cylinder(r=8.5\/2, h=20);\n translate([0, 0, 5])\n rotate([0, 90, 0])\n {\n translate([0, 0, 5])\n nut_space_();\n translate([0, 0, -10])\n cylinder(r=3.5\/2, h=20);\n }\n }\n}\n\n\nmain_handle_();\ntranslate([27, 0, 0])\n block_();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ecdb6495b9626072073d6213e8131c900f31aeb6","subject":"triangles: Add copy of Triangles.scad","message":"triangles: Add copy of Triangles.scad\n\nFrom https:\/\/github.com\/tkoopman\/Delta-Diamond\/blob\/master\/OpenSCAD\/Triangles.scad\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"triangles.scad","new_file":"triangles.scad","new_contents":"\/*\nTriangles.scad\n Author: Tim Koopman\n https:\/\/github.com\/tkoopman\/Delta-Diamond\/blob\/master\/OpenSCAD\/Triangles.scad\n\n angleCA\n \/|\\\n a \/ H \\ c\n \/ | \\\n angleAB ------- angleBC\n b\n\nStandard Parameters\n\tcenter: true\/false\n\t\tIf true same as centerXYZ = [true, true, true]\n\n\tcenterXYZ: Vector of 3 true\/false values [CenterX, CenterY, CenterZ]\n\t\tcenter must be left undef\n\n\theight: The 3D height of the Triangle. Ignored if heights defined\n\n\theights: Vector of 3 height values heights @ [angleAB, angleBC, angleCA]\n\t\tIf CenterZ is true each height will be centered individually, this means\n\t\tthe shape will be different depending on CenterZ. Most times you will want\n\t\tCenterZ to be true to get the shape most people want.\n*\/\n\n\/* \nTriangle\n\ta: Length of side a\n\tb: Length of side b\n\tangle: angle at point angleAB\n*\/\nmodule Triangle(\n\t\t\ta, b, angle, height=1, heights=undef,\n\t\t\tcenter=undef, centerXYZ=[false,false,false])\n{\n\t\/\/ Calculate Heights at each point\n\theightAB = ((heights==undef) ? height : heights[0])\/2;\n\theightBC = ((heights==undef) ? height : heights[1])\/2;\n\theightCA = ((heights==undef) ? height : heights[2])\/2;\n\tcenterZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCA);\n\n\t\/\/ Calculate Offsets for centering\n\toffsetX = (center || (center==undef && centerXYZ[0]))?((cos(angle)*a)+b)\/3:0;\n\toffsetY = (center || (center==undef && centerXYZ[1]))?(sin(angle)*a)\/3:0;\n\t\n\tpointAB1 = [-offsetX,-offsetY, centerZ-heightAB];\n\tpointAB2 = [-offsetX,-offsetY, centerZ+heightAB];\n\tpointBC1 = [b-offsetX,-offsetY, centerZ-heightBC];\n\tpointBC2 = [b-offsetX,-offsetY, centerZ+heightBC];\n\tpointCA1 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ-heightCA];\n\tpointCA2 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ+heightCA];\n\n\tpolyhedron(\n\t\tpoints=[\tpointAB1, pointBC1, pointCA1,\n\t\t\t\t\tpointAB2, pointBC2, pointCA2 ],\n\t\ttriangles=[\t\n\t\t\t[0, 1, 2],\n\t\t\t[3, 5, 4],\n\t\t\t[0, 3, 1],\n\t\t\t[1, 3, 4],\n\t\t\t[1, 4, 2],\n\t\t\t[2, 4, 5],\n\t\t\t[2, 5, 0],\n\t\t\t[0, 5, 3] ] );\n}\n\n\/*\nIsosceles Triangle\n\tExactly 2 of the following paramaters must be defined.\n\tIf all 3 defined H will be ignored.\n\tb: length of side b\n\tangle: angle at points angleAB & angleBC.\n*\/\nmodule Isosceles_Triangle(\n\t\t\tb, angle, H=undef, height=1, heights=undef,\n\t\t\tcenter=undef, centerXYZ=[true, false, false])\n{\n\tvalid = \t(angle!=undef)?((angle < 90) && (b!=undef||H!=undef)) : (b!=undef&&H!=undef);\n\tANGLE = (angle!=undef) ? angle : atan(H \/ (b\/2));\n\ta = (b==undef)?(H\/sin((180-(angle*2))\/2)) : \n\t\t (b \/ cos(ANGLE))\/2;\n\tB = (b==undef)? (cos(angle)*a)*2:b;\n\tif (valid)\n\t{\n\t\tTriangle(a=a, b=B, angle=ANGLE, height=height, heights=heights,\n\t\t\t\t\tcenter=center, centerXYZ=centerXYZ);\n\t} else {\n\t\techo(\"Invalid Isosceles_Triangle. Must specify any 2 of b, angle and H, and if angle used angle must be less than 90\");\n\t}\n}\n\n\/*\nRight Angled Triangle\n\tCreate a Right Angled Triangle where the hypotenuse will be calculated.\n\n |\\\n a| \\\n | \\\n ----\n b\n\ta: length of side a\n\tb: length of side b\n*\/\nmodule Right_Angled_Triangle(\n\t\t\ta, b, height=1, heights=undef,\n\t\t\tcenter=undef, centerXYZ=[false, false, false])\n{\n\tTriangle(a=a, b=b, angle=90, height=height, heights=heights,\n\t\t\t\tcenter=center, centerXYZ=centerXYZ);\n}\n\n\/*\nWedge\n\tIs same as Right Angled Triangle with 2 different heights, and rotated.\n\tGood for creating support structures.\n*\/\nmodule Wedge(a, b, w1, w2)\n{\n\trotate([90,0,0])\n\t\tRight_Angled_Triangle(a, b, heights=[w1, w2, w1], centerXYZ=[false, false, true]);\n}\n\n\/*\nEquilateral Triangle\n\tCreate a Equilateral Triangle.\n\n\tl: Length of all sides (a, b & c)\n\tH: Triangle size will be based on the this 2D height\n\t\tWhen using H, l is ignored.\n*\/\nmodule Equilateral_Triangle(\n\t\t\tl=10, H=undef, height=1, heights=undef,\n\t\t\tcenter=undef, centerXYZ=[true,false,false])\n{\n\tL = (H==undef)?l:H\/sin(60);\n\tTriangle(a=L,b=L,angle=60,height=height, heights=heights,\n\t\t\t\tcenter=center, centerXYZ=centerXYZ);\n}\n\n\/*\nTrapezoid\n\tCreate a Basic Trapezoid (Based on Isosceles_Triangle)\n\n d\n \/----\\\n \/ | \\\n a \/ H \\ c\n \/ | \\\n angle ------------ angle\n b\n\n\tb: Length of side b\n\tangle: Angle at points angleAB & angleBC\n\tH: The 2D height at which the triangle should be cut to create the trapezoid\n\theights: If vector of size 3 (Standard for triangles) both cd & da will be the same height, if vector have 4 values [ab,bc,cd,da] than each point can have different heights.\n*\/\nmodule Trapezoid(\n\t\t\tb, angle=60, H, height=1, heights=undef,\n\t\t\tcenter=undef, centerXYZ=[true,false,false])\n{\n\tvalidAngle = (angle < 90);\n\tadX = H \/ tan(angle);\n\n\t\/\/ Calculate Heights at each point\n\theightAB = ((heights==undef) ? height : heights[0])\/2;\n\theightBC = ((heights==undef) ? height : heights[1])\/2;\n\theightCD = ((heights==undef) ? height : heights[2])\/2;\n\theightDA = ((heights==undef) ? height : ((len(heights) > 3)?heights[3]:heights[2]))\/2;\n\n\t\/\/ Centers\n\tcenterX = (center || (center==undef && centerXYZ[0]))?0:b\/2;\n\tcenterY = (center || (center==undef && centerXYZ[1]))?0:H\/2;\n\tcenterZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCD,heightDA);\n\n\t\/\/ Points\n\ty = H\/2;\n\tbx = b\/2;\n\tdx = (b-(adX*2))\/2;\n\n\tpointAB1 = [centerX-bx, centerY-y, centerZ-heightAB];\n\tpointAB2 = [centerX-bx, centerY-y, centerZ+heightAB];\n\tpointBC1 = [centerX+bx, centerY-y, centerZ-heightBC];\n\tpointBC2 = [centerX+bx, centerY-y, centerZ+heightBC];\n\tpointCD1 = [centerX+dx, centerY+y, centerZ-heightCD];\n\tpointCD2 = [centerX+dx, centerY+y, centerZ+heightCD];\n\tpointDA1 = [centerX-dx, centerY+y, centerZ-heightDA];\n\tpointDA2 = [centerX-dx, centerY+y, centerZ+heightDA];\n\n\tvalidH = (adX < b\/2);\n\n\tif (validAngle && validH)\n\t{\n\t\tpolyhedron(\n\t\t\tpoints=[\tpointAB1, pointBC1, pointCD1, pointDA1,\n\t\t\t\t\t\tpointAB2, pointBC2, pointCD2, pointDA2 ],\n\t\t\ttriangles=[\t\n\t\t\t\t[0, 1, 2],\n\t\t\t\t[0, 2, 3],\n\t\t\t\t[4, 6, 5],\n\t\t\t\t[4, 7, 6],\n\t\t\t\t[0, 4, 1],\n\t\t\t\t[1, 4, 5],\n\t\t\t\t[1, 5, 2],\n\t\t\t\t[2, 5, 6],\n\t\t\t\t[2, 6, 3],\n\t\t\t\t[3, 6, 7],\n\t\t\t\t[3, 7, 0],\n\t\t\t\t[0, 7, 4]\t] );\n\t} else {\n\t\tif (!validAngle) echo(\"Trapezoid invalid, angle must be less than 90\");\n\t\telse echo(\"Trapezoid invalid, H is larger than triangle\");\n\t}\n}\n\n\n\/\/ Examples\nTriangle(a=5, b=15, angle=33, centerXYZ=[true,false,false]);\ntranslate([20,0,0]) Right_Angled_Triangle(a=5, b=20, centerXYZ=[false,true,false]);\ntranslate([45,0,0]) Wedge(a=5, b=20, w1=10, w2=5);\ntranslate([-20,0,0]) Trapezoid(b=20, angle=33, H=4, height=5, centerXYZ=[true,false,true]);\n\ntranslate([0,10,0]) Isosceles_Triangle(b=20, angle=33);\ntranslate([30,10,0]) Isosceles_Triangle(b=20, H=5);\ntranslate([-30,10,0]) Isosceles_Triangle(angle=33, H=5, center=true);\n\ntranslate([15,-25,0]) Equilateral_Triangle(l=20);\ntranslate([-15,-25,0]) Equilateral_Triangle(H=20);\n","old_contents":"\/*\n Triangles.scad\nAuthor: Tim Koopman\nhttps:\/\/github.com\/tkoopman\/Delta-Diamond\/blob\/master\/OpenSCAD\/Triangles.scad\n\nangleCA\n\/|\\\na \/ H \\ c\n\/ | \\\nangleAB ------- angleBC\nb\n\nStandard Parameters\ncenter: true\/false\nIf true same as centerXYZ = [true, true, true]\n\ncenterXYZ: Vector of 3 true\/false values [CenterX, CenterY, CenterZ]\ncenter must be left undef\n\nheight: The 3D height of the Triangle. Ignored if heights defined\n\nheights: Vector of 3 height values heights @ [angleAB, angleBC, angleCA]\nIf CenterZ is true each height will be centered individually, this means\nthe shape will be different depending on CenterZ. Most times you will want\nCenterZ to be true to get the shape most people want.\n *\/\n\n\/* \n Triangle\na: Length of side a\nb: Length of side b\nangle: angle at point angleAB\n *\/\nmodule Triangle(\n a, b, angle, height=1, heights=undef,\n center=undef, centerXYZ=[false,false,false])\n{\n \/\/ Calculate Heights at each point\n heightAB = ((heights==undef) ? height : heights[0])\/2;\n heightBC = ((heights==undef) ? height : heights[1])\/2;\n heightCA = ((heights==undef) ? height : heights[2])\/2;\n centerZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCA);\n\n \/\/ Calculate Offsets for centering\n offsetX = (center || (center==undef && centerXYZ[0]))?((cos(angle)*a)+b)\/3:0;\n offsetY = (center || (center==undef && centerXYZ[1]))?(sin(angle)*a)\/3:0;\n\n pointAB1 = [-offsetX,-offsetY, centerZ-heightAB];\n pointAB2 = [-offsetX,-offsetY, centerZ+heightAB];\n pointBC1 = [b-offsetX,-offsetY, centerZ-heightBC];\n pointBC2 = [b-offsetX,-offsetY, centerZ+heightBC];\n pointCA1 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ-heightCA];\n pointCA2 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ+heightCA];\n\n polyhedron(\n points=[\tpointAB1, pointBC1, pointCA1,\n pointAB2, pointBC2, pointCA2 ],\n triangles=[\t\n [0, 1, 2],\n [3, 5, 4],\n [0, 3, 1],\n [1, 3, 4],\n [1, 4, 2],\n [2, 4, 5],\n [2, 5, 0],\n [0, 5, 3] ] );\n}\n\n\/*\n Isosceles Triangle\n Exactly 2 of the following paramaters must be defined.\n If all 3 defined H will be ignored.\nb: length of side b\nangle: angle at points angleAB & angleBC.\n *\/\nmodule Isosceles_Triangle(\n b, angle, H=undef, height=1, heights=undef,\n center=undef, centerXYZ=[true, false, false])\n{\n valid = \t(angle!=undef)?((angle < 90) && (b!=undef||H!=undef)) : (b!=undef&&H!=undef);\n ANGLE = (angle!=undef) ? angle : atan(H \/ (b\/2));\n a = (b==undef)?(H\/sin((180-(angle*2))\/2)) : \n (b \/ cos(ANGLE))\/2;\n B = (b==undef)? (cos(angle)*a)*2:b;\n if (valid)\n {\n Triangle(a=a, b=B, angle=ANGLE, height=height, heights=heights,\n center=center, centerXYZ=centerXYZ);\n } else {\n echo(\"Invalid Isosceles_Triangle. Must specify any 2 of b, angle and H, and if angle used angle must be less than 90\");\n }\n}\n\n\/*\n Right Angled Triangle\n Create a Right Angled Triangle where the hypotenuse will be calculated.\n\n |\\\n a| \\\n | \\\n ----\n b\na: length of side a\nb: length of side b\n *\/\nmodule Right_Angled_Triangle(\n a, b, height=1, heights=undef,\n center=undef, centerXYZ=[false, false, false])\n{\n Triangle(a=a, b=b, angle=90, height=height, heights=heights,\n center=center, centerXYZ=centerXYZ);\n}\n\n\/*\n Wedge\n Is same as Right Angled Triangle with 2 different heights, and rotated.\n Good for creating support structures.\n *\/\nmodule Wedge(a, b, w1, w2)\n{\n rotate([90,0,0])\n Right_Angled_Triangle(a, b, heights=[w1, w2, w1], centerXYZ=[false, false, true]);\n}\n\n\/*\n Equilateral Triangle\n Create a Equilateral Triangle.\n\nl: Length of all sides (a, b & c)\nH: Triangle size will be based on the this 2D height\nWhen using H, l is ignored.\n *\/\nmodule Equilateral_Triangle(\n l=10, H=undef, height=1, heights=undef,\n center=undef, centerXYZ=[true,false,false])\n{\n L = (H==undef)?l:H\/sin(60);\n Triangle(a=L,b=L,angle=60,height=height, heights=heights,\n center=center, centerXYZ=centerXYZ);\n}\n\n\/*\n Trapezoid\n Create a Basic Trapezoid (Based on Isosceles_Triangle)\n\n d\n \/----\\\n \/ | \\\n a \/ H \\ c\n \/ | \\\n angle ------------ angle\n b\n\nb: Length of side b\nangle: Angle at points angleAB & angleBC\nH: The 2D height at which the triangle should be cut to create the trapezoid\nheights: If vector of size 3 (Standard for triangles) both cd & da will be the same height, if vector have 4 values [ab,bc,cd,da] than each point can have different heights.\n *\/\nmodule Trapezoid(\n b, angle=60, H, height=1, heights=undef,\n center=undef, centerXYZ=[true,false,false])\n{\n validAngle = (angle < 90);\n adX = H \/ tan(angle);\n\n \/\/ Calculate Heights at each point\n heightAB = ((heights==undef) ? height : heights[0])\/2;\n heightBC = ((heights==undef) ? height : heights[1])\/2;\n heightCD = ((heights==undef) ? height : heights[2])\/2;\n heightDA = ((heights==undef) ? height : ((len(heights) > 3)?heights[3]:heights[2]))\/2;\n\n \/\/ Centers\n centerX = (center || (center==undef && centerXYZ[0]))?0:b\/2;\n centerY = (center || (center==undef && centerXYZ[1]))?0:H\/2;\n centerZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCD,heightDA);\n\n \/\/ Points\n y = H\/2;\n bx = b\/2;\n dx = (b-(adX*2))\/2;\n\n pointAB1 = [centerX-bx, centerY-y, centerZ-heightAB];\n pointAB2 = [centerX-bx, centerY-y, centerZ+heightAB];\n pointBC1 = [centerX+bx, centerY-y, centerZ-heightBC];\n pointBC2 = [centerX+bx, centerY-y, centerZ+heightBC];\n pointCD1 = [centerX+dx, centerY+y, centerZ-heightCD];\n pointCD2 = [centerX+dx, centerY+y, centerZ+heightCD];\n pointDA1 = [centerX-dx, centerY+y, centerZ-heightDA];\n pointDA2 = [centerX-dx, centerY+y, centerZ+heightDA];\n\n validH = (adX < b\/2);\n\n if (validAngle && validH)\n {\n polyhedron(\n points=[\tpointAB1, pointBC1, pointCD1, pointDA1,\n pointAB2, pointBC2, pointCD2, pointDA2 ],\n triangles=[\t\n [0, 1, 2],\n [0, 2, 3],\n [4, 6, 5],\n [4, 7, 6],\n [0, 4, 1],\n [1, 4, 5],\n [1, 5, 2],\n [2, 5, 6],\n [2, 6, 3],\n [3, 6, 7],\n [3, 7, 0],\n [0, 7, 4]\t] );\n } else {\n if (!validAngle) echo(\"Trapezoid invalid, angle must be less than 90\");\n else echo(\"Trapezoid invalid, H is larger than triangle\");\n }\n}\n\n\n\/\/ Examples\nTriangle(a=5, b=15, angle=33, centerXYZ=[true,false,false]);\ntranslate([20,0,0]) Right_Angled_Triangle(a=5, b=20, centerXYZ=[false,true,false]);\ntranslate([45,0,0]) Wedge(a=5, b=20, w1=10, w2=5);\ntranslate([-20,0,0]) Trapezoid(b=20, angle=33, H=4, height=5, centerXYZ=[true,false,true]);\n\ntranslate([0,10,0]) Isosceles_Triangle(b=20, angle=33);\ntranslate([30,10,0]) Isosceles_Triangle(b=20, H=5);\ntranslate([-30,10,0]) Isosceles_Triangle(angle=33, H=5, center=true);\n\ntranslate([15,-25,0]) Equilateral_Triangle(l=20);\ntranslate([-15,-25,0]) Equilateral_Triangle(H=20);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ef438f90ed27384e7f2982ea677235e95470ed37","subject":"Add a few comments","message":"Add a few comments\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/bar_mount_reduced.scad","new_file":"Hardware\/bar_mount_reduced.scad","new_contents":"tube_diameter = 28;\nmargin = 1 ;\nthickness\t =1;\nwidth = 15;\nbeam_size = 10;\nbeam_thickness = 5;\nclip_width=10;\n\ndifference(){\n\tunion(){\n\t\t\/\/ Cylinder\n\t\trotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin, h = width, center=true);\n\n\t\t\/\/ Top flat part\n\t\ttranslate([0, 0, beam_thickness]) cube(size=[beam_size+2*thickness, width, tube_diameter+2*thickness], \tcenter = true);\n\t\t\n\t\t\/\/ Part to block strap\n\t\ttranslate([0, width\/2-(width-clip_width)\/4, 0]) hull(){\n\t\trotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin+1, h = (width-clip_width)\/2, center=true);\n\t\ttranslate([0, 0, beam_thickness+1]) cube(size=[beam_size+2*thickness, (width-clip_width)\/2, tube_diameter+2*thickness], center = true);\n\t\t}\n\n\t\t\/\/ Second part to block strap\n\t\ttranslate([0, -width\/2+(width-clip_width)\/4, 0]) hull(){\n\t\trotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin+1, h = (width-clip_width)\/2, center=true);\n\t\ttranslate([0, 0, beam_thickness+1]) cube(size=[beam_size+2*thickness, (width-clip_width)\/2, tube_diameter+2*thickness], center = true);\n\t\t}\n\t}\n\n\t\/\/ Place for beam\n\ttranslate([0, 0, tube_diameter\/2+thickness*2+beam_thickness\/2+1]) cube(size=[beam_size, 2*width, beam_thickness+2], center = true);\n\n\t\/\/ Cylinder corresponding to space for bar\n\trotate([90,0,0]) cylinder(r=tube_diameter\/2+margin, h = 2*width, center=true);\n\n\t\/\/ Cube to hide bottom\n\ttranslate([0, 0, -tube_diameter*5\/8]) cube(size=[2*tube_diameter, 2*width, tube_diameter*2], center=true);\n\n}","old_contents":"tube_diameter = 28;\nmargin = 1 ;\nthickness\t =1;\nwidth = 15;\nbeam_size = 10;\nbeam_thickness = 5;\n\n\nclip_width=10;\ndifference(){\nunion(){\nunion(){\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin, h = width, center=true);\ntranslate([0, 0, beam_thickness]) cube(size=[beam_size+2*thickness, width, tube_diameter+2*thickness], center = true);\n}\n\ntranslate([0, width\/2-(width-clip_width)\/4, 0]) hull(){\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin+1, h = (width-clip_width)\/2, center=true);\ntranslate([0, 0, beam_thickness+1]) cube(size=[beam_size+2*thickness, (width-clip_width)\/2, tube_diameter+2*thickness], center = true);\n}\ntranslate([0, -width\/2+(width-clip_width)\/4, 0]) hull(){\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+thickness+margin+1, h = (width-clip_width)\/2, center=true);\ntranslate([0, 0, beam_thickness+1]) cube(size=[beam_size+2*thickness, (width-clip_width)\/2, tube_diameter+2*thickness], center = true);\n}\n}\ntranslate([0, 0, tube_diameter\/2+thickness*2+beam_thickness\/2+1]) cube(size=[beam_size, 2*width, beam_thickness+2], center = true);\nrotate([90,0,0]) cylinder(r=tube_diameter\/2+margin, h = 2*width, center=true);\ntranslate([0, 0, -tube_diameter*5\/8]) cube(size=[2*tube_diameter, 2*width, tube_diameter*2], center=true);\n\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b466b828f800d44d72ba34a9eda9ab35ee3cd442","subject":"added rpi w (zero) holder","message":"added rpi w (zero) holder\n","repos":"abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev,abetusk\/dev","old_file":"projects\/parameow\/rpi-holder.scad","new_file":"projects\/parameow\/rpi-holder.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b74dcd14c1e3edc2fdae167ec9ea26cd30c3ab3f","subject":"1 box by default","message":"1 box by default\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/multi_junction_box.scad","new_file":"led_controler_junction_box\/multi_junction_box.scad","new_contents":"use ;\n\nfor(i = [0:0])\n translate(i*[0, 83, 0])\n junction_box();\n","old_contents":"use ;\n\nfor(i = [0:2])\n translate(i*[0, 83, 0])\n junction_box();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1c32bd645c57665bb5657d61a3e3bb702989316c","subject":"Add top model","message":"Add top model\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\nusb_type_a_h = 7;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_r = bolt_d\/2 + 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\n\/\/ TODO\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\n\/\/ TODO\ntop_bolt_h = 2;\ntop_bolt_r = gaika_w \/ 2 \/ cos(30) + 0.05;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=fn, r=stoiki_r, h=top_box_z-th+eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=fn, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.5;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bd41e79130d5ff6aa12a84e63fd94f9ba7d5d344","subject":"add cad for dome motor","message":"add cad for dome motor\n","repos":"tarned\/r2d2,tarned\/r2d2","old_file":"cad\/dome_motor_bracket\/dome_motor_bracket.scad","new_file":"cad\/dome_motor_bracket\/dome_motor_bracket.scad","new_contents":"\/\/ JohK nutsnbolts library\ninclude <..\/nutsnbolts\/cyl_head_bolt.scad>\n\n\/\/ all measures in mm\nd = 10;\nthickness = 2;\ndo = d+2*thickness;\nthickness_mount = 4; \/\/ additional to thickness\nh = 60+thickness;\nclr = 0.3; \/\/ clearance of cutouts\nscrew = \"M4\";\n\nmodule holder() {\n \/\/ make the half of the bracket square to lay flat on the thing to mount to\n cube(size=[do,do\/2,h]);\n\n \/\/ the rest round to spare filament\n translate([do\/2,do\/2,0])\n cylinder(h,do\/2,do\/2);\n}\n\nmodule shaft_hole() {\n translate([do\/2,do\/2,thickness])\n cylinder(h,d\/2+clr,d\/2+clr);\n translate([-clr,0,10])\n cube(size=[do+2*clr,do+clr,h-2*10]);\n}\n\nmodule base() {\n difference() {\n cube(size=[do,thickness_mount,h]);\n\n \/\/ nut-catch for mounting bracket\n translate([do\/2,5,8]) rotate([-90,0,0])\n nutcatch_parallel(screw, l=20, clk=clr, clh=clr, clsl=clr);\n translate([do\/2,5,h-8]) rotate([-90,0,0])\n nutcatch_parallel(screw, l=20, clk=clr, clh=clr, clsl=clr);\n }\n\n translate([0,thickness_mount,0])\n difference() {\n holder();\n shaft_hole();\n }\n}\n\nmodule shaft() {\n difference() {\n translate([0,0,thickness])\n cylinder(h-thickness,d\/2,d\/2);\n\n \/\/ nut-catch for mounting motor\n translate([0,0,18]) rotate([90,0,0])\n nutcatch_parallel(screw, l=20, clk=clr, clh=clr, clsl=clr);\n translate([0,0,h-18]) rotate([90,0,0])\n nutcatch_parallel(screw, l=20, clk=clr, clh=clr, clsl=clr);\n }\n}\n\n{\n color(\"red\")\n base();\n\n translate([do\/2,do\/2+thickness_mount,0])\n shaft();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cad\/dome_motor_bracket\/dome_motor_bracket.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"93f3be81136142b99e82570a92877e7698e3dc3e","subject":"Add logo2 OpenSCAD file","message":"Add logo2 OpenSCAD file\n","repos":"bmtwebdevs\/sodalicious,bmtwebdevs\/sodalicious","old_file":"STL\/Logo2.scad","new_file":"STL\/Logo2.scad","new_contents":"\n\ncube([72,22,4]);\n\n\n\ntranslate([1,10,4])\n{ \n linear_extrude(height = 2.5)\n {\n color(c = [1,0,0], alpha = 1.0){\n text(text=\"#Sodalicious\", spacing=0.9, font=\"Arial\");\n } \n }\n}\ntranslate([1,2,4]) {\n linear_extrude(height = 2.5)\n {\n color(c = [1,0,0], alpha = 1.0){\n text(text=\"British Mixing Technology\", spacing=0.9, font=\"Arial\", size=5);\n } \n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'STL\/Logo2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7d55ed156b3d8afa98c124adfa1f3747bd6af638","subject":"fixup! *: use undef\/U alias","message":"fixup! *: use undef\/U alias\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"system.scad","new_file":"system.scad","new_contents":"XAXIS = [1,0,0];\nYAXIS = [0,1,0];\nZAXIS = [0,0,1];\nNAXIS = [0,0,0];\n\nX = XAXIS;\nY = YAXIS;\nZ = ZAXIS;\nN = NAXIS;\n\nAXES = [X,Y,Z];\n\nU = undef;\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n","old_contents":"XAXIS = [1,0,0];\nYAXIS = [0,1,0];\nZAXIS = [0,0,1];\nNAXIS = [0,0,0];\n\nX = XAXIS;\nY = YAXIS;\nZ = ZAXIS;\nN = NAXIS;\n\nAXES = [X,Y,Z];\n\nU = U;\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c57b6e45dac5d5b93df9251f591b6630644a5b33","subject":"Add a flange to the bottom of the bumper to make it a bit stiffer. Should help with direct contacts on the front","message":"Add a flange to the bottom of the bumper to make it a bit stiffer.\nShould help with direct contacts on the front\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"\/* Pins required -\n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\n\/\/ TODO: The locations of these connectors are just horrible and too \"magic\"\nBumper_Con_LeftMicroSwitch =\n[\n\tzr3Vect( [(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightMicroSwitch =\n[\n\t[ -zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[0],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[1],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nBumper_Con_LeftPin =\n[\n\tzr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightPin =\n[\n\t[ -zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[0],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[1],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t view(t=[1, -8, -11], r=[52, 0, 23], d=184);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) {\n\t\t\tconnector(Bumper_Con_LeftMicroSwitch);\n\t\t\tconnector(Bumper_Con_RightMicroSwitch);\n\t\t\tconnector(Bumper_Con_LeftPin);\n\t\t\tconnector(Bumper_Con_RightPin);\n\t\t}\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 8;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 5;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius of the bumper\n\n \/\/ Bumper flange\n\trotate([0, 0, (180 - wrapAngle) \/ 2])\n difference() {\n linear_extrude(thickness*2)\n donutSector(outr, outr-thickness*2, wrapAngle);\n\n translate([0,0,thickness*2])\n rotate_extrude(convexity = 10)\n translate([outr-thickness*2,0,0])\n circle(r=thickness);\n }\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\trotate([0, 0, (180 - wrapAngle) \/ 2])\n\t\tdonutSector(outr, outr - thickness, wrapAngle);\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\t {\n\n\t\t\/\/ Springy bits\n\t\ttranslate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 16, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 0.5 + 2*dw;\n\tbase_width = ms_width + 6.5;\n\n\t\/\/ Base\n\tcube([base_length, base_width, dw]);\n\t\/\/ Microswitch surround\n\tcube([dw, base_width, dw + 3]);\n\ttranslate([base_length - dw, 0, 0])\n\t\tcube([dw, base_width, dw + 3]);\n\ttranslate([0, 4, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\n\t\/\/ Rear support lozenge with pin hole\n\tlozenge_height = dw + ms_height;\n\n\ttranslate([0, -7, 0])\n\tdifference() {\n\t\tlinear_extrude(lozenge_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([15.7, 2.65, lozenge_height + dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n\n\/\/ Rotate a 3vector v = [x,y,z] about the origin by ang degrees\nfunction zr3Vect(v, ang) =\n[\n\tv[0] * cos(ang) - v[1] * sin(ang),\n\tv[0] * sin(ang) + v[1] * cos(ang),\n\tv[2]\n];\n","old_contents":"\/* Pins required -\n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\n\/\/ TODO: The locations of these connectors are just horrible and too \"magic\"\nBumper_Con_LeftMicroSwitch =\n[\n\tzr3Vect( [(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightMicroSwitch =\n[\n\t[ -zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[0],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[1],\n\t zr3Vect([(-10 + dw + 9.6 +.25), (BaseDiameter\/2 - 16 + 4 + dw + 1.25 + .5), dw], 43.5)[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nBumper_Con_LeftPin =\n[\n\tzr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 ),\n\t[0, 0, 1],\n\t43.5,\n\t0,\n\t0];\n\nBumper_Con_RightPin =\n[\n\t[ -zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[0],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[1],\n\t zr3Vect( [(-10 + 15.7 ), (BaseDiameter\/2 - 16 + -7 + 2.65 ), dw + 5.8 + dw], 43.5 )[2] ],\n\t[0, 0, 1],\n\t-43.5,\n\t0,\n\t0];\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t view(t=[1, -8, -11], r=[52, 0, 23], d=184);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) {\n\t\t\tconnector(Bumper_Con_LeftMicroSwitch);\n\t\t\tconnector(Bumper_Con_RightMicroSwitch);\n\t\t\tconnector(Bumper_Con_LeftPin);\n\t\t\tconnector(Bumper_Con_RightPin);\n\t\t}\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"Bumper.stl\"));\n\t\t\t} else {\n\t\t\t\tBumperModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\tbumpstopWidth = 8;\t\t\t\/\/ width of little block that sticks out to hit the microswitch\n\tbumpstopHeight = 5;\t\t\t\/\/ height of little block that sticks out to hit the microswitch\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\trotate([0, 0, (180 - wrapAngle) \/ 2])\n\t\tdonutSector(outr, outr - thickness, wrapAngle);\n\n\t\/\/ Connectors\n\tfor(i=[0, 1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\t {\n\n\t\t\/\/ Springy bits\n\t\ttranslate([15, BaseDiameter\/2 - 11, 0])\n\t\trotate([0, 0, -130])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175);\n\n\t\t\/\/ Bumpstops to hit microwitch arm\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([bumpstopWidth, offset + 1 , bumpstopHeight]);\n\n\t\t\/\/ Microswitch plates\n\t\ttranslate([-10, BaseDiameter\/2 - 16, 0])\n\t\t\tMicroSwitchPlate();\n\t}\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 0.5 + 2*dw;\n\tbase_width = ms_width + 6.5;\n\n\t\/\/ Base\n\tcube([base_length, base_width, dw]);\n\t\/\/ Microswitch surround\n\tcube([dw, base_width, dw + 3]);\n\ttranslate([base_length - dw, 0, 0])\n\t\tcube([dw, base_width, dw + 3]);\n\ttranslate([0, 4, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\n\t\/\/ Rear support lozenge with pin hole\n\tlozenge_height = dw + ms_height;\n\n\ttranslate([0, -7, 0])\n\tdifference() {\n\t\tlinear_extrude(lozenge_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([15.7, 2.65, lozenge_height + dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n\n\/\/ Rotate a 3vector v = [x,y,z] about the origin by ang degrees\nfunction zr3Vect(v, ang) =\n[\n\tv[0] * cos(ang) - v[1] * sin(ang),\n\tv[0] * sin(ang) + v[1] * cos(ang),\n\tv[2]\n];\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"176e6c7bba85ec97f59a6d1beff6c93c79382119","subject":"Added stand for small christmas tree","message":"Added stand for small christmas tree\n","repos":"ksuszka\/3d-projects","old_file":"small\/christmas_tree_stand.scad","new_file":"small\/christmas_tree_stand.scad","new_contents":"$fs=0.2; \/\/ default 2\n$fa=3; \/\/ default 12\n\nmodule stand(dia=80) {\n trunk_height=30;\n module trunk() {\n difference() {\n linear_extrude(height=trunk_height, scale=5\/10) {\n circle(d=10);\n }\n }\n }\n\n module legs() {\n module legs_mold() {\n for(i=[0:120:359]) {\n rotate([0,0,i]) translate([-2,0,0]) cube([4,dia\/2,15]);\n }\n difference() {\n cylinder(r=dia\/2+0.1,h=2);\n translate([0,0,-1]) cylinder(r=dia\/2-4,h=4);\n }\n }\n intersection() {\n legs_mold();\n linear_extrude(height=15, scale=0) {\n circle(r=dia\/2*1.14);\n }\n }\n }\n difference() {\n union() {\n legs();\n trunk();\n }\n cylinder(d=1.5,h=trunk_height*4,center=true);\n }\n}\nstand(80);\ntranslate([85,0,0]) stand(80);\ntranslate([42,62,0]) stand(60);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/christmas_tree_stand.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"83561f610d2ff532dfd901a8135825428e6e8136","subject":"fixed issue by introducing tr_xy","message":"fixed issue by introducing tr_xy\n\nlearned about children(), will change style of programming\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library2d.scad","new_file":"library2d.scad","new_contents":"module ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\nmodule tr_xy(x,y) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\n","old_contents":"module ring(r=5,d=1) {\n\tdifference() {\n\t\tcircle(r=r);\n\t\tcircle(r=r-d);\n\t}\n}\nmodule square_hole(sx=10,sy=0,x=3,y=0,r=1) {\n\tdifference() {\n\t\tsquare([sx,setY(x=sx,y=sy)],center=true);\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*i]);\n\t}\n}\nfunction setY(x,y) = {\n\tif(y==0)\treturn x;\n\treturn y;\n}\nsquare_hole(sx=40,sy=10,x=10,r=2.5);*\/\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"653775d178e470e2ce1b3a718ef56c8f614320e7","subject":"main: Use linear_extrusion module for frame","message":"main: Use linear_extrusion module for frame\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \n\ninclude \ninclude \n\ninclude \ninclude \n\nxaxis_pos_z = 150*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n attach([[0,0,0],[0,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n rotate([0,90,0])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule extrusion(h, w, l) {\n rotate([90, 0, 90]) {\n translate([2.5, 2.5, 0]) cube([h - 5, w - 5, l]);\n translate([0, 0, 0.1]) cube([h, w, l - 0.2]);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([extrusion_size,extrusion_size,main_height], align=[0,i,1]);\n\n translate([0, 0, main_height]) \n cubea([main_upper_width,extrusion_size,extrusion_size], align=[0,0,1]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n cubea([main_width,extrusion_size,extrusion_size], align=[0,i,-1]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0]) \n rotate([0,0,90])\n cubea([main_depth,extrusion_size,extrusion_size], align=[0,i,-1]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3a872d2475426a030ee5acb4601ca542017cbfb2","subject":"draft","message":"draft\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"walbrzych_paper_holder_fix\/paper_hilder_fix.scad","new_file":"walbrzych_paper_holder_fix\/paper_hilder_fix.scad","new_contents":"h=19.5;\n\ncube([36, 3, h]);\ntranslate([0, 9, 0])\n cube([29, 3, h]);\ncube([3.5, 9, h]);","old_contents":"","returncode":1,"stderr":"error: pathspec 'walbrzych_paper_holder_fix\/paper_hilder_fix.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b591406cc2c03bce87af7fe89158b4cd2c27dbcb","subject":"Add openSCAD file for the linear camera","message":"Add openSCAD file for the linear camera\n","repos":"RainerWinkler\/Optical-Spectrograph-Beta,RainerWinkler\/Optical-Spectrograph-Beta,RainerWinkler\/Optical-Spectrograph-Beta","old_file":"Case\/LinearCamera1_V1.1.scad","new_file":"Case\/LinearCamera1_V1.1.scad","new_contents":"\n\/\/Korrekturfaktoren\n\/\/ Unterma\u00df Durchmesser kleine L\u00f6cher\num_small_hole = -0.4;\n\n\/\/ Correction for imperfect printing\n\/\/ the inner diameter is 49.5 instead of 50.0 after print with PLA_13, so add 0.5 mm\n\/\/ (10.01.2016 ad 0.6, because 49.9 was measured)\ndadd_inner_tube = 0.6;\n\ndbaseplate = 9.9;\nxwidth_base_plate = 90;\nzwidth_base_plate = 80;\nfaces_of_small_holes = 12;\n\/\/ The top holes lay 20.5 mm above zero\nztop_holes = 20.5;\n\/\/ The bottom holes lay 17.5 mm below zero\nzbottom_holes = -17.5;\n\/\/ The left holes lay 22.2 mm left of zero in X-Direction\nxleft_holes = -22.2;\n\/\/ The right holes lay 26.8 mm right of zero in X-Direction\nxright_holes = 26.8;\n\n\/\/ The dimensions of central hole\nztop_central_hole = 13;\nzbottom_central_hole = -15;\nxleft_central_hole = -30;\nxright_central_hole = 17;\n\n\/\/ Holes to mount all plates together\n\/\/ The top holes lay 20.5 mm above zero\nztop_holes_2 = ( zwidth_base_plate \/ 2 ) - 5;\n\/\/ The bottom holes lay 17.5 mm below zero\nzbottom_holes_2 = - ( zwidth_base_plate \/ 2 ) + 5;\n\/\/ The left holes lay 22.2 mm left of zero in X-Direction\nxleft_holes_2 = - ( xwidth_base_plate \/ 2) + 5;\n\/\/ The right holes lay 26.8 mm right of zero in X-Direction\nxright_holes_2 = ( xwidth_base_plate \/ 2) - 5;\n\n\/\/ ------------- Central_plate (To mount the sensor) ------------------\n\ndifference(){\n\/\/ Main Plate for sensor\ntranslate([-xwidth_base_plate\/2,0,-zwidth_base_plate\/2])\ncube([xwidth_base_plate,dbaseplate,zwidth_base_plate],center = false);\n\/\/ Holes to mount sensor\n\/\/ bottom left \ntranslate([xleft_holes,dbaseplate,zbottom_holes])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 3.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ bottom right \ntranslate([xright_holes,dbaseplate,zbottom_holes])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 3.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top left \ntranslate([xleft_holes,dbaseplate,ztop_holes])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 3.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top right \ntranslate([xright_holes,dbaseplate,ztop_holes])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 3.2 - um_small_hole, $fn = faces_of_small_holes );\n \n\/\/ Central hole in main plate for sensor for electronics\ntranslate([xleft_central_hole,0,zbottom_central_hole])\ncube([xright_central_hole-xleft_central_hole,dbaseplate,ztop_central_hole-zbottom_central_hole]);\n\n\/\/ Holes to fix plates\n\/\/ bottom left \ntranslate([xleft_holes_2,dbaseplate,zbottom_holes_2])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ bottom right \ntranslate([xright_holes_2,dbaseplate,zbottom_holes_2])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top left \ntranslate([xleft_holes_2,dbaseplate,ztop_holes_2])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top right \ntranslate([xright_holes_2,dbaseplate,ztop_holes_2])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes );\n\n\/\/ Lines for measurements\n\/\/ left \ntranslate([-xwidth_base_plate\/2,dbaseplate,0])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 1, $fn = faces_of_small_holes ); \n\/\/ right \ntranslate([xwidth_base_plate\/2,dbaseplate,0])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 1, $fn = faces_of_small_holes ); \n\/\/ top \ntranslate([0,dbaseplate,zwidth_base_plate\/2])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 1, $fn = faces_of_small_holes ); \n\/\/ bottom \ntranslate([0,dbaseplate,-zwidth_base_plate\/2])\nrotate([90,0,0])\ncylinder(h=dbaseplate, d = 1, $fn = faces_of_small_holes );\n};\n\n\n\/\/ ---------------------- Backplate -------------------------------\n\/\/ Distance while constructing\nyconstruct_backplate = 20;\n\/\/ Dimensions\ndbackplate = 12;\nydepth_screw_head = 4;\n\n\/\/ Hole for Cable\nztop_hole_for_cable = 5;\nzbottom_hole_for_cable = -9;\nxleft_hole_for_cable = 12;\nxright_hole_for_cable = xwidth_base_plate\/2;\nydeep_for_cable = 1.2;\n\/\/ Hole2 for Cable\nztop_hole2_for_cable = 5;\nzbottom_hole2_for_cable = -9;\nxleft_hole2_for_cable = xwidth_base_plate\/2-8;\nxright_hole2_for_cable = xwidth_base_plate\/2;\nydeep2_for_cable = dbackplate;\n\/\/ Depress Cable\nztop_depress_cable = 12;\nzbottom_depress_cable = -14;\nxleft_depress_cable = -3;\nxright_depress_cable = 11;\nyheight_depress_cable = 3;\n\/\/ Hole for Plug\nztop_hole_plug = 8;\nzbottom_hole_plug = -13;\nxleft_hole_plug = -28;\nxright_hole_plug = -13;\nydeep_plug = 9;\n\ntranslate([0,dbaseplate + yconstruct_backplate,0])\nunion(){\ndifference(){\n\/\/ Back Plate for sensor\ntranslate([-xwidth_base_plate\/2,0,-zwidth_base_plate\/2])\ncube([xwidth_base_plate,dbackplate,zwidth_base_plate],center = false);\n \n\/\/ Holes to fix plates\n\/\/ bottom left \ntranslate([xleft_holes_2,dbackplate,zbottom_holes_2])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ bottom right \ntranslate([xright_holes_2,dbackplate,zbottom_holes_2])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top left \ntranslate([xleft_holes_2,dbackplate,ztop_holes_2])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top right \ntranslate([xright_holes_2,dbackplate,ztop_holes_2])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n \n\/\/ Lines for measurements\n\/\/ left \ntranslate([-xwidth_base_plate\/2,dbackplate,0])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 1, $fn = faces_of_small_holes ); \n\/\/ right \ntranslate([xwidth_base_plate\/2,dbackplate,0])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 1, $fn = faces_of_small_holes ); \n\/\/ top \ntranslate([0,dbackplate,zwidth_base_plate\/2])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 1, $fn = faces_of_small_holes ); \n\/\/ bottom \ntranslate([0,dbackplate,-zwidth_base_plate\/2])\nrotate([90,0,0])\ncylinder(h=dbackplate, d = 1, $fn = faces_of_small_holes );\n \n\/\/ Holes for screw heads to mount sensor\n\/\/ bottom left \ntranslate([xleft_holes,ydepth_screw_head,zbottom_holes])\nrotate([90,0,0])\ncylinder(h=ydepth_screw_head, d = 8 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ bottom right \ntranslate([xright_holes,ydepth_screw_head,zbottom_holes])\nrotate([90,0,0])\ncylinder(h=ydepth_screw_head, d = 8 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top left \ntranslate([xleft_holes,ydepth_screw_head,ztop_holes])\nrotate([90,0,0])\ncylinder(h=ydepth_screw_head, d = 8 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top right \ntranslate([xright_holes,ydepth_screw_head,ztop_holes])\nrotate([90,0,0])\ncylinder(h=ydepth_screw_head, d = 8 - um_small_hole, $fn = faces_of_small_holes ); \n \n\/\/ Hole for Plug in backplate\ntranslate([xleft_hole_plug,0,zbottom_hole_plug])\ncube([xright_hole_plug-xleft_hole_plug,ydeep_plug,ztop_hole_plug-zbottom_hole_plug]);\n\/\/ Hole for Cable in backplate\ntranslate([xleft_hole_for_cable,0,zbottom_hole_for_cable])\ncube([xright_hole_for_cable-xleft_hole_for_cable,ydeep_for_cable,ztop_hole_for_cable-zbottom_hole_for_cable]);\n\/\/ Hole2 for Cable in backplate\ntranslate([xleft_hole2_for_cable,0,zbottom_hole2_for_cable])\ncube([xright_hole2_for_cable-xleft_hole2_for_cable,ydeep2_for_cable,ztop_hole2_for_cable-zbottom_hole2_for_cable]); \n};\n\/\/ Depress Cable\ntranslate([xleft_depress_cable,-yheight_depress_cable,zbottom_depress_cable])\ncube([xright_depress_cable-xleft_depress_cable,yheight_depress_cable,ztop_depress_cable-zbottom_depress_cable]);\n};\n\n\/\/ ------------------------ Front of camera ------------------------------\n\n\/\/ Distance while constructing\nyconstruct_front = 0;\n\/\/ Dimensions\ndfront_plate = 12;\n\n\/\/ Front Plate is wider\nfront_plate_wider = 20;\nxwidth_front_plate = xwidth_base_plate + front_plate_wider;\nzwidth_front_plate = zwidth_base_plate + front_plate_wider;\n\n\/\/ Empty Space in Middle\n\nztop_hole_front = zwidth_base_plate\/2 - 10;\nzbottom_hole_front = -zwidth_base_plate\/2 +10;\nxleft_hole_front = -xwidth_base_plate\/2 +10 ;\nxright_hole_front = xwidth_base_plate\/2 -10;\n\n\/\/ Shielding\nshield_height = 20;\n\ntranslate([0,- dfront_plate + yconstruct_front,0])\nunion(){\n\/\/ Cube at bottom so that camera does not drop\ntranslate([-5,-110,-50])\ncube([10,110,10]); \n\/\/ Shielding over sensor and backplate \ndifference(){ \n translate([-xwidth_front_plate\/2,dfront_plate,-zwidth_front_plate\/2])\ncube([xwidth_front_plate,shield_height,zwidth_front_plate],center = false); \n translate([-xwidth_base_plate\/2,dfront_plate,-zwidth_base_plate\/2])\ncube([xwidth_base_plate,shield_height,zwidth_base_plate],center = false); \n\n\/\/ Lines for measurements at shielding\n\/\/ left \ntranslate([-xwidth_front_plate\/2,shield_height+dfront_plate,0])\nrotate([90,0,0])\ncylinder(h=shield_height, d = 1, $fn = faces_of_small_holes ); \n\/\/ right \ntranslate([xwidth_front_plate\/2,shield_height+dfront_plate,0])\nrotate([90,0,0])\ncylinder(h=shield_height, d = 1, $fn = faces_of_small_holes ); \n\/\/ top \ntranslate([0,shield_height+dfront_plate,zwidth_front_plate\/2])\nrotate([90,0,0])\ncylinder(h=shield_height, d = 1, $fn = faces_of_small_holes ); \n\/\/ bottom \ntranslate([0,shield_height+dfront_plate,-zwidth_front_plate\/2])\nrotate([90,0,0])\ncylinder(h=shield_height, d = 1, $fn = faces_of_small_holes ); \n \n};\ndifference(){\n\/\/ Front lower plate\ntranslate([-xwidth_front_plate\/2,0,-zwidth_front_plate\/2])\ncube([xwidth_front_plate,dfront_plate,zwidth_front_plate],center = false);\n \n\/\/ Holes to fix plates\n\/\/ bottom left \ntranslate([xleft_holes_2,dfront_plate,zbottom_holes_2])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ bottom right \ntranslate([xright_holes_2,dfront_plate,zbottom_holes_2])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top left \ntranslate([xleft_holes_2,dfront_plate,ztop_holes_2])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n\/\/ top right \ntranslate([xright_holes_2,dfront_plate,ztop_holes_2])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 4.2 - um_small_hole, $fn = faces_of_small_holes ); \n \n\/\/ Lines for measurements\n\/\/ left \ntranslate([-xwidth_front_plate\/2,dfront_plate,0])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 1, $fn = faces_of_small_holes ); \n\/\/ right \ntranslate([xwidth_front_plate\/2,dfront_plate,0])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 1, $fn = faces_of_small_holes ); \n\/\/ top \ntranslate([0,dfront_plate,zwidth_front_plate\/2])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 1, $fn = faces_of_small_holes ); \n\/\/ bottom \ntranslate([0,dfront_plate,-zwidth_front_plate\/2])\nrotate([90,0,0])\ncylinder(h=dfront_plate, d = 1, $fn = faces_of_small_holes ); \n\n\/\/ Empty Space in Middle\n\ntranslate([xleft_hole_front,0,zbottom_hole_front])\ncube([xright_hole_front-xleft_hole_front,dfront_plate,ztop_hole_front-zbottom_hole_front]);\n\n\n\n};\n\/\/ Tube at the front\nht1 = 5;\nda1 = 99;\ndt1 = 15;\nht2 = 5;\nda2 = 95;\ndt2 = 15;\nht3 = 5;\nda3 = 90;\ndt3 = 15;\nht4 = 5;\nda4 = 85;\ndt4 = 15;\nht5 = 5;\nda5 = 80;\ndt5 = 15;\nht6 = 5;\nda6 = 75;\ndt6 = 15;\nht7 = 5;\nda7 = 70;\ndt7 = 15;\nht8 = 5;\nda8 = 65;\ndt8 = 15;\nfaces_of_tube = 80;\ntranslate([0,0,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht1, d = da1, $fn = faces_of_tube); \n cylinder(h=ht1, d = da1-dt1, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht2, d = da2, $fn = faces_of_tube); \n cylinder(h=ht2, d = da2-dt2, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1 -ht2,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht3, d = da3, $fn = faces_of_tube); \n cylinder(h=ht3, d = da3-dt3, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1 -ht2 -ht3,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht4, d = da4, $fn = faces_of_tube); \n cylinder(h=ht4, d = da4-dt4, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1 -ht2 -ht3 -ht4,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht5, d = da5, $fn = faces_of_tube); \n cylinder(h=ht5, d = da5-dt5, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1 -ht2 -ht3 -ht4 -ht5,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht6, d = da6, $fn = faces_of_tube); \n cylinder(h=ht6, d = da6-dt6, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1 -ht2 -ht3 -ht4 -ht5 -ht6,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht7, d = da7, $fn = faces_of_tube); \n cylinder(h=ht7, d = da7-dt7, $fn = faces_of_tube); \n};\n\ntranslate([0,-ht1 -ht2 -ht3 -ht4 -ht5 -ht6 -ht7,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=ht8, d = da8, $fn = faces_of_tube); \n cylinder(h=ht8, d = da8-dt8, $fn = faces_of_tube); \n};\n\ntranslate([0,-40,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=100, d = 60, $fn = faces_of_tube); \n cylinder(h=100, d = 50, $fn = faces_of_tube); \n};\n\n\n\n};\n\n\n\/\/ ------------------------ Lense holder ------------------------------\n\n\n\n\/\/ Distance while constructing\n\/\/ -50 ganz eingeschoben\n\/\/ -80 ca unendlich fokussiert\n\/\/ -120 ca Fokus 1 Meter eingestellt\nylense_holder = -120;\nxlense_holder = -100;\nylength_of_main_tube = 110;\ndmain_tube_outer = 70;\ndmain_tube_inner = 60 + dadd_inner_tube;\n\/\/ Do not adjust a radius used for outside with correction\n\/\/ value for inner tube:\ndmain_tube_inner_outside = 60;\n\n\/\/ Diameter for Lense\ndlense = 51.2;\n\n\/\/ Correct Positions of Mutter\ndMutter_lense = dlense -50 + dadd_inner_tube -0.7;\ndMutter_tube = dadd_inner_tube -0.2;\nfaces_of_tube_lense_holder = 80;\ntranslate([xlense_holder,ylense_holder,0])\ndifference(){\nunion(){\n \n\/\/ Make tube thicker for screw\ntranslate([26.9,-125,0])\nrotate([0,90,0])\ntranslate([0,0,4])\nlinear_extrude(height = 8, center = true)\ncircle(d=15,$fn=40);\n\n\/\/ Make tube thicker for screw\ntranslate([-26.9,-125,0])\nrotate([0,-90,0])\ntranslate([0,0,4])\nlinear_extrude(height = 8, center = true)\ncircle(d=15,$fn=40);\n \n\/\/ Make tube thicker for screw\ntranslate([26.9,-20,0])\nrotate([0,90,0])\ntranslate([0,0,9])\nlinear_extrude(height = 8, center = true)\ncircle(d=15,$fn=40);\n\n\/\/ Make tube thicker for screw\ntranslate([-26.9,-20,0])\nrotate([0,-90,0])\ntranslate([0,0,9])\nlinear_extrude(height = 8, center = true)\ncircle(d=15,$fn=40); \n \n \n\n \n\/\/ Main Tube \nrotate([90,0,0])\ndifference(){\n cylinder(h=ylength_of_main_tube, d = dmain_tube_outer, $fn = faces_of_tube_lense_holder); \n cylinder(h=ylength_of_main_tube, d = dmain_tube_inner, $fn = faces_of_tube_lense_holder); \n};\n\/\/ Base for Lense\ntranslate([0,-ylength_of_main_tube+10,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=10, d = dmain_tube_inner, $fn = faces_of_tube_lense_holder); \n cylinder(h=10, d = 45, $fn = faces_of_tube_lense_holder); \n};\n\/\/ Ring to guide lense and to mount further structures\ntranslate([0,-ylength_of_main_tube,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=40, d = dmain_tube_inner_outside, $fn = faces_of_tube_lense_holder); \n cylinder(h=40, d = dlense + dadd_inner_tube, $fn = faces_of_tube_lense_holder); \n};\n\/\/ Structure to mount further devices\n\n\/\/ Cube at bottom so that camera does not drop\ntranslate([-5,-120,-50])\ncube([10,45,10]); \n\/\/ Fix Cube to tube\ntranslate([-5,-120,-40])\ncube([10,10,11]); \ntranslate([-5,-85,-40])\ncube([10,10,8]); \n\n\/\/ Mutter positive\n\n\n\n\n};\n\n\/\/ Mutter negative\n\n\/\/ Place for \"Mutter\"\ntranslate([26.9 + dMutter_lense ,-125,0])\nrotate([0,90,0])\nunion(){\nlinear_extrude(height = 4.8, center = true)\ncircle(d=9.2,$fn=6);\ntranslate([0,0,8])\nlinear_extrude(height = 15, center = true)\ncircle(d=5.2,$fn=40);\n}; \n\n\/\/ Place for \"Mutter\"\ntranslate([-26.9 - dMutter_lense,-125,0])\nrotate([0,-90,0])\nunion(){\nlinear_extrude(height = 4.8, center = true)\ncircle(d=9.2,$fn=6);\ntranslate([0,0,8])\nlinear_extrude(height = 15, center = true)\ncircle(d=5.2,$fn=40);\n}; \n\n\/\/ 2. \n \n\/\/ Place for \"Mutter\"\ntranslate([31.9 + dMutter_tube,-20,0])\nrotate([0,90,0])\nunion(){\nlinear_extrude(height = 4.8, center = true)\ncircle(d=9.2,$fn=6);\ntranslate([0,0,8])\nlinear_extrude(height = 15, center = true)\ncircle(d=5.2,$fn=40);\n}; \n\n\/\/ Place for \"Mutter\"\ntranslate([-31.9 -dMutter_tube,-20,0])\nrotate([0,-90,0])\nunion(){\nlinear_extrude(height = 4.8, center = true)\ncircle(d=9.2,$fn=6);\ntranslate([0,0,8])\nlinear_extrude(height = 15, center = true)\ncircle(d=5.2,$fn=40);\n}; \n\n};\n\n\n\/\/ ------------------------ Ring to fix lense ------------------------------\nxfix_lense = -20;\ntranslate([xlense_holder+xfix_lense,ylense_holder,0])\nunion(){\n translate([0,-ylength_of_main_tube-10,0])\nrotate([90,0,0])\ndifference(){\n cylinder(h=10, d = dlense, $fn = faces_of_tube_lense_holder); \n cylinder(h=10, d = 45, $fn = faces_of_tube_lense_holder); \n}; \n};\n\n\/\/translate([0,-52,0])\n\/\/cube([100,1,100]);\n\n\/\/translate([0,-152,0])\n\/\/cube([100,1,100]);\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Case\/LinearCamera1_V1.1.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"95b85e4879a347ac8bebd9f5cdede841be1713bb","subject":"Updated milwaukee battery socket","message":"Updated milwaukee battery socket\n","repos":"ksuszka\/3d-projects","old_file":"powertools\/milwaukee_battery.scad","new_file":"powertools\/milwaukee_battery.scad","new_contents":"use ;\n\n\/\/ dimension\n\/\/ heights:\n\/\/ - base = 0mm\n\/\/ - slope highest point = 26.5mm\n\/\/ - slope mid point = 14mm\n\/\/ - hook lowest edge = 19mm\n\nmodule outer_horizontal_boundary(dim, x0, y0, x1, y1, y2) {\n module half() {\n BezLine([\n [0, 0],\n [dim*y0, dim*x0],\n [dim*y1, dim*x1],\n [dim*y2, dim],\n [0, dim],\n ], width = [0.1, 0.1], resolution = 6);\n }\n half();\n mirror([1,0,0]) half();\n}\n\n\/*\n#color(\"green\") difference() {\ntranslate([0,-19.5, 3]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.06, 0.72, 0.66, 0.41, 0.30);\n translate([0,0.5,0]) battery_tower2();\n}\n*\/\n\n\/*\n#color(\"green\") difference() {\n translate([0,-19.5, -55]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n translate([0,0.5,0]) battery_tower();\n}\/\/*\/\n\n\n\/\/translate([0,-15,-16]) hull() outer_horizontal_boundary(46.4, 0.9, 0.58, 0.37, 0.26);\nmodule outline(height=10, type=1) {\n translate([0,-20.5, -height\/2]) hull() linear_extrude(height=height) {\n if (type == 1) {\n outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n } else if (type == 2) {\n outer_horizontal_boundary(52, 0.04, 0.73, 0.81, 0.43, 0.2);\n } else if (type == 3) {\n outer_horizontal_boundary(52, 0.03, 0.73, 0.86, 0.44, 0.2);\n }\n }\n}\n\nmodule thin_wall() {\n type = 2;\n intersection() {\n\/\/* \n minkowski() {\n difference() {\n cube([100,100,100], true);\n outline(110,type);\n }\n sphere(r=1);\n }\n\/\/ *\/\n outline(110,type);\n }\n}\n\/\/translate([0,0,40])#outline(1,3);\nmodule hooks2() {\n module hook() {\n radius=40;\n intersection() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+1.5,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n };\n cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n }\n\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,13.5,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\nmodule hooks() {\n module hook() {\n radius=40;\n intersection() {\n union() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+2,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n translate([0,0,2]) rotate([-4,0,0]) translate([0,-1,-5]) cylinder(r=radius,h=20,$fn=120); \n };\n }\n rotate([0,0,-30])cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n }\n\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,13.5,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\n\/\/translate([20,-5,60]) cube([1,29,1],true);\n%translate([50,-20,26.5]) rotate([-19,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n%translate([50,22,0]) rotate([-65,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n\nmodule mold() {\n hull() \n {\n translate([0,13.13,11.91]) rotate([0,90,0]) cylinder(d=6,h=100,center=true,$fn=36);\n\/\/ translate([0,11,10.1]) rotate([0,90,0]) cylinder(d=10,h=100,center=true,$fn=36);\n translate([0,-20,26.5])rotate([-19,0,0])translate([0,0,-20])cube([100,2,40],true);\n translate([0,22,0])rotate([-65,0,0])translate([0,0,-1])cube([100,20,2],true);\n }\n}\n\/\/color(\"red\")mold();\nmodule handle() {\n hull() {\n translate([0,0,1]) outline(2,2);\n translate([0,0,29]) outline(22,3);\n }\n}\ndifference() {\n union() {\n\/\/ intersection() {\n\/\/ thin_wall(); \n\/\/ translate([0,0,15]) cube([1000,1000,30], true);\n\/\/ }\n color(\"blue\")difference() {\n\/\/ translate([0,0,26+5]) outline(16,2);\n handle();\n translate([0,0,-0.01]) battery_tower();\n }\n }\n mold();\n hooks();\n}\n\/\/battery_tower();\n\n\/\/translate([0,0,50]) hooks();\n\n\/\/translate([0,0,120])color(\"green\")cube([46,1,1],true);\n\/\/translate([0,-18, 50]) hull() outer_horizontal_boundary(50, 0.83, 0.62, 0.37, 0.26);\n\nmodule battery_tower() {\n clearance = 0.0;\n battery_r = 11 + clearance;\n battery_distance = 9.4;\n cell_h = 60;\n big_tower_h = cell_h + 10;\n battery_d = battery_r * 2;\n big_tower_w = battery_d * 1.1;\n triangle_h = battery_distance * sqrt(3);\n big_tower_offset = triangle_h - battery_r;\n \n module trunk(height) {\n hull() {\n translate([-battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([0, triangle_h, 0])\n cylinder(height, r=battery_r+0.0,$fn=60);\n }\n }\n \n trunk(cell_h);\n \n module edge(height) {\n hull() {\n translate([12.8,21.5])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([12.8,19.4])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([10,19.2])cylinder(d=4+ clearance*2,h=height, $fn=36);\n }\n }\n color(\"red\") edge(big_tower_h);\n color(\"red\") mirror([1,0,0]) edge(big_tower_h);\n intersection() {\n trunk(big_tower_h);\n translate([-big_tower_w \/ 2, big_tower_offset, 0])\n cube([big_tower_w, big_tower_w, big_tower_h]);\n }\n \n color(\"blue\") translate([6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n color(\"blue\") translate([-6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n}\n\n\n\n\n\n","old_contents":"use ;\n\n\/\/ dimension\n\/\/ heights:\n\/\/ - base = 0mm\n\/\/ - slope highest point = 26.5mm\n\/\/ - slope mid point = 14mm\n\/\/ - hook lowest edge = 19mm\n\nmodule outer_horizontal_boundary(dim, x0, y0, x1, y1, y2) {\n module half() {\n BezLine([\n [0, 0],\n [dim*y0, dim*x0],\n [dim*y1, dim*x1],\n [dim*y2, dim],\n [0, dim],\n ], width = [0.1, 0.1], resolution = 6);\n }\n half();\n mirror([1,0,0]) half();\n}\n\n\/*\n#color(\"green\") difference() {\ntranslate([0,-19.5, 3]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.06, 0.72, 0.66, 0.41, 0.30);\n translate([0,0.5,0]) battery_tower2();\n}\n*\/\n\n\/*\n#color(\"green\") difference() {\n translate([0,-19.5, -55]) hull() linear_extrude(height=10) outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n translate([0,0.5,0]) battery_tower();\n}\/\/*\/\n\n\n\/\/translate([0,-15,-16]) hull() outer_horizontal_boundary(46.4, 0.9, 0.58, 0.37, 0.26);\nmodule outline(height=10, type=1) {\n translate([0,-19.5, -height\/2]) hull() linear_extrude(height=height) {\n if (type == 1) {\n outer_horizontal_boundary(52, 0.04, 0.68, 0.66, 0.45, 0.30);\n } else if (type == 2) {\n outer_horizontal_boundary(52, 0.04, 0.73, 0.81, 0.43, 0.2);\n }\n }\n}\n\nmodule thin_wall() {\n type = 2;\n intersection() {\n\/\/* \n minkowski() {\n difference() {\n cube([100,100,100], true);\n outline(110,type);\n }\n sphere(r=1);\n }\n\/\/ *\/\n outline(110,type);\n }\n}\n\nmodule hook() {\n radius=40;\n intersection() {\n translate([0,radius,0]) {\n translate([0,0,19]) cylinder(r=radius+1.5,h=4,$fn=120);\n cylinder(r=radius,h=20,$fn=120); \n };\n cube([10,10,50],true);\n }\n intersection() {\n translate([0,radius,0]) {\n cylinder(r=radius-0.5,h=23,$fn=120); \n };\n translate([2,0,0]) cube([14,10,50],true);\n }\n}\nmodule hooks() {\n for(a=[0:1:1]) {\n mirror([a,0,0]) translate([17.5,14,0]) color(\"green\")rotate([0,0,112]) hook();\n }\n\n}\n\/\/translate([20,-5,60]) cube([1,29,1],true);\n%translate([50,-19.5,26.5]) rotate([-19,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n%translate([50,22.5,0]) rotate([-65,0,0]) translate([0,0,0.5])color(\"gray\") cube([1,100,1],true);\n\nmodule mold() {\n hull() \n {\n translate([0,13.63,11.91]) rotate([0,90,0]) cylinder(d=6,h=100,center=true,$fn=36);\n\/\/ translate([0,11,10.1]) rotate([0,90,0]) cylinder(d=10,h=100,center=true,$fn=36);\n translate([0,-19.5,26.5])rotate([-19,0,0])translate([0,0,-20])cube([100,2,40],true);\n translate([0,22.5,0])rotate([-65,0,0])translate([0,0,-1])cube([100,20,2],true);\n }\n}\n\/\/color(\"red\")mold();\ndifference() {\n union() {\n\/\/ intersection() {\n\/\/ thin_wall(); \n\/\/ translate([0,0,15]) cube([1000,1000,30], true);\n\/\/ }\n color(\"blue\")difference() {\n\/\/ translate([0,0,26+5]) outline(16,2);\n translate([0,0,20]) outline(40,2);\n translate([0,0.5,-0.01]) battery_tower();\n }\n }\n mold();\n hooks();\n}\n\/\/battery_tower();\n\n\n\n\/\/translate([0,0,120])color(\"green\")cube([46,1,1],true);\n\/\/translate([0,-18, 50]) hull() outer_horizontal_boundary(50, 0.83, 0.62, 0.37, 0.26);\n\nmodule battery_tower() {\n clearance = 0.0;\n battery_r = 11 + clearance;\n battery_distance = 9.4;\n cell_h = 60;\n big_tower_h = cell_h + 10;\n battery_d = battery_r * 2;\n big_tower_w = battery_d * 1.1;\n triangle_h = battery_distance * sqrt(3);\n big_tower_offset = triangle_h - battery_r;\n \n module trunk(height) {\n hull() {\n translate([-battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([battery_distance, 0, 0])\n cylinder(height, r=battery_r,$fn=60);\n translate([0, triangle_h, 0])\n cylinder(height, r=battery_r+0.0,$fn=60);\n }\n }\n \n trunk(cell_h);\n \n module edge(height) {\n hull() {\n translate([12.8,21.5])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([12.8,19.4])cylinder(d=1.5+ clearance*2,h=height, $fn=36);\n translate([10,19.2])cylinder(d=4+ clearance*2,h=height, $fn=36);\n }\n }\n color(\"red\") edge(big_tower_h);\n color(\"red\") mirror([1,0,0]) edge(big_tower_h);\n intersection() {\n trunk(big_tower_h);\n translate([-big_tower_w \/ 2, big_tower_offset, 0])\n cube([big_tower_w, big_tower_w, big_tower_h]);\n }\n \n color(\"blue\") translate([6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n color(\"blue\") translate([-6.5, 15, big_tower_h]) cube([0.2, 7, 10], center = true);\n}\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3c2e470881ea0fa5ed7dd2b5bbe961bfb945d02d","subject":"Quick Tidy","message":"Quick Tidy\n","repos":"TildenG\/FH_Tbot,Rodinga\/FH_Tbot,Rodinga\/FH_Tbot,ideaHex\/FH_Tbot,ideaHex\/FH_Tbot,ideaHex\/FH_Tbot,Rodinga\/FH_Tbot,TildenG\/FH_Tbot,ideaHex\/FH_Tbot,TildenG\/FH_Tbot,TildenG\/FH_Tbot,Rodinga\/FH_Tbot","old_file":"Fh@TBot.scad","new_file":"Fh@TBot.scad","new_contents":"\/* _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \r\n *\r\n * Mechanical design of FH@Tbot for Makerfair 2016\r\n * \r\n * Written by Damian Kleiss \r\n * OpenSCAD version 2016.04.06\r\n * _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\*\/\r\n \r\n \r\n \/\/ HUB MOTOR END \/\/\r\n shaftMountOuterWidth = 13.5;\r\n shaftDia = 3.6; \/\/ Diameter of the motor shaft\r\n shaftLength = 8.1; \/\/ Length of motor shaft\r\n shaftFlat = 2.9; \/\/ This is the flat part of the motor shaft\r\n shaftNutWidth = 5.9; \/\/ distance across flats of shaft nuts\r\n shaftnutHeight = 2.8; \/\/ height of shaft nut\r\n shaftBoltDia = 3.5; \/\/ Required hole for grub screw\r\n \r\n \/\/ HUBWHEEL END \/\/\r\n hexWidth = 12.1; \/\/ width between flats of the Wheel Hex\r\n hexLength = 6.2; \/\/ Length of the hex that goes into the wheel\r\n wheelNutWidth = 7.7; \/\/ Width between flats of the nut that the wheel is held on with\r\n wheelNutHeight = 3.9; \/\/ Height of the nut that holds the wheel on\r\n wheelBoltDia = 3.5; \/\/ Diameter of the hole \r\n \r\n \/\/ ORING \/\/\r\n oringInnerDia = 50;\r\n oringThickness = 5;\r\n \r\n \/\/ WHEEL \/\/\r\n wheelDia = oringInnerDia+oringThickness;\r\n wheelThickness = oringThickness;\r\n \r\n \/\/ GENERIC \/\/\r\n minWallThickness = 0.9; \/\/ This is only used between the shaft nut and shaft\r\n smidge = 0.01; \/\/ small value used to get manifold geometry\r\n \r\n $fn = 100; \/\/ number of facets that make up round things\r\n \r\n \r\n \/\/ ASSMBLY \/\/\r\n\r\ntranslate([0,0,wheelThickness\/2])\r\n{\r\n Wheel(hubShape = \"Round\", shaft = \"D\");\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n}\r\n\r\n module Wheel(hubShape = \"Round\", shaft = \"D\")\r\n {\r\n color(\"red\")\r\n difference()\r\n {\r\n union()\r\n {\r\n translate([0,0,shaftLength\/2+1]) \r\n Hub(shape = hubShape);\r\n Rim();\r\n }\r\n translate([0,0,shaftLength\/2+1])\r\n rotate([180,0,0])\r\n HubHoles(shape = shaft);\r\n }\r\n}\r\n\r\n\r\n \r\n \r\n module Rim()\r\n {\r\n difference()\r\n {\r\n cylinder(d=wheelDia,h=wheelThickness,center=true);\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n }\r\n }\r\n\r\n\r\nmodule Oring(id = 50, thickness = 5)\r\n{\r\n color(\"DimGray\")\r\n rotate_extrude(convexity = 10)\r\n {\r\n translate([(id+thickness)\/2,0,0])\r\n circle(r=thickness\/2);\r\n }\r\n}\r\n\r\nmodule Hub(shape = \"Hex\")\r\n{\r\n rotate([0,0,30])\r\n if(shape == \"Hex\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, $fn=6, center = true); \/\/ Motor End\r\n }\r\n else if(shape == \"Round\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, center = true); \/\/ Motor End\r\n }\r\n \r\n}\r\n\r\nmodule HubHoles(shape = \"D\")\r\n{\r\n \/\/ Shaft Mount Holes \r\n color(\"red\")\r\n \r\n if (shape == \"D\")\r\n {\r\n union()\r\n { \r\n rotate([0,90,0])\r\n {\r\n translate([0,0,shaftDia-shaftFlat+minWallThickness])\r\n hull() \/\/ Hull two nuts so we can slip a nut in after the hub has been printed\r\n {\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n translate([shaftLength\/2,0,0])\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n }\r\n translate([0,0,hexWidth\/2])\r\n cylinder(r = shaftBoltDia \/2, h=hexWidth,center = true,$fn=100); \/\/ Shaft Bolt hole\r\n }\r\n \r\n \r\n \/\/ Shaft Hole\r\n difference()\r\n {\r\n cylinder(r=shaftDia\/2,h=shaftLength+smidge,center = true, $fn = 100);\r\n translate([(shaftDia-(shaftDia-shaftFlat)),0,0])\r\n cube([shaftDia,shaftDia,shaftLength+(smidge*2)],center=true); \/\/ Shaft Flat\r\n }\r\n } \r\n }\r\n else if (shape == \"Hex\")\r\n { \r\n cylinder(r = shaftDia \/ 2 \/ cos(180\/6), h = shaftLength+smidge,center = true, $fn=6); \/\/ ShaftNut Hole\r\n translate([0,0,shaftLength\/2 + wheelThickness\/2])\r\n cylinder(r = wheelBoltDia, h = wheelThickness,center = true); \/\/ ShaftNut Hole\r\n }\r\n \r\n}\r\n\r\n","old_contents":"\/* _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \r\n *\r\n * Hub to mount a 12mm hex RC car wheel to a Micro Metal Gear Motor\r\n * you will need to pause the print to place the M4 nut inside\r\n * the height will be shown in the console\r\n * \r\n * \t visit\r\n * \t\twww.ideahex.com\r\n * \r\n * Written by Damian Kleiss \r\n * _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\*\/\r\n \r\n \r\n \/\/ HUB MOTOR END \/\/\r\n shaftMountOuterWidth = 13.5;\r\n shaftDia = 3.6; \/\/ Diameter of the motor shaft\r\n shaftLength = 8.1; \/\/ Length of motor shaft\r\n shaftFlat = 2.9; \/\/ This is the flat part of the motor shaft\r\n shaftNutWidth = 5.9; \/\/ distance across flats of shaft nuts\r\n shaftnutHeight = 2.8; \/\/ height of shaft nut\r\n shaftBoltDia = 3.5; \/\/ Required hole for grub screw\r\n \r\n \/\/ HUBWHEEL END \/\/\r\n hexWidth = 12.1; \/\/ width between flats of the Wheel Hex\r\n hexLength = 6.2; \/\/ Length of the hex that goes into the wheel\r\n wheelNutWidth = 7.7; \/\/ Width between flats of the nut that the wheel is held on with\r\n wheelNutHeight = 3.9; \/\/ Height of the nut that holds the wheel on\r\n wheelBoltDia = 3.5; \/\/ Diameter of the hole \r\n \r\n \/\/ ORING \/\/\r\n oringInnerDia = 50;\r\n oringThickness = 5;\r\n \r\n \/\/ WHEEL \/\/\r\n wheelDia = oringInnerDia+oringThickness;\r\n wheelThickness = oringThickness;\r\n \r\n \/\/ GENERIC \/\/\r\n minWallThickness = 0.9; \/\/ This is only used between the shaft nut and shaft\r\n smidge = 0.01; \/\/ small value used to get manifold geometry\r\n \r\n $fn = 100; \/\/ number of facets that make up round things\r\n \r\n \r\n \/\/ ASSMBLY \/\/\r\n\r\ntranslate([0,0,wheelThickness\/2])\r\n{\r\n Wheel(hubShape = \"Round\", shaft = \"D\");\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n}\r\n\r\n\/\/color(\"blue\")\r\n\/\/ rotate([180,0,0])\r\n\/\/HubHoles(shape = \"Hex\");\r\n\/\/color(\"red\")\r\n\/\/\r\n\/\/Hub(shape = \"Round\");\r\n \r\n module Wheel(hubShape = \"Round\", shaft = \"D\")\r\n {\r\n color(\"red\")\r\n difference()\r\n {\r\n union()\r\n {\r\n translate([0,0,shaftLength\/2+1]) \r\n Hub(shape = hubShape);\r\n Rim();\r\n }\r\n translate([0,0,shaftLength\/2+1])\r\n rotate([180,0,0])\r\n HubHoles(shape = shaft);\r\n }\r\n}\r\n\r\n\r\n \r\n \r\n module Rim()\r\n {\r\n difference()\r\n {\r\n cylinder(d=wheelDia,h=wheelThickness,center=true);\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n }\r\n }\r\n\r\n\r\nmodule Oring(id = 50, thickness = 5)\r\n{\r\n color(\"DimGray\")\r\n rotate_extrude(convexity = 10)\r\n {\r\n translate([(id+thickness)\/2,0,0])\r\n circle(r=thickness\/2);\r\n }\r\n}\r\n\r\nmodule Hub(shape = \"Hex\")\r\n{\r\n rotate([0,0,30])\r\n if(shape == \"Hex\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, $fn=6, center = true); \/\/ Motor End\r\n }\r\n else if(shape == \"Round\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, center = true); \/\/ Motor End\r\n }\r\n \r\n}\r\n\r\nmodule HubHoles(shape = \"D\")\r\n{\r\n \/\/ Shaft Mount Holes \r\n color(\"red\")\r\n \r\n if (shape == \"D\")\r\n {\r\n union()\r\n { \r\n rotate([0,90,0])\r\n {\r\n translate([0,0,shaftDia-shaftFlat+minWallThickness])\r\n hull() \/\/ Hull two nuts so we can slip a nut in after the hub has been printed\r\n {\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n translate([shaftLength\/2,0,0])\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n }\r\n translate([0,0,hexWidth\/2])\r\n cylinder(r = shaftBoltDia \/2, h=hexWidth,center = true,$fn=100); \/\/ Shaft Bolt hole\r\n }\r\n \r\n \r\n \/\/ Shaft Hole\r\n difference()\r\n {\r\n cylinder(r=shaftDia\/2,h=shaftLength+smidge,center = true, $fn = 100);\r\n translate([(shaftDia-(shaftDia-shaftFlat)),0,0])\r\n cube([shaftDia,shaftDia,shaftLength+(smidge*2)],center=true); \/\/ Shaft Flat\r\n }\r\n } \r\n }\r\n else if (shape == \"Hex\")\r\n { \r\n cylinder(r = shaftDia \/ 2 \/ cos(180\/6), h = shaftLength+smidge,center = true, $fn=6); \/\/ ShaftNut Hole\r\n translate([0,0,shaftLength\/2 + wheelThickness\/2])\r\n cylinder(r = wheelBoltDia, h = wheelThickness,center = true); \/\/ ShaftNut Hole\r\n }\r\n \r\n}\r\n\r\n\r\n \r\n \r\n\/\/ echo(\"Pause at Z height of \",shaftLength+wheelNutHeight, \" mm\");\r\n \r\n\r\n\/*\r\n difference() \/\/ Uncomment for cross section view\r\n {\r\n union()\r\n { \r\n \r\n \/\/ WHEEL END \/\/\r\n translate([0,0,shaftLength])\r\n translate([0,0,hexLength\/2])\r\n rotate([0,0,30]) \/\/ Rotate so it lines up with shaft end\r\n difference()\r\n { \r\n cylinder(r = hexWidth \/ 2 \/ cos(180\/6), h = hexLength, $fn=6, center = true); \/\/ Wheel Hex End\r\n color(\"red\")\r\n union()\r\n {\r\n translate([0,0,-(hexLength+smidge)\/2]) \/\/ Move nut hole to end of Hex\r\n cylinder(r = wheelNutWidth \/ 2 \/ cos(180\/6), h = wheelNutHeight, $fn=6 ); \/\/ Wheel nut hole\r\n \r\n cylinder(r=wheelBoltDia\/2,h=hexLength+smidge,center=true,$fn=100); \/\/ wheel bolt hole\r\n }\r\n }\r\n \r\n \/\/ MOTOR END \/\/\r\n translate([0,0,shaftLength\/2])\r\n difference()\r\n {\r\n rotate([0,0,30])\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, $fn=6, center = true); \/\/ Motor End\r\n \r\n \/\/ Shaft Mount Holes \r\n color(\"red\")\r\n union()\r\n { \r\n rotate([0,90,0])\r\n {\r\n translate([0,0,shaftDia-shaftFlat+minWallThickness])\r\n hull() \/\/ Hull two nuts so we can slip a nut in after the hub has been printed\r\n {\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n translate([shaftLength\/2,0,0])\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n }\r\n translate([0,0,hexWidth\/2])\r\n cylinder(r = shaftBoltDia \/2, h=hexWidth,center = true,$fn=100); \/\/ Shaft Bolt hole\r\n }\r\n \r\n \r\n \/\/ Shaft Hole\r\n difference()\r\n {\r\n cylinder(r=shaftDia\/2,h=shaftLength+smidge,center = true, $fn = 100);\r\n translate([(shaftDia-(shaftDia-shaftFlat)),0,0])\r\n cube([shaftDia,shaftDia,shaftLength+(smidge*2)],center=true); \/\/ Shaft Flat\r\n }\r\n }\r\n }\r\n }\r\n translate([-shaftMountOuterWidth,0,-smidge\/2])\r\n cube([shaftMountOuterWidth*2,shaftMountOuterWidth*2,shaftLength+hexLength+smidge],center=false);\r\n}\r\n*\/\r\n ","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"65e287eb8508604a7c482e2d43bdbfde97debd9a","subject":"x\/carriage: use tx\/ty\/tz","message":"x\/carriage: use tx\/ty\/tz\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2d1421237c2e0213b5d30d60cd5f34b2225450ce","subject":"x\/carriage\/extruder\/b: fix hotend mount","message":"x\/carriage\/extruder\/b: fix hotend mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole to see bearing\n t(guidler_drivegear_offset)\n tx(extruder_drivegear_bearing_d\/2)\n rcubea([guidler_mount_off.x+guidler_mount_d\/2+.1*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d\/2+2*mm], align=X);\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1be664fc9449d27b55237170082f21aea17f2769","subject":"Vent adaptor fixes","message":"Vent adaptor fixes\n","repos":"sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning","old_file":"3d-models\/damper-mount\/vent-5v-stepper-adaptor.scad","new_file":"3d-models\/damper-mount\/vent-5v-stepper-adaptor.scad","new_contents":"wall_thickness=2;\n\/\/ Piece that will be rotated\ndamper_arm_diameter=9;\ndamper_arm_cut_width=5.1;\ndamper_arm_depth=12;\n\/\/ stepper mount\nstepper_shaft_diameter=5.8;\nstepper_shaft_cut_width=3.5;\nstepper_shaft_depth=7;\n\/\/ Marker for closed position\nmarker_size=2;\nmarker_distance=9;\nmarker_height=5;\n\/\/ Connecting the two\nmount_length=1.2*(damper_arm_depth+stepper_shaft_depth);\nmount_diameter=max(damper_arm_diameter,stepper_shaft_diameter)+wall_thickness*2;\n\/\/ Pin offset degrees to achieve fully closed vent on button press\npin_degrees_offset=0;\n\n\/* \n * motor-to-damper adaptor\n**\/\n\/\/translate([0, mount_diameter, -mount_length]) motor_to_damper_adaptor();\n\nmodule motor_to_damper_adaptor() {\n rotate([0,0,pin_degrees_offset]) button_pin();\n difference() {\n \/\/ main body\n cylinder(mount_length, mount_diameter\/2, mount_diameter\/2);\n \/\/ Stepper cutout\n translate([0,0,stepper_shaft_depth\/2]) mount_cutout(stepper_shaft_diameter\/2, stepper_shaft_cut_width, stepper_shaft_depth);\n \/\/ Damper cutout\n translate([0,0,mount_length-damper_arm_depth\/2]) mount_cutout(damper_arm_diameter\/2, damper_arm_cut_width, damper_arm_depth);\n }\n \n}\n\nmodule button_pin() {\n translate([mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n \/\/translate([-mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n}\n\n\/\/ Motor mount\nvent_type=\"square\"; \/\/ round or square\nvent_diameter = 6*25.4; \/\/ 6\"\nshaft_offset=8;\nmotor_ears_distance=35;\nmotot_ears_hole_diameter=3.5;\nmotor_ears_screw_length=15;\nvent_mount_distance=55;\nvent_mount_hole_diameter=6;\nmotor_to_vent_distance=mount_length+4-wall_thickness*1.5; \/\/ 4mm distance between connector and motor body\nvent_ears_total_length=vent_mount_distance+vent_mount_hole_diameter+wall_thickness*2;\nvent_ears_total_width=mount_diameter+wall_thickness*4;\nmotor_screw_cube_side=motot_ears_hole_diameter+wall_thickness*2;\n\/*\n * mount bracket itself\n**\/\nrotate([90,180,0]) motor_to_vent_mount();\n\n\/\/ endstop sensor\nendstop_screw_diameter=1.8;\nendstop_screw1_distance=17;\nendstop_screw1_offset=-1;\nendstop_screw2_distance=6;\nendstop_screw2_offset=20.5;\n\n\/\/ Control board\nboard_width=23.5;\nboard_length=37.5;\nboard_latch_height=3.5;\nholder_offset=3;\n\n\/\/ Not a good idea after all\n\/\/translate([motor_ears_distance\/2+motor_screw_cube_side\/2,shaft_offset+motor_screw_cube_side\/2,wall_thickness]) rotate([90,90,0]) controller_mount();\n\nmodule controller_mount() {\n difference(){\n cube([board_width+wall_thickness*2, board_length+wall_thickness*2, board_latch_height+wall_thickness]);\n translate([wall_thickness, wall_thickness, wall_thickness]) cube([board_width, board_length, board_latch_height]);\n \/\/ Cutout for holder to be more flexible\n translate([holder_offset,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([holder_offset+wall_thickness*2,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([board_width-holder_offset+wall_thickness,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([board_width-holder_offset-wall_thickness,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n }\n \/\/ board holder\n \/\/translate([wall_thickness+holder_offset,wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,270]) board_holder();\n \/\/translate([board_width-holder_offset,wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,270]) board_holder();\n \/\/translate([2*wall_thickness+holder_offset,board_length+wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,90]) board_holder();\n \/\/translate([wall_thickness+board_width-holder_offset,board_length+wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,90]) board_holder();\n}\n\nmodule board_holder() {\n union() {\n cube(wall_thickness, wall_thickness, wall_thickness);\n translate([0,wall_thickness, wall_thickness\/2])rotate([90,0,0]) cylinder(d=wall_thickness, h=wall_thickness, $fn=20);\n }\n}\n\n\nmodule motor_to_vent_mount() {\n union() {\n \/\/ Vent ears\n vent_mount_plate();\n \/\/ motor mount\n translate([motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n translate([-motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n }\n}\n\nmodule damper_mount_cutout() {\n intersection() {\n cylinder(damper_arm_depth, damper_arm_diameter, damper_arm_diameter, center=true, $fn=40);\n cube([damper_arm_diameter*2, damper_arm_cut_width, damper_arm_depth], center=true);\n }\n}\n\nmodule mount_cutout(radius, width, depth) {\n intersection() {\n cylinder(depth, radius, radius, center=true, $fn=40);\n cube([radius*2, width, depth], center=true);\n }\n}\n\nmodule vent(length) {\n if (vent_type==\"round\") {\n cylinder(length, vent_diameter\/2, vent_diameter\/2, $fn=100);\n } else if (vent_type==\"square\") {\n } else {\n \/\/ How do you make it visible?\n echo(\"Unknown vent type\");\n }\n}\n\nmodule vent_mount_plate() {\n endstop_sensor_space=max(endstop_screw1_distance,endstop_screw2_distance)+endstop_screw_diameter\/2+wall_thickness-(vent_ears_total_width\/2-mount_diameter\/2);\n \/\/ ^ distance to furthest hole ^ mounting holes w\/ walls ^ distance from original edge to shaft\n plate_total_width=vent_ears_total_width+motor_screw_cube_side\/2+shaft_offset-vent_ears_total_width\/2+mount_diameter\/2;\n \/\/ ^ base width ^ extend for motor mount ^ accommodate endstop sensor\n translate([-vent_ears_total_length\/2,0,0]) rotate([0,90,0]) translate([-wall_thickness*1.5,0,0]) intersection() {\n difference() {\n union() {\n \/\/ General mount plate, then posts for endstop\n translate([-wall_thickness*1.5, -vent_ears_total_width\/2-mount_diameter\/2, 0]) cube([wall_thickness*3, plate_total_width, vent_ears_total_length]);\n \/\/ distance calculation for endstops\n height1 = endstop_screw1_distance;\n width=endstop_screw_diameter+wall_thickness;\n translate([-wall_thickness*1.5,-mount_diameter\/2-height1-endstop_screw_diameter*1.5,endstop_screw1_offset+vent_ears_total_length\/2-width\/2]) \n cube([wall_thickness*3,height1,width]);\n height2 = endstop_screw2_distance;\n translate([-wall_thickness*1.5,-mount_diameter\/2-height2-endstop_screw_diameter*1.5,endstop_screw2_offset+vent_ears_total_length\/2-width\/2]) \n cube([wall_thickness*3,height2,width]);\n }\n translate([-vent_diameter\/2, 0, 0]) vent(vent_ears_total_length);\n \/\/ Mount holes cutout\n translate([-wall_thickness*1.5,0,vent_mount_hole_diameter\/2+wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n translate([-wall_thickness*1.5,0,vent_ears_total_length-vent_mount_hole_diameter\/2-wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n \/\/ shaft cutout\n #translate([-wall_thickness*1.8,0,vent_ears_total_length\/2]) rotate([0,90,0]) shaft_cutout();\n \/\/ endstop sensor mount\n #translate([-5,-endstop_screw1_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw1_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n #translate([-5,-endstop_screw2_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw2_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n }\n }\n}\n\nmodule shaft_cutout() {\n hull() {\n cylinder(wall_thickness*4, mount_diameter\/2+wall_thickness, mount_diameter\/2+wall_thickness);\n \/\/ To make it easier to 3d print (less drastic overhang)\n translate([0,-mount_diameter-wall_thickness,0]) cylinder(d=1, h=wall_thickness*4);\n }\n}\n\nmodule motor_screw_connector() {\n difference() {\n translate([-motor_screw_cube_side\/2, -motor_screw_cube_side\/2, 0]) cube([motor_screw_cube_side, motor_screw_cube_side, motor_to_vent_distance]);\n cylinder(motor_ears_screw_length, motot_ears_hole_diameter\/2, motot_ears_hole_diameter\/2, $fn=20);\n }\n\n}","old_contents":"wall_thickness=2;\n\/\/ Piece that will be rotated\ndamper_arm_diameter=9;\ndamper_arm_cut_width=5.1;\ndamper_arm_depth=12;\n\/\/ stepper mount\nstepper_shaft_diameter=5.8;\nstepper_shaft_cut_width=3.5;\nstepper_shaft_depth=7;\n\/\/ Marker for closed position\nmarker_size=2;\nmarker_distance=9;\nmarker_height=5;\n\/\/ Connecting the two\nmount_length=1.2*(damper_arm_depth+stepper_shaft_depth);\nmount_diameter=max(damper_arm_diameter,stepper_shaft_diameter)+wall_thickness*2;\n\/\/ Pin offset degrees to achieve fully closed vent on button press\npin_degrees_offset=0;\n\n\/* \n * motor-to-damper adaptor\n**\/\n\/\/translate([0, mount_diameter, -mount_length]) motor_to_damper_adaptor();\n\nmodule motor_to_damper_adaptor() {\n rotate([0,0,pin_degrees_offset]) button_pin();\n difference() {\n \/\/ main body\n cylinder(mount_length, mount_diameter\/2, mount_diameter\/2);\n \/\/ Stepper cutout\n translate([0,0,stepper_shaft_depth\/2]) mount_cutout(stepper_shaft_diameter\/2, stepper_shaft_cut_width, stepper_shaft_depth);\n \/\/ Damper cutout\n translate([0,0,mount_length-damper_arm_depth\/2]) mount_cutout(damper_arm_diameter\/2, damper_arm_cut_width, damper_arm_depth);\n }\n \n}\n\nmodule button_pin() {\n translate([mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n translate([-mount_diameter\/2,0,mount_length-marker_distance]) scale([2*marker_size\/marker_height, 0.6, 1]) sphere(d=marker_height, $fn=50);\n}\n\n\/\/ Motor mount\nvent_type=\"squares\"; \/\/ round or square\nvent_diameter = 6*25.4; \/\/ 6\"\nshaft_offset=8;\nmotor_ears_distance=35;\nmotot_ears_hole_diameter=3.5;\nmotor_ears_screw_length=15;\nvent_mount_distance=55;\nvent_mount_hole_diameter=6;\nmotor_to_vent_distance=mount_length+4-wall_thickness*1.5; \/\/ 4mm distance between connector and motor body\nvent_ears_total_length=vent_mount_distance+vent_mount_hole_diameter+wall_thickness*2;\nvent_ears_total_width=mount_diameter+wall_thickness*4;\nmotor_screw_cube_side=motot_ears_hole_diameter+wall_thickness*2;\n\/*\n * mount bracket itself\n**\/\nrotate([90,0,0]) motor_to_vent_mount();\n\n\/\/ endstop sensor\nendstop_screw_diameter=1.8;\nendstop_screw1_distance=16;\nendstop_screw1_offset=0;\nendstop_screw2_distance=5;\nendstop_screw2_offset=21.5;\n\n\/\/ Control board\nboard_width=23.5;\nboard_length=37.5;\nboard_latch_height=3.5;\nholder_offset=3;\n\n\/\/ Not a good idea after all\n\/\/translate([motor_ears_distance\/2+motor_screw_cube_side\/2,shaft_offset+motor_screw_cube_side\/2,wall_thickness]) rotate([90,90,0]) controller_mount();\n\nmodule controller_mount() {\n difference(){\n cube([board_width+wall_thickness*2, board_length+wall_thickness*2, board_latch_height+wall_thickness]);\n translate([wall_thickness, wall_thickness, wall_thickness]) cube([board_width, board_length, board_latch_height]);\n \/\/ Cutout for holder to be more flexible\n translate([holder_offset,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([holder_offset+wall_thickness*2,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([board_width-holder_offset+wall_thickness,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n translate([board_width-holder_offset-wall_thickness,0,wall_thickness]) cube([wall_thickness,board_length+wall_thickness*2, board_latch_height]);\n }\n \/\/ board holder\n \/\/translate([wall_thickness+holder_offset,wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,270]) board_holder();\n \/\/translate([board_width-holder_offset,wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,270]) board_holder();\n \/\/translate([2*wall_thickness+holder_offset,board_length+wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,90]) board_holder();\n \/\/translate([wall_thickness+board_width-holder_offset,board_length+wall_thickness,board_latch_height+wall_thickness]) rotate([0,0,90]) board_holder();\n}\n\nmodule board_holder() {\n union() {\n cube(wall_thickness, wall_thickness, wall_thickness);\n translate([0,wall_thickness, wall_thickness\/2])rotate([90,0,0]) cylinder(d=wall_thickness, h=wall_thickness, $fn=20);\n }\n}\n\n\nmodule motor_to_vent_mount() {\n union() {\n \/\/ Vent ears\n vent_mount_plate();\n \/\/ motor mount\n translate([motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n translate([-motor_ears_distance\/2,shaft_offset,-motor_to_vent_distance]) motor_screw_connector();\n }\n}\n\nmodule damper_mount_cutout() {\n intersection() {\n cylinder(damper_arm_depth, damper_arm_diameter, damper_arm_diameter, center=true, $fn=40);\n cube([damper_arm_diameter*2, damper_arm_cut_width, damper_arm_depth], center=true);\n }\n}\n\nmodule mount_cutout(radius, width, depth) {\n intersection() {\n cylinder(depth, radius, radius, center=true, $fn=40);\n cube([radius*2, width, depth], center=true);\n }\n}\n\nmodule vent(length) {\n if (vent_type==\"round\") {\n cylinder(length, vent_diameter\/2, vent_diameter\/2, $fn=100);\n } else if (vent_type==\"square\") {\n } else {\n \/\/ How do you make it visible?\n echo(\"Unknown vent type\");\n }\n}\n\nmodule vent_mount_plate() {\n endstop_sensor_space=max(endstop_screw1_distance,endstop_screw2_distance)+endstop_screw_diameter\/2+wall_thickness-(vent_ears_total_width\/2-mount_diameter\/2);\n \/\/ ^ distance to furthest hole ^ mounting holes w\/ walls ^ distance from original edge to shaft\n plate_total_width=vent_ears_total_width+motor_screw_cube_side\/2+shaft_offset-vent_ears_total_width\/2+(endstop_sensor_space) ;\n \/\/ ^ base width ^ extend for motor mount ^ accommodate endstop sensor\n translate([-vent_ears_total_length\/2,0,0]) rotate([0,90,0]) translate([-wall_thickness*1.5,0,0]) intersection() {\n difference() {\n translate([-wall_thickness*1.5, -vent_ears_total_width\/2-endstop_sensor_space, 0]) cube([wall_thickness*3, plate_total_width, vent_ears_total_length]);\n translate([-vent_diameter\/2, 0, 0]) vent(vent_ears_total_length);\n \/\/ Mount holes cutout\n translate([-wall_thickness*1.5,0,vent_mount_hole_diameter\/2+wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n translate([-wall_thickness*1.5,0,vent_ears_total_length-vent_mount_hole_diameter\/2-wall_thickness]) rotate([0,90,0]) cylinder(wall_thickness*3, vent_mount_hole_diameter\/2, vent_mount_hole_diameter\/2, $fn=20);\n \/\/ shaft cutout\n #translate([-wall_thickness*1.8,0,vent_ears_total_length\/2]) rotate([0,90,0]) shaft_cutout();\n \/\/ endstop sensor mount\n #translate([-5,-endstop_screw1_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw1_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n #translate([-5,-endstop_screw2_distance-mount_diameter\/2,vent_ears_total_length\/2+endstop_screw2_offset]) rotate([0,90,0]) cylinder(10, d=endstop_screw_diameter, $fn=20);\n }\n }\n}\n\nmodule shaft_cutout() {\n hull() {\n cylinder(wall_thickness*4, mount_diameter\/2+wall_thickness, mount_diameter\/2+wall_thickness);\n \/\/ To make it easier to 3d print (less drastic overhang)\n translate([0,-mount_diameter-wall_thickness,0]) cylinder(d=1, h=wall_thickness*4);\n }\n}\n\nmodule motor_screw_connector() {\n difference() {\n translate([-motor_screw_cube_side\/2, -motor_screw_cube_side\/2, 0]) cube([motor_screw_cube_side, motor_screw_cube_side, motor_to_vent_distance]);\n cylinder(motor_ears_screw_length, motot_ears_hole_diameter\/2, motot_ears_hole_diameter\/2, $fn=20);\n }\n\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0ced561f2318605764983cbf6bae7ff8a6ec4903","subject":"wanhao-i3-fan-spacer: Work in progress for angled holes.","message":"wanhao-i3-fan-spacer: Work in progress for angled holes.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-fan-spacer\/spacer1.scad","new_file":"wanhao-i3-fan-spacer\/spacer1.scad","new_contents":"\/* This is a bit of a hack since angled holes are required. *\/\ngSpacerThick = 9;\ngSpacerPlusHeatsinkThick = 11;\ngFanThick = 10; \/\/ hole right in the middle?\ngMotorHoleSpacing = 31;\ngFanHoleSpacing = 32;\ngGrillThick = 3;\n\n\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=gSpacerThick) {\n linear_extrude(height=thick)\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) circle(r=r);\n}\n\nmodule SpacerHole(thick=gSpacerThick) {\n \/\/ TODO\n \/\/translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\n\/* For reuse building the two parts to line up *\/\nmodule LowerHull(w,r,thick,d=0) {\n linear_extrude(height=thick) hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) circle(r=r);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) circle(r=r);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n translate([0,0,-1]) linear_extrude(height=thick+2)\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y]) circle(r=r);\n }\n \/\/ this is rotated, so can't linear_extrude easily\n hull() {\n for(y=[-r-1,-10])\n translate([0,y,thick])\n rotate([0,90,0]) cylinder(r=2,h=100,center=true);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.7,h=100);\n }\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=gGrillThick) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\ngOffset = 0.5;\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01])\n ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n translate([0,gOffset,0]) FanGrill(r=16,height=thick-1);\n \/\/ TOOD angle this\n \/*for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n *\/\n }\n \/\/ Top part\n difference() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\n\/\/translate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\ntranslate([0,-40,0]) translate([0,20,-12])\ndifference() {\n union() {\n translate([0,-20,12]) SpacerPair();\n \/\/FanMount($fn=64);\n }\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n #translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\ndifference() {\n FanMount($fn=64);\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n #translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","old_contents":"\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=9) {\n difference() {\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) cylinder(r=r,h=thick);\n }\n}\n\nmodule SpacerHole(thick=9) {\n translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\nmodule LowerHull(w,r,thick,d=0) {\n hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) cylinder(r=r,h=thick);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) cylinder(r=r,h=thick);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y,-1]) cylinder(r=r,h=thick+2);\n }\n hull() {\n for(y=[-r-1,-10])\n translate([0,y,thick])\n rotate([0,90,0]) cylinder(r=2,h=100,center=true);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.6,h=100);\n }\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=3) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01]) ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n FanGrill(r=16,height=thick-1);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n }\n \/\/ Top part\n difference() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\ntranslate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\/\/translate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"bd7aa5b8eba5265c75454ac1dbc7a9b1621497ca","subject":"xaxis\/carriage: hull extruder mount cylinders into body","message":"xaxis\/carriage: hull extruder mount cylinders into body\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 13*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef, quad=true)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 13*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef, quad=true)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"33c0a65cc13feb141aa3aa734588285c7fc78456","subject":"dummy snake module","message":"dummy snake module\n","repos":"snhack\/ssnake,snhack\/ssnake,snhack\/ssnake,snhack\/ssnake","old_file":"hardware\/sandbox\/seg.scad","new_file":"hardware\/sandbox\/seg.scad","new_contents":"include <..\/config\/config.scad>\n\n\/\/ sketch of a segment\n\nmodule segment() {\n \/\/ servo driver board\n color(\"white\")\n translate([-26\/2,40 - 63\/2,20])\n cube([26, 63, 26]);\n\n \/\/ joint servo\n attach([[-8,0,10], [1,0,0], -90,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,90), ServoHorn_Con_Def) ServoHorn();\n }\n\n \/\/ wheel\n translate([0, 40, 16\/2])\n rotate([0,90,0])\n cylinder(r=16\/2, h=4, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,0,25])\n scale([1,1,0.8])\n rotate([-90,25,0])\n tube(or=30, ir = 28, h=80, $fn=8, center=false);\n\n \/\/ hinge points\n color(\"white\")\n translate([0,-20,15])\n cylinder(r=5, h=20);\n\n color(\"white\")\n translate([0,100,15])\n cylinder(r=5, h=20);\n}\n\nmodule segment2() {\n \/\/ servo driver board\n color(\"white\")\n translate([0, 30 - 63\/2, 5])\n cube([15, 63, 26]);\n\n \/\/ joint servo\n attach([[-8,0,24], [0,0,-1], -90,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,90), ServoHorn_Con_Def) ServoHorn();\n\n \/\/ push rod\n translate([5,-8,31])\n rotate([0,0,195])\n cube([40,1,1]);\n }\n\n \/\/ wheel\n translate([0, 40, 16\/2])\n rotate([0,90,0])\n cylinder(r=16\/2, h=16, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,30,23])\n rotate([-90,0,0])\n chamferedCube([50,40,60], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-25,0,13])\n cube([50,60, 10]);\n\n \/\/ hinge points\n color(\"white\")\n translate([0,-15,13])\n cylinder(r=5, h=10);\n\n color(\"white\")\n translate([0,75,13])\n cylinder(r=5, h=10);\n }\n\n\n}\n\nmodule segment3() {\n w = 40;\n d = 30;\n hingeOffset = 10;\n wheelOR = 15\/2;\n\n \/\/ joint servo\n attach([[2,-4,26], [-1,0,0], -90,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,90), ServoHorn_Con_Def) ServoHorn();\n\n \/\/ push rod\n translate([8,-7,28])\n rotate([0,0,180])\n cube([40,1,1]);\n }\n \/*\n attach([[-14,5,23], [0,0,-1], 0,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,0), ServoHorn_Con_Def) ServoHorn();\n\n \/\/ push rod\n translate([19,4,31])\n rotate([0,0,270])\n cube([40,1,1]);\n }\n *\/\n\n \/\/ wheel\n translate([0, d\/2, wheelOR])\n rotate([0,90,0])\n cylinder(r=wheelOR, h=16, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,d\/2,23])\n rotate([-90,0,0])\n chamferedCube([w,40,d], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-w\/2,0,13])\n cube([w,d, 10]);\n\n \/\/ hinge points\n color(\"white\")\n translate([0,-hingeOffset,13])\n cylinder(r=5, h=10);\n\n color(\"white\")\n translate([0,d + hingeOffset,13])\n cylinder(r=5, h=10);\n }\n\n\n}\n\nmodule head3() {\n w = 40;\n d = 50;\n hingeOffset = 10;\n wheelOR = 15\/2;\n\n \/\/ servo driver board\n color(\"white\")\n translate([-26\/2, 20 - 63\/2, wheelOR*2])\n cube([26, 63, 26]);\n\n \/\/ wheel\n translate([0, d\/2, wheelOR])\n rotate([0,90,0])\n cylinder(r=wheelOR, h=16, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,d\/2,23])\n rotate([-90,0,0])\n chamferedCube([w,40,d], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-w\/2,0,13])\n cube([w,d, 20]);\n\n \/\/ hinge point\n color(\"white\")\n translate([0,d + hingeOffset,13])\n cylinder(r=5, h=10);\n\n \/\/ mouth\n color(\"white\")\n translate([0,-30,13])\n cylinder(r=10, h=10);\n }\n\n\n}\n\nmodule tail3() {\n w = 40;\n d = 20;\n hingeOffset = 10;\n wheelOR = 15\/2;\n\n \/\/ battery\n color(\"white\")\n translate([-18\/2, 30 - 63\/2, 6])\n cube([18, 60, 32]);\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,d\/2,23])\n rotate([-90,0,0])\n chamferedCube([w,40,d], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-w\/2,0,13])\n cube([w,d, 20]);\n\n \/\/ hinge point\n color(\"white\")\n translate([0, -hingeOffset,13])\n cylinder(r=5, h=10);\n\n \/\/ tail\n color(\"white\")\n translate([0,d + 40,13])\n cylinder(r=10, h=20);\n }\n}\n\nmodule arrangeSegments(num, ang) {\n if (num > 0) {\n translate([0,10,0])\n segment3();\n\n translate([0,50,0])\n rotate([0,0,ang])\n arrangeSegments(num-1, 30 * sin(num * 50));\n } else {\n translate([0,10,0])\n tail3();\n }\n}\n\n\/\/ option 1\n\/\/segment();\n\n\n\/\/ option 2\n*for (i=[0:7])\n translate([0,i*90,0])\n segment2();\n\nmodule snake3() {\n \/\/ option 3\n \/\/ short body segments\n \/\/ larger head to accommodate driver board and NodeMCU\n \/\/ long-ish tail to accommodate battery - LIPO?\n translate([0,-60,0])\n head3();\n arrangeSegments(13, 30);\n}\n\nsegment3();\n","old_contents":"include <..\/config\/config.scad>\n\n\/\/ sketch of a segment\n\nmodule segment() {\n \/\/ servo driver board\n color(\"white\")\n translate([-26\/2,40 - 63\/2,20])\n cube([26, 63, 26]);\n\n \/\/ joint servo\n attach([[-8,0,10], [1,0,0], -90,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,90), ServoHorn_Con_Def) ServoHorn();\n }\n\n \/\/ wheel\n translate([0, 40, 16\/2])\n rotate([0,90,0])\n cylinder(r=16\/2, h=4, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,0,25])\n scale([1,1,0.8])\n rotate([-90,25,0])\n tube(or=30, ir = 28, h=80, $fn=8, center=false);\n\n \/\/ hinge points\n color(\"white\")\n translate([0,-20,15])\n cylinder(r=5, h=20);\n\n color(\"white\")\n translate([0,100,15])\n cylinder(r=5, h=20);\n}\n\nmodule segment2() {\n \/\/ servo driver board\n color(\"white\")\n translate([0, 30 - 63\/2, 5])\n cube([15, 63, 26]);\n\n \/\/ joint servo\n attach([[-8,0,24], [0,0,-1], -90,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,90), ServoHorn_Con_Def) ServoHorn();\n\n \/\/ push rod\n translate([5,-8,31])\n rotate([0,0,195])\n cube([40,1,1]);\n }\n\n \/\/ wheel\n translate([0, 40, 16\/2])\n rotate([0,90,0])\n cylinder(r=16\/2, h=16, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,30,23])\n rotate([-90,0,0])\n chamferedCube([50,40,60], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-25,0,13])\n cube([50,60, 10]);\n\n \/\/ hinge points\n color(\"white\")\n translate([0,-15,13])\n cylinder(r=5, h=10);\n\n color(\"white\")\n translate([0,75,13])\n cylinder(r=5, h=10);\n }\n\n\n}\n\nmodule segment3() {\n w = 40;\n d = 30;\n hingeOffset = 10;\n wheelOR = 15\/2;\n\n \/\/ joint servo\n attach([[2,-4,26], [-1,0,0], -90,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,90), ServoHorn_Con_Def) ServoHorn();\n\n \/\/ push rod\n translate([8,-7,28])\n rotate([0,0,180])\n cube([40,1,1]);\n }\n \/*\n attach([[-14,5,23], [0,0,-1], 0,0,0], MicroServo_Con_Fixing1) {\n MicroServo();\n attach(rollConnector(MicroServo_Con_Horn,0), ServoHorn_Con_Def) ServoHorn();\n\n \/\/ push rod\n translate([19,4,31])\n rotate([0,0,270])\n cube([40,1,1]);\n }\n *\/\n\n \/\/ wheel\n translate([0, d\/2, wheelOR])\n rotate([0,90,0])\n cylinder(r=wheelOR, h=16, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,d\/2,23])\n rotate([-90,0,0])\n chamferedCube([w,40,d], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-w\/2,0,13])\n cube([w,d, 10]);\n\n \/\/ hinge points\n color(\"white\")\n translate([0,-hingeOffset,13])\n cylinder(r=5, h=10);\n\n color(\"white\")\n translate([0,d + hingeOffset,13])\n cylinder(r=5, h=10);\n }\n\n\n}\n\nmodule head3() {\n w = 40;\n d = 50;\n hingeOffset = 10;\n wheelOR = 15\/2;\n\n \/\/ servo driver board\n color(\"white\")\n translate([-26\/2, 20 - 63\/2, wheelOR*2])\n cube([26, 63, 26]);\n\n \/\/ wheel\n translate([0, d\/2, wheelOR])\n rotate([0,90,0])\n cylinder(r=wheelOR, h=16, center=true);\n\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,d\/2,23])\n rotate([-90,0,0])\n chamferedCube([w,40,d], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-w\/2,0,13])\n cube([w,d, 20]);\n\n \/\/ hinge point\n color(\"white\")\n translate([0,d + hingeOffset,13])\n cylinder(r=5, h=10);\n\n \/\/ mouth\n color(\"white\")\n translate([0,-30,13])\n cylinder(r=10, h=10);\n }\n\n\n}\n\nmodule tail3() {\n w = 40;\n d = 20;\n hingeOffset = 10;\n wheelOR = 15\/2;\n\n \/\/ battery\n color(\"white\")\n translate([-18\/2, 30 - 63\/2, 6])\n cube([18, 60, 32]);\n\n \/\/ approx seg volume\n color(\"white\")\n translate([0,d\/2,23])\n rotate([-90,0,0])\n chamferedCube([w,40,d], 10, center=true, shell=2);\n\n color(\"white\")\n hull() {\n \/\/ mid section\n translate([-w\/2,0,13])\n cube([w,d, 20]);\n\n \/\/ hinge point\n color(\"white\")\n translate([0, -hingeOffset,13])\n cylinder(r=5, h=10);\n\n \/\/ tail\n color(\"white\")\n translate([0,d + 40,13])\n cylinder(r=10, h=20);\n }\n}\n\nmodule arrangeSegments(num, ang) {\n if (num > 0) {\n translate([0,10,0])\n segment3();\n\n translate([0,50,0])\n rotate([0,0,ang])\n arrangeSegments(num-1, 30 * sin(num * 50));\n } else {\n translate([0,10,0])\n tail3();\n }\n}\n\n\/\/ option 1\n\/\/segment();\n\n\n\/\/ option 2\n*for (i=[0:7])\n translate([0,i*90,0])\n segment2();\n\n\/\/ option 3\n\/\/ short body segments\n\/\/ larger head to accommodate driver board and NodeMCU\n\/\/ long-ish tail to accommodate battery - LIPO?\ntranslate([0,-60,0])\n head3();\narrangeSegments(13, 30);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c8b1a3096a1364505872a43f424b1c7f40b63a52","subject":"xaxis\/carriage: fix\/refactor hotmount clamp offset variable","message":"xaxis\/carriage: fix\/refactor hotmount clamp offset variable\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\n\/\/ main house\nextruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n];\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n \/*translate([0,-guidler_w_cut\/2,0])*\/\n \/*translate(extruder_guidler_mount_off)*\/\n \/*rotate([0,90,90])*\/\n \/*pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);*\/\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f7217fd6ecfc9a2ba62d2080291c9f84e104e6a0","subject":"x\/carriage\/extruder: fix hotend clamp tolerance","message":"x\/carriage\/extruder: fix hotend clamp tolerance\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-8*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=20*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm-5*mm)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=20*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-8*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=20*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm-5*mm)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=20*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"038e3cf08eb8d192ff67a93a409ec7f74819d3dc","subject":"Add some pieces to be laser cut to make a support for potentiometer","message":"Add some pieces to be laser cut to make a support for potentiometer\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/potentiometer_support.scad","new_file":"Hardware\/potentiometer_support.scad","new_contents":"width = 15;\nbeam_size = 10;\nbeam_thickness = 5;\nthickness = 2;\nbridge_length = 32;\npotentiometer_width = 17;\ntotal_length = bridge_length+2*width+2*thickness;\n\nmodule bottom_beam(){\ndifference(){\nunion(){\n\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tminkowski(){\n\t\t\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness\/2], center=true);\n\t\t\tcylinder(r= 2, h=beam_thickness\/2,center=true);\n}\n\t}\n\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n\ttranslate([0 , potentiometer_width\/2],0) cube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\n\t\n}\nmodule top_beam(){\ndifference(){\n\tunion(){\n\t\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [bridge_length+2*thickness, beam_size, beam_thickness], center=true);\n\t\t\t\n\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tcylinder(r= 5+thickness, h= beam_thickness, center=true);\n\t}\n\tcylinder(r= 5, h= 2* beam_thickness, center=true);\n}\n}\n\ntranslate([0, 0, beam_thickness+1]) top_beam();\nbottom_beam();\n\ntranslate([0, 0, 2* beam_thickness+2]) difference(){\n \tcylinder(r=3+thickness,h=beam_thickness, center=true);\n\tcylinder(r=3, h=2*beam_thickness, center=true);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/potentiometer_support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9dfc9a428a85dc9626ebd25b465da7916c9a07c1","subject":"fixed full height of the box","message":"fixed full height of the box\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bathroom_trash_box\/bathroom_trash_box.scad","new_file":"bathroom_trash_box\/bathroom_trash_box.scad","new_contents":"r_ext=(101+2*4)\/2;\nr_int=r_ext-2;\ncut=5.9+0.1+0.2;\ntotal_h=150;\ncylinder_h=total_h-r_ext;\n\n$fn=200;\n\nmodule box()\n{\n difference()\n {\n union()\n {\n \/\/ mount\n difference()\n {\n cube([68+r_ext, 2*r_ext, cut+2*2]);\n translate([-1, (2*r_ext-101)\/2, -1])\n cube([68-0.2+1, 101, 20]);\n translate([0, (2*r_ext-101-2*2)\/2, 2])\n cube([68+2, 101+2*2, cut]);\n }\n \/\/ box\n translate([68+2+2+r_ext, r_ext, 0])\n {\n cylinder(r=r_ext, h=cylinder_h);\n translate([0,0,cylinder_h])\n sphere(r=r_ext);\n }\n }\n \/\/ cut-in the box\n union()\n {\n translate([68+2+2+r_ext, r_ext, 0])\n translate([0,0,-1])\n {\n cylinder(r=r_int, h=cylinder_h+2);\n translate([0,0,cylinder_h])\n sphere(r=r_int);\n }\n }\n }\n}\n\nbox();\n","old_contents":"r_ext=(101+2*4)\/2;\nr_int=r_ext-2;\ncut=5.9+0.1+0.2;\n\n$fn=200;\n\nmodule box()\n{\n difference()\n {\n union()\n {\n \/\/ mount\n difference()\n {\n cube([68+r_ext, 2*r_ext, cut+2*2]);\n translate([-1, (2*r_ext-101)\/2, -1])\n cube([68-0.2+1, 101, 20]);\n translate([0, (2*r_ext-101-2*2)\/2, 2])\n cube([68+2, 101+2*2, cut]);\n }\n \/\/ box\n translate([68+2+2+r_ext, r_ext, 0])\n {\n cylinder(r=r_ext, h=150);\n translate([0,0,150])\n sphere(r=r_ext);\n }\n }\n \/\/ cut-in the box\n union()\n {\n translate([68+2+2+r_ext, r_ext, 0])\n translate([0,0,-1])\n {\n cylinder(r=r_int, h=150+2);\n translate([0,0,150])\n sphere(r=r_int);\n }\n }\n }\n}\n\nbox();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9a145f7fcb3af368d1a4d6304f0649ff307bef84","subject":"main part made a bit thicker","message":"main part made a bit thicker\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24.5\/2, h=2.5);\n cylinder(r=16\/2, h=1.5);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-1\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([1, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 7]);\n }\n }\n \/\/ screw hole\n translate([0, 0, 2.5+1])\n cylinder(r=(7+1.5)\/2, h=7-1, $fs=1);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","old_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24.5\/2, h=2.5);\n cylinder(r=16\/2, h=2);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-1\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([1, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 7]);\n }\n }\n \/\/ screw hole\n translate([0, 0, 2.5+1])\n cylinder(r=(7+1.5)\/2, h=7-1, $fs=1);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"21d28b789986d52c46f27ccbf102c548be210887","subject":"Added LCD cutout model","message":"Added LCD cutout model\n","repos":"UCT-White-Lab\/provisioning-jig,UCT-White-Lab\/provisioning-jig","old_file":"CAD_models\/lcd_cutout.scad","new_file":"CAD_models\/lcd_cutout.scad","new_contents":"\n\ndifference() {\n cube([15, 15, 0.5], center=true);\n cube([8, 3.7,1], center=true);\n translate([0, -1, -2]){\n cylinder(5, 2, 2);\n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'CAD_models\/lcd_cutout.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"60fbc7b2a47de8eeed2900a2eea0e6934aae8484","subject":"shapes: Extend size_align with orient parameter","message":"shapes: Extend size_align with orient parameter\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);*\/\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);*\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"db8964383ca7a8a76c989acbadb1c33634d7360b","subject":"box is now thicker and a bit wider","message":"box is now thicker and a bit wider\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"small_psu_stub\/small_psu_stub.scad","new_file":"small_psu_stub\/small_psu_stub.scad","new_contents":"use \n\neps = 0.01;\nwall = 2;\nbox_size = [60, 35, 20];\nroundings = 3;\nsplit_h = 5;\nint_size = box_size - 2*wall*[1,1,1];\n\nmodule box_main()\n{\n difference()\n {\n \n rounded_cube(box_size, roundings, $fn=40);\n \/\/ empty interior\n translate(wall*[1,1,1])\n rounded_cube(int_size, roundings-wall, $fn=40);\n \/\/ holes for cable\n translate([-eps, box_size[1]\/2, 3.25\/2+roundings])\n rotate([0, 90, 0])\n hull()\n for(dy=[-1, +1])\n translate([0, dy*(5.5-2*3.5\/2)\/2, 0])\n cylinder(d=3.5, h=box_size[0]+2*eps, $fn=30);\n }\n}\n\nmodule box_bottom()\n{\n intersection()\n {\n box_main();\n cube(box_size - [0, 0, split_h]);\n }\n}\n\nmodule box_top()\n{\n \/\/ cover\n intersection()\n {\n translate([0, box_size[1], box_size[2]])\n rotate([180, 0 , 0])\n box_main();\n cube([box_size[0], box_size[1], split_h]);\n }\n \/\/ side walls for glueing\n translate(wall*[1,1,1])\n {\n difference()\n {\n cube([int_size[0], int_size[1], split_h+3]);\n \/\/ just keep walls\n translate(1.2*[1,1,0])\n cube(int_size-2*1.2*[1,1,1]);\n \/\/ corners removed for more flexibility\n for(dx=[0,1])\n for(dy=[0,1])\n translate([dx*int_size[0], dy*int_size[1], 0])\n translate(-10\/2*[1,1,0])\n cube([10, 10, int_size[2]]);\n \/\/ minimize size of side walls\n translate([box_size[0]\/2 - int_size[0]\/3\/2 - wall, -eps, 0])\n cube([int_size[0]\/3, box_size[1], int_size[2]]);\n }\n }\n}\n\nbox_top();\ntranslate([0, -box_size[1]-3, 0])\n box_bottom();\n","old_contents":"use \n\neps = 0.01;\nwall = 2*0.4;\nbox_size = [60, 25, 20];\nroundings = 2;\nsplit_h = 5;\nint_size = box_size - 2*wall*[1,1,1];\n\nmodule box_main()\n{\n difference()\n {\n \n rounded_cube(box_size, roundings, $fn=30);\n \/\/ empty interior\n translate(wall*[1,1,1])\n rounded_cube(int_size, roundings-wall, $fn=30);\n \/\/ holes for cable\n translate([-eps, box_size[1]\/2, 3.25\/2+roundings])\n rotate([0, 90, 0])\n hull()\n for(dy=[-1, +1])\n translate([0, dy*(5.5-2*3.5\/2)\/2, 0])\n cylinder(d=3.5, h=box_size[0]+2*eps, $fn=20);\n }\n}\n\nmodule box_bottom()\n{\n intersection()\n {\n box_main();\n cube(box_size - [0, 0, split_h]);\n }\n}\n\nmodule box_top()\n{\n \/\/ cover\n intersection()\n {\n translate([0, box_size[1], box_size[2]])\n rotate([180, 0 , 0])\n box_main();\n cube([box_size[0], box_size[1], split_h]);\n }\n \/\/ side walls for glueing\n translate(wall*[1,1,1])\n {\n difference()\n {\n cube([int_size[0], int_size[1], split_h+3]);\n \/\/ just keep walls\n translate(0.5*[1,1,0])\n cube(int_size-2*0.5*[1,1,1]);\n \/\/ corners removed for more flexibility\n for(dx=[0,1])\n for(dy=[0,1])\n translate([dx*int_size[0], dy*int_size[1], 0])\n translate(-10\/2*[1,1,0])\n cube([10, 10, int_size[2]]);\n \/\/ minimize size of side walls\n translate([box_size[0]\/2 - int_size[0]\/3\/2 - wall, -eps, 0])\n cube([int_size[0]\/3, box_size[1], int_size[2]]);\n }\n }\n}\n\nbox_top();\ntranslate([0, -28, 0])\n box_bottom();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"11641d0cf24414584fbcd0b7c6122ce1ae28530c","subject":"fixup! transforms: add r,rx,ry,rz modules","message":"fixup! transforms: add r,rx,ry,rz modules\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"19ef2e27cd2075a1ba6a07b9fd0944b7a1429041","subject":"Update ADENIN.scad","message":"Update ADENIN.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/ADENIN.scad","new_file":"3D-models\/SCAD\/ADENIN.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435: \u0410\u0434\u0435\u043d\u0438\u043d\n\nx=50;\ny=19;\nz=9;\ndx=9; \/\/\u0414\u043b\u0438\u043d\u0430 \u0440\u0430\u0437\u044a\u0435\u043c\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\nd=2.67; \/\/\u0414\u0438\u0430\u043c\u0435\u0442\u0440 \u0433\u043d\u0435\u0437\u0434\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\np=6; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\ndifference() {\nunion() { \n translate([0, 0, 0]) cube ([x-2, y, z-0.3], center=true);\n\n translate([-24, 0, 0]) rotate([0, 0, 45]) cube ([13.5, 13.5, z-0.3], center=true);\n \n translate([30.1, 0, 0]) cube ([13.1, 19, z-0.3], center=true);\n\n} \n translate([6, 0, 3]) cube ([x-10, y+2, z\/1.5], center=true); \/\/\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n\n\n translate([-34.8, 0, 0]) cube ([10.5, 10.5, z+2], center=true); \/\/\u0414\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0438\n\n\n rotate([0, 90, 0]) translate([0, 0, -34.8]) cylinder(dx, d, d);\n\n rotate([0, 90, 0]) translate([0, 0, 33.1]) cylinder(dx, d, d);\n\n\/\/ #rotate([0, 90, 0]) translate([0, -4.5, 33.1]) cylinder(dx, d, d);\n}\n\nrotate([90, 0, 0]) translate([-13, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\nrotate([90, 0, 0]) translate([26.3, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, 0]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n#translate ([24.63,-11,-2])cube([12,22,4.2]);\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0435: \u0410\u0434\u0435\u043d\u0438\u043d\n\nx=50;\ny=19;\nz=9;\ndx=9; \/\/\u0414\u043b\u0438\u043d\u0430 \u0440\u0430\u0437\u044a\u0435\u043c\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\nd=2.67; \/\/\u0414\u0438\u0430\u043c\u0435\u0442\u0440 \u0433\u043d\u0435\u0437\u0434\u0430 \u043c\u0430\u0433\u043d\u0438\u0442\u0430\np=6; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\ndifference() {\nunion() { \n #translate([0, 0, 0]) cube ([x-2, y, z-0.3], center=true);\n\n translate([-24, 0, 0]) rotate([0, 0, 45]) cube ([13.5, 13.5, z-0.3], center=true);\n \n #translate([30.1, 0, 0]) cube ([13.1, 19, z-0.3], center=true);\n\n} \n translate([6, 0, 3]) cube ([x-10, y+2, z\/1.5], center=true); \/\/\u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u043e\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439\n\n\n #translate([-34.8, 0, 0]) cube ([10.5, 10.5, z+2], center=true); \/\/\u0414\u043b\u044f \u0432\u044b\u0440\u0435\u0437\u043a\u0438 \u0441 \u043f\u0435\u0440\u0435\u0434\u0438\n\n\n #rotate([0, 90, 0]) translate([0, 0, -34.8]) cylinder(dx, d, d);\n\n #rotate([0, 90, 0]) translate([0, 0, 33.1]) cylinder(dx, d, d);\n\n\/\/ #rotate([0, 90, 0]) translate([0, -4.5, 33.1]) cylinder(dx, d, d);\n}\n\nrotate([90, 0, 0]) translate([-13, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\nrotate([90, 0, 0]) translate([26.3, 0, -9.5]) cylinder(19, 4.4, 4.4);\n\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410 \ndifference() {\nunion () {\n translate([p, -7.55, 0]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0]) cube ([9, 2, 2]);\n}\n translate([p-6, -9, -2]) cube ([15, 2, 4]);\n translate([p-6, 7.1, -2]) cube ([15, 2, 4]);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"81528804a716bf3872edacefffa7a76dd409674e","subject":"top v2","message":"top v2\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 1.6;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 11;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 20;\ndynamic_y = shift_y + 31.5;\ndynamic_r = 15.2;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 11;\nscreen_start_y = shift_y + 26;\nscreen_length_x = 78;\nscreen_length_y = 51;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 18.5;\nmaster_button_int = 31.5;\nmaster_button_r = 6;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\n!difference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n \/\/translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n \/\/cube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n \/\/}\n \/\/translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n \/\/cube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n \/\/}\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th;\nshift_y = th;\n\nbox_x = pcb_x + 2*th;\nbox_y = pcb_y + 2*th;\n\npcb_width = 1.6;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 11;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 20;\ndynamic_y = shift_y + 31.5;\ndynamic_r = 15.2;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x, box_y, bottom_box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 15 + th;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cube([box_x, box_y, board_h + eps], false);\n translate([board_w, board_w, -eps]) {\n cube([box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], false);\n }\n }\n }\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n \/\/cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps - board_h]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h + board_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol - board_h]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol + board_h]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps - board_h]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps + board_h]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4bc77bacbe33f32b6f10c87e1f39eeb3e3f2ea4c","subject":"x\/carriage: Increase extruder b mount dia","message":"x\/carriage: Increase extruder b mount dia\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"11c9b0df3f256fdeaacaeff8c720aa7353a9539a","subject":"x\/carriage: add sides var in debug preview","message":"x\/carriage: add sides var in debug preview\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*156*mm:-98*mm)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d2f24073170d537c2bd311fb65916da426bd5b77","subject":"[3d] Update Pi connector offsets deeper in case, wider LCD hole","message":"[3d] Update Pi connector offsets deeper in case, wider LCD hole\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"include \n\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.1*1.41; \/\/ thickness of side walls\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=4.5, $fn=16);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.25,-6.25,0]) cube([12.5,12.5,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w,-3.4\/2-ww_d,0])\n cube_fillet([5.5+2*ww_w,3.4+2.5*ww_d,6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -(nut_d\/2+ww_d), 0])\n cube_fillet([nut_d+2*ww_w,nut_d+2*ww_d,oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.3, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth+lip_tip_clip, 0],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_fillet([w+2*wall, d+2*wall, h_b+2*wall_t],\n vertical=[wall\/2,wall\/2,wall\/2,wall\/2], \n top=[wall,wall,wall_t,wall],\n bottom=[wall\/2,wall\/2,wall\/2,wall\/2], $fn=4);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n \/\/ ethernet\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,81.5,-1]) jhole(15,13);\n translate([0,81.5,-2]) jhole(5,5);\n }\n \/\/ USB 0+1\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,0.2]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,2.5]) jhole(9.2,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-65, wall_t]) {\n difference() {\n cube_fillet([10,65,3], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,27.5,e]) cube_fillet([3,14,3], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n \/\/ bottom locklip (postive)\n translate([wall, d+wall, probe_centerline+wall_t]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\nhm43_split();","old_contents":"include \n\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.1*1.41; \/\/ thickness of side walls\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=4.5, $fn=16);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 60, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.25,-6.25,0]) cube([12.5,12.5,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w,-3.4\/2-ww_d,0])\n cube_fillet([5.5+2*ww_w,3.4+2.5*ww_d,6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -(nut_d\/2+ww_d), 0])\n cube_fillet([nut_d+2*ww_w,nut_d+2*ww_d,oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.3, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth+lip_tip_clip, 0],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.50, 2.10, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.75, 7.8, 0])\n cube([63.5, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_fillet([w+2*wall, d+2*wall, h_b+2*wall_t],\n vertical=[wall\/2,wall\/2,wall\/2,wall\/2], \n top=[wall,wall,wall_t,wall],\n bottom=[wall\/2,wall\/2,wall\/2,wall\/2], $fn=4);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n \/\/ ethernet\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,81,-1]) jhole(15,13);\n translate([0,81,-2]) jhole(5,5);\n }\n \/\/ USB 0+1\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,62.25,0]) jhole(13,14.8);\n translate([0,44.25,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.25,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,0.2]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,2.5]) jhole(9.2,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-65, wall_t]) {\n difference() {\n cube_fillet([10,65,3], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,27.5,e]) cube_fillet([3,14,3], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(27);\n translate([w-33,0,0]) locklip_n(33);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n \/\/ bottom locklip (postive)\n translate([wall, d+wall, probe_centerline+wall_t]) {\n locklip_p(27);\n translate([w-33,0,0]) locklip_p(33);\n }\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\nhm43_split();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7d49c0a143f911051a80b01d9879bec9b31052c2","subject":"shapes\/rcylinder: wip","message":"shapes\/rcylinder: wip\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2)\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/4, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h\/2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/2 : taper_h;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h\/4)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=inner_d, h=taper_h\/2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h\/2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4c8e1c14b67cc0b82155577f845bf3fd9cdb2a94","subject":"holes swapped, floor flattened, lid fixed","message":"holes swapped, floor flattened, lid fixed\n","repos":"JoeSuber\/QuickerPicker","old_file":"simons.scad","new_file":"simons.scad","new_contents":"\necho(\"a box with holes in it for Simon\");\n\/\/ todo: get rid of hard-coded '28' in walls_of_box\n\nbigbox = 80;\t\t\t\t\t\t\/\/ old box was 70?\nbigboxht = 55;\t\t\t\t\t\t\/\/ up from 50\nfatten_for_lid_cut=.2;\t\t\t\t\/\/ test fit lids: if more than .6 needed, bad geometry or print\n\t\t\t\t\t\t\t\t\t\/\/ also, should be zero when printing center section\nsides = 2;\t\t\t\t\t\t\t\/\/ skinny, assumes some further light-stopping material\/paint\nledhole=5;\nsensorhole=15;\nfingerspace=37;\t\nholeside=sensorhole + sides*2 + fingerspace;\t\/\/ accomodate lense assembly\ncornerad=4;\t\t\t\t\t\t\/\/ used with minkowski(), cornerad*2 + 4-flat-sides = perimeter\nsmall_chamber = 1\/3;\t\t\t\t\/\/ total of chambers' ratios should == 1 unless center wall gets thicker\nbig_chamber = 2\/3;\t\t\t\t\/\/ chambers can be swapped, or center wall can disappear\nslit_width = 5;\t\t\t\t\t\t\/\/ mm\ncuvtt_inside = 12.1;\t\t\t\t\t\/\/ put cuvette into a lid, slide detector assm into lid-grooves, put other lid on.\nlid_lad = 5;\t\t\t\t\t\t\/\/ basic lid thickness\nlid_puff = 4;\t\t\t\t\t\t\/\/ rounded-ness for lid\n\n\nmodule walls_of_box(\n\t\t\tfattener=fatten_for_lid_cut,\n\t\t\tlongside=bigbox, \n\t\t\tbigboxht=bigboxht, \n\t\t\twallthick=sides,\n\t\t\tledhole=ledhole,\n\t\t\tcornerad=cornerad,\n\t\t\tholeside=holeside,\n\t\t\tinsiders_x=bigbox - sides*3 - cornerad*2,\n\t\t\tinsiders_y=holeside - cornerad,\t\t\/\/ inner-wall corner radius is hard-coded at 1\/2 of outer\n\t\t\t){\n\techo(\"longside = \", longside);\n\techo(\"insiders_x = \", insiders_x);\n\techo(\"insiders_y = \", insiders_y);\n\tdifference(){\n\t\tminkowski(){\n\t\t\tsquare([longside - cornerad*2, holeside - cornerad*2], center=true);\n\t\t\tcircle(r=cornerad+fattener, $fn=36);\n\t\t}\n\t\tfor(block=[[small_chamber*insiders_x - fattener*2, fattener\/2], \n\t\t\t\t\t[big_chamber*insiders_x - fattener*2, 28-fattener\/2]]){\n\t\t\techo(\"block[0] = \", block[0]);\n\t\t\ttranslate([-longside\/2+(wallthick+fattener\/2)*2+block[0]\/2 + block[1], 0, 0]){\n\t\t\t\tminkowski(){\n\t\t\t\t\tsquare([block[0], holeside - cornerad - sides*2 - fattener*2], center=true);\n\t\t\t\t\tcircle(r=(cornerad-fattener)\/2, $fn=36);\n\t\t\t\t}\n\t\t\t\t\/\/ this square is just here to show the light-path\n\t\t\t\t#square([block[0], slit_width], center=true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule growbox(to_height=bigboxht, slit_width=slit_width, fatboy=0){\n\tdifference(){\n\t\tlinear_extrude(height = to_height, center = true, convexity = 10, twist = 0, slices = to_height*2, scale = 1){\n\t\t\twalls_of_box(fattener=fatboy+fatten_for_lid_cut);\n\t\t}\n\t\t\/\/ cut the slot for cuvette illumination\n\t\ttranslate([0,0,-5])\n\t\t\tcube([bigbox-sides*2-cornerad, slit_width, to_height - 5], center=true);\n\t\t\/\/ cut the holes for LED & sensor\n\t\tfor (i=[[-bigbox\/2, sensorhole], [bigbox\/2, ledhole]]){\n\t\t\ttranslate([i[0],0,0]) rotate([0,90,0])\n\t\t\t#cylinder(r=i[1]\/2, h=sides*3, center=true, $fn=32);\n\t\t}\n\t}\n}\n\nmodule lids_on_it (overhang=lid_puff, basethick=lid_lad, fatmaker=.35){\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube([bigbox, holeside, basethick], center=true);\n\t\t\tsphere(r=overhang\/2, center=true, $fn=32);\n\t\t}\n\t\t\/\/ imprint the base of the walls and cuvette on a lid-like-structure\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tgrowbox(fatboy=fatmaker);\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([cuvtt_inside+.5, cuvtt_inside+.5, bigboxht], center=true); \n\t\t\/\/ an extra cut to ensure the lid doesn't obscure the cuvett:\n\t\t\/\/translate([0,0,bigboxht\/2])\n\t\t\/\/\tcube([bigbox-sides*4, slit_width+.1, bigboxht], center=true);\n\t\tif (fatmaker > 0){\n\t\t\ttranslate([-11,0,bigboxht\/2])\n\t\t\t\t#cube([3,5,bigboxht], center=true);\n\t\t}\n\t}\n}\n\n\ntranslate([0,holeside+lid_puff+2,(lid_lad+lid_puff)\/2])\n\tlids_on_it();\ntranslate([0,0,(lid_lad+lid_puff)\/2])\n\tlids_on_it(fatmaker=0);\ntranslate([0, 0, (lid_lad+lid_puff)\/2 + bigboxht\/2])\n\tgrowbox();\n\n\n\n\n","old_contents":"\necho(\"a box with holes in it for Simon\");\n\/\/ todo: get rid of hard-coded '28' in walls_of_box\n\nbigbox = 80;\t\t\t\t\t\t\/\/ old box was 70?\nbigboxht = 55;\t\t\t\t\t\t\/\/ up from 50\nfatten_for_lid_cut=.2;\t\t\t\t\/\/ test fit lids: if more than .6 needed, bad geometry or print\n\t\t\t\t\t\t\t\t\t\/\/ also, should be zero when printing center section\nsides = 2;\t\t\t\t\t\t\t\/\/ skinny, assumes some further light-stopping material\/paint\nledhole=5;\nsensorhole=15;\nfingerspace=37;\t\nholeside=sensorhole + sides*2 + fingerspace;\t\/\/ accomodate lense assembly\ncornerad=4;\t\t\t\t\t\t\/\/ used with minkowski(), cornerad*2 + 4-flat-sides = perimeter\nsmall_chamber = 1\/3;\t\t\t\t\/\/ total of chambers' ratios should == 1 unless center wall gets thicker\nbig_chamber = 2\/3;\t\t\t\t\/\/ chambers can be swapped, or center wall can disappear\nslit_width = 5;\t\t\t\t\t\t\/\/ mm\ncuvtt_inside = 12.1;\t\t\t\t\t\/\/ put cuvette into a lid, slide detector assm into lid-grooves, put other lid on.\nlid_lad = 5;\t\t\t\t\t\t\/\/ basic lid thickness\nlid_puff = 4;\t\t\t\t\t\t\/\/ rounded-ness for lid\n\n\nmodule walls_of_box(\n\t\t\tfattener=fatten_for_lid_cut,\n\t\t\tlongside=bigbox, \n\t\t\tbigboxht=bigboxht, \n\t\t\twallthick=sides,\n\t\t\tledhole=ledhole,\n\t\t\tcornerad=cornerad,\n\t\t\tholeside=holeside,\n\t\t\tinsiders_x=bigbox - sides*3 - cornerad*2,\n\t\t\tinsiders_y=holeside - cornerad,\t\t\/\/ inner-wall corner radius is hard-coded at 1\/2 of outer\n\t\t\t){\n\techo(\"longside = \", longside);\n\techo(\"insiders_x = \", insiders_x);\n\techo(\"insiders_y = \", insiders_y);\n\tdifference(){\n\t\tminkowski(){\n\t\t\tsquare([longside - cornerad*2, holeside - cornerad*2], center=true);\n\t\t\tcircle(r=cornerad+fattener, $fn=36);\n\t\t}\n\t\tfor(block=[[small_chamber*insiders_x - fattener*2, fattener\/2], \n\t\t\t\t\t[big_chamber*insiders_x - fattener*2, 28-fattener\/2]]){\n\t\t\techo(\"block[0] = \", block[0]);\n\t\t\ttranslate([-longside\/2+(wallthick+fattener\/2)*2+block[0]\/2 + block[1], 0, 0]){\n\t\t\t\tminkowski(){\n\t\t\t\t\tsquare([block[0], holeside - cornerad - sides*2 - fattener*2], center=true);\n\t\t\t\t\tcircle(r=(cornerad-fattener)\/2, $fn=36);\n\t\t\t\t}\n\t\t\t\t\/\/ this square is just here to show the light-path\n\t\t\t\t#square([block[0], slit_width], center=true);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule growbox(to_height=bigboxht, slit_width=slit_width, fatboy=0){\n\tdifference(){\n\t\tlinear_extrude(height = to_height, center = true, convexity = 10, twist = 0, slices = to_height*2, scale = 1){\n\t\t\twalls_of_box(fattener=fatboy+fatten_for_lid_cut);\n\t\t}\n\t\t\/\/ cut the slot for cuvette illumination\n\t\ttranslate([0,0,-5])\n\t\t\tcube([bigbox-sides*2-cornerad, slit_width, to_height - 5], center=true);\n\t\t\/\/ cut the holes for LED & sensor\n\t\tfor (i=[[-bigbox\/2, ledhole], [bigbox\/2, sensorhole]]){\n\t\t\ttranslate([i[0],0,0]) rotate([0,90,0])\n\t\t\t#cylinder(r=i[1]\/2, h=sides*3, center=true, $fn=64);\n\t\t}\n\t}\n}\n\nmodule lids_on_it (overhang=lid_puff, basethick=lid_lad, fatmaker=.33){\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube([bigbox, holeside, basethick], center=true);\n\t\t\tsphere(r=overhang\/2, center=true, $fn=64);\n\t\t}\n\t\t\/\/ imprint the base of the walls and cuvette on a lid-like-structure\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tgrowbox(fatboy=fatmaker);\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([cuvtt_inside+.5, cuvtt_inside+.5, bigboxht], center=true); \n\t\t\/\/ an extra cut to ensure the lid doesn't obscure the cuvett:\n\t\ttranslate([0,0,bigboxht\/2])\n\t\t\tcube([bigbox-sides*4, slit_width+.1, bigboxht], center=true);\n\t}\n}\n\n\ntranslate([0,holeside+lid_puff+2,(lid_lad+lid_puff)\/2])\n\tlids_on_it();\ntranslate([0,0,(lid_lad+lid_puff)\/2])\n\tlids_on_it(fatmaker=0);\ntranslate([0, 0, (lid_lad+lid_puff)\/2 + bigboxht\/2])\n\tgrowbox();\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"970b5dd5a3386a99030a8066f6788cb776a1191d","subject":"bearing: disable taper for ziptie cut","message":"bearing: disable taper for ziptie cut\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f93f80c79a9603271d1f144e1415e5ac067da62c","subject":"shapes: add cuberounda","message":"shapes: add cuberounda\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule cuberounda(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cuberound(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule cuberound(size=[10,10,10], facets=32, rounding_radius=1)\n{\n translate(-size\/2)\n hull()\n {\n translate([rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n translate([size[0]-rounding_radius,size[1]-rounding_radius,size[2]-rounding_radius]) sphere (r=rounding_radius,$fn=facets);\n }\n}\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r_*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n","old_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule orient(zaxes, roll=0)\n{\n zaxes = len(zaxes.x) == undef && zaxes.x != undef? [zaxes] : zaxes;\n for(zaxis=zaxes)\n {\n rotate(_orient_angles(zaxis))\n \/*rotate(roll*z)*\/\n children();\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0], orient=[0,0,1])\n{\n bounds = _rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1];\n t=hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]);\n translate(t)\n {\n orient(orient)\n {\n children();\n }\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.8){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n fn,\n fnr=0.8,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r_*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\/*fncylindera(h=10, r=5, extra_r=2, align=[0,0,1], orient=[1,0,0]);*\/\n\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,-1], orient=[0,0,1]);*\/\n\/*translate([0,-10,0])*\/\n\/*fncylindera(h=10, d=5, extra_r=2, align=[0,0,1], orient=[0,0,1]);*\/\n\/*translate([0,-20,0])*\/\n\/*fncylindera(h=10, d=10, extra_h=5, orient=[1,0,0], align=[1,0,0], extra_align=[1,0,0]);*\/\n\/*translate([0,-30,0])*\/\n\/*fncylindera(h=10, d=7.5, extra_h=5, orient=[1,0,0], align=[-1,0,0], extra_align=[1,0,0]);*\/\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5d178dcc44ed00f88692c898eeae0e232169b4f1","subject":"modified bracket - reduced height, increased hole diameter","message":"modified bracket - reduced height, increased hole diameter\n","repos":"loxodes\/SuperDARN_Transmitter,loxodes\/SuperDARN_Transmitter,loxodes\/SuperDARN_Transmitter","old_file":"chassis\/bracket\/front_panel_bracket.scad","new_file":"chassis\/bracket\/front_panel_bracket.scad","new_contents":"\/\/ units in inches\nT_bracket = .2;\nT_hole = .5;\nT_corner = .6;\nT_shell = .15;\nL1 = 2.4;\nL2 = 1.85;\nHu1 = .8;\nHu2 = 1.55;\nHl1 = 1.35;\nHl2 = 2.1;\nW = .85;\nD_hole = .25;\n\n\nmodule prism(l, w, h){\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\ndifference() {\n union() {\n translate([L1\/2,0,0])\n linear_extrude(height = T_bracket)\n square([L1, W], center = true);\n \n translate([T_bracket\/2,0,0])\n linear_extrude(height = L2)\n square([T_bracket, W], center = true);\n \n translate([T_corner,-W\/2,0 ])\n rotate([0,0,90])\n prism(W, T_corner, T_corner);\n \n translate([L2,-W\/2,0 ])\n rotate([0,0,90])\n prism(T_shell, L2, L2);\n \n translate([L2,W\/2-T_shell,0 ])\n rotate([0,0,90])\n prism(T_shell, L2, L2);\n };\n \n union() {\n translate([Hl1, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n \n translate([Hl2, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n\n rotate([0,270,0])\n translate([Hu1, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n \n rotate([0,270,0])\n translate([Hu2, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n };\n}","old_contents":"\/\/ units in inches\nT_bracket = .2;\nT_hole = .5;\nT_corner = .6;\nT_shell = .15;\nL1 = 2.5;\nL2 = 1.85;\nHu1 = .75;\nHu2 = 1.5;\nHl1 = 1.25;\nHl2 = 2;\nW = .8;\nD_hole = .2;\n\n\nmodule prism(l, w, h){\n polyhedron(\n points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],\n faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]\n );\n}\ndifference() {\n union() {\n translate([L1\/2,0,0])\n linear_extrude(height = T_bracket)\n square([L1, W], center = true);\n \n translate([T_bracket\/2,0,0])\n linear_extrude(height = L2)\n square([T_bracket, W], center = true);\n \n translate([T_corner,-W\/2,0 ])\n rotate([0,0,90])\n prism(W, T_corner, T_corner);\n \n translate([L2,-W\/2,0 ])\n rotate([0,0,90])\n prism(T_shell, L2, L2);\n \n translate([L2,W\/2-T_shell,0 ])\n rotate([0,0,90])\n prism(T_shell, L2, L2);\n };\n \n union() {\n translate([Hl1, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n \n translate([Hl2, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n\n rotate([0,270,0])\n translate([Hu1, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n \n rotate([0,270,0])\n translate([Hu2, 0, 0])\n cylinder(h=T_hole,d=D_hole,center=true,$fn=50);\n };\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2f6fb213f9f2417fed28bcd52d20f09ec62a9b78","subject":"increased precision of the side wall finish","message":"increased precision of the side wall finish\n","repos":"el-bart\/soft_playground,el-bart\/soft_playground","old_file":"openscad_svg_frame\/frame.scad","new_file":"openscad_svg_frame\/frame.scad","new_contents":"eps = 0.01;\nwall = 2;\nwall_h = 4;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children();\n }\n }\n\n cut_in_frame()\n children();\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n linear_extrude(wall_h)\n model_slot_base(name)\n children();\n sphere(r=wall\/2, $fn=20);\n }\n \/\/ cut-off for the bottom roundings\n \/\/ we're only interested in the top of the model\n translate([-50, -50, 0])\n cube(300*[1,1,1]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n \/\/ some location(s) that shall be removed from the overall shape:\n \/\/ bottom\n translate([40, -10, 0])\n square([60, 20]);\n \/\/ top\n translate([60, 110, 0])\n square([50, 20]);\n}\n","old_contents":"eps = 0.01;\nwall = 2;\nwall_h = 4;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children();\n }\n }\n\n cut_in_frame()\n children();\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n linear_extrude(wall_h)\n model_slot_base(name)\n children();\n sphere(r=wall\/2);\n }\n \/\/ cut-off for the bottom roundings\n \/\/ we're only interested in the top of the model\n translate([-50, -50, 0])\n cube(300*[1,1,1]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n \/\/ some location(s) that shall be removed from the overall shape:\n \/\/ bottom\n translate([40, -10, 0])\n square([60, 20]);\n \/\/ top\n translate([60, 110, 0])\n square([50, 20]);\n}\n","returncode":0,"stderr":"","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"9eddc0c34051952073c9a6bd94b4e7aac697a5d9","subject":"Dual E3D V6 + extruder mount prototype. Not meant for BG7.","message":"Dual E3D V6 + extruder mount prototype. Not meant for BG7.\n","repos":"twstdpear\/i3_parts","old_file":"bowden_mount.scad","new_file":"bowden_mount.scad","new_contents":"hole_sep = 30;\r\nhole_sep_2 = 20;\r\nslop = .1;\r\nlower_hole_sep = 30;\r\nlower_hole_rad = 5.5+slop;\r\nlower_hole_height = -7.5;\r\n\r\n\r\n\r\n%cube([9,9,100],center=true);\r\n\r\nwall=4;\r\nm_thickness = wall*2+1+1;\r\nhotend_attachment_rad = 23; \r\n\r\n\/\/hotend stuff\r\nhotend_rad = 8+slop;\r\n\r\n\/\/standard stuff\r\nbolt_slop = .5;\r\nnut_slop = .85;\r\nbolt_dia = 5+bolt_slop;\r\nbolt_rad = bolt_dia\/2;\r\nbolt_cap_dia = 10+bolt_slop;\r\nbolt_cap_rad = bolt_cap_dia\/2;\r\nnut_dia = 9+nut_slop;\r\nnut_rad = nut_dia\/2;\r\nnut_height = 3.25;\r\nlock_nut_height = 5.25;\r\n\r\nm3_nut_rad = 6\/cos(30)\/2;\r\nm3_nut_height = 3;\r\nm3_rad = 1.8;\r\nm3_cap_rad = 3.25;\r\nm3_cap_height = 2;\r\n\r\n632_dia = 3.5;\r\n632_rad = 632_dia\/2+slop;\r\n632_nut_rad = 8.25\/cos(45)\/2;\r\n632_cap_dia = 6.5;\r\n632_cap_rad = 632_cap_dia\/2+slop;\r\n632_cap_height = 2+slop;\r\n632_nut_height = 5;\r\n\r\n\/\/the radius of the induction sensor\r\nind_rad = 18\/2+slop*2;\r\nind_offset = -30;\r\nind_height = 12;\r\n\r\nfan_offset = -15;\r\n\r\n\/\/not sure why these are needed\r\narm_rad = wall*1.75;\r\nnut_mount = wall+nut_height\/2;\t\/\/thickness behind cone\r\narm_sep = 54;\r\n\r\ne3d_fin_rad = 26\/2; \/\/\/\/\/\/\/\/\/\/23 for the e3d V6; the V5 is 26 \r\necho(\"Nozzle Sep = \", e3d_fin_rad*2);\r\n\/\/extruder_sep = e3d_fin_rad*2;\r\n\r\n\r\n\/\/bowden_mount();\r\n\/\/translate([0,25,0]) nut_trap();\r\n\/\/translate([0,50,0]) fan_duct(clip_height=25); \r\n\/\/translate([0,50,0]) fan_duct_induction(clip_height=35, e3d_fin_rad = 26\/2); \/\/v5\r\n\/\/translate([0,50,0]) fan_duct_induction(clip_height=25, e3d_fin_rad = 23\/2); \/\/v6\r\n\r\n\/\/translate([0,-50, 0])\r\n\/\/!cyclops_mount();\r\n\r\ninline_mount();\r\n\r\n$fn=32;\r\n\r\nmodule nut_trap(){\r\n\tdifference(){\r\n\t\tunion(){\r\n\t\t\ttranslate([0,0,wall\/6]) cube([hole_sep,wall*2,wall\/3], center=true);\r\n\t\t\tfor(i=[0:1]) mirror([i,0,0]) translate([hole_sep\/2,0,0]) cylinder(r=632_nut_rad+wall\/2,h=632_nut_height, $fn=4);\r\n\t\t}\r\n\t\tfor(i=[0:1]) mirror([i,0,0]) translate([hole_sep\/2,0,0]){\r\n\t\t\ttranslate([0,0,1]) cylinder(r=632_nut_rad,h=632_nut_height, $fn=4);\r\n\t\t\ttranslate([0,0,-1]) cylinder(r=632_rad,h=632_nut_height);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule fan_duct_induction(clip_height = 40, wire_offset = 4){\r\n extruder_sep = e3d_fin_rad*2;\r\n \r\n \theight = 40;\r\n\tfan_w = 40;\r\n\tfan_screwhole = 32\/2;\r\n\tfan_rad = 36\/2;\r\n\r\n\tductwall = 3.5;\r\n\r\n\tcutoff = 45;\r\n \r\n unclip_height = 40-clip_height;\r\n \r\n translate([0,0,height\/2]) rotate([90,0,0])\r\n\tdifference(){\r\n union(){\r\n hull(){\r\n\t\t\t\/\/fan\r\n\t\t\ttranslate([0,0,wall\/2]) rotate([0,45,0]) translate([0,0,fan_offset]) cube([fan_w, fan_w, wall], center=true);\r\n \/\/translate([0,height\/2-unclip_height\/2,extruder_sep+wall\/2+wire_offset]) cube([extruder_sep+e3d_fin_rad*2+ductwall,unclip_height,wall], center=true);\r\n\r\n \/\/the e3d body, with a gap for the wires to pop up\r\n\t\t\tfor(i=[-1,1]) for(j=[0,wire_offset]) translate([i*extruder_sep\/2,0,extruder_sep\/2+wall+j]) rotate([90,0,0]) cylinder(r=e3d_fin_rad+ductwall\/2, h=height, center=true);\r\n \r\n \r\n }\r\n \/\/the induction sensor mount\r\n translate([extruder_sep\/2,-height\/2,extruder_sep\/2+wall+wire_offset+ind_offset]) rotate([-90,0,0]) extruder_mount(1, m_height=ind_height, hotend_rad=ind_rad);\r\n \r\n\t\t}\r\n \/\/induction mount\r\n translate([extruder_sep\/2,-height\/2,extruder_sep\/2+wall+wire_offset+ind_offset]) rotate([-90,0,0]) extruder_mount(0, m_height=ind_height, hotend_rad=ind_rad);\r\n \r\n \/\/the e3d holes\r\n #for(i=[-1,1]) translate([i*extruder_sep\/2,0,extruder_sep\/2+wall+wire_offset]) rotate([90,0,0]) cylinder(r=e3d_fin_rad, h=height+2, center=true);\r\n \r\n hull()\r\n for(i=[-1,1]) translate([i*extruder_sep\/2-wire_offset\/2*i+5*i,0,wall+wire_offset\/2]) {\r\n rotate([90,0,0]) cylinder(r=wire_offset\/2, h=height+ductwall*2, center=true);\r\n translate([0,0,5]) rotate([90,0,0]) cylinder(r=wire_offset\/2, h=height+ductwall*2, center=true);\r\n }\r\n \r\n \/\/cutout around the hotend clamps\r\n hull(){\r\n translate([0,height\/2-unclip_height+wall\/2,wall+wall]) rotate([0,90,0]) cylinder(r=wall\/2, h=100, center=true);\r\n translate([0,height\/2-unclip_height+wall\/2,wall+wall+height]) rotate([0,90,0]) cylinder(r=wall\/2, h=100, center=true);\r\n translate([0,height,wall+wall]) rotate([0,90,0]) cylinder(r=wall\/2, h=100, center=true);\r\n }\r\n\r\n\t\t\/\/cutout for clipping on\r\n for(i=[0,1]) mirror([i,0,0]) translate([extruder_sep\/2,-height\/2-.1,extruder_sep\/2+wall+wire_offset]){\r\n rotate([0,-90+cutoff,0]) difference(){\r\n cube([extruder_sep,height+1, extruder_sep]);\r\n rotate([-90,0,0]) translate([e3d_fin_rad+ductwall\/4,0,-.1]) cylinder(r=ductwall\/4, h=height+3, $fn=16);\r\n }\r\n }\r\n \r\n\t\t\/\/translate([0,0,50+cutoff]) cube([100,100,100], center=true);\r\n\t\t\/\/cutoff the center\r\n\t\ttranslate([0,0,50+wall]) cube([extruder_sep,100,100], center=true);\r\n\r\n\t\t\/\/fan\r\n difference(){\r\n hull(){\r\n translate([0,0,wall\/2]) rotate([0,45,0]) translate([0,0,fan_offset-wall\/2-.1]) cylinder(r=fan_rad,h=wall);\r\n translate([0,0,wall]) cylinder(r=fan_rad,h=.1);\r\n }\r\n translate([extruder_sep\/2,-height\/2,extruder_sep\/2+wall+wire_offset+ind_offset]) rotate([-90,0,0]) extruder_mount(0, m_height=ind_height, hotend_rad=ind_rad+1);\r\n }\r\n translate([0,0,wall]) cylinder(r=fan_rad,h=wall);\r\n \r\n \/\/fan mount\r\n translate([0,0,wall\/2]) rotate([0,45,0]) translate([0,0,fan_offset]) {\r\n for(i=[0:90:359]) rotate([0,0,i]) translate([fan_screwhole, fan_screwhole, -.1]){\r\n cylinder(r=m3_rad, h=wall*4, center=true);\r\n translate([0,0,wall\/2-.1]) cylinder(r1=m3_nut_rad, r2=m3_nut_rad+.5, h=wall*3, $fn=6);\r\n }\r\n }\r\n\t}\r\n}\r\n\r\nmodule fan_duct(clip_height = 40, wire_offset = 4){\r\n\theight = 40;\r\n\tfan_w = 40;\r\n\tfan_screwhole = 32\/2;\r\n\tfan_rad = 36\/2;\r\n\r\n\tductwall = 3.5;\r\n\r\n\tcutoff = 40;\r\n \r\n unclip_height = 40-clip_height;\r\n\r\n echo(unclip_height);\r\n \r\n\ttranslate([0,0,height\/2]) rotate([90,0,0])\r\n\tdifference(){\r\n union(){\r\n hull(){\r\n\t\t\t\/\/fan\r\n\t\t\ttranslate([0,0,wall\/2]) cube([fan_w, fan_w, wall], center=true);\r\n \/\/translate([0,height\/2-unclip_height\/2,extruder_sep+wall\/2+wire_offset]) cube([extruder_sep+e3d_fin_rad*2+ductwall,unclip_height,wall], center=true);\r\n\r\n\t\t\tfor(i=[-1,1]) for(j=[0,wire_offset]) translate([i*extruder_sep\/2,0,extruder_sep\/2+wall+j]) rotate([90,0,0]) cylinder(r=e3d_fin_rad+ductwall\/2, h=height, center=true);\r\n \r\n }\r\n *hull(){\r\n #translate([0,height\/2-unclip_height\/2,extruder_sep+wall\/2+wire_offset]) cube([extruder_sep+e3d_fin_rad*2+ductwall,unclip_height,wall], center=true);\r\n #for(i=[-1,1]) translate([i*extruder_sep\/2,height\/2,extruder_sep\/2+wall+wire_offset]) rotate([90,0,0]) cylinder(r=e3d_fin_rad+ductwall\/2, h=unclip_height+wall);\r\n }\r\n\t\t}\r\n \r\n for(i=[-1,1]) translate([i*extruder_sep\/2,0,extruder_sep\/2+wall+wire_offset]) rotate([90,0,0]) cylinder(r=e3d_fin_rad, h=height+2, center=true);\r\n \r\n for(i=[-1,1]) translate([i*extruder_sep\/2-wire_offset\/2*i,0,extruder_sep\/2+wall-wire_offset\/2]) rotate([90,0,0]) cylinder(r=e3d_fin_rad-wire_offset\/2, h=height+ductwall*2, center=true);\r\n \r\n \/\/cutout around the hotend clamps\r\n \/\/translate([0,height\/2-unclip_height\/2,wall+height\/2+wall\/2]) cube([extruder_sep+e3d_fin_rad*3,unclip_height+.1,height], center=true);\r\n hull(){\r\n translate([0,height\/2-unclip_height+wall\/2,wall+wall]) rotate([0,90,0]) cylinder(r=wall\/2, h=100, center=true);\r\n translate([0,height\/2-unclip_height+wall\/2,wall+wall+height]) rotate([0,90,0]) cylinder(r=wall\/2, h=100, center=true);\r\n translate([0,height,wall+wall]) rotate([0,90,0]) cylinder(r=wall\/2, h=100, center=true);\r\n }\r\n\r\n\t\t\/\/cutout for clipping on\r\n for(i=[0,1]) mirror([i,0,0]) translate([extruder_sep\/2,-height\/2-.1,extruder_sep\/2+wall+wire_offset]){\r\n rotate([0,-90+cutoff,0]) difference(){\r\n cube([extruder_sep,height+1, extruder_sep]);\r\n rotate([-90,0,0]) translate([e3d_fin_rad+ductwall\/4,0,-.1]) cylinder(r=ductwall\/4, h=height+3, $fn=16);\r\n }\r\n }\r\n \r\n \r\n \r\n \r\n\t\t\/\/translate([0,0,50+cutoff]) cube([100,100,100], center=true);\r\n\t\t\/\/cutoff the center\r\n\t\ttranslate([0,0,50+wall]) cube([extruder_sep,100,100], center=true);\r\n\r\n\t\t\/\/fan\r\n\t\tcylinder(r=fan_rad,h=height*2, center=true);\r\n\t\tfor(i=[0:90:359]) rotate([0,0,i]) translate([fan_screwhole, fan_screwhole, -.1]){\r\n\t\t\tcylinder(r=m3_rad, h=wall*4);\r\n\t\t\ttranslate([0,0,wall\/2-.1]) cylinder(r1=m3_nut_rad, r2=m3_nut_rad+.5, h=wall*4, $fn=6);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/mounting holes for the cyclops\r\nmodule cyclops_holes(solid=0, jut=0){\r\n hole_sep = 9;\r\n hole_zsep = 10;\r\n ind_jut = 2;\r\n \r\n for(i=[0,1]) mirror([i,0,0]){\r\n translate([hole_sep\/2,-wall,hole_zsep]) rotate([-90,0,0]){\r\n if(solid>=0){\r\n cylinder(r=m3_rad+wall, h=wall);\r\n if(jut==1){\r\n translate([0,0,wall-.1]) cylinder(r1=m3_rad+wall, r2=m3_rad+wall\/2, h=ind_jut+.1);\r\n }\r\n }\r\n if(solid<=0) translate([0,0,-.1]) {\r\n cap_cylinder(r=m3_rad, h=wall*2);\r\n cap_cylinder(r=m3_cap_rad, h=m3_cap_height);\r\n }\r\n }\r\n }\r\n \r\n translate([0,-wall,0]) rotate([-90,0,0]){\r\n if(solid>=0){\r\n cylinder(r=m3_rad+wall, h=wall);\r\n if(jut==1){\r\n translate([0,0,wall-.1]) cylinder(r1=m3_rad+wall, r2=m3_rad+wall\/2, h=ind_jut+.1);\r\n }\r\n }\r\n if(solid<=0) translate([0,0,-.1]) {\r\n %translate([0,-5,9+wall+ind_jut+.1]) cube([30,30,18], center=true);\r\n %translate([0,-5,6+wall+ind_jut+.1]) rotate([90,0,0]) cylinder(r=1, h=50, center=true);\r\n cap_cylinder(r=m3_rad, h=wall*2);\r\n cap_cylinder(r=m3_cap_rad, h=m3_cap_height);\r\n }\r\n }\r\n}\r\n\r\nmodule i3_holes(solid=0){\r\n attach_height=0;\r\n for(i=[0,1]) mirror([i,0,0]){\r\n translate([lower_hole_sep\/2,-wall,attach_height]) rotate([-90,0,0]){\r\n if(solid>=0)\r\n cylinder(r=632_rad+wall, h=wall);\r\n if(solid<=0) translate([0,0,-.1]) {\r\n cap_cylinder(r=632_rad, h=wall*2);\r\n \/\/translate([0,0,wall-632_cap_height]) \r\n translate([0,0,1.5]) \r\n cap_cylinder(r=632_cap_rad, h=632_cap_height+wall);\r\n }\r\n }\r\n }\r\n}\r\n\r\nmodule cyclops_mount(induction=1){\r\n mount_height = 20;\r\n e3d_mount_height = wall;\r\n e3d_mount_offset = 15;\r\n ind_offset=(16-18)\/2;\r\n wall=4;\r\n \r\n difference(){\r\n union(){\r\n hull(){\r\n for(i=[0,1]) mirror([i,0,0])\r\n translate([e3d_mount_offset,0,e3d_mount_height]) cyclops_holes(1, wall=wall);\r\n translate([0,0,mount_height]) i3_holes(1, wall=wall);\r\n }\r\n if(induction==1){\r\n translate([-e3d_mount_offset,ind_rad+ind_offset,0]) rotate([0,0,90]) extruder_mount(1, m_height=ind_height, hotend_rad=ind_rad, wall=wall);\r\n }\r\n \r\n translate([e3d_mount_offset,0,e3d_mount_height]) cyclops_holes(1, jut=1, wall=wall);\r\n }\r\n \r\n translate([e3d_mount_offset,0,e3d_mount_height]) cyclops_holes(-1, wall=wall);\r\n translate([0,0,mount_height]) i3_holes(-1, wall=wall);\r\n if(induction==1){\r\n translate([-e3d_mount_offset,ind_rad+ind_offset,0]) rotate([0,0,90]) extruder_mount(0, m_height=ind_height, hotend_rad=ind_rad, wall=wall);\r\n }\r\n \r\n \/\/cut off back and base\r\n translate([0,-50-wall,0]) cube([100,100,100], center=true);\r\n translate([0,0,-50]) cube([100,100,100], center=true);\r\n }\r\n \r\n}\r\n\r\nmodule inline_mount(height=14){\r\n extruder_sep = e3d_fin_rad*2;\r\n attach_height = height+3;\r\n \r\n difference(){\r\n union(){\r\n translate([0,e3d_fin_rad-hotend_rad,0]) rotate([0,0,180]) extruder_mount(1,height,0,0);\r\n translate([extruder_sep,e3d_fin_rad-hotend_rad,0]) rotate([0,0,90]) extruder_mount(1,height,0,0);\r\n translate([50,e3d_fin_rad-hotend_rad,0]) rotate([0,0,0]) extruder_mount(1,height,0,0, hotend_rad=ind_rad);\r\n }\r\n translate([0,e3d_fin_rad-hotend_rad,0]) rotate([0,0,180]) extruder_mount(0,height,0,0);\r\n translate([extruder_sep,e3d_fin_rad-hotend_rad,0]) rotate([0,0,90]) extruder_mount(0,height,0,0);\r\n translate([50,e3d_fin_rad-hotend_rad,0]) rotate([0,0,0]) extruder_mount(0,height,0,0, hotend_rad=ind_rad);\r\n \r\n \/\/mounting holes\r\n for(i=[0,50]) translate([i,0,height\/2]) rotate([90,0,0]) {\r\n #cap_cylinder(r=m3_rad, h=50);\r\n }\r\n }\r\n}\r\n\r\nmodule bowden_mount(height=14, induction = 1){\r\n extruder_sep = e3d_fin_rad*2;\r\n attach_height = height+3;\r\n\tdifference(){\r\n\t\tunion(){\r\n\t\t\tfor(i=[0,1]) mirror([i,0,0]) translate([extruder_sep\/2,e3d_fin_rad-hotend_rad,0]) extruder_mount(1,height,0,0);\r\n\r\n\t\t\t\/\/mount supports\r\n\t\t\thull(){\r\n\t\t\t\tfor(i=[0,1]) mirror([i,0,0]) translate([hole_sep\/2,-hotend_rad-wall,attach_height]) rotate([-90,0,0]) cylinder(r=632_rad+wall, h=wall);\r\n\t\t\t\tfor(i=[0,1]) mirror([i,0,0]) translate([hole_sep\/3,-hotend_rad-wall,632_rad+wall]) rotate([-90,0,0]) rotate([0,0,-180\/5\/2]) cylinder(r=(632_rad+wall)\/cos(180\/5), h=wall, $fn=5);\r\n\t\t\t}\r\n\r\n\t\t\t\/\/fillet\r\n\t\t\tdifference(){\r\n\t\t\t\ttranslate([0,-hotend_rad,height+wall\/2-.01]) cube([extruder_sep+(hotend_rad\/cos(180\/18)+.1+wall)\/cos(30),wall*2,wall], center=true);\r\n\t\t\t\ttranslate([0, wall\/2, wall\/2]) translate([0,-hotend_rad+wall\/2-.05,height+wall\/2-.05]) rotate([0,90,0]) cylinder(r=wall, h=hole_sep+632_rad*2+wall*2+1, center=true);\r\n\t\t\t}\r\n \r\n if(induction==1){\r\n translate([0,e3d_fin_rad*2-hotend_rad+ind_rad,0]) rotate([0,0,90]) extruder_mount(1, m_height=ind_height, hotend_rad=ind_rad);\r\n }\r\n\t\t}\r\n if(induction==1){\r\n translate([0,e3d_fin_rad*2-hotend_rad+ind_rad,0]) rotate([0,0,90]) extruder_mount(0, m_height=ind_height, hotend_rad=ind_rad);\r\n }\r\n \r\n\t\tfor(i=[0,1]) mirror([i,0,0]) translate([extruder_sep\/2,e3d_fin_rad-hotend_rad,0]) extruder_mount(0,height,0,0);\r\n\r\n\t\t\/\/holes\r\n\t\tfor(i=[0,1]) mirror([i,0,0]) translate([hole_sep\/2,-hotend_rad-wall-.1,attach_height]) rotate([-90,0,0]) {\r\n\t\t\tcap_cylinder(r=632_rad, h=wall+1);\r\n\t\t\t\/\/translate([0,0,wall-632_cap_height]) cap_cylinder(r=632_cap_rad, h=wall+1);\r\n\t\r\n\t\t\t\/\/hollows for other screws on mount\r\n\t\t\ttranslate([lower_hole_sep\/2-hole_sep\/2, -lower_hole_height, 0]) cap_cylinder(r=lower_hole_rad, h=wall+1);\r\n\t\t}\r\n\r\n\t}\r\n}\r\n\r\n\r\nmodule extruder_mount(solid = 1, m_height = 10, fillet = 8, tap_height=0, width=20, fn=6){\r\n\tgap = 3;\r\n\ttap_dia = 9.1;\r\n\ttap_rad = tap_dia\/2;\r\n\r\n\tif(solid){\t\t\r\n\t\t\/\/clamp material\r\n\t\tif(m_height > nut_rad*2){\r\n\t\t\tcylinder(r=(hotend_rad+wall)\/cos(30), h=m_height, $fn=fn);\r\n\t\t\ttranslate([hotend_rad+bolt_rad+1,gap,m_height\/2]) rotate([-90,0,0]) cylinder(r=m_height\/2\/cos(30), h=wall+1, $fn=6);\r\n\t\t\ttranslate([hotend_rad+bolt_rad+1,-wall-1,m_height\/2]) rotate([-90,0,0]) cylinder(r=m_height\/2\/cos(30), h=wall+1, $fn=6);\r\n\t\t}\r\n\t}else{\r\n\t\tunion(){\r\n\t\t\t\/\/hotend hole\r\n\t\t\ttranslate([0,0,-.05]) cylinder(r=hotend_rad\/cos(180\/18)+.1, h=m_height+40, $fn=36);\r\n\r\n\t\t\t\/\/bolt slots\r\n\t\t\tif(m_height > nut_rad*2){\r\n\t\t\t\trender() translate([hotend_rad+bolt_rad+2,-m_thickness-.05,m_height\/2]) rotate([-90,0,0]) cap_cylinder(r=632_rad, h=m_thickness+10);\r\n\t\t\t\ttranslate([hotend_rad+bolt_rad+2,-wall*2,m_height\/2]) rotate([-90,0,0]) cylinder(r=632_nut_rad, h=wall, $fn=4);\r\n\r\n\t\t\t\t\/\/mount tightener\r\n\t\t\t\ttranslate([hotend_rad+bolt_rad+2,wall+gap-1,m_height\/2]) rotate([-90,0,0]) cylinder(r=632_cap_rad, h=10);\r\n\t\t\t\ttranslate([0,0,-.05]) cube([wall*5, gap, m_height+.1]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule cap_cylinder(r=1, h=1, center=false){\r\n\trender() union(){\r\n\t\tcylinder(r=r, h=h, center=center);\r\n\t\tintersection(){\r\n\t\t\trotate([0,0,22.5]) cylinder(r=r\/cos(180\/8), h=h, $fn=8, center=center);\r\n\t\t\ttranslate([0,-r\/cos(180\/4),0]) rotate([0,0,0]) cylinder(r=r\/cos(180\/4), h=h, $fn=4, center=center);\r\n\t\t}\r\n\t}\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'bowden_mount.scad' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"1770ed91c8db3e6eac1e37d3103bb15731b0f8b2","subject":"improved cage - relocate ESC forward","message":"improved cage - relocate ESC forward\n","repos":"dkuulis\/folkrace,dkuulis\/folkrace","old_file":"3d\/apex.scad","new_file":"3d\/apex.scad","new_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n #arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/ cage holes\n #cage(mode=1\/*cut*\/);\n\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule barbox(p1, p2, s=1, r=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n l1 = l+s-2*r;\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n o = s\/2-r;\n s1 = s-2*r;\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l1], center=true);\n cube(size=[s, s1, l1], center=true);\n\n for (x=[o, -o]) \n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l1, center=true);\n for (z=[l1\/2, -l1\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l1\/2, -l1\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true); \n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n \n }\n}\n\nmodule bar(p1, p2, s=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\nmodule ball8(p1, s=1, r=1) {\n\n o = s\/2-r;\n \n translate(p1) \n for (x=[o, -o]) \n for (y=[o, -o])\n for (z=[o, -o]) \n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\nmodule skew(p1, p2) { \/\/ TODO - not working\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n b = [a[0]\/a[2], a[1]\/a[2]];\n \n matrix = [\n [ 1, 0, b[1], 0 ],\n [ 0, 1, b[2], 0 ],\n [ 0, 0, 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n translate(p1) \n multmatrix(matrix) \n children();\n}\n\nmodule cage_leg(p1, p2, d, db, r, mode)\n{\n if (mode == 2) {\n bar(p1, p2, d); \n }\n else { \n hull() {\n ball8(p2, d, r);\n translate([0, 0, -d\/2]) translate(p1) difference() {\n sphere(d=db, center=true);\n translate([0, 0, -db\/2]) cube(size=[db, db, db], center=true);\n }\n }\n }\n}\n\nmodule cage_pin(p1, p2, d, pd, ph, mode)\n{\n extra = mode == 1 \/*cut*\/ ? 0.5 : 0;\n\n if (mode == 1)\n {\n bar(p1, p2, d+extra); \n }\n else\n difference() {\n bar(p1, p2, d+extra); \n \n #translate ([0,0,-ph])\n translate (p1) \n rotate([0,90,0])\n cylinder(d=pd, h=2*d, center=true);\n } \n}\n\nmodule lcd_mount(p1, x1, x2)\n{\n translate(p1) difference() {\n #translate([(x1-x2)\/2,0,-1-0.5\/2]) cube(size=[x1+x2, 6, 2.5], center=true);\n #translate([0,0,-0.5]) screw2x6bore(); \n } \n}\n\nmodule cage(mode = 0)\n{\n \/\/ mode 0 - full, mode 1 - cutout for platform, 2 - simple full\n \n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements \n top = 82;\n \n top_side = 30;\n \n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front+26\/*esc size*\/;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n \n bottom = 51\/*platform top*\/+d\/2;\n \n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n \n mid = (top+bottom)\/2;\n mid_side = 15;\n mid_front = top_esc+10; \n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n mid_front_left = [mid_front, mid_side, mid];\n mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n \n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n \n \/\/ bars\n if (mode != 1 \/*cut*\/)\n {\n barbox(top_front_left, top_front_right, d, r1); \n barbox(top_rear_left, top_rear_right, d, r1); \n barbox(top_esc_left, top_rear_left, d, r1); \n barbox(top_esc_right, top_rear_right, d, r1); \n\n barbox(top_esc_left, top_esc_right, d, r1); \n barbox(top_lcd_left, top_lcd_right, d, r1);\n\n bar(mid_front_left, top_esc_left, d);\n bar(mid_front_right, top_esc_right, d);\n \n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5-0.5, 23.5\/2, top+d\/2], 2, 4);\n lcd_mount([top_rear+d\/2+2.5-0.5, -23.5\/2, top+d\/2], 2, 4);\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1, mode);\n cage_leg(bottom_front_right, top_front_right, d, db, r1, mode);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1, mode);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1, mode);\n \n \/\/ lcd lead protector\n translate([top_lcd+1,0,top-3]) cube(size=[2, 12, 6], center=true); \n translate([top_lcd+1,0,top-5]) cube(size=[2, 16, 2], center=true); \n }\n \n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, mode); \n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, mode); \n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, mode); \n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, mode); \n}\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage(mode=2\/*simple*\/);\n translate ([33, -8, 79]) rotate([0, 0, 90]) esc();\n lcd();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\nmodule full() {\n car();\n arrangebottom(30) hsonar();\n\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\nfull();\n\n\n\/\/barbox([0,0,0], [0,0,50], 10, 3);\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\n\/\/translate([0,0,90]) rotate([180,0,0]) cage();\n","old_contents":"\/\/$fs = 0.1;\n\/\/$fa = 5;\n$fs = 0.25;\n$fa = 8;\n\nuse \n\nmodule wheel() {\n color(\"black\") rotate([90, 90, 0]) difference() {\n #cylinder(d=47, h=23, center=true);\n cylinder(d=30, h=26, center=true);\n }\n}\n\nmodule base() {\n\n \/\/ 4 wheels\n translate([77.5, 60, 47\/2]) wheel();\n translate([-77.5, 60, 47\/2]) wheel();\n translate([77.5, -60, 47\/2]) wheel();\n translate([-77.5, -60, 47\/2]) wheel();\n\n \/\/ front axe assemby - slightly longer\n translate([77.5-5, 0, 47\/2]) color(\"gray\") cube(size=[25, 103, 26], center=true);\n \/\/ rear axe assemby\n translate([-77.5, 0, 47\/2]) color(\"gray\") cube(size=[26, 97, 26], center=true);\n\n color(\"gray\") translate ([0, 0, 12]) {\n\n \/\/ base plate\n linear_extrude(height = 2) base_plate();\n linear_extrude(height = 7) difference() {\n base_plate();\n offset(-2) base_plate();\n }\n\n \/\/ shaft\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n \/\/shaft ribs\n translate ([14, 4, 23]) cube(size=[67, 2, 4], center=false);\n translate ([14, -6, 23]) cube(size=[67, 2, 4], center=false);\n translate ([0, 0, 23\/2]) cube(size=[158, 12, 23], center=true);\n translate ([-81, 4, 23]) cube(size=[45, 2, 6], center=false);\n translate ([-81, -6, 23]) cube(size=[45, 2, 6], center=false);\n \/\/ servo\n linear_extrude(height = 15) polygon([\n [29,0], [79,0],\n [79,-23], [70,-23],[49,-40],[29,-40]\n ]);\n\n \/\/ motor\n translate ([-79+30, -16, 23\/2+2]) rotate([0, 90, 0]) cylinder(d=23, h=32, center=false);\n\n \/\/ gear\n translate ([-79+23, 0, 34\/2]) rotate([0, 90, 0]) cylinder(d=34, h=6, center=false);\n\n \/\/ battery\n translate ([-5\/2, 30\/2+7, 16\/2+2]) cube(size=[84, 30, 16], center=true);\n\n \/\/ battery holder\n translate ([-79+23, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([79-29, 20, 0]) cylinder(d=7, h=26, center=false);\n translate ([-5\/2, 20, 22]) cube(size=[110, 13, 2], center=true);\n\n \/\/ front shocks\n translate ([162\/2, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[23,44],[18,48],[5,41],[-5,41],[-18,48],[-23,44], [-38,0],[38,0]]);\n\n \/\/ rear shocks\n translate ([-162\/2-16, 0, 0]) rotate([90, 0, 90]) linear_extrude(height = 16)\n polygon([[25,48],[20,48],[5,38],[-5,38],[-20,48],[-25,48], [-38,0],[38,0]]);\n }\n}\n\nmodule base_plate() {\n polygon([\n [-79,25], [-70,25],[-54,40],[49,40],[70,23], [79,23],\n [79,-23], [70,-23],[49,-40],[-54,-40],[-70,-25], [-79,-25]\n ]);\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\nmodule platform() {\n\n difference() {\n color(\"black\") translate ([0, 0, 12+32+4]) difference() {\n union() {\n #linear_extrude(height = 3) intersection() {\n difference() {\n offset(-10) offset(30) offset(-20)\n polygon([\n [-200,25], [-70,25],[-44,60],[34,60],[70,25], [200,25], \/\/ extra wide front\n [200,-25], [70,-25],[34,-60],[-44,-60],[-70,-25], [-200,-25]\n ]);\n\n\n \/\/ central hole\n translate ([-12.5, 0, 0])\n offset(-5) offset(10) offset(-5) difference() {\n\n polygon([\n \/\/ left\n [-45,-20], [-31,-37], \/\/ bevel [-45,-35],\n [ 32,-37], [ 45,-27], \/\/ bevel [45,-35],\n\n [48,-27], [48,27],\n\n \/\/ right\n [ 45, 27], [ 32, 37], \/\/ bevel [45,35],\n [-31, 37], [-45, 20] \/\/ bevel [-45,35]\n ]);\n\n \/\/translate ([-45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([-45, 35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, -35, 0]) circle(r=7.5, center=true);\n \/\/translate ([ 45, 35, 0]) circle(r=7.5, center=true);\n }\n\n\n\n }\n square(size=[162,120], center=true); \/\/ cut off extra length\n }\n\n\n intersection() { translate ([0, 0, 100]) cube(size=[200,200,200], center=true); union() {\n \/\/ shock tower mount points\n \/\/ rear\n #translate ([-81, -25, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n #translate ([-81, 25-7, 0]) {\n hull() {\n cube(size=[4, 7, 12-3.5], center=false);\n translate ([4\/2, 7-3.5, 12-3.5]) rotate([90, 0, 90]) cylinder(d=7, h=4, center=true);\n }\n translate ([8\/2, 7-3.5, 12-3.5-6]) rotate([90, 0, 90]) cylinder(d=6, h=8, center=true);\n }\n\n \/\/ front\n #translate ([81-6.5, -25, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n #translate ([81-6.5, 25-11, 0]) {\n cube(size=[6.5, 11, 4], center=false);\n translate ([6.5\/2, 5.5, 4]) rotate([90, 0, 90]) cylinder(d=11, h=6.5, center=true);\n }\n }}\n }\n\n \/\/ wire tie holes\n #translate ([-45, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-45, 45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, -45, 0]) cylinder(d=5, h=20, center=true);\n #translate ([-35, 45, 0]) cylinder(d=5, h=20, center=true);\n\n \/\/ esc power wires\n #hull() {\n translate ([48-12.5-5, 23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, 23, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ esc motor wires\n #hull() {\n translate ([48-12.5-5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n translate ([54-12.5, -23, 0]) cylinder(d=6, h=20, center=true);\n translate ([48-12.5, -23+4, 0]) cylinder(d=6, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([52, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([42, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([52, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ space save\n #hull() {\n translate ([-72, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, -10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-67, 10, 0]) cylinder(d=5, h=20, center=true);\n translate ([-72, 10, 0]) cylinder(d=5, h=20, center=true);\n }\n\n \/\/ board mount holes\n #translate ([-(45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([-(45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, (35-2.5), 2.5]) screw2x6bore();\n #translate ([ (45-2.5)-10, -(35-2.5), 2.5]) screw2x6bore();\n\n \/\/ mount holes\n \/\/ front\n \/\/ M3 hex nut in front H=2.4, Dmin = 5.4\n \/\/ left\n #translate ([81, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2, 42.5\/2-3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n \/\/ right\n #translate ([81,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([81-4-5\/2,-42.5\/2+3\/2, 8-2-3\/2]) rotate([90, 90, 90]) hexagon(5.6, 6);\n\n \/\/ rear\n \/\/ left\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n \/\/ right\n #translate ([-81,-46.5\/2+3\/2, 12-2-3\/2]) rotate([90, 0, 90]) cylinder(d=3, h=20, center=true);\n #translate ([-81, 46.5\/2-3\/2, 12-2-3\/2-6]) rotate([90, 0, 90]) cylinder(d=3, h=12, center=true);\n }\n #arrangebottom(30)\n {\n hbaseholes(center=true, right=1, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=0, left=1);\n hbaseholes(center=true, right=1, left=0);\n hbaseholes(center=true, right=1, left=0);\n }\n \/\/ cage holes\n #cage(cut=true);\n\n \/\/arrangebottom(45) hbaseholes();\n }\n}\n\nmodule board() {\n\n translate ([-12.5, 0, 47]) {\n \/\/ base\n color(\"yellow\") cube(size=[90, 70, 1.2], center=true);\n\n \/\/ teensy\n color(\"green\") translate ([-12, 0, 5]) cube(size=[63, 18, 10], center=true);\n\n \/\/ MPU-9250\n color(\"red\") translate ([-24, 21, 5]) cube(size=[18.5, 19, 10], center=true);\n\n \/\/ servo conn\n color(\"black\") translate ([27, -21, 1.5]) cube(size=[10, 7.5, 3], center=true);\n }\n}\n\n\nmodule esc() {\n color(\"green\") cube(size=[36, 26, 2], center=true);\n color(\"black\") translate ([36\/2, 0, 0]) rotate([0, 90, 0]) cylinder(d=8, h=16, center=false);\n\n \/\/ esc support box ?\n \/\/ hcolor(\"black\") translate ([0, 0, -11]) cube(size=[30, 20, 20], center=true);\n}\n\nmodule vsonar() {\n\n \/\/ vertical sonar\n translate ([0, -10, 45]) rotate([0, 90, 0]) hcsr04();\n\n \/\/ mount plate\n color(\"gray\") translate ([1.5, -10, -6]) cube(size=[3, 20, 51], center=false);\n color(\"gray\") translate ([-8.5, -10, -6]) cube(size=[10, 20, 5], center=false);\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 22.5]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule hbaseholes(center = true, left = 2, right = 2)\n{\n if (center) translate ([-5, 0, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (left >= 1) translate ([-5, 9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (left >= 2) translate ([-5, 19, -15]) cylinder(d=3.2, h=15, center=false);\n\n if (right >= 1) translate ([-5, -9.5, -15]) cylinder(d=3.2, h=15, center=false);\n if (right >= 2) translate ([-5, -19, -15]) cylinder(d=3.2, h=15, center=false);\n}\n\nmodule hmount() {\n \/\/ mount plate\n color (\"gray\") {\n\n \/\/ front\n difference() {\n translate ([1.5, -48\/2, -6]) #hull() {\n cube(size=[3, 48, 25], center=false);\n translate ([0, 48-3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n translate ([0, 3, 25]) rotate([90, 0, 90]) cylinder(r=3, h=3, center=false);\n }\n\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) {\n\n \/\/ sonar\n translate([45\/2-(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n translate([45\/2+(42-16)\/2,18\/2+1,1.3]) cylinder(d=17, h=15);\n\n \/\/xtal(s)\n hull () {\n translate([45\/2-3.25,20-3.5,1.3])\n {\n translate([0,0,0]) cylinder(d=6, h=5);\n translate([6.5,0,0]) cylinder(d=6, h=5);\n }\n translate([45\/2-3.25, 4,1.3]) hull()\n {\n \/\/translate([0,0,0]) cylinder(d=6, h=5);\n \/\/translate([6.5,0,0]) cylinder(d=6, h=5);\n translate([0,-2,0]) cylinder(d=6, h=5);\n translate([6.5,-2,0]) cylinder(d=6, h=5);\n }\n }\n\n \/\/ screws\n translate([ 1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n translate([45-1.0, 1.0, 4.5-0.5]) screw2x6bore();\n translate([ 1.0, 20-1.5, 4.5-0.5]) screw2x6bore();\n }\n\n translate ([3, 0, 10])\n cube(size=[5, 20, 11], center=true);\n }\n\n \/\/base\n difference() {\n #hull() {\n translate ([-3.5, -48\/2, -6]) cube(size=[5, 48, 5], center=false);\n translate ([-3.5, -48\/2+5, -6]) cylinder(r=5, h=5, center=false);\n translate ([-3.5, 48\/2-5, -6]) cylinder(r=5, h=5, center=false);\n }\n hbaseholes();\n }\n }\n}\n\nmodule screw2x6bore() {\n rotate([180, 0, 0]) {\n cylinder(d=2.2, h=6);\n translate ([0, 0, -1.3])\n cylinder(d1=2*3.6, d2=0, h=2*1.3);\n }\n}\n\nmodule hsonar() {\n\n \/\/ horizontal sonar\n translate ([0, -45\/2, 0]) rotate([90, 0, 90]) hcsr04();\n\n hmount();\n\n \/\/ sonar ray\n \/\/color(\"white\") translate ([20+1000\/2, 0, 10]) rotate([0, 90, 0]) cylinder(d1=40, d2=520,h=1000, center=true);\n}\n\nmodule barbox(p1, p2, s=1, r=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n o = s\/2-r;\n s1 = s-2*r;\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n translate([0, 0, l\/2]) {\n cube(size=[s1, s, l], center=true);\n cube(size=[s, s1, l], center=true);\n\n for (x=[o, -o]) \n for (y=[o, -o]) {\n translate([x,y,0]) cylinder(r=r, h=l, center=true);\n for (z=[l\/2, -l\/2]) {\n translate([x,y,z]) sphere(r=r, center=true);\n }\n }\n\n for (z=[l\/2, -l\/2]) {\n translate([0,0,z]) cube(size=[s1, s1, 2*r], center=true); \n\n translate([ 0, o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ 0,-o, z]) rotate([0,90,0]) cylinder(r=r, h=s1, center=true);\n translate([ o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n translate([-o, 0, z]) rotate([90,0,0]) cylinder(r=r, h=s1, center=true);\n }\n \n }\n}\n\nmodule bar(p1, p2, s=1) {\n \n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n l = norm(a);\n b = [a[0]\/l, a[1]\/l, a[2]\/l];\n \n c = cross([0,0,1], b);\n \n az = atan2(c[0], c[1]);\n ax = acos(b[2]);\n \n translate(p1) sphere(d=s, center=true);\n translate(p2) sphere(d=s, center=true);\n \n translate(p1) \n rotate([0, 0, -az]) \n rotate([0, ax, 0])\n cylinder(d=s, h=l, center=false);\n}\n\nmodule ball8(p1, s=1, r=1) {\n\n o = s\/2-r;\n \n translate(p1) \n for (x=[o, -o]) \n for (y=[o, -o])\n for (z=[o, -o]) \n translate([x,y,z])\n sphere(r=r, center=true);\n}\n\nmodule skew(p1, p2) { \/\/ TODO - not working\n\n a = [p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]];\n b = [a[0]\/a[2], a[1]\/a[2]];\n \n matrix = [\n [ 1, 0, b[1], 0 ],\n [ 0, 1, b[2], 0 ],\n [ 0, 0, 1, 0 ],\n [ 0, 0, 0, 1 ]\n ];\n\n translate(p1) \n multmatrix(matrix) \n children();\n}\n\nmodule cage_leg(p1, p2, d, db, r)\n{\n\/\/ bar(p1, p2, d); \n \n hull() {\n ball8(p2, d, r);\n translate([0, 0, -d\/2]) translate(p1) difference() {\n sphere(d=db, center=true);\n translate([0, 0, -db\/2]) cube(size=[db, db, db], center=true);\n }\n }\n}\n\nmodule cage_pin(p1, p2, d, pd, ph, cut)\n{\n if (cut)\n {\n bar(p1, p2, d+0.5); \n }\n else\n difference() {\n bar(p1, p2, d); \n \n translate ([0,0,-ph])\n translate (p1) \n rotate([90,0,0])\n cylinder(d=pd, h=2*d, center=true);\n } \n}\n\nmodule lcd_mount(p1, x1, x2)\n{\n translate(p1) difference() {\n #translate([(x1-x2)\/2,0,-1]) cube(size=[x1+x2, 6, 2], center=true);\n #cylinder(d=2.2, h=6, center=true);\n } \n}\n\nmodule cage(cut = false)\n{\n \n d = 4;\n r1 = 1;\n n = 4;\n db = 6;\n hb = d;\n pd = 1;\n ph = d\/2 + 3 \/*platform*\/+ 1\/*freespace*\/;\n\n \/\/ measurements \n top = 82;\n \n top_side = 30;\n \n top_front = 20;\n top_rear = -40;\n\n top_esc = top_front-26\/*esc size*\/+d;\n top_lcd = top_rear+27\/*lcd size*\/+d+1;\n \n bottom = 51\/*platform top*\/+d\/2;\n \n bottom_front = 27;\n bottom_rear = -50;\n\n bottom_front_side = 40;\n bottom_rear_side = 40;\n\n pin = 8;\n pin_base = bottom - pin;\n\n \/\/ points\n top_front_left = [top_front, top_side, top];\n top_front_right = [top_front, -top_side, top];\n\n top_esc_left = [top_esc, top_side, top];\n top_esc_right = [top_esc, -top_side, top];\n\n top_lcd_left = [top_lcd, top_side, top];\n top_lcd_right = [top_lcd, -top_side, top];\n\n top_rear_left = [top_rear, top_side, top];\n top_rear_right = [top_rear, -top_side, top];\n\n \/\/mid_front_left = [(top_front+bottom_front)\/2, (top_side+bottom_front_side)\/2, (top+bottom)\/2];\n \/\/mid_front_right = [mid_front_left[0], -mid_front_left[1], mid_front_left[2]];\n\n bottom_front_left = [bottom_front, bottom_front_side, bottom];\n bottom_front_right = [bottom_front, -bottom_front_side, bottom];\n\n bottom_rear_left = [bottom_rear, bottom_rear_side, bottom];\n bottom_rear_right = [bottom_rear, -bottom_rear_side, bottom];\n\n pin_front_left = [bottom_front, bottom_front_side, pin_base];\n pin_front_right = [bottom_front, -bottom_front_side, pin_base];\n\n pin_rear_left = [bottom_rear, bottom_rear_side, pin_base];\n pin_rear_right = [bottom_rear, -bottom_rear_side, pin_base];\n \n \/\/ bars\n if (!cut)\n {\n barbox(top_front_left, top_front_right, d, r1); \n barbox(top_rear_left, top_rear_right, d, r1); \n barbox(top_front_left, top_rear_left, d, r1); \n barbox(top_front_right, top_rear_right, d, r1); \n\n barbox(top_esc_left, top_esc_right, d, r1); \n barbox(top_lcd_left, top_lcd_right, d, r1);\n \n lcd_mount([top_rear+d\/2+2.5+23+0.5, 23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5+23+0.5, -23.5\/2, top+d\/2], 4, 2);\n lcd_mount([top_rear+d\/2+2.5-0.5, 23.5\/2, top+d\/2], 2, 4);\n lcd_mount([top_rear+d\/2+2.5-0.5, -23.5\/2, top+d\/2], 2, 4);\n\n \/\/bar(mid_front_left, mid_front_right, d); \/\/ unprintable\n\n cage_leg(bottom_front_left, top_front_left, d, db, r1);\n cage_leg(bottom_front_right, top_front_right, d, db, r1);\n cage_leg(bottom_rear_left, top_rear_left, d, db, r1);\n cage_leg(bottom_rear_right, top_rear_right, d, db, r1);\n }\n \n cage_pin(bottom_front_left, pin_front_left, d, pd, ph, cut); \n cage_pin(bottom_front_right, pin_front_right, d, pd, ph, cut); \n cage_pin(bottom_rear_left, pin_rear_left, d, pd, ph, cut); \n cage_pin(bottom_rear_right, pin_rear_right, d, pd, ph, cut); \n}\n\nmodule car()\n{\n base();\n platform();\n board();\n color(\"white\") cage();\n\n translate ([9, -8, 79]) rotate([0, 0, 90]) esc();\n}\n\nmodule arrangebottom(a) {\n translate ([68, 0, 57]) if ($children == 1) children(); else children(0);\n\n translate ([45, 42, 57]) rotate([0, 0, a]) if ($children == 1) children(); else children(1);\n translate ([-5, 45, 57]) rotate([0, 0, 2*a]) if ($children == 1) children(); else children(2);\n\n translate ([45, -42, 57]) rotate([0, 0, -a]) if ($children == 1) children(); else children(3);\n translate ([-5, -45, 57]) rotate([0, 0, -2*a]) if ($children == 1) children(); else children(4);\n}\n\nmodule lcd1602() {\ntranslate([-15,0,78]) difference() {\n union() {\n translate([0,0,5+8\/2]) color(\"blue\") cube(size=[27, 72, 8], center=true);\n translate([0,0,4+1\/2]) color(\"green\") cube(size=[36, 80, 1], center=true);\n }\n translate([ 31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2, 75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([ 31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n translate([-31\/2,-75\/2,0]) cylinder(d=2.5, h=20, center=false);\n}\n}\n\nmodule lcd() {\n color(\"blue\") translate([-40+2+27.5\/2+0.5,0,81]) cube(size=[27.5, 27.5, 2], center=true);\n}\n\nmodule fullb() {\n car();\n arrangebottom(30) hsonar();\n cage();\n lcd();\n}\n\n\/\/car();\n\n\/\/cage();\n\n\n\/\/board();\n\/\/platform();\n\n\/\/fullb();\n\n\n\/\/barbox([0,0,0], [0,0,50], 10, 3);\n\n\/\/translate ([0, 0, 4.5]) rotate([0, 90, 0]) hmount();\n\n\n\/* \/\/ small front\nintersection() {\n platform();\n translate ([80, -15, 0]) cube(size=[40, 35, 400], center=true);\n}*\/\n\n\/* \/\/ full front\nintersection() {\n platform();\n #translate ([100+20, 0, 0]) cube(size=[200, 200, 400], center=true);\n}*\/\n\n\/* \/\/ rear\nintersection() {\n platform();\n translate ([-80, 0, 0]) cube(size=[20, 200, 400], center=true);\n}*\/\n\n\/\/screw2x6bore();\n\n\/\/rotate([0,0,180]) projection(cut=true) translate ([0, 0, -49]) platform();\n\/\/projection() translate ([0, 0, 10]) hsonar();\n\ntranslate([0,0,90]) rotate([180,0,0]) cage();\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"2b919b8dbaf4acd789c36701cf287e678ece6d8d","subject":"Fix bug in bin size, add untested locating holes.","message":"Fix bug in bin size, add untested locating holes.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"yellow-bins\/bin.scad","new_file":"yellow-bins\/bin.scad","new_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO I'm not sure this works, maybe because of poylgon circles?\ngExtWidth = 0.45;\n\n\/\/ TODO test print for HF, Stanley sizes\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\n\ngPegHole = 2.5;\ngPegHead = 6;\ngPegCircle = 18; \/\/ measure hole in base, and subtract 1mm for intentional slop\ngPegDepth = 8;\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([w\/2-r,h\/2-r]) circle(r=r);\n}\nmodule Corner(r,e=1) {\n translate([-r,-r]) difference() {\n square([r+e,r+e]);\n circle(r=r,$fn=128);\n }\n}\nmodule Ess(w,h,r) {\n difference() {\n square([w,h]);\n \/\/ cut corner\n translate([w,h]) Corner(r);\n }\n \/\/ add corners\n translate([w,0]) rotate([0,0,180]) Corner(r,0);\n translate([0,h]) rotate([0,0,180]) Corner(r,0);\n}\n\nmodule Fillet(a, r) {\n intersection() {\n difference() {\n hull() {\n translate([-a,a]) circle(r=a);\n translate([a,-a]) circle(r=a);\n }\n hull() {\n translate([a,r]) circle(r=r);\n translate([r,a]) circle(r=r);\n }\n }\n square([a,a]);\n }\n}\n\nmodule Bin(x=1,y=1,wall=gExtWidth*3,feet=true,cutaway=false) {\n inside_wall_w = (x*gGridX)-(wall*2)-gTopSlop;\n inside_wall_h = (y*gGridY)-(wall*2)-gTopSlop;\n difference() {\n union() {\n linear_extrude(height=gHeight,convexity=4) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=128);\n RoundRect(inside_wall_w,inside_wall_h,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=2)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n if(feet) {\n linear_extrude(height=gPegDepth+2,convexity=4)\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([-inside_wall_w\/2,-inside_wall_h\/2]) Fillet(10, 3, $fn=32);\n \/\/Ess(6,6,3);\n }\n }\n if(feet) {\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(x*gGridX-gTopSlop)\/2,(y*gGridY-gTopSlop)\/2,-1])\n rotate([0,0,180+45]) translate([(gPegCircle-gPegHead)\/2,0])\n cylinder(d=gPegHole,h=gPegDepth+1,$fn=32);\n }\n if(cutaway) {\n translate([-inside_wall_w\/2,-inside_wall_h\/2,-1])\n rotate([0,0,-45]) translate([0,-1,0]) cube([12,12,20]);\n }\n }\n}\n\nBin(4,1);\n","old_contents":"\/* Note that the factory bins have draft which make them injection moldable; we\n * don't need that. *\/\n\n\/* The little circles that the legs fit into to keep the bins from moving around *\/\ngLegCircleSize = 18;\n\n\/* Most of the bins have X in this orientation. *\/\ngGridX = 40;\ngGridY = 55;\n\n\/* So the bins don't fit *too* tightly together *\/\ngTopSlop = 0.6;\n\/\/ TODO I'm not sure this works, maybe because of poylgon circles?\ngExtWidth = 0.45;\n\n\/\/gHeight=47.8; \/\/ for HF\ngHeight=40.9; \/\/ for Stanley\n\nmodule RoundRect(w,h,r=1) {\n hull()\n for(x_scale=[1,-1]) for(y_scale=[1,-1])\n scale([x_scale,y_scale])\n translate([(w-r)\/2,(h-r)\/2]) circle(r=r);\n}\n\n\/\/ TODO h for HF\n\/\/ TODO locating feet, maybe a really short screw?\n\/\/ TODO bottom inside rounding\nmodule Bin(x=1,y=1,wall=gExtWidth*3) {\n linear_extrude(height=gHeight) difference() {\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n RoundRect((x*gGridX)-(wall*2)-gTopSlop,(y*gGridY)-(wall*2)-gTopSlop,3-wall,$fn=32);\n }\n \/\/ Floor\n linear_extrude(height=2)\n RoundRect(x*gGridX-gTopSlop,y*gGridY-gTopSlop,3,$fn=32);\n}\n\nBin(4,1);\n\n\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"93fa7a896ac4d2381c0982cccd86d22c40e6044a","subject":"Grey->Gray for better compatibility with a translator.","message":"Grey->Gray for better compatibility with a translator.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/box\/box_structure.scad","new_file":"designs\/box\/box_structure.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.5;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.3mm for just a smidge more...\n \/\/ * 2016-06-17: 3.3 is *still* too tight in a few connections!\n \/\/ Most are fine, but we need to handle the variability\n \/\/ in material thickness, so...\n \/\/ 3.5mm. (Final?)\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 195 + thickness; \/\/ z = 19.5cm to accomodate 16cm tank height plus wires for shock\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ height of insert for rear tank support\ninsert_height = height\/6;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover(spacing=1);\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n} else if (DXF_REAR_SUPPORT) {\n projection() rotate(a=[90,0,0]) rear_support(1);\n translate([overhang*3,0,0])\n projection() rotate(a=[90,0,0]) rear_support(2);\n translate([overhang*6,0,0])\n projection() rotate(a=[90,0,0]) rear_support(3);\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n rear_support();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x, tab_extra=0) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ bottom opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ top openings for wires (electrical stim)\n translate([0, depth-15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n translate([0, 15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2], extra=tab_extra);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n translate([thickness+epsilon,0,-insert_height\/2])\n rear_support();\n wire_opening();\n power_jack_cutout();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n if (center) {\n rounded_rect_centered(x,y,z, radius);\n }\n else {\n translate([x\/2, y\/2, z\/2])\n rounded_rect_centered(x,y,z, radius);\n }\n}\n \nmodule rounded_rect_centered(x,y,z, radius) {\n difference() {\n cube([x,y,z], center=true);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover(spacing=0) {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Gray\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n \/\/ spacing added to make separate pieces for laser cutting\n translate([spacing,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc, tab_extra=5);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Gray\", alpha=0.5)\n tank_support_layer2();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans, extra=0) {\n \/\/ \"extra\" is *removed* from width of cubes\n \/\/ so that resulting tabs (after differencing this) are *wider*\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w + extra\/2, -thickness\/2, -thickness\/2])\n cube([w-extra, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule power_jack_cutout() {\n translate([width, depth-40, overhang+30])\n rotate(a=[0,90,0])\n cylinder(d=8, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule rear_support(num_high=1) {\n support_height = num_high*height;\n ypos = depth\/2-thickness\/2;\n color(\"Orange\")\n translate([width+thickness\/2, ypos, 0])\n union() {\n \/\/ entering-tank part\n translate([-overhang, 0, insert_height\/2+overhang])\n difference() {\n rounded_rect(overhang*2, thickness, insert_height, radius=overhang\/2);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n cube([thickness, thickness*2, height]);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n difference() {\n translate([0,0,overhang*0.8])\n cube([thickness+overhang, thickness*2, height]);\n translate([overhang+thickness, 0, overhang*0.8])\n rotate(a=[90,0,0])\n cylinder(d=overhang*2, h=100, center=true);\n }\n }\n \/\/ connect and fill in one of the rounded corners\n cube([overhang, thickness, insert_height\/2+overhang+overhang]);\n \/\/ below-tank part\n translate([0, 0, -support_height])\n cube([overhang, thickness, support_height]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.5;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.3mm for just a smidge more...\n \/\/ * 2016-06-17: 3.3 is *still* too tight in a few connections!\n \/\/ Most are fine, but we need to handle the variability\n \/\/ in material thickness, so...\n \/\/ 3.5mm. (Final?)\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 195 + thickness; \/\/ z = 19.5cm to accomodate 16cm tank height plus wires for shock\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ height of insert for rear tank support\ninsert_height = height\/6;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover(spacing=1);\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n} else if (DXF_REAR_SUPPORT) {\n projection() rotate(a=[90,0,0]) rear_support(1);\n translate([overhang*3,0,0])\n projection() rotate(a=[90,0,0]) rear_support(2);\n translate([overhang*6,0,0])\n projection() rotate(a=[90,0,0]) rear_support(3);\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n rear_support();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x, tab_extra=0) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ bottom opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ top openings for wires (electrical stim)\n translate([0, depth-15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n translate([0, 15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2], extra=tab_extra);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n translate([thickness+epsilon,0,-insert_height\/2])\n rear_support();\n wire_opening();\n power_jack_cutout();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n if (center) {\n rounded_rect_centered(x,y,z, radius);\n }\n else {\n translate([x\/2, y\/2, z\/2])\n rounded_rect_centered(x,y,z, radius);\n }\n}\n \nmodule rounded_rect_centered(x,y,z, radius) {\n difference() {\n cube([x,y,z], center=true);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover(spacing=0) {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Grey\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n \/\/ spacing added to make separate pieces for laser cutting\n translate([spacing,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc, tab_extra=5);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans, extra=0) {\n \/\/ \"extra\" is *removed* from width of cubes\n \/\/ so that resulting tabs (after differencing this) are *wider*\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w + extra\/2, -thickness\/2, -thickness\/2])\n cube([w-extra, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule power_jack_cutout() {\n translate([width, depth-40, overhang+30])\n rotate(a=[0,90,0])\n cylinder(d=8, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule rear_support(num_high=1) {\n support_height = num_high*height;\n ypos = depth\/2-thickness\/2;\n color(\"Orange\")\n translate([width+thickness\/2, ypos, 0])\n union() {\n \/\/ entering-tank part\n translate([-overhang, 0, insert_height\/2+overhang])\n difference() {\n rounded_rect(overhang*2, thickness, insert_height, radius=overhang\/2);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n cube([thickness, thickness*2, height]);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n difference() {\n translate([0,0,overhang*0.8])\n cube([thickness+overhang, thickness*2, height]);\n translate([overhang+thickness, 0, overhang*0.8])\n rotate(a=[90,0,0])\n cylinder(d=overhang*2, h=100, center=true);\n }\n }\n \/\/ connect and fill in one of the rounded corners\n cube([overhang, thickness, insert_height\/2+overhang+overhang]);\n \/\/ below-tank part\n translate([0, 0, -support_height])\n cube([overhang, thickness, support_height]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"51bdf7e5b8c80ad64ea4dcee678a77d756b51aeb","subject":"more modeling work","message":"more modeling work\n","repos":"hunterowens\/digifab_project,hunterowens\/digifab_project","old_file":"reporter\/SensorMount.scad","new_file":"reporter\/SensorMount.scad","new_contents":"difference(){\n\tcylinder(h = 30, r=70);\n\ttranslate([0,-70,0])cube(size = [70,140,70]);\n\trotate([0,0,30])translate([-11.75,0,3])cube(size = [23.5,70,20.5]);\n\trotate([0,0,70])translate([-11.75,0,3])cube(size = [23.5,70,20.5]);\n\trotate([0,0,110])translate([-11.75,0,3])cube(size = [23.5,70,20.5]);\n\trotate([0,0,150])translate([-11.75,0,3])cube(size = [23.5,70,20.5]);\n}\n\n","old_contents":"difference(){\n\tcylinder(h = 30, r=70);\n\ttranslate([0,-30,0])cube(size = [40,60,30]);\n\trotate([0,0,0])translate([-11.75,0,3])cube(size = [23.5,35,20.5]);\n\trotate([0,0,70])translate([-11.75,0,3])cube(size = [23.5,35,20.5]);\n\trotate([0,0,110])translate([-11.75,0,3])cube(size = [23.5,35,20.5]);\n\trotate([0,0,150])translate([-11.75,0,3])cube(size = [23.5,35,20.5]);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"660d5a65ac6245e1300f79cea98514f1addf3163","subject":"Added comment","message":"Added comment\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/nut-drive\/nut-housings.scad","new_file":"openscad\/nut-drive\/nut-housings.scad","new_contents":"\/\/ Housings to hold hexagonal nut for a \"nut drive\": two nuts with\n\/\/ reverse threads on a threaded rod.\n\/\/ All dimensions in mm.\nuse <..\/common\/extrusions.scad>\nEPSILON = 0.01;\nLARGE = 100;\n\nfunction poly_coords(order, r=1) = \n let(angles=[ for (i = [0:order-1]) i*(360\/order) ])\n \t[ for (th=angles) [r*cos(th), r*sin(th)] ];\n\n \n module regular_polygon(order, r=1){\n \tpolygon(poly_coords(order, r));\n }\n\n\nblock_w = 30; \/\/ Width of block - it's a (rounded) square block\nblock_ro = 3; \/\/ outer radii of rounded block\nscrew_hole_r = 2.05; \/\/ For 3\/32 (imperial) screws\nholes_major_r = (block_w - screw_hole_r)\/2; \/\/ Radius of circle that defines\n \/\/ location of screw holes around center\nend_h = 3;\n\/\/ A rounded square block that fits within {w}x{w} and centered on the origin.\n\/\/ {r} is the rounding radius.\nmodule block2d(w, r) {\n offset(r = r) square([w-2*r, w-2*r], center=true);\n}\n\n\n\/\/ A set of 4 holes positioned on a circle of radius {major_r}.\n\/\/ Each hole has radius {r}\nmodule holes2d(major_r, r) {\n hole_centers = poly_coords(4, major_r);\n rotate([0, 0, 45]) for (i = [0:3]) {\n translate(hole_centers[i]) \n circle(r);\n }\n}\n\n\/\/ The center piece of the nut block. This holds the hex nut \n\/\/ of dia {hex_dia} and height (thickness of nut) {h}.\n\/\/ Center is the origin. {hex_dia} is the distance between opposite *corners*\n\/\/ of the hexagon.\nmodule center_piece(hex_dia, h) {\n linear_extrude(height = h) {\n difference() {\n block2d(block_w, block_ro);\n regular_polygon(6, hex_dia\/2);\n holes2d(holes_major_r, screw_hole_r);\n }\n }\n}\n\n\/\/ Creates an end piece, which matches the center_piece, but with\n\/\/ an additional rounded triangular piece to hold an anchor screw.\nmodule end_piece() {\n linear_extrude(height = end_h) {\n center_hole_r = 5;\n anchor_offset = 5; \/\/ from top of block\n anchor_hole_r = screw_hole_r;\n anchor_wall = 5; \/\/ min wall surrounding anchor - this needs to be enough to\n \/\/ take half of the total load on the anchor\n anchor_center = [0, block_w\/2 + anchor_offset];\n difference() {\n \/\/linear_extrude(height = block_h + 2*EPSILON) \n hull() {\n block2d(block_w, block_ro);\n translate(anchor_center)\n circle(anchor_wall + anchor_hole_r);\n }\n holes2d(holes_major_r, screw_hole_r);\n circle(center_hole_r);\n translate(anchor_center)\n circle(anchor_hole_r);\n \n }\n }\n}\n\n\n$fn = 50;\n\n\/\/ Brass right-handed-thread (RHT) nut dimensions:\n\/\/ side 14.12 (measured) == corner 16.304 \n\/\/ (using https:\/\/rechneronline.de\/pi\/hexagon.php)\n\/\/ nut thickness (measured): 8.52\nRHT_hex_dia = 16.304 + 0.4; \/\/ 0.4 for clearance\ncenter_h = 8.52 + 0.4; \/\/ 0.4 for clearance\n\n\/\/ Steel left-hand-thread (LHT) nut dimensions:\n\/\/ side: 14.17 measured) == corner 16.362 \n\/\/ nut thickness: 8.4\ncenter_piece(RHT_hex_dia, center_h);\ntranslate([block_w + 10, 0, 0]) end_piece();\n\/\/ translate([0, block_w + 10, 0]) end_piece();","old_contents":"\/\/ Housings to hold hexagonal nut for a \"nut drive\": two nuts with\n\/\/ reverse threads on a threaded rod.\n\/\/ All dimensions in mm.\nuse <..\/common\/extrusions.scad>\nEPSILON = 0.01;\nLARGE = 100;\n\nfunction poly_coords(order, r=1) = \n let(angles=[ for (i = [0:order-1]) i*(360\/order) ])\n \t[ for (th=angles) [r*cos(th), r*sin(th)] ];\n\n \n module regular_polygon(order, r=1){\n \tpolygon(poly_coords(order, r));\n }\n\n\nblock_w = 30; \/\/ Width of block - it's a (rounded) square block\nblock_ro = 3; \/\/ outer radii of rounded block\nscrew_hole_r = 2.05; \/\/ For 3\/32 (imperial) screws\nholes_major_r = (block_w - screw_hole_r)\/2; \/\/ Radius of circle that defines\n \/\/ location of screw holes around center\nend_h = 3;\n\/\/ A rounded square block that fits within {w}x{w} and centered on the origin.\n\/\/ {r} is the rounding radius.\nmodule block2d(w, r) {\n offset(r = r) square([w-2*r, w-2*r], center=true);\n}\n\n\n\/\/ A set of 4 holes positioned on a circle of radius {major_r}.\n\/\/ Each hole has radius {r}\nmodule holes2d(major_r, r) {\n hole_centers = poly_coords(4, major_r);\n rotate([0, 0, 45]) for (i = [0:3]) {\n translate(hole_centers[i]) \n circle(r);\n }\n}\n\n\/\/ The center piece of the nut block. This holds the hex nut \n\/\/ of dia {hex_dia} and height (thickness of nut) {h}.\n\/\/ Center is the origin. {hex_dia} is the distance between opposite *corners*\n\/\/ of the hexagon.\nmodule center_piece(hex_dia, h) {\n linear_extrude(height = h) {\n difference() {\n block2d(block_w, block_ro);\n regular_polygon(6, hex_dia\/2);\n holes2d(holes_major_r, screw_hole_r);\n }\n }\n}\n\n\/\/ Creates an end piece, which matches the center_piece, but with\n\/\/ an additional rounded triangular piece to hold an anchor screw.\nmodule end_piece() {\n linear_extrude(height = end_h) {\n center_hole_r = 5;\n anchor_offset = 5; \/\/ from top of block\n anchor_hole_r = screw_hole_r;\n anchor_wall = 5; \/\/ min wall surrounding anchor - this needs to be enough to\n \/\/ take half of the total load on the anchor\n anchor_center = [0, block_w\/2 + anchor_offset];\n difference() {\n \/\/linear_extrude(height = block_h + 2*EPSILON) \n hull() {\n block2d(block_w, block_ro);\n translate(anchor_center)\n circle(anchor_wall + anchor_hole_r);\n }\n holes2d(holes_major_r, screw_hole_r);\n circle(center_hole_r);\n translate(anchor_center)\n circle(anchor_hole_r);\n \n }\n }\n}\n\n\n$fn = 50;\n\n\/\/ Brass right-handed-thread (RHT) nut dimensions:\n\/\/ side 14.12 (measured) == corner 16.304 \n\/\/ (using https:\/\/rechneronline.de\/pi\/hexagon.php)\n\/\/ nut thickness (measured): 8.52\nRHT_hex_dia = 16.304 + 0.4; \/\/ 0.4 for clearance\ncenter_h = 8.52 + 0.4; \/\/ 0.4 for clearance\n\ncenter_piece(RHT_hex_dia, center_h);\ntranslate([block_w + 10, 0, 0]) end_piece();\ntranslate([0, block_w + 10, 0]) end_piece();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"029d37e98a3f422332e36b45572c3d975870c417","subject":"main: use bearing orient param","message":"main: use bearing orient param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = -225\/2*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n xcarriage_padding=10;\n xcarriage_width = xaxis_bearing[2]*2 + xaxis_bearing_dist + xcarriage_padding;\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n cubea([xcarriage_width, 5, xaxis_rod_distance+xaxis_bearing[1]+xcarriage_padding], align=[0,-1,0]);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2, 10, -17], [0,0,0]], extruder_conn_xcarriage)\n \/*#cubea([10,10,10]);*\/\n extruder();\n\n \/\/ x carriage bearings\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,(xaxis_rod_distance\/2)])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, -(xaxis_rod_distance\/2)])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\naxis_pos_x = -225\/2*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n translate([axis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n xcarriage_padding=10;\n xcarriage_width = xaxis_bearing[2]*2 + xaxis_bearing_dist + xcarriage_padding;\n \/\/ x carriage\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,-xaxis_bearing[1]\/2,0])\n cubea([xcarriage_width, 5, xaxis_rod_distance+xaxis_bearing[1]+xcarriage_padding], align=[0,-1,0]);\n\n attach([[-motor_offset_x-motorWidth(extruder_motor)\/2, 10, -17], [0,0,0]], extruder_conn_xcarriage)\n \/*#cubea([10,10,10]);*\/\n extruder();\n\n \/\/ x carriage bearings\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n\n translate([0, xaxis_zaxis_distance_y, -(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n translate([0,j*(yaxis_rod_distance\/2),0])\n rotate([90,0,0])\n bearing(yaxis_bearing);\n }\n\n translate([0,0,yaxis_bearing[1]\/2])\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n translate([0,0,zaxis_motor_offset_z])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n }\n\n\n translate([i*zmotor_mount_motor_offset, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"878a2d0f7c15512a802565bbc70f3b415f191c02","subject":"Add module `section` to shape utils","message":"Add module `section` to shape utils\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/utils\/moreShapes.scad","new_file":"hardware\/utils\/moreShapes.scad","new_contents":"\/\/ moreShapes library\n\/\/ 2D and 3D utility shape functions\n\n\/\/ some borrowed from nophead \/ Mendel90 utils.scad\n\n\/\/ fudge\neta = 0.01;\n\n\nmodule line(start, end, r) {\n\thull() {\n\t\ttranslate(start) sphere(r=r);\n\t\ttranslate(end) sphere(r=r);\n\t}\n}\n\nmodule roundedSquare(size, radius, center=false, shell=0) {\n x = size[0];\n\ty = size[1];\n\n\ttranslate([center?-x\/2:0, center?-y\/2:0, 0])\n\tdifference() {\n\t\thull() {\n\t\t\ttranslate([radius, radius, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius, radius, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\n\t\tif (shell > 0) {\n\t\t\thull() {\n\t\t\ttranslate([radius + shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius - shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius - shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([radius + shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t}\n\t}\n}\n\nmodule roundedRect(size, radius, center=false, shell=0) {\n\tz = size[2];\n\n\ttranslate([0, 0, center?-z\/2:0])\n\t linear_extrude(height=z)\n\t roundedSquare(size=size, radius=radius, center=center, shell=shell);\n}\n\nmodule roundedRectX(size, radius, center=false, shell=0) {\n\t\/\/ X-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([0,90,0]) roundedRect([size[2],size[1],size[0]], radius, center, shell);\n}\n\nmodule roundedRectY(size, radius, center=false, shell=0) {\n\t\/\/ Y-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([-90,0,0]) roundedRect([size[0],size[2],size[1]], radius, center, shell);\n}\n\nmodule allRoundedRect(size, radius, center=false) {\n\t\/\/ lazy implementation - must do better\n\t\/\/ runs VERY slow\n\ttranslate([center?-size[0]\/2:0, center?-size[1]\/2:0, center?-size[2]\/2:0])\n\thull() {\n\t\tfor (x=[0,size[0]], y=[0,size[1]], z=[0,size[2]]) {\n\t\t\ttranslate([x,y,z]) sphere(r=radius);\n\t\t}\n\t}\n}\n\nmodule chamferedSquare(size, chamfer, center=false) {\n\thull() {\n\t\ttranslate([0,center?0:chamfer,0])\n\t\t\tsquare([size[0],size[1]-2*chamfer],center);\n\n\t\ttranslate([center?0:chamfer,0,0])\n\t\t\tsquare([size[0]-2*chamfer,size[1]],center);\n\t}\n}\n\nmodule chamferedCube(size, chamfer, center=false) {\n\ttranslate([0,0, center ? -size[2]\/2 : 0])\n\t\tlinear_extrude(size[2])\n\t\tchamferedSquare(size, chamfer, center=center);\n}\n\n\/\/ show cross section along axis (x)\nmodule section()\n{\n \/\/ TODO: optionally pass in vector and size\n size=1000;\n difference() {\n children();\n\n color(\"white\")\n translate([0, -size\/2, 0])\n cube(size, center=true);\n }\n}\n\n\n\/\/ Extended rotational extrude, allows control of start\/end angle\n\n\/\/ Child 2D shape is used for the rotational extrusion\n\/\/ Child 2D shape should lie in xy plane, centred on z axis\n\/\/ Child y axis will be aligned to z axis in the extrusion\n\n\/\/ NB: Internal render command is necessary to correclty display\n\/\/ complex child objects (e.g. differences)\n\n\/\/ r = Radius of rotational extrusion\n\/\/ childH = height of child object (approx)\n\/\/ childW = width of child object (approx)\n\n\/\/ Example usage:\n\n\/\/ rotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\/\/\t\t\tdifference() {\n\/\/\t\t\t\tsquare([20,20],center=true);\n\/\/\t\t\t\ttranslate([10,0,0]) circle(5);\n\/\/\t\t\t}\n\/\/\t\t}\n\nmodule rotate_extrude_ext(r, childW, childH, convexity) {\n\tor = (r + childW\/2) * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n\t\trender()\n intersection() {\n\t\t\trotate_extrude(convexity=convexity) translate([r,0,0]) children(0);\n\n\t\t\ttranslate([0,0,-childH\/2 - 1])\n\t\t\tlinear_extrude(height=childH+2)\n \t\tpolygon([\n\t\t [0,0],\n\t\t [or * cos(a0), or * sin(a0)],\n\t\t [or * cos(a1), or * sin(a1)],\n\t\t [or * cos(a2), or * sin(a2)],\n\t\t [or * cos(a3), or * sin(a3)],\n\t\t [or * cos(a4), or * sin(a4)],\n\t\t [0,0]\n\t\t ]);\n }\n}\n\n\n\nmodule torusSlice(r1, r2, start_angle, end_angle, convexity=10, r3=0, $fn=64) {\n\tdifference() {\n\t\trotate_extrude_ext(r=r1, childH=2*r2, childW=2*r2, start_angle=start_angle, end_angle=end_angle, convexity=convexity) difference() circle(r2, $fn=$fn\/4);\n\n\t\trotate_extrude(convexity) translate([r1,0,0]) circle(r3, $fn=$fn\/4);\n\t}\n}\n\nmodule torus(r1, r2, $fn=64) {\n\trotate_extrude()\n\t\ttranslate([r1,0,0])\n\t\tcircle(r2, $fn=$fn\/4);\n}\n\n\nmodule trapezoid(a,b,h,aOffset=0,center=false) {\n\t\/\/ lies in x\/y plane\n\t\/\/ edges a,b are parallel to x axis\n\t\/\/ h is in direction of y axis\n\t\/\/ b is anchored at origin, extends along positive x axis\n\t\/\/ a is offset along y by h, extends along positive x axis\n\t\/\/ a if offset along x axis, from y axis, by aOffset\n\t\/\/ centering is relative to edge b\n\n\ttranslate([center?-b\/2:0, center?-h\/2:0, 0])\n\tpolygon(points=[\t[0,0],\n\t\t\t\t\t[aOffset,h],\n\t\t\t\t\t[aOffset + a, h],\n\t\t\t\t\t[b,0]]);\n}\n\nmodule trapezoidPrism(a,b,h,aOffset,height,center=false) {\n\ttranslate([0,0, center?-height\/2:0]) linear_extrude(height=height) trapezoid(a,b,h,aOffset,center);\n}\n\n\nmodule arrangeShapesOnAxis(axis=[1,0,0], spacing=50) {\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([spacing * axis[0] *i,\n\t\t\t\t\tspacing * axis[1]*i,\n\t\t\t\t\tspacing * axis[2]*i]) children(i);\n\t}\n}\n\nmodule arrangeShapesOnGrid(xSpacing=50, ySpacing=50, cols=3, showLocalAxes=false) {\n\t\/\/ layout is cols, rows\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([(i - floor(i \/ cols)*cols) * xSpacing, floor(i \/ cols) * ySpacing, 0]) {\n\t\t\tchildren(i);\n\n\t\t\tif (showLocalAxes) {\n\t\t\t\tcolor(\"red\") line([0,0,0], [xSpacing\/2,0,0], 0.2);\n\t\t\t\tcolor(\"green\") line([0,0,0], [0, ySpacing\/2,0], 0.2);\n\t\t\t\tcolor(\"blue\") line([0,0,0], [0, 0,xSpacing], 0.2);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule slot(h, r, l, center = true)\n linear_extrude(height = h, convexity = 6, center = center)\n hull() {\n translate([l\/2,0,0])\n circle(r = r, center = true);\n translate([-l\/2,0,0])\n circle(r = r, center = true);\n }\n\n\n\nmodule fillet(r, h) {\n\t\/\/ ready to be unioned onto another part, eta fudge included\n\t\/\/ extends along x, y, z\n\n translate([r \/ 2, r \/ 2, 0])\n difference() {\n cube([r + eta, r + eta, h], center = true);\n translate([r\/2, r\/2, 0])\n cylinder(r = r, h = h + 1, center = true);\n }\n}\n\nmodule right_triangle_2d(width,height,center=true) {\n polygon(points = [[0,0], [width, 0], [0, height]]);\n}\n\nmodule right_triangle(width, height, h, center = true) {\n linear_extrude(height = h, center = center)\n right_triangle_2d(width,height,center=center);\n}\n\nmodule roundedRightTriangle(width, height, h, r=[1,1,1], center = true, $fn=12) {\n linear_extrude(height = h, center = center)\n \thull() {\n \ttranslate([r[0],r[0],0]) circle(r[0]);\n \ttranslate([width-r[1],r[1],0]) circle(r[1]);\n \ttranslate([r[2],height-r[2],0]) circle(r[2]);\n }\n}\n\n\nmodule rounded_square(w, h, r, center=true)\n{\n\t\/\/ 2D\n union() {\n translate([center?0:r,0,0])\n \tsquare([w - 2 * r, h], center=center);\n translate([0,center?0:r,0])\n \tsquare([w, h - 2 * r], center=center);\n for(x = [(center?-w\/2:0) + r, (center?w\/2:w) - r])\n for(y = [(center?-h\/2:0) + r, (center?h\/2:h) - r])\n translate([x, y])\n circle(r = r);\n }\n}\n\n\/\/\n\/\/ Cylinder with rounded ends\n\/\/\nmodule rounded_cylinder(r, h, r2, roundBothEnds=false)\n{\n rotate_extrude()\n union() {\n square([r - r2, h]);\n translate([0,roundBothEnds?r2:0,0]) square([r, roundBothEnds? h-2*r2 : h - r2]);\n translate([r - r2, h - r2])\n circle(r = r2);\n\t\t\tif (roundBothEnds) {\n\t\t\t\ttranslate([r - r2, r2])\n circle(r = r2);\n\t\t\t}\n\n }\n}\n\nmodule sector(r, a, h, center = true) {\n linear_extrude(height = h, center = center)\n sector2D(r=r, a=a, center=center);\n}\n\nmodule sector2D(r, a, center = true) {\n intersection() {\n circle(r = r, center = true);\n polygon(points = [\n [0, 0],\n [2 * r * cos(0), 2 * r * sin(0)],\n [2 * r * cos(a * 0.2), 2 * r * sin(a * 0.2)],\n [2 * r * cos(a * 0.4), 2 * r * sin(a * 0.4)],\n [2 * r * cos(a * 0.6), 2 * r * sin(a * 0.6)],\n [2 * r * cos(a * 0.8), 2 * r * sin(a * 0.8)],\n [2 * r * cos(a), 2 * r * sin(a)],\n ]);\n }\n}\n\nmodule donutSector2D(or,ir,a, center=true) {\n\tdifference() {\n\t\tsector2D(or,a,center);\n\n\t\tcircle(ir);\n\t}\n\n}\n\nmodule tube(or, ir, h, center = true) {\n linear_extrude(height = h, center = center, convexity = 5)\n difference() {\n circle(or);\n circle(ir);\n }\n}\n\n\/\/ tube that tapers\nmodule conicalTube(or1,ir1,or2,ir2,h) {\n\tdifference() {\n\t\tcylinder(r1=or1, r2=or2, h=h);\n\n\t\ttranslate([0,0,-eta])\n\t\t\tcylinder(r1=ir1, r2=ir2, h=h+2*eta);\n\t}\n}\n\n\nmodule moreShapesExamples() {\n\tarrangeShapesOnGrid(xSpacing=100, ySpacing=80, cols=4, showLocalAxes=true) {\n\t\troundedRect([50,30,20], 5);\n\t\troundedRectX([50,30,20], 5);\n\t\troundedRectY([50,30,20], 5);\n\t\t\/\/allRoundedRect([50,30,20], 5);\n\n\t\troundedRect([50,30,20], 5, true);\n\t\troundedRectX([50,30,20], 5, true);\n\t\troundedRectY([50,30,20], 5, true);\n\t\t\/\/allRoundedRect([50,30,20], 5, true);\n\n\n\t\ttorusSlice(50, 6, 0, 120, $fn=64);\n\t\ttorusSlice(r1=50, r2=6, r3=4, start_angle=0, end_angle=120, $fn=64); \/\/ define r3 for a hollow torus\n\n\t\ttrapezoidPrism(20,50,20,10,20);\n\t\ttrapezoidPrism(20,50,20,10,20,true);\n\n\t\t\/\/ to be differenced\n\t\tslot(h=20, r=5, l=10);\n\n\t\t\/\/ to be unioned\n\t\tfillet(r=5, h=50);\n\n\t\tright_triangle(width=30, height=20, h=10, center = false);\n\t\trounded_square(w=30, h=20, r=5);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=false);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=true);\n\n\t\t\/\/ same as extruded pieSlice\n\t\tsector(r=10, a=70, h=20, center = false);\n\n\t\ttube(or=10, ir=5, h=50, center = false);\n\n\t\trotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\t\t\tdifference() {\n\t\t\t\tsquare([20,20],center=true);\n\t\t\t\ttranslate([10,0,0]) circle(5);\n\t\t\t}\n\t\t}\n\t}\n}\n\n*moreShapesExamples();\n\nmodule overhangFreeCircle(r, ang) {\n\t\/\/ produces a circle with no overhang ready for extrusion\n\t\/\/ overhang infill is along y axis\n\n\tx1 = r*cos(ang);\n\ty1 = r*sin(ang);\n\tx2 = tan(ang) * (r-y1);\n\n\tunion() {\n\t\tcircle(r);\n\n\t\tfor (i=[0,1])\n\t\t\tmirror([0,i,0])\n\t\t\tpolygon(points=[[0,0],[x1,y1],[x1-x2,r],[-x1+x2,r],[-x1,y1]]);\n\t}\n}\n\n\/\/ supports span x axis\nmodule minSupportBeam(size=[0,0,0], bridge=5, air=0, center=false) {\n\tw = size[0] > bridge ? (size[0] - bridge)\/2 : 0;\n\th = w > air ? air : w;\n\n\tunion() {\n\t\tcube(size, center=center);\n\n\t\t\/\/ triangular supports\n\t\tfor (i=[0,1])\n\t\t\ttranslate([i*size[0],0,eta])\n\t\t\tmirror([i,0,0]) {\n\t\t\t\ttranslate([w-h, 0, 0])\n\t\t\t\t\trotate([-90,0,0])\n\t\t\t\t\tright_triangle(h, h, size[1], center=false);\n\n\t\t\t\ttranslate([0, 0, -h])\n\t\t\t\t\tcube([w-h+eta, size[1], h+eta]);\n\n\t\t\t}\n\t}\n}\n\nmodule minSupportBeamY(size=[0,0,0], bridge=5, air=0, center=false) {\n\ttranslate([size[0], 0, 0])\n\t\trotate([0,0,90])\n\t\tminSupportBeam([size[1], size[0], size[2]], bridge, air, center=center);\n}\n","old_contents":"\/\/ moreShapes library\n\/\/ 2D and 3D utility shape functions\n\n\/\/ some borrowed from nophead \/ Mendel90 utils.scad\n\n\/\/ fudge\neta = 0.01;\n\n\nmodule line(start, end, r) {\n\thull() {\n\t\ttranslate(start) sphere(r=r);\n\t\ttranslate(end) sphere(r=r);\n\t}\n}\n\nmodule roundedSquare(size, radius, center=false, shell=0) {\n x = size[0];\n\ty = size[1];\n\n\ttranslate([center?-x\/2:0, center?-y\/2:0, 0])\n\tdifference() {\n\t\thull() {\n\t\t\ttranslate([radius, radius, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius, radius, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\n\t\tif (shell > 0) {\n\t\t\thull() {\n\t\t\ttranslate([radius + shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius - shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([x - radius - shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\n\t\t\ttranslate([radius + shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t}\n\t}\n}\n\nmodule roundedRect(size, radius, center=false, shell=0) {\n\tz = size[2];\n\n\ttranslate([0, 0, center?-z\/2:0])\n\t linear_extrude(height=z)\n\t roundedSquare(size=size, radius=radius, center=center, shell=shell);\n}\n\nmodule roundedRectX(size, radius, center=false, shell=0) {\n\t\/\/ X-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([0,90,0]) roundedRect([size[2],size[1],size[0]], radius, center, shell);\n}\n\nmodule roundedRectY(size, radius, center=false, shell=0) {\n\t\/\/ Y-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([-90,0,0]) roundedRect([size[0],size[2],size[1]], radius, center, shell);\n}\n\nmodule allRoundedRect(size, radius, center=false) {\n\t\/\/ lazy implementation - must do better\n\t\/\/ runs VERY slow\n\ttranslate([center?-size[0]\/2:0, center?-size[1]\/2:0, center?-size[2]\/2:0])\n\thull() {\n\t\tfor (x=[0,size[0]], y=[0,size[1]], z=[0,size[2]]) {\n\t\t\ttranslate([x,y,z]) sphere(r=radius);\n\t\t}\n\t}\n}\n\nmodule chamferedSquare(size, chamfer, center=false) {\n\thull() {\n\t\ttranslate([0,center?0:chamfer,0])\n\t\t\tsquare([size[0],size[1]-2*chamfer],center);\n\n\t\ttranslate([center?0:chamfer,0,0])\n\t\t\tsquare([size[0]-2*chamfer,size[1]],center);\n\t}\n}\n\nmodule chamferedCube(size, chamfer, center=false) {\n\ttranslate([0,0, center ? -size[2]\/2 : 0])\n\t\tlinear_extrude(size[2])\n\t\tchamferedSquare(size, chamfer, center=center);\n}\n\n\/\/ Extended rotational extrude, allows control of start\/end angle\n\n\/\/ Child 2D shape is used for the rotational extrusion\n\/\/ Child 2D shape should lie in xy plane, centred on z axis\n\/\/ Child y axis will be aligned to z axis in the extrusion\n\n\/\/ NB: Internal render command is necessary to correclty display\n\/\/ complex child objects (e.g. differences)\n\n\/\/ r = Radius of rotational extrusion\n\/\/ childH = height of child object (approx)\n\/\/ childW = width of child object (approx)\n\n\/\/ Example usage:\n\n\/\/ rotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\/\/\t\t\tdifference() {\n\/\/\t\t\t\tsquare([20,20],center=true);\n\/\/\t\t\t\ttranslate([10,0,0]) circle(5);\n\/\/\t\t\t}\n\/\/\t\t}\n\nmodule rotate_extrude_ext(r, childW, childH, convexity) {\n\tor = (r + childW\/2) * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n\t\trender()\n intersection() {\n\t\t\trotate_extrude(convexity=convexity) translate([r,0,0]) children(0);\n\n\t\t\ttranslate([0,0,-childH\/2 - 1])\n\t\t\tlinear_extrude(height=childH+2)\n \t\tpolygon([\n\t\t [0,0],\n\t\t [or * cos(a0), or * sin(a0)],\n\t\t [or * cos(a1), or * sin(a1)],\n\t\t [or * cos(a2), or * sin(a2)],\n\t\t [or * cos(a3), or * sin(a3)],\n\t\t [or * cos(a4), or * sin(a4)],\n\t\t [0,0]\n\t\t ]);\n }\n}\n\n\n\nmodule torusSlice(r1, r2, start_angle, end_angle, convexity=10, r3=0, $fn=64) {\n\tdifference() {\n\t\trotate_extrude_ext(r=r1, childH=2*r2, childW=2*r2, start_angle=start_angle, end_angle=end_angle, convexity=convexity) difference() circle(r2, $fn=$fn\/4);\n\n\t\trotate_extrude(convexity) translate([r1,0,0]) circle(r3, $fn=$fn\/4);\n\t}\n}\n\nmodule torus(r1, r2, $fn=64) {\n\trotate_extrude()\n\t\ttranslate([r1,0,0])\n\t\tcircle(r2, $fn=$fn\/4);\n}\n\n\nmodule trapezoid(a,b,h,aOffset=0,center=false) {\n\t\/\/ lies in x\/y plane\n\t\/\/ edges a,b are parallel to x axis\n\t\/\/ h is in direction of y axis\n\t\/\/ b is anchored at origin, extends along positive x axis\n\t\/\/ a is offset along y by h, extends along positive x axis\n\t\/\/ a if offset along x axis, from y axis, by aOffset\n\t\/\/ centering is relative to edge b\n\n\ttranslate([center?-b\/2:0, center?-h\/2:0, 0])\n\tpolygon(points=[\t[0,0],\n\t\t\t\t\t[aOffset,h],\n\t\t\t\t\t[aOffset + a, h],\n\t\t\t\t\t[b,0]]);\n}\n\nmodule trapezoidPrism(a,b,h,aOffset,height,center=false) {\n\ttranslate([0,0, center?-height\/2:0]) linear_extrude(height=height) trapezoid(a,b,h,aOffset,center);\n}\n\n\nmodule arrangeShapesOnAxis(axis=[1,0,0], spacing=50) {\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([spacing * axis[0] *i,\n\t\t\t\t\tspacing * axis[1]*i,\n\t\t\t\t\tspacing * axis[2]*i]) children(i);\n\t}\n}\n\nmodule arrangeShapesOnGrid(xSpacing=50, ySpacing=50, cols=3, showLocalAxes=false) {\n\t\/\/ layout is cols, rows\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([(i - floor(i \/ cols)*cols) * xSpacing, floor(i \/ cols) * ySpacing, 0]) {\n\t\t\tchildren(i);\n\n\t\t\tif (showLocalAxes) {\n\t\t\t\tcolor(\"red\") line([0,0,0], [xSpacing\/2,0,0], 0.2);\n\t\t\t\tcolor(\"green\") line([0,0,0], [0, ySpacing\/2,0], 0.2);\n\t\t\t\tcolor(\"blue\") line([0,0,0], [0, 0,xSpacing], 0.2);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule slot(h, r, l, center = true)\n linear_extrude(height = h, convexity = 6, center = center)\n hull() {\n translate([l\/2,0,0])\n circle(r = r, center = true);\n translate([-l\/2,0,0])\n circle(r = r, center = true);\n }\n\n\n\nmodule fillet(r, h) {\n\t\/\/ ready to be unioned onto another part, eta fudge included\n\t\/\/ extends along x, y, z\n\n translate([r \/ 2, r \/ 2, 0])\n difference() {\n cube([r + eta, r + eta, h], center = true);\n translate([r\/2, r\/2, 0])\n cylinder(r = r, h = h + 1, center = true);\n }\n}\n\nmodule right_triangle_2d(width,height,center=true) {\n polygon(points = [[0,0], [width, 0], [0, height]]);\n}\n\nmodule right_triangle(width, height, h, center = true) {\n linear_extrude(height = h, center = center)\n right_triangle_2d(width,height,center=center);\n}\n\nmodule roundedRightTriangle(width, height, h, r=[1,1,1], center = true, $fn=12) {\n linear_extrude(height = h, center = center)\n \thull() {\n \ttranslate([r[0],r[0],0]) circle(r[0]);\n \ttranslate([width-r[1],r[1],0]) circle(r[1]);\n \ttranslate([r[2],height-r[2],0]) circle(r[2]);\n }\n}\n\n\nmodule rounded_square(w, h, r, center=true)\n{\n\t\/\/ 2D\n union() {\n translate([center?0:r,0,0])\n \tsquare([w - 2 * r, h], center=center);\n translate([0,center?0:r,0])\n \tsquare([w, h - 2 * r], center=center);\n for(x = [(center?-w\/2:0) + r, (center?w\/2:w) - r])\n for(y = [(center?-h\/2:0) + r, (center?h\/2:h) - r])\n translate([x, y])\n circle(r = r);\n }\n}\n\n\/\/\n\/\/ Cylinder with rounded ends\n\/\/\nmodule rounded_cylinder(r, h, r2, roundBothEnds=false)\n{\n rotate_extrude()\n union() {\n square([r - r2, h]);\n translate([0,roundBothEnds?r2:0,0]) square([r, roundBothEnds? h-2*r2 : h - r2]);\n translate([r - r2, h - r2])\n circle(r = r2);\n\t\t\tif (roundBothEnds) {\n\t\t\t\ttranslate([r - r2, r2])\n circle(r = r2);\n\t\t\t}\n\n }\n}\n\nmodule sector(r, a, h, center = true) {\n linear_extrude(height = h, center = center)\n sector2D(r=r, a=a, center=center);\n}\n\nmodule sector2D(r, a, center = true) {\n intersection() {\n circle(r = r, center = true);\n polygon(points = [\n [0, 0],\n [2 * r * cos(0), 2 * r * sin(0)],\n [2 * r * cos(a * 0.2), 2 * r * sin(a * 0.2)],\n [2 * r * cos(a * 0.4), 2 * r * sin(a * 0.4)],\n [2 * r * cos(a * 0.6), 2 * r * sin(a * 0.6)],\n [2 * r * cos(a * 0.8), 2 * r * sin(a * 0.8)],\n [2 * r * cos(a), 2 * r * sin(a)],\n ]);\n }\n}\n\nmodule donutSector2D(or,ir,a, center=true) {\n\tdifference() {\n\t\tsector2D(or,a,center);\n\n\t\tcircle(ir);\n\t}\n\n}\n\nmodule tube(or, ir, h, center = true) {\n linear_extrude(height = h, center = center, convexity = 5)\n difference() {\n circle(or);\n circle(ir);\n }\n}\n\n\/\/ tube that tapers\nmodule conicalTube(or1,ir1,or2,ir2,h) {\n\tdifference() {\n\t\tcylinder(r1=or1, r2=or2, h=h);\n\n\t\ttranslate([0,0,-eta])\n\t\t\tcylinder(r1=ir1, r2=ir2, h=h+2*eta);\n\t}\n}\n\n\nmodule moreShapesExamples() {\n\tarrangeShapesOnGrid(xSpacing=100, ySpacing=80, cols=4, showLocalAxes=true) {\n\t\troundedRect([50,30,20], 5);\n\t\troundedRectX([50,30,20], 5);\n\t\troundedRectY([50,30,20], 5);\n\t\t\/\/allRoundedRect([50,30,20], 5);\n\n\t\troundedRect([50,30,20], 5, true);\n\t\troundedRectX([50,30,20], 5, true);\n\t\troundedRectY([50,30,20], 5, true);\n\t\t\/\/allRoundedRect([50,30,20], 5, true);\n\n\n\t\ttorusSlice(50, 6, 0, 120, $fn=64);\n\t\ttorusSlice(r1=50, r2=6, r3=4, start_angle=0, end_angle=120, $fn=64); \/\/ define r3 for a hollow torus\n\n\t\ttrapezoidPrism(20,50,20,10,20);\n\t\ttrapezoidPrism(20,50,20,10,20,true);\n\n\t\t\/\/ to be differenced\n\t\tslot(h=20, r=5, l=10);\n\n\t\t\/\/ to be unioned\n\t\tfillet(r=5, h=50);\n\n\t\tright_triangle(width=30, height=20, h=10, center = false);\n\t\trounded_square(w=30, h=20, r=5);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=false);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=true);\n\n\t\t\/\/ same as extruded pieSlice\n\t\tsector(r=10, a=70, h=20, center = false);\n\n\t\ttube(or=10, ir=5, h=50, center = false);\n\n\t\trotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\t\t\tdifference() {\n\t\t\t\tsquare([20,20],center=true);\n\t\t\t\ttranslate([10,0,0]) circle(5);\n\t\t\t}\n\t\t}\n\t}\n}\n\n*moreShapesExamples();\n\nmodule overhangFreeCircle(r, ang) {\n\t\/\/ produces a circle with no overhang ready for extrusion\n\t\/\/ overhang infill is along y axis\n\n\tx1 = r*cos(ang);\n\ty1 = r*sin(ang);\n\tx2 = tan(ang) * (r-y1);\n\n\tunion() {\n\t\tcircle(r);\n\n\t\tfor (i=[0,1])\n\t\t\tmirror([0,i,0])\n\t\t\tpolygon(points=[[0,0],[x1,y1],[x1-x2,r],[-x1+x2,r],[-x1,y1]]);\n\t}\n}\n\n\/\/ supports span x axis\nmodule minSupportBeam(size=[0,0,0], bridge=5, air=0, center=false) {\n\tw = size[0] > bridge ? (size[0] - bridge)\/2 : 0;\n\th = w > air ? air : w;\n\n\tunion() {\n\t\tcube(size, center=center);\n\n\t\t\/\/ triangular supports\n\t\tfor (i=[0,1])\n\t\t\ttranslate([i*size[0],0,eta])\n\t\t\tmirror([i,0,0]) {\n\t\t\t\ttranslate([w-h, 0, 0])\n\t\t\t\t\trotate([-90,0,0])\n\t\t\t\t\tright_triangle(h, h, size[1], center=false);\n\n\t\t\t\ttranslate([0, 0, -h])\n\t\t\t\t\tcube([w-h+eta, size[1], h+eta]);\n\n\t\t\t}\n\t}\n}\n\nmodule minSupportBeamY(size=[0,0,0], bridge=5, air=0, center=false) {\n\ttranslate([size[0], 0, 0])\n\t\trotate([0,0,90])\n\t\tminSupportBeam([size[1], size[0], size[2]], bridge, air, center=center);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a82dcd53e49516af72e011c6140f820246dd6edd","subject":"more bracing at fork","message":"more bracing at fork\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/JansenBED.scad","new_file":"Drawings\/JansenBED.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenBED.scad $\n\/\/ $Id: JansenBED.scad 435 2015-03-02 15:21:04Z mrwhat $\n\n\/\/ main BED code, more injection-mold-like model\n\n\/\/ Uses a ton of stuff from Jansen.scad.\n\/\/ Use from an #include in Jansen.scad.\n\nforkLen = 3.5*LinkRad; \/\/ forks around linkage in BED\nnf=24; \/\/ faces for hull components\n\nmodule BEDhull(dLeft,dPerp,dRight,ph,rp) { hull() {\ntranslate([-dLeft,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([dRight,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([-rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ 0,dPerp-rp,ph-1]) sphere(r=1,$fn=nf);\ntranslate([4-dLeft ,1,2]) sphere(r=1,$fn=nf);\ntranslate([dRight-4,1,2]) sphere(r=1,$fn=nf);\n}}\n\nmodule BEDsideRail(x,dPerp,ph) {\nhull() {\n translate([x,-1, 0]) {\n cylinder(h=1,r1=1.2,r2=.1,$fn=nf);\n translate([0,0,2]) sphere(r=.6,$fn=nf); }\n translate([0,dPerp+2,0]) {\n cylinder(h=1,r1=1.5,r2=.1,$fn=nf);\n translate([0,0,ph-.6]) sphere(r=.6,$fn=nf); }\n }\nhull() {\n if (x < 0) { translate([x+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n else { translate([x-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n translate([0,dPerp,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf);\n }\n}\n\nmodule BEDrails(dLeft,dPerp,dRight,ph,rp) {\nunion() {\n BEDsideRail(-dLeft,dPerp,ph);\n BEDsideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n translate([dRight,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n }\n hull() { \/\/ horiz, flat part of DE segment\n translate([-dLeft+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n translate([dRight-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n }\n hull() { \n translate([dRight-5,6,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n translate([dRight+1,2,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n }\n}}\n\nmodule forkTab(h,r1,r2,len) {\ndifference(){\nhull() { cylinder(h=h,r1=r1,r2=r2,$fn=48);\n translate([len+2,0,0]) cylinder(h=2,r1=2,r2=1,$fn=12); }\ntranslate([len,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n drillHole(rad4);\n}}\n\nmodule imBEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDhull(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-5*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n translate([0,2,-1])\n BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n\/\/ forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n}\n\/\/------------------------------------- end of imBEDmain\n\nmodule BED1main(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDrails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen-2);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen-2); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-4*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n \/\/translate([0,2,-1])\n \/\/ BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n\n \/\/ more bracing for fork\n hull() {\n translate([-dLeft+8,0,0]) cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+17,11,0]) cylinder(r=2,h=1,$fn=6);\n }\n hull() {\n translate([-dLeft+1,-1.5,0]) cylinder(r=2,h=NodeHeight+3.5,$fn=6);\n translate([-dLeft+8,-1,0]) cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+21,0,0]) cylinder(r=2,h=1,$fn=6);\n }\n \n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+9,-6,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+13.5,10,0]) cylinder(h=NodeHeight+3,r=8,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ custom support\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\ncolor(\"Cyan\") union() {\n\/* stuff parallel to perimiter adhered too well\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n \/\/translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n \/\/translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n \/\/translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n*\/\n hull() {\n translate([-34,0,0]) cylinder(r1=3,r2=5,h=2,$fn=11);\n #translate([-29,0.5,0]) scale([1,5,1])\n cylinder(r1=.3,r2=1,h=2,$fn=6);\n }\n translate([-34,0,sH-1.5]) {\n translate([3.6,0,0]) cube([5,sW,2],center=true);\n for (a=[-30,30]) rotate([0,0,a]) translate([4,0,0]) cube([6,sW,3],center=true);\n for (a=[60:30:322]) rotate([0,0,a])\n translate([3,0,0]) cube([4,sW,3],center=true);\n }\n}\n\n}\n\n\/\/------------------------------------- end of BED1main\n\nmodule imBED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n\/\/ Complete (Joined) version of BED, with in-place fork\nmodule imBEDj(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nunion() {\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork, in place\ntranslate([-dLeft,0,-.01]) { rotate([0,0,5]) { \n rotate([180,0,0]) forkTab(ForkHeight+.2,Drad+2,rad4+1.4,forkLen);\n\n#hull(){\n translate([forkLen ,0,0])cylinder(h=NodeHeight-2,r=2.8,$fn=12);\n translate([forkLen+1.5,4,1.1])sphere(r=1,$fn=6);\n translate([forkLen+2,0,0])cylinder(h=NodeHeight-2,r=2.2,$fn=12);}\n}}\n\n}}\n\n\/\/imBED(DEleft,DE,DEperp);\n\n\/\/ version of BED intended for one-sided injection mold\nmodule BED1(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nBED1main(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\ntranslate([-10,8,0]) rotate([0,0,55])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenBED.scad $\n\/\/ $Id: JansenBED.scad 435 2015-03-02 15:21:04Z mrwhat $\n\n\/\/ main BED code, more injection-mold-like model\n\n\/\/ Uses a ton of stuff from Jansen.scad.\n\/\/ Use from an #include in Jansen.scad.\n\nforkLen = 3.5*LinkRad; \/\/ forks around linkage in BED\nnf=24; \/\/ faces for hull components\n\nmodule BEDhull(dLeft,dPerp,dRight,ph,rp) { hull() {\ntranslate([-dLeft,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([dRight,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([-rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ 0,dPerp-rp,ph-1]) sphere(r=1,$fn=nf);\ntranslate([4-dLeft ,1,2]) sphere(r=1,$fn=nf);\ntranslate([dRight-4,1,2]) sphere(r=1,$fn=nf);\n}}\n\nmodule BEDsideRail(x,dPerp,ph) {\nhull() {\n translate([x,-1, 0]) {\n cylinder(h=1,r1=1.2,r2=.1,$fn=nf);\n translate([0,0,2]) sphere(r=.6,$fn=nf); }\n translate([0,dPerp+2,0]) {\n cylinder(h=1,r1=1.5,r2=.1,$fn=nf);\n translate([0,0,ph-.6]) sphere(r=.6,$fn=nf); }\n }\nhull() {\n if (x < 0) { translate([x+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n else { translate([x-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n translate([0,dPerp,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf);\n }\n}\n\nmodule BEDrails(dLeft,dPerp,dRight,ph,rp) {\nunion() {\n BEDsideRail(-dLeft,dPerp,ph);\n BEDsideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n translate([dRight,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n }\n hull() { \/\/ horiz, flat part of DE segment\n translate([-dLeft+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n translate([dRight-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n }\n hull() { \n translate([dRight-5,6,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n translate([dRight+1,2,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n }\n}}\n\nmodule forkTab(h,r1,r2,len) {\ndifference(){\nhull() { cylinder(h=h,r1=r1,r2=r2,$fn=48);\n translate([len+2,0,0]) cylinder(h=2,r1=2,r2=1,$fn=12); }\ntranslate([len,0,-.1]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n drillHole(rad4);\n}}\n\nmodule imBEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDhull(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-5*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n translate([0,2,-1])\n BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n\/\/ forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n}\n\/\/------------------------------------- end of imBEDmain\n\nmodule BED1main(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDrails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen-2);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen-2); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-4*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n \/\/translate([0,2,-1])\n \/\/ BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ custom support\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\ncolor(\"Cyan\") union() {\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n hull() {\n translate([-34,0,0]) cylinder(r1=2,r2=5,h=3.6,$fn=11);\n translate([-29,0.5,0]) rotate([0,0,15])\n scale([1,3,1]) cylinder(r1=.3,r2=1.5,h=3.6,$fn=6);\n }\n}\n\n}\n\n\/\/------------------------------------- end of BED1main\n\nmodule imBED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n\/\/ Complete (Joined) version of BED, with in-place fork\nmodule imBEDj(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nunion() {\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork, in place\ntranslate([-dLeft,0,-.01]) { rotate([0,0,5]) { \n rotate([180,0,0]) forkTab(ForkHeight+.2,Drad+2,rad4+1.4,forkLen);\n\n#hull(){\n translate([forkLen ,0,0])cylinder(h=NodeHeight-2,r=2.8,$fn=12);\n translate([forkLen+1.5,4,1.1])sphere(r=1,$fn=6);\n translate([forkLen+2,0,0])cylinder(h=NodeHeight-2,r=2.2,$fn=12);}\n}}\n\n}}\n\n\/\/imBED(DEleft,DE,DEperp);\n\n\/\/ version of BED intended for one-sided injection mold\nmodule BED1(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nBED1main(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"2e89359dd5f0a524f7ea177f43dbada3bdc2875b","subject":"config: fix missing include","message":"config: fix missing include\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_motor_offset=5;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ea383fe1ce0f21615cc3c2ca53a7e6ad276a2e6c","subject":"xaxis\/carriage: add belt rendering","message":"xaxis\/carriage: add belt rendering\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\n\/\/ main house\nextruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n];\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\n\/\/ main house\nextruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n];\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9d91e26af561eed34a2255ecf085b4c97214eadd","subject":"fixed unwelcommed corner cuts","message":"fixed unwelcommed corner cuts\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_dispenser\/wing.scad","new_file":"battery_dispenser\/wing.scad","new_contents":"use \n\nsurround = 15;\nheight = 150;\nwall = 2;\nbatteryDiameter = 20;\nbatteryLength = 40;\n\nmodule channel(h)\n{\n \/\/ side\n cube([2*wall+batteryDiameter, h, wall]);\n \/\/ back wall\n cube([wall, h, batteryLength\/2]);\n \/\/ front holding\n translate([wall+batteryDiameter, 0, 0])\n cube([wall, h, surround]);\n}\n\nmodule wing()\n{\n difference()\n {\n \/\/ main channel part\n union()\n {\n channel(height);\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n channel(2*batteryDiameter);\n }\n \/\/ removal of unnecessary elements\n translate([wall, wall, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n rotate([0,0,60])\n translate([wall, -2*batteryDiameter, wall])\n cube([batteryDiameter, 1.5*batteryDiameter, surround]);\n \/\/ removal of part from which battery will be extracted\n rotate([0,0,60])\n translate([3*wall, -2*batteryDiameter+wall, wall])\n cube([batteryDiameter, batteryDiameter, surround]);\n \/\/ extra space on the bottom for the fingers to catch the battery easily\n rotate([0,0,60])\n translate([-0.1, -2*batteryDiameter-0.1, surround])\n cube([batteryDiameter, 1.5*batteryDiameter, batteryLength\/2-surround]);\n }\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n cube([2*wall+batteryDiameter, wall, surround]);\n}\n\n\n\/\/ display only\nfor(m = [0,1])\n mirror([m,0,0])\n translate([5,0,0])\n wing();\n","old_contents":"use \n\nsurround = 15;\nheight = 150;\nwall = 2;\nbatteryDiameter = 20;\nbatteryLength = 40;\n\nmodule channel(h)\n{\n \/\/ side\n cube([2*wall+batteryDiameter, h, wall]);\n \/\/ back wall\n cube([wall, h, batteryLength\/2]);\n \/\/ front holding\n translate([wall+batteryDiameter, 0, 0])\n cube([wall, h, surround]);\n}\n\nmodule wing()\n{\n difference()\n {\n \/\/ main channel part\n union()\n {\n channel(height);\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n channel(2*batteryDiameter);\n }\n \/\/ removal of unnecessary elements\n translate([wall, 0, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n rotate([0,0,60])\n translate([wall, -2*batteryDiameter, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n \/\/ removal of part from which battery will be extracted\n rotate([0,0,60])\n translate([3*wall, -2*batteryDiameter+wall, wall])\n cube([batteryDiameter, batteryDiameter, surround]);\n \/\/ extra space on the bottom for the fingers to catch the battery easily\n rotate([0,0,60])\n translate([-0.1, -2*batteryDiameter-0.1, surround])\n cube([batteryDiameter, 1.5*batteryDiameter, batteryLength\/2-surround]);\n }\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n cube([2*wall+batteryDiameter, wall, surround]);\n}\n\n\n\/\/ display only\nfor(m = [0,1])\n mirror([m,0,0])\n translate([5,0,0])\n wing();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e64f780f364a3340810e8e282d150413fe178f43","subject":"cube made bigger, so that it is easier to print","message":"cube made bigger, so that it is easier to print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/3d_cube.scad","new_file":"3d_cube\/3d_cube.scad","new_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([30, 20, 10]);\n","old_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([5, 10, 4]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a007849ef5df537841e55b2fbd1b77d11d5c4566","subject":"The code was cleaned up a little bit.","message":"The code was cleaned up a little bit.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n\t\t\t\t icon1 = \"\",\r\n\t\t\t\t icon1_scale = 1,\r\n\t\t\t\t icon1_x = 0,\r\n\t\t\t \t icon1_y = 0,\r\n text1 = \"\",\r\n\t\t\t\t text1_x,\r\n\t \t\t\t text1_y,\r\n\t\t\t \t text2 = \"\",\r\n\t\t\t\t text2_x,\r\n\t\t\t\t text2_y)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n\t\t\t\t\t\t\ticon1_scale,\r\n\t\t\t\t\t\t\ticon1_x,\r\n\t\t\t\t\t\t\ticon1_y,\r\n\t\t\t\t\t\t\ttext1,\r\n\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\ttext1_y,\r\n\t\t\t\t\t\t\ttext2, text2_x, text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n\t\t\t\t\t\t\ticon1_scale,\r\n\t\t\t\t\t\t\ticon1_x,\r\n\t\t\t\t\t\t\ticon1_y,\r\n\t\t\t\t\t\t text1,\r\n\t\t\t\t\t\t text1_x,\r\n\t\t\t\t\t\t text1_y,\r\n\t\t\t\t\t \t text2,\r\n\t\t\t\t\t \t text2_x,\r\n\t\t\t\t\t\t text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\t\ttext1_y,\r\n\t\t\t\t\t\t\t\ttext2,\r\n\t\t\t\t\t\t\t\ttext2_x,\r\n\t \t\t\t\t\t\t \ttext2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1, icon1_scale, icon1_x,\r\n\t\ticon1_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n\t\t\t\t\t\t\t icon1_scale,\r\n\t\t\t\t\t\t\t icon1_x,\r\n\t\t\t\t\t\t\t icon1_y)\r\n{\r\n\tif(icon1 == \"\")\r\n\t{\r\n\t\t\/\/ do nothing\r\n\t}\r\n\telse\r\n\t{\r\n\t\tzScale = 3;\r\n\t\ttranslate([icon1_x, icon1_y, -1.01])\r\n\t\tif(icon1 == \"heart\")\r\n\t\t{\r\n\t\t\tscale([icon1_scale, icon1_scale, zScale])\r\n\t\t\theartThumbnail();\r\n\t\t}\r\n\t\telse if(icon1 == \"bat\")\r\n\t\t{\r\n\t\t\tscale([icon1_scale, icon1_scale, zScale])\r\n\t\t\tbatmanLogoThumbnail();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule lightSignal_oneTextCutout(text, x, y)\r\n{\r\n\tif(text == \"\")\r\n\t{\r\n\t\t\/\/ do nothing\r\n\t}\r\n\telse\r\n\t{\r\n\t\textrudeHeight = 6;\r\n\t\tzTranslate = -3;\r\n\t\tfont = \"Bauhaus 93:style=Regular\";\r\n\t\tfontSize = 7.5;\r\n\r\n\t\ttranslate([x, y, zTranslate])\r\n\t\tlinear_extrude(height = extrudeHeight)\r\n\t\ttext(text, font = font, size = fontSize);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n\t\t\t\t\t\t\t\t\t showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\t\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\n\tstlBaseInnerRadius = 18.5;\r\n\tstlBaseOuterRadius = stlBaseInnerRadius + 2.5;\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\t\ttext1_y,\r\n\t\t\t\t\t\t\t text2,\r\n\t\t\t\t\t\t\t text2_x,\r\n\t\t\t\t\t\t\t text2_y)\r\n{\r\n\tlightSignal_oneTextCutout(text1, text1_x, text1_y);\r\n\r\n\tlightSignal_oneTextCutout(text2, text2_x, text2_y);\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n\t\t\t\t icon1 = \"\",\r\n\t\t\t\t icon1_scale = 1,\r\n\t\t\t\t icon1_x = 0,\r\n\t\t\t \t icon1_y = 0,\r\n text1 = \"\",\r\n\t\t\t\t text1_x,\r\n\t \t\t\t text1_y,\r\n\t\t\t \t text2 = \"\",\r\n\t\t\t\t text2_x,\r\n\t\t\t\t text2_y)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n\t\t\t\t\t\t\ticon1_scale,\r\n\t\t\t\t\t\t\ticon1_x,\r\n\t\t\t\t\t\t\ticon1_y,\r\n\t\t\t\t\t\t\ttext1,\r\n\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\ttext1_y,\r\n\t\t\t\t\t\t\ttext2, text2_x, text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n\t\t\t\t\t\t\ticon1_scale,\r\n\t\t\t\t\t\t\ticon1_x,\r\n\t\t\t\t\t\t\ticon1_y,\r\n\t\t\t\t\t\t text1,\r\n\t\t\t\t\t\t text1_x,\r\n\t\t\t\t\t\t text1_y,\r\n\t\t\t\t\t \t text2,\r\n\t\t\t\t\t \t text2_x,\r\n\t\t\t\t\t\t text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\t\ttext1_y,\r\n\t\t\t\t\t\t\t\ttext2,\r\n\t\t\t\t\t\t\t\ttext2_x,\r\n\t \t\t\t\t\t\t \ttext2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1, icon1_scale, icon1_x,\r\n\t\ticon1_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n\t\t\t\t\t\t\t icon1_scale,\r\n\t\t\t\t\t\t\t icon1_x,\r\n\t\t\t\t\t\t\t icon1_y)\r\n{\r\n\tif(icon1 == \"\")\r\n\t{\r\n\t\t\/\/ do nothing\r\n\t}\r\n\telse\r\n\t{\r\n\t\tzScale = 3;\r\n\t\ttranslate([icon1_x, icon1_y, -1.01])\r\n\t\tif(icon1 == \"heart\")\r\n\t\t{\r\n\t\t\tscale([icon1_scale, icon1_scale, zScale])\r\n\t\t\theartThumbnail();\r\n\t\t}\r\n\t\telse if(icon1 == \"bat\")\r\n\t\t{\r\n\t\t\tscale([icon1_scale, icon1_scale, zScale])\r\n\t\t\tbatmanLogoThumbnail();\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n\t\t\t\t\t\t\t\t\t showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\t\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\n\tstlBaseInnerRadius = 18.5;\r\n\tstlBaseOuterRadius = stlBaseInnerRadius + 2.5;\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\n\/\/TODO: Move this module to the correct alphabetical location.\r\nmodule lightSignal_oneTextCutout(text, x, y)\r\n{\r\n\tif(text == \"\")\r\n\t{\r\n\t\t\/\/ do nothing\r\n\t}\r\n\telse\r\n\t{\r\n\t\textrudeHeight = 6;\r\n\t\tzTranslate = -3;\r\n\t\tfont = \"Bauhaus 93:style=Regular\";\r\n\t\tfontSize = 7.5;\r\n\r\n\t\ttranslate([x, y, zTranslate])\r\n\t\tlinear_extrude(height = extrudeHeight)\r\n\t\ttext(text, font = font, size = fontSize);\r\n\t}\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_x,\r\n\t\t\t\t\t\t\t\ttext1_y,\r\n\/\/TODO: Remove this initialization.\r\n\t\t\t\t\t\t\t text2 = \"\",\r\n\t\t\t\t\t\t\t text2_x,\r\n\t\t\t\t\t\t\t text2_y)\r\n{\r\n\tlightSignal_oneTextCutout(text1, text1_x, text1_y);\r\n\r\n\tlightSignal_oneTextCutout(text2, text2_x, text2_y);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7225a36177c3ee47c8b03c11f9833aaad64cb4a4","subject":"Got the model working finely","message":"Got the model working finely\n","repos":"agupta231\/fractal_prints","old_file":"corner_cubes.scad","new_file":"corner_cubes.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_cube_size = 50;\niteration_factor = 0.45;\niterations = 3;\n\necho(\"---- Gupta 2017 ----\");\necho(version());\necho(\"--------------------\");\n\nmodule iter_cube(current_iter, starting_pos) {\n iter_size = init_cube_size * pow(iteration_factor, current_iter);\n displacement = (init_cube_size * pow(iteration_factor, current_iter - 1)) \/ 2;\n\n for(i = [\n [-1, -1, -1],\n [-1, -1, 1],\n [-1, 1, 1],\n [1, 1, 1],\n [1, 1, -1],\n [1, -1, -1],\n [1, -1, 1],\n [-1, 1, -1]]\n ){\n disp_vect = displacement * i;\n\n translate(starting_pos + disp_vect) {\n cube(iter_size, center = true);\n }\n\n if(current_iter < iterations) {\n iter_cube(current_iter + 1, starting_pos + disp_vect);\n }\n }\n}\n\nunion() {\n cube(init_cube_size, center = true);\n\n iter_cube(1, [0, 0, 0]);\n}\n","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_cube_size = 50;\niteration_factor = 0.5;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"beeeadc554289a3b4c11b1f5121399d69081cacf","subject":"body: top_shoulder","message":"body: top_shoulder\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n \n correction_diameter_base = (2 * BORDER_RADIUS_BODY);\n diameter_base = DIAMETER_BODY - correction_diameter_base;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n translate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\n\nmodule body()\n{ \n top_surface();\n top_shoulder();\n \n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nmodule top_surface()\n{\n position_z = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\n position = [0,0,position_z];\n \n correction_diameter_base = (2 * BORDER_RADIUS_BODY);\n diameter_base = DIAMETER_BODY - correction_diameter_base;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule body()\n{ \n top_surface();\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a67cc2bc90fbe7f620c569d95562471c03621c9e","subject":"The parameter list was corrected.","message":"The parameter list was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad","new_contents":"\r\n\/**\r\n *\r\n * some parts of this software were inspired by\r\n *\r\n * \t http:\/\/www.thingiverse.com\/thing:9347\r\n *\r\n *\/\r\n\r\n\/**\r\n * makes a rounded cube\r\n *\/\r\nmodule roundedCube(cornerRadius=4,\r\n\t\t\t\t cubeCentered=false,\r\n\t\t\t\t sides=30,\r\n\t\t\t\t sidesOnly=false,\r\n\t\t\t\t size=[20,20,2])\r\n{\r\n $fn=sides;\r\n\r\n x = size[0] - cornerRadius\/2;\r\n y = size[1] - cornerRadius\/2;\r\n z = size[2];\r\n\r\n minkowski()\r\n {\r\n cube(size=[x,y,z], center=cubeCentered);\r\n\r\n if(sidesOnly)\r\n {\r\n cylinder(r=cornerRadius);\r\n }\r\n else\r\n {\r\n sphere(r=cornerRadius);\r\n }\r\n };\r\n}\r\n","old_contents":"\r\n\/**\r\n *\r\n * some parts of this software were inspired by\r\n *\r\n * \t http:\/\/www.thingiverse.com\/thing:9347\r\n *\r\n *\/\r\n\r\n\/**\r\n * makes a rounded cube\r\n *\/\r\nmodule roundedCube(cornerRadius=4,\r\n\t\t\t\t cubeCentered=false,\r\n\t\t\t\t sides=30,\r\n\t\t\t\t sidesOnly=false,\r\n\t\t\t\t size=[20,20,2])\r\n{\r\n $fn=sides;\r\n\r\n x = size[0] - cornerRadius\/2;\r\n y = size[1] - cornerRadius\/2;\r\n z = size[2];\r\n\r\n minkowski(size, cornerRadius)\r\n {\r\n cube(size=[x,y,z], center=cubeCentered);\r\n\r\n if(sidesOnly)\r\n {\r\n cylinder(r=cornerRadius);\r\n }\r\n else\r\n {\r\n sphere(r=cornerRadius);\r\n }\r\n };\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5f9de9fad4cf2a4c128a1b89010d6b7f5b508e34","subject":"shapes: add $preview_mode fallbacks","message":"shapes: add $preview_mode fallbacks\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0 || true)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0 || true)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"64e483daaa572a8d2878dabef2de548cea5b4043","subject":"The font name list annotation is now used.","message":"The font name list annotation is now used.\n\nThe Customizer parameters were updated a little bit.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/customizer\/name-tag-cutomizer.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/customizer\/name-tag-cutomizer.scad","new_contents":"\r\n\/* [Base] *\/\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness = 2; \/\/ [1 : 5]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth = 228;\t\/\/ [50:600]\r\n\r\n\/\/ This determines the height of the name tag.\r\nbaseHeight = 15; \/\/ [54:150]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Fun Enthusiast\";\r\nbottomTextFont = \"Arial\"; \/\/ @FontNamesReplacement@\r\nbottomTextOffsetX = 0; \/\/ [-315 : 315]\r\nbottomTextOffsetY = -15; \/\/ [-315 : 315]\r\nbottomTextSize = 12; \/\/ [0 : 40]\r\n\r\n\/* [Chain Loop]*\/\r\nchainLoop = true;\r\nchainLoopLengthZ = 6;\r\nchainLoopType = \"square\"; \/\/ [rounded, square]\r\nchainLoopPosition = \"bottom\"; \/\/ [bottom, top]\r\n\r\n\/* [General] *\/\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/\/ This is the x off set of the icons\r\nxIconOffset = -100; \/\/ [-200:200]\r\n\r\n\/\/ This is the y off set of the icons\r\nyIconOffset = 3; \/\/ [1:200]\r\n\r\n\/* [Left Icon] *\/\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nleftIconType = \"Moon\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.99; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 2.5; \/\/ [0.1: 0.1 :5]\r\n\r\n\/* [Right Icon] *\/\r\nrightIconHeight = 4.0; \/\/ [0.1: 0.1 :5]\r\n\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nrightIconType = \"Sun\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\nrightIconXyScale = 1.3; \/\/ [0.1 : 0.05 : 5]\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Firstnesto Lastquez\";\r\ntopTextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\ntopTextFont = \"Bauhaus 93\"; \/\/ @FontNamesReplacement@\r\ntopTextSize = 15; \/\/ [0 : 40]\r\n\r\n\/* [Hidden] *\/\r\n\r\nuse <..\/name-tag.scad>\r\n\r\nnametag(baseColor = baseColor,\r\n baseThickness = baseThickness,\r\n borderColor = borderColor,\r\n chainLoop = chainLoop,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\tchainLoopType = chainLoopType,\r\n iconColor = iconColor,\r\n letterThickness = letterThickness,\r\n roundedCorners = true,\r\n topText = topText,\r\n\t\ttopTextOffsetY = 6,\r\n topTextSize = topTextSize,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n\t\tbottomTextSize = bottomTextSize,\r\n\t\tleftIconXyScale = leftIconXyScale,\r\n leftIconType = leftIconType,\r\n leftIconHeight = leftIconHeight,\r\n rightIconHeight = rightIconHeight,\r\n\t\trightIconXyScale = rightIconXyScale,\r\n rightIconType = rightIconType,\r\n xIconOffset = xIconOffset,\r\n yIconOffset = yIconOffset,\r\n baseWidth = baseWidth,\r\n showBorder = showBorder);\r\n","old_contents":"\r\n\/* [Base] *\/\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness = 2; \/\/ [1 : 5]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth = 228;\t\/\/ [228:600]\r\n\r\n\/\/ This determines the height of the name tag.\r\nbaseHeight = 15; \/\/ [54:150]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nshowBorder = \"No\"; \/\/ [Yes, No]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Fun Enthusiast\";\r\nbottomTextFont = \"Arial\"; \/\/ \"Wingdings\";\r\nbottomTextOffsetX = 0; \/\/ [-315 : 315]\r\nbottomTextOffsetY = -15; \/\/ [-315 : 315]\r\nbottomTextSize = 12; \/\/ [0 : 40]\r\n\r\n\/* [Chain Loop]*\/\r\nchainLoop = true;\r\nchainLoopLengthZ = 6;\r\nchainLoopType = \"square\"; \/\/ [rounded, square]\r\nchainLoopPosition = \"bottom\"; \/\/ [bottom, top]\r\n\r\n\/* [General] *\/\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/\/ This is the x off set of the icons\r\nxIconOffset = -100; \/\/ [10:200]\r\n\r\n\/\/ This is the y off set of the icons\r\nyIconOffset = 3; \/\/ [1:200]\r\n\r\n\/* [Left Icon] *\/\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nleftIconType = \"Moon\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.99; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 2.5; \/\/ [0.1: 0.1 :5]\r\n\r\n\/* [Right Icon] *\/\r\nrightIconHeight = 4.0; \/\/ [0.1: 0.1 :5]\r\n\r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nrightIconType = \"Sun\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\nrightIconXyScale = 1.3; \/\/ [0.1 : 0.05 : 5]\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Firstnesto Lastquez\";\r\ntopTextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\ntopTextFont = \"Bauhaus 93\";\r\ntopTextSize = 15; \/\/ [0 : 40]\r\n\r\n\/* [Hidden] *\/\r\n\r\nuse <..\/name-tag.scad>\r\n\r\nnametag(baseColor = baseColor,\r\n baseThickness = baseThickness,\r\n borderColor = borderColor,\r\n chainLoop = chainLoop,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\tchainLoopType = chainLoopType,\r\n iconColor = iconColor,\r\n letterThickness = letterThickness,\r\n roundedCorners = true,\r\n topText = topText,\r\n\t\ttopTextOffsetY = 6,\r\n topTextSize = topTextSize,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n\t\tbottomTextSize = bottomTextSize,\r\n\t\tleftIconXyScale = leftIconXyScale,\r\n leftIconType = leftIconType,\r\n leftIconHeight = leftIconHeight,\r\n rightIconHeight = rightIconHeight,\r\n\t\trightIconXyScale = rightIconXyScale,\r\n rightIconType = rightIconType,\r\n xIconOffset = xIconOffset,\r\n yIconOffset = yIconOffset,\r\n baseWidth = baseWidth,\r\n showBorder = showBorder);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6219c1b07f4bde6bc3a4e32dc6ec3d049477b212","subject":"Added bigger dumplings cutter","message":"Added bigger dumplings cutter\n","repos":"ksuszka\/3d-projects","old_file":"small\/dumplings_cutter.scad","new_file":"small\/dumplings_cutter.scad","new_contents":"draft = false;\n\nshow_intersection = false;\n\nform_r = 40;\nflange_width = 5;\nflange_height = 3;\nflange_notches_count = floor(form_r*1.1);\nflange_notch_r = 1.5;\ninner_r = form_r - flange_width;\nouter_r = form_r + 1;\nhandle_top = 50;\nhandle_bottom = 0.99;\nhandle_bottom_width = outer_r-inner_r;\nhandle_bottom_x = (outer_r+inner_r)\/2;\n\nfunction cp25(r,w) = [[r,-1000,w],\n [r,0,w],\n [r-15,30,2],\n [r-5,48,8]\n ];\n\nfunction cp40(r,w) = [[r,-100,w],\n [r,1,w],\n [r-25,35,2],\n [r-15,47,8]\n ];\n \nfunction cp(r,w) = r<30 ? cp25(r,w) : cp40(r,w);\nhandle_control_points = cp(handle_bottom_x, handle_bottom_width);\n\n\n$fs = draft ? 2 : 0.2;\n$fa = draft ? 12 : 2 ;\nsteps_per_bezier = draft ? 10 : 40;\nrotate_extrude_steps = draft ? 60 : 360;\n\n\nmodule flange() {\n module flange_shell() {\n rotate_extrude() {\n polygon([\n [inner_r, 0],\n [inner_r, 1],\n [outer_r, 1],\n [outer_r, -flange_height\/2],\n [(form_r + outer_r)\/2, -flange_height],\n [form_r, -flange_height],\n [form_r, 0]\n ]);\n }\n }\n module flange_notches() {\n intersection() {\n for(i=[0:360\/flange_notches_count:359]) {\n rotate([0,0,i])\n translate([inner_r,0,0]) {\n intersection() {\n union() {\n translate([flange_notch_r,0,0])\n sphere(r=flange_notch_r);\n translate([flange_width\/2+flange_notch_r,0,0])\n rotate([0,90,0])\n cylinder(r=flange_notch_r,h=flange_width,center=true);\n }\n }\n }\n }\n translate([0,0,-4.5]) cylinder(r=form_r+0.1,h=10,center=true);\n }\n }\n flange_shell();\n flange_notches();\n}\n\nmodule handle_silhouette() {\n intersection() {\n Line2d(Curve(handle_control_points));\n translate([0,handle_bottom])\n scale([1000,handle_top-handle_bottom])\n translate([-0.5,0])\n square(1);\n }\n}\n\nmodule handle() {\n rotate_extrude() {\n handle_silhouette();\n }\n}\n\nmodule cutter() {\n handle();\n flange();\n}\n\nintersection() {\n cutter();\n if (show_intersection) cube([1000,1,1000],true);\n}\n\n\/\/--------------------------------------------------------------------------\n\/\/ Helpers\n\/\/--------------------------------------------------------------------------\n\n\/\/ Bezier functions taken from http:\/\/www.thingiverse.com\/thing:8443\/\nfunction BEZ03(u) = pow((1-u), 3);\nfunction BEZ13(u) = 3*u*(pow((1-u),2));\nfunction BEZ23(u) = 3*(pow(u,2))*(1-u);\nfunction BEZ33(u) = pow(u,3);\n\nfunction PointAlongBez4(p0, p1, p2, p3, u) = [\n\tBEZ03(u)*p0[0]+BEZ13(u)*p1[0]+BEZ23(u)*p2[0]+BEZ33(u)*p3[0],\n\tBEZ03(u)*p0[1]+BEZ13(u)*p1[1]+BEZ23(u)*p2[1]+BEZ33(u)*p3[1],\n\tBEZ03(u)*p0[2]+BEZ13(u)*p1[2]+BEZ23(u)*p2[2]+BEZ33(u)*p3[2],];\n\nfunction length(v) = sqrt(v*v);\n\nfunction Curve(points, steps=steps_per_bezier) = [\n for (i = [ 0 : len(points) - 2 ])\n let ( prev = points[i>0?i-1:i],\n p0 = points[i], \n p3 = points[i+1],\n next = points[i+20?i-1:i],\n p0 = points[i], \n p3 = points[i+1],\n next = points[i+2\n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,10,16];\nbearing_bronze_10_16_18 = [10,16,18,14,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,8,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"89d874b2118a187f23a82a9d4334fc68335a0909","subject":"gantry\/upper: Add rounding","message":"gantry\/upper: Add rounding\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"gantry-upper-connector.scad","new_file":"gantry-upper-connector.scad","new_contents":"include \ninclude \n\nmodule gantry_upper_connector()\n{\n \/\/ how much bigger\/smaller is the upper gantry (on each side)\n upper_gantry_width_diff = (main_upper_width-main_width)\/2;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([zmotor_mount_rod_offset_x,0,0])\n {\n rcubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size\/2])\n rcubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size])\n rcubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1], extrasize=[gantry_connector_thickness,0,0], extrasize_align=[1,0,0]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n for(i=[-1,1])\n {\n translate([-.1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n screw_cut(\n nut=zmotor_mount_clamp_nut,\n h=zmotor_mount_rod_offset_x-(extrusion_size*2),\n orient=[-1,0,0],\n align=[-1,0,0]\n );\n }\n }\n\n translate([upper_gantry_width_diff\/2, 0, extrusion_size+gantry_connector_thickness])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, 0])\n {\n screw_cut(extrusion_nut, h=gantry_connector_thickness+.1, nut_offset=true, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([zmotor_mount_rod_offset_x,0,extrusion_size])\n cylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*gantry_upper_connector();*\/\n","old_contents":"include \ninclude \n\nmodule gantry_upper_connector()\n{\n \/\/ how much bigger\/smaller is the upper gantry (on each side)\n upper_gantry_width_diff = (main_upper_width-main_width)\/2;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([zmotor_mount_rod_offset_x,0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n for(i=[-1,1])\n {\n translate([-.1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n screw_cut(\n nut=zmotor_mount_clamp_nut,\n h=zmotor_mount_rod_offset_x-(extrusion_size*2),\n orient=[-1,0,0],\n align=[-1,0,0]\n );\n }\n }\n\n translate([upper_gantry_width_diff\/2, 0, extrusion_size+gantry_connector_thickness])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, 0])\n {\n screw_cut(extrusion_nut, h=gantry_connector_thickness+.1, nut_offset=true, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([zmotor_mount_rod_offset_x,0,extrusion_size])\n cylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e4650a70b14dc0e08f7a07d168fb937b55c22db0","subject":"gantry\/upper\/connector: fix\/rewrite","message":"gantry\/upper\/connector: fix\/rewrite\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"gantry-upper-connector.scad","new_file":"gantry-upper-connector.scad","new_contents":"include \ninclude \ninclude \n\nmodule gantry_upper_connector(part)\n{\n \/\/ how much bigger\/smaller is the upper gantry (on each side)\n upper_gantry_width_diff = (main_upper_width-main_width)\/2;\n if(part==U)\n {\n difference()\n {\n gantry_upper_connector(\"pos\");\n gantry_upper_connector(\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n t(zaxis_rod_offset)\n tx(zmotor_mount_rod_offset_x)\n rcubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n\n \/\/ connect upper gantry\n tx(upper_gantry_width_diff)\n tz(extrusion_size\/2)\n rcubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=X, extra_size=[0,0,gantry_connector_thickness], extra_align=Z);\n }\n\n tx(upper_gantry_width_diff)\n tz(extrusion_size)\n rcubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1], extra_size=[gantry_connector_thickness,0,0], extra_align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n t(zaxis_rod_offset)\n tx(zmotor_mount_rod_offset_x)\n tz(extrusion_size\/2)\n for(y=[-1,1])\n tx(-.1)\n ty(y*zmotor_mount_clamp_dist\/2)\n screw_cut(\n nut=zmotor_mount_clamp_nut,\n h=zmotor_mount_rod_offset_x-(extrusion_size*2),\n orient=[-1,0,0],\n align=[-1,0,0]\n );\n\n tx(upper_gantry_width_diff\/2)\n tz(extrusion_size+gantry_connector_thickness)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*extrusion_thread_dia*2)\n ty(y*main_upper_dist_y\/2)\n screw_cut(nut=extrusion_nut, h=12*mm, head=\"button\", orient=-Z, align=-Z);\n\n \/\/ cutout for z rod\n t(zaxis_rod_offset)\n tx(zmotor_mount_rod_offset_x)\n tx(extrusion_size)\n cylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=N, orient=Z);\n }\n}\n\nmodule part_gantry_upper_connector()\n{\n gantry_upper_connector();\n}\n\nif(false)\n{\n rotate([0,180,0])\n gantry_upper_connector();\n}\n","old_contents":"include \ninclude \ninclude \n\nmodule gantry_upper_connector()\n{\n \/\/ how much bigger\/smaller is the upper gantry (on each side)\n upper_gantry_width_diff = (main_upper_width-main_width)\/2;\n difference()\n {\n material(Mat_Plastic)\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate(zaxis_rod_offset)\n translate([zmotor_mount_rod_offset_x,0,0])\n {\n rcubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size\/2])\n rcubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=X, extra_size=[0,0,gantry_connector_thickness], extra_align=Z);\n }\n\n translate([upper_gantry_width_diff, 0, 0])\n translate([0,0,extrusion_size])\n rcubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1], extra_size=[gantry_connector_thickness,0,0], extra_align=X);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate(zaxis_rod_offset)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n for(i=[-1,1])\n {\n translate([-.1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n screw_cut(\n nut=zmotor_mount_clamp_nut,\n h=zmotor_mount_rod_offset_x-(extrusion_size*2),\n orient=[-1,0,0],\n align=[-1,0,0]\n );\n }\n }\n\n translate([upper_gantry_width_diff\/2, 0, extrusion_size+gantry_connector_thickness])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, 0])\n {\n screw_cut(nut=extrusion_nut, h=12*mm, head=\"button\", nut_offset=true, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n \/\/ cutout for z rod\n translate(zaxis_rod_offset)\n translate([zmotor_mount_rod_offset_x,0,extrusion_size])\n cylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=N, orient=Z);\n }\n}\n\nmodule part_gantry_upper_connector()\n{\n rotate([0,180,0])\n gantry_upper_connector();\n}\n\n\/*rotate([0,180,0])*\/\n\/*gantry_upper_connector();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6627bac3194d65522cf16668d1d2e1f7de527e55","subject":"Small cable chain, with slot for under wanhao i3","message":"Small cable chain, with slot for under wanhao i3\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"cable-chain-ends\/cable-chain-end.scad","new_file":"cable-chain-ends\/cable-chain-end.scad","new_contents":"\/\/ 13 wide\n\/\/ 3.9 post\n\/\/ 10 tall\n\nw1 = 13;\nw2 = w1 + 4;\nh1 = 10;\nh2 = 12;\n\ndifference() {\n translate([-w2\/2,0,0]) cube([w2,20,h2]);\n translate([-w1\/2,-1,-1]) cube([w1,30,h1+1]);\n translate([-50,16,8]) cube([100,2,100]);\n}\n\nfor(x_scale=[1,-1]) \n scale([x_scale,1,1]) \ntranslate([w1\/2-0.99,4,5]) rotate([0,90,0]) cylinder(d=3.9,h=1);","old_contents":"","returncode":1,"stderr":"error: pathspec 'cable-chain-ends\/cable-chain-end.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"7f04c9d48718aa40f17a8488220c303c15dec3f6","subject":"closet door stop model","message":"closet door stop model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_door_stop\/closet_door_stop.scad","new_file":"closet_door_stop\/closet_door_stop.scad","new_contents":"N=2;\nM=2;\nspacing=3;\n\nmodule door_stop()\n{\n span=10;\n difference()\n {\n union()\n {\n scale([0.5, 1, 1])\n rotate([-90, 0, 0])\n cylinder(r=10, h=span, $fn=50);\n cube([10, span, 10]);\n }\n \/\/ cutt bottom part\n translate([-10, -5, -15])\n cube([30, span+10, 15]);\n \/\/ drill\n translate([5, span\/2, -5])\n cylinder(d=3.5, h=20, $fn=50);\n }\n}\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*(15+spacing), j*(10+spacing), 0])\n door_stop();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'closet_door_stop\/closet_door_stop.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"ea872d70484285fb5e454416d323d491f4c9c0ef","subject":"shoulder","message":"shoulder\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nHEIGHT_TOP = 2 * BORDER_RADIUS_BODY;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n diameter_base = DIAMETER_BODY - HEIGHT_TOP;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule shoulder(position_z)\n{\n position_ring = [0,0,position_z];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n posision_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(posision_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{ \n position = [0,0,main_position_z()];\n \n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_TOP);\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\n\nmodule body()\n{ \n top_surface();\n shoulder(top_position_z()); \n \n main_cylinder();\n shoulder(main_position_z()); \n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nHEIGHT_TOP = 2 * BORDER_RADIUS_BODY;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n diameter_base = DIAMETER_BODY - HEIGHT_TOP;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n position_ring = [0,0,top_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n position_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{\n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_TOP);\n \n position = [0,0,main_position_z()];\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\nmodule bottom_shoulder()\n{\n position_ring = [0,0,main_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n posision_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(posision_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n}\nmodule body()\n{ \n top_surface();\n top_shoulder();\n main_cylinder();\n bottom_shoulder();\n \n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3b6954e149b103d0449db7f6a3714527003ec105","subject":"fix: properly use the build box and the render mode in the sample tube-cap","message":"fix: properly use the build box and the render mode in the sample tube-cap\n","repos":"jsconan\/camelSCAD","old_file":"samples\/tube-cap.scad","new_file":"samples\/tube-cap.scad","new_contents":"\/**\r\n * Samples using the camelSCAD library.\r\n *\r\n * A parametric tube cap.\r\n *\r\n * @author jsconan\r\n * @license CC0-1.0\r\n *\/\r\n\r\n\/\/ As we need to use some shapes, use the right entry point of the library\r\nuse <..\/shapes.scad>\r\ninclude <..\/core\/constants.scad>\r\n\r\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = MODE_PROD;\r\n\r\n\/\/ Defines the dimensions of the object\r\nthickness = 1;\r\nrimDiameter = 40;\r\nholeDiameter = 30;\r\ntubeDiameter = holeDiameter + 2 * thickness;\r\ntubeDepth = 5;\r\n\r\n\/\/ Displays a build box visualization to preview the printer area.\r\nbuildBox(center=true);\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\r\napplyMode(mode=renderMode) {\r\n difference() {\r\n union() {\r\n pipe(d=tubeDiameter, w=thickness, h=tubeDepth + thickness);\r\n cylinder(d=rimDiameter, h=thickness);\r\n }\r\n translateZ(-ALIGN) {\r\n cylinder(d1=tubeDiameter, d2=holeDiameter, h=thickness + ALIGN2);\r\n }\r\n }\r\n}\r\n","old_contents":"\/**\r\n * Samples using the camelSCAD library.\r\n *\r\n * A parametric tube cap.\r\n *\r\n * @author jsconan\r\n * @license CC0-1.0\r\n *\/\r\n\r\n\/\/ As we need to use some shapes, use the right entry point of the library\r\nuse <..\/shapes.scad>\r\ninclude <..\/core\/constants.scad>\r\n\r\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = MODE_PROD;\r\n\r\n\/\/ Defines the dimensions of the object\r\nthickness = 1;\r\nrimDiameter = 40;\r\nholeDiameter = 30;\r\ntubeDiameter = holeDiameter + 2 * thickness;\r\ntubeDepth = 5;\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\r\n\/\/ Displays a build box visualization to preview the printer area.\r\nbuildBox(mode=renderMode) {\r\n difference() {\r\n union() {\r\n pipe(d=tubeDiameter, w=thickness, h=tubeDepth + thickness);\r\n cylinder(d=rimDiameter, h=thickness);\r\n }\r\n translateZ(-ALIGN) {\r\n cylinder(d1=tubeDiameter, d2=holeDiameter, h=thickness + ALIGN2);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3f780cf2deb4b0303da4cc6eddbf613ece77fed8","subject":"both cuts placed","message":"both cuts placed\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_door_blocker\/blocker.scad","new_file":"closet_door_blocker\/blocker.scad","new_contents":"\/\/ closing nails' parameters\nnail_thickness = 1;\nnail_head = 3.5;\nnail_span = 43;\nnail_outstand = 3;\n\n\nmodule cut(height, length, span_up, span_down)\n{\n up_offset = (span_down-span_up)\/2;\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [ up_offset, length, 0], \/\/ 1\n [ up_offset+span_up, length, 0], \/\/ 2\n [ span_down, 0, 0], \/\/ 3\n [ 0, 0, height], \/\/ 4\n [ up_offset, length, height], \/\/ 5\n [ up_offset+span_up, length, height], \/\/ 6\n [ span_down, 0, height] \/\/ 7\n ],\n faces = [\n \/\/ bottom\n [4,5,7],\n [5,6,7],\n \/\/ top\n [2,1,0],\n [0,3,2],\n \/\/ upper wall\n [1,2,5],\n [6,5,2],\n \/\/ lower wall\n [4,3,0],\n [3,4,7],\n \/\/ left wall\n [0,1,4],\n [5,4,1],\n \/\/ right wall\n [2,3,7],\n [7,6,2]\n ]\n );\n}\n\n\nspacing = 2;\ntop = 1.5*nail_thickness;\nbottom = 2*nail_head;\ncut_h = (nail_head-nail_thickness)*8;\nh = cut_h + 2*spacing;\nl = nail_span + bottom\/2*2 + 2*5;\nthick = nail_outstand\/2;\n\ndifference()\n{\n cube([l, h, thick]);\n for(dx = [spacing, l-spacing-bottom])\n translate([dx, (h-cut_h)\/2, 0])\n cut(thick, cut_h, top, bottom);\n}","old_contents":"\/\/ closing nails' parameters\nnail_thickness = 1;\nnail_head = 3.5;\nnail_span = 43;\nnail_outstand = 3;\n\n\nmodule cut(height, length, span_up, span_down)\n{\n up_offset = (span_down-span_up)\/2;\n polyhedron(\n points = [\n [ 0, 0, 0], \/\/ 0\n [ up_offset, length, 0], \/\/ 1\n [ up_offset+span_up, length, 0], \/\/ 2\n [ span_down, 0, 0], \/\/ 3\n [ 0, 0, height], \/\/ 4\n [ up_offset, length, height], \/\/ 5\n [ up_offset+span_up, length, height], \/\/ 6\n [ span_down, 0, height] \/\/ 7\n ],\n faces = [\n \/\/ bottom\n [4,5,7],\n [5,6,7],\n \/\/ top\n [2,1,0],\n [0,3,2],\n \/\/ upper wall\n [1,2,5],\n [6,5,2],\n \/\/ lower wall\n [4,3,0],\n [3,4,7],\n \/\/ left wall\n [0,1,4],\n [5,4,1],\n \/\/ right wall\n [2,3,7],\n [7,6,2]\n ]\n );\n}\n\n\ntop = 1.5*nail_thickness;\nbottom = 2*nail_head;\ncut_h = (nail_head-nail_thickness)*6;\nh = cut_h + 2*5;\nl = nail_span + bottom\/2*2 + 2*5;\nside = nail_outstand\/2;\n\ndifference()\n{\n cube([l, h, side]);\n translate([0, (h-cut_h)\/2, 0])\n cut(2*side, cut_h, top, bottom);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"728975a2e527ba7d51ac4eb213a64439032bdd72","subject":"screw: fixes for orient","message":"screw: fixes for orient\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n translate([0,0,h\/2+.01])\n {\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = override_h==undef?head_h:override_h);\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=override_h==undef?head_h:override_h, align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n translate([0,0,h\/2+.01])\n {\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = override_h==undef?head_h:override_h);\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=override_h==undef?head_h:override_h, align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=trap_axis, align=align)\n {\n hull()\n {\n stack(dist=trap_h)\n {\n orient(trap_axis)\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(trap_axis)\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n }\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\n\/*if(false)*\/\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n translate([0,20,0])\n stack(d=30, axis=[1,0,0])\n {\n stack(d=20, axis=[0,1,0])\n {\n nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);\n nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);\n }\n\n stack(d=20, axis=[1,0,0])\n {\n nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);\n\n nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);\n }\n }\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2d24eef38ed4d8f6ab86c627dfc992243e55070d","subject":"\"PARAMETRIZE ALL THE VARIABLES!!!!\"","message":"\"PARAMETRIZE ALL THE VARIABLES!!!!\"\n\nhttp:\/\/knowyourmeme.com\/memes\/x-all-the-y\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/OmmatiDiag.scad","new_file":"DetectorMockup\/OmmatiDiag.scad","new_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.25;\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n }\n \/\/ box front walls, can (and should be turned off for increased visibility)\n \/\/~ color (\"gray\", 0.6) {\n \/\/~ translate(v = [0, unitlength + padding, 0]) {\n \/\/~ cube([unitlength + padding, 1, height]);\n \/\/~ }\n \/\/~ translate(v = [unitlength + padding, 0, 0]) {\n \/\/~ cube([1, unitlength + padding, height]); \/\/\n \/\/~ }\n \/\/~ }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\", semitransparent)\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\",nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2])CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","old_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nlength = 430;\npadding = 20;\nheight = 100;\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", 0.618) {\n \/\/ box bottom\n cube([length + padding, length + padding,1]);\n \/\/ box back walls\n cube([length + padding, 1, height]);\n cube([1, length + padding, height]);\n }\n\n \/\/ box front walls, can (and should be turned off for increased visibility)\n \/*\n color (\"gray\", 0.6) {\n translate(v = [0, length + padding, 0]) {\n cube([length + padding, 1, height]);\n }\n translate(v = [length + padding, 0, 0]) {\n cube([1, length + padding, height]); \/\/\n }\n }\n *\/\n\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate(v = [padding\/2, padding\/2, 1]) {\n color (\"green\", 0.25) {\n cube([length,length,1]);\n }\n }\nScintillator();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([430\/4, 430\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280,960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\", 0.618) cube([CMOSSize[0] * pixelsize ,CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"green\",0.5) cylinder(h = d_cmos_lens, r1 = CMOSSize[0] * pixelsize \/ 2 , r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2])CMOSCone();\n\n \/\/ Lens (http:\/\/is.gd\/4H9sZf)\n lensdiameter = 2;\n module Lens()\n \/\/ the lens is a squashed sphere which we translate to the middle of the CMOS\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"green\",0.5) cylinder(h = d_lens_scintillator, r1 = lensdiameter * 2 , r2 = FOVSize[1]\/2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([430\/4\/2,430\/3\/2,height-15])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ do twelve iterations, using each xpos with each ypos\n translate([xpos*430\/4, ypos*430\/3, 0]) Ommatidium();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"620e2271dc6e01db7f90105e22c5294c80951553","subject":"[3d] Add a heatshield option to help trap heat","message":"[3d] Add a heatshield option to help trap heat\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 3.0;\n\/\/ Include a bedheat retention ring around the model\nHeatshield = \"No\"; \/\/ [Yes,No]\n\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.0;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule heatshield() {\n hdist=1; \/\/wall\/4;\n hh=10;\n\n if (Pieces == \"Both\") {\n hw=w+2*hh+3*wall+2*hdist;\n hd=2*d+2*hh+5*wall+2*hdist+1;\n\n difference() {\n translate([-hh-wall\/2-hdist,-hh-wall\/2-hdist-d-1-2*wall,0]) difference() {\n union() {\n cube_fillet([hw,hd,hh], top=[hh,hh,hh,hh]);\n translate([hh,hh,0]) cube([hw-2*hh,hd-2*hh,h_b-case_split+wall_t\/2]);\n }\n translate([wall\/2,wall\/2,-e]) {\n cube_fillet([hw-wall,hd-wall,hh+2*e], top=[hh,hh,hh,hh]);\n translate([hh,hh,0]) cube([hw-2*hh-wall,hd-2*hh-wall,h_b-case_split+wall_t+2*e]);\n }\n }\n translate([-wall+e,wall,0]) pic_ex_cube();\n translate([0,-1,h_b+2*wall_t]) rotate([180]) translate([-wall+e,wall,wall_t]) pic_ex_cube();\n }\n }\n else if (Pieces == \"Bottom\") {\n hw=w+2*hh+3*wall+2*hdist;\n hd=d+2*hh+3*wall+2*hdist;\n\n difference() {\n translate([-hh-wall\/2-hdist,-hh-wall\/2-hdist,0]) difference() {\n cube_fillet([hw,hd,hh], top=[hh,hh,hh,hh]);\n translate([wall\/2,wall\/2,-e])\n cube_fillet([hw-wall,hd-wall,hh+2*e], top=[hh,hh,hh,hh]);\n }\n translate([-wall+e,wall,0]) pic_ex_cube();\n }\n }\n else if (Pieces == \"Top\") {\n hw=w+2*hh+3*wall+2*hdist;\n hd=d+2*hh+3*wall+2*hdist;\n\n difference() {\n translate([-hh-wall\/2-hdist,-hh-wall\/2-hdist-d-1-2*wall,0]) difference() {\n cube_fillet([hw,hd,hh], top=[hh,hh,hh,hh]);\n translate([wall\/2,wall\/2,-e])\n cube_fillet([hw-wall,hd-wall,hh+2*e], top=[hh,hh,hh,hh]);\n }\n translate([0,-1,h_b+2*wall_t]) rotate([180]) translate([-wall+e,wall,wall_t]) pic_ex_cube();\n }\n }\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n\n if (Heatshield == \"Yes\") color(\"indigo\") heatshield();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 3.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.0;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"76fe8eac546d088ea6f03ab7b992a445655d84f4","subject":"[3d] Remove unused nut function","message":"[3d] Remove unused nut function\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.1*1.41; \/\/ thickness of side walls\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w,-3.4\/2-ww_d,0])\n cube_fillet([5.5+2*ww_w,3.4+2.5*ww_d,6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -(nut_d\/2+ww_d), 0])\n cube_fillet([nut_d+2*ww_w,nut_d+2*ww_d,oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_fillet([w+2*wall, d+2*wall, h_b+2*wall_t],\n vertical=[wall\/2,wall\/2,wall\/2,wall\/2], \n top=[wall,wall,wall_t,wall],\n bottom=[wall\/2,wall\/2,wall\/2,wall\/2], $fn=4);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n \/\/ ethernet\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n }\n \/\/ USB 0+1\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,0], [wall+guide_offset,0], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips() {\n translate([wall, wall, probe_centerline+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ right guide lip\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n hm43_bottom_lips();\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.1*1.41; \/\/ thickness of side walls\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w,-3.4\/2-ww_d,0])\n cube_fillet([5.5+2*ww_w,3.4+2.5*ww_d,6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -(nut_d\/2+ww_d), 0])\n cube_fillet([nut_d+2*ww_w,nut_d+2*ww_d,oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_fillet([w+2*wall, d+2*wall, h_b+2*wall_t],\n vertical=[wall\/2,wall\/2,wall\/2,wall\/2], \n top=[wall,wall,wall_t,wall],\n bottom=[wall\/2,wall\/2,wall\/2,wall\/2], $fn=4);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n \/\/ ethernet\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n }\n \/\/ USB 0+1\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,0], [wall+guide_offset,0], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips() {\n translate([wall, wall, probe_centerline+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ right guide lip\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n hm43_bottom_lips();\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule nut(d,h,horizontal=true){\n cornerdiameter = (d \/ 2) \/ cos (180 \/ 6);\n cylinder(h = h, r = cornerdiameter, $fn = 6);\n if(horizontal){\n for(i = [1:6]){\n rotate([0,0,60*i]) translate([-cornerdiameter-0.2,0,0]) rotate([0,0,-45]) cube([2,2,h]);\n }\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a700d4dff891b377f5ed858a6f079cba59362cb0","subject":"config: switch to LM12 bearings on Y axis","message":"config: switch to LM12 bearings on Y axis\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingKH1228;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"55b923c46bbd3dba665d1eb7e655f0cf8d95107e","subject":"auto rib calculations","message":"auto rib calculations\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/SupportedShell.scad","new_file":"hardware\/sandbox\/SupportedShell.scad","new_contents":"include <..\/config\/config.scad>\n\nDebugCoordinateFrames = true;\nDebugConnectors = true;\n\nsw = 2 * 0.5; \/\/ approx 2 perimeters\n\nfunction sqr(a) = a*a;\n\nfunction circumference(radius) = 2 * PI * radius;\nfunction arcLength(radius, theta) = PI * radius * theta \/ 180;\nfunction chordLength(radius, theta) = radius * sqrt(2 - 2*cos(theta));\nfunction segmentHeight(radius, theta) = radius - sqrt(sqr(radius) - sqr(chordLength(radius, theta))\/4);\nfunction segmentDistance(radius,theta) = radius - segmentHeight(radius,theta);\n\n\n\/\/ 2D\n\/\/ in XY plane\n\/\/ chord begins at intersection of x+\n\/\/ extends towards y+\n\/\/ theta should be <= 180 degrees\nmodule circularSegment(radius, theta) {\n\tintersection() {\n\t\tcircle(radius);\n\t\t\n\t\t\/\/ chord hull\n\t\tpolygon(\n\t\t[\n\t\t\t[radius, 0],\n\t\t\t[2*radius * cos(theta*0.25), 2*radius * sin(theta*0.1)],\n\t\t\t[2*radius * cos(theta*0.5), 2*radius * sin(theta*0.5)],\n\t\t\t[2*radius * cos(theta*0.75), 2*radius * sin(theta*0.9)],\n\t\t\t[radius * cos(theta), radius * sin(theta)]\n\t\t], 5);\n\t}\n}\n\n\nmodule domeSupportSegment(radius=100, inset=0, thickness=1, supportAngle=45) {\n\tinsetAng = asin(inset\/radius);\t\n\ttheta = 180 - 2*supportAngle - 2*insetAng;\n\n\trotate([0,0,90 - theta - insetAng])\n\t\tlinear_extrude(thickness)\n\t\tcircularSegment(radius,theta);\n}\n\n\nmodule shell() {\n\n\tsupportAngle = 50;\n\tbridgeDist = 6;\n\n\tnumRibs = round(circumference(BaseDiameter\/2 * cos(90-supportAngle)) \/ bridgeDist);\n\techo(numRibs);\n\t\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\t\t\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\tdonutSector2D(\n\t\t\t\t\t\t\tor=BaseDiameter\/2 + Shell_NotchTol + sw, \n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\t\/\/ clearance for pen\n\t\t\t\t\t\tsquare([PenHoleDiameter\/2, BaseDiameter]);\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\/\/ large support ribs\n\t\t\t\tfor (i=[0:numRibs\/4])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/4)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2, perim, supportAngle);\n\t\t\t\t\t\n\t\t\t\t\/\/ medium support ribs\n\t\t\t\tfor (i=[0:numRibs\/4])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/4) + 360\/(numRibs\/2)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2 + 10, perim, supportAngle);\n\t\t\t\t\t\n\t\t\t\t\/\/ small support ribs\n\t\t\t\tfor (i=[0:numRibs\/2])\n\t\t\t\t\trotate([0,0,i*360\/(numRibs\/2) + 360\/(numRibs)])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2 + 20, perim, supportAngle);\n\t\t\t}\n\t\t\n\t\t\t\/\/ section\n\t\t\t*translate([-100,-200,-100])\n\t\t\t\tcube([200,200,200]);\n\t\t}\n}\n\nshell();","old_contents":"include <..\/config\/config.scad>\n\nDebugCoordinateFrames = true;\nDebugConnectors = true;\n\nsw = 2 * 0.5; \/\/ approx 2 perimeters\n\nfunction sqr(a) = a*a;\n\nfunction circumference(radius) = 2 * PI * radius;\nfunction arcLength(radius, theta) = PI * radius * theta \/ 180;\nfunction chordLength(radius, theta) = radius * sqrt(2 - 2*cos(theta));\nfunction segmentHeight(radius, theta) = radius - sqrt(sqr(radius) - sqr(chordLength(radius, theta))\/4);\nfunction segmentDistance(radius,theta) = radius - segmentHeight(radius,theta);\n\n\n\/\/ 2D\n\/\/ in XY plane\n\/\/ chord begins at intersection of x+\n\/\/ extends towards y+\n\/\/ theta should be <= 180 degrees\nmodule circularSegment(radius, theta) {\n\techo(segmentHeight(radius,theta));\n\tintersection() {\n\t\tcircle(radius);\n\t\t\n\t\t\/\/ chord hull\n\t\tpolygon(\n\t\t[\n\t\t\t[radius, 0],\n\t\t\t[2*radius * cos(theta*0.25), 2*radius * sin(theta*0.1)],\n\t\t\t[2*radius * cos(theta*0.5), 2*radius * sin(theta*0.5)],\n\t\t\t[2*radius * cos(theta*0.75), 2*radius * sin(theta*0.9)],\n\t\t\t[radius * cos(theta), radius * sin(theta)]\n\t\t], 5);\n\t}\n}\n\n\nmodule domeSupportSegment(radius=100, inset=0, thickness=1, supportAngle=45) {\n\tinsetAng = asin(inset\/radius);\t\n\ttheta = 180 - 2*supportAngle - 2*insetAng;\n\n\trotate([0,0,90 - theta - insetAng])\n\t\tlinear_extrude(thickness)\n\t\tcircularSegment(radius,theta);\n}\n\n\nmodule shell() {\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\t\t\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\tdonutSector2D(\n\t\t\t\t\t\t\tor=BaseDiameter\/2 + Shell_NotchTol + sw, \n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\t\/\/ clearance for pen\n\t\t\t\t\t\tsquare([PenHoleDiameter\/2, BaseDiameter]);\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\/\/ large support ribs\n\t\t\t\tfor (i=[0:9])\n\t\t\t\t\trotate([0,0,i*360\/10])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2, perim, 50);\n\t\t\t\t\t\n\t\t\t\t\/\/ small support ribs\n\t\t\t\tfor (i=[0:9])\n\t\t\t\t\trotate([0,0,i*360\/10 + 360\/20])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2 + 10, perim, 50);\n\t\t\t}\n\t\t\n\t\t\t\/\/ section\n\t\t\t*translate([-100,-200,-100])\n\t\t\t\tcube([200,200,200]);\n\t\t}\n}\n\nshell();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3761c02a38f51e99c98fc698da1af726d699fc09","subject":"Top was hollow","message":"Top was hollow\n","repos":"kintel\/OpenSCAD-models","old_file":"horn.scad","new_file":"horn.scad","new_contents":"INCHES = 25.4;\n\n\/\/ Number of colors\nNUMBER = 5; \/\/ [2:5]\n\n\/\/ Diameter of the base shape\nDIAMETER = 60; \/\/ [10:200]\n\n\/\/ Height of the object\nHEIGHT = 120; \/\/ [20:300]\n\n\/\/ Twist in degress\nTWIST = 180; \/\/ [0:720]\n\n\/\/ Relative displacement of base shapes\nDISTANCE = 0.7; \/\/ [0:1]\n\n\/\/ Scale of the tip relative to the base\nSCALE = 5\/8; \/\/ [0:2]\n\n\/\/ Should the object be hollow?\nHOLLOW = false; \/\/ [true, false]\n\n\/\/ If not hollow, What color should the inside have?\nINSIDE_COLOR = 1; \/\/ [0:5]\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST, scale=[SCALE, SCALE], convexity=3) children();\n}\n\nmodule basepart(item) {\n extrudepart() baseitem(item);\n toppart(item);\n}\n\nmodule toppart(item) {\n translate([0,0,HEIGHT]) rotate([0,0,TWIST])\n scale(SCALE) rotate([0,0,item*360\/NUMBER])\n translate([DIAMETER\/2*DISTANCE,0]) \n difference() {\n sphere(DIAMETER\/2);\n translate([0,0,-DIAMETER\/2]) cube(DIAMETER, center=true);\n }\n}\n\n \nmodule part(item) {\n color(COLORS[item%NUM_COLORS]) {\n render() difference() {\n basepart(item);\n for (i=[0:NUMBER-1]) if (i!=item) basepart(i);\n }\n if (!HOLLOW && INSIDE_COLOR == item) inside();\n }\n}\n\nmodule inside() {\n extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n for (i=[1:NUMBER-1], j=[0:i-1]) intersection() { \n toppart(i); toppart(j);\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n if (!HOLLOW) color(COLORS[INSIDE_COLOR]) inside();\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\n","old_contents":"INCHES = 25.4;\n\n\/\/ Number of colors\nNUMBER = 5; \/\/ [2:5]\n\n\/\/ Diameter of the base shape\nDIAMETER = 60; \/\/ [10:200]\n\n\/\/ Height of the object\nHEIGHT = 120; \/\/ [20:300]\n\n\/\/ Twist in degress\nTWIST = 180; \/\/ [0:720]\n\n\/\/ Relative displacement of base shapes\nDISTANCE = 0.7; \/\/ [0:1]\n\n\/\/ Scale of the tip relative to the base\nSCALE = 5\/8; \/\/ [0:2]\n\n\/\/ Should the object be hollow?\nHOLLOW = false; \/\/ [true, false]\n\n\/\/ If not hollow, What color should the inside have?\nINSIDE_COLOR = 1; \/\/ [0:5]\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST, scale=[SCALE, SCALE], convexity=3) child();\n}\n\nmodule basepart(item) {\n extrudepart() baseitem(item);\n translate([0,0,HEIGHT]) rotate([0,0,TWIST])\n scale(SCALE) rotate([0,0,item*360\/NUMBER])\n translate([DIAMETER\/2*DISTANCE,0]) \n sphere(DIAMETER\/2);\n}\n \nmodule part(item) {\n color(COLORS[item%NUM_COLORS]) {\n render() difference() {\n basepart(item);\n for (i=[0:NUMBER-1]) if (i!=item) basepart(i);\n }\n if (!HOLLOW && INSIDE_COLOR == item) inside();\n }\n}\n\nmodule inside() {\n extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n if (!HOLLOW) color(COLORS[INSIDE_COLOR]) inside();\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"9a12c9edce5e779e919e22845f59dd9dd2c9933b","subject":"fix: prevent dividing by 0 when count is 1","message":"fix: prevent dividing by 0 when count is 1\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/rotate.scad","new_file":"operator\/repeat\/rotate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = zAxis3D(),\n interval = 0,\n origin = 0,\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ divisor(angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : ORIGIN_3D;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n intervalX = 0,\n intervalY = 0,\n originX = 0,\n originY = 0,\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n axisZ = xAxis3D(),\n intervalX = 0,\n intervalY = 0,\n intervalZ = 0,\n originX = 0,\n originY = 0,\n originZ = 0,\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats the children modules on every angle given in the `map`.\n *\n * @param Vector[] map - The list of angles at which place the children.\n * @param Vector [offset] - An offset to add before the rotation is applied.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatRotateMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n rotate(vector3D(at)) {\n translate(offset) {\n children();\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = zAxis3D(),\n interval = 0,\n origin = 0,\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : ORIGIN_3D;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n intervalX = 0,\n intervalY = 0,\n originX = 0,\n originY = 0,\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n axisZ = xAxis3D(),\n intervalX = 0,\n intervalY = 0,\n intervalZ = 0,\n originX = 0,\n originY = 0,\n originZ = 0,\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats the children modules on every angle given in the `map`.\n *\n * @param Vector[] map - The list of angles at which place the children.\n * @param Vector [offset] - An offset to add before the rotation is applied.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatRotateMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n rotate(vector3D(at)) {\n translate(offset) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4f955208b26db78d69a394d0c374d5e963f53703","subject":"doc: fix typo","message":"doc: fix typo\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/rotate.scad","new_file":"operator\/repeat\/rotate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = zAxis3D(),\n interval = 0,\n origin = 0,\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : ORIGIN_3D;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n intervalX = 0,\n intervalY = 0,\n originX = 0,\n originY = 0,\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n axisZ = xAxis3D(),\n intervalX = 0,\n intervalY = 0,\n intervalZ = 0,\n originX = 0,\n originY = 0,\n originZ = 0,\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats the children modules on every angle given in the `map`.\n *\n * @param Vector[] map - The list of angles at which place the children.\n * @param Vector [offset] - An offset to add before the rotation is applied.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatRotateMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n rotate(vector3D(at)) {\n translate(offset) {\n children();\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats and rotates the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Number [angle] - The angle interval in which rotate the children.\n * @param Vector [axis] - The rotation axis around which rotate the children.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Vector [origin] - The rotate origin.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n * @param Number [axisX] - The X axis factor (will overwrite the X coordinate in the `axis` vector).\n * @param Number [axisY] - The Y axis factor (will overwrite the Y coordinate in the `axis` vector).\n * @param Number [axisZ] - The Z axis factor (will overwrite the Z coordinate in the `axis` vector).\n * @param Number [originX] - The X origin (will overwrite the X coordinate in the `origin` vector).\n * @param Number [originY] - The Y origin (will overwrite the Y coordinate in the `origin` vector).\n * @param Number [originZ] - The Z origin (will overwrite the Z coordinate in the `origin` vector).\n *\/\nmodule repeatRotate(count = 2,\n angle = DEGREES,\n axis = zAxis3D(),\n interval = 0,\n origin = 0,\n center = false,\n intervalX, intervalY, intervalZ,\n axisX, axisY, axisZ,\n originX, originY, originZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n origin = apply3D(origin, originX, originY, originZ);\n angle = deg(angle);\n partAngle = angle \/ (angle % DEGREES ? count - 1 : count);\n axis = apply3D(axis, axisX, axisY, axisZ) * partAngle;\n offset = center ? -interval * (count - 1) \/ 2 : ORIGIN_3D;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n rotateOrigin(a=axis * i, o=origin) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate2D(countX = 2,\n countY = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n intervalX = 0,\n intervalY = 0,\n originX = 0,\n originY = 0,\n center = false) {\n\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats and rotates the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Number [angleX] - The angle interval in which rotate the children along the X axis.\n * @param Number [angleY] - The angle interval in which rotate the children along the Y axis.\n * @param Number [angleZ] - The angle interval in which rotate the children along the Z axis.\n * @param Vector [axisX] - The rotation axis around which rotate the children along the X axis.\n * @param Vector [axisY] - The rotation axis around which rotate the children along the Y axis.\n * @param Vector [axisZ] - The rotation axis around which rotate the children along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Vector [originX] - The rotate origin along the X axis.\n * @param Vector [originY] - The rotate origin along the Y axis.\n * @param Vector [originZ] - The rotate origin along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatRotate3D(countX = 2,\n countY = 2,\n countZ = 2,\n angleX = DEGREES,\n angleY = DEGREES,\n angleZ = DEGREES,\n axisX = zAxis3D(),\n axisY = yAxis3D(),\n axisZ = xAxis3D(),\n intervalX = 0,\n intervalY = 0,\n intervalZ = 0,\n originX = 0,\n originY = 0,\n originZ = 0,\n center = false) {\n\n repeatRotate(count=countZ, interval=vector3D(intervalZ), angle=angleZ, axis=vector3D(axisZ), origin=originZ, center=center) {\n repeatRotate(count=countY, interval=vector3D(intervalY), angle=angleY, axis=vector3D(axisY), origin=originY, center=center) {\n repeatRotate(count=countX, interval=vector3D(intervalX), angle=angleX, axis=vector3D(axisX), origin=originX, center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats the children modules on every angle given in the `map`.\n *\n * @param Vector[] map - The list of angles at which place the children.\n * @param Vector [offset] - An offset to add before the ratation is applied.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatRotateMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n rotate(vector3D(at)) {\n translate(offset) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d089d446b948806249951ec94c28c864c4c0b4de","subject":"screws\/screw_head: Cleanup and fix drive cut","message":"screws\/screw_head: Cleanup and fix drive cut\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = fallback(override_h, get_screw_head_h(head=head, thread=thread));\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h, align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = head_h\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n tz(-head_h\/2)\n if(drive==\"hex\")\n {\n threadsize_cut = threadsize-head_drive_threadsize_minus(head);\n inset = head_drive_inset(head, head_h);\n tz(inset)\n cylindera(d = fn_radius(threadsize_cut, 6), h = head_h, $fn = 6, align=Z);\n }\n }\n}\n\nfunction head_drive_threadsize_minus(head) =\nhead==\"socket\"? 0:\nhead==\"button\"? 0.5:\nhead==\"set\"? 1.5:\n0;\n\nfunction head_drive_inset(head, head_h) =\nhead==\"socket\"? 1*mm:\nhead==\"button\"? 0.5*mm:\nhead==\"set\"? -head_h\/2:\n0;\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=32;\n all_heads=\n [\n \"socket\",\n \"button\",\n \"set\"\n ];\n for(i=[0:len(all_heads)-1])\n {\n head=all_heads[i];\n tx(i*8*mm)\n screw(nut=NutHexM3, head=head, h=25, orient=-Z);\n }\n\n}\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(part, nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n\n if(part==U)\n {\n difference()\n {\n screw(part=\"pos\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n screw(part=\"neg\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n if($show_vit)\n %screw(part=\"vit\", nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n else if(part==\"pos\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, head=head, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n else if(part==\"neg\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n tz(h\/2+.01)\n screw_head(part=part, head=head, thread=thread_, orient=Z, align=Z);\n }\n else if(part==\"vit\")\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(part, head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n\n if(part==U)\n {\n difference()\n {\n screw_head(part=\"pos\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n screw_head(part=\"neg\", head=head, drive=drive, thread=thread, tolerance=tolerance, override_h=override_h, orient=orient, align=align);\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"button\")\n {\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n else if(head==\"set\")\n {\n if(drive == \"hex\")\n {\n \/\/ set head uses -1*mm smaller hex\n tz(-head_h)\n cylindera(d = fn_radius(threadsize-1, 6), h = 1000, $fn = 6, align=Z);\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\" || head==\"button\")\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n }\n else if(head==\"set\")\n {\n tz(-head_h\/2)\n cylindera(d=threadsize, h=fallback(override_h, head_h), align=Z);\n }\n else\n {\n assert(\"head: not implemented\");\n }\n }\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n tz(-h_\/2-.2)\n screw_thread(thread=nut_thread, h=h_+.1);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"set\", h=25, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7dbf0f61f28d7a273ea24892a426a0a5eb9b0ee6","subject":"[3d] Loosen mating tolerances on probewrap","message":"[3d] Loosen mating tolerances on probewrap\n\n-- Increase space between stacks 0.75->1.25, increase height same amount\nto compensate\n-- Fix lip_poly_stack() interior top point being sloped by err_v amount\n-- Increase err_h to make the parts snap to gether easier\n-- Increase slop between stacks by 0.03mm (likely no change due to layer\nrounding)\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/probewrap.scad","new_file":"3d\/probewrap.scad","new_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.5;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7.5;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 1.25;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule rextrude_180(diameter, h) {\n intersection() {\n translate([-diameter\/2-e, -e, -e])\n cube([diameter+2*e, diameter\/2+e, h+2*e]);\n rotate_extrude()\n children();\n }\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \n translate([0,(center_d-center_w)\/2,0]) \n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.20;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.15;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8+err_v], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","old_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.5;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 0.75;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule rextrude_180(diameter, h) {\n intersection() {\n translate([-diameter\/2-e, -e, -e])\n cube([diameter+2*e, diameter\/2+e, h+2*e]);\n rotate_extrude()\n children();\n }\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \n translate([0,(center_d-center_w)\/2,0]) \n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.15;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.12;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dfcb0da15face0d58ee0c634a2bdc4836458948f","subject":"Change the shape of kite Change line length","message":"Change the shape of kite\nChange line length\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"kite.scad","new_file":"kite.scad","new_contents":"\nlineLength=35;\nbearing =0 + sin($t*360)*45;\nelevation = 30+sin(-$t*360*2)*15;\nyaw = bearing-sin($t*360)*30;\ndrift=5;\nroll = sin(360*$t+90+drift)*120;\nangleOfAttack=15;\npitch=elevation + angleOfAttack;\nuseNED=-1;\nrotate(a=bearing, v=[0,0,1*useNED]) rotate(a=elevation, v=[0,1*useNED,0]){\n\ttranslate(v=[lineLength\/2,0,0]) cube(size=[lineLength,0.1,0.1], center=true);\n\ttranslate(v=[lineLength,0,0]) \n \t rotate(a=-1*elevation, v=[0,1*useNED,0]) rotate(a=-1*bearing, v=[0,0,1*useNED])\n\t rotate(a=yaw ,v=[0,0,1*useNED]) rotate(a=pitch, v=[0,1*useNED,0]) rotate(a=roll, v=[1,0,0]) \n color(\"red\") \n\/\/cube(size=[0.1,,3,1],center=true); }\npolygon(points=[[2,0],[2,1], [1.5,2],[0,3],[1.3,2],[1.8,1], [1.8,0],[1.8,-1],[1.3,-2],[0,-3],[1.5,-2],[2,-1]], paths=[[0,1,2,3,4,5,6,7,8,9,10,11]]);}\n\/\/import(\"skpfile.stl\");\n","old_contents":"\nlineLength=20;\nbearing =0 + sin($t*360)*45;\nelevation = 30+sin(-$t*360*2)*15;\nyaw = bearing-sin($t*360)*30;\ndrift=5;\nroll = sin(360*$t+90+drift)*120;\nangleOfAttack=15;\npitch=elevation + angleOfAttack;\nuseNED=-1;\nrotate(a=bearing, v=[0,0,1*useNED]) rotate(a=elevation, v=[0,1*useNED,0]){\n\ttranslate(v=[lineLength\/2,0,0]) cube(size=[lineLength,0.1,0.1], center=true);\n\ttranslate(v=[lineLength,0,0]) \n \t rotate(a=-1*elevation, v=[0,1*useNED,0]) rotate(a=-1*bearing, v=[0,0,1*useNED])\n\t rotate(a=yaw ,v=[0,0,1*useNED]) rotate(a=pitch, v=[0,1*useNED,0]) rotate(a=roll, v=[1,0,0]) \n color(\"red\") cube(size=[0.1,,3,1],center=true); }","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7c1c75e5c0915c98bd668df9f268497bf8114db1","subject":"Detab.","message":"Detab.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\ni_height = 180; \/\/ z (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness*2, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness*2, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\ni_height = 180; \/\/ z (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n\tdifference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness*2, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness*2, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n\t}\n}\n\nmodule vert_face_base(x) {\n\ttranslate([x-thickness\/2,-overhang,overhang])\n\t\tcube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n\t\tcutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n\t\tcutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n\t\tcutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n\t\tcutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n\ttranslate([thickness,-outset,base_height])\n\tdifference() {\n\t\tcube([base_width, depth+outset*2, thickness]);\n\t\tcutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n\t\tcutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n\t}\n}\n\nmodule light_bar() {\n\ttranslate([light_pos_x-light_bar_width\/2, -outset, light_height])\n\tdifference() {\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\n\t\tcutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n\t\tcutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n\t}\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n\tdifference() {\n side_base(y);\n\t\tvert_face(x=0);\n\t\tvert_face(x=width);\n\t\ttank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n\t}\n}\n\nmodule side_base(y) {\n\ttranslate([-overhang,y-thickness\/2,0])\n\t\tcube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"49e09a4398945b92f5632f9d61e394c9c06dac27","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"bdfd8d778bc9356c74246145e535f0fc60487df4","subject":"bearing: fix ziptie\/clip distance etc","message":"bearing: fix ziptie\/clip distance etc\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],bearing_type[2]], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n ziptie_thickness_cut = bearing_type[1]+ziptie_bearing_distance+ziptie_thickness*3;\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*3,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use \ninclude \n\nmodule bearing(bearing_type, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[bearing_type[1],bearing_type[1],bearing_type[2]], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=bearing_type[2], d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=bearing_type[2]+1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(j=[-1,1])\n translate([0,0,j*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1, d=bearing_type[2]+1, align=[0,0,0]);\n fncylindera(h=2, d=bearing_type[4]-clip_depth, align=[0,0,0]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=2*mm, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist;\n ziptie_thickness_cut = bearing_type[1]+ziptie_bearing_distance+ziptie_thickness*3;\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2], d=bearing_type[1]*rod_fit_tolerance, orient=[0,0,1]);\n\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*3,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1]\n );\n\n\n \/\/ bearing\n fncylindera(h=bearing_type[2], d=bearing_type[1], orient=[0,0,1]);\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(i=[-1,1])\n translate([0,0,i*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1]\n );\n }\n }\n }\n}\n\n\/*bearing_mount_holes(zaxis_bearing, orient=[0,0,1]);*\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0baf8e16d9c8af0fa0df454c3a94d83e8cf06c75","subject":"Checkpoint current state of thing:1679353","message":"Checkpoint current state of thing:1679353\n\nThis is actually the current state of spacer1 as well, and this work really\nshould have happened in a branch with the file named spacer2 all along...\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-fan-spacer\/spacer2.scad","new_file":"wanhao-i3-fan-spacer\/spacer2.scad","new_contents":"\/* This is a bit of a hack since angled holes are required. *\/\ngSpacerThick = 9;\ngSpacerPlusHeatsinkThick = 11;\ngFanThick = 10; \/\/ hole right in the middle?\ngMotorHoleSpacing = 31;\ngFanHoleSpacing = 32;\ngGrillThick = 3;\n\n\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=gSpacerThick) {\n linear_extrude(height=thick)\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) circle(r=r);\n}\n\nmodule SpacerHole(thick=gSpacerThick) {\n \/\/ TODO\n \/\/translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\n\/* For reuse building the two parts to line up *\/\nmodule LowerHull(w,r,thick,d=0) {\n linear_extrude(height=thick) hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) circle(r=r);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) circle(r=r);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n translate([0,0,-1]) linear_extrude(height=thick+2)\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y]) circle(r=r);\n }\n \/\/ this is rotated, so can't linear_extrude easily\n hull() {\n for(y=[-r-1,-10])\n translate([0,y,thick])\n rotate([0,90,0]) cylinder(r=2,h=100,center=true);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.7,h=100);\n }\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=gGrillThick) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\ngOffset = 0.5;\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01])\n ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n translate([0,gOffset,0]) FanGrill(r=16,height=thick-1);\n \/\/ TOOD angle this\n \/*for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n *\/\n }\n \/\/ Top part\n difference() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\n\/\/translate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\ntranslate([0,-40,0]) translate([0,20,-12])\ndifference() {\n union() {\n translate([0,-20,12]) SpacerPair();\n \/\/FanMount($fn=64);\n }\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\ndifference() {\n FanMount($fn=64);\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wanhao-i3-fan-spacer\/spacer2.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"c4c3af8bcaeac765efcfcbf2f0bf6b03e2181ded","subject":"Improve number detection","message":"Improve number detection\n","repos":"jsconan\/camelSCAD","old_file":"core\/type.scad","new_file":"core\/type.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Type detection and type casting.\r\n *\r\n * @package core\/type\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Checks if the value is undefined.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is defined.\r\n *\/\r\nfunction isUndef(value) = (value == undef);\r\n\r\n\/**\r\n * Checks if the value is NAN (Not A Number).\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is NAN.\r\n *\/\r\nfunction isNAN(value) = (value != value);\r\n\r\n\/**\r\n * Checks if the value is infinite.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is infinite.\r\n *\/\r\nfunction isInfinity(value) = (value >= INFINITY || value <= -INFINITY);\r\n\r\n\/**\r\n * Checks if the value is numeric.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is numeric.\r\n *\/\r\nfunction isNumber(value) = (value == value && sign(value) != undef);\r\n\r\n\/**\r\n * Checks if the value is integer.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is integer.\r\n *\/\r\nfunction isInteger(value) = (value != undef && floor(value) == value);\r\n\r\n\/**\r\n * Checks if the value is small enough to be considered equal to 0.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is equal to 0 or near enough.\r\n *\/\r\nfunction isZero(value) = (isNumber(value) && value > -EPSILON && value < EPSILON);\r\n\r\n\/**\r\n * Checks if the value is boolean.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is boolean.\r\n *\/\r\nfunction isBoolean(value) = (value == true || value == false);\r\n\r\n\/**\r\n * Checks if the value is a string.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a string.\r\n *\/\r\nfunction isString(value) = (len(value) != undef && concat(value) != value);\r\n\r\n\/**\r\n * Checks if the value is an array or a vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is an array or a vector.\r\n *\/\r\nfunction isArray(value) = (len(value) != undef && concat(value) == value);\r\n\r\n\/**\r\n * Checks if the value is a vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a vector.\r\n *\/\r\nfunction isVector(value) = (len(value) != undef && value * 1 == value);\r\n\r\n\/**\r\n * Checks if the value is a N-dimensions vector.\r\n *\r\n * @param * value - The value to check.\r\n * @param Number length - The required length of the vector.\r\n * @returns Boolean - Returns `true` whether the value is a vector and has the required length.\r\n *\/\r\nfunction isVectorN(value, length) = (len(value) == float(length) && value * 1 == value);\r\n\r\n\/**\r\n * Checks if the value is a 2D vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a 2D vector.\r\n *\/\r\nfunction isVector2D(value) = (len(value) == 2 && value * 1 == value);\r\n\r\n\/**\r\n * Checks if the value is a 3D vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a 3D vector.\r\n *\/\r\nfunction isVector3D(value) = (len(value) == 3 && value * 1 == value);\r\n\r\n\/**\r\n * Typecasts the value to a number.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, 0 will be returned.\r\n *\/\r\nfunction number(value) = value == true ? 1 : float(value);\r\n\r\n\/**\r\n * Typecasts the value to a float.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, 0 will be returned.\r\n *\/\r\nfunction float(value) = value && isNumber(value) ? value : 0;\r\n\r\n\/**\r\n * Typecasts the value to a float, and ensures it is a safe divisor.\r\n * Prevent \"divide by zero\" issues.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, of if the value is 0, 1 will be returned.\r\n *\/\r\nfunction divisor(value) = value && isNumber(value) ? value : 1;\r\n\r\n\/**\r\n * Typecasts the value to an integer.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, 0 will be returned.\r\n *\/\r\nfunction integer(value) =\r\n !value ? 0\r\n :let( value = float(value) )\r\n value > 0 ? floor(value)\r\n :value < 0 ? ceil(value)\r\n :0\r\n;\r\n\r\n\/**\r\n * Typecasts the value to a boolean.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Boolean - Returns a boolean. Falsy values will be replaced by `false`, while others will be replaced by `true`.\r\n *\/\r\nfunction boolean(value) = !value || value == \"false\" ? false : true;\r\n\r\n\/**\r\n * Typecasts the value to a string.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns String - Returns a string. Strings remain unchanged, other values are \"stringified\".\r\n *\/\r\nfunction string(value) = isUndef(value) ? \"\" : str(value);\r\n\r\n\/**\r\n * Typecasts the value to an array.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Array - Returns an array. Arrays and vectors remain unchanged.\r\n * `undef` produces an empty array, other values are wrapped in an array.\r\n *\/\r\nfunction array(value) = isUndef(value) ? [] : concat(value);\r\n\r\n\/**\r\n * Typecasts the value to a vector with the desired length.\r\n * If a number is provided instead of a vector, a vector will all elements filled with the provided number will be returned.\r\n *\r\n * @param Vector|Number value - The value to cast.\r\n * @param Number length - The desired vector length.\r\n * @returns Vector - Returns a vector. Vectors remain unchanged, unless they don't have the required length,\r\n * additional elements are removed while missing ones are replaced by 0.\r\n * Arrays are casted, not numbers are replaced by 0.\r\n * Other values are replaced by an array with the requested length where all elements are 0.\r\n *\/\r\nfunction vector(value, length) =\r\n let(\r\n array = isArray(value),\r\n l = array ? len(value) : 0,\r\n length = float(isUndef(length) ? l : length)\r\n )\r\n !array ? fill(float(value), length)\r\n :length ? [ for (i = [0 : length - 1]) float(value[i]) ]\r\n :[]\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Type detection and type casting.\r\n *\r\n * @package core\/type\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Checks if the value is undefined.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is defined.\r\n *\/\r\nfunction isUndef(value) = (value == undef);\r\n\r\n\/**\r\n * Checks if the value is NAN (Not A Number).\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is NAN.\r\n *\/\r\nfunction isNAN(value) = (value != value);\r\n\r\n\/**\r\n * Checks if the value is infinite.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is infinite.\r\n *\/\r\nfunction isInfinity(value) = (value >= INFINITY || value <= -INFINITY);\r\n\r\n\/**\r\n * Checks if the value is numeric.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is numeric.\r\n *\/\r\nfunction isNumber(value) = (sign(value) != undef);\r\n\r\n\/**\r\n * Checks if the value is integer.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is integer.\r\n *\/\r\nfunction isInteger(value) = (value != undef && floor(value) == value);\r\n\r\n\/**\r\n * Checks if the value is small enough to be considered equal to 0.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is equal to 0 or near enough.\r\n *\/\r\nfunction isZero(value) = (sign(value) != undef && value > -EPSILON && value < EPSILON);\r\n\r\n\/**\r\n * Checks if the value is boolean.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is boolean.\r\n *\/\r\nfunction isBoolean(value) = (value == true || value == false);\r\n\r\n\/**\r\n * Checks if the value is a string.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a string.\r\n *\/\r\nfunction isString(value) = (len(value) != undef && concat(value) != value);\r\n\r\n\/**\r\n * Checks if the value is an array or a vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is an array or a vector.\r\n *\/\r\nfunction isArray(value) = (len(value) != undef && concat(value) == value);\r\n\r\n\/**\r\n * Checks if the value is a vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a vector.\r\n *\/\r\nfunction isVector(value) = (len(value) != undef && value * 1 == value);\r\n\r\n\/**\r\n * Checks if the value is a N-dimensions vector.\r\n *\r\n * @param * value - The value to check.\r\n * @param Number length - The required length of the vector.\r\n * @returns Boolean - Returns `true` whether the value is a vector and has the required length.\r\n *\/\r\nfunction isVectorN(value, length) = (len(value) == float(length) && value * 1 == value);\r\n\r\n\/**\r\n * Checks if the value is a 2D vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a 2D vector.\r\n *\/\r\nfunction isVector2D(value) = (len(value) == 2 && value * 1 == value);\r\n\r\n\/**\r\n * Checks if the value is a 3D vector.\r\n *\r\n * @param * value - The value to check.\r\n * @returns Boolean - Returns `true` whether the value is a 3D vector.\r\n *\/\r\nfunction isVector3D(value) = (len(value) == 3 && value * 1 == value);\r\n\r\n\/**\r\n * Typecasts the value to a number.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, 0 will be returned.\r\n *\/\r\nfunction number(value) = value == true ? 1 : float(value);\r\n\r\n\/**\r\n * Typecasts the value to a float.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, 0 will be returned.\r\n *\/\r\nfunction float(value) = sign(value) ? value : 0;\r\n\r\n\/**\r\n * Typecasts the value to a float, and ensures it is a safe divisor.\r\n * Prevent \"divide by zero\" issues.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, of if the value is 0, 1 will be returned.\r\n *\/\r\nfunction divisor(value) = sign(value) ? value : 1;\r\n\r\n\/**\r\n * Typecasts the value to an integer.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Number - Returns a number. If the value cannot be casted, 0 will be returned.\r\n *\/\r\nfunction integer(value) =\r\n let( s = sign(value) )\r\n s > 0 ? floor(value)\r\n :s < 0 ? ceil(value)\r\n :0\r\n;\r\n\r\n\/**\r\n * Typecasts the value to a boolean.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Boolean - Returns a boolean. Falsy values will be replaced by `false`, while others will be replaced by `true`.\r\n *\/\r\nfunction boolean(value) = !value || value == \"false\" ? false : true;\r\n\r\n\/**\r\n * Typecasts the value to a string.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns String - Returns a string. Strings remain unchanged, other values are \"stringified\".\r\n *\/\r\nfunction string(value) = isUndef(value) ? \"\" : str(value);\r\n\r\n\/**\r\n * Typecasts the value to an array.\r\n *\r\n * @param * value - The value to cast.\r\n * @returns Array - Returns an array. Arrays and vectors remain unchanged.\r\n * `undef` produces an empty array, other values are wrapped in an array.\r\n *\/\r\nfunction array(value) = isUndef(value) ? [] : concat(value);\r\n\r\n\/**\r\n * Typecasts the value to a vector with the desired length.\r\n * If a number is provided instead of a vector, a vector will all elements filled with the provided number will be returned.\r\n *\r\n * @param Vector|Number value - The value to cast.\r\n * @param Number length - The desired vector length.\r\n * @returns Vector - Returns a vector. Vectors remain unchanged, unless they don't have the required length,\r\n * additional elements are removed while missing ones are replaced by 0.\r\n * Arrays are casted, not numbers are replaced by 0.\r\n * Other values are replaced by an array with the requested length where all elements are 0.\r\n *\/\r\nfunction vector(value, length) =\r\n let(\r\n array = isArray(value),\r\n l = array ? len(value) : 0,\r\n length = float(isUndef(length) ? l : length)\r\n )\r\n !array ? fill(float(value), length)\r\n :length ? [ for (i = [0 : length - 1]) float(value[i]) ]\r\n :[]\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"04f9b73adefb4bd270b486bc6dc2ac71d27b25be","subject":"[3d] Change LED holes to be small pillars","message":"[3d] Change LED holes to be small pillars\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"775cd87b14ba804a001604351f011bf65bb84b74","subject":"reset full assembly in mush.scad","message":"reset full assembly in mush.scad\n","repos":"DamCB\/mush","old_file":"scad\/openscad\/mush.scad","new_file":"scad\/openscad\/mush.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n$fn = 360;\nlatitude = 30;\nlongitude = 20;\n\n\/\/camera_arc();\n\/\/camera_stand();\n\/\/lens_75_stand();\n\/\/focus_knob();\n\n\nrotate([0, 0, longitude]) union() {\n rotate([0, latitude, 0]) detection();\n sliders();\n}\n\nrail(); \/* *\/\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n$fn = 360;\nlatitude = 0;\n\n\/\/rotate([0, latitude, 0]) detection();\n\/\/focus_knob();\n\n\/\/camera_arc();\n\/\/camera_stand();\nlens_75_stand();\n\n\n\/\/sliders();\n\/\/rail(); \/* *\/\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"0554921a174ff1efbac6dac115f9639a6ff30226","subject":"y\/idler: add washers","message":"y\/idler: add washers\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2),\n align=N,\n orient=X\n );\n \/*rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);*\/\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n tz(extrusion_size\/2+yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", h=extrusion_size+yaxis_idler_mount_thickness+10*mm, head_embed=false, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n washer_h=.8*mm + .1*mm;\n h = yaxis_idler_pulley_h + 2*washer_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2), orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n\n \/\/ pulley+washers cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5+2*washer_h],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n {\n tx(yaxis_idler_pulley_tight_len\/2)\n tx(5*mm)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, screw_l=12*mm, trap_axis=-Z, orient=-X, align=X);\n\n tx(-yaxis_idler_pulley_tight_len\/2)\n screw_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, h=7*mm, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n \/\/ TODO: add washers\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, Z], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\nif(false)\n{\n yaxis_idler();\n yaxis_idler_pulleyblock();\n}\n\nif(false)\n{\n attach([N,-X], yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n}\n","old_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n t([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2),\n align=N,\n orient=X\n );\n \/*rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*2, orient=X, align=X);*\/\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n tz(extrusion_size\/2+yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n tx(-extrusion_size\/2-yaxis_idler_mount_thickness)\n ty(y*yaxis_idler_tightscrew_dist)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ pulley block adjustment screw\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2+yaxis_belt_path_offset_z)\n t(yaxis_idler_mount_adjustscrew_offset)\n screw_cut(yaxis_idler_mount_adjustscrew_hexnut, head=\"button\", h=extrusion_size+yaxis_idler_mount_thickness+10*mm, head_embed=false, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n d=yaxis_idler_mount_tightscrew_hexnut_dia*2;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ idler\n tz(h\/2)\n rcylindera(d=yaxis_idler_pulley_thread_dia+15*mm, h=h, orient=-Z, align=-Z);\n\n \/\/ tension screws\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n rcubea([d,d,yaxis_idler_pulley_tight_len], orient=X, align=X);\n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n t(yaxis_idler_mount_adjustscrew_offset)\n rcylindera(d=yaxis_idler_mount_adjustscrew_hexnut_dia*sqrt(2), orient=X, align=X);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/\/ tension screws\n for(y=[-1,1])\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n ty(y*yaxis_idler_tightscrew_dist)\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, nut_offset=2*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n\n \/\/ adjustment screw\n tx(-yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len)\n tx(yaxis_idler_pulley_tight_len\/2)\n t(yaxis_idler_mount_adjustscrew_offset)\n {\n tx(yaxis_idler_pulley_tight_len\/2)\n tx(5*mm)\n nut_trap_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, screw_l=12*mm, trap_axis=-Z, orient=-X, align=X);\n\n tx(-yaxis_idler_pulley_tight_len\/2)\n screw_cut(nut=yaxis_idler_mount_adjustscrew_hexnut, h=7*mm, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, -Z], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, Z], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\nif(false)\n{\n yaxis_idler();\n yaxis_idler_pulleyblock();\n}\n\nif(false)\n{\n attach([N,-X], yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"615e06a5ca28c5512422231d0c0a8f92177cee54","subject":"xaxis\/ends: fix missing vit (pulleys\/screws)","message":"xaxis\/ends: fix missing vit (pulleys\/screws)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=x==1);\n \/*xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);*\/\n }\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 5*mm, 0])\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=x==1);\n \/*xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);*\/\n }\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"28b7017bd10ab696e80fd87e46f86859cfc3a03c","subject":"xaxis\/carriage\/extruder_b: Use nut_trap_cut for body\/guidler screws","message":"xaxis\/carriage\/extruder_b: Use nut_trap_cut for body\/guidler screws\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/*translate([0,-between_bearing_and_gear,0])*\/\n \/*translate([0,-extruder_a_bearing[2],0])*\/\n \/*extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\n\/*explode=[0,0,0];*\/\nexplode=[0,10,0];\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n }\n\n rotate([-90,0,0])\n extruder_b(with_sensormount=false);\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset_y,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/*translate([0,-between_bearing_and_gear,0])*\/\n \/*translate([0,-extruder_a_bearing[2],0])*\/\n \/*extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=1000, nut_offset=0*mm, head_embed=false, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n \/*hull()*\/\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\n\/*explode=[0,0,0];*\/\nexplode=[0,10,0];\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*x_carriage_full(show_vitamins=false);*\/\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n }\n\n rotate([-90,0,0])\n extruder_b(with_sensormount=false);\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"413ef1676c55fc8ac32b064c114ba10e17624a43","subject":"moved projector support bream to own file","message":"moved projector support bream to own file\n","repos":"fponticelli\/smallbridges","old_file":"resin\/support_projector_beam.scad","new_file":"resin\/support_projector_beam.scad","new_contents":"use <..\/scad\/geom.scad>\nuse <..\/scad\/brackets.scad>\n\nmodule support_projector_beam(width) {\n module half() {\n translate([0,0,-40])\n rotate_z_at(180, [10,10])\n rotate_y_at(90, [10,10])\n angle_corner_connector();\n translate([0,40,0])\n rotate_y_at(-90, [10,10])\n angle_corner_connector();\n\n translate([0,-20,-20])\n rotate_x_at(90, [10,10])\n rotate_z_at(180, [10,10])\n angle_corner_connector();\n }\n translate([width\/2, 0, 0])\n half();\n translate(-[width\/2, 0, 0])\n mirror([1,0,0])\n half();\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'resin\/support_projector_beam.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f2537d5b7429a046d19e4f2037c8fecf13f8567b","subject":"added or_grantry_plate_test","message":"added or_grantry_plate_test\n","repos":"fponticelli\/smallbridges","old_file":"scad\/or_gantry_plate.scad","new_file":"scad\/or_gantry_plate.scad","new_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nor_gantry_plate_height=3.175;\r\n\r\nd71 = 7.1;\r\nd52 = 5.2;\r\n\r\ni100 = 10;\r\ni200 = 20;\r\ni223 = 22.3;\r\ni263 = 26.3;\r\ni300 = 30;\r\ni323 = 32.3;\r\ni350 = 35;\r\ni400 = 40;\r\ni423 = 42.3;\r\ni523 = 52.3;\r\ni550 = 55;\r\ni623 = 62.3;\r\n\r\nor_gantry_plate_holes = [\r\n\t[],\r\n\t[\r\n\t\t\/\/ 80x80\r\n\t\t[[-i223,0],d71],[[-i223,i223],d71],[[-i223,-i223],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i223,0],d52],[[i223,i223],d52],[[i223,-i223],d52],[[0,i223],d52],[[0,-i223],d52]\r\n\t], [\r\n\t\t\/\/ 100x120\r\n\t\t[[-i323,0],d71],\r\n\t\t[[-i223,i423],d71],[[-i323,i423],d71],[[-i223,-i423],d71],[[-i323,-i423],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,i100],d52],[[i200,-i100],d52],[[-i200,i100],d52],[[-i200,-i100],d52],\r\n\t\t[[i100,i200],d52],[[i100,-i200],d52],[[-i100,i200],d52],[[-i100,-i200],d52],\r\n\t\t[[i100,i300],d52],[[i100,-i300],d52],[[-i100,i300],d52],[[-i100,-i300],d52],\r\n\t\t[[i323,0],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[0,i423],d52],[[0,-i423],d52],[[i100,i423],d52],[[i100,-i423],d52],[[-i100,i423],d52],[[-i100,-i423],d52],\r\n\t\t[[i223,i423],d52],[[i323,i423],d52],[[i223,-i423],d52],[[i323,-i423],d52]\r\n\t], [\r\n\t\t\/\/ 120x140\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,0],d52],[[i300,0],d52],[[-i200,0],d52],[[-i300,0],d52],\r\n\t\t[[0,i200],d52],[[0,i300],d52],[[0,-i200],d52],[[0,-i300],d52],\r\n\t\t[[i200,i300],d52],[[i200,-i300],d52],[[-i200,i300],d52],[[-i200,-i300],d52],\r\n\t\t[[i300,i200],d52],[[i300,-i200],d52],[[-i300,i200],d52],[[-i300,-i200],d52],\r\n\r\n\t\t[[i400,0],d52],[[i423,i100],d52],[[i423,-i100],d52],\r\n\t\t[[i400,i263],d52],[[i400,-i263],d52],\r\n\r\n\t\t[[-i400,0],d71],[[-i423,i100],d52],[[-i423,-i100],d52],\r\n\t\t[[-i400,i263],d71],[[-i400,-i263],d71],\r\n\t\t[[0,i523],d52],[[i100,i523],d52],[[i223,i523],d52],[[i323,i523],d52],[[i423,i523],d52],\r\n\t\t[[0,-i523],d52],[[i100,-i523],d52],[[i223,-i523],d52],[[i323,-i523],d52],[[i423,-i523],d52],\r\n\t\t[[0,i523],d52],[[-i100,i523],d52],[[-i223,i523],d71],[[-i323,i523],d71],[[-i423,i523],d71],\r\n\t\t[[0,-i523],d52],[[-i100,-i523],d52],[[-i223,-i523],d71],[[-i323,-i523],d71],[[-i423,-i523],d71]\r\n\t], [\r\n\t\t\/\/ 140x160\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i300,0],d52],[[0,i300],d52],[[-i300,0],d52],[[0,-i300],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[i100,i400],d52],[[i100,-i400],d52],[[-i100,i400],d52],[[-i100,-i400],d52],\r\n\t\t[[i300,i400],d52],[[i300,-i400],d52],[[-i300,i400],d52],[[-i300,-i400],d52],\r\n\t\t[[i400,i300],d52],[[i400,-i300],d52],[[-i400,i300],d52],[[-i400,-i300],d52],\r\n\t\t[[i100,i550],d52],[[i100,-i550],d52],[[-i100,i550],d52],[[-i100,-i550],d52],\r\n\t\t[[i523,0],d52],[[-i523,0],d71],\r\n\t\t[[i523,i350],d52],[[-i523,i350],d71],[[i523,-i350],d52],[[-i523,-i350],d71],\r\n\t\t[[0,i623],d52],[[i100,i623],d52],[[i223,i623],d52],[[i323,i623],d52],[[i423,i623],d52],[[i523,i623],d52],[[-i100,i623],d52],[[-i223,i623],d71],[[-i323,i623],d71],[[-i423,i623],d71],[[-i523,i623],d71],\r\n\t\t[[0,-i623],d52],[[i100,-i623],d52],[[i223,-i623],d52],[[i323,-i623],d52],[[i423,-i623],d52],[[i523,-i623],d52],[[-i100,-i623],d52],[[-i223,-i623],d71],[[-i323,-i623],d71],[[-i423,-i623],d71],[[-i523,-i623],d71]\r\n\t]\r\n];\r\n\r\nmodule or_gantry_plate(mod = 1) {\r\n\t$fn=50;\r\n\tr=10;\r\n\tw=80;\r\n\th=80;\r\n\tsizes=[[-1,-1],[80,80],[100,120],[120,140],[140,160]];\r\n\tmw = sizes[mod][0];\r\n\tmh = sizes[mod][1];\r\n\r\n\tbom(str(\"ORGP_\",mod), str(\"OpenRail Gantry Plate: \", mw, \"x\", mh, \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack)\r\n\t\tdifference() {\r\n\t\t\thull()\r\n\t\t\t\tfor(x = [-1,1], y = [-1,1])\r\n\t\t\t\t\ttranslate([x*(mw\/2-10),y*(mh\/2-10),-or_gantry_plate_height\/2])\r\n\t\t\t\t\t\tcylinder(r=r,h=or_gantry_plate_height);\r\n\t\t\ttranslate([0,0,-or_gantry_plate_height]) {\r\n\t\t\t\tfor(p = or_gantry_plate_holes[mod])\r\n\t\t\t\t\ttranslate (p[0])\r\n\t\t\t\t\t\tcylinder(r=p[1]\/2,h=or_gantry_plate_height*2);\r\n\t\t\t}\r\n\t\t}\r\n}\r\n\r\nmodule or_gantry_plate_test() {\r\n\ttranslate([-300, 0, 0])\r\n\t\tor_gantry_plate(1);\r\n\ttranslate([-100, 0, 0])\r\n\t\tor_gantry_plate(2);\r\n\ttranslate([100, 0, 0])\r\n\t\tor_gantry_plate(3);\r\n\ttranslate([300, 0, 0])\r\n\t\tor_gantry_plate(4);\r\n}","old_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nor_gantry_plate_height=3.175;\r\n\r\nd71 = 7.1;\r\nd52 = 5.2;\r\n\r\ni100 = 10;\r\ni200 = 20;\r\ni223 = 22.3;\r\ni263 = 26.3;\r\ni300 = 30;\r\ni323 = 32.3;\r\ni350 = 35;\r\ni400 = 40;\r\ni423 = 42.3;\r\ni523 = 52.3;\r\ni550 = 55;\r\ni623 = 62.3;\r\n\r\nor_gantry_plate_holes = [\r\n\t[],\r\n\t[\r\n\t\t\/\/ 80x80\r\n\t\t[[-i223,0],d71],[[-i223,i223],d71],[[-i223,-i223],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i223,0],d52],[[i223,i223],d52],[[i223,-i223],d52],[[0,i223],d52],[[0,-i223],d52]\r\n\t], [\r\n\t\t\/\/ 100x120\r\n\t\t[[-i323,0],d71],\r\n\t\t[[-i223,i423],d71],[[-i323,i423],d71],[[-i223,-i423],d71],[[-i323,-i423],d71],\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,i100],d52],[[i200,-i100],d52],[[-i200,i100],d52],[[-i200,-i100],d52],\r\n\t\t[[i100,i200],d52],[[i100,-i200],d52],[[-i100,i200],d52],[[-i100,-i200],d52],\r\n\t\t[[i100,i300],d52],[[i100,-i300],d52],[[-i100,i300],d52],[[-i100,-i300],d52],\r\n\t\t[[i323,0],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[0,i423],d52],[[0,-i423],d52],[[i100,i423],d52],[[i100,-i423],d52],[[-i100,i423],d52],[[-i100,-i423],d52],\r\n\t\t[[i223,i423],d52],[[i323,i423],d52],[[i223,-i423],d52],[[i323,-i423],d52]\r\n\t], [\r\n\t\t\/\/ 120x140\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i200,0],d52],[[i300,0],d52],[[-i200,0],d52],[[-i300,0],d52],\r\n\t\t[[0,i200],d52],[[0,i300],d52],[[0,-i200],d52],[[0,-i300],d52],\r\n\t\t[[i200,i300],d52],[[i200,-i300],d52],[[-i200,i300],d52],[[-i200,-i300],d52],\r\n\t\t[[i300,i200],d52],[[i300,-i200],d52],[[-i300,i200],d52],[[-i300,-i200],d52],\r\n\r\n\t\t[[i400,0],d52],[[i423,i100],d52],[[i423,-i100],d52],\r\n\t\t[[i400,i263],d52],[[i400,-i263],d52],\r\n\r\n\t\t[[-i400,0],d71],[[-i423,i100],d52],[[-i423,-i100],d52],\r\n\t\t[[-i400,i263],d71],[[-i400,-i263],d71],\r\n\t\t[[0,i523],d52],[[i100,i523],d52],[[i223,i523],d52],[[i323,i523],d52],[[i423,i523],d52],\r\n\t\t[[0,-i523],d52],[[i100,-i523],d52],[[i223,-i523],d52],[[i323,-i523],d52],[[i423,-i523],d52],\r\n\t\t[[0,i523],d52],[[-i100,i523],d52],[[-i223,i523],d71],[[-i323,i523],d71],[[-i423,i523],d71],\r\n\t\t[[0,-i523],d52],[[-i100,-i523],d52],[[-i223,-i523],d71],[[-i323,-i523],d71],[[-i423,-i523],d71]\r\n\t], [\r\n\t\t\/\/ 140x160\r\n\t\t[[0,0],d52],[[i100,0],d52],[[0,i100],d52],[[-i100,0],d52],[[0,-i100],d52],\r\n\t\t[[i300,0],d52],[[0,i300],d52],[[-i300,0],d52],[[0,-i300],d52],\r\n\t\t[[i400,i100],d52],[[i400,-i100],d52],[[-i400,i100],d52],[[-i400,-i100],d52],\r\n\t\t[[i100,i400],d52],[[i100,-i400],d52],[[-i100,i400],d52],[[-i100,-i400],d52],\r\n\t\t[[i300,i400],d52],[[i300,-i400],d52],[[-i300,i400],d52],[[-i300,-i400],d52],\r\n\t\t[[i400,i300],d52],[[i400,-i300],d52],[[-i400,i300],d52],[[-i400,-i300],d52],\r\n\t\t[[i100,i550],d52],[[i100,-i550],d52],[[-i100,i550],d52],[[-i100,-i550],d52],\r\n\t\t[[i523,0],d52],[[-i523,0],d71],\r\n\t\t[[i523,i350],d52],[[-i523,i350],d71],[[i523,-i350],d52],[[-i523,-i350],d71],\r\n\t\t[[0,i623],d52],[[i100,i623],d52],[[i223,i623],d52],[[i323,i623],d52],[[i423,i623],d52],[[i523,i623],d52],[[-i100,i623],d52],[[-i223,i623],d71],[[-i323,i623],d71],[[-i423,i623],d71],[[-i523,i623],d71],\r\n\t\t[[0,-i623],d52],[[i100,-i623],d52],[[i223,-i623],d52],[[i323,-i623],d52],[[i423,-i623],d52],[[i523,-i623],d52],[[-i100,-i623],d52],[[-i223,-i623],d71],[[-i323,-i623],d71],[[-i423,-i623],d71],[[-i523,-i623],d71]\r\n\t]\r\n];\r\n\r\nmodule or_gantry_plate(mod = 1) {\r\n\t$fn=50;\r\n\tr=10;\r\n\tw=80;\r\n\th=80;\r\n\tsizes=[[-1,-1],[80,80],[100,120],[120,140],[140,160]];\r\n\tmw = sizes[mod][0];\r\n\tmh = sizes[mod][1];\r\n\r\n\tbom(str(\"ORGP_\",mod), str(\"OpenRail Gantry Plate: \", mw, \"x\", mh, \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack)\r\n\t\tdifference() {\r\n\t\t\thull()\r\n\t\t\t\tfor(x = [-1,1], y = [-1,1])\r\n\t\t\t\t\ttranslate([x*(mw\/2-10),y*(mh\/2-10),-or_gantry_plate_height\/2])\r\n\t\t\t\t\t\tcylinder(r=r,h=or_gantry_plate_height);\r\n\t\t\ttranslate([0,0,-or_gantry_plate_height]) {\r\n\t\t\t\tfor(p = or_gantry_plate_holes[mod])\r\n\t\t\t\t\ttranslate (p[0])\r\n\t\t\t\t\t\tcylinder(r=p[1]\/2,h=or_gantry_plate_height*2);\r\n\t\t\t}\r\n\t\t}\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9930fb9330b58601eed964aa55f0876d7328273a","subject":"Some information on the mouning hole for the Cherry MX switches was added.","message":"Some information on the mouning hole for the Cherry MX switches was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/office\/keyboard\/panels\/examples\/cherry-mx-switches\/cherry-mx-switches.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/office\/keyboard\/panels\/examples\/cherry-mx-switches\/cherry-mx-switches.scad","new_contents":"\r\n\r\n\/\/ This site lists the Cherry MX switch mounting hole dimensions as follows:\r\n\/\/\r\n\/\/ \t\thttp:\/\/www.makeuseof.com\/tag\/make-custom-shortcut-buttons-arduino\/\r\n\/\/\r\n\/\/\t\t14mm x 14mm mounting hole, with a plate height less than 1.5mm\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/library\/src\/main\/openscad\/office\/keyboard\/panels\/examples\/cherry-mx-switches\/cherry-mx-switches.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"01d86dfc177e3d325c0da5919b3f8880621179b8","subject":"bearing\/linear\/mount: fix minor param error (part)","message":"bearing\/linear\/mount: fix minor param error (part)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part=part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c9a22214ad53fb291acadf6fd333040f975d3d6b","subject":"Add a sample to illustrate the use of Bezier curves","message":"Add a sample to illustrate the use of Bezier curves\n","repos":"jsconan\/camelSCAD","old_file":"samples\/heart.scad","new_file":"samples\/heart.scad","new_contents":"\/**\r\n * Samples using the camelSCAD library.\r\n *\r\n * A simple framed heart using Bezier curve.\r\n *\r\n * @author jsconan\r\n * @license CC0-1.0\r\n *\/\r\n\r\n\/\/ As we need to use some shapes, use the right entry point of the library\r\nuse <..\/shapes.scad>\r\ninclude <..\/core\/constants.scad>\r\n\r\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = MODE_PROD;\r\n\r\n\/\/ Defines the constraints of the print\r\nprintResolution = 0.2;\r\n\r\n\/\/ Defines the constraints of the object\r\nscaleFactor = 5;\r\nheight = 4;\r\ncontrols = [[0, 0], [5, 3], [5, 10], [0, 7]] * scaleFactor;\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\r\n\/\/ Displays a build box visualization to preview the printer area.\r\napplyMode(renderMode) {\r\n \/\/ As we are using function to generate points based on the current render mode\r\n \/\/ we need to wrap the call into one union to ensure the render mode is well applied\r\n union() {\r\n \/\/ Computes the points that draw half the heart\r\n half = cubicBezierCurve(controls[0], controls[1], controls[2], controls[3]);\r\n\r\n \/\/ Assembles the points that draw the full heart\r\n points = concat(half, mirror2D(half));\r\n\r\n \/\/ Compute the size of the heart\r\n size = dimensions2D(points);\r\n echo(\"Size\", size);\r\n\r\n \/\/ Draws the heart\r\n linear_extrude(height=height, convexity=10) {\r\n \/\/ Frame\r\n difference() {\r\n rectangle(size + vector2D(scaleFactor));\r\n rectangle(size);\r\n }\r\n\r\n \/\/ Heart\r\n translateY(-size[1] \/ 2) {\r\n polygon(\r\n points=points\r\n );\r\n }\r\n }\r\n\r\n \/\/ Displays the control points to illustrate how the curve is constrained\r\n translate([0, -size[1] \/ 2, height]) {\r\n controlPoints(controls, size=2);\r\n }\r\n buildPlate();\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/heart.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"29c38300b9cbd7ef1262f4fcd8ca28e3b2f0f555","subject":"Clamps with thin wall around Kossel heated bed","message":"Clamps with thin wall around Kossel heated bed\n","repos":"ksuszka\/3d-projects","old_file":"kossel\/kossel_bed_clamps.scad","new_file":"kossel\/kossel_bed_clamps.scad","new_contents":"$fa=3;\n$fs=0.1;\n\nbed_diameter = 250;\nbed_height = 3;\nclamp_height = 7;\n\n\/\/demo();\nbed_clamp();\n\nmodule demo() {\n %translate([0,0,clamp_height\/2]) bed_mold();\n bed_clamp();\n rotate([0,0,120]) bed_clamp();\n rotate([0,0,240]) bed_clamp();\n}\n\nmodule bed_mold() {\n translate([0,0,bed_height\/2])\n intersection() {\n translate([0,0,0.1])cylinder(d=bed_diameter, h=bed_height+0.2, center=true);\n translate([0,0,-bed_diameter\/3]) sphere(d=bed_diameter*1.203);\n }\n}\n\nmodule bed_clamp() {\n width = 30;\n hole_diameter = 3;\n hole_screw_diameter = 6;\n bottom_length = 20;\n module body_mold() {\n translate([0,0,clamp_height\/2]) {\n cylinder(d=width, h=clamp_height, center=true);\n translate([0,bottom_length\/2,0])\n cube([width,bottom_length,clamp_height], center=true);\n }\n }\n module hole_mold() {\n translate([0,-6,clamp_height\/2]) {\n cylinder(d=hole_diameter, h=clamp_height+1, center=true);\n translate([0,0,clamp_height-bed_height])\n cylinder(d=hole_screw_diameter, h=clamp_height, center=true);\n }\n }\n module edge() {\n translate([0,0,clamp_height\/2])\n difference() {\n cylinder(d=bed_diameter+6,h=clamp_height, center=true);\n cylinder(d=bed_diameter-20,h=clamp_height+1, center=true);\n translate([0,0,2]) cylinder(d=bed_diameter,h=clamp_height, center=true);\n }\n }\n module pie() {\n intersection() {\n edge();\n rotate([0,0,60])translate([-500,0,0]) cube([1000,1000,1000],true);\n rotate([0,0,-60])translate([500,0,0]) cube([1000,1000,1000],true);\n }\n }\n difference() {\n union() {\n translate([0,-bed_diameter\/2+1,0]) body_mold();\n pie();\n }\n translate([0,0,clamp_height-bed_height]) bed_mold();\n translate([0,-bed_diameter\/2+1,0]) hole_mold();\n }\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'kossel\/kossel_bed_clamps.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7e2fc2c06b98228013db2ea4efda592bf354cdef","subject":"removed 'Z' marking highlight","message":"removed 'Z' marking highlight\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/3d_cube.scad","new_file":"3d_cube\/3d_cube.scad","new_contents":"eps=0.01;\ndepth=2;\nside = 20;\nsize = side*[1,1,1];\nfont_size = 15;\n\ndifference()\n{\n cube(size);\n translate([size[0]\/2, depth, size[2]\/2])\n rotate([90,0,0])\n linear_extrude(height=depth+eps)\n text(\"X\", size=font_size, valign=\"center\", halign=\"center\");\n translate([-eps, size[1]\/2, size[2]\/2])\n rotate([90,0,90])\n linear_extrude(height=depth+eps)\n text(\"Y\", size=font_size, valign=\"center\", halign=\"center\");\n translate([size[0]\/2, size[1]\/2, size[2]-depth])\n linear_extrude(height=depth+eps)\n text(\"Z\", size=font_size, valign=\"center\", halign=\"center\");\n}\n","old_contents":"eps=0.01;\ndepth=2;\nside = 20;\nsize = side*[1,1,1];\nfont_size = 15;\n\ndifference()\n{\n cube(size);\n translate([size[0]\/2, depth, size[2]\/2])\n rotate([90,0,0])\n linear_extrude(height=depth+eps)\n text(\"X\", size=font_size, valign=\"center\", halign=\"center\");\n translate([-eps, size[1]\/2, size[2]\/2])\n rotate([90,0,90])\n linear_extrude(height=depth+eps)\n text(\"Y\", size=font_size, valign=\"center\", halign=\"center\");\n translate([size[0]\/2, size[1]\/2, size[2]-depth])\n #linear_extrude(height=depth+eps)\n text(\"Z\", size=font_size, valign=\"center\", halign=\"center\");\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b6c53275361125bb4e24edf695056d4cb4f6e1be","subject":"config: sf1 on Z","message":"config: sf1 on Z\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*zaxis_bearing=bearing_sf1_1212;*\/\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"278755f6834d67f0157e001a391602edb87ed87a","subject":"x\/carriage: fix missing vit section","message":"x\/carriage: fix missing vit section\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9ce60a4e57e2d63062753826bbdc32b174b5e33b","subject":"x\/carriage: add endstop bumpers","message":"x\/carriage: add endstop bumpers\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 22*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+.5*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 22*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+5*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = MHexNutM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.5]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"981d2ae69b38cbb1cadb9c6784c96e2cbf964076","subject":"rodclamps: rewrite","message":"rodclamps: rewrite\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align=[0,0,0], orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate([-outer_d\/2,0,0])\n {\n hull()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate([-outer_d\/2,0,0])\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-XAXIS);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate([-outer_d\/2,0,0])\n {\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align=[0,0,0], orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient);\n }\n }\n else if(part==\"pos\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate([-base_thick_\/2,0,0])\n {\n hull()\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate([-base_thick_\/2,0,0])\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*XAXIS)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-XAXIS);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*XAXIS)\n hull()\n {\n stack(axis=-XAXIS, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=ZAXIS)\n translate([-base_thick_\/2,0,0])\n {\n %translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*XAXIS)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=XAXIS, dist=15)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align=-ZAXIS+XAXIS);\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align=-ZAXIS+XAXIS);\n }\n}\n\n\n","old_contents":"include \ninclude \ninclude \n\nmount_rod_clamp_conn_rod = [[0,0,0],[1,0,0]];\n\nmodule mount_rod_clamp_half(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\nmodule mount_rod_clamp_full(rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, orient=[0,0,1])\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.5:base_thick;\n\n orient(orient)\n difference()\n {\n clamp_tolerance = 0.5*mm;\n base_cut = -rod_d\/2 + clamp_tolerance;\n union()\n {\n \/\/ cylinder around rod\n cylindera(d=outer_d, h=width, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ base\n translate([base_cut,0,0])\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=[1,0,0]);\n }\n\n \/\/ cut bottom of cylinder\n translate([base_cut,0,0])\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0], extrasize=[clamp_tolerance,0,0], extrasize_align=[1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n cylindera(d=thread_dia, h=base_thick_*3, orient=[1,0,0]);\n }\n\n \/\/ cut zrod\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=[0,0,1]);\n }\n}\n\n\/*translate([20,0,0])*\/\n\/*mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\/*mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5);*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c289fd8acacd988c73bdcf03fd3346da2426f7eb","subject":"add the connector bar","message":"add the connector bar\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 40;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 0;\n yTranslate = 0;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n translate([xTranslate, yTranslate, zTranslate])\n\/\/ rotate([0, 0, 45])\n cube([xLength, yLength, zLength]\n , center = true\n );\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n\/\/PICK UP HERE\n\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n\/\/ halfCirclePhoneStand_stand_connectorBar();\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar()\n{\n cube([40, 5, 5]);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6aed981b52d0d4565adf32903699a42a74c61878","subject":"\u0441\u0430\u0445\u0430\u0440 \u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430","message":"\u0441\u0430\u0445\u0430\u0440 \u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \n\n$fn=5; \ncylinder(15, 100, 100); \n \n \n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/DeOxyRibose.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1dab64ce89f4eedd9779fd6a72182d424219acb2","subject":"buttons","message":"buttons\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\n\/\/total_height = 22;\ntotal_height = 19;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 10.2 \/ 2;\ncap_h = total_height - button_h + overlap;\ncap_r_bottom = 3;\n\nborder_offset = 4 + th;\nborder_h = 3;\nborder_r = cap_r + 2;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r_bottom, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n cylinder(r=cap_r, h=border_h + border_offset);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\n\/\/total_height = 22;\ntotal_height = 19;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\n\/\/cap_r = 4.5;\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 4.5 + th;\nborder_h = 3;\nborder_r = cap_r + 2;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5dfef9355c96edbf032ebe62d0bbcc4d69ec05e4","subject":"Adding cut-outs","message":"Adding cut-outs\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\", \\n\n cutouts = \",cutouts,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,0,0]) cube([thickness*3, thickness, thickness]); \n translate([-thickness\/2-thickness*4,0,0]) cube([thickness*3, thickness, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,0,0]) cube([thickness*3, thickness, thickness]); \n translate([-thickness\/2-thickness*4,0,0]) cube([thickness*3, thickness, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a)\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"be00c529548dea2187a979c06545564ffd0d878c","subject":"make support wall a little thicker for cura","message":"make support wall a little thicker for cura\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/JansenFoot.scad","new_file":"Drawings\/JansenFoot.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenFoot.scad $\n\/\/ $Id: JansenFoot.scad 438 2015-03-03 14:39:59Z mrwhat $\n\npadH = 0.3; \/\/ extra clearance amount for H end of CH link\n\nmodule bracedFoot(dLeft,dBase,dPerp) { \/\/ ---------------- foot with out-of-axis support\nbraceHeight = NodeHeight3; \/\/ 3*TrueNodeHeight-.4; \/\/ A little shorter than the hinge-pin\ndRight = 0.9 * (dBase-dLeft); \/\/ scoot brace in a bit from foot\ndLeft1 = dLeft-Frad-1-((0.5*Frad)\/(dLeft-Frad-1));\nunion() { difference() { union() {\n translate([-dLeft,0,0]) {\n cylinder(h=NodeHeight,r1=Frad+.2,r2=Frad-.2,$fn=48); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+2,r2=Hrad+1.6,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([.22*dRight,.85*dPerp,1.1]) sphere(r=1,$fn=6); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+1.9,r2=Hrad+1.4,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([-.28*dLeft1,(1-.23)*dPerp,2]) sphere(r=1,$fn=6); }\n\n \/\/ foot\n translate([dBase-dLeft-LinkRad,0,0]) cylinder(h=NodeHeight+.5,r=LinkRad,$fn=80);\n\n hull() {\n translate([0,dPerp ,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([0,dPerp ,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() {\n translate([-dLeft1,-Frad*0.5,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6);\n translate([0,dPerp,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([-dLeft1+((8*Frad)\/(dLeft-Frad-1)),0,0])\n cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([0,dPerp,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() { \/\/ re-inforcing pyramid over main, long leg\n translate([-dLeft+2*Frad,0,0]) cylinder(h=BarHeight,r1=Frad-1,r2=Frad-3,$fn=6);\n translate([dBase-dLeft-2*LinkRad,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-2,$fn=6);\n translate([0,0,1.5*NodeHeight-1]) sphere(r=1,$fn=16); }\n\n difference() { hull() { \/\/ main, long-leg segment\n translate([-dLeft,0,0]) { nodeCyl(BarHeight,Frad-1);\n translate([dBase-LinkRad,0,0]) nodeCyl(BarHeight,LinkRad-1); }\n }\n translate([-dLeft,0,-1.5]) hull(){nodeCyl(BarHeight,Frad-2.4);\n translate([dBase-LinkRad-2,0,0])nodeCyl(BarHeight,.4);}\n }\n\n hull(){ \/\/ stop to keep \"knee\" from hyper-extending\n translate([-dLeft-Frad+2,0,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft,-Frad+2,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft-Frad+2,-Frad-3,0]) cylinder(h=BarHeight,r=2,$fn=12); }\n translate( [-dLeft-Frad+2,-Frad-3,0]) cylinder(h=3*BarHeight,r1=3,r2=2,$fn=24);\n }\n translate([0,dPerp,0]) drillHole(Hrad);\n translate([-dLeft,0,0]) drillHole(Drad);\n\n \/\/ hollow out re-inforcing pyramid\n hull() { translate([-dLeft+2*Frad+2,0,-1.5]) cylinder(h=BarHeight,r1=Frad-2,r2=Frad-4,$fn=6);\n translate([dBase-dLeft-3*LinkRad,0,-1.5]) cylinder(h=BarHeight,r1=1.5,r2=.2,$fn=6);\n translate([0,0,1.5*NodeHeight-2.5]) sphere(r=0.5,$fn=16); }\n\n \/\/ had trouble with fill around braced link. See if adding little hollows\n \/\/ helps slicer to fill better\n translate([-dLeft,0,NodeHeight\/2]) {\n for(a=[0,30,60,90,120,150,180,210,240,270,300,330]) {\n translate([0.5*(Frad+Drad)*cos(a),0.5*(Frad+Drad)*sin(a),0])\n cylinder(h=NodeHeight-1.4,r=.4,$fn=6,center=true);\n }}\n\n \/\/ knock out a slot to take the CH linkage.\n translate([0,dPerp,NodeHeight-padH]) {\n cylinder(h=NodeHeight+2*padH,r=Hrad+3,$fn=48);\n hull() {\n translate([ 0,-4,0]) cube([.1,.1,NodeHeight+2*padH]);\n translate([ 7,-1,0]) cube([2,5,NodeHeight+2*padH]);\n translate([-7,-2,0]) cube([1,5,NodeHeight+2*padH]);\n }\n }\n\n \/\/cube([3,11,11]); \/\/ diagnostic slice to examine pyramid shell\n }\n}\n\n\/\/ custom support at H node\ncolor(\"Cyan\") union() {\n translate([0,29,NodeHeight-padH*.9]) difference() {\n cylinder(r2=4.4,r1=3.73,h=NodeHeight-.5,$fn=8);\n translate([0,0,-.1]) cylinder(r2=2.6,r1=3.4,h=5,$fn=8);\n }\nif(0) {\n translate([0,29,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=4.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=4.1,h=1.2,$fn=8);\n }\n translate([0,29.4,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=3.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=3.1,h=1.2,$fn=8);\n }\n translate([4,28,NodeHeight*2-1.6]) rotate([0,0,60]) rotate([25,0,0]) cube([4,.35,4],center=true);\n translate([-3.5,27,NodeHeight*2-1.6]) rotate([0,0,-50]) rotate([25,0,0]) cube([4,.35,4],center=true);\n} else {\n translate([0,dPerp,NodeHeight+2+padH]) {\n Hblade(4);\n rotate([0,0, 20]) Hblade();\n rotate([0,0, 50]) Hblade();\n rotate([0,0, 80]) Hblade();\n rotate([0,0,110]) Hblade();\n rotate([0,0,140]) Hblade();\n rotate([0,0,170]) Hblade();\n rotate([0,0,200]) Hblade(3.6);\n rotate([0,0,230]) Hblade(3.3);\n rotate([0,0,250]) Hblade(3.3);\n rotate([0,0,270]) Hblade(3.3);\n rotate([0,0,290]) Hblade(3.3);\n rotate([0,0,310]) Hblade(3.3);\n rotate([0,0,330]) Hblade(3.3);\n rotate([0,0,345]) Hblade(4.5);\n }\n}\n}\n\n}\n\n\/\/ Support blade for H node\nlineW = 0.41; \/\/ single line width\nplateH = NodeHeight-2-padH*0.2;\nmodule Hblade(len=3,h=plateH,w=lineW,cr=2) {\n translate([cr,-w\/2,0]) cube([len,w,h]);\n}\n\n\/\/ example from config E, circa 140227\n\/\/bracedFoot(28.3675,75.792,29.3843);","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenFoot.scad $\n\/\/ $Id: JansenFoot.scad 438 2015-03-03 14:39:59Z mrwhat $\n\npadH = 0.3; \/\/ extra clearance amount for H end of CH link\n\nmodule bracedFoot(dLeft,dBase,dPerp) { \/\/ ---------------- foot with out-of-axis support\nbraceHeight = NodeHeight3; \/\/ 3*TrueNodeHeight-.4; \/\/ A little shorter than the hinge-pin\ndRight = 0.9 * (dBase-dLeft); \/\/ scoot brace in a bit from foot\ndLeft1 = dLeft-Frad-1-((0.5*Frad)\/(dLeft-Frad-1));\nunion() { difference() { union() {\n translate([-dLeft,0,0]) {\n cylinder(h=NodeHeight,r1=Frad+.2,r2=Frad-.2,$fn=48); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+2,r2=Hrad+1.6,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([.22*dRight,.85*dPerp,1.1]) sphere(r=1,$fn=6); }\n hull() {\n translate([0,dPerp,0]) cylinder(h=braceHeight,r1=Hrad+1.9,r2=Hrad+1.4,$fn=48);\n translate([0,dPerp-3,0]) cylinder(h=braceHeight-1,r1=Hrad+1,r2=Hrad+0.5,$fn=32);\n translate([-.28*dLeft1,(1-.23)*dPerp,2]) sphere(r=1,$fn=6); }\n\n \/\/ foot\n translate([dBase-dLeft-LinkRad,0,0]) cylinder(h=NodeHeight+.5,r=LinkRad,$fn=80);\n\n hull() {\n translate([0,dPerp ,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([0,dPerp ,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([dRight,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() {\n translate([-dLeft1,-Frad*0.5,0]) cylinder(h=BarHeight+1.5,r1=1.6,r2=1,$fn=6);\n translate([0,dPerp,0]) cylinder(h=braceHeight ,r1=1.6,r2=1,$fn=6); }\n hull() {\n translate([-dLeft1+((8*Frad)\/(dLeft-Frad-1)),0,0])\n cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6);\n translate([0,dPerp,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-.5,$fn=6); }\n hull() { \/\/ re-inforcing pyramid over main, long leg\n translate([-dLeft+2*Frad,0,0]) cylinder(h=BarHeight,r1=Frad-1,r2=Frad-3,$fn=6);\n translate([dBase-dLeft-2*LinkRad,0,0]) cylinder(h=BarHeight,r1=LinkRad,r2=LinkRad-2,$fn=6);\n translate([0,0,1.5*NodeHeight-1]) sphere(r=1,$fn=16); }\n\n difference() { hull() { \/\/ main, long-leg segment\n translate([-dLeft,0,0]) { nodeCyl(BarHeight,Frad-1);\n translate([dBase-LinkRad,0,0]) nodeCyl(BarHeight,LinkRad-1); }\n }\n translate([-dLeft,0,-1.5]) hull(){nodeCyl(BarHeight,Frad-2.4);\n translate([dBase-LinkRad-2,0,0])nodeCyl(BarHeight,.4);}\n }\n\n hull(){ \/\/ stop to keep \"knee\" from hyper-extending\n translate([-dLeft-Frad+2,0,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft,-Frad+2,0]) cylinder(h=BarHeight,r=2,$fn=8);\n translate([-dLeft-Frad+2,-Frad-3,0]) cylinder(h=BarHeight,r=2,$fn=12); }\n translate( [-dLeft-Frad+2,-Frad-3,0]) cylinder(h=3*BarHeight,r1=3,r2=2,$fn=24);\n }\n translate([0,dPerp,0]) drillHole(Hrad);\n translate([-dLeft,0,0]) drillHole(Drad);\n\n \/\/ hollow out re-inforcing pyramid\n hull() { translate([-dLeft+2*Frad+2,0,-1.5]) cylinder(h=BarHeight,r1=Frad-2,r2=Frad-4,$fn=6);\n translate([dBase-dLeft-3*LinkRad,0,-1.5]) cylinder(h=BarHeight,r1=1.5,r2=.2,$fn=6);\n translate([0,0,1.5*NodeHeight-2.5]) sphere(r=0.5,$fn=16); }\n\n \/\/ had trouble with fill around braced link. See if adding little hollows\n \/\/ helps slicer to fill better\n translate([-dLeft,0,NodeHeight\/2]) {\n for(a=[0,30,60,90,120,150,180,210,240,270,300,330]) {\n translate([0.5*(Frad+Drad)*cos(a),0.5*(Frad+Drad)*sin(a),0])\n cylinder(h=NodeHeight-1.4,r=.4,$fn=6,center=true);\n }}\n\n \/\/ knock out a slot to take the CH linkage.\n translate([0,dPerp,NodeHeight-padH]) {\n cylinder(h=NodeHeight+2*padH,r=Hrad+3,$fn=48);\n hull() {\n translate([ 0,-4,0]) cube([.1,.1,NodeHeight+2*padH]);\n translate([ 7,-1,0]) cube([2,5,NodeHeight+2*padH]);\n translate([-7,-2,0]) cube([1,5,NodeHeight+2*padH]);\n }\n }\n\n \/\/cube([3,11,11]); \/\/ diagnostic slice to examine pyramid shell\n }\n}\n\n\/\/ custom support at H node\ncolor(\"Cyan\") union() {\n translate([0,29,NodeHeight-padH*.9]) difference() {\n cylinder(r2=4.4,r1=3.73,h=NodeHeight-.5,$fn=8);\n translate([0,0,-.1]) cylinder(r2=2.6,r1=3.4,h=5,$fn=8);\n }\nif(0) {\n translate([0,29,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=4.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=4.1,h=1.2,$fn=8);\n }\n translate([0,29.4,NodeHeight*2-padH*2.5]) difference() {\n cylinder(r=3.55,h=1,$fn=8);\n translate([0,0,-.1]) cylinder(r=3.1,h=1.2,$fn=8);\n }\n translate([4,28,NodeHeight*2-1.6]) rotate([0,0,60]) rotate([25,0,0]) cube([4,.35,4],center=true);\n translate([-3.5,27,NodeHeight*2-1.6]) rotate([0,0,-50]) rotate([25,0,0]) cube([4,.35,4],center=true);\n} else {\n translate([0,dPerp,NodeHeight+2+padH]) {\n Hblade(4);\n rotate([0,0, 20]) Hblade();\n rotate([0,0, 50]) Hblade();\n rotate([0,0, 80]) Hblade();\n rotate([0,0,110]) Hblade();\n rotate([0,0,140]) Hblade();\n rotate([0,0,170]) Hblade();\n rotate([0,0,200]) Hblade(3.6);\n rotate([0,0,230]) Hblade(3.3);\n rotate([0,0,250]) Hblade(3.3);\n rotate([0,0,270]) Hblade(3.3);\n rotate([0,0,290]) Hblade(3.3);\n rotate([0,0,310]) Hblade(3.3);\n rotate([0,0,330]) Hblade(3.3);\n rotate([0,0,345]) Hblade(4.5);\n }\n}\n}\n\n}\n\n\/\/ Support blade for H node\nlineW = 0.38; \/\/ single line width\nplateH = NodeHeight-2-padH*0.2;\nmodule Hblade(len=3,h=plateH,w=lineW,cr=2) {\n translate([cr,-w\/2,0]) cube([len,w,h]);\n}\n\n\/\/ example from config E, circa 140227\n\/\/bracedFoot(28.3675,75.792,29.3843);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b8bcb6be111cbf85d502684425acad085430f4c0","subject":"[scad] add kube scaling factor","message":"[scad] add kube scaling factor\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1.04;\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 13.5 + magnet_t;\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_r = 5;\nsupport_h = outer_w - wall_w - flk_h;\n\necho(\"scaling vector\", kube_s);\necho(\"magnet diameter\", magnet_r*2);\necho(\"flk width\", flk_w);\necho(\"kube width\", outer_w);\necho(\"support height\", support_h);\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(flk_w, flk_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\t\tcylinder(r=magnet_r, h=magnet_h);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nscale(kube_s) kube();\n","old_contents":"\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n*\/\n\nmagnet_h = 5;\nmagnet_r = 13.5;\nmagnet_t = 0.2;\n\nflk_h = 23.5;\nflk_w = 30.5;\nflk_t = 0.5;\n\nwall_w = 2;\n\nsupport_r = 5;\nsupport_h = outer_w - wall_w - flk_h;\n\ninner_w = flk_w + flk_t;\nouter_w = inner_w + 2*wall_w;\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(inner_w, inner_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\t\tcylinder(r=magnet_r + magnet_t, h=magnet_h);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nkube();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"631d1be97cb565857114a3dafd520398ee7440b5","subject":"test cube is now 20x20x20, just to keep some ratio","message":"test cube is now 20x20x20, just to keep some ratio\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/3d_cube.scad","new_file":"3d_cube\/3d_cube.scad","new_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([20, 20, 20]);\n","old_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([50, 30, 10]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"08a2775dbdc54179c755095f3d9c81c4303f5fee","subject":"Update solid_layers.scad","message":"Update solid_layers.scad\n\nOops, left a hardcoded 0.3 in. Fixed.","repos":"mcilhargey\/Slic3r,mcilhargey\/Slic3r,platsch\/Slic3r,lordofhyphens\/Slic3r,tmotl\/Slic3r,alexrj\/Slic3r,lordofhyphens\/Slic3r,xoan\/Slic3r,pieis2pi\/Slic3r,mcilhargey\/Slic3r,pieis2pi\/Slic3r,xoan\/Slic3r,platsch\/Slic3r,curieos\/Slic3r,xoan\/Slic3r,platsch\/Slic3r,prusa3d\/Slic3r,tmotl\/Slic3r,alexrj\/Slic3r,prusa3d\/Slic3r,prusa3d\/Slic3r,alexrj\/Slic3r,tmotl\/Slic3r,prusa3d\/Slic3r,platsch\/Slic3r,lordofhyphens\/Slic3r,curieos\/Slic3r,tmotl\/Slic3r,tmotl\/Slic3r,mcilhargey\/Slic3r,prusa3d\/Slic3r,lordofhyphens\/Slic3r,platsch\/Slic3r,xoan\/Slic3r,tmotl\/Slic3r,mcilhargey\/Slic3r,pieis2pi\/Slic3r,alexrj\/Slic3r,pieis2pi\/Slic3r,platsch\/Slic3r,prusa3d\/Slic3r,lordofhyphens\/Slic3r,alexrj\/Slic3r,pieis2pi\/Slic3r,pieis2pi\/Slic3r,xoan\/Slic3r,prusa3d\/Slic3r,curieos\/Slic3r,mcilhargey\/Slic3r,curieos\/Slic3r,mcilhargey\/Slic3r,alexrj\/Slic3r,curieos\/Slic3r,curieos\/Slic3r,xoan\/Slic3r,lordofhyphens\/Slic3r","old_file":"utils\/modifier_helpers\/solid_layers.scad","new_file":"utils\/modifier_helpers\/solid_layers.scad","new_contents":"\/\/ Used to generate a modifier mesh to do something every few layers. \n\/\/ Load into OpenSCAD, tweak the variables below, export as STL and load as \n\/\/ a modifier mesh. Then change settings for the modifier mesh.\n\n\/\/ Written by Joseph Lenox; in public domain.\n\nlayer_height = 0.3; \/\/ set to layer height in slic3r for \"best\" results.\nnumber_of_solid_layers = 2;\nN = 4; \/\/ N > number_of_solid_layers or else the whole thing will be solid\nmodel_height = 300.0;\nmodel_width = 300.0; \/\/ these two should be at least as big as the model \nmodel_depth = 300.0; \/\/ but bigger isn't a problem\ninitial_offset=0; \/\/ don't generate below this\n\nposition_on_bed=[0,0,0]; \/\/ in case you need to move it around\n\n\/\/ don't touch below unless you know what you are doing.\nsimple_layers = round(model_height\/layer_height);\ntranslate(position_on_bed)\n for (i = [initial_offset:N:simple_layers]) {\n translate([0,0,i*layer_height])\n translate([0,0,(layer_height*number_of_solid_layers)\/2])\n cube([model_width,model_depth,layer_height*number_of_solid_layers], center=true);\n }\n","old_contents":"\/\/ Used to generate a modifier mesh to do something every few layers. \n\/\/ Load into OpenSCAD, tweak the variables below, export as STL and load as \n\/\/ a modifier mesh. Then change settings for the modifier mesh.\n\n\/\/ Written by Joseph Lenox; in public domain.\n\nlayer_height = 0.3; \/\/ set to layer height in slic3r for \"best\" results.\nnumber_of_solid_layers = 2;\nN = 4; \/\/ N > number_of_solid_layers or else the whole thing will be solid\nmodel_height = 300.0;\nmodel_width = 300.0; \/\/ these two should be at least as big as the model \nmodel_depth = 300.0; \/\/ but bigger isn't a problem\ninitial_offset=0; \/\/ don't generate below this\n\nposition_on_bed=[0,0,0]; \/\/ in case you need to move it around\n\n\/\/ don't touch below unless you know what you are doing.\nsimple_layers = round(model_height\/0.3);\ntranslate(position_on_bed)\n for (i = [initial_offset:N:simple_layers]) {\n translate([0,0,i*layer_height])\n translate([0,0,(layer_height*number_of_solid_layers)\/2])\n cube([model_width,model_depth,layer_height*number_of_solid_layers], center=true);\n }\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"75f3ba4870c53010479144220885d515b8d6cc44","subject":"Added pantilt OpenScad model","message":"Added pantilt OpenScad model\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/pantilt.scad","new_file":"hardware\/pantilt.scad","new_contents":"$fn = 250;\n\nR = 50;\nballShell = 3;\nsupportX = 35;\nsupportY = 8;\nsupportZ = 60;\nmik = 2;\nsThickness = 5;\nsupportBaseHeight = 5;\nbaseHeight = 31;\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif(application == \"servo\")\n\t{\n\t\ttranslate([-Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\t\n\t\ttranslate([+Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\n\t\ttranslate([+Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\n\t\ttranslate([-Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\t\t\n\t}\n\t}\n}\n\nmodule support() {\n\tdifference() {\n\t\tunion() {\n\t\t\tintersection() {\n\t\t\t\tsphere(R);\n\t\t\t\ttranslate([-R, -R+(supportY+sThickness)\/2, 0]) cube([500, 25, 200], center = true);\n\t\t\t}\n\n\t\t}\n\t}\n\n\ttranslate([0, -R+(supportY+sThickness\/2), -supportZ\/2]) {\n\t\tminkowski() {\n\t\t\tbox(supportX, supportY, supportZ, sThickness , \"none\");\n\t\t\tcylinder(r = mik, h = 1);\n\t\t\t\/\/rotate([90,0,0])cylinder(r = mik, h = 1);\n\t\t}\n\t}\n}\n\nmodule base() {\ntranslate([0, 0, -supportZ])\n\t\tminkowski() {\n\t\t\tcylinder(r= R+mik, h= supportBaseHeight);\n\t\trotate([90,0,0])cylinder(r = mik, h = 1);\n}\n}\n\n\n\nsphere(R);\nsupport();\nmirror([0, 10, 0]) support();\n\/\/need to understnad -2 in 2*R-5-mik-2\nbase();\n\ntranslate([0, 0, -supportZ-supportBaseHeight-baseHeight])\n{difference(){\n\tminkowski() {\ncylinder(r= R+mik, h = baseHeight);\t\t\nrotate([90,0,0])cylinder(r = mik, h = 1);\n}\n\ntranslate([0, 0, 5])cylinder(r= (R+mik)\/2, h = 10*baseHeight);\t\t\n}\ntranslate([0, 0, 17-3])\tbox(24.5, 13, 17, 3,\"servo\");}","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/pantilt.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"3138b5f3addc72782244960803d5aedd5f8d504c","subject":"more mounts, fix screws","message":"more mounts, fix screws\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"$fn=100;\n\nbutton_radius = 49;\nhole_radius = 14.5;\ntable_padding = 40;\nextra_padding = 2;\nbottom_padding = 30;\n\nwall_thickness = 4;\n\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n\n\/\/ difference() {\n\/\/ cube(size=[mount_width, mount_height, mount_depth]);\n\n\/\/ translate([wall_thickness, wall_thickness, wall_thickness])\n\/\/ cube(size=[mount_width - (wall_thickness*2), mount_height, mount_depth]);\n\/\/ }\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nbottom();\ndifference() {\n sides();\n screws();\n}\n\n\/\/ difference() {\n\/\/ translate([0, 0, mount_depth-wall_thickness])\n\/\/ cover();\n\/\/ screws();\n\/\/ }\n","old_contents":"$fn=100;\n\nbutton_radius = 49;\nhole_radius = 14.5;\ntable_padding = 40;\nextra_padding = 2;\nbottom_padding = 30;\n\nwall_thickness = 4;\n\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n\n\/\/ difference() {\n\/\/ cube(size=[mount_width, mount_height, mount_depth]);\n\n\/\/ translate([wall_thickness, wall_thickness, wall_thickness])\n\/\/ cube(size=[mount_width - (wall_thickness*2), mount_height, mount_depth]);\n\/\/ }\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\n\nmodule bottom() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nbottom();\nsides();\n\ntranslate([0, 0, mount_depth + 15])\ncover();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9cc2a527a451865a7570f25bb9cedffbe9290ff7","subject":"config: Fix main width, should be 340mm","message":"config: Fix main width, should be 340mm\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 21.5*mm);\n\n\/\/ 2GT2 20T pulley\nyaxis_pulley_d = 18;\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\nyaxis_idler_pulley_h = 8.65*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nmain_width = 300*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_thickness = 4;\nziptie_width = 4;\nziptie_bearing_distance=2;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\nxaxis_pulley_d = 12.2;\nxaxis_belt_width = 6*mm;\n\nxaxis_carriage_bearing_offset_z = ziptie_thickness\/2;\nxaxis_carriage_beltpath_offset = xaxis_carriage_bearing_offset_z+xaxis_bearing[1]\/2;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 21.5*mm);\n\n\/\/ 2GT2 20T pulley\nyaxis_pulley_d = 18;\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\nyaxis_idler_pulley_h = 8.65*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"cafc83427425d112f1df7abc42f95b493cc5502e","subject":"linear-extrusion: fix missing includes","message":"linear-extrusion: fix missing includes\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"linear-extrusion.scad","new_file":"linear-extrusion.scad","new_contents":"include \ninclude \n\nuse \nuse \n\nmodule linear_extrusion(h=10, center=true, align=N, orient=Z)\n{\n size_align(size=[20,20,h], align=align, orient=orient, orient_ref=Z)\n {\n linear_extrude(height = h, center = true, convexity = 10, twist = 0)\n {\n import (file = \"data\/misumi-extrusion\/hfs5-2020-profile.dxf\");\n }\n }\n}\n\n\/*include *\/\n\/*include *\/\n\/*include *\/\n\/*for(axis=concat(AXES,-AXES))*\/\n\/*translate(axis*20\/2)*\/\n\/*{*\/\n \/*c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);*\/\n \/*color(c)*\/\n \/*linear_extrusion(h=100, align=axis, orient=axis);*\/\n\/*}*\/\n","old_contents":"use \nuse \n\nmodule linear_extrusion(h=10, center=true, align=N, orient=Z)\n{\n size_align(size=[20,20,h], align=align, orient=orient, orient_ref=Z)\n {\n linear_extrude(height = h, center = true, convexity = 10, twist = 0)\n {\n import (file = \"data\/misumi-extrusion\/hfs5-2020-profile.dxf\");\n }\n }\n}\n\n\/*include *\/\n\/*include *\/\n\/*include *\/\n\/*for(axis=concat(AXES,-AXES))*\/\n\/*translate(axis*20\/2)*\/\n\/*{*\/\n \/*c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);*\/\n \/*color(c)*\/\n \/*linear_extrusion(h=100, align=axis, orient=axis);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7385623d0e829a77f6fcb81167aedafb24c0f858","subject":"main: show power panel","message":"main: show power panel\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*152,0,0])\n {\n \/\/ x carriage\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*25, 0, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*152,0,0])\n {\n \/\/ x carriage\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*25, 0, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d67da0cf1e1831131653fb571e18eb46b00337ad","subject":"Use switch position from Sparkfun Pro Mini","message":"Use switch position from Sparkfun Pro Mini","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n moveZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5 * 25.4, moveZ])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([moveX, 0.05 * 25.4, moveZ])\n {\n color(\"silver\")\n linear_extrude(height=1.2)\n square([4.5, 4.5], center=true);\n color(\"gold\")\n translate([0, 0, 1.2])\n linear_extrude(height=0.5)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([0.5 * 25.4, 0.05 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ Green - Status\n square([0.7,1.2], center=true);\n \/\/ Red - Power\n translate([-0.2 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n }\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([moveX, 0.15 * 25.4, moveZ])\n linear_extrude(height=1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([moveX\/2, 0.2 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ RX - Yellow\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors etc.\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, moveZ])\n linear_extrude(height=2)\n {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, moveZ])\n linear_extrude(height=1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n moveX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n moveZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([moveX, 0.5 * 25.4, moveZ])\n rotate([0,0,45])\n linear_extrude(height=1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([moveX, 0.15 * 25.4, moveZ])\n {\n color(\"silver\")\n linear_extrude(height=1.7)\n square([4.5, 4.5], center=true);\n color(\"gold\")\n translate([0, 0, 1.7])\n linear_extrude(height=1.0)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([0.5 * 25.4, 0.05 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ Green - Status\n square([0.7,1.2], center=true);\n \/\/ Red - Power\n translate([-0.2 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n }\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([moveX, 0.15 * 25.4, moveZ])\n linear_extrude(height=1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([moveX\/2, 0.2 * 25.4, moveZ])\n linear_extrude(height=1)\n {\n \/\/ RX - Yellow\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors etc.\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([moveX\/2, moveY, moveZ])\n linear_extrude(height=2)\n {\n square([1.5, 3.5], center=true);\n translate([7.5, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([moveX, moveY, moveZ])\n linear_extrude(height=1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f279323ca12f418a0d6c0d9447597aa0f12496e4","subject":"Add backplane for all and single modules","message":"Add backplane for all and single modules\n\nAnd also clean up the code a bit.\nColoring should now be done consistently.\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/OmmatiDiag.scad","new_file":"DetectorMockup\/OmmatiDiag.scad","new_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n \/\/ box front walls, can (and should be turned off for increased visibility)\n translate(v = [0, unitlength + padding, 0]) {\n % cube([unitlength + padding, 1, height]);\n }\n translate(v = [unitlength + padding, 0, 0]) {\n % cube([1, unitlength + padding, height]); \/\/\n }\n }\n% Housing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ CMOS Backplate\nmodule Backplate()\n translate([(unitlength+padding)\/2 + 5, (unitlength+padding)\/2 + 5, height-15]) {\n color (\"red\", semitransparent) {\n cube([350,320,1],center=true);\n }\n }\n% Backplate();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\")\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ Ommatidium back plate\n module Ommatidiumplate()\n color (\"red\", semitransparent)\n cube([15, 20, 1], center=true);\n translate ([5,7,0]) Ommatidiumplate();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\", nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1)\n polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2]) CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","old_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.25;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n }\n \/\/ box front walls, can (and should be turned off for increased visibility)\n \/\/~ color (\"gray\", 0.6) {\n \/\/~ translate(v = [0, unitlength + padding, 0]) {\n \/\/~ cube([unitlength + padding, 1, height]);\n \/\/~ }\n \/\/~ translate(v = [unitlength + padding, 0, 0]) {\n \/\/~ cube([1, unitlength + padding, height]); \/\/\n \/\/~ }\n \/\/~ }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\", semitransparent)\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\",nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2])CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"d4b20ceaa7d20e874e5b23be75aa4ecf8164eedf","subject":"Lego car wheel","message":"Lego car wheel\n","repos":"ksuszka\/3d-projects","old_file":"lego\/wheel.scad","new_file":"lego\/wheel.scad","new_contents":"$fa=3;\n$fs=0.2;\n\nwheel_radius = 15;\nwheel_width = 10;\nthread_height = 1;\nouter_rim_height = 2;\n\nmodule single_wheel_thread(h = 1, start_angle=0) {\n for(a=[0:10:359]) {\n rotate([0,0,a + start_angle]) translate([wheel_radius-thread_height,0,0]) cube([thread_height*2,2,h],true);\n }\n}\n\nmodule wheel_thread() {\n translate([0,0,-3.5]) single_wheel_thread(3,0);\n translate([0,0,0]) single_wheel_thread(4,5);\n translate([0,0,+3.5]) single_wheel_thread(3,0);\n}\n\nmodule outer_rim() {\n difference() {\n cylinder(r=wheel_radius-thread_height, h=wheel_width, center=true);\n cylinder(r=wheel_radius-thread_height-outer_rim_height, h=wheel_width + 2, center=true);\n }\n}\n\nmodule mount_point() {\n spacing = 0.2;\n axis_long = 4.8 + spacing;\n axis_short = 1.8 + spacing;\n difference() {\n cylinder(r=4, h=wheel_width, center=true);\n translate([0,0,0]) cube([axis_short,axis_long,wheel_width+2],true);\n translate([0,0,0]) cube([axis_long,axis_short,wheel_width+2],true);\n }\n}\n\nmodule inner_rim() {\n for(a=[0:30:359]) {\n rotate([0,0,a]) translate([4+3,-1,0]) rotate([0,0,25])cube([14,1,wheel_width],true);\n }\n}\n\nwheel_thread();\nouter_rim();\nmount_point();\ninner_rim();","old_contents":"","returncode":1,"stderr":"error: pathspec 'lego\/wheel.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e99b7417a88f9edf4a37a712b07dd7e2b324fe30","subject":"gurt_klammer updated","message":"gurt_klammer updated\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"gurt_klammer\/gurt_klammer.scad","new_file":"gurt_klammer\/gurt_klammer.scad","new_contents":"use <..\/library2d.scad>\n\n$fn=100;\nside = 40;\nr = 2.5;\n\nmodule klammer(x=25,r=2.5) {\n difference() {\n flat(side,r);\n for(i=[-1,1])translate([0,i*x\/2])slot(x,r,0);\n translate([x\/2,0])slot(0,r,x);\n scale([1,1.01])cut();\n } \n translate([side\/2+5,0])difference() {\n round_square(15,20,r);\n circle(r=3);\n }\n}\nmodule cut() {\n difference() {\n translate([5,0])square([10,20],center=true);\n circle(r=10);\n }\n}\nmodule slot(x,r,y) {\n hull()for(i=[-1,1])translate([x\/2*i,y\/2*i])circle(r=r);\n}\nmodule flat(x,r,y) {\n hull()tr_xy(x\/2-r)circle(r=r);\n}\nlinear_extrude(height=2)klammer();","old_contents":"use <..\/library2d.scad>\n\n$fn=50;\nside = 40;\nr = 2.5;\n\nmodule klammer(x=25,r=2.5) {\n difference() {\n flat(side,r);\n for(i=[-1,1])translate([0,i*x\/2])slot(x,r,0);\n translate([x\/2,0])slot(0,r,x);\n } \n translate([side\/2+5,0])square([10,20],center=true);\n}\n\nmodule slot(x,r,y) {\n hull()for(i=[-1,1])translate([x\/2*i,y\/2*i])circle(r=r);\n}\nmodule flat(x,r,y) {\n hull()tr_xy(x\/2-r)circle(r=r);\n}\nklammer();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"fde713f667b7b74c077e94cc14f954e813fe78ab","subject":"x\/carriage\/b: fix vitamins being rendered","message":"x\/carriage\/b: fix vitamins being rendered\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extrasize=1000*Z, extrasize_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extrasize=1000*Z, extrasize_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7e78945c8259aa121756a65c65e58885f8eacbbd","subject":"x\/extruder: more wip","message":"x\/extruder: more wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2+.5*mm;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+6*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.6];\nextruder_guidler_mount_off = [-.1*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(part=undef)\n{\n extruder_b_mount_thick = 5*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut, $fn=50);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut, $fn=50);\n }\n\n translate(extruder_guidler_mount_off)\n {\n hull()\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([-guidler_mount_d,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = house_h\/2 + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\n{\n \/*x_carriage_withmounts();*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n extruder_b(part=\"vit\");\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n x_extruder_hotend();\n\n \/\/filament path\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts();*\/\n\n rotate([-90,0,0])\n extruder_a();\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2+.5*mm;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nguidler_bearing = bearing_MR105;\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+6*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-3*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.6];\nextruder_guidler_mount_off = [.5*mm -guidler_mount_off[1]+hobbed_gear_d_inner\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(part=undef)\n{\n extruder_b_mount_thick = 5*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(d=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MHexNutM3, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut_inner,guidler_bearing[1]*2], align=[1,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[1,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[1,0,0]);\n }\n\n translate(extruder_guidler_mount_off)\n {\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([0,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=(guidler_w)+1*mm, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([guidler_screws_mount_d_offset, y*(guidler_screws_distance), house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1*mm, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ cutout for bearing\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=extruder_hotmount_clamp_nut, h=1000, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(x=[-1,1])\n translate([x*(extruder_b_w\/2+4*mm),0,0])\n screw_cut(nut=MHexNutM3, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=6*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -7*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\n\/*if(false)*\/\n{\n x_carriage_withmounts();\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n extruder_b(part=\"vit\");\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n %extruder_guidler(show_extras=true);\n }\n\n %x_extruder_hotend();\n\n \/\/filament path\n translate(extruder_filapath_offset)\n %cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n rotate([90,0,0])\n x_carriage(show_bearings=false);\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"b800cfa7fec8078240d871c70c6d0fc8cc9d166b","subject":"metric\/screw_cut: Add test with custom knurl nut","message":"metric\/screw_cut: Add test with custom knurl nut\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n echo (facets);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\nMKnurlInsertNutM3_5 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([35,0,0])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","old_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"59421c3d897693281946d42fd327c0ad96986a16","subject":"3x print","message":"3x print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"w=119;\ns=21;\nh=2.5;\n\n\nmodule wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\n\nmodule fence(width, height)\n{\n cube([width, 119, height-h]);\n translate([0,0,1])\n wedge(width=w, span=1, height=h);\n}\n\n\nmodule support()\n{\n translate([1,0,0])\n {\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n }\n\n \/\/ side walls\n for(i=[0, s+1])\n translate(i*[1,0,0])\n fence(width=1, height=h+1);\n}\n\nfor(i=[0:2])\n translate(i*[25, 0, 0])\n support(2.5);\n","old_contents":"w=119;\ns=21;\nh=2.5;\n\n\nmodule wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\n\nmodule fence(width, height)\n{\n cube([width, 119, height-h]);\n translate([0,0,1])\n wedge(width=w, span=1, height=h);\n}\n\n\nmodule support()\n{\n translate([1,0,0])\n {\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n }\n\n \/\/ side walls\n for(i=[0, s+1])\n translate(i*[1,0,0])\n fence(width=1, height=h+1);\n}\n\nfor(i=[0:0])\n translate(i*[25, 0, 0])\n support(2.5);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"09e9b9b00078e6b821b0c0bdeb12d33d14ed9d80","subject":"width increased by 9mm","message":"width increased by 9mm\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"module wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\nmodule support()\n{\n h=4.5;\n w=119;\n s=21;\n\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n}\n\n\/\/support();\n\ntranslate([-5, 0, 0])\n rotate([0, -90, 0])\n support();","old_contents":"module wedge(width, span, height)\n{\n polyhedron(\n points=[\n [0, 0, 0],\n [span, 0, 0],\n [span, width, 0],\n [0, width, 0],\n [0, width, height],\n [span, width, height],\n ],\n faces=[\n \/\/ bottom\n [0,1,2],\n [2,3,0],\n \/\/ sides\n [5,2,1],\n [0,3,4],\n \/\/ back\n [3,2,4],\n [5,4,2],\n \/\/ top\n [0,4,5],\n [5,1,0],\n ]\n );\n};\n\nmodule support()\n{\n h=4.5;\n w=110;\n s=21;\n\n difference()\n {\n union()\n {\n wedge(width=w, span=s, height=h);\n\n \/\/ rounded ending\n translate([s\/2, w, 0])\n difference()\n {\n cylinder(r=s\/2, h=h);\n translate([-s\/2, -s\/2*2, 0])\n cube([s, s, h]);\n }\n }\n\n \/\/ screw hole\n translate([s\/2, w-8\/2, 0])\n cylinder(r=8\/2, h=h);\n }\n}\n\n\/\/support();\n\ntranslate([-5, 0, 0])\n rotate([0, -90, 0])\n support();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8afa2bb80ed7079bf61056f7af935917854a0aa4","subject":"improved flat view","message":"improved flat view\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/flat.scad","new_file":"resin\/tank\/flat.scad","new_contents":"include ;\n\ndist = 20;\n\ntranslate([0,0,wall_thickness\/2]) {\n translate([0,-dist,0])\n sideA();\n translate([0, dist,0])\n sideB();\n}\n","old_contents":"include ;\n\ntranslate([0,-30,0])\n sideA();\n\ntranslate([0,30,0])\n sideB();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b74b8df27ada65c0116ac6e1ce9d7d370ba2480f","subject":"chilicorn update","message":"chilicorn update\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 13;\nhead_angle = 30;\n\nhorn_length = 18;\nhorn_radius = 3;\n\nneck_angle = 30;\nneck_radius = 5;\nneck_length = 10;\n\nbody_x = 15;\nbody_z = 29;\nbody_radius = 15;\nbody_length = 32;\n\nleg_length = 26 + body_radius;\nleg_radius = 4;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_radius);\n }\n}\n\nmodule leg(x=0, theta=20) {\n translate([body_x + x, 0, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\ncolor(\"red\") leg(theta=20);\ncolor(\"red\") leg(theta=-20);\ncolor(\"red\") leg(x = body_length, theta=20);\ncolor(\"red\") leg(x = body_length, theta=-20);\n","old_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 13;\nhead_angle = 30;\n\nhorn_length = 15;\nhorn_radius = 3;\n\nneck_angle = 30;\nneck_radius = 5;\nneck_length = 10;\n\nbody_x = 15;\nbody_z = 29;\nbody_radius = 15;\nbody_length = 32;\n\nleg_length = 26 + body_radius;\nleg_radius = 4;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_radius);\n }\n}\n\nmodule leg(x=0, theta=20) {\n translate([body_x + x, 0, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\ncolor(\"red\") leg(theta=20);\ncolor(\"red\") leg(theta=-20);\ncolor(\"red\") leg(x = body_length, theta=20);\ncolor(\"red\") leg(x = body_length, theta=-20);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a94975328b0723a6a6d078cadd322bde3a8b0e48","subject":"fixed error in sizing (it did not fit the shelve)","message":"fixed error in sizing (it did not fit the shelve)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bathroom_trash_box\/bathroom_trash_box.scad","new_file":"bathroom_trash_box\/bathroom_trash_box.scad","new_contents":"r_ext=101\/2+4;\nr_int=r_ext-2;\ncut=5.9+0.1+0.2;\ntotal_h=150;\ncylinder_h=total_h-r_ext;\n\n$fn=200;\n\nmodule box()\n{\n difference()\n {\n union()\n {\n \/\/ mount\n difference()\n {\n cube([68+r_ext, 2*r_ext, cut+2*2]);\n translate([-1, (2*r_ext-101+2*2)\/2, -1])\n cube([68-0.2+1, 101-2*2, 20]);\n translate([-1, (2*r_ext-101)\/2, 2])\n cube([68+2+1, 101, cut]);\n }\n \/\/ box\n translate([68+2+2+r_ext, r_ext, 0])\n {\n cylinder(r=r_ext, h=cylinder_h);\n translate([0,0,cylinder_h])\n sphere(r=r_ext);\n }\n }\n \/\/ cut-in the box\n union()\n {\n translate([68+2+2+r_ext, r_ext, 0])\n translate([0,0,-1])\n {\n cylinder(r=r_int, h=cylinder_h+2);\n translate([0,0,cylinder_h])\n sphere(r=r_int);\n }\n }\n }\n}\n\nbox();\n","old_contents":"r_ext=(101+2*4)\/2;\nr_int=r_ext-2;\ncut=5.9+0.1+0.2;\ntotal_h=150;\ncylinder_h=total_h-r_ext;\n\n$fn=200;\n\nmodule box()\n{\n difference()\n {\n union()\n {\n \/\/ mount\n difference()\n {\n cube([68+r_ext, 2*r_ext, cut+2*2]);\n translate([-1, (2*r_ext-101)\/2, -1])\n cube([68-0.2+1, 101, 20]);\n translate([0, (2*r_ext-101-2*2)\/2, 2])\n cube([68+2, 101+2*2, cut]);\n }\n \/\/ box\n translate([68+2+2+r_ext, r_ext, 0])\n {\n cylinder(r=r_ext, h=cylinder_h);\n translate([0,0,cylinder_h])\n sphere(r=r_ext);\n }\n }\n \/\/ cut-in the box\n union()\n {\n translate([68+2+2+r_ext, r_ext, 0])\n translate([0,0,-1])\n {\n cylinder(r=r_int, h=cylinder_h+2);\n translate([0,0,cylinder_h])\n sphere(r=r_int);\n }\n }\n }\n}\n\nbox();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e3f5fcb04af5af013fab86b9f528d5a9fe0c08ac","subject":"fixup! metric\/nut: Add facets property","message":"fixup! metric\/nut: Add facets property\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\nMKnurlInsertNutM3_5 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([35,0,0])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","old_contents":"include \n\ninclude \ninclude \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n \/*translate([0,0,-total_h\/2])*\/\n {\n translate([0,0,h\/2+.01])\n {\n screw_head_cut(nut, orient=[0,0,1], align=[0,0,1]);\n }\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n cylindera(d=head_d, h = override_h==undef?head_h:override_h, orient=orient, align=align);\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n screw_head(nut=nut, tolerance=tolerance, override_h=1000, orient=orient, align=align);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n echo (facets);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=override_h==undef?thickness:override_h, orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align([d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\nMKnurlInsertNutM3_5 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_5;\n\n box_h = 10;\n difference()\n {\n cubea([50,10,box_h], align=[1,1,-1]);\n\n #union()\n {\n translate([5,0,0])\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([15,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([25,0,0])\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n\n translate([35,0,0])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n }\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f17889ec81635d11bd2be84dde445e60b9b7936b","subject":"x\/carriage\/b: add some cable guides","message":"x\/carriage\/b: add some cable guides\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(3*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,20*mm], align=X-Y);\n\n attach(extruder_conn_guidler, N, $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=N);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:1*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=false)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extrasize=guidler_extra_h_up*Z, extrasize_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n if($show_vit)\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y, extra_size=10*X, extra_align=-X);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n color(\"darkgreen\")\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder();\n\n \/*translate(8*X)*\/\n \/*translate(-30*Y)*\/\n \/*translate(-33*Z)*\/\n \/*rotate(180*Y)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/e3d-v6-part-cooling-2x3510-blower.stl\");*\/\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"012f4a49bb8bfe6c56e7c3977e5b9272341f6cca","subject":"x\/carriage\/extruder\/a: tiny tweak for big gear position","message":"x\/carriage\/extruder\/a: tiny tweak for big gear position\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extra_size=[0,3*mm,0], extra_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=-Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extra_size=[0,3*mm,0], extra_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=-Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6f51d7f7f56741123a4076c6a2006103957b1aaa","subject":"Whitespace changes were made.","message":"Whitespace changes were made.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/antiquity\/nefertiti-la-forge\/using-blender-plugin\/hi-poly\/nefertiti-la-forge.scad","new_file":"OpenSCAD\/src\/main\/openscad\/antiquity\/nefertiti-la-forge\/using-blender-plugin\/hi-poly\/nefertiti-la-forge.scad","new_contents":"\r\n\/**\r\n * when you export in Blender, use \r\n \r\n\t\tselect object -> Wrench tool -> Decimate -> Planar -> Select 'All Boundaries' -> Angle Limit: 5-> Apply -> File -> Export -> .scad\r\n*\/\r\n\r\nuse \r\nuse <..\/..\/..\/..\/cosplay\\star-trek\\geordi-la-forge-visor\\geordi-la-forge-visor.scad>\r\n\r\nnefertitiLaForge();\r\n\r\nmodule nefertitiLaForge()\r\n{\r\n union()\r\n {\t\t\r\n Nefertitihollow();\r\n\r\n scaleFactor = 0.6;\r\n translate([0, -75, 155])\r\n rotate([0, 4, 90])\r\n scale([scaleFactor, scaleFactor, scaleFactor])\r\n geordilaForgeVisor();\r\n\r\n \/\/ base\r\n cube([180, 180, 2], center=true);\r\n }\r\n}","old_contents":"\r\n\/**\r\n * when you export in Blender, use \r\n \r\n\t\tselect object -> Wrench tool -> Decimate -> Planar -> Select 'All Boundaries' -> Angle Limit: 5-> Apply -> File -> Export -> .scad\r\n*\/\r\n\r\nuse \r\nuse <..\/..\/..\/..\/cosplay\\star-trek\\geordi-la-forge-visor\\geordi-la-forge-visor.scad>\r\n\r\nnefertitiLaForge();\r\n\r\nmodule nefertitiLaForge()\r\n{\r\n\tunion()\r\n\t{\t\t\r\n\t\tNefertitihollow();\r\n\r\n\t\tscaleFactor = 0.6;\r\n\t\ttranslate([0, -75, 155])\r\n\t\trotate([0, 4, 90])\r\n\t\tscale([scaleFactor, scaleFactor, scaleFactor])\r\n\t\tgeordilaForgeVisor();\r\n\t\t\r\n\t\t\/\/ base\r\n\t\tcube([180, 180, 2], center=true);\r\n\t}\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"346205bf816348b106a996f0d9380718187729c3","subject":"added new version of GearClock Gears3","message":"added new version of GearClock Gears3\n","repos":"wyolum\/Celeste,wyolum\/Celeste","old_file":"fabricate\/gears3.scad","new_file":"fabricate\/gears3.scad","new_contents":"include \r\n\r\n$fn=50;\r\nmm = 1;\r\ninch = 25.4 * mm;\r\n\r\nACRYLIC_THICKNESS = 5.3 * mm;\r\nACRYLIC_TOL = .5 * mm;\r\nPITCH = 360 * mm;\r\nPRESSURE_ANGLE = 28;\r\n\r\nRIM_THICKNESS = 2 * mm;\r\nEXTRA_RIM_R = 3 * mm;\r\n\r\nmodule hex(r, h){\r\n rotate(a=30, v=[0, 0, 1])\r\n linear_extrude(height=h)\r\n polygon(points=[[r,0],\r\n\t\t [r * cos(60),r * sin(60)],\r\n\t\t [r * cos(120),r * sin(120)],\r\n\t\t [r * cos(180),r * sin(180)],\r\n\t\t [r * cos(240),r * sin(240)],\r\n\t\t [r * cos(300),r * sin(300)],\r\n\t\t ],paths=[ [0, 1, 2, 3, 4, 5] ]);\r\n}\r\n\r\nmodule stepper_gear(N_TEETH=6){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n thickness = ACRYLIC_THICKNESS + 4.7 * mm;\/\/ + RIM_THICKNESS;\r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n translate([0, 0, RIM_THICKNESS])\r\n difference(){\r\n union(){\r\n rotate(a=360\/6\/2., v=[0, 0, 1])\r\n\tintersection(){\r\n\tgear(number_of_teeth=6,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = thickness,\r\n\t rim_thickness = thickness,\r\n\t hub_thickness = thickness,\r\n\t bore_diameter=0. * mm,\r\n\t circles=4,\r\n\t pressure_angle=28,\r\n\t backlash=1\r\n\t );\r\n\tcylinder(h=thickness, r=OUTER_RADIUS - .5*mm);\r\n }\r\n translate([0, 0, -RIM_THICKNESS])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\r\n \/\/ translate([0, 0, 6.5*mm])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\r\n translate([0, 0, -3 * RIM_THICKNESS])cylinder(r=OUTER_RADIUS + EXTRA_RIM_R, h=2 * RIM_THICKNESS);\r\n }\r\n translate([0, 0, -1])cylinder(r=3 * mm\/2 + .05 * mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n }\r\n}\r\n\r\nmodule outer_gear(N_TEETH=66, lash=0){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n\r\n MARGIN = 1 * inch;\r\n intersection(){\r\n scale([.995, .995, 1])\r\n cylinder(h=ACRYLIC_THICKNESS, r=70*mm);\r\ndifference() {\r\n cylinder(r=OUTER_RADIUS + MARGIN, h=ACRYLIC_THICKNESS + ACRYLIC_TOL);\r\n \/\/cylinder(r=OUTER_RADIUS + 3, h=ACRYLIC_THICKNESS + ACRYLIC_TOL);\r\n translate([0, 0, -1])\r\n scale([1.005, 1.005, 1])gear(number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t rim_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t hub_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28,\r\n\t backlash=0 \/\/ play with this\r\n\t );\r\n cylinder(h=ACRYLIC_THICKNESS + ACRYLIC_TOL, r=OUTER_RADIUS-3); \/\/ trim teeth\r\n }\r\n }\r\n \/\/for(i=[0:12])rotate(a=i*360\/12, v=[0, 0, 1])translate([69*mm,-.8*mm,0])cube([3*mm, 1.6*mm, ACRYLIC_THICKNESS]);\r\n for(i=[0:12])rotate(a=i*360\/12, v=[0, 0, 1])translate([69*mm,0*mm,0])\r\n\t\t difference(){\r\n cylinder(r=3*mm, h = ACRYLIC_THICKNESS);\r\n translate([-6*mm,-3*mm, -1])cube([6*mm, 6*mm, ACRYLIC_THICKNESS + 2]);\r\n translate([-0*mm,-0*mm, -1])cube([6*mm, 6*mm, ACRYLIC_THICKNESS + 2]);\r\n }\r\n}\r\n\r\nmodule anti_lash_gear(minute, N_TEETH=30, h=ACRYLIC_THICKNESS, lash=0){\r\n ACRYLIC_THICKNESS = h;\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n rad = 10 * mm;\r\n d1 = (rad + .0) * [1,0,0];\r\n d2 = (rad + .0) * [sin(30), cos(30), 0];\r\n translate([0, 0, -2*ACRYLIC_THICKNESS + ACRYLIC_TOL])union(){\r\n translate([0, 36 * mm, 0]) \r\n intersection(){\r\n difference(){\r\n\tintersection(){\r\n\t cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n\t difference(){\r\n\t gear(number_of_teeth=N_TEETH,\r\n\t\t circular_pitch = PITCH,\r\n\t\t gear_thickness = ACRYLIC_THICKNESS,\r\n\t\t rim_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t\t hub_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t\t bore_diameter=0. * mm,\r\n\t\t circles=0,\r\n\t\t pressure_angle=28,\r\n\t\t backlash=lash \/\/ play with this\r\n\t\t );\r\n\t translate([0, 0, -1])scale([.95, .95, 1.5])gear(number_of_teeth=N_TEETH,\r\n\t\t circular_pitch = PITCH,\r\n\t\t gear_thickness = ACRYLIC_THICKNESS,\r\n\t\t rim_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t\t hub_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t\t bore_diameter=0. * mm,\r\n\t\t circles=0,\r\n\t\t pressure_angle=28,\r\n\t\t backlash=lash \/\/ play with this\r\n\t\t );\r\n\t }\r\n\t}\r\n translate([0, 0, -1])cylinder(r=6 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n\r\n \/\/ hollow out\r\n translate([0, 0, -1])cylinder(r=N_TEETH - 5, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n }\r\n translate([0, 0, -1])cylinder(r=OUTER_RADIUS - .5, h=100);\r\n }\r\n \/\/ add spokes\r\n difference(){\r\n union(){\r\n\tfor(i=[0:4]){\r\n\t \/\/ translate([0, 36 * mm, 0])rotate(a=360\/5 * i + 3, v=[0, 0, 1])translate([-1 *mm, -27 * mm, 0])cube([2 * mm, 30 * mm, ACRYLIC_THICKNESS]); \/\/ streight spokes\r\n\t translate([0, 36 * mm, 0])rotate(a=360\/5 * i + 3, v=[0, 0, 1])translate([0 *mm, 15 * mm, 0])difference(){\r\n \t cylinder(r=11 * mm, h = ACRYLIC_THICKNESS\/2);\r\n\t translate([0, 0, -1])cylinder(r=10.2 * mm, h = ACRYLIC_THICKNESS+2);\r\n\t \/\/ translate([0, -12, -1])cube([12, 24, 2 * ACRYLIC_THICKNESS]);\r\n\t }\r\n\t}\r\n }\r\n translate([0, 36*mm, -1])cylinder(r = 4*mm, h=ACRYLIC_THICKNESS+2);\r\n }\r\n union(){\r\n difference(){ \/\/ outer rim support\r\n translate([0, 36*mm, 0])cylinder(r = 1*inch, h=ACRYLIC_THICKNESS + 1.25);\r\n translate([0, 36*mm, -1])cylinder(r = inch - 1*mm, h=ACRYLIC_THICKNESS + 10);\r\n }\r\n difference(){ \/\/ inner hub support\r\n translate([0, 36*mm, 0])cylinder(r = 4.5*mm, h=ACRYLIC_THICKNESS + 1);\r\n translate([0, 36*mm, -2])cylinder(r = 3*mm, h=ACRYLIC_THICKNESS + 10);\r\n }\r\n \/*\r\n translate([0, 36*mm, 0])\r\n intersection(){\r\n cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n difference(){ \/\/ outer rim tooth support\r\n\tcylinder(r=27, h=ACRYLIC_THICKNESS);\r\n\ttranslate([0, 0, -1])cylinder(r=1*inch, h=ACRYLIC_THICKNESS+2);\r\n }\r\n }\r\n *\/\r\n translate([0, 36*mm, 0])\r\n intersection(){\r\n cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n for(i=[0:N_TEETH]){\r\n\trotate(v=[0, 0, 1],a=i * 360.\/N_TEETH + 180.\/N_TEETH)translate([25*mm, -.5*mm, 0])cube([1.5*mm, 1*mm, ACRYLIC_THICKNESS]);\r\n }\r\n }\r\n }\r\n\r\n }\r\n}\r\n\r\nmodule anti_lash_gear_top(minute, N_TEETH=30, h=ACRYLIC_THICKNESS\/2, lash=0){\r\n ACRYLIC_THICKNESS = h;\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n rad = 10 * mm;\r\n d1 = (rad + .0) * [1,0,0];\r\n d2 = (rad + .0) * [sin(30), cos(30), 0];\r\n translate([0, 36 * mm, 0])\r\n \/\/ rotate(a=360\/30\/4 - 66.\/30 * minute\/60 * 360 + minute\/60.*720, v=[0, 0,1])\r\n \/\/ rotate(-4, v=[0, 0,1])\r\n difference(){\r\n intersection(){\r\n cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n gear(number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = ACRYLIC_THICKNESS,\r\n\t rim_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t hub_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28,\r\n\t backlash=lash\r\n\t );\r\n translate([0, 0, -1])cylinder(r=OUTER_RADIUS - .5, h=100);\r\n }\r\n translate([0, 0, -1])cylinder(r=6 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ hollow out\r\n translate([0, 0, -1])cylinder(r=N_TEETH - 5, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n\r\n }\r\n \/\/ add tensioners\r\n translate([0, 36*mm, 0])\r\n for(i=[0:4]){\r\n rotate(a=360\/5 * i + 3, v=[0, 0, 1])translate([0, 16, 0])difference(){\r\n cylinder(r=6 * mm + 4 * .4*mm, h=ACRYLIC_THICKNESS);\r\n translate([0, 0, -1])cylinder(r=6 * mm, h=ACRYLIC_THICKNESS + 2);\r\n \/\/ scale([1, 1, .3])translate([0, 0, ])rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 18, -1])sphere(r=11 * mm);\r\n }\r\n }\r\n \/\/ add in rim strip to support hour hand\r\n translate([0, 0, 0])\r\n union(){\r\n difference(){ \/\/ outer rim support\r\n translate([0, 36*mm, 0])cylinder(r = 1*inch, h=ACRYLIC_THICKNESS + 1.25);\r\n translate([0, 36*mm, -1])cylinder(r = 7 * inch\/8, h=ACRYLIC_THICKNESS + 10);\r\n }\r\n difference(){ \/\/ inner hub support\r\n translate([0, 36*mm, 0])cylinder(r = 9*mm, h=ACRYLIC_THICKNESS + 1);\r\n translate([0, 36*mm, -2])cylinder(r = 3*mm, h=ACRYLIC_THICKNESS + 10);\r\n }\r\n }\r\n}\r\n\r\nmodule inner_gear(minute, N_TEETH=30, h=ACRYLIC_THICKNESS){\r\n ACRYLIC_THICKNESS = h;\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n rad = 10 * mm;\r\n d1 = (rad + .0) * [1,0,0];\r\n d2 = (rad + .0) * [sin(30), cos(30), 0];\r\n translate([0, 36 * mm, 0])\r\n difference(){\r\n intersection(){\r\n cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n gear(number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = ACRYLIC_THICKNESS,\r\n\t rim_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t hub_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28\r\n\t );\r\n }\r\n translate([0, 0, -1])cylinder(r=6 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n\r\n \/\/ lighten the load\r\n for(i=[0:4]){\r\n rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 16, -1])cylinder(r=6 * mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ scale([1, 1, .3])translate([0, 0, ])rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 18, -1])sphere(r=11 * mm);\r\n }\r\n }\r\n \/\/ add in rim strip to support hour hand\r\n translate([0, 0, 1])\r\n union(){\r\n difference(){ \/\/ outer rim support\r\n translate([0, 36*mm, 0])cylinder(r = 1*inch, h=ACRYLIC_THICKNESS);\r\n translate([0, 36*mm, -1])cylinder(r = 7 * inch\/8, h=ACRYLIC_THICKNESS+2);\r\n }\r\n difference(){ \/\/ inner hub support\r\n translate([0, 36*mm, 0])cylinder(r = 8*mm, h=ACRYLIC_THICKNESS);\r\n translate([0, 36*mm, -1])cylinder(r = 3*mm, h=ACRYLIC_THICKNESS+2);\r\n }\r\n }\r\n}\r\n\r\nmodule minute_hand(r=65*mm, w=21.5*mm, h=RIM_THICKNESS - 0.5*mm,filagree=false){\r\n\/\/linear_extrude(height = 2, center=true)\r\n\/\/polygon(points=[[-5*mm\/2, 0], [0, 65*mm], [5*mm\/2, 0]]);\r\n difference(){\r\n union(){\r\n stepper_gear(N_TEETH=6);\r\n translate([0, 2*mm, -2*RIM_THICKNESS])\r\n\tlinear_extrude(height=h)\r\r\n if (filagree){\r\r\n\t translate([0,8.2,0])scale([1.0,1,1])import(\"filagreeminute.dxf\");\r\r\n }\r\r\n else\r\n polygon(points=[[-w\/2, 0], [0, r], [w\/2, 0]]);\r\n }\r\n translate([0, 0, 0])cylinder(r=2.5 * mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ translate([0, r - 15 * mm, -50])cylinder(h=100, r=3.00\/2*mm); \/\/hole for hall effect magnet\r\n }\r\n}\r\n\r\nmodule hour_hand(r=50*mm, w=21.5*mm, h=1.5*mm, filagree = false){\r\n difference(){\r\n union(){\r\n translate([0, RIM_THICKNESS, -RIM_THICKNESS])\r\n\tlinear_extrude(height=h)\r\r\n if (filagree){\r\r\n\t translate([0,8.2,0])scale([1.,1.025,1])import(\"filagreehour.dxf\"); \r\n }else{ \r\n\t polygon(points=[[-w\/2, 0], [0, r], [w\/2, 0]]);\r\n\t}\r\n \/\/ translate([0, 36, -RIM_THICKNESS])cylinder(r=5.5 * mm\/2, h=ACRYLIC_THICKNESS + RIM_THICKNESS + .5*mm);\r\n translate([0, 36, -RIM_THICKNESS])cylinder(r=5.5 * mm\/2, h=ACRYLIC_THICKNESS + RIM_THICKNESS + 1);\r\n translate([0, 36, ACRYLIC_THICKNESS + .75*mm])scale([1, .8, 1])cylinder(r1=7\/2. * mm, r2=3.2*mm, h=1.5*mm); \/\/ clip\r\n translate([0, 0, -RIM_THICKNESS])cylinder(r=11, h=h);\r\n }\r\n translate([0, 0, -RIM_THICKNESS - 1])cylinder(r=8.25, h=2*h);\r\n translate([-.5 * mm, 36 * mm-5 * mm, 2])cube([1 * mm, 10 * mm, 10 * mm]); \/\/ slot\r\n translate([0 * mm, 36 * mm * mm, 0])cylinder(r=3.12\/2 * mm, h=30.15 * mm);\/\/ hall effect magnet slot\r\n }\r\n}\r\n\r\nHOUR = 9;\r\nMINUTE = $t * 60;\r\n\/\/MINUTE = HOUR * 60 + 15;\r\n\/\/ translate([0,0, 2])rotate(v=[0, 1, 0], a=180)\r\n\/\/ translate([0, -0, -RIM_THICKNESS])rotate(a=MINUTE\/720 * 360, v=[0, 0, 1])color([.1, 1, 0])inner_gear(MINUTE);\r\n\/\/ color([.1, .1, 1])outer_gear(); \r\n\/\/ translate([0, 0, -1.5*mm])rotate(a=MINUTE\/720 * 360, v=[0, 0, 1])color([1, 0, 0])rotate(a=0, v=[0, 0, 1])hour_hand(w=11,filagree=true);\r\ntranslate([0, 0, -2*RIM_THICKNESS])translate([0, 0, 0])rotate(a=MINUTE\/60 * 360, v=[0, 0, 1])minute_hand(w=12,filagree=true);\r\n\r\nlash = 0;\r\n\/\/ anti_lash_gear(lash=lash);\r\n\/\/ color([1, 0, 1])translate([0, -0, +ACRYLIC_THICKNESS\/2 + ACRYLIC_TOL])anti_lash_gear_top(lash=lash, H=ACRYLIC_THICKNESS);\r\n\/\/ translate([130, 0, 0])cylinder(r=50*mm, h=1*mm); \/\/ for scale\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fabricate\/gears3.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"71c14fb03f6def3f2954d1bc500a969acad121e0","subject":"x\/ends: use material system","message":"x\/ends: use material system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=true)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_end_width(with_motor), d=xaxis_rod_d_support, orient=X, align=X);\n\n \/\/ endstops mount support\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate(X*5*mm)\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate(X*-7*mm)\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n material(Mat_Plastic)\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ z smooth bearing mounts support\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts cut\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n material(Mat_PlasticBlack)\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n material(zaxis_nut_mat)\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*100*mm,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=true)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_end_width(with_motor), d=xaxis_rod_d_support, orient=X, align=X);\n\n \/\/ endstops mount support\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate(X*5*mm)\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate(X*-7*mm)\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ z smooth bearing mounts support\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts cut\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*100*mm,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"425ab4223a3a64d44edf31f0dc1d6fe3a2604dc1","subject":"beefed up rails. DE was a bit flexy","message":"beefed up rails. DE was a bit flexy\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/JansenBED.scad","new_file":"Drawings\/JansenBED.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenBED.scad $\n\/\/ $Id: JansenBED.scad 435 2015-03-02 15:21:04Z mrwhat $\n\n\/\/ main BED code, more injection-mold-like model\n\n\/\/ Uses a ton of stuff from Jansen.scad.\n\/\/ Use from an #include in Jansen.scad.\n\n\/\/ for testing, reproduce included stuff:\n\/\/include \n\/\/BED(34,66.4,34);Drad=2.4;NodeHeight3=12.5;NodeHeight=4.3;Brad=2.4;BradFree=2.5;ForkHeight=NodeHeight;rad4=1.4;LinkRad=3;\n\n\nforkLen = 3.5*LinkRad; \/\/ forks around linkage in BED\nnf=24; \/\/ faces for hull components\n\nmodule BEDhull(dLeft,dPerp,dRight,ph,rp) { hull() {\ntranslate([-dLeft,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([dRight,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([-rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ 0,dPerp-rp,ph-1]) sphere(r=1,$fn=nf);\ntranslate([4-dLeft ,1,2]) sphere(r=1,$fn=nf);\ntranslate([dRight-4,1,2]) sphere(r=1,$fn=nf);\n}}\n\nmodule BEDsideRail(x,dPerp,ph) {\nhull() {\n translate([x,-1, 0]) {\n cylinder(h=1,r1=1.2,r2=.1,$fn=nf);\n translate([0,0,2]) sphere(r=.6,$fn=nf); }\n translate([0,dPerp+2,0]) {\n cylinder(h=1,r1=1.5,r2=.1,$fn=nf);\n translate([0,0,ph-.6]) sphere(r=.6,$fn=nf); }\n }\nhull() {\n if (x < 0) { translate([x+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n else { translate([x-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n translate([0,dPerp,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf);\n }\n}\n\nmodule BEDmainSideRail(x,dPerp,ph) {\nx2=(x<0)?x+2:x-2;\nx1=(x<0)?x-1:x+1;\n blade([x2,0,.6],2.5,1.5, [0,dPerp,0.4],3,1.5);\n blade([x1,-1,.4],1,3.5, [0,dPerp+2,1],1,ph,fn=16);\n}\n\n\/*\nmodule BEDrails(dLeft,dPerp,dRight,ph,rp) {\nunion() {\n BEDsideRail(-dLeft,dPerp,ph);\n BEDsideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n translate([dRight,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n }\n hull() { \/\/ horiz, flat part of DE segment\n translate([-dLeft+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n translate([dRight-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n }\n \/\/ extra brace on D node\n hull() { \n translate([dRight-6,6,0]) cylinder(h=3,r1=1,r2=0.5,$fn=6);\n translate([dRight+2,1,0]) cylinder(h=4,r1=3,r2=2,$fn=6);\n }\n}}\n*\/\n\nmodule BEDmainRails(dLeft,dPerp,dRight,ph,rp) union() {\n BEDmainSideRail(-dLeft,dPerp,ph);\n BEDmainSideRail(dRight,dPerp,ph);\n\n blade([-dLeft ,-1,1.5],1,6, \/\/ vert DE\n [dRight+3,-1,0.5],1.5,NodeHeight-1,fn=17);\n blade([-dLeft+1,0,.4],3.5,1.5, \/\/ DE horiz\n [dRight-2,0,.4],3,2);\n\n \/\/ extra brace on D node\n hull() { \n translate([dRight-4,6,0]) scale([1,1,4]) sphere(1,$fn=16);\n translate([dRight+4,1,0]) sphereSection(3,4);\n }\n}\n\nmodule forkTab(h,r1,r2,len) {\ndifference(){\nhull() { cylinder(h=h,r1=r1,r2=r2,$fn=48);\n translate([len+2,0,0]) cylinder(h=2,r1=2,r2=1,$fn=12); }\ntranslate([len,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n drillHole(rad4);\n}}\n\nmodule forkTabF(h,r1,r2,len) difference() {\n union() {\n linkNode(r1+0.5,h,ar=.9,dx=len+3);\n \/\/ add flat section, easier to clamp\n hull() {\n cylinder(r1=3.5,r2=2.5,h=3,$fn=12);\n translate([len,0,0]) cylinder(r1=3,r2=1.8,h=3,$fn=18);\n }\n }\n translate([len,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n drillHole(rad4);\n}\n\nmodule imBEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDhull(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-5*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n translate([0,2,-1])\n BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n\/\/ forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n}\n\/\/------------------------------------- end of imBEDmain\n\nmodule BED1main(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDrails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen-2);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen-2); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) \/\/difference() {\n hull() { translate([-4*Drad-4,-1,2]) sphere(r=2,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n \/\/#translate([0,0,-1.5]) { difference() { hull() {\n \/\/ translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n \/\/ cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n \/\/ cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n \/\/}\n\n } \/\/ end translate\n } \/\/ union\n \n \/\/translate([0,2,-1])\n \/\/ BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n \/\/ main B-axis node cylinder\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n\n \/\/ more bracing for fork\n hull() {\n translate([-dLeft+8,0,0]) cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+17,11,0]) cylinder(r=2,h=1,$fn=6);\n }\n hull() {\n translate([-dLeft+1,-1.5,0]) cylinder(r=2,h=NodeHeight+3.5,$fn=6);\n translate([-dLeft+8,-1,0]) cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+21,0,0]) cylinder(r=2,h=1,$fn=6);\n }\n \n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree+.2); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+9,-6,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+13.5,10,0]) cylinder(h=NodeHeight+3,r=8,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\n\/\/ custom support\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\ncolor(\"Cyan\") union() {\n\/* stuff parallel to perimiter adhered too well\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n \/\/translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n \/\/translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n \/\/translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n*\/\n hull() {\n translate([-34,0,0]) cylinder(r1=3,r2=5,h=2,$fn=11);\n #translate([-29,0.5,0]) scale([1,5,1])\n cylinder(r1=.3,r2=1,h=2,$fn=6);\n }\n translate([-34,0,sH-1.5]) {\n translate([3.6,0,0]) cube([5,sW,2],center=true);\n for (a=[-30,30]) rotate([0,0,a]) translate([4,0,0]) cube([6,sW,3],center=true);\n for (a=[60:30:322]) rotate([0,0,a])\n translate([3,0,0]) cube([4,sW,3],center=true);\n }\n}\n\n}\n\nmodule BEDmainFrame(dLeft,dPerp,dBase,perpHeight) union() {\n\n \/\/ main B-axis node cylinder\n translate([0,dPerp,0]) {\n linkNode(Brad+2.5,perpHeight,ar=3.5,off=-.2,dx= 3*Brad,dy=-3*Brad); \n linkNode(Brad+2.5,perpHeight,ar=3.5,off=-.2,dx=-3*Brad,dy=-3*Brad); \n }\n\n BEDmainRails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) translate([0,0,NodeHeight+0.3])\n forkTabF(ForkHeight,Drad+2,rad4+1.4,forkLen);\n\n translate([dBase,0,0]) linkNode(Drad+2.2,NodeHeight,off=-.2,\n dx=-7*Drad,dy=-2);\n } \/\/ end translate\n\n \/\/ more bracing for fork\n hull() {\n translate([-dLeft+8,0,3.3]) scale([4,2,NodeHeight]) sphere(1,$fn=16);\n translate([-dLeft+16,11,1]) scale([1,1,2]) sphere(1,$fn=16);\n }\n hull() {\n translate([-dLeft+1,-1.5,NodeHeight+2.5]) sphere(2,$fn=24);\n translate([-dLeft+8,0,NodeHeight-1]) sphere(4,$fn=24);\/\/cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+19,-1,-1]) scale([1,1,3]) sphere(1,$fn=16);\n }\n\n}\n\nmodule BEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\n difference() {\n BEDmainFrame(dLeft,dPerp,dBase,perpHeight);\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree+.2); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+9,-6,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+13.5,10,0]) cylinder(h=NodeHeight+3,r=8,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n\n \/\/ chop off any junk below bottom\n translate([-dLeft-20,-20,-30]) cube([dBase+40,dPerp+40,30]);\n }\n\n color(\"Cyan\") forkSupport(); \/\/ custom support\n}\n\nmodule forkSupport() {\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\n union() {\n\/* stuff parallel to perimiter adhered too well\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n \/\/translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n \/\/translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n \/\/translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n*\/\n hull() {\n translate([-34,0,0]) cylinder(r1=3,r2=5,h=2,$fn=11);\n #translate([-29,0.5,0]) scale([1,5,1])\n cylinder(r1=.3,r2=1,h=2,$fn=6);\n }\n translate([-34,0,sH-1.5]) {\n translate([3.6,0,0]) cube([5,sW,2],center=true);\n for (a=[-30,30]) rotate([0,0,a]) translate([4,0,0]) cube([6,sW,3],center=true);\n for (a=[60:30:322]) rotate([0,0,a])\n translate([3,0,0]) cube([4,sW,3],center=true);\n }\n }\n}\n\n\/\/------------------------------------- end of BED1main\n\nmodule imBED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n\/\/ Complete (Joined) version of BED, with in-place fork\nmodule imBEDj(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nunion() {\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork, in place\ntranslate([-dLeft,0,-.01]) { rotate([0,0,5]) { \n rotate([180,0,0]) forkTab(ForkHeight+.2,Drad+2,rad4+1.4,forkLen);\n\n#hull(){\n translate([forkLen ,0,0])cylinder(h=NodeHeight-2,r=2.8,$fn=12);\n translate([forkLen+1.5,4,1.1])sphere(r=1,$fn=6);\n translate([forkLen+2,0,0])cylinder(h=NodeHeight-2,r=2.2,$fn=12);}\n}}\n\n}}\n\n\/\/imBED(DEleft,DE,DEperp);\n\n\/\/ version of BED intended for one-sided injection mold\nmodule BED1(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\necho(\"BED1:\",dLeft,dBase,dPerp);\nBED1main(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\ntranslate([-10,8,0]) rotate([0,0,55])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\nmodule BED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\n\/\/%BED1main(dLeft,dBase,dPerp);\nBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\ntranslate([0,14,0]) rotate([0,0,220])\n forkTabF(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenBED.scad $\n\/\/ $Id: JansenBED.scad 435 2015-03-02 15:21:04Z mrwhat $\n\n\/\/ main BED code, more injection-mold-like model\n\n\/\/ Uses a ton of stuff from Jansen.scad.\n\/\/ Use from an #include in Jansen.scad.\n\n\/\/ for testing, reproduce included stuff:\n\/\/include \n\/\/BED(34,66.4,34);Drad=2.4;NodeHeight3=12.5;NodeHeight=4.3;Brad=2.4;BradFree=2.5;ForkHeight=NodeHeight;rad4=1.4;LinkRad=3;\n\n\nforkLen = 3.5*LinkRad; \/\/ forks around linkage in BED\nnf=24; \/\/ faces for hull components\n\nmodule BEDhull(dLeft,dPerp,dRight,ph,rp) { hull() {\ntranslate([-dLeft,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([dRight,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([-rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ 0,dPerp-rp,ph-1]) sphere(r=1,$fn=nf);\ntranslate([4-dLeft ,1,2]) sphere(r=1,$fn=nf);\ntranslate([dRight-4,1,2]) sphere(r=1,$fn=nf);\n}}\n\nmodule BEDsideRail(x,dPerp,ph) {\nhull() {\n translate([x,-1, 0]) {\n cylinder(h=1,r1=1.2,r2=.1,$fn=nf);\n translate([0,0,2]) sphere(r=.6,$fn=nf); }\n translate([0,dPerp+2,0]) {\n cylinder(h=1,r1=1.5,r2=.1,$fn=nf);\n translate([0,0,ph-.6]) sphere(r=.6,$fn=nf); }\n }\nhull() {\n if (x < 0) { translate([x+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n else { translate([x-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n translate([0,dPerp,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf);\n }\n}\n\nmodule BEDmainSideRail(x,dPerp,ph) {\nx2=(x<0)?x+2:x-2;\n hull() {\n translate([x2,0,.6]) scale([3,1,1.5]) sphere(1,$fn=36);\n translate([0,dPerp,0.6]) scale(3,1,1.5) sphere(1,$fn=36);\n }\n hull() {\n translate([x,-1, 0]) scale([1,1,2]) sphere(1,$fn=16);\n translate([0,dPerp+2,1]) scale([1,1,ph]) sphere(1,$fn=16);\n }\n}\n\nmodule BEDrails(dLeft,dPerp,dRight,ph,rp) {\nunion() {\n BEDsideRail(-dLeft,dPerp,ph);\n BEDsideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n translate([dRight,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n }\n hull() { \/\/ horiz, flat part of DE segment\n translate([-dLeft+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n translate([dRight-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n }\n \/\/ extra brace on D node\n hull() { \n translate([dRight-6,6,0]) cylinder(h=3,r1=1,r2=0.5,$fn=6);\n translate([dRight+2,1,0]) cylinder(h=4,r1=3,r2=2,$fn=6);\n }\n}}\n\nmodule BEDmainRails(dLeft,dPerp,dRight,ph,rp) union() {\n BEDmainSideRail(-dLeft,dPerp,ph);\n BEDmainSideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,1]) scale([1,1,5]) sphere(1,$fn=36);\n translate([dRight+1,-1,1]) scale([1,1,NodeHeight-2]) sphere(1,$fn=36);\n }\n \/\/ horiz, flat part of DE segment\n hull() {\n translate([-dLeft+1,0,.4]) scale([2,3,1.5]) sphere(1,$fn=36);\n translate([dRight-2,0,.4]) scale([2,2,1.5]) sphere(1,$fn=36);\n }\n\n \/\/ extra brace on D node\n hull() { \n translate([dRight-4,6,0]) scale([1,1,3]) sphere(1,$fn=16);\n translate([dRight+4,1,0]) sphereSection(3,4);\n }\n}\n\nmodule forkTab(h,r1,r2,len) {\ndifference(){\nhull() { cylinder(h=h,r1=r1,r2=r2,$fn=48);\n translate([len+2,0,0]) cylinder(h=2,r1=2,r2=1,$fn=12); }\ntranslate([len,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n drillHole(rad4);\n}}\n\nmodule forkTabF(h,r1,r2,len) difference() {\n union() {\n linkNode(r1+0.5,h,ar=.9,dx=len+3);\n \/\/ add flat section, easier to clamp\n hull() {\n cylinder(r1=3.5,r2=2.5,h=3,$fn=12);\n translate([len,0,0]) cylinder(r1=3,r2=1.8,h=3,$fn=18);\n }\n }\n translate([len,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n drillHole(rad4);\n}\n\nmodule imBEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDhull(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-5*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n translate([0,2,-1])\n BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n\/\/ forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n}\n\/\/------------------------------------- end of imBEDmain\n\nmodule BED1main(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDrails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen-2);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen-2); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) \/\/difference() {\n hull() { translate([-4*Drad-4,-1,2]) sphere(r=2,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n \/\/#translate([0,0,-1.5]) { difference() { hull() {\n \/\/ translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n \/\/ cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n \/\/ cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n \/\/}\n\n } \/\/ end translate\n } \/\/ union\n \n \/\/translate([0,2,-1])\n \/\/ BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n \/\/ main B-axis node cylinder\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n\n \/\/ more bracing for fork\n hull() {\n translate([-dLeft+8,0,0]) cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+17,11,0]) cylinder(r=2,h=1,$fn=6);\n }\n hull() {\n translate([-dLeft+1,-1.5,0]) cylinder(r=2,h=NodeHeight+3.5,$fn=6);\n translate([-dLeft+8,-1,0]) cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+21,0,0]) cylinder(r=2,h=1,$fn=6);\n }\n \n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree+.2); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+9,-6,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+13.5,10,0]) cylinder(h=NodeHeight+3,r=8,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\n\/\/ custom support\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\ncolor(\"Cyan\") union() {\n\/* stuff parallel to perimiter adhered too well\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n \/\/translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n \/\/translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n \/\/translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n*\/\n hull() {\n translate([-34,0,0]) cylinder(r1=3,r2=5,h=2,$fn=11);\n #translate([-29,0.5,0]) scale([1,5,1])\n cylinder(r1=.3,r2=1,h=2,$fn=6);\n }\n translate([-34,0,sH-1.5]) {\n translate([3.6,0,0]) cube([5,sW,2],center=true);\n for (a=[-30,30]) rotate([0,0,a]) translate([4,0,0]) cube([6,sW,3],center=true);\n for (a=[60:30:322]) rotate([0,0,a])\n translate([3,0,0]) cube([4,sW,3],center=true);\n }\n}\n\n}\n\nmodule BEDmainFrame(dLeft,dPerp,dBase,perpHeight) union() {\n\n \/\/ main B-axis node cylinder\n translate([0,dPerp,0]) {\n linkNode(Brad+2.5,perpHeight,ar=3.5,off=-.2,dx= 3*Brad,dy=-3*Brad); \n linkNode(Brad+2.5,perpHeight,ar=3.5,off=-.2,dx=-3*Brad,dy=-3*Brad); \n }\n\n BEDmainRails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) translate([0,0,NodeHeight+0.3])\n forkTabF(ForkHeight,Drad+2,rad4+1.4,forkLen);\n\n translate([dBase,0,0]) linkNode(Drad+2.2,NodeHeight,off=-.2,\n dx=-7*Drad,dy=-2);\n } \/\/ end translate\n\n \/\/ more bracing for fork\n hull() {\n translate([-dLeft+8,0,3.3]) scale([4,2,NodeHeight]) sphere(1,$fn=16);\n translate([-dLeft+16,11,1]) scale([1,1,2]) sphere(1,$fn=16);\n }\n hull() {\n translate([-dLeft+1,-1.5,NodeHeight+2.5]) sphere(2,$fn=24);\n translate([-dLeft+8,0,NodeHeight-1]) sphere(4,$fn=24);\/\/cylinder(r=3,h=NodeHeight+3,$fn=6);\n translate([-dLeft+19,-1,-1]) scale([1,1,3]) sphere(1,$fn=16);\n }\n\n}\n\nmodule BEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\n difference() {\n BEDmainFrame(dLeft,dPerp,dBase,perpHeight);\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree+.2); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+9,-6,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+13.5,10,0]) cylinder(h=NodeHeight+3,r=8,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,-1]) cylinder(h=3*NodeHeight,r=.8,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n\n \/\/ chop off any junk below bottom\n translate([-dLeft-20,-20,-30]) cube([dBase+40,dPerp+40,30]);\n }\n\n color(\"Cyan\") forkSupport(); \/\/ custom support\n}\n\nmodule forkSupport() {\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\n union() {\n\/* stuff parallel to perimiter adhered too well\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n \/\/translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n \/\/translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n \/\/translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n*\/\n hull() {\n translate([-34,0,0]) cylinder(r1=3,r2=5,h=2,$fn=11);\n #translate([-29,0.5,0]) scale([1,5,1])\n cylinder(r1=.3,r2=1,h=2,$fn=6);\n }\n translate([-34,0,sH-1.5]) {\n translate([3.6,0,0]) cube([5,sW,2],center=true);\n for (a=[-30,30]) rotate([0,0,a]) translate([4,0,0]) cube([6,sW,3],center=true);\n for (a=[60:30:322]) rotate([0,0,a])\n translate([3,0,0]) cube([4,sW,3],center=true);\n }\n }\n}\n\n\/\/------------------------------------- end of BED1main\n\nmodule imBED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n\/\/ Complete (Joined) version of BED, with in-place fork\nmodule imBEDj(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nunion() {\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork, in place\ntranslate([-dLeft,0,-.01]) { rotate([0,0,5]) { \n rotate([180,0,0]) forkTab(ForkHeight+.2,Drad+2,rad4+1.4,forkLen);\n\n#hull(){\n translate([forkLen ,0,0])cylinder(h=NodeHeight-2,r=2.8,$fn=12);\n translate([forkLen+1.5,4,1.1])sphere(r=1,$fn=6);\n translate([forkLen+2,0,0])cylinder(h=NodeHeight-2,r=2.2,$fn=12);}\n}}\n\n}}\n\n\/\/imBED(DEleft,DE,DEperp);\n\n\/\/ version of BED intended for one-sided injection mold\nmodule BED1(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\necho(\"BED1:\",dLeft,dBase,dPerp);\nBED1main(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\ntranslate([-10,8,0]) rotate([0,0,55])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\nmodule BED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\n\/\/%BED1main(dLeft,dBase,dPerp);\nBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\ntranslate([-9,8,0]) rotate([0,0,55])\n forkTabF(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"f6a798f77e1b240cc9ad0c5b8e9a3c8745423bee","subject":"model\/Capture\/JumpOffTrigger: Fix error introduced by RX changes","message":"model\/Capture\/JumpOffTrigger: Fix error introduced by RX changes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-idler.scad","new_file":"y-idler.scad","new_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,0,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extra_size=[yaxis_idler_pulley_tight_len,0,0], \n extra_align=[-1,0,0]\n );\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=-Z, align=-Z);\n\n \/*cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);*\/\n\n for(y=[-1,1])\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"include \n\ninclude \nuse \n\nmodule yaxis_idler(part)\n{\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n\n if(part==U)\n {\n difference()\n {\n yaxis_idler(part=\"pos\");\n yaxis_idler(part=\"neg\");\n }\n yaxis_idler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ front plate\n tx(-extrusion_size\/2)\n rcubea(\n size=[yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], \n align=-X,\n extra_size=Z*yaxis_idler_mount_thickness,\n extra_align=Z\n );\n\n \/\/ top mount plate\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n rcubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n\n intersection()\n {\n tz(extrusion_size\/2)\n cubea([100, yidler_mount_width, 100], align=Z);\n\n hull()\n {\n for(y=[-1,1])\n ty(y*yaxis_idler_tightscrew_dist)\n tx(-yaxis_idler_mount_thickness)\n tz(extrusion_size\/2)\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n rcylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=N,\n orient=X\n );\n rcubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=Z,\n extra_size=[yaxis_idler_mount_thickness,0,0],\n extra_align=X\n );\n }\n }\n\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n for(y=[-1,0,1])\n ty(y*mount_screw_dist\/2)\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=-Z, align=-Z);\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness+10*mm, with_nut=false, orient=X, align=X);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n tx(-extrusion_size\/2)\n tx(-yaxis_idler_mount_thickness)\n for(y=[-1,1])\n ty(y*(yaxis_idler_mount_thread_dia*2.5))\n screw_cut(nut=extrusion_nut, head=\"button\", h=yaxis_idler_mount_thickness+5*mm, with_nut=false, orient=X, align=X); \n }\n}\n\nmodule yaxis_idler_pulleyblock(part, show_pulley=false)\n{\n h = yaxis_idler_pulley_h + 3*mm*2;\n if(part==U)\n {\n difference()\n {\n yaxis_idler_pulleyblock(part=\"pos\");\n yaxis_idler_pulleyblock(part=\"neg\");\n }\n %yaxis_idler_pulleyblock(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=N,\n extra_size=[yaxis_idler_pulley_tight_len,0,0], \n extra_align=[-1,0,0]\n );\n }\n else if(part==\"neg\")\n {\n \/\/ pulley cutout\n tx(-3*mm)\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=N,\n extra_size=[20*mm,0,0], extra_align=X\n );\n\n \/\/ pulley screw\n tz(h\/2)\n screw_cut(yaxis_idler_pulley_nut, head=\"button\", h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=Z, align=N);\n\n for(y=[-1,1])\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=X, align=X); \n }\n else if(part==\"vit\")\n {\n pulley(pulley_2GT_20T_idler);\n }\n\n}\n\nmodule part_y_idler()\n{\n attach([N, [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule part_y_idler_pulleyblock()\n{\n attach([N, [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([N,[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5e984c656c12b5790ec6991b319192c103e29419","subject":"Create module and try to get projection Reduce resolution to get circles instead of polygons","message":"Create module and try to get projection\nReduce resolution to get circles instead of polygons\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/mobile_support.scad","new_file":"Hardware\/mobile_support.scad","new_contents":"module tender()\n{\ndifference(){\n\tcube(size=[20, 40, thickness], center=true);\n\ttranslate([2, 0, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, 1, 0]) rotate([0,0, -20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0+2, 12, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, 12+1, 0]) rotate([0,0, -20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0+2, -12, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, -12-1, 0]) rotate([0,0, 20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0-5, -6, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\n\t}\n}\n\nmodule mobile_support()\n{\n\twidth = 97; \/\/ External width (except clipping mechanism)\n\theight = 146; \/\/ External height (except clipping mechanism)\n\tcorner_radius = 14; \/\/ Round corner at the bottom corners\n\ttop_width = 114; \/\/ Clipping mechanism width\n\ttop_height = 20; \/\/ Clipping mechanism height\n\tthickness = 5; \/\/ Thickness\n\tclip_height = 14;\n\t\n\t\/\/Main pocket\n\tdifference()\n\t{\n\t\tunion(){\n\t\t\tcube(size = [width,height,thickness], center = true);\n\t\t\tdifference(){\n\t\t\t\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true, $fs=0.03);\n\t\t\t\ttranslate([-width\/2-5, 0,0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\t\t\ttranslate([-width\/2-1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n\t\t\t}\n\t\t\tdifference(){\n\t\t\t\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true, $fs=0.03);\n\t\t\t\ttranslate([width\/2+5, 0,0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\t\t\ttranslate([width\/2+1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n\t}\n\t\t}\n\t\tcube(size = [width-20,height-24,thickness], center = true);\n\t}\n\t\n\t\/\/ Existing top clip\n\t\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\t\n\t\n\tclip_width = width +20;\n\t\/\/ Top clip support\n\tdifference(){\n\t\ttranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width+20, clip_height, thickness], center = true);\n\t\/\/ Holes for the clip\n\t\ttranslate([-clip_width\/2+7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([+clip_width\/2-7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\/\/ Holes to attach a line\n\t\ttranslate([-clip_width\/2-3, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([+clip_width\/2+3, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t}\n\t\n\t\n\t\/\/ Top clip\n\tdifference()\n\t{\n\t\ttranslate([-clip_height\/2-1, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\t\ttranslate([-clip_height\/2-1, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([-clip_height\/2-1, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t}\n\t\n\t\/\/ Bottom clip support\n\tdifference(){\n\t\ttranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width+20, clip_height, thickness], center = true);\n\t\ttranslate([-clip_width\/2+7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([+clip_width\/2-7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([-clip_width\/2-3, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([+clip_width\/2+3, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t}\n\t\/\/ Bottom clip\n\tdifference(){\n\t translate([clip_height\/2+1, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\t\ttranslate([clip_height\/2+1, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t\ttranslate([clip_height\/2+1, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true, $fs=0.03);\n\t}\n\ttranslate([clip_width\/4-2,clip_width\/4,0]) tender();\n\ttranslate([clip_width\/4-2,-clip_width\/4,0]) tender();\n\ttranslate([-clip_width\/4+2,-clip_width\/4,0]) tender();\n\ttranslate([-clip_width\/4+2,clip_width\/4,0]) tender();\n}\n\n\nprojection() mobile_support();\n\n\n\n","old_contents":"width = 97; \/\/ External width (except clipping mechanism)\nheight = 146; \/\/ External height (except clipping mechanism)\ncorner_radius = 14; \/\/ Round corner at the bottom corners\ntop_width = 114; \/\/ Clipping mechanism width\ntop_height = 20; \/\/ Clipping mechanism height\nthickness = 5; \/\/ Thickness\nclip_height = 14;\n\n\/\/Main pocket\ndifference()\n{\n\tunion(){\n\t\tcube(size = [width,height,thickness], center = true);\n\t\tdifference(){\n\t\t\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n\t\t}\n\t\tdifference(){\n\t\t\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([width\/2+5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([width\/2+1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n}\n\t}\n\tcube(size = [width-20,height-24,thickness], center = true);\n}\n\n\/\/ Existing top clip\n\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\n\nclip_width = width +20;\n\/\/ Top clip support\ndifference(){\n\ttranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Top clip\ndifference()\n{\n\ttranslate([-clip_height\/2-1, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([-clip_height\/2-1, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([-clip_height\/2-1, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Bottom clip support\ndifference(){\n\ttranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\/\/ Bottom clip\ndifference(){\n translate([clip_height\/2+1, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([clip_height\/2+1, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([clip_height\/2+1, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\nmodule tender()\n{\ndifference(){\n\tcube(size=[20, 40, thickness], center=true);\n\ttranslate([2, 0, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, 1, 0]) rotate([0,0, -20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0+2, 12, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, 12+1, 0]) rotate([0,0, -20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0+2, -12, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\ttranslate([0-4, -12-1, 0]) rotate([0,0, 20]) cube(size=[15, 3, thickness], center=true);\n\t\ttranslate([0-5, -6, 0]) cylinder(r=2.5, h=thickness, center = true);\n\t\n\t}\n}\ntranslate([clip_width\/4-2,clip_width\/4,0]) tender();\ntranslate([clip_width\/4-2,-clip_width\/4,0]) tender();\ntranslate([-clip_width\/4+2,-clip_width\/4,0]) tender();\ntranslate([-clip_width\/4+2,clip_width\/4,0]) tender();\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8d6873a80cb07fa03dfdea5ff924623d7584ca5f","subject":"tweaking platform mount","message":"tweaking platform mount\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\ntranslate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n%for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=3.6; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=5,r2=4.5,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.8) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-5:5]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.1) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,5,2]) cube([2*axisSep,.5,4],center=true);\n cube([2*axisSep,1,1],center=true);\n }\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) difference() {\n tab();\n %translate([0,0,2]) \/\/ pilot hole for plastic screw\n cylinder(r1=PCBhole-.5,r2=PCBhole+.2,h=5,$fn=13);\n }\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\ntranslate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n%for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=1.5; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=3,r2=2,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(2) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n\/\/r1=hr+1.1; r2=hr-.4; \n ch=thick+2; dz=-1.6; \n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-5:5]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.1) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,5,2]) cube([2*axisSep,.5,4],center=true);\n cube([2*axisSep,1,1],center=true);\n }\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab();\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"4dec8e3bb92c759dceb4bbfa6694dc639351e094","subject":"yaxis: switch to bearing_bronze_12_18_18","message":"yaxis: switch to bearing_bronze_12_18_18\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"e2e81d746f21efa630bb771eaa7d3471c40dd93b","subject":"Add tender (taken from mobile_support.scad)","message":"Add tender (taken from mobile_support.scad)\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/tender.scad","new_file":"Hardware\/tender.scad","new_contents":"tender();\n\nmodule tender()\n{\ndifference(){\n\tcube(size=[20, 45, thickness], center=true);\n\ttranslate([2, 0, 0]) cylinder(r=2.5, h=2*thickness, center = true);\n\t\ttranslate([0-4, 1, 0]) rotate([0,0, -20]) cube(size=[15, 4, 2*thickness], center=true);\n\t\ttranslate([0+2, 13, 0]) cylinder(r=2.5, h=2*thickness, center = true, $fs=1);\n\t\ttranslate([0-4, 13+1, 0]) rotate([0,0, -20]) cube(size=[15, 4, 2*thickness], center=true);\n\t\ttranslate([0+2, -13, 0]) cylinder(r=2.5, h=2*thickness, center = true, $fs=1);\n\t\ttranslate([0-4, -13-1, 0]) rotate([0,0, 20]) cube(size=[15, 4, 2*thickness], center=true);\n\t\ttranslate([0-5, -6.5, 0]) cylinder(r=2.5, h=2*thickness, center = true, $fs=1);\n\t\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/tender.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"fe2df0a1923606a027c4cec4d424f24ed8c58518","subject":"added flowerpot saurcer with d=14cm","message":"added flowerpot saurcer with d=14cm\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"flowerpot_saucer\/flowerpot_saucer_14cm.scad","new_file":"flowerpot_saucer\/flowerpot_saucer_14cm.scad","new_contents":"use \nsaucer(d=140);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'flowerpot_saucer\/flowerpot_saucer_14cm.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"d4880b49ac1031823c2f64678d2fc0b6b1b172e2","subject":"[3d] Add option for no LCD\/Buttons","message":"[3d] Add option for no LCD\/Buttons\n\nIdeally the size of the case would be reduced to the minimum size that\nwould hold the appropriate stack, but the nuttrap on the top can't get\nany smaller\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:No,1:Yes]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32-6.7, 32][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,[wall_t,lcd_mount_t\/2][LCD],lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+38.8,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.5;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 2;\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height (19.1+ headless Zero, 22.4 headless Pi3)\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 8.0, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,-17.25,0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+38.8,wall_t]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+51.5, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+51.5, h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,1,0]) {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"84a6cb31e5676904c76c7d4d659595ba8d44084e","subject":"shapes\/rcylindera: Fix extra_h\/align etc","message":"shapes\/rcylindera: Fix extra_h\/align etc\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=2,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if($preview_mode || round_radius == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_,r2_];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=XAXIS, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n rcylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=XAXIS, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"798f8321734746ef0d8cef540ed4d0fe240319f1","subject":"main: fix out of memory","message":"main: fix out of memory\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*148,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n for(x=[-1,1])\n translate([axis_pos_x+x*148,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d9a6cbca4f07d0ee1289ebc16f8f54abd798b34b","subject":"The damn program is actually starting to work! Just need to make it recursive now....","message":"The damn program is actually starting to work! Just need to make it recursive now....\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3] , current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 2;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n echo(ev_mult(translation_vectors[i], [size \/ (2 * sqrt(2)), size \/ (2 * sqrt(2))]));\n\n translate(translation_vectors[i] * [size \/ (2 * sqrt(2)), size \/ (2 * sqrt(2))] + starting_pos) {\n rotate(rotation_vectors[i] * [0, 45, 45]) {\n #square([connector_thickness, size], center = true);\n }\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"61dcba11e10a6825168aaccdc2ea5da08d30bed7","subject":"[scad] pretty print parameters","message":"[scad] pretty print parameters\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.04; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.1;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(flk_w, flk_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","old_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n\/*$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.04; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.2;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 2;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\n\nring_h = support_h - magnet_h;\nring_t = 0.1;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"scaling vector\", kube_s);\necho(\"magnet diameter\", magnet_r*2);\necho(\"flk width\", flk_w);\necho(\"kube width\", outer_w);\necho(\"support diameter\", support_r*2);\necho(\"support height\", support_h);\necho(\"ring height\", ring_h);\necho(\"ring inner diameter\", ring_inner_r*2);\necho(\"ring outer diameter\", ring_outer_r*2);\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w + magnet_h]) {\n\t\t\tcube(flk_w, flk_w, outer_w - (wall_w + magnet_h));\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\tcylinder(r=support_r, h=support_h);\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1e8b606f185fee78009e998950507e547299ae60","subject":"x\/ends: fix endstop screw cut lengths","message":"x\/ends: fix endstop screw cut lengths\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4b4a1438f28743eefdbb01a5f15330892f491184","subject":"tape connector prototype","message":"tape connector prototype\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tape_connector\/tape_connector.scad","new_file":"tape_connector\/tape_connector.scad","new_contents":"count=2;\n\nmodule tusk(h, l)\n{\n translate([l,0,0])\n rotate([0,0,90])\n polyhedron(\n points=[\n [0, 0, 0], \/\/ 0\n [h, 0, 0], \/\/ 1\n [h\/2, 0, h], \/\/ 2\n [0, l, 0], \/\/ 3\n [h, l, 0], \/\/ 4\n [h\/2, l, h] \/\/ 5\n ],\n faces=[\n [0,2,1],\n [0,1,4],\n [4,3,0],\n [1,2,5],\n [5,4,1],\n [0,5,2],\n [3,5,0],\n [3,4,5]\n ]\n );\n}\n\nmodule side()\n{\n w =20; \/\/ width\n tc=8; \/\/ Tusks Count\n th=5; \/\/ Tusk Height\n ph=3; \/\/ Platform Height\n l =tc*1.5*th-0.5*th; \/\/ length\n \/\/ tusks:\n for(dy = [0:tc-1])\n translate([0, dy*1.5*th, ph])\n tusk(h=th, l=w);\n \/\/ base and mount\n phi=4; \/\/ diameter for screw\n pad=3; \/\/ padding around each hole\n ext=phi\/2+pad; \/\/ external element size\n difference()\n {\n union()\n {\n translate([-ext,0,0])\n cube([w+2*ext, l, ph]);\n }\n \/\/ screw mounts\n for(dx = [-phi\/2, w+phi\/2])\n for(dy = [0, (tc-2)*th*1.5-th*1.5])\n translate([dx, dy+1.5*th-th\/4, -ph])\n hull()\n for(offy = [0, th*1.5])\n translate([0,offy,0])\n cylinder(h=ph*3, r=phi\/2, $fs=1);\n }\n}\n\n\nfor(i = [0:count-1])\n translate([i*35,0,0])\n side();\n\n%translate([20, 4, 15])\n% rotate([0,180,0])\n% side();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tape_connector\/tape_connector.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b615f7420ac7c537ae3a8c5605e066c1736bd80","subject":"The comments were updated.","message":"The comments were updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/pencil-holder-with-cutouts\/spur-vase-spiral-lucky-charms.scad","new_file":"OpenSCAD\/pencil-holder-with-cutouts\/spur-vase-spiral-lucky-charms.scad","new_contents":"\r\nuse ;\r\n\r\n\/\/ this determines how tall the pen holder is\r\nvaseHeight = 300;\r\n\/\/vaseHeight = 120;\r\n\r\n\/\/ this sets how many cutouts are in the pen holder\r\ncharmCount = 35;\r\n\r\nspursCharmStl = \"..\/shapes\/spurs\/spurs-a.stl\";\r\nspursCharmXYScale = 0.2; \/\/ spur scale\r\nspursCharmDepthScale = 20.2; \/\/ oshw depth scale\r\n\r\noshwCharmStl = \"..\/shapes\/oshw\/oshw.stl\";\r\noshwCharmXYScale = 0.7;\r\noshwCharmDepthScale = 40.2;\r\n\r\nstarCharmStl = \"..\/shapes\/star\/star.stl\";\r\nstarCharmXYScale = 0.7;\r\nstarCharmDepthScale = 40.2;\r\n\r\ncharmStls = [\r\n spursCharmStl,\r\n oshwCharmStl,\r\n starCharmStl\r\n ];\r\n\r\ncharmXYScales = [\r\n spursCharmXYScale,\r\n oshwCharmXYScale,\r\n starCharmXYScale\r\n ];\r\n \r\ncharmDepthScales = [\r\n spursCharmDepthScale,\r\n oshwCharmDepthScale,\r\n starCharmDepthScale\r\n ];\r\n\r\nuniqueCharmCount = len(charmStls);\r\n\r\ncharmIndex = -1;\r\n\r\nrandomSeed = 2789676;\r\n\/\/ uncomment this next line to have a different pattern each time the model is rendered in OpenSCAD.\t\r\n\/\/\trandomSeed = rands(0,987654, 1)[0];\r\n\r\nmaxRandom = uniqueCharmCount - 1;\r\nrandomCharmIndcies = rands(0,maxRandom, charmCount, randomSeed);\r\n\r\ndifference()\r\n{\r\n\tcup(vaseHeight);\r\n\r\n\/\/ TODO is this used, I think not!!!! \r\n y = 30;\r\n\r\n \/\/ the cutouts of lucky charms\r\n for( i = [0 : charmCount-1] )\r\n {\r\n single_rand = randomCharmIndcies[i];\r\n\t\t\r\n charmIndex = round(single_rand);\r\n \r\n\/\/echo(charmIndex);\r\n \r\n rotate([\r\n 90, \r\n 0,\r\n i * 38\r\n ]) \r\n translate([15, 5 * i, 30]) \/\/ normally x,y,z - but here y moves the charms up and down\r\n scale([charmXYScales[charmIndex],\r\n charmXYScales[charmIndex], \r\n charmDepthScales[charmIndex]\r\n ])\r\n import(charmStls[charmIndex]);\r\n }\r\n}","old_contents":"\r\nuse ;\r\n\r\n\/\/ this determines how tall the pen holder is\r\nvaseHeight = 300;\r\n\/\/vaseHeight = 120;\r\n\r\n\/\/ this sets how many cutouts are in the pen holder\r\ncharmCount = 35;\r\n\r\nspursCharmStl = \"..\/shapes\/spurs\/spurs-a.stl\";\r\nspursCharmXYScale = 0.2; \/\/ spur scale\r\nspursCharmDepthScale = 20.2; \/\/ oshw depth scale\r\n\r\noshwCharmStl = \"..\/shapes\/oshw\/oshw.stl\";\r\noshwCharmXYScale = 0.7;\r\noshwCharmDepthScale = 40.2;\r\n\r\nstarCharmStl = \"..\/shapes\/star\/star.stl\";\r\nstarCharmXYScale = 0.7;\r\nstarCharmDepthScale = 40.2;\r\n\r\ncharmStls = [\r\n spursCharmStl,\r\n oshwCharmStl,\r\n starCharmStl\r\n ];\r\n\r\ncharmXYScales = [\r\n spursCharmXYScale,\r\n oshwCharmXYScale,\r\n starCharmXYScale\r\n ];\r\n \r\ncharmDepthScales = [\r\n spursCharmDepthScale,\r\n oshwCharmDepthScale,\r\n starCharmDepthScale\r\n ];\r\n\r\nuniqueCharmCount = len(charmStls);\r\n\r\ncharmIndex = -1;\r\n\r\nrandomSeed = 2789676;\r\n\/\/ uncomment this next line to have a different pattern each time the model is rendered in OpenSCAD.\t\r\n\/\/\trandomSeed = rands(0,987654, 1)[0];\r\n\r\nmaxRandom = uniqueCharmCount - 1;\r\nrandomCharmIndcies = rands(0,maxRandom, charmCount, randomSeed);\r\n\r\ndifference()\r\n{\r\n\tcup(vaseHeight);\r\n \r\n y = 30;\r\n\r\n \/\/ lucky charms!\r\n for( i = [0 : charmCount-1] )\r\n {\r\n single_rand = randomCharmIndcies[i];\r\n\t\t\r\n charmIndex = round(single_rand);\r\n \r\n\/\/echo(charmIndex);\r\n \r\n rotate([\r\n 90, \r\n 0,\r\n i * 38\r\n ])\r\n\r\n \/\/ normally x,y,z - but here y moves the charms up and down\r\n translate([15, 5 * i, 30])\r\n scale([charmXYScales[charmIndex],\r\n charmXYScales[charmIndex], \r\n charmDepthScales[charmIndex]\r\n ])\r\n import(charmStls[charmIndex]);\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b0c6fb1664f822373022f1d7f13e6010b8d38df2","subject":"fix: assume default values in rotateOrigin","message":"fix: assume default values in rotateOrigin\n","repos":"jsconan\/camelSCAD","old_file":"operator\/rotate\/origin.scad","new_file":"operator\/rotate\/origin.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that rotate children modules with respect to particular rules.\n *\n * @package operator\/rotate\n * @author jsconan\n *\/\n\n\/**\n * Rotates the children modules from the provided origin.\n *\n * @param Vector|Number [a] - The rotate angle to apply.\n * @param Vector [v] - The rotate axis.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOrigin(a, v, o) {\n a = is_num(a) ? a : vector3D(a);\n v = is_undef(v) ? undef : vector3D(v);\n o = vector3D(o);\n translate(o) {\n rotate(a=a, v=v) {\n translate(-o) {\n children();\n }\n }\n }\n}\n\n\/**\n * Rotates the children modules around the X axis from the provided origin.\n *\n * @param Number a - The rotate angle to apply.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOriginX(a, o) {\n o = vector3D(o);\n translate(o) {\n rotate(xAxis3D(a)) {\n translate(-o) {\n children();\n }\n }\n }\n}\n\n\/**\n * Rotates the children modules around the Y axis from the provided origin.\n *\n * @param Number a - The rotate angle to apply.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOriginY(a, o) {\n o = vector3D(o);\n translate(o) {\n rotate(yAxis3D(a)) {\n translate(-o) {\n children();\n }\n }\n }\n}\n\n\/**\n * Rotates the children modules around the Z axis from the provided origin.\n *\n * @param Number a - The rotate angle to apply.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOriginZ(a, o) {\n o = vector3D(o);\n translate(o) {\n rotate(zAxis3D(a)) {\n translate(-o) {\n children();\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that rotate children modules with respect to particular rules.\n *\n * @package operator\/rotate\n * @author jsconan\n *\/\n\n\/**\n * Rotates the children modules from the provided origin.\n *\n * @param Vector|Number [a] - The rotate angle to apply.\n * @param Vector [v] - The rotate axis.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOrigin(a, v, o) {\n o = vector3D(o);\n translate(o) {\n rotate(a=a, v=v) {\n translate(-o) {\n children();\n }\n }\n }\n}\n\n\/**\n * Rotates the children modules around the X axis from the provided origin.\n *\n * @param Number a - The rotate angle to apply.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOriginX(a, o) {\n o = vector3D(o);\n translate(o) {\n rotate(xAxis3D(a)) {\n translate(-o) {\n children();\n }\n }\n }\n}\n\n\/**\n * Rotates the children modules around the Y axis from the provided origin.\n *\n * @param Number a - The rotate angle to apply.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOriginY(a, o) {\n o = vector3D(o);\n translate(o) {\n rotate(yAxis3D(a)) {\n translate(-o) {\n children();\n }\n }\n }\n}\n\n\/**\n * Rotates the children modules around the Z axis from the provided origin.\n *\n * @param Number a - The rotate angle to apply.\n * @param Vector [o] - The rotate origin.\n *\/\nmodule rotateOriginZ(a, o) {\n o = vector3D(o);\n translate(o) {\n rotate(zAxis3D(a)) {\n translate(-o) {\n children();\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"aedb92e7c40ed46055f430709591077cf18e01f8","subject":"y-motor-mount: rewrite to part system, use screw_cut","message":"y-motor-mount: rewrite to part system, use screw_cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-motor-mount.scad","new_file":"y-motor-mount.scad","new_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n rcubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n %yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n tz(extrusion_size\/2)\n tx(ymotor_mount_thickness)\n tx(ymotor_w\/2)\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n\n \/\/ reinforcement plate between motor and extrusion\n translate([0,0,extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n tz(7*mm)\n rotate(180*X)\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","old_contents":"use \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n cylindera(h=height, d=3*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=Z);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=X);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=X);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=N, orient=X);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n tz(7*mm)\n rotate(180*X)\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount(show_motor=false);\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1ea5cace62d45ea5802700f6b2d8779ad0d15898","subject":"Adding magnet ring model.","message":"Adding magnet ring model.\n","repos":"hmflash\/tikitank,hmflash\/tikitank,hmflash\/tikitank,hmflash\/tikitank,hmflash\/tikitank","old_file":"ring.scad","new_file":"ring.scad","new_contents":"diameter=3.04*25.4; \/\/ Ring inner diameter\nheight=0.5*25.4; \/\/ Ring height\nthickness=5; \/\/ Ring thickness\nmag_dia=6.10; \/\/ Magnet diameter\nnum_mags=16; \/\/ Number of magnets\ndetail=100; \/\/ Circle detail\nteeth=2; \/\/ Joint teeth count\n\ndifference(){\n difference() {\n rotate_extrude($fn=detail)\n translate([diameter \/ 2, 0, 0])\n square([thickness,height]);\n for (i = [0 : num_mags \/ 2]) {\n translate([0,0,height])\n rotate([90,0,(i+0.5) * (360 \/ num_mags)])\n cylinder(diameter*2, r=mag_dia\/2, $fn=detail, center=true);\n }\n }\n union() {\n for (i = [0 : teeth - 1]) {\n s = -height\/teeth\/2;\n translate([0,s\/2,i*height\/teeth-s])\n rotate([-45,0,0])\n cube([diameter,diameter,diameter]);\n }\n for (i = [0 : teeth]) {\n s = -height\/teeth\/2;\n translate([-diameter,s\/2,i*height\/teeth])\n rotate([-45,0,0])\n cube([diameter,diameter,diameter]);\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'ring.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"d88d183dc7fd2ff4c91d6bb07dd48b78c598ba87","subject":"\u043f\u0440\u0438\u043d\u0442\u0435\u0440.scad","message":"\u043f\u0440\u0438\u043d\u0442\u0435\u0440.scad","repos":"soda-without-bekerman\/SPRiNTR,soda-without-bekerman\/SPRiNTR,soda-without-bekerman\/SPRiNTR","old_file":"Mendel\/printer.scad","new_file":"Mendel\/printer.scad","new_contents":"$fn=128;\nh=50;\n\/\/\u0434\u0435\u043b\u0430\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u0438\u043d\u044b\ncube ([50,5,5]); \ntranslate ([0,0,10])cube ([50,5,5]); \ncube ([5,70,5]);\ntranslate ([0,0,10])cube ([5,70,5]); \ntranslate ([50,0,0])cube ([5,70,5]);\ntranslate ([50,0,10])cube ([5,70,5]); \ntranslate ([0,70,0])cube ([55,5,5]);\ntranslate ([0,70,10])cube ([55,5,5]);\ncube ([5,5,10]);\ntranslate ([50,0,0])cube ([5,5,10]);\ntranslate ([50,70,0])cube ([5,5,10]);\ntranslate ([0,70,0])cube ([5,5,10]);\n\/\/\u0434\u0435\u043b\u0430\u044e \u0441\u0442\u0435\u043a\u043b\u044f\u043d\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c\nrotate ([0,0,90])translate ([0,-30,12.5])cube ([70,5,2]);\ntranslate ([7.5,15,14])cube ([40,40,1]);\n\/\/\u0434\u0435\u043b\u0430\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u0438\u043d\u044b\ntranslate ([0,35,10])cube ([5,5,50]); \ntranslate ([50,35,10])cube ([5,5,50]); \nrotate ([-45,0,0])translate ([50,-10,10])cube ([5,5,50]); \nrotate ([-45,0,0])translate ([0,-10,10]) \ncube ([5,5,50]); \ntranslate ([2.5,35,55])cube ([50,5,5]);\n\/\/\u043f\u0430\u043d\u0435\u043b\u044c\u043a\u0430 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438\nrotate ([35,0,0])translate ([10,66,20])cube ([20,2,10]);\n\/\/\u043f\u0435\u0440\u0435\u043a\u043b\u0430\u0434\u0438\u043d\u0430 \u0441 \u044d\u043a\u0441\u0442\u0440\u0443\u0434\u0435\u0440\u043e\u043c\ntranslate ([2.5,38,25])rotate ([0,90,0])cylinder (50,2,2);\ntranslate ([15,35,22])cube ([7,7,8]);\ntranslate ([19,39,18])cylinder (5,1,2);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Mendel\/printer.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"eb9b44677d67dcb22fc59d4c77beea61da71e1c0","subject":"Updated breadboard and motor driver positions","message":"Updated breadboard and motor driver positions\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\n\tMaster assembly for the LogoBot\n\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\n\tReturns:\n\t\tComplete LogoBot model\n\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[-18, 40, 12],[0,0,-1], 0,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-45, 16, 8],[0,-1,0],0,0,0];\nLogoBot_Con_RightMotorDriver = [[45, 16, 8],[0,-1,0],0,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n\n\n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies\" ) {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n attach(DefConUp, DefConUp, ExplodeSpacing=20)\n for (x=[0,1], y=[0,1])\n mirror([0,y,0])\n mirror([x,0,0])\n translate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n rotate([0,0,-30])\n MicroSwitch();\n }\n\n step(3, \"Push the two motor drivers onto the mounting posts\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \/\/ Left Motor Driver\n attach(LogoBot_Con_LeftMotorDriver, ULN2003DriverBoard_Con_UpperLeft, ExplodeSpacing=20)\n ULN2003DriverBoard();\n\n \/\/ Right Motor Driver\n attach(LogoBot_Con_RightMotorDriver, ULN2003DriverBoard_Con_UpperRight, ExplodeSpacing=20)\n ULN2003DriverBoard();\n }\n\n \/\/ Motor + Wheel assemblies (x2)\n step(4, \"Clip the two wheels assemblies onto the base and\n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n\n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n }\n\n \/\/ Connect jumper wires\n step(5,\n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n\n \/\/ Left\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=6, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver,\n ULN2003DriverBoard_Con_UpperLeft,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n\n \/\/ Right\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ),\n con2 = attachedConnector(\n LogoBot_Con_Breadboard,\n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=10, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver,\n ULN2003DriverBoard_Con_UpperRight,\n [0,[1,0,0]]),\n conVec2 = [-1,0,0],\n midVec = [0.5,-1,0]\n );\n }\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n\n \/\/ Power Switch\n step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n\n\n \/\/ LED\n step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2])\n LED();\n }\n\n \/\/ Piezo\n step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n\n\n \/\/ Caster\n \/\/ Example of using attach\n \/\/ TODO: Correct ground clearance!\n step(10, \"Push the caster assembly into the base so that it snaps into place\") {\n view(t=[-6,7,19], r=[115,1,26], d=625);\n\n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n }\n\n\n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n\n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n \/\/ TODO: wrap into a PenLift sub-assembly\n step(11, \"Fit the pen lift assembly\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n\n attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n MicroServo();\n }\n }\n\n\n \/\/ Shell + fixings\n step(PenLift ? 12 : 11,\n \"Push the shell down onto the base and twist to lock into place\") {\n view(t=[11,-23,65], r=[66,0,217], d=1171);\n\n attach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n BasicShell_STL();\n }\n }\n\n\t}\n}\n","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t \n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tPenLift - Set to true to include a PenLift, defaults to false\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\t\n*\/\n\n\n\/\/ Connectors\n\/\/ ----------\n\/\/ These are used within this module to layout the various vitamins\/sub-assemblies\n\/\/ The same connectors are used to shape associated portions of the LogoBotBase_STL\n\nLogoBot_Con_Breadboard = [[0, 12, 0],[0,0,-1], -90,0,0];\n\nLogoBot_Con_LeftMotorDriver = [[-20, 16, 3],[0,0,-1],180,0,0];\nLogoBot_Con_RightMotorDriver = [[20, 16, 3],[0,0,-1],180,0,0];\n\nLogoBot_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\nLogoBot_Con_PenLift = [ [-20, -5, 10], [0,1,0], 0, 0, 0];\n\nLogoBot_Con_SlideSwitch = [[-25, 0, 0], [0,0,-1], 90, 0,0];\n\n\n\/\/ Assembly\n\/\/ --------\n\nfunction LogoBotAssembly_NumSteps() = 10 + (PenLift ? 1 : 0);\n\nmodule LogoBotAssembly ( PenLift=false ) {\n\n assembly(\"assemblies\/LogoBot.scad\", \"Final Assembly\", str(\"LogoBotAssembly(PenLift=\",PenLift,\")\")) {\n\n translate([0, 0, GroundClearance]) {\n \n \/\/ Default Design Elements\n \/\/ -----------------------\n \n \/\/ Base\n LogoBotBase_STL();\n\n step(1, \"Connect the breadboard assembly to the underside of the base\") {\n view(t=[0,17,12], r=[112,0,222], d=513);\n attach(LogoBot_Con_Breadboard, Breadboard_Con_BottomLeft(Breadboard_170), ExplodeSpacing=-20)\n BreadboardAssembly();\n }\n \n \n \/\/ Bumper assemblies (x2)\n step(2, \"Connect the two bumper assemblies\" ) {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n attach(DefConUp, DefConUp, ExplodeSpacing=20)\n for (x=[0,1], y=[0,1])\n mirror([0,y,0])\n mirror([x,0,0])\n translate([(BaseDiameter\/2-10) * cos(45), (BaseDiameter\/2-10) * sin(45), -8 ])\n rotate([0,0,-30])\n MicroSwitch();\n }\n \n step(3, \"Push the two motor drivers onto the mounting posts\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \/\/ Left Motor Driver\n attach(LogoBot_Con_LeftMotorDriver, ULN2003DriverBoard_Con_UpperLeft, ExplodeSpacing=20)\n ULN2003DriverBoard();\n \n \/\/ Right Motor Driver\n attach(LogoBot_Con_RightMotorDriver, ULN2003DriverBoard_Con_UpperRight, ExplodeSpacing=20)\n ULN2003DriverBoard();\n }\n \n \/\/ Motor + Wheel assemblies (x2)\n step(4, \"Clip the two wheels assemblies onto the base and \n connect the motor leads to the the motor drivers\") {\n view(t=[-4,6,47], r=[66,0,190], d=740);\n \n for (i=[0:1])\n mirror([i,0,0])\n translate([BaseDiameter\/2 + MotorOffsetX, 0, MotorOffsetZ])\n translate([-15,0,0])\n attach(DefConDown, DefConDown, ExplodeSpacing = 40)\n translate([15,0,0])\n rotate([-90, 0, 90]) {\n assign($rightSide= i == 0? 1 : 0)\n WheelAssembly();\n }\n }\n \n \/\/ Connect jumper wires\n step(5, \n \"Connect the jumper wires between the motor drivers and the Arduino\") {\n view(t=[9,26,54], r=[38,0,161], d=766);\n view(title=\"plan\", t=[0,32,16], r=[0,0,0], d=337);\n \n \/\/ Left\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_LeftMotorDriver, \n ULN2003DriverBoard_Con_UpperLeft,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ), \n con2 = attachedConnector(\n LogoBot_Con_Breadboard, \n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=6, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_LeftMotorDriver, \n ULN2003DriverBoard_Con_UpperLeft, \n [0,[1,0,0]]),\n conVec2 = [0,-1,0],\n midVec = [0.5,-1,0]\n );\n \n \/\/ Right\n JumperWire(\n type = JumperWire_FM4,\n con1 = attachedConnector(\n LogoBot_Con_RightMotorDriver, \n ULN2003DriverBoard_Con_UpperRight,\n ULN2003DriverBoard_Con_Arduino,\n ExplodeSpacing=20\n ), \n con2 = attachedConnector(\n LogoBot_Con_Breadboard, \n Breadboard_Con_BottomLeft(Breadboard_170),\n Breadboard_Con_Pin(Breadboard_170, along=10, across=8),\n ExplodeSpacing=20\n ),\n length = 100,\n conVec1 = attachedDirection(\n LogoBot_Con_RightMotorDriver, \n ULN2003DriverBoard_Con_UpperRight, \n [0,[1,0,0]]),\n conVec2 = [0,-1,0],\n midVec = [0.5,-1,0]\n );\n }\n \/\/ Battery assembly\n step(6, \"Clip in the battery pack\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-25, -45, 12])\n rotate([90, 0, 90]) {\n BatteryPack(BatteryPack_AA);\n battery_pack_double(BatteryPack_AA, 2, 4);\n }\n }\n \n \/\/ Power Switch\n step(7, \"Clip the power switch into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \n attach(LogoBot_Con_SlideSwitch, DefConUp)\n SlideSwitch();\n }\n \n \n \/\/ LED\n step(8, \"Clip the LED into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([0, -10, BaseDiameter\/2]) \n LED();\n }\n \n \/\/ Piezo\n step(9, \"Clip the piezo sounder into place\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \n attach(DefConDown, DefConDown, ExplodeSpacing=20)\n translate([-37, -32, 10])\n murata_7BB_12_9();\n }\n \n \n \/\/ Caster\n \/\/ Example of using attach\n \/\/ TODO: Correct ground clearance!\n step(10, \"Push the caster assembly into the base so that it snaps into place\") { \n view(t=[-6,7,19], r=[115,1,26], d=625);\n \n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n MarbleCasterAssembly();\n }\n \n \n \/\/ Conditional Design Elements\n \/\/ ---------------------------\n \n \/\/ PenLift\n \/\/ Placeholder of a micro servo to illustrate having conditional design elements\n if (PenLift) {\n \/\/ TODO: wrap into a PenLift sub-assembly\n step(11, \"Fit the pen lift assembly\") {\n view(t=[-6,7,19], r=[64,1,212], d=625);\n \n attach( LogoBot_Con_PenLift, MicroServo_Con_Horn)\n MicroServo();\n }\n }\n \n \n \/\/ Shell + fixings\n step(PenLift ? 12 : 11, \n \"Push the shell down onto the base and twist to lock into place\") { \n view(t=[11,-23,65], r=[66,0,217], d=1171);\n \n attach(DefConDown, DefConDown, ExplodeSpacing=BaseDiameter\/2)\n BasicShell_STL();\n }\n }\n\t\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d359a03ba41bda48df95b06525efebf98e7d5b54","subject":"Added file and parameters for inverse cube","message":"Added file and parameters for inverse cube\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube.scad","new_file":"inverse_cube.scad","new_contents":"init_size_size = 10;\niteration_multiplier = 0.5;\niterations = 3;","old_contents":"","returncode":1,"stderr":"error: pathspec 'inverse_cube.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b0006b8b178bf50461edbb2111896d760f374be0","subject":"\u043b\u0438\u0448\u043d\u0435\u0435 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438","message":"\u043b\u0438\u0448\u043d\u0435\u0435 \u0432 \u043a\u043e\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/G_C.scad","new_file":"3D-models\/SCAD\/G_C.scad","new_contents":"p=6;\ng=12;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \u0438 \u0413\u0443\u0430\u043d\u0438\u043d\n$fn=270;\nscale ([1.1,1.2,1.3]) {\ndifference (){\ncolor(\"MediumPurple\") cube ([100,35,g]);\ncolor(\"MediumPurple\") translate ([0,17.5,-1]) cylinder (15,17.5,17.5);\n}\n\ntranslate ([0,50,0]){\ncolor(\"Red\") cube ([100,35,g]);\ndifference () {\ncolor(\"Red\") translate ([0,17.5,-0]) cylinder (12,17.4,17.4);\n#translate ([-17.5,18,6])rotate ([0,90,0])cylinder (3.5,5,5);\n }\n }\n}\n\/\/\u0421\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438\ntranslate ([0,0,3]) {\ndifference () {\ncolor(\"Orange\") translate ([-47,6,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,6,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\ndifference () {\ncolor(\"Orange\")translate ([-47,36,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,36,5])rotate ([0,90,0])cylinder (3.5,5,5);\n}\ndifference (){\ncolor(\"Orange\")translate ([-37,21,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-37.1,21,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\n}\n\/\/\u0442\u0440\u0443\u0431\u044b \"\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c\"\ntranslate ([17.9,60,3]) {\ndifference () {\ncolor(\"Orange\") translate ([-47,6,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,6,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\ndifference () {\ncolor(\"Orange\")translate ([-47,36,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,36,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\n}\n\n\n\n","old_contents":"p=6;\ng=12;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \u0438 \u0413\u0443\u0430\u043d\u0438\u043d\n$fn=270;\nscale ([1.1,1.2,1.3]) {\ndifference (){\ncolor(\"MediumPurple\") cube ([100,35,g]);\ncolor(\"MediumPurple\") translate ([0,17.5,-1]) cylinder (15,17.5,17.5);\n}\n\ntranslate ([0,50,0]){\ncolor(\"Red\") cube ([100,35,g]);\ndifference () {\ncolor(\"Red\") translate ([0,17.5,-0]) cylinder (12,17.4,17.4);\n#translate ([-17.5,18,6])rotate ([0,90,0])cylinder (3.5,5,5);\n }\n }\n}\n\/\/\u0421\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438\ntranslate ([0,0,3]) {\ndifference () {\ncolor(\"Orange\") translate ([-47,6,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,6,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\ndifference () {\ncolor(\"Orange\")translate ([-47,36,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,36,5])rotate ([0,90,0])cylinder (3.5,5,5);\n}\ndifference (){\ncolor(\"Orange\")translate ([-37,21,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-37.1,21,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\n}\n\/\/\u0442\u0440\u0443\u0431\u044b \u0432\u043e\u0437\u043b\u0435 \u043a\u0440\u0441\u043d\u043e\u0433\u043e \u0444\u0438\u0433\u0443\u0440\u044b \"\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c\"\ntranslate ([17.9,60,3]) {\ndifference () {\ncolor(\"Orange\") translate ([-47,6,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,6,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\ndifference () {\ncolor(\"Orange\")translate ([-47,36,5]) rotate([0,90,0]) cylinder (70,p,p);\ntranslate ([-47.1,36,5])rotate ([0,90,0])cylinder (3.5,5,5);\n }\n}\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0bdcb3d83e0106eb6986742641495bd696c0cd1b","subject":"shoulder spacers compelete","message":"shoulder spacers compelete\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\n\/\/color([.7, .7, 1]) \n %shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\n\/\/color([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n %shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n render() union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 6), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 6), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 50;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"a73cb33b85b8a9532dcb9424ddfba9f3a995af0f","subject":"Add 2D shape module chord()","message":"Add 2D shape module chord()\n","repos":"jsconan\/camelSCAD","old_file":"shape\/2D\/ellipse.scad","new_file":"shape\/2D\/ellipse.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Ellipse shapes.\n *\n * @package shape\/2D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector - Returns a vector containing the horizontal and vertical radius.\n *\/\nfunction sizeEllipse(r, d, rx, ry, dx, dy) =\n let(\n r = apply2D(r, rx, ry),\n d = apply2D(d, dx, dy)\n )\n [\n \/\/ use divisor() to ensure the values will be forced to anything but 0\n divisor(d[0] && !rx ? d[0] \/ 2 : r[0]),\n divisor(d[1] && !ry ? d[1] \/ 2 : r[1])\n ]\n;\n\n\/**\n * Computes the points that draw an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawEllipse(r, d, rx, ry, dx, dy) =\n arc(\n v=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n a=360\n )\n;\n\n\/**\n * Computes the points that draw a pie slice.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPie(r, a=90, d, a1, a2, rx, ry, dx, dy) =\n let (\n a1 = deg(a1),\n a2 = a2 != undef ? deg(a2) : a1 + deg(a),\n angle = absdeg(a2 - a1),\n points = arc(v=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a1=a1, a2=a2)\n )\n \/\/ add the origin to the list of points, unless it is a complete circle\n !angle || angle == 360 ? points : complete(points, [0, 0])\n;\n\n\/**\n * Creates an ellipse at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule ellipse(r=1, d, rx, ry, dx, dy) {\n polygon(\n points = drawEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a pie slice at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pie(r=1, a=90, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = drawPie(r=r, a=a, d=d, a1=a1, a2=a2, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a chord at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the chord\n * @param Number [a1] - The start angle of the chord\n * @param Number [a2] - The end angle of the chord\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule chord(r=1, a=90, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = arc(v=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a=a, a1=a1, a2=a2),\n convexity = 10\n );\n}\n\n\/**\n * Creates a ring at the origin.\n *\n * @param Number|Vector [r] - The radius of the ring or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the ring or a vector that contains horizontal and vertical diameters.\n * @param Number [w] - The thickness of the ring.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number|Vector [ir] - The radius of the ring hole or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [id] - The diameter of the ring hole or a vector that contains horizontal and vertical diameters.\n * @param Number [irx] - The horizontal radius of the ring hole.\n * @param Number [iry] - The vertical radius of the ring hole.\n * @param Number [idx] - The horizontal diameter of the ring hole.\n * @param Number [idy] - The vertical diameter of the ring hole.\n *\/\nmodule ring(r=1, w, ir, d, id, rx, ry, dx, dy, irx, iry, idx, idy) {\n out = sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy);\n in = float(w) ? vsub(out, w)\n : sizeEllipse(r=ir, d=id, rx=irx, ry=iry, dx=idx, dy=idy);\n\n difference() {\n ellipse(r=out);\n ellipse(r=in);\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Ellipse shapes.\n *\n * @package shape\/2D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector - Returns a vector containing the horizontal and vertical radius.\n *\/\nfunction sizeEllipse(r, d, rx, ry, dx, dy) =\n let(\n r = apply2D(r, rx, ry),\n d = apply2D(d, dx, dy)\n )\n [\n \/\/ use divisor() to ensure the values will be forced to anything but 0\n divisor(d[0] && !rx ? d[0] \/ 2 : r[0]),\n divisor(d[1] && !ry ? d[1] \/ 2 : r[1])\n ]\n;\n\n\/**\n * Computes the points that draw an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawEllipse(r, d, rx, ry, dx, dy) =\n arc(\n v=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n a=360\n )\n;\n\n\/**\n * Computes the points that draw a pie slice.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPie(r, a=90, d, a1, a2, rx, ry, dx, dy) =\n let (\n a1 = deg(a1),\n a2 = a2 != undef ? deg(a2) : a1 + deg(a),\n angle = absdeg(a2 - a1),\n points = arc(v=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a1=a1, a2=a2)\n )\n \/\/ add the origin to the list of points, unless it is a complete circle\n !angle || angle == 360 ? points : complete(points, [0, 0])\n;\n\n\/**\n * Creates an ellipse at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule ellipse(r=1, d, rx, ry, dx, dy) {\n polygon(\n points = drawEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a pie slice at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pie(r=1, a=90, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = drawPie(r=r, a=a, d=d, a1=a1, a2=a2, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a ring at the origin.\n *\n * @param Number|Vector [r] - The radius of the ring or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the ring or a vector that contains horizontal and vertical diameters.\n * @param Number [w] - The thickness of the ring.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number|Vector [ir] - The radius of the ring hole or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [id] - The diameter of the ring hole or a vector that contains horizontal and vertical diameters.\n * @param Number [irx] - The horizontal radius of the ring hole.\n * @param Number [iry] - The vertical radius of the ring hole.\n * @param Number [idx] - The horizontal diameter of the ring hole.\n * @param Number [idy] - The vertical diameter of the ring hole.\n *\/\nmodule ring(r=1, w, ir, d, id, rx, ry, dx, dy, irx, iry, idx, idy) {\n out = sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy);\n in = float(w) ? vsub(out, w)\n : sizeEllipse(r=ir, d=id, rx=irx, ry=iry, dx=idx, dy=idy);\n\n difference() {\n ellipse(r=out);\n ellipse(r=in);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3c291a794a4461a023f0d6fbb34595f975c6e493","subject":"Added possible motor driver board carrier for 3d printing","message":"Added possible motor driver board carrier for 3d printing\n","repos":"daubers\/Robot","old_file":"MotorDriverCarrier.scad","new_file":"MotorDriverCarrier.scad","new_contents":"board_depth=15;\nboard_length=20;\nboard_height=1;\n\nheight_to_board=5;\n\nmodule standoff(){\n\tcube([board_length,10,board_height]);\n\ttranslate([board_length+0.5, 5,(height_to_board+board_height*2)\/2]) cube([2,10,height_to_board+board_height*2], center=true);\n\ttranslate([-0.5, 5,(height_to_board+board_height*2)\/2]) cube([2,10,height_to_board+board_height*2], center=true);\n}\n\ndifference(){\n\tstandoff();\n\ttranslate([0,0,(height_to_board+board_height\/2)]) cube([board_length,board_depth,board_height]);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'MotorDriverCarrier.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c98bb55dfb597eb9d4c75827e5fe1156b85a9e2d","subject":"The z length of cutout was scaled more, so that the cutouts break the surface of the coin.","message":"The z length of cutout was scaled more, so that the cutouts break the surface of the coin.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/coin.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/coin.scad","new_contents":"\r\nuse <..\/..\/external-resources\/africa\/africa-outline-hi.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>\r\n\r\nuse <..\/..\/shapes\/balloon\/balloon.scad>\r\nuse <..\/..\/shapes\/blue-moon\/blue-moon.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/disk\/disk.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/hourglass\/hourglass.scad>\r\nuse <..\/..\/shapes\/horseshoe\/horseshoe.scad>\r\nuse <..\/..\/shapes\/oval\/oval.scad>\r\nuse <..\/..\/shapes\/religion\/christianity\/crucifixion-cross\/crucifixion-cross.scad>\r\nuse <..\/..\/shapes\/religion\/judaism\/star-of-david\/star-of-david.scad>\r\nuse <..\/..\/shapes\/religion\/islam\/crescent-star\/crescent-star.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>\r\nuse <..\/..\/shapes\/texas\/texas.scad>\r\nuse <..\/..\/shapes\/throwie-cutout\/throwie-cutout.scad>\r\nuse <..\/..\/shapes\/trees\/christmas\/christmas-tree.scad>\r\n\r\nmodule coin(innerIcon,\r\n innerIconXyScale,\r\n innerIconOffsetY,\r\n outerIcon,\r\n outerIconCount,\r\n outerIconXyScale,\r\n radius,\r\n height)\r\n{\r\n difference()\r\n {\r\n \/\/ main disk\r\n cylinder (h = height, r=radius, center = true, $fn=100);\r\n\r\n \/\/ inner icon\r\n translate([0, innerIconOffsetY, -5])\r\n scale([innerIconXyScale, innerIconXyScale, 16.5])\r\n coinIcon(innerIcon, height);\r\n\r\n \/\/ outer icons\r\n for ( i = [0 : outerIconCount] )\r\n {\r\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\r\n translate([0, 43, -5])\r\n scale([outerIconXyScale, outerIconXyScale, 13.0])\r\n coinIcon(outerIcon, height);\r\n }\r\n }\r\n}\r\n\r\nmodule coinIcon(iconName, height)\r\n{\r\n if(iconName == \"Cross\")\r\n {\r\n crucifixionCcross(height);\r\n }\r\n\telse if(iconName == \"Spur\")\r\n\t{\r\n\t\tspur();\r\n\t}\r\n else if(iconName == \"Throwie\")\r\n {\r\n throwieCutout(height=height);\r\n }\r\n else if(iconName == \"Star of David\")\r\n {\r\n starOfDavid();\r\n }\r\n else if(iconName == \"Crescent Star\")\r\n {\r\n crescentStar();\r\n }\r\n else if(iconName == \"Star\")\r\n {\r\n star(height);\r\n }\r\n else if(iconName == \"Blue Moon\")\r\n {\r\n blueMoon();\r\n }\r\n else if(iconName == \"Clover\")\r\n {\r\n clover();\r\n }\r\n else if(iconName == \"Heart\")\r\n {\r\n heart();\r\n }\r\n else if(iconName == \"Horseshoe\")\r\n {\r\n horseshoe();\r\n }\r\n else if(iconName == \"Hourglass\")\r\n {\r\n hourglass();\r\n }\r\n else if(iconName == \"OSHW\")\r\n {\r\n oshwLogo();\r\n }\r\n else if(iconName == \"Texas\")\r\n {\r\n texas();\r\n }\r\n else if(iconName == \"Africa\")\r\n {\r\n africa();\r\n }\r\n else if(iconName == \"Oval\")\r\n {\r\n oval();\r\n }\r\n else if(iconName == \"Balloon\")\r\n {\r\n balloon();\r\n }\r\n else if(iconName == \"Circle\")\r\n {\r\n disk();\r\n }\r\n else if(iconName == \"Batman\")\r\n {\r\n batmanLogo();\r\n }\r\n else if(iconName == \"Tree\")\r\n {\r\n christmasTree(height);\r\n }\r\n else\r\n {\r\n \/\/ default is to do nothing\r\n\/\/ echo(\"no coin used\");\r\n }\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/africa\/africa-outline-hi.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>\r\n\r\nuse <..\/..\/shapes\/balloon\/balloon.scad>\r\nuse <..\/..\/shapes\/blue-moon\/blue-moon.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/disk\/disk.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/hourglass\/hourglass.scad>\r\nuse <..\/..\/shapes\/horseshoe\/horseshoe.scad>\r\nuse <..\/..\/shapes\/oval\/oval.scad>\r\nuse <..\/..\/shapes\/religion\/christianity\/crucifixion-cross\/crucifixion-cross.scad>\r\nuse <..\/..\/shapes\/religion\/judaism\/star-of-david\/star-of-david.scad>\r\nuse <..\/..\/shapes\/religion\/islam\/crescent-star\/crescent-star.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>\r\nuse <..\/..\/shapes\/texas\/texas.scad>\r\nuse <..\/..\/shapes\/throwie-cutout\/throwie-cutout.scad>\r\nuse <..\/..\/shapes\/trees\/christmas\/christmas-tree.scad>\r\n\r\nmodule coin(innerIcon,\r\n innerIconXyScale,\r\n innerIconOffsetY,\r\n outerIcon,\r\n outerIconCount,\r\n outerIconXyScale,\r\n radius,\r\n height)\r\n{\r\n difference()\r\n {\r\n \/\/ main disk\r\n cylinder (h = height, r=radius, center = true, $fn=100);\r\n\r\n \/\/ inner icon\r\n translate([0, innerIconOffsetY, -5])\r\n scale([innerIconXyScale, innerIconXyScale, 6.5])\r\n coinIcon(innerIcon, height);\r\n\r\n \/\/ outer icons\r\n for ( i = [0 : outerIconCount] )\r\n {\r\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\r\n translate([0, 43, -5])\r\n scale([outerIconXyScale, outerIconXyScale, 3.0])\r\n coinIcon(outerIcon, height);\r\n }\r\n }\r\n}\r\n\r\nmodule coinIcon(iconName, height)\r\n{\r\n if(iconName == \"Cross\")\r\n {\r\n crucifixionCcross(height);\r\n }\r\n\telse if(iconName == \"Spur\")\r\n\t{\r\n\t\tspur();\r\n\t}\t\r\n else if(iconName == \"Throwie\")\r\n {\r\n throwieCutout(height=height);\r\n }\r\n else if(iconName == \"Star of David\")\r\n {\r\n starOfDavid();\r\n }\r\n else if(iconName == \"Crescent Star\")\r\n {\r\n crescentStar();\r\n }\r\n else if(iconName == \"Star\")\r\n {\r\n star(height);\r\n }\r\n else if(iconName == \"Blue Moon\")\r\n {\r\n blueMoon();\r\n }\r\n else if(iconName == \"Clover\")\r\n {\r\n clover();\r\n }\r\n else if(iconName == \"Heart\")\r\n {\r\n heart();\r\n }\r\n else if(iconName == \"Horseshoe\")\r\n {\r\n horseshoe();\r\n }\r\n else if(iconName == \"Hourglass\")\r\n {\r\n hourglass();\r\n }\r\n else if(iconName == \"OSHW\")\r\n {\r\n oshwLogo();\r\n }\r\n else if(iconName == \"Texas\")\r\n {\r\n texas();\r\n }\r\n else if(iconName == \"Africa\")\r\n {\r\n africa();\r\n }\r\n else if(iconName == \"Oval\")\r\n {\r\n oval();\r\n }\r\n else if(iconName == \"Balloon\")\r\n {\r\n balloon();\r\n }\r\n else if(iconName == \"Circle\")\r\n {\r\n disk();\r\n }\r\n else if(iconName == \"Batman\")\r\n {\r\n batmanLogo();\r\n }\r\n else if(iconName == \"Tree\")\r\n {\r\n christmasTree(height);\r\n }\r\n else\r\n {\r\n \/\/ default is to do nothing\r\n\/\/ echo(\"no coin used\");\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e2a3980b020817fa0b94ee2a4028ce1f15f0d8e3","subject":"Removed unnecessary crank on femur","message":"Removed unnecessary crank on femur\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"hardware\/mk1\/femur.scad","new_file":"hardware\/mk1\/femur.scad","new_contents":"\/\/ alternate femur\n\ninclude ;\n\nmodule femurBody(thickness, center_to_center, width) {\n\ttranslate([0,0,thickness\/2])\n\t\thullInPairs() {\n\t\t\t\/\/ end\n\t\t\ttranslate([center_to_center\/2, 0, 0])\n\t\t\t\tcylinder(r = width\/2, h = thickness, center = true);\n\n\t\t\t\/\/ midpoint\n\t\t\ttranslate([0, 0, 0])\n\t\t\t\tcylinder(r = width\/3, h = thickness, center = true);\n\n\t\t\t\/\/ end\n\t\t\ttranslate([-center_to_center\/2, 0, 0])\n\t\t\t\tcylinder(r = width\/2, h = thickness, center = true);\n\t\t}\n}\n\n\nmodule femur(thickness = 4, center_to_center = 40, width = 12) {\n\ttranslate([center_to_center\/2, 0, 0])\n\tdifference() {\n\t\tfemurBody(thickness, center_to_center, width);\n\n\t\t\/\/ tibia\n\t\tcolor(\"red\")\n\t\t\ttranslate([center_to_center\/2,0,thickness + 0.01])\n\t\t\trotate([0, 180, 90])\n\t\t\tservo_arm();\n\n\t\t\/\/ hip\n\t\tcolor(\"red\")\n\t\t\ttranslate([-center_to_center\/2,0,thickness + 0.01])\n\t\t\trotate([0, 180, -90])\n\t\t\tservo_arm();\n\t}\n}\n\n\/\/femur();\n","old_contents":"\/\/ alternate femur\n\ninclude ;\n\nmodule femurBody(thickness, center_to_center, width) {\n\ttranslate([0,0,thickness\/2])\n\t\thullInPairs() {\n\t\t\t\/\/ end\n\t\t\ttranslate([center_to_center\/2, 0, 0])\n\t\t\t\tcylinder(r = width\/2, h = thickness, center = true);\n\n\t\t\t\/\/ midpoint\n\t\t\ttranslate([-7, 9, 0])\n\t\t\t\tcylinder(r = width\/3, h = thickness, center = true);\n\n\t\t\t\/\/ end\n\t\t\ttranslate([-center_to_center\/2, 0, 0])\n\t\t\t\tcylinder(r = width\/2, h = thickness, center = true);\n\t\t}\n}\n\n\nmodule femur(thickness = 4, center_to_center = 40, width = 12) {\n\ttranslate([center_to_center\/2, 0, 0])\n\tdifference() {\n\t\tfemurBody(thickness, center_to_center, width);\n\n\t\t\/\/ tibia\n\t\tcolor(\"red\")\n\t\t\ttranslate([center_to_center\/2,0,thickness + 0.01])\n\t\t\trotate([0, 180, 71])\n\t\t\tservo_arm();\n\n\t\t\/\/ hip\n\t\tcolor(\"red\")\n\t\t\ttranslate([-center_to_center\/2,0,thickness + 0.01])\n\t\t\trotate([0, 180, -55])\n\t\t\tservo_arm();\n\t}\n}\n\n\/\/femur();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"157c8aa3422e9dbaea36084134fd99ded50e1782","subject":"added missing new line","message":"added missing new line\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/all.scad","new_file":"tablet_toilet_mount\/all.scad","new_contents":"use \nuse \n\nsupport();\n\ntranslate([10,0,0])\n wallMount();\n","old_contents":"use \nuse \n\nsupport();\n\ntranslate([10,0,0])\n wallMount();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a976f2b1b68b95d4f82706bd9237a65d80bae021","subject":"yaxis\/idler: use screw_cut","message":"yaxis\/idler: use screw_cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-idler.scad","new_file":"y-axis-idler.scad","new_contents":"use \nuse \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = 2*yaxis_idler_pulley_inner_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut = MHexNutM4;\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, yaxis_idler_mount_tightscrew_hexnut);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, yaxis_idler_mount_tightscrew_hexnut);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.5;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n fncylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n }\n }\n\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n {\n translate([0, i*mount_screw_dist\/2, 0])\n {\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=[-1,0,0], align=[-1,0,0]); \n }\n }\n }\n}\n\nyaxis_idler_tightscrew_dist = 10*mm;\nyaxis_idler_pulley_nut = MHexNutM5;\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_idler_pulley_outer_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*fncylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n cubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=[1,0,0], align=[1,0,0]); \n }\n }\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"use \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = 2*yaxis_idler_pulley_inner_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, MHexNutM4);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, MHexNutM4);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.5;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n fncylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n }\n }\n translate([0,0,extrusion_size\/2])\n {\n for(i=[-1,1])\n translate([0, i*mount_screw_dist\/2, 0])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[0,0,1]);\n\n for(i=[-1,1])\n translate([0, i*mount_screw_dist\/2, yaxis_idler_mount_thickness])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia*2, orient=[0,0,1], align=[0,0,1]);\n }\n\n\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([0,0,extrusion_size\/2])\n {\n \/\/ cutout tighten screw\n translate([0,0,yaxis_belt_path_offset_z])\n fncylindera(h=extrusion_size+yaxis_idler_mount_thickness*2+1, d=yaxis_idler_mount_tightscrew_dia, orient=[1,0,0], align=[0,0,0]);\n\n \/\/ cutout tighten screw\n translate([-extrusion_size-yaxis_idler_mount_thickness-.1,0,yaxis_belt_path_offset_z])\n fncylindera(h=extrusion_size,d=yaxis_idler_mount_tightscrew_dia*2, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/*difference()*\/\n \/*{*\/\n \/*cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[1,0,0]);*\/\n\n \/*for(i=[-1,1])*\/\n \/*translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])*\/\n \/*fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia, orient=[1,0,0]);*\/\n \/*}*\/\n\n \/*\/\/ bottom mount plate*\/\n \/*translate([0,0,-main_lower_dist_z])*\/\n \/*{*\/\n \/*difference()*\/\n \/*{*\/\n \/*cubea([yaxis_idler_mount_thickness, yidler_w, extrusion_size], align=[1,0,0]);*\/\n\n \/*for(i=[0])*\/\n \/*translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])*\/\n \/*fncylindera(h=yaxis_idler_mount_thickness*3,d=yaxis_idler_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);*\/\n \/*}*\/\n \/*}*\/\n\n }\n\n }\n}\n\nyaxis_idler_tightscrew_dist = 10*mm;\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_idler_pulley_outer_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*fncylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n cubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,yaxis_idler_pulley_h\/2+1])\n {\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n }\n\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n for(y=[-1,1])\n {\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n {\n translate([-15*mm+yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len-.1, 0, 0])\n {\n fncylindera(fn=6, d=yaxis_idler_mount_tightscrew_hexnut_dia*1.01, h=yaxis_idler_pulley_tight_len+.1, orient=[1,0,0], align=[1,0,0]);\n\n translate([yaxis_idler_mount_tightscrew_hexnut_thick,0,0])\n fncylindera(d=yaxis_idler_mount_tightscrew_hexnut_dia*1.2, h=yaxis_idler_pulley_tight_len+.1, orient=[1,0,0], align=[1,0,0]);\n }\n\n fncylindera(d=yaxis_idler_mount_tightscrew_dia, h=yaxis_idler_pulleyblock_lenfrompulley+.1, orient=[1,0,0], align=[-1,0,0]);\n }\n }\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9ae70015fbddbd81533c49e5ce6746cbd6b9335c","subject":"Revert \"change buttons height\"","message":"Revert \"change buttons height\"\n\nThis reverts commit 451372d9556a0305292e385cb7759c9dfeb46305.\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 22.5;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"591c1f26c7f04a1e48955395ec945c218c7ec9ab","subject":"extra thickness is not an option - screw is too short","message":"extra thickness is not an option - screw is too short\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"anycubic_chiron\/tow_line_blocker\/tow_line_blocker.scad","new_file":"anycubic_chiron\/tow_line_blocker\/tow_line_blocker.scad","new_contents":"eps = 0.1;\nth0 = 2.4; \/\/ original thickness\ndth = 0; \/\/ extra thickness for the model\nth = th0 + dth;\nh = 10;\n\nfi = 3.5; \/\/ fi of screw\nx1 = 18.5;\ny2 = 16.75;\nx3 = 12.4;\n\n\/\/ screw block\ntranslate([0, -th, 0])\n difference()\n {\n cube([x1, th, h]);\n translate([x1 - 10.5 - fi\/2, -eps, h\/2])\n rotate([-90, 0, 0])\n cylinder(r=fi\/2, h=th+2*eps, $fn=30);\n }\n\n\/\/ connector\ntranslate([x1-th, -y2, 0])\n cube([th, y2, h]);\n\n\/\/ block\ntranslate([-dth, 0, 0])\n translate([x1-th0, -y2-th+th0, 0])\n cube([x3+dth, th, h]);\n","old_contents":"eps = 0.1;\nth0 = 2.4; \/\/ original thickness\ndth = 4; \/\/ extra thickness for the model\nth = th0 + dth;\nh = 10;\n\nfi = 3.5; \/\/ fi of screw\nx1 = 18.5;\ny2 = 16.75;\nx3 = 12.4;\n\n\/\/ screw block\ntranslate([0, -th, 0])\n difference()\n {\n cube([x1, th, h]);\n translate([x1 - 10.5 - fi\/2, -eps, h\/2])\n rotate([-90, 0, 0])\n cylinder(r=fi\/2, h=th+2*eps, $fn=30);\n }\n\n\/\/ connector\ntranslate([x1-th, -y2, 0])\n cube([th, y2, h]);\n\n\/\/ block\ntranslate([-dth, 0, 0])\n translate([x1-th0, -y2-th+th0, 0])\n cube([x3+dth, th, h]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d8853d55ec502de3952702b9096d90c72e0b483b","subject":"Unused code was (temporarily) commented.","message":"Unused code was (temporarily) commented.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\n\r\n\/* [Top Text] *\/\r\n\/\/topTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\n\/\/topLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\n\/\/topLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\n\/\/bottomText = \"\";\r\n\/\/bottomLetterSize = 8.8; \/\/ [2 : 25]\r\n\/\/bottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\n\/\/bottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n letterThickness = 3,\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\necho(\"rc:2 \");\r\necho(baseWidth);\r\n\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n echo(\"rc:7 \");\r\n echo(borderHeight);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\n\r\n\/* [Top Text] *\/\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\n\/\/bottomText = \"\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\n\/\/bottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n letterThickness = 3,\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n nametag_assembly(borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\necho(\"rc:2 \");\r\necho(baseWidth);\r\n\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n echo(\"rc:7 \");\r\n echo(borderHeight);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"97378203782612b0ff1fa0e5c58e07eb13eb6667","subject":"Got the design done... Not a big fan of it, but to each their own","message":"Got the design done... Not a big fan of it, but to each their own\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube_cutout.scad","new_file":"inverse_cube_cutout.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.75;\niterations = 3;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\ntotal_length = ((init_size * iteration_multiplier) * (1 - pow(iteration_multiplier, iterations - 1))) \/ (1 - iteration_multiplier) * 2 + init_size - 5;\n\ndifference() {\n cube(total_length, center = true);\n\n union() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n }\n}","old_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7c947f16769aef922507303e354534bd6787ae44","subject":"Readme: example-007 - update","message":"Readme: example-007 - update\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"readme\/example-007.scad","new_file":"readme\/example-007.scad","new_contents":"include <..\/lasercut.scad>; \n\nthickness = 3.1;\nx = 50;\ny = 100;\nr = thickness*2;\nlasercutoutSquare(thickness=thickness, x=x, y=y,\n finger_joints=[\n [UP, 1, 4],\n [DOWN, 1, 4]\n ],\n circles_add = [\n [r, x+thickness, y\/5],\n ],\n circles_remove = [\n [r, x\/2, y\/2],\n [1.5, x\/2, y*2\/3], \/\/ Screw-hole\n ],\n slits = [\n [RIGHT,x,y\/2,10]\n ],\n cutouts = [\n [x\/6, y\/6, thickness*5, thickness*2]\n ]\n );\n \n","old_contents":"include <..\/lasercut.scad>; \n\nthickness = 3.1;\nx = 50;\ny = 100;\nr = thickness*2;\nlasercutoutSquare(thickness=thickness, x=x, y=y,\n finger_joints=[\n [UP, 1, 4],\n [DOWN, 1, 4]\n ],\n circles_add = [\n [r, x+thickness, y\/5],\n ],\n circles_remove = [\n [r, x\/2, y\/2],\n [1.5, x\/2, y*2\/3], \/\/ Screw-hole\n ],\n slits = [\n [RIGHT,x,y\/2,10]\n ]\n );\n \n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"294a80c931f7b2d61a79ce6a5c2cf11af13290c8","subject":"made inner gear a bit thicker to reduce rattling","message":"made inner gear a bit thicker to reduce rattling\n","repos":"wyolum\/Celeste,wyolum\/Celeste","old_file":"fabricate\/gears.scad","new_file":"fabricate\/gears.scad","new_contents":"include \r\n\r\n$fn=50;\r\nmm = 1;\r\ninch = 25.4 * mm;\r\n\r\nACRYLIC_THICKNESS = 5. * mm;\r\nACRYLIC_TOL = .5 * mm;\r\nPITCH = 360 * mm;\r\nPRESSURE_ANGLE = 28;\r\n\r\nRIM_THICKNESS = 2 * mm;\r\nEXTRA_RIM_R = 3 * mm;\r\n\r\nmodule hex(r, h){\r\n rotate(a=30, v=[0, 0, 1])\r\n linear_extrude(height=h)\r\n polygon(points=[[r,0],\r\n\t\t [r * cos(60),r * sin(60)],\r\n\t\t [r * cos(120),r * sin(120)],\r\n\t\t [r * cos(180),r * sin(180)],\r\n\t\t [r * cos(240),r * sin(240)],\r\n\t\t [r * cos(300),r * sin(300)],\r\n\t\t ],paths=[ [0, 1, 2, 3, 4, 5] ]);\r\n}\r\n\r\nmodule stepper_gear(N_TEETH=6){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL;\/\/ + RIM_THICKNESS;\r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n difference(){\r\n union(){\r\n rotate(a=360\/6\/2., v=[0, 0, 1])\r\n gear (number_of_teeth=6,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = thickness,\r\n\t rim_thickness = thickness,\r\n\t hub_thickness = thickness,\r\n\t bore_diameter=0. * mm,\r\n\t circles=4,\r\n\t pressure_angle=28\r\n\t );\r\n translate([0, 0, -RIM_THICKNESS])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\r\n \/\/ translate([0, 0, 6.5*mm])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\r\n translate([0, 0, -2 * RIM_THICKNESS])cylinder(r=OUTER_RADIUS + EXTRA_RIM_R, h=RIM_THICKNESS);\r\n }\r\n translate([0, 0, -1])cylinder(r=3 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n }\r\n}\r\n\r\nmodule outer_gear(N_TEETH=66){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n\r\n MARGIN = 1 * inch;\r\n difference(){\r\n cylinder(r=OUTER_RADIUS + MARGIN, h=ACRYLIC_THICKNESS + ACRYLIC_TOL);\r\n translate([0, 0, -1])\r\n gear (number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t rim_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t hub_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28\r\n\t );\r\n }\r\n}\r\n\r\nmodule inner_gear(minute, N_TEETH=30){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n rad = 10 * mm;\r\n d1 = (rad + .0) * [1,0,0];\r\n d2 = (rad + .0) * [sin(30), cos(30), 0];\r\n translate([0, 36 * mm, 0])\r\n rotate(a=360\/30\/4 - 66.\/30 * minute\/60 * 360 + minute\/60.*720, v=[0, 0,1])\r\n difference(){\r\n intersection(){\r\n cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n scale([1, 1, 1])gear (number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t\t\t gear_thickness = ACRYLIC_THICKNESS\/2,\r\n\t\t\t rim_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t\t\t hub_thickness = ACRYLIC_THICKNESS, \/\/ - ACRYLIC_TOL,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28\r\n\t );\r\n }\r\n translate([0, 0, -1])cylinder(r=6 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n\r\n \/\/ lighten the load\r\n for(i=[0:4]){\r\n rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 16, -1])cylinder(r=6 * mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ scale([1, 1, .3])translate([0, 0, ])rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 18, -1])sphere(r=11 * mm);\r\n }\r\n }\r\n \/\/ add in rim strip to support hour hand\r\n translate([0, 0, 1])\r\n union(){\r\n difference(){\r\n translate([0, 36*mm, 0])cylinder(r = 1*inch, h=ACRYLIC_THICKNESS);\r\n translate([0, 36*mm, -1])cylinder(r = 7 * inch\/8, h=ACRYLIC_THICKNESS+2);\r\n }\r\n difference(){\r\n translate([0, 36*mm, 0])cylinder(r = 8*mm, h=ACRYLIC_THICKNESS);\r\n translate([0, 36*mm, -1])cylinder(r = 4*mm, h=ACRYLIC_THICKNESS+2);\r\n }\r\n }\r\n}\r\n\r\nmodule minute_hand(r=65*mm, w=21.5*mm, h=RIM_THICKNESS - 0.5*mm,filagree=false){\r\n\/\/linear_extrude(height = 2, center=true)\r\n\/\/polygon(points=[[-5*mm\/2, 0], [0, 65*mm], [5*mm\/2, 0]]);\r\n difference(){\r\n union(){\r\n stepper_gear(N_TEETH=6);\r\n translate([0, 2*mm, -2*RIM_THICKNESS])\r\n\tlinear_extrude(height=h)\r\r\n if (filagree){\r\r\n translate([0,8.2,0])scale([1.3,1,1])import(\"filagreeminute.dxf\");\r\r\n }\r\r\n else\r\n polygon(points=[[-w\/2, 0], [0, r], [w\/2, 0]]);\r\n }\r\n translate([0, 0, -50])cylinder(r=3 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ translate([0, r - 15 * mm, -50])cylinder(h=100, r=3.00\/2*mm); \/\/hole for hall effect magnet\r\n }\r\n}\r\n\r\nmodule hour_hand(r=50*mm, w=21.5*mm, h=1.5*mm, filagree = false){\r\n difference(){\r\n union(){\r\n translate([0, RIM_THICKNESS, -RIM_THICKNESS])\r\n\tlinear_extrude(height=h)\r\r\n if (filagree){\r\r\n translate([0,8.2,0])scale([1.3,1,1])import(\"filagreehour.dxf\");\r\r\n }else\r\n\tpolygon(points=[[-w\/2, 0], [0, r], [w\/2, 0]]);\r\n \/\/ translate([0, 36, -RIM_THICKNESS])cylinder(r=5.5 * mm\/2, h=ACRYLIC_THICKNESS + RIM_THICKNESS + .5*mm);\r\n translate([0, 36, -RIM_THICKNESS])cylinder(r=5.5 * mm\/2, h=ACRYLIC_THICKNESS + RIM_THICKNESS + 1);\r\n translate([0, 36, ACRYLIC_THICKNESS + .75*mm])scale([1, .8, 1])cylinder(r1=7\/2. * mm, r2=3.2*mm, h=1.5*mm); \/\/ clip\r\n translate([0, 0, -RIM_THICKNESS])cylinder(r=11, h=h);\r\n }\r\n translate([0, 0, -RIM_THICKNESS - 1])cylinder(r=8.25, h=2*h);\r\n translate([-.5 * mm, 36 * mm-5 * mm, 2])cube([1 * mm, 10 * mm, 10 * mm]); \/\/ slot\r\n \/\/translate([0, r - 10 * mm, -50])cylinder(h=100, r=3.00\/2*mm); \/\/ hall effect magnet slot\r\n }\r\n}\r\n\r\nHOUR = 9;\r\nMINUTE = $t * 60;\r\n\/\/MINUTE = HOUR * 60 + 15;\r\n\/\/ translate([0,0, 2])rotate(v=[0, 1, 0], a=180)\r\ntranslate([0, -0, -RIM_THICKNESS])rotate(a=MINUTE\/720 * 360, v=[0, 0, 1])color([.1, 1, 0])inner_gear(MINUTE);\r\n\/\/ color([.1, .1, 1])outer_gear(); \r\ntranslate([0, 0, -1.5*mm])rotate(a=MINUTE\/720 * 360, v=[0, 0, 1])color([1, 0, 0])rotate(a=0, v=[0, 0, 1])hour_hand(w=11,filagree=true);\r\ntranslate([0, 0, -RIM_THICKNESS])translate([0, 0, 0])rotate(a=MINUTE\/60 * 360, v=[0, 0, 1])minute_hand(w=12,filagree=true);\r\n\r\n\/\/ cylinder(r=50*mm, h=100*mm); \/\/ for scale\r\n\r\n\r\n","old_contents":"include \r\n\r\n$fn=50;\r\nmm = 1;\r\ninch = 25.4 * mm;\r\n\r\nACRYLIC_THICKNESS = 5. * mm;\r\nACRYLIC_TOL = .5 * mm;\r\nPITCH = 360 * mm;\r\nPRESSURE_ANGLE = 28;\r\n\r\nRIM_THICKNESS = 2 * mm;\r\nEXTRA_RIM_R = 3 * mm;\r\n\r\nmodule hex(r, h){\r\n rotate(a=30, v=[0, 0, 1])\r\n linear_extrude(height=h)\r\n polygon(points=[[r,0],\r\n\t\t [r * cos(60),r * sin(60)],\r\n\t\t [r * cos(120),r * sin(120)],\r\n\t\t [r * cos(180),r * sin(180)],\r\n\t\t [r * cos(240),r * sin(240)],\r\n\t\t [r * cos(300),r * sin(300)],\r\n\t\t ],paths=[ [0, 1, 2, 3, 4, 5] ]);\r\n}\r\n\r\nmodule stepper_gear(N_TEETH=6){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL;\/\/ + RIM_THICKNESS;\r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n difference(){\r\n union(){\r\n rotate(a=360\/6\/2., v=[0, 0, 1])\r\n gear (number_of_teeth=6,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = thickness,\r\n\t rim_thickness = thickness,\r\n\t hub_thickness = thickness,\r\n\t bore_diameter=0. * mm,\r\n\t circles=4,\r\n\t pressure_angle=28\r\n\t );\r\n translate([0, 0, -RIM_THICKNESS])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\r\n \/\/ translate([0, 0, 6.5*mm])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\r\n translate([0, 0, -2 * RIM_THICKNESS])cylinder(r=OUTER_RADIUS + EXTRA_RIM_R, h=RIM_THICKNESS);\r\n }\r\n translate([0, 0, -1])cylinder(r=3 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n }\r\n}\r\n\r\nmodule outer_gear(N_TEETH=66){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n\r\n MARGIN = 1 * inch;\r\n difference(){\r\n cylinder(r=OUTER_RADIUS + MARGIN, h=ACRYLIC_THICKNESS + ACRYLIC_TOL);\r\n translate([0, 0, -1])\r\n gear (number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t gear_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t rim_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t hub_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL + 2,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28\r\n\t );\r\n }\r\n}\r\n\r\nmodule inner_gear(minute, N_TEETH=30){\r\n PITCH_R = N_TEETH * PITCH \/ 360.;\r\n PITCH_D = 2 * PITCH_R;\r\n PITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\r\n \/\/ Addendum: Radial distance from pitch circle to outside circle.\r\n ADDENDUM = 1 \/ PITCH_DIAMETRIAL;\r\n \r\n \/\/Outer Circle\r\n OUTER_RADIUS = PITCH_R + ADDENDUM;\r\n OUTER_DIAMETER = 2 * OUTER_RADIUS;\r\n rad = 10 * mm;\r\n d1 = (rad + .0) * [1,0,0];\r\n d2 = (rad + .0) * [sin(30), cos(30), 0];\r\n translate([0, 36 * mm, 0])\r\n rotate(a=360\/30\/4 - 66.\/30 * minute\/60 * 360 + minute\/60.*720, v=[0, 0,1])\r\n difference(){\r\n intersection(){\r\n cylinder(r1=40, r2=26.5, h=ACRYLIC_THICKNESS); \/\/ taper the teeth\r\n scale([1, 1, 1])gear (number_of_teeth=N_TEETH,\r\n\t circular_pitch = PITCH,\r\n\t\t\t gear_thickness = ACRYLIC_THICKNESS\/2,\r\n\t rim_thickness = ACRYLIC_THICKNESS - ACRYLIC_TOL,\r\n\t hub_thickness = ACRYLIC_THICKNESS - ACRYLIC_TOL,\r\n\t bore_diameter=0. * mm,\r\n\t circles=0,\r\n\t pressure_angle=28\r\n\t );\r\n }\r\n translate([0, 0, -1])cylinder(r=6 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n\r\n \/\/ lighten the load\r\n for(i=[0:4]){\r\n rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 16, -1])cylinder(r=6 * mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ scale([1, 1, .3])translate([0, 0, ])rotate(a=360\/5 * i, v=[0, 0, 1])translate([0, 18, -1])sphere(r=11 * mm);\r\n }\r\n }\r\n \/\/ add in rim strip to support hour hand\r\n translate([0, 0, 1])\r\n union(){\r\n difference(){\r\n translate([0, 36*mm, 0])cylinder(r = 1*inch, h=ACRYLIC_THICKNESS);\r\n translate([0, 36*mm, -1])cylinder(r = 7 * inch\/8, h=ACRYLIC_THICKNESS+2);\r\n }\r\n difference(){\r\n translate([0, 36*mm, 0])cylinder(r = 8*mm, h=ACRYLIC_THICKNESS);\r\n translate([0, 36*mm, -1])cylinder(r = 4*mm, h=ACRYLIC_THICKNESS+2);\r\n }\r\n }\r\n}\r\n\r\nmodule minute_hand(r=65*mm, w=21.5*mm, h=RIM_THICKNESS - 0.5*mm,filagree=false){\r\n\/\/linear_extrude(height = 2, center=true)\r\n\/\/polygon(points=[[-5*mm\/2, 0], [0, 65*mm], [5*mm\/2, 0]]);\r\n difference(){\r\n union(){\r\n stepper_gear(N_TEETH=6);\r\n translate([0, 2*mm, -2*RIM_THICKNESS])\r\n\tlinear_extrude(height=h)\r\r\n if (filagree){\r\r\n translate([0,8.2,0])scale([1.3,1,1])import(\"filagreeminute.dxf\");\r\r\n }\r\r\n else\r\n polygon(points=[[-w\/2, 0], [0, r], [w\/2, 0]]);\r\n }\r\n translate([0, 0, -50])cylinder(r=3 * mm\/2, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2 + 100);\r\n \/\/ translate([0, r - 15 * mm, -50])cylinder(h=100, r=3.00\/2*mm); \/\/hole for hall effect magnet\r\n }\r\n}\r\n\r\nmodule hour_hand(r=50*mm, w=21.5*mm, h=1.5*mm, filagree = false){\r\n difference(){\r\n union(){\r\n translate([0, RIM_THICKNESS, -RIM_THICKNESS])\r\n\tlinear_extrude(height=h)\r\r\n if (filagree){\r\r\n translate([0,8.2,0])scale([1.3,1,1])import(\"filagreehour.dxf\");\r\r\n }else\r\n\tpolygon(points=[[-w\/2, 0], [0, r], [w\/2, 0]]);\r\n \/\/ translate([0, 36, -RIM_THICKNESS])cylinder(r=5.5 * mm\/2, h=ACRYLIC_THICKNESS + RIM_THICKNESS + .5*mm);\r\n translate([0, 36, -RIM_THICKNESS])cylinder(r=5.5 * mm\/2, h=ACRYLIC_THICKNESS + RIM_THICKNESS + 1);\r\n translate([0, 36, ACRYLIC_THICKNESS + .75*mm])scale([1, .8, 1])cylinder(r1=7\/2. * mm, r2=3.2*mm, h=1.5*mm); \/\/ clip\r\n translate([0, 0, -RIM_THICKNESS])cylinder(r=11, h=h);\r\n }\r\n translate([0, 0, -RIM_THICKNESS - 1])cylinder(r=8.25, h=2*h);\r\n translate([-.5 * mm, 36 * mm-5 * mm, 2])cube([1 * mm, 10 * mm, 10 * mm]); \/\/ slot\r\n \/\/translate([0, r - 10 * mm, -50])cylinder(h=100, r=3.00\/2*mm); \/\/ hall effect magnet slot\r\n }\r\n}\r\n\r\nHOUR = 9;\r\nMINUTE = $t * 60;\r\n\/\/MINUTE = HOUR * 60 + 15;\r\n\/\/ translate([0,0, 2])rotate(v=[0, 1, 0], a=180)\r\ntranslate([0, -0, -RIM_THICKNESS])rotate(a=MINUTE\/720 * 360, v=[0, 0, 1])color([.1, 1, 0])inner_gear(MINUTE);\r\n\/\/ color([.1, .1, 1])outer_gear(); \r\ntranslate([0, 0, -1.5*mm])rotate(a=MINUTE\/720 * 360, v=[0, 0, 1])color([1, 0, 0])rotate(a=0, v=[0, 0, 1])hour_hand(w=11,filagree=true);\r\n\/\/ translate([0, 0, -RIM_THICKNESS])translate([0, 0, 0])rotate(a=MINUTE\/60 * 360, v=[0, 0, 1])minute_hand(w=12,filagree=true);\r\n\r\n\/\/ cylinder(r=50*mm, h=100*mm); \/\/ for scale\r\n\r\n\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"347ed6b642340b6a0aa6d50766e5fe0ac505c5e9","subject":"added oring slot for sliding rocket","message":"added oring slot for sliding rocket\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/adapter_nozzle.scad","new_file":"water_rocket_launcher\/adapter_nozzle.scad","new_contents":"use \n\nmodule nozzle()\n{\n module oring(d_in, d_r)\n {\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n }\n\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n {\n difference()\n {\n cylinder(d1=21, d2=20, h=10, $fn=fn(200));\n translate([0, 0, 6])\n oring(d_in=17+1.5, d_r=2.5+0.5);\n }\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nrotate([180, 0, 0])\n nozzle();\n","old_contents":"use \n\nmodule nozzle()\n{\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n cylinder(d1=21, d2=20, h=10, $fn=fn(200));\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nrotate([180, 0, 0])\n nozzle();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"52aa892c1a9b6488dd972e148489b417f0522a1e","subject":"refactor and add a customizer for the internal cutout bottom radius","message":"refactor and add a customizer for the internal cutout bottom radius\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_contents":"\/\/ originially from:\n\/\/ Sine Cube Vase 1 by @Chompworks\n\/\/ Original at: https:\/\/www.thingiverse.com\/thing:2666281\n\/\/ Released under the Creative Commons CC - BY 3.0 licence\n\/\/ Details here: https:\/\/creativecommons.org\/licenses\/by\/3.0\/\n\/\/ customizer modifications by Roberto Marquez\n\/\/ https:\/\/www.thingiverse.com\/onebeartoe\/designs\n\ncubeOrCylinder = \"cylinder\"; \/\/ [cube, cylinder]\n\ninternalCutout_bottomRadius = 43; \/\/ [30 : 1 : 45]\n\n\/* [Hidden] *\/\n\nstep=4; \/\/ number of degrees to step for each cuboid element\n\nmaxlayers=100; \/\/ max number of layers. More layers slows down compilation on [F6], but makes the vase taller\n\nbasewidth=50; \/\/ basic length of a cuboid\n\ndifference() \/\/ Take away the two parts at the bottom\n{\n union() \/\/ this stitches all the cuboids together\n {\n translate([0,0,-80])\n for (layers=[1:maxlayers]) \/\/ make each slice\n {\n for (angle=[1:step:360])\n {\n translate([0,0,layers*2]) \/\/ move the cuboid up to where it needs to be!\n rotate([0,0,angle]) \/\/ rotate the cuboid\n rotate([45,-45,0]) \/\/ rotate the cuboid for the best effect\n translate([0,-1,0]) \/\/ move the cuboid. This minus 1 offset just worked well!\n\n if(cubeOrCylinder == \"cylinder\")\n {\n cylinderHeight = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n\t cylinder(r=2, h=cylinderHeight, $fn=20);\n }\n else\n {\n cube_xLength = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n \t\t\t\tcube([cube_xLength, 4, 4]);\n\n \/\/ lets explain this!\n \/\/ make a 4x4 square\n \/\/ then extrude it by:\n \/\/ basewidth - a constant. this is the minimum length of any cuboid\n \/\/ PLUS\n \/\/ (layers\/maxlayers*30) - this makes the vase taper outward as it gets taller. A sine function on this could make it act more like a pot\/urn [Thin, Fat, Thin]\n \/\/ PLUS\n \/\/ 10*cos(layers*15)*sin(angle*8) - this is a nasty bit of trig at first!\n \/\/ the sine function controls the bumps. Multiplying the angle by 8 means that rather than 1 bump, there are 8 for any given layer\n \/\/ the cosine function (layers*15) makes the bumps also occur in the Z axis as they go up. If you removed this, the vase becomes very straight\n }\n }\n }\n }\n\n \/\/this removes the cone base and leaves a flat base for the vase\n translate([-500,-500,-100])\n cube([1000,1000,100]);\n\n \/\/ this adds an internal hollow, 5mm up from the base\n internalCutout_TopRadius = internalCutout_bottomRadius + 15;\n translate([0,0,5])\n cylinder(r1 = internalCutout_bottomRadius, r2 = internalCutout_TopRadius, h = maxlayers * 2, $fn = 360\/step);\n}\n","old_contents":"\/\/ originially from:\n\/\/ Sine Cube Vase 1 by @Chompworks\n\/\/ Original at: https:\/\/www.thingiverse.com\/thing:2666281\n\/\/ Released under the Creative Commons CC - BY 3.0 licence\n\/\/ Details here: https:\/\/creativecommons.org\/licenses\/by\/3.0\/\n\/\/ customizer modifications by Roberto Marquez\n\/\/ https:\/\/www.thingiverse.com\/onebeartoe\/designs\n\ncubeOrCylinder = \"cube\"; \/\/ [cube, cylinder]\n\n\/* [Hidden] *\/\n\nstep=4; \/\/ number of degrees to step for each cuboid element\nmaxlayers=100; \/\/ max number of layers. More layers slows down compilation on [F6], but makes the vase taller\nbasewidth=50; \/\/ basic length of a cuboid\n\ndifference() \/\/ Take away the two parts at the bottom\n{\n union() \/\/ this stitches all the cuboids together\n {\n translate([0,0,-80])\n for (layers=[1:maxlayers]) \/\/ make each slice\n {\n for (angle=[1:step:360])\n {\n translate([0,0,layers*2]) \/\/ move the cuboid up to where it needs to be!\n rotate([0,0,angle]) \/\/ rotate the cuboid\n rotate([45,-45,0]) \/\/ rotate the cuboid for the best effect\n translate([0,-1,0]) \/\/ move the cuboid. This minus 1 offset just worked well!\n\n if(cubeOrCylinder == \"cylinder\")\n {\n\t cylinder(r=2, h=basewidth + (layers\/maxlayers*30) + 10*cos(layers*15)\n\t\t\t\t\t\t\t\t *sin(angle*8), $fn=20);\n }\n else\n {\n \t\t\t\tcube([basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8),\n 4,\n 4]);\n\n \/\/ lets explain this!\n \/\/ make a 4x4 square\n \/\/ then extrude it by:\n \/\/ basewidth - a constant. this is the minimum length of any cuboid\n \/\/ PLUS\n \/\/ (layers\/maxlayers*30) - this makes the vase taper outward as it gets taller. A sine function on this could make it act more like a pot\/urn [Thin, Fat, Thin]\n \/\/ PLUS\n \/\/ 10*cos(layers*15)*sin(angle*8) - this is a nasty bit of trig at first!\n \/\/ the sine function controls the bumps. Multiplying the angle by 8 means that rather than 1 bump, there are 8 for any given layer\n \/\/ the cosine function (layers*15) makes the bumps also occur in the Z axis as they go up. If you removed this, the vase becomes very straight\n }\n }\n }\n }\n\n \/\/this removes the cone base and leaves a flat base for the vase\n translate([-500,-500,-100])\n cube([1000,1000,100]);\n\n \/\/ this adds an internal hollow, 5mm up from the base\n translate([0,0,5])\n cylinder(r1=30,r2=45,h=maxlayers*2, $fn=360\/step);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2bc1b5946f52089ba30288ff069d91fb30ee90f0","subject":"put the caster back together","message":"put the caster back together\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/MarbleCaster_finalAssembly.scad","new_file":"hardware\/sandbox\/MarbleCaster_finalAssembly.scad","new_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\ntranslate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n \/\/ Caster\n \n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15) {\n \n \n \n MarbleCasterAssembly();\n \n \n }\n \n \n attach(offsetConnector(invertConnector(LogoBot_Con_Caster), [0,0,dw]), MarbleCaster_Con_Default, ExplodeSpacing=15)\n pintack(side=false, h=dw+0.6+2+1.5, lh=2, bh=2);\n \n\n }\n\n\nMarbleCasterAssembly();","old_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\ntranslate([0, 0, GroundClearance]) {\n\n \/\/ Default Design Elements\n \/\/ -----------------------\n\n \/\/ Base\n LogoBotBase_STL();\n\n \/\/ Caster\n \n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15) {\n \n \n \n MarbleCasterAssembly();\n \n \n }\n \n \n attach(LogoBot_Con_Caster, MarbleCaster_Con_Default, ExplodeSpacing=15)\n pintack(side=false, h=dw+0.6+2+1.5, lh=2, bh=2);\n \n\n }\n\n\nMarbleCasterAssembly();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5b1630f2e46dd04dcefa0a5736a17dc9a30f92f8","subject":"Save basic ring for the bar sensor","message":"Save basic ring for the bar sensor\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/ring.scad","new_file":"Hardware\/ring.scad","new_contents":"projection() ring();\nmodule ring(){difference(){\ncylinder(r=15, h=1, center=true);\ncylinder(r=10, h=2, center=true);\n}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/ring.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"ec0ec9e6112734e545792ebaf2d98376bd32e633","subject":"The stand was fleshed out some more.","message":"The stand was fleshed out some more.","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/mounting-hardware\/wall-mounted\/stand\/basic\/customizer\/customizable-basic-wall-mounted-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/mounting-hardware\/wall-mounted\/stand\/basic\/customizer\/customizable-basic-wall-mounted-stand.scad","new_contents":"\nuse <..\/basic-wall-mounted-stand.scad>\n\nmount_cube_xLength = 4; \/\/ [ 2 : 20]\nmount_cube_yLength = 50; \/\/ [20 : 150]\nmount_cube_zLength = 45; \/\/ [20 : 150]\n\nplatform_height = 6; \/\/ [5 : 50]\nplatform_segmentCount = 60; \/\/ [3 : 130]\nplatform_topRadius = 50; \/\/ [25: 100]\n\nsupport_xLength = 60; \/\/ [50 : 100]\nsupport_zLength = 59; \/\/ [20 : 250]\n\nbasicWallMountedStand(mount_cube_xLength = mount_cube_xLength,\n\t\t\t\t\t mount_cube_yLength = mount_cube_yLength,\n\t\t\t\t\t mount_cube_zLength = mount_cube_zLength,\n\t\t\t\t\t platform_height = platform_height,\n\t\t\t\t\t platform_segmentCount = platform_segmentCount,\n\t\t\t\t \t platform_topRadius = platform_topRadius,\n\t\t\t\t\t support_xLength = support_xLength,\n\t\t\t\t \t support_zLength = support_zLength);\n","old_contents":"\nuse <..\/basic-wall-mounted-stand.scad>\n\nmount_cube_yLength = 40; \/\/ [20 : 150]\n\nplatform_height = 6; \/\/ [5 : 50]\nplatform_segmentCount = 60; \/\/ [3 : 130]\nplatform_topRadius = 50; \/\/ [25: 100]\n\nsupport_height = 50; \/\/ [20 : 250]\n\nbasicWallMountedStand(mount_cube_yLength = mount_cube_yLength,\n\t\t\t\t\t platform_height = platform_height,\n\t\t\t\t\t platform_segmentCount = platform_segmentCount,\n\t\t\t\t \t platform_topRadius = platform_topRadius,\n\t\t\t\t \t support_height = support_height);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"704573dff1bab5c0ab5853acd708f8490774d369","subject":"triangles: add triangles scad from thing:220868","message":"triangles: add triangles scad from thing:220868\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"triangles.scad","new_file":"triangles.scad","new_contents":"\/*\n Triangles.scad\nAuthor: Tim Koopman\nhttps:\/\/github.com\/tkoopman\/Delta-Diamond\/blob\/master\/OpenSCAD\/Triangles.scad\n\nangleCA\n\/|\\\na \/ H \\ c\n\/ | \\\nangleAB ------- angleBC\nb\n\nStandard Parameters\ncenter: true\/false\nIf true same as centerXYZ = [true, true, true]\n\ncenterXYZ: Vector of 3 true\/false values [CenterX, CenterY, CenterZ]\ncenter must be left undef\n\nheight: The 3D height of the Triangle. Ignored if heights defined\n\nheights: Vector of 3 height values heights @ [angleAB, angleBC, angleCA]\nIf CenterZ is true each height will be centered individually, this means\nthe shape will be different depending on CenterZ. Most times you will want\nCenterZ to be true to get the shape most people want.\n *\/\n\n\/* \n Triangle\na: Length of side a\nb: Length of side b\nangle: angle at point angleAB\n *\/\nmodule Triangle(\n a, b, angle, height=1, heights=undef,\n center=undef, centerXYZ=[false,false,false])\n{\n \/\/ Calculate Heights at each point\n heightAB = ((heights==undef) ? height : heights[0])\/2;\n heightBC = ((heights==undef) ? height : heights[1])\/2;\n heightCA = ((heights==undef) ? height : heights[2])\/2;\n centerZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCA);\n\n \/\/ Calculate Offsets for centering\n offsetX = (center || (center==undef && centerXYZ[0]))?((cos(angle)*a)+b)\/3:0;\n offsetY = (center || (center==undef && centerXYZ[1]))?(sin(angle)*a)\/3:0;\n\n pointAB1 = [-offsetX,-offsetY, centerZ-heightAB];\n pointAB2 = [-offsetX,-offsetY, centerZ+heightAB];\n pointBC1 = [b-offsetX,-offsetY, centerZ-heightBC];\n pointBC2 = [b-offsetX,-offsetY, centerZ+heightBC];\n pointCA1 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ-heightCA];\n pointCA2 = [(cos(angle)*a)-offsetX,(sin(angle)*a)-offsetY, centerZ+heightCA];\n\n polyhedron(\n points=[\tpointAB1, pointBC1, pointCA1,\n pointAB2, pointBC2, pointCA2 ],\n triangles=[\t\n [0, 1, 2],\n [3, 5, 4],\n [0, 3, 1],\n [1, 3, 4],\n [1, 4, 2],\n [2, 4, 5],\n [2, 5, 0],\n [0, 5, 3] ] );\n}\n\n\/*\n Isosceles Triangle\n Exactly 2 of the following paramaters must be defined.\n If all 3 defined H will be ignored.\nb: length of side b\nangle: angle at points angleAB & angleBC.\n *\/\nmodule Isosceles_Triangle(\n b, angle, H=undef, height=1, heights=undef,\n center=undef, centerXYZ=[true, false, false])\n{\n valid = \t(angle!=undef)?((angle < 90) && (b!=undef||H!=undef)) : (b!=undef&&H!=undef);\n ANGLE = (angle!=undef) ? angle : atan(H \/ (b\/2));\n a = (b==undef)?(H\/sin((180-(angle*2))\/2)) : \n (b \/ cos(ANGLE))\/2;\n B = (b==undef)? (cos(angle)*a)*2:b;\n if (valid)\n {\n Triangle(a=a, b=B, angle=ANGLE, height=height, heights=heights,\n center=center, centerXYZ=centerXYZ);\n } else {\n echo(\"Invalid Isosceles_Triangle. Must specify any 2 of b, angle and H, and if angle used angle must be less than 90\");\n }\n}\n\n\/*\n Right Angled Triangle\n Create a Right Angled Triangle where the hypotenuse will be calculated.\n\n |\\\n a| \\\n | \\\n ----\n b\na: length of side a\nb: length of side b\n *\/\nmodule Right_Angled_Triangle(\n a, b, height=1, heights=undef,\n center=undef, centerXYZ=[false, false, false])\n{\n Triangle(a=a, b=b, angle=90, height=height, heights=heights,\n center=center, centerXYZ=centerXYZ);\n}\n\n\/*\n Wedge\n Is same as Right Angled Triangle with 2 different heights, and rotated.\n Good for creating support structures.\n *\/\nmodule Wedge(a, b, w1, w2)\n{\n rotate([90,0,0])\n Right_Angled_Triangle(a, b, heights=[w1, w2, w1], centerXYZ=[false, false, true]);\n}\n\n\/*\n Equilateral Triangle\n Create a Equilateral Triangle.\n\nl: Length of all sides (a, b & c)\nH: Triangle size will be based on the this 2D height\nWhen using H, l is ignored.\n *\/\nmodule Equilateral_Triangle(\n l=10, H=undef, height=1, heights=undef,\n center=undef, centerXYZ=[true,false,false])\n{\n L = (H==undef)?l:H\/sin(60);\n Triangle(a=L,b=L,angle=60,height=height, heights=heights,\n center=center, centerXYZ=centerXYZ);\n}\n\n\/*\n Trapezoid\n Create a Basic Trapezoid (Based on Isosceles_Triangle)\n\n d\n \/----\\\n \/ | \\\n a \/ H \\ c\n \/ | \\\n angle ------------ angle\n b\n\nb: Length of side b\nangle: Angle at points angleAB & angleBC\nH: The 2D height at which the triangle should be cut to create the trapezoid\nheights: If vector of size 3 (Standard for triangles) both cd & da will be the same height, if vector have 4 values [ab,bc,cd,da] than each point can have different heights.\n *\/\nmodule Trapezoid(\n b, angle=60, H, height=1, heights=undef,\n center=undef, centerXYZ=[true,false,false])\n{\n validAngle = (angle < 90);\n adX = H \/ tan(angle);\n\n \/\/ Calculate Heights at each point\n heightAB = ((heights==undef) ? height : heights[0])\/2;\n heightBC = ((heights==undef) ? height : heights[1])\/2;\n heightCD = ((heights==undef) ? height : heights[2])\/2;\n heightDA = ((heights==undef) ? height : ((len(heights) > 3)?heights[3]:heights[2]))\/2;\n\n \/\/ Centers\n centerX = (center || (center==undef && centerXYZ[0]))?0:b\/2;\n centerY = (center || (center==undef && centerXYZ[1]))?0:H\/2;\n centerZ = (center || (center==undef && centerXYZ[2]))?0:max(heightAB,heightBC,heightCD,heightDA);\n\n \/\/ Points\n y = H\/2;\n bx = b\/2;\n dx = (b-(adX*2))\/2;\n\n pointAB1 = [centerX-bx, centerY-y, centerZ-heightAB];\n pointAB2 = [centerX-bx, centerY-y, centerZ+heightAB];\n pointBC1 = [centerX+bx, centerY-y, centerZ-heightBC];\n pointBC2 = [centerX+bx, centerY-y, centerZ+heightBC];\n pointCD1 = [centerX+dx, centerY+y, centerZ-heightCD];\n pointCD2 = [centerX+dx, centerY+y, centerZ+heightCD];\n pointDA1 = [centerX-dx, centerY+y, centerZ-heightDA];\n pointDA2 = [centerX-dx, centerY+y, centerZ+heightDA];\n\n validH = (adX < b\/2);\n\n if (validAngle && validH)\n {\n polyhedron(\n points=[\tpointAB1, pointBC1, pointCD1, pointDA1,\n pointAB2, pointBC2, pointCD2, pointDA2 ],\n triangles=[\t\n [0, 1, 2],\n [0, 2, 3],\n [4, 6, 5],\n [4, 7, 6],\n [0, 4, 1],\n [1, 4, 5],\n [1, 5, 2],\n [2, 5, 6],\n [2, 6, 3],\n [3, 6, 7],\n [3, 7, 0],\n [0, 7, 4]\t] );\n } else {\n if (!validAngle) echo(\"Trapezoid invalid, angle must be less than 90\");\n else echo(\"Trapezoid invalid, H is larger than triangle\");\n }\n}\n\n\n\/\/ Examples\nTriangle(a=5, b=15, angle=33, centerXYZ=[true,false,false]);\ntranslate([20,0,0]) Right_Angled_Triangle(a=5, b=20, centerXYZ=[false,true,false]);\ntranslate([45,0,0]) Wedge(a=5, b=20, w1=10, w2=5);\ntranslate([-20,0,0]) Trapezoid(b=20, angle=33, H=4, height=5, centerXYZ=[true,false,true]);\n\ntranslate([0,10,0]) Isosceles_Triangle(b=20, angle=33);\ntranslate([30,10,0]) Isosceles_Triangle(b=20, H=5);\ntranslate([-30,10,0]) Isosceles_Triangle(angle=33, H=5, center=true);\n\ntranslate([15,-25,0]) Equilateral_Triangle(l=20);\ntranslate([-15,-25,0]) Equilateral_Triangle(H=20);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'triangles.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0bd1ef8a814418b5541a6ef6b129a28fb893b71f","subject":"Initial OpenScad commit","message":"Initial OpenScad commit\n\nOnly a wheel so far","repos":"TildenG\/FH_Tbot,ideaHex\/FH_Tbot,Rodinga\/FH_Tbot,TildenG\/FH_Tbot,Rodinga\/FH_Tbot,ideaHex\/FH_Tbot,TildenG\/FH_Tbot,ideaHex\/FH_Tbot,TildenG\/FH_Tbot,Rodinga\/FH_Tbot,ideaHex\/FH_Tbot,Rodinga\/FH_Tbot","old_file":"Fh@TBot.scad","new_file":"Fh@TBot.scad","new_contents":"\/* _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \r\n *\r\n * Hub to mount a 12mm hex RC car wheel to a Micro Metal Gear Motor\r\n * you will need to pause the print to place the M4 nut inside\r\n * the height will be shown in the console\r\n * \r\n * \t visit\r\n * \t\twww.ideahex.com\r\n * \r\n * Written by Damian Kleiss \r\n * _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n * \/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\ \r\n * \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\_\/ \\*\/\r\n \r\n \r\n \/\/ HUB MOTOR END \/\/\r\n shaftMountOuterWidth = 13.5;\r\n shaftDia = 3.6; \/\/ Diameter of the motor shaft\r\n shaftLength = 8.1; \/\/ Length of motor shaft\r\n shaftFlat = 2.9; \/\/ This is the flat part of the motor shaft\r\n shaftNutWidth = 5.9; \/\/ distance across flats of shaft nuts\r\n shaftnutHeight = 2.8; \/\/ height of shaft nut\r\n shaftBoltDia = 3.5; \/\/ Required hole for grub screw\r\n \r\n \/\/ HUBWHEEL END \/\/\r\n hexWidth = 12.1; \/\/ width between flats of the Wheel Hex\r\n hexLength = 6.2; \/\/ Length of the hex that goes into the wheel\r\n wheelNutWidth = 7.7; \/\/ Width between flats of the nut that the wheel is held on with\r\n wheelNutHeight = 3.9; \/\/ Height of the nut that holds the wheel on\r\n wheelBoltDia = 3.5; \/\/ Diameter of the hole \r\n \r\n \/\/ ORING \/\/\r\n oringInnerDia = 50;\r\n oringThickness = 5;\r\n \r\n \/\/ WHEEL \/\/\r\n wheelDia = oringInnerDia+oringThickness;\r\n wheelThickness = oringThickness;\r\n \r\n \/\/ GENERIC \/\/\r\n minWallThickness = 0.9; \/\/ This is only used between the shaft nut and shaft\r\n smidge = 0.01; \/\/ small value used to get manifold geometry\r\n \r\n $fn = 100; \/\/ number of facets that make up round things\r\n \r\n \r\n \/\/ ASSMBLY \/\/\r\n\r\ntranslate([0,0,wheelThickness\/2])\r\n{\r\n Wheel(hubShape = \"Round\", shaft = \"D\");\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n}\r\n\r\n\/\/color(\"blue\")\r\n\/\/ rotate([180,0,0])\r\n\/\/HubHoles(shape = \"Hex\");\r\n\/\/color(\"red\")\r\n\/\/\r\n\/\/Hub(shape = \"Round\");\r\n \r\n module Wheel(hubShape = \"Round\", shaft = \"D\")\r\n {\r\n color(\"red\")\r\n difference()\r\n {\r\n union()\r\n {\r\n translate([0,0,shaftLength\/2+1]) \r\n Hub(shape = hubShape);\r\n Rim();\r\n }\r\n translate([0,0,shaftLength\/2+1])\r\n rotate([180,0,0])\r\n HubHoles(shape = shaft);\r\n }\r\n}\r\n\r\n\r\n \r\n \r\n module Rim()\r\n {\r\n difference()\r\n {\r\n cylinder(d=wheelDia,h=wheelThickness,center=true);\r\n Oring(id = oringInnerDia, thickness = oringThickness);\r\n }\r\n }\r\n\r\n\r\nmodule Oring(id = 50, thickness = 5)\r\n{\r\n color(\"DimGray\")\r\n rotate_extrude(convexity = 10)\r\n {\r\n translate([(id+thickness)\/2,0,0])\r\n circle(r=thickness\/2);\r\n }\r\n}\r\n\r\nmodule Hub(shape = \"Hex\")\r\n{\r\n rotate([0,0,30])\r\n if(shape == \"Hex\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, $fn=6, center = true); \/\/ Motor End\r\n }\r\n else if(shape == \"Round\")\r\n {\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, center = true); \/\/ Motor End\r\n }\r\n \r\n}\r\n\r\nmodule HubHoles(shape = \"D\")\r\n{\r\n \/\/ Shaft Mount Holes \r\n color(\"red\")\r\n \r\n if (shape == \"D\")\r\n {\r\n union()\r\n { \r\n rotate([0,90,0])\r\n {\r\n translate([0,0,shaftDia-shaftFlat+minWallThickness])\r\n hull() \/\/ Hull two nuts so we can slip a nut in after the hub has been printed\r\n {\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n translate([shaftLength\/2,0,0])\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n }\r\n translate([0,0,hexWidth\/2])\r\n cylinder(r = shaftBoltDia \/2, h=hexWidth,center = true,$fn=100); \/\/ Shaft Bolt hole\r\n }\r\n \r\n \r\n \/\/ Shaft Hole\r\n difference()\r\n {\r\n cylinder(r=shaftDia\/2,h=shaftLength+smidge,center = true, $fn = 100);\r\n translate([(shaftDia-(shaftDia-shaftFlat)),0,0])\r\n cube([shaftDia,shaftDia,shaftLength+(smidge*2)],center=true); \/\/ Shaft Flat\r\n }\r\n } \r\n }\r\n else if (shape == \"Hex\")\r\n { \r\n cylinder(r = shaftDia \/ 2 \/ cos(180\/6), h = shaftLength+smidge,center = true, $fn=6); \/\/ ShaftNut Hole\r\n translate([0,0,shaftLength\/2 + wheelThickness\/2])\r\n cylinder(r = wheelBoltDia, h = wheelThickness,center = true); \/\/ ShaftNut Hole\r\n }\r\n \r\n}\r\n\r\n\r\n \r\n \r\n\/\/ echo(\"Pause at Z height of \",shaftLength+wheelNutHeight, \" mm\");\r\n \r\n\r\n\/*\r\n difference() \/\/ Uncomment for cross section view\r\n {\r\n union()\r\n { \r\n \r\n \/\/ WHEEL END \/\/\r\n translate([0,0,shaftLength])\r\n translate([0,0,hexLength\/2])\r\n rotate([0,0,30]) \/\/ Rotate so it lines up with shaft end\r\n difference()\r\n { \r\n cylinder(r = hexWidth \/ 2 \/ cos(180\/6), h = hexLength, $fn=6, center = true); \/\/ Wheel Hex End\r\n color(\"red\")\r\n union()\r\n {\r\n translate([0,0,-(hexLength+smidge)\/2]) \/\/ Move nut hole to end of Hex\r\n cylinder(r = wheelNutWidth \/ 2 \/ cos(180\/6), h = wheelNutHeight, $fn=6 ); \/\/ Wheel nut hole\r\n \r\n cylinder(r=wheelBoltDia\/2,h=hexLength+smidge,center=true,$fn=100); \/\/ wheel bolt hole\r\n }\r\n }\r\n \r\n \/\/ MOTOR END \/\/\r\n translate([0,0,shaftLength\/2])\r\n difference()\r\n {\r\n rotate([0,0,30])\r\n cylinder(r = shaftMountOuterWidth \/ 2 \/ cos(180\/6), h = shaftLength, $fn=6, center = true); \/\/ Motor End\r\n \r\n \/\/ Shaft Mount Holes \r\n color(\"red\")\r\n union()\r\n { \r\n rotate([0,90,0])\r\n {\r\n translate([0,0,shaftDia-shaftFlat+minWallThickness])\r\n hull() \/\/ Hull two nuts so we can slip a nut in after the hub has been printed\r\n {\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n translate([shaftLength\/2,0,0])\r\n cylinder(r = shaftNutWidth \/ 2 \/ cos(180\/6), h = shaftnutHeight, $fn=6); \/\/ ShaftNut Hole\r\n }\r\n translate([0,0,hexWidth\/2])\r\n cylinder(r = shaftBoltDia \/2, h=hexWidth,center = true,$fn=100); \/\/ Shaft Bolt hole\r\n }\r\n \r\n \r\n \/\/ Shaft Hole\r\n difference()\r\n {\r\n cylinder(r=shaftDia\/2,h=shaftLength+smidge,center = true, $fn = 100);\r\n translate([(shaftDia-(shaftDia-shaftFlat)),0,0])\r\n cube([shaftDia,shaftDia,shaftLength+(smidge*2)],center=true); \/\/ Shaft Flat\r\n }\r\n }\r\n }\r\n }\r\n translate([-shaftMountOuterWidth,0,-smidge\/2])\r\n cube([shaftMountOuterWidth*2,shaftMountOuterWidth*2,shaftLength+hexLength+smidge],center=false);\r\n}\r\n*\/\r\n ","old_contents":"","returncode":1,"stderr":"error: pathspec 'Fh@TBot.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"15e41728cb2b7710a9c033c6ca8b62ac23a0a436","subject":"Correct typo","message":"Correct typo\n","repos":"habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX,habi\/GlobalDiagnostiX","old_file":"DetectorMockup\/OmmatiDiag.scad","new_file":"DetectorMockup\/OmmatiDiag.scad","new_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detector will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n \/\/ box front walls, can (and should be turned off for increased visibility)\n translate(v = [0, unitlength + padding, 0]) {\n cube([unitlength + padding, 1, height]);\n }\n translate(v = [unitlength + padding, 0, 0]) {\n cube([1, unitlength + padding, height]); \/\/\n }\n }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ CMOS Backplate\nmodule Backplate()\n translate([(unitlength+padding)\/2 + 5, (unitlength+padding)\/2 + 5, height-15]) {\n color (\"red\", semitransparent) {\n cube([350,320,1],center=true);\n }\n }\nBackplate();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\")\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ Ommatidium back plate\n module Ommatidiumplate()\n color (\"red\", semitransparent)\n cube([15, 20, 1], center=true);\n translate ([5,7,0]) Ommatidiumplate();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\", nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1)\n polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2]) CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","old_contents":"\/\/ Mockup of OmmatiDiag\n\/*\n * The mockup was done after the first crude drawing with\n * [Tinkrecad](https:\/\/tinkercad.com\/things\/3utMiKsZhx9) proved to be too\n * inflexible.\n * The basic unit of the detecotor will be the scintillator size, which we\n * chose to be 17\" x 17\" translating to 430 x 430 mm in SI units.\n*\/\n\n\/\/ Basic length variables [mm]\nunitlength = 430;\npadding = 20;\nheight = 100;\nsemitransparent = 0.618;\nnearlytransparent = 0.309;\n\n\/\/ dimlines.scad is used to easily draw dimensional measurements\n\/\/ http:\/\/www.cannymachines.com\/entries\/9\/openscad_dimensioned_drawings\ninclude \n\nDIM_LINE_WIDTH = .025 * unitlength;\nDIM_SPACE = .1 * unitlength;\n\n\/\/~ translate([unitlength + 50 , padding\/2, 0])\n\/\/~ rotate([0,0,90])\n \/\/~ dimensions(unitlength, line_width=DIM_LINE_WIDTH, loc=0);\n\n\/\/ Housing\nmodule Housing()\n color (\"gray\", semitransparent) {\n \/\/ box bottom\n cube([unitlength + padding, unitlength + padding,1]);\n \/\/ box back walls\n cube([unitlength + padding, 1, height]);\n cube([1, unitlength + padding, height]);\n \/\/ box front walls, can (and should be turned off for increased visibility)\n translate(v = [0, unitlength + padding, 0]) {\n cube([unitlength + padding, 1, height]);\n }\n translate(v = [unitlength + padding, 0, 0]) {\n cube([1, unitlength + padding, height]); \/\/\n }\n }\nHousing();\n\n\/\/ Scintillator\nmodule Scintillator()\n translate([padding\/2, padding\/2, 1]) {\n color (\"green\", 1) {\n cube([unitlength,unitlength,1]);\n }\n }\nScintillator();\n\n\/\/ CMOS Backplate\nmodule Backplate()\n translate([(unitlength+padding)\/2 + 5, (unitlength+padding)\/2 + 5, height-15]) {\n color (\"red\", semitransparent) {\n cube([350,320,1],center=true);\n }\n }\nBackplate();\n\n\/\/ Ommatidium\nmodule Ommatidium() {\n \/\/ FOV of one Ommatidium\n FOVSize = ([unitlength\/4, unitlength\/3]);\n module FOV()\n color(\"pink\",0.5) cube([FOVSize[0], FOVSize[1], 1], center=true);\n\n \/\/ CMOS (Aptina AR0130)\n CMOSSize = ([1280, 960]);\n pixelsize = 3.75 \/ 1000; \/\/ [um]\n module CMOS()\n color (\"blue\")\n cube([CMOSSize[0] * pixelsize, CMOSSize[1] * pixelsize, 0.5], center=true);\n translate ([0,0,0]) CMOS();\n\n \/\/ Ommatidium back plate\n module Ommatidiumplate()\n color (\"red\", semitransparent)\n cube([15, 20, 1], center=true);\n translate ([5,7,0]) Ommatidiumplate();\n\n \/\/ FOV CMOS\n d_cmos_lens = 15;\n d_lens_scintillator = height - d_cmos_lens - 15;\n module CMOSCone()\n color(\"orange\", nearlytransparent)\n cylinder(h = d_cmos_lens,\n r1 = CMOSSize[0] * pixelsize \/ 2 ,\n r2 = lensdiameter * 2, center=true);\n module CMOSCross() {\n color(\"red\", 1)\n polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-CMOSSize[0]*pixelsize\/2, 0, d_cmos_lens], \/\/ horizontal_1\n [CMOSSize[0]*pixelsize\/2, 0,d_cmos_lens], \/\/ horizontal_2\n [0, -CMOSSize[1] * pixelsize \/ 2,d_cmos_lens], \/\/ vertical_1\n [0, CMOSSize[1] * pixelsize \/ 2,d_cmos_lens]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n\n mirror([0,0,1]) translate([0,0,-d_cmos_lens])CMOSCross();\n translate([0,0,d_cmos_lens\/2]) CMOSCone();\n\n \/\/ Lens\n lensdiameter = 4;\n module Lens()\n \/\/ the lens is a squashed sphere: http:\/\/is.gd\/4H9sZf\n scale([2,2,0.5]) sphere(lensdiameter, $fn=50, center=true);\n translate([0, 0, d_cmos_lens]) Lens();\n\n \/\/ FOV Lens\n module LensCone()\n color(\"orange\",nearlytransparent)\n scale([1, 4\/3, 1])\n cylinder(h = d_lens_scintillator,\n r1 = lensdiameter * 2,\n r2 = FOVSize[1]\/2 * 1.2);\n module LensCross() {\n color(\"red\", 1) polyhedron(\n points=[ [0, 0, 0], \/\/origin\n [-FOVSize[0]\/2, 0, d_lens_scintillator], \/\/ horizontal_1\n [FOVSize[0]\/2, 0,d_lens_scintillator], \/\/ horizontal_2\n [0, -FOVSize[1]\/2 ,d_lens_scintillator], \/\/ vertical_1\n [0, FOVSize[1]\/2 ,d_lens_scintillator]], \/\/ vertical_2\n triangles=[[0,1,2], [0,3,4]]);\n }\n translate([0,0,d_cmos_lens]) LensCross();\n translate([0,0,d_cmos_lens]) LensCone();\n translate([0,0,d_cmos_lens + d_lens_scintillator]) FOV();\n}\n\ntranslate([unitlength\/4\/2 + padding\/2, unitlength\/3\/2 + padding\/2, height-14])\nmirror([0,0,1])\nfor (xpos=[0:3], ypos = [0:2]) \/\/ iterate over x and y\n translate([xpos*unitlength\/4, ypos*unitlength\/3, 0]) Ommatidium();\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"6ceb7517207316fab89727d6f31137981083e252","subject":"x\/ends: use dual bearings","message":"x\/ends: use dual bearings\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=true)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], round_r=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_end_width(with_motor), d=xaxis_rod_d_support, extra_h=3*mm, extra_align=-X, orient=X, align=X);\n\n \/\/ endstops mount support\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n tx(-5*mm)\n nut_trap_cut(nut=NutHexM4, trap_offset=8*mm, screw_l=12*mm, screw_offset=2*mm, trap_axis=Y, cut_screw=true, orient=X, align=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extra_size = with_motor?0*mm:0*mm;\n extra_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n material(Mat_Plastic)\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ z smooth bearing mounts support\n translate(-xaxis_zaxis_distance_y*Y)\n for(z=[-1,1])\n translate(-z*Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z*z,\n align=Z*z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, head_embed=false, with_head=true, with_nut=false, orient=-Z, align=-Z);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, head_embed=false, with_head=true, with_nut=false, orient=-Z, align=-Z);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts cut\n translate(-xaxis_zaxis_distance_y*Y)\n for(z=[-1,1])\n translate(-z*Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z*z,\n align=Z*z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n translate(-xaxis_zaxis_distance_y*Y)\n for(z=[-1,1])\n translate(-z*Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z*z,\n align=Z*z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(model=xaxis_motor, size=NemaMedium, dual_axis=false, orient=-Y);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n difference()\n {\n material(Mat_PlasticBlack)\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n material(zaxis_nut_mat)\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*100*mm,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=true)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], round_r=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_end_width(with_motor), d=xaxis_rod_d_support, extra_h=3*mm, extra_align=-X, orient=X, align=X);\n\n \/\/ endstops mount support\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n tx(-5*mm)\n nut_trap_cut(nut=NutHexM4, trap_offset=8*mm, screw_l=12*mm, screw_offset=2*mm, trap_axis=Y, cut_screw=true, orient=X, align=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extra_size = with_motor?0*mm:0*mm;\n extra_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n material(Mat_Plastic)\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ z smooth bearing mounts support\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, head_embed=false, with_head=true, with_nut=false, orient=-Z, align=-Z);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, head_embed=false, with_head=true, with_nut=false, orient=-Z, align=-Z);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts cut\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n translate(-xaxis_zaxis_distance_y*Y)\n translate(-Z*(xaxis_end_wz\/2))\n {\n linear_bearing_mount(\n part=part,\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=Z,\n with_zips=true,\n offset_flange=true,\n mount_dir_align=xaxis_z_bearing_mount_dir,\n mount_style=xaxis_z_bearing_mount_style\n );\n }\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(model=xaxis_motor, size=NemaMedium, dual_axis=false, orient=-Y);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n if(xaxis_endstop_type == \"SWITCH\")\n {\n t(xaxis_endstop_pos(with_motor))\n difference()\n {\n material(Mat_PlasticBlack)\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n t(xaxis_endstop_pos(with_motor))\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n material(zaxis_nut_mat)\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*100*mm,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d61a1cb60a63d2df22b73a43a983ccfee37fc878","subject":"config: yaxis belt path offset reduced","message":"config: yaxis belt path offset reduced\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f74583799c9cc543c3a1230e95830c6339fb1252","subject":"\u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043c\u0435\u043d\u044f\u043b \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0431\u0443\u043a\u0432\u044b \u0432 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438","message":"\u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043c\u0435\u043d\u044f\u043b \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0431\u0443\u043a\u0432\u044b \u0432 \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Adenin.scad","new_file":"3D-models\/SCAD\/Adenin.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference(){\n translate ([dx\/2, t, 0]){ \n difference(){ \n color() translate ([0, 0, 0]) cube ([x, y, z],center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\nunion(){ \n\n difference(){\n\nunion(){\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n}\n} \n\ttranslate([-32, 0, 0]) cube([21, 21, 10],center=true);\n\ntranslate([-10, -10.5, 2]) cube([50, 21, 5]);\n}\n\n\n}\n#rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(6, 2.65, 2.65);\ntranslate([-13, -10.5, -1]) cube([39, 21, 5]);\n} \n\n} \n}\ndifference(){\n\n#translate([34,-10.5,-3.45]) cube([13, 21, 7]);\n#rotate([0, 90, 0]) translate([0, -5, 45]) cylinder(5, 2.65, 2.65);\n#rotate([0, 90, 0]) translate([0, 5, 45]) cylinder(5, 2.65, 2.65);\n}\n#rotate([90, 0, 0]) translate([-3, 0, -10.5]) cylinder(21, 3.5, 3.5);\n#rotate([90, 0, 0]) translate([34, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410\n translate([p, -7.55, 0-1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2-1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0-1]) cube ([9, 2, 2]);\n\n\n\n \n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference(){\n translate ([dx\/2, t, 0]){ \n difference(){ \n color() translate ([0, 0, 0]) cube ([x, y, z],center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\nunion(){ \n\n difference(){\n\nunion(){\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n}\n} \n\ttranslate([-32, 0, 0]) cube([21, 21, 10],center=true);\n\ntranslate([-10, -10.5, 2]) cube([50, 21, 5]);\n}\n\n\n}\n#rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(6, 2.65, 2.65);\ntranslate([-13, -10.5, -1]) cube([39, 21, 5]);\n} \n\n} \n}\ndifference(){\n\n#translate([34,-10.5,-3.45]) cube([13, 21, 7]);\n#rotate([0, 90, 0]) translate([0, -5, 45]) cylinder(5, 2.65, 2.65);\n#rotate([0, 90, 0]) translate([0, 5, 45]) cylinder(5, 2.65, 2.65);\n}\n#rotate([90, 0, 0]) translate([-3, 0, -10.5]) cylinder(21, 3.5, 3.5);\n#rotate([90, 0, 0]) translate([34, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410\n translate([p, -7.55, 0]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0]) cube ([9, 2, 2]);\n\n\n\n \n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"934b8b34da696e1993066343610ae96ae7516c0a","subject":"Add demo for the pipe shape","message":"Add demo for the pipe shape\n","repos":"jsconan\/camelSCAD","old_file":"samples\/simple-tube.scad","new_file":"samples\/simple-tube.scad","new_contents":"\/**\n * Samples using the camelSCAD library.\n *\n * A simple parametric pipe.\n *\n * @author jsconan\n * @license CC0-1.0\n *\/\n\n\/\/ As we need to use some shapes, use the right entry point of the library\nuse <..\/shapes.scad>\n\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = \"prod\";\n\n\/\/ Defines the dimensions of the pipe\nheight = 50;\r\nwidth = 1;\r\ninnerDiameter = 9.5;\r\nouterDiameter = innerDiameter + width * 2;\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\n$fa = facetAngle(renderMode);\n$fs = facetSize(renderMode);\n\n\/\/ And draw the pipe accordingly\npipe(d=outerDiameter, h=height, w=width);\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/simple-tube.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"4d3225f7d07bca658f37abdc80f4f945f6bfdf5a","subject":"Add bowden adapters for Greg's extruder + J-Head","message":"Add bowden adapters for Greg's extruder + J-Head\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"bowden\/bowden.scad","new_file":"bowden\/bowden.scad","new_contents":"gInnerGuide = 19; \/\/ distance from top of hotend hole to bottom of bearings\ngMountRad = 17\/2; \/\/ normally 16 for J-Head\ngBoltSpacing = 25; \/\/ each from center\n\ngExtruderInset = 11; \/\/ Bottom of extruder to top of hotend hole\ngHotendInset = 4.5; \/\/ Size of J-Head above lasercut part\ngHotendGuide = 6; \/\/ Top of J-Head to top of PTFE liner (where hollow setscrew is)\n\ngMountsThick = 6;\ngMountsWide = 10;\ngHalfWidth = gMountsWide \/ 2;\n\n\/\/ For McMaster 51055K972 (1\/4\" NPTF)\n\/\/ slightly less than the screw thread on coupler\ngScrewableInnerRad = 6.5+0.1;\n\/\/ outer-inner=wall\ngScrewableOuterRad = gScrewableInnerRad + 2.1;\n\ngInnerTubeRadClearance = 2; \/\/ If using a 2-part liner, size of hole to let inner through\n\n\/\/ TODO single layer bridging at bottom of gap\n\/\/ TODO optional trap nuts on hotend side\n\/\/ TODO tighten up mounting holes (they're loose on M4)\n\/\/ TODO extend depth of screwable part (seems to bottom out about 1mm shy)\n\nmodule PushFitting(screwDepth=14, screwRad=6.75, hexTall=6.3, hexShort=17.18\/2, roundTall=3.3, roundRad=16.64\/2,\n secondRad=14.5\/2, secondTall=2, thirdRad=10\/2, thirdTall=1.5) {\n difference() {\n union() {\n cylinder(r=hexShort\/cos(30), h=hexTall, $fn=6);\n cylinder(r=roundRad, roundTall+hexTall, $fn=100);\n cylinder(r=secondRad, roundTall+hexTall+secondTall);\n cylinder(r=thirdRad, roundTall+hexTall+secondTall+thirdTall);\n translate([0,0,-screwDepth])\n cylinder(r=screwRad, h=screwDepth+1, $fn=100);\n }\n translate([0,0,-50]) cylinder(r=6.3\/2, h=100);\n }\n}\n\nmodule CenteredRoundedCube(xyz, r=3) {\n hull() {\n for(x_scale=[-1,1])\n for(y_scale=[-1,1])\n translate([xyz[0]\/2*x_scale, xyz[1]\/2*y_scale, 0])\n cylinder(r=r, h=xyz[2]);\n }\n}\n\nmodule ExtruderMount(outerRad=false, zOffset=0) {\n difference() {\n union() {\n CenteredRoundedCube([gBoltSpacing*2+gHalfWidth*2, gMountsWide, gMountsThick], $fn=25);\n cylinder(r=gScrewableOuterRad, h=17+zOffset); \/\/ 1mm more than usual\n if(zOffset > 0) {\n cylinder(r=outerRad, h=zOffset);\n translate([0,0,zOffset])\n cylinder(r1=outerRad, r2=gScrewableOuterRad, h=outerRad-gScrewableOuterRad);\n }\n }\n translate([0,0,zOffset]) {\n translate([0,0,2]) cylinder(r=gScrewableInnerRad, h=15.1);\n translate([0,0,-50]) cylinder(r=gInnerTubeRadClearance, h=100, $fn=12);\n }\n for(x_scale=[-1,1])\n translate([gBoltSpacing*x_scale, 0, -1])\n cylinder(r=5\/2, h=100);\n }\n}\n\nmodule HotendMount() {\n difference() {\n ExtruderMount(outerRad=gMountRad+4, zOffset=gHotendInset+2);\n translate([0,0,-1]) cylinder(r=gMountRad, h=gHotendInset+1, $fn=100);\n }\n}\n\nExtruderMount();\ntranslate([0,30,0]) HotendMount();\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'bowden\/bowden.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"6a188ddb0182184de746539381cd06a9526556c7","subject":"Undo transparency of microusb connector","message":"Undo transparency of microusb connector\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/MicroUSB.scad","new_file":"hardware\/vitamins\/MicroUSB.scad","new_contents":"\/*\n Vitamin: MicroUSB\n Model of a Micro USB receptacle\n\n TODO: Add different types of Micro USB Connectors\n\n Derived from: http:\/\/www.farnell.com\/datasheets\/1693470.pdf\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Part width is in x+ (meeting PCB edge), depth is through center in y+\n\n Parameters:\n None\n\n Returns:\n Model of a Micro USB receptacle (SMT)\n*\/\n\nmodule MicroUSB_Receptacle() {\n \/\/ dimensions for micro usb header\n \/\/ http:\/\/www.farnell.com\/datasheets\/1693470.pdf\n depth = 5.3;\n width = 7.5;\n height = 2.8;\n flange = 7.8; \/\/ width of front flange\n offset = 2.15 + 0.6 - 1.45; \/\/ distance to overhang board edge\n\n color(Grey90)\n linear_extrude(height) {\n translate([0, offset - depth\/2, 0])\n square(size=[flange, depth], center=true);\n }\n}\n","old_contents":"\/*\n Vitamin: MicroUSB\n Model of a Micro USB receptacle\n\n TODO: Add different types of Micro USB Connectors\n\n Derived from: http:\/\/www.farnell.com\/datasheets\/1693470.pdf\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Part width is in x+ (meeting PCB edge), depth is through center in y+\n\n Parameters:\n None\n\n Returns:\n Model of a Micro USB receptacle (SMT)\n*\/\n\nmodule MicroUSB_Receptacle() {\n \/\/ dimensions for micro usb header\n \/\/ http:\/\/www.farnell.com\/datasheets\/1693470.pdf\n depth = 5.3;\n width = 7.5;\n height = 2.8;\n flange = 7.8; \/\/ width of front flange\n offset = 2.15 + 0.6 - 1.45; \/\/ distance to overhang board edge\n\n color(Grey90, 0.3)\n linear_extrude(height) {\n translate([0, offset - depth\/2, 0])\n square(size=[flange, depth], center=true);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2ece669e4a686e602336b4ae6d9f8838fb778ae8","subject":"new carriage","message":"new carriage\n","repos":"JoeSuber\/QuickerPicker","old_file":"CardStack\/bolt_carriage.scad","new_file":"CardStack\/bolt_carriage.scad","new_contents":"use ;\n\n\/\/ screw(length, nutpos, washer, bearingpos = -1)\n\/\/holderflat();\n\/\/m3bolt();\n\n\/\/capture_hollow();\n\/\/card();\n\/\/support();\ntray();\nmodule lmb6uu(){\n \/\/ with rod\n difference(){\n union(){\n cylinder(r=3.1, h=70, $fn=28, center=true);\n cylinder(r=6.1, h=19, $fn=64, center=true);\n }\n \/\/ rings on the bearing:\n for (i=[1,-1]){\n translate([0,0,19\/4*i])\n difference(){\n cylinder(r=6.15, h=1.1, $fn=64, center=true);\n cylinder(r=5.6, h=1.1, $fn=64, center=true);\n }\n }\n }\n}\n\nmodule captured_drive(sep_from_lmb=22.1\/2+6.1+1, nutht=7){\n \/\/ with two nuts\n screwsize = 5\/16 * 25.4;\n echo(\"separation between centers of screw-nuts and lmb\", sep_from_lmb);\n translate([0, sep_from_lmb, 35]){\n screw(70, 35-10.5, 0, bearingpos = -1, $fn=24);\n screw(70, 35+7.5, 0, bearingpos = -1);\n }\n}\n\nmodule holderflat(){\n translate([0,0,-12])\n linear_extrude(height=21.45){\n minkowski(){\n circle(r=2, $fn=36);\n translate([0,10,0])\n square([18, 40], center=true);\n }\n }\n}\n\nmodule m3bolt(length=18){\n cylinder(r=1.62, h=length, $fn=24, center=true);\n translate([0,0,-length\/2])\n cylinder(r=5.8\/2, h=2.8, $fn=6, center=false);\n translate([0,0,length\/2-2.8])\n cylinder(r=5.8\/2, h=2.8, $fn=6, center=false);\n}\n\nmodule rivits(a=8, b=28, l=24.1){\n for (i=[1,-1]){\n rotate([0,90,0]) translate([5*i+1,b,0])\n #m3bolt(length=l);\n rotate([0,90,0]) translate([5*i+1,a,0])\n #m3bolt(length=l);\n }\n}\n \nmodule capture_hollow(){\n difference(){\n holderflat();\n #lmb6uu();\n #cube([1.5, 25, 24.5], center=true);\n #captured_drive();\n \n rotate([0,90,0]) translate([0,-9,0])\n #m3bolt(length=22.1);\n rivits(a=8, b=28, l=24.1);\n }\n}\nmodule card(x=63, y=87.97, curve=2.98, h=17.89\/58){\n linear_extrude(height=h){\n minkowski(){\n square([x-curve*2, y-curve*2], center=true);\n circle(r=curve, $fn=36);\n }\n }\n \/\/test size\n #translate([0,0,-1]) square([x, y], center=true);\n}\n\nmodule support(l= 110, thk=23.4, sections=4, gap=1.5){\n dsqr=(l\/sections)+gap;\n start=l\/sections;\n intersection(){\n translate([-l\/2,0,40]) scale([2.5,1,1])\n sphere(r=l\/2);\n difference(){\n cube([l+gap*(sections), l+gap*(sections), start-.05], center=true);\n for (i=[0:dsqr:l], j=[-2:2]){\n translate([i - l\/2, j*dsqr, 0])\n cube([start, start, start], center=true);\n }\n }\n }\n} \n\nmodule tray(){\n translate([0, 90, 0])\n card(h=1.2);\n support();\n}\n \n \n ","old_contents":"","returncode":1,"stderr":"error: pathspec 'CardStack\/bolt_carriage.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"20dcc38bb97ac49c7178efa06591e38978ba45c8","subject":"Spaces around operators and after comma","message":"Spaces around operators and after comma\n","repos":"brodykenrick\/text_on_OpenSCAD","old_file":"text_on.scad","new_file":"text_on.scad","new_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t = \"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\"; \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false; \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0; \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth = 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi = 3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2 = internal_pi * 2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = (center==true) ? height \/ 2 : height;\r\nfunction cylinder_center_adjusted_bottom( height, center ) = (center==true) ? height \/ 2 : 0;\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0) = ( width_of_text_char( size, spacing ) \/(internal_pi2 * r)) * 360 * (1 - abs(rotate) \/ 90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering \r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing, r, rotate, center) = (center) ? (width_of_text_string_num_length( len(t) - 1, size, spacing ) \/ 2 \/ (internal_pi2 * r) * 360) : 0;\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center) = ((center) ? (width_of_text_string( t, size, spacing ) \/ 2 \/ (internal_pi2 * r) * 360) : 1) * (1 - abs(rotate) \/ 90);\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t = default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,\r\n r1,\r\n r2,\r\n h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n if ((face == \"top\") || (face == \"bottom\")){\r\n \/\/Work on a circle\r\n locn_offset_vec = (face == \"top\" ) ? [0, 0, cylinder_center_adjusted_top(h, cylinder_center)] : [0, 0, cylinder_center_adjusted_bottom(h, cylinder_center)];\r\n rotation_angle = (face == \"top\" ) ? 0 : 180;\r\n int_radius = (r == undef) ? ((face == \"top\" ) ? r2 : r1 ) : r; \/\/Use the top\/bottom radius for slanty-cylinders\r\n rotate(rotation_angle, [1, 0, 0])\r\n text_on_circle(t,\r\n locn_vec + locn_offset_vec,\r\n r = int_radius-size,\r\n font = font,size=size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n eastwest = eastwest,\r\n middle = middle,\r\n ccw = ccw);\r\n }else{\r\n if((middle != undef) && (middle != default_circle_middle))\r\n {\r\n \/\/TODO: Which others?\r\n \/\/TODO: Which side things aren't supported on the circle\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n }\r\n \/\/Work on the side\r\n locn_offset_vec = (cylinder_center == true) ? [0, 0, 0] : [0, 0, h \/ 2]; \r\n rotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing, r, rotate, center), [0, 0, 1])\r\n translate(locn_vec + locn_offset_vec)\r\n __internal_text_on_cylinder_side(t,\r\n locn_vec,\r\n r = r,\r\n h = h,\r\n r1 = r1,\r\n r2 = r2,\r\n cylinder_center = cylinder_center,\r\n center = center,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n face = face,\r\n updown = updown,\r\n eastwest = eastwest);\r\n }\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0, 0, 0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n ccw_sign = (ccw == true) ? 1 : -1;\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n rotate_z_outer = -rotate + ccw_sign * eastwest;\r\n rotate_z_inner = -rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, r-middle, rotate, center);\r\n rotate( rotate_z_outer, [0, 0, 1] )\r\n rotate( rotate_z_inner, [0, 0, 1] )\r\n translate(locn_vec)\r\n for (l = [0 : len(t) - 1]){\r\n \/\/TTB\/BTT means no per letter rotation\r\n rotate_z_inner2 = -ccw_sign * 90 + ttb_btt_inaction * rtl_sign * ccw_sign * l * rotation_for_character(size, spacing, r - middle, rotate = 0); \/\/Bottom out=-270+r\r\n \/\/TTB means we go toward center, BTT means away\r\n vert_x_offset = (direction == \"ttb\" || direction == \"btt\") ? (l * size * ((direction == \"btt\") ? -1 : 1)) : 0;\r\n rotate( rotate_z_inner2, [0, 0, 1] )\r\n translate([r - middle - vert_x_offset, 0, 0])\r\n rotate(-ccw_sign * 270, [0, 0, 1]) \/\/ flip text (botom out = -270)\r\n text_extrude(t[l],\r\n center = true,\r\n font = font,\r\n size = size,\r\n rotate = undef,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height);\r\n }\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n r1,\r\n r2,\r\n h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1, r2, h_total, h_offset) = ( r1 + ((r2 - r1) * (h_total - h_offset) \/ h_total) );\r\n \r\n \/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1, r2, h, length, rotate, updown) = ( h \/ 2 - updown + length * rotate \/ 90 * cos( atan( (r2 - r1) \/ h ) ) );\r\n\r\n function calc_radius_at_length(r1, r2, h, length, rotate, updown) = ( calc_radius_at_height_offset(r1, r2, h, calc_height_offset_at_length(r1, r2, h, length, rotate, updown)));\r\n \r\n if(r == undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction == \"btt\") || (direction == \"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\"));\r\n }\r\n if(center == true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n r1 = (r1 != undef) ? r1 : r;\r\n r2 = (r2 != undef) ? r2 : r;\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n rr1 = (center) ? r1 - extrusion_height \/ 2 : r1;\r\n rr2 = (center) ? r2 - extrusion_height \/ 2 : r2;\r\n \r\n ccenter = (r != undef) ? center : false; \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n ddirection = ((r == undef) && ((direction == \"ttb\") || (direction == \"btt\"))) ? \"ltr\" : direction; \/\/We don't do ttb or btt directions on slanty\r\n rtl_sign = (ddirection == \"rtl\") ? -1 : 1;\r\n\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0, 0, updown])\r\n rotate(eastwest, [0, 0, 1])\r\n for (l = [0 : len(t) - 1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n length_to_center_of_char = width_of_text_string_num_length(l + 0.5, size, spacing);\r\n radius_here = calc_radius_at_length(rr1, rr2, h, length_to_center_of_char, rotate, updown);\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, radius_here, rotate) * ((ddirection == \"ttb\" || ddirection== \"btt\") ? 0 : l);\r\n rotate(rotate_z_inner, [0, 0, 1])\r\n {\r\n \/\/Positioning - based on (somewhat innacurate) string length\r\n \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n vert_z_char_offset = (ddirection == \"ttb\" || ddirection == \"btt\") ? (l * size * ((ddirection == \"ttb\") ? -1 : 1 )) : 0 ;\r\n \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n vert_z_half_text_offset_tmp = (len(t) -1) \/ 2 * (rotate \/ 90 * wid);\r\n vert_z_half_text_offset = ((ddirection == \"ttb\" || ddirection == \"btt\") || (ccenter == false)) ? 0 : vert_z_half_text_offset_tmp;\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate) \/ 90 * wid) + vert_z_half_text_offset])\r\n\r\n \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n rotate( atan( (rr2 - rr1) \/h), [0, 1, 0])\r\n \/\/Flip onto face of \"normal\" cylinder\r\n rotate(90, [1, 0, 0])\r\n rotate(90, [0, 1, 0])\r\n\r\n \/\/Modify the offset of the baselined text to center\r\n translate([0, (ccenter) ? -size \/ 2 : 0, 0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n extrusion_height = extrusion_height\r\n );\r\n }\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n \/\/If we are centered - we sink the radius by half the\r\n \/\/extrusion height to draw \"just below the surface\"\r\n rr = (center) ? r - extrusion_height \/ 2 : r ;\r\n \r\n rotate(eastwest, [0, 0, 1])\r\n rotate(-northsouth, [1, 0, 0])\r\n rotate(spin, [0, 1, 0])\r\n {\r\n \/\/This tries to center the text (for RTL text).\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n rotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, rr, rotate, center), [0, 0, 1])\r\n {\r\n translate(locn_vec)\r\n if ( rounded == false ){\r\n __internal_text_on_sphere_helper(t = t,\r\n r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height\r\n );\r\n }else{\r\n \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n intersection()\r\n {\r\n __internal_text_on_sphere_helper(t = t,\r\n r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height * 2 \/\/Make it proud to clip it off.\r\n );\r\n\r\n \/\/Shell - bounding inner and outer\r\n difference()\r\n { \/\/rounded outside\r\n sphere(rr + extrusion_height);\r\n \/\/ rounded inside for indented text\r\n sphere( rr );\r\n }\r\n\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t = default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n rtl_sign = (direction == \"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction == \"ttb\" || direction == \"btt\") ? 0 : 1;\r\n ttb_btt_action = (direction == \"ttb\" || direction == \"btt\") ? 1 : 0;\r\n \r\n for (l = [0 : len(t) - 1]){\r\n rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0);\r\n \r\n rotate( rotate_z_inner, [0, 0, 1] )\r\n {\r\n translate_sign = (direction == \"ttb\" || direction == \"btt\") ? ((direction == \"btt\") ? 1 : -1) : 0 ;\r\n \/\/translate_effect = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0 ;\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ) \/ 90 , [0, 1, 0])\r\n \/\/Flip character into position to be flush against sphere\r\n rotate(90, [1, 0, 0])\r\n rotate(90, [0, 1, 0])\r\n \r\n \/\/Modify the offset of the baselined text to center\r\n translate([0, (center) ? -size \/ 2 : 0 , 0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,\r\n script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height = extrusion_height );\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t = default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0, 0, 0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign != undef) || (halign != undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n int_cube_size = (str(cube_size)[0] != \"[\") ? [cube_size, cube_size, cube_size] : cube_size;\r\n rotate_x = ( (face == \"front\") || (face == \"back\") || (face == \"left\") || (face == \"right\") ) ? 90\r\n : ((face == \"bottom\") ? 180 : 0) ; \/\/Top is zero\r\n rotate_y = ( (face == \"back\") || (face == \"left\") || (face == \"right\") ) ? (face == \"back\") ? 180 : ((face == \"left\") ? -90 : 90) \/\/Right is 90\r\n : 0 ; \/\/Top, bottom, front are zero\r\n locn_vec_offset =\r\n (face == \"front\") ? [+rightleft, -int_cube_size[1] \/ 2, +updown]\r\n :((face == \"back\") ? [+rightleft, +int_cube_size[1] \/ 2, +updown]\r\n : ((fac e== \"left\") ? [-int_cube_size[0] \/ 2, +rightleft, +updown]\r\n : ((face == \"right\") ? [+int_cube_size[0] \/ 2, +rightleft, +updown]\r\n : ((face == \"top\") ? [+rightleft, +updown, +int_cube_size[2] \/ 2]\r\n : [+rightleft, -updown, -int_cube_size[2] \/ 2]\r\n )))); \/\/bottom\r\n \r\n translate(locn_vec + locn_vec_offset)\r\n rotate(rotate_x, [1, 0, 0])\r\n rotate(rotate_y, [0, 1, 0]) \/\/ rotate around the y axis (z before rotation)\r\n text_extrude(t,\r\n center = center,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height );\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val != undef) ? val : default_val;\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t = default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center == true)\r\n {\r\n if((halign != undef) || (valign != undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n t = default_if_undef(t, default_t);\r\n font = default_if_undef(font, default_font);\r\n extrusion_height = default_if_undef(extrusion_height, default_extrusion_height);\r\n center = default_if_undef(center, default_center);\r\n rotate = default_if_undef(rotate, default_rotate);\r\n spacing = default_if_undef(spacing, default_spacing);\r\n size = default_if_undef(size, default_size);\r\n \r\n halign = (center) ? \"center\" : halign ;\r\n valign = (center) ? \"center\" : valign ;\r\n extrusion_center = (center) ? true : false ;\r\n \r\n scale( scale )\r\n rotate(rotate, [0, 0, -1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n {\r\n linear_extrude(height = extrusion_height, convexity = 10, center = extrusion_center)\r\n text(text = t,\r\n size = size,\r\n $fn = 40,\r\n font = font,\r\n direction = direction,\r\n spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language = language,\r\n script = script);\r\n }\r\n}\r\n\r\n","old_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t = \"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\"; \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false; \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0; \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth = 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi = 3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2 = internal_pi*2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = (center==true) ? height\/2 : height ;\r\nfunction cylinder_center_adjusted_bottom( height, center ) = (center==true) ? height\/2 : 0 ;\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0) = ( width_of_text_char( size, spacing ) \/(internal_pi2*r))*360*(1-abs(rotate)\/90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering \r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing,r,rotate,center) = (center) ? (width_of_text_string_num_length( len(t)-1, size, spacing )\/2\/(internal_pi2*r)*360) : 0 ;\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center) = ((center) ? (width_of_text_string( t, size, spacing )\/2\/(internal_pi2*r)*360) : 1) * (1-abs(rotate)\/90);\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t = default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n rtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n if ((face==\"top\")||(face==\"bottom\") ){\r\n \/\/Work on a circle\r\n locn_offset_vec = (face==\"top\" ) ? [0,0,cylinder_center_adjusted_top(h,cylinder_center)] : [0,0,cylinder_center_adjusted_bottom(h,cylinder_center)] ;\r\n rotation_angle = (face==\"top\" ) ? 0 : 180 ;\r\n int_radius = (r==undef) ? ((face==\"top\" ) ? r2 : r1 ) : r; \/\/Use the top\/bottom radius for slanty-cylinders\r\n rotate(rotation_angle,[1,0,0])\r\n text_on_circle(t,locn_vec+locn_offset_vec,r = int_radius-size,\r\n font = font,size=size,\r\n spacing = spacing,direction = direction,language = language,script = script,halign = halign,valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,\r\n eastwest = eastwest,middle = middle,ccw = ccw);\r\n }else{\r\n if((middle!=undef) && (middle!=default_circle_middle))\r\n {\r\n \/\/TODO: Which others?\r\n \/\/TODO: Which side things aren't supported on the circle\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n }\r\n \/\/Work on the side\r\n locn_offset_vec = (cylinder_center==true) ? [0,0,0] : [0,0,h\/2]; \r\n rotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing,r,rotate,center), [0,0,1])\r\n translate(locn_vec+locn_offset_vec)\r\n __internal_text_on_cylinder_side(t,locn_vec,r = r,h = h,r1 = r1,r2 = r2,\r\n cylinder_center =c ylinder_center,\r\n center = center,\r\n font = font,size = size,\r\n spacing = spacing,direction = direction,language = language,script = script,halign = halign,valign = valign,\r\n extrusion_height = extrusion_height,\r\n rotate = rotate,face = face,updown = updown,\r\n eastwest = eastwest);\r\n }\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n ccw_sign = (ccw==true) ? 1 : -1;\r\n rtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n rotate_z_outer = -rotate + ccw_sign*eastwest;\r\n rotate_z_inner = -rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string( t, size, spacing, r-middle, rotate, center);\r\n rotate( rotate_z_outer, [0,0,1] )\r\n rotate( rotate_z_inner, [0,0,1] )\r\n translate(locn_vec)\r\n for (l=[0:len(t)-1]){\r\n \/\/TTB\/BTT means no per letter rotation\r\n rotate_z_inner2 = -ccw_sign * 90 + ttb_btt_inaction*rtl_sign*ccw_sign*l*rotation_for_character(size, spacing, r-middle, rotate=0); \/\/Bottom out=-270+r\r\n \/\/TTB means we go toward center, BTT means away\r\n vert_x_offset = (direction==\"ttb\" || direction==\"btt\") ? (l * size * ((direction==\"btt\") ? -1 : 1)) : 0;\r\n rotate( rotate_z_inner2, [0,0,1] )\r\n translate([r - middle - vert_x_offset,0,0])\r\n rotate(-ccw_sign*270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n text_extrude(t[l],center = true,\r\n font = font,size = size,\r\n rotate = undef,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,script = script,halign = halign,valign = valign,\r\n extrusion_height = extrusion_height );\r\n }\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1,r2,h_total,h_offset) = ( r1 + ((r2-r1) * (h_total-h_offset)\/h_total) );\r\n \r\n \/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1,r2,h,length,rotate, updown) = ( h\/2 - updown + length * rotate\/90 * cos( atan( (r2-r1)\/h ) ) );\r\n\r\n function calc_radius_at_length(r1,r2,h,length,rotate,updown) = ( calc_radius_at_height_offset(r1,r2,h,calc_height_offset_at_length(r1,r2,h,length,rotate,updown)));\r\n \r\n if(r==undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction==\"btt\") || (direction==\"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\")); \r\n }\r\n if(center==true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n r1 = (r1!=undef) ? r1 : r;\r\n r2 = (r2!=undef) ? r2 : r;\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n rr1 = (center) ? r1-extrusion_height\/2 : r1;\r\n rr2 = (center) ? r2-extrusion_height\/2 : r2;\r\n \r\n ccenter = (r!=undef) ? center : false; \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n ddirection = ((r==undef) && ((direction==\"ttb\")||(direction==\"btt\"))) ? \"ltr\" : direction; \/\/We don't do ttb or btt directions on slanty\r\n rtl_sign = (ddirection==\"rtl\") ? -1 : 1;\r\n\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0,0,updown])\r\n rotate(eastwest,[0,0,1])\r\n for (l=[0:len(t)-1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n length_to_center_of_char = width_of_text_string_num_length(l+0.5,size,spacing);\r\n radius_here = calc_radius_at_length(rr1,rr2,h, length_to_center_of_char, rotate, updown);\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, ( radius_here ), rotate) * ((ddirection==\"ttb\" || ddirection==\"btt\") ? 0 : l);\r\n rotate(rotate_z_inner,[0,0,1])\r\n {\r\n \/\/Positioning - based on (somewhat innacurate) string length\r\n \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n vert_z_char_offset = (ddirection==\"ttb\" || ddirection==\"btt\") ? (l * size * ((ddirection==\"ttb\") ? -1 : 1 )) : 0 ;\r\n \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n vert_z_half_text_offset_tmp = (len(t)-1)\/2 * (rotate\/90*wid);\r\n vert_z_half_text_offset = ((ddirection==\"ttb\" || ddirection==\"btt\") || (ccenter==false)) ? 0 : vert_z_half_text_offset_tmp;\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate)\/90*wid) + vert_z_half_text_offset])\r\n\r\n \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n rotate( atan( (rr2-rr1)\/h ) , [0,1,0])\r\n \/\/Flip onto face of \"normal\" cylinder\r\n rotate(90,[1,0,0])\r\n rotate(90,[0,1,0])\r\n\r\n \/\/Modify the offset of the baselined text to center\r\n translate([0,(ccenter) ? -size\/2 : 0,0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n font = font,size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n extrusion_height = extrusion_height\r\n );\r\n }\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t = default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n rtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n \r\n \/\/TODO: Look at changing this to extrusion_height_center\r\n \/\/and renaming the other as text_center\r\n \/\/If we are centered - we sink the radius by half the\r\n \/\/extrusion height to draw \"just below the surface\"\r\n rr = (center) ? r-extrusion_height\/2 : r ;\r\n \r\n rotate(eastwest,[0,0,1])\r\n rotate(-northsouth,[1,0,0])\r\n rotate(spin,[0,1,0])\r\n {\r\n \/\/This tries to center the text (for RTL text).\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n rotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, rr, rotate, center), [0,0,1])\r\n {\r\n translate(locn_vec)\r\n if ( rounded == false ){\r\n __internal_text_on_sphere_helper(t = t,r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,script = script,halign = halign,valign = valign,\r\n extrusion_height = extrusion_height\r\n );\r\n }else{\r\n \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n intersection()\r\n {\r\n __internal_text_on_sphere_helper(t = t,r = rr,\r\n rotate = rotate,\r\n center = center,\r\n scale = scale,\r\n font = font,size = size,\r\n spacing = spacing,\r\n direction = direction,\r\n language = language,script = script,halign = halign,valign = valign,\r\n extrusion_height = extrusion_height*2 \/\/Make it proud to clip it off.\r\n );\r\n\r\n \/\/Shell - bounding inner and outer\r\n difference()\r\n { \/\/rounded outside\r\n sphere(rr+extrusion_height);\r\n \/\/ rounded inside for indented text\r\n sphere( rr );\r\n }\r\n\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t = default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n rtl_sign = (direction==\"rtl\") ? -1 : 1;\r\n ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? 0 : 1;\r\n ttb_btt_action = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0;\r\n \r\n for (l = [0:len(t)-1]){\r\n rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0);\r\n \r\n rotate( rotate_z_inner, [0,0,1] )\r\n {\r\n translate_sign = (direction==\"ttb\" || direction==\"btt\") ? ((direction==\"btt\") ? 1 : -1) : 0 ;\r\n \/\/translate_effect = (direction==\"ttb\" || direction==\"btt\") ? 1 : 0 ;\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l )\/90 , [0,1,0])\r\n \/\/Flip character into position to be flush against sphere\r\n rotate(90,[1,0,0])\r\n rotate(90,[0,1,0])\r\n \r\n \/\/Modify the offset of the baselined text to center\r\n translate([0,(center) ? -size\/2 : 0 ,0])\r\n \r\n text_extrude(t[l],\r\n center = false,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language = language,script = script,\r\n halign = \"center\", \/\/This can be relaxed eventually\r\n valign = \"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height = extrusion_height );\r\n }\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t = default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0,0,0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n int_cube_size = (str(cube_size)[0] != \"[\") ? [cube_size,cube_size,cube_size] : cube_size;\r\n rotate_x = ( (face==\"front\") || (face==\"back\") || (face==\"left\") || (face==\"right\") ) ? 90\r\n : ((face==\"bottom\") ? 180 : 0) ; \/\/Top is zero\r\n rotate_y = ( (face==\"back\") || (face==\"left\") || (face==\"right\") ) ? (face==\"back\") ? 180 : ((face==\"left\") ? -90 : 90) \/\/Right is 90\r\n : 0 ; \/\/Top, bottom, front are zero\r\n locn_vec_offset =\r\n (face==\"front\") ? [+rightleft, -int_cube_size[1]\/2, +updown]\r\n :((face==\"back\")? [+rightleft, +int_cube_size[1]\/2, +updown]\r\n : ((face==\"left\")? [-int_cube_size[0]\/2, +rightleft, +updown]\r\n : ((face==\"right\")? [+int_cube_size[0]\/2, +rightleft, +updown]\r\n : ((face==\"top\")? [+rightleft, +updown, +int_cube_size[2]\/2]\r\n : [+rightleft, -updown, -int_cube_size[2]\/2]\r\n )))); \/\/bottom\r\n \r\n translate(locn_vec + locn_vec_offset)\r\n rotate(rotate_x,[1,0,0])\r\n rotate(rotate_y,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n text_extrude(t,\r\n center = center,\r\n rotate = rotate,\r\n scale = scale,\r\n font = font,\r\n size = size,\r\n spacing = spacing,\r\n direction = direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n language = language,\r\n script = script,\r\n halign = halign,\r\n valign = valign,\r\n extrusion_height = extrusion_height );\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val!=undef) ? val : default_val;\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t = default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center==true)\r\n {\r\n if((halign!=undef) || (valign!=undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n t = default_if_undef(t,default_t);\r\n font = default_if_undef(font,default_font);\r\n extrusion_height = default_if_undef(extrusion_height,default_extrusion_height);\r\n center = default_if_undef(center,default_center);\r\n rotate = default_if_undef(rotate,default_rotate);\r\n spacing = default_if_undef(spacing,default_spacing);\r\n size = default_if_undef(size,default_size);\r\n \r\n halign = (center) ? \"center\" : halign ;\r\n valign = (center) ? \"center\" : valign ;\r\n extrusion_center = (center) ? true : false ;\r\n \r\n scale( scale )\r\n rotate(rotate,[0,0,-1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n {\r\n linear_extrude(height = extrusion_height,convexity = 10,center = extrusion_center)\r\n text(text = t, size = size,\r\n $fn = 40,\r\n font = font, direction = direction, spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language = language, script = script);\r\n }\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"2ffef18b458ea72b84144c5a3f059a692e76d37c","subject":"klammer update","message":"klammer update\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"klammer\/klammer.scad","new_file":"klammer\/klammer.scad","new_contents":"$fn=100;\n\/\/Variables\nr1=1.5;\nr2=1.5;\nd1=1.5;\nlen1=33;\nlen2=31;\nlen3=15;\nmodule stick_hull() {\n\thull() {\n\t\ttranslate([0,len1-r1])circle(r=r1);\n\t\ttranslate([0,-len2+r2+len3])circle(r=r2);\n translate([0,-len2+r2])translate([-(r2*2-d1),d1\/2])square(d1,center=true);\n }\n translate([0,3])internal();\n}\n\nmodule internal(d=1.5,n=5) {\n\tfor(i=[0:d:(n-1)*d]) {\n\t\ttranslate([r1-0.1,i])scale(v=[1,1])rotate(a=[0,0,45])square(1.5,center=true);\n\t}\n}\nmodule ring() {\n\tintersection(){\n\t\tdifference() {\n\t\t\tcircle(r=9);\n\t\t\tcircle(r=7);\n\t\t}\n\t\ttranslate([-4,-11])square(8);\n\t}\n}\nmodule klammer(x=3,y=3.7) {\n\tdifference() {\n union() {\n translate([-y,0])rotate(a=[0,0,-x])stick_hull();\n mirror([1,0])translate([-y,0])rotate(a=[0,0,-x])stick_hull();\n translate([0,8])ring();\n }\n translate([0,31])hull()resize([15])claw();\n }\n translate([0,31])resize([7.17])claw();\n}\nmodule claw(o1=-0.6,o2=0.6) {\n difference() {\n intersection() {\n hull()for(i=[-1,1])translate([i*0.5,0])circle(r=2);\n translate([0,3])square([10,6],center=true);\n } \n polygon(points=[[-1-o1,0],[-1.5-o1,0.5],[-1-o1,1],[-2.5-o1,2],[-0.5-o2,2],[-0.5-o2,1.8],[1-o2,1],[0.5-o2,0.5],[1-o2,0]]);\n }\n}\n\/\/Extrusion\nintersection() {\n linear_extrude(height=20)klammer();\n cube([15,100,40],center=true);\n}\n","old_contents":"$fn=100;\n\/\/Variables\nr1=1.25;\nr2=1.75;\nlen1=32;\nlen2=33;\nmodule stick_hull() {\n\thull() {\n\t\ttranslate([0,len1-r1])circle(r=r1);\n\t\ttranslate([0,-len2+r2])circle(r=r2);\n\t}\n}\nmodule stick_cut() {\n\tfor(i=[0:1.3:2]) {\n\t\ttranslate([r1+0.1,i])scale(v=[1,1])rotate(a=[0,0,45])square(1.5,center=true);\n\t}\n}\nmodule stick1(x) {\n\t\tstick_hull();\n\t\ttranslate([-0.4,x])stick_cut();\n}\nmodule stick2(x) {\n\tdifference() {\n\t\tstick_hull();\n\t\ttranslate([0,x])stick_cut();\n\t}\n}\nmodule ring() {\n\tintersection(){\n\t\tdifference() {\n\t\t\tcircle(r=9);\n\t\t\tcircle(r=6);\n\t\t}\n\t\ttranslate([-4,-11])square(8);\n\t}\n}\nmodule klammer(x=5.1,y=4.5) {\n\ttranslate([-y,0])rotate(a=[0,0,-x])stick1(29);\n mirror([1,0])translate([-y,0])rotate(a=[0,0,-x])stick2(29);\n\ttranslate([0,6])ring();\n}\n\/\/Extrusion\nintersection() {\n linear_extrude(height=20)klammer();\n cube([18,100,40],center=true);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1495c7448080fa554bda7525600729d93abb757f","subject":"Create 1US.scad","message":"Create 1US.scad","repos":"loif\/Grap,loif\/Grap,loif\/Grap","old_file":"SCAD\/1US.scad","new_file":"SCAD\/1US.scad","new_contents":"use \n$fn=70;\ncolor([1,1,1])difference()\n{\n union()\n {\n cube([48,28,24]);\n translate([48,-10])cube([30,48,44]);\n }\n translate([4,4,4])servo(\"g\");\n translate([52,34,4])rotate([0,0,270])servo(\"g\");\n translate([47.9,-10.5,24])cube([24.1,49,24]);\n translate([-1,4,4])rotate([90,0,90])\n {\n translate([2.5,2.5])cylinder(r=1,h=10);\n translate([2.5,17.5])cylinder(r=1,h=10);\n translate([17.5,2.5])cylinder(r=1,h=10);\n translate([17.5,17.5])cylinder(r=1,h=10);\n }\n translate([43,4,4])rotate([90,0,90])\n {\n translate([10,3])cylinder(r=1,h=10);\n translate([3,10])cylinder(r=1,h=10);\n translate([17,10])cylinder(r=1,h=10);\n }\n translate([48,4,4])rotate([90,0,90])\n {\n translate([10,3])cylinder(r=3,h=40);\n translate([3,10])cylinder(r=3,h=40);\n translate([17,10])cylinder(r=3,h=40);\n }\n \/\/eix m4\n translate([71,14,35])rotate([0,90,0])cylinder(r=2,8);\n translate([77.6,14,35])rotate([0,90,0])cylinder(r=4.5,8);\n translate([71.9,14,35])rotate([0,90,0])cylinder(r=3,3);\n translate([52,-1,4])rotate([90,0,0])\n {\n translate([10,3])cylinder(r=1,h=10);\n translate([3,10])cylinder(r=1,h=10);\n translate([17,10])cylinder(r=1,h=10);\n }\n translate([52,43,4])rotate([90,0,0])\n {\n translate([2.5,2.5])cylinder(r=1,h=10);\n translate([2.5,17.5])cylinder(r=1,h=10);\n translate([17.5,2.5])cylinder(r=1,h=10);\n translate([17.5,17.5])cylinder(r=1,h=10);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'SCAD\/1US.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"9dc6656a75100bfc792f438bdd19de443b7955e4","subject":"new 3dmodel","message":"new 3dmodel\n","repos":"pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam,pfnegrini\/pi-Cam","old_file":"hardware\/pantilt.scad","new_file":"hardware\/pantilt.scad","new_contents":"$fn = 150;\n\nR = 50;\nballShell = 3;\nsupportX = 0.7*R;\nsupportY = 0.15*R;\nsupportZ = 1.25*R;\nmik = 2;\nsThickness = 5;\nsupportBaseHeight = 5;\nbaseHeight = 31;\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif(application == \"servo\")\n\t{\n\t\ttranslate([-Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\t\n\t\ttranslate([+Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\n\t\ttranslate([+Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\n\t\ttranslate([-Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\t\t\n\t}\n\t}\n}\n\nmodule support() {\n\tdifference() {\n\t\tunion() {\n\t\t\tintersection() {\n\t\t\t\tsphere(R);\n\t\t\t\ttranslate([-R, -R+(supportY+sThickness)\/2, 0]) cube([500, 25, 200], center = true);\n\t\t\t}\n\n\t\t}\n\t}\n\n\ttranslate([0, -R+(supportY+sThickness\/2), -supportZ\/2]) {\n\t\tminkowski() {\n\t\t\tbox(supportX, supportY, supportZ, sThickness , \"none\");\n\t\t\tcylinder(r = mik, h = 1);\n\t\t\t\/\/rotate([90,0,0])cylinder(r = mik, h = 1);\n\t\t}\n\t}\n}\n\nmodule base() {\ntranslate([0, 0, -supportZ])\n\t\tminkowski() {\n\t\t\tcylinder(r= R+mik, h= supportBaseHeight);\n\t\trotate([90,0,0])cylinder(r = mik, h = 1);\n}\n}\n\n\n\nsphere(R);\nsupport();\nmirror([0, 10, 0]) support();\nbottom();\nbase();\nmodule bottom() {\n\ttranslate([0, 0, -supportZ - supportBaseHeight - baseHeight]){\n\tdifference() {\n\n\t\tdifference() {\n\t\t\tminkowski() {\n\t\t\t\tcylinder(r = R + 6, h = baseHeight);\n\t\t\t\trotate([90, 0, 0]) cylinder(r = mik, h = 1);\n\t\t\t}\n\n\t\t\ttranslate([0, 0, 5]) cylinder(r = (R + mik)-2*sThickness, h = 10 * baseHeight);\n\t\t}\n\ttranslate([0, 0, baseHeight-supportBaseHeight]) cylinder(r = R + mik + 2, h = 10*supportBaseHeight);\n\t}\n\t \ntranslate([0, 0, 17 - 3]) box(24.5, 13, 17, 3, \"servo\");\n}\n\n}","old_contents":"$fn = 250;\n\nR = 50;\nballShell = 3;\nsupportX = 35;\nsupportY = 8;\nsupportZ = 60;\nmik = 2;\nsThickness = 5;\nsupportBaseHeight = 5;\nbaseHeight = 31;\n\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n\/\/Creates a box, dimensions are internal\n{\n\tdifference() {\n\t\t\/\/translate([10,0,-thickness])\n\t\tcube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n\t\ttranslate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\t\tif(application == \"servo\")\n\t{\n\t\ttranslate([-Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\t\n\t\ttranslate([+Xdim\/2,0,-0.5*Zdim])cube([5,Ydim+2*thickness,Zdim\/2+thickness], center=true);\n\t\ttranslate([+Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\n\t\ttranslate([-Xdim\/2,0,0])cube([thickness\/2,0.3*Ydim,Zdim], center=true);\t\t\n\t}\n\t}\n}\n\nmodule support() {\n\tdifference() {\n\t\tunion() {\n\t\t\tintersection() {\n\t\t\t\tsphere(R);\n\t\t\t\ttranslate([-R, -R+(supportY+sThickness)\/2, 0]) cube([500, 25, 200], center = true);\n\t\t\t}\n\n\t\t}\n\t}\n\n\ttranslate([0, -R+(supportY+sThickness\/2), -supportZ\/2]) {\n\t\tminkowski() {\n\t\t\tbox(supportX, supportY, supportZ, sThickness , \"none\");\n\t\t\tcylinder(r = mik, h = 1);\n\t\t\t\/\/rotate([90,0,0])cylinder(r = mik, h = 1);\n\t\t}\n\t}\n}\n\nmodule base() {\ntranslate([0, 0, -supportZ])\n\t\tminkowski() {\n\t\t\tcylinder(r= R+mik, h= supportBaseHeight);\n\t\trotate([90,0,0])cylinder(r = mik, h = 1);\n}\n}\n\n\n\nsphere(R);\nsupport();\nmirror([0, 10, 0]) support();\n\/\/need to understnad -2 in 2*R-5-mik-2\nbase();\n\ntranslate([0, 0, -supportZ-supportBaseHeight-baseHeight])\ndifference(){\n{difference(){\n\tminkowski() {\ncylinder(r= R+6, h = baseHeight);\t\t\nrotate([90,0,0])cylinder(r = mik, h = 1);\n}\n\ntranslate([0, 0, 5])cylinder(r= (R+mik)\/2, h = 10*baseHeight);\t\t\n}\ntranslate([0, 0, 5])cylinder(r= R+mik+2, h = 10*baseHeight);\t\t\n\n\n}\n\ntranslate([0, 0, 17-3])\tbox(24.5, 13, 17, 3,\"servo\");}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b065c4466f0220745239469201bbbbb98f62dc2f","subject":"Additional tweaks to Typeatron model","message":"Additional tweaks to Typeatron model\n","repos":"joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo","old_file":"typeatron\/typeatron.scad","new_file":"typeatron\/typeatron.scad","new_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\npinHoleRes = 10;\n\/*\ncornerRoundingRes = 100;\nconnectorPinRes = 100;\nledHoleRes = 100;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nconnectorPinRes = 10;\nledHoleRes = 10;\n\/\/*\/\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.95;\nledRimThick = 1.0;\n\nlidThick = 1.5;\nfloorThick = 1.5;\n\ncaseWidth = 70;\ncaseLength = 130;\nthickestComponent = 7.9;\ncaseHeight = lidThick + floorThick + thickestComponent + 1;\n\nwallThick = caseHeight\/2;\n\necho(\"caseHeight: \", caseHeight);\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0;\npushButtonBaseThick = 1.5;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = 25;\nthumbButtonLength = 30;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = 0.3; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error2);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 27;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\n\nmodule button(length) {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n translate([length-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([length-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t\/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1.5,0, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1.5,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([length,buttonWidth,buttonThick+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([length-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+3,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n \/\/translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n\n }\n\n for (i = [1:4]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbBevelLength - wallThick*2\/3)\/4,0]) {\n pinHole();\n }\n }\n translate([12,caseLength-thumbBevelLength+2,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-wallThick*2\/3,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-15, 0]) {\n pinHole();\n }\n translate([wallThick*2\/3,10,0]) {\n pinHole();\n }\n translate([10,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-8,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2+8,wallThick*2\/3,0]) {\n pinHole();\n }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+thumbBevelBuffer,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-thumbBevelBuffer,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(fingerButtonLength, pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(thumbButtonLength, pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([42,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-1+wallThick+ledRimThick]) {\n cylinder(h=10,r=ledRimRadius+clearance, $fn=20);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick+cavityWidth-chargerHeaderWidth-error2,0,caseHeight-floorThick-chargerHeaderLength-error2]) {\n cube([chargerHeaderWidth+error2,wallThick+1,chargerHeaderLength+error2]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+error2,wallThick+1,powerSwitchWidth+error2]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick+1,nanoUsbHeight+clearance]);\n }\n }\n}\n\n\/\/ body\ndifference() {\n union() {\n basicCase();\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight-floorThick+0.001, r=3);\n }\n }\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error, $fn=connectorPinRes);\n }\n translate([wallThick+2, caseLength-thumbBevelLength+3, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error, $fn=connectorPinRes);\n }\n\n \/\/ screwdriver\/leverage slots\n translate([wallThick,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,caseLength-wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([-60,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick+2, caseLength-thumbBevelLength+3, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([-10,0,10]) {\n for (i = [0:3]) {\n translate([0,i*(fingerButtonLength+2),0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }} \n }\n}\ntranslate([5,caseLength-35,10]) {\n rotate([90,180,-90]) {\n button(thumbButtonLength);\n } \n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ container for power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+error2,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([0,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([0,3,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","old_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\npinHoleRes = 10;\n\/*\ncornerRoundingRes = 50;\nconnectorPinRes = 50;\nledHoleRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nconnectorPinRes = 10;\nledHoleRes = 10;\n\/\/*\/\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.95;\nledRimThick = 1.0;\n\nlidThick = 1.5;\nfloorThick = 1.5;\n\ncaseWidth = 70;\ncaseLength = 130;\nthickestComponent = 7.9;\ncaseHeight = lidThick + floorThick + thickestComponent + 1;\n\nwallThick = caseHeight\/2;\n\necho(\"caseHeight: \", caseHeight);\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0;\npushButtonBaseThick = 1.5;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = 25;\nthumbButtonLength = 30;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = 0.3; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error2);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 27;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\n\nmodule button(length) {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n translate([length-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([length-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t\/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1.5,0, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1.5,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([length,buttonWidth,buttonThick+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([length-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+3,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n \/\/translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n\n }\n\n for (i = [1:4]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbBevelLength - wallThick*2\/3)\/4,0]) {\n pinHole();\n }\n }\n translate([12,caseLength-thumbBevelLength+2,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-wallThick*2\/3,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-15, 0]) {\n pinHole();\n }\n translate([wallThick*2\/3,10,0]) {\n pinHole();\n }\n translate([10,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-8,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2+8,wallThick*2\/3,0]) {\n pinHole();\n }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+thumbBevelBuffer,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-thumbBevelBuffer,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(fingerButtonLength, pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(thumbButtonLength, pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([42,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-1+wallThick+ledRimThick]) {\n cylinder(h=10,r=ledRimRadius+clearance, $fn=20);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick+cavityWidth-chargerHeaderWidth-error2,0,caseHeight-floorThick-chargerHeaderLength-error2]) {\n cube([chargerHeaderWidth+error2,wallThick+1,chargerHeaderLength+error2]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+error2,wallThick+1,powerSwitchWidth+error2]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick+1,nanoUsbHeight+clearance]);\n }\n }\n}\n\n\/\/ body\ndifference() {\n union() {\n basicCase();\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight-floorThick+0.001, r=3);\n }\n }\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick+2, caseLength-thumbBevelLength+3, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n\n \/\/ screwdriver\/leverage slots\n translate([wallThick,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,caseLength-wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([-60,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick+2, caseLength-thumbBevelLength+3, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([-10,0,10]) {\n for (i = [0:3]) {\n translate([0,i*(fingerButtonLength+2),0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }} \n }\n}\ntranslate([5,caseLength-35,10]) {\n rotate([90,180,-90]) {\n button(thumbButtonLength);\n } \n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ container for power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+error2,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([0,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([0,3,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4454ead05a825e58a45ada05200a5b29f51e228a","subject":"screws: use transform shortcuts","message":"screws: use transform shortcuts\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n tz(-h\/2+.01)\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n tz(head_embed?-head_h:0)\n {\n if(with_head)\n {\n tz(h\/2+.01)\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n tz(-h\/2+nut_h+nut_offset+(head_embed?head_h:0))\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n tz(nut_thick\/2)\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n tz(-nut_thick-.01)\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n tz(nut_h\/2+screw_offset)\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n tz(-nut_h\/2)\n tz(screw_offset)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ for proper threads\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n translate([0,0,-h\/2+.01])\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_nut_access=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, with_access=with_nut_access, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n threadsize = get(ThreadSize, thread);\n d = get(ThreadSize, thread);\n pitch = get(ThreadPitchMm, thread);\n windings = ceil(h\/pitch);\n\n size_align(size=[d,d,h], orient=orient, align=align)\n material(Mat_Steel)\n {\n if($preview_mode)\n {\n cylindera(d=d, h=h, align=Z);\n }\n else\n {\n intersection()\n {\n cylindera(d=d, h=h, align=Z);\n tz(-pitch)\n threading(angle=60, pitch=pitch, d=d, windings=windings, full=true);\n }\n \/*inner_d = (get(ThreadInternalMinorDiaMin, thread) + get(ThreadInternalMinorDiaMin, thread))\/2;*\/\n \/*cylindera(d=inner_d, h=h, align=Z);*\/\n }\n }\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n nut_thread = fallback(thread, get(NutThread, nut));\n h_ = fallback(override_h, nut_thick);\n material(Mat_Steel)\n size_align([nut_dia, nut_dia, h_], orient=orient, align=align)\n {\n difference()\n {\n cylindera($fn=nut_facets, d=nut_dia, h=h_);\n screw_thread(thread=nut_thread, h=h_+.2);\n }\n }\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, with_access=true, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n tz(-.1)\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n\n if(with_access)\n translate([0,0,-nut_thick-.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n tolerance = -.2*mm;\n nut_width_min = get(NutWidthMin, nut)+tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut)+tolerance;\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\n\/*module Threading(D = 0, pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40)*\/\n\/*{*\/\n \/*R = D==0?d\/2+2*pitch\/PI:D\/2; *\/\n \/*translate([0,0,-pitch])*\/\n \/*difference()*\/\n \/*{*\/\n \/*translate([0,0,pitch])*\/\n \/*cylinder (r=R, h =pitch*(windings-helices));*\/\n \/*threading(pitch, d, windings, helices, angle, steps, true); *\/\n \/*}*\/\n\/*}*\/\n\n\/\/ From ParkinBots threading library\n\/\/ https:\/\/www.thingiverse.com\/thing:1659079\nmodule threading(pitch = 1, d = 12, windings = 10, helices = 1, angle = 60, steps=40, full = false)\n{\n \/\/ tricky: glue two 180\u00b0 pieces together to get a proper manifold \n r = d\/2;\n Steps = steps\/2;\n Pitch = pitch*helices;\n if(full)\n {\n cylinder(r = r-.5-pitch\/PI, h=pitch*(windings+helices), $fn=steps);\n }\n\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n rz(180)\n tz(Pitch\/2)\n sweep(gen_dat(), planar_caps=true); \/\/ half screw\n\n function gen_dat() =\n let(ang = 180, bar = R_(180, -90, 0, Ty_(-r+.5, vec3D(pitch\/PI*Rack(windings, angle)))))\n [for (i=[0:Steps]) Tz_(i\/2\/Steps*Pitch, -Rz_(i*ang\/Steps, bar))];\n\n function Rack(w, angle) =\n concat([[0, 2]],\n [for (i=[0:w-1], j=[0:3])\n let(t = [ [0, 1], [2*tan(angle\/2), -1], [PI\/2, -1], [2*tan(angle\/2)+PI\/2, 1]])\n [t[j][0]+i*PI, t[j][1]]], [[w*PI, 1], [w*PI, 2]\n ]);\n}\n\n\nif(false)\n{\n $fn=128;\n nut1 = NutHexM3;\n stack(axis=X, dist = 20)\n {\n screw(nut=NutHexM8, head=\"socket\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=1, with_nut=0, orient=-Z);\n screw(nut=NutHexM8, head=\"button\", h=25, with_head=0, with_nut=0, orient=-Z);\n\n threading(pitch = 1.25, d=8, windings=10, full=true);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"157c55eb6ad8d30f44ae2b0a4b4335bb3ca293f3","subject":"fixed spacing and sizes + added element() helper function","message":"fixed spacing and sizes + added element() helper function\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"aks_zielonka\/cable_tube_enclosure.scad","new_file":"aks_zielonka\/cable_tube_enclosure.scad","new_contents":"wall = 1.75;\nspacing = 1.3;\nl = 3.2;\nsize = [90+2*wall, 41, 15];\n\nmodule tooth_()\n{\n size = 4;\n difference()\n {\n cube([l, size, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube([l, size, 2*l]);\n }\n}\n\nmodule element()\n{\n \/\/ body\n difference()\n {\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n }\n \n \/\/ side teeth\n for(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth_();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth_();\n }\n \n \/\/ upper teeth\n for(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth_();\n}\n\nelement();\n","old_contents":"size = [92.75, 41, 15];\nwall = 1.75;\nspacing = 2;\nl = 3.2;\n\nmodule tooth()\n{\n size = 4;\n difference()\n {\n cube([l, size, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube([l, size, 2*l]);\n }\n}\n\n\/\/ body\ndifference()\n{\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n}\n\n\/\/ side teeth\nfor(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth();\n }\n\n\/\/ upper teeth\nfor(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5ece7360a564f00df585129a8eea61ca2df279c2","subject":"shapes: add triangle module","message":"shapes: add triangle module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2)\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/*triangle_a(45, 5, 5);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(10, 15, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2)\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"69fe20e5bbdac26cfb35b6e3d5717dfff6c9e0ec","subject":"xaxis\/ends: apply rounding on some cylinders","message":"xaxis\/ends: apply rounding on some cylinders\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"024df03077871597195a3ef78026bf80a475035d","subject":"Fixes #32 - thanks to @akrinke","message":"Fixes #32 - thanks to @akrinke\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n cutouts_vb = cutouts_vb,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts[t]) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n if(twist_holes[t][4] != undef) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=twist_holes[t][4]);\n }\n else\n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=3*thickness);\n }\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n if(twist_connect[t][3] != undef) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=twist_connect[t][3]);\n }\n else\n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=thickness*3);\n }\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(cutouts_vb != undef) for (t = [0:1:len(cutouts_vb)-1]) \n {\n simpleCutouts(cutouts_vb[t][0], cutouts_vb[t][1], cutouts_vb[t][2], cutouts_vb[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ((thickness*2.5 + milling_bit*2) > 5)\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n else\n {\n if ($children) translate([0, max_y(points) + 5, 0])\n children(); \n }\n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(cutouts_vb)\n echo(str(\"[LC] , cutouts_vb = \", cutouts_vb));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness, spine)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and spine\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + ((spine\/2)*(spine\/2)) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness\/2-spine\/4,spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n translate([+thickness\/2+spine\/4,-spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x, spine)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]);\n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]);\n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n\nmodule lasercutoutVinylBox(thickness, x=0, y=0, z=0, sides=6, overlapdistance=-1,\n infill=false,\n infill_x=5,\n infill_y=5,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n overlap = (overlapdistance == -1) ? (1+10)*thickness : overlapdistance;\n\n gap_y = (x-(overlap+thickness)-(overlap+thickness))\/infill_x;\n gap_x = (y-(overlap+thickness)-(overlap+thickness))\/infill_y;\n\n cutouts_y = [for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) [z\/2, i+gap_x\/2, z\/2, thickness] ];\n cutouts_x = [for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) [i+gap_y\/2, 0, thickness, z\/2] ];\n cutouts_x_extend = [for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) [i+gap_y\/2, z\/3, thickness, z\/3] ];\n cutouts_y_extend = [for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) [z\/3, i+gap_x\/2, z\/3, thickness] ];\n\n \/\/ cutout just for down protruding infill \n cutouts_1 = [for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) [x\/3, i+gap_x\/2, x\/3, thickness] ];\n cutouts_2 = [for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) [i+gap_y\/2, y\/3, thickness, y\/3] ];\n\n cutouts_1_all = (infill) ? cutouts_1 : undef ;\n cutouts_2_all = (infill) ? cutouts_2 : undef ;\n\n cutouts_3_4 = [ \n [x*1\/3, overlap, x\/3, thickness],\n [x*1\/3, z-overlap-thickness, x\/3, thickness],\n [overlap, z\/3, thickness, z\/3],\n [x-overlap-thickness, z\/3, thickness, z\/3] \n ];\n \n \n cutout_3_4_all = (infill) ? concat(cutouts_3_4, cutouts_x_extend) : cutouts_3_4 ;\n \n cutouts_5_6= [ \n [overlap, y\/3, thickness, y\/3],\n [z-overlap-thickness*2, y\/3, thickness, y\/3]\n ];\n\n cutout_5_6_all = (infill) ? concat(cutouts_5_6, cutouts_y_extend) : cutouts_5_6 ;\n\n points_1_2 = [\n [overlap+thickness,overlap+thickness], \n [overlap+thickness,y*1\/3], \n [0,y*1\/3], [0,y*2\/3],\n [overlap+thickness,y*2\/3], \n [overlap+thickness,y-overlap-thickness], \n [x*1\/3,y-overlap-thickness], \n [x*1\/3,y], \n [x*2\/3,y], \n [x*2\/3,y-overlap-thickness], \n [x-overlap-thickness,y-overlap-thickness], \n [x-overlap-thickness,y*2\/3], \n [x,y*2\/3], \n [x,y*1\/3], \n [x-overlap-thickness,y*1\/3], \n [x-overlap-thickness,overlap+thickness], \n [x*2\/3,overlap+thickness], \n [x*2\/3,0], \n [x*1\/3,0], \n [x*1\/3,overlap+thickness], \n ];\n\n points_5_6 = [\n [0,overlap+thickness], \n [z\/3,overlap+thickness], \n [z\/3,0], \n [z*2\/3,0], \n [z*2\/3,overlap+thickness], \n [z*3\/3,overlap+thickness], \n [z*3\/3,y-(overlap+thickness)], \n [z*2\/3,y-(overlap+thickness)], \n [z*2\/3,y], \n [z*1\/3,y], \n [z*1\/3,y-(overlap+thickness)], \n [0,y-(overlap+thickness)]\n ];\n\n points_infil_x = [\n [overlap+thickness,overlap+thickness],\n [z\/3,overlap+thickness],\n [z\/3,0], [z*2\/3,0],\n [z*2\/3,overlap+thickness],\n [z-(overlap+thickness),overlap+thickness],\n [z-(overlap+thickness),y-(overlap+thickness)],\n [z*2\/3,y-(overlap+thickness)],\n [z*2\/3,y],\n [z*1\/3,y],\n [z*1\/3,y-(overlap+thickness)],\n [overlap+thickness,y-(overlap+thickness)],\n [overlap+thickness,y*2\/3],\n [0,y*2\/3],\n [0,y*1\/3],\n [overlap+thickness,y*1\/3],\n [overlap+thickness,overlap+thickness],\n ];\n\n points_infil_y = [\n [overlap+thickness,overlap+thickness],\n [overlap+thickness,z\/3],\n [0,z\/3],\n [0,z*2\/3],\n [overlap+thickness,z*2\/3],\n [overlap+thickness,z-(overlap+thickness)],\n [x\/3,z-(overlap+thickness)],\n [x\/3,z],\n [x*2\/3,z],\n [x*2\/3,z-(overlap+thickness)],\n [x-(overlap+thickness),z-(overlap+thickness)],\n [x-(overlap+thickness),z*2\/3],\n [x,z*2\/3],\n [x,z*1\/3],\n [x-(overlap+thickness),z*1\/3],\n [x-(overlap+thickness),(overlap+thickness)],\n [overlap+thickness,overlap+thickness],\n ];\n\n if (sides>0)\n {\n \/\/ side 1\n translate([0,0,overlap]) rotate([0,0,0]) lasercutout(thickness=thickness,\n points=points_1_2,\n cutouts_vb=cutouts_1_all,\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit\n ); \n }\n if (sides>1)\n {\n \/\/ side 2\n translate([x,0,z-overlap]) rotate([0,180,0]) lasercutout(thickness=thickness,\n points=points_1_2,\n cutouts_vb=cutouts_2_all,\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit\n ); \n }\n if (sides>2)\n {\n \/\/ side 3\n translate([0,overlap,z]) rotate([270,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=z,\n cutouts_vb=cutout_3_4_all,\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit\n ); \n }\n if (sides>3)\n {\n \/\/ side 4\n translate([0,y-thickness-overlap,z]) rotate([270,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=z,\n cutouts_vb=cutout_3_4_all,\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n ); \n }\n if (sides>4)\n {\n \/\/ Side 5\n translate([overlap,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_5_6,\n cutouts_vb=cutout_5_6_all,\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit\n ); \n }\n if (sides>5)\n {\n \/\/ Side 6\n translate([x-overlap,0,0]) rotate([0,270,0]) lasercutout(thickness=thickness,\n points=points_5_6,\n cutouts_vb=cutout_5_6_all,\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit\n ); \n }\n if (infill)\n {\n for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) \n {\n translate([i+gap_y\/2,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_infil_x,\n cutouts=cutouts_y\n );\n }\n for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) \n {\n translate([0,i+gap_x\/2,z]) rotate([270,0,0]) lasercutout(thickness=thickness,\n points=points_infil_y,\n cutouts=cutouts_x\n );\n }\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n cutouts_vb = cutouts_vb,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n if(twist_holes[t][4] != undef) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=twist_holes[t][4]);\n }\n else\n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=3*thickness);\n }\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n if(twist_connect[t][3] != undef) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=twist_connect[t][3]);\n }\n else\n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=thickness*3);\n }\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(cutouts_vb != undef) for (t = [0:1:len(cutouts_vb)-1]) \n {\n simpleCutouts(cutouts_vb[t][0], cutouts_vb[t][1], cutouts_vb[t][2], cutouts_vb[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ((thickness*2.5 + milling_bit*2) > 5)\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n else\n {\n if ($children) translate([0, max_y(points) + 5, 0])\n children(); \n }\n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(cutouts_vb)\n echo(str(\"[LC] , cutouts_vb = \", cutouts_vb));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness, spine)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and spine\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + ((spine\/2)*(spine\/2)) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness\/2-spine\/4,spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n translate([+thickness\/2+spine\/4,-spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x, spine)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]);\n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]);\n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n\nmodule lasercutoutVinylBox(thickness, x=0, y=0, z=0, sides=6, overlapdistance=-1,\n infill=false,\n infill_x=5,\n infill_y=5,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n overlap = (overlapdistance == -1) ? (1+10)*thickness : overlapdistance;\n\n gap_y = (x-(overlap+thickness)-(overlap+thickness))\/infill_x;\n gap_x = (y-(overlap+thickness)-(overlap+thickness))\/infill_y;\n\n cutouts_y = [for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) [z\/2, i+gap_x\/2, z\/2, thickness] ];\n cutouts_x = [for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) [i+gap_y\/2, 0, thickness, z\/2] ];\n cutouts_x_extend = [for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) [i+gap_y\/2, z\/3, thickness, z\/3] ];\n cutouts_y_extend = [for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) [z\/3, i+gap_x\/2, z\/3, thickness] ];\n\n \/\/ cutout just for down protruding infill \n cutouts_1 = [for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) [x\/3, i+gap_x\/2, x\/3, thickness] ];\n cutouts_2 = [for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) [i+gap_y\/2, y\/3, thickness, y\/3] ];\n\n cutouts_1_all = (infill) ? cutouts_1 : undef ;\n cutouts_2_all = (infill) ? cutouts_2 : undef ;\n\n cutouts_3_4 = [ \n [x*1\/3, overlap, x\/3, thickness],\n [x*1\/3, z-overlap-thickness, x\/3, thickness],\n [overlap, z\/3, thickness, z\/3],\n [x-overlap-thickness, z\/3, thickness, z\/3] \n ];\n \n \n cutout_3_4_all = (infill) ? concat(cutouts_3_4, cutouts_x_extend) : cutouts_3_4 ;\n \n cutouts_5_6= [ \n [overlap, y\/3, thickness, y\/3],\n [z-overlap-thickness*2, y\/3, thickness, y\/3]\n ];\n\n cutout_5_6_all = (infill) ? concat(cutouts_5_6, cutouts_y_extend) : cutouts_5_6 ;\n\n points_1_2 = [\n [overlap+thickness,overlap+thickness], \n [overlap+thickness,y*1\/3], \n [0,y*1\/3], [0,y*2\/3],\n [overlap+thickness,y*2\/3], \n [overlap+thickness,y-overlap-thickness], \n [x*1\/3,y-overlap-thickness], \n [x*1\/3,y], \n [x*2\/3,y], \n [x*2\/3,y-overlap-thickness], \n [x-overlap-thickness,y-overlap-thickness], \n [x-overlap-thickness,y*2\/3], \n [x,y*2\/3], \n [x,y*1\/3], \n [x-overlap-thickness,y*1\/3], \n [x-overlap-thickness,overlap+thickness], \n [x*2\/3,overlap+thickness], \n [x*2\/3,0], \n [x*1\/3,0], \n [x*1\/3,overlap+thickness], \n ];\n\n points_5_6 = [\n [0,overlap+thickness], \n [z\/3,overlap+thickness], \n [z\/3,0], \n [z*2\/3,0], \n [z*2\/3,overlap+thickness], \n [z*3\/3,overlap+thickness], \n [z*3\/3,y-(overlap+thickness)], \n [z*2\/3,y-(overlap+thickness)], \n [z*2\/3,y], \n [z*1\/3,y], \n [z*1\/3,y-(overlap+thickness)], \n [0,y-(overlap+thickness)]\n ];\n\n points_infil_x = [\n [overlap+thickness,overlap+thickness],\n [z\/3,overlap+thickness],\n [z\/3,0], [z*2\/3,0],\n [z*2\/3,overlap+thickness],\n [z-(overlap+thickness),overlap+thickness],\n [z-(overlap+thickness),y-(overlap+thickness)],\n [z*2\/3,y-(overlap+thickness)],\n [z*2\/3,y],\n [z*1\/3,y],\n [z*1\/3,y-(overlap+thickness)],\n [overlap+thickness,y-(overlap+thickness)],\n [overlap+thickness,y*2\/3],\n [0,y*2\/3],\n [0,y*1\/3],\n [overlap+thickness,y*1\/3],\n [overlap+thickness,overlap+thickness],\n ];\n\n points_infil_y = [\n [overlap+thickness,overlap+thickness],\n [overlap+thickness,z\/3],\n [0,z\/3],\n [0,z*2\/3],\n [overlap+thickness,z*2\/3],\n [overlap+thickness,z-(overlap+thickness)],\n [x\/3,z-(overlap+thickness)],\n [x\/3,z],\n [x*2\/3,z],\n [x*2\/3,z-(overlap+thickness)],\n [x-(overlap+thickness),z-(overlap+thickness)],\n [x-(overlap+thickness),z*2\/3],\n [x,z*2\/3],\n [x,z*1\/3],\n [x-(overlap+thickness),z*1\/3],\n [x-(overlap+thickness),(overlap+thickness)],\n [overlap+thickness,overlap+thickness],\n ];\n\n if (sides>0)\n {\n \/\/ side 1\n translate([0,0,overlap]) rotate([0,0,0]) lasercutout(thickness=thickness,\n points=points_1_2,\n cutouts_vb=cutouts_1_all,\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit\n ); \n }\n if (sides>1)\n {\n \/\/ side 2\n translate([x,0,z-overlap]) rotate([0,180,0]) lasercutout(thickness=thickness,\n points=points_1_2,\n cutouts_vb=cutouts_2_all,\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit\n ); \n }\n if (sides>2)\n {\n \/\/ side 3\n translate([0,overlap,z]) rotate([270,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=z,\n cutouts_vb=cutout_3_4_all,\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit\n ); \n }\n if (sides>3)\n {\n \/\/ side 4\n translate([0,y-thickness-overlap,z]) rotate([270,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=z,\n cutouts_vb=cutout_3_4_all,\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n ); \n }\n if (sides>4)\n {\n \/\/ Side 5\n translate([overlap,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_5_6,\n cutouts_vb=cutout_5_6_all,\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit\n ); \n }\n if (sides>5)\n {\n \/\/ Side 6\n translate([x-overlap,0,0]) rotate([0,270,0]) lasercutout(thickness=thickness,\n points=points_5_6,\n cutouts_vb=cutout_5_6_all,\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit\n ); \n }\n if (infill)\n {\n for(i = [(overlap+thickness): gap_y : x-(overlap+thickness)-(overlap+thickness)]) \n {\n translate([i+gap_y\/2,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_infil_x,\n cutouts=cutouts_y\n );\n }\n for(i = [(overlap+thickness): gap_x : y-(overlap+thickness)-(overlap+thickness)]) \n {\n translate([0,i+gap_x\/2,z]) rotate([270,0,0]) lasercutout(thickness=thickness,\n points=points_infil_y,\n cutouts=cutouts_x\n );\n }\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"8e3241429ec252c89972d15b74276239b0f74297","subject":"Missing parameter in drawPlate()","message":"Missing parameter in drawPlate()\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/rounded.scad","new_file":"shape\/3D\/rounded.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rounded shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a 3D rounded shape.\n *\n * @param Number|Vector [r] - The radius of the rounded part or a vector that contains radius for each dimensions.\n * @param Number|Vector [d] - The diameter of the rounded part or a vector that contains diameters for each dimensions.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns the radius vector.\n *\/\nfunction sizeRounded3D(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n d[0] && !rx ? d[0] \/ 2 : r[0],\n d[1] && !ry ? d[1] \/ 2 : r[1],\n d[2] && !rz ? d[2] \/ 2 : r[2]\n ]\n;\n\n\/**\n * Computes the size of an arch box.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeArchBox(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1]),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a stadium shape.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeSlot(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a cushion shape.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeCushion(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n radius = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1])\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n radius = [\n min(max(size[0], size[1]) \/ 2, c[0]),\n min(size[2] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n verRadius = size[2] \/ 2,\n radius = [\n min(max(size[0], size[1]) \/ 2, or(c[0], verRadius)),\n verRadius\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the points that draw the sketch of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] - radius[1]\n ],\n points = arc(r=radius, o=center, a=RIGHT)\n )\n complete(points, [radius[0], 0], [0, 0])\n;\n\n\/**\n * Computes the points that draw the sketch of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] \/ 2 - radius[1]\n ]\n )\n center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :concat(\n arc(r=radius, o=-center, a=RIGHT, a1=-RIGHT),\n arc(r=radius, o=center, a=RIGHT)\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n right = max(size[0], size[1]) \/ 2,\n top = size[2] \/ 2,\n center = [\n right - radius[0],\n top - radius[1]\n ]\n )\n radius == [0, 0] ? [ [right, top], [0, top], [0, -top], [right, -top] ]\n :center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :complete(\n concat(\n arc(r=radius, o=[center[0], -center[1]], a1=QUADRANT_3, a2=QUADRANT_4),\n arc(r=radius, o=center, a1=0, a2=QUADRANT_1)\n ),\n [0, -top],\n [0, top]\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n max(size[0], size[1]) \/ 2 - radius[0], 0\n ],\n points = arc(r=radius, o=center, a1=-RIGHT, a2=RIGHT)\n )\n center == [0, 0] ? points\n :complete(points, -[0, radius[1]], [0, radius[1]])\n;\n\n\/**\n * Creates an arch box at the origin.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule archBox(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeArchBox(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n arch(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a slot shape at the origin.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule slot(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeSlot(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n stadium(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a cushion shape at the origin.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule cushion(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeCushion(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n roundedRectangle(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a bullet shape at the origin.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule bullet(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawBullet(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a pill shape at the origin.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pill(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPill(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a peg shape at the origin.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule peg(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPeg(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a plate shape at the origin.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule plate(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPlate(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a rounded corner wedge at the origin.\n * For now the function can only handle square corner.\n *\n * @param Number [size] - The size of the corner.\n * @param Number [r] - The radius of the round.\n * @param Number [h] - The height of the solid.\n * @param Number [d] - The diameter of the round.\n * @param String|Vector [p] - The position of the corner, as a cardinal point (default: \"ne\", aka North East).\n * @param Boolean [convex] - Whether makes a convex corner (default: false).\n * @param Number [adjust] - An adjust value added to the size in order to fix wall alignment issue.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule roundedCornerWedge(size, r, h, d, p, convex, adjust, center) {\n linear_extrude(height=divisor(h), center=center, convexity=10) {\n roundedCorner(size=size, r=r, d=d, p=p, convex=convex, adjust=adjust);\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rounded shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a 3D rounded shape.\n *\n * @param Number|Vector [r] - The radius of the rounded part or a vector that contains radius for each dimensions.\n * @param Number|Vector [d] - The diameter of the rounded part or a vector that contains diameters for each dimensions.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns the radius vector.\n *\/\nfunction sizeRounded3D(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n d[0] && !rx ? d[0] \/ 2 : r[0],\n d[1] && !ry ? d[1] \/ 2 : r[1],\n d[2] && !rz ? d[2] \/ 2 : r[2]\n ]\n;\n\n\/**\n * Computes the size of an arch box.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeArchBox(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1]),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a stadium shape.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeSlot(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n horRadius = size[0] \/ 2,\n radius = [\n horRadius,\n min(size[1] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a cushion shape.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeCushion(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n radius = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1])\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2], or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n horRadius = max(size[0], size[1]) \/ 2,\n radius = [\n horRadius,\n min(size[2] \/ 2, or(c[1], horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n radius = [\n min(max(size[0], size[1]) \/ 2, c[0]),\n min(size[2] \/ 2, c[1])\n ]\n )\n [ size, radius[0] && radius[1] ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[0] * 2),\n divisor(s[2] ? s[2] : c[1] * 2)\n ],\n verRadius = size[2] \/ 2,\n radius = [\n min(max(size[0], size[1]) \/ 2, or(c[0], verRadius)),\n verRadius\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the points that draw the sketch of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] - radius[1]\n ],\n points = arc(r=radius, o=center, a=RIGHT)\n )\n complete(points, [radius[0], 0], [0, 0])\n;\n\n\/**\n * Computes the points that draw the sketch of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size[2] \/ 2 - radius[1]\n ]\n )\n center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :concat(\n arc(r=radius, o=-center, a=RIGHT, a1=-RIGHT),\n arc(r=radius, o=center, a=RIGHT)\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n right = max(size[0], size[1]) \/ 2,\n top = size[2] \/ 2,\n center = [\n right - radius[0],\n top - radius[1]\n ]\n )\n radius == [0, 0] ? [ [right, top], [0, top], [0, -top], [right, -top] ]\n :center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :complete(\n concat(\n arc(r=radius, o=[center[0], -center[1]], a1=QUADRANT_3, a2=QUADRANT_4),\n arc(r=radius, o=center, a1=0, a2=QUADRANT_1)\n ),\n [0, -top],\n [0, top]\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPlate(size, r, d, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePlate(size=size, r=r, d=d, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n max(size[0], size[1]) \/ 2 - radius[0], 0\n ],\n points = arc(r=radius, o=center, a1=-RIGHT, a2=RIGHT)\n )\n center == [0, 0] ? points\n :complete(points, -[0, radius[1]], [0, radius[1]])\n;\n\n\/**\n * Creates an arch box at the origin.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule archBox(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeArchBox(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n arch(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a slot shape at the origin.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule slot(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeSlot(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n stadium(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a cushion shape at the origin.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule cushion(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeCushion(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n roundedRectangle(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a bullet shape at the origin.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule bullet(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawBullet(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a pill shape at the origin.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pill(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPill(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a peg shape at the origin.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule peg(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPeg(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a plate shape at the origin.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule plate(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPlate(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a rounded corner wedge at the origin.\n * For now the function can only handle square corner.\n *\n * @param Number [size] - The size of the corner.\n * @param Number [r] - The radius of the round.\n * @param Number [h] - The height of the solid.\n * @param Number [d] - The diameter of the round.\n * @param String|Vector [p] - The position of the corner, as a cardinal point (default: \"ne\", aka North East).\n * @param Boolean [convex] - Whether makes a convex corner (default: false).\n * @param Number [adjust] - An adjust value added to the size in order to fix wall alignment issue.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule roundedCornerWedge(size, r, h, d, p, convex, adjust, center) {\n linear_extrude(height=divisor(h), center=center, convexity=10) {\n roundedCorner(size=size, r=r, d=d, p=p, convex=convex, adjust=adjust);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"42f62dcd4d7f085f357794c6cd4d14a279534bb6","subject":"oblong: switch from using minkowski to offet","message":"oblong: switch from using minkowski to offet\n\nminkowski was adding height of the object.\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/common\/extrusions.scad","new_file":"openscad\/common\/extrusions.scad","new_contents":"\/\/\n\/\/ Common extrusions\n\/\/ Author: Joseph M. Joy FTC 12598 mentor\n\/\/\nEPSILON = 0.001; \/\/ For moving things to properly punch out holes\n\n\/\/ Makes a flat (horizontal) \"T\":\n\/\/\n\/\/ --------------\n\/\/ |wtXht --|\n\/\/ ----\\ \/---\n\/\/ |wbX|\n\/\/ |hb |\n\/\/ -----\n\/\/\n\/\/\n\/\/ It could also be an inverted L shape\n\/\/ if the lower (vertical) bar is wide enough to extend beyond the right \n\/\/ hand side of the upper (horizontal) bar.\n\/\/\n\/\/ {xoff} is horizontal distance to the start of the bar.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule T_channel(wb, hb, wt, ht, xoff, r, t) {\n ow = 2*wt; \/\/ wide enough to \n oh = 2*(hb+ht); \/\/ high enough to descend below the shape\n\n difference() {\n cube([wt, hb+ht, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n }\n}\n\n\n\/\/ Makes a flat (horizontal) \"O\":\n\/\/\n\/\/ \/-------------\\\n\/\/ | |\n\/\/ | \/--------\\ |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | \\ \/ |\n\/\/ | --------- |\n\/\/ \\------------\/\n\/\/\n\/\/\n\/\/ It could also be a U or L\n\/\/ if the oblong hole extends outside the outer\n\/\/ boundary.\n\/\/\n\/\/ ({xoff},{yoff} is origin of bounding-rectangle of the oblong hole\n\/\/ {(wo}, {ho}) is the bounding box of the outer oblong.\n\/\/ {(wi}, {hi}) is the bounding box of the inner (hole) oblong.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule O_channel(wo, ho, wi, hi, xoff, yoff, r, t) {\n difference() {\n oblong(wo, ho, r, t);\n translate([xoff, yoff, -EPSILON]) oblong(wi, hi, r, t+2*EPSILON);\n }\n}\n\n\n\/\/ A rectangular prism that fits within {w} x {h} and\n\/\/ has rounded corners with radius {r} on all 4 sides.\n\/\/ The actual radius may be reduced so keep the oblong\n\/\/ viable. {t} is the thickness (in z).\nmodule oblong2(w, h, r, t) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON);\n translate([r, r, 0])\n minkowski() {\n cube([w-2*r, h-2*r, t]);\n cylinder(10, r, r);\n }\n}\nmodule oblong(w, h, r, t) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON);\n translate([r, r, 0])\n linear_extrude(height = t, center = false, convexity = 10) {\n offset(r = r) square([w-2*r, h-2*r]);\n }\n}\n\n\n\/\/\n\/\/ Example code\n\/\/\nwb = 10;\nhb = 20;\nwt = 40;\nht = 30;\nt = 5;\nr = 5;\nri = 5;\nxoff = 10;\noblong(wb, hb, r, t);\ntranslate([wb+5, 0, 0]) T_channel(wb, hb, wt, ht, xoff, r, t);\ntranslate([wb+wt+10, 0, 0]) O_channel(wt, hb+ht, wb, hb, xoff, xoff, ri, t);\n\n\n","old_contents":"\/\/\n\/\/ Common extrusions\n\/\/ Author: Joseph M. Joy FTC 12598 mentor\n\/\/\nEPSILON = 0.001; \/\/ For moving things to properly punch out holes\n\n\/\/ Makes a flat (horizontal) \"T\":\n\/\/\n\/\/ --------------\n\/\/ |wtXht --|\n\/\/ ----\\ \/---\n\/\/ |wbX|\n\/\/ |hb |\n\/\/ -----\n\/\/\n\/\/\n\/\/ It could also be an inverted L shape\n\/\/ if the lower (vertical) bar is wide enough to extend beyond the right \n\/\/ hand side of the upper (horizontal) bar.\n\/\/\n\/\/ {xoff} is horizontal distance to the start of the bar.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule T_channel(wb, hb, wt, ht, xoff, r, t) {\n ow = 10*wb;\n oh = 10*hb;\n\n difference() {\n cube([wt, hb+ht, t]);\n translate([xoff-ow,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n translate([xoff+wb,hb-oh,-EPSILON]) oblong(ow, oh, r, t+2*EPSILON);\n }\n}\n\n\n\/\/ Makes a flat (horizontal) \"O\":\n\/\/\n\/\/ \/-------------\\\n\/\/ | |\n\/\/ | \/--------\\ |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | | | |\n\/\/ | \\ \/ |\n\/\/ | --------- |\n\/\/ \\------------\/\n\/\/\n\/\/\n\/\/ It could also be a U or L\n\/\/ if the oblong hole extends outside the outer\n\/\/ boundary.\n\/\/\n\/\/ ({xoff},{yoff} is origin of bounding-rectangle of the oblong hole\n\/\/ {(wo}, {ho}) is the bounding box of the outer oblong.\n\/\/ {(wi}, {hi}) is the bounding box of the inner (hole) oblong.\n\/\/ {r} is the radius of the\n\/\/ curve shown as diagonals above.\n\/\/ t is the thickness of the plate - in\n\/\/ the z direction.\n\/\/ Origin is the left hand corner\n\/\/ of the bounding rectangle.\n\/\/ \nmodule O_channel(wo, ho, wi, hi, xoff, yoff, r, t) {\n difference() {\n oblong(wo, ho, r, t);\n translate([xoff, yoff, -EPSILON]) oblong(wi, hi, r, t+2*EPSILON);\n }\n}\n\n\n\/\/ A rectangular prism that fits within {w} x {h} and\n\/\/ has rounded corners with radius {r} on all 4 sides.\n\/\/ The actual radius may be reduced so keep the oblong\n\/\/ viable. {t} is the thickness (in z).\nmodule oblong(w, h, r, t) {\n r = min(r, w\/2-EPSILON, h\/2-EPSILON);\n translate([r, r, 0])\n minkowski() {\n cube([w-2*r, h-2*r, t]);\n cylinder(2*t, r, r);\n }\n}\n\n\nwb = 5;\nhb = 20;\nwt = 40;\nht = 30;\nt = 2;\nr = 5;\nri = 5;\nxoff = 10;\n\/\/T_channel(wb, hb, wt, ht, xoff, r, t);\nO_channel(wt, hb+ht, wb, hb+ht, xoff, xoff, ri, t);\n\/\/oblong(11, 40, 5, 2);\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"380566f6832103c69b77eaf4eb31ae6f53a04dcf","subject":"The whitespce in the code was formatted. The knurled surface library is now included from the external-resources directory, via a 'use' statement.","message":"The whitespce in the code was formatted. The knurled surface library is now included from the external-resources directory, via a 'use' statement.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_contents":"\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\\knurled-surface\\aubenc\\knurledFinishLib_v2.scad>\r\n\r\nuse <..\/..\/shapes\\star\\star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 5; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/Allocate coin data\r\n\r\ncoinName = coin == 1 ? \"AU $2\" :\r\n (coin == 2 ? \"AU 5c\" :\r\n (coin == 3 ? \"US 10c\" :\r\n (coin == 4 ? \"UK \u00a31\" :\r\n (coin == 5 ? \"UK 5p\" :\r\n (coin == 6 ? \"EU \u20ac1\" :\r\n (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule dollarHolder() {\r\n\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() {\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n starThumbnail(height = 10);\r\n \/\/\t\t\tcylinder(d=coin_d,h=holder_z+4,center=true);\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalise\r\n\r\nmodule plus() {\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() {\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() {\r\n plus();\r\n minus();\r\n}\r\n","old_contents":"\r\n\/**\r\n Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n Original Author: Geoff Buttsworth\r\n Original Filename: moneySpinner02\r\n Borrowed from Version: 0.5\r\n Twitter: @gbutts9\r\n\r\n This version is designed to work with the Thingiverse Customizer.\r\n Ref: http:\/\/customizer.makerbot.com\/docs\r\n*\/\r\n\r\n\/*\r\n The knurled library is incorporated in toto here as Customizer is limited to one SCAD file.\r\n\r\n\t * knurledFinishLib_v2.scad\r\n\t * \r\n\t * Written by aubenc @ Thingiverse\r\n\t *\r\n\t * This script is licensed under the Public Domain license.\r\n\t *\r\n\t * http:\/\/www.thingiverse.com\/thing:31122\r\n\t *\r\n\t * Derived from knurledFinishLib.scad (also Public Domain license) available at\r\n\t *\r\n\t * http:\/\/www.thingiverse.com\/thing:9095\r\n\t *\r\n*\/\r\n\r\nuse <..\/..\/shapes\\star\\star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\/\/Which coin do you want to use?\r\ncoin_list=8;\/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin=coin_list;\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes=5;\/\/[2,3,4,5,6,7]\r\nspokeNumber=Number_of_Spokes;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub=1;\/\/[0:Hub,1:Flush]\r\nflush=Flush_or_Raised_Hub;\t\t\/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/knurledFinishLib_v2\r\n\t\/*\r\n\t * Usage:\r\n\t *\r\n\t *\t Drop this script somewhere where OpenSCAD can find it (your current project's\r\n\t *\t working directory\/folder or your OpenSCAD libraries directory\/folder).\r\n\t *\r\n\t *\t Add the line:\r\n\t *\r\n\t *\t\tuse \r\n\t *\r\n\t *\t in your OpenSCAD script and call either...\r\n\t *\r\n\t * knurled_cyl( Knurled cylinder height,\r\n\t * Knurled cylinder outer diameter,\r\n\t * Knurl polyhedron width,\r\n\t * Knurl polyhedron height,\r\n\t * Knurl polyhedron depth,\r\n\t * Cylinder ends smoothed height,\r\n\t * Knurled surface smoothing amount );\r\n\t *\r\n\t * ...or...\r\n\t *\r\n\t * knurl();\r\n\t *\r\n\t *\tIf you use knurled_cyl() module, you need to specify the values for all and\r\n\t *\r\n\t * Call the module ' help(); ' for a little bit more of detail\r\n\t * and\/or take a look to the PDF available at http:\/\/www.thingiverse.com\/thing:9095\r\n\t * for a in depth descrition of the knurl properties.\r\n\t *\/\r\n\r\n\r\n\tmodule knurl(\tk_cyl_hg\t= 12,\r\n\t\t\t\t\t\tk_cyl_od\t= 25,\r\n\t\t\t\t\t\tknurl_wd = 3,\r\n\t\t\t\t\t\tknurl_hg = 4,\r\n\t\t\t\t\t\tknurl_dp = 1.5,\r\n\t\t\t\t\t\te_smooth = 2,\r\n\t\t\t\t\t\ts_smooth = 0)\r\n\t{\r\n\t knurled_cyl(k_cyl_hg, k_cyl_od, \r\n\t knurl_wd, knurl_hg, knurl_dp, \r\n\t e_smooth, s_smooth);\r\n\t}\r\n\r\n\tmodule knurled_cyl(chg, cod, cwd, csh, cdp, fsh, smt)\r\n\t{\r\n\t cord=(cod+cdp+cdp*smt\/100)\/2;\r\n\t cird=cord-cdp;\r\n\t cfn=round(2*cird*PI\/cwd);\r\n\t clf=360\/cfn;\r\n\t crn=ceil(chg\/csh);\r\n\r\n\t echo(\"knurled cylinder max diameter: \", 2*cord);\r\n\t echo(\"knurled cylinder min diameter: \", 2*cird);\r\n\r\n\t\t if( fsh < 0 )\r\n\t {\r\n\t union()\r\n\t {\r\n\t shape(fsh, cird+cdp*smt\/100, cord, cfn*4, chg);\r\n\r\n\t translate([0,0,-(crn*csh-chg)\/2])\r\n\t knurled_finish(cord, cird, clf, csh, cfn, crn);\r\n\t }\r\n\t }\r\n\t else if ( fsh == 0 )\r\n\t {\r\n\t intersection()\r\n\t {\r\n\t cylinder(h=chg, r=cord-cdp*smt\/100, $fn=2*cfn, center=false);\r\n\r\n\t translate([0,0,-(crn*csh-chg)\/2])\r\n\t knurled_finish(cord, cird, clf, csh, cfn, crn);\r\n\t }\r\n\t }\r\n\t else\r\n\t {\r\n\t intersection()\r\n\t {\r\n\t shape(fsh, cird, cord-cdp*smt\/100, cfn*4, chg);\r\n\r\n\t translate([0,0,-(crn*csh-chg)\/2])\r\n\t knurled_finish(cord, cird, clf, csh, cfn, crn);\r\n\t }\r\n\t }\r\n\t}\r\n\r\n\tmodule shape(hsh, ird, ord, fn4, hg)\r\n\t{\r\n\t\tx0= 0;\tx1 = hsh > 0 ? ird : ord;\t\tx2 = hsh > 0 ? ord : ird;\r\n\t\ty0=-0.1;\ty1=0;\ty2=abs(hsh);\ty3=hg-abs(hsh);\ty4=hg;\ty5=hg+0.1;\r\n\r\n\t\tif ( hsh >= 0 )\r\n\t\t{\r\n\t\t\trotate_extrude(convexity=10, $fn=fn4)\r\n\t\t\tpolygon(points=[\t[x0,y1],[x1,y1],[x2,y2],[x2,y3],[x1,y4],[x0,y4]\t],\r\n\t\t\t\t\t\tpaths=[\t[0,1,2,3,4,5]\t]);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\trotate_extrude(convexity=10, $fn=fn4)\r\n\t\t\tpolygon(points=[\t[x0,y0],[x1,y0],[x1,y1],[x2,y2],\r\n\t\t\t\t\t\t\t\t\t[x2,y3],[x1,y4],[x1,y5],[x0,y5]\t],\r\n\t\t\t\t\t\tpaths=[\t[0,1,2,3,4,5,6,7]\t]);\r\n\t\t}\r\n\t}\r\n\r\n\tmodule knurled_finish(ord, ird, lf, sh, fn, rn)\r\n\t{\r\n\t for(j=[0:rn-1])\r\n\t assign(h0=sh*j, h1=sh*(j+1\/2), h2=sh*(j+1))\r\n\t {\r\n\t for(i=[0:fn-1])\r\n\t assign(lf0=lf*i, lf1=lf*(i+1\/2), lf2=lf*(i+1))\r\n\t {\r\n\t polyhedron(\r\n\t points=[\r\n\t [ 0,0,h0],\r\n\t [ ord*cos(lf0), ord*sin(lf0), h0],\r\n\t [ ird*cos(lf1), ird*sin(lf1), h0],\r\n\t [ ord*cos(lf2), ord*sin(lf2), h0],\r\n\r\n\t [ ird*cos(lf0), ird*sin(lf0), h1],\r\n\t [ ord*cos(lf1), ord*sin(lf1), h1],\r\n\t [ ird*cos(lf2), ird*sin(lf2), h1],\r\n\r\n\t [ 0,0,h2],\r\n\t [ ord*cos(lf0), ord*sin(lf0), h2],\r\n\t [ ird*cos(lf1), ird*sin(lf1), h2],\r\n\t [ ord*cos(lf2), ord*sin(lf2), h2]\r\n\t ],\r\n\t triangles=[\r\n\t [0,1,2],[2,3,0],\r\n\t [1,0,4],[4,0,7],[7,8,4],\r\n\t [8,7,9],[10,9,7],\r\n\t [10,7,6],[6,7,0],[3,6,0],\r\n\t [2,1,4],[3,2,6],[10,6,9],[8,9,4],\r\n\t [4,5,2],[2,5,6],[6,5,9],[9,5,4]\r\n\t ],\r\n\t convexity=5);\r\n\t }\r\n\t }\r\n\t}\r\n\r\n\tmodule knurl_help()\r\n\t{\r\n\t\techo();\r\n\t\techo(\" Knurled Surface Library v2 \");\r\n\t echo(\"\");\r\n\t\techo(\" Modules: \");\r\n\t\techo(\"\");\r\n\t\techo(\" knurled_cyl(parameters... ); - Requires a value for each an every expected parameter (see bellow) \");\r\n\t\techo(\"\");\r\n\t\techo(\" knurl(); - Call to the previous module with a set of default parameters, \");\r\n\t\techo(\" values may be changed by adding 'parameter_name=value' i.e. knurl(s_smooth=40); \");\r\n\t\techo(\"\");\r\n\t\techo(\" Parameters, all of them in mm but the last one. \");\r\n\t\techo(\"\");\r\n\t\techo(\" k_cyl_hg - [ 12 ] ,, Height for the knurled cylinder \");\r\n\t\techo(\" k_cyl_od - [ 25 ] ,, Cylinder's Outer Diameter before applying the knurled surfacefinishing. \");\r\n\t\techo(\" knurl_wd - [ 3 ] ,, Knurl's Width. \");\r\n\t\techo(\" knurl_hg - [ 4 ] ,, Knurl's Height. \");\r\n\t\techo(\" knurl_dp - [ 1.5 ] ,, Knurl's Depth. \");\r\n\t\techo(\" e_smooth - [ 2 ] ,, Bevel's Height at the bottom and the top of the cylinder \");\r\n\t\techo(\" s_smooth - [ 0 ] ,, Knurl's Surface Smoothing : File donwn the top of the knurl this value, i.e. 40 will snooth it a 40%. \");\r\n\t\techo(\"\");\r\n\t}\r\n\r\n\/\/Allocate coin data\r\n\r\n\tcoinName=coin==1 ? \"AU $2\" : \r\n\t\t(coin==2 ? \"AU 5c\" : \r\n\t\t\t(coin==3 ? \"US 10c\" :\r\n\t\t\t\t(coin==4 ? \"UK \u00a31\" :\r\n\t\t\t\t\t(coin==5 ? \"UK 5p\" :\r\n\t\t\t\t\t\t(coin==6 ? \"EU \u20ac1\" :\r\n\t\t\t\t\t\t\t(coin==7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\t\t\t\t\t\t)\t\r\n\t\t\t\t\t)\t\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\tcoin_d=coin==1 ? 20.5 : \r\n\t\t(coin==2 ? 19.4 : \r\n\t\t\t(coin==3 ? 17.9 :\r\n\t\t\t\t(coin==4 ? 22.5 :\r\n\t\t\t\t\t(coin==5 ? 18.0 :\r\n\t\t\t\t\t\t(coin==6 ? 23.3 :\r\n\t\t\t\t\t\t\t(coin==7 ? 25.0 : 21.3)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\t\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\tcoin_z=coin==1 ? 2.8 : \r\n\t\t(coin==2 ? 1.3 : \r\n\t\t\t(coin==3 ? 1.35 :\r\n\t\t\t\t(coin==4 ? 3.15 :\r\n\t\t\t\t\t(coin==5 ? 1.8 :\r\n\t\t\t\t\t\t(coin==6 ? 2.35 :\r\n\t\t\t\t\t\t\t(coin==7 ? 1.78 : 1.95)\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t)\t\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t);\r\n\r\n\tstack=coin==2 ? 3 : \r\n\t\t(coin==3 ? 3 : \r\n\t\t\t(coin==5 ? 3 :\r\n\t\t\t\t(coin==7 ? 3 :\r\n\t\t\t\t\t(coin==8 ? 4 : 2)\r\n\t\t\t\t)\r\n\t\t\t)\t\r\n\t\t);\r\n\r\n\/\/Default values\r\n\t$fa=0.8;\r\n\t$fs=0.8;\r\n\r\n\/\/Variables:\r\n\r\n\trim=5;\r\n\tholder_d=coin_d+rim;\r\n\tholder_z=coin_z*stack;\r\n\r\n\tbrg_d=22.0;\r\n\tbrg_z=7.0;\r\n\r\n\tspoke_x=coin_d\/2;\r\n\tspoke_y=coin_d\/3;\r\n\tspoke_z=holder_z;\r\n\r\n\t\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\n\thub_z=flush==1 ? coin_z*stack : brg_z;\t\r\n\r\n\/\/SpinnerModules\r\n\r\n\tmodule dollarHolder() {\r\n\t\ttranslate([0,coin_d\/2+spoke_y,0])\r\n\t\tdifference() {\r\n\t\t\ttranslate([0,0,-coin_z*stack\/2])\r\n\t\t\t\tknurl(k_cyl_hg=holder_z,k_cyl_od=holder_d);\r\n\t\t\t\t\r\n\t\t\txyScale = 0.75;\r\n\t\t\ttranslate([0, 0, -5])\r\n\t\t\tscale([xyScale, xyScale, 1])\r\n\t\t\tstarThumbnail(height=10);\r\n\/\/\t\t\tcylinder(d=coin_d,h=holder_z+4,center=true);\r\n\t\t}\t\r\n\t}\r\n\r\n\tmodule hub() {\r\n\t\t\tcylinder(h=hub_z,d=brg_d+rim,center=true);\r\n\t}\r\n\r\n\tmodule spoke() {\r\n\t\ttranslate([0,spoke_y\/2,0])\r\n\t\t\tcube([spoke_x,spoke_y,spoke_z], center=true);\r\n\t}\r\n\r\n\tmodule brgVoid() {\r\n\t\tcylinder(h=brg_z+2,d=brg_d,center=true);\r\n\t}\r\n\r\n\tmodule holderSpoke() {\r\n\t\ttranslate([0,brg_d\/2,0])\r\n\t\tunion() {\r\n\t\t\tdollarHolder();\r\n\t\t\tspoke();\r\n\t\t}\r\n\t}\r\n\r\n\/\/Rotate\r\n\trA = 360\/spokeNumber;\t\/\/rotational angle\r\n\tfA = round(360-rA);\t\t\/\/final angle\r\n\r\n\tmodule spinner() {\r\n\t\tfor (i = [0:rA:fA]) {\r\n\t\t\trotate([0,0,i])\r\n\t\t\t\tholderSpoke();\r\n\t\t}\r\n\t}\r\n\r\n\/\/Finalise\r\n\tmodule plus() {\r\n\t\thub();\r\n\t\tspinner();\r\n\t}\r\n\r\n\tmodule minus() {\r\n\t\tbrgVoid();\r\n\t}\r\n\r\n\t\/\/Render\r\n\tdifference() {\r\n\t\tplus();\r\n\t\tminus();\r\n\t}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9acd16f4d0a32330b677c1046ee2d3bcacac5567","subject":"The left over near the left head left colar bone was removed.","message":"The left over near the left head left colar bone was removed.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/toys\/treasure-troll\/treasure-troll.scad","new_file":"OpenSCAD\/src\/main\/openscad\/toys\/treasure-troll\/treasure-troll.scad","new_contents":"\r\nheadCutoutRadius = 19;\r\n\r\nmodule headRemover()\r\n{\r\n difference()\r\n {\r\n cubeLengthX = 95; \r\n cube([cubeLengthX, 85, 70]);\r\n\r\n translate([40, 120, -3])\r\n rotate([90, 0, 0])\r\n cylinder(r=headCutoutRadius, \r\n h=129,\r\n $fn=60);\r\n }\r\n}\r\n\r\nmodule headlessTroll(stlPath, cutHeight)\r\n{\r\n trollY = 140;\r\n difference()\r\n {\r\n translate([0, trollY, 0])\r\n originalTroll(stlPath);\r\n\r\n color(\"green\")\r\n translate([-17, 132, 58.5])\r\n headRemover();\r\n \r\n \/\/ remove the left overs\r\n \r\n\/\/ }\r\n \r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([21, 172, 74])\r\n\t\trotate([0,20,0])\r\n\t\tcube([15, 30, 5]);\r\n\t}\r\n}\r\n\r\n\/\/ Jesse Troll?\r\nmodule originalTroll(stlPath)\r\n{\r\n translate([-20,-40,0])\r\n import(stlPath);\r\n}\r\n\r\n\/**\r\n * unionDifference: true gets union, false gets difference \r\n *\/\r\nmodule trollHead(stlPath)\r\n{\r\n difference()\r\n {\r\n intersection()\r\n {\r\n translate([0, 260, 0])\r\n originalTroll(stlPath);\r\n\r\n translate([22.5, 295, 133.7])\r\n sphere(r=70.4);\r\n }\r\n\r\n translate([23, 272, 54])\r\n sphere(r=20);\r\n \r\n translate([23, 310, 54])\r\n sphere(r=20);\r\n\r\n color(\"green\")\r\n translate([23, 280, 48])\r\n cube([20,25,20]);\r\n \r\n color(\"blue\")\r\n \r\n translate([23, 277, 51.5])\r\n rotate([-9, 0, 0]) \r\n cube([20,25,20]); \r\n }\r\n}\r\n\r\nmodule twoHeadedTroll(stlPath)\r\n{\r\n union()\r\n {\r\n s = 0.7;\r\n headScale = [s, s, s];\r\n headRotate = 9.8;\r\n \r\n headX = 10;\r\n rightHeadY = 285;\r\n headZ = 22;\r\n \r\n \/\/ left head\r\n color(\"yellow\")\r\n translate([headX, rightHeadY + 40, headZ+30])\r\n scale(headScale)\r\n rotate([-headRotate,-10,0])\r\n trollHead(stlPath);\r\n\r\n \/\/ right head\r\n color(\"red\")\r\n translate([headX, rightHeadY+20, headZ-33])\r\n scale(headScale)\r\n rotate([headRotate, -0, 0])\r\n trollHead(stlPath);\r\n \r\n twoHeadedTranslateY = 340;\r\n \r\n \/\/ neck part\r\n neckY = twoHeadedTranslateY + 183.5;\r\n neckRadius = headCutoutRadius - 9;\r\n translate([22, neckY-9, 68])\r\n\/\/ translate([23, neckY, 68])\r\n rotate([90,0,0])\r\n\/\/ cylinder(r=neckRadius, \r\n\/\/ h=22,\r\n\/\/ $fn=60);\r\n sphere(r=neckRadius + 7,\r\n $fn=80);\r\n\r\n \/\/ body\r\n \/\/ two headed troll\r\n twoHeadedTranslate = [0, twoHeadedTranslateY, 0];\r\n color(\"pink\")\r\n translate(twoHeadedTranslate)\r\n headlessTroll(stlPath);\r\n } \r\n}\r\n","old_contents":"\r\nheadCutoutRadius = 19;\r\n\r\nmodule headlessTroll(stlPath, cutHeight)\r\n{\r\n trollY = 140;\r\n difference()\r\n {\r\n translate([0, trollY, 0])\r\n originalTroll(stlPath);\r\n\r\n color(\"green\")\r\n translate([-17, 132, 58.5])\r\n headRemover();\r\n }\r\n}\r\n\r\nmodule headRemover()\r\n{\r\n difference()\r\n {\r\n cubeLengthX = 95; \r\n cube([cubeLengthX, 85, 70]);\r\n\r\n translate([40, 120, -3])\r\n rotate([90, 0, 0])\r\n cylinder(r=headCutoutRadius, \r\n h=129,\r\n $fn=60);\r\n }\r\n}\r\n\r\n\/\/ Jesse Troll?\r\nmodule originalTroll(stlPath)\r\n{\r\n translate([-20,-40,0])\r\n import(stlPath);\r\n}\r\n\r\n\/**\r\n * unionDifference: true gets union, false gets difference \r\n *\/\r\nmodule trollHead(stlPath)\r\n{\r\n difference()\r\n {\r\n intersection()\r\n {\r\n translate([0, 260, 0])\r\n originalTroll(stlPath);\r\n\r\n translate([22.5, 295, 133.7])\r\n sphere(r=70.4);\r\n }\r\n\r\n translate([23, 272, 54])\r\n sphere(r=20);\r\n \r\n translate([23, 310, 54])\r\n sphere(r=20);\r\n\r\n color(\"green\")\r\n translate([23, 280, 48])\r\n cube([20,25,20]);\r\n \r\n color(\"blue\")\r\n \r\n translate([23, 277, 51.5])\r\n rotate([-9, 0, 0]) \r\n cube([20,25,20]); \r\n }\r\n}\r\n\r\nmodule twoHeadedTroll(stlPath)\r\n{\r\n union()\r\n {\r\n s = 0.7;\r\n headScale = [s, s, s];\r\n headRotate = 9.8;\r\n \r\n headX = 10;\r\n rightHeadY = 285;\r\n headZ = 22;\r\n \r\n \/\/ left head\r\n color(\"yellow\")\r\n translate([headX, rightHeadY + 40, headZ+30])\r\n scale(headScale)\r\n rotate([-headRotate,-10,0])\r\n trollHead(stlPath);\r\n\r\n \/\/ right head\r\n color(\"red\")\r\n translate([headX, rightHeadY+20, headZ-33])\r\n scale(headScale)\r\n rotate([headRotate, -0, 0])\r\n trollHead(stlPath);\r\n \r\n twoHeadedTranslateY = 340;\r\n \r\n \/\/ neck part\r\n neckY = twoHeadedTranslateY + 183.5;\r\n neckRadius = headCutoutRadius - 9;\r\n translate([22, neckY-9, 68])\r\n\/\/ translate([23, neckY, 68])\r\n rotate([90,0,0])\r\n\/\/ cylinder(r=neckRadius, \r\n\/\/ h=22,\r\n\/\/ $fn=60);\r\n sphere(r=neckRadius + 7,\r\n $fn=80);\r\n\r\n \/\/ body\r\n \/\/ two headed troll\r\n twoHeadedTranslate = [0, twoHeadedTranslateY, 0];\r\n color(\"pink\")\r\n translate(twoHeadedTranslate)\r\n headlessTroll(stlPath);\r\n } \r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4c44cef75eb14be75b9f5b263ba3981731414706","subject":"added one more support element, for a print to look better","message":"added one more support element, for a print to look better\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"marker_holder\/marker_holder.scad","new_file":"marker_holder\/marker_holder.scad","new_contents":"holderDiameter = 25 + 2*1.5;\ncubeLen = 7+8\/2 + 2.5 + holderDiameter\/2;\n\ndifference()\n{\n union()\n {\n \/\/ mounting rod\n cube([7, 8, 20]);\n translate([7, 8\/2, 0])\n cylinder(r=8\/2, h=20, $fs=0.1);\n \n \/\/ connecting bar\n translate([0, 0, 20])\n cube([cubeLen, 8, 4]);\n translate([cubeLen-holderDiameter\/2, -holderDiameter\/2+8, 0])\n cube([holderDiameter\/2, holderDiameter\/2, 20+4]);\n \n \/\/ marker holder - main part\n translate([cubeLen, -holderDiameter\/2+8, 0])\n cylinder(r=(holderDiameter)\/2, h=50);\n }\n \/\/ marker holder drill\n translate([cubeLen, -holderDiameter\/2+8, 0])\n translate([0, 0, 1.5])\n cylinder(r=25\/2, h=50);\n}\n","old_contents":"holderDiameter = 25 + 2*1.5;\ncubeLen = 7+8\/2 + 0 + holderDiameter\/2;\n\ndifference()\n{\n union()\n {\n \/\/ mounting rod\n cube([7,8,20]);\n translate([7,8\/2,0])\n cylinder(r=8\/2, h=20, $fs=0.1);\n \n \/\/ connecting bar\n translate([0, 0, 20])\n cube([cubeLen, 8, 4]);\n \n \/\/ marker holder - main part\n translate([cubeLen, -holderDiameter\/2+8, 0])\n cylinder(r=(holderDiameter)\/2, h=50);\n }\n \/\/ marker holder drill\n translate([cubeLen, -holderDiameter\/2+8, 0])\n translate([0, 0, 1.5])\n cylinder(r=25\/2, h=50);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7ff3945ed081bf9789780994b3f7652a8e5e6047","subject":"shapes\/rcylindera: fix rounding always disabled","message":"shapes\/rcylindera: fix rounding always disabled\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=XAXIS, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, , extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\n\/*cubea(size=[10,20,30], align=[0,-1,0], orient=[0,0,1], roll=10, extra_roll=-30, extra_roll_orient=[1,0,0]);*\/\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n if($preview_mode || rounding_radius == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n }\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_radius=round_radius);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylindera(d, d1, d2, r, r1, r2, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n if($preview_mode || round_radius == 0 || true)\n {\n cylindera(d=d, d1=d1, d2=d2, r=r, r1=r1, r2=r2, h=h, align=align, orient=orient);\n }\n else\n {\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d\/2, d1_\/2]);\n r2_ = v_fallback(r2, [d\/2, d2_\/2]);\n\n r_ = [r1_,r2_];\n\n size_align(align=align, orient=orient)\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == undef ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=[0,0,1], align=[0,0,0]);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=[0,0,1]);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=[0,0,1]);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=[0,0,1], align=[0,0,0], $fn=fn);\n }\n else\n {\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=[0,0,0], orient=[0,1,0], roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=[0,0,1], roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n teardrop(r=r, h=20, orient=axis, align=axis);\n }\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n for(axis=concat(AXES,-AXES))\n \/*translate(axis)*\/\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cubea([w,w,h], orient=axis, align=axis*3);\n }\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=XAXIS, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=[0,0,1], align=[0,0,1]);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);\n }\n\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n \/*cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);*\/\n cylindera(h=20, r1=r, r2=r\/2, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=16, round_radius=2);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"18907c8fc04e84fbfb37cbb3b3289d3ece9e8d55","subject":"erector set","message":"erector set\n","repos":"JoeSuber\/QuickerPicker","old_file":"turner.scad","new_file":"turner.scad","new_contents":"\necho(\"turner.scad - small gears for runners and drive of big gear, with nut-d_shaft insert\");\necho(\".... uses stl import of 'whiskers_small.stl'\");\n\nmodule gearbear() {\n\tdifference(){\n\t\tcylinder(r=7.97\/2, h=7.1, center=false, $fn=24);\n\t\tcylinder(r=1.65, h=7.1, center=false, $fn=12);\n\t\ttranslate([0,0,0+7.1])\n\t\t\tcylinder(r=6.3\/2, h=5, center=true, $fn=6);\n\t}\n\trotate([180,0,0])\n\t\tdifference(){\n\t\ttranslate([0,-47.8,0]) \n\t\t\timport(\"whiskers_small.stl\");\n\t\n\t\tcylinder(r=1.65, h=18, center=true, $fn=12);\n\t\ttranslate([0,0,6]) \n\t\t\tcylinder(r=5.6\/2, h=2.2, center=true, $fn=16);\n\t\ttranslate([0,0,4.6]) \n\t\t\tcylinder(r1=1.5, r2=5.6\/2, h=1, center=true, $fn=16);\n\t\t}\n}\n\n\/\/ the little nubby insert for motor shaftage\nmodule d_shaft(hexplugD=6.0, hexplugH=4, shaftrad=1.69, fraction_cut=5){\n\tdifference(){\n\tcylinder(r=hexplugD\/2, h=hexplugH, center=false, $fn=6);\n\t\tdifference(){\n\t\t\ttranslate([0, 0, (hexplugH+.1)\/2])\n\t\t\t\tcylinder(r=shaftrad, h=hexplugH+.1, center=true, $fn=16);\n\t\t\ttranslate([shaftrad - shaftrad \/ fraction_cut, 0, (hexplugH+.15)\/2])\n\t\t\t\tcube([2*(shaftrad) \/ fraction_cut, hexplugD*.75, hexplugH+.15], center=true);\n\t\t}\n\t}\n}\n\nmodule armplate(midlen=16){\n difference(){\n linear_extrude(height=3, convexity=10){\n difference(){\n hull(){\n translate([-midlen,0,0])\n circle(r=6);\n translate([midlen,0,0])\n circle(r=6, $fn=16);\n }\n for (i=[2:midlen*2\/3:midlen*2-1]){\n translate([i - midlen, 0, 0]){ \n circle(r=1.66, $fn=16);\n }\n }\n \n }\n }\n for (i=[2:midlen*2\/3:midlen*2-1]){\n translate([i - midlen, 0, 1]) \n cylinder(r=6.3\/2, h=2.1, $fn=6);\n }\n }\n}\n\ntranslate([20,0,0]) rotate([0,0,90])\n armplate();\n\ntranslate([0,0,6])\n\tgearbear();\n\ntranslate([-20,0,6])\n\tgearbear();\n\ntranslate([-12,15,6])\n\tgearbear();\n\ntranslate([2,16,0])\n\td_shaft();\ntranslate([6,20,0])\n\td_shaft();\ntranslate([10,24,0])\n\td_shaft();\ntranslate([14,29,0])\n\td_shaft();\n","old_contents":"\necho(\"turner.scad - small gears for runners and drive of big gear, with nut-d_shaft insert\");\necho(\".... uses stl import of 'whiskers_small.stl'\");\n\nmodule gearbear() {\n\tdifference(){\n\t\tcylinder(r=7.97\/2, h=7.1, center=false, $fn=24);\n\t\tcylinder(r=1.65, h=7.1, center=false, $fn=12);\n\t\ttranslate([0,0,0+7.1])\n\t\t\tcylinder(r=6.3\/2, h=5, center=true, $fn=6);\n\t}\n\trotate([180,0,0])\n\t\tdifference(){\n\t\ttranslate([0,-47.8,0]) \n\t\t\timport(\"whiskers_small.stl\");\n\t\n\t\tcylinder(r=1.65, h=18, center=true, $fn=12);\n\t\ttranslate([0,0,5.5]) \n\t\t\tcylinder(r=5.5\/2, h=2.67, center=true, $fn=12);\n\t\t}\n}\n\n\/\/ the little nubby insert for motor shaftage\nmodule d_shaft(hexplugD=6.0, hexplugH=4, shaftrad=1.69, fraction_cut=5){\n\tdifference(){\n\tcylinder(r=hexplugD\/2, h=hexplugH, center=false, $fn=6);\n\t\tdifference(){\n\t\t\ttranslate([0, 0, (hexplugH+.1)\/2])\n\t\t\t\tcylinder(r=shaftrad, h=hexplugH+.1, center=true, $fn=16);\n\t\t\ttranslate([shaftrad - shaftrad \/ fraction_cut, 0, (hexplugH+.15)\/2])\n\t\t\t\tcube([2*(shaftrad) \/ fraction_cut, hexplugD*.75, hexplugH+.15], center=true);\n\t\t}\n\t}\n}\n\ntranslate([0,0,6])\n\tgearbear();\n\ntranslate([-20,0,6])\n\tgearbear();\n\ntranslate([-12,15,6])\n\tgearbear();\n\ntranslate([0,15,0])\n\td_shaft();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"38691b7468859629ce7d7eb5ecbfd2c7b3bdc192","subject":"cable guide is now a larger hole","message":"cable guide is now a larger hole\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/cable_guide.scad","new_file":"lcd_case_for_prusa_i3\/cable_guide.scad","new_contents":"module cableGuide()\n{\n hull()\n {\n \/\/ upper baund\n translate([0, 20, 0])\n cube([75, 1, 6+7]);\n \/\/ lower baund\n cube([60, 1, 6+7]);\n }\n}\n\ncableGuide();","old_contents":"module cableGuide()\n{\n hull()\n {\n \/\/ upper baund\n translate([0, 20, 0])\n cube([75, 1, 6+7]);\n \/\/ lower baund\n translate([(75-40)\/2, 0, 0])\n cube([40, 1, 6+7]);\n }\n}\n\ncableGuide();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bbb3b056d20ba310e754424fc7eb8fa12808d0d6","subject":"Update proMiniClip overhang","message":"Update proMiniClip overhang\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/ProMiniClip.scad","new_file":"hardware\/printedparts\/ProMiniClip.scad","new_contents":"module ProMiniClip_STL()\n{\n\tprintedPart(\"printedparts\/ProMiniClip.scad\", \"Pro Mini Clip\", \"ProMiniClip_STL()\") {\n\n\t\tview(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Con_Default);\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"ProMiniClip.stl\"));\n\t\t\t} else {\n\t\t\t\tProMiniClipModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule ProMiniClipModel()\n{\n\tProMini_Width = 18 + 0.5; \/\/ +0.5 tolerance (note this doesn't currently agree with the dimensions in the vitamin)\n\tProMini_BoardHeight = 3.5; \/\/ PCB thickness including room for solder pads to stick out underneath\n\n\tclip = 1.5; \/\/ How much the clip protrudes to hold the board\n\n\trotate([90, 0, 0])\n\ttranslate([0, 0, -2.5]) {\n\n\t\tpintack(side=true, h=2.25 + 3, bh=0);\n\n\t\tlinear_extrude(5)\n\t\ttranslate([0, -(2Perim + ProMini_BoardHeight + 2Perim)\/2, 0])\n\t\tdifference() {\n\t\t\tsquare([ProMini_Width + 4Perim, 2Perim + ProMini_BoardHeight + 2Perim], center=true);\n\n\t\t\ttranslate([0, -(2Perim - 2Perim)\/2, 0])\n\t\t\t\tsquare([ProMini_Width, ProMini_BoardHeight], center=true);\n\t\t\ttranslate([0, -(2Perim)\/2, 0])\n\t\t\t\tsquare([ProMini_Width-clip, ProMini_BoardHeight+2Perim], center=true);\n\t\t}\n\t}\n}\n","old_contents":"module ProMiniClip_STL()\n{\n\tprintedPart(\"printedparts\/ProMiniClip.scad\", \"Pro Mini Clip\", \"ProMiniClip_STL()\") {\n\t\t\n\t\tview(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Con_Default);\n\n\t\tcolor(Level2PlasticColor) {\n\t\t\tif (UseSTL) {\n\t\t\t\timport(str(STLPath, \"ProMiniClip.stl\"));\n\t\t\t} else {\n\t\t\t\tProMiniClipModel();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule ProMiniClipModel()\n{\n\tProMini_Width = 18 + 0.5; \/\/ +0.5 tolerance (note this doesn't currently agree with the dimensions in the vitamin)\n\tProMini_BoardHeight = 3.5; \/\/ PCB thickness including room for solder pads to stick out underneath\n\n\tclip = 0.8; \/\/ How much the clip protrudes to hold the board\n\n\trotate([90, 0, 0])\n\ttranslate([0, 0, -2.5]) {\n\n\t\tpintack(side=true, h=2.25 + 3, bh=0);\n\n\t\tlinear_extrude(5)\n\t\ttranslate([0, -(2Perim + ProMini_BoardHeight + 2Perim)\/2, 0])\n\t\tdifference() {\n\t\t\tsquare([ProMini_Width + 4Perim, 2Perim + ProMini_BoardHeight + 2Perim], center=true);\n\t\n\t\t\ttranslate([0, -(2Perim - 2Perim)\/2, 0])\n\t\t\t\tsquare([ProMini_Width, ProMini_BoardHeight], center=true);\n\t\t\ttranslate([0, -(2Perim)\/2, 0])\n\t\t\t\tsquare([ProMini_Width-clip, ProMini_BoardHeight+2Perim], center=true);\n\t\t}\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"51ec7fbae1a800d7e2616a0b9ee102e7ffd6f910","subject":"Added mock battery and mcu","message":"Added mock battery and mcu\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"hardware\/mk1\/assembly.scad","new_file":"hardware\/mk1\/assembly.scad","new_contents":"include ;\n\nuse ;\nuse ;\nuse ;\ninclude ;\ninclude ;\ninclude ;\n\nbb_length=90;\nbb_height = 8;\n\nservo_length = 23;\nservo_width = 12.5;\n\nh_pos = (bb_length-20)\/2;\n\n\/\/tibia2();\n\/\/femur();\n\/\/mirror([1,0,0]) coxa();\n\n\/\/ wheel mode\nfinalAssembly(0, -130, 130);\n\n\/\/ walking mode\ntranslate([0, 300, 28])\n\tfinalAssembly(45, 0, -20);\n\nmodule finalAssembly(coxa_rot_angle, femur_angle, tibia_angle) {\n\n\t\t\/\/ battery - modelled on a zippy 850mah 2s lipo\n\t\tcolor(\"yellow\")\n\t\t\ttranslate([-28,-15,-20])\n\t\t\tcube([56,30,14]);\n\n\t\t\/\/ APM2.5\n\t\tcolor(\"grey\")\n\t\t\ttranslate([-33,-21,6])\n\t\t\tcube([66, 42, 10]);\n\n\t\tbackbone();\n\n\t\tfor ( i = [1, -1]){\n\t\t\ttranslate([0,i*h_pos,(bb_height\/2)])\n\t\t\t\thip(servo_length,servo_width);\n\n\t\t\tfor (j = [1, -1]) {\n\t\t\t\ttranslate([j*22.5,i*h_pos,8]) {\n\t\t\t\t\trotate([0,0,j*-90]) color(\"blue\") servo();\n\n\t\t\t\t\ttranslate([j*-.5,0,-2.5]) rotate([90,0,i*j*coxa_rot_angle]) {\n\t\t\t\t\t\tscale([j*1,1,i*-1]) coxa();\n\t\t\t\t\t\ttranslate([j*26.5,6,0]) rotate([0,90 + i*90,0]) {\n\t\t\t\t\t\t\tcolor(\"blue\") servo();\n\t\t\t\t\t\t\ttranslate([0,0,11]) scale([j*i,1,1]) rotate([0,0,180 + femur_angle]) {\n\t\t\t\t\t\t\t\tfemur();\n\t\t\t\t\t\t\t\ttranslate([40, 0, -11]) rotate([0, 0, 90 + tibia_angle]) {\n\t\t\t\t\t\t\t\t\tcolor(\"blue\") servo();\n\t\t\t\t\t\t\t\t\ttranslate([0, -22, -4]) rotate([0, 0, -90]) tibia2();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n","old_contents":"include ;\n\nuse ;\nuse ;\nuse ;\ninclude ;\ninclude ;\ninclude ;\n\nbb_length=90;\nbb_height = 8;\n\nservo_length = 23;\nservo_width = 12.5;\n\nwheel = true; \/\/ true to show in wheel configuration, false for walking config\n\ncoxa_rot_ang = wheel ? 0 : 30;\nfemur_ang = wheel ? -130 : 0;\ntibia_ang = wheel ? 130 : -20;\n\nh_pos = (bb_length-20)\/2;\n\n\/\/tibia2();\n\/\/femur();\n\/\/mirror([1,0,0]) coxa();\n\n\/\/ wheel mode\nfinalAssembly(0, -130, 130);\n\n\/\/ walking mode\ntranslate([0, 300, 28])\n\tfinalAssembly(30, 0, -20);\n\nmodule finalAssembly(coxa_rot_angle, femur_angle, tibia_angle) {\n\t\t\/\/full assembly example\n\t\tbackbone();\n\n\t\tfor ( i = [1, -1]){\n\t\t\ttranslate([0,i*h_pos,(bb_height\/2)])\n\t\t\t\thip(servo_length,servo_width);\n\n\t\t\tfor (j = [1, -1]) {\n\t\t\t\ttranslate([j*22.5,i*h_pos,8]) {\n\t\t\t\t\trotate([0,0,j*-90]) color(\"blue\") servo();\n\n\t\t\t\t\ttranslate([j*-.5,0,-2.5]) rotate([90,0,i*j*coxa_rot_angle]) {\n\t\t\t\t\t\tscale([j*1,1,i*-1]) coxa();\n\t\t\t\t\t\ttranslate([j*26.5,6,0]) rotate([0,90 + i*90,0]) {\n\t\t\t\t\t\t\tcolor(\"blue\") servo();\n\t\t\t\t\t\t\ttranslate([0,0,11]) scale([j*i,1,1]) rotate([0,0,180 + femur_angle]) {\n\t\t\t\t\t\t\t\tfemur();\n\t\t\t\t\t\t\t\ttranslate([40, 0, -11]) rotate([0, 0, 90 + tibia_angle]) {\n\t\t\t\t\t\t\t\t\tcolor(\"blue\") servo();\n\t\t\t\t\t\t\t\t\ttranslate([0, -22, -4]) rotate([0, 0, -90]) tibia2();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f1ceab0d7755c4b0285e90fb7d441a1f34bce887","subject":"Updated captive nut to give an overlap","message":"Updated captive nut to give an overlap\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\", \\n\n cutouts = \",cutouts,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness=3.1, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts\n );\n}\n\nmodule lasercutout(thickness=3.1, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x) ;\n } \n \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n \n }\n \n if ($children) translate([0, max_y(points) + thickness*3, 0])\n children();\n\n if (generate == 1)\n {\n output = str(\n \"[LC] lasercutout(thickness=\", thickness, \", \\n \n points= \", points, \", \\n\n simple_tabs = \",simple_tabs,\", \\n\n simple_tab_holes = \",simple_tab_holes,\", \\n\n captive_nuts = \",captive_nuts,\", \\n\n captive_nut_holes = \",captive_nut_holes,\", \\n\n finger_joints = \",finger_joints,\", \\n\n circles_add = \",circles_add,\", \\n\n circles_remove = \",circles_remove,\", \\n\n slits = \",slits,\", \\n\n cutouts = \",cutouts,\") \\n\"\n );\n echo(output);\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y);\n }\n\n}\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y)\n{\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( i = [range_min : (range_max-range_min)\/fingers : range_max - (range_max-range_min)\/fingers] )\n {\n if(start_up == 1) \n {\n translate([i,0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2),0,0]) cube([ (range_max-range_min)\/(fingers*2), thickness*2, thickness]);\n \n }\n }\n }\n\n}\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,0,0]) cube([thickness*3, thickness, thickness]); \n translate([-thickness\/2-thickness*4,0,0]) cube([thickness*3, thickness, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness = 3.1, x=0, y=0, z=0, sides=6,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n)\n{\n if (sides==4)\n {\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 0, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 1, 4], [DOWN, 1, 4], [LEFT, 1, 4], [RIGHT, 0, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n [ [UP, 0, 4], [DOWN, 1, 4], [LEFT, 0, 4], [RIGHT, 1, 4] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a);\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness = 3.1, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [])\n{\n translate([0,0,0]) lasercutoutSquare(x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0]);\n\n translate([0,0,z+thickness]) lasercutoutSquare(x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1]);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2]);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3]);\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5]);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"0a765fa786157e155367e770d8f949a0c071eedb","subject":"SD card reader and reset button","message":"SD card reader and reset button\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \n\n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n menuKnob();\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n resetButton();\n }\n\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2, boxSize[2]-(6+7)];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15+5, 0, 0])\n cube([143-(15+5), 53, 6]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n menuKnob();\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dc83f3379c038ed2c5cc8b2526f4a6d4b69dd554","subject":"add ankle bracelet","message":"add ankle bracelet\n","repos":"tarned\/r2d2,tarned\/r2d2","old_file":"cad\/ankle_bracelet\/ankle_bracelet.scad","new_file":"cad\/ankle_bracelet\/ankle_bracelet.scad","new_contents":"\/\/ measures are in mm \n\/\/ copied and adapted from the blueprints of CS:R from R2 Builders Club\n\nh = 2.5;\n\nmodule triangle(l, w, h) {\n\tCubePoints = [\n\t\t[0, 0, 0], \/\/ 0\n\t\t[l, 0, 0], \/\/ 1\n\t\t[l, w, 0], \/\/ 2\n\t\t[0, 0, h], \/\/ 3\n\t\t[l, 0, h], \/\/ 4\n\t\t[l, w, h], \/\/ 5\n\t];\n\n\tCubeFaces = [\n\t\t[0, 1, 2], \/\/ bottom\n\t\t[0, 3, 4, 1], \/\/ front\n\t\t[5, 4, 3], \/\/ top\n\t\t[1, 4, 5, 2], \/\/ right\n\t\t[2, 5, 3, 0], \/\/ back, left\n\t]; \/\/ left\n\n\tpolyhedron(CubePoints, CubeFaces);\n}\n\nmodule the_triangle() {\n\ttranslate([-64.5\/2, 4.3+35+17.7-0.02, 0])\n\ttriangle(64.5\/2-8.7\/2, 7, h);\n}\n\nmodule outer() {\n\tintersection() {\n\t\ttranslate([-107.5\/2,0,0])\n\t\tcube(size=[107.5,76.5,h]);\n\n\t\tcylinder(h, 77, 77);\n\t}\n}\n\nmodule inner() {\n\ttranslate([0, 62, 0])\n\tcylinder(h, 8.7, 8.7);\n\n\ttranslate([-87\/2, 4.3, 0])\n\tcube(size=[87, 35, h]);\n\n\ttranslate([-64.5\/2, 4.3+35-0.01, 0])\n\tcube(size=[64.5, 17.7, h]);\n\n\tthe_triangle();\n\tmirror([1, 0, 0])\n\tthe_triangle();\n}\n\nmodule all() {\n\tdifference() {\n\t\touter();\n\n\t\ttranslate([0, 0, -h\/2])\n\t\tscale([1, 1, 2])\n\t\tinner();\n\t}\n}\n\nall();","old_contents":"","returncode":1,"stderr":"error: pathspec 'cad\/ankle_bracelet\/ankle_bracelet.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"41d6a77d2f3dcf706ac38977390945055cc24b9f","subject":"The variables were prepared a little for Thingiverse Customizer.","message":"The variables were prepared a little for Thingiverse Customizer.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_file":"OpenSCAD\/src\/main\/openscad\/toys\/fidget-spinner\/fidget-spinner.scad","new_contents":"\r\n\/\/ preview[view:south, tilt:top]\r\n\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\/adafruit\/fidget-spinner\/ada-spinner-flat.scad>\r\nuse <..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/time-bandits\/fidget-outline.scad> \r\nuse <..\/..\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>;\r\nuse <..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\r\nuse <..\/..\/external-resources\/star-trek\/logo\/star-trek-logo.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/pacman\/pacman.scad> \r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\r\ncutoutName = \"Star\"; \/\/ [Adafruit, Aqua Dude, Bat, Clover, Fidget (Time Bandits), Heart, Pacman, OSHW, Rebel Alliance, Spur, Star, Star Trek]\r\n\r\ncutoutHolderType = \"Knurl\"; \/\/ [Cylinder, Knurl]\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 3; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/* [Hidden] *\/\r\n\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/Allocate coin data\r\n\r\n\/\/ !!!!!to make the spoke count this is needed, so far. or maybe not!!!!\r\n\/\/coinName = coin == 1 ? \"AU $2\" :\r\n\/\/ (coin == 2 ? \"AU 5c\" :\r\n\/\/ (coin == 3 ? \"US 10c\" :\r\n\/\/ (coin == 4 ? \"UK \u00a31\" :\r\n\/\/ (coin == 5 ? \"UK 5p\" :\r\n\/\/ (coin == 6 ? \"EU \u20ac1\" :\r\n\/\/ (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule cutout()\r\n{\r\n if(cutoutName == \"Adafruit\")\r\n {\r\n scale([0.3, 0.3, 5])\r\n AdaSpinnerFlat_001();\r\n }\r\n if(cutoutName == \"Aqua Dude\")\r\n {\r\n aquamanThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Bat\")\r\n {\r\n translate([0, 0, 4])\r\n scale([1, 1, 4])\r\n batmanLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Clover\")\r\n {\r\n translate([0, 0, -1])\r\n cloverThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Fidget (Time Bandits)\")\r\n {\r\n fidgetOutlineThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Heart\")\r\n {\r\n heartThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Rebel Alliance\")\r\n {\r\n rebelAllianceThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"OSHW\")\r\n {\r\n translate(0,0,10)\r\n scale([1, 1, 17])\r\n oshwLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Pacman\")\r\n {\r\n translate([0, 0, 8])\r\n pacmanThumbnail(height = 15);\r\n }\r\n else if(cutoutName == \"Spur\")\r\n {\r\n scale([0.17, 0.17, 1])\r\n spur(height = 10);\r\n }\r\n else if(cutoutName == \"Star\")\r\n {\r\n \tstarThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Star Trek\")\r\n {\r\n xyScale = 0.35;\r\n \r\n scale([xyScale, xyScale, 1])\r\n Star_Trek_Logo_Blank_fixed();\r\n }\r\n}\r\n\r\nmodule cutoutHolder()\r\n{\r\n if(cutoutHolderType == \"Cylinder\")\r\n {\r\n cylinder(h=holder_z, d=holder_d);\r\n }\r\n else if( cutoutHolderType == \"Knurl\")\r\n {\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n }\r\n else\r\n {\r\n \/\/ Rounded Cylinder\r\n }\r\n}\r\n\r\nmodule dollarHolder() \r\n{\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() \r\n {\r\n \/\/ TODO: this next item looks like where the knurl can be swapped out for\r\n \/\/ a regular cylinder or rounded cylinder.\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n cutoutHolder();\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n cutout();\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalize\r\n\r\nmodule plus() \r\n{\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() \r\n{\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() \r\n{\r\n plus();\r\n minus();\r\n}","old_contents":"\r\n\/**\r\n * This script renders onebeartoe Fidget Spinners!\r\n * \r\n * Author: Roberto Marquez\r\n * \r\n * https:\/\/plus.google.com\/u\/0\/104101484714566033177\r\n * https:\/\/twitter.com\/onebeartoe\r\n * https:\/\/www.youtube.com\/user\/onebeartoe\/videos\r\n * \r\n * Originally from: http:\/\/www.thingiverse.com\/thing:1937473 \r\n * Original Author: Geoff Buttsworth\r\n * Original Filename: moneySpinner02\r\n * Borrowed from Version: 0.5\r\n * Twitter: @gbutts9\r\n * \r\n * This version is designed to work with the Thingiverse Customizer.\r\n * Ref: http:\/\/customizer.makerbot.com\/docs\r\n *\/\r\n\r\nuse <..\/..\/external-resources\/adafruit\/fidget-spinner\/ada-spinner-flat.scad>\r\nuse <..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/time-bandits\/fidget-outline.scad> \r\nuse <..\/..\/external-resources\/knurled-surface\/aubenc\/knurledFinishLib_v2.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>;\r\nuse <..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\r\nuse <..\/..\/external-resources\/star-trek\/logo\/star-trek-logo.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/pacman\/pacman.scad> \r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>;\r\n\r\n\/* [Spinner_Parameters] *\/\r\n\/\/Which coin do you want to use?\r\ncoin_list = 8; \/\/[1:AU $2,2:AU 5c,3:US 10c,4:UK \u00a31,5:UK 5p,6:EU \u20ac1,7:QA 0.5QAR,8:US 5c]\r\ncoin = coin_list;\r\n\r\ncutoutName = \"Star\"; \/\/ [Adafruit, Aqua Dude, Bat, Clover, Fidget (Time Bandits), Heart, Pacman, OSHW, Rebel Alliance, Spur, Star, Star Trek]\r\n\r\ncutoutHolderType = \"Knurl\"; \/\/ [Cylinder, Knurl]\r\n\r\n\/\/How many spokes should the spinner have?\r\nNumber_of_Spokes = 3; \/\/[2,3,4,5,6,7]\r\nspokeNumber = Number_of_Spokes;\r\n\r\n\/\/Flush for easier printing \r\nFlush_or_Raised_Hub = 1; \/\/[0:Hub,1:Flush]\r\nflush = Flush_or_Raised_Hub; \/\/Flush is easier to print, the hub is height of bearing and may print with support\r\n\r\n\/\/Allocate coin data\r\n\r\n\/\/ !!!!!to make the spoke count this is needed, so far. or maybe not!!!!\r\n\/\/coinName = coin == 1 ? \"AU $2\" :\r\n\/\/ (coin == 2 ? \"AU 5c\" :\r\n\/\/ (coin == 3 ? \"US 10c\" :\r\n\/\/ (coin == 4 ? \"UK \u00a31\" :\r\n\/\/ (coin == 5 ? \"UK 5p\" :\r\n\/\/ (coin == 6 ? \"EU \u20ac1\" :\r\n\/\/ (coin == 7 ? \"QA 0.5QAR\" : \"US 5c\")\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ )\r\n\/\/ );\r\n\r\ncoin_d = coin == 1 ? 20.5 :\r\n (coin == 2 ? 19.4 :\r\n (coin == 3 ? 17.9 :\r\n (coin == 4 ? 22.5 :\r\n (coin == 5 ? 18.0 :\r\n (coin == 6 ? 23.3 :\r\n (coin == 7 ? 25.0 : 21.3)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\ncoin_z = coin == 1 ? 2.8 :\r\n (coin == 2 ? 1.3 :\r\n (coin == 3 ? 1.35 :\r\n (coin == 4 ? 3.15 :\r\n (coin == 5 ? 1.8 :\r\n (coin == 6 ? 2.35 :\r\n (coin == 7 ? 1.78 : 1.95)\r\n )\r\n )\r\n )\r\n )\r\n );\r\n\r\nstack = coin == 2 ? 3 :\r\n (coin == 3 ? 3 :\r\n (coin == 5 ? 3 :\r\n (coin == 7 ? 3 :\r\n (coin == 8 ? 4 : 2)\r\n )\r\n )\r\n );\r\n\r\n\/\/Default values\r\n$fa = 0.8;\r\n$fs = 0.8;\r\n\r\n\/\/Variables:\r\n\r\nrim = 5;\r\nholder_d = coin_d + rim;\r\nholder_z = coin_z*stack;\r\n\r\nbrg_d = 22.0;\r\nbrg_z = 7.0;\r\n\r\nspoke_x = coin_d \/ 2;\r\nspoke_y = coin_d \/ 3;\r\nspoke_z = holder_z;\r\n\r\n\/\/If flush: hub will be height of coin stack otherwise height of bearing\r\nhub_z = flush == 1 ? coin_z*stack : brg_z;\r\n\r\n\/\/SpinnerModules\r\n\r\nmodule cutout()\r\n{\r\n if(cutoutName == \"Adafruit\")\r\n {\r\n scale([0.3, 0.3, 5])\r\n AdaSpinnerFlat_001();\r\n }\r\n if(cutoutName == \"Aqua Dude\")\r\n {\r\n aquamanThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Bat\")\r\n {\r\n translate([0, 0, 4])\r\n scale([1, 1, 4])\r\n batmanLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Clover\")\r\n {\r\n translate([0, 0, -1])\r\n cloverThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Fidget (Time Bandits)\")\r\n {\r\n fidgetOutlineThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Heart\")\r\n {\r\n heartThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"Rebel Alliance\")\r\n {\r\n rebelAllianceThumbnail(height=10);\r\n }\r\n else if(cutoutName == \"OSHW\")\r\n {\r\n translate(0,0,10)\r\n scale([1, 1, 17])\r\n oshwLogoThumbnail();\r\n }\r\n else if(cutoutName == \"Pacman\")\r\n {\r\n translate([0, 0, 8])\r\n pacmanThumbnail(height = 15);\r\n }\r\n else if(cutoutName == \"Spur\")\r\n {\r\n scale([0.17, 0.17, 1])\r\n spur(height = 10);\r\n }\r\n else if(cutoutName == \"Star\")\r\n {\r\n \tstarThumbnail(height = 10);\r\n }\r\n else if(cutoutName == \"Star Trek\")\r\n {\r\n xyScale = 0.35;\r\n \r\n scale([xyScale, xyScale, 1])\r\n Star_Trek_Logo_Blank_fixed();\r\n }\r\n}\r\n\r\nmodule cutoutHolder()\r\n{\r\n if(cutoutHolderType == \"Cylinder\")\r\n {\r\n cylinder(h=holder_z, d=holder_d);\r\n }\r\n else if( cutoutHolderType == \"Knurl\")\r\n {\r\n knurl(k_cyl_hg = holder_z, k_cyl_od = holder_d);\r\n }\r\n else\r\n {\r\n \/\/ Rounded Cylinder\r\n }\r\n}\r\n\r\nmodule dollarHolder() \r\n{\r\n translate([0, coin_d \/ 2 + spoke_y, 0])\r\n difference() \r\n {\r\n \/\/ TODO: this next item looks like where the knurl can be swapped out for\r\n \/\/ a regular cylinder or rounded cylinder.\r\n translate([0, 0, -coin_z * stack \/ 2])\r\n cutoutHolder();\r\n\r\n xyScale = 0.75;\r\n translate([0, 0, -5])\r\n scale([xyScale, xyScale, 1])\r\n cutout();\r\n }\r\n}\r\n\r\nmodule hub() {\r\n cylinder(h = hub_z, d = brg_d + rim, center = true);\r\n}\r\n\r\nmodule spoke() {\r\n translate([0, spoke_y \/ 2, 0])\r\n cube([spoke_x, spoke_y, spoke_z], center = true);\r\n}\r\n\r\nmodule brgVoid() {\r\n cylinder(h = brg_z + 2, d = brg_d, center = true);\r\n}\r\n\r\nmodule holderSpoke() {\r\n\r\n translate([0, brg_d \/ 2, 0])\r\n union() {\r\n dollarHolder();\r\n spoke();\r\n }\r\n}\r\n\r\n\/\/Rotate\r\nrA = 360 \/ spokeNumber; \/\/rotational angle\r\nfA = round(360 - rA); \/\/final angle\r\n\r\nmodule spinner() {\r\n for (i = [0 : rA : fA]) {\r\n rotate([0, 0, i])\r\n holderSpoke();\r\n }\r\n}\r\n\r\n\/\/Finalize\r\n\r\nmodule plus() \r\n{\r\n hub();\r\n spinner();\r\n}\r\n\r\nmodule minus() \r\n{\r\n brgVoid();\r\n}\r\n\r\n\/\/Render\r\n\r\ndifference() \r\n{\r\n plus();\r\n minus();\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8c959880c1d91966a98e4f96cbd8b6ec76fdd68f","subject":"Version 2 of the GJB marker designed by Keya","message":"Version 2 of the GJB marker designed by Keya\n\nThis one is a complete rectangular hole shape, not a c shape\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/marker-thing\/marker_thing.scad","new_file":"openscad\/marker-thing\/marker_thing.scad","new_contents":"use <..\/common\/extrusions.scad>\nLARGE = 100;\n\nmodule marker_thing() {\n w = 4.5*25.4;\n thick = 3;\n d = 2*25.4;\n h = 2*25.4;\n ri = 3;\n ro = 1;\n \n O_channel(\n w+2*thick, h+thick, \n w, LARGE, \n thick, thick, ro, ri, d);\n \/\/cube([w, d, h]);\n}\n\nmodule marker_thing2() {\n w = 4*25.4;\n thick = 3;\n d = 2*25.4;\n h = 4*25.4;\n ri = 3;\n ro = 1;\n \n O_channel(\n w+2*thick, h+2*thick, \n w, h, \n thick, thick, ro, ri, d);\n \/\/cube([w, d, h]);\n}\n\n\n\nmarker_thing2();","old_contents":"use <..\/common\/extrusions.scad>\nLARGE = 100;\n\nmodule marker_thing() {\n w = 4.5*25.4;\n thick = 3;\n d = 2*25.4;\n h = 2*25.4;\n ri = 3;\n ro = 1;\n \n O_channel(\n w+2*thick, h+thick, \n w, LARGE, \n thick, thick, ro, ri, d);\n \/\/cube([w, d, h]);\n}\n\n\n\nmarker_thing();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"a77d066277627a636e9644a2ace9134a38bb880d","subject":"misc: remove assert (now supported by openscad!)","message":"misc: remove assert (now supported by openscad!)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"521d75249b5471c07eef8c05746dcfa04e66ddde","subject":"spoke prototype complete","message":"spoke prototype complete\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2, 0, 0])\n latch_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength * 1.2, 0, 0])\n rotate([0, 0, 90])\n encoder();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n \/\/string();\n \n}\n\nspoke_lid();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\n OLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"66736393eea9ea3b4b1f264ac1440d14b70a8b6c","subject":"Fix issue with array of strings in flatten()","message":"Fix issue with array of strings in flatten()\n","repos":"jsconan\/camelSCAD","old_file":"core\/list.scad","new_file":"core\/list.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Operations on lists.\r\n *\r\n * @package core\/list\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Fills an array with a value upon the requested length.\r\n *\r\n * @param * value - The value to fill with. Can be of any type.\r\n * @param Number length - The length of the array to fill.\r\n * @returns Array\r\n *\/\r\nfunction fill(value, length) =\r\n let( length = float(length) )\r\n length > 0 ? [ for (i = [0 : length - 1]) value ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Fills an array with a range of values.\r\n *\r\n * @param Number start - The start of the range, or the length of the range\r\n * @param Number [end] - The end of the range.\r\n * @param Number [step] - The range increment.\r\n * @returns Array\r\n *\/\r\nfunction range(start, end, step) =\r\n let(\r\n s = float(start),\r\n simple = s && isUndef(end),\r\n start = simple ? 0 : s,\r\n end = simple ? s : float(end),\r\n step = or(number(step), start > end ? -1 : 1)\r\n )\r\n start || end ? [ for (i = [start : step : end]) i ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Returns a list range with the ideal step to cover this range by the required count.\r\n *\r\n * @param Number start - The start of the range.\r\n * @param Number count - The number of steps to cover the range.\r\n * @param Number end - The end of the range.\r\n * @returns Number\r\n *\/\r\nfunction steps(start, count, end) =\r\n let(\r\n start = float(start),\r\n end = float(end),\r\n step = (end - start) \/ divisor(float(count) - 1)\r\n )\r\n [ start : step : end ]\r\n;\r\n\r\n\/**\r\n * Reverses an array.\r\n *\r\n * @param Array collection - The array to reverse.\r\n * @returns Array\r\n *\/\r\nfunction reverse(collection) =\r\n let( collection = arrayOr(collection, []) )\r\n [ for (i = [len(collection) - 1 : -1 : 0]) collection[i] ]\r\n;\r\n\r\n\/**\r\n * Flattens a multi level array to a less deep array.\r\n *\r\n * @param Array collection - The array to flatten.\r\n * @returns Array\r\n *\/\r\nfunction flatten(collection) = [ for (a = arrayOr(collection, [])) for (b = isString(a) ? [a] : a) b ];\r\n\r\n\/**\r\n * Finds the index of a key in a collection.\r\n *\r\n * @param Array collection - The collection in which search.\r\n * @param * key - The key to search in the collection.\r\n * @returns Number - The position of the key in the collection, or -1 if not found.\r\n *\/\r\nfunction find(collection, key) = numberOr(search([key], collection)[0], -1);\n\r\n\/**\r\n * Fetches a record from a collection with respect to the provided key.\r\n *\r\n * @param Array collection - The collection in which search.\r\n * @param * key - The key for which fetch the record.\r\n * @returns * - The record that relates to the key, or undef if not found.\r\n *\/\r\nfunction fetch(collection, key) = collection[find(collection, key)];\r\n\r\n\/**\r\n * Checks if an element exists in an array.\r\n *\r\n * @param Array collection - The collection from which search the element.\r\n * @param * elem - The element to search.\r\n * @returns Boolean\r\n *\/\r\nfunction inArray(collection, elem) = find(collection, elem) > -1;\r\n\r\n\/**\r\n * Completes a list with start and end elements, at the condition there are not aleady present.\r\n *\r\n * @param Array collection - The list to complete.\r\n * @param * start - The start element to add.\r\n * @param * end - The end element to add.\r\n * @returns Array\r\n *\/\r\nfunction complete(collection, start, end) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n first = start && start != collection[0] && start != collection[len(collection) - 1] ? concat([start], collection) : collection,\r\n second = end && end != first[0] && end != first[len(first) - 1] ? concat(first, [end]) : first\r\n )\r\n second\r\n;\r\n\r\n\/**\r\n * Gets an array slice.\r\n *\r\n * @param Array collection - The collection to slice.\r\n * @param Number [start] - The start index of the slice. If negative, will start from the end.\r\n * @param Number [end] - The end index of the slice, exclusive.\r\n * @returns Array\r\n *\/\r\nfunction slice(collection, start, end) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n length = len(collection),\r\n start = start < 0 ? max(0, length + start) : integer(start),\r\n end = (end < 0 ? max(start, length + end) : numberOr(end, length)) - 1\r\n )\r\n length && start <= end ? [ for (i = [start : end]) if (i < length) collection[i] ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Changes the contents of an array by removing existing elements and\/or adding new elements.\r\n *\r\n * @param Array collection - The collection to slice.\r\n * @param Number [start] - The index at which to start changing the array. If negative, will start from the end.\r\n * @param Number [remove] - The number of elements to remove.\r\n * @param Array [elems] - The elements to add to the array, beginning at the start index.\r\n * @returns Array\r\n *\/\r\nfunction splice(collection, start, remove, elems) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n elems = arrayOr(elems, []),\r\n length = len(collection),\r\n start = min(start < 0 ? max(0, length + start) : integer(start), length),\r\n next = start + numberOr(remove, length - start),\r\n last = length - 1\r\n )\r\n length || len(elems)\r\n ?concat(\r\n length && start > 0 ? [ for (i = [0 : start - 1]) collection[i] ] : [],\r\n elems,\r\n length && next <= last ? [ for (i = [next : last]) collection[i] ] : []\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Gets the N first elements of an array.\r\n *\r\n * @param Array collection - The collection from which get the elements.\r\n * @param Number [count] - The number of elements to get.\r\n * @returns Array|*\r\n *\/\r\nfunction first(collection, count) =\r\n let( count = numberOr(count, 1) )\r\n count > 1 ? slice(collection, 0, count)\r\n : arrayOr(collection, [])[0]\r\n;\r\n\r\n\/**\r\n * Gets the N last elements of an array.\r\n *\r\n * @param Array collection - The collection from which get the elements.\r\n * @param Number [count] - The number of elements to get.\r\n * @returns *\r\n *\/\r\nfunction last(collection, count) =\r\n let( count = numberOr(count, 1) )\r\n count > 1 ? slice(collection, -count)\r\n : arrayOr(collection, [])[len(collection) - 1]\r\n;\r\n\r\n\/**\r\n * Removes the last element of an array.\r\n *\r\n * @param Array collection - The collection from which removes the element.\r\n * @returns Array\r\n *\/\r\nfunction pop(collection) = slice(collection, end=-1);\r\n\r\n\/**\r\n * Removes the first element of an array.\r\n *\r\n * @param Array collection - The collection from which removes the element.\r\n * @returns Array\r\n *\/\r\nfunction shift(collection) = slice(collection, 1);\r\n\r\n\/**\r\n * Adds an element at the end of an array.\r\n *\r\n * @param Array collection - The collection to which add the element.\r\n * @param * elem - The element to add.\r\n * @returns Array\r\n *\/\r\nfunction push(collection, elem) = concat(arrayOr(collection, []), [elem]);\r\n\r\n\/**\r\n * Adds an element at the beginning of an array.\r\n *\r\n * @param Array collection - The collection to which add the element.\r\n * @param * elem - The element to add.\r\n * @returns Array\r\n *\/\r\nfunction unshift(collection, elem) = concat([elem], arrayOr(collection, []));\r\n\r\n\/**\r\n * Picks elements in an array to build another array.\r\n *\r\n * @param Array collection - The collection in which pick the elements.\r\n * @param Array what - The indexes of the elements to pick.\r\n * @returns Array\r\n *\/\r\nfunction pick(collection, what) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n length = len(collection),\r\n what = arrayOr(what, [])\r\n )\r\n [ for (i = what) if (i < length) collection[i] ]\r\n;\r\n\r\n\/**\r\n * Sorts an array.\r\n *\r\n * @param Array collection - The collection to sort.\r\n * @returns Array\r\n *\/\r\nfunction sort(collection,\r\n \/\/ internal\r\n nocheck=false) =\r\n let( length = len(collection) )\r\n !length || !nocheck && isString(collection) ? [] \/\/ not array or empty\r\n :let( middle = collection[floor(length \/ 2)] )\r\n concat(\r\n sort([ for (i = collection) if (i < middle) i ], true), \/\/ lesser\r\n [ for (i = collection) if (i == middle) i ], \/\/ equal\r\n sort([ for (i = collection) if (i > middle) i ], true) \/\/ greater\r\n )\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Operations on lists.\r\n *\r\n * @package core\/list\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Fills an array with a value upon the requested length.\r\n *\r\n * @param * value - The value to fill with. Can be of any type.\r\n * @param Number length - The length of the array to fill.\r\n * @returns Array\r\n *\/\r\nfunction fill(value, length) =\r\n let( length = float(length) )\r\n length > 0 ? [ for (i = [0 : length - 1]) value ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Fills an array with a range of values.\r\n *\r\n * @param Number start - The start of the range, or the length of the range\r\n * @param Number [end] - The end of the range.\r\n * @param Number [step] - The range increment.\r\n * @returns Array\r\n *\/\r\nfunction range(start, end, step) =\r\n let(\r\n s = float(start),\r\n simple = s && isUndef(end),\r\n start = simple ? 0 : s,\r\n end = simple ? s : float(end),\r\n step = or(number(step), start > end ? -1 : 1)\r\n )\r\n start || end ? [ for (i = [start : step : end]) i ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Returns a list range with the ideal step to cover this range by the required count.\r\n *\r\n * @param Number start - The start of the range.\r\n * @param Number count - The number of steps to cover the range.\r\n * @param Number end - The end of the range.\r\n * @returns Number\r\n *\/\r\nfunction steps(start, count, end) =\r\n let(\r\n start = float(start),\r\n end = float(end),\r\n step = (end - start) \/ divisor(float(count) - 1)\r\n )\r\n [ start : step : end ]\r\n;\r\n\r\n\/**\r\n * Reverses an array.\r\n *\r\n * @param Array collection - The array to reverse.\r\n * @returns Array\r\n *\/\r\nfunction reverse(collection) =\r\n let( collection = arrayOr(collection, []) )\r\n [ for (i = [len(collection) - 1 : -1 : 0]) collection[i] ]\r\n;\r\n\r\n\/**\r\n * Flattens a multi level array to a less deep array.\r\n *\r\n * @param Array collection - The array to flatten.\r\n * @returns Array\r\n *\/\r\nfunction flatten(collection) = [ for (a = arrayOr(collection, [])) for (b = a) b ];\r\n\r\n\/**\r\n * Finds the index of a key in a collection.\r\n *\r\n * @param Array collection - The collection in which search.\r\n * @param * key - The key to search in the collection.\r\n * @returns Number - The position of the key in the collection, or -1 if not found.\r\n *\/\r\nfunction find(collection, key) = numberOr(search([key], collection)[0], -1);\n\r\n\/**\r\n * Fetches a record from a collection with respect to the provided key.\r\n *\r\n * @param Array collection - The collection in which search.\r\n * @param * key - The key for which fetch the record.\r\n * @returns * - The record that relates to the key, or undef if not found.\r\n *\/\r\nfunction fetch(collection, key) = collection[find(collection, key)];\r\n\r\n\/**\r\n * Checks if an element exists in an array.\r\n *\r\n * @param Array collection - The collection from which search the element.\r\n * @param * elem - The element to search.\r\n * @returns Boolean\r\n *\/\r\nfunction inArray(collection, elem) = find(collection, elem) > -1;\r\n\r\n\/**\r\n * Completes a list with start and end elements, at the condition there are not aleady present.\r\n *\r\n * @param Array collection - The list to complete.\r\n * @param * start - The start element to add.\r\n * @param * end - The end element to add.\r\n * @returns Array\r\n *\/\r\nfunction complete(collection, start, end) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n first = start && start != collection[0] && start != collection[len(collection) - 1] ? concat([start], collection) : collection,\r\n second = end && end != first[0] && end != first[len(first) - 1] ? concat(first, [end]) : first\r\n )\r\n second\r\n;\r\n\r\n\/**\r\n * Gets an array slice.\r\n *\r\n * @param Array collection - The collection to slice.\r\n * @param Number [start] - The start index of the slice. If negative, will start from the end.\r\n * @param Number [end] - The end index of the slice, exclusive.\r\n * @returns Array\r\n *\/\r\nfunction slice(collection, start, end) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n length = len(collection),\r\n start = start < 0 ? max(0, length + start) : integer(start),\r\n end = (end < 0 ? max(start, length + end) : numberOr(end, length)) - 1\r\n )\r\n length && start <= end ? [ for (i = [start : end]) if (i < length) collection[i] ]\r\n : []\r\n;\r\n\r\n\/**\r\n * Changes the contents of an array by removing existing elements and\/or adding new elements.\r\n *\r\n * @param Array collection - The collection to slice.\r\n * @param Number [start] - The index at which to start changing the array. If negative, will start from the end.\r\n * @param Number [remove] - The number of elements to remove.\r\n * @param Array [elems] - The elements to add to the array, beginning at the start index.\r\n * @returns Array\r\n *\/\r\nfunction splice(collection, start, remove, elems) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n elems = arrayOr(elems, []),\r\n length = len(collection),\r\n start = min(start < 0 ? max(0, length + start) : integer(start), length),\r\n next = start + numberOr(remove, length - start),\r\n last = length - 1\r\n )\r\n length || len(elems)\r\n ?concat(\r\n length && start > 0 ? [ for (i = [0 : start - 1]) collection[i] ] : [],\r\n elems,\r\n length && next <= last ? [ for (i = [next : last]) collection[i] ] : []\r\n )\r\n :[]\r\n;\r\n\r\n\/**\r\n * Gets the N first elements of an array.\r\n *\r\n * @param Array collection - The collection from which get the elements.\r\n * @param Number [count] - The number of elements to get.\r\n * @returns Array|*\r\n *\/\r\nfunction first(collection, count) =\r\n let( count = numberOr(count, 1) )\r\n count > 1 ? slice(collection, 0, count)\r\n : arrayOr(collection, [])[0]\r\n;\r\n\r\n\/**\r\n * Gets the N last elements of an array.\r\n *\r\n * @param Array collection - The collection from which get the elements.\r\n * @param Number [count] - The number of elements to get.\r\n * @returns *\r\n *\/\r\nfunction last(collection, count) =\r\n let( count = numberOr(count, 1) )\r\n count > 1 ? slice(collection, -count)\r\n : arrayOr(collection, [])[len(collection) - 1]\r\n;\r\n\r\n\/**\r\n * Removes the last element of an array.\r\n *\r\n * @param Array collection - The collection from which removes the element.\r\n * @returns Array\r\n *\/\r\nfunction pop(collection) = slice(collection, end=-1);\r\n\r\n\/**\r\n * Removes the first element of an array.\r\n *\r\n * @param Array collection - The collection from which removes the element.\r\n * @returns Array\r\n *\/\r\nfunction shift(collection) = slice(collection, 1);\r\n\r\n\/**\r\n * Adds an element at the end of an array.\r\n *\r\n * @param Array collection - The collection to which add the element.\r\n * @param * elem - The element to add.\r\n * @returns Array\r\n *\/\r\nfunction push(collection, elem) = concat(arrayOr(collection, []), [elem]);\r\n\r\n\/**\r\n * Adds an element at the beginning of an array.\r\n *\r\n * @param Array collection - The collection to which add the element.\r\n * @param * elem - The element to add.\r\n * @returns Array\r\n *\/\r\nfunction unshift(collection, elem) = concat([elem], arrayOr(collection, []));\r\n\r\n\/**\r\n * Picks elements in an array to build another array.\r\n *\r\n * @param Array collection - The collection in which pick the elements.\r\n * @param Array what - The indexes of the elements to pick.\r\n * @returns Array\r\n *\/\r\nfunction pick(collection, what) =\r\n let(\r\n collection = arrayOr(collection, []),\r\n length = len(collection),\r\n what = arrayOr(what, [])\r\n )\r\n [ for (i = what) if (i < length) collection[i] ]\r\n;\r\n\r\n\/**\r\n * Sorts an array.\r\n *\r\n * @param Array collection - The collection to sort.\r\n * @returns Array\r\n *\/\r\nfunction sort(collection,\r\n \/\/ internal\r\n nocheck=false) =\r\n let( length = len(collection) )\r\n !length || !nocheck && isString(collection) ? [] \/\/ not array or empty\r\n :let( middle = collection[floor(length \/ 2)] )\r\n concat(\r\n sort([ for (i = collection) if (i < middle) i ], true), \/\/ lesser\r\n [ for (i = collection) if (i == middle) i ], \/\/ equal\r\n sort([ for (i = collection) if (i > middle) i ], true) \/\/ greater\r\n )\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"057349706587c301c7c4e780f3e6acdd6278fcb0","subject":"=> rules coding","message":"=> rules coding","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_file":"3D-models\/SCAD\/DeOxyRibose.scad","new_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5; \nx=9; \ny=38; \nz=38; \ncylinder(x, y, z); \n} \n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t \ndx=4.2; \n\/\/difference () { \ntranslate([9,73,dx]) rotate([90,0,0]) cylinder(40,4,4);\t\t \n\/\/rotate ([90,0,0])translate ([30,7.5,-200.1])cylinder (3.5,5,5); \n \n\/\/} \n \n\/\/difference() { \ntranslate([9,-32,dx]) rotate([90,0,45]) cylinder(40,4,4); \n\/\/rotate ([90,45,45])translate ([-35,-24,196.1])cylinder (3.5,5,5); \n \n\/\/}\t\t \n\/\/difference () { \ntranslate([-61,-41,dx]) rotate([45,90,76]) cylinder(40,4,4);\t\t\t \n\/\/rotate ([90,90,-59])translate ([-7.5,8.5,204.7])cylinder (3.5,5,5); \n\/\/ }\t\t \n} \nplaid();\t\t \nconnect();\t \n\n\n","old_contents":"\/\/\u0414\u0435\u0437\u043e\u043a\u0441\u0438\u0440\u0438\u0431\u043e\u0437\u0430 \nmodule plaid() { \n$fn=5;\nx=9; \ny=38;\nz=38; \ncylinder(x, y, z); \n}\n\/\/\u0441\u0432\u044f\u0437\u044c \nmodule connect() { \n$fn=160;\t\t\t\ndx=4.2;\n\/\/difference () {\ntranslate([9,73,dx]) rotate([90,0,0]) cylinder(40,4,4);\t\t\n\/\/rotate ([90,0,0])translate ([30,7.5,-200.1])cylinder (3.5,5,5);\n\n\/\/}\n\n\/\/difference() {\ntranslate([9,-32,dx]) rotate([90,0,45]) cylinder(40,4,4);\n\/\/rotate ([90,45,45])translate ([-35,-24,196.1])cylinder (3.5,5,5);\n\n\/\/}\t\t\n\/\/difference () {\ntranslate([-61,-41,dx]) rotate([45,90,76]) cylinder(40,4,4);\t\t\t\n\/\/rotate ([90,90,-59])translate ([-7.5,8.5,204.7])cylinder (3.5,5,5);\n\/\/ }\t\t\n}\nplaid();\t\t\nconnect();\t\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9d1512f8f6af2b201731d554bcf89f5a59e5f58f","subject":"Added invert option to scad script","message":"Added invert option to scad script\n","repos":"skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak","old_file":"zikcase\/openscad-zzr3-case-r1\/zikcase-all.scad","new_file":"zikcase\/openscad-zzr3-case-r1\/zikcase-all.scad","new_contents":"\/* Case parts for Zikzak rev3\n * www.zikzak.ca\n *\/\n\n\/\/ ref\n\/\/ colours: https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/Transformations#color\n\n\/\/ TODO:\n\/\/ - add cart hole 'sides' as guides for the cart to go down nicely into edge connector\n\/\/\n\n\/\/ render target\n\/\/ - leftbacktop\n\/\/ - rightfrontbottom\n\/\/ - all\ntarget = \"leftbacktop\";\n\/\/target = \"rightfrontbottom\";\n\/\/target = \"all\";\n\n\/\/ scale? Use this to print out tiny versions for inspection prior to printing real ones\n\/\/scale_factor = 1;\nscale_factor = 0.4;\n\n\/\/ invert for print?\n\/\/rotate_y = 180; \/\/ invert\nrotate_y = 0; \/\/ no invert\n\n\/\/ fan holes?\nfan_holes = 1;\n\/\/fan_holes = 0;\n\n\/\/ DO IT\n\/\/\n\n\/\/ facets\n$fn = 50;\n\n\/\/ board params\ninner_width = 150;\ninner_depth = 100;\ninner_height = 40;\n\n\/\/ calcs\nsloppyness = 2;\nwall_thickness = 2.5;\njack_buffer = 2; \t\t\t\/\/ amount of extra cutout space around each side of a jack\n\nouter_width = inner_width + sloppyness + wall_thickness;\nouter_depth = inner_depth + sloppyness + wall_thickness;\nouter_height = inner_height + sloppyness + wall_thickness;\n\nmodule leftbacktop () {\n\tfunction r_from_dia(d) = d \/ 2;\n\n\tmodule walls() {\n\t\tunion() {\n\t\t\t\/\/ left wall\n\t\t\tcolor ( \"thistle\" ) {\n\t\t\t\tcube ( [ wall_thickness, outer_depth, outer_height ] );\n\t\t\t}\n\t\t\t\/\/ back wall\n\t\t\tcolor ( \"cadetblue\" ) {\n\t\t\t\ttranslate ( [ 0, inner_depth + sloppyness, 0 ] ) {\n\t\t\t\t\tcube ( [ outer_width, wall_thickness, outer_height ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\/\/ top\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\n\t\t\t\ttranslate ( [ 0, 0, inner_height + sloppyness ] ) {\n\t\t\t\t\tcube ( [ outer_width, outer_depth, wall_thickness] );\n\t\t\t\t}\n\t\t\t}\n\n } \/\/ union\n\t} \/\/ walls\n\n\tmodule cutouts() {\n\t\t\/\/ LEFT SIDE\n\t\t\/\/\n\n\t\t\/\/ joy0 + headphone\n\t\ttranslate ( [ -10, 9 - jack_buffer, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 20, 30 + 15 + (2*jack_buffer), 13 + (2*jack_buffer) ] );\n\t\t}\n\n\t\t\/\/ BACK\n\t\t\/\/\n\n\t\t\/\/ USB power\/serial\n\t\ttranslate ( [ 3 - jack_buffer, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 7 + (2*jack_buffer), 20, 4 + (2*jack_buffer) ] );\n\t\t}\n\t\t\/\/ volume potwheel\n\t\ttranslate ( [ 16, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 15 + (2*jack_buffer), 20, 2 + (2*jack_buffer) ] );\n\t\t}\n\t\t\/\/ PS\/2 keyb\n\t\ttranslate ( [ 36, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 15, 20, 15 + (2*jack_buffer) ] );\n\t\t}\n\t\t\/\/ VGA\n\t\ttranslate ( [ 55, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 31, 20, 14 + (2*jack_buffer) ] );\n\t\t}\n \n \/\/ TOP\n \/\/\n\n \t\t\/\/ cart\n\t\ttranslate ( [ 30, 2, 35 - jack_buffer ] ) {\n\t\t\tcube( [ 82 + (2*jack_buffer), 25+(2*jack_buffer), 20 ] );\n\t\t}\n\n\t} \/\/ cutouts\n\n module reartrim() {\n translate ( [ 135, inner_depth + sloppyness + 2, 13 ] ) {\n rotate ( [ 90, 0, 180 ] ) {\n linear_extrude(slices=1,height=5) {\n text ( text=\"ZZ\", size=20, font=\"DejaVu Sans Mono:style=Bold\" );\n } \/\/ extrude\n } \/\/ rotate\n } \/\/ translate\n } \/\/ rear trim\n \n module toptrim() {\n translate ( [ 10, 60, 39 + sloppyness ] ) {\n linear_extrude(slices=1,height=5) {\n text ( text=\"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\", size=20, font=\"DejaVu Sans Mono:style=Bold\",spacing=.3 );\n } \/\/ ex\n } \/\/ tr\n } \/\/ top trim\n \n difference() {\n\t\twalls();\n\t\tcutouts();\n reartrim();\n toptrim();\n\t}\n\n} \/\/ left back top\n\nmodule rightfrontbottom () {\n\n\tmodule walls() {\n\t\tunion() {\n\t\t\t\/\/ right wall\n\t\t\tcolor ( \"thistle\" ) {\n translate ( [ inner_width + sloppyness, 0, 0 ] ) {\n cube ( [ wall_thickness, outer_depth, outer_height ] );\n }\n\t\t\t}\n\t\t\t\/\/ front wall\n\t\t\tcolor ( \"cadetblue\" ) {\n cube ( [ outer_width, wall_thickness, outer_height ] );\n\t\t\t}\n\t\t\t\/\/ bottom\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\n cube ( [ outer_width, outer_depth, wall_thickness] );\n\t\t\t}\n\n } \/\/ union\n\t} \/\/ walls\n\n module trimtext() {\n translate ( [ 105, 0, 13 ] ) {\n rotate ( [ 90, 0, 0 ] ) {\n linear_extrude(slices=1,height=5) {\n text ( text=\"ZZ\", size=20, font=\"DejaVu Sans Mono:style=Bold\" );\n } \/\/ extrude\n } \/\/ rotate\n } \/\/ translate\n } \/\/ trim text\n \n difference() {\n\t\twalls();\n trimtext();\n if ( fan_holes == 1 ) translate( [ 75, 55, 0 ] ) fanholes();\n\t}\n\n} \/\/ right front bottom\n\nrotate ( [ 0, rotate_y, 0 ] ) {\n scale ( [ scale_factor, scale_factor, scale_factor ] ) {\n if ( target == \"leftbacktop\" ) {\n leftbacktop();\n } else if ( target == \"rightfrontbottom\" ) {\n rightfrontbottom();\n } else if ( target == \"all\" ) {\n leftbacktop();\n rightfrontbottom();\n } \/\/ render the right piece\n } \/\/ scale\n} \/\/ rotate\n\nmodule fanholes() {\n \/\/ How large is the fan rotor ? (mm)\nRotorDiameter=70;\n\/\/ How large should each hole be ? (mm)\nHolesDiameter=10;\n\/\/ How much space should be left between each hole, proportionally to the hole size ?\nHolesRingsSpacingFraction = 0.4; \/\/ [0.1:4.0]\n\/\/ The height of the generated solids (mm)\nHeight = 10; \n\/\/ The number of faces of each hole outer perimeter\nResoultion=20;\/\/ [3:100]\n\n\n\/\/ VARIABLES INITIALIZATION\necho(\"RotorDiameter=\",RotorDiameter);\necho(\"HolesDiameter=\",HolesDiameter);\necho(\"Height=\",Height);\necho(\"Resoultion=\",Resoultion);\n\nHolesBoundingBox = HolesDiameter*(1+HolesRingsSpacingFraction);\necho(\"HolesBoundingBox=\",HolesBoundingBox);\nNumberOfRings = RotorDiameter \/ HolesBoundingBox;\necho(\"NumberOfRings=\",NumberOfRings);\n\nOuterRadius = RotorDiameter\/2;\necho(\"OuterRadius=\",OuterRadius);\n\nRingRadiusStep = HolesBoundingBox;\necho(\"RingRadiusStep=\",RingRadiusStep);\n\n\n \ndifference()\n{\n for (i=[0:1:NumberOfRings\/2])\n {\n difference()\n { \n for(j=[0:360\/((i*HolesBoundingBox*6\/HolesBoundingBox)):360])\n {\n translate([sin(j)*(i*HolesBoundingBox),cos(j)*(i*HolesBoundingBox),0])cylinder(h=Height,d=HolesDiameter, center = false, $fn=Resoultion);\n }\n } \n }\n}\n\n} \/\/ fanholes","old_contents":"\/* Case parts for Zikzak rev3\n * www.zikzak.ca\n *\/\n\n\/\/ ref\n\/\/ colours: https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/Transformations#color\n\n\/\/ TODO:\n\/\/ - add cart hole 'sides' as guides for the cart to go down nicely into edge connector\n\/\/\n\n\/\/ render target\n\/\/ - leftbacktop\n\/\/ - rightfrontbottom\n\/\/ - all\n\/\/target = \"leftbacktop\";\ntarget = \"rightfrontbottom\";\n\/\/target = \"all\";\n\n\/\/ scale? Use this to print out tiny versions for inspection prior to printing real ones\n\/\/scale_factor = 1;\nscale_factor = 0.4;\n\n\/\/ fan holes?\nfan_holes = 1;\n\/\/fan_holes = 0;\n\n\/\/ facets\n$fn = 50;\n\n\/\/ board params\ninner_width = 150;\ninner_depth = 100;\ninner_height = 40;\n\n\/\/ calcs\nsloppyness = 2;\nwall_thickness = 2.5;\njack_buffer = 2; \t\t\t\/\/ amount of extra cutout space around each side of a jack\n\nouter_width = inner_width + sloppyness + wall_thickness;\nouter_depth = inner_depth + sloppyness + wall_thickness;\nouter_height = inner_height + sloppyness + wall_thickness;\n\nmodule leftbacktop () {\n\tfunction r_from_dia(d) = d \/ 2;\n\n\tmodule walls() {\n\t\tunion() {\n\t\t\t\/\/ left wall\n\t\t\tcolor ( \"thistle\" ) {\n\t\t\t\tcube ( [ wall_thickness, outer_depth, outer_height ] );\n\t\t\t}\n\t\t\t\/\/ back wall\n\t\t\tcolor ( \"cadetblue\" ) {\n\t\t\t\ttranslate ( [ 0, inner_depth + sloppyness, 0 ] ) {\n\t\t\t\t\tcube ( [ outer_width, wall_thickness, outer_height ] );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\/\/ top\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\n\t\t\t\ttranslate ( [ 0, 0, inner_height + sloppyness ] ) {\n\t\t\t\t\tcube ( [ outer_width, outer_depth, wall_thickness] );\n\t\t\t\t}\n\t\t\t}\n\n } \/\/ union\n\t} \/\/ walls\n\n\tmodule cutouts() {\n\t\t\/\/ LEFT SIDE\n\t\t\/\/\n\n\t\t\/\/ joy0 + headphone\n\t\ttranslate ( [ -10, 9 - jack_buffer, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 20, 30 + 15 + (2*jack_buffer), 13 + (2*jack_buffer) ] );\n\t\t}\n\n\t\t\/\/ BACK\n\t\t\/\/\n\n\t\t\/\/ USB power\/serial\n\t\ttranslate ( [ 3 - jack_buffer, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 7 + (2*jack_buffer), 20, 4 + (2*jack_buffer) ] );\n\t\t}\n\t\t\/\/ volume potwheel\n\t\ttranslate ( [ 16, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 15 + (2*jack_buffer), 20, 2 + (2*jack_buffer) ] );\n\t\t}\n\t\t\/\/ PS\/2 keyb\n\t\ttranslate ( [ 36, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 15, 20, 15 + (2*jack_buffer) ] );\n\t\t}\n\t\t\/\/ VGA\n\t\ttranslate ( [ 55, inner_depth, 25 - jack_buffer ] ) {\n\t\t\tcube( [ 31, 20, 14 + (2*jack_buffer) ] );\n\t\t}\n \n \/\/ TOP\n \/\/\n\n \t\t\/\/ cart\n\t\ttranslate ( [ 30, 2, 35 - jack_buffer ] ) {\n\t\t\tcube( [ 82 + (2*jack_buffer), 25+(2*jack_buffer), 20 ] );\n\t\t}\n\n\t} \/\/ cutouts\n\n module reartrim() {\n translate ( [ 135, inner_depth + sloppyness + 2, 13 ] ) {\n rotate ( [ 90, 0, 180 ] ) {\n linear_extrude(slices=1,height=5) {\n text ( text=\"ZZ\", size=20, font=\"DejaVu Sans Mono:style=Bold\" );\n } \/\/ extrude\n } \/\/ rotate\n } \/\/ translate\n } \/\/ rear trim\n \n module toptrim() {\n translate ( [ 10, 60, 39 + sloppyness ] ) {\n linear_extrude(slices=1,height=5) {\n text ( text=\"\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\", size=20, font=\"DejaVu Sans Mono:style=Bold\",spacing=.3 );\n } \/\/ ex\n } \/\/ tr\n } \/\/ top trim\n \n difference() {\n\t\twalls();\n\t\tcutouts();\n reartrim();\n toptrim();\n\t}\n\n} \/\/ left back top\n\nmodule rightfrontbottom () {\n\n\tmodule walls() {\n\t\tunion() {\n\t\t\t\/\/ right wall\n\t\t\tcolor ( \"thistle\" ) {\n translate ( [ inner_width + sloppyness, 0, 0 ] ) {\n cube ( [ wall_thickness, outer_depth, outer_height ] );\n }\n\t\t\t}\n\t\t\t\/\/ front wall\n\t\t\tcolor ( \"cadetblue\" ) {\n cube ( [ outer_width, wall_thickness, outer_height ] );\n\t\t\t}\n\t\t\t\/\/ bottom\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\n cube ( [ outer_width, outer_depth, wall_thickness] );\n\t\t\t}\n\n } \/\/ union\n\t} \/\/ walls\n\n module trimtext() {\n translate ( [ 105, 0, 13 ] ) {\n rotate ( [ 90, 0, 0 ] ) {\n linear_extrude(slices=1,height=5) {\n text ( text=\"ZZ\", size=20, font=\"DejaVu Sans Mono:style=Bold\" );\n } \/\/ extrude\n } \/\/ rotate\n } \/\/ translate\n } \/\/ trim text\n \n difference() {\n\t\twalls();\n trimtext();\n if ( fan_holes == 1 ) translate( [ 75, 55, 0 ] ) fanholes();\n\t}\n\n} \/\/ right front bottom\n\nscale ( [ scale_factor, scale_factor, scale_factor ] ) {\n\tif ( target == \"leftbacktop\" ) {\n\t\tleftbacktop();\n\t} else if ( target == \"rightfrontbottom\" ) {\n\t\trightfrontbottom();\n\t} else if ( target == \"all\" ) {\n leftbacktop();\n rightfrontbottom();\n\t}\n}\n\nmodule fanholes() {\n \/\/ How large is the fan rotor ? (mm)\nRotorDiameter=70;\n\/\/ How large should each hole be ? (mm)\nHolesDiameter=10;\n\/\/ How much space should be left between each hole, proportionally to the hole size ?\nHolesRingsSpacingFraction = 0.4; \/\/ [0.1:4.0]\n\/\/ The height of the generated solids (mm)\nHeight = 10; \n\/\/ The number of faces of each hole outer perimeter\nResoultion=20;\/\/ [3:100]\n\n\n\/\/ VARIABLES INITIALIZATION\necho(\"RotorDiameter=\",RotorDiameter);\necho(\"HolesDiameter=\",HolesDiameter);\necho(\"Height=\",Height);\necho(\"Resoultion=\",Resoultion);\n\nHolesBoundingBox = HolesDiameter*(1+HolesRingsSpacingFraction);\necho(\"HolesBoundingBox=\",HolesBoundingBox);\nNumberOfRings = RotorDiameter \/ HolesBoundingBox;\necho(\"NumberOfRings=\",NumberOfRings);\n\nOuterRadius = RotorDiameter\/2;\necho(\"OuterRadius=\",OuterRadius);\n\nRingRadiusStep = HolesBoundingBox;\necho(\"RingRadiusStep=\",RingRadiusStep);\n\n\n \ndifference()\n{\n for (i=[0:1:NumberOfRings\/2])\n {\n difference()\n { \n for(j=[0:360\/((i*HolesBoundingBox*6\/HolesBoundingBox)):360])\n {\n translate([sin(j)*(i*HolesBoundingBox),cos(j)*(i*HolesBoundingBox),0])cylinder(h=Height,d=HolesDiameter, center = false, $fn=Resoultion);\n }\n } \n }\n}\n\n} \/\/ fanholes","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"bc2b0954215a6de731227c70383e42adb0261c61","subject":"adding x pegs. check in before altering a bit","message":"adding x pegs. check in before altering a bit\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n\/\/%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n*for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\ntranslate([0,0,9]) lid();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\ndh=3.1;\nc30=cos(30); dx=3*dh; dy=2*c30*dh;\nmodule hexGrid() {\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y,s=[1,1,1]) translate([x,y,0]) scale(s)\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\nmodule lid() {\n difference() {\n union() {\n for (i=[-1,1]) {\n for (j=[-1,1]) translate([2*dx*i,5*dy*j,0]) {\n hull() {\n translate([0, 0 ,1.7]) cylinder(r=2.2,h=1.4,$fn=6);\n translate([0,1.5*j,3]) cylinder(r=.1 ,h=5,$fn=6); }\n hex(0,0,[.9,.9,1]); }\n hull() { hex(5*dx*i, 0 ,[.9,.9,1]);\n translate([(5*dx-0.6)*i,0,8]) sphere(0.1); }\n }\n difference() {\n lidShell();\n translate([0,0,0.3]) scale([.982,.976,.97]) lidShell();\n\n \/\/trim off thin edges of shell\n translate([0,0,2.4]) cube([89,53,2],center=true);\n }\n }\n\n \/\/ trim off severe overhanging parts of tabs\n *hull() {\n translate([0,0,3.5]) cube([70,55,.1],center=true);\n cube([70,50,7],center=true);\n }\n\n \/\/ trim off part of tab in partial hex hole\n for(x=[-1,1]) translate([49.7*x,0,0]) rotate([0,10*x,0])\n cube([6,6,20],center=true);\n\n \/\/ pass through for cable ties to attach platform to sides\n for(x=[-1,1]) translate([x*28,0,2.7]) rotate([90,0,0])\n scale([3,2,1]) cylinder(r=1,h=77,$fn=16,center=true);\n\n \/\/translate([0,0,-99]) cube([200,200,200]);\n }\n\n}\n\nmodule lidShell()\n hull() {\n for (x=[-1,1]) for(y=[-1,1]) {\n translate([44*x,26*y,4.6]) sphere(3,$fn=24);\n translate([40*x,23 *y,30 ]) sphere(3,$fn=24);\n }\n}\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\ntranslate([0,0,9]) lid();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\ndh=3.1;\nc30=cos(30); dx=3*dh; dy=2*c30*dh;\nmodule hexGrid() {\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y,s=[1,1,1]) translate([x,y,0]) scale(s)\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\nmodule lid() {\n difference() {\n union() {\n for (i=[-1,1]) for (j=[-1,1]) \n hex(3*dx*i,5*dy*j,[.9,.9,1]);\n difference() {\n lidShell();\n translate([0,0,0.3]) scale([.987,.98,.97]) lidShell();\n }\n }\n hull() {\n translate([0,0,3.5]) cube([89,57.5,.1],center=true);\n cube([86,52,7],center=true);\n }\n\n for(x=[-1,1]) translate([x*23,0,2.2]) rotate([90,0,0])\n scale([2.5,1.5,1]) cylinder(r=1,h=77,$fn=16,center=true);\n\n \/\/translate([0,0,-99]) cube([200,200,200]);\n }\n\n}\n\nmodule lidShell()\n hull() {\n for (x=[-1,1]) for(y=[-1,1]) {\n translate([44*x,27.5*y,4.6]) sphere(3,$fn=24);\n translate([40*x,23 *y,30 ]) sphere(3,$fn=24);\n }\n}\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"d87c06d2c5437801a1cf4538afd17080e2807a78","subject":"updated placements","message":"updated placements\n","repos":"holtsoftware\/House,holtsoftware\/House,holtsoftware\/House,holtsoftware\/House","old_file":"OpenSCAD\/Yard\/SolarRoof.scad","new_file":"OpenSCAD\/Yard\/SolarRoof.scad","new_contents":"module solarPanel()\n{\n translate([0,0,1.5]) color(\"blue\") cube([51,51,4]);\n translate([4,4,0]) color(\"red\") cube([43,43,5]);\n translate([0,21.5,0]) color(\"orange\") cube([51,8,5]);\n}\n\ndifference()\n{\n cube([140,75,5]);\n translate([18,12.25,0]) solarPanel();\n translate([73,12.25,0]) solarPanel();\n}","old_contents":"module solarPanel()\n{\n translate([0,0,1.5]) color(\"blue\") cube([51,51,4]);\n translate([4,4,0]) color(\"red\") cube([43,43,5]);\n translate([0,21.5,0]) color(\"orange\") cube([51,8,5]);\n}\n\ndifference()\n{\n cube([140,75,5]);\n translate([17,12.25,0]) solarPanel();\n translate([70,12.25,0]) solarPanel();\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1a196fdb0faf6c006a0d8cb7d10a97e7c371dbdc","subject":"fixed diameter and wall thinckness of the rod-holder","message":"fixed diameter and wall thinckness of the rod-holder\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/guide_rod_mount.scad","new_file":"water_rocket_launcher\/guide_rod_mount.scad","new_contents":"eps = 0.01;\nrod_d = 5+0.7;\nmount_h = 40;\n\nmodule rod_mount()\n{\n base_h = 4;\n base_d = 35;\n \/\/ base\n difference()\n {\n cylinder(d=base_d, h=base_h);\n n=5;\n for(i=[0:n-1])\n rotate([0, 0, 1]*(i\/n*360))\n translate([base_d\/2-5, 0, -eps])\n cylinder(d=3.5, h=base_h+2*eps, $fn=30);\n }\n \/\/ rod holder\n translate([0, 0, base_h])\n difference()\n {\n cylinder(d=rod_d+2.5, h=mount_h, $fn=30);\n cylinder(d=rod_d, h=mount_h+eps, $fn=100);\n }\n}\n\n\nrod_mount();\n","old_contents":"eps = 0.01;\nrod_d = 5;\nmount_h = 40;\n\nmodule rod_mount()\n{\n base_h = 4;\n base_d = 35;\n \/\/ base\n difference()\n {\n cylinder(d=base_d, h=base_h);\n n=5;\n for(i=[0:n-1])\n rotate([0, 0, 1]*(i\/n*360))\n translate([base_d\/2-5, 0, -eps])\n cylinder(d=3.5, h=base_h+2*eps, $fn=30);\n }\n \/\/ main block\n translate([0, 0, base_h])\n difference()\n {\n cylinder(d=rod_d+1.5, h=mount_h, $fn=30);\n cylinder(d=rod_d, h=mount_h+eps, $fn=100);\n }\n}\n\n\nrod_mount();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cbe0847c0586024b22afdbaceb3e44165b907ff7","subject":"remove the jetpuf version from the preivew","message":"remove the jetpuf version from the preivew\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/mini\/mini-chistmas-story-leg-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/mini\/mini-chistmas-story-leg-lamp-shade.scad","new_contents":"\n\nouterRadius = 12;\n\nsquareLength = 28;\n\nxScale = 0.4;\n\nyScale = 1.9;\n\nbottomOuterRadius = 20;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/ translate([-120, 0, 0])\n\/\/ import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\n\nouterRadius = 12;\n\nsquareLength = 28;\n\nxScale = 0.4;\n\nyScale = 1.9;\n\nbottomOuterRadius = 20;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\ntranslate([-120, 0, 0])\nimport(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n xScale = xScale,\n yScale = yScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"baaee24ab5d653bd8ee857522fa28aea937182cb","subject":"Fixes and improvements to hanging supports.","message":"Fixes and improvements to hanging supports.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports (z -5 to center on camera opening)\n hanging_supports(x=width, y=depth\/2, z=height\/2-5, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports (z -5 to center on camera opening)\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2-5+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n cutout_w = 10;\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+cutout_w*2, thickness, inner_h+cutout_w*3], center=true);\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+cutout_w\/2),0,-cutout_w\/2])\n cube([cutout_w+2*epsilon, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-(inner_h\/2+cutout_w)])\n cube([thickness, thickness*2, cutout_w], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 1.8; \/\/ 1.8mm = 0.07\" (looks good based on cut test piece)\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_depth = depth-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-10;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n side(y=0);\n side(y=depth);\n tank_base();\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang, 0])\n cube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness,base_height])\n difference() {\n cube([width+outset*2, base_depth, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,base_depth\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,base_depth\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(x=0);\n scale([1,1,0.5])\n vert_face_base(x=width);\n light_bar_opening();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n cube([width+overhang*2, thickness, height-overhang\/2]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"508e438d3bc161d45f5852f7110fc60ed427a95d","subject":"xaxis\/ends: misc tweaks","message":"xaxis\/ends: misc tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -1*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n \/*translate([0,5,0])*\/\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n \/*translate([0,-1*mm,0])*\/\n \/*pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);*\/\n \/*motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);*\/\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*if(false)*\/\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=false, nut_top=false, show_nut=true, show_rods=true);\n\n translate([150,0,0])\n {\n xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n xaxis_end_idlerholder();\n }\n}\n\nif(false)\n{\n translate([0,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=true, show_motor=true, show_nut=false);\n\n translate([100,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=false, show_nut=false);\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1]+0*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-0*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n translate([0,-1,0])\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*debug=false;*\/\n\/*[>debug=true;<]*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*\/\/ x smooth rods*\/\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*(xaxis_rod_distance\/2)])*\/\n \/*%fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);*\/\n\n \/*xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n\n \/*translate([150,0,0])*\/\n \/*{*\/\n \/*xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n \/*xaxis_end_idlerholder();*\/\n \/*}*\/\n\/*}*\/\n\n\/*print=false;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"75e2eb0ee12a3035599ba08ce2c0ed4d05a9a516","subject":"xaxis\/ends: use teardrop module for motor mount","message":"xaxis\/ends: use teardrop module for motor mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9a06031bebb3a1d057d9535293d7f5e78ec97d70","subject":"x\/carriage: fix hotend mount offset","message":"x\/carriage: fix hotend mount offset\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"95dc322478d020c64a01e76ad685f98f04fccfc5","subject":"x\/carriage\/sensormount: tweak pindav2 cutout","message":"x\/carriage\/sensormount: tweak pindav2 cutout\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n ty(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n}\n\nmodule x_extruder_hotend_()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n tx(-x_carriage_w\/2)\n ty(xaxis_endstop_pos(true).y)\n tz(xaxis_endstop_pos(true).z)\n hull()\n {\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z);\n\n ty(xaxis_carriage_bearing_offset_y)\n rcubea(\n size=[4*mm,xaxis_endstop_size_switch.y,xaxis_endstop_size_switch.z],\n align=X+Y+Z,\n extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2),\n extra_align=-Y);\n }\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n h=13*mm;\n\n cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*proj_extrude_axis_part(axis=Y, offset=5*mm)*\/\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_guidler_mount_w, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n \/*tx(3*mm)*\/\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n ty(.1)\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1.5*mm, orient=Y, align=-Y);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+3*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n sensormount_clamp(part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-8*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-8*mm)\n ty(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=20*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm-5*mm)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n rcubea(size=[18*mm,3*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(3*mm)\n ty(-11*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=20*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n extruder_b();\n\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend();\n\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n \/*translate(-extruder_offset)*\/\n \/*translate(34*X)*\/\n \/*translate(2*Y)*\/\n \/*translate(-1*Z)*\/\n \/*rotate(180*Z)*\/\n \/*rotate(-90*X)*\/\n \/*import(\"stl\/Fan_Duct_V4.STL\");*\/\n\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n\n tx(100)\n ty(extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*117*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(with_sensormount=x<0);\n\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=[-1,1])\n translate([x*200,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fc31fd65b197c222ef4e9b628c98f4cdd33d8601","subject":"beef up support for printability under cura","message":"beef up support for printability under cura\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/JansenBED.scad","new_file":"Drawings\/JansenBED.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenBED.scad $\n\/\/ $Id: JansenBED.scad 435 2015-03-02 15:21:04Z mrwhat $\n\n\/\/ main BED code, more injection-mold-like model\n\n\/\/ Uses a ton of stuff from Jansen.scad.\n\/\/ Use from an #include in Jansen.scad.\n\nforkLen = 3.5*LinkRad; \/\/ forks around linkage in BED\nnf=24; \/\/ faces for hull components\n\nmodule BEDhull(dLeft,dPerp,dRight,ph,rp) { hull() {\ntranslate([-dLeft,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([dRight,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([-rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ 0,dPerp-rp,ph-1]) sphere(r=1,$fn=nf);\ntranslate([4-dLeft ,1,2]) sphere(r=1,$fn=nf);\ntranslate([dRight-4,1,2]) sphere(r=1,$fn=nf);\n}}\n\nmodule BEDsideRail(x,dPerp,ph) {\nhull() {\n translate([x,-1, 0]) {\n cylinder(h=1,r1=1.2,r2=.1,$fn=nf);\n translate([0,0,2]) sphere(r=.6,$fn=nf); }\n translate([0,dPerp+2,0]) {\n cylinder(h=1,r1=1.5,r2=.1,$fn=nf);\n translate([0,0,ph-.6]) sphere(r=.6,$fn=nf); }\n }\nhull() {\n if (x < 0) { translate([x+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n else { translate([x-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n translate([0,dPerp,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf);\n }\n}\n\nmodule BEDrails(dLeft,dPerp,dRight,ph,rp) {\nunion() {\n BEDsideRail(-dLeft,dPerp,ph);\n BEDsideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n translate([dRight,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n }\n hull() { \/\/ horiz, flat part of DE segment\n translate([-dLeft+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n translate([dRight-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n }\n hull() { \n translate([dRight-5,6,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n translate([dRight+1,2,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n }\n}}\n\nmodule forkTab(h,r1,r2,len) {\ndifference(){\nhull() { cylinder(h=h,r1=r1,r2=r2,$fn=48);\n translate([len+2,0,0]) cylinder(h=2,r1=2,r2=1,$fn=12); }\ntranslate([len,0,-.1]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n drillHole(rad4);\n}}\n\nmodule imBEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDhull(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-5*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n translate([0,2,-1])\n BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n\/\/ forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n}\n\/\/------------------------------------- end of imBEDmain\n\nmodule BED1main(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDrails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen-2);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen-2); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-4*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n \/\/translate([0,2,-1])\n \/\/ BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ custom support\nsW=0.41; \/\/ support width\nsH=4.4; \/\/ support height\nsH2=sH\/2;\ncolor(\"Cyan\") union() {\n translate([-28,1,sH2]) rotate([0,0,10]) cube([sW,8,sH],center=true);\n translate([-29.5,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-31,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-32.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-34,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-35.5,0,sH2]) rotate([0,0,5]) cube([sW,10,sH],center=true);\n translate([-37,0,sH2]) rotate([0,0,5]) cube([sW,9,sH],center=true);\n translate([-36.5,-2.5,sH2]) rotate([0,0,40]) cube([sW,7,sH],center=true);\n translate([-36.5,2.5,sH2]) rotate([0,0,-40]) cube([sW,7,sH],center=true);\n translate([-30,-2.5,sH2]) rotate([0,0,10]) cube([8,sW,sH],center=true);\n translate([-31,3.5,sH2]) rotate([0,0,-10]) cube([8,sW,sH],center=true);\n hull() {\n translate([-34,0,0]) cylinder(r1=2,r2=5,h=3.6,$fn=11);\n translate([-29,0.5,0]) rotate([0,0,15])\n scale([1,3,1]) cylinder(r1=.3,r2=1.5,h=3.6,$fn=6);\n }\n}\n\n}\n\n\/\/------------------------------------- end of BED1main\n\nmodule imBED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n\/\/ Complete (Joined) version of BED, with in-place fork\nmodule imBEDj(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nunion() {\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork, in place\ntranslate([-dLeft,0,-.01]) { rotate([0,0,5]) { \n rotate([180,0,0]) forkTab(ForkHeight+.2,Drad+2,rad4+1.4,forkLen);\n\n#hull(){\n translate([forkLen ,0,0])cylinder(h=NodeHeight-2,r=2.8,$fn=12);\n translate([forkLen+1.5,4,1.1])sphere(r=1,$fn=6);\n translate([forkLen+2,0,0])cylinder(h=NodeHeight-2,r=2.2,$fn=12);}\n}}\n\n}}\n\n\/\/imBED(DEleft,DE,DEperp);\n\n\/\/ version of BED intended for one-sided injection mold\nmodule BED1(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nBED1main(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/JansenBED.scad $\n\/\/ $Id: JansenBED.scad 435 2015-03-02 15:21:04Z mrwhat $\n\n\/\/ main BED code, more injection-mold-like model\n\n\/\/ Uses a ton of stuff from Jansen.scad.\n\/\/ Use from an #include in Jansen.scad.\n\nforkLen = 3.5*LinkRad; \/\/ forks around linkage in BED\nnf=24; \/\/ faces for hull components\n\nmodule BEDhull(dLeft,dPerp,dRight,ph,rp) { hull() {\ntranslate([-dLeft,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([dRight,-1, 0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([-rp,dPerp+1,0]) cylinder(h=1,r1=1,r2=.1,$fn=nf);\ntranslate([ 0,dPerp-rp,ph-1]) sphere(r=1,$fn=nf);\ntranslate([4-dLeft ,1,2]) sphere(r=1,$fn=nf);\ntranslate([dRight-4,1,2]) sphere(r=1,$fn=nf);\n}}\n\nmodule BEDsideRail(x,dPerp,ph) {\nhull() {\n translate([x,-1, 0]) {\n cylinder(h=1,r1=1.2,r2=.1,$fn=nf);\n translate([0,0,2]) sphere(r=.6,$fn=nf); }\n translate([0,dPerp+2,0]) {\n cylinder(h=1,r1=1.5,r2=.1,$fn=nf);\n translate([0,0,ph-.6]) sphere(r=.6,$fn=nf); }\n }\nhull() {\n if (x < 0) { translate([x+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n else { translate([x-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf); }\n translate([0,dPerp,0]) cylinder(h=2,r1=2.5,r2=2,$fn=nf);\n }\n}\n\nmodule BEDrails(dLeft,dPerp,dRight,ph,rp) {\nunion() {\n BEDsideRail(-dLeft,dPerp,ph);\n BEDsideRail(dRight,dPerp,ph);\n hull() { \/\/ vert bar part, DE\n translate([-dLeft,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n translate([dRight,-1,0]) { cylinder(h=1,r1=1.5,r2=.1,$fn=6);\n translate([0,0,3]) sphere(r=.6,$fn=nf); }\n }\n hull() { \/\/ horiz, flat part of DE segment\n translate([-dLeft+2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n translate([dRight-2,0,0]) cylinder(h=2,r1=2.5,r2=2,$fn=6);\n }\n hull() { \n translate([dRight-5,6,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n translate([dRight+1,2,0]) cylinder(h=2,r1=1.5,r2=1,$fn=6);\n }\n}}\n\nmodule forkTab(h,r1,r2,len) {\ndifference(){\nhull() { cylinder(h=h,r1=r1,r2=r2,$fn=48);\n translate([len+2,0,0]) cylinder(h=2,r1=2,r2=1,$fn=12); }\ntranslate([len,0,-.1]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n drillHole(rad4);\n}}\n\nmodule imBEDmain(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDhull(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-5*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n translate([0,2,-1])\n BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ add other side of fork\n\/\/translate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n\/\/ forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen);\n}\n\/\/------------------------------------- end of imBEDmain\n\nmodule BED1main(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nperpHeight = NodeHeight3; \/\/3*TrueNodeHeight; \/\/ same height as long hinge-pin\ndifference() { union() {\n difference() { union() {\n BEDrails(dLeft*.8,dPerp,.75*(dBase-dLeft),perpHeight,Brad);\n\n translate([-dLeft,0,0]) {\n rotate([0,0,5]) hull() { \n translate([0,0,NodeHeight+0.3]) forkTab(ForkHeight,Drad+2,rad4+1.4,forkLen-2);\n translate([NodeHeight, 0 , 0 ]) forkTab( 2 ,Drad+2,rad4+1.4,forkLen-2); }\n\n translate([dBase,0,0]) rotate([0,0,-5]) difference() {\n hull() { translate([-4*Drad,0,1.5]) sphere(r=1.5,$fn=12);\n cylinder(h=NodeHeight,r1=Drad+2, r2=Drad+1.8, $fn=48); }\n \/\/ hollow out hull a but... injction mold style\n translate([0,0,-1.5]) { difference() { hull() {\n translate([-4*Drad+3,0,0]) cylinder(h=NodeHeight-1,r1=.4,r2=.2,$fn=6);\n cylinder(h=NodeHeight,r1=Drad-.1 ,r2=Drad-.4,$fn=24); }\n cylinder(h=NodeHeight,r1=Drad+1.7,r2=Drad+1.9,$fn=24); }}\n }\n\n } \/\/ end translate\n } \/\/ union\n \n \/\/translate([0,2,-1])\n \/\/ BEDhull(dLeft*.8-3,dPerp-3,.75*(dBase-dLeft)-3,perpHeight-2,Drad-1);\n } \/\/ inner diff\n\n translate([0,dPerp,0])\n cylinder(h=perpHeight,r1=Brad+2.4,r2=Brad+1.8,$fn=48);\n } \/\/ end second union\n\n \/\/------------- main holes\/knock outs\n translate([0,dPerp,0])drillHole(BradFree); \/\/ a little larger to move freely\n translate([(dBase-dLeft),0,0]) drillHole(Drad);\n\n \/\/ for Maxi version, drill hole in top half of \"fork\" node,\n \/\/ and knock out slot for in-plane CD linkage\n translate([-dLeft,0,0]) {\n\n translate([0,0,-.1]) {\n difference() { cube([28,33,2*(NodeHeight+.3)],center=true);\n hull() {\n translate([Drad+7,1,0]) cylinder(h=NodeHeight+.31,r=3,$fn=16);\n translate([Drad+14,2,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n translate([Drad+14,10,0]) cylinder(h=NodeHeight+3,r=5,$fn=6);\n }\n }\n }\n drillHole(rad4);\n\n \/\/ drill hole to help allign fork linkage, must match linkage length below\n rotate([0,0,5]) translate([forkLen,0,0]) cylinder(h=3*NodeHeight,r=.6,$fn=6);\n }\n\n \/\/ diagnostic slice to examine walls\n \/\/translate([0,-2,-2]) cube([4,44,33]);\n}\n\n\/\/ custom support\ncolor(\"Cyan\") union() {\n translate([-28,1,2.2]) rotate([0,0,10]) cube([0.35,8,4.4],center=true);\n translate([-29.5,0,2.2]) rotate([0,0,5]) cube([0.35,9,4.4],center=true);\n translate([-31,0,2.2]) rotate([0,0,5]) cube([0.35,9,4.4],center=true);\n translate([-32.5,0,2.2]) rotate([0,0,5]) cube([0.35,10,4.4],center=true);\n translate([-34,0,2.2]) rotate([0,0,5]) cube([0.35,10,4.4],center=true);\n translate([-35.5,0,2.2]) rotate([0,0,5]) cube([0.35,10,4.4],center=true);\n translate([-37,0,2.2]) rotate([0,0,5]) cube([0.35,9,4.4],center=true);\n translate([-36.5,-2.5,2.2]) rotate([0,0,40]) cube([0.35,7,4.4],center=true);\n translate([-36.5,2.5,2.2]) rotate([0,0,-40]) cube([0.35,7,4.4],center=true);\n translate([-30,-2.5,2.2]) rotate([0,0,10]) cube([8,0.35,4.4],center=true);\n translate([-31,3.5,2.2]) rotate([0,0,-10]) cube([8,0.35,4.4],center=true);\n}\n\n}\n\n\/\/------------------------------------- end of BED1main\n\nmodule imBED(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n\/\/ Complete (Joined) version of BED, with in-place fork\nmodule imBEDj(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nunion() {\nimBEDmain(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork, in place\ntranslate([-dLeft,0,-.01]) { rotate([0,0,5]) { \n rotate([180,0,0]) forkTab(ForkHeight+.2,Drad+2,rad4+1.4,forkLen);\n\n#hull(){\n translate([forkLen ,0,0])cylinder(h=NodeHeight-2,r=2.8,$fn=12);\n translate([forkLen+1.5,4,1.1])sphere(r=1,$fn=6);\n translate([forkLen+2,0,0])cylinder(h=NodeHeight-2,r=2.2,$fn=12);}\n}}\n\n}}\n\n\/\/imBED(DEleft,DE,DEperp);\n\n\/\/ version of BED intended for one-sided injection mold\nmodule BED1(dLeft,dBase,dPerp) { \/\/------------------------------------ BED\nBED1main(dLeft,dBase,dPerp);\n\n\/\/ add other side of fork\ntranslate([-dLeft+0.7*forkLen,1.2*forkLen,0]) rotate([0,0,40])\n forkTab(ForkHeight+.1,Drad+2,rad4+1.4,forkLen);\n}\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ea5d1bae104cb353a48257a6ec0144fd8b532d96","subject":"Tail still messed","message":"Tail still messed\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Unicorn by Paul Houghton \u00a9 2015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=12;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nhair_thickness = mane_thickness \/ 8;\nhair_spacing = mane_thickness \/ 2;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\ntail_thickness = mane_thickness;\ntail_radius = 1.5 * body_back_radius \/ 3;\ntail_x = 2*body_x + body_length - tail_radius;\ntail_height = -body_z + 1.7*tail_radius;\ntail_tip_length = 30;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule hair_line(x = 0, z = 0, hair_radius = mane_radius, delta_x = body_x, delta_z = body_z) {\n translate([x, 0, z])\n difference() {\n hull() {\n cylinder(h = mane_thickness, r = hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius);\n }\n hull() {\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n }\n hair_line();\n hair_line(hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nmodule tailhair_line(x = 0, z = 0, delta_x = body_x, delta_z = 1.2*body_z) {\n translate([x, 0, z - hair_thickness])\n difference() {\n hull() {\n cylinder(h = tail_thickness, r = tail_radius);\n translate([delta_x, -delta_z, 0])\n cube([tail_tip_length, tail_tip_length - hair_thickness, tail_thickness]);\n }\n hull() {\n cylinder(h = tail_thickness, r = tail_radius - hair_spacing);\n translate([delta_x + hair_spacing, -delta_z + hair_spacing, 0])\n # cube([tail_tip_length, tail_tip_length - hair_thickness, tail_thickness]);\n } \n }\n}\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2 - hair_thickness, tail_height])\n rotate([90, 0, 0]) {\n intersection() {\n union() {\n hull() {\n cylinder(h = tail_thickness - 2*hair_thickness, r = tail_radius);\n translate([body_x, -1.2*body_z, 0])\n cube([tail_tip_length, tail_tip_length, tail_thickness - 2*hair_thickness]);\n }\ncolor(\"blue\") tailhair_line();\n }\n cylinder(h = tail_thickness, r = tail_tip_length*1.25);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n base();\n}","old_contents":"\/\/ Unicorn by Paul Houghton \u00a9 2015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=90;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nhair_thickness = mane_thickness \/ 10;\nhair_spacing = mane_thickness \/ 2;\n\nmodule hair_line(x = 0, z = 0, hair_radius = mane_radius, delta_x = body_x, delta_z = body_z) {\n translate([x, mane_thickness\/2, z])\n difference() {\n hull() {\n cylinder(h = mane_thickness, r = hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius);\n }\n hull() {\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n }\n hair_line();\n hair_line(hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\ntail_x = 2*body_x + body_length;\ntail_thickness = mane_thickness;\ntail_radius = body_back_radius;\ntail_height = -body_z + tail_radius\/2;\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2, tail_height])\n rotate([90, 0, 0]) {\n hull() {\n cylinder(h = mane_thickness, r = tail_radius);\n translate([1.5*body_x, 1.5*(-body_z), 0])\n cube([tail_thickness, tail_thickness, tail_thickness]);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n # base();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7129cc7675d64a4490a2216e6d8251a3ad13308e","subject":"Added the boom and placed\/sized\/rotated parts.","message":"Added the boom and placed\/sized\/rotated parts.\n","repos":"PeterWithers\/MinimalGlider","old_file":"dlgFuselage.scad","new_file":"dlgFuselage.scad","new_contents":"module makeMainShape(shrinkValue){\n\ttranslate([shrinkValue\/2,0,shrinkValue])\n\tcube([boardLength-shrinkValue,boardWidth-shrinkValue*2,totalHeight],true);\n\trotate([0,90,0])translate([0,0,(boardLength+cowlingLength)\/2-1-shrinkValue])\n\tintersection(){\n\t\tcylinder(cowlingLength+1, cowlingTailRadius-shrinkValue, cowlingTipRadius-shrinkValue,true);\n\t\ttranslate([-shrinkValue,0,0]) cube([totalHeight,boardWidth-shrinkValue*2,cowlingLength-shrinkValue*2],true);\n\t}\n}\n\n\ntipDiameter = 15;\nshoulderRadius = 15;\nnoseLength = 40;\nwallThickeness = 0.4;\nboomDiameter = 7.5;\nboomLength = 825;\nfuselageCornerRadius = 8.7;\n\nservoWidth = 23;\nservoHeight = 12;\nservoDepth = 23;\nservoMountThickness = 3;\nservoMountOffset = 7;\nservoMountWidth = 33;\n\nservoPosOnBoom = 127;\n\nmodule makeServo() {\n\tcube([servoWidth,servoHeight,servoDepth],true);\n\ttranslate([0,0,servoMountOffset\/2]) cube([servoMountWidth,servoHeight,servoMountThickness],true);\n}\n\nmodule makeNose(offset){\n\thull(){\n\t\ttranslate([0,0,noseLength]) sphere(tipDiameter-offset);\n\t\ttranslate([0,0,-offset]) mainFuselage(offset, 1);\n\t\t\/\/sphere(shoulderRadius-offset);\n\t}\n}\n\nmodule hollowNose(){\n\tdifference(){\n\t\tmakeNose(0);\n\t\tunion(){\n\t\t\tmakeNose(wallThickeness);\n\t\t\ttranslate([0,0,-shoulderRadius\/2])\n\t\t\t\tcube([shoulderRadius*2,shoulderRadius*2,shoulderRadius],true);\n\t\t}\n\t}\n}\n\nmodule solidNose(){\n\tdifference(){\n\t\tunion(){\n\t\t\tmakeNose(0);\t\n\t\t\ttranslate([0,0,-5])\n\t\t\t\tmainFuselage(wallThickeness*2, 5);\n\t\t}\n\t\tcylinder(noseLength*2, boomDiameter\/2+1, boomDiameter\/2+1,true);\n\t}\n}\n\nmodule mainFuselage(offset, length){\nhull()\nfor ( i = [0 : 3] )\n\t{\n\t\trotate( i * 360 \/ 4 + 360 \/ 8, [0, 0, 1])\n\t\ttranslate([0, shoulderRadius, 0])\n\t\tcylinder(length,fuselageCornerRadius-offset,fuselageCornerRadius-offset);\n\t}\n}\nmodule fuselageLength(length){\n\tdifference(){\n\t\ttranslate([0,0,-length])mainFuselage(0, length);\n\t\ttranslate([0,0,-length-wallThickeness])mainFuselage(wallThickeness, length+wallThickeness*2);\n\t}\n}\nmodule makeServoGroup(){\n\ttranslate([-4.5,boomDiameter\/2+servoHeight\/2,noseLength-servoMountWidth\/2-servoPosOnBoom]) rotate(90,[0,1,0]) {\n\t\tmakeServo();\n\t\ttranslate([28,0,9]) rotate(180,[1,0,0]) makeServo();\n\t}\n}\nmodule makeBoom() {\n\ttranslate([0,0,noseLength-boomLength\/2])\n\t\tcylinder(boomLength, boomDiameter\/2, boomDiameter\/2,true);\n}\nmodule makeNonPrintedParts() {\n\tmakeServoGroup();\n\tmakeBoom();\n}\nsolidNose();\n%fuselageLength(150);\n\/\/hollowNose();\n\/\/mainFuselage(0,1);\nmakeNonPrintedParts();\n","old_contents":"module makeMainShape(shrinkValue){\n\ttranslate([shrinkValue\/2,0,shrinkValue])\n\tcube([boardLength-shrinkValue,boardWidth-shrinkValue*2,totalHeight],true);\n\trotate([0,90,0])translate([0,0,(boardLength+cowlingLength)\/2-1-shrinkValue])\n\tintersection(){\n\t\tcylinder(cowlingLength+1, cowlingTailRadius-shrinkValue, cowlingTipRadius-shrinkValue,true);\n\t\ttranslate([-shrinkValue,0,0]) cube([totalHeight,boardWidth-shrinkValue*2,cowlingLength-shrinkValue*2],true);\n\t}\n}\n\n\ntipDiameter = 15;\nshoulderRadius = 18;\nnoseLength = 40;\nwallThickeness = 0.4;\nboomDiameter = 7.5;\nboomLength = 825;\nfuselageCornerRadius = 8.7;\n\nmodule makeServo(){\n\tservoWidth = 23;\n\tservoHeight = 12;\n\tservoDepth = 23;\n\tservoMountThickness = 3;\n\tservoMountOffset = 7;\n\tservoMountWidth = 33;\n\n\tcube([servoWidth,servoHeight,servoDepth],true);\n\ttranslate([0,0,servoMountOffset\/2]) cube([servoMountWidth,servoHeight,servoMountThickness],true);\n}\n\nmodule makeNose(offset){\n\thull(){\n\t\ttranslate([0,0,noseLength]) sphere(tipDiameter-offset);\n\t\ttranslate([0,0,-offset]) mainFuselage(offset, 1);\n\t\t\/\/sphere(shoulderRadius-offset);\n\t}\n}\n\nmodule hollowNose(){\n\tdifference(){\n\t\tmakeNose(0);\n\t\tunion(){\n\t\t\tmakeNose(wallThickeness);\n\t\t\ttranslate([0,0,-shoulderRadius\/2])\n\t\t\t\tcube([shoulderRadius*2,shoulderRadius*2,shoulderRadius],true);\n\t\t}\n\t}\n}\n\nmodule solidNose(){\n\tdifference(){\n\t\tunion(){\n\t\t\tmakeNose(0);\t\n\t\t\ttranslate([0,0,-5])\n\t\t\t\tmainFuselage(wallThickeness*2, 5);\n\t\t}\n\t\tcylinder(noseLength, boomDiameter, boomDiameter,true);\n\t}\n}\n\nmodule mainFuselage(offset, length){\nhull()\nfor ( i = [0 : 3] )\n\t{\n\t\trotate( i * 360 \/ 4, [0, 0, 1])\n\t\ttranslate([0, shoulderRadius, 0])\n\t\tcylinder(length,fuselageCornerRadius-offset,fuselageCornerRadius-offset);\n\t}\n}\nmodule fuselageLength(length){\n\tdifference(){\n\t\ttranslate([0,0,-length])mainFuselage(0, length);\n\t\ttranslate([0,0,-length-wallThickeness])mainFuselage(wallThickeness, length+wallThickeness*2);\n\t}\n}\nmodule makeServoGroup(){\n\tmakeServo();\n\ttranslate([28,0,9]) rotate(180,[1,0,0]) makeServo();\n}\n\/\/solidNose();\nfuselageLength(15);\n\/\/hollowNose();\n\/\/mainFuselage(0,1);\n%makeServoGroup();","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7b359123bd9f7e00433159299b47b28ba2ba409f","subject":"config: define y motor z offset from belt path","message":"config: define y motor z offset from belt path\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = 5*mm;\n\nyaxis_motor_offset_z = yaxis_belt_path_offset_z - 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \n\/*include *\/\ninclude \ninclude \n\ninclude \n\nuse \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\nMat_filament = Mat_PlasticBlack;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing_top = LinearBearingLM10;\nxaxis_bearing_bottom = xaxis_bearing_top;\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+get(LinearBearingOuterDiameter, xaxis_bearing_top)\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nxaxis_endstop_type = \"SWITCH\";\n\/*xaxis_endstop_type = \"SN04\";*\/\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing = LinearBearingLM12;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\n\nyaxis_belt = TimingBelt_GT2_2;\nyaxis_belt_width = 6*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 10*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nMat_PrintCarriage = Mat_Aluminium;\nMat_PrintBed = [.6,.5,.5];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing = LinearBearingLMH12L;\nzaxis_bearing_ID=get(LinearBearingInnerDiameter,zaxis_bearing);\nzaxis_bearing_OD=get(LinearBearingOuterDiameter,zaxis_bearing);\nzaxis_bearing_L=get(LinearBearingLength,zaxis_bearing);\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\nzaxis_nut_mat = Mat_PlasticBlack;\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing_OD\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_mount_screw_offset_x + zaxis_rod_screw_distance_x;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fd43548861bc51ad293a1e9fcb994e32d4faad6b","subject":"Create deksobiroza_2.scad","message":"Create deksobiroza_2.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/deksobiroza_2.scad","new_file":"3D-models\/SCAD\/deksobiroza_2.scad","new_contents":"z=9; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([0,-50,-0.1])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([-28,-73,-1])cube ([20,45,11]);\n\ntranslate ([2,-80,1]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,z]);\ntranslate ([0,-50,-0.1])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3D-models\/SCAD\/deksobiroza_2.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"3aafb1eff55b8249975f9251588b5235e099217d","subject":"Add micro USB port for Pro Micro board","message":"Add micro USB port for Pro Micro board","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ProMicro.scad","new_file":"hardware\/vitamins\/ProMicro.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\n\/\/ Pro Micro\/Mini\nboard_colour = [26\/255, 90\/255, 160\/255];\nmetal_colour = [220\/255, 220\/255, 220\/255];\n\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n micro_usb_area = [7.7, 5.2];\n micro_usb_height = 2.7;\n\n color(metal_colour)\n translate([pcbWidth\/2 - holeInset, pcbLength - holeSpace, pcbHeight])\n linear_extrude(height=2.7)\n square(size = micro_usb_area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(board_colour)\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro(type = \"mini\") {\n color([26\/255, 90\/255, 160\/255])\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"de5d5b80ed3d0890f8e4900da7aa7bfd3029f257","subject":"supported dome routines","message":"supported dome routines\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/SupportedShell.scad","new_file":"hardware\/sandbox\/SupportedShell.scad","new_contents":"include <..\/config\/config.scad>\n\nDebugCoordinateFrames = true;\nDebugConnectors = true;\n\nsw = 2 * 0.5; \/\/ approx 2 perimeters\n\nfunction sqr(a) = a*a;\n\nfunction circumference(radius) = 2 * PI * radius;\nfunction arcLength(radius, theta) = PI * radius * theta \/ 180;\nfunction chordLength(radius, theta) = radius * sqrt(2 - 2*cos(theta));\nfunction segmentHeight(radius, theta) = radius - sqrt(sqr(radius) - sqr(chordLength(radius, theta))\/4);\nfunction segmentDistance(radius,theta) = radius - segmentHeight(radius,theta);\n\n\n\/\/ 2D\n\/\/ in XY plane\n\/\/ chord begins at intersection of x+\n\/\/ extends towards y+\n\/\/ theta should be <= 180 degrees\nmodule circularSegment(radius, theta) {\n\techo(segmentHeight(radius,theta));\n\tintersection() {\n\t\tcircle(radius);\n\t\t\n\t\t\/\/ chord hull\n\t\tpolygon(\n\t\t[\n\t\t\t[radius, 0],\n\t\t\t[2*radius * cos(theta*0.25), 2*radius * sin(theta*0.1)],\n\t\t\t[2*radius * cos(theta*0.5), 2*radius * sin(theta*0.5)],\n\t\t\t[2*radius * cos(theta*0.75), 2*radius * sin(theta*0.9)],\n\t\t\t[radius * cos(theta), radius * sin(theta)]\n\t\t], 5);\n\t}\n}\n\n\nmodule domeSupportSegment(radius=100, inset=0, thickness=1, supportAngle=45) {\n\tinsetAng = asin(inset\/radius);\t\n\ttheta = 180 - 2*supportAngle - 2*insetAng;\n\n\trotate([0,0,90 - theta - insetAng])\n\t\tlinear_extrude(thickness)\n\t\tcircularSegment(radius,theta);\n}\n\n\nmodule shell() {\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\t\t\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\trotate_extrude()\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\tdonutSector2D(\n\t\t\t\t\t\t\tor=BaseDiameter\/2 + Shell_NotchTol + sw, \n\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t\t\t\t\/\/ clearance for pen\n\t\t\t\t\t\tsquare([PenHoleDiameter\/2, BaseDiameter]);\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\/\/ large support ribs\n\t\t\t\tfor (i=[0:9])\n\t\t\t\t\trotate([0,0,i*360\/10])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2, perim, 50);\n\t\t\t\t\t\n\t\t\t\t\/\/ small support ribs\n\t\t\t\tfor (i=[0:9])\n\t\t\t\t\trotate([0,0,i*360\/10 + 360\/20])\n\t\t\t\t\trotate([90,0,0])\n\t\t\t\t\tdomeSupportSegment(BaseDiameter\/2, PenHoleDiameter\/2 + 10, perim, 50);\n\t\t\t}\n\t\t\n\t\t\t\/\/ section\n\t\t\t*translate([-100,-200,-100])\n\t\t\t\tcube([200,200,200]);\n\t\t}\n}\n\nshell();","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/sandbox\/SupportedShell.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b9d79a0ad356feedaebae4bea9c01d8d45ac43a0","subject":"feat: register the collection of animate operators","message":"feat: register the collection of animate operators\n","repos":"jsconan\/camelSCAD","old_file":"operators.scad","new_file":"operators.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Entry point of the camelSCAD library.\n *\n * Features set: Includes the core components and the operators.\n *\n * @author jsconan\n *\/\n\n\/* CORE *\/\ninclude \n\n\/* OPERATORS *\/\ninclude \ninclude \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \n\ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\ninclude \n\ninclude \ninclude \ninclude \n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Entry point of the camelSCAD library.\n *\n * Features set: Includes the core components and the operators.\n *\n * @author jsconan\n *\/\n\n\/* CORE *\/\ninclude \n\n\/* OPERATORS *\/\ninclude \ninclude \ninclude \ninclude \n\ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\ninclude \n\ninclude \ninclude \ninclude \n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"af0efaf9eda498523fe30c27390c64ffccd95e75","subject":"adjusted cut offset parameter","message":"adjusted cut offset parameter\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 40 * 2;\n cut_width = 440;\n cut_offset = 1.0;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 560;\n base_depth = 440;\n display_projection = true;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n module baser(width, depth, sections = 2) {\n translate([(- width + sections * 20) \/ 2 - 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n translate([( width - sections * 20) \/ 2 + 10, -10, -base_depth\/2])\n rotate([0,0,90])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 30 * sections;\n translate([-lateral_beam_width\/2, -10, -base_depth\/2+20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n translate([-lateral_beam_width\/2, -10, base_depth\/2-20])\n rotate([90,0,90])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 2;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n baser(width, base_depth, 2);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width - 20 - offset * 2;\n plate_depth = base_depth - 40 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, width \/ 2 + rail_sections * 2 - 5);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - width \/ 2 + 30])\n rotate([90,90,0])\n profile(3, 120);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"71b5fe9e0d7326e07c7460ff7410b35c017b144e","subject":"lens tube","message":"lens tube\n","repos":"DamCB\/mush","old_file":"scad\/mush.scad","new_file":"scad\/mush.scad","new_contents":"\n\n\/\/ contact lens\n\nphi_cl = 13.8;\nRC_cl = 8.6;\ne_cl = 1;\nd1_cl = sqrt(pow(RC_cl, 2) - pow(phi_cl\/2, 2));\n\n\nmodule contact_lens(phi_cl, RC_cl, e_cl, d1_cl){\n translate([0, 0, e_cl-RC_cl])\n difference(){\n\t difference(){\n\t sphere(RC_cl+e_cl, $fn=36);\n\t sphere(RC_cl, $fn=36);\n\t translate([0, 0, -d1_cl])\n\t\t cube([4 * RC_cl, 4*RC_cl,\n\t\t\t 2*d1_cl + RC_cl],\n\t\t\t center=true);\n\t }\n };\n}\n\n\n%contact_lens(phi_cl, RC_cl, e_cl, d1_cl);\n\nh=5;\nmodule lens_tube(h, phi_cl, RC_cl, e_cl, d1_cl){\n translate([0, 0, -h-d1_cl+2*e_cl])\n\t difference(){\n\t cylinder(h=h, d=phi_cl+4*e_cl);\n\t union(){\n\t translate([0, 0, -e_cl\/2])\n\t\t cylinder(h=h+e_cl,\n\t\t\t d=phi_cl+e_cl);\n\t translate([0, 0, h-e_cl+0.1])\n\t\t cylinder(h=e_cl, d=phi_cl+3*e_cl);\n\t }\n }\n}\nlens_tube(h, phi_cl, RC_cl, e_cl, d1_cl);\n","old_contents":"\n\n\/\/ contact lens\n\nphi_cl = 13.8;\nRC_cl = 8.6;\ne_cl = 1;\n\n\nmodule contact_lens(phi_cl, RC_cl, e_cl){\n d1_cl = sqrt(pow(RC_cl, 2) - pow(phi_cl\/2, 2));\n translate([0, 0, e_cl-RC_cl])\n difference(){\n\t difference(){\n\t sphere(RC_cl+e_cl, $fn=36);\n\t sphere(RC_cl, $fn=36);\n\t translate([0, 0, -d1_cl]) cube([4 * RC_cl, 4*RC_cl,\n\t\t\t\t\t 2*d1_cl + RC_cl],\n\t\t\t\t\t center=true);\n\t }\n };\n}\n\n\n%contact_lens(phi_cl, RC_cl, e_cl);\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"cb51d07fc832362fcd4fb61b5bf2003935f75a2c","subject":"pulley: add flip param","message":"pulley: add flip param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"pulley.scad","new_file":"pulley.scad","new_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1.15*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?0:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n flip=flip,\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, flip=false, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, full_h==undef?h:full_h], align=align, orient=orient)\n {\n \/\/for flipping\n mirror([0,0,flip?-1:0])\n \/\/center\n translate([0,0,full_h==undef?-h\/2:-full_h\/2])\n difference()\n {\n union()\n {\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,0])\n fncylindera(d = inner_d, h = h, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = walls, align=[0,0,1], orient=[0,0,1]);\n\n translate([0,0,h])\n if(!is_idler)\n {\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,1], orient=[0,0,1]);\n }\n }\n translate([0,0,-.1])\n fncylindera(d = bore, h = full_h+.2, align=[0,0,1], orient=[0,0,1]);\n }\n }\n}\n\n\/*debug = true;*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*[>pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);<]*\/\n \/*[>pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,1], flip=false);<]*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,-1], orient=[0,0,1], flip=false);*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\n\/\/ h, full_h, inner_d, outer_d, walls, bore\npulley_2GT_20T_idler = [8.65*mm, undef, 12*mm, 18*mm, 1*mm, 5*mm];\npulley_2GT_20T = [8.65*mm, 16*mm, 12*mm, 16*mm, 1*mm, 5*mm];\n\nmodule pulley(pulley=pulley_2GT_20T, align=[0,0,0], orient = [0,0,1])\n{\n is_idler = pulley[1] == undef;\n pulley_full(\n is_idler=is_idler,\n h=pulley[0],\n full_h=is_idler?0:pulley[1],\n inner_d=pulley[2],\n outer_d=pulley[3],\n walls=pulley[4],\n bore=pulley[5],\n align=align,\n orient=orient\n );\n}\n\nmodule pulley_full(h, inner_d, outer_d, bore, walls, is_idler=false, full_h, align=[0,0,0], orient = [0,0,1])\n{\n size_align(size=[outer_d, outer_d, h], align=align, orient=orient)\n {\n difference()\n {\n union()\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n fncylindera(d = outer_d, h = walls, align=[0,0,-z], orient=[0,0,1]);\n\n fncylindera(d = inner_d, h = h, align=[0,0,0], orient=[0,0,1]);\n\n if(!is_idler)\n {\n translate([0,0,h-walls])\n fncylindera(d = outer_d, h = full_h-h, align=[0,0,0], orient=[0,0,1]);\n }\n }\n fncylindera(d = bore, h = full_h, align=[0,0,0], orient=[0,0,1]);\n }\n }\n}\n\n\/*debug = false;*\/\nif(debug)\n{\n \/*pulley(pulley_2GT_20T_idler, align=[0,0,1], orient=[0,0,1]);*\/\n \/*pulley(pulley_2GT_20T, align=[0,0,1], orient=[0,0,1]);*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4fd10129ce4ede8e9eb8ba89a3abd35c05e56e79","subject":"Incremental improvement to fan filter holder","message":"Incremental improvement to fan filter holder\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"fan-filter-pivot\/fan-filter-pivot.scad","new_file":"fan-filter-pivot\/fan-filter-pivot.scad","new_contents":"\/* Fits the standard Hakko FA400 filters, holes for 120mm fan *\/\n\nmodule XYCenteredCube(size) {\n translate([-size[0]\/2, -size[1]\/2]) cube(size);\n}\n\nmodule XYCenteredClippedCube(size, clip) {\n difference() {\n XYCenteredCube(size);\n for(rotate=[0,90,180,270]) {\n rotate([0,0,rotate])\n linear_extrude(100)\n polygon(points=[\n [size[0]\/2 - clip, size[1]\/2],\n [size[0]\/2, size[1]\/2 - clip],\n [size[0] \/ 2, size[1] \/ 2]]);\n }\n }\n}\n\nmodule ThinWallCube(dims, thick=1.2) {\n \/* dims is outer size, centers in XY *\/\n inner_dim0 = dims[0] - thick * 2;\n inner_dim1 = dims[1] - thick * 2;\n difference() {\n translate([-dims[0]\/2,0,0])\n cube(dims);\n translate([-inner_dim0\/2,thick,-1])\n cube([inner_dim0, inner_dim1, dims[2] + 2]);\n }\n}\n\nmodule Arch(dims) {\n r = dims[0] \/ 2;\n translate([-dims[0]\/2,0])\n square([dims[0], dims[1]-r]);\n translate([0,dims[1]-r])\n circle(r=r);\n}\n\nmodule ThinWallArch(dims, thick=1.2) {\n \/* origin is at outer middle of square end (X). dims is total outer. *\/\n linear_extrude(height=dims[2]) difference() {\n Arch(dims);\n translate([0,thick]) Arch([dims[0]-thick*2, dims[1]-thick*2]);\n }\n}\n\nmodule Roundover(r=3,h=100) {\n\/* origin is middle in z, and outer edge *\/\ntranslate([-r,-r,-h\/2]) difference() {\ncube([r+r,r+r,h]);\ntranslate([0,0,-1]) cylinder(r=r,h=h+2);\n}\n}\n\n\/* rear *\/\ntranslate([-20,0,0]) {\ncube([6.5,30,6]);\ncube([6.5,3,8]);\n}\n\n\/* front *\/\ntranslate([-30,10,0])\ndifference() {\n cube([6.5,20,6]);\n translate([0,0,6]) rotate([90,0,0]) rotate([0,-90,0]) Roundover($fn=100);\n}\n\ntranslate([0,0,0]) {\ncube([8,12,8]);\ntranslate([4,20,4]) rotate([0,22.5,0]) rotate([90,0,0]) cylinder(r=3.5,h=10,$fn=8);\n}\n\n\/*ThinWallArch([10,16,6], $fn=100);\ntranslate([20,0,0]) ThinWallCube([10,16,6]);\n*\/\n\nmodule Arrow(l=10, w=3, r=1) {\n \/* stem *\/\n hull() {\n circle(r=r);\n translate([0,-l]) circle(r=r);\n }\n \/* left *\/\n hull() {\n circle(r=r);\n translate([-w, -w]) circle(r=r);\n }\n \/* right *\/\n hull() {\n circle(r=r);\n translate([w, -w]) circle(r=r);\n }\n}\n\n \n\/*translate([-70,-70])\n cube([140,140,6]);\n\/\/ inset for filter\ntranslate([0,0,2])\n XYCenteredCube([130,130,10]);\n\/\/ holes\nfor(rotate=[0:90:360])\n rotate([0,0,rotate])\n translate([105\/2, 105\/2,-1]) cylinder(r=2.6,h=100);\n*\/\nmodule Main() {\nunion () {\n ThinWallCube([10,12,7]);\n translate([0,6.2,5]) rotate([90,0,0])\n linear_extrude(height=1)\n Arrow(l=4,$fn=16);\n}\n\n\/* back leg *\/\ntranslate([-3.5,-4.5,-20])\n cube([7,5,40]);\n\/* back top retainer *\/\ntranslate([-3.5,-6,15])\n cube([7,4,5]);\n\/* back piece *\/\ntranslate([-130\/2,-6,-131])\n cube([130,6.5,130]);\n\n\/* front leg *\/\ntranslate([-3.5,1,-20])\n cube([7,3.5,28]);\n\/* front piece *\/\ntranslate([-130\/2,2,-131])\n cube([130,6.5,130]);\n\n}\n","old_contents":"module thin_wall_cube(dims, thick=1) {\n \/* centers in XY *\/\n inner_dim0 = dims[0] - thick * 2;\n inner_dim1 = dims[1] - thick * 2;\n difference() {\n translate([-dims[0]\/2,-dims[1]\/2,0])\n cube(dims);\n translate([-inner_dim0\/2,-inner_dim1\/2,-1])\n cube([inner_dim0, inner_dim1, dims[2] + 2]);\n }\n}\n\nmodule arrow(l=10, w=3, r=1) {\n \/* stem *\/\n hull() {\n circle(r=r);\n translate([0,-l]) circle(r=r);\n }\n \/* left *\/\n hull() {\n circle(r=r);\n translate([-w, -w]) circle(r=r);\n }\n \/* right *\/\n hull() {\n circle(r=r);\n translate([w, -w]) circle(r=r);\n }\n}\n \n\nunion () {\n thin_wall_cube([10,12,7]);\n translate([0,6.2,5]) rotate([90,0,0])\n linear_extrude(height=1)\n arrow(l=4,$fn=16);\n}\n\n\/* back leg *\/\ntranslate([-3.5,-4.5,-20])\n cube([7,5,40]);\n\/* back top retainer *\/\ntranslate([-3.5,-6,15])\n cube([7,4,5]);\n\/* back piece *\/\ntranslate([-130\/2,-6,-131])\n cube([130,6.5,130]);\n\n\/* front leg *\/\ntranslate([-3.5,1,-20])\n cube([7,3.5,28]);\n\/* front piece *\/\ntranslate([-130\/2,2,-131])\n cube([130,6.5,130]);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"6fae0d6dd9672b4ef92845e38eec1e9130acb4fc","subject":"prototype","message":"prototype\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tape_shorting_clamp\/tape_shorting_clamp.scad","new_file":"tape_shorting_clamp\/tape_shorting_clamp.scad","new_contents":"count=2;\n\nw = 18+2*(4+2*2);\n\nmodule distancingElement()\n{\n difference()\n {\n cube([w, 8+6, 2]);\n for(dx = [2+4\/2, w-(2+4\/2)])\n translate([dx, 8\/2+4\/2, -1])\n cylinder(r=4\/2, h=4, $fs=0.1);\n }\n}\n\nmodule clamp()\n{\n difference()\n {\n cube([w, 4+2*2, 2]);\n for(dx = [2+4\/2, w-(2+4\/2)])\n translate([dx, 8\/2, -1])\n cylinder(r=4\/2, h=4, $fs=0.1);\n }\n}\n\n\nfor(i = [0:count-1])\n translate([i*35,0,0])\n {\n distancingElement();\n for(dy = [0, 10])\n translate([0, 16+dy, 0])\n clamp();\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tape_shorting_clamp\/tape_shorting_clamp.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8098e0e0235969f2f3c2cc2d289d1b8013cc52c4","subject":"wanhao-i3-z-stop: make SideClamp a little bigger and easier to print","message":"wanhao-i3-z-stop: make SideClamp a little bigger and easier to print\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-z-stop\/zstop_all_2.scad","new_file":"wanhao-i3-z-stop\/zstop_all_2.scad","new_contents":"include <..\/libs\/trig.scad>;\n\n\/\/ enlarged to account for shrink\ng3mm = 3.45;\ng3mmnut = 5.85;\ng2mm = 2.0;\ngNutChamfer = 0.5;\n\ngMicroswitchHoleSpacing = 6.0;\ngSideClampHole1 = 0;\ngSideClampHole2 = 10;\n\ngTopClampY1 = 15;\ngTopClampY2 = 30;\ngClampOffset = 10;\ngSideClampOffset = 0;\n\nmodule NutTrap(x,h=100) {\n cylinder(d=x\/0.866,h=h,$fn=6);\n translate([0,0,-0.01])\n cylinder(d1=(x+gNutChamfer)\/0.866,d2=x\/0.866,h=gNutChamfer,$fn=6);\n}\n\n\/* cylinder_wall_thick should be a small integer *nozzle_dia *\/\nmodule NutTrapSupport(d,h,cylinder_wall_thick=0.7,cylinder_wall_offset=0.1) {\n cylinder(d=d+cylinder_wall_offset*2,h=h,$fn=16);\n}\n\n\nmodule Fillet(r,h=100) {\n difference() {\n cube([r,r,h]);\n translate([0,0,-1]) cylinder(r=r,h=h+2);\n }\n}\n\n\/* Side clamp, in two parts *\/\n\nmodule SideBody() {\n difference() {\n translate([0,-4,0]) cube([22,24,5+gSideClampOffset]);\n translate([-1,-5,3.5]) cube([11,27,5+gSideClampOffset]);\n translate([14,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([14+gMicroswitchHoleSpacing,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([8,gSideClampHole1,-1]) cylinder(d=g3mm,h=100,$fn=32);\n translate([8,gSideClampHole2,-1]) cylinder(d=g3mm,h=100,$fn=32);\n }\n}\n\ngSidePos1 = [8,18];\ngSidePos2 = [11,4];\ngSideCutoutRad = 25;\n\nmodule SideClamp() {\n difference() {\n hull() for(c=[[4,-2],[11,-2],[4,18],gSidePos1,gSidePos2])\n translate(c) cylinder(r=2,h=5,$fn=32);\n translate([0,0,-1])\n translate(CircleCircleIntersection(gSidePos1, gSidePos2, 2, gSideCutoutRad))\n cylinder(r=gSideCutoutRad,h=10,$fn=100);\n \/\/translate(gSidePos1) cylinder(r=2,h=10);\n \/\/translate(gSidePos2) cylinder(r=2,h=10);\n translate([8,gSideClampHole1,-1]) union() {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n translate([8,gSideClampHole2,-1]) {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n }\n}\n\n\n\/* Top clamp, in two parts *\/\n\nmodule TopBody() {\n difference() {\n union() {\n translate([-1,0,0]) cube([11,35,12]);\n \/* thing adjustment screw goes on *\/\n hull() for(x=[-9,0])\n for(y=[1,9])\n translate([x,y]) cylinder(r=1,h=12);\n translate([-2.99,11.99,0]) rotate([0,0,-90]) Fillet(2,12);\n }\n hull() {\n for(x=[5,10])\n for(y=[10,50])\n translate([x,y,3])\n cylinder(r=2,h=100);\n }\n hull() {\n for(x=[5+1.7,10])\n for(y=[10+1.7,50])\n translate([x,y,-1])\n cylinder(r=2,h=100);\n }\n \/* adjustment screw *\/\n translate([-5,5,0]) {\n NutTrap(g3mmnut,3);\n cylinder(d=g3mm,h=200);\n }\n \/* notch for frame *\/\n hull() {\n for(x=[8,20])\n translate([x,0,-1]) cylinder(r=2,h=100);\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([-10,y,6])\n rotate([0,90,0]) cylinder(d=g3mm,h=100);\n }\n \/* adjustment screw support *\/\n translate([-5,5,0]) NutTrapSupport(g3mm,3);\n}\n\nmodule TopClamp() {\n difference() {\n intersection() {\n cube([12,25,6]);\n hull() {\n translate([0,2,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,2,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n }\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0]) {\n cylinder(d=g3mm,h=100);\n NutTrap(g3mmnut,3);\n }\n }\n \/* clamp holes support *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0])\n NutTrapSupport(g3mm,3);\n}\n\nTopBody($fn=32);\n\n\/* to visualize together *\/\n\/* translate([11,gClampOffset,0]) rotate([0,-90,0]) Clamper($fn=32); *\/\n\/* for printing *\/\ntranslate([7,gClampOffset+2,0]) TopClamp($fn=32);\n\ntranslate([-25,15,0]) SideBody();\n\/* to visualise together *\/\n\/* translate([-25,15,5]) SideClamp(); *\/\n\/* for printing *\/\ntranslate([-15,-3,0]) rotate([0,0,90]) SideClamp();\n","old_contents":"\/\/ enlarged to account for shrink\ng3mm = 3.45;\ng3mmnut = 5.85;\ng2mm = 2.0;\ngNutChamfer = 0.5;\n\ngMicroswitchHoleSpacing = 6.0;\ngSideClampHole1 = 0;\ngSideClampHole2 = 10;\n\ngTopClampY1 = 15;\ngTopClampY2 = 30;\ngClampOffset = 10;\n\nmodule NutTrap(x,h=100) {\n cylinder(d=x\/0.866,h=h,$fn=6);\n translate([0,0,-0.01])\n cylinder(d1=(x+gNutChamfer)\/0.866,d2=x\/0.866,h=gNutChamfer,$fn=6);\n}\n\n\/* cylinder_wall_thick should be a small integer *nozzle_dia *\/\nmodule NutTrapSupport(d,h,cylinder_wall_thick=0.7,cylinder_wall_offset=0.1) {\n cylinder(d=d+cylinder_wall_offset*2,h=h,$fn=16);\n}\n\n\nmodule Fillet(r,h=100) {\n difference() {\n cube([r,r,h]);\n translate([0,0,-1]) cylinder(r=r,h=h+2);\n }\n}\n\n\/* Side clamp, in two parts *\/\n\nmodule SideBody() {\n difference() {\n translate([0,-4,0]) cube([22,24,5]);\n translate([-1,-5,3.5]) cube([11,27,5]);\n translate([14,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([14+gMicroswitchHoleSpacing,17,-1]) cylinder(d=g2mm,h=100,$fn=32);\n translate([8,gSideClampHole1,-1]) cylinder(d=g3mm,h=100,$fn=32);\n translate([8,gSideClampHole2,-1]) cylinder(d=g3mm,h=100,$fn=32);\n }\n \n}\n\nmodule SideClamp() {\n difference() {\n translate([3,-4,0]) cube([9,18,5]);\n translate([30+10,15,-1]) cylinder(r=30,h=100,$fn=100);\n translate([8,gSideClampHole1,-1]) union() {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n translate([8,gSideClampHole2,-1]) {\n cylinder(d=g3mm,h=100,$fn=32);\n translate([0,0,6.1]) scale([1,1,-1]) NutTrap(g3mmnut,3);\n }\n }\n}\n\n\n\/* Top clamp, in two parts *\/\n\nmodule TopBody() {\n difference() {\n union() {\n translate([-1,0,0]) cube([11,35,12]);\n \/* thing adjustment screw goes on *\/\n hull() for(x=[-9,0])\n for(y=[1,9])\n translate([x,y]) cylinder(r=1,h=12);\n translate([-2.99,11.99,0]) rotate([0,0,-90]) Fillet(2,12);\n }\n hull() {\n for(x=[5,10])\n for(y=[10,50])\n translate([x,y,3])\n cylinder(r=2,h=100);\n }\n hull() {\n for(x=[5+1.7,10])\n for(y=[10+1.7,50])\n translate([x,y,-1])\n cylinder(r=2,h=100);\n }\n \/* adjustment screw *\/\n translate([-5,5,0]) {\n NutTrap(g3mmnut,3);\n cylinder(d=g3mm,h=200);\n }\n \/* notch for frame *\/\n hull() {\n for(x=[8,20])\n translate([x,0,-1]) cylinder(r=2,h=100);\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([-10,y,6])\n rotate([0,90,0]) cylinder(d=g3mm,h=100);\n }\n \/* adjustment screw support *\/\n translate([-5,5,0]) NutTrapSupport(g3mm,3);\n}\n\nmodule TopClamp() {\n difference() {\n intersection() {\n cube([12,25,6]);\n hull() {\n translate([0,2,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,4]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,50,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n translate([0,2,-50]) rotate([0,90,0]) cylinder(r=2,h=100);\n }\n }\n \/* clamp holes *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0]) {\n cylinder(d=g3mm,h=100);\n NutTrap(g3mmnut,3);\n }\n \n }\n \/* clamp holes support *\/\n for(y=[gTopClampY1,gTopClampY2])\n translate([6,y-gClampOffset,0])\n NutTrapSupport(g3mm,3);\n}\n\nTopBody($fn=32);\n\n\/* to visualize together *\/\n\/* translate([11,gClampOffset,0]) rotate([0,-90,0]) Clamper($fn=32); *\/\n\/* for printing *\/\ntranslate([7,gClampOffset+2,0]) TopClamp($fn=32);\n\ntranslate([-25,15,0]) SideBody();\ntranslate([-15,-2,0]) rotate([0,0,90]) SideClamp();\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"a7fc1e627eeb5b0d19b9a31b0914318212975d17","subject":"Printable version of the as yet unnamed one-handed typing device which has been submitted to Shapeways","message":"Printable version of the as yet unnamed one-handed typing device which has been submitted to Shapeways\n","repos":"joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn","old_file":"typeatron\/typeatron.scad","new_file":"typeatron\/typeatron.scad","new_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\npinHoleRes = 10;\n\/*\ncornerRoundingRes = 50;\nconnectorPinRes = 50;\nledHoleRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nconnectorPinRes = 10;\nledHoleRes = 10;\n\/\/*\/\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.95;\nledRimThick = 1.0;\n\nlidThick = 1.5;\nfloorThick = 1.5;\n\ncaseWidth = 70;\ncaseLength = 130;\nthickestComponent = 7.9;\ncaseHeight = lidThick + floorThick + thickestComponent + 1;\n\nwallThick = caseHeight\/2;\n\necho(\"caseHeight: \", caseHeight);\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0;\npushButtonBaseThick = 1.5;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = 25;\nthumbButtonLength = 30;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = 0.3; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error2);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 27;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\n\nmodule button(length) {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n translate([length-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([length-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error2]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t\/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1.5,0, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1.5,pushButtonWellWidth-1.5, 0]) {\n cube([1.5,1.5,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([length,buttonWidth,buttonThick+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([length-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+3,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n \/\/translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n\n }\n\n for (i = [1:4]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbBevelLength - wallThick*2\/3)\/4,0]) {\n pinHole();\n }\n }\n translate([12,caseLength-thumbBevelLength+2,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-wallThick*2\/3,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-15, 0]) {\n pinHole();\n }\n translate([wallThick*2\/3,10,0]) {\n pinHole();\n }\n translate([10,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-8,wallThick*2\/3,0]) {\n pinHole();\n }\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2+8,wallThick*2\/3,0]) {\n pinHole();\n }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+thumbBevelBuffer,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-thumbBevelBuffer,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(fingerButtonLength, pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(thumbButtonLength, pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([42,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-1+wallThick+ledRimThick]) {\n cylinder(h=10,r=ledRimRadius+clearance, $fn=20);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick+cavityWidth-chargerHeaderWidth-error2,0,caseHeight-floorThick-chargerHeaderLength-error2]) {\n cube([chargerHeaderWidth+error2,wallThick+1,chargerHeaderLength+error2]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+error2,wallThick+1,powerSwitchWidth+error2]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick+1,nanoUsbHeight+clearance]);\n }\n }\n}\n\n\/\/ body\ndifference() {\n union() {\n basicCase();\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight-floorThick+0.001, r=3);\n }\n }\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick+2, caseLength-thumbBevelLength+3, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight*2\/3, r=1.5+error2, $fn=connectorPinRes);\n }\n\n \/\/ screwdriver\/leverage slots\n translate([wallThick,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n translate([wallThick+cavityWidth+3,caseLength-wallThick\/2,(caseHeight-buttonWidth)\/2]) {\n rotate([-60,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick+2, caseLength-thumbBevelLength+3, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, lidThick]) {\n cylinder(h=caseHeight\/3, r=1.5, $fn=connectorPinRes);\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([-10,0,10]) {\n for (i = [0:3]) {\n translate([0,i*(fingerButtonLength+2),0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }} \n }\n}\ntranslate([5,caseLength-35,10]) {\n rotate([90,180,-90]) {\n button(thumbButtonLength);\n } \n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ container for power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+error2,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([0,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([0,3,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","old_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\nerror2 = error * 2;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\n\/\/cornerRoundingRes = 50;\ncornerRoundingRes = 10;\npinHoleRes = 10;\n\/\/connectorPinRes = 50;\nconnectorPinRes = 10;\n\/\/ledHoleRes = 50;\nledHoleRes = 10;\n\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.10;\nchargerHeaderWidth = 2.56;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.9;\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 12;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 4;\npushButtonPressDepth = 0.3;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1.5;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonClearance = 0.3; \/\/ horizontal clearance between button and walls\nbuttonLip = 2.5;\nbuttonSlack = 0.5; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonRetainerThick = 1.0;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + error);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\npinHoleRadius = 0.8;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\nthumbBevelBuffer = 2;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\n\nmodule button() {\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes); }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([buttonLength-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n \/\/ stabilizer rods\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n translate([buttonLength-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n \/\/ retainer rods\n translate([buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n translate([buttonLength-buttonStabilizerWellWidth-buttonLip+buttonClearance,buttonClearance,buttonThick+pushButtonHeight-pushButtonWellDepth+buttonRetainerThick+buttonSlack+error]) {\n cube([buttonStabilizerWellWidth+buttonLip-2*buttonClearance,buttonWidth-2*buttonClearance, 1]);\n }\n }\n\n\t\/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([0,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-2,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([0,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-2,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+pushButtonPressDepth+10]);\n\/\/ cube([buttonLength,buttonWidth,pushButtonWellDepth+buttonThick-buttonWidth\/2+error]);\n\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n translate([-buttonLip,0,0]) {\n cube([buttonStabilizerWellWidth+buttonLip, buttonWidth, pushButtonWellDepth-buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2, $fn=cornerRoundingRes); \n }\n}\n\nmodule pinHole() {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n}\n\nmodule pinHoles() {\n translate([0,0,-1]) {\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+3,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n \/\/translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) { pinHole(); }\n\n }\n\n for (i = [1:5]) {\n translate([wallThick*2\/3,wallThick*2\/3 + i*(caseLength-thumbBevelLength - wallThick*2\/3)\/5,0]) {\n pinHole();\n }\n }\n translate([15,caseLength-thumbBevelLength+3,0]) {\n pinHole();\n }\n\n translate([thumbBevelWidth, caseLength-wallThick*2\/3,0]) {\n pinHole();\n }\n translate([thumbBevelWidth, caseLength-15, 0]) {\n pinHole();\n }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick, $fn=cornerRoundingRes);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick, $fn=cornerRoundingRes);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick, $fn=cornerRoundingRes);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+thumbBevelBuffer,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-thumbBevelBuffer,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error, $fn=ledHoleRes);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius+clearance, $fn=20);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick+cavityWidth-chargerHeaderWidth-2*error,0,caseHeight-floorThick-chargerHeaderLength-2*error]) {\n cube([chargerHeaderWidth+2*error,wallThick,chargerHeaderLength+2*error]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+2*error,wallThick,powerSwitchWidth+2*error]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick,nanoUsbHeight+clearance]);\n }\n }\n}\n\n\/\/ body\ndifference() {\n union() {\n basicCase();\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight-floorThick+0.001, r=3);\n }\n }\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick+7, caseLength-thumbBevelLength+7, 0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight\/2+error2, r=1.5+error2, $fn=connectorPinRes);\n }\n}\n\n\/\/ lid\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n for (i = [0:4]) {\n translate([wallThick+cavityWidth+10,caseLength-fingerHeightOffset-fingerRad*i*2,0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n }\n translate([thumbBevelWidth-3, caseLength-wallThick-6, 0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick+7, caseLength-thumbBevelLength+7, 0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n translate([wallThick, wallThick, 0]) {\n cylinder(h=caseHeight\/2, r=1.5, $fn=connectorPinRes);\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\ntranslate([-5,0,10]) {\n for (i = [0:4]) {\n translate([0,i*(buttonLength+2),0]) { rotate([90,180,-90]) {\n \/\/cube([10,20,40]);\n\n button();\n }} \n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+2*error,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([0,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([0,3,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"38bcb3157e7b28be18142e0ee305dabe613268bc","subject":"added slot gantry extrusion","message":"added slot gantry extrusion\n","repos":"fponticelli\/smallbridges","old_file":"scad\/vslot_gantry_plate.scad","new_file":"scad\/vslot_gantry_plate.scad","new_contents":"use \r\n\r\nAnodizedBlack = [0.17, 0.17, 0.2];\r\n\r\nvslot_gantry_plate_height = 3;\r\n\r\nvslot_gantry_plate_holes_big = [\r\n\t[-30.32, 49.85],\r\n\t[ 0.00, 49.85],\r\n\t[ 30.32, 49.85],\r\n\r\n\t[-30.32, 39.85],\r\n\t[ 0.00, 39.85],\r\n\t[ 30.32, 39.85],\r\n\r\n\t[-30.32, 29.85],\r\n\t[ 0.00, 29.85],\r\n\t[ 30.32, 29.85],\r\n\r\n\t[-30.32, 19.85],\r\n\t[ 0.00, 19.85],\r\n\t[ 30.32, 19.85],\r\n\r\n\t[-30.32,-49.85],\r\n\t[ 0.00,-49.85],\r\n\t[ 30.32,-49.85],\r\n\r\n\t[-30.32,-39.85],\r\n\t[ 0.00,-39.85],\r\n\t[ 30.32,-39.85],\r\n\r\n\t[-30.32,-29.85],\r\n\t[ 0.00,-29.85],\r\n\t[ 30.32,-29.85],\r\n\r\n\t[-30.32,-19.85],\r\n\t[ 0.00,-19.85],\r\n\t[ 30.32,-19.85]\r\n];\r\n\r\nvslot_gantry_plate_sizes =[[],\r\n\t[65.5,65.5],\r\n\t[127,88]\r\n];\r\n\r\nmodule vslot_gantry_plate_big() {\r\n\tbom(\"vslot_gantry_plate_big\", str(\"V-Slot Gantry Plate: \", vslot_gantry_plate_sizes[1][0], \"x\", vslot_gantry_plate_sizes[1][1], \"mm\"), \"plates\");\r\n\r\n\tcolor(AnodizedBlack) {\r\n\t\tlinear_extrude(height = vslot_gantry_plate_height, center = true, convexity = 10)\r\n \t\timport (file = \"..\/dxf\/vslot_gantry_plate.dxf\");\r\n\t}\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/vslot_gantry_plate.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"83e69aa2e909f71b8d48202a56f485ee0557fa23","subject":"walls maked slimmer + fixed distances","message":"walls maked slimmer + fixed distances\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"walbrzych_paper_holder_fix\/paper_hilder_fix.scad","new_file":"walbrzych_paper_holder_fix\/paper_hilder_fix.scad","new_contents":"h=19.5;\n\ncube([36, 2.5, h]);\ntranslate([0, 9-2.5, 0])\n cube([29, 2.5, h]);\ncube([3, 9, h]);","old_contents":"h=19.5;\n\ncube([36, 3, h]);\ntranslate([0, 9, 0])\n cube([29, 3, h]);\ncube([3.5, 9, h]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"720ed87ccb71d16875d643e1c4e4f12a4eaeef29","subject":"rod-clamps: use material system","message":"rod-clamps: use material system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"rod-clamps.scad","new_file":"rod-clamps.scad","new_contents":"include \n\ninclude \nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n %size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","old_contents":"include \n\nuse \nuse \nuse \nuse \n\nmodule mount_rod_clamp_half(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : N;\n\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_half(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_half(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_half(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n cubea([outer_d\/2+.1, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n else if(part==\"vit\")\n {\n s=[outer_d, base_thick_, width];\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n}\n\nmodule mount_rod_clamp_full(part, rod_d=10, screw_dist=undef, width=4, thick=undef, base_thick=undef, thread=ThreadM4, align, orient, align_obj = \"rod\")\n{\n thick_=thick==undef?rod_d:thick;\n outer_d= rod_d+thick_*2;\n thread_dia=lookup(ThreadSize, thread);\n screw_dist_=screw_dist==undef?outer_d+thread_dia*2+thick_:screw_dist;\n base_thick_=base_thick==undef?thick_*1.2:base_thick;\n clamp_tolerance = 0.5*mm;\n\n pos_offset = align_obj == \"mount\" ? N : [-rod_d\/2,0,0];\n\n s=[base_thick_, screw_dist_+thread_dia*2.5, width];\n if(part==undef)\n {\n difference()\n {\n mount_rod_clamp_full(part=\"pos\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n mount_rod_clamp_full(part=\"neg\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n if($show_vit)\n {\n %mount_rod_clamp_full(part=\"vit\", rod_d=rod_d, screw_dist=screw_dist, width=width, thick=thick, base_thick=base_thick, thread=thread, align=align, orient=orient, align_obj=align_obj);\n }\n }\n else if(part==\"pos\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/*hull()*\/\n {\n \/\/ cylinder around rod\n translate([rod_d\/2,0,0])\n rcylindera(d=outer_d, h=width, orient=Z, align=N);\n\n \/\/ base\n \/*translate([-rod_d\/2,0,0])*\/\n rcubea([base_thick_, screw_dist_+thread_dia*2.5, width], align=X);\n }\n }\n }\n else if(part==\"neg\")\n {\n size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n {\n \/\/ cut bottom of cylinder\n \/*translate(-rod_d\/2*X)*\/\n cubea([outer_d\/2, screw_dist_+thread_dia*2.5+.1, width+1], align=[-1,0,0]);\n\n \/\/ cut clamp screw holes\n for(i=[-1,1])\n translate([0, i*screw_dist_\/2, 0])\n {\n screw_cut(thread=thread, orient=-X);\n }\n\n \/\/ cut rod\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n hull()\n {\n stack(axis=-X, dist=100)\n {\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n %size_align(size=s, align=align, orient=orient, orient_ref=Z)\n translate(pos_offset)\n translate([rod_d\/2,0,0])\n translate(-clamp_tolerance*X)\n cylindera(d=rod_d*rod_fit_tolerance, h=width*2, orient=Z);\n }\n}\n\nif(false)\n{\n \/*$show_vit=false;*\/\n \/*$preview_mode=false;*\/\n stack(axis=Z, dist=50)\n {\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"mount\");\n\n mount_rod_clamp_half(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n mount_rod_clamp_full(rod_d=yaxis_rod_d, width=extrusion_size, thick=4, thread=ThreadM5, align_obj=\"rod\");\n }\n}\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"dddab4236470f76b70cac3141915c90330278c63","subject":"support size decreased","message":"support size decreased\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"ball_support\/ball_support.scad","new_file":"ball_support\/ball_support.scad","new_contents":"ball_radius=610\/2; \/\/ [mm]\n\nmodule theBall()\n{\n translate([0, 0, ball_radius+2])\n sphere(r=ball_radius, $fn=100);\n}\n\ndifference()\n{\n cylinder(r=ball_radius\/5, h=20, $fn=100);\n #theBall();\n}\n","old_contents":"ball_radius=610\/2; \/\/ [mm]\n\nmodule theBall()\n{\n translate([0, 0, ball_radius+2])\n sphere(r=ball_radius, $fn=100);\n}\n\ndifference()\n{\n cylinder(r=ball_radius\/3, h=20, $fn=100);\n #theBall();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e494dc0eb941dec45ed5cb5763ff001136df6f1f","subject":"Just adding some basic code: Variables and other grunt lines","message":"Just adding some basic code: Variables and other grunt lines\n","repos":"agupta231\/fractal_prints","old_file":"olson_project_30_60_90.scad","new_file":"olson_project_30_60_90.scad","new_contents":"\/\/ https:\/\/www.github.com\/agupta231\n\n\/\/ User set variables\ninit_side_len = 50.8;\n\necho(version());\n\nmodule pattern() {\n\n}\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c16e6205ffd02511fcc0ac4ba2f177d31e13742e","subject":"main: add param for y carrriage pos","message":"main: add param for y carrriage pos\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n translate([0,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n hull()\n {\n translate([0,0,yaxis_bearing[0]\/2])\n {\n attach(ycarriage_bearing_mount_conn_bearing, [[0,0,0],[0,0,1]])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n translate([0,0,yaxis_belt_path_offset_z])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n }\n\n }\n\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,0]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,0]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n translate([0,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n hull()\n {\n translate([0,0,yaxis_bearing[0]\/2])\n {\n attach(ycarriage_bearing_mount_conn_bearing, [[0,0,0],[0,0,1]])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n translate([0,0,yaxis_belt_path_offset_z])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n }\n\n }\n\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,0,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,0]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,0]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3f2c0dfab1209081cc08ddf016b4dbb3cb1903f5","subject":"Added rounded cap","message":"Added rounded cap\n","repos":"kintel\/OpenSCAD-models","old_file":"horn.scad","new_file":"horn.scad","new_contents":"INCHES = 25.4;\n\nNUMBER = 5;\nDIAMETER = 60;\nHEIGHT = 120;\nTWIST = 0.5;\nDISTANCE = 0.7;\nSCALE = 5\/8;\n\nHOLLOW = false;\nINSIDE_COLOR = 1;\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST*360, scale=[SCALE, SCALE], convexity=3) child();\n}\n\nmodule basepart(item) {\n extrudepart() baseitem(item);\n translate([0,0,HEIGHT]) rotate([0,0,TWIST*360])\n scale(SCALE) rotate([0,0,item*360\/NUMBER])\n translate([DIAMETER\/2*DISTANCE,0]) \n sphere(DIAMETER\/2);\n}\n \nmodule part(item) {\n color(COLORS[item%NUM_COLORS]) {\n render() difference() {\n basepart(item);\n for (i=[0:NUMBER-1]) if (i!=item) basepart(i);\n }\n if (!HOLLOW && INSIDE_COLOR == item) inside();\n }\n}\n\nmodule inside() {\n extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n if (!HOLLOW) color(COLORS[INSIDE_COLOR]) inside();\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\n","old_contents":"INCHES = 25.4;\n\nNUMBER = 2;\nDIAMETER = 60;\nHEIGHT = 120;\nTWIST = 0.5;\nDISTANCE = 0.4;\nHOLLOW = false;\nSCALE = 6\/8;\n\nmodule baseshape(size) {\n circle(size\/2);\n* rotate([0,0,45]) square(size, center=true);\n* rotate([0,0,45]) pentagon(size\/2);\n}\n\n\nCOLORS = [\"White\", \"Red\", \"Green\", \"Blue\", \"Yellow\", \"Black\", \"Pink\"];\nNUM_COLORS = 8;\nITEM = -1;\nuse \n\n\nmodule base(neg = false) {\n if (neg) {\n difference() {\n translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n }\n else {\n translate([-DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n }\n}\n\nmodule baseitem(n) {\n rotate([0,0,n*360\/NUMBER]) translate([DIAMETER\/2*DISTANCE,0]) baseshape(DIAMETER);\n}\n\nmodule newbase(n) {\n difference() {\n baseitem(n);\n for (i=[0:NUMBER-1]) {\n if (i!=n) baseitem(i);\n }\n }\n}\n\nmodule smoother() {\n hull() {\n sphere(r=10);\n translate([0,0,54.5]) sphere(r=4);\n }\n}\n\nmodule extrudepart() {\n linear_extrude(height=HEIGHT, twist=TWIST*360, scale=[SCALE, SCALE], convexity=3) child();\n}\n\nmodule part(item) {\n color(COLORS[(item+1)%NUM_COLORS]) extrudepart() newbase(item);\n}\n\nmodule inside() {\n color(COLORS[0]) extrudepart() for (i=[1:NUMBER-1], j=[0:i-1]) {\n intersection() {baseitem(i); baseitem(j);}\n }\n}\n\nmodule horn(item) {\n if (item == -1) {\n for (x=[0:NUMBER-1]) part(x);\n }\n else {\n part(item);\n }\n}\n\nhorn(ITEM);\nif (!HOLLOW) inside();\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"be476d36ab7add20634526a5cd7dddf7f2ca5abe","subject":"xaxis\/ends: fix show_motor","message":"xaxis\/ends: fix show_motor\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 20*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[1,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n rcubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=true, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n hull()\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=false,\n show_zips=false\n );\n\n translate([-5*cm,0,0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=false,\n show_zips=false\n );\n }\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n cylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n \/*cubea([xaxis_end_beltpath_length, xaxis_beltpath_width, xaxis_beltpath_height+diag\/2]);*\/\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n \/*cubea([10*mm, xaxis_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);*\/\n\n \/*translate([10*mm, 0,0])*\/\n rcubea([30*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n cylindera(h=15*mm,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=100, orient=[1,0,0], align=[1,0,0]);\n\n translate([23*mm, 0,0])\n hull()\n {\n screw_nut(MHexNutM4, tolerance=1.25, orient=[1,0,0]);\n translate([0,-10,0])\n screw_nut(MHexNutM4, tolerance=1.25, orient=[1,0,0]);\n }\n\n }\n }\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([30*mm\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n\n xaxis_end_idlerholder();\n}\n\nif(false)\n{\n translate([0,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=true, show_motor=true, show_nut=false, show_bearings=false);\n\n translate([100,0,0])\n translate([0,0,xaxis_end_wz\/2])\n mirror([1,0,0])\n xaxis_end(with_motor=false, stop_x_rods=false, show_nut=false);\n\n translate([50,30,25])\n rotate([0,90,0])\n xaxis_end_idlerholder();\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 20*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap,d=xaxis_rod_d+5*mm, orient=[1,0,0], align=[1,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n rcubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=true, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n hull()\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=false,\n show_zips=false\n );\n\n translate([-5*cm,0,0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=false,\n show_zips=false\n );\n }\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n cylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n \/*translate([0,5,0])*\/\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n \/*translate([0,-1*mm,0])*\/\n \/*pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);*\/\n \/*motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);*\/\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n \/*cubea([xaxis_end_beltpath_length, xaxis_beltpath_width, xaxis_beltpath_height+diag\/2]);*\/\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_beltpath_width,xaxis_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n \/*cubea([10*mm, xaxis_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);*\/\n\n \/*translate([10*mm, 0,0])*\/\n rcubea([30*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n cylindera(h=15*mm,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=100, orient=[1,0,0], align=[1,0,0]);\n\n translate([23*mm, 0,0])\n hull()\n {\n screw_nut(MHexNutM4, tolerance=1.25, orient=[1,0,0]);\n translate([0,-10,0])\n screw_nut(MHexNutM4, tolerance=1.25, orient=[1,0,0]);\n }\n\n }\n }\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([30*mm\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n\n xaxis_end_idlerholder();\n}\n\nif(false)\n{\n translate([0,0,xaxis_end_wz\/2])\n xaxis_end(with_motor=true, show_motor=true, show_nut=false, show_bearings=false);\n\n translate([100,0,0])\n translate([0,0,xaxis_end_wz\/2])\n mirror([1,0,0])\n xaxis_end(with_motor=false, stop_x_rods=false, show_nut=false);\n\n translate([50,30,25])\n rotate([0,90,0])\n xaxis_end_idlerholder();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c436ccc6f3e17b60b1a82b133a3f189859a99b5d","subject":"x\/carriage: tweak size of endstop bumper","message":"x\/carriage: tweak size of endstop bumper\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \nuse \ninclude \n\nuse \n\nmodule x_extruder_hotend(side=-1, new=true)\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n\n mx(side>=1)\n tx(-16)\n tz(-29)\n rz(-90)\n rx(-90)\n tx(-123)\n ty(-123)\n import(\"stl\/thing_43783214\/30mm_clip_with_venturi_v3_50_by_thed0ct0r_.stl\");\n\n mx(side>=1)\n tx(-26)\n ty(-4.1)\n tz(-30)\n rz(10)\n fan(orient=X, align=-X);\n\n mx(side>=1)\n tz(-76.4)\n ty(-112.8)\n rx(-90)\n rz(180)\n import(\"stl\/thing_3316685\/e3d_v6_30mm_to_40mm_adapter.stl\");\n\n if(new)\n {\n tx(-13)\n ty(129)\n tz(-178)\n rz(180)\n ry(-90)\n import(\"stl\/thing_43783214\/Clip_with_sliding_guide_and_screw_slot_rev2.stl\");\n\n tx(-161.2)\n ty(-147.9)\n tz(71)\n rx(-90)\n rx(45)\n import(\"stl\/thing_43783214\/5015_sloped_layer_cooling.stl\");\n\n tx(-150.5)\n ty(-163.5)\n tz(-65.5)\n import(\"stl\/thing_43783214\/Prusa_like_nozzle_duct1.stl\");\n\n tx(-17)\n ty(-49)\n tz(-38)\n rx(-45)\n rz(-90)\n fan_5015S();\n }\n else\n {\n tx(-113.5)\n ty(-22.1)\n tz(-148)\n rz(-90)\n ry(-90)\n import(\"stl\/thing_2769783\/5015_layer_cooling_adapter_-_for_prusa_cooler_v1_2_-_rotated.stl\");\n\n tx(17)\n ty(-30)\n tz(-25)\n rz(180)\n rx(-90)\n rz(-90)\n fan_5015S();\n\n tx(-1)\n ty(13)\n tz(-4)\n rz(180)\n import(\"stl\/thing_2769783\/prusa_nozzle_fan_converted_2_v3_5L3.stl\");\n\n }\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,xaxis_carriage_thickness\/2,-8*mm])\n rcubea(size=[5,12,10], align=X+Y, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1*mm, orient=Y, align=-Y, extra_h=.1*mm, extra_align=Y);\n\n \/\/ cut out for shaft (so we can attach a knob)\n cylindera(d=extruder_b_bearing[0]+1*mm, h=1000, orient=Y, align=N);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=true, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, head_embed=true, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n sensormount_clamp(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-15*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n tz(-10*mm)\n rcubea(size=[18*mm,4*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(side)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n mx(side==1)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n mx(side==1)\n extruder_b();\n\n mx(side==1)\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n mx(side==1)\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend(side);\n\n mx(side==1)\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*187*mm:-129*mm)\n {\n mx(x==1)\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(x);\n\n mx(x==1)\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*270,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","old_contents":"include \n\nuse \nuse ;\nuse \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \nuse \ninclude \n\nuse \n\nmodule x_extruder_hotend(side=-1, new=true)\n{\n material(Mat_Aluminium)\n tz(-21.3*mm)\n rz(-90)\n rx(90)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n tz(-hotend_height)\n color(\"blue\")\n spherea(2, align=Z);\n\n tz(-hotend_height)\n {\n \/*fanduct();*\/\n }\n\n \/\/filament path\n material(Mat_PlasticBlack)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n\n mx(side>=1)\n tx(-16)\n tz(-29)\n rz(-90)\n rx(-90)\n tx(-123)\n ty(-123)\n import(\"stl\/thing_43783214\/30mm_clip_with_venturi_v3_50_by_thed0ct0r_.stl\");\n\n mx(side>=1)\n tx(-26)\n ty(-4.1)\n tz(-30)\n rz(10)\n fan(orient=X, align=-X);\n\n mx(side>=1)\n tz(-76.4)\n ty(-112.8)\n rx(-90)\n rz(180)\n import(\"stl\/thing_3316685\/e3d_v6_30mm_to_40mm_adapter.stl\");\n\n if(new)\n {\n tx(-13)\n ty(129)\n tz(-178)\n rz(180)\n ry(-90)\n import(\"stl\/thing_43783214\/Clip_with_sliding_guide_and_screw_slot_rev2.stl\");\n\n tx(-161.2)\n ty(-147.9)\n tz(71)\n rx(-90)\n rx(45)\n import(\"stl\/thing_43783214\/5015_sloped_layer_cooling.stl\");\n\n tx(-150.5)\n ty(-163.5)\n tz(-65.5)\n import(\"stl\/thing_43783214\/Prusa_like_nozzle_duct1.stl\");\n\n tx(-17)\n ty(-49)\n tz(-38)\n rx(-45)\n rz(-90)\n fan_5015S();\n }\n else\n {\n tx(-113.5)\n ty(-22.1)\n tz(-148)\n rz(-90)\n ry(-90)\n import(\"stl\/thing_2769783\/5015_layer_cooling_adapter_-_for_prusa_cooler_v1_2_-_rotated.stl\");\n\n tx(17)\n ty(-30)\n tz(-25)\n rz(180)\n rx(-90)\n rz(-90)\n fan_5015S();\n\n tx(-1)\n ty(13)\n tz(-4)\n rz(180)\n import(\"stl\/thing_2769783\/prusa_nozzle_fan_converted_2_v3_5L3.stl\");\n\n }\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings support\n tz(xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/ bottom bearings support\n tz(-xaxis_rod_distance\/2)\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n ty(-extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_carriage_beltpath_offset_y)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn, $explode=0)\n {\n sensormount(part);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-x_carriage_w\/2,xaxis_carriage_thickness\/2,-8*mm])\n rcubea(size=[8,10,10], align=X+Y, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n ty(xaxis_carriage_beltpath_offset_y)\n tz(z)\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_spread\/2,xaxis_carriage_bearing_spread\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n ty(-6*mm)\n {\n h=7*mm;\n if($preview_mode)\n {\n cylindera(d=extruder_gear_small_PD, h=h, orient=orient, align=align);\n }\n else\n {\n rx(90)\n tz(h\/2)\n gear(z=get(GearTeeth, extruder_gear_small), m=get(GearMod, extruder_gear_small), h=h);\n }\n }\n \/*h=13*mm;*\/\n\n \/*#cylindera(d=extruder_gear_small_PD, h=h-7*mm, orient=orient, align=align);*\/\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z, with_hub=false)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n if($preview_mode)\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n }\n else\n {\n tz(extruder_gear_big_h[0]\/2)\n gear(z=get(GearTeeth, extruder_gear_big), m=get(GearMod, extruder_gear_big),h=extruder_gear_big_h[0]);\n }\n\n if(with_hub)\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n ty(-(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n ty(-3*mm)\n ty(extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, head=\"button\", with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==U)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n if($show_vit)\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n ty(extruder_a_h)\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n\n \/\/ support around bearing\n ty(extruder_a_h)\n t(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n t(extruder_gear_big_offset)\n {\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n t(extruder_a_bearing_offset)\n cylindera(d=extruder_a_bearing[1]+bearing_pressfit_tolerance, h=1000*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n ty(extruder_a_h)\n ty(-extruder_gear_motor_dist)\n {\n ty(-.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n t(extruder_gear_big_offset)\n {\n ty(-between_bearing_and_gear)\n ty(-extruder_a_bearing[2])\n ty(-2*mm)\n extruder_gear_big(orient=Y, align=-Y);\n\n \/\/ bearing\n t(extruder_a_bearing_offset)\n bearing(extruder_a_bearing, orient=Y, align=-Y);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=-Y);\n }\n }\n\n ty(extruder_a_h)\n ry(extruder_motor_mount_angle)\n ty(-1*mm)\n {\n motor(model=extruder_motor, size=NemaMedium, orient=-Y);\n\n \/\/ motor heatsink\n ty(lookup(NemaLengthMedium, extruder_motor)+2*mm)\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n ty(11*mm)\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=-Y);\n }\n\n }\n\n }\n\n\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]+hotend_tolerance;\n h=hotend_d_h[e][1]+hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule extruder_b_filaguide(part)\n{\n base_thick = 2*mm;\n base_s=[hotend_outer_size_xy-5*mm, hotend_outer_size_xy, base_thick];\n\n if(part==undef)\n {\n difference()\n {\n extruder_b_filaguide(part=\"pos\");\n extruder_b_filaguide(part=\"neg\");\n\n t(-extruder_b_hotend_mount_offset)\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"guidecut\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b_filaguide(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base\n tz(.1*mm)\n cubea(base_s, align=Z);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n\n hull()\n {\n \/\/ base\n tz(.1*mm)\n cubea([extruder_filaguide_d, hotend_outer_size_xy\/2, base_thick], align=Z-Y);\n\n \/\/ outer tube\/support\n tz(.1*mm)\n rcylindera(d=extruder_filaguide_d, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut for filament at top\n pcylindera(d=filament_d+.25*mm, h=guidler_w, orient=Z, align=Z, extra_h=1*mm);\n\n \/\/ cut for ptfe tube\n pcylindera(d=extruder_ptfe_tube_d, h=-extruder_b_hotend_mount_offset.z-7*mm, orient=Z, align=Z);\n }\n else if(part==\"support\")\n {\n \/\/ filaguide base support\n tz(.1*mm)\n rcubea(base_s+[3*mm, 0, 1.5*mm], align=Z);\n }\n else if(part==\"cutout\")\n {\n tolerance = .4*mm;\n \/\/ base\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n cubea(base_s+[tolerance,tolerance,tolerance], align=Z);\n\n \/\/ outer tube\/support\n proj_extrude_axis(axis=-Y, offset=extruder_b_hotend_mount_offset.y)\n scale(1.01)\n r(X*180)\n tz(.1*mm)\n ty(-.1*mm)\n rcylindera(d=extruder_ptfe_tube_d+3*mm+.1*mm, h=-extruder_b_hotend_mount_offset.z, orient=Z, align=Z);\n }\n}\n\nmodule extruder_b_cableguide(part)\n{\n hh=8*mm;\n if(part==U)\n {\n difference()\n {\n extruder_b_cableguide(part=\"pos\");\n extruder_b_cableguide(part=\"neg\");\n }\n }\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n tx(1*mm)\n rcubea([10, 10, hh], align=-Y);\n }\n else if(part==\"neg\")\n {\n tx(-7*mm)\n ty(-7*mm)\n {\n hull()\n {\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n ty(-10)\n rcylindera(d=10*mm, h=hh+.1, orient=Z);\n }\n\n hollow_cylinder(\n d=14*mm,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-Z\n );\n }\n }\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n\n t(extruder_offset_c)\n extruder_c(part=\"neg\", is_extruder_b=true, $show_vit=false);\n\n attach(extruder_conn_guidler, guidler_conn, $explode=0)\n extruder_guidler(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler mount\n txz(extruder_b_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=extruder_b_thick, orient=Y, align=-Y);\n\n \/\/ guidler screw support\n txz(extruder_b_guidler_screw_offset)\n {\n d = guidler_screw_thread_dia + 3*mm;\n rcubea([d, extruder_b_thick, d], align=-Y);\n }\n\n \/\/ pushfit connector support\n t(extruder_b_filapath_offset)\n tz(20*mm)\n rcylindera(d=get(NutWidthMin, extruder_b_pushfit_nut)+3*mm, h=get(NutThickness, extruder_b_pushfit_nut)+1*mm, orient=Z, align=Z);\n }\n\n \/\/ filaguide slot and hotend support\n hull()\n {\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(extruder_b_hotend_mount_offset)\n t(extruder_b_hotend_clamp_offset)\n ty(-hotend_outer_size_xy\/2)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_thick, orient=Y, align=Y);\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"support\");\n }\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear window cutout\n t(extruder_b_drivegear_offset)\n ty(extruder_drivegear_drivepath_offset)\n ty(1*mm)\n {\n \/*cylindera(h=20, d=30\/2, orient=X, align=-X);*\/\n hull()\n {\n cubea([1,extruder_drivegear_h,extruder_drivegear_d_inner+1*mm], align=-X);\n tx(-20)\n cubea([1,extruder_drivegear_h+4*mm,extruder_drivegear_d_inner+30*mm], align=-X);\n }\n }\n\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide(part=\"cutout\");\n\n guidler_w_cut = guidler_w+.2*mm;\n\n t(extruder_b_guidler_screw_offset)\n tx(1*mm)\n ty(guidler_w_cut\/2)\n cubea([100,100,100], align=X-Y+Z);\n\n attach(extruder_conn_guidler, [N,guidler_conn[1]], $explode=0)\n ty(-guidler_w\/2)\n ty(guidler_w_cut\/2)\n {\n guidler_mount_d_ = guidler_mount_d+1*mm;\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=-Y);\n\n hull()\n {\n txz(-guidler_mount_off)\n cylindera(d=extruder_drivegear_bearing_d+2*mm, h=100, orient=Y, align=N-Y);\n\n cylindera(d=guidler_mount_d_, h=100, orient=Y, align=N-Y);\n\n t(-guidler_mount_off)\n tz(5*mm)\n ty(-100\/2)\n extruder_guidler(part=\"mainblock\", override_w=100);\n }\n\n guidler_pivot_r_bearing = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+0*mm;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n pie_slice(guidler_pivot_r_bearing, 90+120, 90+270, 100, orient=Y);\n\n guidler_pivot_r_mount = pythag_hyp(\n abs(guidler_mount_off.x),\n abs(guidler_mount_off.z))+(extruder_drivegear_bearing_d)\/2+(guidler_mount_d_)\/2;\n\n \/\/ cutout pivot to make sure guidler bearing\/drivegear can rotate out\n ty(-100)\n tz(-guidler_mount_d_\/2)\n pie_slice(guidler_pivot_r_mount, 90+145, 90+270, 100, orient=Y);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_guidler_mount_off)\n cylindera(d=get(ThreadSize, guidler_screw_thread), h=extruder_b_guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n txz(extruder_b_drivegear_offset)\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=-Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n pcylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n tz(extruder_drivegear_d_inner\/2+3*mm)\n pcylindera(h=1000, d=extruder_ptfe_tube_d, orient=Z, align=Z);\n }\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n translate(extruder_b_hotend_mount_offset)\n hotend_cut(extend_cut = true);\n\n \/\/ pushfit connector knurl nut\n t(extruder_b_filapath_offset)\n tz(20*mm)\n {\n screw_cut($show_vit=false, nut=extruder_b_pushfit_nut, with_head=\"false\", orient=-Z, align=Z, with_nut_access=false);\n\n \/\/ cut for ptfe tube underneath pushfit and knurl nut\n pcylindera(d=extruder_ptfe_tube_d, h=13*mm, orient=Z, align=-Z);\n }\n\n\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(extruder_b_hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n material(Mat_Steel)\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*ty(.1)*\/\n \/*bearing(extruder_b_bearing, orient=Y, align=-Y);*\/\n\n material(Mat_PlasticBlack)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n\n t(extruder_b_mount_offsets[2])\n tx(-4*mm)\n extruder_b_cableguide(part=part);\n\n t(extruder_b_mount_offsets[1])\n tx(-4.5*mm)\n extruder_b_cableguide(part=part);\n\n}\n\nmodule extruder_drivegear(part)\n{\n if(extruder_drivegear_type==\"Bondtech\")\n extruder_drivegear_bondtech(part);\n\n if(extruder_drivegear_type==\"MK8\")\n extruder_drivegear_mk8(part);\n}\n\nmodule extruder_drivegear_bondtech(part)\n{\n extruder_drivegear_drivepath_h = 2.4*mm;\n\n inner_d=extruder_drivegear_d_inner;\n outer_d=8*mm;\n\n inner_d_gear=7.45;\n outer_d_gear=extruder_drivegear_d_outer;\n\n gear_h = 4.1*mm;\n gear_offset=9.45;\n\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_bondtech(part=\"pos\");\n extruder_drivegear_bondtech(part=\"neg\");\n }\n if($show_vit)\n %extruder_drivegear_bondtech(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n \/\/ main gear body\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=extruder_drivegear_h, d=outer_d, orient=Y, align=Y);\n\n \/\/ gear teeth\n ty(-extruder_drivegear_drivepath_offset)\n ty(gear_offset)\n {\n\n ty(gear_h\/2)\n rx(90)\n gear(z=17, m=0.5, h=gear_h);\n }\n\n \/*translate([0,-extruder_drivegear_drivepath_h\/2,0])*\/\n \/*cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);*\/\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n material(Mat_Steel)\n {\n cylindera(d=5.01*mm, h=100, orient=Z);\n\n \/\/ drive path teeth\n torus($fn=32, d=outer_d+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n }\n else if(part==\"vit\")\n {\n material(Mat_Steel)\n ty(-extruder_drivegear_drivepath_offset)\n cylindera(h=gear_h, d=inner_d, orient=Y, align=Y);\n }\n}\n\nmodule extruder_drivegear_mk8(part)\n{\n extruder_drivegear_drivepath_h = 3.45;\n if(part==U)\n {\n difference()\n {\n extruder_drivegear_mk8(part=\"pos\");\n extruder_drivegear_mk8(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Steel)\n {\n difference()\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=N);\n torus($fn=32, d=extruder_drivegear_d_outer+extruder_drivegear_drivepath_h\/1.5, radial_width=extruder_drivegear_drivepath_h\/2, orient=Y);\n \/*cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);*\/\n }\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n else if(part==\"cutout\")\n {\n cylindera(h=1000, d=extruder_drivegear_d_outer, orient=Y, align=N);\n }\n else if(part==\"neg\")\n {\n cylindera(d=5.01*mm, h=100, orient=Y);\n }\n}\n\nmodule extruder_c(part=undef, is_extruder_b=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_c(part=\"pos\");\n extruder_c(part=\"neg\");\n }\n if($show_vit)\n %extruder_c(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ hobbed gear bearing support\n rcylindera(d=extruder_b_bearing[1]+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/\/ mount onto extruder B\n position(extruder_c_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_c_thickness, orient=Y, align=-Y);\n\n \/*\/\/ hotend clamp screws*\/\n \/*t(extruder_c_hotend_clamp_offset)*\/\n \/*for(x=[-1,1])*\/\n \/*tx(x*hotend_clamp_screws_dist)*\/\n \/*rcylindera(d=get(ThreadSize, extruder_hotend_clamp_thread)+8*mm, h=extruder_c_thickness, orient=Y, align=-Y);*\/\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n rcylindera(d=guidler_mount_d, h=extruder_c_thickness, orient=Y, align=-Y);\n \/*screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, orient=Y, align=Y);*\/\n }\n\n t(extruder_c_hotend_mount_offset)\n t(extruder_c_hotend_clamp_offset)\n cubea([hotend_clamp_screws_dist-.5*mm,hotend_outer_size_xy\/2,extruder_b_mount_dia], align=Y);\n\n }\n else if(part==\"neg\")\n {\n \/\/ b bearing cutout\n cylindera(d=extruder_b_bearing[1]+bearing_pressfit_tolerance, h=extruder_b_bearing[2]+1*mm, orient=Y, align=-Y, extra_h=.1*mm, extra_align=Y);\n\n \/\/ cut out for shaft (so we can attach a knob)\n cylindera(d=extruder_b_bearing[0]+1*mm, h=1000, orient=Y, align=N);\n\n \/*\/\/ guidler mount screw cut*\/\n \/*translate(extruder_b_bearing[2]\/2*Y)*\/\n \/*translate(extruder_b_guidler_mount_off)*\/\n \/*ty(-extruder_c_thickness)*\/\n \/*screw_cut(nut=guidler_screw_nut, h=extruder_b_guidler_mount_w+extruder_c_thickness+5*mm, orient=Y, align=Y);*\/\n\n t(extruder_c_hotend_mount_offset)\n ty(is_extruder_b?0:.5*mm)\n hotend_cut(extend_cut = false);\n\n \/\/ mount screws\n ty(-extruder_c_thickness)\n position(extruder_c_mount_offsets)\n screw_cut(thread=extruder_hotend_clamp_thread, h=hotend_clamp_screw_l, nut_offset=0*mm, head_embed=true, orient=Y, align=Y);\n\n \/\/ guidler mount screw hole\n tx(extruder_b_guidler_mount_off.x)\n tz(guidler_mount_off.z)\n ty(-extruder_c_thickness)\n screw_cut(thread=guidler_screw_thread, h=hotend_clamp_screw_l, head_embed=true, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n ty(.1)\n bearing(extruder_b_bearing, orient=Y, align=-Y);\n\n material(Mat_PlasticBlack)\n translate(extruder_c_filapath_offset)\n cylindera(h=1000, d=filament_d, orient=Z, align=N);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n if($show_vit)\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod\/gear between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=5*mm+1*mm, orient=Y, align=N);\n\n \/\/ we also want to allow drivegear through\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n\n \/\/ extruder A mount cutout\n t(extruder_offset)\n txz(extruder_offset_a)\n ry(extruder_motor_mount_angle)\n position(extruder_a_mount_offsets)\n {\n h= extruder_offset_a[1]+.2;\n echo(\"carriage => A screw length:\", h);\n screw_cut(\n $show_vit=true,\n nut=NutHexM3,\n h=h,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n screw_cut(\n nut=NutKnurlM3_3_42,\n h=4*mm,\n nut_offset=0,\n with_nut_access=false,\n head_embed=false,\n orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part=part);\n sensormount_clamp(part=part);\n }\n }\n}\n\nmodule extruder_guidler(part, override_w)\n{\n \/\/ for tolerance\/fit\n guidler_w_ = fallback(override_w, guidler_w -.5*mm);\n\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n\n t(guidler_mount_off)\n t(-extruder_b_guidler_mount_off)\n t(extruder_offset_b)\n t(extruder_offset_c)\n ty(guidler_w\/2)\n extruder_c(part=\"neg\", $show_vit=false);\n }\n if($show_vit)\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"mainblock\")\n {\n \/\/ guidler main block\n t(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(guidler_mount_d)\n rcubea([guidler_d, guidler_w_, 15*mm], align=-X, extra_size=guidler_extra_h_up*Z, extra_align=Z);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n guidler_x_2 = guidler_mount_off[1]-guidler_mount_d\/2;\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+1.5*mm,h=guidler_w_, orient=Y);\n\n \/*\/\/ filament guide*\/\n \/*tx(-extruder_drivegear_bearing_d\/2)*\/\n \/*tx(-filament_d\/2)*\/\n \/*tz(extruder_drivegear_bearing_d\/2)*\/\n \/*tz(6*mm)*\/\n \/*rcylindera(d=filament_d*2, h = 8*mm, align=-Z);*\/\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n \/\/ guidler bearing\/drivegear bolt\/screw support\n t(guidler_drivegear_offset)\n rcylindera(d=extruder_drivegear_bearing_id+3*mm, h=guidler_w_, orient=Y);\n\n \/\/ guidler mount point\n translate(guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_w_, orient=Y);\n }\n\n \/\/ tab, for easier open\n hull()\n {\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 15*mm)\n rcylindera(d=guidler_w_, h=2*mm, align=-X, orient=X);\n }\n\n hull()\n {\n extruder_guidler(part=\"mainblock\");\n\n txy(guidler_mount_off)\n tx(guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screw_thread_dia\/2 + 2*mm)\n rcylindera(d=guidler_w_, h=guidler_d, align=-X, orient=X);\n }\n }\n }\n else if(part==\"guidecut\")\n {\n \/\/ guidler bearing cutout\n cylindera(d=extruder_drivegear_bearing_d+1.5*mm, h=100, orient=Y);\n\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n }\n else if(part==\"neg\")\n {\n \/\/ drive gear cutout\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-extruder_drivegear_d_outer\/2)\n scale(1.10)\n extruder_drivegear(part=\"cutout\");\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .8*mm;\n bearing_cut_w = extruder_drivegear_bearing_h+2*bearing_mount_bump;\n t(guidler_drivegear_offset)\n difference()\n {\n cylindera(d=extruder_drivegear_bearing_d+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=extruder_drivegear_bearing_id+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n\n t(guidler_drivegear_offset)\n if(extruder_drivegear_type == \"Bondtech\")\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n hull()\n {\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n\n cubea([extruder_drivegear_bearing_id, extruder_drivegear_bearing_bolt_h, extruder_drivegear_bearing_id], align=-X);\n }\n }\n else\n {\n \/\/ guidler bearing\/drivegear screw holder cutout\n ty(-guidler_w\/2)\n ty(-1*mm)\n screw_cut(thread=extruder_drivegear_bearing_thread, head=\"button\", head_embed=true, h=guidler_w, orient=Y, align=Y, with_nut_access=false);\n }\n\n \/\/ port hole\/window to see bearing\n t(guidler_drivegear_offset)\n hull()\n {\n tx(extruder_drivegear_bearing_d\/3)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d-3*mm], align=-X);\n\n tx(10*mm)\n rcubea([3*mm, extruder_drivegear_bearing_h+1*mm, extruder_drivegear_bearing_d+6*mm], align=X);\n }\n\n \/\/ screw\/spring for tighten\n t(extruder_guidler_screw_offset)\n tx(-15*mm)\n screw_cut(thread=guidler_screw_thread, nut=guidler_screw_nut, h=30*mm, orient=-X, align=X, nut_offset=6*mm);\n }\n else if(part==\"vit\")\n {\n if(extruder_drivegear_type == \"Bondtech\")\n {\n extruder_drivegear();\n\n \/\/ bearing bolt\n t(guidler_drivegear_offset)\n material(Mat_Chrome)\n cylindera(d=extruder_drivegear_bearing_id, h=extruder_drivegear_bearing_bolt_h, orient=Y);\n }\n else\n {\n t(guidler_drivegear_offset)\n bearing(extruder_drivegear_bearing, orient=Y);\n }\n }\n else if(part==\"debug\")\n {\n \/\/ filament path\n material(Mat_PlasticBlack)\n tx(-extruder_drivegear_bearing_d\/2)\n tx(-filament_d\/2)\n \/*ty(-extruder_filament_bite)*\/\n cylindera(d=filament_d, h=1000*mm, align=N);\n }\n}\n\nmodule sensormount(part=undef)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\");\n sensormount(part=\"neg\");\n }\n if($show_vit)\n {\n sensormount(part=\"vit\");\n sensormount_clamp();\n }\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(4*mm)*\/\n tz(-2*mm)\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n ty(-7*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", head_embed=true, h=16*mm, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n hull()\n {\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n ty(-1000)\n rcylindera(d=8*mm, h=40*mm, orient=Z, align=Z);\n }\n }\n else if(part == \"vit\")\n tz(-18.5*mm)\n {\n material(Mat_Steel)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n\n color(\"white\")\n rcylindera(d=8*mm, h=4*mm, orient=Z, align=-Z);\n }\n}\n\nmodule sensormount_clamp(part=U)\n{\n if(part==U)\n {\n difference()\n {\n sensormount_clamp(part=\"pos\");\n sensormount_clamp(part=\"neg\");\n }\n if($show_vit)\n sensormount_clamp(part=\"vit\");\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n \/*ty(-10*mm)*\/\n ty(-3*mm)\n tz(-10*mm)\n rcubea(size=[18*mm,4*mm,8*mm], align=-Y);\n }\n else if(part == \"neg\")\n {\n ty(-8*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, head=\"button\", h=12*mm, head_embed=true, with_nut=true, orient=Y, align=Y);\n\n tz(-18.5*mm)\n rcylindera(d=8*mm, h=30*mm, orient=Z, align=Z);\n }\n else if(part == \"vit\")\n {\n }\n}\n\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_left_extruder_c()\n{\n rotate([90,0,0])\n extruder_c();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_right_extruder_c()\n{\n rotate([90,0,0])\n mirror(X)\n extruder_c();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [guidler_mount_off.x+guidler_mount_d\/2, 0, 0], X]; \n attach([N,-Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nmodule part_x_carriage_extruder_filaguide()\n{\n extruder_b_filaguide();\n}\n\nmodule part_x_carriage_sensormount_clamp()\n{\n rx(90)\n sensormount_clamp();\n}\n\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(side)\n{\n $show_conn=false;\n $show_vit=true;\n debug_filapath=false;\n\n $explode=0;\n \/*$explode=30*mm;*\/\n \/*$explode=50*mm;*\/\n\n translate(extruder_offset)\n {\n te(extruder_offset_a, Y*$explode)\n mx(side==1)\n extruder_a();\n\n te(extruder_offset_b+[0,-.1,0], Y*$explode)\n {\n difference()\n {\n union()\n {\n mx(side==1)\n extruder_b();\n\n mx(side==1)\n te(extruder_offset_b, Y*$explode)\n t(extruder_b_hotend_mount_offset)\n extruder_b_filaguide();\n\n mx(side==1)\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll, $explode=$explode\/2)\n extruder_guidler();\n\n attach(extruder_b_hotend_mount_conn, hotend_conn, roll=0)\n x_extruder_hotend(side);\n\n mx(side==1)\n te(extruder_offset_c, Y*$explode)\n extruder_c();\n }\n\n if(debug_filapath)\n t(extruder_b_filapath_offset)\n cubea([1000,1000,1000], align=-Y);\n }\n }\n }\n}\n\n\/*if(false)*\/\n{\n sides=[-1,1];\n \/*sides=[-1];*\/\n\n \/*if(false)*\/\n for(x=sides)\n \/*for(x=[-1,1])*\/\n tx(x==-1?x*187*mm:-129*mm)\n {\n mx(x==1)\n x_carriage_withmounts($show_vit=true, beltpath_sign=x, with_sensormount=x<0);\n\n x_carriage_extruder(x);\n\n mx(x==1)\n if(x<0)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n sensormount_clamp();\n }\n\n \/*if(false)*\/\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*if(false)*\/\n ty(xaxis_carriage_beltpath_offset_y)\n for(x=sides)\n translate([x*270,0,0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n ty(xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y)\n translate([xaxis_rod_offset_x,0,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"029f34063afc653916333dca5dee19a2d7546e1e","subject":"xaxis\/ends: use 2.5M screws for endstops","message":"xaxis\/ends: use 2.5M screws for endstops\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2-1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[5], h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders, width=xaxis_beltpath_width);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n translate([x*45,25,0])\n translate([x*-0,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2-1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[5], h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders, width=xaxis_beltpath_width);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n translate([x*45,25,0])\n translate([x*-0,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ca6c4d71e7cc5ea8958c19c5248b655b15362806","subject":"x\/carriage\/extruder\/b: fix bearing support\/cut","message":"x\/carriage\/extruder\/b: fix bearing support\/cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n ty(-guidler_bearing[1]\/2+2*mm)\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n ty(guidler_bearing[1]\/2)\n ty(-extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=Y);\n\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"601a2a157463ba1d7890442fc739d2e2384dcd58","subject":"adding missing source files","message":"adding missing source files\n","repos":"kak-bo-che\/zen_toolworks_quelab,Quelab\/zen_toolworks_quelab","old_file":"src\/simple_spoil_board.scad","new_file":"src\/simple_spoil_board.scad","new_contents":"object=\"spoil_board\";\nfile_type=\"dxf\";\n\nmodule base_plate(){\n\tsquare([240, 200]);\n}\n\nmodule long_slit(){\n\tlength=140;\n\twidth=6;\n\tunion(){\n\t\tsquare([width,length]);\n\t\ttranslate([3,-5.2]) circle(r=6);\n\t\ttranslate([3, length+5.2]) circle(r=6);\n\t}\n}\nmodule short_slit(){\n\tunion(){\n\t\tsquare([6,51]);\n\t\ttranslate([3,-5.2]) circle(r=6);\n\t\ttranslate([3, 56.2]) circle(r=6);\n\t}\n}\nmodule x_align(){\n\t square([10,200]);\n\ttranslate([20, 0]) square([10,200]);\n\ttranslate([40, 0]) square([10,200]);\n\ttranslate([60, 0]) square([10,200]);\n\ttranslate([80, 0]) square([10,200]);\n\ttranslate([100, 0]) square([10,200]);\n\ttranslate([120, 0]) square([10,200]);\n\ttranslate([140, 0]) square([10,200]);\n\ttranslate([160, 0]) square([10,200]);\n\ttranslate([180, 0]) square([10,200]);\n\ttranslate([200, 0]) square([10,200]);\n\ttranslate([220, 0]) square([10,200]);\n\n}\nmodule y_align(){\n\ttranslate([0, 10]) square([240,10]);\n\ttranslate([0, 30]) square([240,10]);\n\ttranslate([0, 50]) square([240,10]);\n\ttranslate([0, 70]) square([240,10]);\n\ttranslate([0, 90]) square([240,10]);\n\ttranslate([0, 110]) square([240,10]);\n\ttranslate([0, 130]) square([240,10]);\n\ttranslate([0, 150]) square([240,10]);\n\ttranslate([0, 170]) square([240,10]);\n\ttranslate([0, 190]) square([240,10]);\n\n}\nmodule spoil_board(){\n\t\/\/ 119 to 170\n\tdifference(){\n\t\tbase_plate([240, 200]);\n\t\ttranslate([17,30]) long_slit();\n\t\ttranslate([217,30]) long_slit();\n\t\ttranslate([67, 30]) short_slit();\n\t\ttranslate([167, 30]) short_slit();\n\t\ttranslate([67, 120]) short_slit();\n\t\ttranslate([167, 120]) short_slit();\n\t}\n}\n\nif(file_type==\"stl\"){\n\tif(object==\"y_align\") linear_extrude(height=1) y_align();\n\tif(object==\"x_align\") linear_extrude(height=1) x_align();\n\tif(object==\"spoil_board\") linear_extrude(height=1) spoil_board();\n} else {\n\tif(object==\"y_align\") y_align();\n\tif(object==\"x_align\") x_align();\n\tif(object==\"spoil_board\") spoil_board();\n\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'src\/simple_spoil_board.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"ac97a23599ff6fa0a34c2b9f91cf5a1d7850aba5","subject":"transforms: add r,rx,ry,rz modules","message":"transforms: add r,rx,ry,rz modules\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5c79e90ed2d24e05267c8be5efa3f2ecde608c5d","subject":"Update dezoxiriboza_v2.scad","message":"Update dezoxiriboza_v2.scad","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/dezoxiriboza_v2.scad","new_file":"3D-models\/SCAD\/dezoxiriboza_v2.scad","new_contents":"z=9; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([-16,-60,2])cube([20.35,20.35,4.2]);\ntranslate ([0,-50,2])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([8,-50,4.5])rotate([0,90,-30])cylinder (4.5+g,1,1);\ntranslate ([-28,-73,-1])cube ([20,45,11]);\n\ntranslate ([2,-80,1]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \ntranslate ([2+4.7,36+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,1,1); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,z]);\ntranslate ([-26,-61.2,2])cube([30.35,22,4.2]);\ntranslate ([0,-50,2])cylinder(4.2,10.35,10.35);\n\n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n","old_contents":"z=9; \/\/\u0432\u044b\u0441\u043e\u0442\u0430\ng=3.5; \/\/\u0433\u043b\u0443\u0431\u0438\u043d\u0430 \u0434\u044b\u0440\u043e\u043a \n\/\/\u0434\u0435\u043a\u0441\u0438\u0431\u0438\u0440\u043e\u0437\u0430\ntranslate ([0,79,0]) {\ndifference () {\ntranslate([0,-50,0])cylinder(z,20,20, $fn=6);\ntranslate ([0,-50,-0.1])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \ntranslate ([9.3,-62.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([14,-54.2,4.5])rotate([0,90,-30])cylinder (4.5+g,2.65,2.65);\ntranslate ([-28,-73,-1])cube ([20,45,11]);\n\ntranslate ([2,-80,1]) {\ntranslate ([4,40,g])rotate ([90,0,120])cylinder(4.5+g,2.65,2.65); \ntranslate ([4+4.7,37.5+-9+g,g])rotate ([90,0,120])cylinder(4.5+3.5,2.65,2.65); \n } \n }\ndifference () {\ntranslate ([-25,-67.4,0])cube ([20,34.7,z]);\ntranslate ([0,-50,-0.1])cylinder(4.2,10.35,10.35);\ntranslate ([-7,0,1]) {\nrotate([0, 90, 0]) translate([-3.5,-54.6,-17+g]) cylinder(9,2.65,2.65); \nrotate([0, 90, 0]) translate([-3.5,-45.6,-17+g]) cylinder(9,2.65,2.65); \n} \n\ntranslate ([-35,-59.6,-1])cube ([20,19,12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3323ea91dfb30f50fe045b8b67624b219de6fc3f","subject":"Add documenation and refactor","message":"Add documenation and refactor\n","repos":"OregonTechPrint3D\/Wintermute,OregonTechPrint3D\/Wintermute,OregonTechPrint3D\/Wintermute","old_file":"models\/experimental\/Wintermute_Travel_Bracket\/TRV_BRKT.scad","new_file":"models\/experimental\/Wintermute_Travel_Bracket\/TRV_BRKT.scad","new_contents":"\/\/\n\/\/\tOregon Tech Print3D Rapid Prototyping Lab\n\/\/\t\n\/\/\tAuthor: Dustin Kerns\n\/\/\tProject: Wintermute Delta Printer\n\/\/\tPurpose: To redefine base HIMAWARI travel bracket to suit the needs of the Wintermute fork\n\/\/\n\n\/\/ \n\/\/\tGenerate model\n\/\/\nTravelBracket();\n\n\/\/--------------------------------------------------------------------------------------------------------------------------------------\n\n\/\/\n\/\/\tModule: NutSocket\n\/\/\tPurpose: Defines the shape of a M3 Nut for screw mounts\n\/\/\nmodule NutSocket(width,depth,height)\n{\n\tside_length=sqrt(pow(width,2)\/2);\n\ttranslate([0,0,height\/2])cube([width,depth,height],center=true);\n\trotate([0,45,0])cube([side_length,depth,side_length],center=true);\n}\n\n\n\/\/\n\/\/\tModule: Travel Bracket\n\/\/\tPurpose: Revised Travel Bracket for Wintermute Delta Printer\n\/\/\nmodule TravelBracket()\n{\n\n\tstandoff_height=1; \/\/ In mm\n\n\tdifference()\n\t{\n\t\t\/\/ Fill in un-used aspects of base model and add new structure to the Travel Bracket\n\t\tunion()\n\t\t{\n\t\t\t\/\/ Import base HIMAWIRI STL\n\t\t\timport(\"TRV_BRKT_V1_0.stl\");\n\t\t\n\t\t\t\/\/ Fill in unneeded holes\n\t\t\t\/\/ These aspects of the original HIMAWRI base printer are not used on\n\t\t\t\/\/ the Wintermute fork\n\t\t\ttranslate([16,17,3])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\t\ttranslate([16,17,11])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\t\ttranslate([22,9,0])cube([6,8,14]);\n\t\t\ttranslate([-22,9,0])mirror([1,0,0])cube([6,8,14]);\n\t\t\ttranslate([22,-9,0])mirror([0,1,0])cube([6,6,14]);\n\t\t\ttranslate([-22,-9,0])mirror([1,1,0])cube([6,6,14]);\n\t\t\ttranslate([13,11,0])cube([6,3,14]);\n\n\t\t\t\/\/ Smooth out holes for linear bearings and generate standoff\n\t\t\tdifference()\n\t\t\t{\n\n\t\t\t\t\/\/ Cylinder defining the outer shell\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\ttranslate([25,0,0])cylinder(h=14+standoff_height,r=10,$fn=40);\n\t\t\t\t\ttranslate([-25,0,0])cylinder(h=14+standoff_height,r=10,$fn=40);\n\t\t\t\t}\n\n\t\t\t\t\/\/ Cylider defining the inner section to be removed\n\t\t\t\t\/\/ (Where the linear bearings will fit)\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\ttranslate([25,0,-1])cylinder(h=18,r=8,$fn=40);\n\t\t\t\t\ttranslate([-25,0,-1])cylinder(h=18,r=8,$fn=40);\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\n\t\t\n\t\t\/\/ Holes for set screws to add further support for linear bearings\n\t\ttranslate([-25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\n\t\ttranslate([25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\n\n\t\t\/\/ Nut sockets for M3 set screws\n\t\ttranslate([-25,12.5,5.5])NutSocket(6,3,14);\n\t\ttranslate([25,12.5,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([-25,11,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([25,11,5.5])NutSocket(6,3,14);\n\t}\n}","old_contents":"\/\/ Module containing code for revised Travel Bracket for Wintermute Delta Printer\nmodule TravelBracket()\n{\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\t\/\/ Import base HIMAWIRI STL from approved directory\n\t\t\timport(\"..\/\/..\/\/approved\/\/TRV_BRKT.stl\");\n\t\t\n\t\t\t\/\/ Fill in unneeded holes\n\t\t\t\/\/ These aspects of the original HIMAWRI base printer are not used on\n\t\t\t\/\/ the Wintermute fork\n\t\t\ttranslate([16,17,3])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\t\ttranslate([16,17,11])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\t\ttranslate([22,9,0])cube([6,8,14]);\n\t\t\ttranslate([-22,9,0])mirror([1,0,0])cube([6,8,14]);\n\t\t\ttranslate([22,-9,0])mirror([0,1,0])cube([6,6,14]);\n\t\t\ttranslate([-22,-9,0])mirror([1,1,0])cube([6,6,14]);\n\t\t\ttranslate([13,11,0])cube([6,3,14]);\n\n\t\t\t\/\/ Linear bearing holes\n\t\t\tdifference()\n\t\t\t{\n\t\t\t\t\/\/ Cylinder defining the outer shell\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\ttranslate([25,0,0])cylinder(h=16,r=10,$fn=40);\t\/\/ Left\n\t\t\t\t\ttranslate([-25,0,0])cylinder(h=16,r=10,$fn=40);\t\/\/ Right\n\t\t\t\t}\n\n\t\t\t\t\/\/ Cylider defining the inner section to be removed\n\t\t\t\t\/\/ (Where the linear bearings will fit)\n\t\t\t\tunion()\n\t\t\t\t{\n\t\t\t\t\ttranslate([25,0,-1])cylinder(h=18,r=8,$fn=40);\t\/\/ Left\n\t\t\t\t\ttranslate([-25,0,-1])cylinder(h=18,r=8,$fn=40);\t\/\/ Right\n\t\t\t\t}\n\t\t\t}\t\t\t\t\n\t\t}\t\t\n\t\t\/\/ Holes for set screws to add further support for linear bearings\n\t\ttranslate([-25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\n\t\ttranslate([25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\t\t\n\t}\n}\n\n\/\/ Module defining the shape of a M3 Nut for screw mounts\nmodule NutSocket(width,depth,height)\n{\n\tside_length=sqrt(pow(width,2)\/2);\n\ttranslate([0,0,height\/2])cube([width,depth,height],center=true);\n\trotate([0,45,0])cube([side_length,depth,side_length],center=true);\n}\n\ndifference()\n{\n\tTravelBracket();\n\n\tunion()\n{\n\t\ttranslate([-25,12.5,5.5])NutSocket(6,3,14);\n\t\ttranslate([25,12.5,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([-25,11,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([25,11,5.5])NutSocket(6,3,14);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"383fe4fcd4bda8b98aaee715e51d38e8494f19f5","subject":"The font name was updated.","message":"The font name was updated.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/customizer\/name-tag-test.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/customizer\/name-tag-test.scad","new_contents":" \r\n\/* [Base] *\/\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness = 2; \/\/ [1 : 5]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth = 228;\t\/\/ [228:600]\r\n\r\n\/\/ This determines the height of the name tag.\r\nbaseHeight = 15; \/\/ [54:150]\r\n\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nshowBorder = \"No\"; \/\/ [Yes, No] \r\n\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Fun Enthusiast\";\r\nbottomTextFont = \"Wingdings\";\r\nbottomTextOffsetX = 0; \/\/ [-315 : 315]\r\nbottomTextOffsetY = -20; \/\/ [-315 : 315]\r\n\r\n\r\n\/* [Chain Loop]*\/\r\nchainLoop = true;\r\nchainLoopLengthZ = 6;\r\nchainLoopPosition = \"bottom\"; \/\/ [bottom, top]\r\n\r\n\/* [General] *\/\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green] \r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nleftIconType = \"Moon\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef] \r\nrightIconType = \"Sun\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\n\/\/ This is the x off set of the icons\r\nxIconOffset = -100; \/\/ [10:200]\r\n\r\n\/\/ This is the y off set of the icons\r\nyIconOffset = 3; \/\/ [1:200]\r\n \r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\n\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 2.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 4.0; \/\/ [0.1: 0.1 :5]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Firstnesto Lastquez\";\r\ntopTextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\ntopTextFont = \"Arial\";\r\n\r\n\/* [Hidden] *\/\r\n\r\nuse <..\/name-tag.scad>\r\n\r\nnametag(baseColor = baseColor,\r\n baseThickness = baseThickness,\r\n borderColor = borderColor,\r\n chainLoop = chainLoop,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n iconColor = iconColor,\r\n letterThickness = letterThickness,\r\n roundedCorners = true,\r\n topText = topText,\r\n topTextSize = 13,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n\/\/ font=font,\r\n leftIconType = leftIconType,\r\n leftIconHeight = leftIconHeight,\r\n rightIconHeight = rightIconHeight,\r\n\/\/ rightIconOffsetY = 0,\r\n rightIconType = rightIconType,\r\n xIconOffset = xIconOffset,\r\n yIconOffset = yIconOffset,\r\n baseWidth = baseWidth,\r\n showBorder = showBorder);","old_contents":" \r\n\/* [Base] *\/\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness = 2; \/\/ [1 : 5]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth = 228;\t\/\/ [228:600]\r\n\r\n\/\/ This determines the height of the name tag.\r\nbaseHeight = 15; \/\/ [54:150]\r\n\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nshowBorder = \"No\"; \/\/ [Yes, No] \r\n\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Fun Enthusiast\";\r\nbottomTextFont = \"Wingdings\";\r\nbottomTextOffsetX = 0; \/\/ [-315 : 315]\r\nbottomTextOffsetY = -20; \/\/ [-315 : 315]\r\n\r\n\r\n\/* [Chain Loop]*\/\r\nchainLoop = true;\r\nchainLoopLengthZ = 6;\r\nchainLoopPosition = \"bottom\"; \/\/ [bottom, top]\r\n\r\n\/* [General] *\/\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green] \r\n\/\/TODO: Where is the heart icon, man? \"Put your heart into it.\"\r\nleftIconType = \"Moon\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef] \r\nrightIconType = \"Sun\"; \/\/ [Bass Clef, Creeper, Light Bulb, Moon, Rebel, Trooper, Aqua Dude, Cat, Fan, Spur, Mario, Luigi, Sun, Thundercat, Treble Clef]\r\n\r\n\/\/ This is the x off set of the icons\r\nxIconOffset = -100; \/\/ [10:200]\r\n\r\n\/\/ This is the y off set of the icons\r\nyIconOffset = 3; \/\/ [1:200]\r\n \r\n\/\/ This is the X,Y scale of the icons.\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\n\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 2.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 4.0; \/\/ [0.1: 0.1 :5]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Firstnesto Lastquez\";\r\ntopTextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\ntopTextFont = \"Times\";\r\n\r\n\/* [Hidden] *\/\r\n\r\nuse <..\/name-tag.scad>\r\n\r\nnametag(baseColor = baseColor,\r\n baseThickness = baseThickness,\r\n borderColor = borderColor,\r\n chainLoop = chainLoop,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n iconColor = iconColor,\r\n letterThickness = letterThickness,\r\n roundedCorners = true,\r\n topText = topText,\r\n topTextSize = 13,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n\/\/ font=font,\r\n leftIconType = leftIconType,\r\n leftIconHeight = leftIconHeight,\r\n rightIconHeight = rightIconHeight,\r\n\/\/ rightIconOffsetY = 0,\r\n rightIconType = rightIconType,\r\n xIconOffset = xIconOffset,\r\n yIconOffset = yIconOffset,\r\n baseWidth = baseWidth,\r\n showBorder = showBorder);","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b0c26f6d9d14c9647e003baaf6af0759ed6419d5","subject":"Cut out hole on bottom of switch part","message":"Cut out hole on bottom of switch part\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_file":"openscad\/strain-relief\/switch-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 30; \/\/ width - x\n wall_h = 10; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 30; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n side_w = 5; \/\/ side part of base without hole\n front_d = 5; \/\/ front part of base without hole\n hole_r = 5;\n hole_w = switch_w - 2 * side_w; \/\/ width of hole\n base_w = switch_w + 2*thick;\n difference() {\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d);\n translate([thick + side_w, front_d, -EPSILON])\n oblong(hole_w, LARGE, hole_r, thick + 2*EPSILON);\n }\n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 10; \/\/ width - x \n lug_h = 5; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 10; \/\/ depth - y - of lug\n lug_off = 5; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","old_contents":"\/\/\n\/\/ Strain relief for FTC robot main power switch\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Switch side and walls\nmodule switch_part() {\n switch_w = 30; \/\/ width - x\n wall_h = 20; \/\/ height - z - of walls - will be slightly less than switch walls\n \/\/ so that tape or ziptie is firm against top of the switch\n switch_d = 30; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n ri = 0.2; \/\/ radii of switch channel inside walls\n\n base_w = switch_w + 2*thick;\n translate([0, switch_d, 0]) rotate([90, 0, 0])\n O_channel(base_w, wall_h+thick, switch_w, LARGE,\n thick, thick, \n ro, ri,switch_d); \n}\n\n\/\/ Support below lugs - depth - in y-direction - is {lug_d}\nmodule lugs_support(lug_d) {\n lug_w = 10; \/\/ width - x \n lug_h = 5; \/\/ height - z\n lug_center_w = 5; \/\/ width of center protrusion\n lug_r = 1; \/\/ radii of curve in center protrusion\n lug_pad_h = 0.5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n lug_gap_d = 0.5; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([lug_w, lug_d+EPSILON, thick]);\n translate([lug_w, lug_d-lug_gap_d, lug_h+thick+lug_pad_h])\n rotate([90, 180, 0])\n T_channel(lug_center_w, lug_h, lug_w, thick+lug_pad_h, \n (lug_w-lug_center_w)\/2, \n lug_r, lug_d-lug_gap_d);\n }\n translate([-thick, lug_d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(lug_w+2*thick, thick+thick, lug_w, LARGE, \n thick, thick,\n 0, lug_r, lug_d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n lug_d = 10; \/\/ depth - y - of lug\n lug_off = 5; \/\/ offset in x of lug position\n translate([0, lug_d, 0]) switch_part();\n translate([lug_off, 0, 0]) lugs_support(lug_d);\n}\n\n\nswitch_strain_relief();\n\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"ce17af5b38e5b0155abd3fb90cf880724a3fb94b","subject":"Tweak tolerances","message":"Tweak tolerances\n\nadded 0.5mm\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/LineSensorHolder.scad","new_file":"hardware\/printedparts\/LineSensorHolder.scad","new_contents":"\/\/ Connectors\n\nLineSensorHolder_Con_Def = [[0,0,0], [0,0,-1], 0,0,0];\n\n\nmodule LineSensorHolder_STL() {\n\n printedPart(\"printedparts\/LineSensorHolder.scad\", \"Line Sensor Holder\", \"LineSensorHolder_STL()\") {\n\n view(t=[0,0,0],r=[72,0,130],d=400);\n\n if (DebugCoordinateFrames) frame();\n if (DebugConnectors) {\n connector(LineSensorHolder_Con_Def);\n }\n\n color(Level3PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"LineSensorHolder.stl\"));\n } else {\n LineSensorHolder_Model();\n }\n }\n }\n}\n\n\nmodule LineSensorHolder_Model()\n{\n \/\/ local vars\n\n \/\/ model\n difference() {\n union() {\n \/\/ surrounds for sensors\n for (i=[0,1])\n mirror([i,0,0])\n translate([4,-5,-GroundClearance+2])\n cube([15,10,10]);\n\n \/\/ walls\n for (i=[0,1])\n mirror([i,0,0])\n translate([3,-5,-GroundClearance+2])\n cube([dw,10,GroundClearance-2]);\n\n \/\/ pin plate\n translate([-5,-5,-2])\n cube([10, 10, 2]);\n }\n\n \/\/ hollow for Pin\n cylinder(r=PinDiameter\/2, h=20, center=true);\n\n \/\/ hollow for sensors\n for (i=[0,1])\n mirror([i,0,0])\n translate([6.2,-3.5,-GroundClearance-1])\n cube([11,6.5,14]);\n }\n}\n","old_contents":"\/\/ Connectors\n\nLineSensorHolder_Con_Def = [[0,0,0], [0,0,-1], 0,0,0];\n\n\nmodule LineSensorHolder_STL() {\n\n printedPart(\"printedparts\/LineSensorHolder.scad\", \"Line Sensor Holder\", \"LineSensorHolder_STL()\") {\n\n view(t=[0,0,0],r=[72,0,130],d=400);\n\n if (DebugCoordinateFrames) frame();\n if (DebugConnectors) {\n connector(LineSensorHolder_Con_Def);\n }\n\n color(Level3PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"LineSensorHolder.stl\"));\n } else {\n LineSensorHolder_Model();\n }\n }\n }\n}\n\n\nmodule LineSensorHolder_Model()\n{\n \/\/ local vars\n\n \/\/ model\n difference() {\n union() {\n \/\/ surrounds for sensors\n for (i=[0,1])\n mirror([i,0,0])\n translate([4,-5,-GroundClearance+2])\n cube([15,10,10]);\n\n \/\/ walls\n for (i=[0,1])\n mirror([i,0,0])\n translate([3,-5,-GroundClearance+2])\n cube([dw,10,GroundClearance-2]);\n\n \/\/ pin plate\n translate([-5,-5,-2])\n cube([10, 10, 2]);\n }\n\n \/\/ hollow for Pin\n cylinder(r=PinDiameter\/2, h=20, center=true);\n\n \/\/ hollow for sensors\n for (i=[0,1])\n mirror([i,0,0])\n translate([6.7,-3,-GroundClearance-1])\n cube([10.5,6,14]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fcf3514cff36e781a3d7b44353bbe12040127f1e","subject":"Added coupling feature to shell","message":"Added coupling feature to shell\n","repos":"artdavis\/eggloft","old_file":"eggcarrier\/Customizable_hollow_egg_carrier.scad","new_file":"eggcarrier\/Customizable_hollow_egg_carrier.scad","new_contents":"\/\/ Copyright 2017 Arthur Davis (thingiverse.com\/artdavis)\n\/\/ This file is licensed under a Creative Commons Attribution 4.0\n\/\/ International License.\n\/\/ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\/\/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\/\/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\/\/ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\/\/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n\/\/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n\/\/ DEALINGS IN THE SOFTWARE.\n\n\/\/ Length of the Egg Casing Shell\ncase_length = 78; \/\/ [60:2:100]\n\/\/ Coupler Shoulder Length\ncoupler_shoulder_len = 6.0; \/\/ [1.0:1.0:25.0]\n\/\/ Coupler Shoulder Diameter\ncoupler_shoulder_diam = 18.7; \/\/ [10.0:0.2:50.0]\n\/\/ Fitting Shoulder Length\ncoupler_fitting_len = 12.0; \/\/ [5.0:1.0:25.0]\n\/\/ Fitting Shoulder Diameter\ncoupler_fitting_diam = 17.9; \/\/ [10.0:0.2:50.0]\n\/\/ Wall thickness\nwall_th = 2.0; \/\/ [1.0:0.2:4.0]\n\/\/ Coupler Fraction\ncoupler_fract = 0.4; \/\/ [0.0:0.05:1.0]\n\/\/ Coupler Thickness\ncoupler_th = 2.0; \/\/ [0.0:0.2:4.0]\n\n\/* [Hidden] *\/\n\/\/ Special variables for facets\/arcs\n$fn = 48;\n\n\/\/ Incremental offset to make good overlap for CSG operations\ndelta = 0.1;\n\n\/\/ Coupler extension to overlap with egg shell\ncoupler_extra = 50.0;\n\n\/\/ Number of steps to sample the half profile of the shell\nsteps = 100;\n\n\n\/\/ Egg profile computing function\nfunction egg(x, l=case_length)= 0.9*l*pow(1-x\/l, 2\/3)*sqrt(1-pow(1-x\/l, 2\/3));\n\n\/\/ Create egg profile\nmodule egg_profile(length=case_length, offset=0, steps=steps) {\n ss = length \/ (steps-1); \/\/ step size\n v1 = [for (x=[0:ss:length]) [egg(x, length), x + offset]];\n \/\/ Make absolute sure the last point bring the profile\n \/\/ back to the axis\n v2 = concat(v1, [[0, length + offset]]);\n \/\/ Close the loop\n v3 = concat(v2, [[0, offset]]);\n polygon(points = v3);\n}\n\n\/\/ Create a solid egg part\nmodule solid_egg(length=case_length, offset=0, steps=steps) {\n rotate_extrude(convexity = 10) {\n egg_profile(length=length, offset=offset, steps=steps);\n }\n}\n\n\/\/ Create shell coupling feature\n\/\/ thick: Thickness of the coupling feature\n\/\/ fract: Fraction of shell to cover with coupling feature (between 0 and 1)\nmodule shell_coupler(length=case_length, offset=0,\n thick=coupler_th, fract=coupler_fract, steps=steps) {\n rotate(a=[90,0,-90]){\n difference() {\n union() {\n linear_extrude(height=thick, convexity=10) {\n egg_profile(length=length, offset=offset, steps=steps);}\n mirror(v=[1, 0, 0]) {\n linear_extrude(height=thick, convexity=10) {\n egg_profile(length=length, offset=offset, steps=steps);}\n }\n }\n cube(size=[200, 2*(1-fract)*length, 200], center=true);\n }\n }\n}\n\nrotate(a = [0, 90.0000000000, 0])\n{\n\tdifference() {\n\t\tdifference() {\n\t\t\tunion() {\n shell_coupler(length=case_length + 2*coupler_th,\n offset=-coupler_th, fract=coupler_fract);\n solid_egg(length=case_length, offset=0, steps=steps);\n\t\t\t\tdifference() {\n\t\t\t\t\tunion() {\n\t\t\t\t\t\ttranslate(v = [0, 0, -coupler_shoulder_len]) {\n\t\t\t\t\t\t\tcylinder(d = coupler_shoulder_diam,\n h = coupler_shoulder_len + coupler_extra);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttranslate(v = [0, 0,\n -(coupler_shoulder_len+coupler_fitting_len)]) {\n\t\t\t\t\t\t\tcylinder(d = coupler_fitting_diam,\n h = coupler_fitting_len + delta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttranslate(v = [0, 0,\n -(coupler_shoulder_len + coupler_fitting_len + delta\/2.)]) {\n\t\t\t\t\t\tcylinder(d = coupler_fitting_diam - 2 * wall_th,\n h = coupler_shoulder_len + coupler_extra + coupler_fitting_len + delta);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n solid_egg(case_length - 2*wall_th, wall_th);\n\t\t}\n\t\ttranslate(v = [0, -100.0000000000, -100.0000000000]) {\n\t\t\tcube(size = 200);\n\t\t}\n\t}\n}\n","old_contents":"\n\/\/ Copyright 2017 Arthur Davis (thingiverse.com\/artdavis)\n\/\/ This file is licensed under a Creative Commons Attribution 4.0\n\/\/ International License.\n\/\/ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n\/\/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n\/\/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n\/\/ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n\/\/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n\/\/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n\/\/ DEALINGS IN THE SOFTWARE.\n\n\/\/ Coupler Shoulder Length\ncoupler_shoulder_len = 6.0; \/\/ [1.0:1.0:25.0]\n\/\/ Coupler Shoulder Diameter\ncoupler_shoulder_diam = 18.7; \/\/ [10.0:0.2:50.0]\n\/\/ Fitting Shoulder Length\ncoupler_fitting_len = 12.0; \/\/ [5.0:1.0:25.0]\n\/\/ Fitting Shoulder Diameter\ncoupler_fitting_diam = 17.9; \/\/ [10.0:0.2:50.0]\n\n\/* [Hidden] *\/\n\/\/ Special variables for facets\/arcs\n$fn = 48;\n\n\/\/ Incremental offset to make good overlap for CSG operations\ndelta = 0.1;\n\n\/\/ Coupler extension to overlap with egg shell\ncoupler_extra = 50.0;\n\n\/\/ Wall thickness of the fitting\nwall_th = 2.0;\n\n\nrotate(a = [0, 90.0000000000, 0]) {\n\tdifference() {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\trotate_extrude(convexity = 10) {\n\t\t\t\t\tpolygon(paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]], points = [[0.0, 0.0], [5.72665976254, 0.787878787879], [8.05038105423, 1.57575757576], [9.80018127265, 2.36363636364], [11.2472643828, 3.15151515152], [12.4972974066, 3.93939393939], [13.6047652817, 4.72727272727], [14.6021984362, 5.51515151515], [15.5108932745, 6.30303030303], [16.3457085347, 7.09090909091], [17.1175079667, 7.87878787879], [17.8345245286, 8.66666666667], [18.5031770294, 9.45454545455], [19.1285862759, 10.2424242424], [19.7149158759, 11.0303030303], [20.2656055159, 11.8181818182], [20.7835355337, 12.6060606061], [21.2711460408, 13.3939393939], [21.7305250773, 14.1818181818], [22.1634751175, 14.9696969697], [22.5715640991, 15.7575757576], [22.9561651671, 16.5454545455], [23.3184880451, 17.3333333333], [23.6596040934, 18.1212121212], [23.9804665411, 18.9090909091], [24.2819269813, 19.696969697], [24.5647489379, 20.4848484848], [24.8296191131, 21.2727272727], [25.0771567804, 22.0606060606], [25.3079216807, 22.8484848485], [25.5224206998, 23.6363636364], [25.7211135462, 24.4242424242], [25.9044176022, 25.2121212121], [26.072712088, 26.0], [26.2263416488, 26.7878787879], [26.3656194555, 27.5757575758], [26.4908298928, 28.3636363636], [26.6022308959, 29.1515151515], [26.7000559829, 29.9393939394], [26.7845160264, 30.7272727273], [26.8558007977, 31.5151515152], [26.9140803113, 32.303030303], [26.9595059942, 33.0909090909], [26.9922116996, 33.8787878788], [27.0123145812, 34.6666666667], [27.0199158429, 35.4545454545], [27.0151013739, 36.2424242424], [26.9979422797, 37.0303030303], [26.9684953169, 37.8181818182], [26.9268032365, 38.6060606061], [26.8728950426, 39.3939393939], [26.8067861681, 40.1818181818], [26.7284785707, 40.9696969697], [26.6379607503, 41.7575757576], [26.5352076876, 42.5454545455], [26.4201807035, 43.3333333333], [26.2928272365, 44.1212121212], [26.1530805355, 44.9090909091], [26.0008592627, 45.696969697], [25.8360670014, 46.4848484848], [25.6585916611, 47.2727272727], [25.46830477, 48.0606060606], [25.2650606441, 48.8484848485], [25.0486954195, 49.6363636364], [24.819025931, 50.4242424242], [24.5758484169, 51.2121212121], [24.3189370276, 52.0], [24.0480421065, 52.7878787879], [23.7628882124, 53.5757575758], [23.4631718379, 54.3636363636], [23.1485587749, 55.1515151515], [22.8186810642, 55.9393939394], [22.4731334524, 56.7272727273], [22.111469262, 57.5151515152], [21.7331955563, 58.303030303], [21.3377674507, 59.0909090909], [20.9245813851, 59.8787878788], [20.4929671158, 60.6666666667], [20.0421781222, 61.4545454545], [19.5713800259, 62.2424242424], [19.0796364944, 63.0303030303], [18.5658919259, 63.8181818182], [18.0289499606, 64.6060606061], [17.4674465095, 65.3939393939], [16.8798154681, 66.1818181818], [16.2642445037, 66.9696969697], [15.6186171137, 67.7575757576], [14.9404352801, 68.5454545455], [14.2267140118, 69.3333333333], [13.4738339769, 70.1212121212], [12.6773295295, 70.9090909091], [11.8315731081, 71.696969697], [10.9292852524, 72.4848484848], [9.96073328705, 73.2727272727], [8.91233085017, 74.0606060606], [7.76396461901, 74.8484848485], [6.4832197059, 75.6363636364], [5.01030931987, 76.4242424242], [3.20274294789, 77.2121212121], [0.0, 78.0], [0.0000000000, 0]]);\n\t\t\t\t}\n\t\t\t\tdifference() {\n\t\t\t\t\tunion() {\n\t\t\t\t\t\ttranslate(v = [0, 0, -coupler_shoulder_len]) {\n\t\t\t\t\t\t\tcylinder(d = coupler_shoulder_diam, h = coupler_shoulder_len + coupler_extra);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttranslate(v = [0, 0, -(coupler_shoulder_len + coupler_fitting_len)]) {\n\t\t\t\t\t\t\tcylinder(d = coupler_fitting_diam, h = coupler_fitting_len + delta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\ttranslate(v = [0, 0, -(coupler_shoulder_len + coupler_fitting_len + delta\/2.)]) {\n\t\t\t\t\t\tcylinder(d = coupler_fitting_diam - 2 * wall_th, h = coupler_shoulder_len + coupler_extra + coupler_fitting_len + delta);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\trotate_extrude() {\n\t\t\t\tpolygon(paths = [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]], points = [[0.0, 2.0], [5.43298490292, 2.74747474747], [7.63754100017, 3.49494949495], [9.29760787405, 4.24242424242], [10.6704815939, 4.9898989899], [11.8564103601, 5.73737373737], [12.9070850108, 6.48484848485], [13.8533677471, 7.23232323232], [14.7154628502, 7.9797979798], [15.5074670714, 8.72727272727], [16.2396870454, 9.47474747475], [16.9199335271, 10.2222222222], [17.5542961561, 10.9696969697], [18.1476331336, 11.7171717172], [18.7038945489, 12.4646464646], [19.2263436946, 13.2121212121], [19.7177131986, 13.9595959596], [20.1803180387, 14.7070707071], [20.6161391759, 15.4545454545], [21.02688665, 16.202020202], [21.4140479914, 16.9494949495], [21.7789259277, 17.696969697], [22.1226681454, 18.4444444444], [22.446291063, 19.1919191919], [22.7506990262, 19.9393939394], [23.0366999567, 20.6868686869], [23.3050182231, 21.4343434343], [23.5563053124, 22.1818181818], [23.7911487403, 22.9292929293], [24.0100795432, 23.6767676768], [24.2135786127, 24.4242424242], [24.4020820823, 25.1717171717], [24.5759859303, 25.9191919192], [24.7356499297, 26.6666666667], [24.8814010515, 27.4141414141], [25.0135364065, 28.1616161616], [25.1323257958, 28.9090909091], [25.2380139269, 29.6565656566], [25.3308223427, 30.404040404], [25.410951102, 31.1515151515], [25.478580244, 31.898989899], [25.5338710646, 32.6464646465], [25.5769672253, 33.3939393939], [25.607995715, 34.1414141414], [25.6270676796, 34.8888888889], [25.634279133, 35.6363636364], [25.6297115599, 36.3838383838], [25.6134324192, 37.1313131313], [25.585495557, 37.8787878788], [25.545941532, 38.6262626263], [25.4947978609, 39.3737373737], [25.4320791851, 40.1212121212], [25.357787362, 40.8686868687], [25.2719114811, 41.6161616162], [25.1744278062, 42.3636363636], [25.0652996418, 43.1111111111], [24.9444771218, 43.8585858586], [24.8118969183, 44.6060606061], [24.6674818646, 45.3535353535], [24.5111404885, 46.101010101], [24.3427664477, 46.8484848485], [24.1622378587, 47.595959596], [23.9694165085, 48.3434343434], [23.7641469364, 49.0909090909], [23.5462553704, 49.8383838384], [23.3155484981, 50.5858585859], [23.0718120518, 51.3333333333], [22.8148091779, 52.0808080808], [22.5442785605, 52.8282828283], [22.2599322565, 53.5757575758], [21.9614531967, 54.3232323232], [21.6484922916, 55.0707070707], [21.3206650702, 55.8181818182], [20.9775477614, 56.5656565657], [20.6186727072, 57.3131313131], [20.2435229661, 58.0606060606], [19.8515259294, 58.8080808081], [19.4420457252, 59.5555555556], [19.0143741159, 60.303030303], [18.5677195117, 61.0505050505], [18.1011935973, 61.797979798], [17.6137949041, 62.5454545455], [17.1043884241, 63.2929292929], [16.5716800218, 64.0404040404], [16.0141839056, 64.7878787879], [15.430180683, 65.5353535354], [14.8176623899, 66.2828282828], [14.1742591119, 67.0303030303], [13.4971389342, 67.7777777778], [12.7828681319, 68.5252525253], [12.0272100664, 69.2727272727], [11.2248257692, 70.0202020202], [10.3688090856, 70.7676767677], [9.44992645182, 71.5151515152], [8.45528824247, 72.2626262626], [7.36581258726, 73.0101010101], [6.15074690047, 73.7575757576], [4.75337038039, 74.5050505051], [3.0384997198, 75.2525252525], [0.0, 76.0], [0.0000000000, 2.0000000000]]);\n\t\t\t}\n\t\t}\n\t\ttranslate(v = [0, -100.0000000000, -100.0000000000]) {\n\t\t\tcube(size = 200);\n\t\t}\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"39b759fdb19957f8a3d010d0d1233b37a7caa155","subject":"extruder: wip stuff","message":"extruder: wip stuff\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"extruder-direct.scad","new_file":"extruder-direct.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nextruder_motor_type = NemaShort;\nextruder_motor = dict_replace_multiple(Nema17, \n [\n [NemaShort, 33*mm],\n [NemaFrontAxleLength, 22*mm]\n ]);\n\nextruder_motor_mount_thickness = 5*mm;\nextruder_motor_side = motorWidth(extruder_motor);\nextruder_motor_length = motorLength(extruder_motor);\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n house_w_extended = max(house_w, extruder_motor_mount_thickness*2+extruder_motor_length);\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([0,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n union()\n {\n \/\/ front mount plate for motor\n translate([-house_w\/2,0,0])\n {\n cubea([extruder_motor_mount_thickness, extruder_motor_side+slide_dist, extruder_motor_side],[1,0,0]);\n\n \/\/ back mount plate for motor\n translate([extruder_motor_length,0,0])\n cubea([extruder_motor_mount_thickness, extruder_motor_side+slide_dist, extruder_motor_side],[1,0,0]);\n }\n }\n\n translate([-extruder_motor_mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(extruder_motor_mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([0,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n cubea([extruder_motor_length, extruder_motor_side+slide_dist, extruder_motor_side],[1,0,0]);\n\n translate([-extruder_motor_mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(extruder_motor_mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([-1,bolt_center_offset,0])\n translate([-house_w\/2+extruder_motor_mount_thickness,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, extruder_motor_type, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() \n{\n extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\n attach([[0,0,0],[0,0,-1]], extruder_conn_layflat)\n {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); \n }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2, guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); \n }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) \n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); \n }\n}\n\n\/*extruder();*\/\n\/*print();*\/\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nextruder_motor = dict_replace_multiple(Nema17, \n [\n [NemaFrontAxleLength, 22*mm]\n ]);\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(extruder_motor);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(extruder_motor);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(extruder_motor), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x-1,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4333662782095740927764c911b885135eab27da","subject":"added some more space for elements, so that glue can fit in as well + added visualization of how elements fit together","message":"added some more space for elements, so that glue can fit in as well + added visualization of how elements fit together\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"usb_power_relay\/box\/usb_power_relay_box.scad","new_file":"usb_power_relay\/box\/usb_power_relay_box.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"146d1b62c791b6f5821a97a5cfdcf378911f87a8","subject":"checking in before making knee wider","message":"checking in before making knee wider\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\nr38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\n\/\/translate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ntranslate([xC,yC,linkOffset-.5]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/translate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ntranslate([xC,yC,linkOffset+1.8]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() difference() {\n \/* old style, with forks ground from square tube : \n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n *\/\n union() {\n translate([DE\/2,0,0]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) cylinder(r=1.4,h=7.2,$fn=36); \/\/ axle\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n }\n\n \/\/ pivot holes\n for (x=[0,DE]) translate([x,0,0]) cylinder(r=r38,h=11,center=true);\n}\n\nmodule eFork() for(z=[-1,1]) hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n}\n\nmodule crankLink(dx=CD) {\n cylinder(r=1.4,h=.7,$fn=24,center=true);\n color([0.3,0.3,0.4,0.9]) translate([dx-1,0,.6]) difference() {\n cube([5,2.7,2.2],center=true);\n #translate([1,0,0]) cylinder(r=.64,h=11,center=true);\n }\n translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\n\nmodule EFlink() difference() {\n union() {\n color([.4,.4,.5,.9]) {\n translate([ 1.5,0,0]) cube([6,3,2.5],center=true);\n translate([EF-1.5,0,0]) cube([6,3,2.5],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-4,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=r38,h=3,center=true);\n cylinder(r=r38,h=5,center=true);\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() {\n translate([0,0,2.4]) cylinder(r=1.4,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([4,4,7.9],center=true);\n }\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-3,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,0.5,-2.4]) sphere(.8);\n translate([BH-5,1, 6 ]) sphere(.8); \n }\n hull() {\n translate([ 4,-.5, 7]) sphere(.8);\n translate([BH-5, -1, -2 ]) sphere(.8); \n }\n\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\n\/\/translate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ntranslate([xC,yC,linkOffset-.5]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/translate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ntranslate([xC,yC,linkOffset+1.8]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.2]) cylinder(r=1.4,h=7.2,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule crankLink(dx=CD) {\n cylinder(r=1.4,h=.7,$fn=24,center=true);\n color([0.3,0.3,0.4,0.9]) translate([dx-1,0,.6]) difference() {\n cube([5,2.7,2.2],center=true);\n #translate([1,0,0]) cylinder(r=.64,h=11,center=true);\n }\n translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\nmodule EFlink() {\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ 2,0,0]) cube([7,3,2],center=true);\n translate([EF-2,0,0]) cube([7,3,2],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-6,2.6,2.6],center=true);\n }\n\n #translate([EF,0,0]) cylinder(r=.4,h=3,center=true);\n # cylinder(r=.4,h=5,center=true);\n }\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() {\n translate([0,0,2.4]) cylinder(r=1.4,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([4,4,7.9],center=true);\n }\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-3,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,0.5,-2.4]) sphere(.8);\n translate([BH-5,1, 6 ]) sphere(.8); \n }\n hull() {\n translate([ 4,-.5, 7]) sphere(.8);\n translate([BH-5, -1, -2 ]) sphere(.8); \n }\n\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"fd748b708e77b01e93f0e99f12be12475eb4129a","subject":"removed old model leftovers","message":"removed old model leftovers\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"coffee_spoon\/coffee_spoon.scad","new_file":"coffee_spoon\/coffee_spoon.scad","new_contents":"vol = 11700; \/\/ Volumen of the final construct\nb = 30; \/\/ Base\nw = 20; \/\/ Width\nh = ceil( 2*vol\/(b*w) ); \/\/ Height\nt = 1.5; \/\/ wall Thickness\n\necho(h=h);\n\nmodule shape(b, w, h)\n{\n polyhedron(points = [\n [0, 0, 0], \/\/ 0\n [b, 0, 0], \/\/ 1\n [b, w, 0], \/\/ 2\n [0, w, 0], \/\/ 3\n [b\/2, 0, h], \/\/ 4\n [b\/2, w, h] \/\/ 5\n ],\n faces = [\n [1,0,4],\n [3,2,5],\n [0,1,3],\n [1,2,3],\n [1,4,5],\n [5,2,1],\n [0,3,5],\n [0,5,4]\n ]\n );\n}\n\nmodule spoon()\n{\n difference()\n {\n translate([-t, -t, 0])\n shape(b+2*t, w+2*t, h+1*t);\n shape(b, w, h);\n }\n}\n\n\ntranslate([-w\/2, 0, 0])\n rotate([0, 0, -90])\n spoon();\n\ntranslate([-15\/2, 0, 0])\n cube([15, 120, 3]);\n","old_contents":"vol = 11700; \/\/ Volumen of the final construct\nb = 30; \/\/ Base\nw = 20; \/\/ Width\nh = ceil( 2*vol\/(b*w) ); \/\/ Height\nt = 1.5; \/\/ wall Thickness\n\necho(h=h);\n\nmodule shape(b, w, h)\n{\n polyhedron(points = [\n [0, 0, 0], \/\/ 0\n [b, 0, 0], \/\/ 1\n [b, w, 0], \/\/ 2\n [0, w, 0], \/\/ 3\n [b\/2, 0, h], \/\/ 4\n [b\/2, w, h] \/\/ 5\n ],\n faces = [\n [1,0,4],\n [3,2,5],\n [0,1,3],\n [1,2,3],\n [1,4,5],\n [5,2,1],\n [0,3,5],\n [0,5,4]\n ]\n );\n}\n\nmodule spoon()\n{\n difference()\n {\n translate([-t, -t, 0])\n shape(b+2*t, w+2*t, h+1*t);\n shape(b, w, h);\n }\n}\n\n\ntranslate([-w\/2, 0, 0])\n rotate([0, 0, -90])\n spoon();\n\ntranslate([-15\/2, +r-1, 0])\n cube([15, 120, 3]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a9de64f348a152e719958ecaaa71841b9402b5ae","subject":"walls are now 2x thicker and height is rounded","message":"walls are now 2x thicker and height is rounded\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"coffee_spoon\/coffee_spoon.scad","new_file":"coffee_spoon\/coffee_spoon.scad","new_contents":"vol = 11700; \/\/ Volumen of the final construct\nb = 30; \/\/ Base\nw = 30; \/\/ Width\nh = round( 2*vol\/(b*w) ); \/\/ Height\nt = 3; \/\/ wall Thickness\n\necho(h=h);\n\nmodule shape(b, w, h)\n{\n polyhedron(points = [\n [0, 0, 0], \/\/ 0\n [b, 0, 0], \/\/ 1\n [b, w, 0], \/\/ 2\n [0, w, 0], \/\/ 3\n [b\/2, 0, h], \/\/ 4\n [b\/2, w, h] \/\/ 5\n ],\n faces = [\n [1,0,4],\n [3,2,5],\n [0,1,3],\n [1,2,3],\n [1,4,5],\n [5,2,1],\n [0,3,5],\n [0,5,4]\n ]\n );\n}\n\nmodule spoon()\n{\n difference()\n {\n translate([-t, -t, 0])\n shape(b+2*t, w+2*t, h+1*t);\n shape(b, w, h);\n }\n}\n\n\ntranslate([-w\/2, 0, 0])\n rotate([0, 0, -90])\n spoon();\n\ntranslate([-15\/2, 0, 0])\n cube([15, 120, 3]);\n","old_contents":"vol = 11700; \/\/ Volumen of the final construct\nb = 30; \/\/ Base\nw = 30; \/\/ Width\nh = ceil( 2*vol\/(b*w) ); \/\/ Height\nt = 1.5; \/\/ wall Thickness\n\necho(h=h);\n\nmodule shape(b, w, h)\n{\n polyhedron(points = [\n [0, 0, 0], \/\/ 0\n [b, 0, 0], \/\/ 1\n [b, w, 0], \/\/ 2\n [0, w, 0], \/\/ 3\n [b\/2, 0, h], \/\/ 4\n [b\/2, w, h] \/\/ 5\n ],\n faces = [\n [1,0,4],\n [3,2,5],\n [0,1,3],\n [1,2,3],\n [1,4,5],\n [5,2,1],\n [0,3,5],\n [0,5,4]\n ]\n );\n}\n\nmodule spoon()\n{\n difference()\n {\n translate([-t, -t, 0])\n shape(b+2*t, w+2*t, h+1*t);\n shape(b, w, h);\n }\n}\n\n\ntranslate([-w\/2, 0, 0])\n rotate([0, 0, -90])\n spoon();\n\ntranslate([-15\/2, 0, 0])\n cube([15, 120, 3]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"668f773ee5ca35dedef7e0a73c5b3cfcb13e196e","subject":"triangle-shapped spoon","message":"triangle-shapped spoon\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"coffee_spoon\/coffee_spoon.scad","new_file":"coffee_spoon\/coffee_spoon.scad","new_contents":"vol = 11700; \/\/ Volumen of the final construct\nb = 30; \/\/ Base\nw = 20; \/\/ Width\nh = ceil( 2*vol\/(b*w) ); \/\/ Height\nt = 1.5; \/\/ wall Thickness\n\necho(h=h);\n\nmodule shape(b, w, h)\n{\n polyhedron(points = [\n [0, 0, 0], \/\/ 0\n [b, 0, 0], \/\/ 1\n [b, w, 0], \/\/ 2\n [0, w, 0], \/\/ 3\n [b\/2, 0, h], \/\/ 4\n [b\/2, w, h] \/\/ 5\n ],\n faces = [\n [1,0,4],\n [3,2,5],\n [0,1,3],\n [1,2,3],\n [1,4,5],\n [5,2,1],\n [0,3,5],\n [0,5,4]\n ]\n );\n}\n\nmodule spoon()\n{\n difference()\n {\n translate([-t, -t, 0])\n shape(b+2*t, w+2*t, h+1*t);\n shape(b, w, h);\n }\n}\n\n\ntranslate([-w\/2, 0, 0])\n rotate([0, 0, -90])\n spoon();\n\ntranslate([-15\/2, +r-1, 0])\n cube([15, 120, 3]);\n","old_contents":"module halfSphere(r)\n{\n difference()\n {\n sphere(r);\n d=r+1;\n translate([-d, -d, -d])\n cube([2*d, 2*d, d]);\n }\n}\n\n\nr=17.743;\ndifference()\n{\n halfSphere(19);\n halfSphere(r);\n}\ntranslate([-15\/2, +r-1, 0])\n cube([15, 140, 5]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"9af7d649dff3373837fdfc16420864631d9a51b9","subject":"linked the OpenSCAD file into the tree, as well","message":"linked the OpenSCAD file into the tree, as well\n","repos":"flashcactus\/buzzwatch,flashcactus\/buzzwatch","old_file":"case.scad","new_file":"case.scad","new_contents":"$fs=0.05;\n$fa=5;\neps=0.001;\n\nmot_rad=3.02;\nmot_suppthick=1.6;\nmot_suppaddw=0.8;\nmot_suppoff=2;\nmot_supphwdth=mot_rad+mot_suppaddw;\nmot_len=10.1;\nmot_shaft=6;\nmot_wires=1.7;\nmot_total_len=mot_len+mot_shaft+mot_wires;\n\nbrd_bthick=1.5;\nbrd_topthick=5.5;\nbrd_botthick=2;\nbrd_lx=27.53;\nbrd_ly=18.8;\nbrd_slack=0.5;\nbrd_vslack=0.2;\n\nbrd_hrad=0.5;\nbrd_hox=1;\nbrd_hoy=1;\nbrd_hlx=25.5;\nbrd_hly=16.75;\n\nbrd_rheo_offset=[4.72,8.31,3.38];\nbrd_rheo_rad=7;\nbrd_rheo_thick=1.2;\nbrd_rheo_slack=0.5;\n\nbrd_batt_dia=12.5;\nbrd_batt_thick=3.5;\/\/incl. wire\nbrd_batt_x=21.25;\nbrd_batt_y=9.25;\n\nbrd_sw_w=2.7;\nbrd_sw_h=1.64;\nbrd_sw_d=1;\nbrd_sw_offset=[19.05,1,0];\n\nsw_hole_h=1.2;\nsw_hole_w=2;\nsw_hole_skirt=0.4;\n\ncase_thick=0.8;\ncase_pin_skirt=0.5;\n\nnut_hole_add=0.2;\nnut_sz=nut_hole_add+5.5;\nnut_thk=2.4;\nnut_depth=2.5;\n\nbolt_hole_add=0.15;\nbolt_dia=bolt_hole_add+3;\nbolt_len=8;\nbolt_head_len=2;\nbolt_head_td=bolt_hole_add+5.52;\nbolt_depth=1;\nnb_mass_thk=1.2;\n\nlid_skirt_h=1;\nlid_skirt_w=0.8;\nlid_bh_base=1.5;\nlid_bh_foot=0.8;\nlid_bh_x=20;\n \nstrap_pindst=2;\nstrap_pindia=1;\nstrap_tabdia=3;\nstrap_tabthick=1.2;\n\nmodule mynut() { nut(nut_sz,nut_thk); }\nmodule mybolt() { bolt(bolt_dia,bolt_len,bolt_head_len,bolt_head_td,bolt_dia); }\n\nint_box=[\n brd_lx+brd_slack*2,\n brd_ly+brd_slack*2+mot_supphwdth*2,\n brd_topthick+brd_botthick+brd_vslack*2\n ];\nint_box_off=[\n -brd_slack,\n -brd_slack,\n -brd_vslack-brd_botthick\n ];\n\next_box=int_box+[2,2,1]*case_thick;\/\/keep the top open\next_box_off=int_box_off-[1,1,1]*case_thick;\n\n\ncase_lid_slack=0.25;\/\/min distance between lid & everything else\n\n\nmotor_off=[brd_slack+mot_total_len+0.5,\n brd_ly+brd_slack+eps,\n -brd_botthick-brd_vslack-eps\n ];\n\n\n\nbn_hoff=[\n (motor_off[0]+int_box[0]+int_box_off[0])\/2,\n brd_ly+brd_slack+mot_supphwdth,\n 0\n ];\n\n\n\/\/------------------\n\nmodule nut(sz,thickn){\n intersection() {\n cube([sz,sz*2,thickn],true);\n rotate([0,0,60]) cube([sz,sz*2,thickn],true);\n rotate([0,0,-60])cube([sz,sz*2,thickn],true);\n }\n}\n\nmodule hnut(sz,thk,hole){\n difference(){\n nut(sz,thk);\n translate([0,0,-thk\/2-eps]) \n cylinder(thk+2*eps,hole\/2,hole\/2);\n }\n}\n\nmodule bolt(dia,tlen,hlen,htop,hbot) {\n union() {\n cylinder(tlen,dia\/2,dia\/2);\n translate([0,0,-eps]) \n cylinder(hlen+eps,htop\/2,hbot\/2);\n }\n}\n\n\nmodule motcube(transl) {\n translate([0,0,transl])\n cube([mot_supphwdth*2,mot_supphwdth*2,mot_suppthick],true);\n};\n\nmodule motrings(){\n difference() {\n union() {\n motcube(mot_suppoff);\n motcube(mot_len-mot_suppoff);\n }\n #cylinder(mot_len, mot_rad, mot_rad, false);\n }\n translate([0,0,-mot_wires])\n %cylinder(mot_total_len,mot_rad-0.1,mot_rad-0.1);\n}\n\nmodule rmotrings(){\n translate([0,mot_supphwdth,mot_supphwdth])\n rotate(-90,[0,1,0])\n translate([0,0,mot_wires])\n motrings();\n}\n\nmodule rmotkeepout(slack){\n translate([0,mot_supphwdth,mot_supphwdth])\n rotate(-90,[0,1,0])\n translate([0,0,mot_total_len\/2])\n cube([2,2,0]*(mot_supphwdth+slack) + [0,0,mot_total_len], true);\n}\n\n\nmodule brdhole(x,y,rad,top,bot) {\n translate(\n [brd_hox+brd_hlx*x,\n brd_hoy+brd_hly*y,\n bot]\n )\n cylinder(top-bot,rad,rad);\n}\n\nmodule mainbrd(slack, rslack) { \n union() {\n difference() {\/\/the board\n translate([-slack,-slack,0])\n cube([brd_lx+slack*2,brd_ly+slack*2,brd_bthick],false);\n brdhole(0,0,brd_hrad,brd_bthick+0.1,-0.1);\n brdhole(0,1,brd_hrad,brd_bthick+0.1,-0.1);\n brdhole(1,0,brd_hrad,brd_bthick+0.1,-0.1);\n brdhole(1,1,brd_hrad,brd_bthick+0.1,-0.1);\n }\n \/\/rheo\n translate(brd_rheo_offset-[0,0,rslack]) {\n cylinder(brd_rheo_thick+rslack*2,brd_rheo_rad+rslack,brd_rheo_rad+rslack);\n }\n \/\/button\n translate(brd_sw_offset+[-brd_sw_w\/2, 0, -brd_sw_h]) {\n cube([brd_sw_w,brd_sw_d,brd_sw_h],false);\n }\n \/\/batt\n batt_off=[brd_batt_x,brd_batt_y,brd_bthick];\n translate(batt_off)\n cylinder(brd_batt_thick,brd_batt_dia\/2,brd_batt_dia\/2);\n }\n}\n\n\n\n\nmodule cbox(){ \n pin_brad = brd_hrad+case_pin_skirt;\n pin_trad = brd_hrad;\n pin_top = brd_bthick+0.1;\n pin_bot = int_box_off[2]-0.01;\n \n slit_dim = [case_thick,\n brd_hly,\n brd_bthick+case_thick-int_box_off[2]\n ];\n slit_off = int_box_off+[0,brd_hoy-int_box_off[1],0];\n \n llip_dim = [case_thick+2*eps,\n int_box[1]+2*eps,\n case_thick];\n llip_off = int_box_off+[-eps,-eps,int_box[2]-llip_dim[2]];\n \n union() {\n difference() {\n \/\/outer shell\n translate(ext_box_off)\n cube(ext_box);\n \/\/main cavity\n translate(int_box_off)\n cube(int_box+[0,0,0.01]);\n }\n \n \/\/pins\n brdhole(1,0,pin_brad,0,pin_bot);\n brdhole(1,0,pin_trad,pin_top,-0.1);\n brdhole(1,1,pin_brad,0,pin_bot);\n brdhole(1,1,pin_trad,pin_top,-0.1);\n \n \/\/potside slit mass\n translate(slit_off)\n cube(slit_dim);\n \n \/\/lid grip\n translate(llip_off)\n cube(llip_dim);\n \n \/\/screw mass\n bm_orad = bolt_head_td\/2+nb_mass_thk;\n bm_srad = bolt_dia\/2+nb_mass_thk;\n translate(bn_hoff+[0,0,ext_box_off[2]+eps]){\n cylinder(bolt_depth,bm_orad,bm_orad);\n translate([0,0,bolt_depth-eps])\n cylinder(bolt_head_len,bm_orad,bm_srad);\n }\n }\n}\n\nmodule case(){\n union(){\n difference() {\n cbox();\n \n \/\/hole for rheo\n mainbrd(brd_slack,brd_rheo_slack);\n \n \/\/hole for button\n translate(brd_sw_offset+[0,0,-sw_hole_h\/2-sw_hole_skirt])\n cube([sw_hole_w,8,sw_hole_h],true);\n \n \/\/hole for screw\n translate(bn_hoff+[0,0,ext_box_off[2]-eps]){\n cylinder(bolt_depth+2*eps,bolt_head_td\/2,bolt_head_td\/2);\n translate([0,0,bolt_depth+eps])\n #mybolt();\n }\n }\n \n \/\/motor\n translate(motor_off){\n rmotrings();\n }\n \n translate(ext_box_off+[0,0,strap_tabdia\/2])\n rotate (-90,[0,1,0]) \n strappair(\n ext_box[1],\n strap_tabdia,\n strap_pindst,\n strap_pindia,\n strap_tabthick\n );\n \n translate(ext_box_off+[ext_box[0],0,strap_tabdia\/2])\n rotate (90,[0,1,0]) \n strappair(\n ext_box[1],\n strap_tabdia,\n strap_pindst,\n strap_pindia,\n strap_tabthick\n );\n }\n}\n\nmodule lid(){\n lid_dim = [ext_box[0]-eps,ext_box[1]-eps,case_thick+lid_skirt_h];\n lid_off = ext_box_off+[eps\/2,eps\/2,(ext_box[2]-lid_skirt_h)];\n lsksub_dim = lid_dim-[2,2,0]*(lid_skirt_w+case_thick)+[0,0,-case_thick+eps];\n lsksub_off = lid_off+[1,1,0]*(lid_skirt_w+case_thick)+[0,0,-eps];\n lidgrip_dim = [4*case_thick,lid_dim[1],lid_dim[2]+case_thick];\n lidgrip_off = lid_off + [0,0,-1]*case_thick;\n \n nut_off = bn_hoff+[0,0,lid_off[2]+case_thick+lid_skirt_h];\n\n bh_hght = lid_off[2]+lid_skirt_h-brd_bthick;\n bh_z = lid_off[2]+lid_skirt_h-bh_hght;\n \n difference(){\n union(){\n difference(){ \/\/basic lid w\/skirt\n translate(lid_off) cube(lid_dim);\n translate(lsksub_off) cube(lsksub_dim);\n }\n difference(){ \/\/lip-grip\n translate(lidgrip_off) cube(lidgrip_dim);\n translate(brd_rheo_offset) cube(brd_rheo_rad*2,true);\n }\n\n intersection(){\n translate(int_box_off)\n cube(int_box);\n union(){\n \/\/board-holders\n translate([lid_bh_x,0,bh_z])\n cylinder(bh_hght+eps,lid_bh_foot,lid_bh_base);\n translate([lid_bh_x,brd_ly,bh_z])\n cylinder(bh_hght+eps,lid_bh_foot,lid_bh_base);\n \n \/\/nut mass\n translate(nut_off) \n nut(nut_sz+nb_mass_thk, (nut_depth+nb_mass_thk)*2); \n }\n \n }\n \n \n \n }\n \n case();\n \n translate(motor_off){\n rmotkeepout(case_lid_slack);\n }\n \n translate(nut_off){ \n nut(nut_sz,nut_depth*2);\n translate([0,0,-bolt_len]) \n mybolt();\n translate([0,0,nut_thk\/2-nut_depth])\n %hnut(nut_sz,nut_thk,bolt_dia);\n }\n \n }\n}\n\nmodule straptab(wid,dist,holedia,thickn) {\n translate([-wid\/2,-thickn\/2,-eps])\n difference() {\n union() {\n cube([wid,thickn,dist+eps]);\n translate([wid\/2,0,dist+eps]){\n rotate(-90,[1,0,0]) {\n cylinder(thickn,wid\/2,wid\/2);\n }\n }\n }\n \n translate([wid\/2,-eps,dist+eps]){\n rotate(-90,[1,0,0]) {\n cylinder(thickn+eps*2,holedia\/2,holedia\/2);\n }\n }\n }\n} \n\nmodule strappair(pwidth,twidth,pdist,pindia,tthick) {\n union() {\n translate([0,tthick\/2,0]) straptab(twidth,pdist,pindia,tthick);\n translate([0,pwidth-tthick\/2,0]) straptab(twidth,pdist,pindia,tthick);\n }\n}\n\n\n\ntranslate(-ext_box_off){\n *lid();\n case();\n %mainbrd(0.4,0);\n}\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'case.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"786d8aa578aed680fd1ff8039cbc9c4a30683fce","subject":"main: fix wierd rendering artifact on x rods","message":"main: fix wierd rendering artifact on x rods\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ba7880231de375ad0d583428d55c5e473bb56bdd","subject":"fixing up diameters","message":"fixing up diameters\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button() {\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 24;\nledButtonHeight = 33;\nmodule momentary_button() {\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 6.5;\nphotoresistorLength = 6.5;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 8;\nledLaserLength = 10;\nwireCasingDepth = 3;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\n\n\/\/ display\ni2cOLEDWidth = 27;\ni2cOLEDHeight = 16;\ni2cOLEDScrewWidth = 20;\ni2cOLEDScrewHeight = 22;\nmodule display() {\n}\n\nmodule lid() {\n string();\n}\n\nlid();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c2cbbf3ac75da94931a7205efda5fe560f60d9ec","subject":"Fix typo in annotation (negativeExtrude)","message":"Fix typo in annotation (negativeExtrude)\n","repos":"jsconan\/camelSCAD","old_file":"operator\/extrude\/negative.scad","new_file":"operator\/extrude\/negative.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that extrude children modules with respect to particular rules.\n *\n * @package operator\/extrude\n * @author jsconan\n *\/\n\n\/**\n * Extrudes linearly the children modules, and applies a wall adjustment to ensure\n * the final object will not produce artifacts after a `difference()` operation.\n *\n * @param Number [height] - The height of the extrusion. If the value is negative,\n * the extrusion will be made top to bottom (below the origin).\n * @param Number|String [direction] - Tells on what sides adjust the height to make sure\n * the difference won't produce dummy walls.\n * @param Boolean [center] - Whether or not center the extrusion on the vertical axis.\n * @param Number [convexity] - If the extrusion fails for a non-trivial 2D shape,\n * try setting the convexity parameter.\n * @param Number [twist] - The number of degrees of through which the shape is extruded.\n * @param Number [slices] - Defines the number of intermediate points along the Z axis\n * of the extrusion.\n * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of\n * the extrusion.\n *\/\nmodule negativeExtrude(height, direction, center, convexity, twist, slices, scale) {\n center = boolean(center);\n convexity = numberOr(convexity, 10);\n height = align(value=height, direction=direction, center=center);\n\n translateZ(height[1]) {\n linear_extrude(height=height[0], center=center, convexity=convexity, twist=twist, slices=slices, scale=scale) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that extrude children modules with respect to particular rules.\n *\n * @package operator\/extrude\n * @author jsconan\n *\/\n\n\/**\n * Extrudes linearly the children modules, and apply a wall adjustment to ensure\n * the final object will not produce artifacts after a `difference()` operation.\n *\n * @param Number [height] - The height of the extrusion. If the value is negative,\n * the extrusion will be made top to bottom (below the origin).\n * @param Number|String [direction] - Tells on what sides adjust the height to make sure\n * the difference won't produce dummy walls.\n * @param Boolean [center] - Whether or not center the extrusion on the vertical axis.\n * @param Number [convexity] - If the extrusion fails for a non-trivial 2D shape,\n * try setting the convexity parameter.\n * @param Number [twist] - The number of degrees of through which the shape is extruded.\n * @param Number [slices] - Defines the number of intermediate points along the Z axis\n * of the extrusion.\n * @param Number|Vector [scale] - Scales the 2D shape by this value over the height of\n * the extrusion.\n *\/\nmodule negativeExtrude(height, direction, center, convexity, twist, slices, scale) {\n center = boolean(center);\n convexity = numberOr(convexity, 10);\n height = align(value=height, direction=direction, center=center);\n\n translateZ(height[1]) {\n linear_extrude(height=height[0], center=center, convexity=convexity, twist=twist, slices=slices, scale=scale) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0cb208c5b63059157c61469b4188a806760afd3e","subject":"units: add basic definition of units (mm, cm etc)","message":"units: add basic definition of units (mm, cm etc)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"units.scad","new_file":"units.scad","new_contents":"mm = 1;\ncm = 10 * mm;\ndm = 100 * mm;\nm = 1000 * mm;\n\ninch = 25.4 * mm;\n\nX = [1, 0, 0];\nY = [0, 1, 0];\nZ = [0, 0, 1];\n\nepsilon = 0.01*mm;\ne = 0.01*mm;\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'units.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"26cfe37a2ea3b80c3d120931acd81b3483d5f7e1","subject":"Add a piece to link two potentiometer to make \"gimbal measurement\"","message":"Add a piece to link two potentiometer to make \"gimbal measurement\"\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/gimbal_connection.scad","new_file":"Hardware\/gimbal_connection.scad","new_contents":"use \n\nguiding_length = 10;\nx = 2;\nspace = 15;\n\n\ndifference(){\nunion(){\n\thull(){\n\ttranslate([space +guiding_length\/2,0,0]) cube(size=[15,10,guiding_length], center = true);\n\ttranslate([x, 0, x]) sphere(3);\n\t}\n\n\thull(){\n\t\ttranslate([0,0,space+guiding_length\/2]) rotate([0,90,0])cube(size=[15,10,guiding_length], center = true);\n\t\ttranslate([x, 0, x]) sphere(3);\n\t}\n}\n\n\ttranslate([space +guiding_length\/2,0,0]) cylinder(r=3.25, h=10*guiding_length, center = true);\n\ttranslate([0,0,space+guiding_length\/2]) rotate([0,90,0])cylinder(r=3.25, h=10*guiding_length, center = true);\n\n\/\/space for nut\n\trotate([0,-90,0])\nunion(){translate([space +guiding_length\/2+4.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n translate([space +guiding_length\/2+2.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n\n\ttranslate([space +guiding_length\/2+5,0, 0]) rotate([0,90,0]) cylinder(r=1.5, h=15, center=true);}\n\n\ttranslate([space +guiding_length\/2+4.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n\ttranslate([space +guiding_length\/2+2.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n\ttranslate([space +guiding_length\/2+5,0, 0]) rotate([0,90,0]) cylinder(r=1.5, h=15, center=true);\n\n\/\/Cube to visualize\n\t\/\/cube(space +guiding_length\/2+7);\n\n}\n\n\/\/cube(size=[sqrt(guiding_length\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/gimbal_connection.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"979b69fe6e3a1751318213501ba98774d5b8e598","subject":"The trooper icon was added.","message":"The trooper icon was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/name-tags\/nametag.scad","new_file":"OpenSCAD\/name-tags\/nametag.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"red\"; \/\/ [pink, red, black, white, yellow, blue]\r\nletterThickness = 2; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto\";\r\ntopTextYOffset = 5; \/\/ [0 : 30]\r\ntopLetterSize = 14; \/\/ [2 : 25]\r\n\r\n\r\n\/* [Sub Text] *\/\r\nsubText = \"Rebel Scum\";\r\nbottomLetterSize = 8; \/\/ [2 : 25]\r\n\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"red\"; \/\/ [pink, red, black, white, yellow, blue]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue]\r\n\r\n\r\n\/* [Icons] *\/\r\niconType = \"Rebel\"; \/\/ [Rebel, Trooper]\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 0.12; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nxOffset = 80; \/\/ [10:200]\r\niconColor = \"red\"; \/\/ [pink, red, black, white, yellow, blue] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nbaseThickness=2;\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[ 5, topText, topLetterSize],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[-10, subText, bottomLetterSize],\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}","old_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"red\"; \/\/ [pink, red, yellow, black, blue]\r\nletterThickness = 2; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto\";\r\ntopTextYOffset = 5; \/\/ [0 : 30]\r\ntopLetterSize = 14; \/\/ [2 : 25]\r\n\r\n\r\n\/* [Sub Text] *\/\r\nsubText = \"Rebel Scum\";\r\nbottomLetterSize = 8; \/\/ [2 : 25]\r\n\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"red\"; \/\/ [red, black, white, yellow, blue]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, yellow, black, blue]\r\n\r\n\r\n\/* [Icons] *\/\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 0.12; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nxOffset = 80; \/\/ [10:200]\r\niconColor = \"red\"; \/\/ [red, black, white, yellow, blue, pink] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nbaseThickness=2;\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[ 5, topText, topLetterSize],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[-10, subText, bottomLetterSize],\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n rebelAlliance(6);\r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"efb11cd548dfadf8e3f2b14bbcbabb5a7deff116","subject":"main: fix range\/position of T0\/T1","message":"main: fix range\/position of T0\/T1\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - x_carriage_w\/2 + 20;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder($show_vit=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n tx(x*(main_upper_width\/2))\n tz(main_height)\n {\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n mirror([x==1?0:-1,0,0])\n gantry_upper_connector();\n }\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - zaxis_rod_d\/2 - xaxis_end_width_right(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2-extruder_b_hotend_mount_offset.x);\naxis_x_parked = [false, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : axis_printrange_x[x];\n\n tx(pos)\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts($show_vit=true, beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder($show_vit=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n tx(x*(main_upper_width\/2))\n tz(main_height)\n {\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n mirror([x==1?0:-1,0,0])\n gantry_upper_connector();\n }\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fb3b77e64f21424213f4ccbee3697df33b38131c","subject":"removed dead code + put holes in place of rods - these will be replaced by metal M8 screws, instead","message":"removed dead code + put holes in place of rods - these will be replaced by metal M8 screws, instead\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"buggy_troley_mount\/mount.scad","new_file":"buggy_troley_mount\/mount.scad","new_contents":"r_mount=(28.8+2*2.1)\/2;\nh=20;\neps=0.01;\n\nmodule mount_rod_space()\n{\n translate([0, 0, -eps])\n cylinder(r=r_mount, h=h+2*eps, $fn=180);\n}\n\n\nmodule body_core()\n{\n \/\/ main rod with mounts\n rotate([0, 0, 180-30])\n {\n difference()\n {\n \/\/ main block\n hull()\n for(dx=[0, 90])\n translate([dx, 0, 0])\n cylinder(r=30\/2, h=h);\n \/\/ support rods\n for(dx=[0, 29.5, 60.5])\n translate([90-dx, 0, -eps])\n cylinder(r=8.5\/2, h=30, $fn=50);\n }\n }\n \/\/ rod_slot\n difference()\n {\n \/\/ main block\n union()\n {\n cylinder(r=30\/2, h=h);\n translate([-35, -50, 0])\n cube([50, 50, h]);\n \/\/ stubbing hole, between two elements\n translate([-35, 0, 0])\n cube([20, 10, h]);\n }\n \/\/ screw hole\n translate([-35-eps, -42, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=50+2*eps, $fn=50);\n \/\/ place for bottom block\n translate([-20\/2-r_mount, -20-40, -eps])\n cube([r_mount*2, 40, h+2*eps]);\n }\n}\n\n\nmodule buggy_troley_closure()\n{\n dy=30;\n difference()\n {\n cube([r_mount*2, dy, h]);\n translate([r_mount, dy, 0])\n mount_rod_space();\n translate([-eps-10, 8, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=55+2*eps, $fn=50);\n }\n}\n\n\nmodule buggy_troley_mount()\n{\n difference()\n {\n body_core();\n translate([-20\/2, -20, 0])\n mount_rod_space();\n }\n}\n\n\n\nfor(pos=[[0,0,0], [180,1,35]])\n translate([pos[2], 0, 0])\n rotate([0, pos[0], 0])\n mirror([0, 0, pos[1]])\n {\n buggy_troley_mount();\n %translate([-20\/2-r_mount, -50, 0])\n buggy_troley_closure();\n\n translate([-75, -30, 0])\n buggy_troley_closure();\n }\n","old_contents":"r_mount=(28.8+2*2.1)\/2;\nh=20;\neps=0.01;\n\nmodule mount_rod_space()\n{\n translate([0, 0, -eps])\n cylinder(r=r_mount, h=h+2*eps, $fn=180);\n}\n\n\nmodule rod_protection()\n{\n $fn=50;\n h=15;\n difference()\n {\n cylinder(r=10.5\/2, h=h);\n translate([0,0,-eps])\n cylinder(r=8.5\/2, h=h+2*eps);\n }\n}\n\n\nmodule body_core()\n{\n \/\/ main rod with mounts\n rotate([0, 0, 180-30])\n {\n \/\/ main block\n hull()\n for(dx=[0, 90])\n translate([dx, 0, 0])\n cylinder(r=30\/2, h=h);\n \/\/ support rods\n for(dx=[0, 29.5, 60.5])\n translate([90-dx, 0, h])\n cylinder(r=10.5\/2, h=30, $fn=50);\n }\n \/\/ rod_slot\n difference()\n {\n \/\/ main block\n union()\n {\n cylinder(r=30\/2, h=h);\n translate([-35, -50, 0])\n cube([50, 50, h]);\n \/\/ stubbing hole, between two elements\n translate([-35, 0, 0])\n cube([20, 10, h]);\n }\n \/\/ screw hole\n translate([-35-eps, -42, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=50+2*eps, $fn=50);\n \/\/ place for bottom block\n translate([-20\/2-r_mount, -20-40, -eps])\n cube([r_mount*2, 40, h+2*eps]);\n }\n}\n\n\nmodule buggy_troley_closure()\n{\n dy=30;\n difference()\n {\n cube([r_mount*2, dy, h]);\n translate([r_mount, dy, 0])\n mount_rod_space();\n translate([-eps-10, 8, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=55+2*eps, $fn=50);\n }\n}\n\n\nmodule buggy_troley_mount()\n{\n difference()\n {\n body_core();\n translate([-20\/2, -20, 0])\n mount_rod_space();\n }\n}\n\n\n\nfor(pos=[[0,0,0], [180,1,35]])\n translate([pos[2], 0, 0])\n rotate([0, pos[0], 0])\n mirror([0, 0, pos[1]])\n {\n buggy_troley_mount();\n %translate([-20\/2-r_mount, -50, 0])\n buggy_troley_closure();\n\n translate([-75, -30, 0])\n buggy_troley_closure();\n }\n\n%rod_protection();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3fd69fffb65c0e452aa0bb715b47cb8211799867","subject":"element count is now a parameter","message":"element count is now a parameter\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"cable_support\/cable_support.scad","new_file":"cable_support\/cable_support.scad","new_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\nN=4;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[1:N])\n translate([0, i*12, 0])\n element();\n","old_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[0:2])\n translate([0, i*12, 0])\n element();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e0ddc0b801865e99c61f272e6b58b68b5d71b120","subject":"added explicit function for the participating blocks","message":"added explicit function for the participating blocks\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n }\n}\n\n\nmodule brush_holder()\n{\n wall([0,0,0], [36,50,2]);\n plane([0,16.5,50\/2-2], [36-2*2,29,2]);\n holder([20\/2-1,-1,2], [3,25,18]);\n holder([-20\/2-1,-1,2], [3,25,18]);\n}\n\n\nbrush_holder();\n","old_contents":"$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [3,25,18]);\nholder([-20\/2-1,-1,2], [3,25,18]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"deccc1900a9be13e595c07d92363f6fe063cb0c7","subject":"More regular layout of sandbox models","message":"More regular layout of sandbox models\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/ArduinoProDev.scad","new_file":"hardware\/sandbox\/ArduinoProDev.scad","new_contents":"\/*\n\n\tPlayground for developing the vitamins\/ArduinoPro.scad library\n\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ include the ArduinoPro.scad library\ninclude <..\/vitamins\/ArduinoPro.scad>\n\n\/\/ Set custom board properties\n\/\/ ArduinoPro_PCB_Width = 1.0 * 25.4;\n\/\/ ArduinoPro_PCB_Length = 1.5 * 25.4;\n\/\/ ArduinoPro_PCB_Colour = \"green\";\n\n\nmodule ArduinoPro_Layout_Sandbox()\n{\n \/\/ show pins in layout\n showpins = ArduinoPro_Pins_Normal;\n\n \/\/ how far apart to layout boards\n margin_x = ArduinoPro_PCB_Inset * 2;\n\n \/\/ amount origin is offset in board\n origin_o = ArduinoPro_PCB_Inset;\n\n \/\/ layout offsets to use in translate\n layout_o = origin_o + margin_x;\n layout_x = ArduinoPro_PCB_Width - origin_o + margin_x;\n layout_y = ArduinoPro_PCB_Length - origin_o + margin_x;\n\n \/\/ Create an Arduino Pro Mini with header pins\n translate([-layout_x, layout_o, 0])\n ArduinoPro(ArduinoPro_Mini, showpins, showpins);\n\n \/\/ Create an Arduino Pro Micro with header pins\n translate([layout_o, layout_o, 0])\n ArduinoPro(ArduinoPro_Micro, showpins);\n\n \/\/ Create an Arduino Pro (common features only, pin mounting reversed)\n translate([-layout_x, -layout_y, 0])\n ArduinoPro(ArduinoPro_No_Port, showpins * ArduinoPro_Pins_Opposite);\n\n \/\/ Create an Arduino Pro Mini without any header pins\n translate([layout_o, -layout_y, 0])\n ArduinoPro(ArduinoPro_Mini);\n}\n\nArduinoPro_Layout_Sandbox();","old_contents":"\/*\n\n\tPlayground for developing the vitamins\/ArduinoPro.scad library\n\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ include the ArduinoPro.scad library\ninclude <..\/vitamins\/ArduinoPro.scad>\n\n\/\/ Set custom board properties\n\/\/ ArduinoPro_PCB_Width = 0.7 * 25.4;\n\/\/ ArduinoPro_PCB_Length = 1.3 * 25.4;\n\/\/ ArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255];\n\n\n\/\/ Create an Arduino Pro Mini with header pins\ntranslate([-ArduinoPro_PCB_Width, 0, 0])\n ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n\n\/\/ Create an Arduino Pro Micro with header pins\ntranslate([ArduinoPro_PCB_Width, 0, 0])\n ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\n\/\/ Create an Arduino Pro Mini without any header pins\ntranslate([ArduinoPro_PCB_Width, -ArduinoPro_PCB_Length *1.5, 0])\n ArduinoPro(ArduinoPro_Mini);\n\n\/\/ Create an Arduino Pro (no programming header, pin mounting reversed)\ntranslate([-ArduinoPro_PCB_Width, -ArduinoPro_PCB_Length *1.5, 0])\n ArduinoPro(ArduinoPro_No_Port, ArduinoPro_Pins_Opposite);\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"94da2841d037b915ba287c074ffd5ae8570cc220","subject":"Increase spacing between wheel and support","message":"Increase spacing between wheel and support\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/RingEncoder\/ring_encoder.scad","new_file":"Hardware\/RingEncoder\/ring_encoder.scad","new_contents":"pot_radius=5.90\/2;\nmeplat = 1.5;\nwidth=12.5;\nlength = 13.2;\nscrew_radius = 8.6\/2;\npot_length = 12.8;\nscrew_length = 6.9;\nthickness = 3;\naxis_radius = 5.5;\nspacing = 1.5;\n\nwheel_radius = width\/2+thickness+0.5;\n\nmodule pot(mep){\ntranslate([0,0,-1.5-1]) cube(size=[width, length, 5], center=true);\ntranslate([0,0, -1])cylinder(r= screw_radius, h=screw_length+1);\ndifference(){\n\t\ttranslate([0,0,screw_length-1]) cylinder(r=pot_radius, h=pot_length+2);\n\t\ttranslate([2*pot_radius-mep,0,50+screw_length]) cube([2*pot_radius\t, 100,100], center=true);\n}\n}\n\n\/\/rotate([0,-90,0])\ndifference(){\nunion(){\ntranslate([0,0,-1.5+1]) cube(size=[width+thickness, length+thickness, 5], center=true);\ncylinder(r= screw_radius+thickness, h=screw_length);\ndifference(){\n\t\ttranslate([0,0,screw_length-thickness]) cylinder(r=wheel_radius+spacing+thickness, h=pot_length+thickness);\n\t\ttranslate([50,0,screw_length+(pot_length-thickness)\/2]) cube([100, 100,pot_length-thickness], center=true);\n\t\n\t\ttranslate([0,0,screw_length]) cylinder(r=wheel_radius+spacing, h=pot_length-thickness);\n}\n}\npot(0);\n\ttranslate([wheel_radius+axis_radius-0.1,0,0]) cylinder(r=axis_radius, h=100, center=true);\n}\n\n\n\n\n\/\/Wheel\n\ntranslate([30,0,0])\ndifference(){\n\ttranslate([0,0, screw_length+1]) cylinder(r=wheel_radius, h=pot_length-5);\npot(meplat);\n\t}\n\n\n\n","old_contents":"pot_radius=5.90\/2;\nmeplat = 1.5;\nwidth=12.5;\nlength = 13.2;\nscrew_radius = 8.6\/2;\npot_length = 12.8;\nscrew_length = 6.9;\nthickness = 3;\naxis_radius = 5.5;\n\nwheel_radius = width\/2+thickness+0.5;\n\nmodule pot(mep){\ntranslate([0,0,-1.5-1]) cube(size=[width, length, 5], center=true);\ntranslate([0,0, -1])cylinder(r= screw_radius, h=screw_length+1);\ndifference(){\n\t\ttranslate([0,0,screw_length-1]) cylinder(r=pot_radius, h=pot_length+2);\n\t\ttranslate([2*pot_radius-mep,0,50+screw_length]) cube([2*pot_radius\t, 100,100], center=true);\n}\n}\n\/\/pot(meplat);\ndifference(){\nunion(){\ntranslate([0,0,-1.5+1]) cube(size=[width+thickness, length+thickness, 5], center=true);\ncylinder(r= screw_radius+thickness, h=screw_length);\ndifference(){\n\t\ttranslate([0,0,screw_length-thickness]) cylinder(r=wheel_radius+thickness, h=pot_length+thickness);\n\t\ttranslate([50,0,screw_length+(pot_length-thickness)\/2]) cube([100, 100,pot_length-thickness], center=true);\n\t\n\t\ttranslate([0,0,screw_length]) cylinder(r=wheel_radius+0.5, h=pot_length-thickness);\n}\n}\npot(0);\n\ttranslate([wheel_radius+axis_radius-0.1,0,0]) cylinder(r=axis_radius, h=100, center=true);\n}\n\n\n\ntranslate([30,0,0])\ndifference(){\n\ttranslate([0,0, screw_length+1]) cylinder(r=wheel_radius, h=pot_length-5);\npot(meplat);\n\t}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e8c50c5c45676d82f931a69a235bab47275cc210","subject":"xaxis\/ends: re-enable leadscew support to top","message":"xaxis\/ends: re-enable leadscew support to top\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1], round_radius=2);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fc74fcbc95f7554fc21844acc1e32dd05609c0af","subject":"draft for support structure in steel version","message":"draft for support structure in steel version\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/walkerChassis.scad","new_file":"Drawings\/steel\/walkerChassis.scad","new_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-40; \/\/ location of lower brace beams\nloX= 20;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0, 80*a]) legProxy();\n %translate([0,0,100*a]) legProxy();\n translate([0,0,90*a]) mainBar();\n translate([Bx*a,0,0]) cylinder(r=2.5,h=300,$fn=16,center=true); \/\/ main axle\n translate([-20*a,-40,0]) cube([2.5,2.5,300],center=true); \/\/ lower rails\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,70*a]) sphere(1); \/\/ arm guard bar\n hull() for (b=[-1,1]) translate([loX*b,loY,70*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n hull() { \/\/ inner support on outside trapaoid\n translate([ 5*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n }\n\n hull() { \/\/ center front trap\n translate([loX,loY, 2*a]) sphere(1);\n translate([ Bx, 0 ,25*a]) sphere(1);\n }\n hull() { \/\/ outer front diag\n translate([loX,loY,68*a]) sphere(1);\n translate([ Bx, 0 ,40*a]) sphere(1);\n }\n hull() { \/\/ inner back trap\n translate([-loX,loY,25*a]) sphere(1);\n translate([ -Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([-loX,loY,35*a]) sphere(1);\n translate([ -Bx, 0 ,65*a]) sphere(1);\n }\n\n for (b=[-1,1]) { \/\/ outside diagonal brace\n hull() {\n translate([loX*b,loY,140*a]) sphere(1);\n translate([ Bx*b, 0 ,110*a]) sphere(1);\n }\n hull() {\n translate([ Bx*b, 0 ,140*a]) sphere(1);\n translate([loX*b,loY,110*a]) sphere(1);\n }\n hull() {\n translate([loX*b,loY,110*a]) sphere(1);\n translate([ Bx*b, 0 ,110*a]) sphere(1);\n }\n }\n hull() for(b=[-1,1]) translate([loX*b,loY,140*a]) sphere(1);\n hull() for(b=[-1,1]) translate([ Bx*b, 0 ,110*a]) sphere(1);\n\n\n hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n}\nmodule legProxy() {\n\n legProxy1();\n mirror([1,0,0]) legProxy1();\n\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","old_contents":"","returncode":1,"stderr":"error: pathspec 'Drawings\/steel\/walkerChassis.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"00fc6e66709b146fe8af8a49db392a29b41d646a","subject":"16x2 LED matrix bracket","message":"16x2 LED matrix bracket\n","repos":"Yona-Appletree\/ledSPI,Yona-Appletree\/ledSPI","old_file":"matrix-bracket.scad","new_file":"matrix-bracket.scad","new_contents":"\/** \\file\n * Bracket to hold a 16x2 LED panel in an Octoscroller configuration.\n *\/\n\nmodule bracket()\n{\n\trender() difference()\n\t{\n\t\tcube([16,5,10]);\n\n\t\ttranslate([13,10,5])\n\t\trotate([90,0,0])\n\t\tcylinder(r=2, h=20, $fs=1);\n\t}\n}\n\nrotate([0,0,+45\/2]) bracket();\nrotate([0,0,-45\/2-180]) translate([0,-5,0]) bracket();\n\n%translate([0,0,-1]) cube([200,200,2], center=true);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'matrix-bracket.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"37497be709a23478ad61acfb59838e3a03fe733f","subject":"parameterize the minkowskiSphereRadius value","message":"parameterize the minkowskiSphereRadius value\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nmodule halfCirclePhoneStand(minkowskiSphereRadius = 0.5)\n{\n \n\n halfCirclePhoneStand_stand_base(minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_stand_base(minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = 19.125,\n innerRadius = 4.9,\n outerRadius = 5.59,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nmodule halfCirclePhoneStand()\n{\n \n\n halfCirclePhoneStand_stand_base();\n}\n\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_stand_base()\n{\n minkowskiSphereRadius = 0.5;\n\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = 19.125,\n innerRadius = 4.9,\n outerRadius = 5.59,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ee17a956eab45f12a5dea61fac3940ff703f54c3","subject":"Further work on box\/enclosure design.","message":"Further work on box\/enclosure design.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\r\nthickness = 0.25;\r\n\r\nwidth = 20;\r\nlength = 20;\r\nheight = 10;\r\n\r\n\/\/ width and height of tank base plate\r\nbase_width = width\/4;\r\nbase_height = 1;\r\n\r\n\/\/ height of side supports\r\n\/\/side_support_height = height\/2; \/\/ full side walls\r\nside_support_height = 2;\r\n\r\n\/\/ amount faces extend past each other at corners\r\noverhang = 1;\r\n\r\n\/\/ for minor corrections\r\nepsilon = 0.01;\r\n\r\nvert_faces();\r\nside_supports();\r\ntank_base();\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=length);\r\n\t\t}\r\n\t\tside_support_base(clearance=0.1, height_scale=0.5);\r\n\t\tside_support_top(clearance=0.1, height_scale=0.5);\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,0,0])\r\n\t\tcube([thickness,width,height]);\r\n}\r\n\r\nmodule tank_base(clearance=0) {\r\n\ttranslate([thickness,0,base_height])\r\n\tdifference() {\r\n\t\tcube([base_width, length, thickness + clearance]);\r\n\t\ttank_base_cutouts(clearance);\r\n\t\ttranslate([0,length-overhang-thickness\/2,0])\r\n\t\t\ttank_base_cutouts(clearance);\r\n\t}\r\n}\r\n\r\nmodule tank_base_cutouts(clearance=0) {\r\n\tcube([base_width\/8, overhang+thickness\/2, thickness+clearance]);\r\n\ttranslate([3*base_width\/8,0,0])\r\n\t\tcube([base_width\/4, overhang+thickness\/2, thickness+clearance]);\r\n\ttranslate([7*base_width\/8,0,0])\r\n\t\tcube([base_width\/8+epsilon, overhang+thickness\/2, thickness+clearance]);\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tside_support_base();\r\n\t\t\tside_support_top();\r\n\t\t}\r\n\t\tvert_faces();\r\n\t\ttank_base(clearance=0.1);\r\n\t}\r\n}\r\n\r\nmodule side_support_top(clearance=0, height_scale=1) {\r\n\ttranslate([0,0,height])\r\n\tside_support_base(clearance=clearance, height_scale=-height_scale);\r\n}\r\n\r\nmodule side_support_base(clearance=0, height_scale=1) {\r\n\tscale([1,1,height_scale])\r\n\t\tunion() {\r\n\t\t\tside_support(y=overhang, clearance=clearance);\r\n\t\t\tside_support(y=width-overhang, clearance=clearance);\r\n\t\t}\r\n}\r\n\r\nmodule side_support(y, clearance) {\r\n\ttranslate([-overhang,y-thickness\/2-clearance\/2,0])\r\n\t\tcube([length+overhang*2, thickness+clearance, side_support_height+clearance]);\r\n}","old_contents":"\r\nthickness = 0.5;\r\n\r\nwidth = 20;\r\nlength = 20;\r\nheight = 10;\r\n\r\nvert_faces();\r\nside_supports();\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=length);\r\n\t\t}\r\n\t\tscale([1,1,0.5]) {\r\n\t\t\tside_support_base(clearance=0.1);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,0,0])\r\n\t\tcube([thickness,width,height]);\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tside_support_base();\r\n\t\tvert_faces();\r\n\t}\r\n}\r\n\r\nmodule side_support_base(clearance=0) {\r\n\tunion() {\r\n\t\tside_support(y=2, clearance=clearance);\r\n\t\tside_support(y=width-2, clearance=clearance);\r\n\t}\r\n}\r\n\r\nmodule side_support(y, clearance) {\r\n\toverhang = 1;\r\n\theight = 2;\r\n\ttranslate([-overhang,y-thickness\/2-clearance\/2,0])\r\n\t\tcube([length+overhang*2, thickness+clearance, height+clearance]);\r\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5c5779b6ad75ef37f6bfcbd2550417696b8691f9","subject":"Note that the belt clamp has been tested working.","message":"Note that the belt clamp has been tested working.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"shapeoko-beltclamp\/beltclamp.scad","new_file":"shapeoko-beltclamp\/beltclamp.scad","new_contents":"\/\/ This printed part is one possible way to anchor Shapeoko belts.\n\/\/ See http:\/\/www.shapeoko.com\/wiki\/index.php\/Belt_Anchors for other ideas.\n\/\/ Motivated by http:\/\/www.thingiverse.com\/thing:33881 not being strong enough\n\/\/ when I initially printed it.\n\n\/\/ Upright: printed, tested lightly\n\/\/ Top: printed, tested\n\ngThick = 8;\ngRibHeight = 6;\ngTopRoundoverRadius = 4;\ngSideRoundoverRadius = 4;\ngMainWidth = 16;\ngMainHeight = 66;\n\ngTopWidth = 30;\ngRibWidth = 3.4;\ngRibLength = 50;\ngHoleSpacing = 20;\ngBeltWide = 14; \/\/ 1\/4\" belt + slop\ngBeltPitch = 2.032; \/\/ MXL in mm\ngBeltThick = 1.5;\ne = 0.02;\n\n\/\/ screw_clearance_diameter, socket_head_clearance_diameter, nut outside diameter\n\/\/ TODO untested numbers, these should move to a common include.\nM3 = [3.8, 6.4, 6.5];\nM5 = [5.5, 9.4, 9.4];\nM8 = [8, 13, 13];\n\nmodule InsetHole(x) {\n d = x[0];\n socket_head = x[1];\n union() {\n translate([0,0,-50]) cylinder(r=d\/2, h=100);\n cylinder(r=socket_head\/2, h=10);\n }\n}\n\nmodule NutHole(x) {\n d = x[0];\n nut_size = x[2];\n union() {\n translate([0,0,1]) cylinder(r=d\/2, h=50);\n cylinder(r=nut_size\/2, $fn=6, h=6);\n }\n}\n\nmodule Rib(t=4) {\n translate([-t\/2,0,-0.1])\n rotate([90,0,90])\n linear_extrude(height=t)\n polygon(points=[[0,0],[gRibLength,0],[0,gRibHeight]],paths=[[0,1,2]]);\n}\n\nmodule Roundover(r) {\n translate([0.1,0.1,-50])\n difference() {\n cube([r,r,100]);\n translate([0,0,-1]) cylinder(r=r,h=102,$fn=20);\n }\n}\n\nmodule Upright() {\n difference() {\n union() {\n \/\/ body, for now (until beziers work)\n translate([0,-gMainHeight\/2-4.9,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n translate([0,0,gThick\/2]) cube([gMainWidth,gMainHeight,gThick], center=true);\n \/\/ ribs\n translate([(gMainWidth-gRibWidth)\/2,-gMainHeight\/2,gThick]) Rib(t=gRibWidth);\n translate([-(gMainWidth-gRibWidth)\/2,-gMainHeight\/2,gThick]) Rib(t=gRibWidth);\n }\n \/\/ Chamfer top edges\n \/\/ TODO make these translation numbers constants as well, and fix Roundover's\n \/\/ origin.\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ Chamfer edges near bottom mounting hole\n translate([gMainWidth\/2-gSideRoundoverRadius,gMainHeight\/2-4,0])\n Roundover(r=gSideRoundoverRadius);\n translate([-(gMainWidth\/2-gSideRoundoverRadius),gMainHeight\/2-4,0])\n rotate([0,0,90])\n Roundover(r=gSideRoundoverRadius);\n \/\/ M5 mounting holes\n translate([0,gMainHeight\/2-30,gThick-2]) InsetHole(M5);\n translate([0,gMainHeight\/2-10,gThick-2]) InsetHole(M5);\n \/\/ M3 nut traps (20mm spacing, for compat with old part)\n translate([-gHoleSpacing\/2,-gMainHeight\/2+4,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,-gMainHeight\/2+4,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n }\n}\n\nmodule Belt() {\n translate([0,0,gBeltThick\/2]) cube([gBeltWide,30,gBeltThick], center=true);\n for(i = [0:30\/gBeltPitch]) {\n translate([0,i * gBeltPitch,-gBeltThick\/2+e]) cube([gBeltWide,gBeltPitch \/ 2,gBeltThick], center=true);\n }\n}\n\nmodule Top() {\n rotate([-90,0,0]) difference() {\n translate([0,-6\/2,(gThick+gRibHeight)\/2]) cube([gTopWidth,6,gThick+gRibHeight], center=true);\n \/\/ holes\n translate([-gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n \/\/ chamfer\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ TODO remove magic number\n translate([0,-8+(1.6*gBeltThick),0]) rotate([90,0,0]) Belt();\n }\n}\n\nunion() {\n Upright();\n translate([0,-gMainHeight\/2-12,0]) rotate([0,0,180]) Top();\n}","old_contents":"\/\/ This printed part is one possible way to anchor Shapeoko belts.\n\/\/ See http:\/\/www.shapeoko.com\/wiki\/index.php\/Belt_Anchors for other ideas.\n\/\/ Motivated by http:\/\/www.thingiverse.com\/thing:33881 not being strong enough\n\/\/ when I initially printed it.\n\n\/\/ Upright: printed, but not stress tested, looks sturdy\n\/\/ Top: completely untested\n\ngThick = 8;\ngRibHeight = 6;\ngTopRoundoverRadius = 4;\ngSideRoundoverRadius = 4;\ngMainWidth = 16;\ngMainHeight = 66;\n\ngTopWidth = 30;\ngRibWidth = 3.4;\ngRibLength = 50;\ngHoleSpacing = 20;\ngBeltWide = 14; \/\/ 1\/4\" belt + slop\ngBeltPitch = 2.032; \/\/ MXL in mm\ngBeltThick = 1.5;\ne = 0.02;\n\n\/\/ screw_clearance_diameter, socket_head_clearance_diameter, nut outside diameter\n\/\/ TODO untested numbers, these should move to a common include.\nM3 = [3.8, 6.4, 6.5];\nM5 = [5.5, 9.4, 9.4];\nM8 = [8, 13, 13];\n\nmodule InsetHole(x) {\n d = x[0];\n socket_head = x[1];\n union() {\n translate([0,0,-50]) cylinder(r=d\/2, h=100);\n cylinder(r=socket_head\/2, h=10);\n }\n}\n\nmodule NutHole(x) {\n d = x[0];\n nut_size = x[2];\n union() {\n translate([0,0,1]) cylinder(r=d\/2, h=50);\n cylinder(r=nut_size\/2, $fn=6, h=6);\n }\n}\n\nmodule Rib(t=4) {\n translate([-t\/2,0,-0.1])\n rotate([90,0,90])\n linear_extrude(height=t)\n polygon(points=[[0,0],[gRibLength,0],[0,gRibHeight]],paths=[[0,1,2]]);\n}\n\nmodule Roundover(r) {\n translate([0.1,0.1,-50])\n difference() {\n cube([r,r,100]);\n translate([0,0,-1]) cylinder(r=r,h=102,$fn=20);\n }\n}\n\nmodule Upright() {\n difference() {\n union() {\n \/\/ body, for now (until beziers work)\n translate([0,-gMainHeight\/2-4.9,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n translate([0,0,gThick\/2]) cube([gMainWidth,gMainHeight,gThick], center=true);\n \/\/ ribs\n translate([(gMainWidth-gRibWidth)\/2,-gMainHeight\/2,gThick]) Rib(t=gRibWidth);\n translate([-(gMainWidth-gRibWidth)\/2,-gMainHeight\/2,gThick]) Rib(t=gRibWidth);\n }\n \/\/ Chamfer top edges\n \/\/ TODO make these translation numbers constants as well, and fix Roundover's\n \/\/ origin.\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ Chamfer edges near bottom mounting hole\n translate([gMainWidth\/2-gSideRoundoverRadius,gMainHeight\/2-4,0])\n Roundover(r=gSideRoundoverRadius);\n translate([-(gMainWidth\/2-gSideRoundoverRadius),gMainHeight\/2-4,0])\n rotate([0,0,90])\n Roundover(r=gSideRoundoverRadius);\n \/\/ M5 mounting holes\n translate([0,gMainHeight\/2-30,gThick-2]) InsetHole(M5);\n translate([0,gMainHeight\/2-10,gThick-2]) InsetHole(M5);\n \/\/ M3 nut traps (20mm spacing, for compat with old part)\n translate([-gHoleSpacing\/2,-gMainHeight\/2+4,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,-gMainHeight\/2+4,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n }\n}\n\nmodule Belt() {\n translate([0,0,gBeltThick\/2]) cube([gBeltWide,30,gBeltThick], center=true);\n for(i = [0:30\/gBeltPitch]) {\n translate([0,i * gBeltPitch,-gBeltThick\/2+e]) cube([gBeltWide,gBeltPitch \/ 2,gBeltThick], center=true);\n }\n}\n\nmodule Top() {\n rotate([-90,0,0]) difference() {\n translate([0,-6\/2,(gThick+gRibHeight)\/2]) cube([gTopWidth,6,gThick+gRibHeight], center=true);\n \/\/ holes\n translate([-gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n \/\/ chamfer\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ TODO remove magic number\n translate([0,-8+(1.6*gBeltThick),0]) rotate([90,0,0]) Belt();\n }\n}\n\nunion() {\n Upright();\n translate([0,-gMainHeight\/2-12,0]) rotate([0,0,180]) Top();\n}\n\/\/union() {\n\/\/ for(i=[1:4]) {\n\/\/ translate([0,-15*i,0]) Top();\n\/\/ }\n\/\/}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"1bad0f8a7604e3755c81b63ad7463025f5e038b0","subject":"Change some variable names\/comments","message":"Change some variable names\/comments","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch\/2; \/\/ inset from board edge\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB (along z)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n height = 2.7;\n area = [7.7, 5.2];\n colour = [220\/255, 220\/255, 220\/255];\n move_x = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch;\n move_z = ArduinoPro_PCB_Height;\n\n color(colour)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square(size = area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole(d = 1.25) {\n \/\/ Standard PCB hole\n circle(d = d);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_Hole_Space = 2.54; \/\/ spacing of the holes\nArduinoPro_Hole_Inset = ArduinoPro_Hole_Space\/2; \/\/ Inset from board edge\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255];\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n height = 2.7;\n area = [7.7, 5.2];\n colour = [220\/255, 220\/255, 220\/255];\n move_x = ArduinoPro_PCB_Width\/2 - ArduinoPro_Hole_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space;\n move_z = ArduinoPro_PCB_Height;\n\n color(colour)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square(size = area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole(d = 1.25) {\n \/\/ Standard PCB hole\n circle(d = d);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_Hole_Space - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_Hole_Space : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_Hole_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_Hole_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_Hole_Inset : ArduinoPro_Hole_Space : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_Hole_Inset, -ArduinoPro_Hole_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dbc089506fe64a06af4e50f2ef50aea44a28648a","subject":"Fix place of conges()","message":"Fix place of conges()\n","repos":"mbouyer\/marine_chartplotter,mbouyer\/marine_chartplotter,mbouyer\/marine_chartplotter,mbouyer\/marine_chartplotter","old_file":"hardware\/CAD\/cover-wp11.scad","new_file":"hardware\/CAD\/cover-wp11.scad","new_contents":"$fn=100;\nlongueur = 150.5;\nlargeur = 110.5;\nhauteur = 42;\nrayon = 20;\nbase_ep = 1.5;\nmurs_ep = 1.5;\n\nlongueur_e = longueur+murs_ep*2;\nlargeur_e = largeur+murs_ep*2;\nrayon_e = rayon + murs_ep;\n\nlongueur_c = longueur \/ 2 - rayon;\nlargeur_c = largeur \/ 2 - rayon;\n\nconge = murs_ep * 2;\n\nmodule quart_tore() {\n\trotate_extrude(angle = 90, convexity=10) translate([rayon, 0, 0])\n\t difference() {\n\t\ttranslate([-conge\/2, conge\/2, 0]) square([conge, conge], center=true);\n\t\ttranslate([-conge, conge, 0]) circle(r=conge, $fn=500);\n\t };\n}\n\nmodule quart_rond(l) {\n\tdifference() {\n\t\ttranslate([-conge\/2, -conge\/2, 0]) cube([conge, conge, l], center=true);\n\t\ttranslate([-conge, -conge, 0]) cylinder(r=conge, h=l, center=true, $fn=500);\n\t}\n}\n\nmodule quart_tube() {\n\tintersection() {\n\t\tdifference() {\n\t\t\tcylinder(r = rayon_e, h = hauteur, center=true, $fn = 500);\n\t\t\tcylinder(r = rayon - 0.001, h = hauteur, center=true, $fn = 500);\n\t\t};\n\t\ttranslate([rayon_e\/2, rayon_e\/2, 0]) cube([rayon_e, rayon_e, hauteur], center=true);\n\t};\n}\n\nmodule base () {\n\tunion() {\n\t\tdifference() {\n\t\t\tcube([longueur_e, largeur_e, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t} ;\n\t\ttranslate([longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([-longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([-longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\n\t};\n}\n\nmodule murs() {\n\ttranslate([0,0,base_ep\/2 + hauteur\/2]) union() {\n\t\ttranslate([(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep + 0.0001, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([-(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep + 0.0001, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([0, (largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep + 0.0001, hauteur], center = true);\n\t\ttranslate([0, -(largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep + 0.0001, hauteur], center = true);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tube();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tube();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tube();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tube();\n\t};\n}\n\nmodule conges() {\n\ttranslate([0,0,base_ep\/2]) union() {\n\t\ttranslate([longueur\/2, 0, 0]) rotate([90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([-longueur\/2, 0, 0]) rotate([-90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([0, largeur\/2, 0]) rotate([0,90,0]) quart_rond(longueur-rayon*2);\n\t\ttranslate([0, -largeur\/2, 0]) rotate([90,90,-90]) quart_rond(longueur-rayon*2);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tore();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tore();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tore();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tore();\n\t};\n}\n\nmodule all() {\n\tunion() {\n\t\tbase();\n\t\tmurs();\n\t\tconges();\n\n\t};\n}\n\nall();\n\n\/\/ difference() {\n\/\/ \tall ();\n\/\/ \tcube([longueur+10, largeur+10, (hauteur-5) * 2], center=true);\n\/\/ }\n\/\/ projection(cut=true) translate([0,0, -(base_ep+conge+0.1)]) all();\n\/\/ projection(cut=true) rotate([90, 0, 0]) all();\n","old_contents":"$fn=100;\nlongueur = 150.5;\nlargeur = 110.5;\nhauteur = 42;\nrayon = 20;\nbase_ep = 1.5;\nmurs_ep = 1.5;\n\nlongueur_e = longueur+murs_ep*2;\nlargeur_e = largeur+murs_ep*2;\nrayon_e = rayon + murs_ep;\n\nlongueur_c = longueur \/ 2 - rayon;\nlargeur_c = largeur \/ 2 - rayon;\n\nconge = murs_ep * 2;\n\nmodule quart_tore() {\n\trotate_extrude(angle = 90, convexity=10) translate([rayon, 0, 0])\n\t difference() {\n\t\ttranslate([-conge\/2, conge\/2, 0]) square([conge, conge], center=true);\n\t\ttranslate([-conge, conge, 0]) circle(r=conge, $fn=500);\n\t };\n}\n\nmodule quart_rond(l) {\n\tdifference() {\n\t\ttranslate([-conge\/2, -conge\/2, 0]) cube([conge, conge, l], center=true);\n\t\ttranslate([-conge, -conge, 0]) cylinder(r=conge, h=l, center=true, $fn=500);\n\t}\n}\n\nmodule quart_tube() {\n\tintersection() {\n\t\tdifference() {\n\t\t\tcylinder(r = rayon_e, h = hauteur, center=true, $fn = 500);\n\t\t\tcylinder(r = rayon - 0.001, h = hauteur, center=true, $fn = 500);\n\t\t};\n\t\ttranslate([rayon_e\/2, rayon_e\/2, 0]) cube([rayon_e, rayon_e, hauteur], center=true);\n\t};\n}\n\nmodule base () {\n\tunion() {\n\t\tdifference() {\n\t\t\tcube([longueur_e, largeur_e, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([-longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t\ttranslate([longueur\/2, -largeur\/2, 0]) cube([rayon*2, rayon*2, base_ep], center = true);\n\t\t} ;\n\t\ttranslate([longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([-longueur_c, largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([-longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\t\ttranslate([longueur_c, -largeur_c, 0]) cylinder(r = (rayon+murs_ep), h = base_ep, center = true, $fn = 500);\n\n\t};\n}\n\nmodule murs() {\n\ttranslate([0,0,base_ep\/2 + hauteur\/2]) union() {\n\t\ttranslate([(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep + 0.0001, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([-(longueur+murs_ep)\/2, 0, 0]) cube([murs_ep + 0.0001, largeur-rayon*2, hauteur], center = true);\n\t\ttranslate([0, (largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep + 0.0001, hauteur], center = true);\n\t\ttranslate([0, -(largeur+murs_ep)\/2, 0]) cube([longueur-rayon*2, murs_ep + 0.0001, hauteur], center = true);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tube();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tube();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tube();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tube();\n\t};\n}\n\nmodule conges() {\n\ttranslate([0,0,base_ep]) union() {\n\t\ttranslate([longueur\/2, 0, 0]) rotate([90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([-longueur\/2, 0, 0]) rotate([-90,90,0]) quart_rond(largeur-rayon*2);\n\t\ttranslate([0, largeur\/2, 0]) rotate([0,90,0]) quart_rond(longueur-rayon*2);\n\t\ttranslate([0, -largeur\/2, 0]) rotate([90,90,-90]) quart_rond(longueur-rayon*2);\n\t\ttranslate([longueur_c, largeur_c, 0]) quart_tore();\n\t\ttranslate([-longueur_c, largeur_c, 0]) rotate([0,0,90]) quart_tore();\n\t\ttranslate([-longueur_c, -largeur_c, 0]) rotate([0,0,180]) quart_tore();\n\t\ttranslate([longueur_c, -largeur_c, 0]) rotate([0,0,-90]) quart_tore();\n\t};\n}\n\nmodule all() {\n\tunion() {\n\t\tbase();\n\t\tmurs();\n\t\tconges();\n\n\t};\n}\n\nall();\n\n\/\/ difference() {\n\/\/ \tall ();\n\/\/ \tcube([longueur+10, largeur+10, (hauteur-5) * 2], center=true);\n\/\/ }\n\/\/ projection(cut=true) translate([0,0, -(base_ep+conge+0.1)]) all();\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"c2a27688f3d70b3117f09a2473d2785c5aaa1abe","subject":"added test sample","message":"added test sample\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module rise_for(h)\n {\n translate([0, 0, 11-h+eps])\n children();\n }\n module up()\n {\n translate([0, 9, 0])\n children();\n }\n module right()\n {\n translate([9, 0, 0])\n children();\n }\n module pair(d, h)\n {\n right()\n {\n rise_for(h)\n {\n cylinder(d=d, h=h);\n up()\n cylinder(d=d, h=h+10);\n }\n children();\n }\n }\n\n difference()\n {\n cube([37, 20, 11]);\n translate([-3, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4db64e1d413f2d608cc4bbffc76fe8ea5698480b","subject":"Lattice Shell","message":"Lattice Shell\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/LatticeShell.scad","new_file":"hardware\/sandbox\/LatticeShell.scad","new_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\nLatticeShell_STL();\n\n\n\n\nmodule LatticeShell_STL() {\n\tprintedPart(\"printedparts\/LatticeShell.scad\", \"Lattice Shell\", \"LatticeShell_STL()\") {\n\t view(t=[-2, 6, 14], r=[63, 0, 26], d=726);\n\n color([Level2PlasticColor[0], Level2PlasticColor[1], Level2PlasticColor[2], 1])\n if (UseSTL) {\n import(str(STLPath, \"LatticeShell.stl\"));\n } else {\n\t\t\t\tLatticeShell_Model();\n }\n }\n}\n\n\nmodule LatticeShell_Model() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/LatticeShell_Lattice();\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\tunion() {\n\t\t\/\/ shell coupler and skirt\n\t\tdifference() {\n\t\t\trotate_extrude()\n\t\t\t\tdifference() {\n\t\t\t\t\tunion() {\n\t\t\t\t\t\t\/\/ upper coupling ring\n\t\t\t\t\t\trotate([0,0,56])\n\t\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\t\ta=20\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\/\/ lower skirt\n\t\t\t\t\t\trotate([0,0,0])\n\t\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\t\ta=5\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\n\t\t\t\t\tpolygon(\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t]);\n\n\t\t\t\t}\n\t\t}\n\n\t\t\/\/ Lattice\n\t\tLatticeShell_Lattice();\n\n\t\t\/\/ twist lock\n\t\tShell_TwistLock();\n\t}\n\n}\n\n\nmodule LatticeShell_Lattice() {\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\n\t\/\/ number of steps in curve\n\tsteps = 20;\n\n\tstripWidth = 2.5;\n\tnumStrips = 40;\n\n\tintersection() {\n\t\t\/\/ shell\n\t\trotate_extrude()\n\t\t\tdonutSector(\n\t\t\t\tor=or,\n\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\ta=58\n\t\t\t);\n\n\t\t\/\/ lattice work\n\t\tfor (k=[0:numStrips-1])\n\t\t\trotate([0,0,k * 360\/numStrips]) {\n\t\t\t\t\/\/ control points\n\t\t\t\t\/\/cp1 = [rands(-10,10,1)[0], 0]; \/\/ start\n\t\t\t\t\/\/cp4 = [rands(-5,5,1)[0] + (k%2 == 0 ? 20 : -20), or * sin(60) + 5]; \/\/ end\n\t\t\t\tcp1 = [0, 0]; \/\/ start\n\t\t\t\tcp4 = [(k%2 == 0 ? 20 : -20), or * sin(60)]; \/\/ end\n\t\t\t\tcp2 = [ cp1[0] + rands(-25,25,1)[0], or * sin(20) ]; \/\/ handle 1\n\t\t\t\tcp3 = [ cp4[0] + rands(-25,25,1)[0], or * sin(40)]; \/\/ handle 2\n\n\t\t\t\t\/\/ generate and position the curve\n\t\t\t\trotate([90,0,0])\n\t\t\t\t\ttranslate([0,0,0])\n\t\t\t\t\tlinear_extrude(2*or)\n\t\t\t\t\tunion() \/\/ union lots of little \"pill\" shapes for each segment of the curve\n\t\t\t\t\tfor (i=[0:steps-2]) {\n\t\t\t\t\t\t\/\/ curve time parameters for this step and next\n\t\t\t\t\t\tu1 = i \/ (steps-1);\n\t\t\t\t\t\tu2 = (i+1) \/ (steps-1);\n\n\t\t\t\t\t\t\/\/ 2D points for this step and next\n\t\t\t\t\t\tp1 = PtOnBez2D(cp1, cp2, cp3, cp4, u1);\n\t\t\t\t\t\tp2 = PtOnBez2D(cp1, cp2, cp3, cp4, u2);\n\n\t\t\t\t\t\t\/\/ hull together circles at this the position of this step and next\n\t\t\t\t\t\thull($fn=8) {\n\t\t\t\t\t\t\ttranslate(p1) circle(stripWidth\/2);\n\t\t\t\t\t\t\ttranslate(p2) circle(stripWidth\/2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t}\n\n\n}\n","old_contents":"include <..\/config\/config.scad>\nUseSTL=false;\nUseVitaminSTL=true;\nDebugConnectors=true;\nDebugCoordinateFrames=true;\n\nLatticeShell_STL();\n\n\n\n\nmodule LatticeShell_STL() {\n\tprintedPart(\"printedparts\/LatticeShell.scad\", \"Lattice Shell\", \"LatticeShell_STL()\") {\n\t view(t=[-2, 6, 14], r=[63, 0, 26], d=726);\n\n color([Level2PlasticColor[0], Level2PlasticColor[1], Level2PlasticColor[2], 1])\n if (UseSTL) {\n import(str(STLPath, \"LatticeShell.stl\"));\n } else {\n\t\t\t\tLatticeShell_Model();\n }\n }\n}\n\n\nmodule LatticeShell_Model() {\n\n\tsw = 2 * perim;\n\n\tor = BaseDiameter\/2 + Shell_NotchTol + dw;\n\n\tsr = or - sw + eta;\n\n\tsupportAngle = 50;\n\tbridgeDist = 5;\n\n\tnumRibs1 = round(circumference(sr * cos(supportAngle)) \/ bridgeDist);\n\tnumRibs = 4 * (floor(numRibs1 \/ 4) + 1);\n\n\tribThickness = 0.7;\n\n\t$fn=64;\n\n\t\/\/ shell with hole for LED\n\t\/\/render()\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\t\/\/ curved shell with centre hole for pen\n\t\t\t\tdifference() {\n\t\t\t\t\trotate_extrude()\n\t\t\t\t\t\tdifference() {\n\t\t\t\t\t\t\t\/\/ outer shell\n\t\t\t\t\t\t\tdonutSector(\n\t\t\t\t\t\t\t\tor=or,\n\t\t\t\t\t\t\t\tir=BaseDiameter\/2 + Shell_NotchTol,\n\t\t\t\t\t\t\t\ta=90\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tpolygon(\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t[0, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 + 1000, ShellOpeningHeight + 1000],\n\t\t\t\t\t\t\t\t\t[ShellOpeningDiameter\/2 - dw - 1, ShellOpeningHeight - dw - 1],\n\t\t\t\t\t\t\t\t\t[0, ShellOpeningHeight - dw - 1]\n\t\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\tlinear_extrude(or)\n\t\t\t\t\t\t\trandom_voronoi(\n\t\t\t\t\t\t\t\tn = 80, nuclei = false,\n\t\t\t\t\t\t\t\tL = or+30, thickness = 1.5,\n\t\t\t\t\t\t\t\tround = 1, min = 0, max = 2*or,\n\t\t\t\t\t\t\t\tseed = 7, center = true\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\/\/ hollow the middle of the voronoi mesh\n\t\t\t\t\t\tcylinder(r=ShellOpeningDiameter\/2 + 5, h=or);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\n\t\t\t\t\/\/ twist lock\n\t\t\t\tShell_TwistLock();\n\t\t\t}\n\t\t}\n}\n\n\n\/*\n\n Shell API Functions\n\n To help build loads of funky shells... with twist-lock fitting\n\n*\/\n\nShell_NotchOuterWidth = 20;\nShell_NotchSlope = 2;\nShell_NotchInnerWidth = Shell_NotchOuterWidth - 2* Shell_NotchSlope;\nShell_NotchDepth = 5;\nShell_NotchTol = 1;\nShell_NotchStop = dw;\nShell_NotchRotation = 2 * atan2(Shell_NotchOuterWidth\/2 - Shell_NotchStop\/2, BaseDiameter\/2);\n\n\/\/ 2D shape to be removed from the base to support shell twist-lock\nmodule Shell_TwistLockCutouts() {\n a = Shell_NotchOuterWidth + 2*Shell_NotchTol;\n b = Shell_NotchInnerWidth + 2*Shell_NotchTol;\n h = Shell_NotchDepth + Shell_NotchTol;\n aOffset = Shell_NotchSlope;\n\n for (i=[0,1])\n rotate([0,0, i*180 + Shell_NotchRotation\/2])\n translate([BaseDiameter\/2 - h\/2 + eta, 0, 0])\n rotate([0,0, 90])\n trapezoid(b, a, h, aOffset, center=true);\n}\n\n\/\/ 3D twist-lock ring to mate a shell to the base\nmodule Shell_TwistLock() {\n a = Shell_NotchOuterWidth;\n b = Shell_NotchInnerWidth;\n h = Shell_NotchDepth;\n aOffset = Shell_NotchSlope;\n\n union() {\n \/\/ Locking tabs\n for (i=[0,1])\n translate([0,0,-dw])\n difference() {\n \/\/ create the basic tab shape\n linear_extrude(dw)\n hull() {\n \/\/ Locking tab\n rotate([0,0, i*180 - Shell_NotchRotation\/2])\n translate([BaseDiameter\/2 - h\/2 + eta, 0, 0])\n rotate([0,0, 90])\n trapezoid(b, a, h, aOffset, center=true);\n\n \/\/ linking piece to connect locking tab to outer ring\n translate([0,0,0])\n rotate([0,0, i*180 - Shell_NotchRotation])\n donutSector(or=BaseDiameter\/2 + Shell_NotchTol + dw,\n ir=BaseDiameter\/2,\n a=Shell_NotchRotation\n );\n }\n\n \/\/ now chop out a slight slope to allow for a tight friction fit\n rotate([0,0, i*180 - Shell_NotchRotation\/2])\n translate([BaseDiameter\/2 - h - 3, 0, dw * 0.8])\n rotate([5,0,0])\n translate([0,-a\/2-1,0])\n cube([10, a + 2,10]);\n }\n\n\n \/\/ notch stops\n for (i=[0,1])\n rotate([0,0, i*180 - Shell_NotchRotation\/2 + 0.3])\n translate([BaseDiameter\/2 - h\/2 + 1+eta, a\/2 - Shell_NotchStop\/2 - 0.5\/2, -dw])\n rotate([0,0, 90])\n linear_extrude(dw*2)\n trapezoid(Shell_NotchStop-aOffset+0.7, Shell_NotchStop+1.3, h+2, 0, center=true);\n\n \/\/ outer ring\n translate([0,0,-dw])\n rotate_extrude()\n translate([BaseDiameter\/2 + Shell_NotchTol, 0])\n union() {\n square([dw, 3*dw]);\n\n translate([eta, 3*dw - Shell_NotchTol, 0])\n mirror([1,1,0])\n rightTriangle(dw, dw, center = true);\n\n translate([-dw+eta, 3*dw - Shell_NotchTol - eta,0])\n square([dw, Shell_NotchTol+eta]);\n }\n\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"87f481940cab1471caf024d94f99be026f7ee145","subject":"PrinterBotZStop.scad: initial checkin","message":"PrinterBotZStop.scad: initial checkin\n","repos":"tschutter\/printrbot","old_file":"things\/PrinterBotZStop.scad","new_file":"things\/PrinterBotZStop.scad","new_contents":"\/\/ Various Z stop parts.\n\nBottomNutCapture(19, 14, 8, 13, 7, 3, 2);\n\nmodule BottomNutCapture(width, length, height, slotWidth, nutDiameter, nutHeight, screwDiameter) {\n \/\/ width = width in mm\n \/\/ length = length in mm\n \/\/ height = height in mm\n\n difference() {\n \/\/ body\n cube([width, length, height], center=true);\n\n \/\/ slot\n translate([0, -1, 10]) {\n cube([slotWidth, length + 3, 20], center=true);\n }\n\n \/\/ nut\n translate([0, 0, -nutHeight]) {\n cylinder(h = nutHeight + 1, d = nutDiameter, $fn=6, center=false);\n }\n\n \/\/ screw hole\n cylinder(h = height + 2, d = screwDiameter, $fn=30, center=true);\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'things\/PrinterBotZStop.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"6df4367f0d583265c18b4a1d91c4dadc03f12568","subject":"Ready to laser cut...","message":"Ready to laser cut...\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/mobile_support.scad","new_file":"Hardware\/mobile_support.scad","new_contents":"width = 97; \/\/ External width (except clipping mechanism)\nheight = 146; \/\/ External height (except clipping mechanism)\ncorner_radius = 14; \/\/ Round corner at the bottom corners\ntop_width = 114; \/\/ Clipping mechanism width\ntop_height = 20; \/\/ Clipping mechanism height\nthickness = 5; \/\/ Thickness\nclip_height = 14;\n\n\/\/Main pocket\ndifference()\n{\n\tunion(){\n\t\tcube(size = [width,height,thickness], center = true);\n\t\tdifference(){\n\t\t\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([-width\/2-1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n\t\t}\n\t\tdifference(){\n\t\t\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t\t\ttranslate([width\/2+5, 0,0]) cylinder(r=2.5, h=thickness, center = true);\n\t\t\ttranslate([width\/2+1.5, -10,0]) cube(size =[3,26,thickness], center = true);\n}\n\t}\n\tcube(size = [width-20,height-24,thickness], center = true);\n}\n\n\/\/ Existing top clip\n\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\n\nclip_width = width +20;\n\/\/ Top clip support\ndifference(){\n\ttranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, height\/2- clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Top clip\ndifference()\n{\n\ttranslate([-clip_height, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([-clip_height, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([-clip_height, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\/\/ Bottom clip support\ndifference(){\n\ttranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\ttranslate([-clip_width\/2+7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([+clip_width\/2-7, -height\/2+ clip_height\/2, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\/\/ Bottom clip\ndifference(){\n translate([clip_height, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\ttranslate([clip_height, clip_width\/2-7, 0]) cylinder(r=2.5, h=thickness, center = true);\n\ttranslate([clip_height, -clip_width\/2+7, 0]) cylinder(r=2.5, h=thickness, center = true);\n}\n\n\n\n\n","old_contents":"width = 97; \/\/ External width (except clipping mechanism)\nheight = 142; \/\/ External height (except clipping mechanism)\ncorner_radius = 14; \/\/ Round corner at the bottom corners\ntop_width = 114; \/\/ Clipping mechanism width\ntop_height = 20; \/\/ Clipping mechanism height\nthickness = 2*0.7; \/\/ Thickness of clipping mechanism\nclip_height = 12;\n\n\/\/Main pocket\ndifference()\n{\n\tunion(){\n\tcube(size = [width,height,thickness], center = true);\n\ttranslate([-width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\ttranslate([width\/2, 0,0]) cylinder(r=20, h=thickness, center = true);\n\t}\n\tcube(size = [width-20,height-24,thickness], center = true);\n}\n\n\/\/ Existing top clip\n\/\/translate([0, height\/2 + top_height\/2, 0]) cube(size = [top_width,top_height,thickness], center = true);\n\n\nclip_width = width +20;\n\/\/ Top clip support\ntranslate([0, height\/2 - clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\n\/\/ Top clip \ntranslate([-clip_height, 0 , 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\n\/\/ Bottom clip support\ntranslate([0, -height\/2+clip_height\/2, 0]) cube(size = [clip_width, clip_height, thickness], center = true);\n\n\/\/ Bottom clip\ntranslate([clip_height, 0, 0]) cube(size = [clip_height, clip_width, thickness], center = true);\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fb19a8fda395891b19bd2b7f00a26451b735695d","subject":"model rotated for a print","message":"model rotated for a print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"\/*\n * configuration\n *\/\n\nbrushes_count = 2;\n\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, 20+4, 0])\n difference()\n {\n cylinder(h=10+3, r=20);\n translate([0,0,3])\n cylinder(h=10+3, r2=20, r1=16);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, 24+5, 0])\n difference()\n {\n cylinder(h=16, r=24+5);\n cylinder(h=16, r=24+0);\n }\n}\n\n\nmodule back_wall()\n{\n translate([0,0,0])\n {\n \/\/ lower part\n translate([-70\/2, 0, 0])\n cube([70, 3, 20]);\n \/\/ upper part\n translate([-70\/2, 0, 100-16+13])\n cube([70, 3, 20]);\n \/\/ connector\n translate([-20\/2, 0, 0])\n cube([20, 3, 100]);\n }\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-30\/2, 3, 0])\n cube([30, 10, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100])\n {\n difference()\n {\n translate([-40\/2, 3, 0])\n cube([40, 10, 16]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(offset = [0:brushes_count-1])\n {\n translate(offset * [60, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"\/*\n * configuration\n *\/\n\nbrushes_count = 2;\n\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, 20+4, 0])\n difference()\n {\n cylinder(h=10+3, r=20);\n translate([0,0,3])\n cylinder(h=10+3, r2=20, r1=16);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, 24+5, 0])\n difference()\n {\n cylinder(h=16, r=24+5);\n cylinder(h=16, r=24+0);\n }\n}\n\n\nmodule back_wall()\n{\n translate([0,0,0])\n {\n \/\/ lower part\n translate([-70\/2, 0, 0])\n cube([70, 3, 20]);\n \/\/ upper part\n translate([-70\/2, 0, 100-16+13])\n cube([70, 3, 20]);\n \/\/ connector\n translate([-20\/2, 0, 0])\n cube([20, 3, 100]);\n }\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-30\/2, 3, 0])\n cube([30, 10, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100])\n {\n difference()\n {\n translate([-40\/2, 3, 0])\n cube([40, 10, 16]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nfor(offset = [0:brushes_count-1])\n{\n translate(offset * [60, 0, 0])\n brush_holder();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"09bed630c46c1f91e0cb5086bef90cff8f6b080a","subject":"The rainmaker code was refactored to parameterize more arguments.","message":"The rainmaker code was refactored to parameterize more arguments.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/rainmaker.scad","new_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/rainmaker.scad","new_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule rainmaker(height = 140,\n innerRadius = 30,\n outerRadius = 34,\n\t\t\t \t stepRadius = 2,\n\t\t\t \t zRotateAngle = 25)\n{\n union()\n {\n \/\/ the main shell\n \t%\n openCylinder(height = height,\n innerRadius = innerRadius,\n outerRadius = outerRadius);\n\n bottomZ = 5;\n\n \/\/ the steps\n zStart = bottomZ;\n step_xLength = (innerRadius * 2) + 1;\n rainmaker_steps(height = height,\n\t\t\t\t\t\tstepRadius = stepRadius,\n\t\t\t\t\t\tstep_xLength = step_xLength,\n\t\t\t\t\t\tzRotateAngle = zRotateAngle,\n zStart = zStart);\n\n \/\/ the bottom\n cylinder(r=outerRadius, h=bottomZ);\n }\n}\n\nmodule rainmaker_steps(height,\n\t\t\t\t\t\tstepRadius,\n\t\t\t\t\t\tstep_xLength,\n\t\t\t\t\t\tzRotateAngle,\n\t\t\t\t\t\tzStart)\n{\n step = 5;\n\n\tzEnd = height - step - stepRadius;\n\n for(z = [zStart : step : zEnd])\n {\n\t\txTranslate = 0;\n zTranslate = zStart + z;\n\n\t\tzRotate = z * zRotateAngle;\n\n\t\tfor(s = [1 : 1 : 2])\n\t\t{\n\t\t\tif(s == 1)\n\t\t\t{\n\t\t translate([xTranslate, 0, zTranslate])\n\t\t\t\trotate([0, 90, zRotate])\n\t\t cylinder(r = stepRadius,\n\t\t\t\t\t\t\th = step_xLength,\n\t\t\t\t\t\t\tcenter = true);\n\t\t\t}\n\t\t}\n }\n}\n","old_contents":"\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\n\nmodule rainmaker(height = 140,\n innerRadius = 30,\n outerRadius = 34,\n\t\t\t \t stepRadius = 2)\n{\n union()\n {\n \/\/ the main shell\n \t%\n openCylinder(height = height,\n innerRadius = innerRadius,\n outerRadius = outerRadius);\n\n bottomZ = 5;\n\n \/\/ the steps\n zStart = bottomZ;\n step_xLength = (innerRadius * 2) + 1;\n rainmaker_steps(height = height,\n\t\t\t\t\t\tstepRadius = stepRadius,\n\t\t\t\t\t\tstep_xLength = step_xLength,\n zStart = zStart);\n\n \/\/ the bottom\n cylinder(r=outerRadius, h=bottomZ);\n }\n}\n\nmodule rainmaker_steps(height,\n\t\t\t\t\t\tstepRadius,\n\t\t\t\t\t\tstep_xLength,\n\t\t\t\t\t\tzStart)\n{\n step = 5;\n\n\tzEnd = height - step - stepRadius;\n\n for(z = [zStart : step : zEnd])\n {\n\t\txTranslate = 0;\n zTranslate = zStart + z;\n\n\/\/\t\tzRotate = z * 5;\n\t\tzRotate = z * 25;\n\n\t\tfor(s = [1 : 1 : 2])\n\t\t{\n\t\t\tif(s == 1)\n\t\t\t{\n\/\/\t\t\t\tcolor(\"green\")\n\t\t translate([xTranslate, 0, zTranslate])\n\t\t\t\trotate([0, 90, zRotate])\n\t\t cylinder(r = stepRadius,\n\t\t\t\t\t\t\th = step_xLength,\n\t\t\t\t\t\t\tcenter = true);\n\t\t\t}\n\t\t}\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"18ddd66b08ae2ccfb99c352e02fb5108409b139d","subject":"fix: misplacement of the elements when centering a distributed grid","message":"fix: misplacement of the elements when centering a distributed grid\n","repos":"jsconan\/camelSCAD","old_file":"operator\/distribute\/grid.scad","new_file":"operator\/distribute\/grid.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that distribute children modules with respect to particular rules.\n *\n * @package operator\/distribute\n * @author jsconan\n *\/\n\n\/**\n * Distributes the children modules on a grid with the provided `interval`, up to `line` elements per lines.\n *\n * @param Vector [intervalX] - The interval between each columns.\n * @param Vector [intervalY] - The interval between each lines.\n * @param Number [line] - The max number of elements per lines.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule distributeGrid(intervalX = [1, 0, 0],\n intervalY = [0, 1, 0],\n line = 2,\n center = false) {\n\n intervalX = vector3D(intervalX);\n intervalY = vector3D(intervalY);\n count = $children;\n line = max(floor(abs(float(line))), 1);\n offsetX = center ? -intervalX * ((count > line ? line : count) - 1) \/ 2 : [0, 0, 0];\n offsetY = center ? -intervalY * (floor(count \/ line) - (count % line ? 0 : 1)) \/ 2 : [0, 0, 0];\n\n for (i = [0 : count - 1]) {\n translate(offsetX + intervalX * (i % line) + offsetY + intervalY * floor(i \/ line)) {\n children(i);\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that distribute children modules with respect to particular rules.\n *\n * @package operator\/distribute\n * @author jsconan\n *\/\n\n\/**\n * Distributes the children modules on a grid with the provided `interval`, up to `line` elements per lines.\n *\n * @param Vector [intervalX] - The interval between each columns.\n * @param Vector [intervalY] - The interval between each lines.\n * @param Number [line] - The max number of elements per lines.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule distributeGrid(intervalX = [1, 0, 0],\n intervalY = [0, 1, 0],\n line = 2,\n center = false) {\n\n intervalX = vector3D(intervalX);\n intervalY = vector3D(intervalY);\n line = max(floor(abs(float(line))), 1);\n offsetX = center ? -intervalX * (line - 1) \/ 2 : [0, 0, 0];\n offsetY = center ? -intervalY * floor($children \/ line) \/ 2 : [0, 0, 0];\n\n for (i = [0 : $children - 1]) {\n translate(offsetX + intervalX * (i % line) + offsetY + intervalY * floor(i \/ line)) {\n children(i);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5f2c116774525e7b2f9f1303ebb9d39314362ddf","subject":"removed test pritn stub, to print the whole elements instead","message":"removed test pritn stub, to print the whole elements instead\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/adapter_nozzle.scad","new_file":"water_rocket_launcher\/adapter_nozzle.scad","new_contents":"use \n\nmodule oring(d_in, d_r)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n}\n\nmodule oring_slot(d_in, d_r, d_ext, d_r_ext)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n hull()\n {\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n translate([d_ext\/2+d_r_ext\/2, 0, 0])\n circle(d=d_r_ext, $fn=fn(40));\n }\n}\n\n\nmodule nozzle()\n{\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n {\n difference()\n {\n cylinder(d=21, h=10, $fn=fn(200));\n translate([0, 0, 6])\n {\n d_in = 17-0.5;\n d_r = 2.5;\n oring_slot(d_in=d_in, d_r=d_r, d_ext=d_in+1.5, d_r_ext=d_r+0.75);\n %oring(d_in=d_in, d_r=d_r);\n }\n }\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nrotate([180, 0, 0])\n nozzle();\n","old_contents":"use \n\nmodule oring(d_in, d_r)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n}\n\nmodule oring_slot(d_in, d_r, d_ext, d_r_ext)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n hull()\n {\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n translate([d_ext\/2+d_r_ext\/2, 0, 0])\n circle(d=d_r_ext, $fn=fn(40));\n }\n}\n\n\nmodule nozzle()\n{\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n {\n difference()\n {\n cylinder(d=21, h=10, $fn=fn(200));\n translate([0, 0, 6])\n {\n d_in = 17-0.5;\n d_r = 2.5;\n oring_slot(d_in=d_in, d_r=d_r, d_ext=d_in+1.5, d_r_ext=d_r+0.75);\n %oring(d_in=d_in, d_r=d_r);\n }\n }\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\n\/\/rotate([180, 0, 0])\nintersection()\n{\n translate([0, 0, 54.5])\n cube([50, 50, 20], center=true);\n nozzle();\n}\n\n\/\/oring_slot(d_in=17-0.25, d_r=2.5, d_ext=20, d_r_ext=3);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e0a77067db45d43f70a95bafc56267c8b207fcb7","subject":"Minimum 5mm seperation between parts","message":"Minimum 5mm seperation between parts\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n cutouts_vb = cutouts_vb,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n if(twist_holes[t][4] != undef) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=twist_holes[t][4]);\n }\n else\n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=3*thickness);\n }\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n if(twist_connect[t][3] != undef) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=twist_connect[t][3]);\n }\n else\n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=thickness*3);\n }\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(cutouts_vb != undef) for (t = [0:1:len(cutouts_vb)-1]) \n {\n simpleCutouts(cutouts_vb[t][0], cutouts_vb[t][1], cutouts_vb[t][2], cutouts_vb[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ((thickness*2.5 + milling_bit*2) > 5)\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n else\n {\n if ($children) translate([0, max_y(points) + 5, 0])\n children(); \n }\n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(cutouts_vb)\n echo(str(\"[LC] , cutouts_vb = \", cutouts_vb));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness, spine)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and spine\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + ((spine\/2)*(spine\/2)) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness\/2-spine\/4,spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n translate([+thickness\/2+spine\/4,-spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x, spine)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n# translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n\nmodule lasercutoutVinylBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2, overlapfactor=20,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n overlap=(1+overlapfactor)*thickness;\n \n if (sides>3)\n {\n cutouts_1_2= [ \n [x*1\/5, overlap, x\/5, thickness],\n [x*1\/5, y-overlap-thickness, x\/5, thickness],\n [x*3\/5, overlap, x\/5, thickness],\n [x*3\/5, y-overlap-thickness, x\/5, thickness],\n [overlap, y\/3, thickness, y\/3],\n [x-overlap, y\/3, thickness, y\/3] \n ];\n \n \/\/ Base side 1\n translate([0,0,overlap]) lasercutoutSquare(thickness=thickness,\n x=x, y=y,\n cutouts_vb=cutouts_1_2,\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit\n ); \n \n translate([0,y,z-overlap]) rotate([180,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=y,\n cutouts_vb=cutouts_1_2,\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit\n ); \n \n cutouts_3_4= [ \n [overlap, z\/3, thickness, z\/3],\n [x-overlap, z\/3, thickness, z\/3]\n ];\n \n points = [\n [0,overlap+thickness], [x*1\/5,overlap+thickness], \n [x*1\/5,0], [x*2\/5,0], \n [x*2\/5, overlap+thickness], [x*3\/5,overlap+thickness],\n [x*3\/5,0], [x*4\/5,0],\n [x*4\/5,overlap+thickness], [x*5\/5,overlap+thickness],\n [x*5\/5,z-overlap-thickness], [x*4\/5,z-overlap-thickness],\n [x*4\/5,z], [x*3\/5,z],\n [x*3\/5,z-overlap-thickness], [x*2\/5,z-overlap-thickness],\n [x*2\/5,z], [x*1\/5,z],\n [x*1\/5,z-overlap-thickness], [0,z-overlap-thickness],\n [0,z]];\n \n translate([0,thickness+overlap,0]) rotate([90,0,0]) lasercutout(thickness=thickness,\n points=points,\n cutouts_vb=cutouts_3_4,\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit\n ); \n \n translate([0,y-overlap-thickness,z]) rotate([270,0,0]) lasercutout(thickness=thickness,\n points=points,\n cutouts_vb=cutouts_3_4,\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n ); \n }\n points_end = [\n [overlap+thickness,overlap+thickness], \n [overlap+thickness,y*1\/3], \n [0,y*1\/3], [0,y*2\/3],\n [overlap+thickness,y*2\/3], \n [overlap+thickness,y-overlap-thickness], \n [z*1\/3,y-overlap-thickness], \n [z*1\/3,y], \n [z*2\/3,y], \n [z*2\/3,y-overlap-thickness], \n [z-overlap-thickness,y-overlap-thickness], \n [z-overlap-thickness,y*2\/3], \n [z,y*2\/3], \n [z,y*1\/3], \n [z-overlap-thickness,y*1\/3], \n [z-overlap-thickness,overlap+thickness], \n [z*2\/3,overlap+thickness], \n [z*2\/3,0], \n [z*1\/3,0], \n [z*1\/3,overlap+thickness], \n ];\n\n if (sides>4)\n {\n translate([overlap,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_end,\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit\n ); \n }\n\n if (sides>5)\n { \n translate([x-overlap+thickness,0,0]) rotate([0,270,0]) lasercutout(thickness=thickness,\n points=points_end,\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit\n ); \n }\n\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = 0; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n cutouts_vb = cutouts_vb,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n cutouts_vb = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points);\n if(simple_tabs != undef) for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n if(circles_add != undef) for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n if(finger_joints != undef) for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n if(bumpy_finger_joints != undef) for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n if(simple_tab_holes != undef) for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n if(captive_nuts != undef) for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n if(captive_nut_holes != undef) for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n if(twist_holes != undef) for (t = [0:1:len(twist_holes)-1]) \n {\n if(twist_holes[t][4] != undef) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=twist_holes[t][4]);\n }\n else\n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness, spine=3*thickness);\n }\n } \n if(twist_connect != undef) for (t = [0:1:len(twist_connect)-1]) \n {\n if(twist_connect[t][3] != undef) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=twist_connect[t][3]);\n }\n else\n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x, spine=thickness*3);\n }\n } \n if(clips != undef) for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n if(clip_holes != undef) for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n if(circles_remove != undef) for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n if(slits != undef) for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n if(cutouts != undef) for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n if(cutouts_vb != undef) for (t = [0:1:len(cutouts_vb)-1]) \n {\n simpleCutouts(cutouts_vb[t][0], cutouts_vb[t][1], cutouts_vb[t][2], cutouts_vb[t][3], thickness);\n }\n if(screw_tabs != undef) for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n if(screw_tab_holes != undef) for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(cutouts_vb)\n echo(str(\"[LC] , cutouts_vb = \", cutouts_vb));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness, spine)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and spine\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + ((spine\/2)*(spine\/2)) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness\/2-spine\/4,spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n translate([+thickness\/2+spine\/4,-spine\/4,0]) cube([(spine\/2), (spine\/2), thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x, spine)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n# translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(spine\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n screw_tab_holes_a = [],\n twist_holes_a = [],\n clip_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n\nmodule lasercutoutVinylBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2, overlapfactor=20,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n overlap=(1+overlapfactor)*thickness;\n \n if (sides>3)\n {\n cutouts_1_2= [ \n [x*1\/5, overlap, x\/5, thickness],\n [x*1\/5, y-overlap-thickness, x\/5, thickness],\n [x*3\/5, overlap, x\/5, thickness],\n [x*3\/5, y-overlap-thickness, x\/5, thickness],\n [overlap, y\/3, thickness, y\/3],\n [x-overlap, y\/3, thickness, y\/3] \n ];\n \n \/\/ Base side 1\n translate([0,0,overlap]) lasercutoutSquare(thickness=thickness,\n x=x, y=y,\n cutouts_vb=cutouts_1_2,\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit\n ); \n \n translate([0,y,z-overlap]) rotate([180,0,0]) lasercutoutSquare(thickness=thickness,\n x=x, y=y,\n cutouts_vb=cutouts_1_2,\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit\n ); \n \n cutouts_3_4= [ \n [overlap, z\/3, thickness, z\/3],\n [x-overlap, z\/3, thickness, z\/3]\n ];\n \n points = [\n [0,overlap+thickness], [x*1\/5,overlap+thickness], \n [x*1\/5,0], [x*2\/5,0], \n [x*2\/5, overlap+thickness], [x*3\/5,overlap+thickness],\n [x*3\/5,0], [x*4\/5,0],\n [x*4\/5,overlap+thickness], [x*5\/5,overlap+thickness],\n [x*5\/5,z-overlap-thickness], [x*4\/5,z-overlap-thickness],\n [x*4\/5,z], [x*3\/5,z],\n [x*3\/5,z-overlap-thickness], [x*2\/5,z-overlap-thickness],\n [x*2\/5,z], [x*1\/5,z],\n [x*1\/5,z-overlap-thickness], [0,z-overlap-thickness],\n [0,z]];\n \n translate([0,thickness+overlap,0]) rotate([90,0,0]) lasercutout(thickness=thickness,\n points=points,\n cutouts_vb=cutouts_3_4,\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit\n ); \n \n translate([0,y-overlap-thickness,z]) rotate([270,0,0]) lasercutout(thickness=thickness,\n points=points,\n cutouts_vb=cutouts_3_4,\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n ); \n }\n points_end = [\n [overlap+thickness,overlap+thickness], \n [overlap+thickness,y*1\/3], \n [0,y*1\/3], [0,y*2\/3],\n [overlap+thickness,y*2\/3], \n [overlap+thickness,y-overlap-thickness], \n [z*1\/3,y-overlap-thickness], \n [z*1\/3,y], \n [z*2\/3,y], \n [z*2\/3,y-overlap-thickness], \n [z-overlap-thickness,y-overlap-thickness], \n [z-overlap-thickness,y*2\/3], \n [z,y*2\/3], \n [z,y*1\/3], \n [z-overlap-thickness,y*1\/3], \n [z-overlap-thickness,overlap+thickness], \n [z*2\/3,overlap+thickness], \n [z*2\/3,0], \n [z*1\/3,0], \n [z*1\/3,overlap+thickness], \n ];\n\n if (sides>4)\n {\n translate([overlap,0,z]) rotate([0,90,0]) lasercutout(thickness=thickness,\n points=points_end,\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit\n ); \n }\n\n if (sides>5)\n { \n translate([x-overlap+thickness,0,0]) rotate([0,270,0]) lasercutout(thickness=thickness,\n points=points_end,\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit\n ); \n }\n\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"f6592fe2e6388cf21073920bee143d89e498a2ea","subject":"shapes: add lineup and stack","message":"shapes: add lineup and stack\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-shapes.scad","new_file":"utils-shapes.scad","new_contents":"use \n\n\/\/ translate children \nmodule lineup(arr=undef)\n{\n \/*echo(arr);*\/\n \/*echo($children);*\/\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(separations)\n{\n union()\n {\n for (i = [0:len(separations)-1])\n {\n offset = v_sum(separations,i);\n \/*echo(\"i\",i,\"offset\",offset);*\/\n translate ([0,0,offset])\n {\n child(i);\n }\n }\n }\n}\n\nmodule size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);\n%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);\n","old_contents":"use \n\nmodule size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);\n%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d1436a8acea59558370d1216ff51fcc46d9ad823","subject":"The spur options was added to the logic.","message":"The spur options was added to the logic.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/coin.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/coin.scad","new_contents":"\r\nuse <..\/..\/external-resources\/africa\/africa-outline-hi.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>\r\n\r\nuse <..\/..\/shapes\/balloon\/balloon.scad>\r\nuse <..\/..\/shapes\/blue-moon\/blue-moon.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/disk\/disk.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/hourglass\/hourglass.scad>\r\nuse <..\/..\/shapes\/horseshoe\/horseshoe.scad>\r\nuse <..\/..\/shapes\/oval\/oval.scad>\r\nuse <..\/..\/shapes\/religion\/christianity\/crucifixion-cross\/crucifixion-cross.scad>\r\nuse <..\/..\/shapes\/religion\/judaism\/star-of-david\/star-of-david.scad>\r\nuse <..\/..\/shapes\/religion\/islam\/crescent-star\/crescent-star.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>\r\nuse <..\/..\/shapes\/texas\/texas.scad>\r\nuse <..\/..\/shapes\/throwie-cutout\/throwie-cutout.scad>\r\nuse <..\/..\/shapes\/trees\/christmas\/christmas-tree.scad>\r\n\r\nmodule coin(innerIcon,\r\n innerIconXyScale,\r\n innerIconOffsetY,\r\n outerIcon,\r\n outerIconCount,\r\n outerIconXyScale,\r\n radius,\r\n height)\r\n{\r\n difference()\r\n {\r\n \/\/ main disk\r\n cylinder (h = height, r=radius, center = true, $fn=100);\r\n\r\n \/\/ inner icon\r\n translate([0, innerIconOffsetY, -5])\r\n scale([innerIconXyScale, innerIconXyScale, 6.5])\r\n coinIcon(innerIcon, height);\r\n\r\n \/\/ outer icons\r\n for ( i = [0 : outerIconCount] )\r\n {\r\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\r\n translate([0, 43, -5])\r\n scale([outerIconXyScale, outerIconXyScale, 3.0])\r\n coinIcon(outerIcon, height);\r\n }\r\n }\r\n}\r\n\r\nmodule coinIcon(iconName, height)\r\n{\r\n if(iconName == \"Cross\")\r\n {\r\n crucifixionCcross(height);\r\n }\r\n\telse if(iconName == \"Spur\")\r\n\t{\r\n\t\tspur();\r\n\t}\t\r\n else if(iconName == \"Throwie\")\r\n {\r\n throwieCutout(height=height);\r\n }\r\n else if(iconName == \"Star of David\")\r\n {\r\n starOfDavid();\r\n }\r\n else if(iconName == \"Crescent Star\")\r\n {\r\n crescentStar();\r\n }\r\n else if(iconName == \"Star\")\r\n {\r\n star(height);\r\n }\r\n else if(iconName == \"Blue Moon\")\r\n {\r\n blueMoon();\r\n }\r\n else if(iconName == \"Clover\")\r\n {\r\n clover();\r\n }\r\n else if(iconName == \"Heart\")\r\n {\r\n heart();\r\n }\r\n else if(iconName == \"Horseshoe\")\r\n {\r\n horseshoe();\r\n }\r\n else if(iconName == \"Hourglass\")\r\n {\r\n hourglass();\r\n }\r\n else if(iconName == \"OSHW\")\r\n {\r\n oshwLogo();\r\n }\r\n else if(iconName == \"Texas\")\r\n {\r\n texas();\r\n }\r\n else if(iconName == \"Africa\")\r\n {\r\n africa();\r\n }\r\n else if(iconName == \"Oval\")\r\n {\r\n oval();\r\n }\r\n else if(iconName == \"Balloon\")\r\n {\r\n balloon();\r\n }\r\n else if(iconName == \"Circle\")\r\n {\r\n disk();\r\n }\r\n else if(iconName == \"Batman\")\r\n {\r\n batmanLogo();\r\n }\r\n else if(iconName == \"Tree\")\r\n {\r\n christmasTree(height);\r\n }\r\n else\r\n {\r\n \/\/ default is to do nothing\r\n\/\/ echo(\"no coin used\");\r\n }\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/africa\/africa-outline-hi.scad>\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\nuse <..\/..\/external-resources\/oshw\/oshw-logo-800-px.scad>\r\n\r\nuse <..\/..\/shapes\/balloon\/balloon.scad>\r\nuse <..\/..\/shapes\/blue-moon\/blue-moon.scad>\r\nuse <..\/..\/shapes\/clover\/clover.scad>\r\nuse <..\/..\/shapes\/disk\/disk.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/hourglass\/hourglass.scad>\r\nuse <..\/..\/shapes\/horseshoe\/horseshoe.scad>\r\nuse <..\/..\/shapes\/oval\/oval.scad>\r\nuse <..\/..\/shapes\/religion\/christianity\/crucifixion-cross\/crucifixion-cross.scad>\r\nuse <..\/..\/shapes\/religion\/judaism\/star-of-david\/star-of-david.scad>\r\nuse <..\/..\/shapes\/religion\/islam\/crescent-star\/crescent-star.scad>\r\nuse <..\/..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/..\/shapes\/star\/star.scad>\r\nuse <..\/..\/shapes\/texas\/texas.scad>\r\nuse <..\/..\/shapes\/throwie-cutout\/throwie-cutout.scad>\r\nuse <..\/..\/shapes\/trees\/christmas\/christmas-tree.scad>\r\n\r\nmodule coin(innerIcon,\r\n innerIconXyScale,\r\n innerIconOffsetY,\r\n outerIcon,\r\n outerIconCount,\r\n outerIconXyScale,\r\n radius,\r\n height)\r\n{\r\n difference()\r\n {\r\n \/\/ main disk\r\n cylinder (h = height, r=radius, center = true, $fn=100);\r\n\r\n \/\/ inner icon\r\n translate([0, innerIconOffsetY, -5])\r\n scale([innerIconXyScale, innerIconXyScale, 6.5])\r\n coinIcon(innerIcon, height);\r\n\r\n \/\/ outer icons\r\n for ( i = [0 : outerIconCount] )\r\n {\r\n rotate( i * 360 \/ (outerIconCount+1), [0, 0, 1])\r\n translate([0, 43, -5])\r\n scale([outerIconXyScale, outerIconXyScale, 3.0])\r\n coinIcon(outerIcon, height);\r\n }\r\n }\r\n}\r\n\r\nmodule coinIcon(iconName, height)\r\n{\r\n if(iconName == \"Cross\")\r\n {\r\n crucifixionCcross(height);\r\n }\r\n else if(iconName == \"Throwie\")\r\n {\r\n throwieCutout(height=height);\r\n }\r\n else if(iconName == \"Star of David\")\r\n {\r\n starOfDavid();\r\n }\r\n else if(iconName == \"Crescent Star\")\r\n {\r\n crescentStar();\r\n }\r\n else if(iconName == \"Star\")\r\n {\r\n star(height);\r\n }\r\n else if(iconName == \"Blue Moon\")\r\n {\r\n blueMoon();\r\n }\r\n else if(iconName == \"Clover\")\r\n {\r\n clover();\r\n }\r\n else if(iconName == \"Heart\")\r\n {\r\n heart();\r\n }\r\n else if(iconName == \"Horseshoe\")\r\n {\r\n horseshoe();\r\n }\r\n else if(iconName == \"Hourglass\")\r\n {\r\n hourglass();\r\n }\r\n else if(iconName == \"OSHW\")\r\n {\r\n oshwLogo();\r\n }\r\n else if(iconName == \"Texas\")\r\n {\r\n texas();\r\n }\r\n else if(iconName == \"Africa\")\r\n {\r\n africa();\r\n }\r\n else if(iconName == \"Oval\")\r\n {\r\n oval();\r\n }\r\n else if(iconName == \"Balloon\")\r\n {\r\n balloon();\r\n }\r\n else if(iconName == \"Circle\")\r\n {\r\n disk();\r\n }\r\n else if(iconName == \"Batman\")\r\n {\r\n batmanLogo();\r\n }\r\n else if(iconName == \"Tree\")\r\n {\r\n christmasTree(height);\r\n }\r\n else\r\n {\r\n \/\/ default is to do nothing\r\n\/\/ echo(\"no coin used\");\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"02663e1f308b24fd5472d8d9e39a7e596155f04c","subject":"[3d] Remove edge stop and pi screws from Zero variant","message":"[3d] Remove edge stop and pi screws from Zero variant\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 3.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.0;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t])\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 3.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces\nwall_t = 2;\n\/\/ External corner radius on the body\nbody_corner_radius = 4;\n\/\/ Height of the body edge bead chamfer\nbody_chamfer_height = 1.5;\n\n\/* [Hidden] *\/\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.0; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\n\nhm43_split();\n\nfunction inch(x) = x*25.4;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.0;\n nut_ingress = 5.7; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d, oa_h+e],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 3x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([0,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d+e\/sin(60), $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2,lcd_mount_t\/2],\n vertical=[1,1]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7.5,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([9.5,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.85,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-17, h_b+wall_t-lcd_mount_t])\n cube_fillet([w,17,lcd_mount_t+e], \n bottom=[lcd_mount_t\/2,lcd_mount_t\/2,0,lcd_mount_t\/2]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\" || Pi_Model == \"1A+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 3.5])\n cube_fillet([pic_ex+1, 2, h_b-3.5], bottom=[0,0,0,2]);\n translate([0, 81.5-15\/2-3, 3.5])\n cube_fillet([pic_ex+1, 2.5, h_b-3.5], bottom=[0,0,0,2]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, d-5, 3.5])\n cube_fillet([pic_ex+1, 5+e, h_b-3.5], bottom=[0,0,0,2]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f40a06251e89582fac85e76b8654a7e890873bff","subject":"misc: add v_contains","message":"misc: add v_contains\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"619e2bf0a1010f440144a18ba9dd29244454db51","subject":"The module names were refactored.","message":"The module names were refactored.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_contents":"\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n\t signalText1 = \"Impalas\")\r\n{\r\n\tdifference()\r\n\t{\r\n\t\t\tlightSignal_shell(baseHeight,\r\n\t\t\t\t\t\t\t\t\tshowOriginal = false);\r\n\r\n\t\t\tlightSignal_cutouts(signalText1);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\nmodule lightSignal_cutouts(signalText1)\r\n{\r\n\tfont = \"Bauhaus 93:style=Regular\";\r\n\tfontSize = 7.5;\r\n\txTranslate = -18;\r\n\ttranslate([xTranslate, -3, -3])\r\n\tlinear_extrude(height = 6)\r\n\ttext(signalText1, font = font, size = fontSize);\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n\t\t\t\t\t\t\t\t\t showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\t\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\n\tstlBaseInnerRadius = 18.5;\r\n\tstlBaseOuterRadius = stlBaseInnerRadius + 2.5;\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottome disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n","old_contents":"\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n\t signalText1 = \"Impalas\")\r\n{\r\n\tdifference()\r\n\t{\r\n\t\t\tsignalShell(baseHeight,\r\n\t\t\t\t\t\t\t\t\tshowOriginal = false);\r\n\r\n\t\t\tplaque(signalText1);\r\n\t}\r\n}\r\n\r\nmodule plaque(signalText1)\r\n{\r\n\tfont = \"Bauhaus 93:style=Regular\";\r\n\tfontSize = 7.5;\r\n\txTranslate = -18;\r\n\ttranslate([xTranslate, -3, -3])\r\n\tlinear_extrude(height = 6)\r\n\ttext(signalText1, font = font, size = fontSize);\r\n}\r\n\r\nmodule signalShell(baseHeight,\r\n\t\t\t\t\t\t\t\t\t showOriginal = false)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\t\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\n\tstlBaseInnerRadius = 18.5;\r\n\tstlBaseOuterRadius = stlBaseInnerRadius + 2.5;\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"orange\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal)\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottome disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3365ca8202869a6d5a3667b15f14ba32dd1b3a8b","subject":"Added a little extra clearance for motor depth","message":"Added a little extra clearance for motor depth\n\nTo make press fitting the motors easier for kids\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/MotorClip.scad","new_file":"hardware\/printedparts\/MotorClip.scad","new_contents":"\/*\n Clip to hold the stepper motor and driver board, mates to base plate using the pin system.\n\n Local Frame:\n TBC\n\n*\/\n\nMotorClip_DriverOffsetX = 20;\nMotorClip_DriverOffsetZ = 8;\n\n\/\/ Connectors\n\/\/ connector for where the motor attaches...\nWheel_Con_Default\t\t\t\t= [ [0, 0 ,2], [0, 0, 1], 90, 0, 0 ];\n\nMotorClip_Con_Fixing1 = [[20, MotorOffsetZ - dw, 14], [0,1,0], 0,0,0];\nMotorClip_Con_Fixing2 = [[-20, MotorOffsetZ -dw, 14], [0,1,0], 0,0,0];\n\n\/\/ inner fixing holes\nMotorClip_Con_Fixing3 = [[10, MotorOffsetZ - dw, 14], [0,1,0], 0,0,0];\nMotorClip_Con_Fixing4 = [[-10, MotorOffsetZ -dw, 14], [0,1,0], 0,0,0];\n\nMotorClip_Con_Motor = [[0, 0, 4.5], [0,0, 1], 0,0,0];\n\nLeftMotorClip_Con_Driver = [[-MotorClip_DriverOffsetX, 1, MotorClip_DriverOffsetZ], [1, 0, 0], 0,0,0];\nRightMotorClip_Con_Driver = [[MotorClip_DriverOffsetX, 1, MotorClip_DriverOffsetZ], [-1, 0, 0], 0,0,0];\n\n\nmodule LeftMotorClip_STL() {\n\n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\n printedPart(\"printedparts\/MotorClip.scad\", \"Left Motor Clip\", \"LeftMotorClip_STL()\") {\n\n \/\/ TODO: Update view\n view(t=[0,0,0], r=[58,0,225], d=681);\n\n \/\/ Color it as a printed plastic part\n color(PlasticColor)\n if (UseSTL) {\n import(str(STLPath, \"MotorClip.stl\"));\n } else {\n MotorClip_Model();\n }\n }\n}\n\nmodule RightMotorClip_STL() {\n\n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\n printedPart(\"printedparts\/MotorClip.scad\", \"Right Motor Clip\", \"RightMotorClip_STL()\") {\n\n \/\/ TODO: Update view\n view(t=[0,0,0], r=[58,0,225], d=681);\n\n \/\/ Color it as a printed plastic part\n color(PlasticColor)\n mirror([1,0,0])\n if (UseSTL) {\n import(str(STLPath, \"MotorClip.stl\"));\n } else {\n MotorClip_Model();\n }\n }\n}\n\nmodule MotorClip_Model() {\n if (DebugConnectors) {\n \/\/ motor shaft\n connector(DefConDown);\n\n connector(MotorClip_Con_Fixing1);\n connector(MotorClip_Con_Fixing2);\n\n connector(LeftMotorClip_Con_Driver);\n }\n\n dbw = ULN2003Driver_BoardWidth + 1; \/\/ includes clearance\n\n difference() {\n \/\/ solid stuff\n union() {\n \/\/ plate for front of motor\n attach(MotorClip_Con_Motor, DefConDown)\n hull() {\n \/\/ central disc\n cylinder(r=MotorOffsetZ-dw, h=dw);\n\n \/\/ fixing to base plate\n translate([-10, MotorOffsetZ - 2*dw,0])\n cube([20,dw, dw]);\n }\n\n \/\/ motor retaining clip\n attach(MotorClip_Con_Motor, DefConDown)\n attach(StepperMotor28YBJ48_Con_Body, DefConUp)\n translate([0,0,2])\n rotate([0,0,-10])\n sector3D(r=StepperMotor28YBJ48_Body_OR + dw, a=200, h=StepperMotor28YBJ48_Body_Depth + 2*dw + 0.5, center=false);\n\n\n \/\/ base plate\n hull () {\n \/\/ pins\n attach(MotorClip_Con_Fixing1, DefConDown) {\n cylinder(r=12\/2, h=dw);\n }\n\n attach(MotorClip_Con_Fixing2, DefConDown) {\n cylinder(r=12\/2, h=dw);\n }\n\n \/\/ mating join to front plate\n attach(MotorClip_Con_Motor, DefConDown)\n translate([-10, MotorOffsetZ - 2*dw,0])\n cube([20, dw, dw]);\n\n \/\/ mating to driver holder?\n }\n\n\n \/\/ driver holder\n translate([-MotorClip_DriverOffsetX -2*dw, MotorOffsetZ - 2*dw, MotorClip_DriverOffsetZ-4])\n cube([3*dw, dw, dbw]);\n\n \/\/ outer post\n translate([-MotorClip_DriverOffsetX -2*dw, MotorOffsetZ - dw - 12, MotorClip_DriverOffsetZ-4])\n cube([3*dw, 12, 4]);\n\n \/\/ inner post\n translate([-MotorClip_DriverOffsetX -2*dw, MotorOffsetZ - dw - 20, MotorClip_DriverOffsetZ-5.5 + dbw])\n cube([3*dw, 20, 4]);\n\n\n\n }\n\n\n \/\/ pin fixings\n attach(MotorClip_Con_Fixing1, DefConDown)\n cylinder(r=PinDiameter\/2, h=10, center=true);\n\n attach(MotorClip_Con_Fixing2, DefConDown)\n cylinder(r=PinDiameter\/2, h=10, center=true);\n\n attach(MotorClip_Con_Fixing3, DefConDown)\n cylinder(r=PinDiameter\/2, h=30, center=true);\n\n attach(MotorClip_Con_Fixing4, DefConDown)\n cylinder(r=PinDiameter\/2, h=30, center=true);\n\n attach(MotorClip_Con_Motor, DefConDown) {\n \/\/ hollow for motor boss\n cylinder(r=5, h=100, center=true);\n\n \/\/ motor boss\/shaft insertion channel\n translate([-10\/2, -100, -50])\n cube([10, 100, 100]);\n\n\n \/\/ hollow for motor body\n attach(MotorClip_Con_Motor, DefConDown)\n attach(StepperMotor28YBJ48_Con_Body, DefConDown)\n cylinder(r=StepperMotor28YBJ48_Body_OR, h=StepperMotor28YBJ48_Body_Depth + 1, center=false);\n\n \/\/ hollow for motor tabs\n translate([0,-8, -0.5])\n cube([100, 7, 1.5], center=true);\n }\n\n\n\n \/\/ hollow for driver board\n attach(LeftMotorClip_Con_Driver, ULN2003DriverBoard_Con_UpperLeft)\n ULN2003DriverBoard_PCB(false, ULN2003Driver_PCBThickness+0.5);\n\n \/\/ hollow again, but shifted slightly - cheap hack to provide some side-to-side clearance\n translate([0,0,1])\n attach(LeftMotorClip_Con_Driver, ULN2003DriverBoard_Con_UpperLeft)\n ULN2003DriverBoard_PCB(false, ULN2003Driver_PCBThickness+0.5);\n }\n}\n","old_contents":"\/*\n Clip to hold the stepper motor and driver board, mates to base plate using the pin system.\n\n Local Frame:\n TBC\n\n*\/\n\nMotorClip_DriverOffsetX = 20;\nMotorClip_DriverOffsetZ = 8;\n\n\/\/ Connectors\n\/\/ connector for where the motor attaches...\nWheel_Con_Default\t\t\t\t= [ [0, 0 ,2], [0, 0, 1], 90, 0, 0 ];\n\nMotorClip_Con_Fixing1 = [[20, MotorOffsetZ - dw, 14], [0,1,0], 0,0,0];\nMotorClip_Con_Fixing2 = [[-20, MotorOffsetZ -dw, 14], [0,1,0], 0,0,0];\n\n\/\/ inner fixing holes\nMotorClip_Con_Fixing3 = [[10, MotorOffsetZ - dw, 14], [0,1,0], 0,0,0];\nMotorClip_Con_Fixing4 = [[-10, MotorOffsetZ -dw, 14], [0,1,0], 0,0,0];\n\nMotorClip_Con_Motor = [[0, 0, 4.5], [0,0, 1], 0,0,0];\n\nLeftMotorClip_Con_Driver = [[-MotorClip_DriverOffsetX, 1, MotorClip_DriverOffsetZ], [1, 0, 0], 0,0,0];\nRightMotorClip_Con_Driver = [[MotorClip_DriverOffsetX, 1, MotorClip_DriverOffsetZ], [-1, 0, 0], 0,0,0];\n\n\nmodule LeftMotorClip_STL() {\n\n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\n printedPart(\"printedparts\/MotorClip.scad\", \"Left Motor Clip\", \"LeftMotorClip_STL()\") {\n\n \/\/ TODO: Update view\n view(t=[0,0,0], r=[58,0,225], d=681);\n\n \/\/ Color it as a printed plastic part\n color(PlasticColor)\n if (UseSTL) {\n import(str(STLPath, \"MotorClip.stl\"));\n } else {\n MotorClip_Model();\n }\n }\n}\n\nmodule RightMotorClip_STL() {\n\n \/\/ turn off explosions inside STL!!!\n $Explode = false;\n\n printedPart(\"printedparts\/MotorClip.scad\", \"Right Motor Clip\", \"RightMotorClip_STL()\") {\n\n \/\/ TODO: Update view\n view(t=[0,0,0], r=[58,0,225], d=681);\n\n \/\/ Color it as a printed plastic part\n color(PlasticColor)\n mirror([1,0,0])\n if (UseSTL) {\n import(str(STLPath, \"MotorClip.stl\"));\n } else {\n MotorClip_Model();\n }\n }\n}\n\nmodule MotorClip_Model() {\n if (DebugConnectors) {\n \/\/ motor shaft\n connector(DefConDown);\n\n connector(MotorClip_Con_Fixing1);\n connector(MotorClip_Con_Fixing2);\n\n connector(LeftMotorClip_Con_Driver);\n }\n\n dbw = ULN2003Driver_BoardWidth + 1; \/\/ includes clearance\n\n difference() {\n \/\/ solid stuff\n union() {\n \/\/ plate for front of motor\n attach(MotorClip_Con_Motor, DefConDown)\n hull() {\n \/\/ central disc\n cylinder(r=MotorOffsetZ-dw, h=dw);\n\n \/\/ fixing to base plate\n translate([-10, MotorOffsetZ - 2*dw,0])\n cube([20,dw, dw]);\n }\n\n \/\/ motor retaining clip\n attach(MotorClip_Con_Motor, DefConDown)\n attach(StepperMotor28YBJ48_Con_Body, DefConUp)\n translate([0,0,2])\n rotate([0,0,-10])\n sector3D(r=StepperMotor28YBJ48_Body_OR + dw, a=200, h=StepperMotor28YBJ48_Body_Depth + 2*dw, center=false);\n\n\n \/\/ base plate\n hull () {\n \/\/ pins\n attach(MotorClip_Con_Fixing1, DefConDown) {\n cylinder(r=12\/2, h=dw);\n }\n\n attach(MotorClip_Con_Fixing2, DefConDown) {\n cylinder(r=12\/2, h=dw);\n }\n\n \/\/ mating join to front plate\n attach(MotorClip_Con_Motor, DefConDown)\n translate([-10, MotorOffsetZ - 2*dw,0])\n cube([20, dw, dw]);\n\n \/\/ mating to driver holder?\n }\n\n\n \/\/ driver holder\n translate([-MotorClip_DriverOffsetX -2*dw, MotorOffsetZ - 2*dw, MotorClip_DriverOffsetZ-4])\n cube([3*dw, dw, dbw]);\n\n \/\/ outer post\n translate([-MotorClip_DriverOffsetX -2*dw, MotorOffsetZ - dw - 12, MotorClip_DriverOffsetZ-4])\n cube([3*dw, 12, 4]);\n\n \/\/ inner post\n translate([-MotorClip_DriverOffsetX -2*dw, MotorOffsetZ - dw - 20, MotorClip_DriverOffsetZ-5.5 + dbw])\n cube([3*dw, 20, 4]);\n\n\n\n }\n\n\n \/\/ pin fixings\n attach(MotorClip_Con_Fixing1, DefConDown)\n cylinder(r=PinDiameter\/2, h=10, center=true);\n\n attach(MotorClip_Con_Fixing2, DefConDown)\n cylinder(r=PinDiameter\/2, h=10, center=true);\n\n attach(MotorClip_Con_Fixing3, DefConDown)\n cylinder(r=PinDiameter\/2, h=30, center=true);\n\n attach(MotorClip_Con_Fixing4, DefConDown)\n cylinder(r=PinDiameter\/2, h=30, center=true);\n\n attach(MotorClip_Con_Motor, DefConDown) {\n \/\/ hollow for motor boss\n cylinder(r=5, h=100, center=true);\n\n \/\/ motor boss\/shaft insertion channel\n translate([-10\/2, -100, -50])\n cube([10, 100, 100]);\n\n\n \/\/ hollow for motor body\n attach(MotorClip_Con_Motor, DefConDown)\n attach(StepperMotor28YBJ48_Con_Body, DefConDown)\n cylinder(r=StepperMotor28YBJ48_Body_OR, h=StepperMotor28YBJ48_Body_Depth + 0.5, center=false);\n\n \/\/ hollow for motor tabs\n translate([0,-8, -0.5])\n cube([100, 7, 1.5], center=true);\n }\n\n\n\n \/\/ hollow for driver board\n attach(LeftMotorClip_Con_Driver, ULN2003DriverBoard_Con_UpperLeft)\n ULN2003DriverBoard_PCB(false, ULN2003Driver_PCBThickness+0.5);\n\n \/\/ hollow again, but shifted slightly - cheap hack to provide some side-to-side clearance\n translate([0,0,1])\n attach(LeftMotorClip_Con_Driver, ULN2003DriverBoard_Con_UpperLeft)\n ULN2003DriverBoard_PCB(false, ULN2003Driver_PCBThickness+0.5);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e2c52bf729f8be058d6e58810035ef443fb5abe0","subject":"correcting module misname","message":"correcting module misname\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/utils\/moreShapes.scad","new_file":"hardware\/utils\/moreShapes.scad","new_contents":"\/\/ moreShapes library\n\/\/ 2D and 3D utility shape functions\n\n\/\/ some borrowed from nophead \/ Mendel90 utils.scad\n\n\/\/ fudge\neta = 0.01;\n\n\nmodule line(start, end, r) {\n\thull() {\n\t\ttranslate(start) sphere(r=r);\n\t\ttranslate(end) sphere(r=r);\n\t}\n}\n\nmodule roundedSquare(size, radius, center=false, shell=0) {\n x = size[0];\n\ty = size[1];\n \n\ttranslate([center?-x\/2:0, center?-y\/2:0, 0])\n\tdifference() {\n\t\thull() {\n\t\t\ttranslate([radius, radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius, radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t\n\t\tif (shell > 0) {\n\t\t\thull() {\n\t\t\ttranslate([radius + shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius - shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius - shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([radius + shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t}\n\t}\n}\n\nmodule roundedRect(size, radius, center=false, shell=0) {\n\tz = size[2];\n\t\n\ttranslate([0, 0, center?-z\/2:0])\n\t linear_extrude(height=z) \n\t roundedSquare(size=size, radius=radius, center=center, shell=shell);\n}\n\nmodule roundedRectX(size, radius, center=false, shell=0) {\n\t\/\/ X-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([0,90,0]) roundedRect([size[2],size[1],size[0]], radius, center, shell);\n}\n\nmodule roundedRectY(size, radius, center=false, shell=0) {\n\t\/\/ Y-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([-90,0,0]) roundedRect([size[0],size[2],size[1]], radius, center, shell);\n}\n\nmodule allRoundedRect(size, radius, center=false) {\n\t\/\/ lazy implementation - must do better\n\t\/\/ runs VERY slow\n\ttranslate([center?-size[0]\/2:0, center?-size[1]\/2:0, center?-size[2]\/2:0])\n\thull() {\n\t\tfor (x=[0,size[0]], y=[0,size[1]], z=[0,size[2]]) {\n\t\t\ttranslate([x,y,z]) sphere(r=radius);\n\t\t}\n\t}\n}\n\nmodule chamferedRect(size, chamfer, center=false) {\n\thull() {\n\t\ttranslate([0,center?0:chamfer,0])\n\t\t\tsquare([size[0],size[1]-2*chamfer],center);\n\t\t\t\n\t\ttranslate([center?0:chamfer,0,0])\n\t\t\tsquare([size[0]-2*chamfer,size[1]],center);\n\t}\n}\n\n\/\/ Extended rotational extrude, allows control of start\/end angle\n\n\/\/ Child 2D shape is used for the rotational extrusion\n\/\/ Child 2D shape should lie in xy plane, centred on z axis\n\/\/ Child y axis will be aligned to z axis in the extrusion\n\n\/\/ NB: Internal render command is necessary to correclty display\n\/\/ complex child objects (e.g. differences)\n\n\/\/ r = Radius of rotational extrusion\n\/\/ childH = height of child object (approx)\n\/\/ childW = width of child object (approx)\n\n\/\/ Example usage:\n\n\/\/ rotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\/\/\t\t\tdifference() {\n\/\/\t\t\t\tsquare([20,20],center=true);\n\/\/\t\t\t\ttranslate([10,0,0]) circle(5);\n\/\/\t\t\t}\n\/\/\t\t}\n\nmodule rotate_extrude_ext(r, childW, childH, convexity) {\n\tor = (r + childW\/2) * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n\t\trender()\n intersection() {\n\t\t\trotate_extrude(convexity=convexity) translate([r,0,0]) children(0);\n\n\t\t\ttranslate([0,0,-childH\/2 - 1])\n\t\t\tlinear_extrude(height=childH+2)\n \t\tpolygon([\n\t\t [0,0],\n\t\t [or * cos(a0), or * sin(a0)],\n\t\t [or * cos(a1), or * sin(a1)],\n\t\t [or * cos(a2), or * sin(a2)],\n\t\t [or * cos(a3), or * sin(a3)],\n\t\t [or * cos(a4), or * sin(a4)],\n\t\t [0,0]\n\t\t ]);\n }\n}\n\n\n\nmodule torusSlice(r1, r2, start_angle, end_angle, convexity=10, r3=0, $fn=64) {\n\tdifference() {\n\t\trotate_extrude_ext(r=r1, childH=2*r2, childW=2*r2, start_angle=start_angle, end_angle=end_angle, convexity=convexity) difference() circle(r2, $fn=$fn\/4);\n\n\t\trotate_extrude(convexity) translate([r1,0,0]) circle(r3, $fn=$fn\/4);\n\t}\n}\n\nmodule torus(r1, r2, $fn=64) {\n\trotate_extrude() \n\t\ttranslate([r1,0,0]) \n\t\tcircle(r2, $fn=$fn\/4);\n}\n\n\nmodule trapezoid(a,b,h,aOffset=0,center=false) {\n\t\/\/ lies in x\/y plane\n\t\/\/ edges a,b are parallel to x axis\n\t\/\/ h is in direction of y axis\t\n\t\/\/ b is anchored at origin, extends along positive x axis\n\t\/\/ a is offset along y by h, extends along positive x axis\n\t\/\/ a if offset along x axis, from y axis, by aOffset\n\t\/\/ centering is relative to edge b\n\n\ttranslate([center?-b\/2:0, center?-h\/2:0, 0]) \n\tpolygon(points=[\t[0,0],\n\t\t\t\t\t[aOffset,h],\n\t\t\t\t\t[aOffset + a, h],\n\t\t\t\t\t[b,0]]); \n}\n\nmodule trapezoidPrism(a,b,h,aOffset,height,center=false) {\n\ttranslate([0,0, center?-height\/2:0]) linear_extrude(height=height) trapezoid(a,b,h,aOffset,center);\n}\n\n\nmodule arrangeShapesOnAxis(axis=[1,0,0], spacing=50) {\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([spacing * axis[0] *i,\n\t\t\t\t\tspacing * axis[1]*i,\n\t\t\t\t\tspacing * axis[2]*i]) children(i);\n\t}\n}\n\nmodule arrangeShapesOnGrid(xSpacing=50, ySpacing=50, cols=3, showLocalAxes=false) {\t\n\t\/\/ layout is cols, rows\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([(i - floor(i \/ cols)*cols) * xSpacing, floor(i \/ cols) * ySpacing, 0]) {\n\t\t\tchildren(i);\n\n\t\t\tif (showLocalAxes) {\n\t\t\t\tcolor(\"red\") line([0,0,0], [xSpacing\/2,0,0], 0.2);\n\t\t\t\tcolor(\"green\") line([0,0,0], [0, ySpacing\/2,0], 0.2);\n\t\t\t\tcolor(\"blue\") line([0,0,0], [0, 0,xSpacing], 0.2);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule slot(h, r, l, center = true)\n linear_extrude(height = h, convexity = 6, center = center)\n hull() {\n translate([l\/2,0,0])\n circle(r = r, center = true);\n translate([-l\/2,0,0])\n circle(r = r, center = true);\n }\n\n\n\nmodule fillet(r, h) {\n\t\/\/ ready to be unioned onto another part, eta fudge included\n\t\/\/ extends along x, y, z\n\n translate([r \/ 2, r \/ 2, 0])\n difference() {\n cube([r + eta, r + eta, h], center = true);\n translate([r\/2, r\/2, 0])\n cylinder(r = r, h = h + 1, center = true);\n }\n}\n\nmodule right_triangle_2d(width,height,center=true) {\n polygon(points = [[0,0], [width, 0], [0, height]]);\n}\n\nmodule right_triangle(width, height, h, center = true) {\n linear_extrude(height = h, center = center)\n right_triangle_2d(width,height,center=center);\n}\n\nmodule roundedRightTriangle(width, height, h, r=[1,1,1], center = true, $fn=12) {\n linear_extrude(height = h, center = center)\n \thull() {\n \ttranslate([r[0],r[0],0]) circle(r[0]);\n \ttranslate([width-r[1],r[1],0]) circle(r[1]);\n \ttranslate([r[2],height-r[2],0]) circle(r[2]);\n }\n}\n\n\nmodule rounded_square(w, h, r, center=true)\n{\n\t\/\/ 2D\n union() {\n translate([center?0:r,0,0])\n \tsquare([w - 2 * r, h], center=center);\n translate([0,center?0:r,0])\n \tsquare([w, h - 2 * r], center=center);\n for(x = [(center?-w\/2:0) + r, (center?w\/2:w) - r])\n for(y = [(center?-h\/2:0) + r, (center?h\/2:h) - r])\n translate([x, y])\n circle(r = r);\n }\n}\n\n\/\/\n\/\/ Cylinder with rounded ends\n\/\/\nmodule rounded_cylinder(r, h, r2, roundBothEnds=false)\n{\n rotate_extrude()\n union() {\n square([r - r2, h]);\n translate([0,roundBothEnds?r2:0,0]) square([r, roundBothEnds? h-2*r2 : h - r2]);\n translate([r - r2, h - r2])\n circle(r = r2);\n\t\t\tif (roundBothEnds) {\n\t\t\t\ttranslate([r - r2, r2])\n circle(r = r2);\n\t\t\t}\n\t\t\t\n }\n}\n\nmodule sector(r, a, h, center = true) {\n linear_extrude(height = h, center = center)\n sector2D(r=r, a=a, center=center);\n}\n\nmodule sector2D(r, a, center = true) {\n intersection() {\n circle(r = r, center = true);\n polygon(points = [\n [0, 0],\n [2 * r * cos(0), 2 * r * sin(0)],\n [2 * r * cos(a * 0.2), 2 * r * sin(a * 0.2)],\n [2 * r * cos(a * 0.4), 2 * r * sin(a * 0.4)],\n [2 * r * cos(a * 0.6), 2 * r * sin(a * 0.6)],\n [2 * r * cos(a * 0.8), 2 * r * sin(a * 0.8)],\n [2 * r * cos(a), 2 * r * sin(a)],\n ]);\n }\n}\n\nmodule donutSector2D(or,ir,a, center=true) {\n\tdifference() {\n\t\tsector2D(or,a,center);\n\t\t\n\t\tcircle(ir);\n\t}\n\n}\n\nmodule tube(or, ir, h, center = true) {\n linear_extrude(height = h, center = center, convexity = 5)\n difference() {\n circle(or);\n circle(ir);\n }\n}\n\n\/\/ tube that tapers\nmodule conicalTube(or1,ir1,or2,ir2,h) {\n\tdifference() {\n\t\tcylinder(r1=or1, r2=or2, h=h);\n\t\t\n\t\ttranslate([0,0,-eta])\n\t\t\tcylinder(r1=ir1, r2=ir2, h=h+2*eta);\n\t}\n}\n\n\nmodule moreShapesExamples() {\n\tarrangeShapesOnGrid(xSpacing=100, ySpacing=80, cols=4, showLocalAxes=true) {\n\t\troundedRect([50,30,20], 5);\n\t\troundedRectX([50,30,20], 5);\n\t\troundedRectY([50,30,20], 5);\n\t\t\/\/allRoundedRect([50,30,20], 5);\n\n\t\troundedRect([50,30,20], 5, true);\n\t\troundedRectX([50,30,20], 5, true);\n\t\troundedRectY([50,30,20], 5, true);\n\t\t\/\/allRoundedRect([50,30,20], 5, true);\n\n\n\t\ttorusSlice(50, 6, 0, 120, $fn=64);\n\t\ttorusSlice(r1=50, r2=6, r3=4, start_angle=0, end_angle=120, $fn=64); \/\/ define r3 for a hollow torus\n\n\t\ttrapezoidPrism(20,50,20,10,20);\n\t\ttrapezoidPrism(20,50,20,10,20,true);\n\n\t\t\/\/ to be differenced\n\t\tslot(h=20, r=5, l=10);\n\n\t\t\/\/ to be unioned\n\t\tfillet(r=5, h=50);\n\n\t\tright_triangle(width=30, height=20, h=10, center = false);\n\t\trounded_square(w=30, h=20, r=5);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=false);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=true);\n\t\t\n\t\t\/\/ same as extruded pieSlice\n\t\tsector(r=10, a=70, h=20, center = false);\n\n\t\ttube(or=10, ir=5, h=50, center = false);\n\n\t\trotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\t\t\tdifference() {\n\t\t\t\tsquare([20,20],center=true);\n\t\t\t\ttranslate([10,0,0]) circle(5);\n\t\t\t}\n\t\t}\n\t}\n}\n\n*moreShapesExamples();\n\nmodule overhangFreeCircle(r, ang) {\n\t\/\/ produces a circle with no overhang ready for extrusion\n\t\/\/ overhang infill is along y axis\n\n\tx1 = r*cos(ang);\n\ty1 = r*sin(ang);\n\tx2 = tan(ang) * (r-y1);\n\n\tunion() {\n\t\tcircle(r);\n\n\t\tfor (i=[0,1])\n\t\t\tmirror([0,i,0])\n\t\t\tpolygon(points=[[0,0],[x1,y1],[x1-x2,r],[-x1+x2,r],[-x1,y1]]);\n\t}\n}\n\n\/\/ supports span x axis\nmodule minSupportBeam(size=[0,0,0], bridge=5, air=0, center=false) {\n\tw = size[0] > bridge ? (size[0] - bridge)\/2 : 0;\n\th = w > air ? air : w;\n\t\n\tunion() {\n\t\tcube(size, center=center);\n\t\n\t\t\/\/ triangular supports\n\t\tfor (i=[0,1])\n\t\t\ttranslate([i*size[0],0,eta])\n\t\t\tmirror([i,0,0]) {\n\t\t\t\ttranslate([w-h, 0, 0])\n\t\t\t\t\trotate([-90,0,0])\n\t\t\t\t\tright_triangle(h, h, size[1], center=false);\n\t\t\t\t\t\n\t\t\t\ttranslate([0, 0, -h])\n\t\t\t\t\tcube([w-h+eta, size[1], h+eta]);\n\t\t\t\n\t\t\t}\n\t}\n}\n\nmodule minSupportBeamY(size=[0,0,0], bridge=5, air=0, center=false) {\n\ttranslate([size[0], 0, 0])\n\t\trotate([0,0,90])\n\t\tminSupportBeam([size[1], size[0], size[2]], bridge, air, center=center);\n}\n\n","old_contents":"\/\/ moreShapes library\n\/\/ 2D and 3D utility shape functions\n\n\/\/ some borrowed from nophead \/ Mendel90 utils.scad\n\n\/\/ fudge\neta = 0.01;\n\n\nmodule line(start, end, r) {\n\thull() {\n\t\ttranslate(start) sphere(r=r);\n\t\ttranslate(end) sphere(r=r);\n\t}\n}\n\nmodule roundedSquare2(size, radius, center=false, shell=0) {\n x = size[0];\n\ty = size[1];\n \n\ttranslate([center?-x\/2:0, center?-y\/2:0, 0])\n\tdifference() {\n\t\thull() {\n\t\t\ttranslate([radius, radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius, radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([radius, y - radius, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t\n\t\tif (shell > 0) {\n\t\t\thull() {\n\t\t\ttranslate([radius + shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius - shell, radius + shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([x - radius - shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t\n\t\t\ttranslate([radius + shell, y - radius - shell, 0])\n\t\t\tcircle(r=radius);\n\t\t}\n\t\t}\n\t}\n}\n\nmodule roundedRect(size, radius, center=false, shell=0) {\n\tz = size[2];\n\t\n\ttranslate([0, 0, center?-z\/2:0])\n\t linear_extrude(height=z) \n\t roundedSquare2(size=size, radius=radius, center=center, shell=shell);\n}\n\nmodule roundedRectX(size, radius, center=false, shell=0) {\n\t\/\/ X-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([0,90,0]) roundedRect([size[2],size[1],size[0]], radius, center, shell);\n}\n\nmodule roundedRectY(size, radius, center=false, shell=0) {\n\t\/\/ Y-axis aligned roundedRect\n\ttranslate([0,0,center?0:size[2]]) rotate([-90,0,0]) roundedRect([size[0],size[2],size[1]], radius, center, shell);\n}\n\nmodule allRoundedRect(size, radius, center=false) {\n\t\/\/ lazy implementation - must do better\n\t\/\/ runs VERY slow\n\ttranslate([center?-size[0]\/2:0, center?-size[1]\/2:0, center?-size[2]\/2:0])\n\thull() {\n\t\tfor (x=[0,size[0]], y=[0,size[1]], z=[0,size[2]]) {\n\t\t\ttranslate([x,y,z]) sphere(r=radius);\n\t\t}\n\t}\n}\n\nmodule chamferedRect(size, chamfer, center=false) {\n\thull() {\n\t\ttranslate([0,center?0:chamfer,0])\n\t\t\tsquare([size[0],size[1]-2*chamfer],center);\n\t\t\t\n\t\ttranslate([center?0:chamfer,0,0])\n\t\t\tsquare([size[0]-2*chamfer,size[1]],center);\n\t}\n}\n\n\/\/ Extended rotational extrude, allows control of start\/end angle\n\n\/\/ Child 2D shape is used for the rotational extrusion\n\/\/ Child 2D shape should lie in xy plane, centred on z axis\n\/\/ Child y axis will be aligned to z axis in the extrusion\n\n\/\/ NB: Internal render command is necessary to correclty display\n\/\/ complex child objects (e.g. differences)\n\n\/\/ r = Radius of rotational extrusion\n\/\/ childH = height of child object (approx)\n\/\/ childW = width of child object (approx)\n\n\/\/ Example usage:\n\n\/\/ rotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\/\/\t\t\tdifference() {\n\/\/\t\t\t\tsquare([20,20],center=true);\n\/\/\t\t\t\ttranslate([10,0,0]) circle(5);\n\/\/\t\t\t}\n\/\/\t\t}\n\nmodule rotate_extrude_ext(r, childW, childH, convexity) {\n\tor = (r + childW\/2) * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n\t\trender()\n intersection() {\n\t\t\trotate_extrude(convexity=convexity) translate([r,0,0]) children(0);\n\n\t\t\ttranslate([0,0,-childH\/2 - 1])\n\t\t\tlinear_extrude(height=childH+2)\n \t\tpolygon([\n\t\t [0,0],\n\t\t [or * cos(a0), or * sin(a0)],\n\t\t [or * cos(a1), or * sin(a1)],\n\t\t [or * cos(a2), or * sin(a2)],\n\t\t [or * cos(a3), or * sin(a3)],\n\t\t [or * cos(a4), or * sin(a4)],\n\t\t [0,0]\n\t\t ]);\n }\n}\n\n\n\nmodule torusSlice(r1, r2, start_angle, end_angle, convexity=10, r3=0, $fn=64) {\n\tdifference() {\n\t\trotate_extrude_ext(r=r1, childH=2*r2, childW=2*r2, start_angle=start_angle, end_angle=end_angle, convexity=convexity) difference() circle(r2, $fn=$fn\/4);\n\n\t\trotate_extrude(convexity) translate([r1,0,0]) circle(r3, $fn=$fn\/4);\n\t}\n}\n\nmodule torus(r1, r2, $fn=64) {\n\trotate_extrude() \n\t\ttranslate([r1,0,0]) \n\t\tcircle(r2, $fn=$fn\/4);\n}\n\n\nmodule trapezoid(a,b,h,aOffset=0,center=false) {\n\t\/\/ lies in x\/y plane\n\t\/\/ edges a,b are parallel to x axis\n\t\/\/ h is in direction of y axis\t\n\t\/\/ b is anchored at origin, extends along positive x axis\n\t\/\/ a is offset along y by h, extends along positive x axis\n\t\/\/ a if offset along x axis, from y axis, by aOffset\n\t\/\/ centering is relative to edge b\n\n\ttranslate([center?-b\/2:0, center?-h\/2:0, 0]) \n\tpolygon(points=[\t[0,0],\n\t\t\t\t\t[aOffset,h],\n\t\t\t\t\t[aOffset + a, h],\n\t\t\t\t\t[b,0]]); \n}\n\nmodule trapezoidPrism(a,b,h,aOffset,height,center=false) {\n\ttranslate([0,0, center?-height\/2:0]) linear_extrude(height=height) trapezoid(a,b,h,aOffset,center);\n}\n\n\nmodule arrangeShapesOnAxis(axis=[1,0,0], spacing=50) {\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([spacing * axis[0] *i,\n\t\t\t\t\tspacing * axis[1]*i,\n\t\t\t\t\tspacing * axis[2]*i]) children(i);\n\t}\n}\n\nmodule arrangeShapesOnGrid(xSpacing=50, ySpacing=50, cols=3, showLocalAxes=false) {\t\n\t\/\/ layout is cols, rows\n\tfor (i=[0:$children-1]) {\n\t\ttranslate([(i - floor(i \/ cols)*cols) * xSpacing, floor(i \/ cols) * ySpacing, 0]) {\n\t\t\tchildren(i);\n\n\t\t\tif (showLocalAxes) {\n\t\t\t\tcolor(\"red\") line([0,0,0], [xSpacing\/2,0,0], 0.2);\n\t\t\t\tcolor(\"green\") line([0,0,0], [0, ySpacing\/2,0], 0.2);\n\t\t\t\tcolor(\"blue\") line([0,0,0], [0, 0,xSpacing], 0.2);\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule slot(h, r, l, center = true)\n linear_extrude(height = h, convexity = 6, center = center)\n hull() {\n translate([l\/2,0,0])\n circle(r = r, center = true);\n translate([-l\/2,0,0])\n circle(r = r, center = true);\n }\n\n\n\nmodule fillet(r, h) {\n\t\/\/ ready to be unioned onto another part, eta fudge included\n\t\/\/ extends along x, y, z\n\n translate([r \/ 2, r \/ 2, 0])\n difference() {\n cube([r + eta, r + eta, h], center = true);\n translate([r\/2, r\/2, 0])\n cylinder(r = r, h = h + 1, center = true);\n }\n}\n\nmodule right_triangle_2d(width,height,center=true) {\n polygon(points = [[0,0], [width, 0], [0, height]]);\n}\n\nmodule right_triangle(width, height, h, center = true) {\n linear_extrude(height = h, center = center)\n right_triangle_2d(width,height,center=center);\n}\n\nmodule roundedRightTriangle(width, height, h, r=[1,1,1], center = true, $fn=12) {\n linear_extrude(height = h, center = center)\n \thull() {\n \ttranslate([r[0],r[0],0]) circle(r[0]);\n \ttranslate([width-r[1],r[1],0]) circle(r[1]);\n \ttranslate([r[2],height-r[2],0]) circle(r[2]);\n }\n}\n\n\nmodule rounded_square(w, h, r, center=true)\n{\n\t\/\/ 2D\n union() {\n translate([center?0:r,0,0])\n \tsquare([w - 2 * r, h], center=center);\n translate([0,center?0:r,0])\n \tsquare([w, h - 2 * r], center=center);\n for(x = [(center?-w\/2:0) + r, (center?w\/2:w) - r])\n for(y = [(center?-h\/2:0) + r, (center?h\/2:h) - r])\n translate([x, y])\n circle(r = r);\n }\n}\n\n\/\/\n\/\/ Cylinder with rounded ends\n\/\/\nmodule rounded_cylinder(r, h, r2, roundBothEnds=false)\n{\n rotate_extrude()\n union() {\n square([r - r2, h]);\n translate([0,roundBothEnds?r2:0,0]) square([r, roundBothEnds? h-2*r2 : h - r2]);\n translate([r - r2, h - r2])\n circle(r = r2);\n\t\t\tif (roundBothEnds) {\n\t\t\t\ttranslate([r - r2, r2])\n circle(r = r2);\n\t\t\t}\n\t\t\t\n }\n}\n\nmodule sector(r, a, h, center = true) {\n linear_extrude(height = h, center = center)\n sector2D(r=r, a=a, center=center);\n}\n\nmodule sector2D(r, a, center = true) {\n intersection() {\n circle(r = r, center = true);\n polygon(points = [\n [0, 0],\n [2 * r * cos(0), 2 * r * sin(0)],\n [2 * r * cos(a * 0.2), 2 * r * sin(a * 0.2)],\n [2 * r * cos(a * 0.4), 2 * r * sin(a * 0.4)],\n [2 * r * cos(a * 0.6), 2 * r * sin(a * 0.6)],\n [2 * r * cos(a * 0.8), 2 * r * sin(a * 0.8)],\n [2 * r * cos(a), 2 * r * sin(a)],\n ]);\n }\n}\n\nmodule donutSector2D(or,ir,a, center=true) {\n\tdifference() {\n\t\tsector2D(or,a,center);\n\t\t\n\t\tcircle(ir);\n\t}\n\n}\n\nmodule tube(or, ir, h, center = true) {\n linear_extrude(height = h, center = center, convexity = 5)\n difference() {\n circle(or);\n circle(ir);\n }\n}\n\n\/\/ tube that tapers\nmodule conicalTube(or1,ir1,or2,ir2,h) {\n\tdifference() {\n\t\tcylinder(r1=or1, r2=or2, h=h);\n\t\t\n\t\ttranslate([0,0,-eta])\n\t\t\tcylinder(r1=ir1, r2=ir2, h=h+2*eta);\n\t}\n}\n\n\nmodule moreShapesExamples() {\n\tarrangeShapesOnGrid(xSpacing=100, ySpacing=80, cols=4, showLocalAxes=true) {\n\t\troundedRect([50,30,20], 5);\n\t\troundedRectX([50,30,20], 5);\n\t\troundedRectY([50,30,20], 5);\n\t\t\/\/allRoundedRect([50,30,20], 5);\n\n\t\troundedRect([50,30,20], 5, true);\n\t\troundedRectX([50,30,20], 5, true);\n\t\troundedRectY([50,30,20], 5, true);\n\t\t\/\/allRoundedRect([50,30,20], 5, true);\n\n\n\t\ttorusSlice(50, 6, 0, 120, $fn=64);\n\t\ttorusSlice(r1=50, r2=6, r3=4, start_angle=0, end_angle=120, $fn=64); \/\/ define r3 for a hollow torus\n\n\t\ttrapezoidPrism(20,50,20,10,20);\n\t\ttrapezoidPrism(20,50,20,10,20,true);\n\n\t\t\/\/ to be differenced\n\t\tslot(h=20, r=5, l=10);\n\n\t\t\/\/ to be unioned\n\t\tfillet(r=5, h=50);\n\n\t\tright_triangle(width=30, height=20, h=10, center = false);\n\t\trounded_square(w=30, h=20, r=5);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=false);\n\t\trounded_cylinder(r=10, h=50, r2=5, roundBothEnds=true);\n\t\t\n\t\t\/\/ same as extruded pieSlice\n\t\tsector(r=10, a=70, h=20, center = false);\n\n\t\ttube(or=10, ir=5, h=50, center = false);\n\n\t\trotate_extrude_ext(r=50, childW=20, childH=20, start_angle=0, end_angle=180) {\n\t\t\tdifference() {\n\t\t\t\tsquare([20,20],center=true);\n\t\t\t\ttranslate([10,0,0]) circle(5);\n\t\t\t}\n\t\t}\n\t}\n}\n\n*moreShapesExamples();\n\nmodule overhangFreeCircle(r, ang) {\n\t\/\/ produces a circle with no overhang ready for extrusion\n\t\/\/ overhang infill is along y axis\n\n\tx1 = r*cos(ang);\n\ty1 = r*sin(ang);\n\tx2 = tan(ang) * (r-y1);\n\n\tunion() {\n\t\tcircle(r);\n\n\t\tfor (i=[0,1])\n\t\t\tmirror([0,i,0])\n\t\t\tpolygon(points=[[0,0],[x1,y1],[x1-x2,r],[-x1+x2,r],[-x1,y1]]);\n\t}\n}\n\n\/\/ supports span x axis\nmodule minSupportBeam(size=[0,0,0], bridge=5, air=0, center=false) {\n\tw = size[0] > bridge ? (size[0] - bridge)\/2 : 0;\n\th = w > air ? air : w;\n\t\n\tunion() {\n\t\tcube(size, center=center);\n\t\n\t\t\/\/ triangular supports\n\t\tfor (i=[0,1])\n\t\t\ttranslate([i*size[0],0,eta])\n\t\t\tmirror([i,0,0]) {\n\t\t\t\ttranslate([w-h, 0, 0])\n\t\t\t\t\trotate([-90,0,0])\n\t\t\t\t\tright_triangle(h, h, size[1], center=false);\n\t\t\t\t\t\n\t\t\t\ttranslate([0, 0, -h])\n\t\t\t\t\tcube([w-h+eta, size[1], h+eta]);\n\t\t\t\n\t\t\t}\n\t}\n}\n\nmodule minSupportBeamY(size=[0,0,0], bridge=5, air=0, center=false) {\n\ttranslate([size[0], 0, 0])\n\t\trotate([0,0,90])\n\t\tminSupportBeam([size[1], size[0], size[2]], bridge, air, center=center);\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e4efe817b3412df00b4f81f176c7cf0cb989474e","subject":"Added steps parameter description","message":"Added steps parameter description\n","repos":"ksuszka\/3d-projects","old_file":"libraries\/terrain\/terrain.scad","new_file":"libraries\/terrain\/terrain.scad","new_contents":"\/*\n * Generates a 3D model of randomized terrain.\n *\n * @param sx - the size of generated model along x axis.\n * @param sy - the size of generated model along y axis.\n * @param base_h - the minimal height of generated model.\n * @param steps - a vector of generation parameters. Each element of that vector adds additional layer of details.\n * Single element can be a 2 element vector [s, w] or a single integer \"s\" (in that case \"w\" is\n * assumed to be 1). \"s\" sets resolution of the layer, a new random number is used for the height\n * every \"s\" units. \"w\" sets the weight of the layer.\n * @param seed - random generator seed. If unset then random value is used.\n * @return A 3D block of randomized terrain. \n *\/\nmodule terrain(sx,sy,base_h=1,steps=[[1,0.2],3,5,7,11],seed=undef) {\n real_seed = seed*0 == 0 ? seed : rands(0,1000000,1)[0];\n function sumv_imp(v,i,acc) = i<0 ? acc : sumv_imp(v, i-1, acc + v[i]);\n function sumv(v) = sumv_imp(v,len(v)-1,0);\n function height(x,y) = sumv([\n for(step=steps)\n let(s=len(step)>=0 ? (len(step)>0 ? step[0] : 0) : step)\n let(w=len(step)>1 ? step[1] : 1)\n terrain_height(x,y,s,real_seed)*w]) + base_h;\n p1 = [[0,0,0],[sx,0,0],[0,sy,0],[sx,sy,0]];\n p2 = [ if (sy>=0 && sx>=0)\n for(y=[0:sy],x=[0:sx] )\n [x,y,height(x,y)] ];\n p = concat(p1,p2);\n function f_idx(x,y) = len(p1)+y*(sx+1)+x;\n f1 = [ if (sy>0 && sx>0)\n for(y=[0:sy-1],x=[0:sx-1])\n [ f_idx(x,y), f_idx(x,y+1), f_idx(x+1,y) ] ];\n f1b = [ if (sy>0 && sx>0)\n for(y=[0:sy-1],x=[0:sx-1])\n [ f_idx(x,y+1), f_idx(x+1,y+1), f_idx(x+1,y) ] ];\n f2 = [ if (sx>0)\n concat([ for(x=[sx:-1:0]) len(p1)+x+sy*(sx+1) ], [2,3]) ];\n f3 = [ if (sx>0)\n concat([ for(x=[0:sx]) len(p1)+x ], [1,0]) ];\n f4 = [ if (sy>0)\n concat([ for(y=[sy:-1:0]) len(p1)+y*(sx+1) ], [0,2]) ];\n f5 = [ if (sy>0)\n concat([ for(y=[0:sy]) len(p1)+sx+y*(sx+1) ], [3,1]) ];\n f6 = [ if (sy>0 && sx>0)\n [0,1,3,2] ];\n f = concat(f1,f1b,f2,f3,f4,f5,f6);\n polyhedron(points=p,faces=f);\n}\n\n\/*\n * Generates terrain height value for given coordinates.\n *\n * @param x - x coordinate.\n * @param y - y coordinate.\n * @param steps - terrain resolution factor.\n * @param seed - random generator seed.\n * @return The height of the terain at (x,y) coordinates.\n *\/\nfunction terrain_height(x,y,steps=1,seed=0) = \n let(cx=floor(x\/steps),\n cy=floor(y\/steps),\n sx=_terrain_rem(x\/steps),\n sy=_terrain_rem(y\/steps),\n h00=_terrain_cell_height(cx,cy,seed),\n h01=_terrain_cell_height(cx+1,cy,seed),\n h10=_terrain_cell_height(cx,cy+1,seed),\n h11=_terrain_cell_height(cx+1,cy+1,seed))\n _terrain_interpolate2d(h00,h01,h10,h11,sx,sy);\n\n\/\/ http:\/\/stackoverflow.com\/a\/919661\nfunction _terrain_pairing_normalize(a) = a >= 0 ? a*2 : -a*2-1;\nfunction _terrain_pairing(i1,i2) = \n let(n1=_terrain_pairing_normalize(i1),\n n2=_terrain_pairing_normalize(i2))\n (n1 + n2)*(n1 + n2 + 1)\/2 + n2;\n\nfunction _terrain_rem(a) = a-floor(a);\n \nfunction _terrain_interpolate2d(h00,h01,h10,h11,sx,sy) = \n (h00+(h01-h00)*sx)*(1-sy) + \n (h10+(h11-h10)*sx)*sy;\n\nfunction _terrain_cell_height(x,y,seed) =\n rands(0,1,1,_terrain_pairing(x,y)+seed)[0];\n","old_contents":"\/*\n * Generates a 3D model of randomized terrain.\n *\n * @param sx - the size of generated model along x axis.\n * @param sy - the size of generated model along y axis.\n * @param base_h - the minimal height of generated model.\n * @param steps - a vector of generation parameters\n * @param seed - random generator seed. If unset then random value is used.\n * @return A 3D block of randomized terrain. \n *\/\nmodule terrain(sx,sy,base_h=1,steps=[[1,0.2],3,5,7,11],seed=undef) {\n real_seed = seed*0 == 0 ? seed : rands(0,1000000,1)[0];\n function sumv_imp(v,i,acc) = i<0 ? acc : sumv_imp(v, i-1, acc + v[i]);\n function sumv(v) = sumv_imp(v,len(v)-1,0);\n function height(x,y) = sumv([\n for(step=steps)\n let(s=len(step)>=0 ? (len(step)>0 ? step[0] : 0) : step)\n let(w=len(step)>1 ? step[1] : 1)\n terrain_height(x,y,s,real_seed)*w]) + base_h;\n p1 = [[0,0,0],[sx,0,0],[0,sy,0],[sx,sy,0]];\n p2 = [ if (sy>=0 && sx>=0)\n for(y=[0:sy],x=[0:sx] )\n [x,y,height(x,y)] ];\n p = concat(p1,p2);\n function f_idx(x,y) = len(p1)+y*(sx+1)+x;\n f1 = [ if (sy>0 && sx>0)\n for(y=[0:sy-1],x=[0:sx-1])\n [ f_idx(x,y), f_idx(x,y+1), f_idx(x+1,y) ] ];\n f1b = [ if (sy>0 && sx>0)\n for(y=[0:sy-1],x=[0:sx-1])\n [ f_idx(x,y+1), f_idx(x+1,y+1), f_idx(x+1,y) ] ];\n f2 = [ if (sx>0)\n concat([ for(x=[sx:-1:0]) len(p1)+x+sy*(sx+1) ], [2,3]) ];\n f3 = [ if (sx>0)\n concat([ for(x=[0:sx]) len(p1)+x ], [1,0]) ];\n f4 = [ if (sy>0)\n concat([ for(y=[sy:-1:0]) len(p1)+y*(sx+1) ], [0,2]) ];\n f5 = [ if (sy>0)\n concat([ for(y=[0:sy]) len(p1)+sx+y*(sx+1) ], [3,1]) ];\n f6 = [ if (sy>0 && sx>0)\n [0,1,3,2] ];\n f = concat(f1,f1b,f2,f3,f4,f5,f6);\n polyhedron(points=p,faces=f);\n}\n\n\/*\n * Generates terrain height value for given coordinates.\n *\n * @param x - x coordinate.\n * @param y - y coordinate.\n * @param steps - terrain resolution factor.\n * @param seed - random generator seed.\n * @return The height of the terain at (x,y) coordinates.\n *\/\nfunction terrain_height(x,y,steps=1,seed=0) = \n let(cx=floor(x\/steps),\n cy=floor(y\/steps),\n sx=_terrain_rem(x\/steps),\n sy=_terrain_rem(y\/steps),\n h00=_terrain_cell_height(cx,cy,seed),\n h01=_terrain_cell_height(cx+1,cy,seed),\n h10=_terrain_cell_height(cx,cy+1,seed),\n h11=_terrain_cell_height(cx+1,cy+1,seed))\n _terrain_interpolate2d(h00,h01,h10,h11,sx,sy);\n\n\/\/ http:\/\/stackoverflow.com\/a\/919661\nfunction _terrain_pairing_normalize(a) = a >= 0 ? a*2 : -a*2-1;\nfunction _terrain_pairing(i1,i2) = \n let(n1=_terrain_pairing_normalize(i1),\n n2=_terrain_pairing_normalize(i2))\n (n1 + n2)*(n1 + n2 + 1)\/2 + n2;\n\nfunction _terrain_rem(a) = a-floor(a);\n \nfunction _terrain_interpolate2d(h00,h01,h10,h11,sx,sy) = \n (h00+(h01-h00)*sx)*(1-sy) + \n (h10+(h11-h10)*sx)*sy;\n\nfunction _terrain_cell_height(x,y,seed) =\n rands(0,1,1,_terrain_pairing(x,y)+seed)[0];\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0defd1d26c40b0d55dc6049dc0b04eeb197c7520","subject":"moved vertical rail outside of boundaries and extended length to floor","message":"moved vertical rail outside of boundaries and extended length to floor\n","repos":"fponticelli\/smallbridges","old_file":"resin\/printer.scad","new_file":"resin\/printer.scad","new_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 500;\n base_depth = 360;\n display_projection = false;\n base_sections = 3;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-20 * base_sections,-10])\n rotate([90,90,90])\n profile(base_sections, beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n profile_height = sections * 20;\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 3;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n base(width, base_depth, middle_sections);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width + 20 - offset * 2;\n plate_depth = base_depth - 20 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + middle_sections * 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 + 20])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n translate([-65, -base_depth \/ 2 - 20, -height \/ 2 - 20 * (bottom_sections)]) {\n profile(rail_sections, screw_height + height + 20 * (bottom_sections + middle_sections));\n }\n }\n translate([0,0,30]) {\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 240);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - 210])\n rotate([90,90,0])\n profile(3, 140);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n }\n}","old_contents":"use ;\ninclude ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \nuse <..\/scad\/brackets.scad>\nuse <..\/scad\/geom.scad>\nuse \ninclude \nuse \nuse \n\nmodule printer(projector_position = 0) {\n offset_depth = 50;\n\n middle_sections = 2;\n\n height = 500;\n width = 500;\n base_depth = 360;\n display_projection = false;\n\n projector_movement = height \/ 2 - acer_projector_distances[projector_position] + middle_sections * 20;\n\n \/\/ projector\n translate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(display_projection);\n }\n }\n }\n beam_offset = 10;\n beam_width = width - 2 * beam_offset;\n\n carriage_tower_sections = 3;\n\n translate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-60,-10])\n rotate([90,90,90])\n profile_20x60(beam_width);\n \/*\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n translate([-beam_width\/2,-60,-10])\n rotate([90,0,-90])\n gantry_cart_big(carriage_tower_sections, offset = 1);\n *\/\n }\n\n \/\/ projector towers\n translate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n }\n\n \/\/ supports for horizontal beam\n translate([0, middle_sections * 20, -offset_depth])\n for(d = acer_projector_distances) {\n translate([0,d-height\/2+10,0])\n support_projector_beam(width-60);\n }\n \/\/height \/ 2 - d\n\n \/\/ base\n module base(width, depth, sections = 2) {\n profile_height = sections * 20;\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n }\n\n\n bottom_sections = 4;\n translate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\n translate([0,(height+middle_sections*20)\/2,0])\n base(width, base_depth, middle_sections);\n\n \/\/ support towers\n tower_pos = base_depth \/ 2 - 10;\n translate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n translate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile(1, height);\n\n rotate([0,180,0]) {\n\n offset = 16;\n plate_width = width + 20 - offset * 2;\n plate_depth = base_depth - 20 * 2;\n cut_width = 440;\n cut_offset = 7.5;\n translate([\n -plate_width\/2,\n height\/2 + middle_sections * 20,\n -plate_depth \/ 2 + 20 - offset])\n basin_support(plate_width, plate_depth, cut_width, cut_offset);\n\n translate([0, height\/2 + 20 * middle_sections, base_depth \/ 2 - 10])\n big_screw();\n\n \/\/ TODO review\n screw_height = 640;\n rail_sections = 2;\n rotate([-90, 0, 0]) {\n translate([65, -base_depth \/ 2 + 10, height \/ 2 + 20 * middle_sections]) {\n profile(rail_sections, screw_height);\n }\n translate([-65, -base_depth \/ 2 + 10, height \/ 2 + 20 * middle_sections]) {\n profile(rail_sections, screw_height);\n }\n }\n translate([40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 210);\n translate([-40, height \/ 2 + 20 * middle_sections + 260, base_depth \/ 2 + 20])\n rotate([0, 180, 0])\n profile(4, 210);\n translate([-50, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([-50, height \/ 2 + 20 * middle_sections + 216, base_depth \/ 2 -60])\n plate(100, 4, 80);\n translate([0, height \/ 2 + 20 * middle_sections + 300, base_depth \/ 2 - 180])\n rotate([90,90,0])\n profile(3, 140);\n\n translate([65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n\n translate([-65, height \/ 2 + 20 * middle_sections + 300 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 240 - 10, base_depth \/ 2 - 20 - rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n translate([-65, height \/ 2 + 20 * middle_sections + 270 - 10, base_depth \/ 2 + rail_sections * 10])\n rotate([0,90,0])\n ob_solid_wheel();\n }\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6372685083eea99074eef35380ac9b3d570c6e9c","subject":"A yTranlate varialbe was introduced.","message":"A yTranlate varialbe was introduced.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/cutouts\/rotated-spiral-cutouts.scad","new_file":"OpenSCAD\/cutouts\/rotated-spiral-cutouts.scad","new_contents":"\r\n\/**\r\n * This is a library for evenly spacted cutouts.\r\n *\/\r\nmodule originalRotatedSpiralCutout(verticalSpacingFromBottom=0, \r\n z=0,\r\n\t\t\t\t\t\t\t\t charmCount = 6,\r\n\t\t\t\t\t\t\t\t xyScale = 0.125,\r\n\t\t\t\t\t\t\t\t charmStl = \"..\/..\/..\/shapes\/spurs\/spurs-a.stl\",\r\n\t\t\t\t\t\t\t\t rowSpacing = 30)\r\n{\r\n\t\/\/ outer spurs\r\n\tfor ( i = [0 : charmCount-1] )\r\n\t{\r\n\t\tyTranslate = verticalSpacingFromBottom + (z*rowSpacing);\r\n\t\t\r\n\t\trotate([\r\n\t\t\t\t90, \r\n\t\t\t\t0,\r\n\t\t\t\ti * 360 \/ charmCount\r\n\t\t])\r\n\t\t\/\/ normally x,y,z - but here y moves the little spurs up and down\r\n\t\ttranslate([15, yTranslate, 30])\r\n\t\tscale([xyScale, xyScale, 20.2])\r\n\t\timport(charmStl);\r\n\t}\t\r\n}\r\n\r\n\r\nmodule propossedRotatedSpiralCutout(charmStl = \"..\/shapes\/oshw\/oshw.stl\",\r\n\t\t\t\t\t\t\t\t\tcharmCount = 16,\r\n\t\t\t\t\t\t\t\t\txyScale = 0.4)\r\n{\r\n for ( i = [0 : charmCount] )\r\n {\t\r\n\t\tyTranslate = 5 * i;\r\n\t\t\r\n rotate([\r\n 90, \r\n 0,\r\n i * 30\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, yTranslate, 30])\r\n scale([xyScale, xyScale, 20.2])\r\n import(charmStl);\r\n }\r\n}","old_contents":"\r\n\/**\r\n * This is a library for evenly spacted cutouts.\r\n *\/\r\nmodule originalRotatedSpiralCutout(verticalSpacingFromBottom=0, \r\n z=0,\r\n\t\t\t\t\t\t\t\t charmCount = 6,\r\n\t\t\t\t\t\t\t\t xyScale = 0.125,\r\n\t\t\t\t\t\t\t\t charmStl = \"..\/..\/..\/shapes\/spurs\/spurs-a.stl\",\r\n\t\t\t\t\t\t\t\t rowSpacing = 30)\r\n{\r\n\t\/\/ outer spurs\r\n\tfor ( i = [0 : charmCount-1] )\r\n\t{\r\n\t\tyTranslate = verticalSpacingFromBottom + (z*rowSpacing);\r\n\t\t\r\n\t\trotate([\r\n\t\t\t\t90, \r\n\t\t\t\t0,\r\n\t\t\t\ti * 360 \/ charmCount\r\n\t\t])\r\n\t\t\/\/ normally x,y,z - but here y moves the little spurs up and down\r\n\t\ttranslate([15, yTranslate, 30])\r\n\t\tscale([xyScale, xyScale, 20.2])\r\n\t\timport(charmStl);\r\n\t}\t\r\n}\r\n\r\n\r\nmodule propossedRotatedSpiralCutout(spurStl = \"..\/shapes\/oshw\/oshw.stl\",\r\n\t\t\t\t\t\t\t\t\tcharmCount = 16,\r\n\t\t\t\t\t\t\t\t\txyScale = 0.4)\r\n{\r\n for ( i = [0 : charmCount] )\r\n {\t\r\n rotate([\r\n 90, \r\n 0,\r\n i * 30\r\n ])\r\n \/\/ normally x,y,z - but here y moves the little spurs up and down\r\n translate([15, 5 * i, 30])\r\n scale([xyScale, xyScale, 20.2])\r\n import(spurStl);\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"758fe17fe8c372af2d74772011412d5be9f89c83","subject":"added sd card","message":"added sd card\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\nOLEDWidth = 27.3;\nOLEDDisplayHeight = 19;\nOLEDScrewWidth = 20.7;\nOLEDScrewHeight = 23.2;\nOLEDScrewDiameter = 3;\nOLEDDepth = 1;\nOLEDDisplayDepth = 1;\nmodule display() {\n difference() {\n union() {\n cube([OLEDWidth, OLEDWidth, OLEDDepth]);\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, 1])\n cube([OLEDWidth, OLEDDisplayHeight, OLEDDisplayDepth]);\n }\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule pentagon_lid() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n translate([-OLEDWidth \/ 2, 0, 0]) rotate([0, 0, -18]) {\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, -.1])\n cube([OLEDWidth, OLEDDisplayHeight, boxThickness + .2]);\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n for (i = [3:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - ledButtonDiameter * 1.5, 0, -.1])\n momentary_button(color=\"red\");\n for (i = [3:4])\n rotate([0, 0, 180 + i * 72])\n translate([pentagonRadius - latchButtonDiameter * 2.2, 0, -.1])\n latch_button((i == 3 ? \"red\" : \"green\"));\n for (i = [0,2])\n rotate([0, 0, (i == 0 ? - 1 : 1) * 12 + i * 72])\n translate([pentagonRadius - latchButtonDiameter * 2.2, 0, -10])\n encoder();\n\n rotate([0, 0, 4*-72])\n translate([-pentagonR + boxThickness, -sdCardWidth \/ 2, 10])\n rotate([0, 90, 0]) \n sd_card(iFitAdjust);\n }\n\/\/ display();\n}\n\nsdCardHeight = 32;\nsdCardWidth = 24;\nsdCardThickness = 2.1;\nmodule sd_card(adjust) {\n cube([sdCardHeight + adjust, sdCardWidth + adjust, sdCardThickness + adjust]);\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/translate([0, 0, boxHeight + boxThickness]) spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n \/\/pentagon_core();\n \/\/translate([0, 0, boxHeight + boxThickness]) \n pentagon_lid();\n \/\/display();\n}\n\ncase();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\nOLEDWidth = 27.3;\nOLEDDisplayHeight = 19;\nOLEDScrewWidth = 20.7;\nOLEDScrewHeight = 23.2;\nOLEDScrewDiameter = 3;\nOLEDDepth = 1;\nOLEDDisplayDepth = 1;\nmodule display() {\n difference() {\n union() {\n cube([OLEDWidth, OLEDWidth, OLEDDepth]);\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, 1])\n cube([OLEDWidth, OLEDDisplayHeight, OLEDDisplayDepth]);\n }\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule pentagon_lid() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n translate([-OLEDWidth \/ 2, 0, 0]) rotate([0, 0, -18]) {\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, -.1])\n cube([OLEDWidth, OLEDDisplayHeight, boxThickness + .2]);\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n for (i = [3:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - ledButtonDiameter * 1.5, 0, -.1])\n momentary_button(color=\"red\");\n for (i = [3:4])\n rotate([0, 0, 180 + i * 72])\n translate([pentagonRadius - latchButtonDiameter * 2.2, 0, -.1])\n latch_button((i == 3 ? \"red\" : \"green\"));\n for (i = [0,2])\n rotate([0, 0, (i == 0 ? - 1 : 1) * 12 + i * 72])\n translate([pentagonRadius - latchButtonDiameter * 2.2, 0, -10])\n encoder();\n }\n\/\/ display();\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/translate([0, 0, boxHeight + boxThickness]) spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n \/\/pentagon_core();\n \/\/translate([0, 0, boxHeight + boxThickness]) \n pentagon_lid();\n \/\/display();\n}\n\ncase();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"4b07ad50f62ea14d5829452c55d1e903f293dcd0","subject":"improved CH clearance at H node on BH segments","message":"improved CH clearance at H node on BH segments\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.4);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2.2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.9])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.3]) rotate([180,0,0]) F698();\n translate([0,0,2.24]) F698();\n translate([0,0,6.74]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-1,FGperp-1,z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([12,11,-.3]) barEnd1();\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) barEnd1();\n translate([14,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+1,FGperp-1,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+1,FGperp-1,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([8,0,0]) barEnd1();\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) barEnd1();\n translate([DE-8,0,0]) barEnd1();\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-110,0,0]) cylinder(r=.8,h=14.4);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=1,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .36]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.36]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule barEnd1() sphere(.8,$fn=12);\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-20;\nb2=h2-2;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([b2,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b2,spread,hi]) barEnd1();\n translate([b1,spread,lo]) barEnd1(); \n }\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) barEnd1();\n translate([BH-3,1 *q,1]) barEnd1();\n }\n hull() {\n translate([ 0 ,0,5]) barEnd1();\n translate([BH-3,0,1]) barEnd1();\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.4);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2.2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n cylinder(r=.4,h=22,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.9])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.3]) rotate([180,0,0]) F698();\n translate([0,0,2.24]) F698();\n translate([0,0,6.74]) F698();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.6,2.6,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) sphere(.8);\n translate([FGleft-1,FGperp-1,z]) sphere(.8);\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) sphere(.8);\n translate([12,11,-.3]) sphere(.8);\n }\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n hull() {\n translate([FGleft-7.2,FGperp-8,5.3]) sphere(.8);\n translate([14,13.5,-.3]) sphere(.8);\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) sphere(.8);\n translate([FGleft+1,FGperp-1,-.3]) sphere(.8);\n }\n hull() {\n translate([FG-10,0,0]) sphere(.8);\n translate([FGleft+1,FGperp-1,5.2]) sphere(.8);\n }\n\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,5.2]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n hull() { \/\/ perp brace\n translate([FGleft,FGperp-1,-.3]) sphere(.8);\n translate([FGleft,0,-.3]) sphere(.8);\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) sphere(.8);\n translate([35, 0,0]) sphere(.8);\n }\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) cube([DE-5,2.5,2.5],center=true); \/\/ top tube\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n cylinder(r=2.54*1.5\/2,h=7.2,$fn=36); \/\/ axle\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=18,center=true);\n }\n\n \/\/ top tube fork plates\n translate([DE,0,0]) mirror([1,0,0]) eFork();\n eFork();\n\n\n hull() { \/\/ diag tubes\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n\n \/\/ extra bracing\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,5]) rotate([-110,0,0]) cylinder(r=.8,h=14.4);\n}\n\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=1,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .36]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.36]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3,$fn=11,center=true);\n\n translate([dx,0,0]) SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SA8();\n translate([EF\/2-.4,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n translate([0,0,2.4]) cylinder(r=2.54*1.5\/2,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=2.54*1.5\/2-.3,h=22,$fn=19,center=true);\n }\n\n \/\/ brace near axle\n translate([3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-6,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,.7,-1.6]) sphere(.8);\n translate([BH-9,.7, 6.2]) sphere(.8); \n }\n hull() {\n translate([ 4,-.7, 6.2]) sphere(.8);\n translate([BH-9,-.7,-1.6]) sphere(.8); \n }\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1e121acd9f1f4bfbc55dce6f859408ceb1c003af","subject":"main brick","message":"main brick\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"wooden_tracks\/wooden_line_tracks.scad","new_file":"wooden_tracks\/wooden_line_tracks.scad","new_contents":"length = 144.5;\n\nmodule main_track()\n{\n cube([length, 40, 12]);\n}\n\nmain_track();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wooden_tracks\/wooden_line_tracks.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"5fb33e3b620d05ec283a24fb722008a022e7e292","subject":"The stand was fleshed out some more.","message":"The stand was fleshed out some more.","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/mounting-hardware\/wall-mounted\/stand\/wall-mounted-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/mounting-hardware\/wall-mounted\/stand\/wall-mounted-stand.scad","new_contents":"\nuse \n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\n\nmodule wallMountedStand(mount_cube_xLength,\n\t\t\t\t\t\tmount_cube_yLength,\n\t\t\t\t\t\tmount_cube_zLength,\n\t\t\t\t\t\tplatform_height,\n\t\t\t\t\t\tplatform_segmentCount,\n\t\t\t\t\t\tplatform_topRadius,\n\t\t\t\t\t\tsupport_xLength,\n\t\t\t\t\t\tsupport_zLength)\n{\n\tunion()\n\t{\n\t\twallMountedStand_platform(height = platform_height,\n\t\t\t\t\t\t\t\t segmentCount = platform_segmentCount,\n\t\t\t\t\t\t\t \t topRadius = platform_topRadius);\n\n\t\twallMountedStand_support(platform_topRadius = platform_topRadius,\n\t\t\t\t\t\t\t\t support_xLength = support_xLength,\n\t\t\t\t\t\t\t\t support_zLength = support_zLength);\n\n\t\twallMountedStand_mount(cube_xLength = mount_cube_xLength,\n\t\t\t\t\t\t\t cube_yLength = mount_cube_yLength,\n\t\t\t\t\t\t\t cube_zLength = mount_cube_zLength,\n\t\t\t\t\t\t\t platform_topRadius = platform_topRadius);\n }\n}\n\nmodule wallMountedStand_platform(height,\n\t\t\t\t\t\t\t\t segmentCount,\n\t\t\t\t\t\t\t \t topRadius)\n{\n\tcolor(\"orange\")\n\tcylinder(h=height, r1=topRadius, r2=40, $fn=segmentCount);\n}\n\nmodule wallMountedStand_support(platform_topRadius,\n\t\t\t\t\t\t\t\tsupport_xLength,\n\t\t\t\t\t\t\t\tsupport_zLength)\n{\n\techo(\"slooop\");\n\tadjacent = support_zLength - 15;\n\topposite = support_xLength; \/\/platform_topRadius + 5;\n\tdepth = 10;\n\n\tzTranslate = -platform_topRadius;\n\n\tcolor(\"green\")\n\ttranslate([zTranslate, 0, 0])\n\trotate([180, 90, 90])\n\trightTriangle(adjacent, opposite, depth);\n\n\techo(\"slooop 2\");\n}\n\nmodule wallMountedStand_mount(cube_xLength,\n\t\t\t\t\t\t\t cube_yLength,\n\t\t\t\t\t\t\t cube_zLength,\n\t\t\t\t\t\t\t platform_topRadius)\n{\n\tsize = [cube_xLength, cube_yLength, cube_zLength];\n\n\tcornerRadius = 2;\n\n\txTranslate = -platform_topRadius + cornerRadius;\n\tyTranslate = -cube_yLength \/ 2.0;\n\n\tdifference()\n\t{\n\t\tcolor(\"orange\")\n\t\ttranslate([xTranslate, yTranslate, 0])\n\t\troundedCube(cornerRadius = cornerRadius,\n\t\t sides=20,\n\t\t sidesOnly=true,\n\t\t size=size);\n\n\t\twallMountedStand_mountCutouts();\n\t}\n}\n\nmodule wallMountedStand_mountCutouts()\n{\n\txTranslate = -70;\n\tyTranslate = -15;\n\tzTranslate = 15;\n\n\trotation = [0, 90, 0];\n\n\tcolor(\"purple\")\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\trotate(rotation)\n\tcylinder(r=1, h = 80, $fn = 30);\n\n\tcolor(\"purple\")\n\ttranslate([xTranslate, -yTranslate, zTranslate])\n\trotate(rotation)\n\tcylinder(r=1, h = 80, $fn = 30);\n}\n","old_contents":"\nuse \n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\n\nmodule wallMountedStand(mount_cube_yLength,\n\t\t\t\t\t\tplatform_height,\n\t\t\t\t\t\tplatform_segmentCount,\n\t\t\t\t\t\tplatform_topRadius,\n\t\t\t\t\t\tsupport_height)\n{\n\tunion()\n\t{\n\t\twallMountedStand_platform(height = platform_height,\n\t\t\t\t\t\t\t\t segmentCount = platform_segmentCount,\n\t\t\t\t\t\t\t \t topRadius = platform_topRadius);\n\n\t\twallMountedStand_support(platform_topRadius = platform_topRadius,\n\t\t\t\t\t\t\t\t support_height = support_height);\n\n\t\twallMountedStand_mount(cube_yLength = mount_cube_yLength,\n\t\t\t\t\t\t\t platform_topRadius = platform_topRadius);\n }\n}\n\nmodule wallMountedStand_platform(height,\n\t\t\t\t\t\t\t\t segmentCount,\n\t\t\t\t\t\t\t \t topRadius)\n{\n\tcolor(\"orange\")\n\tcylinder(h=height, r1=topRadius, r2=40, $fn=segmentCount);\n}\n\nmodule wallMountedStand_support(platform_topRadius,\n\t\t\t\t\t\t\t\tsupport_height)\n{\n\techo(\"slooop\");\n\tadjacent = support_height - 25;\n\topposite = platform_topRadius - 4;\n\tdepth = 40;\n\n\tzTranslate = -platform_topRadius;\n\n\tcolor(\"green\")\n\ttranslate([zTranslate, 0, 0])\n\trotate([180, 90, 90])\n\trightTriangle(adjacent, opposite, depth);\n\n\techo(\"slooop 2\");\n}\n\nmodule wallMountedStand_mount(cube_yLength,\n\t\t\t\t\t\t\t platform_topRadius)\n{\n\tboardLength = 10;\n\tboardHeight = 19;\n\n\tsize = [boardLength, cube_yLength, boardHeight];\n\n\txTranslate = -platform_topRadius;\n\n\tcolor(\"orange\")\n\ttranslate([xTranslate, 0, 0])\n\troundedCube(cornerRadius = 5,\n\t sides=20,\n\t sidesOnly=true,\n\t size=size);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"71b25599f1068c5d44667d276e65faf102a47bc0","subject":"bearing\/linear\/mount: use 2 zipties even if no clips in bearing","message":"bearing\/linear\/mount: use 2 zipties even if no clips in bearing\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n ziptie_dist_ = v_fallback(ziptie_dist, [clip_dist\/2, ziptie_width*2<(h\/3+2*mm) ? h \/ 3 : U]);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(ziptie_dist_ != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(ziptie_dist_ != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*ziptie_dist_\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \nuse \nuse \nuse \ninclude \ninclude \n\nmodule linear_bearing(part, bearing, align=N, orient=Z, offset_flange=false)\n{\n model = get(LinearBearingModel, bearing);\n width_x = fallback(get(LinearBearingFlangeCutDiameter, bearing),LinearBearingOuterDiameter);\n width_y = fallback(get(LinearBearingFlangeDiameter, bearing),LinearBearingOuterDiameter);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n clip_groove = get(LinearBearingClipsGrooveDepth, bearing);\n clip_dia = get(LinearBearingClipsDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n\n flange_offset = offset_flange ? -flange_h : 0;\n h = get(LinearBearingLength,bearing);\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n s = [width_x, width_y, h];\n if(part==U)\n {\n difference()\n {\n linear_bearing(part=\"pos\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n linear_bearing(part=\"neg\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n %linear_bearing(part=\"vit\", bearing=bearing, align=align, orient=orient, offset_flange=offset_flange);\n }\n else if(part==\"pos\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n cylindera(h=h, d=D, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=s, align=align, orient=orient)\n translate(Z*flange_offset)\n {\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n}\n\nmodule linear_bearing_mount(part, bearing, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=.1*mm, align=N, orient=Z, ziptie_dist=U, with_zips=true, offset_flange=false, mount_dir_align=U, mount_style=\"open\")\n{\n assert(mount_dir_align != U, \"mount_dir_align == U\");\n\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, get(LinearBearingClipsDistance,bearing)\/2);\n\n clip_dist = get(LinearBearingClipsDistance, bearing);\n\n h = fallback(override_h, get(LinearBearingLength,bearing)) + extra_h;\n d = get(LinearBearingInnerDiameter, bearing);\n D = get(LinearBearingOuterDiameter, bearing);\n\n flange_h = fallback(get(LinearBearingFlangeThickness, bearing),0);\n\n \/\/ for all kinds of flanges\n flange_d = get(LinearBearingFlangeDiameter,bearing);\n\n \/\/ only for square flange\n flange_side = get(LinearBearingFlangeSide,bearing);\n\n \/\/ only for cut flanges\n flange_d_cut = get(LinearBearingFlangeCutDiameter,bearing);\n\n flange_pcd = get(LinearBearingFlangePitchCircleDiameter,bearing);\n\n flange_screw_len=12*mm;\n flange_offset = offset_flange ? -flange_h : 0;\n\n support_wall_thickness = 2.5*mm;\n\n support_D=D+2*support_wall_thickness;\n support_h = h+flange_offset;\n if(part==U)\n {\n difference()\n {\n linear_bearing_mount(part=\"pos\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n linear_bearing_mount(part=\"neg\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n %linear_bearing_mount(part=\"vit\", bearing=bearing, extra_h=extra_h, override_h=override_h, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, tolerance=tolerance, align=align, orient=orient, ziptie_dist=ziptie_dist, with_zips=with_zips, offset_flange=offset_flange, mount_dir_align=mount_dir_align, mount_style=mount_style);\n }\n else if(part==\"pos\")\n size_align(size=[D,D,h], align=align, orient=orient)\n {\n translate(-Z*h\/2)\n {\n \/\/ z axis bearing support\n if(mount_style==\"open\")\n {\n intersection()\n {\n rcylindera(h=support_h, d=D, orient=Z, align=Z);\n rcubea(size=[D,D,support_h], orient=Z, align=Z+mount_dir_align);\n }\n }\n else if(mount_style==\"closed\")\n {\n rcylindera(h=support_h, d=support_D, orient=Z, align=Z);\n }\n\n \/\/ support for clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ support for flange mount\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n rcylindera(d=1.5*get(LinearBearingFlangeMountingSize,bearing), h=flange_screw_len, orient=Z, align=Z);\n }\n }\n }\n else if(part==\"neg\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n translate(-Z*.001)\n {\n \/\/ Main bearing cut\n cylindera(h=h+tolerance, d=D+tolerance, orient=Z);\n\n if(mount_style==\"open\")\n {\n orient(-orient)\n rcubea(size=[1000,1000,D+.2*mm], align=mount_dir_align);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n }\n\n \/\/ for linear rod\n cylindera(d=d+2*mm, h=1000, orient=Z);\n\n \/\/ flange\n translate(-Z*h\/2)\n {\n if(flange_side != U)\n {\n \/\/ LMK\n intersection()\n {\n rcubea(size=[flange_side, flange_side, flange_h], orient=Z, align=Z, round_r=1);\n\n rcubea(size=[flange_d, flange_d, flange_h], orient=Z, align=Z, round_r=1);\n }\n }\n else if(flange_d != U)\n {\n \/\/ LMH\n if(flange_d_cut != U)\n {\n intersection()\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n rcubea(size=[get(LinearBearingFlangeCutDiameter, bearing), flange_d, flange_h], align=Z, round_r=1);\n }\n }\n \/\/ LMF\n else if(flange_d != U)\n {\n rcylindera(h=flange_h, d=flange_d, orient=Z, align=Z, round_r=1);\n }\n }\n }\n\n translate(-Z*h\/2)\n {\n \/\/ inner bore cut\n cylindera(h=h, d=d, orient=Z, align=Z, extra_h=.2);\n\n \/\/ clips\n if(clip_dist != U)\n {\n translate(Z*h\/2)\n for(z=[-1,1])\n translate(z*Z*clip_dist\/2)\n hollow_cylinder(d=D-clip_groove\/2+.01, thickness=clip_groove, h=clip_groove, taper=false, orient=Z, align=-z);\n }\n\n \/\/ flange\n if(flange_side != U)\n {\n \/\/ LMK\n \/\/ screw cut\n for(x=[-1,1])\n for(y=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d_cut != U)\n {\n \/\/ LMH\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*get(LinearBearingFlangeCutMountHoleDist, bearing)\/2)\n translate(x*X*get(LinearBearingFlangeCutMountHoleDistSide, bearing)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n else if(flange_d != U)\n {\n \/\/ LMF\n \/\/ screw cut\n for(y=[-1,1])\n for(x=[-1,1])\n translate(y*Y*flange_pcd\/2*sqrt(2)\/2)\n translate(x*X*flange_pcd\/2*sqrt(2)\/2)\n screw_cut(thread=ThreadM4, h=flange_screw_len, orient=Z, align=Z);\n }\n }\n\n }\n else if(part==\"vit\")\n size_align(size=[D,D,h], align=align, orient=orient)\n translate(Z*flange_offset)\n {\n if($show_vit)\n {\n linear_bearing(bearing=bearing);\n\n if(mount_style==\"open\")\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n hollow_cylinder(\n d=D+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\n\n\/\/ all\nif(false)\n{\n v_flangewidth = v_get(AllLinearBearing,LinearBearingFlangeDiameter);\n v_dia = v_get(AllLinearBearing,LinearBearingOuterDiameter);\n v_width = vv_fallback([v_flangewidth, v_dia]);\n dist_cumsum = v_cumsum(v_width, 0);\n for(i=[0:1:len(AllLinearBearing)-1])\n {\n bearing = AllLinearBearing[i];\n dist=dist_cumsum[i];\n translate(X*dist)\n {\n linear_bearing(bearing=bearing, align=Z);\n translate((v_width[i]\/2 + 3*mm)*-Y)\n rotate(-90*Z)\n text(get(LinearBearingModel, bearing), size=v_width[i]*.8, valign=\"center\", halign=\"left\");\n\n translate((v_width[i] + 10*mm)*Y)\n linear_bearing_mount(bearing=bearing, align=Z);\n }\n }\n}\n\nif(false)\n{\n stack(axis=X, dist=50*mm)\n {\n linear_bearing(bearing=LinearBearingLM6, align=Z);\n linear_bearing(bearing=LinearBearingLM6L, align=Z);\n linear_bearing(bearing=LinearBearingLMF8, align=Z);\n linear_bearing(bearing=LinearBearingLMF8L, align=Z);\n linear_bearing(bearing=LinearBearingLMK8, align=Z);\n linear_bearing(bearing=LinearBearingLMK8L, align=Z);\n linear_bearing(bearing=LinearBearingLMH12L, align=Z);\n linear_bearing(bearing=LinearBearingLMH16L, align=Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d8435f87573db49c69cd3bd641d60b91b76d0a99","subject":"As printed","message":"As printed\n","repos":"Yona-Appletree\/ledSPI,Yona-Appletree\/ledSPI","old_file":"matrix-bracket.scad","new_file":"matrix-bracket.scad","new_contents":"\/** \\file\n * Bracket to hold a 16x2 LED panel in an Octoscroller configuration.\n *\/\n\nmodule bracket_half()\n{\n\trender() difference()\n\t{\n\t\tcube([18,7,10]);\n\n\t\ttranslate([13,10,5])\n\t\trotate([90,0,0])\n\t\tcylinder(r=2, h=20, $fs=1);\n\t}\n}\n\nmodule bracket()\n{\n\trotate([0,0,+45\/2]) bracket_half();\n\trotate([0,0,-45\/2-180]) translate([0,-7,0]) bracket_half();\n}\n\nfor (i = [0:1])\n{\n\ttranslate([i*35,0,0]) {\n\t\tfor (j = [0:7]) {\n\t\t\ttranslate([0,10*j,0]) bracket();\n\t\t}\n\t}\n}\n\n%translate([0,0,-1]) cube([200,200,2], center=true);\n","old_contents":"\/** \\file\n * Bracket to hold a 16x2 LED panel in an Octoscroller configuration.\n *\/\n\nmodule bracket()\n{\n\trender() difference()\n\t{\n\t\tcube([16,5,10]);\n\n\t\ttranslate([13,10,5])\n\t\trotate([90,0,0])\n\t\tcylinder(r=2, h=20, $fs=1);\n\t}\n}\n\nrotate([0,0,+45\/2]) bracket();\nrotate([0,0,-45\/2-180]) translate([0,-5,0]) bracket();\n\n%translate([0,0,-1]) cube([200,200,2], center=true);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"133a9865aca75158ec039b3c1e872bb5cfa953a7","subject":"transforms: add some asserts","message":"transforms: add some asserts\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n assert(dist!=U, \"dist==U\");\n translate(Z*dist)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\nmodule r(a, v)\n{\n rotate(a,v)\n children();\n}\n\nmodule rx(degrees)\n{\n rotate(X*degrees)\n children();\n}\n\nmodule ry(degrees)\n{\n rotate(Y*degrees)\n children();\n}\n\nmodule rz(degrees)\n{\n rotate(Z*degrees)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n extra_t = (orient==U||extra_size==U||extra_size==[U,U,U]||extra_size==[0,0,0]||extra_align==U) ?\n N : _orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n\/\/ translate by pos, with extra (depending on the sign of pos)\n\/\/ an \"explode\" function\nmodule te(pos, extra=[0,0,0])\n{\n assert(len(pos) == 3);\n assert(len(extra) == 3);\n\n t(pos + v_mul(extra , v_sign(pos)))\n children();\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"688c096931f038aa41346e9727e71b362b23f350","subject":"Clarifying specs, general updates.","message":"Clarifying specs, general updates.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\nheight = 180; \/\/ z\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = 10;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ height of side supports\nside_support_height = height\/2; \/\/ full side walls\n\/\/side_support_height = 20;\n\n\/\/ amount faces extend past each other at corners\noverhang = 10;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ components to include (comment out unwanted)\nvert_faces();\nside_supports();\ntank_base();\nlight_bar();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_faces() {\n\tdifference() {\n\t\tunion() {\n\t\t\tvert_face(x=0);\n\t\t\tvert_face(x=width);\n\t\t}\n\t\tside_support_base(height_scale=0.5);\n\t\tside_support_top(height_scale=0.5);\n\t}\n}\n\nmodule vert_face(x) {\n\ttranslate([x-thickness\/2,-overhang,0])\n\t\tcube([thickness,depth+overhang*2,height]);\n}\n\nmodule tank_base() {\n\ttranslate([thickness,-outset,base_height])\n\tdifference() {\n\t\tcube([base_width, depth+outset*2, thickness]);\n\t\tcutouts(5,base_width,outset,far_side=false);\n cutouts(5,base_width,outset,far_side=true);\n\t}\n}\n\nmodule light_bar() {\n\ttranslate([light_pos_x,-outset,light_height])\n\tdifference() {\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\n cutouts(2,light_bar_width,outset,far_side=true);\n\t}\n}\n\nmodule cutouts(num, width, outset, far_side=False) {\n w = width \/ ((num-1) * 2);\n y = far_side ? depth+outset-thickness\/2 : 0;\n for (i = [0 : num-1]) {\n translate([-w\/2 + i*2*w,y,0])\n cube([w, outset+thickness\/2, thickness]);\n }\n}\n\nmodule side_supports() {\n\tdifference() {\n\t\tunion() {\n\t\t\tside_support_base();\n\t\t\tside_support_top();\n\t\t}\n\t\tvert_faces();\n\t\ttank_base();\n light_bar();\n\t}\n}\n\nmodule side_support_top(height_scale=1) {\n\ttranslate([0,0,height])\n side_support_base(height_scale=-height_scale);\n}\n\nmodule side_support_base(height_scale=1) {\n\tscale([1,1,height_scale])\n\t\tunion() {\n\t\t\tside_support(y=0);\n\t\t\tside_support(y=depth);\n\t\t}\n}\n\nmodule side_support(y) {\n\ttranslate([-overhang,y-thickness\/2,0])\n\t\tcube([width+overhang*2, thickness, side_support_height]);\n}\n","old_contents":"\/\/ fishbox.scad\r\n\/\/ - Enclosure design for zebrafish Skinner box\r\n\/\/ \r\n\/\/ Author: Mark Liffiton\r\n\/\/ Date: Oct, 2014\r\n\/\/\r\n\/\/ Units are mm\r\n\r\n\/\/ Set thickness to account for thickness of material\r\n\/\/ PLUS needed clearance for cuts into which material should fit.\r\nthickness = 3;\r\n\r\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\r\nwidth = 400; \/\/ x\r\ndepth = 300; \/\/ y\r\nheight = 180; \/\/ z\r\n\r\n\/\/ tank base plate\r\nbase_width = 80;\r\nbase_height = 10;\r\n\r\n\/\/ light bar\r\nlight_bar_width = 20;\r\nlight_pos_x = thickness+base_width-light_bar_width;\r\nlight_height = height-10;\r\n\r\n\/\/ height of side supports\r\n\/\/side_support_height = height\/2; \/\/ full side walls\r\nside_support_height = 20;\r\n\r\n\/\/ amount faces extend past each other at corners\r\noverhang = 10;\r\n\r\n\/\/ amount horizontal support bars extend past side supports\r\noutset = overhang\/2;\r\n\r\n\/\/ components to include (comment out unwanted)\r\nvert_faces();\r\nside_supports();\r\ntank_base();\r\nlight_bar();\r\n\r\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\r\n\/\/ Module definitions\r\n\/\/\r\n\r\nmodule vert_faces() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tvert_face(x=0);\r\n\t\t\tvert_face(x=width);\r\n\t\t}\r\n\t\tside_support_base(height_scale=0.5);\r\n\t\tside_support_top(height_scale=0.5);\r\n\t}\r\n}\r\n\r\nmodule vert_face(x) {\r\n\ttranslate([x-thickness\/2,-overhang,0])\r\n\t\tcube([thickness,depth+overhang*2,height]);\r\n}\r\n\r\nmodule tank_base() {\r\n\ttranslate([thickness,-outset,base_height])\r\n\tdifference() {\r\n\t\tcube([base_width, depth+outset*2, thickness]);\r\n\t\tcutouts(3,base_width,outset,far_side=false);\r\n cutouts(3,base_width,outset,far_side=true);\r\n\t}\r\n}\r\n\r\nmodule light_bar() {\r\n\ttranslate([light_pos_x,-outset,light_height])\r\n\tdifference() {\r\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\r\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\r\n cutouts(2,light_bar_width,outset,far_side=true);\r\n\t}\r\n}\r\n\r\nmodule cutouts(num, width, outset, far_side=False) {\r\n w = width \/ ((num-1) * 2);\r\n y = far_side ? depth+outset-thickness\/2 : 0;\r\n for (i = [0 : num-1]) {\r\n translate([-w\/2 + i*2*w,y,0])\r\n cube([w, outset+thickness\/2, thickness]);\r\n }\r\n}\r\n\r\nmodule side_supports() {\r\n\tdifference() {\r\n\t\tunion() {\r\n\t\t\tside_support_base();\r\n\t\t\tside_support_top();\r\n\t\t}\r\n\t\tvert_faces();\r\n\t\ttank_base();\r\n light_bar();\r\n\t}\r\n}\r\n\r\nmodule side_support_top(height_scale=1) {\r\n\ttranslate([0,0,height])\r\n side_support_base(height_scale=-height_scale);\r\n}\r\n\r\nmodule side_support_base(height_scale=1) {\r\n\tscale([1,1,height_scale])\r\n\t\tunion() {\r\n\t\t\tside_support(y=0);\r\n\t\t\tside_support(y=depth);\r\n\t\t}\r\n}\r\n\r\nmodule side_support(y) {\r\n\ttranslate([-overhang,y-thickness\/2,0])\r\n\t\tcube([width+overhang*2, thickness, side_support_height]);\r\n}\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"db89269be292fee77951371f3cd2d814e16a5e0b","subject":"Fix offset of camera supports for cutouts.","message":"Fix offset of camera supports for cutouts.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox.scad","new_file":"designs\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\nheight = 180; \/\/ z\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = 10;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ height of side supports\nside_support_height = height\/2; \/\/ full side walls\n\/\/side_support_height = 20;\n\n\/\/ amount faces extend past each other at corners\noverhang = 10;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ components to include (comment out unwanted)\nvert_faces();\nside_supports();\ntank_base();\nlight_bar();\ncamera_supports(x=width, y=depth\/2, z=height\/2, spacing=20);\ntop_cover();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_faces() {\n\tdifference() {\n\t\tunion() {\n\t\t\tvert_face(x=0);\n difference() {\n vert_face(x=width);\n camera_opening();\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+10, spacing=20);\n }\n\t\t}\n\t\tside_support_base(height_scale=0.5);\n\t\tside_support_top(height_scale=0.5);\n\t}\n}\n\nmodule vert_face(x) {\n\ttranslate([x-thickness\/2,-overhang,0])\n\t\tcube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, spacing) {\n camera_support(x, y + spacing\/2, z);\n camera_support(x, y - spacing\/2, z);\n}\n\nmodule camera_support(x, y, z) {\n inner_w = 20;\n inner_h = 30;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([thickness\/2,-outset,height-thickness])\n difference() {\n cube([width-thickness,depth+outset*2,thickness]);\n\t\tcutouts(5,width-thickness,outset,far_side=false);\n\t\tcutouts(5,width-thickness,outset,far_side=true);\n }\n}\n\nmodule tank_base() {\n\ttranslate([thickness,-outset,base_height])\n\tdifference() {\n\t\tcube([base_width, depth+outset*2, thickness]);\n\t\tcutouts(5,base_width,outset,far_side=false);\n cutouts(5,base_width,outset,far_side=true);\n\t}\n}\n\nmodule light_bar() {\n\ttranslate([light_pos_x-light_bar_width\/2, -outset, light_height])\n\tdifference() {\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\n cutouts(2,light_bar_width,outset,far_side=true);\n\t}\n}\n\nmodule cutouts(num, width, outset, far_side=false) {\n w = width \/ ((num-1) * 2);\n y = far_side ? depth+outset-thickness\/2 : 0;\n for (i = [0 : num-1]) {\n translate([-w\/2 + i*2*w, y, -epsilon])\n cube([w, outset+thickness\/2, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side_supports() {\n\tdifference() {\n\t\tunion() {\n\t\t\tside_support_base();\n\t\t\tside_support_top();\n\t\t}\n\t\tvert_faces();\n\t\ttank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n\t}\n}\n\nmodule side_support_top(height_scale=1) {\n\ttranslate([0,0,height])\n side_support_base(height_scale=-height_scale);\n}\n\nmodule side_support_base(height_scale=1) {\n\tscale([1,1,height_scale])\n\t\tunion() {\n\t\t\tside_support(y=0);\n\t\t\tside_support(y=depth);\n\t\t}\n}\n\nmodule side_support(y) {\n\ttranslate([-overhang,y-thickness\/2,0])\n\t\tcube([width+overhang*2, thickness, side_support_height]);\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 3;\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\nheight = 180; \/\/ z\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = 10;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-10;\n\n\/\/ height of side supports\nside_support_height = height\/2; \/\/ full side walls\n\/\/side_support_height = 20;\n\n\/\/ amount faces extend past each other at corners\noverhang = 10;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ components to include (comment out unwanted)\nvert_faces();\nside_supports();\ntank_base();\nlight_bar();\ncamera_supports(x=width, y=depth\/2, z=height\/2, spacing=20);\ntop_cover();\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_faces() {\n\tdifference() {\n\t\tunion() {\n\t\t\tvert_face(x=0);\n difference() {\n vert_face(x=width);\n camera_opening();\n camera_supports(x=width+10, y=depth\/2, z=height\/2+10, spacing=20);\n }\n\t\t}\n\t\tside_support_base(height_scale=0.5);\n\t\tside_support_top(height_scale=0.5);\n\t}\n}\n\nmodule vert_face(x) {\n\ttranslate([x-thickness\/2,-overhang,0])\n\t\tcube([thickness,depth+overhang*2,height]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, spacing) {\n camera_support(x, y + spacing\/2, z);\n camera_support(x, y - spacing\/2, z);\n}\n\nmodule camera_support(x, y, z) {\n inner_w = 20;\n inner_h = 30;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([thickness\/2,-outset,height-thickness])\n difference() {\n cube([width-thickness,depth+outset*2,thickness]);\n\t\tcutouts(5,width-thickness,outset,far_side=false);\n\t\tcutouts(5,width-thickness,outset,far_side=true);\n }\n}\n\nmodule tank_base() {\n\ttranslate([thickness,-outset,base_height])\n\tdifference() {\n\t\tcube([base_width, depth+outset*2, thickness]);\n\t\tcutouts(5,base_width,outset,far_side=false);\n cutouts(5,base_width,outset,far_side=true);\n\t}\n}\n\nmodule light_bar() {\n\ttranslate([light_pos_x-light_bar_width\/2, -outset, light_height])\n\tdifference() {\n\t\tcube([light_bar_width, depth+outset*2, thickness]);\n\t\tcutouts(2,light_bar_width,outset,far_side=false);\n cutouts(2,light_bar_width,outset,far_side=true);\n\t}\n}\n\nmodule cutouts(num, width, outset, far_side=false) {\n w = width \/ ((num-1) * 2);\n y = far_side ? depth+outset-thickness\/2 : 0;\n for (i = [0 : num-1]) {\n translate([-w\/2 + i*2*w, y, -epsilon])\n cube([w, outset+thickness\/2, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side_supports() {\n\tdifference() {\n\t\tunion() {\n\t\t\tside_support_base();\n\t\t\tside_support_top();\n\t\t}\n\t\tvert_faces();\n\t\ttank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n\t}\n}\n\nmodule side_support_top(height_scale=1) {\n\ttranslate([0,0,height])\n side_support_base(height_scale=-height_scale);\n}\n\nmodule side_support_base(height_scale=1) {\n\tscale([1,1,height_scale])\n\t\tunion() {\n\t\t\tside_support(y=0);\n\t\t\tside_support(y=depth);\n\t\t}\n}\n\nmodule side_support(y) {\n\ttranslate([-overhang,y-thickness\/2,0])\n\t\tcube([width+overhang*2, thickness, side_support_height]);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a5fd57e0edfe829d7a0617f3af2b165980e6424c","subject":"Adjust header spacer and reset button colours","message":"Adjust header spacer and reset button colours","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 0.1 * 25.4; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(Grey20)\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(Grey20)\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n datumX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n datumZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([datumX, 0.5 * 25.4, datumZ])\n rotate([0,0,45])\n linear_extrude(1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([datumX, 0.05 * 25.4, datumZ])\n {\n color(\"silver\")\n linear_extrude(1.2)\n square([4.5, 4.5], center=true);\n color(ArduinoPro_PCB_Colour)\n translate([0, 0, 1.2])\n linear_extrude(0.5)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([datumX, 0.05 * 25.4, datumZ])\n linear_extrude(1)\n {\n \/\/ Red - Power\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ Green - Status\n translate([0.2 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([datumX, 0.15 * 25.4, datumZ])\n linear_extrude(1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([datumX, 0.2 * 25.4, datumZ])\n linear_extrude(1)\n {\n \/\/ RX - Yellow\n translate([-0.3 * 25.4\/2, 0, 0])\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([-0.15 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4\/2, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([datumX, moveY, datumZ])\n linear_extrude(2)\n {\n translate([-7.5\/2, 0, 0])\n square([1.5, 3.5], center=true);\n translate([7.5\/2, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([datumX, moveY, datumZ])\n linear_extrude(1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\n\/\/ ArduinoPro Model Variants\nArduinoPro_Mini = 1; \/\/ default\nArduinoPro_Micro = 2;\n\n\/\/ ArduinoPro Without Programming Port\nArduinoPro_No_Port = 0;\n\n\/\/ Show Header Pins\nArduinoPro_Pins_Normal = 1;\nArduinoPro_Pins_Opposite = 2;\n\n\/\/ ArduinoPro Without Header Pins\nArduinoPro_No_Pins = 0; \/\/ default\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 0.1 * 25.4; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch \/2; \/\/ inset from board edge\nArduinoPro_PCB_Type = 0.047 * 25.4; \/\/ .047 .063 \/\/ standard PCB thickness\nArduinoPro_PCB_Layers = 0.035 * 2; \/\/ total copper layer thickness\nArduinoPro_PCB_Height = ArduinoPro_PCB_Type +\n ArduinoPro_PCB_Layers; \/\/ height of the PCB (along z)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\nmodule ArduinoPro_MicroUSB()\n{\n include \n \/\/ Subtracting `ArduinoPro_PCB_Inset` compansates for board origin\n \/\/-: Not sure if board origin would be better set after creation\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset;\n move_z = ArduinoPro_PCB_Height;\n\n \/\/ Add USB header and move to top of board (along x)\n translate([move_x, move_y, move_z])\n MicroUSB_Receptacle();\n}\n\nmodule ArduinoPro_PCB()\n{\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\nmodule ArduinoPro_Header_Hole()\n{\n \/\/ Standard PCB hole\n holediameter = 1.25; \/\/ diameter of PCB hole\n circle(d = holediameter);\n}\n\nmodule ArduinoPro_Header_Pin(rotation = 0)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n \/\/ Header Pins\n color(\"white\")\n translate([0, 0, -pinoffset])\n linear_extrude(pinheight)\n square(pinwidth, center = true);\n\n \/\/ Pin Spacers\n color(\"black\")\n linear_extrude(spacerheight)\n square(spacerwidth, center = true);\n\n \/\/ Break-Away Material\n color(\"black\")\n \/\/ FIXME: material needs to be rotated based on vector argument\n rotate(rotation, 0, 0)\n translate([0, pcbholepitch\/2, 0])\n linear_extrude(spacerheight)\n square([spacerwidth * 0.85, pcbholepitch - spacerwidth], center = true);\n}\n\nmodule ArduinoPro_Headers_Layout()\n{\n \/\/ distance between the two header rows\n \/\/ FIXME: improve this to be a multiple of 0.1 inch\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) children();\n }\n}\n\nmodule ArduinoPro_Serial_Header_Layout()\n{\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) children();\n }\n}\n\nmodule ArduinoPro_SMT_Components(type = ArduinoPro_Mini)\n{\n \/\/ Distance from origin to middle along y\n datumX = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n datumZ = ArduinoPro_PCB_Height;\n\n \/\/ Controller IC\n color(Grey20)\n translate([datumX, 0.5 * 25.4, datumZ])\n rotate([0,0,45])\n linear_extrude(1)\n square(sqrt(pow(0.4 * 25.4, 2)\/2), center=true);\n\n \/\/ Parts for Pro Mini\n if (type == ArduinoPro_Mini) {\n \/\/ Reset switch\n translate([datumX, 0.05 * 25.4, datumZ])\n {\n color(\"silver\")\n linear_extrude(1.2)\n square([4.5, 4.5], center=true);\n color(\"sandybrown\")\n translate([0, 0, 1.2])\n linear_extrude(0.5)\n circle(d=2.5);\n }\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([datumX, 0.05 * 25.4, datumZ])\n linear_extrude(1)\n {\n \/\/ Red - Power\n translate([0, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ Green - Status\n translate([0.2 * 25.4, 0, 0])\n square([0.7,1.2], center=true);\n }\n\n }\n\n \/\/ Parts for Pro Micro\n if (type == ArduinoPro_Micro) {\n \/\/ Crystal\n color(\"silver\")\n translate([datumX, 0.15 * 25.4, datumZ])\n linear_extrude(1)\n square([5, 3], center=true);\n\n \/\/ RX and TX LEDs\n color(\"white\")\n translate([datumX, 0.2 * 25.4, datumZ])\n linear_extrude(1)\n {\n \/\/ RX - Yellow\n translate([-0.3 * 25.4\/2, 0, 0])\n square([0.7,1.2], center=true);\n \/\/ Power - Red\n translate([-0.15 * 25.4, 0.75 * 25.4, 0])\n square([1.2,0.7], center=true);\n \/\/ TX - Green\n translate([0.3 * 25.4\/2, 0, 0])\n square([0.7,1.2], center=true);\n }\n }\n\n \/\/ Capacitors\n moveY = (type == ArduinoPro_Mini ? 0.9 : 0.8) * 25.4;\n color(\"silver\")\n translate([datumX, moveY, datumZ])\n linear_extrude(2)\n {\n translate([-7.5\/2, 0, 0])\n square([1.5, 3.5], center=true);\n translate([7.5\/2, 0, 0])\n square([1.5, 3.5], center=true);\n }\n\n \/\/ Other components\n color(\"silver\")\n translate([datumX, moveY, datumZ])\n linear_extrude(1)\n {\n square([1, 2.5], center=true);\n translate([0, 3.25, 0])\n square([2.5, 1.5], center=true);\n }\n}\n\nmodule ArduinoPro(type = ArduinoPro_Mini, headerpins = 0, serialpins = 0)\n{\n color(ArduinoPro_PCB_Colour)\n linear_extrude(ArduinoPro_PCB_Height)\n difference() {\n \/\/ Base PCB\n ArduinoPro_PCB();\n\n \/\/ Common Headers for Pro Mini\/Micro\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Hole();\n\n \/\/ Pro Mini Serial Header\n if (type == ArduinoPro_Mini) {\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Hole();\n }\n }\n\n \/\/ Pro Mini Serial Header Pins\n serialontop = (serialpins != ArduinoPro_Pins_Opposite);\n if (serialpins > 0 && type == ArduinoPro_Mini) {\n \/\/ Offset for board height if located on top\n translate([0, 0, serialontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, serialontop ? 0 : 1 ])\n ArduinoPro_Serial_Header_Layout()\n ArduinoPro_Header_Pin(rotation = 90);\n }\n\n \/\/ Common Header Pins\n headerontop = (headerpins == ArduinoPro_Pins_Opposite);\n if (headerpins > 0) {\n \/\/ Offset for board height located on top\n translate([0, 0, headerontop ? ArduinoPro_PCB_Height : 0])\n mirror([0, 0, headerontop ? 0 : 1 ])\n ArduinoPro_Headers_Layout()\n ArduinoPro_Header_Pin();\n }\n\n \/\/ Pro Micro USB port\n if (type == ArduinoPro_Micro) ArduinoPro_MicroUSB();\n\n \/\/ Surface mount components\n ArduinoPro_SMT_Components(type);\n}\n\n\n\n\/\/ Example Usage\n\/\/ ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n\/\/ ArduinoPro(ArduinoPro_Mini, ArduinoPro_Pins_Normal, ArduinoPro_Pins_Normal);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"447b56c60f85bc7f64c9151292ddb59d2975a21f","subject":"adding gantry cart","message":"adding gantry cart\n","repos":"fponticelli\/smallbridges","old_file":"resin\/gantry_cart.scad","new_file":"resin\/gantry_cart.scad","new_contents":"include <..\/scad\/or_gantry_plate.scad>\ninclude <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\nuse <..\/scad\/shim.scad>\n\nmodule gantry_cart(mod = 1) {\n translate([0,0,or_gantry_plate_height\/2])\n or_gantry_plate(mod);\n eccentric_spacers = [[],[2,10]];\n spacers = [[],[1,9]];\n translate([0,0,or_gantry_plate_height]) {\n for(s = eccentric_spacers[mod])\n translate(or_gantry_plate_holes[mod][s][0]) {\n ob_eccentric_spacer();\n translate([0,0,6.85]) {\n precision_shim_10x5x1();\n translate([0,0,ob_wheel_half_width])\n ob_solid_wheel();\n }\n }\n for(s = spacers[mod])\n translate(or_gantry_plate_holes[mod][s][0]) {\n ob_spacer(6.35);\n translate([0,0,6.85]) {\n precision_shim_10x5x1();\n translate([0,0,ob_wheel_half_width])\n ob_solid_wheel();\n }\n }\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'resin\/gantry_cart.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0abe4cab9bb4a134c0a894b369bef87f17cabaa0","subject":"first draft","message":"first draft\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"leszeks_box_update\/cross.scad","new_file":"leszeks_box_update\/cross.scad","new_contents":"cutW=2;\ncutH=4;\nwidth=2*1+cutW;\nheight=3+cutH;\n\ndifference()\n{\n union()\n {\n translate([-width\/2, 0, 0])\n cube([width, 51, height]);\n translate([-67\/2, 31+width, 0])\n rotate([0, 0, -90])\n cube([width, 67, height]);\n }\n translate([-cutW\/2, 0, 3])\n cube([cutW, 51, cutH]);\n translate([-67\/2, 31+1, 3])\n cube([67, cutW, cutH]);\n}\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1d49ba3bdb822c05657f88fb0bab874f03e4a4d7","subject":"Some code tidyups","message":"Some code tidyups\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nmodule BumperModel()\n{\n\t\/\/ Parameters\n\tthickness = dw;\t\t\t\t\/\/ bumper thickness\n\theight = 15;\t\t\t\t\/\/ bumper height\n\toffset = 5;\t\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\t\/\/ Calculated parameters\n\toutr = BaseDiameter\/2 + offset + thickness;\t\t\/\/ outside radius or the bumper\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate([0, 0, wrapAngle\/2])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate([0, 0, -wrapAngle\/2])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0, 1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0, 0, 90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0, 1])\n\t\tmirror([i, 0, 0])\n\t\trotate([0, 0, microSwitchAngle])\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\n\t\/\/ Microswitch plates\n\tfor(i=[0, 1])\n\t\tmirror([i, 0, 0])\n\t\trotate([0, 0, microSwitchAngle])\n\t\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\t\tMicroSwitchPlate();\n}\n\nmodule MicroSwitchPlate()\n{\n\t\/\/ Parameters - todo: pickup from microswitch model?\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Rear support lozenge with pin hole\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\t\/\/ Actual hole\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0, 0, dw])\n\t\tmirror([0, 0, 1])\n\t\t\tpinhole(fixed=true);\n\t}\n}\n","old_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = dw;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0,1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0,0,90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\t}\n\n\t\/\/ Microswitch plates\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\tMicroSwitchPlate();\n\t\n}\n\n\nmodule MicroSwitchPlate()\n{\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Pin section\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0,0,dw])\n\t\tmirror([0,0,1])\n\t\t\tpinhole(fixed=true);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"16ed73f04091d2baed27392207d6df2d807ebdd3","subject":"zaxis\/motormount: use new screw_cut","message":"zaxis\/motormount: use new screw_cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-upper-gantry-connector.scad","new_file":"z-axis-upper-gantry-connector.scad","new_contents":"include \n\nmodule zaxis_upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-.1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n screw_cut(zmotor_mount_clamp_nut, h=200, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size+gantry_connector_thickness])\n \/*#cubea(align=[0,0,1])*\/\n\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, 0])\n {\n screw_cut(extrusion_nut, h=gantry_connector_thickness+.1, nut_offset=true, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","old_contents":"include \n\nmodule zaxis_upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*2,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia*1.05, h=zmotor_mount_clamp_nut_thick*1.05, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/4, 0, 0])\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*extrusion_thread_dia*2, y*main_upper_dist_y\/2, -1])\n {\n fncylindera(d=extrusion_thread_dia, h=100, orient=[0,0,1], align=[1,0,1]);\n }\n }\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\/*rotate([0,180,0])*\/\n\/*zaxis_upper_gantry_zrod_connector();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"fcf6cc065d9cadb9cc46fea3e39a315ebc16ca9f","subject":"Changed calls to child() to children()","message":"Changed calls to child() to children()\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/utils\/obiscad\/attach.scad","new_file":"hardware\/utils\/obiscad\/attach.scad","new_contents":"\/\/---------------------------------------------------------------\n\/\/-- Openscad Attachment library\n\/\/-- Attach parts easily. Make your designs more reusable and clean\n\/\/---------------------------------------------------------------\n\/\/-- This is a component of the obiscad opescad tools by Obijuan\n\/\/-- (C) Juan Gonzalez-Gomez (Obijuan)\n\/\/-- Sep-2012\n\/\/---------------------------------------------------------------\n\/\/-- Released under the GPL license\n\/\/---------------------------------------------------------------\n\nuse \n\n\/\/ default connector\nDefCon = [[0,0,0],[0,0,1],0,0,0];\n\n\n\/\/ Connector getter functions\n\nfunction connector_translation(c) \t= c[0];\nfunction connector_axis(c) \t\t \t= c[1];\nfunction connector_ang(c) \t\t\t= c[2];\nfunction connector_thickness(c) \t= c[3];\t \/\/ the thickness of the mounting point\nfunction connector_bore(c) \t\t\t= c[4]; \/\/ the required diameter of a fixing\n \n\n\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , v, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c,clr=\"Gray\")\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n \n translate(p)\n rotate(a=ang, v=v)\n color(clr) vector(unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a,b)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n roll = a[2]; \/\/-- Rolling angle\n \n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n \/\/-- The rolling angle of the attachable part is not used\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n \/\/raxis = cross(vref,v);\n raxis = v[0]==vref[0] && v[1]==vref[1] ? [0,1,0] : cross(vref,v);\n \n \/\/-- Calculate the angle between the vectors\n ang = anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n for (i=[0:$children-1])\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n\t\tchildren(i);\n}\n\n\nmodule attachWithOffset(a,b,o) {\n\t\/\/ offsets attachment point on a by o\n\t\n\tnewa = [\n\t\t[\n\t\t\ta[0][0] + o[0],\n\t\t\ta[0][1] + o[1],\n\t\t\ta[0][2] + o[2]\n\t\t],\n\t\ta[1],\n\t\ta[2]\n\t];\n\t\n\tfor (i=[0:$children-1])\n\t\tattach(newa,b) children(i);\n}\n \n\n\/\/ threads along neg z axis, starting at z=0 with first part\n\/\/ up to 12 children\nmodule threadTogether(a) {\n\techo($children);\n\tchildren(0);\n\tif ($children>1)\n\t\ttranslate([0,0,-a[0]]) \n\t\tchildren(1);\n\tif ($children>2)\n\t\ttranslate([0,0,-a[0]-a[1]]) \n\t\tchildren(2);\n\tif ($children>3)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]]) \n\t\tchildren(3);\n\tif ($children>4)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]]) \n\t\tchildren(4);\n\tif ($children>5)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]]) \n\t\tchildren(5);\n\tif ($children>6)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]]) \n\t\tchildren(6);\n\tif ($children>7)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]]) \n\t\tchildren(7);\n\tif ($children>8)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]]) \n\t\tchildren(8);\n\tif ($children>9)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]-a[8]]) \n\t\tchildren(9);\n\tif ($children>10)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]-a[8]-a[9]]) \n\t\tchildren(10);\n\tif ($children>11)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]-a[8]-a[9]-a[10]]) \n\t\tchildren(11);\n}\n","old_contents":"\/\/---------------------------------------------------------------\n\/\/-- Openscad Attachment library\n\/\/-- Attach parts easily. Make your designs more reusable and clean\n\/\/---------------------------------------------------------------\n\/\/-- This is a component of the obiscad opescad tools by Obijuan\n\/\/-- (C) Juan Gonzalez-Gomez (Obijuan)\n\/\/-- Sep-2012\n\/\/---------------------------------------------------------------\n\/\/-- Released under the GPL license\n\/\/---------------------------------------------------------------\n\nuse \n\n\/\/ default connector\nDefCon = [[0,0,0],[0,0,1],0,0,0];\n\n\n\/\/ Connector getter functions\n\nfunction connector_translation(c) \t= c[0];\nfunction connector_axis(c) \t\t \t= c[1];\nfunction connector_ang(c) \t\t\t= c[2];\nfunction connector_thickness(c) \t= c[3];\t \/\/ the thickness of the mounting point\nfunction connector_bore(c) \t\t\t= c[4]; \/\/ the required diameter of a fixing\n \n\n\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , v, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c,clr=\"Gray\")\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment poing\n color(\"Gray\") point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n \n translate(p)\n rotate(a=ang, v=v)\n color(clr) vector(unitv(v)*6, l_arrow=2, mark=true);\n}\n\n\n\/\/-------------------------------------------------------------------------\n\/\/-- ATTACH OPERATOR\n\/\/-- This operator applies the necesary transformations to the \n\/\/-- child (attachable part) so that it is attached to the main part\n\/\/-- \n\/\/-- Parameters\n\/\/-- a -> Connector of the main part\n\/\/-- b -> Connector of the attachable part\n\/\/-------------------------------------------------------------------------\nmodule attach(a,b)\n{\n \/\/-- Get the data from the connectors\n pos1 = a[0]; \/\/-- Attachment point. Main part\n v = a[1]; \/\/-- Attachment axis. Main part\n roll = a[2]; \/\/-- Rolling angle\n \n pos2 = b[0]; \/\/-- Attachment point. Attachable part\n vref = b[1]; \/\/-- Atachment axis. Attachable part\n \/\/-- The rolling angle of the attachable part is not used\n\n \/\/-------- Calculations for the \"orientate operator\"------\n \/\/-- Calculate the rotation axis\n \/\/raxis = cross(vref,v);\n raxis = v[0]==vref[0] && v[1]==vref[1] ? [0,1,0] : cross(vref,v);\n \n \/\/-- Calculate the angle between the vectors\n ang = anglev(vref,v);\n \/\/--------------------------------------------------------.-\n\n \/\/-- Apply the transformations to the child ---------------------------\n\n for (i=[0:$children-1])\n \/\/-- Place the attachable part on the main part attachment point\n translate(pos1)\n \/\/-- Orientate operator. Apply the orientation so that\n \/\/-- both attachment axis are paralell. Also apply the roll angle\n rotate(a=roll, v=v) rotate(a=ang, v=raxis)\n \/\/-- Attachable part to the origin\n translate(-pos2)\n\t\tchild(i);\n}\n\n\nmodule attachWithOffset(a,b,o) {\n\t\/\/ offsets attachment point on a by o\n\t\n\tnewa = [\n\t\t[\n\t\t\ta[0][0] + o[0],\n\t\t\ta[0][1] + o[1],\n\t\t\ta[0][2] + o[2]\n\t\t],\n\t\ta[1],\n\t\ta[2]\n\t];\n\t\n\tfor (i=[0:$children-1])\n\t\tattach(newa,b) child(i);\n}\n \n\n\/\/ threads along neg z axis, starting at z=0 with first part\n\/\/ up to 12 children\nmodule threadTogether(a) {\n\techo($children);\n\tchild(0);\n\tif ($children>1)\n\t\ttranslate([0,0,-a[0]]) \n\t\tchild(1);\n\tif ($children>2)\n\t\ttranslate([0,0,-a[0]-a[1]]) \n\t\tchild(2);\n\tif ($children>3)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]]) \n\t\tchild(3);\n\tif ($children>4)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]]) \n\t\tchild(4);\n\tif ($children>5)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]]) \n\t\tchild(5);\n\tif ($children>6)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]]) \n\t\tchild(6);\n\tif ($children>7)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]]) \n\t\tchild(7);\n\tif ($children>8)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]]) \n\t\tchild(8);\n\tif ($children>9)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]-a[8]]) \n\t\tchild(9);\n\tif ($children>10)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]-a[8]-a[9]]) \n\t\tchild(10);\n\tif ($children>11)\n\t\ttranslate([0,0,-a[0]-a[1]-a[2]-a[3]-a[4]-a[5]-a[6]-a[7]-a[8]-a[9]-a[10]]) \n\t\tchild(11);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ffdbbe8c6585412b84fa03f4e09befba8e98a6c3","subject":"hut version draft","message":"hut version draft\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_contents":"use \n\nmodule cover_shape()\n{\n h1=5;\n polyhedron(\n points = [\n [55, 0, 0], \/\/ 0\n [55, 0, h1], \/\/ 1\n [55, 45, h1], \/\/ 2\n [55, 45, 0], \/\/ 3\n [ 0, 45, h1], \/\/ 4\n [ 0, 45, 0], \/\/ 5\n [ 0, 0, 0], \/\/ 6\n [ 0, 0, h1], \/\/ 7\n [55\/2,0, 30], \/\/ 8\n [55\/2,40,30] \/\/ 9\n ], \n faces = [\n [0,1,2],\n [0,2,3],\n [5,2,4],\n [2,5,3],\n [7,6,4],\n [5,4,6],\n [4,8,7],\n [9,8,4],\n [4,2,9],\n [1,8,9],\n [1,9,2],\n ]\n );\n}\n\nmodule cover()\n{\n extra_size = 2;\n minkowski()\n {\n cube(extra_size*[1,1,1]);\n cover_shape();\n }\n}\n\n%translate([18, 0, 0])\n closet_hinge();\ncover();","old_contents":"use \n\nmodule shell(extra_size)\n{\n cube_size=100;\n\n difference()\n {\n resize([60, 60, 70] + extra_size*[1,1,1])\n sphere(r=25);\n \/\/ front cut\n translate(cube_size*[-1\/2, -1, -1\/2] + [0, -20, 0])\n cube(cube_size*[1,1,1]);\n \/\/ bottom cut\n translate(cube_size*[-1\/2, -1\/2, -1])\n cube(cube_size*[1,1,1]);\n }\n}\n\n\nmodule cover()\n{\n difference()\n {\n shell(3);\n shell(0);\n }\n}\n\n\n%translate([-21\/2, -41\/2, 0])\n closet_hinge();\ncover();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"54149d7f9458751dd99da1a43a3d0430210f5784","subject":"The holes for the resistor leads were made larger.","message":"The holes for the resistor leads were made larger.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/resistor-stand\/resistor-stand.scad","new_file":"OpenSCAD\/resistor-stand\/resistor-stand.scad","new_contents":"\r\nresisitorStand();\r\n\r\nmodule resisitorStand()\r\n{\r\n resistorHolder();\r\n}\r\n\r\nmodule resistorHolder(baseLengthX = 24,\r\n baseLengthY = 15,\r\n baseLengthZ = 5,\r\n \r\n towerLengthX = 6,\r\n towerLengthY = 15,\r\n towerLengthZ = 21)\r\n{\r\n difference()\r\n {\r\n resistorHolderUnion(baseLengthX,\r\n baseLengthY ,\r\n baseLengthZ ,\r\n \r\n towerLengthX,\r\n towerLengthY,\r\n towerLengthZ);\r\n \r\n shafts();\r\n }\r\n\r\n}\r\n\r\nmodule resistorHolderUnion(baseLengthX,\r\n baseLengthY ,\r\n baseLengthZ ,\r\n \r\n towerLengthX,\r\n towerLengthY,\r\n towerLengthZ)\r\n{\r\n union()\r\n {\r\n base(xLength=baseLengthX,\r\n yLength=baseLengthY,\r\n zLength=baseLengthZ);\r\n \r\n for ( i = [0 : 1] )\r\n {\r\n xIncrement = (towerLengthX\/4.0) + 10;\r\n xTranslate = i * xIncrement;\r\n translate([xTranslate, 0, 0])\r\n tower(xLength=towerLengthX,\r\n yLength=towerLengthY,\r\n zLength=towerLengthZ); \r\n }\r\n } \r\n}\r\n\r\nmodule shaft(xLength, zLength)\r\n{\r\n cylinder (h = 130, \r\n r=1.6, \r\n $fn=100\r\n ); \r\n}\r\n\r\nmodule shafts()\r\n{\r\n \r\n}\r\n\r\nmodule tower(xLength, yLength, zLength)\r\n{\r\n difference()\r\n {\r\n cube([xLength, yLength, zLength]);\r\n \r\n color(\"blue\")\r\n rotate([-20, 0, 0])\r\n translate([xLength,\/\/xLength\/2.0,\r\n -1,\r\n -10])\r\n shaft(xLength, zLength);\r\n } \r\n}\r\n\r\nmodule base(xLength, yLength, zLength)\r\n{\r\n cube([xLength, yLength, zLength]);\r\n}\r\n","old_contents":"\r\nresisitorStand();\r\n\r\nmodule resisitorStand(baseLengthX = 24,\r\n baseLengthY = 15,\r\n baseLengthZ = 5,\r\n \r\n towerLengthX = 6,\r\n towerLengthY = 15,\r\n towerLengthZ = 25)\r\n{\r\n union()\r\n {\r\n base(xLength=baseLengthX,\r\n yLength=baseLengthY,\r\n zLength=baseLengthZ);\r\n \r\n for ( i = [0 : 1] )\r\n {\r\n xIncrement = (towerLengthX\/4.0) + 10;\r\n xTranslate = i * xIncrement;\r\n translate([xTranslate, 0, 0])\r\n tower(xLength=towerLengthX,\r\n yLength=towerLengthY,\r\n zLength=towerLengthZ); \r\n }\r\n }\r\n}\r\n\r\nmodule shaft(xLength, zLength)\r\n{\r\n cylinder (h = 130, \r\n r=0.8, \r\n $fn=100\r\n ); \r\n}\r\n\r\nmodule tower(xLength, yLength, zLength)\r\n{\r\n difference()\r\n {\r\n cube([xLength, yLength, zLength]);\r\n \r\n color(\"blue\")\r\n \r\n rotate([-25, 0, 0])\r\n \r\n translate([xLength\/2.0,\r\n -2,\r\n 0])\r\n \r\n shaft(xLength, zLength);\r\n } \r\n}\r\n\r\nmodule base(xLength, yLength, zLength)\r\n{\r\n cube([xLength, yLength, zLength]);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a861c34662b6f06197379dab957f2a9a04d9dfcb","subject":"model of the element for holding string to troley","message":"model of the element for holding string to troley\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"buggy_troley_lift_lock\/lift_lock.scad","new_file":"buggy_troley_lift_lock\/lift_lock.scad","new_contents":"eps = 0.01;\nspacing = 0.5;\nd = 13;\ndh = 8;\n\nx_raw = 30.9;\ny_raw = 22.9;\nz_raw = 8.2;\nx = x_raw - 2*spacing;\ny = y_raw + dh + dh\/2;\nz = z_raw - 2*spacing;\n\ncut = (x - d)\/2;\necho(cut);\n\ndifference()\n{\n cube([x, y, z]);\n for(dx=[0, x-cut])\n translate([dx, y_raw, -eps])\n #cube([cut, dh, z + 2*eps]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'buggy_troley_lift_lock\/lift_lock.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"459f24789560e7ed8cc3d508e441a166b4011dd8","subject":"LCD's PCB hole gained extra 1mm on OY to squeeze in more smoothly","message":"LCD's PCB hole gained extra 1mm on OY to squeeze in more smoothly\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \ninclude \n\nmodule front()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+2, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n {\n cylinder(r=(16+2)\/2, h=boxSize[2], $fs=1);\n translate([0, 0, 0])\n cylinder(r=(16+10)\/2, h=boxSize[2]\/2, $fs=1);\n }\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=(3+2)\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ LCD mounting drills\n translate(lcdOffset)\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=(3+2)\/2, h=20, $fs=1);\n }\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+4])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=(5+2)\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}\n\nrotate([180, 0, 0])\n front();\n","old_contents":"use \nuse \nuse \nuse \nuse \nuse \ninclude \n\nmodule front()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n {\n cylinder(r=(16+2)\/2, h=boxSize[2], $fs=1);\n translate([0, 0, 0])\n cylinder(r=(16+10)\/2, h=boxSize[2]\/2, $fs=1);\n }\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=(3+2)\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ LCD mounting drills\n translate(lcdOffset)\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=(3+2)\/2, h=20, $fs=1);\n }\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+4])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=(5+2)\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}\n\nrotate([180, 0, 0])\n front();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a4cca5f5315c8e53d0855bb20114d9c89355ca2a","subject":"added proper oring slot + calibrated parameters to tight-fit into the bottle's nozzle","message":"added proper oring slot + calibrated parameters to tight-fit into the bottle's nozzle\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/adapter_nozzle.scad","new_file":"water_rocket_launcher\/adapter_nozzle.scad","new_contents":"use \n\nmodule oring(d_in, d_r)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n}\n\nmodule oring_slot(d_in, d_r, d_ext, d_r_ext)\n{\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n hull()\n {\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n translate([d_ext\/2+d_r_ext\/2, 0, 0])\n circle(d=d_r_ext, $fn=fn(40));\n }\n}\n\n\nmodule nozzle()\n{\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n {\n difference()\n {\n cylinder(d=21, h=10, $fn=fn(200));\n translate([0, 0, 6])\n {\n d_in = 17-0.5;\n d_r = 2.5;\n oring_slot(d_in=d_in, d_r=d_r, d_ext=d_in+1.5, d_r_ext=d_r+0.75);\n %oring(d_in=d_in, d_r=d_r);\n }\n }\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\n\/\/rotate([180, 0, 0])\nintersection()\n{\n translate([0, 0, 54.5])\n cube([50, 50, 20], center=true);\n nozzle();\n}\n\n\/\/oring_slot(d_in=17-0.25, d_r=2.5, d_ext=20, d_r_ext=3);\n","old_contents":"use \n\nmodule nozzle()\n{\n module oring(d_in, d_r)\n {\n rotate_extrude(angle=360, convexity=20, $fn=fn(120))\n translate([d_in\/2+d_r\/2, 0, 0])\n circle(d=d_r, $fn=fn(40));\n }\n\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n {\n difference()\n {\n cylinder(d1=21, d2=20, h=10, $fn=fn(200));\n translate([0, 0, 6])\n oring(d_in=17+1.5, d_r=2.5+0.5);\n }\n }\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nrotate([180, 0, 0])\n nozzle();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1ea065c8ccde0a7ea8a688bfb2e3fb981c1e72d4","subject":"added both elements to be printed symetrical","message":"added both elements to be printed symetrical\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"buggy_troley_mount\/buggy_troley_mount.scad","new_file":"buggy_troley_mount\/buggy_troley_mount.scad","new_contents":"r_mount=(28.8+2*2.1)\/2;\nh=20;\neps=0.01;\n\nmodule mount_rod_space()\n{\n translate([0, 0, -eps])\n cylinder(r=r_mount, h=h+2*eps, $fn=180);\n}\n\n\nmodule body_core()\n{\n \/\/ main rod with mounts\n rotate([0, 0, 180-30])\n {\n \/\/ main block\n hull()\n for(dx=[0, 90])\n translate([dx, 0, 0])\n cylinder(r=30\/2, h=h);\n \/\/ support rods\n for(dx=[0, 29.5, 60.5])\n translate([90-dx, 0, h])\n cylinder(r=10.5\/2, h=30, $fn=50);\n }\n \/\/ rod_slot\n difference()\n {\n \/\/ main block\n union()\n {\n cylinder(r=30\/2, h=h);\n translate([-35, -50, 0])\n cube([50, 50, h]);\n \/\/ stubbing hole, between two elements\n translate([-35, 0, 0])\n cube([20, 10, h]);\n }\n \/\/ screw hole\n translate([-35-eps, -42, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=50+2*eps, $fn=50);\n \/\/ place for bottom block\n translate([-20\/2-r_mount, -20-40, -eps])\n cube([r_mount*2, 40, h+2*eps]);\n }\n}\n\n\nmodule buggy_troley_closure()\n{\n dy=30;\n difference()\n {\n cube([r_mount*2, dy, h]);\n translate([r_mount, dy, 0])\n mount_rod_space();\n translate([-eps-10, 8, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=55+2*eps, $fn=50);\n }\n}\n\n\nmodule buggy_troley_mount()\n{\n difference()\n {\n body_core();\n translate([-20\/2, -20, 0])\n mount_rod_space();\n }\n}\n\n\n\nfor(pos=[[0,0,0], [180,1,35]])\n translate([pos[2], 0, 0])\n rotate([0, pos[0], 0])\n mirror([0, 0, pos[1]])\n {\n buggy_troley_mount();\n %translate([-20\/2-r_mount, -50, 0])\n buggy_troley_closure();\n\n translate([-75, -30, 0])\n buggy_troley_closure();\n }\n","old_contents":"r_mount=(28.8+2*2.1)\/2;\nh=20;\neps=0.01;\n\nmodule mount_rod_space()\n{\n translate([0, 0, -eps])\n cylinder(r=r_mount, h=h+2*eps, $fn=180);\n}\n\n\nmodule body_core()\n{\n \/\/ main rod with mounts\n rotate([0, 0, 180-30])\n {\n \/\/ main block\n hull()\n for(dx=[0, 90])\n translate([dx, 0, 0])\n cylinder(r=30\/2, h=h);\n \/\/ support rods\n for(dx=[0, 29.5, 60.5])\n translate([90-dx, 0, h])\n cylinder(r=10.5\/2, h=30, $fn=50);\n }\n \/\/ rod_slot\n difference()\n {\n \/\/ main block\n union()\n {\n cylinder(r=30\/2, h=h);\n translate([-35, -50, 0])\n cube([50, 50, h]);\n \/\/ stubbing hole, between two elements\n translate([-35, 0, 0])\n cube([20, 10, h]);\n }\n \/\/ screw hole\n translate([-35-eps, -42, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=50+2*eps, $fn=50);\n \/\/ place for bottom block\n translate([-20\/2-r_mount, -20-40, -eps])\n cube([r_mount*2, 40, h+2*eps]);\n }\n}\n\n\nmodule buggy_troley_closure()\n{\n dy=30;\n difference()\n {\n cube([r_mount*2, dy, h]);\n translate([r_mount, dy, 0])\n mount_rod_space();\n translate([-eps-10, 8, h\/2])\n rotate([0, 90, 0])\n cylinder(r=3.5\/2, h=55+2*eps, $fn=50);\n }\n}\n\n\nmodule buggy_troley_mount()\n{\n difference()\n {\n body_core();\n translate([-20\/2, -20, 0])\n mount_rod_space();\n }\n}\n\n\nbuggy_troley_mount();\n%translate([-20\/2-r_mount, -50, 0])\n buggy_troley_closure();\n\ntranslate([-75, -30, 0])\n buggy_troley_closure();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1d66a4a5fb0f7898fc795bd24238f6af580c5bbf","subject":"model of a single mount for a loudspeaker","message":"model of a single mount for a loudspeaker\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"loudspeaker_mount\/loudspeaker_mount.scad","new_file":"loudspeaker_mount\/loudspeaker_mount.scad","new_contents":"eps=0.1;\n\nmodule mount()\n{\n wall=5;\n screw_d=4;\n ls_dim=[236+1, 162+1];\n ls_border=11.6-2;\n mount_len=60;\n mount_size=[30, 2*wall, mount_len+wall];\n\n module body_mount()\n {\n difference()\n {\n cube([ls_dim[0]+2*wall, ls_dim[1]+1*wall, mount_len+wall]);\n translate(wall*[1,1,1])\n cube([ls_dim[0], ls_dim[1]+eps, mount_len+eps]);\n translate(wall*[2,2,0]-[0,0,eps])\n cube([ls_dim[0]-2*wall, ls_dim[1]-1*wall+eps, wall+2*eps]);\n }\n }\n\n module screw_mount()\n {\n module screw()\n {\n rotate([-90, 0, 0])\n union()\n {\n $fn=50;\n cylinder(r1=(2*screw_d)\/2, r2=screw_d\/2, h=5);\n translate([0, 0, 5-eps])\n cylinder(r=screw_d\/2, h=5+eps+10);\n }\n }\n\n translate([-mount_size[0], 0, 0])\n difference()\n {\n cube(mount_size);\n for(i=[-1,0,+1])\n translate([mount_size[0]\/2, -eps, mount_size[2]\/2+i*18])\n screw();\n }\n }\n\n body_mount();\n for(i=[0,1])\n translate([i*(ls_dim[0]+2*wall+mount_size[0]), ls_dim[1]-wall, 0])\n screw_mount();\n}\n\nmount();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'loudspeaker_mount\/loudspeaker_mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"ef0f6a78f612426af9a0fa7db44f1384db9a4e98","subject":"zaxis\/motorount: tweaks, increase clamp nut holder tolerances","message":"zaxis\/motorount: tweaks, increase clamp nut holder tolerances\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-motor-mount.scad","new_file":"z-axis-motor-mount.scad","new_contents":"include \ninclude \n\nuse \n\ninclude \ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.3, zmotor_mount_clamp_nut_dia*1.1, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n translate([-zmotor_mount_clamp_nut_thick*1.3\/2,0,0])\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n\/*print = true;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*rotate([0,-90,0])*\/\n \/*zaxis_motor_mount();*\/\n\n \/*translate([-25,0,zmotor_mount_thickness_h\/2])*\/\n \/*mount_rod_clamp_half(*\/\n \/*rod_d=zaxis_rod_d,*\/\n \/*screw_dist=zmotor_mount_clamp_dist,*\/\n \/*thick=5,*\/\n \/*base_thick=5,*\/\n \/*width=zmotor_mount_thickness_h,*\/\n \/*thread=zmotor_mount_clamp_thread);*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"11a638a525069d28c6b3a8ddfadb4570c3e9f3a5","subject":"Need a little extra padding for my table","message":"Need a little extra padding for my table\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 4;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You can inscribe something here. I print the box at lower resolution (.3mm), it\n \/\/ comes out OK but not very good looking. Higher res looks better.\n \/\/ name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"YourTextHere\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You can inscribe something here. I print the box at lower resolution (.3mm), it\n \/\/ comes out OK but not very good looking. Higher res looks better.\n \/\/ name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"YourTextHere\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a76dba9fb67e59dd08a3b5d3ab5edb389f2bc9eb","subject":"y\/motormount: define parts","message":"y\/motormount: define parts\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-motor-mount.scad","new_file":"y-axis-motor-mount.scad","new_contents":"include \ninclude \n\nuse \ninclude \ninclude \ninclude \n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nyaxis_motor_pulley_h = 17.5*mm;\nyaxis_motor_mount_bearing_clamp_offset_z = yaxis_motor_pulley_h;\n\nmodule yaxis_motor_mount_bearing_clamp(align=[0,0,0])\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=[0,0,1], align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n cylindera(h=height, d=3*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=[0,0,1]);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=[1,0,0], align=[0,0,0])\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=[0,0,1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=[0,0,1], align=[0,0,0]);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=[1,0,0]\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,8*mm])\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[1,0,0]])\n {\n yaxis_motor_mount(show_motor=false);\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","old_contents":"include \ninclude \n\nuse \ninclude \ninclude \ninclude \n\nyaxis_motor_mount_conn = [[0,0,+extrusion_size\/2+yaxis_motor_offset_z],[1,0,0]];\nyaxis_motor_mount_conn_motor = [[+yaxis_motor_offset_x, 0,+extrusion_size\/2+yaxis_motor_offset_z],[0,0,1]];\n\nymotor_w = lookup(NemaSideSize, yaxis_motor);\nymotor_h = lookup(NemaLengthLong, yaxis_motor);\nymotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nymotor_mount_h = main_lower_dist_z+extrusion_size+yaxis_motor_offset_z;\nymotor_mount_width = ymotor_w+ymotor_mount_thickness*2 + ymotor_mount_thread_dia*8;\n\nyaxis_motor_pulley_h = 17.5*mm;\nyaxis_motor_mount_bearing_clamp_offset_z = yaxis_motor_pulley_h;\n\nmodule yaxis_motor_mount_bearing_clamp(align=[0,0,0])\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=[0,0,1], align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n cylindera(h=height, d=3*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=[0,0,1]);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=[1,0,0], align=[0,0,0])\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n cubea([width, depth, height], align=[0,0,1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=[0,0,1], align=[0,0,0]);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n translate([ymotor_mount_thickness,0,extrusion_size\/2])\n {\n \/*translate([ymotor_w\/2,0,ymotor_mount_thickness_h+yaxis_motor_mount_bearing_clamp_offset_z+1])*\/\n \/*yaxis_motor_mount_bearing_clamp(align=[0,0,-1]);*\/\n\n translate([ymotor_w\/2,0,0])\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=[1,0,0]);\n }\n\n translate([0,0,extrusion_size\/2])\n {\n difference()\n {\n \/\/ reinforcement plate between motor and extrusion\n cubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extrasize=[0,0,ymotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n }\n }\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=[1,0,0]\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n cubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=[1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n translate([0,0,-main_lower_dist_z])\n {\n difference()\n {\n cubea([ymotor_mount_thickness, ymotor_w, extrusion_size], align=[1,0,0]);\n\n for(i=[0])\n translate([0, i*(ymotor_w\/2+ymotor_mount_thread_dia*3), 0])\n cylindera(h=ymotor_mount_thickness*3,d=ymotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n }\n\n }\n\n }\n\n\n if(show_motor)\n {\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[0,0,0]])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,8*mm])\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule print_yaxis_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[[0,0,0],[1,0,0]])\n {\n yaxis_motor_mount(show_motor=false);\n }\n}\n\n\/*yaxis_motor_mount(show_motor=true);*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"08d3d1993d731a99390c7534dda4008b89d273ad","subject":"added platform and mounting tabs","message":"added platform and mounting tabs\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\ntranslate([0,0,7.8]) payloadPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\n%for(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=1.5; \/\/ offset for tab\ntabSep=40; \/\/ distance between tab centers\nmodule tab() cylinder(r1=3,r2=2,h=6,$fn=3);\n\nmodule payloadPlatform() difference() {\n payloadPlatformShell();\n payloadPlatformCutouts();\n}\n\nmodule payloadPlatformCutouts() {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) translate([x*45,y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(2) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n\/\/r1=hr+1.1; r2=hr-.4; \n ch=thick+2; dz=-1.6; \n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-5:5]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.6,h=6,$fn=6,center=true); \n\n\n\nmodule payloadPlatformShell() {\n intersection() {\n difference() {\n cube([100,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(1.1) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*46,y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-34; \/\/ L286 module mount platform offset\n union() {\n for (x=[-1,1]) \/\/hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n \/\/translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4); }\n\n hull() { \/\/ top bar\n translate([0,5,2]) cube([2*axisSep,.5,4],center=true);\n cube([2*axisSep,1,1],center=true);\n }\n\n translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*axisSep,0,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*28,platOff,2]) scale([1,2,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*axisSep,0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*25,platOff,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n for(x=[-tabSep,0,tabSep]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab();\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.2; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nlayer1bias = 0.4;\nplatformHeight = 45; \/\/ from bar to top platform\nmountHeight=15; \/\/ from bar to electronics platform\nPCBwidth=43;\nHoleInset=3;\n\nthick=5;\nt2=thick\/2;\n\nsf = 16; \/\/ sphere faces\n\ndifference() {\n payloadMount(Bx,Bhole,PCBwidth,HoleInset,PCBhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\/\/translate([0,20,0]) L298mount();\n\nthinWall=0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\nmodule L298mount() intersection() { cube([99,99,4],center=true); \n \n difference() {\n union() {\n hull() {\n cube([36,1,4],center=true);\n for(x=[-1,1]) translate([x*27,17,0])\n scale([5,5,3]) sphere(1,$fn=24);\n }\n }\n\n translate([0,20,0]) scale([16,11,4]) sphere(1,$fn=60);\n\n difference() {\n union() {\n \/\/%scale([6,3,4]) sphere(1,$fn=36);\n\n for(x=[-1,1]) {\n translate([x*(PCBwidth\/2-HoleInset),18,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n translate([x*27,17,-4]) cylinder(r=1.6,h=9,$fn=15);\n translate([x*16,8,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*23,10,-4]) rotate([0,0,30]) cylinder(r=2,h=9,$fn=6);\n translate([x*20.5,6,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*17,4,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*13,5,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n translate([x*9,4,-4]) rotate([0,0,30]) cylinder(r=2,h=9,$fn=6);\n translate([x*5,4,-4]) rotate([0,0,30]) cylinder(r=1.5,h=9,$fn=6);\n }\n }\n %cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\n\n\n\n\nmodule payloadMount(axisSep,axisRad,platWidth,dHole,rHole) {\n \/\/difference() {\n union() {\n \/\/%braceBar(axisSep,axisRad);\n for (x=[-1,1]) hull() {\n translate([x*axisSep,0,0])\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n translate([x*(axisSep-14),0,0]) cylinder(r=0.4,h=1,$fn=4);\n }\n hull() {\n translate([0,5,2]) cube([2*axisSep,.5,4],center=true);\n cube([2*axisSep,1,1],center=true);\n }\n\n translate([0,-34,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) hull() { \/\/ main side braces\n translate([x*axisSep,0,5]) scale([.6,.6,4]) sphere(1,$fn=16);\n translate([x*axisSep,0,0]) cube([2,2,1],center=true);\n translate([x*18,-34,0]) cube([4,4,1],center=true);\n translate([x*27,-34,8]) sphere(0.6,$fn=12);\n }\n\n *for(x=[-1,1]) hull() { \/\/ secondary supports\n translate([x*1 , 4 ,0.5]) scale([3,1,1]) sphere(1,$fn=16);\n translate([x*16,-34,0.5]) scale([2,1,1]) sphere(1,$fn=16);\n }\n\n }\n \/\/}\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e73898d1a76b6e05b5a763bb648e2d4ada251af1","subject":"x\/carriage: fix hotend cutout","message":"x\/carriage: fix hotend cutout\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2-2*mm])\n rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=ZAXIS+XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8b7a238d30b0f19da84d517c4253bdbfcb841536","subject":"x\/end: fix teardrop roll","message":"x\/end: fix teardrop roll\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=X, align=[-1,0,0]);\n\n \/\/ endstops mount support\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ z axis bearing support\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n intersection()\n {\n rcylindera(h=h, d=d, orient=Z, align=N);\n rcubea(size=[d,d,h], orient=Z, align=xaxis_z_bearing_mount_dir);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n rcubea(size=[d,d,h], orient=Z, align=-xaxis_z_bearing_mount_dir);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=Z, align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n translate(-xaxis_zaxis_distance_y*Y)\n for(z=[-1,1])\n translate(z*(xaxis_end_wz\/2-2*mm)*Z)\n {\n linear_bearing_mount(\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=-z*Z,\n with_zips=true\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=-Y, roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"use \nuse \nuse \nuse \nuse \n\ninclude \ninclude \n\ninclude \n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing_OD + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=X, align=[-1,0,0]);\n\n \/\/ endstops mount support\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ z axis bearing support\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n intersection()\n {\n rcylindera(h=h, d=d, orient=Z, align=N);\n rcubea(size=[d,d,h], orient=Z, align=xaxis_z_bearing_mount_dir);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n rcubea(size=[d,d,h], orient=Z, align=-xaxis_z_bearing_mount_dir);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=Z, align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n proj_extrude_axis(axis=Z, offset=xaxis_end_wz\/2)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n translate(-xaxis_zaxis_distance_y*Y)\n for(z=[-1,1])\n translate(z*(xaxis_end_wz\/2-2*mm)*Z)\n {\n linear_bearing_mount(\n bearing=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=-z*Z,\n with_zips=true\n );\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=-Y, roll=0, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"8031ad424b3193dc788385e2d3224c899997c181","subject":"updated m3d\/ lib to include more Mx screw heads","message":"updated m3d\/ lib to include more Mx screw heads\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roll_handle\/m3d\/screw_head_hex.scad","new_file":"kite_roll_handle\/m3d\/screw_head_hex.scad","new_contents":"\/\/ generic hex-sided screw head.\n\/\/ y - distance between parallel edges (often denotated as 'd' in specs)\n\/\/ h - height of the head\nmodule screw_head_hex(y, h)\n{\n a = 120;\n x = y\/2 * 1\/sin(a\/2);\n for(r=[0, 120, 240])\n rotate([0, 0, r])\n translate(-1\/2*[x, y, 0])\n cube([x, y, h]);\n}\n\n\/\/\n\/\/ M2-M12 sizes, based on ISO 4032 norm\n\/\/\n\n\/\/ M2 screw head, with optional extra spacing\nmodule screw_head_hex_m2(dy=0, dh=0)\n{\n screw_head_hex(y=4+dy, h=1.35+dh);\n}\n\n\/\/ M3 screw head, with optional extra spacing\nmodule screw_head_hex_m3(dy=0, dh=0)\n{\n screw_head_hex(y=5.5+dy, h=2.5+dh);\n}\n\n\/\/ M4 screw head, with optional extra spacing\nmodule screw_head_hex_m4(dy=0, dh=0)\n{\n screw_head_hex(y=7+dy, h=2.9+dh);\n}\n\n\/\/ M5 screw head, with optional extra spacing\nmodule screw_head_hex_m5(dy=0, dh=0)\n{\n screw_head_hex(y=8+dy, h=4.4+dh);\n}\n\n\/\/ M6 screw head, with optional extra spacing\nmodule screw_head_hex_m6(dy=0, dh=0)\n{\n screw_head_hex(y=10+dy, h=4.9+dh);\n}\n\n\/\/ M8 screw head, with optional extra spacing\nmodule screw_head_hex_m8(dy=0, dh=0)\n{\n screw_head_hex(y=13+dy, h=6.44+dh);\n}\n\n\/\/ M10 screw head, with optional extra spacing\nmodule screw_head_hex_m10(dy=0, dh=0)\n{\n screw_head_hex(y=16+dy, h=8.04+dh);\n}\n\n\/\/ M12 screw head, with optional extra spacing\nmodule screw_head_hex_m12(dy=0, dh=0)\n{\n screw_head_hex(y=18+dy, h=10.37+dh);\n}\n\n\/\/ M10 screw head, with optional extra spacing\nmodule screw_head_hex_m10(dy=0, dh=0)\n{\n screw_head_hex(y=17+dy, h=6.4+dh);\n}\n\n\nif(false)\n{\n translate([0, 0,0]) screw_head_hex_m2();\n translate([0, 6,0]) screw_head_hex_m3();\n translate([0,14,0]) screw_head_hex_m4();\n translate([0,23,0]) screw_head_hex_m5();\n translate([0,34,0]) screw_head_hex_m6();\n translate([0,47,0]) screw_head_hex_m8();\n translate([0,65,0]) screw_head_hex_m10();\n translate([0,85,0]) screw_head_hex_m12();\n\n translate([6, 0, 0])\n {\n \/\/ model with some extra spacing, to make a head slot\n screw_head_hex_m2(dy=0.5, dh=0.4);\n }\n}\n","old_contents":"\/\/ generic hex-sided screw head.\n\/\/ y - distance between parallel edges (often denotated as 'd' in specs)\n\/\/ h - height of the head\nmodule screw_head_hex(y, h)\n{\n a = 120;\n x = y\/2 * 1\/sin(a\/2);\n for(r=[0, 120, 240])\n rotate([0, 0, r])\n translate(-1\/2*[x, y, 0])\n cube([x, y, h]);\n}\n\n\/\/ M3 screw head, with optional extra spacing\nmodule screw_head_hex_m3(dy=0, dh=0)\n{\n screw_head_hex(y=5.5+dy, h=2.5+dh);\n}\n\n\/\/ TODO: M3..M10\n\n\/\/ M10 screw head, with optional extra spacing\nmodule screw_head_hex_m10(dy=0, dh=0)\n{\n screw_head_hex(y=17+dy, h=6.4+dh);\n}\n\n\nif(false)\n{\n \/\/ screw-head model\n screw_head_hex_m3();\n translate([10, 0, 0])\n {\n \/\/ model with some extra spacing, to make a head slot\n screw_head_hex_m3(dy=0.5, dh=0.4);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"913013c49224c106742c1bec6beecbdb12d53dc3","subject":"remove unused code","message":"remove unused code\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule screw_mount() {\n difference() {\n cube([10, wall_thickness, 10]);\n\n rotate([90, 0, 0])\n translate([5, 5, -wall_thickness-1])\n cylinder(r=2, h=wall_thickness+2);\n }\n}\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n \n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b439e1bccb26d71dd5c26d4d4d670172d96d9b16","subject":"x\/carriage\/extruder\/guidler: rewrite to be X oriented","message":"x\/carriage\/extruder\/guidler: rewrite to be X oriented\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n ty(-0.1*mm)\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n tx(-guidler_bearing[1]\/2+2*mm)\n cubea([100, bearing_cut_w, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bearing[0]*1.05,guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05], align=-X);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=Y);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=Y);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotend_d_h[0][1]-hotend_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotend_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotend_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+3*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(extruder_b_bearing_offset)\n {\n ty(-1*mm)\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n tx(guidler_mount_off[0])\n tz(guidler_mount_off[2])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n ty(-0.1*mm)\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n bearing_cut_w = guidler_bearing[2]+.5*mm;\n\n \/\/ port hole to see bearing\n tx(-guidler_bearing[1]\/2+2*mm)\n cubea([100, bearing_cut_w, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n tx(guidler_mount_off[0])\n tz(guidler_mount_off[2])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+.5*mm, orient=Y);\n\n \/\/ mount screw hole\n tx(guidler_mount_off[0])\n ty(-guidler_w\/2)\n tz(guidler_mount_off[2])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bearing[0]*1.05,guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05], align=-X);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=Y);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=Y);\n\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"82284b922c1205d7cb8d76e6984553dcc112ed29","subject":"exploring Jamie's ProMicro bug","message":"exploring Jamie's ProMicro bug\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/ProMicroDebugging.scad","new_file":"hardware\/sandbox\/ProMicroDebugging.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: None\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\ninclude <..\/config\/config.scad>\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size=[pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ Add headers to either side along y, leaving room for end header\n \/\/ distance between the two header rows\n rowpitch=pcbWidth-holeInset*2;\n \/\/ amount of holes in each row, leaving room for end header and insets\n rowcount=((pcbLength-holeSpace-holeInset*2)\/holeSpace);\n\n \/\/ FIXME: rowcount doesn't get fully interated\n \/\/ rowcount=11;\n\n echo(\"Count=\", rowcount * 10000);\n for (x=[0, rowpitch], y=[0:rowcount]) {\n echo(\"Loop=\", y);\n translate([x, y*holeSpace, 0]) {\n \/\/ Standard PCB hole\n circle(r=holeDiam\/2);\n }\n }\n echo(\"Count=\", rowcount);\n}\n\nmodule ArduinoPro(type=\"mini\") {\n \/\/ Common Features between Pro Mini and Pro Micro\n difference() {\n \/\/ Common PCB\n ArduinoPro_PCB();\n\n \/\/ Common headers\n ArduinoPro_Headers();\n }\n\n \/\/ Features for Pro Mini\n if (type==\"mini\") {\n }\n\n \/\/ Features for Pro Micro\n if (type==\"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/sandbox\/ProMicroDebugging.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"4199bc23954f47c87bd5d12a46110967319cfc4c","subject":"[3d] Add support for 0.36inch LED displays to MeterMonitor","message":"[3d] Add support for 0.36inch LED displays to MeterMonitor\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/MeterMonitor.scad","new_file":"3d\/MeterMonitor.scad","new_contents":"\/\/ LCD type\r\nlt = 0; \/\/ [0: 0.56inch, 1: 0.36inch]\r\n\r\nwall = 1.3; \/\/ interior walls\r\nwall_o = 1.9; \/\/ outer walls\r\nwall_t = 1.45; \/\/ base thickness\r\n\r\n\/* Hidden *\/\r\nlid_h = wall_t;\r\n\r\nlcd_w = [67, 45.50][lt];\r\nlcd_d = [28, 23.00][lt];\r\nlcd_s_w = [60, 40.35][lt]; \/\/ width between screws\r\nlcd_s_d = [22, 17.76][lt];\r\nlcd_s_h = [8.5, 7.0][lt];\r\nlcd_s_dia = [3.1, 3.1][lt];\r\nlcd_a_w = [50, 30][lt]; \/\/ width of actual 7-segment area\r\nlcd_a_d = [17.5, 14][lt];\r\nlcd_ex_w = [0, 2][lt];\r\nlcd_ex_d = [2, 4][lt];\r\nlcd_window_offset = [2, (5.43-10.07)\/2][lt];\r\nw_extra = [2, 6][lt];\r\nd_extra = [0, 0][lt];\r\n\r\noa_w = 2*lcd_w + 2*lcd_ex_w + w_extra;\r\noa_d = 3*lcd_d + 3*lcd_ex_d + d_extra;\r\noa_h = 15;\r\npad_right = max(2*lcd_window_offset, 0); \/\/ padding is asymetrical so not included in oa_w\r\n\r\nmain();\r\n\/\/translate([-oa_w\/2, oa_d\/2+wall_o+5, 0]) lid();\r\n\r\nmodule main() {\r\n difference() {\r\n union() {\r\n translate([-oa_w\/2-wall_o, -oa_d\/2-wall_o, 0])\r\n cube_bchamfer([oa_w+pad_right+2*wall_o, oa_d+2*wall_o, oa_h+wall_t+lid_h+wall_t\/2], r=5, bottom=1);\r\n } \/\/ union\r\n \r\n \/\/ main cutout\r\n translate([-oa_w\/2, -oa_d\/2, wall_t])\r\n cube_bchamfer([oa_w+pad_right, oa_d, oa_h+e], r=5-wall, bottom=1, top=lid_h);\r\n \/\/ lid cutout\r\n translate([-oa_w\/2,-oa_d\/2-wall_o-e,wall_t+oa_h])\r\n cube_fillet([oa_w+pad_right, oa_d+wall_o+e, lid_h+wall_t+e],\r\n vertical=[2,2], top=[lid_h,lid_h,0,lid_h], $fn=4);\r\n \r\n \/\/ LCD holes\r\n lcd_places() lcd_mount_n();\r\n \r\n \/\/ USB power hole\r\n wemos_place() translate([-5.9, -35.2\/2-1.2-wall_o-e, 2.3+2-0.5]) \r\n cube_fillet([13, 10, 6+1.5], top=[0,1,0,1]);\r\n\r\n \/\/branding();\r\n } \/\/ diff\r\n\r\n lcd_places() lcd_mount_p();\r\n wemos_place() wemos_mount(2);\r\n}\r\n\r\nmodule lid() {\r\n ww = oa_w+pad_right+0.2;\r\n dd = oa_d+wall_o-0.2;\r\n difference() {\r\n cube_fillet([ww, dd, lid_h], bottom=[0.5, 0.5, 0, 0.5], vertical=[1.5, 1.5 ,1.5, 1.5]);\r\n \/\/ vent holes\r\n \/\/translate([15, dd\/2, 0])\r\n \/\/ for (X=[0:3])\r\n \/\/ translate([X*(ww-30)\/3, 0, -e]) rotate(90) cylcyl(d*0.7, 2, lid_h+2*e, $fn=12);\r\n }\r\n \/\/ lock bump\r\n \/\/translate([wall_o+wall_t+0.5, dd\/2-4*wall, lid_h-e]) cube_fillet([2*wall, 8*wall, 0.6], top=[0.6,0,0.6,0]);\r\n translate([ww\/4, wall_o+wall_t+0.5, lid_h-e]) cube_fillet([ww\/2, 2*wall, 0.6], top=[0,0.6,0,0.6]);\r\n}\r\n\r\nmodule lcd_places() {\r\n \/\/ center two\r\n translate([lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n translate([-lcd_w\/2-lcd_ex_w,0,0])\r\n children();\r\n \/\/ top\/bottom\r\n mirror2([0,1,0]) translate([-lcd_w\/2-lcd_ex_w,lcd_d+lcd_ex_d,0])\r\n children();\r\n}\r\n\r\nmodule lcd_mount_p() {\r\n mirror2([1,0,0]) mirror2([0,1,0]) translate([lcd_s_w\/2, lcd_s_d\/2, wall_t]) {\r\n difference() {\r\n cylinder(lcd_s_h, d=lcd_s_dia+2*wall, $fn=16);\r\n translate([0,0,-e]) cylinder(lcd_s_h+2*e, d=lcd_s_dia, $fn=16);\r\n }\r\n }\r\n}\r\n\r\nmodule lcd_mount_n() {\r\n translate([-lcd_a_w\/2+lcd_window_offset-wall_t, -lcd_a_d\/2-wall_t, -e])\r\n cube_bchamfer([lcd_a_w+2*wall_t, lcd_a_d+2*wall_t, wall_t+2*e], r=3, top=wall_t, $fn=12);\r\n}\r\n\r\nmodule wemos_place() {\r\n translate([oa_w\/2+pad_right+wall-20, -lcd_d-lcd_ex_d, wall_t]) rotate(90) children();\r\n}\r\n\r\nmodule wemos_mount(extra_h) {\r\n we_w=25.9;\r\n we_d=35.2;\r\n we_h=6;\r\n we_rad=2.4;\r\n we_wall=1.2;\r\n \r\n difference() {\r\n translate([-we_w\/2-we_wall, -we_d\/2-we_wall, 0])\r\n cube_fillet([we_w+2*we_wall, we_d+2*we_wall, we_h+extra_h],\r\n vertical=[we_rad+we_wall*0.5855,we_rad+we_wall*0.5855]);\r\n \r\n translate([0,0,extra_h]) {\r\n \/\/ Big hole\r\n translate([-we_w\/2, -we_d\/2, 3])\r\n cube_fillet([we_w, we_d, we_h+2*e], vertical=[we_rad,we_rad]);\r\n \/\/ USB jack\r\n translate([-5.9, -we_d\/2-we_wall-e, 2.3]) \r\n cube([13, 10, we_h]);\r\n \/\/ Reset button\r\n translate([we_w\/2-e, -we_d\/2+1.8, 3.5]) \r\n cube([we_wall+2*e, 5, we_h]);\r\n \/\/ Bottom small hole\r\n translate([-21\/2, -31\/2, -e])\r\n cube([21, 31, we_h+2*e]);\r\n \/\/ wifi antenna\r\n translate([-18\/2, we_d\/2-(we_d-31)\/2-e, 3-1.3]) \r\n cube([18, (we_d-31)\/2+e, 1.3+e]);\r\n }\r\n } \/\/ diff\r\n \r\n \/\/ Grab notches\r\n translate([0,0,extra_h]) {\r\n translate([we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n translate([-we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n }\r\n}\r\n\r\nmodule branding() {\r\n translate([lcd_w\/2-3,lcd_d+lcd_ex_d,-e]) mirror([1,0,0]) linear_extrude(0.24+e)\r\n text(\"HeaterMeter\", halign=\"center\", valign=\"center\", font=\"Impact\",\r\n spacing=1.3, size=7);\r\n}\r\n\r\n\/********************************** LIBRARY CODE BELOW HERE **********************\/\r\n\r\ne = 0.01;\r\n\r\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\r\n \/\/ bottom beaded area\r\n if (bottom != 0) hull(){\r\n translate([r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n }\r\n \/\/ center\r\n translate([0,0,bottom]) hull(){\r\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n }\r\n \/\/ top beaded area\r\n if (top != 0) translate([0,0,dim[2]-top-e]) hull(){\r\n translate([r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n }\r\n}\r\n\r\nmodule mirror2(dim) {\r\n \/\/ Create both item and mirror of item\r\n children();\r\n mirror(dim) children();\r\n}\r\n\r\nmodule fillet(radius, height=100, $fn=$fn) {\r\n if (radius > 0) {\r\n \/\/this creates acutal fillet\r\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\r\n cube([radius * 2, radius * 2, height + 0.04]);\r\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\r\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\r\n } else {\r\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\r\n }\r\n\r\n }\r\n }\r\n}\r\n\r\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\r\n if (center) {\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n } else {\r\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n }\r\n}\r\n\r\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n j=[1,0,1,0];\r\n\r\n fn_V = $fn[0] == undef ? $fn : $fn[0];\r\n fn_T = $fn[1] == undef ? $fn : $fn[1];\r\n fn_B = $fn[2] == undef ? $fn : $fn[2];\r\n \r\n for (i=[0:3]) {\r\n if (radius > -1) {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\r\n } else {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\r\n }\r\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\r\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\r\n\r\n }\r\n}\r\n\r\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n \/\/makes CENTERED cube with round corners\r\n \/\/ if you give it radius, it will fillet vertical corners.\r\n \/\/othervise use vertical, top, bottom arrays\r\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\r\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\r\n\r\n if (radius == 0) {\r\n cube(size, center=true);\r\n } else {\r\n difference() {\r\n cube(size, center=true);\r\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\r\n }\r\n }\r\n}\r\n\r\n\/\/cube_fillet([10,10,10]);","old_contents":"wall = 1.3;\r\nwall_o = 1.9;\r\nwall_t = 1.45;\r\n\r\nlid_h = wall_t;\r\n\r\nlcd_w = 67;\r\nlcd_d = 28;\r\nlcd_s_w = 60; \/\/ width between screws\r\nlcd_s_d = 22;\r\nlcd_s_h = 8.5;\r\nlcd_s_dia = 3.1;\r\nlcd_a_w = 50; \/\/ width of actual 7-segment area\r\nlcd_a_d = 17.5; \/\/19\r\nlcd_ex_w = 0;\r\nlcd_ex_d = 2;\r\nlcd_window_offset = 2;\r\n\r\noa_w = 2*lcd_w+2*lcd_ex_w;\r\noa_d = 3*lcd_d+3*lcd_ex_d;\r\noa_h = 15;\r\n\r\nmain();\r\n\/\/translate([-oa_w\/2, oa_d\/2+wall_o+5, 0]) lid();\r\n\r\nmodule main() {\r\n difference() {\r\n union() {\r\n translate([-oa_w\/2-wall_o, -oa_d\/2-wall_o, 0])\r\n cube_bchamfer([oa_w+2*lcd_window_offset+2*wall_o, oa_d+2*wall_o, oa_h+wall_t+lid_h+wall_t\/2], r=5, bottom=1);\r\n } \/\/ union\r\n \r\n \/\/ main cutout\r\n translate([-oa_w\/2, -oa_d\/2, wall_t])\r\n cube_bchamfer([oa_w+2*lcd_window_offset, oa_d, oa_h+e], r=5-wall, bottom=1, top=lid_h);\r\n \/\/ lid cutout\r\n translate([-oa_w\/2,-oa_d\/2-wall_o-e,wall_t+oa_h])\r\n cube_fillet([oa_w+2*lcd_window_offset, oa_d+wall_o+e, lid_h+wall_t+e],\r\n vertical=[2,2], top=[lid_h,lid_h,0,lid_h], $fn=4);\r\n \r\n \/\/ LCD holes\r\n lcd_places() lcd_mount_n();\r\n \r\n \/\/ USB power hole\r\n wemos_place() translate([-5.9, -35.2\/2-1.2-wall_o-e, 2.3+2-0.5]) \r\n cube_fillet([13, 10, 6+1.5], top=[0,1,0,1]);\r\n\r\n \/\/branding();\r\n } \/\/ diff\r\n\r\n lcd_places() lcd_mount_p();\r\n wemos_place() wemos_mount(2);\r\n}\r\n\r\nmodule lid() {\r\n ww = oa_w+2*lcd_window_offset+0.2;\r\n dd = oa_d+wall_o-0.2;\r\n difference() {\r\n cube_fillet([ww, dd, lid_h], bottom=[0.5, 0.5, 0, 0.5], vertical=[1.5, 1.5 ,1.5, 1.5]);\r\n \/\/ vent holes\r\n \/\/translate([15, dd\/2, 0])\r\n \/\/ for (X=[0:3])\r\n \/\/ translate([X*(ww-30)\/3, 0, -e]) rotate(90) cylcyl(d*0.7, 2, lid_h+2*e, $fn=12);\r\n }\r\n \/\/ lock bump\r\n \/\/translate([wall_o+wall_t+0.5, dd\/2-4*wall, lid_h-e]) cube_fillet([2*wall, 8*wall, 0.6], top=[0.6,0,0.6,0]);\r\n translate([ww\/4, wall_o+wall_t+0.5, lid_h-e]) cube_fillet([ww\/2, 2*wall, 0.6], top=[0,0.6,0,0.6]);\r\n}\r\n\r\nmodule lcd_places() {\r\n \/\/ center two\r\n translate([lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n translate([-lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n \/\/ top\/bottom\r\n mirror2([0,1,0]) translate([-lcd_w\/2,lcd_d+lcd_ex_d,0])\r\n children();\r\n}\r\n\r\nmodule lcd_mount_p() {\r\n mirror2([1,0,0]) mirror2([0,1,0]) translate([lcd_s_w\/2, lcd_s_d\/2, wall_t]) {\r\n difference() {\r\n cylinder(lcd_s_h, d=lcd_s_dia+2*wall, $fn=16);\r\n translate([0,0,-e]) cylinder(lcd_s_h+2*e, d=lcd_s_dia, $fn=16);\r\n }\r\n }\r\n}\r\n\r\nmodule lcd_mount_n() {\r\n translate([-lcd_a_w\/2+lcd_window_offset-wall_t, -lcd_a_d\/2-wall_t, -e])\r\n cube_bchamfer([lcd_a_w+2*wall_t, lcd_a_d+2*wall_t, wall_t+2*e], r=3, top=wall_t, $fn=12);\r\n}\r\n\r\nmodule wemos_place() {\r\n translate([oa_w\/2+2*lcd_window_offset+wall-20, -lcd_d-lcd_ex_d, wall_t]) rotate(90) children();\r\n}\r\n\r\nmodule wemos_mount(extra_h) {\r\n we_w=25.9;\r\n we_d=35.2;\r\n we_h=6;\r\n we_rad=2.4;\r\n we_wall=1.2;\r\n \r\n difference() {\r\n translate([-we_w\/2-we_wall, -we_d\/2-we_wall, 0])\r\n cube_fillet([we_w+2*we_wall, we_d+2*we_wall, we_h+extra_h],\r\n vertical=[we_rad+we_wall*0.5855,we_rad+we_wall*0.5855]);\r\n \r\n translate([0,0,extra_h]) {\r\n \/\/ Big hole\r\n translate([-we_w\/2, -we_d\/2, 3])\r\n cube_fillet([we_w, we_d, we_h+2*e], vertical=[we_rad,we_rad]);\r\n \/\/ USB jack\r\n translate([-5.9, -we_d\/2-we_wall-e, 2.3]) \r\n cube([13, 10, we_h]);\r\n \/\/ Reset button\r\n translate([we_w\/2-e, -we_d\/2+1.8, 3.5]) \r\n cube([we_wall+2*e, 5, we_h]);\r\n \/\/ Bottom small hole\r\n translate([-21\/2, -31\/2, -e])\r\n cube([21, 31, we_h+2*e]);\r\n \/\/ wifi antenna\r\n translate([-18\/2, we_d\/2-(we_d-31)\/2-e, 3-1.3]) \r\n cube([18, (we_d-31)\/2+e, 1.3+e]);\r\n }\r\n } \/\/ diff\r\n \r\n \/\/ Grab notches\r\n translate([0,0,extra_h]) {\r\n translate([we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n translate([-we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n }\r\n}\r\n\r\nmodule branding() {\r\n translate([lcd_w\/2-3,lcd_d+lcd_ex_d,-e]) mirror([1,0,0]) linear_extrude(0.24+e)\r\n text(\"HeaterMeter\", halign=\"center\", valign=\"center\", font=\"Impact\",\r\n spacing=1.3, size=7);\r\n}\r\n\r\n\/********************************** LIBRARY CODE BELOW HERE **********************\/\r\n\r\ne = 0.01;\r\n\r\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\r\n \/\/ bottom beaded area\r\n if (bottom != 0) hull(){\r\n translate([r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n }\r\n \/\/ center\r\n translate([0,0,bottom]) hull(){\r\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n }\r\n \/\/ top beaded area\r\n if (top != 0) translate([0,0,dim[2]-top-e]) hull(){\r\n translate([r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n }\r\n}\r\n\r\nmodule mirror2(dim) {\r\n \/\/ Create both item and mirror of item\r\n children();\r\n mirror(dim) children();\r\n}\r\n\r\nmodule fillet(radius, height=100, $fn=$fn) {\r\n if (radius > 0) {\r\n \/\/this creates acutal fillet\r\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\r\n cube([radius * 2, radius * 2, height + 0.04]);\r\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\r\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\r\n } else {\r\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\r\n }\r\n\r\n }\r\n }\r\n}\r\n\r\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\r\n if (center) {\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n } else {\r\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n }\r\n}\r\n\r\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n j=[1,0,1,0];\r\n\r\n fn_V = $fn[0] == undef ? $fn : $fn[0];\r\n fn_T = $fn[1] == undef ? $fn : $fn[1];\r\n fn_B = $fn[2] == undef ? $fn : $fn[2];\r\n \r\n for (i=[0:3]) {\r\n if (radius > -1) {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\r\n } else {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\r\n }\r\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\r\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\r\n\r\n }\r\n}\r\n\r\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n \/\/makes CENTERED cube with round corners\r\n \/\/ if you give it radius, it will fillet vertical corners.\r\n \/\/othervise use vertical, top, bottom arrays\r\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\r\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\r\n\r\n if (radius == 0) {\r\n cube(size, center=true);\r\n } else {\r\n difference() {\r\n cube(size, center=true);\r\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\r\n }\r\n }\r\n}\r\n\r\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"46b2ba02b300e3ca8adf7ea07bc45dc1a0d8b8cf","subject":"main: add psu's + psu extrusion brackets","message":"main: add psu's + psu extrusion brackets\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(ycarriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_bearing=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(ycarriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9fd5817178c2e8b39a6d2bc91c715cab16bb3304","subject":"updated size","message":"updated size\n","repos":"holtsoftware\/House,holtsoftware\/House,holtsoftware\/House,holtsoftware\/House","old_file":"OpenSCAD\/Yard\/SolarRoof.scad","new_file":"OpenSCAD\/Yard\/SolarRoof.scad","new_contents":"module solarPanel()\n{\n translate([0,0,1.5]) color(\"blue\") cube([51,51,4]);\n translate([4,4,0]) color(\"red\") cube([43,43,5]);\n translate([0,21.5,0]) color(\"orange\") cube([51,8,5]);\n}\n\ndifference()\n{\n cube([140,75,5]);\n translate([17,12.25,0]) solarPanel();\n translate([70,12.25,0]) solarPanel();\n}","old_contents":"module solarPanel()\n{\n translate([0,0,1.75]) color(\"blue\") cube([49,49,3.25]);\n translate([3,3,0]) color(\"red\") cube([43,43,5]);\n translate([0,20.5,0]) color(\"orange\") cube([49,8,5]);\n}\n\ndifference()\n{\n cube([140,75,5]);\n translate([19,12.25,0]) solarPanel();\n translate([70,12.25,0]) solarPanel();\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a8b14390fedb8ea92470d6b467d4bc442371a2d9","subject":"Added leeway for the board and cutouts for the lid","message":"Added leeway for the board and cutouts for the lid\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"extras\/iotsaCase.scad","new_file":"extras\/iotsaCase.scad","new_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-5, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 20; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 3;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually)\n\nmodule box() {\n innerXSize = (63-numberOfMMRemoved) + 5 + 2*leeWay; \/\/ Add 5 for how far the esp12 antenna extends\n innerYSize = 43 + 2*leeWay;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n retainerWidth = 3;\n retainerLength = 6;\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n union() {\n difference() {\n translate([-5-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n \/\/ left retainer hole\n # translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ right retainer hole\n # translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize, 0])\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","old_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-5, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 20; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 3;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nmodule box() {\n innerXSize = (63-numberOfMMRemoved) + 5; \/\/ Add 5 for how far the esp12 antenna extends\n innerYSize = 43;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22, 0, 0]) cube([9, 2*boxFrontThickness, 11]);\n }\n union() {\n difference() {\n translate([-5-boxLeftThickness, -boxFrontThickness, -(boardThickness+iotsaSolderingHeight+boxBottomThickness)])\n union() {\n basicBox();\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n translate([0, innerYSize, 0])\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -boxFrontThickness, 0]) frontHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"756e319e1fc7c0ed219d3a6222365bd4337204bd","subject":"z\/motor-mount: rewrite to part system, use screw_cut","message":"z\/motor-mount: rewrite to part system, use screw_cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-motor-mount.scad","new_file":"z-motor-mount.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \nuse \n\nuse \n\nmodule zaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n zaxis_motor_mount(part=\"pos\");\n zaxis_motor_mount(part=\"neg\");\n }\n %zaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ top plate\n rcubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n rcubea([gantry_connector_thickness+5, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=[1,0,-1], extra_size=[0,0,2], extra_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=[1,0,-1]);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(y=[-1,1])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ screw hole bottom\n for(y=[0])\n tx(zmotor_mount_thickness)\n ty(y*(zmotor_w\/2+zmotor_mount_thread_dia*3))\n tz(-extrusion_size-main_lower_dist_z)\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=-X, align=-X);\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_mount_screw_offset_x, 0, 0])\n translate([0,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-5, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n nut_trap_cut(nut=zmotor_mount_clamp_nut, h=10, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=-Z, orient=X, align=N);\n }\n }\n\n }\n else if(part==\"vit\")\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nmodule part_z_motor_mount_clamp()\n{\n translate([0,0,zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n}\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\nuse \n\nmodule zaxis_motor_mount(show_motor=false)\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n material(Mat_Plastic)\n union()\n {\n \/\/ top plate\n rcubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n rcubea([gantry_connector_thickness+5, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n rcubea([zmotor_mount_thickness, zmotor_w+2, zmotor_h], align=[1,0,-1], extra_size=[0,0,2], extra_align=Z);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n rcubea([zmotor_mount_thickness, zmotor_w+2, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n triangle(\n zmotor_mount_rod_offset_x-zmotor_mount_thickness,\n main_lower_dist_z+extrusion_size+zaxis_motor_offset_z+2,\n depth=zmotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 2])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h+2], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=X);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n cylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=N, orient=X);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_mount_screw_offset_x, 0, 0])\n translate([0,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n cylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=Z);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-5, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n nut_trap_cut(nut=zmotor_mount_clamp_nut, h=10, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=Z, orient=X, align=N);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],N],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\nmodule part_z_motor_mount()\n{\n rotate([0,-90,0])\n zaxis_motor_mount();\n}\n\nmodule part_z_motor_mount_clamp()\n{\n translate([0,0,zmotor_mount_thickness_h\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"84ce25588c25e8372ce9ee9ccd25f23aa5a729a4","subject":"curve: fix eol","message":"curve: fix eol\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"curve.scad","new_file":"curve.scad","new_contents":"include \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\n\nmodule draw_path(path, r=1) {\n for (i=[0:len(path)-2]) {\n hull() {\n translate(path[i]) sphere(r);\n translate(path[i+1]) sphere(r);\n }\n }\n}\n\nmodule draw_transform(transform, r=1) {\n multmatrix(transform) scale(r\/3) frame(10);\n}\n\nmodule draw_transforms(transforms, r=1) {\n for (t=transforms) {\n draw_transform(t,r);\n }\n}\n\nfunction vec_trans(path_t) = [for(t=path_t) translation_part(t)];\n\nfunction to_delta_trans(path)=\n[\n let(l=len(path))\n for (i=[0:l-1-1])\n trajectory(translation=path[i+1]-path[i])\n];\n\nfunction quantize_path(path, step, includestartoffset=1) = let (\n \/\/ construct vector of delta translations\n path_traj = to_delta_trans(path)\n \/\/ quantize evenly along path\n , path_q_f = quantize_trajectories(path_traj, step=step, loop=false, start_position=0)\n )\n includestartoffset == 1 ?\n [for(v=path_q_f) path[0]+translation_part(v)]\n :\n [for(v=path_q_f) translation_part(v)]\n;\n\nfunction step_vec(vec, step, start_offset=0, end_offset=0) =\n [start_offset:step:len(vec)-1-end_offset];\n\nfunction iterate_step_vec(vec, step, start_offset=0, end_offset=0, even=0) =\n even==1?\n \/\/remainder\n let(r = (len(vec)-1) % step)\n [for(k=[r\/2+start_offset:step:len(vec)-1-end_offset]) vec[k]]\n :\n [for(k=[start_offset:step:len(vec)-1-end_offset]) vec[k]]\n;\n\nmodule place(vec_t, debug=0)\n{\n for(t=vec_t)\n {\n multmatrix(t)\n {\n if(debug>=1)\n {\n {\n draw_transforms(t);\n }\n }\n children();\n }\n }\n}\n\nmodule placealong(vec_t, step, start_offset=0, end_offset=0, even=0, debug=0)\n{\n vec = iterate_step_vec(vec_t,step,start_offset,end_offset, even);\n place(vec, debug)\n {\n children();\n }\n}\n\nfunction c(t, r=[20,20], degrees=360) = [\n r[0]*(cos((degrees)*t)),\n 0,\n r[1]*(sin((degrees)*t)),\n];\nfunction c_(t, r=[20,20], degrees=360) = [\n r[0]*-degrees*(sin((degrees)*t)),\n 0,\n r[1]*-degrees*(cos((degrees)*t)),\n];\n\nfunction f(t,r,d)=c(t,r,d)-c(0,r,d);\n\n\/*s = degrees\/4;*\/\ns = 10;\n\ndegrees = s*10;\n\n\/\/ one step per degree\ndegstep = 1;\npath_e = [for (t=[0:degstep\/degrees:1-degstep\/degrees]) vec3(f(t,[80,50],degrees)) ];\n\n\/\/ normal transform path (not evenly distributed points)\npath_t = construct_transform_path(path_e);\n\n\/\/ evenly distributed points, \"acc\" steps per degree\nacc = 2;\npath_e_q = quantize_path(path_e, step=1\/acc);\npath_t_q = construct_transform_path(path_e_q);\n\/*accstep = acc * len(path_t)\/len(path_t_q);*\/\n\nfunction path_sweepalong(path) = [for(k=path) place_mat()*k];\nfunction path_placealong(path) = [for(k=path) place_mat()*k*rotation([180,90,0])];\n\nfunction place_mat() =\n translation(N)\n *\n rotation(N)\n ;\n\nshape_debug = rectangle_profile([0.5,0.5]);\n\n\n\/\/ non-interpolated\ntranslate(N)\n{\n color(\"black\")\n {\n sweep(shape_debug, path_sweepalong(path_t), false);\n }\n placealong(path_placealong(path_t), s, even=0, debug=1)\n {\n color(\"red\")\n {\n cube([s,5,0.1], true);\n }\n }\n}\n\n\/\/ interpolated\ntranslate([0,10,0])\n{\n color(\"black\")\n {\n sweep(shape_debug, path_sweepalong(path_t_q), false);\n }\n placealong(path_placealong(path_t_q), s*acc, even=0, debug=1)\n {\n color(\"blue\")\n {\n cube([s,5,0.1], true);\n }\n }\n}\n\n","old_contents":"include \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\nuse \r\n\r\n\r\nmodule draw_path(path, r=1) {\r\n for (i=[0:len(path)-2]) {\r\n hull() {\r\n translate(path[i]) sphere(r);\r\n translate(path[i+1]) sphere(r);\r\n }\r\n }\r\n}\r\n\r\nmodule draw_transform(transform, r=1) {\r\n multmatrix(transform) scale(r\/3) frame(10);\r\n}\r\n\r\nmodule draw_transforms(transforms, r=1) {\r\n for (t=transforms) {\r\n draw_transform(t,r);\r\n }\r\n}\r\n\r\nfunction vec_trans(path_t) = [for(t=path_t) translation_part(t)];\r\n\r\nfunction to_delta_trans(path)=\r\n[\r\n let(l=len(path))\r\n for (i=[0:l-1-1])\r\n trajectory(translation=path[i+1]-path[i])\r\n];\r\n\r\nfunction quantize_path(path, step, includestartoffset=1) = let (\r\n \/\/ construct vector of delta translations\r\n path_traj = to_delta_trans(path)\r\n \/\/ quantize evenly along path\r\n , path_q_f = quantize_trajectories(path_traj, step=step, loop=false, start_position=0)\r\n )\r\n includestartoffset == 1 ?\r\n [for(v=path_q_f) path[0]+translation_part(v)]\r\n :\r\n [for(v=path_q_f) translation_part(v)]\r\n;\r\n\r\nfunction step_vec(vec, step, start_offset=0, end_offset=0) =\r\n [start_offset:step:len(vec)-1-end_offset];\r\n\r\nfunction iterate_step_vec(vec, step, start_offset=0, end_offset=0, even=0) =\r\n even==1?\r\n \/\/remainder\r\n let(r = (len(vec)-1) % step)\r\n [for(k=[r\/2+start_offset:step:len(vec)-1-end_offset]) vec[k]]\r\n :\r\n [for(k=[start_offset:step:len(vec)-1-end_offset]) vec[k]]\r\n;\r\n\r\nmodule place(vec_t, debug=0)\r\n{\r\n for(t=vec_t)\r\n {\r\n multmatrix(t)\r\n {\r\n if(debug>=1)\r\n {\r\n {\r\n draw_transforms(t);\r\n }\r\n }\r\n children();\r\n }\r\n }\r\n}\r\n\r\nmodule placealong(vec_t, step, start_offset=0, end_offset=0, even=0, debug=0)\r\n{\r\n vec = iterate_step_vec(vec_t,step,start_offset,end_offset, even);\r\n place(vec, debug)\r\n {\r\n children();\r\n }\r\n}\r\n\r\nfunction c(t, r=[20,20], degrees=360) = [\r\n r[0]*(cos((degrees)*t)),\r\n 0,\r\n r[1]*(sin((degrees)*t)),\r\n];\r\nfunction c_(t, r=[20,20], degrees=360) = [\r\n r[0]*-degrees*(sin((degrees)*t)),\r\n 0,\r\n r[1]*-degrees*(cos((degrees)*t)),\r\n];\r\n\r\nfunction f(t,r,d)=c(t,r,d)-c(0,r,d);\r\n\r\n\/*s = degrees\/4;*\/\r\ns = 10;\r\n\r\ndegrees = s*10;\r\n\r\n\/\/ one step per degree\r\ndegstep = 1;\r\npath_e = [for (t=[0:degstep\/degrees:1-degstep\/degrees]) vec3(f(t,[80,50],degrees)) ];\r\n\r\n\/\/ normal transform path (not evenly distributed points)\r\npath_t = construct_transform_path(path_e);\r\n\r\n\/\/ evenly distributed points, \"acc\" steps per degree\r\nacc = 2;\r\npath_e_q = quantize_path(path_e, step=1\/acc);\r\npath_t_q = construct_transform_path(path_e_q);\r\n\/*accstep = acc * len(path_t)\/len(path_t_q);*\/\r\n\r\nfunction path_sweepalong(path) = [for(k=path) place_mat()*k];\r\nfunction path_placealong(path) = [for(k=path) place_mat()*k*rotation([180,90,0])];\r\n\r\nfunction place_mat() =\r\n translation(N)\r\n *\r\n rotation(N)\r\n ;\r\n\r\nshape_debug = rectangle_profile([0.5,0.5]);\r\n\r\n\r\n\/\/ non-interpolated\r\ntranslate(N)\r\n{\r\n color(\"black\")\r\n {\r\n sweep(shape_debug, path_sweepalong(path_t), false);\r\n }\r\n placealong(path_placealong(path_t), s, even=0, debug=1)\r\n {\r\n color(\"red\")\r\n {\r\n cube([s,5,0.1], true);\r\n }\r\n }\r\n}\r\n\r\n\/\/ interpolated\r\ntranslate([0,10,0])\r\n{\r\n color(\"black\")\r\n {\r\n sweep(shape_debug, path_sweepalong(path_t_q), false);\r\n }\r\n placealong(path_placealong(path_t_q), s*acc, even=0, debug=1)\r\n {\r\n color(\"blue\")\r\n {\r\n cube([s,5,0.1], true);\r\n }\r\n }\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6af1877f2c2a22af1ab55a1ca7f14c83fd9be867","subject":"Adusted fine details of Typeatron status LED, pinholes, thumb button","message":"Adusted fine details of Typeatron status LED, pinholes, thumb button\n","repos":"joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn","old_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/openscad\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\/\/ a slight overestimate of the sizes of subtracted objects which prevents a confusing \"film\" in the STL\noverkill = 0.001;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorHeadWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorHeadThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\npressureSensorTailWidth = 6.3; \/\/ by direct measurement\npressureSensorTailThick = 0.90; \/\/ by direct measurement; this is the thick segment of the sensor with the electrical contacts\n\ntactileSwitchWidth = 6.0;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 22.0; \/\/ originally 25mm in Typeatron #2, based on the model; this was a bit too high\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 67; \/\/ Typeatron #1 and #2 were both 70mm wide\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nfingerButtonHeight = 5;\nthumbButtonHeight = 8; \/\/ thumb button is a little taller because it is not deeply inset like the finger buttons\nbuttonWidth = tactileSwitchWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = 0;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + fingerButtonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + thumbButtonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = pressureSensorTailThick + foreignPartClearance;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length, buttonHeight) {\n innerRetainerWellWidth = (length - tactileSwitchWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorHeadThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n difference() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n \/\/ remove the bottom half of the cylinder, which could protrude below the button body\n translate([0, 0, buttonWidth\/2]) {\n cube(length, buttonWidth, buttonWidth\/2 + overkill);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length, buttonHeight) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n translate([-(pressureSensorTailWidth+foreignPartClearance)\/2,0,-tactileSwitchLegLength]) {\n translate([0, -w\/2, 0]) {\n cube([pressureSensorTailWidth+foreignPartClearance, pressureSensorChannelHeight+overkill, fsrChannelDepth]);\n }\n translate([0, w\/2-pressureSensorChannelHeight, 0]) {\n cube([pressureSensorTailWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength, buttonHeight) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+overkill, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+overkill, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength, buttonHeight);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-25]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-50]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight - floorThick - ledRimRadius - foreignPartClearance]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n \/\/ extra material is required if the button starts below the rim of the case\n depth = (thumbUpperRightY < caseLength - rimThick) ?\n totalThumbWellDepth + (caseLength - rimThick - thumbUpperRightY)\n : totalThumbWellDepth;\n y = (thumbUpperRightY < caseLength - rimThick) ?\n caseLength - rimThick\n : thumbUpperRightY;\n\n translate([thumbUpperRightX, y, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(depth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalThumbWellDepth, thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+overkill,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength, fingerButtonHeight);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1+overkill]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n\nSome details to double-check before printing:\n * channel for index finger's pressure sensor does not intersect thumb button structure\n Ideally, let it be entirely below, so that the sensor can lie flat on the case floor\n\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs and buttons in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\n\/\/ hollow out buttons to save plastic\/money (possible only with thick buttons)\nhollowButtons = false;\n\n\/\/ put pinholes in strategic locations where there is insuficient solid material for a hole;\n\/\/ this requires a column to be built around the hole. The columns take up valuable space,\n\/\/ but better coverage with pinholes makes it possible to secure the lid more firmly to the case\nfloatingPinHoles = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\/\/ a slight overestimate of the sizes of subtracted objects which prevents a confusing \"film\" in the STL\noverkill = 0.001;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = shapewaysAccuracy;\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of the particular printer\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorHeadWidth = 7.8; \/\/ by direct measurement of the wide \"head\". The data sheet says 7.2mm\npressureSensorHeadThick = 0.40; \/\/ by direct measurement, without removing the adhesive backing. The data sheet says 0.35mm\npressureSensorTailWidth = 6.3; \/\/ by direct measurement\npressureSensorTailThick = 0.90; \/\/ by direct measurement; this is the thick segment of the sensor with the electrical contacts\n\ntactileSwitchWidth = 6.0;\ntactileSwitchHeight = 5.0;\ntactileSwitchLegLength = 3.4;\ntactileSwitchPressDepth = 0.25;\ntactileSwitchWellDepth = 4.0; \/\/ this is the height of the body of the tactile switch (without the push button)\ntactileSwitchBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 22.0; \/\/ originally 25mm in Typeatron #2, based on the model; this was a bit too high\nfingerNotchDepth = 5; \/\/ curve in which fingers rest\nthumbNotchDepth = 5; \/\/ curve in which the thumb would rest, in the absence of a button\n\n\/\/ reasonably chosen values\ncaseWidth = 67; \/\/ Typeatron #1 and #2 were both 70mm wide\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nfingerButtonHeight = 5;\nthumbButtonHeight = 8; \/\/ thumb button is a little taller because it is not deeply inset like the finger buttons\nbuttonWidth = tactileSwitchWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\n\/\/ clearance between button and walls (on all four sides). We take the risk of a low tolerance for the sake of a snug fit\nbuttonClearance = accuracy \/ 2;\nbuttonLip = 2.5;\nbuttonSlack = tactileSwitchPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = tactileSwitchHeight - (tactileSwitchPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by 2\/3 of the depth of the finger or thumb notch, making most of the contact of the finger\n\/\/ with the case rather than the button. This should make the Typeatron easy to grip while typing. Direct inward\n\/\/ pressure must be exerted on the button in order to close the switch.\nfingerButtonInsetDepth = fingerNotchDepth * 2\/3;\nthumbButtonInsetDepth = 0;\n\ntotalFingerWellDepth = fingerButtonInsetDepth + fingerButtonHeight + tactileSwitchHeight;\ntotalThumbWellDepth = thumbButtonInsetDepth + thumbButtonHeight + tactileSwitchHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = pressureSensorTailThick + foreignPartClearance;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - tactileSwitchBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length, buttonHeight) {\n innerRetainerWellWidth = (length - tactileSwitchWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2 * buttonRetainerThick\n + (tactileSwitchHeight - tactileSwitchWellDepth + foreignPartClearance)\n + pressureSensorHeadThick\n + 0.15;\n\n difference() {\n union() {\n \/\/ rounded cap\n difference() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n \/\/ remove the bottom half of the cylinder, which could protrude below the button body\n translate([0, 0, buttonWidth\/2]) {\n cube(length, buttonWidth, buttonWidth\/2 + overkill);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t if (hollowButtons) {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n }\n}\n\n\/\/ a complex well which houses a finger button and prevents it from detaching from the Typeatron\nmodule fingerButtonWell(length, buttonHeight) {\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - tactileSwitchWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n translate([-length\/2,-buttonWidth\/2,tactileSwitchWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]); \/\/ clearance of 10 is more than enough\n\n \/\/ retainer wells\n translate([0,0,-tactileSwitchWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, tactileSwitchWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ well for four-legged through-hole tactile push button switch with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule tactileSwitchWell(length, depth) {\n w = tactileSwitchWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n \/\/ the pressure sensor channels extend slightly past the well for the tactile switch\n fsrChannelDepth = tactileSwitchLegLength + tactileSwitchHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-tactileSwitchLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+tactileSwitchLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n translate([-(pressureSensorTailWidth+foreignPartClearance)\/2,0,-tactileSwitchLegLength]) {\n translate([0, -w\/2, 0]) {\n cube([pressureSensorTailWidth+foreignPartClearance, pressureSensorChannelHeight+overkill, fsrChannelDepth]);\n }\n translate([0, w\/2-pressureSensorChannelHeight, 0]) {\n cube([pressureSensorTailWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n}\n\n\/\/ notchDepth: depth of semi-circular rest for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of tactile switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(notchDepth, width, totalWellDepth, buttonLength, buttonHeight) {\n x = width \/ 2;\n y = notchDepth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - notchDepth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - notchDepth, 0, rimThick]) {\n cylinder(h=rimThick+overkill, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - notchDepth,0,0]) {\n cylinder(h=rimThick+overkill, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for finger button, tactile switch, wires, and pressure sensor\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n fingerButtonWell(buttonLength, buttonHeight);\n tactileSwitchWell(buttonLength, tactileSwitchWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-tactileSwitchBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+tactileSwitchBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerButtonInsetDepth,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - thumbButtonInsetDepth, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength, fingerButtonHeight);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n if (floatingPinHoles) {\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalThumbWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbNotchDepth, thumbWidth, totalThumbWellDepth, thumbButtonLength, thumbButtonHeight);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+overkill,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - overkill,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n if (floatingPinHoles) {\n \/\/ columns for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ columns for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalThumbWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerNotchDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength, fingerButtonHeight);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n translate([0,0,-1]) {\n cube([caseWidth, caseLength, buttonLidHeight+1+overkill]);\n }\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bf568bf7a67030a444df1de2af446f29a31c0412","subject":"y\/carriage-belt-clamp: use material system","message":"y\/carriage-belt-clamp: use material system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-carriage-belt-clamp.scad","new_file":"y-carriage-belt-clamp.scad","new_contents":"include \nuse \ninclude \n\nmodule yaxis_belt_holder(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_belt_holder(part=\"pos\");\n yaxis_belt_holder(part=\"neg\");\n }\n %yaxis_belt_holder(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ base (screws etc)\n rcubea([yaxis_belt_mount_width_base,yaxis_belt_mount_depth_base,yaxis_belt_mount_base_thick], align=Z);\n\n \/\/ for belt attachment\n rcubea([yaxis_belt_mount_width_belt,yaxis_belt_mount_depth,yaxis_belt_mount_height], align=-Z, extrasize=Z*yaxis_belt_mount_base_thick, extrasize_align=Z);\n\n \/*intersection()*\/\n \/*{*\/\n \/*hull()*\/\n \/*{*\/\n \/*\/\/ base (screws etc)*\/\n \/*rcubea([yaxis_belt_mount_width_base,yaxis_belt_mount_depth_base,yaxis_belt_mount_base_thick], align=Z);*\/\n\n \/*\/\/ for belt attachment*\/\n \/*rcubea([yaxis_belt_mount_width_belt,yaxis_belt_mount_depth,yaxis_belt_mount_height], align=-Z);*\/\n \/*}*\/\n\n \/*\/\/ for belt attachment*\/\n \/*rcubea([yaxis_belt_mount_width_belt,1000,yaxis_belt_mount_height], align=-Z);*\/\n \/*}*\/\n }\n else if(part==\"neg\")\n {\n \/\/ for belt attachment\n rcubea([yaxis_belt_mount_width_base*2,yaxis_belt_mount_belt_gap,yaxis_belt_mount_height+1], align=-Z);\n\n for(y=[-1,1])\n translate(Y*y*yaxis_belt_mounthole_dist\/2)\n screw_cut(nut=yaxis_belt_mounthole_nut, orient=Z, align=Z);\n \/*cylindera(d=yaxis_belt_mounthole_thread_dia,yaxis_belt_mount_base_thick*2, align=Z, orient=Z);*\/\n }\n}\n\nmodule part_y_carriage_belt_holder()\n{\n conn = [N,-Z];\n attach(conn, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n}\n","old_contents":"include \nuse \n\nmodule yaxis_belt_holder(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_belt_holder(part=\"pos\");\n yaxis_belt_holder(part=\"neg\");\n }\n %yaxis_belt_holder(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ base (screws etc)\n rcubea([yaxis_belt_mount_width_base,yaxis_belt_mount_depth_base,yaxis_belt_mount_base_thick], align=Z);\n\n \/\/ for belt attachment\n rcubea([yaxis_belt_mount_width_belt,yaxis_belt_mount_depth,yaxis_belt_mount_height], align=-Z, extrasize=Z*yaxis_belt_mount_base_thick, extrasize_align=Z);\n\n \/*intersection()*\/\n \/*{*\/\n \/*hull()*\/\n \/*{*\/\n \/*\/\/ base (screws etc)*\/\n \/*rcubea([yaxis_belt_mount_width_base,yaxis_belt_mount_depth_base,yaxis_belt_mount_base_thick], align=Z);*\/\n\n \/*\/\/ for belt attachment*\/\n \/*rcubea([yaxis_belt_mount_width_belt,yaxis_belt_mount_depth,yaxis_belt_mount_height], align=-Z);*\/\n \/*}*\/\n\n \/*\/\/ for belt attachment*\/\n \/*rcubea([yaxis_belt_mount_width_belt,1000,yaxis_belt_mount_height], align=-Z);*\/\n \/*}*\/\n }\n else if(part==\"neg\")\n {\n \/\/ for belt attachment\n rcubea([yaxis_belt_mount_width_base*2,yaxis_belt_mount_belt_gap,yaxis_belt_mount_height+1], align=-Z);\n\n for(y=[-1,1])\n translate(Y*y*yaxis_belt_mounthole_dist\/2)\n screw_cut(nut=yaxis_belt_mounthole_nut, orient=Z, align=Z);\n \/*cylindera(d=yaxis_belt_mounthole_thread_dia,yaxis_belt_mount_base_thick*2, align=Z, orient=Z);*\/\n }\n}\n\nmodule part_y_carriage_belt_holder()\n{\n conn = [N,-Z];\n attach(conn, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"63009517e6dcfaa5e6f9468d6754da1182088ded","subject":"correct sizes","message":"correct sizes\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/Multirotors,DanNixon\/BubbleCopter","old_file":"Suika\/config.scad","new_file":"Suika\/config.scad","new_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0.05;\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* Flight control board *\/\nFC_DIMENSIONS = [20, 34, 5]; \/\/ 5mm maximum height at JST connectors\nFC_POSITION = [0, 0];\nFC_RETENTION_OFFSET = [0, -4];\n\n\/* Motors *\/\nPROP_DIAMETER = 55;\nMOTOR_DIMENSIONS = [8.5, 20]; \/\/ [diameter, length]\n\nMOTOR_DIST_X = 37.5;\nMOTOR_DIST_Y = 37.5;\n\nMOTOR_POSITIONS = [\n [MOTOR_DIST_X, MOTOR_DIST_Y],\n [-MOTOR_DIST_X, MOTOR_DIST_Y],\n [MOTOR_DIST_X, -MOTOR_DIST_Y],\n [-MOTOR_DIST_X, -MOTOR_DIST_Y]\n];\n\n\/* Arm motor wiring holes *\/\nWIRING_HOLE_OFFSET = 0.7;\nWIRING_HOLE_DIAMETER = 2;\n\n\/* Frame *\/\nARM_WIDTH = 13.5;\nPLATE_DIMENSIONS = [30, 45];\n\n\/* Fixings\/cutouts *\/\nZIP_TIE_HOLE_DIAM = 3;\n\n\/* FPV camera *\/\nFPV_CAMERA_ANGLE = 30;\nFPV_CAMERA_POSITON = [0, 2, 16];\n\n\/* Camera mount *\/\nCAMERA_BRACKET_SPACING = 25;\nCAMERA_BRACKET_LENGTH = PLATE_DIMENSIONS[1] * 0.9;\nCAMERA_BRACKET_BASE_HEIGHT = 8;\nCAMERA_BRACKET_CAM_SPACING = 5;\nCAMERA_BRACKET_TAB_WIDTH = 5;\nCAMERA_BRACKET_TAB_OFFSET = CAMERA_BRACKET_LENGTH * 0.325;\n","old_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0.05;\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* Flight control board *\/\nFC_DIMENSIONS = [20, 34, 5]; \/\/ 5mm maximum height at JST connectors\nFC_POSITION = [0, 0];\nFC_RETENTION_OFFSET = [0, -4];\n\n\/* Motors *\/\n\/* TODO: check dimensions *\/\nPROP_DIAMETER = 60;\nMOTOR_DIMENSIONS = [8.5, 22]; \/\/ [diameter, length]\n\nMOTOR_DIST_X = 37.5;\nMOTOR_DIST_Y = 37.5;\n\nMOTOR_POSITIONS = [\n [MOTOR_DIST_X, MOTOR_DIST_Y],\n [-MOTOR_DIST_X, MOTOR_DIST_Y],\n [MOTOR_DIST_X, -MOTOR_DIST_Y],\n [-MOTOR_DIST_X, -MOTOR_DIST_Y]\n];\n\n\/* Arm motor wiring holes *\/\nWIRING_HOLE_OFFSET = 0.7;\nWIRING_HOLE_DIAMETER = 2;\n\n\/* Frame *\/\nARM_WIDTH = 13.5;\nPLATE_DIMENSIONS = [30, 45];\n\n\/* Fixings\/cutouts *\/\nZIP_TIE_HOLE_DIAM = 3;\n\n\/* FPV camera *\/\nFPV_CAMERA_ANGLE = 30;\nFPV_CAMERA_POSITON = [0, 2, 16];\n\n\/* Camera mount *\/\nCAMERA_BRACKET_SPACING = 25;\nCAMERA_BRACKET_LENGTH = PLATE_DIMENSIONS[1] * 0.9;\nCAMERA_BRACKET_BASE_HEIGHT = 8;\nCAMERA_BRACKET_CAM_SPACING = 5;\nCAMERA_BRACKET_TAB_WIDTH = 5;\nCAMERA_BRACKET_TAB_OFFSET = CAMERA_BRACKET_LENGTH * 0.325;\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e2c599c8aa2f8c64c907a13849d56111f380c1dc","subject":"whitespace refactor","message":"whitespace refactor\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/vases\/Chompworks\/sine\/EvilVase1-cylinder.scad","new_contents":"\/\/ originially from:\n\/\/ Sine Cube Vase 1 by @Chompworks\n\/\/ Original at: https:\/\/www.thingiverse.com\/thing:2666281\n\/\/ Released under the Creative Commons CC - BY 3.0 licence\n\/\/ Details here: https:\/\/creativecommons.org\/licenses\/by\/3.0\/\n\/\/\n\/\/ customizer modifications by Roberto Marquez inclue cylinder and sphere options\n\/\/ https:\/\/www.thingiverse.com\/onebeartoe\/designs\n\ncubeOrCylinder = \"cylinder\"; \/\/ [cube, cylinder, sphere]\n\ninternalCutout_bottomRadius = 43; \/\/ [30 : 1 : 45]\n\n\/* [Hidden] *\/\n\nstep=4; \/\/ number of degrees to step for each cuboid element\n\nmaxlayers=100; \/\/ max number of layers. More layers slows down compilation on [F6], but makes the vase taller\n\nbasewidth=50; \/\/ basic length of a cuboid\n\ndifference() \/\/ Take away the two parts at the bottom\n{\n union() \/\/ this stitches all the cuboids together\n {\n translate([0,0,-80])\n for (layers=[1:maxlayers]) \/\/ make each slice\n {\n for (angle=[1:step:360])\n {\n translate([0,0,layers*2]) \/\/ move the cuboid up to where it needs to be!\n rotate([0,0,angle]) \/\/ rotate the cuboid\n rotate([45,-45,0]) \/\/ rotate the cuboid for the best effect\n translate([0,-1,0]) \/\/ move the cuboid. This minus 1 offset just worked well!\n\n\n if(cubeOrCylinder == \"cylinder\")\n {\n cylinderHeight = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n cylinder(r=2, h=cylinderHeight, $fn=20);\n }\n else if( cubeOrCylinder == \"sphere\")\n {\n sphereHeight = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n color(\"blue\")\n translate([sphereHeight, 0, 0])\n sphere(r = 5);\n }\n else\n {\n cube_xLength = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n \t\t\t\tcube([cube_xLength, 4, 4]);\n\n \/\/ lets explain this!\n \/\/ make a 4x4 square\n \/\/ then extrude it by:\n \/\/ basewidth - a constant. this is the minimum length of any cuboid\n \/\/ PLUS\n \/\/ (layers\/maxlayers*30) - this makes the vase taper outward as it gets taller. A sine function on this could make it act more like a pot\/urn [Thin, Fat, Thin]\n \/\/ PLUS\n \/\/ 10*cos(layers*15)*sin(angle*8) - this is a nasty bit of trig at first!\n \/\/ the sine function controls the bumps. Multiplying the angle by 8 means that rather than 1 bump, there are 8 for any given layer\n \/\/ the cosine function (layers*15) makes the bumps also occur in the Z axis as they go up. If you removed this, the vase becomes very straight\n }\n }\n }\n }\n\n \/\/this removes the cone base and leaves a flat base for the vase\n translate([-500,-500,-100])\n cube([1000,1000,100]);\n\n \/\/ this adds an internal hollow, 5mm up from the base\n internalCutout_TopRadius = internalCutout_bottomRadius + 22;\n translate([0,0,5])\n cylinder(r1 = internalCutout_bottomRadius, r2 = internalCutout_TopRadius, h = maxlayers * 2, $fn = 360\/step);\n}\n","old_contents":"\/\/ originially from:\n\/\/ Sine Cube Vase 1 by @Chompworks\n\/\/ Original at: https:\/\/www.thingiverse.com\/thing:2666281\n\/\/ Released under the Creative Commons CC - BY 3.0 licence\n\/\/ Details here: https:\/\/creativecommons.org\/licenses\/by\/3.0\/\n\/\/ customizer modifications by Roberto Marquez\n\/\/ https:\/\/www.thingiverse.com\/onebeartoe\/designs\n\ncubeOrCylinder = \"cylinder\"; \/\/ [cube, cylinder]\n\ninternalCutout_bottomRadius = 43; \/\/ [30 : 1 : 45]\n\n\/* [Hidden] *\/\n\nstep=4; \/\/ number of degrees to step for each cuboid element\n\nmaxlayers=100; \/\/ max number of layers. More layers slows down compilation on [F6], but makes the vase taller\n\nbasewidth=50; \/\/ basic length of a cuboid\n\ndifference() \/\/ Take away the two parts at the bottom\n{\n union() \/\/ this stitches all the cuboids together\n {\n translate([0,0,-80])\n for (layers=[1:maxlayers]) \/\/ make each slice\n {\n for (angle=[1:step:360])\n {\n translate([0,0,layers*2]) \/\/ move the cuboid up to where it needs to be!\n rotate([0,0,angle]) \/\/ rotate the cuboid\n rotate([45,-45,0]) \/\/ rotate the cuboid for the best effect\n translate([0,-1,0]) \/\/ move the cuboid. This minus 1 offset just worked well!\n\n\/\/echo(\"sure\");\n if(cubeOrCylinder == \"cylinder\")\n {\n cylinderHeight = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n\/\/union()\n\/\/{\n\/\/ cylinder(r=2, h=cylinderHeight, $fn=20);\n\n\n\/\/echo(\"sure\");\ncolor(\"blue\")\ntranslate([cylinderHeight, 0, 0])\nsphere(r = 5);\n\/\/}\n }\n else\n {\n cube_xLength = basewidth + (layers\/maxlayers*30) + 10*cos(layers*15) * sin(angle*8);\n\n \t\t\t\tcube([cube_xLength, 4, 4]);\n\n \/\/ lets explain this!\n \/\/ make a 4x4 square\n \/\/ then extrude it by:\n \/\/ basewidth - a constant. this is the minimum length of any cuboid\n \/\/ PLUS\n \/\/ (layers\/maxlayers*30) - this makes the vase taper outward as it gets taller. A sine function on this could make it act more like a pot\/urn [Thin, Fat, Thin]\n \/\/ PLUS\n \/\/ 10*cos(layers*15)*sin(angle*8) - this is a nasty bit of trig at first!\n \/\/ the sine function controls the bumps. Multiplying the angle by 8 means that rather than 1 bump, there are 8 for any given layer\n \/\/ the cosine function (layers*15) makes the bumps also occur in the Z axis as they go up. If you removed this, the vase becomes very straight\n }\n }\n }\n }\n\n \/\/this removes the cone base and leaves a flat base for the vase\n translate([-500,-500,-100])\n cube([1000,1000,100]);\n\n \/\/ this adds an internal hollow, 5mm up from the base\n internalCutout_TopRadius = internalCutout_bottomRadius + 22;\n translate([0,0,5])\n cylinder(r1 = internalCutout_bottomRadius, r2 = internalCutout_TopRadius, h = maxlayers * 2, $fn = 360\/step);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"1e281a89a39f283f6c3c576797019b9893a42c1f","subject":"main: minor cleanup","message":"main: minor cleanup\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - zaxis_rod_d\/2 - xaxis_end_width_right(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2+extrusion_size+zaxis_rod_d\/2+xaxis_end_motor_offset.x))\n rotate(90*X)\n belt_path(\n len=-xaxis_end_motor_offset.x+extrusion_size+zaxis_rod_d\/2+(main_width-2*extrusion_size-2*zaxis_rod_d\/2),\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n tx(x*(main_width\/2))\n ty(xaxis_zaxis_distance_y)\n tx(-x*(extrusion_size+zaxis_rod_d\/2))\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n tx(x*(yaxis_rod_distance\/2))\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n \/*render()*\/\n tz(-main_lower_dist_z\/2)\n gantry_lower();\n\n \/*render()*\/\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n \/*render()*\/\n x_axis();\n\n \/*render()*\/\n y_axis();\n\n \/*render()*\/\n z_axis();\n\n \/*render()*\/\n \/*translate([-75*mm,0,0])*\/\n \/*translate([0,main_depth\/2,0])*\/\n \/*translate([0,extrusion_size,0])*\/\n \/*translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])*\/\n \/*power_panel_iec320(orient=[0,-1,0], align=Y);*\/\n\n if(!$preview_mode)\n {\n render()\n ty(-main_depth\/2)\n ty(-extrusion_size\/2)\n tz(-main_lower_dist_z\/2)\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render()\n psu_a();\n\n render()\n mirror([x==-1?1:0,0,0])\n ty(-psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_side();\n\n render()\n translate(psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_back();\n }\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - zaxis_rod_d\/2 - xaxis_end_width_right(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2+extrusion_size+zaxis_rod_d\/2+xaxis_end_motor_offset.x))\n rotate(90*X)\n belt_path(\n len=-xaxis_end_motor_offset.x+extrusion_size+zaxis_rod_d\/2+(main_width-2*extrusion_size-2*zaxis_rod_d\/2),\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n tx(x*(main_width\/2))\n ty(xaxis_zaxis_distance_y)\n tx(-x*(extrusion_size+zaxis_rod_d\/2))\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n tx(x*(yaxis_rod_distance\/2))\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n \/*render()*\/\n tz(-main_lower_dist_z\/2)\n gantry_lower();\n\n \/*render()*\/\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n \/*render()*\/\n x_axis();\n\n \/*render()*\/\n y_axis();\n\n \/*render()*\/\n z_axis();\n\n \/*render()*\/\n \/*translate([-75*mm,0,0])*\/\n \/*translate([0,main_depth\/2,0])*\/\n \/*translate([0,extrusion_size,0])*\/\n \/*translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])*\/\n \/*power_panel_iec320(orient=[0,-1,0], align=Y);*\/\n\n if(!$preview_mode)\n {\n render()\n ty(-main_depth\/2)\n ty(-extrusion_size\/2)\n tz(-main_lower_dist_z\/2)\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render()\n psu_a();\n\n render()\n mirror([x==-1?1:0,0,0])\n ty(-psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_side();\n\n render()\n translate(psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_back();\n }\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2b3806180e1335a53cbe62516906d4bc08293795","subject":"misc: add geth","message":"misc: add geth\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_key) = \n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0];\n\nfunction geth(S, col_key, row_index) = \nlet(col_index = header_col_index(S, col_key))\nS[row_index+1][col_index];\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n}\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"073459446730d2cc2eb79fbb74387cd6b376f554","subject":"misc: add spread function","message":"misc: add spread function\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9839809bf9c60e687bdef08b72e979ac3a760f6c","subject":"wall suport a bit thicker","message":"wall suport a bit thicker\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/support.scad","new_file":"tablet_toilet_mount\/support.scad","new_contents":"use \n\nmodule _supportSurface()\n{\n difference()\n {\n union()\n {\n difference()\n {\n \/\/ root element\n cube([150, 40, 2]);\n \/\/ holes\n for(offset = [30, 90])\n translate([offset, 10, 0])\n cube([30, 20, 2]);\n }\n \/\/ lower stripe for wall-support\n off = 4;\n translate([0, -off, 0])\n cube([150, off, 3.5]);\n \/\/ upport tablet block-wall\n translate([0, 40-2, 0])\n cube([150, 2, 9]);\n }\n \/\/ lock cut-in\n radius = 7.5;\n translate([150\/2, 40-(10), 0])\n rotate([-90, 0, 0])\n cylinder(h=10, r=radius, $fs=0.01);\n }\n}\n\n\nmodule support()\n{\n _supportSurface();\n for(offset = [10+(3+1), 150-10-3-(3+1)])\n translate([offset, 0, 2])\n joint(2);\n}\n\n\nsupport();\n","old_contents":"use \n\nmodule _supportSurface()\n{\n difference()\n {\n union()\n {\n difference()\n {\n \/\/ root element\n cube([150, 40, 2]);\n \/\/ holes\n for(offset = [30, 90])\n translate([offset, 10, 0])\n cube([30, 20, 2]);\n }\n \/\/ lower stripe for wall-support\n off = 4;\n translate([0, -off, 0])\n cube([150, off, 3]);\n \/\/ upport tablet block-wall\n translate([0, 40-2, 0])\n cube([150, 2, 9]);\n }\n \/\/ lock cut-in\n radius = 7.5;\n translate([150\/2, 40-(10), 0])\n rotate([-90, 0, 0])\n cylinder(h=10, r=radius, $fs=0.01);\n }\n}\n\n\nmodule support()\n{\n _supportSurface();\n for(offset = [10+(3+1), 150-10-3-(3+1)])\n translate([offset, 0, 2])\n joint(2);\n}\n\n\nsupport();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7d2b510946c75f2824b7b8955e3ad5fdf1af5a1d","subject":"shoulder spacers compelete","message":"shoulder spacers compelete\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n } \n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 6), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"2318aeada1873494f7063b61d96739cbca479b37","subject":"removed some debugging pieces","message":"removed some debugging pieces\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n\/\/$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\n\/\/render()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\nsharpieDiameter = 13;\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = sharpieDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + sharpieDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n\/\/$fn = 64; \/\/ production\n\/\/$fn = 48; \/\/ development\n$fn = 24; \/\/ LQ\necho($fn);\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\nrender()\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n \/\/render() \n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)]) \n difference() { \/\/ base w\/ cutout for seeing into the joint\n \n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n intersection() { \/\/ cutout\n difference() {\n cylinder(h = bearingStep * 2, d = .85 * bearingOD);\n cylinder(h = bearingStep * 2, d = .35 * bearingOD);\n }\n translate([-bearingOD, -bearingOD\/2, 0])\n cube([bearingOD, bearingOD, bearingStep * 2], center = false);\n }\n }\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n \/\/ spokes\n rotate([0, 0, 150])\n radial_array_partial(vec=[0, 0, 1], n = 6, 2)\n translate([hubRadius - (bearingStep \/ 2), -(spokeWidth \/ 2), -(bearingStep * 2)]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, bearingStep], center = false);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n \/* original *\/\nsharpieDiameter = 13;\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = sharpieDiameter);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n #translate([-forearmLength + sharpieDiameter, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n\/**\/\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"6092b3cedd760221ae16aaf595d785aa27d763cd","subject":"The holes were added for the keys as well as a cutout for the mounting panel of the keys.","message":"The holes were added for the keys as well as a cutout for the mounting panel of the keys.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/shortcut\/examples\/trinket-mini\/trinket-mini-shortcut-keyboard.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/shortcut\/examples\/trinket-mini\/trinket-mini-shortcut-keyboard.scad","new_contents":"\r\nuse <..\/..\/..\/..\/..\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/microcontrollers\/adafruit\/trinket-mini\/mounting-standoffs\/trinket-mini-mounting-standoffs.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/office\/keyboard\/panels\/keyboard-panel.scad>\r\n\r\ntrinketMiniShortcutKeyboard();\r\n\r\nmodule frameWithTrinketMounts(boardLengthZ, cornerRadius)\r\n{\r\n\tunion()\r\n\t{\r\n\t\tboardLengthX = 60;\r\n\t\tboardLengthY = 60;\r\n\r\n\t\troundedCubeEnclosure(boardLengthX = boardLengthX,\r\n\t\t\t\t\t\t\tboardLengthY = boardLengthY,\r\n\t\t\t\t\t\t\tboardLengthZ = boardLengthZ,\r\n\t\t\t\t\t\t\tcornerRadius = cornerRadius,\r\n\t\t\t\t\t\t\txAxisCutout_yPercentage = 0.8,\r\n\t\t\t\t\t\t\txAxisCutout_zPercentage = 0.8,\r\n\t\t\t\t\t\t\tyAxisCutout_xPercentage = 0.85,\r\n\t\t\t\t\t\t\tyAxisCutout_zPercentage = 0.75);\r\n\r\n\t\txTranslate = (boardLengthX + cornerRadius) * 0.6;\r\n\t\tyTranslate = (boardLengthY + cornerRadius) * 0.3;\r\n\t\tzTranslate = 2;\r\n\r\n\t\tcolor(\"red\")\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\ttrinketMiniStandoffs();\r\n\t}\r\n}\r\n\r\nmodule trinketMiniShortcutKeyboard()\r\n{\r\n\tboardLengthZ = 30;\r\n\tbuttonSide = 12;\r\n\tcornerRadius = 3;\r\n\r\n\tdifference()\r\n\t{\r\n\t\tframeWithTrinketMounts(boardLengthZ, cornerRadius);\r\n\r\n\t\txTranslate = -12;\r\n\t\tyTranslate = 1;\r\n\t\tzTranslate = boardLengthZ * 0.8;\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\tkeyboardHoles(buttonCount = 4,\r\n\t\t\t\t\t buttonSide = buttonSide,\r\n\t\t\t\t \t panelHeight = 5);\r\n\r\n\t\t panelCutout_xLength = buttonSide + 4;\r\n\t\t panelCutout_yLength = (panelCutout_xLength * 4) - 5;\r\n\t\t panelCutout_zLength = 10;\r\n\t\t panelCutout_xTranslate = 2;\r\n\t\t panelCutout_yTranslate = 0;\r\n\t\t panelCutout_zTranslate = (boardLengthZ + cornerRadius) - panelCutout_zLength - 1; \/\/ the minus 1 is for the panel mount height\r\n\t\t color(\"pink\")\r\n\t\t translate([panelCutout_xTranslate, panelCutout_yTranslate, panelCutout_zTranslate])\r\n\t\t cube([panelCutout_xLength, panelCutout_yLength, panelCutout_zLength]);\r\n\t}\r\n}\r\n","old_contents":"\r\nuse <..\/..\/..\/..\/..\/basics\/rounded-edges\/rounded-cube-enclosure\/rounded-cube-enclosure.scad>\r\n\r\nuse <..\/..\/..\/..\/..\/microcontrollers\/adafruit\/trinket-mini\/mounting-standoffs\/trinket-mini-mounting-standoffs.scad>\r\n\r\ntrinketMiniShortcutKeyboard();\r\n\r\nmodule frameWithTrinketMounts()\r\n{\r\n\tunion()\r\n\t{\r\n\t\tboardLengthX = 60;\r\n\t\tboardLengthY = 60;\r\n\t\tcornerRadius = 3;\r\n\t\troundedCubeEnclosure(boardLengthX = boardLengthX,\r\n\t\t\t\t\t\t\tboardLengthY = boardLengthY,\r\n\t\t\t\t\t\t\tboardLengthZ = 30,\r\n\t\t\t\t\t\t\tcornerRadius = cornerRadius,\r\n\t\t\t\t\t\t\txAxisCutout_yPercentage = 0.8,\r\n\t\t\t\t\t\t\txAxisCutout_zPercentage = 0.8,\r\n\t\t\t\t\t\t\tyAxisCutout_xPercentage = 0.85,\r\n\t\t\t\t\t\t\tyAxisCutout_zPercentage = 0.75);\r\n\r\n\t\txTranslate = (boardLengthX + cornerRadius) * 0.6;\r\n\t\tyTranslate = (boardLengthY + cornerRadius) * 0.3;\r\n\t\tzTranslate = 2;\r\n\r\n\t\tcolor(\"red\")\r\n\t\ttranslate([xTranslate, yTranslate, zTranslate])\r\n\t\ttrinketMiniStandoffs();\r\n\t}\r\n}\r\n\r\nmodule trinketMiniShortcutKeyboard()\r\n{\r\n\tframeWithTrinketMounts();\r\n\r\n\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"604e14830e302e1e2d1212bdbf2d061a2f5442f8","subject":"stepper: misc improvements","message":"stepper: misc improvements\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"stepper.scad","new_file":"stepper.scad","new_contents":" \/\/ Some code from MCAD\/stepper.scad\n \/\/ Originally by Hans H\u00e4ggstr\u00f6m, 2010.\n \/\/ Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later\n\ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \n\n\/*test2();*\/\n\nmodule test()\n{\n for (size = AllNemaSizes)\n {\n ty(size*100)\n stack(axis=X, dist=100)\n {\n motor(model=Nema34, size=size, dual_axis=true);\n motor(model=Nema23, size=size, dual_axis=true);\n motor(model=Nema17, size=size, dual_axis=true);\n motor(model=Nema14, size=size, dual_axis=true);\n motor(model=Nema11, size=size, dual_axis=true);\n motor(model=Nema08, size=size, dual_axis=true);\n }\n }\n}\n\nmodule test2()\n{\n model = Nema17;\n size = NemaMedium;\n motor_mount(model=model, size=size, dual_axis=true);\n}\n\nfunction motorWidth(model) = get(NemaSideSize, model);\nfunction motorLength(model, size=NemaMedium) = get(size, model);\n\nmodule motor_mount(part=U, model, thickness, size=NemaMedium, extra_size=U, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"motor_mount(): model==U\");\n assert(thickness!=U, \"motor_mount(): thickness==U\");\n assert(size!=U, \"motor_mount(): size==U\");\n\n length = get(size, model);\n side = get(NemaSideSize, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n s=[side+fallback(extra_size.x,0), side+fallback(extra_size.y,0), length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n material(Mat_Plastic)\n render()\n difference()\n {\n motor_mount(part=\"pos\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n motor_mount(part=\"neg\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n\n if($show_vit)\n motor_mount(part=\"vit\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n else if(part==\"pos\")\n {\n rcubea([s.x,s.y,thickness], align=Z);\n }\n else if(part==\"neg\")\n {\n cylindera(h=thickness+.1, r=extrRad, align=Z, extra_h=.1, extra_align=-Z);\n\n \/\/ main motor\n tz(-s.z)\n cubea(size=[side+.3*mm,side+.3*mm,length], align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=thickness+.1, r=holeRadius, align=Z, extra_h=.1, extra_align=-Z);\n\n }\n else if(part==\"vit\")\n {\n motor(model=model, size=size, dualAxis=dual_axis, orient=Z);\n }\n}\n\nmodule motor(part=U, model, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n side = get(NemaSideSize, model);\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n holeDepth = get(NemaMountingHoleDepth, model);\n\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n mid = side \/ 2;\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n s=[side, side, length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n difference()\n {\n motor(part=\"pos\", model=model, size=size, dual_axis=dual_axis);\n motor(part=\"neg\", model=model, size=size, dual_axis=dual_axis);\n }\n motor(part=\"vit\", model=model, size=size, dual_axis=dual_axis);\n\n motor_axle(model=model, size=size, dual_axis=dual_axis);\n }\n if(part==\"echo\")\n {\n echo(str(\" Motor: Nema\",get(NemaModel, model),\", length= \",length,\"mm, dual axis=\",dual_axis));\n }\n else if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n tz(-s.z)\n cubea(s, align=Z, extra_size=Z*extrSize, extra_align=Z);\n }\n else if(part==\"neg\")\n {\n \/\/ Axle hole\n material(Mat_Aluminium)\n cylindera(r=axleRadius+.2*mm, h=1000);\n\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=Z);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=Z, extra_size=.1*Z, extra_align=-Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=holeDepth+.1*mm, r=holeRadius, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ Grinded flat\n material(Mat_BlackPaint)\n difference()\n {\n cubea(size=[side+.1, side+.1, extrSize+.1], align=Z);\n cylindera(h=extrSize, r=extrRad, align=Z);\n }\n }\n}\n\nmodule motor_axle(model=Nema23, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n axleLengthFront = get(NemaFrontAxleLength, model);\n axleLengthBack = get(NemaBackAxleLength, model);\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n axleFlatDepth = get(NemaAxleFlatDepth, model);\n axleFlatLengthFront = get(NemaAxleFlatLengthFront, model);\n axleFlatLengthBack = get(NemaAxleFlatLengthBack, model);\n\n material(Mat_Steel)\n render()\n intersection()\n {\n material(Mat_Aluminium)\n tz(-length)\n cylindera(r=axleRadius, h=length+extrSize+axleLengthFront, align=Z, extra_h=dual_axis?axleLengthBack:0, extra_align=-Z);\n\n material(Mat_Aluminium)\n union()\n {\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthFront], align=Z);\n\n cubea(size=[2*axleRadius, 2*axleRadius, length+.4*mm], align=-Z, extra_size=Z*(extrSize+.4*mm), extra_align=Z);\n\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n tz(-length)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthBack], align=-Z);\n }\n }\n}\n\n","old_contents":" \/\/ Some code from MCAD\/stepper.scad\n \/\/ Originally by Hans H\u00e4ggstr\u00f6m, 2010.\n \/\/ Dual licenced under Creative Commons Attribution-Share Alike 3.0 and LGPL2 or later\n\ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \n\n\/*test2();*\/\n\nmodule test()\n{\n for (size = AllNemaSizes)\n {\n ty(size*100)\n stack(axis=X, dist=100)\n {\n motor(model=Nema34, size=size, dual_axis=true);\n motor(model=Nema23, size=size, dual_axis=true);\n motor(model=Nema17, size=size, dual_axis=true);\n motor(model=Nema14, size=size, dual_axis=true);\n motor(model=Nema11, size=size, dual_axis=true);\n motor(model=Nema08, size=size, dual_axis=true);\n }\n }\n}\n\nmodule test2()\n{\n model = Nema17;\n size = NemaMedium;\n motor_mount(model=model, size=size, dual_axis=true);\n}\n\nfunction motorWidth(model) = get(NemaSideSize, model);\nfunction motorLength(model, size=NemaMedium) = get(size, model);\n\nmodule motor_mount(part=U, model, thickness, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"motor_mount(): model==U\");\n assert(thickness!=U, \"motor_mount(): thickness==U\");\n assert(size!=U, \"motor_mount(): size==U\");\n\n length = get(size, model);\n side = get(NemaSideSize, model);\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n s=[side, side, length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n material(Mat_Plastic)\n render()\n difference()\n {\n motor_mount(part=\"pos\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n motor_mount(part=\"neg\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n\n if($show_vit)\n motor_mount(part=\"vit\", model=model, thickness=thickness, size=size, dual_axis=dual_axis);\n }\n else if(part==\"pos\")\n {\n rcubea([side,side,thickness], align=Z);\n }\n else if(part==\"neg\")\n {\n cylindera(h=thickness+.1, r=extrRad, align=Z, extra_h=.1, extra_align=-Z);\n\n \/\/ main motor\n tz(-s.z)\n cubea(s, align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=thickness+.1, r=holeRadius, align=Z, extra_h=.1, extra_align=-Z);\n\n }\n else if(part==\"vit\")\n {\n motor(model=model, size=size, dualAxis=dual_axis, orient=Z);\n }\n}\n\nmodule motor(part=U, model, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n side = get(NemaSideSize, model);\n cutR = get(NemaMountingHoleCutoutRadius, model);\n lip = get(NemaMountingHoleLip, model);\n holeDepth = get(NemaMountingHoleDepth, model);\n\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n extrRad = get(NemaRoundExtrusionDiameter, model) * 0.5;\n\n holeDist = get(NemaDistanceBetweenMountingHoles, model) * 0.5;\n holeRadius = get(NemaMountingHoleDiameter, model) * 0.5;\n\n mid = side \/ 2;\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n s=[side, side, length];\n size_align(size=s, orient=orient, align=align)\n if(part==U)\n {\n difference()\n {\n motor(part=\"pos\", model=model, size=size, dual_axis=dual_axis);\n motor(part=\"neg\", model=model, size=size, dual_axis=dual_axis);\n }\n motor(part=\"vit\", model=model, size=size, dual_axis=dual_axis);\n\n motor_axle(model=model, size=size, dual_axis=dual_axis);\n }\n if(part==\"echo\")\n {\n echo(str(\" Motor: Nema\",get(NemaModel, model),\", length= \",length,\"mm, dual axis=\",dual_axis));\n }\n else if(part==\"pos\")\n {\n material(Mat_BlackPaint)\n tz(-s.z)\n cubea(s, align=Z, extra_size=Z*extrSize, extra_align=Z);\n }\n else if(part==\"neg\")\n {\n \/\/ Axle hole\n material(Mat_Aluminium)\n cylindera(r=axleRadius+.2*mm, h=1000);\n\n \/\/ Corner cutouts\n if (lip > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n tz(-lip)\n cylindera(h=length, r=cutR, align=Z);\n\n \/\/ Rounded edges\n if (roundR > 0)\n material(Mat_BlackPaint)\n tz(-s.z)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*side\/2)\n ty(y*side\/2)\n mirror([x>0?0:1,y>0?0:1,0])\n rz(45)\n cubea(size=[roundR, roundR*2, 4+length + extrSize+2], align=Z);\n\n \/\/ Bolt holes\n material(Mat_Aluminium)\n for(x=[-1,1])\n for(y=[-1,1])\n tx(x*holeDist)\n ty(y*holeDist)\n cylindera(h=holeDepth+.1*mm, r=holeRadius, align=-Z, extra_h=.1, extra_align=Z);\n\n \/\/ Grinded flat\n material(Mat_BlackPaint)\n difference()\n {\n cubea(size=[side+.1, side+.1, extrSize+.1], align=Z);\n cylindera(h=extrSize, r=extrRad, align=Z);\n }\n }\n}\n\nmodule motor_axle(model=Nema23, size=NemaMedium, dual_axis=false, orient=Z, align=U)\n{\n assert(model!=U, \"model == U\");\n assert(size!=U, \"size == U\");\n length = get(size, model);\n\n axleLengthFront = get(NemaFrontAxleLength, model);\n axleLengthBack = get(NemaBackAxleLength, model);\n axleRadius = get(NemaAxleDiameter, model) * 0.5;\n\n extrSize = get(NemaRoundExtrusionHeight, model);\n\n roundR = get(NemaEdgeRoundingRadius, model);\n\n axleFlatDepth = get(NemaAxleFlatDepth, model);\n axleFlatLengthFront = get(NemaAxleFlatLengthFront, model);\n axleFlatLengthBack = get(NemaAxleFlatLengthBack, model);\n\n render()\n intersection()\n {\n material(Mat_Aluminium)\n tz(-length)\n cylindera(r=axleRadius, h=length+extrSize+axleLengthFront, align=Z, extra_h=dual_axis?axleLengthBack:0, extra_align=-Z);\n\n material(Mat_Aluminium)\n union()\n {\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthFront], align=Z);\n\n cubea(size=[2*axleRadius, 2*axleRadius, length+.4*mm], align=-Z, extra_size=Z*(extrSize+.4*mm), extra_align=Z);\n\n tx(axleFlatDepth>0?-axleFlatDepth:0)\n tz(-length)\n cubea(size=[2*axleRadius, 2*axleRadius, axleLengthBack], align=-Z);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"3d9281299c04396f7aed262386e8e4bbc3e3d4e9","subject":"The dome was added and the mouning post zTranslate was added for customization.","message":"The dome was added and the mouning post zTranslate was added for customization.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_file":"openscad\/models\/src\/main\/openscad\/signals\/light-signals\/light-signal.scad","new_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/dome\/dome.scad>\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n icon1 = \"\",\r\n icon1_scale = 1,\r\n icon1_x = 0,\r\n icon1_y = 0,\r\n icon2 = \"\",\r\n icon2_scale = 1.0,\r\n icon2_x = 0,\r\n icon2_y = 0,\r\n\t\t\t\t\tmountingPosts = \"No\",\r\n\t\t\t\t\tmountingPostsTranslatePercentageZ = 0.6,\r\n text1 = \"\",\r\n\t\t\t\t\ttext1_fontName = \"Bauhaus 93:style=Regular\",\r\n text1_fontSize = 7.5,\r\n text1_x = 0,\r\n text1_y = 0,\r\n text2 = \"\",\r\n\t\t\t\t\ttext2_fontName = \"Bauhaus 93:style=Regular\",\r\n text2_fontSize = 7.5,\r\n text2_x = 0,\r\n text2_y = 0)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tshowOriginal = \"No\";\r\n\t\tlightSignal_shell(baseHeight, mountingPosts, mountingPostsTranslatePercentageZ, showOriginal);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n\t\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\n\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\nfunction lightSignal_stlBaseInnerRadius() = 18.5;\r\n\r\nfunction lightSignal_stlBaseOuterRadius() = lightSignal_stlBaseInnerRadius() + 2.5;\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y)\r\n{\r\n lightSignal_oneIconCutout(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y);\r\n\r\n lightSignal_oneIconCutout(icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_oneIconCutout(\r\n icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y)\r\n{\r\n if(icon1 == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n zScale = 3;\r\n translate([icon1_x, icon1_y, -1.01])\r\n if(icon1 == \"heart\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n heartThumbnail();\r\n }\r\n else if(icon1 == \"bat\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n batmanLogoThumbnail();\r\n }\r\n }\r\n}\r\n\r\n\/\/ TODO: Move this model back here!\r\n\/\/module lightSignal_oneShellMountingPost()\r\n\r\nmodule lightSignal_oneTextCutout(text, fontName, fontSize, x, y)\r\n{\r\n if(text == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n extrudeHeight = 6;\r\n zTranslate = -3;\r\n\r\n translate([x, y, zTranslate])\r\n linear_extrude(height = extrudeHeight)\r\n text(text = text, font = fontName, size = fontSize);\r\n }\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n\t\t\t\t\t\t\tmountingPosts,\r\n\t\t\t\t\t\t\tmountingPostsTranslatePercentageZ,\r\n\t \tshowOriginal)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\r\n\tstlBaseInnerRadius = lightSignal_stlBaseInnerRadius();\r\n\tstlBaseOuterRadius = lightSignal_stlBaseOuterRadius();\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\/*\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n*\/\r\n\/\/------------\r\n\t\tcolor([1,0.6863,0.6863])\r\n\t\ttranslate([0,0,13.5])\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tdome(domePercentage=50, radius=30.0);\r\n\r\n\t\t\topenCylinder(height=35, innerRadius=21.0, outerRadius=51.0);\r\n\r\n\t\t\ttranslate([0,0,31])\r\n\t\t\tcylinder(h=9, r=6, center=true);\r\n\r\n\t\t}\r\n\/\/------------\r\n\r\n\t\tif(mountingPosts == \"Yes\")\r\n\t\t{\r\n\t\t\tlightSignal_shellMountingPosts(zTopHoleTranslate, mountingPostsTranslatePercentageZ);\r\n\t\t}\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"yellow\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal == \"Yes\")\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\n\/\/ TODo: Move this module to the correct ABC location\r\nmodule lightSignal_oneShellMountingPost()\r\n{\r\n\theight = 10;\r\n\/\/\ttranslate([height, 0, 0])\r\n\trotate([0, 90, 0])\r\n\tcylinder(r=3, h=height, center=true, $fn=20);\r\n}\r\n\r\nmodule lightSignal_shellMountingPosts(zTopHoleTranslate, zTranslatePercentage)\r\n{\r\n\txTranslate = lightSignal_stlBaseOuterRadius() + 2.5;\r\n\tzTranslate = zTopHoleTranslate * zTranslatePercentage;\r\n\ttranslate([xTranslate, 0, zTranslate])\r\n\tlightSignal_oneShellMountingPost();\r\n\r\n\/\/\tzTranslate = zTopHoleTranslate * 0.75;\r\n\ttranslate([-xTranslate, 0, zTranslate])\r\n\tlightSignal_oneShellMountingPost();\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n lightSignal_oneTextCutout(text1, text1_fontName, text1_fontSize, text1_x, text1_y);\r\n\r\n lightSignal_oneTextCutout(text2, text2_fontName, text2_fontSize, text2_x, text2_y);\r\n}\r\n","old_contents":"\r\nuse <..\/..\/external-resources\/batman\/batman.scad>\r\n\r\nuse <..\/..\/shapes\/heart\/heart.scad>\r\nuse <..\/..\/shapes\/open-cylinder\/open-cylinder.scad>\r\n\r\nmodule lightSignal(baseHeight = 2,\r\n icon1 = \"\",\r\n icon1_scale = 1,\r\n icon1_x = 0,\r\n icon1_y = 0,\r\n icon2 = \"\",\r\n icon2_scale = 1.0,\r\n icon2_x = 0,\r\n icon2_y = 0,\r\n\t\t\t\t\tmountingPosts = \"No\",\r\n text1 = \"\",\r\n\t\t\t\t\ttext1_fontName = \"Bauhaus 93:style=Regular\",\r\n text1_fontSize = 7.5,\r\n text1_x = 0,\r\n text1_y = 0,\r\n text2 = \"\",\r\n\t\t\t\t\ttext2_fontName = \"Bauhaus 93:style=Regular\",\r\n text2_fontSize = 7.5,\r\n text2_x = 0,\r\n text2_y = 0)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tshowOriginal = \"No\";\r\n\t\tlightSignal_shell(baseHeight, mountingPosts, showOriginal);\r\n\/\/\t\tlightSignal_shell(baseHeight, showOriginal = false);\r\n\r\n\t\tlightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n\t\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\t}\r\n}\r\n\r\n\/** Support functions and moduules follow. **\/\r\n\r\n\/\/ DO NOT CHANGE THE RADIUS; IT MACHES THE ORIGINAL MODEL\r\nfunction lightSignal_stlBaseInnerRadius() = 18.5;\r\n\r\nfunction lightSignal_stlBaseOuterRadius() = lightSignal_stlBaseInnerRadius() + 2.5;\r\n\r\nmodule lightSignal_cutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y,\r\n text1,\r\n\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n\t\tlightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y);\r\n\r\n\t\tlightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_iconCutouts(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y,\r\n icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y)\r\n{\r\n lightSignal_oneIconCutout(icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y);\r\n\r\n lightSignal_oneIconCutout(icon2,\r\n icon2_scale,\r\n icon2_x,\r\n icon2_y);\r\n}\r\n\r\nmodule lightSignal_oneIconCutout(\r\n icon1,\r\n icon1_scale,\r\n icon1_x,\r\n icon1_y)\r\n{\r\n if(icon1 == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n zScale = 3;\r\n translate([icon1_x, icon1_y, -1.01])\r\n if(icon1 == \"heart\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n heartThumbnail();\r\n }\r\n else if(icon1 == \"bat\")\r\n {\r\n scale([icon1_scale, icon1_scale, zScale])\r\n batmanLogoThumbnail();\r\n }\r\n }\r\n}\r\n\r\n\/\/ TODO: Move this model back here!\r\n\/\/module lightSignal_oneShellMountingPost()\r\n\r\nmodule lightSignal_oneTextCutout(text, fontName, fontSize, x, y)\r\n{\r\n if(text == \"\")\r\n {\r\n \/\/ do nothing\r\n }\r\n else\r\n {\r\n extrudeHeight = 6;\r\n zTranslate = -3;\r\n\r\n translate([x, y, zTranslate])\r\n linear_extrude(height = extrudeHeight)\r\n text(text = text, font = fontName, size = fontSize);\r\n }\r\n}\r\n\r\nmodule lightSignal_shell(baseHeight,\r\n\t\t\t\t\t\t\tmountingPosts,\r\n\t \tshowOriginal)\r\n{\r\n\tsignalStl = \"..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/..\/Versioning\/world\/beto-land-world\/3d-printing\/super-heroes\/batman\/bat-signal\/customizable_phone_bat_signal_20150130-9347-hv0ikc-0.stl\";\r\n\r\n\tstlBaseInnerRadius = lightSignal_stlBaseInnerRadius();\r\n\tstlBaseOuterRadius = lightSignal_stlBaseOuterRadius();\r\n\r\n\tunion()\r\n\t{\r\n\t\t\/\/ this is the top hole\/cutout\r\n\t\tzTopHoleTranslate = 35;\r\n\t\tcolor(\"blue\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate])\r\n\t\topenCylinder(height=1, outerRadius = 12, innerRadius=6);\r\n\r\n\t\t\/\/ connector for the shaft and top hole\r\n\t\tcolor(\"pink\")\r\n\t\ttranslate([0, 0, zTopHoleTranslate-3])\r\n\t\topenCylinder(height=3.1, outerRadius = 19, innerRadius=8);\r\n\r\n\t\tif(mountingPosts == \"Yes\")\r\n\t\t{\r\n\t\t\tlightSignal_shellMountingPosts(zTopHoleTranslate);\r\n\t\t}\r\n\r\n\t\t\/\/ this is the bottom wide shaft\r\n\t\tzTranslate = -baseHeight \/ 2.0;\r\n\t\tcolor(\"yellow\")\r\n\t\ttranslate([0, 0, zTranslate])\r\n\t\topenCylinder(height=zTopHoleTranslate, outerRadius = stlBaseOuterRadius, innerRadius = stlBaseInnerRadius);\r\n\r\n\t\t\/\/ this thing was modeld after this original\r\n\t\tif(showOriginal == \"Yes\")\r\n\t\t{\r\n\t\t\tcolor(\"yellow\")\r\n\t\t\ttranslate([0, 0, zTranslate])\r\n\t\t\timport(signalStl);\r\n\t\t}\r\n\r\n\t\t\/\/ This is the bottom disk, that holds the text\/icon cutout.\r\n\t\tcolor(\"green\")\r\n\t\tcylinder(r=stlBaseInnerRadius+0.1, h=baseHeight, center=true);\r\n\t}\r\n}\r\n\r\n\/\/ TODo: Move this module to the correct ABC location\r\nmodule lightSignal_oneShellMountingPost()\r\n{\r\n\theight = 10;\r\n\/\/\ttranslate([height, 0, 0])\r\n\trotate([0, 90, 0])\r\n\tcylinder(r=3, h=height, center=true, $fn=20);\r\n}\r\n\r\nmodule lightSignal_shellMountingPosts(zTopHoleTranslate)\r\n{\r\n\txTranslate = lightSignal_stlBaseOuterRadius() + 2.5;\r\n\tzTranslate = zTopHoleTranslate * 0.75;\r\n\ttranslate([xTranslate, 0, zTranslate])\r\n\tlightSignal_oneShellMountingPost();\r\n\r\n\tzTranslate = zTopHoleTranslate * 0.75;\r\n\ttranslate([-xTranslate, 0, zTranslate])\r\n\tlightSignal_oneShellMountingPost();\r\n}\r\n\r\nmodule lightSignal_textCutouts(text1,\r\n\t\t\t\t\t\t\t\ttext1_fontName,\r\n text1_fontSize,\r\n text1_x,\r\n text1_y,\r\n text2,\r\n\t\t\t\t\t\t\t\ttext2_fontName,\r\n text2_fontSize,\r\n text2_x,\r\n text2_y)\r\n{\r\n lightSignal_oneTextCutout(text1, text1_fontName, text1_fontSize, text1_x, text1_y);\r\n\r\n lightSignal_oneTextCutout(text2, text2_fontName, text2_fontSize, text2_x, text2_y);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"db52aac40385d8815b2c677455340b939e8cd88b","subject":"Introduce new travel bracket design","message":"Introduce new travel bracket design\n","repos":"OregonTechPrint3D\/Wintermute,OregonTechPrint3D\/Wintermute,OregonTechPrint3D\/Wintermute","old_file":"models\/experimental\/Wintermute_Travel_Bracket\/Travel_Brkt_Solid.scad","new_file":"models\/experimental\/Wintermute_Travel_Bracket\/Travel_Brkt_Solid.scad","new_contents":"module TravelBracket(){\ndifference(){\n\tunion(){\n\t\timport(\"..\/\/..\/\/approved\/\/TRV_BRKT.stl\");\n\t\t\n\t\t\/\/ Fill in unneeded holes\n\t\tcolor([255,0,0])translate([16,17,3])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\t\tcolor([255,0,0])translate([16,17,11])rotate([90,0,0])cylinder(h=10,r=1.8,$fn=40);\n\n\t\ttranslate([22,9,0])cube([6,8,14]);\n\t\ttranslate([-22,9,0])mirror([1,0,0])cube([6,8,14]);\n\t\ttranslate([22,-9,0])mirror([0,1,0])cube([6,6,14]);\n\t\ttranslate([-22,-9,0])mirror([1,1,0])cube([6,6,14]);\n\n\t\ttranslate([13,11,0])cube([6,3,14]);\n\n\t\t\/\/ Linear bearing holes\n\t\tdifference(){\n\t\t\tunion(){\n\t\t\t\ttranslate([25,0,0])cylinder(h=14,r=10,$fn=40);\n\t\t\t\ttranslate([-25,0,0])cylinder(h=14,r=10,$fn=40);\n\t\t\t}\n\n\t\t\tunion(){\n\t\t\t\ttranslate([25,0,-1])cylinder(h=18,r=8,$fn=40);\n\t\t\t\ttranslate([-25,0,-1])cylinder(h=18,r=8,$fn=40);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t}\n\t\t\n\t\t\/\/ Mount screw Linear bearing\n\t\ttranslate([-25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\n\t\ttranslate([25,0,7])rotate([90,0,0])cylinder(h=40,r=1.8,$fn=40,center=true);\t\t\n\n}\n\n\n}\n\nmodule NutSocket(width,depth,height)\n{\n\tside_length=sqrt(pow(width,2)\/2);\n\ttranslate([0,0,height\/2])cube([width,depth,height],center=true);\n\trotate([0,45,0])cube([side_length,depth,side_length],center=true);\n}\n\ndifference(){\n\tTravelBracket();\n\n\tunion(){\n\t\ttranslate([-25,12.5,5.5])NutSocket(6,3,14);\n\t\ttranslate([25,12.5,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([-25,11,5.5])NutSocket(6,3,14);\n\t\tmirror([0,1,0])translate([25,11,5.5])NutSocket(6,3,14);\n\t}\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'models\/experimental\/Wintermute_Travel_Bracket\/Travel_Brkt_Solid.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"d9da24a218bbadab6dd056b74676e1adb1f19248","subject":"The include path was corrected.","message":"The include path was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/shortcut\/trinket-mini\/mounting-plate\/mounting-plate.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/electronics\/keyboards\/shortcut\/trinket-mini\/mounting-plate\/mounting-plate.scad","new_contents":"\r\nuse <..\/..\/..\/switch-mounting-holes\/adafruit-1009\/adafruit-1009-panel.scad>\r\n\r\nadafruit10009SwitchPanel(boardLengthX = 60,\r\n panelHeight = 1);\r\n","old_contents":"\r\nuse <..\/..\/..\/..\/switch-mounting-holes\/adafruit-1009\/adafruit-1009-panel.scad>\r\n \r\n \/\/ farto\r\n \r\nadafruit10009SwitchPanel(boardLengthX = 60,\r\n panelHeight = 1);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b2e364ef858ff79413d9ba28514d2bfc7425f451","subject":"xaxis\/ends\/idlerholder: rewrite to part system","message":"xaxis\/ends\/idlerholder: rewrite to part system\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders);\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"394bb4d7ad0c33ade9a218e2ed71d1685b8fb466","subject":"Box with a board","message":"Box with a board\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1_board.scad","new_file":"3d\/enclosure_v1_board.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 0.4;\nboard_h = 5;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n\t cube([box_x,box_y, box_z-board_h], false);\n\t translate([th - board_w, th - board_w, 0]) {\n\t cube([box_x - 2*board_w, box_y - 2*board_w, box_z], false);\n\t }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d\/enclosure_v1_board.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"5b29976f4af87772c2a6fab5999cf93412382236","subject":"Minor fixes","message":"Minor fixes\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v2_board.scad","new_file":"3d\/enclosure_v2_board.scad","new_contents":"use \n\ntol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th + 0.5;\nshift_y = th + 0.5;\n\nbox_x = pcb_x + 2*th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 1.8;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36.5;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 19;\ndynamic_y = shift_y + 30;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\nround_radius=2;\n\ntranslate([0,0,-50]) {\n\n\/\/ put exclamation mark here to render bottom\ndifference() {\n union() {\n difference() {\n union() {\n cubeBottomX([box_x, box_y, bottom_box_z-board_h], radius=round_radius);\n translate([th - board_w, th - board_w, 0]) {\n cubeBottomX([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], radius=round_radius);\n }\n }\n translate([th, th, th]) {\n cubeBottomX([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], radius=round_radius);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 11.5;\nscreen_start_y = shift_y + 25;\nscreen_length_x = 77;\nscreen_length_y = 50.5;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 19;\nmaster_button_int = 31.5;\nmaster_button_r = 6.25;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\n\n\/\/ put exclamation mark here to render top\n!rotate(a=[180,0,0]) {\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cubeSideX(size=[box_x, box_y, board_h + eps], radius=round_radius, center=false);\n translate([board_w, board_w, -eps]) {\n cubeSideX(size=[box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], radius=round_radius, center=false);\n }\n }\n }\n difference() {\n cubeTopX(size=[box_x,box_y,top_box_z], radius=round_radius, center=false);\n translate([th, th, -eps]) {\n cubeTopX(size=[box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], radius=round_radius, center=false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h-2*eps);\n }\n }\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=20, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\nmodule roundedRect(size, radius)\n{\n x = size[0];\n y = size[1];\n z = size[2];\n translate([x\/2,y\/2,0]) {\n linear_extrude(height=z)\n hull()\n {\n \/\/ place 4 circles in the corners, with the given radius\n translate([(-x\/2)+(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(-x\/2)+(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n }\n }\n}\n","old_contents":"use \n\ntol = 0.25;\nscreen_tol = 0.8;\npcb_x = 100;\npcb_y = 100;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 3;\nshift_bolt_x = 4;\nshift_bolt_y = 7;\nboard_w = 1;\nboard_h = 1;\n\nm3_bolt_top_r = 2.9;\nm3_bolt_top_h = 1.5;\n\n\n\/\/ box thickness\nth = 2;\n\n\/\/ bolts\nshift_x = th + 0.5;\nshift_y = th + 0.5;\n\nbox_x = pcb_x + 2*th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 1.8;\n\nsocket_h = 14.7;\nsocket_w = 10;\nsocket_n = 6;\nsocket_all_len = 85;\nsocket_int = socket_w + (socket_all_len - socket_n*socket_w)\/(socket_n - 1);\nstart_socket_x = shift_x + (pcb_x - socket_all_len) \/ 2;\neps = 1e-1;\n\nbottom_box_z = socket_h + th + pcb_width;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + pcb_y - 36.5;\nstart_type_b_z = bottom_box_z - pcb_width - usb_type_b_h - tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 6.3;\nstart_type_a_y = shift_y + 25;\nstart_type_a_z = bottom_box_z - pcb_width - usb_type_a_h - tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\n\/\/volume_start_x = shift_x + pcb_x - 39.2;\n\/\/volume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nstoiki_h = socket_h;\nwide_stoiki_r = stoiki_r + 2;\n\ndynamic_x = shift_x + 20;\ndynamic_y = shift_y + 31;\ndynamic_r = 16;\n\nvolume_center_y = shift_y + 50;\nvolume_w = 15;\nvolume_start_y = volume_center_y - volume_w\/2;\nvolume_h = 4;\nround_radius=2;\n\ntranslate([0,0,-50]) {\n\n\/\/ put exclamation mark here to render bottom\n!difference() {\n union() {\n difference() {\n union() {\n cubeBottomX([box_x, box_y, bottom_box_z-board_h], radius=round_radius);\n translate([th - board_w, th - board_w, 0]) {\n cubeBottomX([box_x - 2*(th - board_w), box_y - 2*(th - board_w), bottom_box_z], radius=round_radius);\n }\n }\n translate([th, th, th]) {\n cubeBottomX([box_x-2*th+eps, box_y-2*th+eps, bottom_box_z-th+eps], radius=round_radius);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=stoiki_h + eps);\n \/\/cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([start_socket_x, th - eps, th - eps]) {\n cube([socket_all_len, th\/2 + eps, stoiki_h + eps]);\n }\n \/\/translate([box_x\/2, box_y\/2, th-eps]) {\n \/\/cylinder($fn=6, r=stoiki_r, h=pcb_up);\n \/\/}\n }\n\n \/\/ dynamic\n translate([dynamic_x, dynamic_y, -eps]) {\n cylinder($fn=20, r=dynamic_r, h = th+2*eps);\n }\n\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, -eps, bottom_box_z - socket_h - pcb_width]) {\n cube(size=[socket_w + 2*tol, socket_h, socket_h + socket_h]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+stoiki_h+2*eps);\n \/\/ bolt\n cylinder($fn=12, r=m3_bolt_top_r + 0.05, h=m3_bolt_top_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n cube(size=[th+2*eps, usb_type_b_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ usb_out1 type a\n translate([box_x - eps - th, start_type_a_y - tol, start_type_a_z]) {\n cube(size=[th+2*eps, usb_type_a_w + 2*tol, bottom_box_z]);\n }\n\n \/\/ volume\n translate([-eps, volume_start_y, bottom_box_z - pcb_width - volume_h]) {\n cube(size=[th+2*eps, volume_w, volume_h + pcb_width + eps]);\n }\n\n}\n}\n\ntop_box_z = 10;\n\/\/stoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 11.5;\nscreen_start_y = shift_y + 24.5;\nscreen_length_x = 77;\nscreen_length_y = 51;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + pcb_y - 7.5;\nmaster_button_x = shift_x + 18.5;\nmaster_button_int = 31.5;\nmaster_button_r = 6.5;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\n\n\/\/ put exclamation mark here to render top\nrotate(a=[180,0,0]) {\ndifference() {\n union() {\n \/\/ board\n translate([0, 0, -board_h]) {\n difference() {\n cubeSideX(size=[box_x, box_y, board_h + eps], radius=round_radius, center=false);\n translate([board_w, board_w, -eps]) {\n cubeSideX(size=[box_x - 2*board_w, box_y - 2*board_w, board_h + 3*eps], radius=round_radius, center=false);\n }\n }\n }\n difference() {\n cubeTopX(size=[box_x,box_y,top_box_z], radius=round_radius, center=false);\n translate([th, th, -eps]) {\n cubeTopX(size=[box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], radius=round_radius, center=false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=6, r=stoiki_r-0.5, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h-2*eps);\n }\n }\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt_x, shift_x+pcb_x-shift_bolt_x]) {\n for (dy = [shift_y+shift_bolt_y, shift_y+pcb_y-shift_bolt_y]) {\n translate([dx,dy,-2*eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\nmodule roundedRect(size, radius)\n{\n x = size[0];\n y = size[1];\n z = size[2];\n translate([x\/2,y\/2,0]) {\n linear_extrude(height=z)\n hull()\n {\n \/\/ place 4 circles in the corners, with the given radius\n translate([(-x\/2)+(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (-y\/2)+(radius\/2), 0])\n circle(r=radius);\n\n translate([(-x\/2)+(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n\n translate([(x\/2)-(radius\/2), (y\/2)-(radius\/2), 0])\n circle(r=radius);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"75c0a60521cb21f03f6e9e14c538d96e7bd432fe","subject":"fix border","message":"fix border\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/enclosure_v1_board.scad","new_file":"3d\/enclosure_v1_board.scad","new_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 1;\nboard_h = 1;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n cube([box_x,box_y, box_z-board_h], false);\n translate([th - board_w, th - board_w, 0]) {\n cube([box_x - 2*(th - board_w), box_y - 2*(th -board_w), box_z], false);\n }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\nscreen_tol = 0.8;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\nboard_w = 0.4;\nboard_h = 5;\n\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 14.4;\nusb_type_a_h = 7.8;\nstart_type_a_y = shift_y + 46;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 13;\nfn = 10;\ngaika_h = 4;\ngaika_w = 5.5;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n union() {\n\t cube([box_x,box_y, box_z-board_h], false);\n\t translate([th - board_w, th - board_w, 0]) {\n\t cube([box_x - 2*board_w, box_y - 2*board_w, box_z], false);\n\t }\n }\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb, stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ translate([dx,dy,pcb_up\/2+th-eps]) {\n\/\/ cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n\/\/ }\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 4;\npcb_room = 1;\nscreen_start_x = shift_x + 29;\nscreen_start_y = shift_y + 38.9;\nscreen_length_x = 71.2;\nscreen_length_y = 24.2;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12.5;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 15;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - wide_stoiki_h]) {\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=wide_stoiki_h+eps);\n \/\/cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x - screen_tol, screen_start_y - screen_tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*screen_tol, screen_length_y + 2*screen_tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int - tol, box_y-th-eps, -eps]) {\n cube(size=[socket_w + 2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -eps]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r + tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2f19faab5bd6842c4c61780c86f9a0400057233a","subject":"fixup! main\/yaxis: improve y carriage plate detail","message":"fixup! main\/yaxis: improve y carriage plate detail\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[0,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n translate([0,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n hull()\n {\n translate([0,0,yaxis_bearing[0]\/2])\n {\n attach(ycarriage_bearing_mount_conn_bearing, [[0,0,0],[0,0,1]])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n translate([0,0,yaxis_belt_path_offset_z])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n }\n\n }\n\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[0,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n translate([0,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x, 6, yaxis_pulley_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n hull()\n {\n translate([0,0,yaxis_bearing[0]\/2])\n {\n attach(ycarriage_bearing_mount_conn_bearing, [[0,0,0],[0,0,1]])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n translate([0,0,yaxis_belt_path_offset_z])\n {\n cubea([10,20,10], align=[0,0,-1]);\n }\n }\n\n }\n\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(ycarriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*ycarriage_size[0]\/2, y*(ycarriage_size[1])\/2, 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,0]);\n }\n translate([x*(ycarriage_size[0]\/2-16*mm), y*(ycarriage_size[1]\/2-16*mm), 0])\n {\n fncylindera(d=10*mm, h=ycarriage_size[2], align=[-x,-y,0]);\n }\n }\n\n cubea([ycarriage_size[0]-16*mm*2,ycarriage_size[1]-16*mm*2, ycarriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(ycarriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2d77a9364cc4d8a5dbe15f745c0e40ddc4d3e599","subject":"Revert \"misc: remove assert (now supported by openscad!)\"","message":"Revert \"misc: remove assert (now supported by openscad!)\"\n\nThis reverts commit a77d066277627a636e9644a2ace9134a38bb880d.\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n\n\/\/ Assert that `bool` is true.\n\/\/\n\/\/ If `bool` is false, emit the error `msg`,\n\/\/ and terminate compilation (via infinite recursion).\nmodule assert(bool, msg = \"\")\n{\n if(bool == false)\n {\n echo(\"Assertion Failed: \", msg);\n echo(\"\", assertion_failed());\n }\n}\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\n\/\/ Called when an assertion fails (invokes infinite recursion).\nfunction assertion_failed() = (assertion_failed());\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b72e5a83d30b1490051ffdc28c1fa39b0234d380","subject":"misc: expand geth and header_col_index to support multiple keys","message":"misc: expand geth and header_col_index to support multiple keys\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_key) = \n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0];\n\nfunction geth(S, col_key, row_index) = \nlet(col_index = header_col_index(S, col_key))\nS[row_index+1][col_index];\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8d54260e095dea8e010d9849c6d11d51327c731f","subject":"x\/end: use proj_extrude_axis","message":"x\/end: use proj_extrude_axis\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+10*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nxaxis_z_bearing_mount_dir = X;\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=X, align=[-1,0,0]);\n\n \/\/ endstops mount support\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ z axis bearing support\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n intersection()\n {\n rcylindera(h=h, d=d, orient=Z, align=N);\n rcubea(size=[d,d,h], orient=Z, align=xaxis_z_bearing_mount_dir);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n rcubea(size=[d,d,h], orient=Z, align=-xaxis_z_bearing_mount_dir);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=Z, align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n \/\/ projection against z, ensure easy print\n proj_extrude_axis(axis=Z, offset=-xaxis_end_wz\/2)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n\n if(show_bearings)\n {\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*xaxis_rod_distance\/2])*\/\n \/*translate([0, -xaxis_zaxis_distance_y, 0])*\/\n \/*bearing(zaxis_bearing);*\/\n\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate(-Z*xaxis_end_wz\/2)\n {\n linear_bearing(bearing=LinearBearingLMH12L, align=Z, offset_flange=true);\n }\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_rod_d+10*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nxaxis_z_bearing_mount_dir = X;\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=Y, align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n rcylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=Z);\n\n \/\/ nut screw holes support\n rotate(Z*90)\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n rcylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=Z);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*rcylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=Z);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n rcylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=X, align=[-1,0,0]);\n\n \/\/ endstops mount support\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n rcubea(xaxis_endstop_size_switch, align=-XAXIS-ZAXIS);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=-XAXIS-ZAXIS);\n }\n }\n\n \/\/ z axis bearing support\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n d=bearing_sizey+4*mm;\n h=xaxis_end_wz;\n intersection()\n {\n rcylindera(h=h, d=d, orient=Z, align=N);\n rcubea(size=[d,d,h], orient=Z, align=xaxis_z_bearing_mount_dir);\n }\n }\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=Y, d=15*mm, h=7*mm, align=-y*Y);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n {\n d=bearing_sizey+2*mm;\n h=xaxis_end_wz+5;\n rcubea(size=[d,d,h], orient=Z, align=-xaxis_z_bearing_mount_dir);\n \/*cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+10], orient=Z, align=[0,-1,0]);*\/\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=X, align=X);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=Y, orient=-X, align=X);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=X);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_end_wz\/2-2*mm)])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=Z,\n align=[0,0,-z],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate(Y)\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=Z, orient=Y, align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=Y, align=Y);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=Y, align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=Y, align=Y);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n rotate(90*Z)\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=Z);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=Z);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=16*mm, with_nut=false, orient=Z, align=Z);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=Y, align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, with_nut=false, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,xaxis_end_wz\/2])\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=Y, align=Y);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=Y);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=Z);\n }\n\n if(show_bearings)\n {\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*xaxis_rod_distance\/2])*\/\n \/*translate([0, -xaxis_zaxis_distance_y, 0])*\/\n \/*bearing(zaxis_bearing);*\/\n\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate(-Z*xaxis_end_wz\/2)\n {\n linear_bearing(bearing=LinearBearingLMH12L, align=Z, offset_flange=true);\n }\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=N, orient=X)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=Z, align=Z);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=Z, align=Z);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=Z, align=Z);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=X, align=X);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=Z, align=N);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"765a17cf9bfb7e4407ad42b8ed25dd5e5fe20bd1","subject":"shapes\/hollow_cylinder: bugfix taper","message":"shapes\/hollow_cylinder: bugfix taper\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h\/2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/2 : taper_h;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h\/4)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=inner_d, h=taper_h\/2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h\/2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], facets=32, rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, facets=facets, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=10, r1=undef, r2=undef, h=10, round_radius=2)\n{\n r_= (r1!=undef && r2!=undef) ? [r1,r2] : [d\/2,d\/2];\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n hull()\n {\n taper_h = outer_d\/2;\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=0, h=taper_h, align=[0,0,1]);\n cylindera(d1=inner_d, d2=inner_d*2, h=taper_h, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.2, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n\n }\n}\n\n\/*hollow_cylinder(thickness=2, h=9, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"30724525600a1a6d5b7b087e8a9510ef64b8ffdf","subject":"Added files via upload","message":"Added files via upload","repos":"pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey,pfnegrini\/Bailey","old_file":"hardware\/power.scad","new_file":"hardware\/power.scad","new_contents":"Zdim = 40;\nXdim = 60;\nYdim = 67;\nthickness = 2;\nsupportDiam = 5;\nbuttonDiam = 16;\nXT60X = 15.54;\nXT60Y = 8.16;\nXT60Z = 16.10;\n\ntextHV = \"HVDC\";\ntextLV = \"5V\";\n$fn=80;\n\n\/\/--------------------------------\nmodule box(Xdim, Ydim, Zdim, thickness, application)\n \/\/Creates a box, dimensions are internal\n {\n difference() {\n\n cube([Xdim + thickness, Ydim + thickness, Zdim], center = true);\n translate([0, 0, thickness \/ 2]) cube([Xdim, Ydim, Zdim], center = true);\n\n if (application == \"servo\") {\n translate([-Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, -0.5 * Zdim]) cube([5, Ydim + 2 * thickness, Zdim \/ 2 + thickness], center = true);\n translate([+Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n translate([-Xdim \/ 2, 0, 0]) cube([thickness \/ 2, 0.3 * Ydim, Zdim], center = true);\n }\n\n }\n }\n\n\n\nmodule support(shape, D1, H1, D1H, D2, H2, D2H, offsetval, tolerance) {\n difference() {\n union() {\n\n if (shape == \"square\") {\n \/\/ translate([0,0,H1\/2])\n cube([D1, D1, H1], center = true);\n translate([offsetval, 0, (H2 \/ 2 + (H2 + H1) \/ 3)]) cube([D2, D2, H2], center = true);\n\n } else {\n cylinder(r = (D1 \/ 2), h = H1, center = false);\n translate([offsetval, 0, H1]) cylinder(r = (D2 \/ 2), h = H2, center = false);\n }\n\n if (offsetval != 0) {\n translate([0, 0, H1 - (H1 + H2) \/ 6])\n hull() { \/\/Connecition\n if (shape == \"square\") {\n translate([0, 0, (H1 + H2) \/ 9]) cube([D1, D1, (H1 + H2) \/ 3], center = true);\n translate([offsetval, 0, (H1 + H2) \/ 9]) cube([D2, D2, (H1 + H2) \/ 3], center = true);\n\n } else {\n cylinder(r = (D1 \/ 2), h = (H1 + H2) \/ 3, center = false);\n translate([offsetval, 0, 0]) cylinder(r = D2 \/ 2, h = (H1 + H2) \/ 3, center = false);\n }\n }\n }\n }\n \/\/Holes\n cylinder(r = D1H \/ 2 + tolerance, h = 3 * H1, center = false);\n translate([offsetval, 0, H1 - (H1 + H2) \/ 2]) cylinder(r = D2H \/ 2 + tolerance, h = 3 * H2, center = false);\n }\n\n}\n\n\nmodule SUB_pillars() {\n translate([-Xdim \/ 2 + supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([(Xdim \/ 2 - supportDiam \/ 2), (Ydim \/ 2 - supportDiam \/ 2), 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([Xdim \/ 2 - supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n translate([-Xdim \/ 2 + supportDiam \/ 2, Ydim \/ 2 - supportDiam \/ 2, 0]) support(\"square\", supportDiam, Zdim, 2.5, 0, 0, 0, 0, 0.2);\n}\n\nmodule SUB_regulatorSupport() {\n translate([0, 0, 0]) support(\"round\", supportDiam, 8, 2, 0, 0, 0, 0, 0.2);\n translate([11, 33, 0]) support(\"round\", supportDiam, 8, 2, 0, 0, 0, 0, 0.2);\n\n\n}\n\nmodule powerPlant() {\n difference() {\n box(Xdim, Ydim, Zdim, thickness, \"box\");\n \/\/Button Holes\n translate([Xdim \/ 4, Ydim \/ 2, -buttonDiam \/ 2]) rotate([90, 0, 0]) {\n\n cylinder(r = buttonDiam \/ 2, h = 10, center = true);\n translate([0, buttonDiam + 3, 0]) cylinder(r = buttonDiam \/ 2, h = 10, center = true);\n }\n }\n SUB_pillars();\n\n\n translate([-Xdim \/ 4, -Ydim \/ 5, -Zdim \/ 2]) SUB_regulatorSupport();\n\n \/\/XT60 holder\n translate([0, -Ydim \/ 2 + XT60Y \/ 2, 0]) box(XT60X, XT60Y, Zdim, thickness, \"servo\");\n\n\n}\n\nmodule labelVoltage(textL) {\n\n translate([0, 0, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(textL, font = \"Liberation Sans\", size = 4);\n translate([4, 3, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(\"+\", font = \"Liberation Sans\", size = 2);\n translate([0, 3, 0]) rotate([0, 0, -90]) linear_extrude(height = thickness \/ 2) text(\"-\", font = \"Liberation Sans\", size = 2);\n}\n\nmodule topLid() {\n\n translate([0, 0, 0])\n difference() {\n cube([Xdim + thickness, Ydim + thickness, thickness \/ 2], center = true);\n SUB_lidHoles();\n }\n translate([-Xdim \/ 4, -Ydim \/ 4, 0]) labelVoltage(textHV);\n translate([-Xdim \/ 4 - 12, -Ydim \/ 4, 0]) labelVoltage(textLV);\n\n}\n\n\nmodule SUB_lidHoles() {\n translate([-Xdim \/ 2 + supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, -5]) cylinder(r = 2.5 \/ 2, h = 10);\n translate([(Xdim \/ 2 - supportDiam \/ 2), (Ydim \/ 2 - supportDiam \/ 2), -5]) cylinder(r = 2.5 \/ 2, h = 10);\n translate([Xdim \/ 2 - supportDiam \/ 2, -Ydim \/ 2 + supportDiam \/ 2, -5]) cylinder(r = 2.5 \/ 2, h = 10);\n translate([-Xdim \/ 2 + supportDiam \/ 2, Ydim \/ 2 - supportDiam \/ 2, -5]) cylinder(r = 2.5 \/ 2, h = 10);\n\n \/\/Holes to power the lines, need to check the geomety. Fro now visually adjuste\n translate([-Xdim \/ 4 + 3, -Ydim \/ 6, -5]) cylinder(r = 4 \/ 2, h = 10);\n translate([-Xdim \/ 4 - 9, -Ydim \/ 6, -5]) cylinder(r = 4 \/ 2, h = 10);\n\n\n \/\/XT60 hole\n translate([0, -Ydim \/ 2 + XT60Y \/ 2, 0]) cube([1 * XT60X, 1 * XT60Y, Zdim], center = true);\n\n}\n\npowerPlant();\n\n\/\/translate([0, 0, 0]) topLid();\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/power.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b26a8e1ebdd3e8ff898c636b7ae630ba2126a569","subject":"main: include fixes","message":"main: include fixes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = 80;\/\/axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = 80;\/\/axis_range_z[1]*mm\/2;\n\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[35, -0, -0], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n zaxis_upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f0af18dfbe2ce5b8508a93a19f9bc621644d5ae9","subject":"gurt_klammer added","message":"gurt_klammer added\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"gurt_klammer\/gurt_klammer.scad","new_file":"gurt_klammer\/gurt_klammer.scad","new_contents":"use <..\/library2d.scad>\n\n$fn=50;\nside = 40;\nr = 2.5;\n\nmodule klammer(x=25,r=2.5) {\n difference() {\n flat(side,r);\n for(i=[-1,1])translate([0,i*x\/2])slot(x,r,0);\n translate([x\/2,0])slot(0,r,x);\n } \n translate([side\/2+5,0])square([10,20],center=true);\n}\n\nmodule slot(x,r,y) {\n hull()for(i=[-1,1])translate([x\/2*i,y\/2*i])circle(r=r);\n}\nmodule flat(x,r,y) {\n hull()tr_xy(x\/2-r)circle(r=r);\n}\nklammer();","old_contents":"","returncode":1,"stderr":"error: pathspec 'gurt_klammer\/gurt_klammer.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"ba14861d0c771b055ffb7af3e749e362ca85d48a","subject":"misc: add pythag_hyp and pythag_leg","message":"misc: add pythag_hyp and pythag_leg\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-misc.scad","new_file":"utils-misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) sum_vec(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ sum a vector up to position i\nfunction v_sum(v, i) = i >= 0 ? v[i] + sum_vec(v, i - 1) : 0;\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) sum_vec(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9aa1c2d9eed0c91ec970877e6a7b0a7a6e2e8500","subject":"Fix placement of top cover cut for mask.","message":"Fix placement of top cover cut for mask.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 29;\nview_opening_height = 90;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=0, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n difference() {\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n vert_face_base(x=mask_loc);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 29;\nview_opening_height = 90;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=0, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n vert_face_base(x=mask_loc);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"309d11f1651f2bdf8376477b9031e0f07f019d89","subject":"side support walls added","message":"side support walls added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_still_mount_support\/window_still_mount_support.scad","new_file":"window_still_mount_support\/window_still_mount_support.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"b105f8b093ab37ece6b486f0669da8d8979e9b1b","subject":"fix the buttons height","message":"fix the buttons height\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/buttons_v1.scad","new_file":"3d\/buttons_v1.scad","new_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 21;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","old_contents":"$fn = 50;\nbutton_h = 13;\noverlap = 5;\ntotal_height = 23;\nth = 2; \/\/ enclosure thickness\neps = 1e-1;\n\ncap_r = 6.5 \/ 2;\ncap_h = total_height - button_h + overlap;\n\nborder_offset = 5.5 + th;\nborder_h = 3;\nborder_r = cap_r + 3;\n\nsocket_r = 3.2 \/ 2;\n\ndifference() {\n union() {\n cylinder(r=cap_r, h=cap_h);\n translate([0, 0, cap_h - border_h - border_offset]) {\n cylinder(r=border_r, h=border_h);\n }\n }\n translate([0, 0, -eps]) {\n cylinder(r=socket_r, h=overlap+eps);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2745abbbd6695b08aac59b988c2b64927e5fe111","subject":"shapes\/pie_slice: Add tests, allow negative sweep","message":"shapes\/pie_slice: Add tests, allow negative sweep\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, align=align)\n translate([0,0,-h\/2])\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n \/*stack(dist=10, axis=[0,0,-1])*\/\n \/*{*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=-180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n \/*}*\/\n}\n","old_contents":"use \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,1],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([extra_sizexy,extra_sizexy,extra_h], align=extra_align, orient=orient)\n orient(orient)\n {\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n orient(-orient)\n size_align([sizexy,sizexy,h], align=align, orient=orient)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n\/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*translate([10,0,0])*\/\n\/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n\/*}*\/\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n\/*hull_pairwise()*\/\n{\n \/*sphere(30\/2);*\/\n\n\/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n\/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bf2f7c5318f09554224fb37d0b8328adaa1770f1","subject":"enclosure top: minor adjustments","message":"enclosure top: minor adjustments\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\nusb_type_b_h = 11.5;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\nusb_type_a_h = 8;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_r = bolt_d\/2 + 2;\nstoiki_h = top_box_z - th;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room+stoiki_h\/2]) {\n\t \/\/cylinder($fn=fn, r=stoiki_r, h=top_box_z-th+eps);\n cube(size=[under_pcb, under_pcb, stoiki_h + eps], center=true);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=fn, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\nusb_type_b_h = 11.5;\nstart_type_b_y = shift_y + pcb_y - 30.1;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\nusb_type_a_h = 8;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_h = 6;\ngaika_w = 5.6;\n\n\ntranslate([0,0,-50]) {\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 17 + th;\nstoiki_r = bolt_d\/2 + 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 14;\nscreen_hold_y_shift = -2;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 2.5;\ntop_bolt_r = 3.5;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=fn, r=stoiki_r, h=top_box_z-th+eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y + screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=fn, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x-tol, screen_start_y-tol, top_box_z - th - eps]) {\n cube([screen_length_x + 2*tol, screen_length_y + 2*tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h+tol]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_a_w + 2*tol, usb_type_a_h + 2*tol]);\n }\n \/\/ master buttons\n for (dx = [master_button_x, master_button_x + master_button_int*2])\n translate([dx, master_button_y, top_box_z - th - eps]) {\n\t cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7337486045903140ccaa362281a84b1230dddb2b","subject":"Probe mount, rough dimensions.","message":"Probe mount, rough dimensions.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-probe-mount\/probe_mount_1.scad","new_file":"wanhao-i3-probe-mount\/probe_mount_1.scad","new_contents":"\/\/ enlarged to account for shrink\ng3mm = 3.45;\ng3mmnut = 5.85;\ng2mm = 2.0;\ngNutChamfer = 0.5;\n\nmodule NutTrap(x,h=100) {\n cylinder(d=x\/0.866,h=h,$fn=6);\n translate([0,0,-0.01])\n cylinder(d1=(x+gNutChamfer)\/0.866,d2=x\/0.866,h=gNutChamfer,$fn=6);\n}\n\nmodule NutTrapSupport(d,h,cylinder_wall_offset=0.1) {\n cylinder(d=d+cylinder_wall_offset*2,h=h,$fn=16);\n}\n\nmodule RoundedCube(dims,r=10) {\n hull()\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([dims[0]\/2-r,dims[1]\/2-r,0])\n cylinder(r=r,h=dims[2]);\n}\n\nmodule ChamferHole(r,h=100,c=0.5,top_c=0) {\n cylinder(r=r,h=h);\n translate([0,0,-0.01])\n cylinder(r1=r+c,r2=r,h=c);\n if(top_c != 0 )\n translate([0,0,h-c+0.01])\n cylinder(r1=r,r2=r+c,h=top_c);\n}\n\n\nmodule Main() {\n difference() {\n union() {\n translate([10,-3,0]) RoundedCube([75,20,7],3,$fn=32);\n translate([37,-3,7]) ChamferHole(8,6,$fn=64);\n }\n translate([0,0,5]) RoundedCube([52,20,7],2,$fn=32);\n for(x=[-20,20])\n translate([x,0,0]) {\n NutTrap(g3mmnut, 3);\n translate([0,0,5.01]) scale([1,1,-1]) ChamferHole(g3mm\/2,2,$fn=32);\n }\n translate([37,-3,0]) ChamferHole(6.1,7+6,top_c=0.5,$fn=32);\n }\n for(x=[-20,20])\n translate([x,0,0]) NutTrapSupport(g3mm,3);\n}\n\nMain();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'wanhao-i3-probe-mount\/probe_mount_1.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"efae9caa06df971baf3611e802186d39bbf3a5b6","subject":"sweep: add missing system ref","message":"sweep: add missing system ref\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"sweep.scad","new_file":"sweep.scad","new_contents":"include \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\n\nfunction combine_accumulated_rotations(a,b) =\nconcat(a, [ let(e = a[len(a)-1]) for(t = b) t * e ]);\n\nfunction accumulate_rotations(rotations) = let(N=len(rotations))\n N == 0 ? [] :\n N == 1 ? rotations :\n let(mid = floor(N\/2))\n combine_accumulated_rotations(\n accumulate_rotations(subarray(rotations,0,mid)),\n accumulate_rotations(subarray(rotations,mid))\n );\n\nfunction construct_torsion_minimizing_rotations(tangents) = [\n for (i = [0:len(tangents)-2])\n rotate_from_to(tangents[i],tangents[i+1])\n];\n\n\/\/ Calculates the relative torsion along the Z axis for two transformations\nfunction calculate_twist(A,B) = let(D = transpose_3(B) * A)\n atan2(D[1][0], D[0][0]);\n\nfunction construct_transform_path_mod(path, closed=false) = let(\n l = len(path),\n tangents = [ for (i=[0:l-1]) tangent_path(path, i)],\n local_rotations = construct_torsion_minimizing_rotations(concat([Z],tangents)),\n rotations = accumulate_rotations(local_rotations),\n twist = closed ? calculate_twist(rotations[0], rotations[l-1]) : 0\n ) [ for (i = [0:l-1]) construct_rt(rotations[i], path[i]) * rotation([0,0,twist*i\/(l-1)])];\n\nfunction path_extend(path, extend=[5,5]) =\n let(\n path_start = path[0],\n path_end = path[len(path)-1],\n\n path_start_e_ = path_start * translation([0,0,-extend[0]]),\n path_end_e_ = path_end * translation([0,0,extend[1]]),\n\n s_t1 = translation_part(path_start),\n s_t2 = translation_part(path_start_e_),\n s_t3 = [s_t2[0],s_t2[1],s_t1[2]],\n\n e_t1 = translation_part(path_end),\n e_t2 = translation_part(path_end_e_),\n e_t3 = [e_t2[0],e_t2[1],e_t1[2]],\n\n path_start_e = construct_rt(rotation_part(path_start_e_), s_t3),\n path_end_e = construct_rt(rotation_part(path_end_e_), e_t3)\n )\n\n \/\/ extended path\n concat([path_start_e], path, [path_end_e]);\n\nuse \nmodule sweep_t(shape, path_transforms, closed=false, t_pre=identity4(), t_post=identity4())\n{\n \/*path_transforms_mod = path_transforms;*\/\n path_transforms_mod =\n t_pre==U?\n t_post==U?\n path_transforms\n : transform_post(path_transforms, t_post)\n :\n t_post==U?\n transform_pre(path_transforms, t_pre)\n : transform_pp(path_transforms, t_pre, t_post)\n ;\n\n sweep(shape, path_transforms_mod, closed);\n}\n\nfunction path_size_i(path,i) =\n let(\n path_t_i=[for(t=path) translation_part(t)[i]]\n )\n max(path_t_i)-min(path_t_i);\n\nfunction path_size(path) =\n [\n path_size_i(path,0), path_size_i(path,1), path_size_i(path,2),\n ];\n\n","old_contents":"use \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \nuse \n\n\nfunction combine_accumulated_rotations(a,b) =\nconcat(a, [ let(e = a[len(a)-1]) for(t = b) t * e ]);\n\nfunction accumulate_rotations(rotations) = let(N=len(rotations))\n N == 0 ? [] :\n N == 1 ? rotations :\n let(mid = floor(N\/2))\n combine_accumulated_rotations(\n accumulate_rotations(subarray(rotations,0,mid)),\n accumulate_rotations(subarray(rotations,mid))\n );\n\nfunction construct_torsion_minimizing_rotations(tangents) = [\n for (i = [0:len(tangents)-2])\n rotate_from_to(tangents[i],tangents[i+1])\n];\n\n\/\/ Calculates the relative torsion along the Z axis for two transformations\nfunction calculate_twist(A,B) = let(D = transpose_3(B) * A)\n atan2(D[1][0], D[0][0]);\n\nfunction construct_transform_path_mod(path, closed=false) = let(\n l = len(path),\n tangents = [ for (i=[0:l-1]) tangent_path(path, i)],\n local_rotations = construct_torsion_minimizing_rotations(concat([Z],tangents)),\n rotations = accumulate_rotations(local_rotations),\n twist = closed ? calculate_twist(rotations[0], rotations[l-1]) : 0\n ) [ for (i = [0:l-1]) construct_rt(rotations[i], path[i]) * rotation([0,0,twist*i\/(l-1)])];\n\nfunction path_extend(path, extend=[5,5]) =\n let(\n path_start = path[0],\n path_end = path[len(path)-1],\n\n path_start_e_ = path_start * translation([0,0,-extend[0]]),\n path_end_e_ = path_end * translation([0,0,extend[1]]),\n\n s_t1 = translation_part(path_start),\n s_t2 = translation_part(path_start_e_),\n s_t3 = [s_t2[0],s_t2[1],s_t1[2]],\n\n e_t1 = translation_part(path_end),\n e_t2 = translation_part(path_end_e_),\n e_t3 = [e_t2[0],e_t2[1],e_t1[2]],\n\n path_start_e = construct_rt(rotation_part(path_start_e_), s_t3),\n path_end_e = construct_rt(rotation_part(path_end_e_), e_t3)\n )\n\n \/\/ extended path\n concat([path_start_e], path, [path_end_e]);\n\nuse \nmodule sweep_t(shape, path_transforms, closed=false, t_pre=identity4(), t_post=identity4())\n{\n \/*path_transforms_mod = path_transforms;*\/\n path_transforms_mod =\n t_pre==U?\n t_post==U?\n path_transforms\n : transform_post(path_transforms, t_post)\n :\n t_post==U?\n transform_pre(path_transforms, t_pre)\n : transform_pp(path_transforms, t_pre, t_post)\n ;\n\n sweep(shape, path_transforms_mod, closed);\n}\n\nfunction path_size_i(path,i) =\n let(\n path_t_i=[for(t=path) translation_part(t)[i]]\n )\n max(path_t_i)-min(path_t_i);\n\nfunction path_size(path) =\n [\n path_size_i(path,0), path_size_i(path,1), path_size_i(path,2),\n ];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6c534d7b68b52687159949ca8a95df05ba739439","subject":"metric-screw: add screw_cut_h and nut_cut_h","message":"metric-screw: add screw_cut_h and nut_cut_h\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut=nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut=nut, tolerance=1.25, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut=nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut=nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"05fb2a09e938f254684b39797d647479ea2dccca","subject":"Some of the variable names were refactored. Some of the variables were setup for Thingiverse Customizer parameters.","message":"Some of the variable names were refactored. Some of the variables were setup for Thingiverse Customizer parameters.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/name-tags\/nametag.scad","new_file":"OpenSCAD\/name-tags\/nametag.scad","new_contents":"\r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\n\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\n\r\nbaseThickness=2;\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nletterthickness=1;\r\nlettersize=12 ;\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[10,\"Roberto\"],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text \r\n\t[-10,\"Scrum Trooper\"],\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\nnametag_assembly();\r\n\r\n\r\n\/\/ ************* Module part *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(\"black\") \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(\"black\")\t\r\n\t\tborder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse base();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterthickness\/2])\r\n\t\t\twrite(namematrix[i][1],t=letterthickness,h=lettersize,center=true,font=font);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tbase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\thole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\thole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference(){\r\n\t\tbase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t}\r\n}\r\n\r\nmodule base()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule border()\r\n{\r\n\ttranslate([0,0,baseThickness+letterthickness\/2])\r\n\tlinear_extrude(height = letterthickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tquarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tquarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tquarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tquarter();\r\n\t}\r\n}\r\n\r\nmodule quarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule hole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}","old_contents":"\r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\nbasex=228;\t\t\t\/\/ Width of base\r\nbasey=54;\t\t\t\/\/ Height of base\r\nbasethickness=2;\r\n\r\nborderwidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nletterthickness=1;\r\nlettersize=12 ;\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\nnamematrix = \r\n[\t\t\t\t\t \t \/\/ Matrix with place and names - add as many rows as you like\t \r\n\t[10,\"Roberto\"],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text \r\n\t[-10,\"Scrum Trooper\"],\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\nnametag_assembly();\r\n\r\n\r\n\/\/ ************* Module part *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(\"black\") \r\n\twriting();\r\n\t\r\n\/\/TODO: put an if conditional here that determins if the border is displayed or not\t\r\n\tcolor(\"black\")\t\r\n\tborder();\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse base();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\ttranslate([0,namematrix[i][0],basethickness+letterthickness\/2])\r\n\t\t\twrite(namematrix[i][1],t=letterthickness,h=lettersize,center=true,font=font);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tbase();\r\n\t\ttranslate([-(basex\/2-borderdistance*2-borderwidth-countersink-holediameter),0,0])\r\n\t\t\thole();\r\n\t\ttranslate([(basex\/2-borderdistance*2-borderwidth-countersink-holediameter),(0),0])\r\n\t\t\thole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference(){\r\n\t\tbase();\r\n\t\ttranslate([(basex\/2-borderdistance),(basey\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t\ttranslate([(basex\/2-borderdistance),-(basey\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t\ttranslate([-(basex\/2-borderdistance),(basey\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t\ttranslate([-(basex\/2-borderdistance),-(basey\/2-borderdistance),0])\r\n\t\t\thole();\r\n\t}\r\n}\r\n\r\nmodule base()\r\n{\r\n\ttranslate([0,0,basethickness\/2])\r\n\t\tcube(size = [basex,basey,basethickness], center = true);\r\n}\r\n\r\nmodule border()\r\n{\r\n\ttranslate([0,0,basethickness+letterthickness\/2])\r\n\tlinear_extrude(height = letterthickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,basey\/2-borderdistance,0])\r\n\t\t\tsquare ([basex-borderdistance*2-borderradius*2+borderwidth*2,borderwidth],center = true);\r\n\t\ttranslate([0,-(basey\/2-borderdistance),0])\r\n\t\t\tsquare ([basex-borderdistance*2-borderradius*2+borderwidth*2,borderwidth],center = true);\r\n\t\ttranslate([basex\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderwidth, basey-borderdistance*2-borderradius*2+borderwidth*2,],center = true);\r\n\t\ttranslate([-(basex\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderwidth, basey-borderdistance*2-borderradius*2+borderwidth*2,],center = true);\r\n\r\n\t\ttranslate([-(basex\/2-borderdistance),-(basey\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tquarter();\r\n\t\ttranslate([(basex\/2-borderdistance),(basey\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tquarter();\r\n\t\ttranslate([(basex\/2-borderdistance),-(basey\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tquarter();\r\n\t\ttranslate([-(basex\/2-borderdistance),(basey\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tquarter();\r\n\t}\r\n}\r\n\r\nmodule quarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderwidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule hole()\r\n{\r\n\ttranslate([0,0,basethickness\/2])\r\n\t\tcylinder(h = basethickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,basethickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"df3f581fd248c59637d46a31313f915b2be4497d","subject":"Update parameter name for text() to match latest OpenSCAD snapshots.","message":"Update parameter name for text() to match latest OpenSCAD snapshots.\n","repos":"brodykenrick\/text_on_OpenSCAD","old_file":"text_on.scad","new_file":"text_on.scad","new_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t=\"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\";\t \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false;\t \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0;\t\t \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth= 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi=3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2=internal_pi*2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = ((center==true)?(height\/2):(height));\r\nfunction cylinder_center_adjusted_bottom( height, center ) = ((center==true)?(height\/2):(0));\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0)\r\n = ( width_of_text_char( size, spacing ) \/(internal_pi2*r))*360*(1-abs(rotate)\/90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering\t\r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing,r,rotate,center)\r\n = ( (center)?((width_of_text_string_num_length( len(t)-1, size, spacing )\/2\/(internal_pi2*r)*360)):(0) );\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center)\r\n = (((center)?((width_of_text_string( t, size, spacing )\/2\/(internal_pi2*r)*360)):(1)) * (1-abs(rotate)\/90));\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t=default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\tassign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n {\r\n\t if ((face==\"top\")||(face==\"bottom\") ){\r\n\t \/\/Work on a circle\r\n\t\t assign( locn_offset_vec = ((face==\"top\" ) ? ([0,0,cylinder_center_adjusted_top(h,cylinder_center)]) : ([0,0,cylinder_center_adjusted_bottom(h,cylinder_center)]) ))\r\n\t\t assign( rotation_angle = ((face==\"top\" ) ? (0) : (180) ))\r\n\t\t assign( int_radius = (r==undef)?((face==\"top\" ) ? (r2) : (r1) ) : (r) ) \/\/Assign the top\/bottom radius for slanty-cylinders\r\n\t\t {\r\n\t\t rotate(rotation_angle,[1,0,0])\r\n\t\t\t text_on_circle(t,locn_vec+locn_offset_vec,r=int_radius-size,\r\n\t\t\t font=font,size=size,\r\n\t\t\t spacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t extrusion_height=extrusion_height,\r\n\t\t\t rotate=rotate,\r\n\t\t\t eastwest=eastwest,middle=middle,ccw=ccw);\r\n\t\t }\r\n\t }else{\r\n\t if((middle!=undef) && (middle!=default_circle_middle))\r\n {\r\n \/\/TODO: Which others?\r\n \/\/TODO: Which side things aren't supported on the circle\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n }\r\n\t \/\/Work on the side\r\n\t\t assign( locn_offset_vec = ((cylinder_center==true)?([0,0,0]):([0,0,h\/2])) ) \r\n\t\t rotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing,r,rotate,center), [0,0,1])\r\n\t\t translate(locn_vec+locn_offset_vec)\r\n\t\t __internal_text_on_cylinder_side(t,locn_vec,r=r,h=h,r1=r1,r2=r2,\r\n\t\t cylinder_center=cylinder_center,\r\n\t\t center=center,\r\n\t\t font=font,size=size,\r\n\t\t spacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t extrusion_height=extrusion_height,\r\n\t\t\t rotate=rotate,face=face,updown=updown,\r\n\t\t\t eastwest=eastwest);\r\n\t }\r\n\t}\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\tassign( ccw_sign = (ccw==true) ? (1) : (-1) )\r\n\tassign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n assign( ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? (0) : (1) ) \r\n\tassign( rotate_z_outer = ( -rotate + ccw_sign*eastwest ) )\r\n\t{\r\n\t\trotate(rotate_z_outer, [0,0,1])\r\n\t\t{\r\n assign( rotate_z_inner = (-rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string( t, size, spacing, r-middle, rotate, center)) )\r\n\t\t\trotate( rotate_z_inner, [0,0,1] )\r\n\t\t\t{\r\n\t\t\t translate(locn_vec)\r\n\t\t\t\tfor (l=[0:len(t)-1]){\r\n\t\t\t\t \/\/TTB\/BTT means no per letter rotation\r\n\t\t\t\t assign( rotate_z_inner2_tmp = -ccw_sign * 90 + ttb_btt_inaction*rtl_sign*ccw_sign*l*rotation_for_character(size, spacing, r-middle, rotate=0) ) \/\/Bottom out=-270+r\r\n\t\t\t\t assign( rotate_z_inner2 = (rotate_z_inner2_tmp) )\r\n\t\t\t\t \/\/TTB means we go toward center, BTT means away\r\n\t\t\t rotate( rotate_z_inner2, [0,0,1] )\r\n\t\t\t\t assign( vert_x_offset = (direction==\"ttb\" || direction==\"btt\") ? ( l * size * ((direction==\"btt\")?(-1):(1)) ) : ( 0 ) )\r\n\t\t\t\t\ttranslate([r-middle - vert_x_offset,0,0])\r\n\t\t\t\t\trotate(-ccw_sign*270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\t\t\t\ttext_extrude(t[l],center=true,\r\n\t\t\t\t\t font=font,size=size,\r\n\t\t\t\t\t rotate=undef,\r\n\t\t\t spacing=spacing,\r\n\t\t\t direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t\t\t language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t extrusion_height=extrusion_height );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1,r2,h_total,h_offset) = ( r1 + ((r2-r1) * (h_total-h_offset)\/h_total) );\r\n \r\n \t\/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1,r2,h,length,rotate, updown) = ( h\/2 - updown + length * rotate\/90 * cos( atan( (r2-r1)\/h ) ) );\r\n\r\n function calc_radius_at_length(r1,r2,h,length,rotate,updown) = ( calc_radius_at_height_offset(r1,r2,h,calc_height_offset_at_length(r1,r2,h,length,rotate,updown)));\r\n \r\n if(r==undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction==\"btt\") || (direction==\"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\")); \r\n }\r\n if(center==true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n assign( r1 = ((r1!=undef)?(r1):(r)) )\r\n assign( r2 = ((r2!=undef)?(r2):(r)) )\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\tassign( r1 = center?(r1-extrusion_height\/2):(r1) )\r\n\tassign( r2 = center?(r2-extrusion_height\/2):(r2) )\r\n \r\n assign( center = ((r!=undef)?(center):(false)) ) \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n assign( direction = ((r==undef) && ((direction==\"ttb\")||(direction==\"btt\")))?(\"ltr\"):(direction) ) \/\/We don't do ttb or btt directions on slanty\r\n assign( rtl_sign = ((direction==\"rtl\") ? (-1) : (1)) )\r\n\r\n \r\n {\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0,0,updown])\r\n rotate(eastwest,[0,0,1])\r\n for (l=[0:len(t)-1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \t \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n assign( length_to_center_of_char = width_of_text_string_num_length(l+0.5,size,spacing) )\r\n assign( radius_here = calc_radius_at_length(r1,r2,h, length_to_center_of_char, rotate, updown) )\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n\t\t assign( rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, ( radius_here ), rotate) * ((direction==\"ttb\" || direction==\"btt\") ? ( 0 ) : ( l )) )\r\n\t rotate(rotate_z_inner,[0,0,1])\r\n\t \/\/Positioning - based on (somewhat innacurate) string length\r\n\t\t \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n\t\t assign( vert_z_char_offset = (direction==\"ttb\" || direction==\"btt\") ? ( l * size * ((direction==\"ttb\")?(-1):(1)) ) : ( 0 ) )\r\n\t\t \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n\t\t assign( vert_z_half_text_offset_tmp = (len(t)-1)\/2 * ((rotate)\/90*wid) )\r\n\t\t assign( vert_z_half_text_offset = ((direction==\"ttb\" || direction==\"btt\") || (center==false))?(0):(vert_z_half_text_offset_tmp) )\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate)\/90*wid) + vert_z_half_text_offset])\r\n\r\n\t \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n\t rotate( atan( (r2-r1)\/h ) , [0,1,0])\r\n\t \/\/Flip onto face of \"normal\" cylinder\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\r\n \t \/\/Modify the offset of the baselined text to center\r\n translate([0,(center)?(-size\/2):(0),0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t font=font,size=size,\r\n\t spacing=spacing,\r\n\t direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t language=language,script=script,\r\n\t halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n\t extrusion_height=extrusion_height\r\n\t );\r\n }\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n\tassign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n\t\r\n\t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\t\/\/If we are centered - we sink the radius by half the\r\n\t\/\/extrusion height to draw \"just below the surface\"\r\n\tassign( r = center?(r-extrusion_height\/2):(r) )\r\n\t\r\n\trotate(eastwest,[0,0,1])\r\n\trotate(-northsouth,[1,0,0])\r\n\trotate(spin,[0,1,0])\r\n\t\/\/This tries to center the text (for RTL text).\r\n assign( ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? (0) : (1) ) \r\n\trotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, r, rotate, center), [0,0,1])\r\n\t{\r\n\t translate(locn_vec)\r\n\t\tif ( rounded == false ){\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=r,\r\n\t \t\trotate=rotate,\r\n\t \t\tcenter=center,\r\n\t \t\tscale=scale,\r\n\t font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height\r\n\t\t\t);\r\n\t\t}else{\r\n\t\t \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n\t\t\tintersection()\r\n\t\t\t{\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=r,\r\n \t\trotate=rotate,\r\n \t\tcenter=center,\r\n \t\tscale=scale,\r\n font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height*2 \/\/Make it proud to clip it off.\r\n\t\t );\r\n\r\n \/\/Shell - bounding inner and outer\r\n\t\t\tdifference()\r\n\t\t\t{ \/\/rounded outside\r\n\t\t\t\tsphere(r+extrusion_height);\r\n\t\t\t\t\/\/ rounded inside for indented text\r\n\t\t\t sphere( r );\r\n\t\t\t}\r\n\r\n\t\t }\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t=default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n assign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n assign( ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? (0) : (1) ) \r\n assign( ttb_btt_action = (direction==\"ttb\" || direction==\"btt\") ? (1) : (0) ) \r\n \r\n for (l=[0:len(t)-1]){\r\n\t assign( rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0) )\r\n\t \r\n rotate( rotate_z_inner, [0,0,1] )\r\n assign( translate_sign = (direction==\"ttb\" || direction==\"btt\") ? ( ((direction==\"btt\")?(1):(-1)) ) : ( 0 ) )\r\n \/\/assign( translate_effect = (direction==\"ttb\" || direction==\"btt\") ? (1) : ( 0 ) )\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n\t translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n\t rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l )\/90 , [0,1,0])\r\n \/\/Flip character into position to be flush against sphere\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\t \r\n\t \/\/Modify the offset of the baselined text to center\r\n\t translate([0,(center)?(-size\/2):(0),0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t scale=scale,\r\n\t font=font,\r\n\t size=size,\r\n spacing=spacing,\r\n direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language=language,script=script,\r\n halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height=extrusion_height );\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t=default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0,0,0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n assign( int_cube_size = (str(cube_size)[0] != \"[\")?([cube_size,cube_size,cube_size]):(cube_size) )\r\n assign(\r\n\t rotate_x = ((face==\"front\") || (face==\"back\") || (face==\"left\") || (face==\"right\"))?(90)\r\n\t :(\t(face==\"bottom\")?(180):(0) ) \/\/Top is zero\r\n\t)\r\n\tassign(\r\n\t rotate_y = ( (face==\"back\") || (face==\"left\") || (face==\"right\"))\r\n\t ?((face==\"back\")?(180)\r\n\t :( ((face==\"left\")?(-90):(90)) ) \/\/Right is 90\r\n\t )\r\n\t :(0) \/\/Top, bottom, front are zero\r\n\t)\r\n\tassign(\r\n\t locn_vec_offset =\r\n\t (face==\"front\")?( [+rightleft, -int_cube_size[1]\/2,+updown] )\r\n\t :(\t(face==\"back\")?( [+rightleft, +int_cube_size[1]\/2,+updown] )\r\n\t :(\t(face==\"left\")?( [-int_cube_size[0]\/2,+rightleft, +updown] )\r\n\t :(\t(face==\"right\")?( [+int_cube_size[0]\/2,+rightleft, +updown] )\r\n\t :(\t(face==\"top\")?( [+rightleft, +updown, +int_cube_size[2]\/2] )\r\n\t :(\t [+rightleft, -updown, -int_cube_size[2]\/2] ) ) ) ) \/\/bottom\r\n\t )\r\n\t)\r\n {\r\n\t\ttranslate(locn_vec + locn_vec_offset)\r\n\t\trotate(rotate_x,[1,0,0])\r\n\t\trotate(rotate_y,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\ttext_extrude(t,\r\n\t\t center=center,\r\n\t\t rotate=rotate,\r\n\t\t scale=scale,\r\n\t\t font=font,\r\n\t\t size=size,\r\n\t\t spacing=spacing,\r\n\t\t direction=direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n\t\t language=language,\r\n\t\t script=script,\r\n\t\t halign=halign,\r\n\t\t valign=valign,\r\n\t\t extrusion_height=extrusion_height );\r\n\t}\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val!=undef?val:default_val);\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t=default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center==true)\r\n {\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n assign( t = default_if_undef(t,default_t) )\r\n assign( font = default_if_undef(font,default_font) )\r\n assign( extrusion_height = default_if_undef(extrusion_height,default_extrusion_height) )\r\n assign( center = default_if_undef(center,default_center) )\r\n assign( rotate = default_if_undef(rotate,default_rotate) )\r\n assign( spacing = default_if_undef(spacing,default_spacing) )\r\n assign( size = default_if_undef(size,default_size) )\r\n \r\n assign( halign = (center)?(\"center\"):(halign) )\r\n assign( valign = (center)?(\"center\"):(valign) )\r\n assign( extrusion_center = (center)?(true):(false) )\r\n\t\r\n\tscale( scale )\r\n rotate(rotate,[0,0,-1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n\t{\r\n\t linear_extrude(height=extrusion_height,convexity=10,center=extrusion_center)\r\n text(text=t, size = size,\r\n $fn = 40,\r\n font = font, direction = direction, spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language=language, script=script);\r\n\t}\r\n}\r\n\r\n","old_contents":"\/* text on ....\r\n This is a rework of version 3 of write.scad to use the new OpenSCAD internal text() primitive.\r\n All credit to Harlan Martin (harlan@sutlog.com) for his great effort on the original.\r\n Great thanks to t-paul (and the OpenSCAD dev team) on adding the new text() primitive.\r\n*\/\r\n\r\n\r\n\/*\r\nThe arguments to be provided for each function are explictly in the modules.\r\n\r\nAll modules take close to all the arguments to text() [Not all features are supported in all text_on_object() modules though -- try them out warnings will be given if it is not supported]\r\n\r\ntext() params:\r\nt\r\nsize\r\nspacing\r\nfont\r\ndirection -- ltr, ttb, btt or rtl\r\nlanguage\r\nscript\r\nhalign -- left, right or center\r\nvalign -- baseline, bottom, top or center\r\n\r\nAll modules also take the additional arguments:\r\nextrusion_height = depth of the letter, i.e. how far it sits proud\r\nrotate\r\ncenter \/\/center the text at the location it is being written (NOT that the object is centered)\r\n\r\nALL faux-objects that the text is applied to have center=true\r\nTODO: object_center=true\/false (already done for cylinder)\r\n\r\nThe above arguemnts can be seen in text_extrude() as all modules call that module evetually (often multiple times).\r\n\r\nlocn_vector -- Where the faux-object has been translated to. TODO: Rename object to translate_vector?\r\n\r\nAdditional arguments for text_on_cube():\r\n\r\nAdditional arguments for text_on_cylinder():\r\n\r\nAdditional arguments for text_on_circle():\r\n\r\nAdditional arguments for text_on_sphere():\r\n\r\n\r\n*\/\r\n\r\n\/\/ These control the default values for text_extrude(), text_on_sphere(), text_on_cube(), text_on_cylinder(), text_on_circle()\r\n\/\/ if the arguments are not included in the call to the module.\r\n\r\n\/\/ Defaults\r\n\/\/ Defaults for all modules\r\ndefault_t=\"text_on\";\r\ndefault_size = 4; \/\/TODO - Can we make this 10?? To match internal size? There is an underlying value in text() -- This masks that.\r\ndefault_font = \"Liberation Mono\";\r\ndefault_spacing = 1; \/\/Spacing between characters. There is an underlying value in text() -- This masks that. We try and match it here.\r\ndefault_rotate = 0; \/\/ text rotation (clockwise)\r\ndefault_center = true; \/\/Text-centering\r\ndefault_scale = [1,1,1];\r\ndefault_extrusion_height = 2; \/\/mm letter extrusion height\r\n\r\n\/\/Defaults for Cube\r\ndefault_cube_face = \"front\";\t \/\/ default face (top,bottom,left,right,back,front)\r\ndefault_sphere_rounded = false;\t \/\/default for rounded letters on text_on_sphere\r\ndefault_cube_updown = 0; \/\/mm up (-down) from center on face of cube\r\ndefault_cube_rightleft = 0;\t\t \/\/mm right(-left) from center on face of cube\r\n\r\n\/\/Defaults for Sphere\r\ndefault_sphere_northsouth= 0;\r\ndefault_sphere_eastwest = 0;\r\ndefault_sphere_spin = 0; \/\/TODO:Different to rotate? or up\/down. Better name?\r\n\r\n\/\/Defaults for Cylinder (including circle as it is on top\/bottom)\r\ndefault_circle_middle = 0; \/\/(mm toward middle of circle)\r\ndefault_circle_ccw = false; \/\/write on top or bottom in a ccw direction\r\ndefault_circle_eastwest = 0;\r\ndefault_cylinder_face = \"side\";\r\ndefault_cylinder_updown = 0;\r\n\r\n\/\/Internal values - don't play with these :)\r\n\/\/This is much more accurate than the PI constant internal to Openscad.\r\ninternal_pi=3.1415926535897932384626433832795028841971693993751058209;\r\ninternal_pi2=internal_pi*2;\r\n\r\n\/\/Internal values - You might want to play with these if you are using a proportional font\r\ninternal_space_fudge = 0.80; \/\/Fudge for working out lengths (widths) of strings\r\n\r\ndebug = true;\r\n\r\n\/\/---- Helper Functions ----\r\n\/\/String width (length from left to right or RTL) in OpenSCAD units\r\n\/\/NOTE: These are innacurate because we don't know the real spacing of the chars and so have to approximate\r\n\/\/They work for monospaced (fixed-width) fonts well\r\nfunction width_of_text_char( size, spacing ) = (size * internal_space_fudge * spacing);\r\nfunction width_of_text_string_num_length(length, size, spacing) = ( width_of_text_char( size, spacing ) * (length));\r\nfunction width_of_text_string( t, size, spacing ) = ( width_of_text_string_num_length(len(t), size, spacing) );\r\n\r\nfunction cylinder_center_adjusted_top( height, center ) = ((center==true)?(height\/2):(height));\r\nfunction cylinder_center_adjusted_bottom( height, center ) = ((center==true)?(height\/2):(0));\r\n\r\n\r\n\/\/Angle that measures width of letters on perimeter of a circle (and sphere and cylinder)\r\nfunction rotation_for_character(size, spacing, r, rotate = 0)\r\n = ( width_of_text_char( size, spacing ) \/(internal_pi2*r))*360*(1-abs(rotate)\/90);\r\n\r\n\r\n\/\/Rotate 1\/2 width of text if centering\t\r\n\/\/One less -- if we have a single char we are already centred..\r\nfunction rotation_for_center_text_string( t, size, spacing,r,rotate,center)\r\n = ( (center)?((width_of_text_string_num_length( len(t)-1, size, spacing )\/2\/(internal_pi2*r)*360)):(0) );\r\n\r\n\/\/Rotate according to rotate and if centred text also 1\/2 width of text\r\nfunction rotation_for_center_text_string_and_rotate( t, size, spacing,r,rotate,center)\r\n = (((center)?((width_of_text_string( t, size, spacing )\/2\/(internal_pi2*r)*360)):(1)) * (1-abs(rotate)\/90));\r\n\r\n\r\n\/\/---- Text on Object Functions ----\r\n\/\/Text on the top or side of a cylinder.\r\n\/\/Supports writing on normal and slanty cylinders\r\n\/\/cylinder(h,r,center)\r\n\/\/cylinder(h,r1,r2,center)\r\nmodule text_on_cylinder(t=default_t,\r\n \/\/Object-specific \r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n face = default_cylinder_face,\r\n updown = default_cylinder_updown,\r\n rotate = default_rotate,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n cylinder_center = false, \/\/if the cylinder object we are writing on is center==true\r\n \/\/TODO: add rounded\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_cylinder:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"h\" , h));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r=\" , r));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"text_on_cylinder:\",\"r2=\" , r2));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\tassign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n {\r\n\t if ((face==\"top\")||(face==\"bottom\") ){\r\n\t \/\/Work on a circle\r\n\t\t assign( locn_offset_vec = ((face==\"top\" ) ? ([0,0,cylinder_center_adjusted_top(h,cylinder_center)]) : ([0,0,cylinder_center_adjusted_bottom(h,cylinder_center)]) ))\r\n\t\t assign( rotation_angle = ((face==\"top\" ) ? (0) : (180) ))\r\n\t\t assign( int_radius = (r==undef)?((face==\"top\" ) ? (r2) : (r1) ) : (r) ) \/\/Assign the top\/bottom radius for slanty-cylinders\r\n\t\t {\r\n\t\t rotate(rotation_angle,[1,0,0])\r\n\t\t\t text_on_circle(t,locn_vec+locn_offset_vec,r=int_radius-size,\r\n\t\t\t font=font,size=size,\r\n\t\t\t spacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t extrusion_height=extrusion_height,\r\n\t\t\t rotate=rotate,\r\n\t\t\t eastwest=eastwest,middle=middle,ccw=ccw);\r\n\t\t }\r\n\t }else{\r\n\t if((middle!=undef) && (middle!=default_circle_middle))\r\n {\r\n \/\/TODO: Which others?\r\n \/\/TODO: Which side things aren't supported on the circle\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"middle NOT supported for the SIDE of a cylinder.\"));\r\n }\r\n\t \/\/Work on the side\r\n\t\t assign( locn_offset_vec = ((cylinder_center==true)?([0,0,0]):([0,0,h\/2])) ) \r\n\t\t rotate(-rtl_sign * rotation_for_center_text_string_and_rotate(t, size, spacing,r,rotate,center), [0,0,1])\r\n\t\t translate(locn_vec+locn_offset_vec)\r\n\t\t __internal_text_on_cylinder_side(t,locn_vec,r=r,h=h,r1=r1,r2=r2,\r\n\t\t cylinder_center=cylinder_center,\r\n\t\t center=center,\r\n\t\t font=font,size=size,\r\n\t\t spacing=spacing,direction=direction,language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t extrusion_height=extrusion_height,\r\n\t\t\t rotate=rotate,face=face,updown=updown,\r\n\t\t\t eastwest=eastwest);\r\n\t }\r\n\t}\r\n}\r\n\r\n\/\/circle(r)\r\nmodule text_on_circle(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_circle_eastwest,\r\n middle = default_circle_middle,\r\n ccw = default_circle_ccw,\r\n\r\n \/\/All objects \r\n extrusion_height = default_extrusion_height,\r\n rotate = default_rotate,\r\n center = default_center,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n\/\/ echo (str(\"text_on_circle:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"text_on_circle:\",\"rotate=\" , rotate));\r\n\/\/ echo (str(\"text_on_circle:\",\"eastwest=\" , eastwest));\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_circle:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n\tassign( ccw_sign = (ccw==true) ? (1) : (-1) )\r\n\tassign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n assign( ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? (0) : (1) ) \r\n\tassign( rotate_z_outer = ( -rotate + ccw_sign*eastwest ) )\r\n\t{\r\n\t\trotate(rotate_z_outer, [0,0,1])\r\n\t\t{\r\n assign( rotate_z_inner = (-rtl_sign * ccw_sign * ttb_btt_inaction * rotation_for_center_text_string( t, size, spacing, r-middle, rotate, center)) )\r\n\t\t\trotate( rotate_z_inner, [0,0,1] )\r\n\t\t\t{\r\n\t\t\t translate(locn_vec)\r\n\t\t\t\tfor (l=[0:len(t)-1]){\r\n\t\t\t\t \/\/TTB\/BTT means no per letter rotation\r\n\t\t\t\t assign( rotate_z_inner2_tmp = -ccw_sign * 90 + ttb_btt_inaction*rtl_sign*ccw_sign*l*rotation_for_character(size, spacing, r-middle, rotate=0) ) \/\/Bottom out=-270+r\r\n\t\t\t\t assign( rotate_z_inner2 = (rotate_z_inner2_tmp) )\r\n\t\t\t\t \/\/TTB means we go toward center, BTT means away\r\n\t\t\t rotate( rotate_z_inner2, [0,0,1] )\r\n\t\t\t\t assign( vert_x_offset = (direction==\"ttb\" || direction==\"btt\") ? ( l * size * ((direction==\"btt\")?(-1):(1)) ) : ( 0 ) )\r\n\t\t\t\t\ttranslate([r-middle - vert_x_offset,0,0])\r\n\t\t\t\t\trotate(-ccw_sign*270,[0,0,1]) \/\/ flip text (botom out = -270)\r\n\t\t\t\t\ttext_extrude(t[l],center=true,\r\n\t\t\t\t\t font=font,size=size,\r\n\t\t\t\t\t rotate=undef,\r\n\t\t\t spacing=spacing,\r\n\t\t\t direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t\t\t language=language,script=script,halign=halign,valign=valign,\r\n\t\t\t extrusion_height=extrusion_height );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/Only expected to be called from another function. No defaults as expected to be done in parent.\r\n\/\/NOTE: This is hacked. Requires more mathematics than I feel like to do properly today....\r\n\/\/TODO: Refactor the two operations - side of normal and slanty\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_cylinder_side(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,r1,r2,h,\r\n cylinder_center,\r\n \r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n \r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Overridden\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:There are \" ,len(t) ,\" letters in t\" , t));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"h=\" , h));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r=\" , r));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r1=\" , r1));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"r2=\" , r2));\r\n\/\/ echo (str(\"__internal_text_on_cylinder_side:\",\"direction=\" , direction));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n wid = width_of_text_char( size, spacing ); \/\/TODO: refactor this out?\r\n\r\n function calc_radius_at_height_offset(r1,r2,h_total,h_offset) = ( r1 + ((r2-r1) * (h_total-h_offset)\/h_total) );\r\n \r\n \t\/\/Has to factor in up\/downedness\r\n \/\/Starts at middle height then height displacement is reduced under rotation and by the slope of the uneven radii\r\n function calc_height_offset_at_length(r1,r2,h,length,rotate, updown) = ( h\/2 - updown + length * rotate\/90 * cos( atan( (r2-r1)\/h ) ) );\r\n\r\n function calc_radius_at_length(r1,r2,h,length,rotate,updown) = ( calc_radius_at_height_offset(r1,r2,h,calc_height_offset_at_length(r1,r2,h,length,rotate,updown)));\r\n \r\n if(r==undef)\r\n {\r\n \/\/Slanty-cylinder (truncated cone) warnings\r\n if((direction==\"btt\") || (direction==\"ttb\"))\r\n {\r\n \/\/TODO: After the issues are resolved refactoring should give this pretty easily\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders definitely don't directions TTB or BTT on sides yet. Setting direction to ltr.\")); \r\n }\r\n if(center==true)\r\n {\r\n echo (str(\"text_on_cylinder:\",\"WARNING\" , \" - Slanty-cylinders don't support centering yet. Setting center to false. You can adjust updown and eastwest and achieve most of what you are after....\")); \r\n }\r\n }\r\n\r\n assign( r1 = ((r1!=undef)?(r1):(r)) )\r\n assign( r2 = ((r2!=undef)?(r2):(r)) )\r\n \/\/NOTE: r is not used after here. We operate on generalised slanty cone (r1 and r2)\r\n \r\n \t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\tassign( r1 = center?(r1-extrusion_height\/2):(r1) )\r\n\tassign( r2 = center?(r2-extrusion_height\/2):(r2) )\r\n \r\n assign( center = ((r!=undef)?(center):(false)) ) \/\/We don't do (text) centering for the slanty cones\/helical paths (yet? ever?). Needs to do quite a few offset calcs.\r\n assign( direction = ((r==undef) && ((direction==\"ttb\")||(direction==\"btt\")))?(\"ltr\"):(direction) ) \/\/We don't do ttb or btt directions on slanty\r\n assign( rtl_sign = ((direction==\"rtl\") ? (-1) : (1)) )\r\n\r\n \r\n {\r\n \/\/This code takes care of slanty cylinders and \"normal\" cylinders\r\n translate([0,0,updown])\r\n rotate(eastwest,[0,0,1])\r\n for (l=[0:len(t)-1]){\r\n \/\/TODO: TTB and BTT need to have a different concept of path\/length than this for RTL\/LTR\r\n \t \/\/width_of_... is half a char too long -- add 0.5 (counting from zero)\r\n assign( length_to_center_of_char = width_of_text_string_num_length(l+0.5,size,spacing) )\r\n assign( radius_here = calc_radius_at_length(r1,r2,h, length_to_center_of_char, rotate, updown) )\r\n \/\/Rotating into position and tangentially to surface -- Don't rotate per character for ttb\/btt\r\n \/\/-90 is to get centering at origin\r\n\t\t assign( rotate_z_inner = -90 + rtl_sign * rotation_for_character(size, spacing, ( radius_here ), rotate) * ((direction==\"ttb\" || direction==\"btt\") ? ( 0 ) : ( l )) )\r\n\t rotate(rotate_z_inner,[0,0,1])\r\n\t \/\/Positioning - based on (somewhat innacurate) string length\r\n\t\t \/\/Offset per character to go up\/down the side in ttb\/btt -- TTB down, BTT up\r\n\t\t assign( vert_z_char_offset = (direction==\"ttb\" || direction==\"btt\") ? ( l * size * ((direction==\"ttb\")?(-1):(1)) ) : ( 0 ) )\r\n\t\t \/\/Only if RTL\/LTR and if center -- center the text (starts off in a more visually appealing location)\r\n\t\t assign( vert_z_half_text_offset_tmp = (len(t)-1)\/2 * ((rotate)\/90*wid) )\r\n\t\t assign( vert_z_half_text_offset = ((direction==\"ttb\" || direction==\"btt\") || (center==false))?(0):(vert_z_half_text_offset_tmp) )\r\n translate([ radius_here , 0, vert_z_char_offset - l * ((rotate)\/90*wid) + vert_z_half_text_offset])\r\n\r\n\t \/\/Flip to tangent on the sloping side (without respecting rotation impact on the tangent -- rotate seems a little off. TODO: Investigate).\r\n\t rotate( atan( (r2-r1)\/h ) , [0,1,0])\r\n\t \/\/Flip onto face of \"normal\" cylinder\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\r\n \t \/\/Modify the offset of the baselined text to center\r\n translate([0,(center)?(-size\/2):(0),0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t font=font,size=size,\r\n\t spacing=spacing,\r\n\t direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n\t language=language,script=script,\r\n\t halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make\r\n\t extrusion_height=extrusion_height\r\n\t );\r\n }\r\n }\r\n}\r\n\r\n\/\/sphere(r)\r\n\/\/NB: Iterates through characters\/glyphs and presents them individually (but supports actions across the entire string still)\r\n\/\/supports all features of text() except: halign and valign\r\nmodule text_on_sphere(t=default_t,\r\n \/\/Object-specific\r\n locn_vec = [0,0,0],\r\n r,\r\n eastwest = default_sphere_eastwest,\r\n northsouth = default_sphere_northsouth,\r\n rotate = default_rotate,\r\n spin = default_sphere_spin,\r\n rounded = default_sphere_rounded,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/center = false doesn't really even make sense to do (IMHO)\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef, \/\/Not supported - only here to enable a warning\r\n valign = undef, \/\/Not supported - only here to enable a warning\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (\"text_on_sphere:There are \" ,len(t) ,\" letters in t\" , t);\r\n\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_sphere:\",\"WARNING \" , \"halign and valign are NOT supported (functionality used in centering).\"));\r\n }\r\n\r\n \/\/TODO: refactor this?\r\n\tassign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n\t\r\n\t\/\/TODO: Look at changing this to extrusion_height_center\r\n\t\/\/and renaming the other as text_center\r\n\t\/\/If we are centered - we sink the radius by half the\r\n\t\/\/extrusion height to draw \"just below the surface\"\r\n\tassign( r = center?(r-extrusion_height\/2):(r) )\r\n\t\r\n\trotate(eastwest,[0,0,1])\r\n\trotate(-northsouth,[1,0,0])\r\n\trotate(spin,[0,1,0])\r\n\t\/\/This tries to center the text (for RTL text).\r\n assign( ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? (0) : (1) ) \r\n\trotate( -rtl_sign * ttb_btt_inaction * rotation_for_center_text_string(t, size, spacing, r, rotate, center), [0,0,1])\r\n\t{\r\n\t translate(locn_vec)\r\n\t\tif ( rounded == false ){\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=r,\r\n\t \t\trotate=rotate,\r\n\t \t\tcenter=center,\r\n\t \t\tscale=scale,\r\n\t font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height\r\n\t\t\t);\r\n\t\t}else{\r\n\t\t \/\/If rounding then clip the text inside an inner sphere and outer sphere\r\n\t\t\tintersection()\r\n\t\t\t{\r\n\t\t\t__internal_text_on_sphere_helper(t=t,r=r,\r\n \t\trotate=rotate,\r\n \t\tcenter=center,\r\n \t\tscale=scale,\r\n font=font,size=size,\r\n spacing=spacing,\r\n direction=direction,\r\n language=language,script=script,halign=halign,valign=valign,\r\n extrusion_height=extrusion_height*2 \/\/Make it proud to clip it off.\r\n\t\t );\r\n\r\n \/\/Shell - bounding inner and outer\r\n\t\t\tdifference()\r\n\t\t\t{ \/\/rounded outside\r\n\t\t\t\tsphere(r+extrusion_height);\r\n\t\t\t\t\/\/ rounded inside for indented text\r\n\t\t\t sphere( r );\r\n\t\t\t}\r\n\r\n\t\t }\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\/\/internal function -- don't call directly\r\n\/\/No default checks in this funciton -- done in parent\r\nmodule __internal_text_on_sphere_helper(t=default_t,\r\n \/\/Object-specific\r\n r,\r\n \/\/All objects\r\n extrusion_height = default_extrusion_height,\r\n center = default_center,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n \/\/halign = undef,\r\n \/\/valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n assign( rtl_sign = (direction==\"rtl\") ? (-1) : (1) )\r\n assign( ttb_btt_inaction = (direction==\"ttb\" || direction==\"btt\") ? (0) : (1) ) \r\n assign( ttb_btt_action = (direction==\"ttb\" || direction==\"btt\") ? (1) : (0) ) \r\n \r\n for (l=[0:len(t)-1]){\r\n\t assign( rotate_z_inner = -90 + rtl_sign * ttb_btt_inaction * l * rotation_for_character(size, spacing, r, 0) )\r\n\t \r\n rotate( rotate_z_inner, [0,0,1] )\r\n assign( translate_sign = (direction==\"ttb\" || direction==\"btt\") ? ( ((direction==\"btt\")?(1):(-1)) ) : ( 0 ) )\r\n \/\/assign( translate_effect = (direction==\"ttb\" || direction==\"btt\") ? (1) : ( 0 ) )\r\n \/\/Translate letter to be located on the sphere in up\/down direction when we are doing TTB and BTT\r\n\t translate(r * [cos(0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l ), 0, translate_sign * ttb_btt_action * sin(0 + rotation_for_character(size, spacing, r, rotate) * l ) ])\r\n \/\/Rotate letter to be tangential to the new part of the sphere when we are doing TTB and BTT\r\n\t rotate(-90 * translate_sign * (0 + ttb_btt_action * rotation_for_character(size, spacing, r, rotate) * l )\/90 , [0,1,0])\r\n \/\/Flip character into position to be flush against sphere\r\n\t rotate(90,[1,0,0])\r\n\t rotate(90,[0,1,0])\r\n\t \r\n\t \/\/Modify the offset of the baselined text to center\r\n\t translate([0,(center)?(-size\/2):(0),0])\r\n\t \r\n\t text_extrude(t[l],\r\n\t center=false,\r\n\t rotate=rotate,\r\n\t scale=scale,\r\n\t font=font,\r\n\t size=size,\r\n spacing=spacing,\r\n direction=undef, \/\/We don't pass direction ( misaligns inside text() ). TODO: Investigate why\r\n language=language,script=script,\r\n halign=\"center\", \/\/This can be relaxed eventually\r\n valign=\"baseline\", \/\/Need this to keep all letters on the same line (could also support top -- otherw will make wonky letters)\r\n extrusion_height=extrusion_height );\r\n }\r\n}\r\n\r\n\r\n\r\n\/\/cube(size)\r\n\/\/cube([width,h,depth])\r\n\/\/NB: cube_size is used instead of size (the name size is used in the text module)\r\n\/\/NB: Passes through text as strings -- supports all features of text()\r\nmodule text_on_cube( t=default_t,\r\n \/\/Object-specific\r\n cube_size, \/\/number or 3-vector\r\n face = default_cube_face,\r\n rightleft = default_cube_rightleft,\r\n updown = default_cube_updown,\r\n \/\/All objects\r\n locn_vec = [0,0,0],\r\n extrusion_height = default_extrusion_height,\r\n center = undef,\r\n rotate = default_rotate,\r\n scale = default_scale,\r\n \/\/All objects -- arguments as for text()\r\n font = undef,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n){\r\n \/\/echo (str(\"text_on_cube:\",\"There are \" ,len(t) ,\" letters in t\" , t));\r\n \/\/echo (str(\"text_on_cube:\",\"cube_size\" , cube_size));\r\n \r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_on_cube:\",\"WARNING \" , \"halign and valign are NOT supported.\"));\r\n }\r\n\r\n assign( int_cube_size = (str(cube_size)[0] != \"[\")?([cube_size,cube_size,cube_size]):(cube_size) )\r\n assign(\r\n\t rotate_x = ((face==\"front\") || (face==\"back\") || (face==\"left\") || (face==\"right\"))?(90)\r\n\t :(\t(face==\"bottom\")?(180):(0) ) \/\/Top is zero\r\n\t)\r\n\tassign(\r\n\t rotate_y = ( (face==\"back\") || (face==\"left\") || (face==\"right\"))\r\n\t ?((face==\"back\")?(180)\r\n\t :( ((face==\"left\")?(-90):(90)) ) \/\/Right is 90\r\n\t )\r\n\t :(0) \/\/Top, bottom, front are zero\r\n\t)\r\n\tassign(\r\n\t locn_vec_offset =\r\n\t (face==\"front\")?( [+rightleft, -int_cube_size[1]\/2,+updown] )\r\n\t :(\t(face==\"back\")?( [+rightleft, +int_cube_size[1]\/2,+updown] )\r\n\t :(\t(face==\"left\")?( [-int_cube_size[0]\/2,+rightleft, +updown] )\r\n\t :(\t(face==\"right\")?( [+int_cube_size[0]\/2,+rightleft, +updown] )\r\n\t :(\t(face==\"top\")?( [+rightleft, +updown, +int_cube_size[2]\/2] )\r\n\t :(\t [+rightleft, -updown, -int_cube_size[2]\/2] ) ) ) ) \/\/bottom\r\n\t )\r\n\t)\r\n {\r\n\t\ttranslate(locn_vec + locn_vec_offset)\r\n\t\trotate(rotate_x,[1,0,0])\r\n\t\trotate(rotate_y,[0,1,0]) \/\/ rotate around the y axis (z before rotation)\r\n\t\ttext_extrude(t,\r\n\t\t center=center,\r\n\t\t rotate=rotate,\r\n\t\t scale=scale,\r\n\t\t font=font,\r\n\t\t size=size,\r\n\t\t spacing=spacing,\r\n\t\t direction=direction, \/\/Does this misalign inside text()? the individual character modules do.\r\n\t\t language=language,\r\n\t\t script=script,\r\n\t\t halign=halign,\r\n\t\t valign=valign,\r\n\t\t extrusion_height=extrusion_height );\r\n\t}\r\n}\r\n\r\nfunction default_if_undef(val, default_val) = (val!=undef?val:default_val);\r\n\r\n\/\/Print a single character or a string at the desired extrusion height\r\n\/\/Passes on values to text() that are passed in\r\n\/\/TODO: Add x,y,z rotations get text facing the right way from the start)\r\nmodule text_extrude( t=default_t,\r\n extrusion_height = default_extrusion_height,\r\n center = default_center, \/\/Fudgy. YMMV. \/\/TODO:center_extrusion, or extrusion offset??\r\n rotate = default_rotate,\r\n scale = default_scale, \/\/For scaling by different on axes (for widening etc)\r\n \/\/Following are test() params (in addition to t=)\r\n font = default_font,\r\n size = default_size,\r\n direction = undef,\r\n halign = undef,\r\n valign = undef,\r\n language = undef,\r\n script = undef,\r\n spacing = default_spacing\r\n)\r\n{\r\n \/\/echo (str(\"text_extrude:\",\"There are \" ,len(t) ,\" letters in text\" , t));\r\n \/\/echo (str(\"text_extrude:\",\"extrusion_height=\" , extrusion_height));\r\n \r\n if(center==true)\r\n {\r\n if((halign!=undef) || (halign!=undef))\r\n {\r\n echo (str(\"text_extrude:\",\"WARNING \" , \"When center is true, then halign and valign are NOT supported.\"));\r\n }\r\n }\r\n \r\n \/\/As arguments are explicitly set as undef (from higher functions) as they come down (they don't get defaults in this function as they are set as something)\r\n \/\/we need to check and replace any that we don't want to be undef\r\n assign( t = default_if_undef(t,default_t) )\r\n assign( font = default_if_undef(font,default_font) )\r\n assign( extrusion_height = default_if_undef(extrusion_height,default_extrusion_height) )\r\n assign( center = default_if_undef(center,default_center) )\r\n assign( rotate = default_if_undef(rotate,default_rotate) )\r\n assign( spacing = default_if_undef(spacing,default_spacing) )\r\n assign( size = default_if_undef(size,default_size) )\r\n \r\n assign( halign = (center)?(\"center\"):(halign) )\r\n assign( valign = (center)?(\"center\"):(valign) )\r\n assign( extrusion_center = (center)?(true):(false) )\r\n\t\r\n\tscale( scale )\r\n rotate(rotate,[0,0,-1]) \/\/TODO: Do we want to make this so that the entire vector can be set?\r\n\t{\r\n\t linear_extrude(height=extrusion_height,convexity=10,center=extrusion_center)\r\n text(t=t, size = size,\r\n $fn = 40,\r\n font = font, direction = direction, spacing = spacing,\r\n halign = halign,\r\n valign = valign,\r\n language=language, script=script);\r\n\t}\r\n}\r\n\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d3758df4647056972a2516ab234caa1e3a36a448","subject":"Corn update","message":"Corn update\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Unicorn by Paul Houghton \u00a9 2015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=90;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 100*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nhair_thickness = mane_thickness \/ 10;\nhair_spacing = mane_thickness \/ 2;\n\nmodule hair_line(x = 0, z = 0, hair_radius = mane_radius, delta_x = body_x, delta_z = body_z) {\n translate([x, mane_thickness\/2, z])\n difference() {\n hull() {\n cylinder(h = mane_thickness, r = hair_radius);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius);\n }\n hull() {\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n translate([delta_x, -delta_z, 0])\n cylinder(h = mane_thickness, r = hair_radius - hair_spacing);\n } \n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n translate([0, 0, hair_thickness])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness - 2*hair_thickness, r = mane_radius);\n }\n hair_line();\n hair_line(hair_radius = mane_radius - 2*hair_spacing);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\ntail_x = 2*body_x + body_length;\ntail_thickness = mane_thickness;\ntail_radius = body_back_radius;\ntail_height = -body_z + tail_radius\/2;\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2, tail_height])\n rotate([90, 0, 0]) {\n hull() {\n cylinder(h = mane_thickness, r = tail_radius);\n translate([1.5*body_x, 1.5*(-body_z), 0])\n cube([tail_thickness, tail_thickness, tail_thickness]);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.6*body_length, 0, -leg_length - body_z])\n minkowski() {\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n # base();\n}","old_contents":"\/\/ Unicorn by Paul Houghton \u00a9 2015, CC BY-NC-AS license, https:\/\/creativecommons.org\/licenses\/\n$fn=90;\n\nscale = 1;\n\nhead_big_radius = 10*scale;\nhead_small_radius = 4.5*scale;\nhead_length = 18*scale;\nhead_angle = 50;\n\nhorn_length = 20*scale;\nhorn_radius = 2.8*scale;\n\nmane_thickness = 2*horn_radius;\nmane_radius = head_big_radius;\nmane_height = head_big_radius * 0.7;\nmane_x = head_big_radius * 0.28;\nmane_length_x = 10*scale;\nmane_length_z = 20*scale;\n\nneck_radius = 3*scale;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3*scale;\n\nbody_x = 15*scale;\nbody_z = 28*scale;\nbody_radius = 14*scale;\nbody_back_radius = 12*scale;\nbody_length = 33*scale;\n\nleg_length = (33*scale + body_radius);\nleg_radius = 4*scale;\n\ncute_leg_first_ratio = 0.5;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nbase_thickness = 10*scale;\nbase_width = 40*scale;\nbase_corner_radius = 5*scale;\nbase_length = 70*scale;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_length, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2*scale])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2*scale, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule mane() {\n translate([mane_x, mane_thickness\/2, mane_height])\n rotate([90, 0, 0]) {\n hull() {\n cylinder(h = mane_thickness, r = mane_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = mane_thickness, r = mane_radius);\n }\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\ntail_x = 2*body_x + body_length;\ntail_thickness = mane_thickness;\ntail_radius = body_back_radius;\ntail_height = -body_z + tail_radius\/2;\n\nmodule tail() {\n translate([tail_x, tail_thickness\/2, tail_height])\n rotate([90, 0, 0]) {\n hull() {\n cylinder(h = mane_thickness, r = tail_radius);\n translate([body_x, -body_z, 0])\n cylinder(h = tail_thickness, r = tail_radius);\n }\n }\n}\n\nmodule base() {\n translate([body_x + 0.2*body_length, 0, -leg_length - body_z])\n minkowski() {\n cube([base_length, base_width - 2*base_corner_radius, base_thickness\/3], center = true);\n cylinder(h = base_thickness \/ 3, r = base_corner_radius);\n }\n}\n\ndifference() { \/\/ difference() -> no base, or union() -> solid base\n union() {\n head();\n horn();\n neck();\n mane();\n body();\n leg(theta=5, sideways=3*scale);\n cute_leg(theta=-5, sideways=-3*scale, downwards=3*scale);\n leg(lengthwards = body_length, sideways=2*scale, theta=15);\n leg(lengthwards = body_length, sideways=-2*scale, theta=-15);\n tail();\n }\n # base();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"973b792c3ea0cb6d075eed17601b105b17937a58","subject":"Added file for inverse_cube with a box suspending it","message":"Added file for inverse_cube with a box suspending it\n","repos":"agupta231\/fractal_prints","old_file":"inverse_cube_with_enclosure.scad","new_file":"inverse_cube_with_enclosure.scad","new_contents":"\/\/ Program by Ankur Gupta\n\/\/ www.github.com\/agupta231\n\/\/ Jan 2017\n\n\/**\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_size = 50;\niteration_multiplier = 0.5;\niterations = 5;\n\necho(version());\n\nmodule aux_cubes(current_iter, starting_pos) {\n iter_size = init_size * pow(iteration_multiplier, current_iter);\n displacement = (init_size * (pow(iteration_multiplier, current_iter) + pow(iteration_multiplier, current_iter - 1))) \/ 2;\n \n for(i = [[displacement, 0, 0], [-displacement, 0, 0], [0, displacement, 0], [0, -displacement, 0], [0, 0, displacement], [0, 0, -displacement]]) {\n new_pos = i + starting_pos;\n \n translate(i + starting_pos) {\n cube(iter_size, center = true);\n }\n \n if(current_iter < iterations) {\n aux_cubes(current_iter + 1, new_pos);\n }\n }\n}\n\nunion() {\n cube(init_size, center = true);\n \n aux_cubes(1, [0, 0, 0]);\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'inverse_cube_with_enclosure.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"bd749666646fbbeb39add395c9d014a6c53c6202","subject":"x\/ends: fix motor mount screw overlap pulley mount","message":"x\/ends: fix motor mount screw overlap pulley mount\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n if(!(x==1 && z == (beltpath_index==0?1:-1)))\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size_switch = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset_switch = [-2.45*mm, 0*mm, 0*mm];\n\nxaxis_endstop_size_SN04 = [34.15*mm, 18.15*mm, 17.8*mm];\nxaxis_endstop_screw_offset_SN04 = [-27.5*mm, 0*mm, 0*mm];\nxaxis_endstop_offset_SN04 = [-3*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n rcubea(xaxis_endstop_size_SN04, align=[-1,0,-1]);\n }\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n {\n screw_cut(nut=NutHexM2_5, h=10*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset_SN04)\n for(y=[-1,1])\n translate([-0*mm,y*10.5*mm\/2,xaxis_endstop_size_SN04[2]])\n {\n translate(xaxis_endstop_offset_SN04)\n screw_cut(nut=NutHexM3, h=20*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n \/*if(xaxis_endstop_type == \"SWITCH\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size_switch, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset_switch)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size_switch[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n \/*else if(xaxis_endstop_type == \"SN04\")*\/\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n translate(xaxis_endstop_offset_SN04)\n translate([-36,-9,0])\n rotate(ZAXIS*-90)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"5d89dafe3c0c1ffabc8c47c11bbd26c32c836409","subject":"config: remove belt stuff, now have this in libutils","message":"config: remove belt stuff, now have this in libutils\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_sf1_1212;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"59fd554e0c9f28c68c847b1d3abcafdc0d1b4f94","subject":"Add an OpenSCAD file.","message":"Add an OpenSCAD file.\n","repos":"volab\/vor12,volab\/vor12","old_file":"cad\/2d_foot.scad","new_file":"cad\/2d_foot.scad","new_contents":"\/\/ VoR-12 - 2D foot\n\n\/\/ Copyright (c) 2015 J\u00e9r\u00e9mie DECOCK (www.jdhp.org)\n\n\/\/ Base unit: mm\n\nmodule 2d_foot() {\n inner_square_size = 33;\n outer_square_size = 105;\n screw_hole_diameter = 3;\n\n difference() {\n union() {\n square(outer_square_size, center=true);\n rotate(45) 2d_toe();\n rotate(135) 2d_toe();\n rotate(-45) 2d_toe();\n rotate(-135) 2d_toe();\n }\n\n union() {\n square(inner_square_size, center=true);\n translate([-31.5, 0]) circle(d=screw_hole_diameter);\n translate([ 31.5, 0]) circle(d=screw_hole_diameter);\n translate([ 0, 38.5]) circle(d=screw_hole_diameter);\n }\n }\n}\n\nmodule 2d_toe() {\n $fn=50;\n\n toe_depth = 25;\n toe_length = 80;\n\n hull() {\n square(toe_depth, center=true);\n translate([toe_length, 0]) circle(d=toe_depth);\n }\n}\n\n\/\/ Uncomment the following line to test this module\n2d_foot();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'cad\/2d_foot.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"396e0cb22648470f7c89df59b541e440611f22c0","subject":"timingbelt: Fixes and rewrites","message":"timingbelt: Fixes and rewrites\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"timing-belts.scad","new_file":"timing-belts.scad","new_contents":"\/*Parametric belting section generator\n * types GT2 2mm T2.5 T5 T10 MXL\n *\n * (c) ALJ_rprp\n *\n * Derived from http:\/\/www.thingiverse.com\/\n * thing:19758 By The DoomMeister\n * thing:16627 by Droftarts\n *\n * licence GPL 2.1 or later\n *\n * deal properly with ends\n * allow circular segments\n * length is given in mm not nb of teeth\n * belt is centered at z=0 and extend along x\n *\n * TODO : add ofset for cosmetic teeth liaisons between segments\n *\n * usage :\n * belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90)\n * belt_len (prf = tT2_5, belt_width = 6, len = 10)\n *\/\n\ninclude \ninclude \n\n\/\/ profiles\ntGT2_2=0;\ntT2_5=1;\ntT5=2;\ntT10=3;\ntMXL=4;\n\n\/*test_belt();*\/\n\nmodule test_belt()\n{\n $fs= 0.5;\n $fa = 4;\n\n translate([-00.5,0,5.5]) cube([1,40,1]);\n\n stack(dist=20, axis=[0,0,-1])\n {\n belt_len(profile = tT10, belt_width = 10, len = 100);\n color(\"red\") belt_len(profile = tT5, belt_width = 10, len = 100);\n color(\"green\") belt_len(profile = tT2_5, belt_width = 10, len = 80);\n color(\"blue\") belt_len(profile = tGT2_2, belt_width = 10, len = 100);\n color(\"orange\") belt_len(profile = tMXL, belt_width = 10, len = 100);\n\n belt_angle(tT10,20,10,180);\n belt_angle(tT5,15,10,90);\n belt_angle(tT2_5,25,10,120);\n belt_angle(tGT2_2,30,10,40);\n belt_angle(tMXL,30,10,40);\n\n color(\"aquamarine\") {\n belt_len(tT2_5,10, 50);\n translate([50,30,0]) rotate([0,0,180]) belt_len(tT2_5,10,50);\n translate([ 0,30,0]) rotate([0,0,180]) belt_angle(tT2_5,15,10,180);\n translate([50,0,0]) rotate([0,0,0]) belt_angle(tT2_5,15,10,180);\n }\n }\n}\n\nmodule belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90)\n{\n av=360\/2\/rad\/3.14159*tpitch[prf];\n bk=bk_thick[prf];\n\n nn=ceil(angle\/av);\n ang=av*nn;\n\n intersection()\n {\n translate([0,-bk-.5,0])\n pie_slice(r=rad+bk+.5,start_angle=-90,end_angle=angle-90,h=bwdth, align=[0,1,0]);\n\n union ()\n {\n for(i=[0:nn])\n {\n translate ([0,rad,-bwdth\/2])\n rotate ([0,0,av*i])\n translate ([0,-rad,0])\n draw_tooth(prf,0,bwdth);\n }\n\n translate ([0,rad,-bwdth\/2])\n rotate([0,0,-90])\n rotate_extrude(angle = angle)\n polygon([[rad,0],[rad+bk,0],[rad+bk,bwdth],[rad,bwdth]]);\n }\n }\n}\n\n\/\/Outer Module\nmodule belt_len(profile = tT2_5, belt_width = 6, len = 10){\n if ( profile == tT2_5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT10 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tMXL )\t{ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tGT2_2 ){ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n}\n\n\/\/inner module\nmodule _belt_len(prf = -1, len = 10, bwdth = 5) {\n\n n=ceil(len\/tpitch[prf]);\n\n translate ([0,0,-bwdth\/2]) intersection() {\n union(){\n for( i = [0:n]) {\n draw_tooth(prf,i,bwdth);\n }\n translate([-1,-bk_thick[prf],0])cube([len+1,bk_thick[prf],bwdth]);\n }\n translate([0,-bk_thick[prf],0])cube([len,max_h[prf]+bk_thick[prf],bwdth]);\n }\n}\n\nmodule draw_tooth(prf,i,bwdth) {\n if ( prf == tT2_5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T2_5);}\n if ( prf == tT5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T5);}\n if ( prf == tT10 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T10);}\n if ( prf == tMXL ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_MXL);}\n if ( prf == tGT2_2 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_GT2_2);}\n}\n\n\/************************************\n *\t\t\t\tDATA TABLES\t\t\t\t\t*\n ************************************\/\n tpitch = [2,2.5,5,10,2.032];\n bk_thick=[0.6,0.6,1,2,0.64];\n max_h=[0.76447, 0.699911, 1.189895, 2.499784, 0.508035];\n\n pf_GT2_2= [[ 0.747183,-0.5 ],[ 0.747183, 0 ],[ 0.647876, 0.037218],\n [ 0.598311, 0.130528],[ 0.578556, 0.238423],[ 0.547158, 0.343077],\n [ 0.504649, 0.443762],[ 0.451556, 0.53975 ],[ 0.358229, 0.636924],\n [ 0.2484 , 0.707276],[ 0.127259, 0.750044],[ 0 , 0.76447 ],\n [-0.127259, 0.750044],[-0.2484 , 0.707276],[-0.358229, 0.636924],\n [-0.451556, 0.53975 ],[-0.504797, 0.443762],[-0.547291, 0.343077],\n [-0.578605, 0.238423],[-0.598311, 0.130528],[-0.648009, 0.037218],\n [-0.747183, 0 ],[-0.747183,-0.5]];\npf_T2_5= [[-0.839258,-0.5 ],[-0.839258, 0 ],[-0.770246, 0.021652],\n [-0.726369, 0.079022],[-0.529167, 0.620889],[-0.485025, 0.67826 ],\n [-0.416278, 0.699911],[ 0.416278, 0.699911],[ 0.484849, 0.67826 ],\n [ 0.528814, 0.620889],[ 0.726369, 0.079022],[ 0.770114, 0.021652],\n [ 0.839258, 0 ],[ 0.839258,-0.5]];\npf_T5= \t [[-1.632126,-0.5 ],[-1.632126, 0 ],[-1.568549, 0.004939],\n [-1.507539, 0.019367],[-1.450023, 0.042686],[-1.396912, 0.074224],\n [-1.349125, 0.113379],[-1.307581, 0.159508],[-1.273186, 0.211991],\n [-1.246868, 0.270192],[-1.009802, 0.920362],[-0.983414, 0.978433],\n [-0.949018, 1.030788],[-0.907524, 1.076798],[-0.859829, 1.115847],\n [-0.80682 , 1.147314],[-0.749402, 1.170562],[-0.688471, 1.184956],\n [-0.624921, 1.189895],[ 0.624971, 1.189895],[ 0.688622, 1.184956],\n [ 0.749607, 1.170562],[ 0.807043, 1.147314],[ 0.860055, 1.115847],\n [ 0.907754, 1.076798],[ 0.949269, 1.030788],[ 0.9837 , 0.978433],\n [ 1.010193, 0.920362],[ 1.246907, 0.270192],[ 1.273295, 0.211991],\n [ 1.307726, 0.159508],[ 1.349276, 0.113379],[ 1.397039, 0.074224],\n [ 1.450111, 0.042686],[ 1.507589, 0.019367],[ 1.568563, 0.004939],\n [ 1.632126, 0 ],[ 1.632126,-0.5]];\npf_T10= [[-3.06511 ,-1 ],[-3.06511 , 0 ],[-2.971998, 0.007239],\n [-2.882718, 0.028344],[-2.79859 , 0.062396],[-2.720931, 0.108479],\n [-2.651061, 0.165675],[-2.590298, 0.233065],[-2.539962, 0.309732],\n [-2.501371, 0.394759],[-1.879071, 2.105025],[-1.840363, 2.190052],\n [-1.789939, 2.266719],[-1.729114, 2.334109],[-1.659202, 2.391304],\n [-1.581518, 2.437387],[-1.497376, 2.47144 ],[-1.408092, 2.492545],\n [-1.314979, 2.499784],[ 1.314979, 2.499784],[ 1.408091, 2.492545],\n [ 1.497371, 2.47144 ],[ 1.581499, 2.437387],[ 1.659158, 2.391304],\n [ 1.729028, 2.334109],[ 1.789791, 2.266719],[ 1.840127, 2.190052],\n [ 1.878718, 2.105025],[ 2.501018, 0.394759],[ 2.539726, 0.309732],\n [ 2.59015 , 0.233065],[ 2.650975, 0.165675],[ 2.720887, 0.108479],\n [ 2.798571, 0.062396],[ 2.882713, 0.028344],[ 2.971997, 0.007239],\n [ 3.06511 , 0 ],[ 3.06511 ,-1]];\npf_MXL= [[-0.660421,-0.5 ],[-0.660421, 0 ],[-0.621898, 0.006033],\n [-0.587714, 0.023037],[-0.560056, 0.049424],[-0.541182, 0.083609],\n [-0.417357, 0.424392],[-0.398413, 0.458752],[-0.370649, 0.48514 ],\n [-0.336324, 0.502074],[-0.297744, 0.508035],[ 0.297744, 0.508035],\n [ 0.336268, 0.502074],[ 0.370452, 0.48514 ],[ 0.39811 , 0.458752],\n [ 0.416983, 0.424392],[ 0.540808, 0.083609],[ 0.559752, 0.049424],\n [ 0.587516, 0.023037],[ 0.621841, 0.006033],[ 0.660421, 0 ],\n [ 0.660421,-0.5]];\n\n","old_contents":"\/*Parametric belting section generator \n * types GT2 2mm T2.5 T5 T10 MXL\n *\n * (c) ALJ_rprp\n *\n * Derived from http:\/\/www.thingiverse.com\/\n * thing:19758 By The DoomMeister\n * thing:16627 by Droftarts\n *\n * licence GPL 2.1 or later\n *\n * deal properly with ends\n * allow circular segments\n * length is given in mm not nb of teeth\n * belt is centered at z=0 and extend along x\n * \n * TODO : add ofset for cosmetic teeth liaisons between segments\n *\n * usage :\n * belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90,fn=128)\n * belt_len (prf = tT2_5, belt_width = 6, len = 10)\n *\/\n\n\n\/\/ profiles\ntGT2_2=0;\ntT2_5=1;\ntT5=2;\ntT10=3;\ntMXL=4;\n\n\/*test_belt();*\/\n\nmodule test_belt() {\n translate([-00.5,0,5.5])cube([1,40,1]);\n\n belt_len(profile = tT10, belt_width = 10, len = 100);\n translate([0,0,-20])color(\"red\")belt_len(profile = tT5, belt_width = 10, len = 100);\n translate([0,0,-40])color(\"green\")belt_len(profile = tT2_5, belt_width = 10, len = 80);\n translate([0,0,-60])color(\"blue\")belt_len(profile = tGT2_2, belt_width = 10, len = 100);\n translate([0,0,-80])color(\"orange\")belt_len(profile = tMXL, belt_width = 10, len = 100);\n\n translate([0,0,-0]) belt_angle(tT10,20,10,180);\n translate([0,0,-20]) belt_angle(tT5,15,10,90);\n translate([0,0,-40]) belt_angle(tT2_5,25,10,120);\n translate([0,0,-60]) belt_angle(tGT2_2,30,10,40);\n translate([0,0,-80]) belt_angle(tMXL,30,10,40);\n\n\n translate([0,0,-100])color(\"aquamarine\") {\n belt_len(tT2_5,10, 50);\n translate([50,30,0]) rotate([0,0,180]) belt_len(tT2_5,10,50);\n translate([ 0,30,0]) rotate([0,0,180]) belt_angle(tT2_5,15,10,180);\n translate([50,0,0]) rotate([0,0,0]) belt_angle(tT2_5,15,10,180);\n }\n}\n\n\/* there is no partial rotate extrude in scad, hence the workaround\n * note that the pie slice will silently drop angles > 360 *\/\nmodule p_slice(radius, angle,height,back_t=0.6) {\n pt_slc = [[0,radius],\n [0 ,-back_t],\n [radius,-back_t],\n [radius+back_t,radius],\n [radius+back_t,radius*2],\n [0,radius*2+back_t],\n [-radius-back_t,radius*2+back_t],\n [-radius-back_t,radius],\n [-radius-back_t,-back_t],\n [(radius+back_t)*sin(angle),(radius+back_t)*(1-cos(angle))-back_t]];\n\n if (angle<=90) {\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,9]]);\n }else if (angle<=180){\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,3,4,9]]);\n }else if (angle<=270){\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,3,4,5,6,9]]);\n }else if (angle<360) {\n linear_extrude(height = height+0.2, center=true)\n polygon( points = pt_slc, \n paths=[[0,1,2,3,4,5,6,7,8,9]]);\n }\n}\n\ndp=5;\n\nmodule belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90,fn=128) {\n av=360\/2\/rad\/3.14159*tpitch[prf];\n bk=bk_thick[prf];\n\n nn=ceil(angle\/av);\n ang=av*nn;\n intersection(){\n p_slice(rad,angle,bwdth,bk_thick[prf]);\n union () {\n for( i = [0:nn]){\n translate ([0,rad,-bwdth\/2])rotate ([0,0,av*i])translate ([0,-rad,0])\n draw_tooth(prf,0,bwdth);\n }\n translate ([0,rad,-bwdth\/2]) rotate_extrude(angle = 90, $fn=fn)\n polygon([[rad,0],[rad+bk,0],[rad+bk,bwdth],[rad,bwdth]]);\n }\n }\n}\n\n\/\/Outer Module\nmodule belt_len(profile = tT2_5, belt_width = 6, len = 10){\n if ( profile == tT2_5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT10 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tMXL )\t{ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tGT2_2 ){ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n}\n\n\/\/inner module\nmodule _belt_len(prf = -1, len = 10, bwdth = 5) {\n\n n=ceil(len\/tpitch[prf]);\n\n translate ([0,0,-bwdth\/2]) intersection() {\n union(){\n for( i = [0:n]) {\n draw_tooth(prf,i,bwdth);\n }\n translate([-1,-bk_thick[prf],0])cube([len+1,bk_thick[prf],bwdth]);\n }\n translate([0,-bk_thick[prf],0])cube([len,max_h[prf]+bk_thick[prf],bwdth]);\n }\n}\n\nmodule draw_tooth(prf,i,bwdth) {\n if ( prf == tT2_5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T2_5);}\n if ( prf == tT5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T5);}\n if ( prf == tT10 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T10);}\n if ( prf == tMXL ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_MXL);}\n if ( prf == tGT2_2 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_GT2_2);}\n}\n\n\/************************************\n *\t\t\t\tDATA TABLES\t\t\t\t\t*\n ************************************\/\n tpitch = [2,2.5,5,10,2.032];\n bk_thick=[0.6,0.6,1,2,0.64];\n max_h=[0.76447, 0.699911, 1.189895, 2.499784, 0.508035];\n\n pf_GT2_2= [[ 0.747183,-0.5 ],[ 0.747183, 0 ],[ 0.647876, 0.037218],\n [ 0.598311, 0.130528],[ 0.578556, 0.238423],[ 0.547158, 0.343077],\n [ 0.504649, 0.443762],[ 0.451556, 0.53975 ],[ 0.358229, 0.636924],\n [ 0.2484 , 0.707276],[ 0.127259, 0.750044],[ 0 , 0.76447 ],\n [-0.127259, 0.750044],[-0.2484 , 0.707276],[-0.358229, 0.636924],\n [-0.451556, 0.53975 ],[-0.504797, 0.443762],[-0.547291, 0.343077],\n [-0.578605, 0.238423],[-0.598311, 0.130528],[-0.648009, 0.037218],\n [-0.747183, 0 ],[-0.747183,-0.5]];\npf_T2_5= [[-0.839258,-0.5 ],[-0.839258, 0 ],[-0.770246, 0.021652],\n [-0.726369, 0.079022],[-0.529167, 0.620889],[-0.485025, 0.67826 ],\n [-0.416278, 0.699911],[ 0.416278, 0.699911],[ 0.484849, 0.67826 ],\n [ 0.528814, 0.620889],[ 0.726369, 0.079022],[ 0.770114, 0.021652],\n [ 0.839258, 0 ],[ 0.839258,-0.5]];\npf_T5= \t [[-1.632126,-0.5 ],[-1.632126, 0 ],[-1.568549, 0.004939],\n [-1.507539, 0.019367],[-1.450023, 0.042686],[-1.396912, 0.074224],\n [-1.349125, 0.113379],[-1.307581, 0.159508],[-1.273186, 0.211991],\n [-1.246868, 0.270192],[-1.009802, 0.920362],[-0.983414, 0.978433],\n [-0.949018, 1.030788],[-0.907524, 1.076798],[-0.859829, 1.115847],\n [-0.80682 , 1.147314],[-0.749402, 1.170562],[-0.688471, 1.184956],\n [-0.624921, 1.189895],[ 0.624971, 1.189895],[ 0.688622, 1.184956],\n [ 0.749607, 1.170562],[ 0.807043, 1.147314],[ 0.860055, 1.115847],\n [ 0.907754, 1.076798],[ 0.949269, 1.030788],[ 0.9837 , 0.978433],\n [ 1.010193, 0.920362],[ 1.246907, 0.270192],[ 1.273295, 0.211991],\n [ 1.307726, 0.159508],[ 1.349276, 0.113379],[ 1.397039, 0.074224],\n [ 1.450111, 0.042686],[ 1.507589, 0.019367],[ 1.568563, 0.004939],\n [ 1.632126, 0 ],[ 1.632126,-0.5]];\npf_T10= [[-3.06511 ,-1 ],[-3.06511 , 0 ],[-2.971998, 0.007239],\n [-2.882718, 0.028344],[-2.79859 , 0.062396],[-2.720931, 0.108479],\n [-2.651061, 0.165675],[-2.590298, 0.233065],[-2.539962, 0.309732],\n [-2.501371, 0.394759],[-1.879071, 2.105025],[-1.840363, 2.190052],\n [-1.789939, 2.266719],[-1.729114, 2.334109],[-1.659202, 2.391304],\n [-1.581518, 2.437387],[-1.497376, 2.47144 ],[-1.408092, 2.492545],\n [-1.314979, 2.499784],[ 1.314979, 2.499784],[ 1.408091, 2.492545],\n [ 1.497371, 2.47144 ],[ 1.581499, 2.437387],[ 1.659158, 2.391304],\n [ 1.729028, 2.334109],[ 1.789791, 2.266719],[ 1.840127, 2.190052],\n [ 1.878718, 2.105025],[ 2.501018, 0.394759],[ 2.539726, 0.309732],\n [ 2.59015 , 0.233065],[ 2.650975, 0.165675],[ 2.720887, 0.108479],\n [ 2.798571, 0.062396],[ 2.882713, 0.028344],[ 2.971997, 0.007239],\n [ 3.06511 , 0 ],[ 3.06511 ,-1]];\npf_MXL= [[-0.660421,-0.5 ],[-0.660421, 0 ],[-0.621898, 0.006033],\n [-0.587714, 0.023037],[-0.560056, 0.049424],[-0.541182, 0.083609],\n [-0.417357, 0.424392],[-0.398413, 0.458752],[-0.370649, 0.48514 ],\n [-0.336324, 0.502074],[-0.297744, 0.508035],[ 0.297744, 0.508035],\n [ 0.336268, 0.502074],[ 0.370452, 0.48514 ],[ 0.39811 , 0.458752],\n [ 0.416983, 0.424392],[ 0.540808, 0.083609],[ 0.559752, 0.049424],\n [ 0.587516, 0.023037],[ 0.621841, 0.006033],[ 0.660421, 0 ],\n [ 0.660421,-0.5]];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"414a3dcd40d5e954984cb82a94c8ab8503ee809f","subject":"[3d] Add threaded insert support in addition to captive nuts","message":"[3d] Add threaded insert support in addition to captive nuts\n\nAlso maybe fix weird STL generation cause by intersection volumes when splitting halves?\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d=5.6+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d=5.6, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"89bcda69f3231b427314a8ab21be17f6959550f7","subject":"This is v1 - 200mm x 200mm with 2mm base thickness","message":"This is v1 - 200mm x 200mm with 2mm base thickness\n\nThis on took about 12 hours to print using PETG on the Pulse, slow speed (50mm),\n30% fill. The print is almost 8\" by 8\", and there was some detachment\/bending. Also 2mm is unnecessarily thick - took the most time to print that 2mm base.\n","repos":"josephmjoy\/funstuff","old_file":"models\/cushiongrab\/cushiongrab.scad","new_file":"models\/cushiongrab\/cushiongrab.scad","new_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\ntri_height = 5;\nbase_thickness = 2;\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([3*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ Dome - used for differencing\nmodule dome(width) {\n r = 7;\n ceiling_height = tri_height + base_thickness; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n n = width \/ (3*tri_height); \/\/ each row is 3*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0]) \n difference() {\n union() { \n cube([width, base_thickness, width]);\n translate([tri_height, base_thickness, 0]) prism_rows(tri_height, width, n);\n }\n dome(width);\n }\n}\n\n\ncushion_grabber(200);\n\/\/dome(100);\n\n\n\n\n\n","old_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([2*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ Dome - used for differencing\nmodule dome(width) {\n r = 10;\n ceiling_height = 3; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n tri_height = 2;\n base_height = 1;\n n = width \/ (2*tri_height); \/\/ each row is 2*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0])\n difference() {\n union() { \n cube([width, base_height, width]);\n translate([0, base_height, 0]) prism_rows(tri_height, width, n);\n }\n dome(width);\n }\n}\n\n\ncushion_grabber(50);\n\/\/dome(100);\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cac58373d92766de3d4b44598ac12e9090cf12d6","subject":"feat: add an operator to animate a translation","message":"feat: add an operator to animate a translation\n","repos":"jsconan\/camelSCAD","old_file":"operator\/animate\/translate.scad","new_file":"operator\/animate\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that animate child modules with respect to particular rules.\n *\n * @package operator\/animate\n * @author jsconan\n *\/\n\n\/**\n * Translates the child modules, interpolating the coordinates with respect to the `$t` variable.\n *\n * @param Vector [from] - The coordinates from where starts the interpolation.\n * @param Vector [to] - The coordinates to where ends the interpolation.\n * @param Number [start] - The start threshold under what the from-coordinates will persist and above what it will be interpolated.\n * @param Number [end] - The end threshold above what the to-coordinates will persist and under what it will be interpolated.\n * @param Number [domain] - The percentage domain used to compute the thresholds (default: 100).\n * @param Vector [values] - A list of coordinates composing the range to interpolate.\n * @param Vector [range] - A pre-built interpolation range. If missing, it will be built from the parameters `from`, `to`, `start`, `end`, `domain`.\n * @returns Number\n *\/\nmodule translateAnimate(from, to, start, end, domain, values, range) {\n translate(interpolateStep3D(step=$t, low=from, high=to, start=start, end=end, domain=domain, values=values, range=range)) {\n children();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'operator\/animate\/translate.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"5ba31e62751cb1bbf730b522262139d248485f00","subject":"linear_extrusion: add basic 2020 extrusion module","message":"linear_extrusion: add basic 2020 extrusion module\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"linear-extrusion.scad","new_file":"linear-extrusion.scad","new_contents":"use \n\nmodule linear_extrusion(h=10, center=true, align=[0,0,0], orient=[0,0,1])\n{\n size_align([20,20,h], align, orient)\n {\n linear_extrude(height = h, center = true, convexity = 10, twist = 0)\n {\n import (file = \"data\/misumi-extrusion\/hfs5-2020-profile.dxf\");\n }\n }\n}\n\nlinear_extrusion(h=100, align=[0,0,0], orient=[0,0,1]);\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'linear-extrusion.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"71d5fd28db96e1433d8332fcb7d48a9589ce9985","subject":"Add demo for the cushion shape and some helpers","message":"Add demo for the cushion shape and some helpers\n","repos":"jsconan\/camelSCAD","old_file":"samples\/simple-box.scad","new_file":"samples\/simple-box.scad","new_contents":"\/**\r\n * Samples using the camelSCAD library.\r\n *\r\n * A simple parametric box with rounded corners.\r\n *\r\n * @author jsconan\r\n * @license CC0-1.0\r\n *\/\r\n\r\n\/\/ As we need to use some shapes, use the right entry point of the library\r\nuse <..\/shapes.scad>\r\n\r\n\/**\r\n * Renders a rounded box at the origin.\r\n *\r\n * @param Vector|Number size - The outer dimensions of the box\r\n * @param Number thickness - The thickness of the box walls (default 1). Cannot be greater than 10% of the lowest dimension.\r\n * @param Number radius - The radius of the corner (default 10% of the lowest dimension)\r\n *\/\r\nmodule simpleBox(size, thickness, radius) {\r\n \/\/ Adjust the values to get usable size, thickness, and rounded corner radius\r\n size = vector3D(size);\r\n lowest = min(size[0], size[1]) \/ 10;\r\n thickness = min(numberOr(thickness, 1), lowest);\r\n radius = numberOr(radius, lowest);\r\n\r\n \/\/ Compute the size and position of the handle hole\r\n handleRadius = size[0] + size[1];\r\n handleCenter = center2D(\r\n a=apply2D(x=-size[0] \/ 2 + radius, y=size[2]),\r\n b=apply2D(x=size[0] \/ 2 - radius, y=size[2]),\r\n r=handleRadius,\r\n negative=true\r\n );\r\n\r\n difference() {\r\n \/\/ This is the outside of the box\r\n cushion(size=size, r=radius);\r\n\r\n \/\/ This is the inside of the box\r\n translate([0, 0, thickness]) {\r\n cushion(size=apply3D(size, x=size[0] - thickness * 2, y=size[1] - thickness * 2), r=radius-thickness\/2);\r\n }\r\n\r\n \/\/ This is the handle hole\r\n rotateX(90) {\r\n translate(vector3D(handleCenter)) {\r\n cylinder(r=handleRadius, h=size[1] + 1, center=true);\r\n }\r\n }\r\n }\r\n\r\n}\r\n\r\n\/\/ We will render the object using the specifications of this mode\r\nrenderMode = \"prod\";\r\n\r\n\/\/ Defines the dimensions of the box\r\nlength = 100;\r\nwidth = 70;\r\nheight = 40;\r\nthickness = 1;\r\nradius = 5;\r\n\r\n\/\/ Sets the minimum facet angle and size using the defined render mode.\r\n$fa = facetAngle(renderMode);\r\n$fs = facetSize(renderMode);\r\n\r\n\/\/ And draw the box accordingly\r\nsimpleBox(size = [length, width, height], thickness=thickness, radius=radius);\r\n\r\n\/\/ You may also draw a cover by rendering another box that has an increased size with respect to the wall thickness...\r\n%translate([0, 0, height + thickness]) {\r\n rotateX(180) {\r\n \/\/ Use an additional adjustment value (0.1) to counter the printer's precision lack and\r\n \/\/ allow to put the cover in place once printed.\r\n sizeAdjust = thickness * 2 + 0.1;\r\n simpleBox(size = [length + sizeAdjust, width + sizeAdjust, height + thickness], thickness=thickness, radius=radius);\r\n }\r\n}\r\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'samples\/simple-box.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1588af6c368eeba597149b1333e3807df42d20aa","subject":"made lit a bit bigger, with more rounded corners","message":"made lit a bit bigger, with more rounded corners\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/payloadMount.scad","new_file":"Drawings\/payloadMount.scad","new_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\ntranslate([0,0,9]) lid();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\ndh=3.1;\nc30=cos(30); dx=3*dh; dy=2*c30*dh;\nmodule hexGrid() {\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y,s=[1,1,1]) translate([x,y,0]) scale(s)\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\nmodule lid() {\n difference() {\n union() {\n for (i=[-1,1]) for (j=[-1,1]) \n hex(3*dx*i,5*dy*j,[.9,.9,1]);\n difference() {\n lidShell();\n translate([0,0,0.3]) scale([.987,.98,.97]) lidShell();\n }\n }\n hull() {\n translate([0,0,3.5]) cube([89,57.5,.1],center=true);\n cube([86,52,7],center=true);\n }\n\n for(x=[-1,1]) translate([x*23,0,2.2]) rotate([90,0,0])\n scale([2.5,1.5,1]) cylinder(r=1,h=77,$fn=16,center=true);\n\n \/\/translate([0,0,-99]) cube([200,200,200]);\n }\n\n}\n\nmodule lidShell()\n hull() {\n for (x=[-1,1]) for(y=[-1,1]) {\n translate([44*x,27.5*y,4.6]) sphere(3,$fn=24);\n translate([40*x,23 *y,30 ]) sphere(3,$fn=24);\n }\n}\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","old_contents":"\/\/ unified payload electronics mount\n\nBhole=2.38+.3; \/\/ for brass tube\nPCBhole = (25.4*3\/32)\/2;\/\/1; \/\/ found that 3\/32\" drill made good pilot for #4 self-piloting screw\ninclude ; \/\/ Bx \nPCBholeSep=37; \/\/ hole pattern for L298 module is a square this wide\nPCBholeInset=15; \/\/ from hole center to side of mount\n\nthinWall=.35;\/\/0.41; \/\/ width of thinnest wall which will not get culled by slicer\n\n\/\/translate([0,20,0]) L298mount();\n\n%translate([0,0, 7.8]) payloadPlatform();\n%translate([0,0,-31.5]) rotate([180,0,0]) lowerPlatform();\n\nbraceSep = PCBholeInset+PCBholeSep\/2;\nfor(a=[0,180]) rotate([0,0,a]) translate([0,braceSep,0]) rotate([90,0,0])\n payloadBrace();\n\n\/\/translate([0,100,0]) payloadBrace();\n\n\/\/%translate([0,0,-29]) cylinder(r=4,h=31,$fn=4);\n\n\/\/ -----------------------------------------------------\n\nmodule payloadBrace() difference() {\n payloadMount(Bx,Bhole);\n\n #for(x=[-1,1]) translate([x*Bx,0,-1]) cylinder(r=Bhole,h=44,$fn=25);\n translate([0,0,-4]) cube([200,200,8],center=true);\n}\n\n\n\/\/ dovetail tabs for platform\ntabZ=4.2; \/\/ offset for tab\nmodule tab(pilotHoleRad=0) difference() {\n cylinder(r1=7,r2=5.5,h=6,$fn=3);\n\n if (pilotHoleRad > 0.2) {\n translate([0,0,1]) \/\/ pilot hole for plastic screw\n #cylinder(r1=pilotHoleRad-.4,r2=pilotHoleRad+.2,h=6,$fn=13);\n }\n}\ntabCutoutScale = .4\/6 + 1; \/\/ want .2 mm space\ntabShellScale = 4\/6 + 1; \/\/ want 2 mm space\ntabSepUpper=40;\ntabSepLower=23;\n\nmodule payloadPlatform() {\nplatWidth=100;\n difference() {\n payloadPlatformShell( platWidth,tabSepUpper); \/\/ width, tab seperation\n payloadPlatformCutouts(platWidth,tabSepUpper);\n }\n}\nmodule lowerPlatform() {\nplatWidth=70;\nhc=PCBholeSep\/2; \/\/ dist for L298N module sqare hole pattern\n difference() {\n payloadPlatformShell( platWidth,tabSepLower); \/\/ width, tab seperation\n difference() {\n payloadPlatformCutouts(platWidth,tabSepLower);\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,0])\n cylinder(r1=4,r2=3,h=6,$fn=12,center=true);\n }\n\n \/\/ pilot holes for L298N module mount screws\n for(x=[-1,1]) for(y=[-1,1]) translate([x*hc,y*hc,-1])\n cylinder(r1=PCBhole+.3,r2=PCBhole-.2,h=4,$fn=12,center=true);\n }\n}\n\nmodule payloadPlatformCutouts(width=100,tabSep=40) {\n intersection() {\n difference() {\n hull() for(x=[-1,1]) for(y=[-1,1]) \n translate([x*(width\/2-5),y*(braceSep-5),0])\n cylinder(r1=2,r2=3,h=6,$fn=16,center=true);\n\n \/\/ cutouts for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabShellScale) tab();\n }\n hexGrid();\n }\n}\n\n\nmodule hexGrid() {\ndh=3.1;\nc30=cos(30); $fn=6; dx=3*dh; dy=2*c30*dh;\n translate([3*dh\/2,-c30*dh,0])\n for(j=[-5:6]) for(i=[-5:4]) hex(i*dx,j*dy);\n for(j=[-6:6]) for(i=[-5:5]) hex(i*dx,j*dy);\n}\nmodule hex(x,y) translate([x,y,0])\n cylinder(r1=2,r2=2.7,h=6,$fn=6,center=true); \n\n\n\/\/ width of platform along axes (Y width fixed)\n\/\/ tabSep -- seperation between tab centers\nmodule payloadPlatformShell(width=100,tabSep=40) {\n intersection() {\n difference() {\n cube([width,2*braceSep,5],center=true);\n\n \/\/ slots for dovetail tabs\n for(a=[0,180]) rotate([0,0,a])\n for(x=[-tabSep,0,tabSep]) translate([x,braceSep-tabZ,-3])\n rotate([0,0,-30]) scale(tabCutoutScale) tab();\n }\n\n \/\/ round off corners\n hull()for(x=[-1,1])for(y=[-1,1])translate([x*(width\/2-4),y*(braceSep-4),0])\n scale([4.5,4.5,3.5])sphere(1,$fn=36);\n }\n}\n\n\nmodule L298mount() intersection() { cube([59,99,4],center=true); \n \n difference() {\n hull() for(x=[-1,1]) for(y=[-1,PCBholeInset-0.5])\n translate([x*(30-4),y,0])\n scale([4,4,3]) sphere(1,$fn=24);\n\n hull() {\n translate([0,12,0]) scale([ 9,4,6]) sphere(1,$fn=48);\n translate([0,22,0]) scale([18,1,8]) sphere(1,$fn=48);\n }\n\n difference() {\n union() {\n translate([0,4,0]) scale([ 5,2.5,5]) sphere(1,$fn=24);\n\n for(x=[-1,1]) {\n translate([x*PCBholeSep\/2,PCBholeInset,-4])\n #cylinder(r=PCBhole,h=9,$fn=15);\n\n for (y=[6,14]) translate([x*26,y,-4]) cylinder(r=1.6,h=9,$fn=15);\n\n hull() {\n translate([x*21,7,0]) rotate([0,0,40*x])\n scale([5,1,5]) sphere(1,$fn=36);\n translate([x*22,13,0]) scale([1,2,5]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*11,5,0]) rotate([0,0,30*x])\n scale([4,2,5]) sphere(1,$fn=36);\n translate([x*16,12,0]) scale([2,1,5]) sphere(1,$fn=12);\n }\n\n }\n }\n\n cube([99,99,thinWall],center=true); \/\/ leave support wall\n }\n }\n}\n\n\nmodule payloadMount(axisSep,axisRad) {\nplatOff=-30+2; \/\/ L286 module mount platform offset\n union() {\n\n for (x=[-1,1]) translate([x*axisSep,0,0]) \/\/ axle hubs\n cylinder(r1=axisRad+3,r2=axisRad+2,h=12,$fn=36);\n\n hull() { \/\/ top bar\n translate([0,4.7,4]) cube([2*axisSep,.7,8],center=true);\n translate([0,1.5,0]) cube([2*axisSep,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([axisSep*x,1.1,0.5])\n scale([1,4,1.5]) sphere(1,$fn=16);\n\n hull() { \/\/ lower bar\n translate([0,platOff-.7,4]) cube([60,.6,8],center=true);\n translate([0,platOff+1 ,0]) cube([60,1 ,1],center=true);\n }\n hull() for(x=[-1,1]) translate([31*x,platOff+3,0.3])\n rotate([0,0,-x*40]) scale([1,3.5,1.5]) sphere(1,$fn=16);\n\n \/\/%translate([0,platOff,0]) rotate([90,0,0]) L298mount();\n\n for(x=[-1,1]) { \/\/ main side braces\n hull() {\n translate([x*(axisSep+2),-2,2]) scale([1.5,1,9]) sphere(1,$fn=16);\n translate([x*29,platOff ,3]) scale([.5,1,4]) sphere(1,$fn=16);\n }\n hull() {\n translate([x*(axisSep-1),0 ,0.3]) scale([4,1,1.5]) sphere(1,$fn=16);\n translate([x*26,platOff,0.3]) scale([3,1,1.5]) sphere(1,$fn=16);\n }\n }\n\n \/\/ upper platform tabs\n for(x=[-tabSepUpper,0,tabSepUpper]) translate([x,5-1,tabZ])\n rotate([-90,0,0]) rotate([0,0,-30]) tab(PCBhole);\n\n \/\/ lower platform tabs\n for(x=[-tabSepLower,0,tabSepLower]) translate([x,platOff+0.3,tabZ])\n rotate([90,0,0]) rotate([0,0,30]) tab(PCBhole);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"fce42d38ddc319b96ca371141b5b17eb3c2051b1","subject":"limit to one axis worth of brackets, and make brackets L-R universal.","message":"limit to one axis worth of brackets, and make brackets L-R universal.\n","repos":"freemakers\/usable-shapeoko","old_file":"cad\/limit-switch-brackets.scad","new_file":"cad\/limit-switch-brackets.scad","new_contents":"$fn=100;\n\nmm=1;\n\nswitch_z=10*mm;\n\nbase_x=32*mm;\nbase_y=28*mm;\nbase_z=3.25*mm;\n\nlayer2_z=7.6*mm-base_z;\n\nriser_x=22*mm;\nriser_y=base_y;\nriser_z=layer2_z;\n\nriser_x_off=0;\nriser_y_off=0;\nriser_z_off=base_z;\n\nhole_r=2.9*mm\/2;\nhole_z=base_z + layer2_z;\n\nhole_y_off=1.4*mm + hole_r;\n\nhole1_x_off=11.6*mm + hole_r;\nhole2_x_off=hole_y_off;\n\nhole1_L_y_off=hole_y_off;\nhole2_L_y_off=base_y-hole_y_off;\n\nhole1_R_y_off=base_y-hole_y_off;\nhole2_R_y_off=hole_y_off;\n\ntab_x=2.8*mm;\ntab_y=12.5*mm;\ntab_z=layer2_z + 3;\n\ntab_x_off=riser_x+3.6*mm + (tab_x\/2);\ntab_y_off=(base_y-tab_y)\/2;\ntab_z_off=base_z;\n\nmodule base(){\n cube([base_x, base_y, base_z]);\n}\n\nmodule tab(x_off, y_off, z_off, x, y, z){\n\thull(){\n\t\ttranslate([x_off, y_off, z_off])\n\t\t\tcylinder(d=x, h=z);\n\t\ttranslate([x_off, y_off+(y), z_off])\n\t\t\tcylinder(d=x, h=z);\n\t}\n}\n\nmodule layer2(){\n\ttranslate([riser_x_off, riser_y_off, riser_z_off])\n\t\tcube([riser_x, riser_y, riser_z]);\n}\n\nmodule bottom_holes(){\n\tunion(){\n\t\ttranslate([hole1_x_off, hole1_L_y_off, 0])\n\t\t\tcylinder(r=hole_r, h=hole_z);\n\t\ttranslate([hole2_x_off, hole2_L_y_off, 0])\n\t\t\tcylinder(r=hole_r, h=hole_z);\n \n\t\ttranslate([hole1_x_off, hole1_R_y_off, 0])\n\t\t\tcylinder(r=hole_r, h=hole_z);\n\t\ttranslate([hole2_x_off, hole2_R_y_off, 0])\n\t\t\tcylinder(r=hole_r, h=hole_z);\n \n\t\ttranslate([tab_x_off, tab_y_off, 0])\n\t\t\tcylinder(r=hole_r,h=base_z);\n\t\ttranslate([tab_x_off, tab_y_off+tab_y-hole_r, 0])\n\t\t\tcylinder(r=hole_r,h=base_z);\n\t}\n}\n\nmodule bracket(){\n\tdifference(){\n\t\tunion(){\n\t\t \tbase();\n \t\t\tlayer2();\n\t\t}\n\t\tbottom_holes();\n\t}\n}\n\nmodule axis_brackets(){\n\tbracket();\n\ttranslate([0,-(base_y+10),0]) bracket();\n}\n\nunion(){\n axis_brackets();\n\/\/ translate([-(base_x+10),0,0]) axis_brackets();\n}\n\n","old_contents":"$fn=100;\n\nmm=1;\n\nswitch_z=10*mm;\n\nbase_x=32*mm;\nbase_y=28*mm;\nbase_z=3.25*mm;\n\nlayer2_z=7.6*mm-base_z;\n\nriser_x=22*mm;\nriser_y=base_y;\nriser_z=layer2_z;\n\nriser_x_off=0;\nriser_y_off=0;\nriser_z_off=base_z;\n\nhole_r=2.9*mm\/2;\nhole_z=base_z + layer2_z;\n\nhole_y_off=1.4*mm + hole_r;\n\nhole1_x_off=11.6*mm + hole_r;\nhole1_y_off=base_y-hole_y_off;\n\nhole2_x_off=hole_y_off;\nhole2_y_off=hole_y_off;\n\ntab_x=2.8*mm;\ntab_y=12.5*mm;\ntab_z=layer2_z + 3;\n\ntab_x_off=riser_x+3.6*mm + (tab_x\/2);\ntab_y_off=(base_y-tab_y)\/2;\ntab_z_off=base_z;\n\nmodule base(){\n cube([base_x, base_y, base_z]);\n}\n\nmodule tab(x_off, y_off, z_off, x, y, z){\n\thull(){\n\t\ttranslate([x_off, y_off, z_off])\n\t\t\tcylinder(d=x, h=z);\n\t\ttranslate([x_off, y_off+(y), z_off])\n\t\t\tcylinder(d=x, h=z);\n\t}\n}\n\nmodule layer2(){\n\ttranslate([riser_x_off, riser_y_off, riser_z_off])\n\t\tcube([riser_x, riser_y, riser_z]);\n}\n\nmodule bottom_holes(){\n\tunion(){\n\t\ttranslate([hole1_x_off, hole1_y_off, 0])\n\t\t\tcylinder(r=hole_r, h=hole_z);\n\t\ttranslate([hole2_x_off, hole2_y_off, 0])\n\t\t\tcylinder(r=hole_r, h=hole_z);\n\t\ttranslate([tab_x_off, tab_y_off, 0])\n\t\t\tcylinder(r=hole_r,h=base_z);\n\t\ttranslate([tab_x_off, tab_y_off+tab_y-hole_r, 0])\n\t\t\tcylinder(r=hole_r,h=base_z);\n\t}\n}\n\nmodule bracket(){\n\tdifference(){\n\t\tunion(){\n\t\t \tbase();\n \t\t\tlayer2();\n\t\t}\n\t\tbottom_holes();\n\t}\n}\n\nunion(){\n\tbracket();\n\ttranslate([0,-(base_y+10),0]) bracket();\n\ttranslate([-(base_x+10),0,0]) bracket();\n\ttranslate([-(base_x+10),-(base_y+10),0]) bracket();\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e7ff93f7065ab5dec4369c609259aec9ea96bb09","subject":"added mount point","message":"added mount point\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_case\/bottom_aa.scad","new_file":"battery_case\/bottom_aa.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"b8e7256e84dca380a5285c6884e812d46647dffe","subject":"xaxis\/carriage: add quad (bearing) mode","message":"xaxis\/carriage: add quad (bearing) mode\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 13*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef, quad=true)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 20*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 13*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = 5*mm + xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = 5*mm + xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nmodule x_carriage_full()\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"853e9846da2b2940f5c992846335791e183802ca","subject":"x\/extruder: more tweaks","message":"x\/extruder: more tweaks\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\nextruder_b_mount_offsets=[\n [-1*(extruder_b_w\/2+4*mm),0,0],\n [+1*(extruder_b_w\/2+4*mm),0,0],\n [-4*mm,0,44.5*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut, $fn=50);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut, $fn=50);\n }\n\n translate(extruder_guidler_mount_off)\n {\n hull()\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([-guidler_mount_d,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nif(false)\n{\n \/*x_carriage_withmounts(show_vitamins=true);*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n \/*difference()*\/\n \/*{*\/\n \/*extruder_b(part=\"pos\");*\/\n\n \/*extruder_b(part=\"neg\");*\/\n \/*}*\/\n \/*extruder_b(part=\"vit\");*\/\n\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=true);*\/\n \/*}*\/\n\n \/*x_extruder_hotend();*\/\n\n \/*\/\/filament path*\/\n \/*translate(extruder_filapath_offset)*\/\n \/*cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);*\/\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n rotate([-90,0,0])\n extruder_a();\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -12*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 14*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+7*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1-4*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n \/*if(false)*\/\n %if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\nextruder_b_mount_offsets=[\n [-1*(extruder_b_w\/2+4*mm),0,0],\n [+1*(extruder_b_w\/2+4*mm),0,0],\n [-4*mm,0,44.5*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=10*mm, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/*\/\/ clamp mount screw holes*\/\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])*\/\n \/*cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);*\/\n \/*}*\/\n }\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000*mm;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut, $fn=50);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut, $fn=50);\n }\n\n translate(extruder_guidler_mount_off)\n {\n hull()\n for(y=[-1,1])\n translate([0,y*guidler_mount_w\/2,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);\n translate([-guidler_mount_d,0,-guidler_mount_d\/2])\n cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);\n }\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+2*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,0,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,0,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]*1.1,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n \/*translate(extruder_offset_b)*\/\n translate([extruder_filapath_offset[0],0,-15*mm])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,90])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.6];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*3;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n extruder_b(part=\"vit\");\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n x_extruder_hotend();\n\n \/\/filament path\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n rotate([90,0,0])\n x_carriage_withmounts(show_vitamins=false);\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"aad6cf67af4f0d86780c8cb86d632fbb66a15a9f","subject":"bearing: reduce rod cut dia to 1.3 instead of 1.5","message":"bearing: reduce rod cut dia to 1.3 instead of 1.5\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.3, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use \ninclude \ninclude \n\nmodule bearing(bearing_type, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = override_h==undef ? bearing_type[2] : override_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n fncylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n fncylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n fncylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n fncylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n fncylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n\n \/\/ for linear rod\n fncylindera(d=bearing_type[0]*1.5, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7475c3fbb3400648747e8caf8860f6d4e7fdb9a4","subject":"bladeValve draft","message":"bladeValve draft\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"bladeValve.scad","new_file":"bladeValve.scad","new_contents":"\/\/Air Valve Prototype\n\n\/\/Variables\nbladeH = 80;\nbladeW = 20;\ngearT = 5;\njointT = 5;\njointW = 5;\n\n\/\/Blade\nmodule blade() {\n square([bladeW,bladeH],center=true);\n square([jointW,bladeH+2*(gearT+jointT)],center=true);\n}\n\nlinear_extrude(height=5)blade();","old_contents":"","returncode":1,"stderr":"error: pathspec 'bladeValve.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1b5d560c0bb70437eeebf7d7e97aaa84f8dfab95","subject":"Added bridge to hold a battery together with the computers","message":"Added bridge to hold a battery together with the computers\n","repos":"mhct\/droneuaw","old_file":"support-design\/support-rocket-m5-rpi.scad","new_file":"support-design\/support-rocket-m5-rpi.scad","new_contents":"\nmodule holefixer() {\n \/\/produces a holefixer (with space for a 3 mm screw)\n \/\/ it has 13 mm heigh\n \/\/ the center of the hole is at x=12,y=12\n difference() {\n union() {\n tickness = 3;\n cube([12, 10, tickness], center=true);\n translate([0,0,-15]) cylinder(h=16, r=3, center=false, $fn=100); \n } \n translate([0,0,-20]) cylinder(h=30, r=2, center=false, $fn=100);\n \n }\n\n}\n\nmodule bridge(covered = false) {\n color([1,1,1],1) {\n translate([0,44,0]) rotate([0,-90,0]) union() {\n cube([37, 24, 3]);\n translate([0,6,0]) cube([15, 12, 5]);\n }\n \n translate([76,44,0]) rotate([0,-90,0]) union() {\n cube([37, 24, 3]);\n translate([0,6,-2]) cube([15, 12, 5]);\n }\n if (covered == true) {\n translate([-3, 44, 37]) cube([79,24,3]); \n }\n }\n}\n\n$fn=100;\ndifference() {\n union() {\n tickness = 3;\n cube([74, 107, tickness]);\n translate([0,-33,0]) bridge(true);\n translate([0,28,0]) bridge(true);\n \n translate([-6,40,1.5]) holefixer();\n translate([-2,35,1.5]) cube([6, 10, 3], center=false); \/\/support to make outside wings stronger\n translate([79,40,1.5]) holefixer();\n translate([69,35,1.5]) cube([6, 10, 3], center=false); \/\/support to make outside wings stronger\n \n\n translate([31.5, 44, 0]) cube([10, 4, 10], center=false);\n translate([26.5, 103, 0]) cube([20, 4, 10], center=false);\n translate([66, 74.5, 0]) cube([4, 10, 10], center=false);\n }\n\n\n translate([5.5, 7.5, 0]) cylinder(h=16, r=1.6, center=true);\n translate([14.1, -1, -1]) cube([18,16,7], center=false); \/\/ hole for ethernet card \n translate([64, 50, -1]) cube([6,18,7], center=false); \/\/hole for firmware pins\n\n translate([66.3, 7.5, 0]) cylinder(h=16, r=1.6, center=true);\n\n translate([37, 75, 0]) cylinder(h=16, r=24, center=true);\n\/\/ translate([37, 20, 0]) cylinder(h=16, r=16, center=true);\n\n}\n\n\nmodule measureCheck() {\n color([1.0,0,0], 1) {\n rotate([0,90,0]) cylinder(h=85, r=1, center=false);\n }\n}\n\n\/\/translate([-6,40,0]) measureCheck();","old_contents":"","returncode":1,"stderr":"error: pathspec 'support-design\/support-rocket-m5-rpi.scad' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"8fac88dec44ccd7a62cd76f9da52056e1603fc3c","subject":"WIP on the model itself","message":"WIP on the model itself\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"orp_orze\u0142_model_holder\/holder.scad","new_file":"orp_orze\u0142_model_holder\/holder.scad","new_contents":"eps = 0.01;\nspacing = 4;\nsize = [74.1+2*spacing, 32.2+2*spacing];\nrounding = 5;\n\nmodule holder_()\n{\n z=2;\n x=74.1;\n y=32.2;\n w=3.08;\n for(dx=[0, x-w])\n translate([dx,0,0])\n {\n cube([w, y, z]);\n translate(6*[0, 1\/2, 0])\n cube([w, y-6, z+20]);\n }\n translate([0, y\/2-w\/2, z])\n cube([x, w, z]);\n}\n\nmodule holder_space_()\n{\n space=2;\n z=2-0.5;\n x=74.1;\n y=32.2+2*space;\n w=3.08+2*space;\n for(dx=[0, x-w+2*space])\n translate([dx, 0, 0])\n cube([w, y, z]);\n}\n\nmodule main_block_()\n{\n \/\/ desk mount\n\/\/ difference()\n\/\/ {\n\/\/ cube([size[0], 19+2*2, 20+4]);\n\/\/ translate([-eps, 2, 4])\n\/\/ cube([size[0]+2*eps, 19, 20+1]);\n\/\/ }\n \/\/ main surface\n for(i=[0])\/\/, size[0]-rounding])\n translate([i, 0, 0])\n hull()\n {\n cube([2*rounding+2, 1, 3]);\n for(j=[0, spacing])\n #translate(spacing*[1,0,0] + [j+1, size[1], 0])\n cylinder(r=rounding, h=3, $fn=120);\n }\n}\n\n\nmodule holder()\n{\n difference()\n {\n main_block_();\n translate([2, spacing, 0])\n #holder_space_();\n translate(2*[1, 1, 0] + [size[0]-spacing-2, spacing, 1.5])\n rotate([0, 180, 0])\n %holder_();\n }\n}\n\nholder();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'orp_orze\u0142_model_holder\/holder.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0127aae1678243c3b4a162dfa35d8930cb85751d","subject":"animation","message":"animation\n","repos":"JoeSuber\/QuickerPicker","old_file":"test_spring.scad","new_file":"test_spring.scad","new_contents":"\/\/ test parts for kinematic practicality\n\nuse ;\n\nspringlen = 30;\n\nfor (i=[-1,0,1]){\n translate([0,i*(10+1),5\/2])\n spring();\n}\n\ntranslate([0,0,17]){\n \/\/%contact_ring(fat=1);\n nest_ring();\n translate([65,4,-2])\n contact_ring(fat=1);\n}\n\/\/small_switch();\n\nmodule spring(sl=springlen, sh=10, stp=2, tab=6){\n difference(){\n union(){\n \/\/ spring body \n cube([sl, sh, sh\/2], center=true);\n \/\/ tabs for insertions\n for (i=[-sl\/2-tab\/2+1, sl\/2+tab\/2-1]){\n translate([i, 0, -sh\/4+0.5])\n minkowski(){\n cube([tab-2, sh-2, 1-0.1], center=true);\n cylinder(r=1, h=0.1, center=true, $fn=12);\n }\n }\n }\n \/\/ diff out gaps\n for (i=[stp+1:stp*2:sl-stp\/2], j=[-stp\/2,stp\/2]){\n translate([i-sl\/2, stp\/2, 0])\n cube([stp\/2, sh+0.05,sh\/2+0.1], center=true);\n translate([i-sl\/2-stp, -stp\/2, 0])\n cube([stp\/2, sh+0.05,sh\/2+0.1], center=true);\n }\n \/\/ holes in tabs\n for (i=[-sl\/2-tab\/2, sl\/2+tab\/2]){\n translate([i, 0, -sh\/2+0.5])\n cylinder(r=1.7, h=sh, $fn=12, center=true);\n }\n }\n}\n\nmodule springcut(sl=springlen, sh=10, stp=2, tab=6){\n scale([1.0, 1.05, 1.05]){\n cube([sl, sh, sh\/2], center=true);\n translate([0,0,-sh\/4+0.5])\n cube([sl+tab*2, sh, 1], center=true);\n for (i=[-sl\/2-tab\/2, sl\/2+tab\/2]){\n translate([i, 0, -sh\/4+0.5])\n cylinder(r=1.7, h=sh+1, $fn=12, center=true);\n }\n }\n}\n\nmodule alutube(OD=5.56, ID=4.7, ht=20){\n wedge=(OD-ID)\/2;\n difference(){\n union(){\n translate([0,0,ht\/2-wedge\/2])\n cylinder(r1=OD\/2, r2=ID\/2, h=wedge+.05, center=true, $fn=round(OD*6));\n mirror([0,0,1]) translate([0,0,ht\/2-wedge\/2])\n cylinder(r1=OD\/2, r2=OD\/2, h=wedge, center=true, $fn=round(OD*6));\n cylinder(r=OD\/2, h=(ht-wedge*2), center=true, $fn=round(OD*6));\n }\n cylinder(r=ID\/2, h=ht+0.1, center=true, $fn=round(OD*6));\n }\n}\n\nmodule contact_ring(OD=58, wall=2, base=10, crown=5, ht=30, fat=1, sx=.3){\n springspot = 11;\n midwall=(OD*fat + (OD-wall*2*fat))\/4 -.5;\n difference(){\n alutube(OD=OD*fat, ID=OD-wall*2*fat, ht=ht);\n for (i=[120,240,360]){\n translate([midwall*cos(i), midwall*sin(i), springspot]) rotate([i-180, -90,0]) \n springcut();\n }\n for (i=[60,180,300]){\n translate([(midwall-sx)*cos(i), (midwall-sx)*sin(i), 14]) rotate([180, 0, i-90]) \n small_switch();\n }\n }\n \/\/redraw the spring-cuts as positives if needed for cut-out duty\n if (fat > 1){ \n for (i=[120,240,360]){\n translate([midwall*cos(i), midwall*sin(i), springspot-4]) rotate([i-180, -90,0]) \n scale([1, fat, fat])\n springcut();\n }\n for (i=[60,180,300]){\n translate([(midwall-sx)*cos(i), (midwall-sx)*sin(i), 14]) rotate([180, 0, i-90]) \n small_switch();\n }\n }\n}\n\nmodule nest_ring(OD=64.6, wall=4.6, fat=1.00, ht=34){\n midwall=(OD*fat + (OD-wall*2*fat))\/4;\n difference(){\n alutube(OD=OD, ID=OD-wall*2, ht=ht);\n translate([0,0,-13]) \n contact_ring(fat=1.06);\n }\n}\n \n","old_contents":"\/\/ test parts for kinematic practicality\n\nuse ;\n\nspringlen = 29;\n\nfor (i=[-1,0,1]){\n translate([0,i*(10+1),5\/2])\n spring();\n}\n\ntranslate([0,0,17]){\n \/\/%contact_ring(fat=1);\n nest_ring();\n translate([65,4,-2])\n contact_ring(fat=1);\n}\n\/\/small_switch();\n\nmodule spring(sl=springlen, sh=10, stp=2, tab=6){\n difference(){\n union(){\n \/\/ spring body \n cube([sl, sh, sh\/2], center=true);\n \/\/ tabs for insertions\n for (i=[-sl\/2-tab\/2+1, sl\/2+tab\/2-1]){\n translate([i, 0, -sh\/4+0.5])\n minkowski(){\n cube([tab-2, sh-2, 1-0.1], center=true);\n cylinder(r=1, h=0.1, center=true, $fn=12);\n }\n }\n }\n \/\/ diff out gaps\n for (i=[stp+1:stp*2:sl-stp\/2], j=[-stp\/2,stp\/2]){\n translate([i-sl\/2, stp\/2, 0])\n cube([stp\/2, sh+0.05,sh\/2+0.1], center=true);\n translate([i-sl\/2-stp, -stp\/2, 0])\n cube([stp\/2, sh+0.05,sh\/2+0.1], center=true);\n }\n \/\/ holes in tabs\n for (i=[-sl\/2-tab\/2, sl\/2+tab\/2]){\n translate([i, 0, -sh\/2+0.5])\n cylinder(r=1.7, h=sh, $fn=12, center=true);\n }\n }\n}\n\nmodule springcut(sl=springlen, sh=10, stp=2, tab=6){\n scale([1.0, 1.05, 1.05]){\n cube([sl, sh, sh\/2], center=true);\n translate([0,0,-sh\/4+0.5])\n cube([sl+tab*2, sh, 1], center=true);\n for (i=[-sl\/2-tab\/2, sl\/2+tab\/2]){\n translate([i, 0, -sh\/4+0.5])\n cylinder(r=1.7, h=sh+1, $fn=12, center=true);\n }\n }\n}\n\nmodule alutube(OD=5.56, ID=4.7, ht=20){\n wedge=(OD-ID)\/2;\n difference(){\n union(){\n translate([0,0,ht\/2-wedge\/2])\n cylinder(r1=OD\/2, r2=ID\/2, h=wedge+.05, center=true, $fn=round(OD*6));\n mirror([0,0,1]) translate([0,0,ht\/2-wedge\/2])\n cylinder(r1=OD\/2, r2=OD\/2, h=wedge, center=true, $fn=round(OD*6));\n cylinder(r=OD\/2, h=(ht-wedge*2), center=true, $fn=round(OD*6));\n }\n cylinder(r=ID\/2, h=ht+0.1, center=true, $fn=round(OD*6));\n }\n}\n\nmodule contact_ring(OD=58, wall=2, base=10, crown=5, ht=30, fat=1, sx=.3){\n springspot = 11;\n midwall=(OD*fat + (OD-wall*2*fat))\/4 -.5;\n difference(){\n alutube(OD=OD*fat, ID=OD-wall*2*fat, ht=ht);\n for (i=[120,240,360]){\n translate([midwall*cos(i), midwall*sin(i), springspot]) rotate([i-180, -90,0]) \n springcut();\n }\n for (i=[60,180,300]){\n translate([(midwall-sx)*cos(i), (midwall-sx)*sin(i), 14]) rotate([180, 0, i-90]) \n small_switch();\n }\n }\n \/\/redraw the spring-cuts as positives if needed for cut-out duty\n if (fat > 1){ \n for (i=[120,240,360]){\n translate([midwall*cos(i), midwall*sin(i), springspot-4]) rotate([i-180, -90,0]) \n scale([1, fat, fat])\n springcut();\n }\n for (i=[60,180,300]){\n translate([(midwall-sx)*cos(i), (midwall-sx)*sin(i), 14]) rotate([180, 0, i-90]) \n small_switch();\n }\n }\n}\n\nmodule nest_ring(OD=64.6, wall=4.6, fat=1.00, ht=34){\n midwall=(OD*fat + (OD-wall*2*fat))\/4;\n difference(){\n alutube(OD=OD, ID=OD-wall*2, ht=ht);\n translate([0,0,-13]) \n contact_ring(fat=1.06);\n }\n}\n \n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2c95aefc841d5d60aabc26fd08976754b3f14536","subject":"yaxis\/idler: Rewrite to be smaller\/more compact","message":"yaxis\/idler: Rewrite to be smaller\/more compact\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-idler.scad","new_file":"y-axis-idler.scad","new_contents":"use \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = 2*yaxis_idler_pulley_inner_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut = MHexNutM4;\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, yaxis_idler_mount_tightscrew_hexnut);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, yaxis_idler_mount_tightscrew_hexnut);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.3;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n\n difference()\n {\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n cylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n }\n\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[1000, 1000, 1000],\n align=[0,0,-1]\n );\n }\n\n\n }\n }\n\n \/\/ top\/vertical mount screws (to extrusion)\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n translate([0, i*mount_screw_dist\/2, 0])\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n\n \/\/ mount screws for pulley block\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n \/\/ front\/horizontal mount screws (to extrusion)\n for(i=[-1,1])\n translate([0, i*(yaxis_idler_mount_thread_dia*2.5), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=[-1,0,0], align=[-1,0,0]); \n }\n }\n }\n}\n\nyaxis_idler_tightscrew_dist = 10*mm;\nyaxis_idler_pulley_nut = MHexNutM5;\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_idler_pulley_outer_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*cylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=[1,0,0], align=[1,0,0]); \n }\n }\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"use \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = 2*yaxis_idler_pulley_inner_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut = MHexNutM4;\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, yaxis_idler_mount_tightscrew_hexnut);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, yaxis_idler_mount_tightscrew_hexnut);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.5;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n cylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n }\n }\n\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n {\n translate([0, i*mount_screw_dist\/2, 0])\n {\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=[-1,0,0], align=[-1,0,0]); \n }\n }\n }\n}\n\nyaxis_idler_tightscrew_dist = 10*mm;\nyaxis_idler_pulley_nut = MHexNutM5;\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_idler_pulley_outer_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*cylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n rcubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n cylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=[1,0,0], align=[1,0,0]); \n }\n }\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"913c3ec0195324d4cb5027d207a934db92bab5c3","subject":"This is a move refactor.","message":"This is a move refactor.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/star-trek\/logo\/basic\/star-trek-logo-test.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/star-trek\/logo\/basic\/star-trek-logo-test.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"8b25a9968ee0df7f2d435b50e9a6a75ef39657c4","subject":"A color was added to the shape.","message":"A color was added to the shape.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube\/examples\/a\/rounded-cube-basic.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/basics\/rounded-edges\/rounded-cube\/examples\/a\/rounded-cube-basic.scad","new_contents":"\r\nuse <..\/..\/rounded-cube.scad>\r\n\r\nboardLength = 150;\r\nboardWidth = 100;\r\nsize = [boardLength, boardWidth, 1];\r\n\r\nroundedCube(size=[boardLength, boardWidth, 1],\r\n sides=5,\r\n sides=20);\r\n\r\ncolor(\"green\")\r\ntranslate([0, 130, 0])\r\nroundedCube(cornerRadius = 5,\r\n sides=20,\r\n sidesOnly=true,\r\n size=size);\r\n","old_contents":"\r\nuse <..\/..\/rounded-cube.scad>\r\n\r\nboardLength = 150;\r\nboardWidth = 100;\r\nsize = [boardLength, boardWidth, 1];\r\n\r\nroundedCube(size=[boardLength, boardWidth, 1],\r\n sides=5,\r\n sides=20);\r\n\r\ntranslate([0, 130, 0])\r\nroundedCube(cornerRadius = 5,\r\n sides=20,\r\n sidesOnly=true,\r\n size=size);\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"4fc54a92db0b25febe0e0aa566d55add54a8b95e","subject":"not neede really...","message":"not neede really...\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"navibot_sr8980_docking_station_walls\/all.scad","new_file":"navibot_sr8980_docking_station_walls\/all.scad","new_contents":"","old_contents":"use \nuse \n\nleftWall();\ntranslate([85, 0, 0])\n rightWall();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c91a210aecb744ddf830c52bee050cbc1b5e29a7","subject":"modified openscad","message":"modified openscad\n","repos":"luoyi\/RpiPlayer","old_file":"RpiPlayer.scad","new_file":"RpiPlayer.scad","new_contents":"$fn=100;\n\nout_x=64;\nout_y=40;\nall_z=36;\nall_r=4;\n\nall_y = out_y+2*all_r;\nall_x = out_x+2*all_r;\n\nhdmi_look_x = 12;\nhdmi_look_y = 6;\n\nusb_look_x = 6;\nusb_look_y = 3;\n\nside_look_x = 30;\nside_look_y = 15;\n\nhdmi_x_pos = 5;\nhdmi_y_pos = 1;\nhdmi_z_pos = 5;\n\nusb_x_pos = -15;\nusb_z_pos = 5;\n\nuart_x=10;\nuart_y=8;\nuart_z=2;\n \nuart_x_pos = 10;\nuart_z_pos = 20;\n\n\nlr_width=3;\nf_width=3;\nb_width=10;\nbottom_h=3;\n\ngb_x=out_x-2*all_r;\ngb_sx=1;\ngb_mw=2;\ngb_sy=6;\n\ntop_z=bottom_h;\n\n\n\n\nmodule round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\nmodule gong_bang(all_x, side_x, mid_w, side_y, h) {\n cube([all_x, mid_w, h], center=true);\n translate([(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, side_y\/2,0])\n cylinder(r=side_x, h=h, center=true);\n translate([-(all_x-side_x)\/2, -side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n translate([(all_x-side_x)\/2, -side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n translate([(all_x-side_x)\/2, side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n}\n\n\nshrink=0.1;\nmodule gong_bang_shrink(all_x, side_x, mid_w, side_y, h) {\n gong_bang(all_x-shrink, side_x-shrink, mid_w-shrink, \n side_y-shrink, h);\n}","old_contents":"$fn=100;\nmodule round_cube(size_x, size_y, size_z, r) {\nunion() {\ncube([size_x + 2*r, size_y, size_z], center=true);\ncube([size_x , size_y + 2*r, size_z], center=true);\ntranslate([-size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, -size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\ntranslate([-size_x\/2, size_y\/2, 0]) cylinder(h=size_z, r=r, center=true);\n}\n\n}\n\nmodule gong_bang(all_x, side_x, mid_w, side_y, h) {\n cube([all_x, mid_w, h], center=true);\n translate([(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, 0,0]) cube([side_x, side_y, h], center=true);\n translate([-(all_x-side_x)\/2, side_y\/2,0])\n cylinder(r=side_x, h=h, center=true);\n translate([-(all_x-side_x)\/2, -side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n translate([(all_x-side_x)\/2, -side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n translate([(all_x-side_x)\/2, side_y\/2,0])\n cylinder(r=side_x, h=h, center=true); \n}\n\n\nshrink=0.1;\nmodule gong_bang_shrink(all_x, side_x, mid_w, side_y, h) {\n gong_bang(all_x-shrink, side_x-shrink, mid_w-shrink, \n side_y-shrink, h);\n}\n\n\/\/gong_bang(80, 2, 2, 10, 40);\n\n\n\nout_x=46;\nout_y=26;\nall_z=20;\nall_r=4;\n\nlr_width=3;\nf_width=3;\nb_width=10;\nbottom_h=3;\n\ngb_x=out_x-2*all_r;\ngb_sx=1;\ngb_mw=2;\ngb_sy=6;\n\ntop_z=bottom_h;\n\n\n\n\ndifference () {\nround_cube(out_x,out_y,all_z,all_r); \ntranslate([0,(f_width-b_width)\/2,bottom_h]) round_cube(out_x-2*lr_width,out_y-f_width-b_width,all_z,all_r);\ncolor([1,0,0]) \ntranslate([0, (out_y - b_width)\/2 + all_r, 2])\ngong_bang(gb_x, gb_sx, gb_mw, gb_sy, all_z);\ntranslate([0, out_y\/2, bottom_h]) \n cube([gb_x-gb_sx-4, out_y, all_z], center=true);\n}\n\n\n\/\/union() {\n\/\/round_cube(out_x,out_y,top_z,bottom_h); \ntranslate([-100, 0,all_z])\nunion() {\nround_cube(out_x,out_y,bottom_h,all_r); \n translate([0,0,bottom_h])\n difference() {\ncolor([1,0,0]) \ntranslate([0,(f_width-b_width)\/2,0]) round_cube(out_x-2*lr_width,out_y-f_width-b_width,bottom_h,all_r); \ntranslate([0,(f_width-b_width)\/2,1]) round_cube(out_x-4*lr_width,out_y-f_width-b_width-4,bottom_h,all_r); }\ncolor([0,0,1])\ntranslate([0, (out_y - b_width)\/2 + all_r, all_z\/2-1])\ngong_bang(gb_x, gb_sx, gb_mw, gb_sy, all_z);\n\/\/color([0,1,0]) \n\/\/translate([0,(f_width-b_width)\/2,-(top_z)]) round_cube(out_x-4*lr_width,out_y-f_width-b_width-10,bottom_h+1,all_r); \n }\n\/\/}\n\n\n","returncode":0,"stderr":"","license":"artistic-2.0","lang":"OpenSCAD"} {"commit":"23cd97f7d9beba77e1f54bc7e4b970f473d7fafb","subject":"screws\/screw_cut: fix screw preview\/vit (respect head_embed)","message":"screws\/screw_cut: fix screw preview\/vit (respect head_embed)\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"24395720ea162465db3b7f01b16526b8015e54e1","subject":"top of the tower is bigger, to avoid issues with small layers w\/o cooling","message":"top of the tower is bigger, to avoid issues with small layers w\/o cooling\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_printer_oozing_testing\/oozing_test.scad","new_file":"3d_printer_oozing_testing\/oozing_test.scad","new_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n \nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r1=5\/2, r2=2\/2, h=20);\n","old_contents":"$fn=20;\n\ntranslate([-5, -5, 0])\n cube([15+2*5, 10, 0.2]);\n \nfor(i=[0:1])\n translate(i*[15, 0, 0])\n cylinder(r1=5\/2, r2=1\/2, h=20);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"edb033add4b6e5cd4e571c17f418b14ae0bef3b2","subject":"cross must be a bit bigger in order to print correctly...","message":"cross must be a bit bigger in order to print correctly...\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"center_print_test\/center.scad","new_file":"center_print_test\/center.scad","new_contents":"cube([40,2,1], center=true);\nrotate([0,0,90])\n cube([40,2,1], center=true);\n","old_contents":"cube([10,1,1], center=true);\nrotate([0,0,90])\n cube([10,1,1], center=true);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e40d3b83a20cd6b709b7af805abb7edcd1729f52","subject":"holder is now simpler and a bit wider","message":"holder is now simpler and a bit wider\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"braun_oral_b_brush_holder\/brush_holder.scad","new_file":"braun_oral_b_brush_holder\/brush_holder.scad","new_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([0, 7, size[2]-6])\n cube([size[0], size[1]-7, 6]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [4,25,18]);\nholder([-20\/2-1,-1,2], [4,25,18]);\n","old_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n difference()\n {\n cube(size);\n translate([0,7.5,0])\n cube([size[0],size[1]-7.5,size[2]-7.5]);\n }\n translate([size[0],0,size[2]-(7.5-3.5)])\n cube([3-2,size[1],7.5-3.5]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [2,19,23.5]);\nholder([-20\/2-1,-1,2], [2,19,23.5]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a0e8d4d13f2bfb515d22afc07df43dfb2e75766b","subject":"Refine circle quadrants constants","message":"Refine circle quadrants constants\n","repos":"jsconan\/camelSCAD","old_file":"core\/constants.scad","new_file":"core\/constants.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = RIGHT;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = STRAIGHT;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = DEGREES - RIGHT;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = DEGREES;\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = 90;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = 180;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = 270;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = 360;\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d6434ea4060960aa8401901054f9fd663dd7a704","subject":"removed deprecated function","message":"removed deprecated function\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"braun_oral_b_brush_holder\/brush_holder.scad","new_file":"braun_oral_b_brush_holder\/brush_holder.scad","new_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n translate([size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]])\n sphere(size[2]);\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n translate([size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]])\n sphere(size[2]);\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([0, 7, size[2]-6])\n cube([size[0], size[1]-7, 6]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [3,25,18]);\nholder([-20\/2-1,-1,2], [3,25,18]);\n","old_contents":"\/*\n * Brown Orla-B brush holder (wall-attached).\n *\/\n$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n assign( off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]] )\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([0, 7, size[2]-6])\n cube([size[0], size[1]-7, 6]);\n }\n}\n\n\nwall([0,0,0], [36,50,2]);\nplane([0,16.5,50\/2-2], [36-2*2,29,2]);\nholder([20\/2-1,-1,2], [3,25,18]);\nholder([-20\/2-1,-1,2], [3,25,18]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0aff8f3490be9667cbbe71663be2d57a7df6165c","subject":"main: render belts in preview_mode","message":"main: render belts in preview_mode\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1* axis_range_x_,-1*axis_range_x_+x_carriage_w];\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1* axis_range_x_,-1*axis_range_x_+x_carriage_w];\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!$preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"338a524d8a785525207c171151f2317495d61e22","subject":"Disable debug chop","message":"Disable debug chop\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/MarbleCaster.scad","new_file":"hardware\/printedparts\/MarbleCaster.scad","new_contents":"module MarbleCaster_STL () {\n\tod = connector_bore(MarbleCaster_Con_Default) - 0.5; \/\/ include some tolerance!\n\tfod = od + 5;\n\tballr = 16\/2;\n\n\tplateThickness = connector_thickness(MarbleCaster_Con_Default);\n\n\tballtol = 0.5;\n\n\t$fn=64;\n\n\tprintedPart(\"printedparts\/MarbleCaster.scad\", \"Caster Housing\", \"MarbleCaster_STL()\") {\n\n\t view(t=[1.4, 0.8, -5.6], r=[63, 0, 114], d=172);\n\n color(Level2PlasticColor)\n if (UseSTL) {\n import(str(STLPath, \"CasterHousing.stl\"));\n } else {\n \/\/render() \/\/ pre-render for speed\n difference() {\n union() {\n \/\/ push fitting core\n *cylinder(r=od\/2, h=plateThickness+eta);\n\n \/\/ push fitting upper taper\n *translate([0, 0, plateThickness + 1])\n cylinder(r1=od\/2 + 0.5, r2=od\/2 - 1, h= dw + 1);\n\n \/\/ push fitting lower taper\n *translate([0, 0, plateThickness])\n cylinder(r1=od\/2, r2=od\/2 + 0.5, h=1 + eta);\n\n\n \/\/flange\n translate([0, 0, -2])\n cylinder(r=fod\/2, h=2 + eta);\n\n \/\/ tapered joint between ball casing and flange\n translate([0, 0, -GroundClearance + ballr])\n cylinder(r1=ballr + dw, r2=fod\/2, h=GroundClearance - ballr + eta);\n\n \/\/ ball casing\n translate([0, 0, -GroundClearance + ballr])\n sphere(r=ballr + dw);\n\n }\n\n \/\/ slit the push fitting\n *for (i=[0,1])\n rotate([0,0, i*90])\n translate([-ballr, -1, eta])\n cube([2*ballr, 2, 100]);\n\n \/\/ chop the bottom off\n translate([-50, -50, -100 - GroundClearance + ballr\/2])\n cube([100, 100, 100]);\n\n \/\/ hollow the casing for the ball - allow some tolerance\n translate([0,0, -GroundClearance + ballr])\n sphere(ballr + balltol);\n\n \/\/ taper the interior to allow for easier printing\n *translate([0, 0, -GroundClearance + ballr])\n cylinder(r1=ballr, r2=1, h= GroundClearance - ballr + plateThickness + dw + 2, $fn=32);\n\n\t\t\t\t\t\/\/ hollow for pin\n\t\t\t\t\tcylinder(r=7\/2, h=100, center=true);\n\t\t\t\t\ttranslate([0,0,-10 - plateThickness])\n\t\t\t\t\t\tcylinder(r=7\/2 + 1.5, h=10);\n\n \/\/ cut a curve into the ball casing to allow flex for the marble to be inserted\n \/\/ and so it looks pretty :)\n translate([0, 0, -GroundClearance + ballr\/2])\n rotate([0, 90, 0])\n scale([1, 0.7, 1])\n cylinder(r=ballr, h=100, center=true, $fn=32);\n\n \/\/ chop it in half for debugging\n *translate([0, -50, -50])\n cube([100,100,100]);\n }\n }\n }\n}\n","old_contents":"module MarbleCaster_STL () {\n\tod = connector_bore(MarbleCaster_Con_Default) - 0.5; \/\/ include some tolerance!\n\tfod = od + 5;\n\tballr = 16\/2;\n\n\tplateThickness = connector_thickness(MarbleCaster_Con_Default);\n\n\tballtol = 0.5;\n\n\t$fn=64;\n\n\tprintedPart(\"printedparts\/MarbleCaster.scad\", \"Caster Housing\", \"MarbleCaster_STL()\") {\n\n\t view(t=[1.4, 0.8, -5.6], r=[63, 0, 114], d=172);\n\n color(Level2PlasticColor)\n if (UseSTL) {\n import(str(STLPath, \"CasterHousing.stl\"));\n } else {\n \/\/render() \/\/ pre-render for speed\n difference() {\n union() {\n \/\/ push fitting core\n *cylinder(r=od\/2, h=plateThickness+eta);\n\n \/\/ push fitting upper taper\n *translate([0, 0, plateThickness + 1])\n cylinder(r1=od\/2 + 0.5, r2=od\/2 - 1, h= dw + 1);\n\n \/\/ push fitting lower taper\n *translate([0, 0, plateThickness])\n cylinder(r1=od\/2, r2=od\/2 + 0.5, h=1 + eta);\n\n\n \/\/flange\n translate([0, 0, -2])\n cylinder(r=fod\/2, h=2 + eta);\n\n \/\/ tapered joint between ball casing and flange\n translate([0, 0, -GroundClearance + ballr])\n cylinder(r1=ballr + dw, r2=fod\/2, h=GroundClearance - ballr + eta);\n\n \/\/ ball casing\n translate([0, 0, -GroundClearance + ballr])\n sphere(r=ballr + dw);\n\n }\n\n \/\/ slit the push fitting\n *for (i=[0,1])\n rotate([0,0, i*90])\n translate([-ballr, -1, eta])\n cube([2*ballr, 2, 100]);\n\n \/\/ chop the bottom off\n translate([-50, -50, -100 - GroundClearance + ballr\/2])\n cube([100, 100, 100]);\n\n \/\/ hollow the casing for the ball - allow some tolerance\n translate([0,0, -GroundClearance + ballr])\n sphere(ballr + balltol);\n\n \/\/ taper the interior to allow for easier printing\n *translate([0, 0, -GroundClearance + ballr])\n cylinder(r1=ballr, r2=1, h= GroundClearance - ballr + plateThickness + dw + 2, $fn=32);\n\n\t\t\t\t\t\/\/ hollow for pin\n\t\t\t\t\tcylinder(r=7\/2, h=100, center=true);\n\t\t\t\t\ttranslate([0,0,-10 - plateThickness])\n\t\t\t\t\t\tcylinder(r=7\/2 + 1.5, h=10);\n\n \/\/ cut a curve into the ball casing to allow flex for the marble to be inserted\n \/\/ and so it looks pretty :)\n translate([0, 0, -GroundClearance + ballr\/2])\n rotate([0, 90, 0])\n scale([1, 0.7, 1])\n cylinder(r=ballr, h=100, center=true, $fn=32);\n\n \/\/ chop it in half for debugging\n translate([0, -50, -50])\n cube([100,100,100]);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a07c6c0ee3f7ca1109535ed0f240416f0a272fdb","subject":"widen the shade","message":"widen the shade\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_file":"openscad\/models\/src\/main\/openscad\/lamps\/lamp-shade\/samples\/christmas-story\/full-size\/full-size-chistmas-story-leg-lamp-shade.scad","new_contents":"\nbottomOuterRadius = 52;\n\nintersection_xTranslate = -58;\n\nouterRadius = 90;\n\nsquareLength = 59;\n\ntop_zTranslate = 1;\n\nxScale = 0.2; \n\nyScale = 0.7; \n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ %import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n top_zTranslate = top_zTranslate,\n xScale = xScale,\n yScale = yScale);\n","old_contents":"\nbottomOuterRadius = 52;\n\nintersection_xTranslate = -51;\n\nouterRadius = 90;\n\/\/outerRadius = 36;\n\nsquareLength = 59; \/\/28;\n\ntop_zTranslate = 5;\n\nxScale = 0.2; \/\/ 0.3;\n\nyScale = 0.7; \/\/ 0.7;\n\nuse <..\/christmas-story-lamp-shade.scad>\n\n\/\/translate([-120, 0, 0])\n\/\/ translate([9, 18, 0])\n\/\/ %import(\"\/home\/roberto\/Versioning\/world\/betoland\/household\/lamps\/christmas-story-leg-lamp\/jetpuf\/files\/LegLamp_Shade130.stl\");\n\nlegLampShade(intersection_xTranslate = intersection_xTranslate,\n bottomOuterRadius = bottomOuterRadius,\n outerRadius = outerRadius,\n squareLength = squareLength,\n top_zTranslate = top_zTranslate,\n xScale = xScale,\n yScale = yScale);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ae99feac079dc81c038c3c5abb09a496f2dbab3c","subject":"coding rules","message":"coding rules","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Timin_v2.scad","new_file":"3D-models\/SCAD\/Timin_v2.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=19; \nz=7; \nt=0; \nz2=2.5;\nedge=0.71*y; \ndx=edge*1.41; \n\/\/\u0422\u0438\u043c\u0438\u043d \ndifference() {\nunion() {\ntranslate ([dx\/2, t, 0]) { \n\ncolor() translate ([0, 0, 0]) cube ([x-dx\/2, y, z], center=true); \n\ntranslate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([edge, edge, z], center=true); \n} \ntranslate([24.78, -9.5, -1]) cube([10, 19, 5]);\n}\n\ntranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n#rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(3, 2.65, 2.65);\n\n#rotate([0, 90, 0]) translate([0, 4.5, 31.5]) cylinder(9, 2.65, 2.65);\n\n#rotate([0, 90, 0]) translate([0, -4.5, 31.5]) cylinder(9, 2.65, 2.65);\n\ntranslate([-10, -10.5, 0]) cube([35, 21, 5]);\n}\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10]) cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\nrotate([90, 0, 0]) translate([25.3, 0.5, -9.5]) cylinder(19, 3.5, 3.5);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u043e\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ntranslate([8, -6, 0]) cube([xx, e+2, xx]);\ntranslate([3, -6, 0]) cube([e, xx, xx]);\n\n\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=19; \nz=7; \nt=0; \nz2=2.5;\nedge=0.71*y; \ndx=edge*1.41; \n\/\/\u0422\u0438\u043c\u0438\u043d \ndifference(){\nunion(){\ntranslate ([dx\/2,t,0]) { \n\ncolor() translate ([0,0,0]) cube ([x-dx\/2,y,z], center=true); \n\ntranslate([-25,0,0]) color() rotate ([0,0,45]) cube ([edge,edge,z], center=true); \n} \ntranslate([24.78,-9.5,-1]) cube([10,19,5]);\n}\n\ntranslate([-32,0,0]) cube([21,21,10],center=true);\n\n#rotate([0,90,0]) translate([0,0,-22]) cylinder(3,2.65,2.65);\n\n#rotate([0,90,0]) translate([0,4.5,31.5]) cylinder(9,2.65,2.65);\n\n#rotate([0,90,0]) translate([0,-4.5,31.5]) cylinder(9,2.65,2.65);\n\ntranslate([-10,-10.5,0]) cube([35,21,5]);\n}\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4,-0.25,-10])cube([40,0.5,30])\n\nrotate([90,0,0]) translate([-10.5,0,-9.5]) cylinder(19,3.5,3.5);\n\nrotate([90,0,0]) translate([25.3,0.5,-9.5]) cylinder(19,3.5,3.5);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u043e\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ntranslate([8,-6,0]) cube([xx,e+2,xx]);\ntranslate([3,-6,0]) cube([e,xx,xx]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5cc3c7ff2e44431e0407304d22ad02acf7b86ca9","subject":"x\/carriage\/extruder\/b: fix viewport cut and round it","message":"x\/carriage\/extruder\/b: fix viewport cut and round it\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,0], extra_align=Y-X);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=-Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ mounts\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n {\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n hotmount_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extra_size=[0,100,0], extra_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n %extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extra_size=[0,3*mm,0], extra_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=-Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder(with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n {\n extruder_b(with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n extruder_guidler();\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\nif(false)\n{\n \/*if(false)*\/\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x);\n\n x_carriage_extruder(with_sensormount=x<0);\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ea8494297e11aabfa07a366c9a1678a1ecc5d485","subject":"main: minor cleanup","message":"main: minor cleanup\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n if(!preview_mode)\n {\n belt_path(main_depth-yaxis_motor_offset*2, 6, yaxis_pulley_d, orient=[0,1,0]);\n }\n\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = 0*mm;\naxis_range_z=[85,380];\naxis_pos_z = axis_range_z[1]*mm\/2;\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n belt_path(500, 6, xaxis_pulley_d, orient=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage(show_bearings=true);\n }\n\n if(!preview_mode)\n {\n attach([[12, -30, -30], [1,0,0]], extruder_conn_xcarriage)\n {\n extruder();\n }\n }\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([16,16,-8])\n translate([(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n \/*translate([(xaxis_bearing_distance+xaxis_bearing[2])\/2, xaxis_zaxis_distance_y, 0])*\/\n idler_x_end();\n\n translate([-21,16,-8])\n translate([-(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n motor_x_end();\n }\n\n \/\/ y axis\n attach([[0,main_depth\/2,0], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount();\n\n attach([[0,0,0],[0,0,0]], yaxis_motor_mount_conn_motor)\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n translate([0,0,5*mm])\n fncylindera(d=yaxis_pulley_d, h=10*mm, orient=[0,0,1]);\n }\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n if(!preview_mode)\n {\n belt_path(main_depth-yaxis_motor_offset*2, 6, yaxis_pulley_d, orient=[0,1,0]);\n }\n\n for(i=[-1,1])\n for(j=[-1,1])\n {\n attach([[i*(yaxis_rod_distance\/2),j*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2), 0, 0])\n {\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(j=[-1,1])\n {\n attach([[0,j*(yaxis_rod_distance\/2),0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n ycarriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach([[0,0,0],[0,0,-1]], ycarriage_bearing_mount_conn_bearing)\n {\n \/\/ y axis plate\n cubea(ycarriage_size, align=[0,0,-1]);\n\n translate([0,0,-10*mm])\n cubea(ycarriage_size, align=[0,0,-1]);\n }\n }\n\n \/\/ z axis\n for(i=[-1,1])\n {\n translate([i*(main_width\/2),0,main_height])\n {\n mirror([i==-1?1:0,0,0])\n {\n upper_gantry_zrod_connector();\n\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n\n translate([i*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([i==-1?1:0,0,0])\n {\n zaxis_motor_mount();\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n translate([(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*(lookup(NemaSideSize,zaxis_motor)\/2), 0, 0])\n translate([i*(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n \/\/ z rods\n translate([0,0,zaxis_motor_offset_z-50])\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(j=[-1,1])\n translate([0,0,axis_pos_z-j*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n\n translate([i*zmotor_mount_rod_offset_x, 0, axis_pos_z])\n #fncylindera(h=100, d=zaxis_nut[1], align=[0,0,0]);\n\n translate([i*zaxis_leadscrew_offset_x, 0, axis_pos_z-xaxis_rod_distance\/2-10])\n {\n difference()\n {\n #fncylindera(h=10, d=zaxis_nut[1], align=[0,0,0]);\n union()\n {\n fncylindera(h=10+1, d=zaxis_nut[0], center= false);\n translate([0, 13.5, -1]) fncylindera(h=5, r=1.6);\n translate([0, -13.5, -1]) fncylindera(h=5, r=1.6);\n }\n }\n }\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_w\/2, -psu_d\/2, psu_h\/2])\n {\n psu();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_side();\n\n translate([0, psu_screw_dist_y\/2, 0])\n psu_extrusion_bracket_back();\n }\n }\n}\n\nmodule upper_gantry_zrod_connector()\n{\n upper_width_extra = main_upper_width-main_width;\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ attach to z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,0])\n {\n cubea([gantry_connector_thickness, zmotor_mount_clamp_width, extrusion_size+gantry_connector_thickness], align=[-1,0,1]);\n }\n\n \/\/ connect upper gantry\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size\/2])\n cubea([gantry_connector_thickness,main_upper_dist_y+extrusion_size,extrusion_size], align=[1,0,0], extrasize=[0,0,gantry_connector_thickness], extrasize_align=[0,0,1]);\n }\n\n translate([upper_width_extra\/2, 0, 0])\n translate([0,0,extrusion_size])\n cubea([extrusion_size*1.5,main_upper_dist_y+extrusion_size,gantry_connector_thickness], align=[-1,0,1]);\n\n }\n\n \/\/ cut out z rod mounting clamp nut traps and screw holes\n translate([0,0,extrusion_size\/2])\n translate([upper_width_extra\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([-1, i*zmotor_mount_clamp_dist\/2, 0])\n {\n fncylindera(fn=6, d=zmotor_mount_clamp_nut_dia, h=zmotor_mount_clamp_nut_thick, orient=[1,0,0], align=[1,0,0]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=100, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n\n \/\/ cutout for z rod\n translate([lookup(NemaSideSize,zaxis_motor)\/2, 0, 0])\n translate([(zaxis_rod_screw_distance_x+zmotor_mount_motor_offset),0,extrusion_size])\n fncylindera(d=zaxis_rod_d*1.01, h=extrusion_size*3, align=[0,0,0], orient=[0,0,1]);\n }\n}\n\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-i,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,i,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n }\n }\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-i,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(i=[-1,1])\n translate([i*w\/2,0,0])\n cubea([wallthick,d,h], align=[-i, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(i=[-1,1])\n translate([0,0,i*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -i]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"88ccc4c268398e1cb39be81beb475c296c697624","subject":"misc: add decompose","message":"misc: add decompose\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\ntest_mode = false;\n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) =\n is_num(V) ? V :\n len(V)==1 ? V[0] :\n V;\n\nif(test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nif(test_mode)\n{\n assert_v(v_mul([0,1], [1,2]), [0, 2]);\n assert_v(v_mul([1,1], [1,2]), [1, 2]);\n assert_v(v_mul([1,2], [1,2]), [1, 4]);\n}\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif(test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\nfunction v_filter(vec,val=U) = filter(vec,val);\n\nif(test_mode)\n{\n v=[0,1,2];\n assert_v(filter(v, U), [0,1,2]);\n assert_v(filter(v, 1), [0,2]);\n}\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xz(v) = [v[0],0,v[2]];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev_(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\/\/ support NxN (gives nan)\nfunction v_anglev(u,v) = let(x = v_anglev_(u,v)) is_num(x)?x:0;\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\n\/*function is_string(x) =*\/\n\/*x == U || len(x) == U*\/\n\/*? false \/\/ if U, a boolean or a number*\/\n\/*: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false*\/\n\n\/\/ FUNCTION: is_list(x)\n\/\/ Returns true if x is a list, false otherwise.\n\/*function is_list(x) =*\/\n\/*is_string(x) ? false : len(x) != U;*\/\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_list(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif(test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif(test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif(test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif(test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n\/\/ assert 3-vector with numbers\nmodule assert_v3n(t, message)\n{\n assert(is_list(t), t);\n assert(len(t) == 3, t);\n assert(is_num(t[0]) && is_num(t[1]) && is_num(t[2]), str(message, t));\n}\n\nmodule assert_v(val, expected, message)\n{\n if(is_list(val) && len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n m = str(val, \" != \", expected, \" - \", is_undef(message)?\"\":message);\n assert(val == expected, m);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif(test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif(test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n \/\/ we don't want to iterate over characters in a string,\n \/\/ in the case where col_keys is just one value\/string\n let(ck = concat(col_keys))\n [for(col_key=ck)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n \/\/ we don't want to iterate over characters in a string,\n \/\/ in the case where col_keys is just one value\/string\n let(ck = concat(col_keys))\n [for(col_key=ck)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif(test_mode)\n{\n A = [\n [\"Tx\", \"Ty\", 0],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n assert_v(header_col_index(A, 0), 2);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_list(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif(test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif(test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif(test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n\/\/ nopheads polyhole, holes with size compensation for 3d printing\nfunction polyhole_n(d) = max(round(2 * d), 3);\nfunction polyhole_d(d) = 2*(d \/ 2) \/ cos (180 \/ polyhole_n(d));\n\nfunction decompose(v) = [X*v.x,Y*v.y,Z*v.z];\nif(test_mode)\n{\n vec_a = X+Y+Z;\n assert_v(decompose(vec_a),[X,Y,Z]);\n}\n","old_contents":"include \nuse \nuse \n\ntest_mode = false;\n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) =\n is_num(V) ? V :\n len(V)==1 ? V[0] :\n V;\n\nif(test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nif(test_mode)\n{\n assert_v(v_mul([0,1], [1,2]), [0, 2]);\n assert_v(v_mul([1,1], [1,2]), [1, 2]);\n assert_v(v_mul([1,2], [1,2]), [1, 4]);\n}\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif(test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\nfunction v_filter(vec,val=U) = filter(vec,val);\n\nif(test_mode)\n{\n v=[0,1,2];\n assert_v(filter(v, U), [0,1,2]);\n assert_v(filter(v, 1), [0,2]);\n}\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xz(v) = [v[0],0,v[2]];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev_(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\/\/ support NxN (gives nan)\nfunction v_anglev(u,v) = let(x = v_anglev_(u,v)) is_num(x)?x:0;\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\n\/*function is_string(x) =*\/\n\/*x == U || len(x) == U*\/\n\/*? false \/\/ if U, a boolean or a number*\/\n\/*: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false*\/\n\n\/\/ FUNCTION: is_list(x)\n\/\/ Returns true if x is a list, false otherwise.\n\/*function is_list(x) =*\/\n\/*is_string(x) ? false : len(x) != U;*\/\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_list(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif(test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif(test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif(test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif(test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n\/\/ assert 3-vector with numbers\nmodule assert_v3n(t, message)\n{\n assert(is_list(t), t);\n assert(len(t) == 3, t);\n assert(is_num(t[0]) && is_num(t[1]) && is_num(t[2]), str(message, t));\n}\n\nmodule assert_v(val, expected, message)\n{\n if(is_list(val) && len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n m = str(val, \" != \", expected, \" - \", is_undef(message)?\"\":message);\n assert(val == expected, m);\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif(test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif(test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n \/\/ we don't want to iterate over characters in a string,\n \/\/ in the case where col_keys is just one value\/string\n let(ck = concat(col_keys))\n [for(col_key=ck)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n \/\/ we don't want to iterate over characters in a string,\n \/\/ in the case where col_keys is just one value\/string\n let(ck = concat(col_keys))\n [for(col_key=ck)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif(test_mode)\n{\n A = [\n [\"Tx\", \"Ty\", 0],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n assert_v(header_col_index(A, 0), 2);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_list(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif(test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif(test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif(test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n\/\/ nopheads polyhole, holes with size compensation for 3d printing\nfunction polyhole_n(d) = max(round(2 * d), 3);\nfunction polyhole_d(d) = 2*(d \/ 2) \/ cos (180 \/ polyhole_n(d));\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d2e33733f92a2869699faf4fe2532aa82dd40f58","subject":"Fixed issue with fan_mount.scad","message":"Fixed issue with fan_mount.scad\n","repos":"twstdpear\/i3_parts","old_file":"bg8\/extruder\/fan_mount.scad","new_file":"bg8\/extruder\/fan_mount.scad","new_contents":"\n\nhot_rad = 30\/2\/cos(30);\nhotend_x=25;\nfan_x = 15+5;\n\nhotend_y=-5;\n\nthickness = 10;\nwall=2;\nslop=.2;\n\nfan_hole = (40-wall-wall)\/2;\nmount_drop = 10;\nfan_z = fan_hole+wall;\n\n\/\/fan_mount();\nbowden_fan();\n\n%cylinder(r=hot_rad, h=20, center=true);\n%translate([-23,0,0]) cylinder(r=hot_rad, h=20, center=true);\n\nm3_cap_rad = 4;\nm3_rad = 2;\nm3_nut_rad = 6.01\/2+.1;\n\nfacets = 6;\n\nmodule fan_mount(){\n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n \/\/fan mount\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n hull() for(i=[0:90:359]) rotate([0,0,i]) {\n #translate([20-wall,20-wall,-wall]) cylinder(r=wall,h=wall*2, $fn=16);\n } \n }\n \n \/\/mounting lugs above fan\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/fan holes\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) for(j=[-16, 16]) {\n #translate([j,i,-.1]) cylinder(r=m3_rad, h=wall+.2, $fn=16);\n translate([j,i,-wall*2-.1]) cylinder(r2=m3_nut_rad, r1=m3_nut_rad+.25, h=wall*2+.2, $fn=6);\n }\n }\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n translate([0,-5+hotend_y\/2,0])cube([100,10,wall]);\n }\n }\n}\n\nduct_angle=-5;\nduct_jut = -5;\n\nmodule bowden_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=40;\n \n mount_height = 46;\n \n offset = -20;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[0,-30,-50]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([16,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule duct(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 90, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n }\n \n translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n #translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n \n}\n\n","old_contents":"\n\nhot_rad = 30\/2\/cos(30);\nhotend_x=25;\nfan_x = 15+5;\n\nhotend_y=-5;\n\nthickness = 10;\nwall=2;\nslop=.2;\n\nfan_hole = (40-wall-wall)\/2;\nmount_drop = 10;\nfan_z = fan_hole+wall;\n\n\/\/fan_mount();\nbowden_fan();\n\n%cylinder(r=hot_rad, h=20, center=true);\n%translate([-23,0,0]) cylinder(r=hot_rad, h=20, center=true);\n\nm3_cap_rad = 4;\nm3_rad = 2;\nm3_nut_rad = 6.01\/2+.1;\n\nfacets = 6;\n\nmodule fan_mount(){\n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n \/\/fan mount\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n hull() for(i=[0:90:359]) rotate([0,0,i]) {\n #translate([20-wall,20-wall,-wall]) cylinder(r=wall,h=wall*2, $fn=16);\n } \n }\n \n \/\/mounting lugs above fan\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/fan holes\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) for(j=[-16, 16]) {\n #translate([j,i,-.1]) cylinder(r=m3_rad, h=wall+.2, $fn=16);\n translate([j,i,-wall*2-.1]) cylinder(r2=m3_nut_rad, r1=m3_nut_rad+.25, h=wall*2+.2, $fn=6);\n }\n }\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n translate([0,-5+hotend_y\/2,0])cube([100,10,wall]);\n }\n }\n}\n\nduct_angle=-5;\nduct_jut = -5;\n\nmodule bowden_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=40;\n \n mount_height = 46;\n \n offset = -20;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[0,-30,-50]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([16,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule duct(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 70, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n }\n \n translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n #translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n \n}\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"8161916a55e76ed8e14c2948fc6ab38d60c578fb","subject":"Updates","message":"Updates\n","repos":"daubers\/Robot","old_file":"base.scad","new_file":"base.scad","new_contents":"include \ninclude \ninclude \n\nrobot_diameter=200; \/\/ diameter of robot in mm\nacrylic_depth=3;\n\nwheel_width=19; \/\/ http:\/\/skpang.co.uk\/catalog\/pololu-wheel-42x19mm-pair-p-463.html\nwheel_diameter=42;\nwheel_w_clearence=5;\nwheel_d_clearence=5;\nwheel_to_mount=6;\n\n\/\/standoffs(MEGA2560, mountType=PIN);\n\/\/holePlacement(boardType=MEGA2560)\n\/\/\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\nmodule WheelWell(h=16){\n\tcube([wheel_width+wheel_w_clearence,wheel_diameter+wheel_d_clearence,h], center=true);\n\ttranslate([wheel_width\/2+wheel_w_clearence\/2+wheel_to_mount,-1*hole_seperation\/2,0]){\n\t\trotate([0,0,90]) mmgb_holes(height=acrylic_depth);\n\t}\n}\n\n\ndifference(){\n\tcylinder(r=robot_diameter\/2, h=acrylic_depth, $fn=100);\n\ttranslate([-1*robot_diameter\/8,-1*(robot_diameter\/2)+10,0]) holePlacement(boardType=MEGA2560)\n\t\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\ttranslate([(robot_diameter\/2)-(robot_diameter\/4\/2),0,0]) rotate([0,0,180]) WheelWell();\n\ttranslate([-1*((robot_diameter\/2)-(robot_diameter\/4\/2)),0,0]) WheelWell();\n\t\n\t\n}\ntranslate([0,0,acrylic_depth]) color([1,0,0]) board_carrier();","old_contents":"include \ninclude \ninclude \n\nrobot_diameter=200; \/\/ diameter of robot in mm\nacrylic_depth=8;\n\nwheel_width=19; \/\/ http:\/\/skpang.co.uk\/catalog\/pololu-wheel-42x19mm-pair-p-463.html\nwheel_diameter=42;\nwheel_w_clearence=5;\nwheel_d_clearence=5;\nwheel_to_mount=6;\n\n\/\/standoffs(MEGA2560, mountType=PIN);\n\/\/holePlacement(boardType=MEGA2560)\n\/\/\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\nmodule WheelWell(h=16){\n\tcube([wheel_width+wheel_w_clearence,wheel_diameter+wheel_d_clearence,h], center=true);\n\ttranslate([0,wheel_diameter+wheel_d_clearence\/2,0]){\n\t\tmmgb_holes(height=acrylic_depth);\n\t}\n}\n\n\ndifference(){\n\tcylinder(r=robot_diameter\/2, h=acrylic_depth, $fn=100);\n\ttranslate([-1*robot_diameter\/8,-1*(robot_diameter\/2)+10,0]) holePlacement(boardType=MEGA2560)\n\t\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\ttranslate([(robot_diameter\/2)-(robot_diameter\/4\/2),0,0]) WheelWell();\n\ttranslate([-1*((robot_diameter\/2)-(robot_diameter\/4\/2)),0,0]) WheelWell();\n\t\n\t\n}\ntranslate([0,0,acrylic_depth]) board_carrier();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d6b857beaae07aa740d87f61fc1a116dc5c9e1b7","subject":"transforms: add t,tx,ty,tz","message":"transforms: add t,tx,ty,tz\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"transforms.scad","new_file":"transforms.scad","new_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\nmodule t(dist)\n{\n translate(dist)\n children();\n}\n\nmodule tx(dist)\n{\n translate(X*dist)\n children();\n}\n\nmodule ty(dist)\n{\n translate(Y*dist)\n children();\n}\n\nmodule tz(dist)\n{\n translate(Z*dist)\n children();\n}\n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","old_contents":"\/*include <..\/scad-utils\/transformations.scad>*\/\ninclude \nuse \n\n\/\/ translate children\nmodule position(positions)\n{\n assert(positions!=U, \"positions==U\");\n for(pos=positions)\n translate(pos)\n children();\n}\n\n\/\/ translate children\nmodule linup(arr=U)\n{\n if($children>0)\n {\n for (i = [0 : $children-1])\n translate(arr[i]) children(i);\n }\n}\n\nmodule stack(dist=10, distances=U, axis=Z)\n{\n if($children>0)\n {\n if(dist == U && distances != U)\n {\n for (i = [0:len(distances)-1])\n {\n offset = v_sum(distances,i);\n translate(axis*offset)\n child(i);\n }\n }\n else if(dist != U && distances == U)\n {\n for (i = [0 : $children-1])\n translate(axis*(dist*i))\n children(i);\n }\n }\n}\n\n\nmodule orient(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n \/*rotate(axis_ref==U?0:_orient_angles(axis_ref))*\/\n \/*multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))*\/\n rotate(axis_ref==U?0:_orient_angles(axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n \/*multmatrix(axis==U?0:v_rotate(90, axis))*\/\n rotate(axis==U?0:_orient_angles(axis))\n children();\n}\n\nmodule orient_(axis=U, axis_ref=U, roll=0, extra_roll, extra_roll_orient)\n{\n rotate(extra_roll_orient==U||extra_roll==U?0:extra_roll*extra_roll_orient)\n\n \/\/ orient to reference axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis_ref))\n\n \/\/ roll around orient axis\n rotate(axis==U?0:roll*axis)\n\n \/\/ orient to axis\n multmatrix(axis_ref==U?0:v_rotate(90, axis))\n children();\n}\n\nfunction _orient_bounds(orient, size) =\n (_rotate_matrix(_orient_angles(orient)) * [size.x,size.y,size.z,1]);\n\nfunction _orient_t(orient, align, size) =\n let(bounds = _orient_bounds(orient, size))\n (hadamard(align, [abs(bounds.x\/2),abs(bounds.y\/2),abs(bounds.z\/2)]));\n\nmodule size_align(size=[10,10,10], extra_size=N, align=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n t = orient==U?N:_orient_t(orient, align, size);\n \/*t_ = orient_ref==U?N:_orient_t(orient_ref, align, size);*\/\n extra_t = (orient==U||extra_size==U)?N:_orient_t(orient, extra_align, extra_size);\n translate(t+extra_t)\n {\n orient(axis=orient, axis_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n {\n children();\n }\n }\n}\n\nmodule hull_pairwise()\n{\n for (i= [1:1:$children-1])\n {\n hull()\n {\n children(i-1);\n children(i);\n }\n }\n}\n\nmodule proj_extrude_axis(axis=Z, h=1, offset=0, cut=false)\n{\n translate(-offset*axis)\n hull()\n {\n orient_(axis=axis, axis_ref=Z)\n {\n linear_extrude(h, center=false)\n projection(cut=cut)\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n\n orient_(axis=Z, axis_ref=axis)\n translate(offset*axis)\n children();\n }\n }\n}\n\nmodule all_axes()\n{\n for($axis=concat(AXES,-AXES))\n {\n $color = v_abs($axis*.3 + v_clamp(v_sign($axis),0,1)*.7);\n children();\n }\n}\n\n\/\/ test proj_extruder_axis\nif(false)\n{\n all_axes()\n color($color)\n translate(5*$axis)\n proj_extrude_axis(axis=$axis)\n translate(20*$axis)\n sphere(d=10);\n}\n\nif(false)\n{\n translate(Y*10)\n proj_extrude_axis(axis=Y, offset=10)\n {\n sphere(d=10);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"afa5288f43789e109d43d9e6196a883d58dc72de","subject":"main: fix y axis belt rotation","message":"main: fix y axis belt rotation\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(YAXIS*90)\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9f14d6a1ac19bac47ce65a195e0fe60a793020f7","subject":"main: add some echoes","message":"main: add some echoes\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(YAXIS*90)\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\/*include ;*\/\n\n\/*include *\/\n\/*include *\/\n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \nuse \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n rotate(YAXIS*90)\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],ZAXIS],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-80*mm])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if($preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"74df219ad19d72e7e3d7a3bd37d63cfad6a90154","subject":"main: Add render statements (for perf)","message":"main: Add render statements (for perf)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[1]\/2-30*mm;\naxis_range_z=[-20+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2 - .5*mm;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[1]\/2-30*mm;\naxis_range_z=[-20+26*mm+hotend_height,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(show_vitamins=true);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount(show_motor=true);\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n translate([0,0,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],Z])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n material(Mat_PrintCarriage)\n {\n \/\/ y axis carriage plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n\n \/\/ y axis carriage plate\n hull()\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n material(Mat_PrintBed)\n translate([0,0,10*mm])\n cubea(printbed_size, align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n\n tx(x*(main_width\/2))\n {\n tz(zaxis_motor_offset_z)\n mirror([x==-1?1:0,0,0])\n {\n zaxis_motor_mount(show_motor=true);\n\n tx(zmotor_mount_rod_offset_x)\n tz(zmotor_mount_thickness_h\/2)\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n\n \/\/ z smooth rods\n tx(x*(zmotor_mount_rod_offset_x))\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_height, align=[-x,0,1], orient=Z);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n translate([x*(main_width\/2),0,main_height])\n mirror([x==-1?1:0,0,0])\n gantry_upper_connector();\n\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"01c1e5a75280f8ffc9ef6b6627112858ae44072c","subject":"fan_axial: bugfix","message":"fan_axial: bugfix\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"fan_axial.scad","new_file":"fan_axial.scad","new_contents":"\/\/ Remixed from MiseryBot's original work: http:\/\/www.thingiverse.com\/thing:8063\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule fan_axial(width, depth, mount_dist, thread, head_embed=true, corner_radius=3, blade_angle=-45, bore_dia_walls=1.5, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n bore_diameter = width - bore_dia_walls;\n s = [width, width, depth];\n difference()\n {\n union()\n {\n roundedBox(size=s, radius=corner_radius, sidesonly=true);\n }\n\n difference()\n {\n cylindera(d=bore_diameter, h=depth+.2, orient=Z);\n cylindera(d=bore_diameter\/2 + 2*mm, h=depth+.2, orient=Z);\n }\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=depth, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n fan_axial_blades(width=bore_diameter, depth=depth, angle=blade_angle);\n }\n}\n\n\nmodule fan_axial_cut(width, depth, tolerance=.3*mm, mount_dist, screw_l, thread, head_embed=true, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n cubea(size=s, extrasize=[tolerance,tolerance,tolerance]);\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=screw_l, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n}\n\nmodule body(width, depth, bore_diameter, mount_dist, corner_radius, thread)\n{\n\n}\n\nmodule fan_axial_blades(width, depth, angle)\n{\n linear_extrude(height=depth-1, center = true, convexity = 4, twist = angle)\n {\n for(i=[0:6])\n rotate((360*i)\/7)\n translate([0,-1.5\/2]) square([width\/2-0.75,1.5]);\n }\n}\n\n\nif(false)\n{\n fan_axial(width=40*mm, depth=10.5*mm, mount_dist=32*mm, thread=ThreadM3, orient=Y, align=N);\n %fan_axial_cut(width=40*mm, depth=10.5*mm, mount_dist=32*mm, screw_l=25*mm, thread=ThreadM3, orient=Y, align=N);\n}\n","old_contents":"\/\/ Remixed from MiseryBot's original work: http:\/\/www.thingiverse.com\/thing:8063\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule fan_axial(width, depth, mount_dist, thread, head_embed=true, corner_radius=3, blade_angle=-45, bore_dia_walls=1.5, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n bore_diameter = width - bore_dia_walls;\n s = [width, width, depth];\n difference()\n {\n union()\n {\n roundedBox(size=s, radius=corner_radius, sidesonly=true);\n }\n\n difference()\n {\n cylindera(d=bore_diameter, h=depth+.2, orient=Z);\n cylindera(d=bore_diameter\/2 + 2*mm, h=depth+.2, orient=Z);\n }\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=depth, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n fan_axial_blades(width=bore_diameter, depth=depth, blade_angle=blade_angle);\n }\n}\n\n\nmodule fan_axial_cut(width, depth, tolerance=.3*mm, mount_dist, screw_l, thread, head_embed=true, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n cubea(size=s, extrasize=[tolerance,tolerance,tolerance]);\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=screw_l, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n}\n\nmodule body(width, depth, bore_diameter, mount_dist, corner_radius, thread)\n{\n\n}\n\nmodule fan_axial_blades(width, depth, angle)\n{\n linear_extrude(height=depth-1, center = true, convexity = 4, twist = angle)\n {\n for(i=[0:6])\n rotate((360*i)\/7)\n translate([0,-1.5\/2]) square([width\/2-0.75,1.5]);\n }\n}\n\n\nif(false)\n{\n fan_axial(width=40*mm, depth=10.5*mm, mount_dist=32*mm, thread=ThreadM3, orient=Y, align=N);\n %fan_axial_cut(width=40*mm, depth=10.5*mm, mount_dist=32*mm, screw_l=25*mm, thread=ThreadM3, orient=Y, align=N);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0472a2b6de62b707349eb3dcff1ade678d9a4f8a","subject":"x\/carriage: proj belt_fastener against Y","message":"x\/carriage: proj belt_fastener against Y\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], N];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ bearing mount top\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount top cutout\n hull()\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=Y);\n }\n }\n\n\n \/\/ bearing mount bottom\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount bottom cutout\n hull()\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=X);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=X);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, Z];\nhotend_conn = [[0,21.3,0], Y];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, Y];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, X];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], N];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ bearing mount top\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount top cutout\n hull()\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=Y);\n }\n }\n\n\n \/\/ bearing mount bottom\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X);\n }\n }\n\n \/\/ bearing mount bottom cutout\n hull()\n for(x=[-1,1])\n {\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=X);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=X);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, Z];\nhotend_conn = [[0,21.3,0], Y];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, Y];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, X];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"013332bb648a7696337776088f50ab58e3b656b5","subject":"Display segment scad file","message":"Display segment scad file\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/segment.scad","new_file":"models\/segment.scad","new_contents":"radius = 18;\nheight = 30;\nlength = 70;\nwall = 2;\n\n$fn=100;\n\nmodule post() {\n difference() {\n cylinder(r=4, h=height-wall);\n cylinder(r=1.5, h=4);\n }\n}\n\n\ndifference() {\n hull() {\n cylinder(r=radius, h=height);\n\n translate([0, length, 0])\n cylinder(r=radius, h=height);\n }\n\n hull() {\n translate(0, wall, 0)\n cylinder(r=radius-wall, h=height-wall);\n\n translate([0, length, 0])\n cylinder(r=radius-wall, h=height-wall);\n }\n}\n\ntranslate([0, -(radius+wall)\/2-2*wall, 0])\npost();\n\ntranslate([0, length + ((radius+wall)\/2+2*wall), 0])\npost();","old_contents":"","returncode":1,"stderr":"error: pathspec 'models\/segment.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"56b1399442568a9ccbb96d79c8154807950e5fb6","subject":"misc: add v_z","message":"misc: add v_z\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n","old_contents":"use \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=undef,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==undef?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\n\/\/ echo(fallback(undef,1));\nfunction fallback(a, b) = a==undef?b:a;\n\n\/\/ echo(fallback(undef,[undef, 1]));\nfunction v_fallback(a,v,i=0) = (a!=undef || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"cb95a2c5c8cde2498131e9c98f84751fe17fee49","subject":"misc: add clamp,v_max,v_min,v_clamp","message":"misc: add clamp,v_max,v_min,v_clamp\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n","old_contents":"use \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\nfunction vec_add(vec,v) = [for(vv=vec) vv+v];\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=undef,start=0) = \nlet(e_= e==undef ? len(v)-1 : e)\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0) = [for(i=[start:1:len(v)-1]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=undef) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec)); \n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == undef || len(x) == undef\n\t\t? false \/\/ if undef, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != undef;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, [1,0,0]) * [1, 0, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 1, 0]);*\/\n \/*echo(rotate(90, [1,0,0]) * [0, 0, 1]);*\/\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"5de596799f82722c4c9a4f0896fcd51c1f66b683","subject":"Add simplePolyhedron shape","message":"Add simplePolyhedron shape\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/polyhedron.scad","new_file":"shape\/3D\/polyhedron.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polyhedron shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a box.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBox(size, l, w, h) =\n let(\n size = apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2])\n ]\n;\n\n\/**\n * Computes the size of a chamfered box.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[] - Returns an array containing the size vector and the chamfer vector.\n *\/\nfunction sizeChamferedBox(size, chamfer, l, w, h, cl, cw) =\n let(\n s = apply3D(size, l, w, h),\n c = apply2D(chamfer, cl, cw),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n chamfer = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, chamfer[0] && chamfer[1] ? chamfer : [0, 0] ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @returns Vector - Returns the size vector, as [a, b, w, h].\n *\/\nfunction sizeTrapeziumBox(size, a, b, w, h) =\n let(\n h = uor(h, isNumber(size) ? size : size[3]),\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n divisor(h)\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, h, n].\n *\/\nfunction sizeRegularPolygonBox(size, n, l, w, h, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector3D(2 * divisor(s) \/ (2 * sin(STRAIGHT \/ n)))\n : apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStarBox(size, core, edges, l, w, h, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? vector2D(size) * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Creates a box at the origin.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule box(size, l, w, h, center) {\n size = sizeBox(size=size, l=l, w=w, h=h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n rectangle(size);\n }\n}\n\n\/**\n * Creates a chamfered box at the origin.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule chamferedBox(size, chamfer, l, w, h, cl, cw, center) {\n size = sizeBox(size=size, chamfer=chamfer, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[2], center=center, convexity=10) {\n chamferedRectangle(size, chamfer);\n }\n}\n\n\/**\n * Creates a trapezium box at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule trapeziumBox(size, a, b, w, h, center) {\n size = sizeTrapeziumBox(size=size, a=a, b=b, w=w, h=h);\n linear_extrude(height=size[3], center=center, convexity=10) {\n trapezium(size);\n }\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularPolygonBox(size, n, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=n, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n regularPolygon(size, size[3]);\n }\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule hexagonBox(size, pointy, adjust, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=6, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n hexagon(size=size, pointy=pointy, adjust=adjust);\n }\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width\n * @param Number [h] - The overall height..\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule starBox(size, core, edges, l, w, h, cl, cw, center) {\n size = sizeStarBox(size=size, core=core, edges=edges, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n star(size[0], size[1], size[2]);\n }\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule meshBox(size, count, gap, pointy, linear, even, l, w, h, cx, cy, gx, gy, center) {\n size = apply3D(size, l, w, h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n mesh(size=size, count=count, gap=gap, pointy=pointy, linear=linear, even=even, cx=cx, cy=cy, gx=gx, gy=gy);\n }\n}\n\n\/**\n * Creates a simple polyhedron, where only two opposite faces are defined by a\n * list of points. Several possibilities are available:\n * - provides the points for one face, then set a distance for the opposite face\n * - provides the points for two opposite faces\n * - provides the points for two opposite faces, then set a distance between them\n *\n * Note: both faces should have the same number of points.\n *\n * @param Vector[] [bottom] - The list of points for the bottom face.\n * @param Vector[] [top] - The list of points for the top face.\n * @param Vector[] [points] - The list of points for a main face.\n * @param Vector [distane] - The distance between two main faces.\n * @param Number [x] - The distance between two main faces on the X-axis.\n * @param Number [y] - The distance between two main faces on the Y-axis.\n * @param Number [z] - The distance between two main faces on the Z-axis.\n * @returns Vector[]\n *\/\nmodule simplePolyhedron(bottom, top, points, distance, x, y, z) {\n points = simplePolyhedronPoints(bottom=bottom, top=top, points=points, distance=distance, x=x, y=y, z=z);\n polyhedron(\n points = points,\n faces = simplePolyhedronFaces(len(points) \/ 2),\n convexity = 10\n );\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Polyhedron shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a box.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @returns Vector - Returns the size vector.\n *\/\nfunction sizeBox(size, l, w, h) =\n let(\n size = apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2])\n ]\n;\n\n\/**\n * Computes the size of a chamfered box.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @returns Vector[] - Returns an array containing the size vector and the chamfer vector.\n *\/\nfunction sizeChamferedBox(size, chamfer, l, w, h, cl, cw) =\n let(\n s = apply3D(size, l, w, h),\n c = apply2D(chamfer, cl, cw),\n size = [\n divisor(s[0] ? s[0] : c[0] * 2),\n divisor(s[1] ? s[1] : c[1] * 2),\n divisor(s[2])\n ],\n chamfer = [\n min(size[0] \/ 2, c[0]),\n min(size[1] \/ 2, c[1])\n ]\n )\n [ size, chamfer[0] && chamfer[1] ? chamfer : [0, 0] ]\n;\n\n\/**\n * Computes the size of a trapezium shape.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @returns Vector - Returns the size vector, as [a, b, w, h].\n *\/\nfunction sizeTrapeziumBox(size, a, b, w, h) =\n let(\n h = uor(h, isNumber(size) ? size : size[3]),\n size = apply3D(size, a, b, w)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n divisor(h)\n ]\n;\n\n\/**\n * Computes the size of a regular polygon.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [s] - The length of a side.\n * @returns Vector - Returns the size vector, as [l, w, h, n].\n *\/\nfunction sizeRegularPolygonBox(size, n, l, w, h, s) =\n let(\n n = max(3, float(n)),\n size = (s && !size && !l && !w) ? vector3D(2 * divisor(s) \/ (2 * sin(STRAIGHT \/ n)))\n : apply3D(size, l, w, h)\n )\n [\n divisor(size[0]),\n divisor(size[1]),\n divisor(size[2]),\n n\n ]\n;\n\n\/**\n * Computes the size of a star shape.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The height of the box.\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @returns Vector[] - Returns two vectors containing the outer and core size of the star\n *\/\nfunction sizeStarBox(size, core, edges, l, w, h, cl, cw) =\n let(\n edges = max(3, float(edges)),\n size = divisor3D(apply3D(size, l, w, h)),\n core = apply2D(core, cl, cw)\n )\n [\n size,\n core == [0, 0] ? vector2D(size) * or(1 - 3 \/ edges, 0.2) : core,\n edges\n ]\n;\n\n\/**\n * Creates a box at the origin.\n *\n * @param Number|Vector [size] - The size of the box.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule box(size, l, w, h, center) {\n size = sizeBox(size=size, l=l, w=w, h=h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n rectangle(size);\n }\n}\n\n\/**\n * Creates a chamfered box at the origin.\n *\n * @param Number|Vector [size] - The size of the chamfered box.\n * @param Number|Vector [chamfer] - The size of the chamfers.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cl] - The length of the chamfers.\n * @param Number [cw] - The width of the chamfers.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule chamferedBox(size, chamfer, l, w, h, cl, cw, center) {\n size = sizeBox(size=size, chamfer=chamfer, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[2], center=center, convexity=10) {\n chamferedRectangle(size, chamfer);\n }\n}\n\n\/**\n * Creates a trapezium box at the origin.\n *\n * @param Number|Vector [size] - The size of the trapezium.\n * @param Number [a] - The length of the bottom base.\n * @param Number [b] - The length of the top base.\n * @param Number [w] - The width between bases.\n * @param Number [h] - The height of the box.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule trapeziumBox(size, a, b, w, h, center) {\n size = sizeTrapeziumBox(size=size, a=a, b=b, w=w, h=h);\n linear_extrude(height=size[3], center=center, convexity=10) {\n trapezium(size);\n }\n}\n\n\/**\n * Creates a regular polygon at the origin.\n *\n * @param Number|Vector [size] - The size of the polygon.\n * @param Number [n] - The number of facets (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule regularPolygonBox(size, n, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=n, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n regularPolygon(size, size[3]);\n }\n}\n\n\/**\n * Creates an hexagon at the origin.\n *\n * @param Number|Vector [size] - The size of the hexagon.\n * @param Boolean [pointy] - Tells if the hexagon must be pointy topped (default: false, Flat topped).\n * @param Number [adjust] - An adjust length added on the horizontal side.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [s] - The length of a side.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule hexagonBox(size, pointy, adjust, l, w, h, s, center) {\n size = sizeRegularPolygonBox(size=size, n=6, l=l, w=w, h=h, s=s);\n linear_extrude(height=size[2], center=center, convexity=10) {\n hexagon(size=size, pointy=pointy, adjust=adjust);\n }\n}\n\n\/**\n * Creates a star at the origin.\n *\n * @param Number|Vector [size] - The outer size of the star.\n * @param Number|Vector [core] - The size of the core.\n * @param Number [edges] - The number of star edges (min. 3).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width\n * @param Number [h] - The overall height..\n * @param Number [cl] - The core length.\n * @param Number [cw] - The core width.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule starBox(size, core, edges, l, w, h, cl, cw, center) {\n size = sizeStarBox(size=size, core=core, edges=edges, l=l, w=w, h=h, cl=cl, cw=cw);\n linear_extrude(height=size[0][2], center=center, convexity=10) {\n star(size[0], size[1], size[2]);\n }\n}\n\n\/**\n * Creates a mesh with honeycomb cells using a hex grid pattern.\n *\n * @param Number|Vector [size] - The outer size of the mesh.\n * @param Number|Vector [count] - The number of cells on each lines and each columns.\n * @param Number|Vector [gap] - The space between two cells.\n * @param Boolean [pointy] - Tells if the hexagons in the mesh are pointy topped (default: false, Flat topped).\n * @param Boolean [linear] - Tells if the hex grid is linear instead of radial (default: false).\n * @param Boolean [even] - Tells if the first hexagons of a the linear grid should be below the line (default: false).\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [cx] - The number of cells per lines.\n * @param Number [cy] - The number of cells per columns.\n * @param Number [gx] - The space between two cells on each lines.\n * @param Number [gy] - The space between two cells on each columns.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule meshBox(size, count, gap, pointy, linear, even, l, w, h, cx, cy, gx, gy, center) {\n size = apply3D(size, l, w, h);\n linear_extrude(height=size[2], center=center, convexity=10) {\n mesh(size=size, count=count, gap=gap, pointy=pointy, linear=linear, even=even, cx=cx, cy=cy, gx=gx, gy=gy);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fce9c338689a952b5fb8b2a3ae88f0f9a8d57f9b","subject":"Update tmp\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","message":"Update tmp\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad\n\nSigned-off-by: Bernard Ojengwa \n","repos":"apipanda\/openssl,apipanda\/openssl,apipanda\/openssl,apipanda\/openssl","old_file":"tmp\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","new_file":"tmp\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","new_contents":"","old_contents":"\/\/ ace can highlight scad!\nmodule Element(xpos, ypos, zpos){\n\ttranslate([xpos,ypos,zpos]){\n\t\tunion(){\n\t\t\tcube([10,10,4],true);\n\t\t\tcylinder(10,15,5);\n\t\t\ttranslate([0,0,10])sphere(5);\n\t\t}\n\t}\n}\n\nunion(){\n\tfor(i=[0:30]){\n\t\t# Element(0,0,0);\n\t\tElement(15*i,0,0);\n\t}\n}\n\nfor (i = [3, 5, 7, 11]){\n\trotate([i*10,0,0])scale([1,1,i])cube(10);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"bd4756754221ff54ab2cfe89c9feb27b28bf4445","subject":"misc: cleanup","message":"misc: cleanup\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cros product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n -(u[0]*v[2] - v[0]*u[2]) ,\n u[0]*v[1] - v[0]*u[1]];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[-asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0];\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e333131281df2fbd4ee11184d09f8c583471cba7","subject":"minor cleanup","message":"minor cleanup\n\nalso set the rod_dia to be the correct dia (for #10 screw)\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad","new_file":"3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad","new_contents":"\/\/ Frame to mount OLFA rotary cutter on a rail and weigh it down.\n\/\/ Consists of a back plate, a front plate. Additonally,\n\/\/ a weight holder (made of wood or polycarb) attaches to the \n\/\/ front plate.\n\/\/\n\/\/ History:\n\/\/ 2020 May 1: JMJ Created original design\n\/\/\nuse <..\/common\/extrusions.scad>\n$fn = 50;\nEPSILON = 0.01;\nLARGE = 100;\nMM = 25.4; \/\/ Inch to mm\nhole_dist = 3.5*MM;\nbase_w = 0.4*MM; \/\/ from hole to edge\nro = 0.5*MM;\nrod_dia = 3\/16*1.2*MM; \/\/ To let #10 threaded rod fit easily\n\n\n\/\/ Back plate\nmodule back_plate() {\n extra_below = 0.5*MM; \/\/ lower part is 1\"\n t = 0.5;\n r = rod_dia\/2;\n hole_y = base_w + extra_below;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=r, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n }\n}\n\n\/\/ Front plate\nmodule front_plate() {\n extra_below = 0.25*MM; \/\/ lower part is 1\"\n big_r = 1.25*MM; \/\/ Arc above\n t = 0.5;\n hole_y = base_w + extra_below;\n big_hole_dia = 1*MM;\n big_hole_h = 1.25*MM;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n translate([base_w + hole_dist\/2, hole_y, 0]) {\n difference() {\n cylinder(r=big_r, h = t);\n translate([-big_r, -2*big_r, -EPSILON])\n cube([2*big_r, 2*big_r, 2*t]);\n }\n }\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n bdd = big_hole_dia;\n translate([base_w + hole_dist\/2 -bdd\/2, hole_y - bdd \/2, -EPSILON])\n oblong(bdd, bdd, bdd\/2, 2*t);\n\n }\n}\n\n\nback_plate();\ntranslate([0, 5*base_w, 0])\n front_plate();","old_contents":"\/\/ Frame to mount OFLA rotary cutter on a rail and weigh it down\n\/\/ History:\n\/\/ 2020 May 1: JMJ Created original design\n\/\/\nuse <..\/common\/extrusions.scad>\n$fn = 50;\nEPSILON = 0.01;\nLARGE = 100;\nMM = 25.4; \/\/ Inch to mm\nhole_dist = 3.5*MM;\nbase_w = 0.4*MM; \/\/ from hole to edge\nro = 0.5*MM;\nrod_dia = 4; \/\/ To let #10 threaded rod fit\n\n\n\/\/ Back plate\nmodule back_plate() {\n extra_below = 0.5*MM; \/\/ lower part is 1\"\n t = 0.5;\n r = rod_dia\/2;\n hole_y = base_w + extra_below;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=r, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n }\n}\n\n\/\/ Front plate\nmodule front_plate() {\n extra_below = 0.25*MM; \/\/ lower part is 1\"\n big_r = 1.25*MM; \/\/ Arc above\n t = 0.5;\n hole_y = base_w + extra_below;\n big_hole_dia = 1*MM;\n big_hole_h = 1.25*MM;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n translate([base_w + hole_dist\/2, hole_y, 0]) {\n difference() {\n cylinder(r=big_r, h = t);\n translate([-big_r, -2*big_r, -EPSILON])\n cube([2*big_r, 2*big_r, 2*t]);\n }\n }\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n bdd = big_hole_dia;\n translate([base_w + hole_dist\/2 -bdd\/2, hole_y - bdd\/2, -EPSILON])\n oblong(bdd, bdd, bdd\/2, 2*t);\n\n }\n}\n\n\n\/\/wb = 10;\n\/\/hb = 20;\n\/\/ro = 5;\n\n\/\/oblong(wb, hb, ro, t);\n\/\/back_plate();\n\/\/translate([0, 5*base_w, 0])\n front_plate();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"f82787a715ef0a2a7df58d307ffefc25a5d7a86d","subject":"xaxis\/ends: fix motor shaft bearing cut","message":"xaxis\/ends: fix motor shaft bearing cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+7*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-2*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height, width=xaxis_beltpath_width, length = 1000)\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=[1,0,0], roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([0,0,xaxis_end_wz\/2])\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"65c819470ef36b51db119e30133100c43ffeafef","subject":"Add a visual indicator when the actual number of assertions does not match the expected number","message":"Add a visual indicator when the actual number of assertions does not match the expected number\n","repos":"jsconan\/camelSCAD","old_file":"util\/test.scad","new_file":"util\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n if (!checkExpectedAsserts(actual, expected)) {\n color([1, 0.4, 0.2]) {\n cube(15, center=true);\n }\n }\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"817cf136d9f46a3db32e97f9b4a8468b147f4e2b","subject":"holes made more visible on a preview","message":"holes made more visible on a preview\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n menuKnob();\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n resetButton();\n \/\/ cable guide drill\n translate([boxSize[0]-75-5, 40+16+10, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 30, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n lcdBoard();\n \/\/ encoder\n translate(encoderOffset)\n menuKnob();\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n resetButton();\n \/\/ cable guide drill\n translate([boxSize[0]-75-5, 40+16+10, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 30, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, 0])\n cylinder(r=5\/2, h=6+7, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2c5173653c5e3ce1a660b1056cb3e3f80c4c1246","subject":"Tweak placement of cover.","message":"Tweak placement of cover.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/piCameraEnclosure.scad","new_file":"designs\/piCameraEnclosure.scad","new_contents":"\/\/ Modified from: https:\/\/github.com\/luisibanez\/ShapesFor3DPrinting\/tree\/master\/OpenSCA\r\n\r\nmodule piCameraEnclosure() \r\n{\r\n\r\n\tmodule piCameraBackCoverBevel(clearance) {\r\n\t\tc = clearance;\r\n\t\thw = ( 25 \/ 2 ) + c;\r\n\t\the = hw + 1.5 + c;\r\n\t\tpolyhedron(\r\n\t\t\tpoints = [\r\n\t\t\t\t[ hw, -15-c, -1-c ],\r\n\t\t\t\t[ hw, 15+c, -1-c ], \r\n\t\t\t\t[ hw, 15+c, 1 ], \r\n\t\t\t\t[ hw, -15-c, 1 ],\r\n\t\t\t\t[ he, -15-c, -1-c ],\r\n\t\t\t\t[ he, 15+c, -1-c ] \r\n\t\t\t\t], \r\n\t\t\tfaces = [\r\n\t\t\t\t[ 5, 1, 0, 4],\r\n\t\t\t\t[ 4, 0, 3 ],\r\n\t\t\t\t[ 2, 1, 5 ],\r\n\t\t\t\t[ 5, 4, 3, 2],\r\n\t\t\t\t[ 0, 1, 2, 3],\r\n\t\t\t]\r\n\t\t);\r\n\t}\r\n\r\n\tmodule piCameraBackCoverBevels(clearance) {\r\n\t\tunion() {\r\n\t\t\tpiCameraBackCoverBevel(clearance);\r\n\t\t\tmirror([1,0,0])\r\n\t\t\t\tpiCameraBackCoverBevel(clearance);\r\n\t\t}\r\n\t}\r\n\r\n\tmodule piCameraBackCover(clearance=0, indent=true) {\r\n\t\tc = 2*clearance;\r\n\t\ttranslate([0,-5.5,9])\r\n\t\t\tdifference() {\r\n\t\t\t\tunion() {\r\n\t\t\t\t\tpiCameraBackCoverBevels(clearance);\r\n\t\t\t\t\tcube(size=[25+c,30+c,2+c],center=true);\r\n\t\t\t\t}\r\n\t\t\t\ttranslate([0,12,0])\r\n\t\t\t\t\tcube(size=[20.5-c,7,3],center=true);\r\n\t\t\t\tif (indent)\r\n\t\t\t\t\ttranslate([0,-12,1.5])\r\n\t\t\t\t\trotate([0,90,0])\r\n\t\t\t\t\t\tcylinder(r=1, h=40, center=true, $fn=20);\r\n\t\t\t}\r\n\t}\r\n\r\n\tmodule cableOpening() {\r\n\t\ttranslate([0,14,8.1])\r\n\t\t\tcube(size=[17,12,4],center=true);\r\n\t}\r\n\r\n\tmodule chipOpening() {\r\n\t\tclearance = 0.5;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,-9.5,5])\r\n\t\t\tcube(size=[8+c,10+c,4],center=true);\r\n\t}\r\n\r\n\tmodule lensOpening() {\r\n\t\tclearance = 0.5;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,0,2.5])\r\n\t\t\tcube(size=[8+c,8+c,5+c], center=true);\r\n\t}\r\n\r\n\tmodule boardOpening() {\r\n\t\tclearance = 0.2;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,-3,7.5])\r\n\t\t\tcube(size=[25+c,24+c,5+clearance], center=true);\r\n\t}\r\n\r\n\tmodule cameraFrame() {\r\n\t\ttranslate([0,-0.5,5])\r\n\t\t\tcube(size=[40,40,10], center=true);\r\n\t}\r\n\r\n\tmodule roundedCorner(radius) {\r\n\t\ttranslate([-radius, -radius, 0])\r\n\t\tdifference() {\r\n\t\t\ttranslate([0,0,-50])\r\n\t\t\t\tcube(size=[radius+0.1,radius+0.1,100]);\r\n\t\t\tcylinder(h=100, r=radius, $fn=50, center=true);\r\n\t\t}\r\n }\r\n\r\n module cornerRounding(radius) {\r\n\t\t\/\/ vertical corners\r\n\t\ttranslate([20,19.5,0])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([-20,19.5,0])\r\n\t\trotate([0,0,90])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([-20,-20.5,0])\r\n\t\trotate([0,0,180])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([20,-20.5,0])\r\n\t\trotate([0,0,-90])\r\n\t\t\troundedCorner(radius);\r\n\r\n\t\t\/\/ top corners\r\n\t\ttranslate([-20,0,10])\r\n\t\trotate([0,-90,0])\r\n\t\trotate([90,0,0])\r\n\t\t\troundedCorner(radius\/2);\r\n\t\ttranslate([20,0,10])\r\n\t\trotate([90,0,0])\r\n\t\t\troundedCorner(radius\/2);\r\n }\r\n\r\n\tmodule piCameraAdapter() {\r\n\t\tdifference() {\r\n\t\t\tcameraFrame();\r\n\t\t\tboardOpening();\r\n\t\t\tchipOpening();\r\n\t\t\tcableOpening();\r\n\t\t\tlensOpening();\r\n\t\t\tcornerRounding(radius=8);\r\n\t\t\tpiCameraBackCover(clearance=0.3, indent=false);\r\n\t\t}\r\n\t}\r\n\r\n\tunion() {\r\n\t\tpiCameraAdapter();\r\n\t\t\/\/ Comment out translate to see\r\n\t\t\/\/ back cover in place.\r\n\t\ttranslate([40,5,-8])\r\n\t\t\tpiCameraBackCover();\r\n\t}\r\n}\r\n\r\npiCameraEnclosure();\r\n","old_contents":"\/\/ Modified from: https:\/\/github.com\/luisibanez\/ShapesFor3DPrinting\/tree\/master\/OpenSCA\r\n\r\nmodule piCameraEnclosure() \r\n{\r\n\r\n\tmodule piCameraBackCoverBevel(clearance) {\r\n\t\tc = clearance;\r\n\t\thw = ( 25 \/ 2 ) + c;\r\n\t\the = hw + 1.5 + c;\r\n\t\tpolyhedron(\r\n\t\t\tpoints = [\r\n\t\t\t\t[ hw, -15-c, -1-c ],\r\n\t\t\t\t[ hw, 15+c, -1-c ], \r\n\t\t\t\t[ hw, 15+c, 1 ], \r\n\t\t\t\t[ hw, -15-c, 1 ],\r\n\t\t\t\t[ he, -15-c, -1-c ],\r\n\t\t\t\t[ he, 15+c, -1-c ] \r\n\t\t\t\t], \r\n\t\t\tfaces = [\r\n\t\t\t\t[ 5, 1, 0, 4],\r\n\t\t\t\t[ 4, 0, 3 ],\r\n\t\t\t\t[ 2, 1, 5 ],\r\n\t\t\t\t[ 5, 4, 3, 2],\r\n\t\t\t\t[ 0, 1, 2, 3],\r\n\t\t\t]\r\n\t\t);\r\n\t}\r\n\r\n\tmodule piCameraBackCoverBevels(clearance) {\r\n\t\tunion() {\r\n\t\t\tpiCameraBackCoverBevel(clearance);\r\n\t\t\tmirror([1,0,0])\r\n\t\t\t\tpiCameraBackCoverBevel(clearance);\r\n\t\t}\r\n\t}\r\n\r\n\tmodule piCameraBackCover(clearance=0, indent=true) {\r\n\t\tc = 2*clearance;\r\n\t\ttranslate([0,-5.5,9])\r\n\t\t\tdifference() {\r\n\t\t\t\tunion() {\r\n\t\t\t\t\tpiCameraBackCoverBevels(clearance);\r\n\t\t\t\t\tcube(size=[25+c,30+c,2+c],center=true);\r\n\t\t\t\t}\r\n\t\t\t\ttranslate([0,12,0])\r\n\t\t\t\t\tcube(size=[20.5-c,7,3],center=true);\r\n\t\t\t\tif (indent)\r\n\t\t\t\t\ttranslate([0,-12,1.5])\r\n\t\t\t\t\trotate([0,90,0])\r\n\t\t\t\t\t\tcylinder(r=1, h=40, center=true, $fn=20);\r\n\t\t\t}\r\n\t}\r\n\r\n\tmodule cableOpening() {\r\n\t\ttranslate([0,14,8.1])\r\n\t\t\tcube(size=[17,12,4],center=true);\r\n\t}\r\n\r\n\tmodule chipOpening() {\r\n\t\tclearance = 0.5;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,-9.5,5])\r\n\t\t\tcube(size=[8+c,10+c,4],center=true);\r\n\t}\r\n\r\n\tmodule lensOpening() {\r\n\t\tclearance = 0.5;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,0,2.5])\r\n\t\t\tcube(size=[8+c,8+c,5+c], center=true);\r\n\t}\r\n\r\n\tmodule boardOpening() {\r\n\t\tclearance = 0.2;\r\n\t\tc = 2 * clearance;\r\n\t\ttranslate([0,-3,7.5])\r\n\t\t\tcube(size=[25+c,24+c,5+clearance], center=true);\r\n\t}\r\n\r\n\tmodule cameraFrame() {\r\n\t\ttranslate([0,-0.5,5])\r\n\t\t\tcube(size=[40,40,10], center=true);\r\n\t}\r\n\r\n\tmodule roundedCorner(radius) {\r\n\t\ttranslate([-radius, -radius, 0])\r\n\t\tdifference() {\r\n\t\t\ttranslate([0,0,-50])\r\n\t\t\t\tcube(size=[radius+0.1,radius+0.1,100]);\r\n\t\t\tcylinder(h=100, r=radius, $fn=50, center=true);\r\n\t\t}\r\n }\r\n\r\n module cornerRounding(radius) {\r\n\t\t\/\/ vertical corners\r\n\t\ttranslate([20,19.5,0])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([-20,19.5,0])\r\n\t\trotate([0,0,90])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([-20,-20.5,0])\r\n\t\trotate([0,0,180])\r\n\t\t\troundedCorner(radius);\r\n\t\ttranslate([20,-20.5,0])\r\n\t\trotate([0,0,-90])\r\n\t\t\troundedCorner(radius);\r\n\r\n\t\t\/\/ top corners\r\n\t\ttranslate([-20,0,10])\r\n\t\trotate([0,-90,0])\r\n\t\trotate([90,0,0])\r\n\t\t\troundedCorner(radius\/2);\r\n\t\ttranslate([20,0,10])\r\n\t\trotate([90,0,0])\r\n\t\t\troundedCorner(radius\/2);\r\n }\r\n\r\n\tmodule piCameraAdapter() {\r\n\t\tdifference() {\r\n\t\t\tcameraFrame();\r\n\t\t\tboardOpening();\r\n\t\t\tchipOpening();\r\n\t\t\tcableOpening();\r\n\t\t\tlensOpening();\r\n\t\t\tcornerRounding(radius=8);\r\n\t\t\tpiCameraBackCover(clearance=0.3, indent=false);\r\n\t\t}\r\n\t}\r\n\r\n\tunion() {\r\n\t\tpiCameraAdapter();\r\n\t\t\/\/ Comment out translate to see\r\n\t\t\/\/ back cover in place.\r\n\t\ttranslate([40,0,-8])\r\n\t\t\tpiCameraBackCover();\r\n\t}\r\n}\r\n\r\npiCameraEnclosure();\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3c7cba647f0d9b35d99b3b999bad35852ee00543","subject":"xaxis\/ends: more work, add idler holder","message":"xaxis\/ends: more work, add idler holder\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \n\nmotor_mount_wall_thick = xaxis_pulley[1]+1*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\n\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n translate([0,1*mm,0])\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-1*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, .1, z*screw_dist\/2])\n {\n \/\/ screw\n translate([0,1,0])\n fncylindera(d=lookup(ThreadSize, xaxis_motor_thread), h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ screw head\n translate([0,-motor_mount_wall_thick,0])\n fncylindera(d=lookup(ThreadSize, xaxis_motor_thread)*1.9, h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n translate([0,-1,0])\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*debug=false;*\/\n\/*[>debug=true;<]*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*\/\/ x smooth rods*\/\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*(xaxis_rod_distance\/2)])*\/\n \/*%fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);*\/\n\n \/*xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n\n \/*translate([150,0,0])*\/\n \/*{*\/\n \/*xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n \/*xaxis_end_idlerholder();*\/\n \/*}*\/\n\/*}*\/\n\n\/*print=false;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \n\nmotor_mount_wall_thick = xaxis_pulley[1]+1*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n translate([0,1*mm,0])\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n beltpath_height = xaxis_pulley_inner_d+5*mm;\n beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\n \/\/ belt path\n beltpath_length = 1000;\n cubea([beltpath_length,beltpath_width, beltpath_height]);\n\n diag = pythag_hyp(beltpath_width,beltpath_width)\/2;\n\n for(z=[-1,1])\n translate([0,0,z*beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([beltpath_length, diag, diag]);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-1*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, .1, z*screw_dist\/2])\n {\n \/\/ screw\n translate([0,1,0])\n fncylindera(d=lookup(ThreadSize, xaxis_motor_thread), h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ screw head\n translate([0,-motor_mount_wall_thick,0])\n fncylindera(d=lookup(ThreadSize, xaxis_motor_thread)*1.9, h=wy+motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n translate([0,-1,0])\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ndebug=false;\n\/*debug=true;*\/\nif(debug)\n{\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n %fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n\n translate([150,0,0])\n xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);\n}\n\nprint=true;\nif(print)\n{\n xaxis_end(with_motor=true, show_motor=false, show_nut=false);\n translate([100,0,0])\n xaxis_end(with_motor=false, show_motor=false, show_nut=false);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"095cbd1c23545f868515d77424271b2e51072043","subject":"xaxis\/ends: round stuff","message":"xaxis\/ends: round stuff\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z,0], [0,0,0]];\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cuberounda([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*#cubea([top_width,xaxis_carriage_bearing_offset_z,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cuberounda([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n {\n difference()\n {\n translate([0,0,xaxis_pulley_inner_d\/2])\n cuberounda([50, xaxis_carriage_teeth_height, 10], align=[0,0,-1]);\n }\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n translate([0,0,-xaxis_pulley_inner_d\/2])\n cubea([500,xaxis_carriage_teeth_height,5], align=[0,0,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);\n\n belt_thickness=1.5;\n for(i=[-1,1])\n translate([i*30,0,0])\n cubea([15,xaxis_carriage_teeth_height,15-belt_thickness], align=[0,0,0]);\n\n \/\/ Cut in the middle for belt\n cubea([7,xaxis_carriage_teeth_height+.1,15], align=[0,0,0]);\n\n translate([0,0,xaxis_pulley_inner_d\/2])\n {\n \/\/ Belt slit\n cubea([500,xaxis_carriage_teeth_height,belt_thickness], align=[0,0,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 2;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);\n }\n }\n\n }\n\n\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),0,0])\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, -xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n \/\/ Extruder mounting holes\n translate([0,0,xaxis_carriage_mount_offset_z])\n for(j=[-1,1])\n for(i=[-1,1])\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])\n {\n screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);\n fncylindera(d=screw_dia, h=100, orient=[0,1,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_holes();\n }\n\n if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([j*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, 0, xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([0, 0, -xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n for(i=[-1,1])\n translate([i*50,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nif(false)\n{\n x_carriage();\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_z,0], [0,0,0]];\n\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z;\n\n difference()\n {\n union()\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*#cubea([top_width,xaxis_carriage_bearing_offset_z,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n {\n difference()\n {\n translate([0,0,xaxis_pulley_inner_d\/2])\n cubea([50, xaxis_carriage_teeth_height, 10], align=[0,0,-1]);\n }\n }\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n translate([0,0,-xaxis_pulley_inner_d\/2])\n cubea([500,xaxis_carriage_teeth_height,5], align=[0,0,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);\n\n belt_thickness=1.5;\n for(i=[-1,1])\n translate([i*30,0,0])\n cubea([15,xaxis_carriage_teeth_height,15-belt_thickness], align=[0,0,0]);\n\n \/\/ Cut in the middle for belt\n cubea([7,xaxis_carriage_teeth_height+.1,15], align=[0,0,0]);\n\n translate([0,0,xaxis_pulley_inner_d\/2])\n {\n \/\/ Belt slit\n cubea([500,xaxis_carriage_teeth_height,belt_thickness], align=[0,0,0]);\n\n \/\/ Teeth cuts\n teeth = 50;\n teeth_height = 2;\n translate([-belt_tooth_distance\/2*teeth-.5,0,0])\n for(i=[0:teeth])\n {\n translate([i*belt_tooth_distance,0,0])\n cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);\n }\n }\n\n }\n\n\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),0,0])\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n translate([0, xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_z, -xaxis_rod_distance\/2])\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n\n \/\/ Extruder mounting holes\n translate([0,0,xaxis_carriage_mount_offset_z])\n for(j=[-1,1])\n for(i=[-1,1])\n {\n translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])\n {\n screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);\n fncylindera(d=screw_dia, h=100, orient=[0,1,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n x_carriage_base();\n x_carriage_holes();\n }\n\n if(show_bearings)\n {\n for(j=[-1,1])\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([j*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,0,0])\n translate([0, 0, xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_z,0])\n translate([0, 0, -xaxis_rod_distance\/2])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([0,xaxis_carriage_beltpath_offset,0])\n for(i=[-1,1])\n translate([i*50,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nif(false)\n{\n x_carriage();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2c6226d2feb112826ecf743e4d3edaf6d800b148","subject":"Add test unit operator: testUnitContext()","message":"Add test unit operator: testUnitContext()\n","repos":"jsconan\/camelSCAD","old_file":"util\/test.scad","new_file":"util\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Declares a unit test context. That allows to isolate context data from other unit tests.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnitContext(title, expected) {\n $testUnit = str($testUnit, \" - \", string(title));\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n if (!checkExpectedAsserts(actual, expected)) {\n color([1, 0.4, 0.2]) {\n cube(15, center=true);\n }\n }\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n if (!checkExpectedAsserts(actual, expected)) {\n color([1, 0.4, 0.2]) {\n cube(15, center=true);\n }\n }\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"38133dbe0fb275192127ec1247f54305391e81da","subject":"Allow to center repeated shapes","message":"Allow to center repeated shapes\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/translate.scad","new_file":"operator\/repeat\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2020 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n offset = center ? -interval * (count - 1) \/ 2 : 0;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n center = false) {\n\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n center = false) {\n\n repeat(count=countZ, interval=vector3D(intervalZ), center=center) {\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]],\n center = center\n ) {\n children();\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2019 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n\n for (i = [0 : count - 1]) {\n translate(interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0]) {\n\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0]) {\n\n repeat(count=countZ, interval=vector3D(intervalZ)) {\n repeat(count=countY, interval=vector3D(intervalY)) {\n repeat(count=countX, interval=vector3D(intervalX)) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n * @param Boolean [center] - Whether or not center the repeated shapes\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n translate(center ? -vmul(size, count - [1, 1]) \/ 2 : 0) {\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0]\n ) {\n children();\n }\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape\n * @param Vector [count] - The number of shapes on each axis\n * @param Boolean [center] - Whether or not center the repeated shapes\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n translate(center ? -vmul(size, count - [1, 1, 1]) \/ 2 : 0) {\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]]\n ) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ce77437a09b2f2114ac905b78fae6b7a32916c47","subject":"3d printed spool","message":"3d printed spool\n","repos":"TheBeachLab\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,Fablabsitges\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap,TheBeachLab\/BeachLab_flip_flap","old_file":"V2\/Hardware\/structure\/spool-3dp.scad","new_file":"V2\/Hardware\/structure\/spool-3dp.scad","new_contents":"\/\/ Alphabets New Spool\n$fn=(50);\n\n\/\/ Parameters\nncards=64; \/\/ number of cards\nsdiam=85; \/\/ diameter of the spool mm\ne=2; \/\/ 3d printed part thickness mm\n\n\/\/ Variables\nsrad=sdiam\/2;\nangle=360\/ncards; \/\/ angle of rotation\n\n\/\/ define copy_mirror function\nmodule copy_mirror(vec=[0,1,0])\n{\n children();\n mirror(vec) children();\n} \n\n\/\/ Define axis motor\nmodule axismotor() {\nintersection() {square(size = [3, 6], center = true); circle(2.5);}\n}\n\n\/\/ Define axis support\nmodule axis() {\ncircle(1.5);\n}\n\n\/\/ define aro\nmodule aro() {\ndifference(){\n difference() { circle(srad); circle(srad-5);}\n for (a=[0:angle:360]){\n rotate(a) \n translate([srad-2.5,0,0]) circle(1.5);\n }\n}\n}\n\n\/\/ CODE STARTS HERE\n\nlinear_extrude(height = e) {\nunion(){ \naro();\n difference() {\n intersection() {\n union() {\n translate ([srad,0,0]) aro();\n translate ([-srad,0,0]) aro();\n circle (6.5);\n }\n circle(srad-5);\n }\n\n axismotor();\n }\n} \n}\n\ntranslate ([sdiam+5,0,0])\n union() {\n linear_extrude(height = 5) {circle(1.5);}\n linear_extrude(height = e) {\n union(){ \n aro();\n intersection() {\n union() {\n translate ([srad,0,0]) aro();\n translate ([-srad,0,0]) aro();\n circle (6.5);\n }\n circle(srad-5);\n }\n\n } \n }\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'V2\/Hardware\/structure\/spool-3dp.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b8c1f579476e6307a1497e52a6f20659ec662f22","subject":"todo: arm spacers and elbow screw holes","message":"todo: arm spacers and elbow screw holes\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 4, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ shoulder base\ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\n\/*\ndeprecated\nrender() \n translate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + (2* bearingStep)])\n armJointSpacer(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\n*\/\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n \n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"b07a714d7911aefbb40d295587b0931828475b9f","subject":"simplified focus knob","message":"simplified focus knob\n","repos":"DamCB\/mush","old_file":"scad\/openscad\/focus_knob.scad","new_file":"scad\/openscad\/focus_knob.scad","new_contents":"\n\nmodule inner_barrel(phi_in=23.9, phi_out=38, hh=13.5){\n difference(){\n cylinder(d=phi_out, h=hh, center=true);\n cylinder(d=phi_in, h=hh+0.4, center=true);\n }\n}\n\nmodule outer_barrel(phi_in1=38.1, phi_out1=41.7, h1=21.7, phi_out2=26, h2=3.6, phi_in2=23){\n\n difference(){\n union(){\n translate([0, 0, (h1+h2)\/2])\n cylinder(d=phi_out2, h=h2+0.2, center=true);\n cylinder(d=phi_out1, h=h1, center=true);\n }\n union(){\n translate([0, 0, (h1+h2)\/2])\n cylinder(d=phi_in2, h=h2+5, center=true);\n translate([0, 0, -2]) cylinder(d=phi_in1, h=h1, center=true);\n }\n }\n}\n\n\n\nmodule mock_focus(){\n inner_barrel();\n outer_barrel();\n}\n\nmock_focus();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'scad\/openscad\/focus_knob.scad' did not match any file(s) known to git\n","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"d365d02fcb8d005dacec8782976a94ee9c8dfd1f","subject":"Better type management in logic.scad","message":"Better type management in logic.scad\n","repos":"jsconan\/camelSCAD","old_file":"core\/logic.scad","new_file":"core\/logic.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017-2019 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Comparisons and boolean operations.\r\n *\r\n * @package core\/logic\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Returns the first value if it is equivalent to true, otherwise returns the second value.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction or(a, b) = a ? a : b;\r\n\r\n\/**\r\n * Returns the second value if the first value is equivalent to true.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction and(a, b) = a ? b : a;\r\n\r\n\/**\r\n * Returns `true` when the paramaters do not have the same boolean meaning, otherwise return `false`.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction xor(a, b) = (!a && b) || (a && !b);\r\n\r\n\/**\r\n * Returns the first value if it is defined, otherwise returns the second value.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction uor(a, b) = isUndef(a) ? b : a;\r\n\r\n\/**\r\n * Returns the second value if the first value is defined.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction uand(a, b) = isUndef(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a number, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Number|*\r\n *\/\r\nfunction numberOr(a, b) = isNumber(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is an integer, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Number|*\r\n *\/\r\nfunction integerOr(a, b) = isInteger(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a boolean, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Boolean|*\r\n *\/\r\nfunction booleanOr(a, b) = isBoolean(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a string, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return String|*\r\n *\/\r\nfunction stringOr(a, b) = isString(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is an array, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Array|*\r\n *\/\r\nfunction arrayOr(a, b) = isArray(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a vector, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Vector|*\r\n *\/\r\nfunction vectorOr(a, b) = isVector(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a 2D vector, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Vector|*\r\n *\/\r\nfunction vector2DOr(a, b) = isVector2D(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a 3D vector, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Vector|*\r\n *\/\r\nfunction vector3DOr(a, b) = isVector3D(a) ? a : b;\r\n\r\n\/**\r\n * Checks if all elements of an array are equivalent to true.\r\n *\r\n * @param Array a - The array to check.\r\n * @returns Boolean\r\n *\/\r\nfunction allTrue(a) =\r\n let(\r\n a = array(a),\r\n l = len(a)\r\n )\r\n l ? len([ for (i = a) if (i) i ]) == l\r\n : false\r\n;\r\n\r\n\/**\r\n * Checks if all elements of an array are falsy.\r\n *\r\n * @param Array a - The array to check.\r\n * @returns Boolean\r\n *\/\r\nfunction allFalse(a) =\r\n let(\r\n a = array(a),\r\n l = len(a)\r\n )\r\n l ? len([ for (i = a) if (!i) i ]) == l\r\n : true\r\n;\r\n\r\n\/**\r\n * Checks if all elements of an array are equal.\r\n *\r\n * @param Array a - The array to check\r\n * @returns Boolean\r\n *\/\r\nfunction allSame(a) =\r\n let(\r\n a = array(a),\r\n l = len(a)\r\n )\r\n l > 1 ? !len([ for (i = [1 : l - 1]) if (a[i - 1] != a[i]) i ])\r\n : true\r\n;\r\n\r\n\/**\r\n * Checks if a value is comprised within the given range, inclusive.\r\n *\r\n * @param Number value - The value to check.\r\n * @param Number low - The lowest value of the range.\r\n * @param Number high - The highest value of the range.\r\n * @returns Boolean\r\n *\/\r\nfunction between(value, low, high) =\r\n let(\r\n value = float(value),\r\n low = float(low),\r\n high = float(high)\r\n )\r\n (value >= min(low, high) && value <= max(low, high))\r\n;\r\n\r\n\/**\r\n * Checks if an array contains a particular value.\r\n *\r\n * @param Array a - The array to check.\r\n * @param * value - The value to search for.\r\n * @returns Boolean\r\n *\/\r\nfunction contains(a, value) =\r\n let(\r\n a = array(a)\r\n )\r\n len([ for (i = a) if (i == value) i ]) > 0\r\n;\r\n\r\n\/**\r\n * Checks if the provided values are approximately equal. Number will be rounded with the wanted decimal precision.\r\n * Strings and booleans will be strictly compared. Arrays and vectors will be recursively compared.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @param Number [precision] - The wanted decimal precision (default: 5).\r\n * @returns Boolean\r\n *\/\r\nfunction approx(a, b, precision=5,\r\n \/\/ internal\r\n p, l) =\r\n isArray(a) ? (\r\n !isArray(b) ? false\r\n :(\r\n let(\r\n la = len(a),\r\n lb = len(b)\r\n )\r\n la != lb ? false\r\n :!l && (!la || concat(a) != a) ? a == b\r\n :let(\r\n p = float(p),\r\n l = numberOr(l, la)\r\n )\r\n l <= 4 ? (\r\n let(\r\n r1 = approx(a[p], b[p], precision)\r\n )\r\n r1 && l > 1 ? (\r\n let(\r\n r2 = approx(a[p + 1], b[p + 1], precision)\r\n )\r\n r2 && l > 2 ? (\r\n let(\r\n r3 = approx(a[p + 2], b[p + 2], precision)\r\n )\r\n r3 && l > 3 ? approx(a[p + 3], b[p + 3], precision)\r\n :r3\r\n )\r\n :r2\r\n )\r\n :r1\r\n )\r\n :let(\r\n half = floor(l \/ 2)\r\n )\r\n approx(a, b, precision, p, half) && approx(a, b, precision, p + half, l - half)\r\n )\r\n )\r\n :isNumber(a) ? (\r\n !isNumber(b) ? false\r\n :(\r\n let(\r\n sa = sign(a),\r\n sb = sign(b)\r\n )\r\n sa != sb ? false\r\n :sa == 0 ? a == b\r\n :let(\r\n precision = pow(10, float(precision)),\r\n a = round(a * precision) \/ precision,\r\n b = round(b * precision) \/ precision\r\n )\r\n a == b\r\n )\r\n )\r\n :a == b\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Comparisons and boolean operations.\r\n *\r\n * @package core\/logic\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Returns the first value if it is equivalent to true, otherwise returns the second value.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction or(a, b) = a ? a : b;\r\n\r\n\/**\r\n * Returns the second value if the first value is equivalent to true.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction and(a, b) = a ? b : a;\r\n\r\n\/**\r\n * Returns `true` when the paramaters do not have the same boolean meaning, otherwise return `false`.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction xor(a, b) = (!a && b) || (a && !b);\r\n\r\n\/**\r\n * Returns the first value if it is defined, otherwise returns the second value.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction uor(a, b) = isUndef(a) ? b : a;\r\n\r\n\/**\r\n * Returns the second value if the first value is defined.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @returns *\r\n *\/\r\nfunction uand(a, b) = isUndef(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a number, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Number|*\r\n *\/\r\nfunction numberOr(a, b) = isNumber(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is an integer, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Number|*\r\n *\/\r\nfunction integerOr(a, b) = isInteger(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a boolean, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Boolean|*\r\n *\/\r\nfunction booleanOr(a, b) = isBoolean(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a string, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return String|*\r\n *\/\r\nfunction stringOr(a, b) = isString(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is an array, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Array|*\r\n *\/\r\nfunction arrayOr(a, b) = isArray(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a vector, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Vector|*\r\n *\/\r\nfunction vectorOr(a, b) = isVector(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a 2D vector, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Vector|*\r\n *\/\r\nfunction vector2DOr(a, b) = isVector2D(a) ? a : b;\r\n\r\n\/**\r\n * Gets the first value if it is a 3D vector, otherwise gets the second value whatever it is.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @return Vector|*\r\n *\/\r\nfunction vector3DOr(a, b) = isVector3D(a) ? a : b;\r\n\r\n\/**\r\n * Checks if all elements of an array are equivalent to true.\r\n *\r\n * @param Array a - The array to check.\r\n * @returns Boolean\r\n *\/\r\nfunction allTrue(a) =\r\n let( l = len(a) )\r\n l && !isString(a) ? len([ for (i = a) if (i) i ]) == l\r\n : !!a\r\n;\r\n\r\n\/**\r\n * Checks if all elements of an array are falsy.\r\n *\r\n * @param Array a - The array to check.\r\n * @returns Boolean\r\n *\/\r\nfunction allFalse(a) =\r\n let( l = len(a) )\r\n l && !isString(a) ? len([ for (i = a) if (!i) i ]) == l\r\n : !a\r\n;\r\n\r\n\/**\r\n * Checks if all elements of an array are equal.\r\n *\r\n * @param Array a - The array to check\r\n * @returns Boolean\r\n *\/\r\nfunction allSame(a) =\r\n let( l = len(a) )\r\n l > 1 && !isString(a) ? !len([ for (i = [1 : l - 1]) if (a[i - 1] != a[i]) i ])\r\n : true\r\n;\r\n\r\n\/**\r\n * Checks if a value is comprised within the given range, inclusive.\r\n *\r\n * @param Number value - The value to check.\r\n * @param Number low - The lowest value of the range.\r\n * @param Number high - The highest value of the range.\r\n * @returns Boolean\r\n *\/\r\nfunction between(value, low, high) =\r\n let(\r\n value = float(value),\r\n low = float(low),\r\n high = float(high)\r\n )\r\n (value >= min(low, high) && value <= max(low, high))\r\n;\r\n\r\n\/**\r\n * Checks if an array contains a particular value.\r\n *\r\n * @param Array a - The array to check.\r\n * @param * value - The value to search for.\r\n * @returns Boolean\r\n *\/\r\nfunction contains(a, value) = len([ for (i = a) if (i == value) i ]) > 0;\r\n\r\n\/**\r\n * Checks if the provided values are approximately equal. Number will be rounded with the wanted decimal precision.\r\n * Strings and booleans will be strictly compared. Arrays and vectors will be recursively compared.\r\n *\r\n * @param * a - The first value.\r\n * @param * b - The second value.\r\n * @param Number [precision] - The wanted decimal precision (default: 5).\r\n * @returns Boolean\r\n *\/\r\nfunction approx(a, b, precision=5,\r\n \/\/ internal\r\n p, l) =\r\n let(\r\n sa = sign(a),\r\n sb = sign(b)\r\n )\r\n sa != sb ? false\r\n :!sa ? (\r\n sa == 0 ? a == b\r\n :(\r\n let(\r\n la = len(a),\r\n lb = len(b)\r\n )\r\n la != lb ? false\r\n :!l && (!la || concat(a) != a) ? a == b\r\n :let(\r\n p = float(p),\r\n l = numberOr(l, la)\r\n )\r\n l <= 4 ? (\r\n let(\r\n r1 = approx(a[p], b[p], precision)\r\n )\r\n r1 && l > 1 ? (\r\n let(\r\n r2 = approx(a[p + 1], b[p + 1], precision)\r\n )\r\n r2 && l > 2 ? (\r\n let(\r\n r3 = approx(a[p + 2], b[p + 2], precision)\r\n )\r\n r3 && l > 3 ? approx(a[p + 3], b[p + 3], precision)\r\n :r3\r\n )\r\n :r2\r\n )\r\n :r1\r\n )\r\n :let(\r\n half = floor(l \/ 2)\r\n )\r\n approx(a, b, precision, p, half) && approx(a, b, precision, p + half, l - half)\r\n )\r\n )\r\n :let(\r\n precision = pow(10, float(precision)),\r\n a = round(a * precision) \/ precision,\r\n b = round(b * precision) \/ precision\r\n )\r\n a == b\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b8a3d8ca31ce16be398986ecea20579cef976d0b","subject":"fixed up for automatic building with make","message":"fixed up for automatic building with make\n","repos":"beckdac\/SCARA,beckdac\/SCARA","old_file":"SCARA.scad","new_file":"SCARA.scad","new_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\nquality = \"development\";\nif (quality == \"production\") {\n\t$fn = 48;\n} else {\n\t$fn = 24;\n}\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n \/\/render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","old_contents":"use ;\nuse ;\ninclude ;\n\n\/\/ global rendering parameters\n$fn = 24;\n\n\/\/ library examples\n\/\/ translate([100, 100, 10]) { StepMotor28BYJ(); }\n\/\/ stepperHub(10, 7, 6, 3.1, 1.5, 2.75);\n\/\/translate([0, 0, 8]) bearing6807_2RS();\n\/\/ bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\n\n\/\/ shoulder base parameters\nshoulderBaseHeight = 3;\nshoulderBaseDiameter = 55;\nshaftBossDiameter = 10;\nmountScrewDiameter = 3.1;\nbearingStep = 2; \/\/ size in mm of bearing interface step\n\/\/ joint parameters\nhubHeight = 10;\nhubRadius = 7;\nshaftHeight = 6;\nshaftRadius = 3.1;\nsetScrewRadius = 1.5;\nsetScrewHeight = 2.75;\nspokeWidth = 3;\nspokes = 6;\nscrewTabs = 4;\nscrewTabHeight = 4;\narmLength = 100;\n\/\/ misc\nbaseDeckExtension = 60;\nboundingBox = 8;\nboundingBoxHalf = boundingBox \/ 2;\n\/\/ 8 is distance from shaft center to screw center on x axis\n\/\/ 35 is screw center to screw center on y axis\nshaftCenterToMountHoldCenterXAxis = 8;\nmountHoleCenterToMountHoleCenter = 35;\nleadScrewDiameter = 8;\n\/\/ forearm\nforearmLength = 75;\n\n\/* Pieces in this model\n** Shoulder:\n*** Base plate\n*** Top plate\n*** Lower arm\n*** Upper arm\n** Forearm:\n*** ?\n** Hand:\n*** ?\n*\/\n\n\/\/ SHOULDER\n\/\/ shoulder base\nmodule shoulderBasePlate() { \/\/ make me \ncolor([.7, .7, 1]) \n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n}\nshoulderBasePlate();\n\/\/ shoulder lower stepper\nrotate([0, 180, 0]) \n translate([-8, 0, 10]) \n StepMotor28BYJ();\n\/\/ lower shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + bearingStep])\n %bearing6807_2RS();\n\/\/ shoulder top\ncolor([.6, .6, .9]) \n translate([0, 0, 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)])\n rotate([180, 0, 0])\n shoulderBase(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter);\n\/\/ upper shoulder bearing\ntranslate([0, 0, shoulderBaseHeight + (3 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ shoulder upper stepper\nrotate([0, 0, 180]) \n translate([-8, 0, 10 + 2 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep)]) \n StepMotor28BYJ();\n\/\/ shoulder spacers\nmodule shoulderSpacerSet() { \/\/ make me\ncolor([.7, .6, .2])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\ncolor([.7, .6, .2])\ntranslate([baseDeckExtension \/ 3, 0, 0])\nshoulderSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\nshoulderSpacerSet();\n\/\/ end shoulder\n\n\/\/ lower arm including the shoulder - arm joint \n\/\/render()\nmodule armSection() { \/\/ make me\ncolor([1, .7, .7]) \n translate([0, 0, shoulderBaseHeight + bearing6807_2RS_B]) \n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n}\narmSection();\n\/\/ upper arm\n\/\/render()\ncolor([.9, .7, .7]) \n translate([0, 0, shoulderBaseHeight + ( 2*bearing6807_2RS_B) + (12 * bearingStep) - (.5 * bearingStep)]) \n rotate([180, 0, 0])\n armLower(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength);\n\/\/ elbow joint pieces\n\/\/ lower bearing\ntranslate([-armLength, 0, shoulderBaseHeight + bearing6807_2RS_B + bearingStep])\n %bearing6807_2RS();\n\/\/ arm upper stepper\ntranslate([-armLength + 8, 0, shoulderBaseHeight + ( 3*bearing6807_2RS_B) + (16 * bearingStep) - (.5 * bearingStep)]) \n rotate([0, 0, 180]) \n StepMotor28BYJ();\n\/\/ arm lower stepper\nrotate([0, 180, 0]) \n translate([armLength - 8, 0, bearingStep * 2]) \n StepMotor28BYJ();\n\/\/ arm spacers\nmodule armSpacerSet() { \/\/ make me\ncolor([.6, .6, .3])\n armSpacers(bearing6807_2RS_D + iFitAdjust, 0 * shoulderBaseHeight + (4 * bearing6807_2RS_B) + (8 * bearingStep));\n}\narmSpacerSet();\n\/\/ end arm\n \n\/\/ forearm pieces\n\/\/ lower\nmodule forearmSection() { \/\/ make me\ncolor([.1, .7, .1])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n\/\/translate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (14 *bearingStep)])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n}\nforearmSection();\n\/\/ upper\ncolor([.2, .8, .2])\ntranslate([-armLength, 0, shoulderBaseHeight + (bearing6807_2RS_B * 2) + (4 *bearingStep)])\n rotate([180, 0, 0])\n forearmLower(bearing6807_2RS_d - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight + (bearing6807_2RS_B \/ 2) + (bearingStep\/2), hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox);\n\/\/ forearm upper bearing\ntranslate([-armLength, 0, shoulderBaseHeight + (2 * bearing6807_2RS_B) + (7 * bearingStep)])\n %bearing6807_2RS();\n\/\/ forearm spacers\n\/\/ none at this time\n\n\/\/bearingInnerStep(bearing6807_2RS_d - iFitAdjust, 2, 2);\nmodule bearingInnerStep(bearingID, stepHeight, stepWidth) {\n difference() {\n union() {\n \/\/ this fits inside of the bearing\n cylinder(h = stepHeight * 2, d = bearingID);\n \/\/ this rests on the bearing inner lip\n cylinder(h = stepHeight, d = bearingID + stepWidth);\n }\n \/\/ remove center\n cylinder(h = stepHeight * 2, d = bearingID - (stepWidth * 2));\n }\n}\n\n\/\/translate([0, 0, 12]) bearingOuterStep(bearing6807_2RS_D + iFitAdjust, 2, 2);\nmodule bearingOuterStep(bearingOD, stepHeight, stepWidth) {\n \/\/render(convexivity = 3)\n difference() {\n cylinder(h = stepHeight * 2, d = bearingOD + stepWidth);\n cylinder(h = stepHeight * 2, d = bearingOD - stepWidth);\n cylinder(h = stepHeight, d = bearingOD);\n }\n}\n\nmodule shoulderSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 1.0])\n difference() {\n union () {\n cylinder(h = screwSpacerHeight, r = setScrewRadius * 2);\n \n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\nmodule armSpacers(bearingOD, screwSpacerHeight) {\n union() {\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = 4)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n \/\/ TODO: put in spacers along arm, make sure holes exist in arm\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight + bearing6807_2RS_B + 2 * bearingStep])\n difference() {\n union () {\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius * 2);\n \n }\n cylinder(h = bearing6807_2RS_B * 2 + 4 * bearingStep, r = setScrewRadius);\n }\n }\n}\n\n\/\/ armJointSpacer(bearing6807_2RS_D - iFitAdjust, bearing6807_2RS_D + iFitAdjust, bearingStep, shaftBossDiameter, mountScrewDiameter);\nmodule armJointSpacer(bearingID, bearingOD, bearingStep, shaftBossDiameter, mountScrewDiameter) {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID);\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n } \n }\n}\n\n\n\/\/shoulderBase(2, 55, 9.1, 3.1);\n\/\/ WARNING: has some hard-coded non-parametric values in here!\nmodule shoulderBase(bearingID, bearingOD, shoulderBaseHeight, shoulderBaseDiameter, shaftBossDiameter, mountScrewDiameter) {\n mountHoleDepth = shoulderBaseHeight;\n\n \/\/render(convexivity = 3)\n difference() {\n union () {\n cylinder(h = shoulderBaseHeight, d = shoulderBaseDiameter);\n translate([0, 0, shoulderBaseHeight])\n bearingInnerStep(bearing6807_2RS_d - iFitAdjust, bearingStep, bearingStep);\n \/\/ 40 is the length of deck extension from the baseplate in x\n translate([0, -shoulderBaseDiameter \/ 2, 0])\n cube([baseDeckExtension, shoulderBaseDiameter, shoulderBaseHeight], center = false);\n }\n \/\/ motor shaft hole\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n \n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n \/\/ lead screw hole\n translate([baseDeckExtension - (leadScrewDiameter * 1.5), 0, 0])\n cylinder(h = shoulderBaseHeight, d = leadScrewDiameter + (leadScrewDiameter \/ 2));\n \/\/ upper to lower spacer screw holes\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n translate([baseDeckExtension \/ 3, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, shoulderBaseHeight * 0])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ NOTE: need to add LM8UU mounts\n}\n\n\n\n\nmodule armLower(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight, armLength) {\n armWidth = bearingOD \/ 2;\n render(convexivity = 3)\n difference() { \n union() {\n armInnerJoint(bearingOD, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\n translate([-armLength, 0, 0])\n armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight);\n difference() {\n translate([-armLength, -armWidth \/ 2, 0])\n cube([armLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n difference() {\n intersection() {\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : armLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n }\n difference() {\n hull() {\n translate([- armLength, 0, bearingStep])\n linear_extrude(height = 2 * bearingStep, center = true, twist = 0)\n polygon(points=[[0, -bearingOD\/2 - setScrewRadius\/2], [bearingOD \/ 2 + (setScrewRadius * 8), -armWidth \/ 2], [bearingOD \/ 2 + (setScrewRadius * 8), armWidth \/ 2], [0, bearingOD\/2 + setScrewRadius\/2]]);\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius * 2);\n \n }\n translate([- armLength, 0, 0])\n rotate([0, 0, -30])\n radial_array_partial(vec = [0, 0, 1], n = 6, 2)\n translate([bearingOD \/ 2 + (setScrewRadius * 8), 0, 0])\n cylinder(h = 2 * bearingStep, r = setScrewRadius);\n \n translate([-armLength + (bearingOD \/ 2) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([armLength - bearingOD - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n translate([-armLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD);\n \n }\n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n \n \n }\n}\n\nmodule armOuterJointBase(bearingOD, bearingStep, setScrewRadius, screwTabs, screwTabHeight) {\n mountHoleDepth = bearingStep * 2;\n\n union() {\n difference() {\n union() {\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n translate([0, 0, bearingStep * 2])\n rotate([0, 180, 0])\n bearingOuterStep(bearingOD, bearingStep, bearingStep);\n }\n \/\/ motor shaft hole\n translate([0, 0, -(bearingStep * 2)])\n cylinder(h = shoulderBaseHeight + (bearingStep * 2), d = shaftBossDiameter);\n \/\/ mounting holes\n translate([0, 0, -(bearingStep * 2)]) {\n translate([shaftCenterToMountHoldCenterXAxis, mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n translate([shaftCenterToMountHoldCenterXAxis, -mountHoleCenterToMountHoleCenter\/2, 0]) \n cylinder(h = mountHoleDepth, d = mountScrewDiameter);\n }\n }\n \n }\n}\n\n\/\/armInnerJoint(bearing6807_2RS_D + iFitAdjust, bearingStep, bearingStep, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight);\nmodule armInnerJoint(bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, screwTabs, screwTabHeight) {\n \/\/translate([0, 0, hubHeight - (2 * stepHeight)])\n difference() {\n union() {\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + (setScrewRadius * 6));\n cylinder(h = bearingStep * 2, d = bearingOD);\n\/\/ translate([0, -bearingOD, 0])\n\/\/ cube([bearingOD, bearingOD * 2, bearingStep * 2]);\n }\n bearingOuterStep(bearingOD, stepHeight, stepWidth);\n \/\/ hub\n translate([0, 0, -(hubHeight - (2 * stepHeight))])\n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), stepHeight]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, stepHeight], center = false);\n \/\/ screw tabs for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n \n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n \n }\n \/\/ screw holes for joining to upper\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * stepHeight) - screwTabHeight])\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n}\n\n\nmodule forearmLower(bearingID, bearingOD, stepHeight, stepWidth, hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight, spokeWidth, spokes, forearmLength, boundingBox) {\n armWidth = bearingOD \/ 2;\n\n rotate([180, 0, 0]) union() {\n boundingBoxHalf = boundingBox \/ 2;\n difference() {\n cylinder(h = bearingStep * 2, d = bearingOD + bearingStep);\n cylinder(h = bearingStep * 2, d = bearingID - (2 * bearingStep));\n }\n translate([0, 0, bearingStep * 2])\n bearingInnerStep(bearingID, bearingStep, bearingStep);\n \/\/ screw holes for joining to arm\n radial_array(vec = [0, 0, 1], n = screwTabs)\n translate([bearingOD \/ 2 + (setScrewRadius * 2), 0, (2 * bearingStep) - screwTabHeight])\n difference() {\n union () {\n cylinder(h = screwTabHeight, r = setScrewRadius * 2);\n translate([-2 * setScrewRadius, - 2 * setScrewRadius, 0])\n cube([setScrewRadius * 2, 4 * setScrewRadius, screwTabHeight], center = false);\n }\n cylinder(h = screwTabHeight, r = setScrewRadius);\n }\n \/\/ hub\n translate([0, 0, hubHeight]) rotate([180, 0, 0]) \n stepperHub(hubHeight, hubRadius, shaftHeight, shaftRadius, setScrewRadius, setScrewHeight);\n \/\/ spokes\n radial_array(vec=[0, 0, 1], n = spokes)\n translate([hubRadius - (stepWidth \/ 2), -(spokeWidth \/ 2), 0]) \n cube([(bearingOD \/ 2) - hubRadius, spokeWidth, 2 *stepHeight], center = false); \n \/\/ forearm extension\n difference() {\n translate([-forearmLength, -armWidth \/ 2, 0])\n cube([forearmLength, armWidth, bearingStep * 2], center=false);\n cylinder(h = bearingStep * 2, d = bearingOD);\n translate([-forearmLength, 0, 0])\n cylinder(h = bearingStep * 2, d = bearingOD \/ 2);\n \/\/ 4 on next line comes from dividing the bearingOD on the above line\n translate([-forearmLength + (bearingOD \/ 4) + (boundingBox \/ 2), -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD\/2) - (boundingBox + boundingBoxHalf), armWidth - boundingBox, bearingStep * 2], center = false);\n }\n\n intersection() {\n \n translate([-forearmLength + boundingBox * 2, -(armWidth \/ 2) + boundingBoxHalf, 0])\n cube([forearmLength - (bearingOD \/ 2) - boundingBox, armWidth - boundingBox, bearingStep * 2], center = false);\n for (i = [ bearingOD \/ 2 - boundingBoxHalf: armWidth : forearmLength]) {\n translate([ -i, 0, bearingStep])\n rotate([0, 0, 45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n translate([ -i, 0, bearingStep])\n rotate([0, 0, -45])\n cube([spokeWidth, armWidth + boundingBoxHalf, bearingStep * 2], center = true);\n }\n }\n \n\n }\n}\n\n\nmodule copy_mirror(vec=[0,1,0]) { \n children(); \n mirror(vec)\n children(); \n} \n\nmodule radial_array(vec = [0,0,1], n = 4) {\n for ( i = [0 : n - 1] )\n {\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n\nmodule radial_array_partial(vec = [0,0,1], n = 4, j = 2) {\n for ( i = [0 : n - 1] )\n {\n if (i < j)\n rotate( i * 360 \/ n, vec)\n children();\n } \n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"a95832467920f382503603fc9eafb2d01cbad787","subject":"Adapt piece to 3D printing Cut piece in two parts to be joined Avoid \"echafaudage\" Sligtly increase hole for potentiometer","message":"Adapt piece to 3D printing\nCut piece in two parts to be joined\nAvoid \"echafaudage\"\nSligtly increase hole for potentiometer\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/gimbal_connection.scad","new_file":"Hardware\/gimbal_connection.scad","new_contents":"guiding_length = 10;\nx = 2;\nspace = 16;\npotentiometer_diameter = 6.6;\nalpha = 2\/3;\n\ntotal_length = guiding_length*3\/2+space;\n\n\/\/ Bottom part\ndifference(){\n\tunion(){\n\t\tcube(size=[total_length,guiding_length,guiding_length], center = true);\n\t}\n\n\ttranslate([total_length\/2-guiding_length\/2,0,0]) cylinder(r=potentiometer_diameter\/2, h=10*guiding_length, center = true);\n\ttranslate([-total_length\/2+guiding_length\/2+guiding_length*(1-alpha)\/2,0,0]) cube(size=[alpha*guiding_length, alpha*guiding_length, 2*guiding_length],center = true) ;\n}\n\n\n\/\/ Top part to be inserted at 90deg\ntranslate([0,1.5*guiding_length,0])\nunion(){\ndifference(){\n\tunion(){\n\t\tcube(size=[total_length,guiding_length,guiding_length], center = true);\n\t}\n\n\ttranslate([total_length\/2-guiding_length\/2,0,0]) cylinder(r=potentiometer_diameter\/2, h=10*guiding_length, center = true);\n\n\tdifference(){\n\ttranslate([-total_length\/2+guiding_length\/2-1,0,0]) cube(size=[guiding_length+2, guiding_length+2, 2*guiding_length],center = true) ;\n\ttranslate([-total_length\/2+guiding_length\/2,0,-guiding_length*(1-alpha)\/2]) cube(size=[guiding_length, alpha*guiding_length, alpha*guiding_length],center = true) ;\n}\n}\n}\n\n\n\n","old_contents":"use \n\nguiding_length = 10;\nx = 2;\nspace = 15;\n\n\ndifference(){\nunion(){\n\thull(){\n\ttranslate([space +guiding_length\/2,0,0]) cube(size=[15,10,guiding_length], center = true);\n\ttranslate([x, 0, x]) sphere(3);\n\t}\n\n\thull(){\n\t\ttranslate([0,0,space+guiding_length\/2]) rotate([0,90,0])cube(size=[15,10,guiding_length], center = true);\n\t\ttranslate([x, 0, x]) sphere(3);\n\t}\n}\n\n\ttranslate([space +guiding_length\/2,0,0]) cylinder(r=3.25, h=10*guiding_length, center = true);\n\ttranslate([0,0,space+guiding_length\/2]) rotate([0,90,0])cylinder(r=3.25, h=10*guiding_length, center = true);\n\n\/\/space for nut\n\trotate([0,-90,0])\nunion(){translate([space +guiding_length\/2+4.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n translate([space +guiding_length\/2+2.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n\n\ttranslate([space +guiding_length\/2+5,0, 0]) rotate([0,90,0]) cylinder(r=1.5, h=15, center=true);}\n\n\ttranslate([space +guiding_length\/2+4.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n\ttranslate([space +guiding_length\/2+2.5,0, 0]) rotate([0,90,0]) translate([0,0,-1.25]) nutHole(3);\n\ttranslate([space +guiding_length\/2+5,0, 0]) rotate([0,90,0]) cylinder(r=1.5, h=15, center=true);\n\n\/\/Cube to visualize\n\t\/\/cube(space +guiding_length\/2+7);\n\n}\n\n\/\/cube(size=[sqrt(guiding_length\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5b89ea5949d8babed5dd6c786933367baa0c09ae","subject":"minor tweaks","message":"minor tweaks\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\n\/\/translate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ntranslate([xC,yC,linkOffset-.5]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/translate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ntranslate([xC,yC,linkOffset+1.8]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.2]) cylinder(r=1.4,h=7.2,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule crankLink(dx=CD) {\n cylinder(r=1.4,h=.7,$fn=24,center=true);\n color([0.3,0.3,0.4,0.9]) translate([dx-1,0,.6]) difference() {\n cube([5,2.7,2.2],center=true);\n #translate([1,0,0]) cylinder(r=.64,h=11,center=true);\n }\n translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\nmodule EFlink() {\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ 2,0,0]) cube([7,3,2],center=true);\n translate([EF-2,0,0]) cube([7,3,2],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-6,2.6,2.6],center=true);\n }\n\n #translate([EF,0,0]) cylinder(r=.4,h=3,center=true);\n # cylinder(r=.4,h=5,center=true);\n }\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() {\n translate([0,0,2.4]) cylinder(r=1.4,h=13.5,$fn=36,center=true);\n translate([0,0,2.4]) cube([4,4,7.9],center=true);\n }\n\n for(z=[-2.4,7.2]) {\n hull() {\n translate([BH-3,0,z]) sphere(.8);\n translate([ 0,0,z]) sphere(.8);\n }\n }\n\n hull() {\n translate([ 4,0.5,-2.4]) sphere(.8);\n translate([BH-5,1, 6 ]) sphere(.8); \n }\n hull() {\n translate([ 4,-.5, 7]) sphere(.8);\n translate([BH-5, -1, -2 ]) sphere(.8); \n }\n\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n\n}\nmodule BHlinks1() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\ntranslate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\ntranslate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ncheckLink(xC,yC,xH,yH,CH);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n #cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n #cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.5]) cylinder(r=1.4,h=8,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\nmodule EFlink() {\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ 2,0,0]) cube([7,3,2],center=true);\n translate([EF-2,0,0]) cube([7,3,2],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-6,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=.7,h=3,center=true);\n cylinder(r=.7,h=3,center=true);\n }\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a10974350acee09579f95d554b78838eef93563b","subject":"increased some diameters for better match","message":"increased some diameters for better match\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/adapter_nozzle.scad","new_file":"water_rocket_launcher\/adapter_nozzle.scad","new_contents":"use \n\nmodule nozzle()\n{\n module body()\n {\n h = 15;\n cylinder(d=26.5, h=h, $fn=fn(100));\n translate([0,0,h])\n {\n h = 24.5;\n cylinder(d=32, h=h, $fn=fn(120));\n translate([0,0,h])\n {\n h = 5;\n cylinder(d1=32, d2=21, h=h, $fn=fn(200));\n translate([0,0,h])\n cylinder(d1=21, d2=20, h=10, $fn=fn(200));\n }\n }\n }\n\n difference()\n {\n body();\n translate([0,0,-1])\n cylinder(d=9, h=60, $fn=fn(50));\n }\n}\n\nrotate([180, 0, 0])\n nozzle();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'water_rocket_launcher\/adapter_nozzle.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"769cc30f53052c52443304c496b72c9a6da8149a","subject":"Update to real measurements.","message":"Update to real measurements.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 290; \/\/ x = 29cm wall-to-wall\ndepth = 350; \/\/ y = 35cm to accomodate 34.5cm tank length\ni_height = 180+thickness;\n \/\/ z = 18cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*3;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\nthickness = 6.35; \/\/ 6.35mm = 1\/4\"\n\n\/\/ Interior box dimensions (from centerpoints of walls, so actual dimension is minus material thickness)\nwidth = 400; \/\/ x\ndepth = 300; \/\/ y\ni_height = 180; \/\/ z (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 20;\n\n\/\/ amount horizontal support bars extend past side supports\noutset = overhang\/2;\n\n\/\/ tank base plate\nbase_width = width-thickness*2;\nbase_height = overhang;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*3;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0);\n vert_face(x=width);\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n \/\/ camera supports\n hanging_supports(x=width, y=depth\/2, z=height\/2, out=20, up=30, spacing=20);\n \/\/ rpi support\n hanging_support(x=width, y=depth\/4+9, z=height\/2, out=3, up=85);\n mock_rpi(x=width, y=depth\/4, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n vert_face_base(x);\n camera_opening();\n \/\/ camera supports\n hanging_supports(x=width+thickness, y=depth\/2, z=height\/2+10, out=20, up=30, spacing=20);\n \/\/ rpi supports\n hanging_support(x=width+thickness, y=depth\/4+9, z=height\/2+10, out=3, up=85);\n scale([1,1,0.5])\n side_base(y=0);\n scale([1,1,0.5])\n side_base(y=depth);\n }\n}\n\nmodule vert_face_base(x) {\n translate([x-thickness\/2,-overhang,overhang])\n cube([thickness,depth+overhang*2,height-overhang]);\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule hanging_supports(x, y, z, out, up, spacing) {\n hanging_support(x, y + spacing\/2, z, out, up);\n hanging_support(x, y - spacing\/2, z, out, up);\n}\n\nmodule hanging_support(x, y, z, out, up) {\n inner_w = out+thickness;\n inner_h = up;\n inner_offset = 5;\n translate([x,y,z])\n \/\/ shift down to center on camera opening\n translate([0,0,-inner_offset])\n \/\/ push inner opening up against vert face\n translate([inner_w\/2,0,0])\n difference() {\n cube([inner_w+20, thickness, inner_h+30], center=true);\n \/\/ cutout for camera\n translate([0,0,inner_offset])\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-10-epsilon,0,0])\n cube([inner_w, thickness*2, inner_h-10], center=true);\n \/\/ bottom cutout\n translate([-inner_w\/2,0,-25])\n cube([thickness, thickness*2, 10], center=true);\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([thickness,-outset,base_height])\n difference() {\n cube([base_width, depth+outset*2, thickness]);\n cutouts(5,base_width,outset,rot=0,trans=[base_width\/2,0,0]);\n cutouts(5,base_width,outset,rot=180,trans=[base_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -epsilon])\n cube([w, outset+thickness, thickness+epsilon*2]);\n }\n}\n\nmodule light_wire_opening() {\n translate([light_pos_x, 0, light_height-10])\n scale([2,1,1])\n rotate(v=[1,0,0], a=90)\n cylinder(d=10, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n vert_face(x=0);\n vert_face(x=width);\n tank_base();\n light_bar();\n light_wire_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n cube([width+overhang*2, thickness, height]);\n}\n\nmodule mock_rpi(x, y, z) {\n translate([x+thickness, y, z])\n rotate(v=[0,1,0], a=90)\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"efa17279e6e03762962769ceb23f0960c3112905","subject":"zaxis\/motormount: fix show_motor","message":"zaxis\/motormount: fix show_motor\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"z-axis-motor-mount.scad","new_file":"z-axis-motor-mount.scad","new_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n %if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n","old_contents":"include \ninclude \n\nuse \n\ninclude \n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\n\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nzaxis_leadscrew_offset_x = zmotor_w\/2 + zmotor_mount_motor_offset;\n\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zaxis_motor_mount(show_motor=false)\n{\n\n difference()\n {\n \/\/ top plate\n union()\n {\n\n difference()\n {\n union()\n {\n \/\/ top plate\n cubea([zmotor_mount_rod_offset_x-zmotor_mount_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[1,0,1]);\n translate([zmotor_mount_rod_offset_x, 0, 0])\n {\n cubea([gantry_connector_thickness, zmotor_w+zmotor_mount_thickness*2, zmotor_mount_thickness_h], align=[-1,0,1]);\n }\n\n \/\/ reinforcement plate between motor and extrusion\n cubea([zmotor_mount_thickness, zmotor_w, zmotor_h], align=[1,0,-1]);\n\n \/\/ top extrusion mount plate\n translate([0, 0,-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_mount_width, extrusion_size], align=[1,0,1]);\n\n \/\/ bottom extrusion mount plate\n translate([0, 0, -main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([zmotor_mount_thickness, zmotor_w, extrusion_size], align=[1,0,1]);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([zmotor_mount_thickness, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=zmotor_mount_rod_offset_x-zmotor_mount_thickness, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=zmotor_mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((zmotor_w\/2)+zmotor_mount_thickness\/2), 0])\n cubea([zmotor_mount_thickness, zmotor_mount_thickness, zmotor_mount_h], align=[1,0,-1]);\n }\n\n }\n\n \/\/ cutout for motor cables\n translate([0,0,-30*mm])\n cubea([zmotor_mount_thickness*3, 20*mm, zmotor_h], align=[0,0,-1]);\n\n \/\/ screw holes top\n for(i=[-1,1])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia, orient=[1,0,0]);\n\n \/\/ screw hole bottom\n for(i=[0])\n translate([0, i*(zmotor_w\/2+zmotor_mount_thread_dia*3), -extrusion_size-main_lower_dist_z])\n fncylindera(h=zmotor_mount_thickness*3,d=zmotor_mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n }\n\n \/\/ cut out motor mount holes etc\n translate([zmotor_w\/2+zmotor_mount_motor_offset,0,-1])\n linear_extrude(zmotor_mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n\n \/\/ cut out z rod\n translate([zmotor_mount_rod_offset_x, 0, 0])\n fncylindera(d=zaxis_rod_d*rod_fit_tolerance, h=100, orient=[0,0,1]);\n\n \/\/ cut out z rod mounting clamp nut traps\n for(i=[-1,1])\n {\n translate([zmotor_mount_rod_offset_x-7, i*zmotor_mount_clamp_dist\/2, zmotor_mount_thickness_h\/2])\n {\n cubea([zmotor_mount_clamp_nut_thick*1.1, zmotor_mount_clamp_nut_dia*1.01, zmotor_mount_clamp_nut_dia*1.01], extrasize=[0,0,zmotor_mount_thickness_h], extrasize_align=[0,0,1]);\n\n fncylindera(d=zmotor_mount_clamp_thread_dia, h=20, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n if(show_motor)\n {\n attach([[lookup(NemaSideSize,zaxis_motor)\/2,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9650de849649dbf2900f71126f0d5b3f74e85799","subject":"wallet too","message":"wallet too\n","repos":"JoeSuber\/QuickerPicker","old_file":"PowerPac\/Magic_Wallet__v2_-_w_Dualstrusion_and_Printable_Straps\/magic_wallet.scad","new_file":"PowerPac\/Magic_Wallet__v2_-_w_Dualstrusion_and_Printable_Straps\/magic_wallet.scad","new_contents":"use ;\n\n\/* [Personalize] *\/\n\n\/\/Your text for the Red panel first line\ntext_line_1_side1=\"-\"; \n\/\/Your text for the Red panel second line\ntext_line_2_side1=\"Kara K.\";\n\/\/Your text for the Red panel third line\ntext_line_3_side1=\"-\"; \n\/\/The position of the text. Y-Axis only\ntext_position_side1=13; \/\/[1:25]\n\n\/\/is side 2 (Green Panel) text or an image?\nside2=\"image\"; \/\/[text,image]\n\n\/\/Your high contrast logo\nside2_image=\"tribmp.png\"; \/\/[image_surface:100x100]\n\n\/\/Image Scale\nimg_scale=1; \/\/[.1,.2,.3,.4,.5,.6,.7,.8,.9,1]\n\n\/\/The position of the text or image. Y-Axis only\ntext_position_side2y=0; \/\/[-25:25]\n\/\/The position of the text or image. x-Axis only\ntext_postion_side2x=0; \/\/[-25:25]\n\/\/Your text for the Green panel first line\ntext_line_1_side2=\"\"; \n\/\/Your text for the Green panel second line\ntext_line_2_side2=\"\"; \n\/\/Your text for the Green panel third line\ntext_line_3_side2=\"\"; \n\n\n\n\/\/Text Size\ntext_size=7; \/\/[0,1,2,3,4,5,6,7,8,9,10]\n\/\/How far should the text extrude?\ntext_height=1.5; \/\/[1,1.5,2,2.5]\n\/\/Select your font\ntext_font=\"orbitron.dxf\"; \/\/[write\/letters.dxf,write\/BlackRose.dxf,write\/braille.dxf,write\/knewave.dxf,write\/orbitron.dxf]\n\n\n\n\/* [Size and Shape] *\/\n\n\n\/\/Thickness of each side\nmw_height=1.5; \/\/[1.5:thin,2:medium,2.5:thick]\n\/\/Y-Axis Dimensions \nmw_width=60; \/\/[50:150]\n\/\/X-Axis Dimensions \nmw_length=100; \/\/[50:150]\n\/\/Left side hole heights\nmw_strap_small=15; \/\/[2:20]\n\/\/Right side hole heights\nmw_strap_big=15; \/\/[2:20]\n\/\/Strap hole widths\nmw_strap_w=2; \/\/[1,2,3]\n\/\/Up this when making strap holes wider\nstrap_dfe=3; \/\/[2,3,4]\n\n\n\/* [Advanced] *\/\n\n\/\/What should we print out? (Use individual sides for portait or larger wallets)\npart = \"all\" ; \/\/[sides:Sides Only,straps:Straps Only,all:Straps and Sides,side1:Red Side,side2:Green Side,text:text and images only]\n\n\/\/strap thickness\nstrap_thk=.3; \/\/probably don't want to mess with this\n\n\/\/tolerance for fit. subtracted from straps only\nfit_tol=.2; \/\/[0,.1,.2,.3,.4,.5,.6,.7,.8]\n\n\/* [Hidden] *\/\n\n\/\/size as defined above\nsize=[mw_width,mw_length,mw_height];\n\n\n\/\/Features waiting to be fixed\n\/\/Adjustable text rotation\ntext_rot=90;\n\/\/2x2 holes or 2x1 holes\nhole_count=0; \/\/[0:2x1,1:2x2]\n\n\n\nimage_file = \"image-surface.dat\"; \/\/ [image_surface:100x100]\n\n\n\/\/z shift for print of straps\nzshift=(strap_thk)*-1;\n\n\/\/---Don't mess with anything down here unless you know whats going on---\/\/\n\n\n\n\/\/PART BEGIN: Side 1 (red side)\n\nmodule magicWallet_side1()\n{\n\tdifference()\n\t{\n\t\tunion() \/\/All the parts that we want to add\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\tcolor(\"red\")\n\t\t\tcube(size, center=true);\n\n\t\tif(print==\"text\")\n\t\t{\n\t\t\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\/\/text line 1 \t\n\t\t\ttranslate([text_position_side1*-1,0,size[2]-1])\n\t\t\tcolor(\"black\")\n\t\t\trotate(text_rot)\n\t\t\twrite(text_line_1_side1,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\/\/text line 2\n\t\t\ttranslate([(text_size+2+(text_position_side1*-1)),0,size[2]-1])\n\t\t\tcolor(\"black\")\n\t\t\trotate(text_rot)\n\t\t\twrite(text_line_2_side1,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\/\/text line 3\n\t\t\ttranslate([(2*(text_size+2)+(text_position_side1*-1)),0,size[2]-1])\n\t\t\tcolor(\"black\")\n\t\t\trotate(text_rot)\n\t\t\twrite(text_line_3_side1,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t}\n\n\t\t\t\n\t\t}\n\t\t\n\t\tunion() \/\/All the parts that we want to remove\n\t\t{\n\n\/\/Makes sure the bottom has nothing protruding (problem with adding images)\n\t\t\ttranslate([0,0,-size[2]])\n\t\t\tcube(size, center=true);\n\n\/\/ making the holes for the small straps\n\n\/\/bottom\n\t\t\ttranslate([size[0]\/3,(size[1]\/2-strap_dfe)*-1,-size[2]])\n\t\t\tcube([mw_strap_small,mw_strap_w,20],center=true);\n\n\/\/top\t\t\t\n\t\t\ttranslate([(size[0]\/3*-1),(size[1]\/2-strap_dfe)*-1,-size[2]])\n\t\t\tcube([mw_strap_small,mw_strap_w,20],center=true);\n\n\/\/ making the holes for the big straps (1\/2 of height and right side)\n\t\t\ttranslate([0,(size[1]\/2-strap_dfe),-size[2]])\n\t\t\tcube([mw_strap_big,mw_strap_w,20],center=true);\n\n\/\/ Pretty edges to be added\n\n\t\n\t\n\t\t}\n\n\t}\n\t\n}\n\/\/PART END: Side 1 \n\n\/\/PART BEGIN: Side 2 (Green Side)\n\nmodule magicWallet_side2()\n{\n\n\tdifference()\n\t{\n\t\tunion() \/\/All the parts that we want to add\n\t\t{\n\t\t\tcolor(\"green\")\n\t\t\tcube(size, center=true);\n\t\tif(part==\"text\")\n\t\t{\n\t\t\n\t\t}\n\t\telse\n\t\t{\t\n\n\t\t\tif(side2==\"image\")\n\t\t\t{\n\n\t\t\n\t\t\t\ttranslate([text_position_side2y*-1,text_postion_side2x,size[2]-.8])\n\t\t\t\tcolor(\"black\")\n\t\t\t\tscale([img_scale\/1.71,img_scale\/1.71,text_height\/25]) \n\t\t\t\trotate(90)\n\t\t\t\tsurface(file=side2_image, center=true, convexity=5);\n\t\t\n\t\t\t}\n\t\t\t\telse\n\t\t\t{\n\t\t\t\/\/text line 1 \t\n\t\t\t\ttranslate([text_position_side2y*-1,text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\trotate(text_rot)\n\t\t\t\twrite(text_line_1_side2,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\t\/\/text line 2\n\t\t\t\ttranslate([(text_size+2+(text_position_side2y*-1)),text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\trotate(text_rot)\n\t\t\t\twrite(text_line_2_side2,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\t\/\/text line 3\n\t\t\t\ttranslate([(2*(text_size+2)+(text_position_side2y*-1)),text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\trotate(text_rot)\n\t\t\t\twrite(text_line_3_side2,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tunion() \/\/All the parts that we want to remove\n\t\t{\n\t\n\t\t\t\/\/Makes sure the bottom has nothing protruding (problem with adding images)\n\t\t\ttranslate([0,0,-size[2]])\n\t\t\tcube(size, center=true);\n\n\t\t\t\/\/ making the holes for the small straps\n\n\t\t\t\/\/bottom\n\t\t\ttranslate([size[0]\/3, (size[1]\/2-strap_dfe)*-1,-size[2]])\n\t\t\tcube([mw_strap_small,mw_strap_w,20],center=true);\n\n\t\t\t\/\/top\t\t\t\n\t\t\ttranslate([(size[0]\/3*-1),(size[1]\/2-strap_dfe)*-1,-size[2]])\n\t\t\tcube([mw_strap_small,mw_strap_w,20],center=true);\n\n\t\t\t\/\/ making the holes for the big straps\n\t\t\ttranslate([0,(size[1]\/2-strap_dfe),-size[2]])\n\t\t\tcube([mw_strap_big,mw_strap_w,20],center=true);\n\n\/\/ Pretty edges to be added\n\n\n\t\n\t\t}\n\n\t}\n\t\n}\n\n\/\/PART END: Side 2\n\n\/\/PART BEGIN: STRAPS\n\nmodule smallStraps()\n{\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\ttranslate([0,0,0])\n\t\t\tcube([mw_strap_small-fit_tol,size[1]+size[2]*2,mw_strap_w-fit_tol],center=true);\n\t\t\t\n\t\t\ttranslate([-mw_strap_small*1.1,0,0])\n\t\t\tcube([mw_strap_small-fit_tol,size[1]+size[2]*2,mw_strap_w-fit_tol],center=true);\n\t\t}\n\n\t\tunion()\n\t\t{\n\t\t\ttranslate([0,0,zshift])\n\t\t\tcube([mw_strap_small,size[1],mw_strap_w-strap_thk],center=true);\n\t\t\t\n\t\t\ttranslate([-mw_strap_small*1.1,0,zshift])\n\t\t\tcube([mw_strap_small,size[1],mw_strap_w-strap_thk],center=true);\n\t\t}\n\t}\n\n}\n\nmodule bigStraps()\n{\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\ttranslate([0,0,0])\n\t\t\tcube([mw_strap_big-fit_tol,size[1]+size[2]*2,mw_strap_w-fit_tol],center=true);\n\t\t\t\n\t\t}\n\n\t\tunion()\n\t\t{\n\t\t\ttranslate([0,0,zshift])\n\t\t\tcube([mw_strap_big,size[1],mw_strap_w-strap_thk],center=true);\n\t\t\t\n\t\t}\n\t}\n\n}\n\n\/\/END PART: Straps\n\n\/\/BEGIN PART: Text (for when print==\"text\")\n\n\nmodule textOnly()\n\n{\t\nif(part==\"text\")\n{\n\n\t\tdifference()\t\n\t\t{\n\t\t\tunion()\n\t\t\t{\n\ntranslate([0,0,size[2]\/2])\n{\n\t\t\/\/text line 1 \t\n\t\t\ttranslate([text_position_side1*-1,0,size[2]-1])\n\t\t\tcolor(\"black\")\n\t\t\trotate(text_rot)\n\t\t\twrite(text_line_1_side1,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\/\/text line 2\n\t\t\ttranslate([(text_size+2+(text_position_side1*-1)),0,size[2]-1])\n\t\t\tcolor(\"black\")\n\t\t\trotate(text_rot)\n\t\t\twrite(text_line_2_side1,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\/\/text line 3\n\t\t\ttranslate([(2*(text_size+2)+(text_position_side1*-1)),0,size[2]-1])\n\t\t\tcolor(\"black\")\n\t\t\trotate(text_rot)\n\t\t\twrite(text_line_3_side1,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\n}\n\ntranslate([size[0]+4,0,size[2]\/2])\n{\n\t\t\tif(side2==\"image\")\n\t\t\t\t{\n\n\t\t\n\t\t\t\ttranslate([text_position_side2y*-1,text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\tscale([img_scale,img_scale,text_height]) \n\t\t\t\trotate(90)\n\t\t\t\tsurface(file=side2_image, center=true, convexity=5);\n\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\/\/text line 1 \t\n\t\t\t\ttranslate([text_position_side2y*-1,text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\trotate(text_rot)\n\t\t\t\twrite(text_line_1_side2,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\t\/\/text line 2\n\t\t\t\ttranslate([(text_size+2+(text_position_side2y*-1)),text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\trotate(text_rot)\n\t\t\t\twrite(text_line_2_side2,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\t\/\/text line 3\n\t\t\t\ttranslate([(2*(text_size+2)+(text_position_side2y*-1)),text_postion_side2x,size[2]-1])\n\t\t\t\tcolor(\"black\")\n\t\t\t\trotate(text_rot)\n\t\t\t\twrite(text_line_3_side2,h=text_size,t=text_height,font=text_font,\n\t\t\t\tcenter=true);\n\t\t\t\t}\n}\n\n\t\t\t}\n\t\t\tunion()\n\t\t\t{\n\t\t\ttranslate([0,0,size[2]\/2])\n\t\t\tcube(size,center=true);\n\t\t\t\n\t\t\ttranslate([size[0]+4,0,size[2]\/2])\t\n\t\t\tcube(size, center=true);\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\n\t\telse\n\t\t{\t\n\t\t}\n}\n\n\/\/Print Parts\n\nprint_part();\n\nmodule print_part() {\n\tif (part == \"sides\") {\n\t\tsides();\n\t} else if (part == \"straps\") {\n\t\tstraps();\n\t} else if (part == \"all\") {\n\t\tall();\n\t} else if (part == \"side1\") {\n\t\tside1();\n\t} else if (part == \"side2\") {\n\t\tside2();\n\t} else if (part == \"text\") {\n\t\tjusttext();\n\t} else {\n\t\tall();\n\t}\n}\n\nmodule all()\n{\n\ttranslate([0,0,size[2]\/2])\n\tmagicWallet_side1();\n\n\t\/\/move side 2 down 1 width + 4\n\ttranslate([size[0]+4,0,size[2]\/2])\n\tmagicWallet_side2();\n\n\t\n\t\t\/\/move small straps to right of design by 1 length + 4 and rotate 90\n\t\tcolor(\"gray\")\n\t\ttranslate([size[0]*.5,size[1]\/2+1.1*mw_strap_small,(mw_strap_w-fit_tol)\/2])\n\t\trotate([0,180,90])\n\t\tsmallStraps();\n\n\t\n\t\t\/\/move big straps to left of design by 1.1 length and rotate 90\n\t\tcolor(\"gray\")\n\t\ttranslate([size[0]*.5,(size[1]\/2+1.1*mw_strap_big)*-1,(mw_strap_w-fit_tol)\/2])\n\t\trotate([0,180,90])\n\t\tbigStraps();\n}\n\nmodule sides()\n{\n\ttranslate([0,0,size[2]\/2])\n\tmagicWallet_side1();\n\n\t\/\/move side 2 down 1 width + 4\n\ttranslate([size[0]+4,0,size[2]\/2])\n\tmagicWallet_side2();\n}\n\nmodule straps()\n{\n\t\t\/\/move small straps to right of design by 1 length + 4 and rotate 90\n\t\tcolor(\"gray\")\n\t\ttranslate([size[0]*.5,0,(mw_strap_w-fit_tol)\/2])\n\t\trotate([0,180,90])\n\t\tsmallStraps();\n\n\t\n\t\t\/\/move big straps to left of design by 1.1 length and rotate 90\n\t\tcolor(\"gray\")\n\t\ttranslate([size[0]*.5, -(mw_strap_big+mw_strap_small),(mw_strap_w-fit_tol)\/2])\n\t\trotate([0,180,90])\n\t\tbigStraps();\n\n}\n\nmodule side1()\n{\n\t\tmagicWallet_side1();\n}\n\nmodule side2()\n{\n\t\tmagicWallet_side2();\n}\n\nmodule justtext()\n{\n\ttextOnly();\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'PowerPac\/Magic_Wallet__v2_-_w_Dualstrusion_and_Printable_Straps\/magic_wallet.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0d15db768d5c80642ca0f3200f90a47fa14cce4e","subject":"Final tweak for model printed on RPI's Stratasys uPrint","message":"Final tweak for model printed on RPI's Stratasys uPrint\n","repos":"joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo","old_file":"typeatron\/mark1\/typeatron-mark1.scad","new_file":"typeatron\/mark1\/typeatron-mark1.scad","new_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of whatever printer we have.\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.2; \/\/ max value, from the data sheet\npressureSensorThick = 0.35; \/\/ from the data sheet\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0; \/\/ this is the height of the body of the push button (without the actual button)\npushButtonBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = pushButtonPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 0.75;\nbuttonRetainerHookHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + pushButtonHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2*buttonRetainerThick\n + (pushButtonHeight-pushButtonWellDepth+foreignPartClearance)\n + pressureSensorThick + 0.15 \/\/ TODO: improve this estimate when you have the sensor in hand\n + 0.1; \/\/ \"a little extra\" which can be easily corrected with tape or paint\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n w = pushButtonWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the push button well\n fsrChannelDepth = pushButtonLegLength + pushButtonHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-pushButtonLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-pushButtonLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, pushButtonHeight - pushButtonWellDepth]);\n }\n\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]);\n\n \/\/ retainer wells\n translate([0,0,-pushButtonWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","old_contents":"\/*\nOpenSCAD design for Typeatron Mark 1\nCopyright 2013 by Joshua Shinavier\n\nNote: the origin is at the \"bottom right\" of the case (in the empty space where the lid goes),\nwith the thumb to the north (the y axis), the fingers of the left hand to the left\n(the x axis) and pointing away, and the bottom of the case pointing down (the z axis)\naway from the palm.\n*\/\n\nfunction sq(x) = x*x;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ rendering settings\n\n\/\/ toggle this variable to see the ICs in position and make sure they fit inside the case\nvisualizeInternalComponents = false;\nbuttonsInSitu = false;\n\nsimpleEdges = true;\n\n\/*\ncornerRoundingRes = 100;\nledDomeRes = 100;\nthumbCurveRes = 50;\n\/\/*\/\n\/\/*\ncornerRoundingRes = 10;\nledDomeRes = 10;\nthumbCurveRes = 10;\n\/\/*\/\n\nledRimRes = 20;\nlightSensorWellRes = 20;\npinHoleRes = 10;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ printer parameters\n\n\/\/ the following values are for Shapeways' \"Strong & Flexible Plastics\" material\nshapewaysAccuracy = 0.15; \/\/ then 0.15% of longest axis\n\n\/\/accuracy = 0.178; \/\/ for Stratasys Dimension Elite\naccuracy = 0.254; \/\/ for Stratasys uPrint\n\naccuracyRatio = accuracy \/ shapewaysAccuracy;\n\n\/\/ Additional figures from Shapeways, but adjusted for the resolution of whatever printer we have.\n\/\/ Assumed to be more or less analogous.\nclearance = 0.5 * accuracyRatio;\nminWallSupported = 0.7 * accuracyRatio;\nminWallFree = 0.7 * accuracyRatio;\nminWireSupported = 0.9 * accuracyRatio;\nminWireFree = 1.0 * accuracyRatio;\nminEmbossedDetail = 0.2 * accuracyRatio;\nminEmbossedText = 0.5 * accuracyRatio;\nminEngravedDetail = 0.2 * accuracyRatio;\nminEngravedText = 0.5 * accuracyRatio;\n\/\/Min Bounding Box: x+y+z \u2265 7.5mm\n\/\/Max Bounding Box: 650x350x550mm (White) \u00b7 230x180x320mm (Black) \u00b7 150x150x150mm (Polished & Dyed)\n\naccuracy2 = accuracy * 2;\n\n\/\/ A safe gap between the printed part and each side of a foreign object such as a circuit board.\n\/\/ We assume these have been directly measured with digital calipers (as opposed to relying on product specifications),\n\/\/ with an accuracy of no less than 0.1mm.\nforeignPartClearance = accuracy + 0.1;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ dimensions of foreign parts\n\nbatteryWidth = 25;\nbatteryLength = 36;\nbatteryHeight = 5.4;\n\nchargerHeaderLength = 5.1;\nchargerHeaderWidth = 2.6;\n\nlaserWidth = 10.3;\nlaserThick = 3.3;\n\nledDomeRadius = 5.0 \/ 2;\nledRimRadius = 5.9 \/ 2;\nledRimThick = 1.0;\n\nlightSensorRadius = 5.0 \/ 2;\nlightSensorThick = 2.0;\nlightSensorWireThick = 0.6;\n\nmodemWidth = 16.8;\nmodemLength = 42.8;\nmodemHeight = 4.1;\n\nmotionSensorWidth = 15.4;\nmotionSensorLength = 25.8;\nmotionSensorHeight = 2.5;\n\npowerSwitchLength = 11.7;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.7;\n\npressureSensorWidth = 7.2; \/\/ max value, from the data sheet\npressureSensorThick = 0.35; \/\/ from the data sheet\n\npushButtonWellWidth = 7;\npushButtonHeight = 5.0;\npushButtonLegLength = 3.4;\npushButtonPressDepth = 0.25;\npushButtonWellDepth = 4.0; \/\/ this is the height of the body of the push button (without the actual button)\npushButtonBaseThick = 1.5;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4; \/\/ used only for visualization\nnanoHeightToUsbBase = 3.4;\nnanoUsbWidth = 7.7;\nnanoUsbHeight = 3.8;\nnanoUsbCableWidth = 9.6;\nnanoUsbCableHeight = 6.6;\nnanoUsbCableOffsetFromPerfboard = 3.3;\n\ntransducerWidth = 14.5;\ntransducerLength = 21.5;\ntransducerHeight = 7.9;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ parameters of the printed part\n\n\/\/ measurements taken from the clay model\nthumbCurveRadius = 39.0;\noffsetFromTopEdgeToFirstFinger = 15.0;\nfingerWidth = 84 \/ 4; \/\/ 21 -- 82mm was measured, but this seemed a little cramped\nthumbWidth = 25;\nthumbUpperRightX = 25.0;\nfingerWellDepth = 5;\nthumbWellDepth = 5;\n\n\/\/ reasonably chosen values\ncaseWidth = 70;\ncaseLength = 120;\nlidThick = 1.5;\nfloorThick = 1.5;\n\ndividerThick = minWallSupported * 1.5;\n\n\/\/ horizontal offset of components with ports\/controls on the bottom edge\nnanoOffset = 0;\nchargerHeaderOffset = nanoOffset + nanoWidth + foreignPartClearance + dividerThick;\n\/\/ place the power switch a reasonable distance past the charger header\npowerSwitchOffset = chargerHeaderOffset + chargerHeaderWidth + foreignPartClearance + 5;\n\nthickestComponent = transducerHeight;\ncavityHeight = thickestComponent + foreignPartClearance;\ncaseHeight = lidThick + floorThick + cavityHeight;\n\nrimThick = caseHeight\/2;\n\/\/ TODO: give the case a square profile by making caseCornerRadius less than half of the case height\ncaseCornerRadius = rimThick;\n\ntopYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2;\nbottomYOfFingers = caseLength - offsetFromTopEdgeToFirstFinger - 4*fingerWidth - dividerThick\/2;\n\nalignmentPegWidth = 2;\nalignmentPegHeight = 2;\n\nbuttonHeight = 8;\nbuttonWidth = pushButtonWellWidth;\nfingerButtonLength = fingerWidth - dividerThick;\nthumbButtonLength = thumbWidth - dividerThick;\nbuttonClearance = accuracy; \/\/ clearance between button and walls (on all four sides)\nbuttonLip = 2.5;\nbuttonSlack = pushButtonPressDepth * 2; \/\/ minimum vertical clearance between button and floor\/retainers\nbuttonStabilizerThick = 1.75; \/\/ vertical bars on buttons and case\nbuttonRetainerThick = 1.0; \/\/ horizontal bars on buttons and case\nbuttonRetainerGap = 1.0;\nbuttonRetainerHookHeight = pushButtonHeight - (pushButtonPressDepth + buttonSlack + accuracy2);\n\n\/\/ buttons are inset by only 1\/3 of the depth of the finger or thumb well\ntotalFingerWellDepth = fingerWellDepth\/3 + buttonHeight + pushButtonHeight;\ntotalThumbWellDepth = thumbWellDepth\/3 + buttonHeight + pushButtonHeight;\n\n\/\/ this keeps the edges of the thumb container from protruding out of the case\nthumbWellDepression = 2;\n\nthumbUpperRightY = caseLength - thumbCurveRadius + sqrt(sq(thumbCurveRadius) - sq(thumbCurveRadius - thumbUpperRightX)) - thumbWellDepression;\n\npinHoleRadius = 0.7 * sqrt(accuracyRatio);\npinHoleBlockWidth = 2 * (pinHoleRadius + clearance*1.5);\n\n\/\/ just to be on the safe side, we overestimate the necessary clearance\npressureSensorChannelHeight = clearance * 1.5;\n\ncavityWidth = caseWidth - rimThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - 2*rimThick;\n\nbuttonLidHeight = (caseHeight-buttonWidth)\/2;\n\n\/\/ for visualization only\nnanoVizOffsetX = 1;\nnanoVizOffsetY = 1;\nmodemVizOffsetX = cavityWidth - 2 - 16;\nmodemVizOffsetY = nanoLength + dividerThick + 2;\nmotionSensorVizOffsetX = nanoOffset + nanoWidth + dividerThick + 3;\nmotionSensorVizOffsetY = 3;\nbatteryVizOffsetX = modemVizOffsetX - 1 - 25;\nbatteryVizOffsetY = modemVizOffsetY;\ntransducerVizOffsetX = motionSensorVizOffsetX;\ntransducerVizOffsetY = motionSensorVizOffsetY + 1 + 26;\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ modules\n\n\/\/ creates a button of the given length. Clearance on all sides of the button is subtracted.\n\/\/ the long axis of the button is x. y is side-to-side. z is up and down (as you press the button).\nmodule button(length) {\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n retainerLength = innerRetainerWellWidth - buttonClearance - buttonRetainerGap;\n\n \/\/ this measurement is crucial\n stabilizerHeight\n = 2*buttonRetainerThick\n + (pushButtonHeight-pushButtonWellDepth+foreignPartClearance)\n + pressureSensorThick + 0.15 \/\/ TODO: improve this estimate when you have the sensor in hand\n + 0.1; \/\/ \"a little extra\" which can be easily corrected with tape or paint\n\n difference() {\n union() {\n \/\/ rounded cap\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) {\n cylinder(h=length-2*buttonClearance,r=buttonWidth\/2-buttonClearance, $fn=cornerRoundingRes);\n }\n }\n\n \/\/ button body\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([length-2*buttonClearance,buttonWidth-2*buttonClearance,buttonHeight-buttonWidth\/2]);\n }\n\n \/\/ stabilizer bars\n translate([buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n translate([length-buttonStabilizerThick-buttonClearance,buttonClearance,buttonHeight]) {\n cube([buttonStabilizerThick, buttonWidth-2*buttonClearance, stabilizerHeight]);\n }\n\n \/\/ retainer bars\n translate([buttonClearance,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n translate([length-buttonClearance-retainerLength,buttonClearance,buttonHeight+stabilizerHeight-buttonRetainerThick]) {\n cube([retainerLength,buttonWidth-2*buttonClearance, buttonRetainerThick]);\n }\n }\n\n\t \/\/ hollow out the button to save plastic\/money\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=length+1,r=buttonWidth\/3); }\n }\n }\n}\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(length, depth) {\n w = pushButtonWellWidth + foreignPartClearance;\n l = 1.5; \/\/ width of leg holes\n\n outerRetainerWellWidth = buttonStabilizerThick + buttonRetainerGap;\n innerRetainerWellWidth = (length - pushButtonWellWidth - foreignPartClearance)\/2 - buttonStabilizerThick;\n\n \/\/ the pressure sensor channels extend slightly past the push button well\n fsrChannelDepth = pushButtonLegLength + pushButtonHeight;\n\n translate([-w\/2, -w\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([w, w, depth]);\n\n translate([0,0,-pushButtonLegLength]) {\n \/\/ channels for legs\/wires of switch\n translate([0,0,0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,0, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([0,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n translate([w-l,w-l, 0]) {\n cube([l,l,depth+pushButtonLegLength]);\n }\n }\n }\n\n \/\/ channels for pressure sensor\n \/\/ note: the slight 0.001 overlap prevents a confusing \"film\" in the STL\n translate([-(pressureSensorWidth+foreignPartClearance)\/2,-w\/2,-pushButtonLegLength]) {\n translate([0, -pressureSensorChannelHeight, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight+0.001, fsrChannelDepth]);\n }\n translate([0, w-0.001, 0]) {\n cube([pressureSensorWidth+foreignPartClearance, pressureSensorChannelHeight, fsrChannelDepth]);\n }\n }\n\n \/\/ rim to allow the pressure sensor to wrap around\n translate([-(pressureSensorWidth+foreignPartClearance)\/2, -w\/2-pressureSensorChannelHeight, depth]) {\n cube([pressureSensorWidth+foreignPartClearance, w+2*pressureSensorChannelHeight, pushButtonHeight - pushButtonWellDepth]);\n }\n\n translate([-length\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n \/\/ rectangular well for button body\n cube([length,buttonWidth,buttonHeight+10]);\n\n \/\/ retainer wells\n translate([0,0,-pushButtonWellDepth]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n\n translate([length-outerRetainerWellWidth,0,0]) {\n cube([outerRetainerWellWidth, buttonWidth, pushButtonWellDepth]);\n }\n\n translate([length-innerRetainerWellWidth,0,0]) {\n cube([innerRetainerWellWidth, buttonWidth, pushButtonWellDepth - buttonRetainerThick]);\n }\n\t\t}\n }\n}\n\n\/\/ depth: depth of circular well for the finger\n\/\/ width: width of the entire construction\n\/\/ totalWellDepth: depth to base of push button switch\n\/\/ buttonLength: length of the moving part\nmodule fingerWell(depth, width, totalWellDepth, buttonLength) {\n x = width \/ 2;\n y = depth;\n radius = (x*x + y*y) \/ (2*y);\n\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius, $fn=cornerRoundingRes);\n }\n\n translate([radius - depth, 0, rimThick]) {\n cylinder(h=rimThick+.001, r1=radius-rimThick\/2, r2=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n \n translate([radius - depth,0,0]) {\n cylinder(h=rimThick+.001, r2=radius-rimThick\/2, r1=radius+rimThick\/2, $fn=cornerRoundingRes);\n }\n\n \/\/ well and channels for push button switch and wires\n translate([-totalWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(buttonLength, pushButtonWellDepth);\n }}\n }\n}\n\nmodule fingerContainer(totalWellDepth, buttonLength) {\n translate([-totalWellDepth-pushButtonBaseThick, -buttonLength\/2-dividerThick, lidThick]) {\n cube([totalWellDepth+pushButtonBaseThick, buttonLength + 2*dividerThick, caseHeight-lidThick]);\n }\n}\n\nmodule buttons() {\n fingerButtonsPrintable = [caseWidth + 15,bottomYOfFingers+dividerThick,10];\n fingerButtonsInSitu = [caseWidth - fingerWellDepth * 1\/3,bottomYOfFingers + dividerThick,buttonLidHeight + buttonWidth];\n thumbButtonPrintable = [thumbUpperRightX+thumbButtonLength+dividerThick,caseLength+12,10];\n thumbButtonInSitu = [thumbUpperRightX + thumbWidth - dividerThick\/2,thumbUpperRightY - fingerWellDepth * 1\/3, buttonLidHeight + buttonWidth];\n\n \/\/ TODO: simplify this ridiculous if..then\n if (buttonsInSitu) {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsInSitu) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonInSitu) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n } else {\n \/\/ Note: the buttons are oriented so as to make the longest surfaces the smoothest\n translate(fingerButtonsPrintable) {\n for (i = [0:3]) {\n translate([0,i*fingerWidth,0]) { rotate([90,180,-90]) {\n button(fingerButtonLength);\n }}\n }\n }\n translate(thumbButtonPrintable) {\n rotate([90,180,0]) {\n button(thumbButtonLength);\n }\n }\n }\n}\n\n\/\/ for the thumb rest\nmodule roundedCylinder(height, radius, cornerRadius) {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=caseHeight);\n translate([0, 0, caseCornerRadius]) {\n rotate_extrude($fn=thumbCurveRes) {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n cylinder(r=thumbCurveRadius, h=(caseHeight - 2*caseCornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, caseHeight - caseCornerRadius]) {\n rotate_extrude() {\n translate([thumbCurveRadius - caseCornerRadius, 0, 0]) {\n circle(r = caseCornerRadius, $fn=cornerRoundingRes);\n }\n }\n } \n}\n\n\/\/ for the rounded flat edges of the case\nmodule roundedEdge(length, height, cornerRadius) {\n rem = height - 2*cornerRadius;\n\n if (simpleEdges) {\n cylinder(r=cornerRadius, h=length, $fn=cornerRoundingRes);\n } else {\n intersection() {\n translate([-height\/2, 0, 0]) {\n cube([height, cornerRadius, length]);\n }\n union() {\n translate([-rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([rem\/2.0, 0, 0]) {\n cylinder(h=length, r=cornerRadius, $fn=cornerRoundingRes);\n }\n translate([-rem\/2.0, -cornerRadius, 0]) {\n cube([rem, 2 * cornerRadius, length]);\n }\n }\n }\n }\n}\n\n\/\/ for the intersections between rounded edges\nmodule roundedCorner(height, cornerRadius) {\n if (simpleEdges) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n } else {\n difference() {\n union() {\n translate([0, 0, -height\/2.0 + cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n cylinder(r=cornerRadius, h=(height - 2*cornerRadius), $fn=cornerRoundingRes);\n }\n translate([0, 0, height\/2.0 - cornerRadius]) {\n sphere(r=cornerRadius, $fn=cornerRoundingRes);\n }\n }\n translate([0, 0, -height\/2]) {\n cube([cornerRadius, cornerRadius, height]);\n }\n }\n }\n}\n\nmodule pinHole() {\n translate([0,0,-1]) {\n cylinder(h=caseHeight+2,r=pinHoleRadius, $fn=pinHoleRes);\n }\n}\n\nmodule pinHoles() {\n \/\/ pinholes on the straight portion of the right edge\n for (i = [1:4]) {\n translate([rimThick*2\/3, rimThick*2\/3 + i*(caseLength-thumbCurveRadius - rimThick*2\/3)\/4, 0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes close to the corners\n translate([rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,rimThick+pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,caseLength-rimThick*2\/3,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick*2\/3,caseLength-rimThick-pinHoleRadius,0]) {\n pinHole();\n }\n translate([caseWidth-rimThick-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n\n \/\/ pinholes on the bottom edge which avoid interfering with the battery charger port, power switch, and USB port\n translate([rimThick,0,0]) {\n translate([nanoOffset+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([nanoOffset+nanoWidth-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset-pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n translate([powerSwitchOffset+powerSwitchLength+2*dividerThick+2*foreignPartClearance+pinHoleRadius,rimThick*2\/3,0]) {\n pinHole();\n }\n }\n\n \/\/ pinholes on curved surface of thumb rest\n translate([thumbCurveRadius, caseLength-thumbCurveRadius, 0]) {\n rotate([0,0,-20]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-40]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n rotate([0,0,-60]) {\n translate([-thumbCurveRadius+rimThick*2\/3,0,0]) {\n pinHole();\n }\n }\n }\n\n \/\/ finger pinholes\n translate([rimThick + cavityWidth + pinHoleBlockWidth\/2,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2,0]) {\n pinHole();\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i,\n 0]) {\n pinHole();\n }\n }\n translate([rimThick+cavityWidth, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4 + pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n\n \/\/ thumb pinholes\n translate([thumbUpperRightX+1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n translate([thumbUpperRightX+thumbWidth-1.5, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth\/2, 0]) {\n pinHole();\n }\n}\n\nmodule lightSensorWell() {\n translate([caseWidth + 1, ((caseLength - rimThick) + topYOfFingers) \/ 2, caseHeight \/ 2]) {\n rotate([0,-90,0]) { rotate([0,0,90]) {\n cylinder(r=(lightSensorRadius+foreignPartClearance), h=(lightSensorThick+foreignPartClearance + 1), $fn=lightSensorWellRes);\n translate([-lightSensorRadius, -(lightSensorWireThick + foreignPartClearance)\/2, 0]) {\n cube([lightSensorRadius*2, lightSensorWireThick + foreignPartClearance, rimThick + 2]);\n }\n }}\n }\n}\n\nmodule statusLEDHole() {\n translate([caseWidth - rimThick - 5.5, caseLength, caseHeight\/2]) {\n rotate(a=[90,0,0]) {\n cylinder(h=rimThick,r=ledDomeRadius+foreignPartClearance, $fn=ledDomeRes);\n\n \/\/ note: the rim depression uses a larger accuracy\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,-2+rimThick]) {\n cylinder(h=5,r=ledRimRadius+foreignPartClearance, $fn=ledRimRes);\n }\n }\n }\n}\n\nmodule caseConvexHull() {\n \/\/ box with cutout for thumb cylinder\n difference() {\n translate([rimThick, rimThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([0, caseLength - thumbCurveRadius, -1]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight + 2]);\n }\n }\n\n \/\/ thumb rest\n difference() {\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, 0]) {\n intersection() {\n roundedCylinder(caseHeight, thumbCurveRadius, caseCornerRadius);\n translate([-thumbCurveRadius, 0, 0]) {\n cube([thumbCurveRadius, thumbCurveRadius, caseHeight]);\n }\n }\n }\n translate([thumbCurveRadius, caseLength - thumbCurveRadius, lidThick]) {\n intersection() {\n cylinder(r=(thumbCurveRadius - caseCornerRadius), h=cavityHeight);\n translate([-thumbCurveRadius, 0, 0]) { cube([thumbCurveRadius, thumbCurveRadius, caseHeight]); }\n }\n }\n }\n\n \/\/ rounded edges and corners\n ccr = caseCornerRadius;\n shortEdge = caseWidth - 2*ccr;\n mediumEdge = caseLength - thumbCurveRadius - ccr;\n longEdge = caseLength - 2 * ccr;\n tinyEdge = caseWidth - thumbCurveRadius - ccr;\n translate([ccr, ccr, caseHeight\/2.0]) {\n roundedCorner(caseHeight, ccr);\n rotate([-90, 0, 0]) { rotate([0, 0, 90]) {\n roundedEdge(mediumEdge, caseHeight, ccr);\n }}\n rotate([0, 90, 0]) { rotate([0, 0, 180]) {\n roundedEdge(shortEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, ccr, caseHeight\/2.0]) {\n rotate([0, 0, 90]) { roundedCorner(caseHeight, ccr); }\n rotate([-90, 0, 0]) { rotate([0, 0, -90]) {\n roundedEdge(longEdge, caseHeight, ccr);\n }}\n }\n translate([caseWidth-ccr, caseLength-ccr, caseHeight\/2.0]) {\n rotate([0, 0, 180]) { roundedCorner(caseHeight, ccr); }\n rotate([0, -90, 0]) {\n roundedEdge(tinyEdge, caseHeight, ccr);\n }\n }\n}\n\nmodule thumbButtonContainer() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerContainer(totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n}\n\nmodule thumbButtonWell() {\n translate([thumbUpperRightX, thumbUpperRightY, 0]) {\n rotate([0,0,90]) {\n translate([0,-(thumbButtonLength+dividerThick)\/2],0){\n fingerWell(thumbWellDepth, thumbWidth, totalFingerWellDepth, thumbButtonLength);\n }\n }\n }\n\n \/\/ take an extra \"bite\" out of the cusp to the right of the thumb button, which would otherwise get in the way\n translate([thumbUpperRightX - 10, thumbUpperRightY + thumbWellDepression -1, 0]) {\n cube([12, 5, caseHeight]);\n }\n}\n\nmodule basicCase() {\n difference() {\n union() {\n difference() {\n caseConvexHull();\n\n \/\/ inner cavity\n translate([0,0,lidThick]) {\n translate([rimThick,rimThick,0]) {\n cube([cavityWidth,caseLength-thumbCurveRadius-rimThick+0.001,cavityHeight]);\n }\n translate([thumbCurveRadius,rimThick,0]) {\n cube([cavityWidth+rimThick-thumbCurveRadius,cavityLength,cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,topYOfFingers,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, caseLength - rimThick - topYOfFingers, cavityHeight]);\n }\n translate([rimThick+cavityWidth - 0.001,rimThick,0]) {\n cube([caseWidth - 2*rimThick - cavityWidth, bottomYOfFingers - rimThick, cavityHeight]);\n }\n }\n }\n\n thumbButtonContainer();\n\n \/\/ blocks for finger pinholes\n translate([rimThick + cavityWidth,caseLength - offsetFromTopEdgeToFirstFinger + dividerThick\/2 - pinHoleBlockWidth\/2,0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n for (i = [1:3]) {\n translate([\n rimThick + cavityWidth - pinHoleBlockWidth\/2,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * i - pinHoleBlockWidth\/2,\n 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n translate([rimThick+cavityWidth - pinHoleBlockWidth\/2, caseLength-offsetFromTopEdgeToFirstFinger - fingerWidth*4, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n\n \/\/ blocks for thumb pinholes\n translate([thumbUpperRightX, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n translate([thumbUpperRightX+thumbWidth-pinHoleBlockWidth, thumbUpperRightY-totalFingerWellDepth-pinHoleBlockWidth, 0]) {\n cube([pinHoleBlockWidth,pinHoleBlockWidth,caseHeight]);\n }\n }\n\n pinHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - offsetFromTopEdgeToFirstFinger - fingerWidth * (i + 0.5),\n 0]) {\n fingerWell(fingerWellDepth, fingerWidth, totalFingerWellDepth, fingerButtonLength);\n }\n }\n\n thumbButtonWell();\n\n lightSensorWell();\n\n statusLEDHole();\n\n \/\/ holes for ports\/controls on bottom edge\n translate([rimThick, 0, 0]) {\n \/\/ hole for Arduino USB port\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-foreignPartClearance]) {\n cube([nanoUsbWidth+foreignPartClearance,rimThick+1,nanoUsbHeight+foreignPartClearance]);\n }\n\n translate([nanoOffset+(nanoWidth+foreignPartClearance-nanoUsbCableWidth)\/2,0,caseHeight-floorThick-nanoHeightToUsbBase-(nanoUsbHeight+nanoUsbCableHeight+foreignPartClearance)\/2]) {\n cube([nanoUsbCableWidth+foreignPartClearance,rimThick-nanoUsbCableOffsetFromPerfboard,nanoUsbCableHeight+foreignPartClearance]);\n }\n\n \/\/ hole for battery charger headers\n translate([chargerHeaderOffset,0,(caseHeight-chargerHeaderLength-foreignPartClearance)\/2]) {\n cube([chargerHeaderWidth+foreignPartClearance,rimThick+1,chargerHeaderLength+foreignPartClearance]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset+dividerThick,0,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n cube([powerSwitchLength+foreignPartClearance,rimThick+1,powerSwitchWidth+foreignPartClearance]);\n }\n }\n\n \/\/ cutaway for laser shelf\n translate([caseWidth - rimThick - 1, bottomYOfFingers - laserWidth - foreignPartClearance, lidThick]) {\n cube([rimThick + 2, laserWidth + foreignPartClearance, laserThick + foreignPartClearance]);\n }\n }\n}\n\nmodule alignmentPeg() {\n cube([alignmentPegWidth,alignmentPegWidth,buttonLidHeight - lidThick]);\n translate([accuracy, accuracy, 0]) {\n cube([alignmentPegWidth-accuracy2,alignmentPegWidth-accuracy2,alignmentPegHeight]);\n }\n}\n\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ main\n\necho(\"accuracy: \", accuracy);\necho(\"clearance: \", clearance);\necho(\"foreignPartClearance \", foreignPartClearance);\necho(\"caseWidth: \", caseWidth);\necho(\"caseLength: \", caseLength);\necho(\"caseHeight: \", caseHeight);\necho(\"rimThick: \", rimThick);\necho(\"cavityWidth: \", cavityWidth);\necho(\"cavityLength: \", cavityLength);\necho(\"cavityHeight: \", cavityHeight);\necho(\"pinHoleRadius: \", pinHoleRadius);\necho(\"pinHoleBlockWidth: \", pinHoleBlockWidth);\n\n\/\/ body\ndifference() {\n basicCase();\n\n cube([caseWidth, caseLength, buttonLidHeight+0.0001]);\n\n \/\/ screwdriver\/leverage slot(s)\n translate([rimThick+cavityWidth,rimThick\/2,buttonLidHeight]) {\n rotate([150,0,0]) { cube([5,10,10]); }\n }\n}\n\n\/\/ lid\ntranslate([-5, 0, 8]) {\n rotate([0,180,0]) {\n difference() {\n basicCase();\n translate([0,0,buttonLidHeight]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n\n \/\/ alignment pegs\n translate([rimThick, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, rimThick, lidThick]) { alignmentPeg(); }\n translate([caseWidth-rimThick-alignmentPegWidth, caseLength-rimThick-alignmentPegWidth, lidThick]) { alignmentPeg(); }\n }\n}\n\nbuttons();\n\n\/\/ electronic components\ntranslate([rimThick,rimThick,0]) {\n\n \/\/ container for Arduino Nano v3.0\n translate([nanoOffset,0,caseHeight-floorThick-nanoHeightToUsbBase]) {\n \/\/ vertical wall\n translate([nanoWidth+foreignPartClearance,0,0]) {\n cube([dividerThick,nanoLength+foreignPartClearance+dividerThick,nanoHeightToUsbBase]);\n }\n \/\/ horizontal wall\n translate([0,nanoLength+foreignPartClearance,0]) {\n cube([nanoWidth+foreignPartClearance+dividerThick,dividerThick,nanoHeightToUsbBase]);\n }\n }\n\n \/\/ container for power switch\n translate([powerSwitchOffset,-0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2]) {\n \/\/ right vertical wall\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n \/\/ left vertical wall\n translate([dividerThick+powerSwitchLength+foreignPartClearance,0,0]) {\n cube([dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight+powerSwitchWidth+foreignPartClearance)\/2-floorThick]);\n }\n \/\/ base\n translate([0,0,powerSwitchWidth+foreignPartClearance]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,powerSwitchDepth-rimThick+foreignPartClearance+dividerThick+0.1,(caseHeight-powerSwitchWidth-foreignPartClearance)\/2-floorThick]);\n }\n \/\/ rear support\n translate([0,powerSwitchDepth-rimThick+foreignPartClearance+0.1,powerSwitchWidth+foreignPartClearance-1]) {\n cube([powerSwitchLength+foreignPartClearance+2*dividerThick,dividerThick,1]);\n }\n }\n\n \/\/ shelf for the laser\n translate([cavityWidth, bottomYOfFingers - laserWidth - foreignPartClearance - rimThick, lidThick + laserThick + foreignPartClearance]) {\n cube([caseWidth-2*rimThick-cavityWidth, laserWidth + foreignPartClearance, dividerThick]);\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([nanoVizOffsetX,nanoVizOffsetY,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([transducerVizOffsetX,transducerVizOffsetY,-10]) {\n cube([transducerLength,transducerWidth,transducerHeight]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver\n translate([modemVizOffsetX,modemVizOffsetY,-10]) { cube([modemWidth,modemLength,modemHeight]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n \/\/translate([-40,0,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([batteryVizOffsetX,batteryVizOffsetY,-10]) { cube([batteryWidth,batteryLength,batteryHeight]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([motionSensorVizOffsetX,motionSensorVizOffsetY,-10]) { cube([motionSensorWidth, motionSensorLength, motionSensorHeight]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7fd868e652681c1088e8046ee8b1b373f7d7ee88","subject":"Sensor box with yun update","message":"Sensor box with yun update\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/3d-iot-case-models\/bathroom-sensor-case.scad","new_file":"3d-models\/3d-iot-case-models\/bathroom-sensor-case.scad","new_contents":"\/\/ Bathroom Sensor 3D Model with methane sensor, 2 motion sensors and Arduino Yun\n\n$fn = 8;\n\ncube_side = 140;\ncube_tip_clip = 10;\nwall_width = 26;\n\nskin = 10;\ninner_skin = 8;\nthin_skin = 0.05;\n\ndifference() {\n color(\"red\") box();\n methane_moved_skin();\n}\n\nyun_moved();\nmethane_moved();\n\nyun_y = -wall_width;\nyun_z = -wall_width;\n\nmodule yun_moved() {\n translate([-skin, yun_y, yun_z])\n rotate([180, 0, 0]) {\n yun();\n }\n}\n\nmodule yun_moved_skin() {\n minkowski() {\n yun_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule methane_moved() {\n translate([cube_side + skin - cube_tip_clip*2, 0, 0])\n rotate([0, 90, 0]) {\n methane();\n }\n}\n\nmodule methane_moved_skin() {\n minkowski() {\n methane_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule poly(clip = 0) {\n difference() {\n polyhedron(\n points=[[0,cube_side,0],\n [0,0,-cube_side],\n [0,-cube_side,0],\n [0,0,cube_side],\n [cube_side,0]],\n faces=[[0,1,4],[1,2,4],[2,3,4],[3,0,4],[1,0,3],[2,1,3]]);\n union() {\n translate([-2*cube_side, -2*cube_side, clip\/.85])\n cube([cube_side*4, cube_side*4, cube_side]);\n translate([cube_side - clip\/2, 0, 0])\n cube([clip*2, clip*3, clip*3], center = true);\n }\n }\n}\n\nmodule wall_tunnel() {\n translate([-2*cube_side, -wall_width\/2, -2*cube_side - cube_tip_clip\/.6])\n cube([4*cube_side, wall_width, 2*cube_side]);\n}\n\nmodule box() {\n difference() {\n minkowski() {\n union() {\n poly(cube_tip_clip);\n intersection() {\n hull() {\n poly(cube_tip_clip);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin);\n }\n }\n }\n sphere(r=skin);\n }\n union() {\n methane_moved_skin();\n difference() {\n minkowski() {\n translate([-skin, 0, 0])\n poly(cube_tip_clip\/2);\n sphere(r=inner_skin);\n }\n minkowski() {\n wall_tunnel();\n sphere(r=skin - inner_skin);\n }\n }\n wall_tunnel();\n }\n }\n}\n\nmodule yun() {\n include <..\/3d-iot-component-models\/arduino-yun-mini.scad>\n}\n\nmodule methane() {\n include <..\/3d-iot-component-models\/methane-sensor.scad>\n}\n\nmodule motion() {\n include <..\/3d-iot-component-models\/pir-motion-sensor.scad>\n}\n\n","old_contents":"\/\/ Bathroom Sensor 3D Model with methane sensor, 2 motion sensors and Arduino Yun\n\n$fn = 8;\n\ncube_side = 140;\ncube_tip_clip = 12;\nskin = 10;\ninner_skin = 5;\nthin_skin = 0.05;\n\ndifference() {\n color(\"red\") box();\n union() {\n methane_moved_skin();\n }\n}\n\n\/\/yun_moved();\nmethane_moved();\n\nmodule yun() {\n include <..\/3d-iot-component-models\/arduino-yun-mini.scad>\n}\n\nmodule methane() {\n include <..\/3d-iot-component-models\/methane-sensor.scad>\n}\n\nmodule motion() {\n include <..\/3d-iot-component-models\/pir-motion-sensor.scad>\n}\n\nmodule yun_moved() {\n translate([0, -cube_side\/3 + skin, 0]) yun();\n}\n\nmodule yun_moved_skin() {\n minkowski() {\n yun_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule methane_moved() {\n translate([cube_side + skin - cube_tip_clip*2, 0, 0])\n rotate([0, 90, 0]) {\n methane();\n }\n}\n\nmodule methane_moved_skin() {\n minkowski() {\n methane_moved();\n sphere(r=thin_skin);\n }\n}\n\nmodule poly(clip = 0) {\n difference() {\n polyhedron(\n points=[[0,cube_side,0],\n [0,0,-cube_side],\n [0,-cube_side,0],\n [0,0,cube_side],\n [cube_side,0]],\n faces=[[0,1,4],[1,2,4],[2,3,4],[3,0,4],[1,0,3],[2,1,3]],\n convexivity=8); \n translate([cube_side - clip\/2, 0, 0])\n cube([clip*2, clip*3, clip*3], center = true);\n }\n}\n\nmodule box() {\n difference() {\n minkowski() {\n poly(cube_tip_clip);\n sphere(r=skin);\n }\n union() {\n methane_moved_skin();\n minkowski() {\n translate([-skin, 0, 0])\n poly(cube_tip_clip\/2);\n sphere(r=inner_skin);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b2a3a61f27ca720ed4271a7297a682ac5054d8ed","subject":"Move 'raspicam4pibow.scad' in another repository.","message":"Move 'raspicam4pibow.scad' in another repository.\n","repos":"jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets","old_file":"openscad\/raspicam4pibow.scad","new_file":"openscad\/raspicam4pibow.scad","new_contents":"","old_contents":"\/\/ Raspicam for Pibow\n\/\/ A raspicam support for the Pibow case (Pimoroni).\n\n\/\/ Copyright (c) 2014 J\u00e9r\u00e9mie DECOCK \n\n\n\/\/ BODY \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule body(board_width, board_height, board_depth, board_corner_radius, screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes, camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, camera_slot_width, hinge_radius_in, hinge_radius_out, hinge_slot_length) {\n difference() {\n union() {\n difference() {\n body_main_board(board_width, board_height, board_depth, board_corner_radius);\n\n #union() {\n translate([-board_width\/2 + 10, 0, 0]){\n body_screw_holes(screw_hole_radius, screw_hole_spacing, screw_hole_depth, num_screw_holes);\n }\n\n translate([board_width\/2 - camera_screw_holes_spacing_x\/2 - 10, 0, 0]){\n body_camera_screw_holes(camera_screw_holes_radius, camera_screw_holes_spacing_x, camera_screw_holes_spacing_y, screw_hole_depth);\n translate([-camera_screw_holes_spacing_x\/2, 0, 0]){\n body_camera_slot(camera_slot_width, screw_hole_depth);\n }\n }\n\n body_board_round_corner_mask(radius=board_corner_radius, spacing_x=board_width-2*board_corner_radius, spacing_y=board_height-2*board_corner_radius, depth=screw_hole_depth);\n }\n }\n translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n body_hinge(hinge_radius_in, hinge_radius_out, board_height);\n }\n }\n }\n #translate([-board_width\/2, 0, hinge_radius_out - board_depth\/2]) {\n cube([hinge_radius_out * 2 + 2, hinge_slot_length, hinge_radius_out * 2 + 2], center=true);\n }\n }\n}\n\nmodule body_main_board(width, height, depth, radius) {\n\t$fn=50;\n cube([width, height, depth], center=true);\n}\n\nmodule body_screw_holes(radius, spacing, depth, num) {\n\t$fn=50;\n\t\n\tfor (i = [1:num]) { \n\t\ttranslate([i*spacing, 0, 0]) { \n\t\t\tcylinder(r=radius, h=depth, center=true);\n\t\t}\n\t}\n}\n\nmodule body_camera_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule body_camera_slot(width, depth) {\n cube([width, width, depth], center=true);\n}\n\nmodule body_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\nmodule body_board_round_corner_mask(radius, spacing_x, spacing_y, depth) {\n translate([ spacing_x\/2, spacing_y\/2, 0]) mirror([1,1,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([ spacing_x\/2, -spacing_y\/2, 0]) mirror([1,0,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n}\n\nmodule body_board_camera_protection(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y) {\n difference() {\n cube([board_width, board_height, board_depth], center=true);\n #four_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, board_depth+2);\n #board_round_4_corner_mask(radius=board_corner_radius, spacing_x=board_width-2*board_corner_radius, spacing_y=board_height-2*board_corner_radius, depth=board_depth+2);\n }\n}\n\n\n\/\/ HINGE SCREW \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule hinge_screw(radius, head_radius, length, head_length) {\n cylinder(r=head_radius, h=head_length, $fn=8);\n translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n\n translate([15, 0, 0]) {\n difference() {\n cylinder(r=head_radius, h=head_length, $fn=8);\n #translate([0, 0, head_length\/2]) cylinder(r=radius, h=length, $fn=50);\n }\n }\n}\n\n\n\/\/ FEET \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule feet(board_width, board_height, board_depth, board_corner_radius, screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth, hinge_length, hinge_radius_in, hinge_radius_out, hinge_shelf_width, ventilation_holes_radius) {\n difference() {\n feet_main_board(board_width, board_height, board_depth, board_corner_radius);\n #four_screw_holes(screw_holes_radius, screw_holes_spacing_x, screw_holes_spacing_y, screw_hole_depth);\n #feet_ventilation_holes(ventilation_holes_radius, screw_hole_depth);\n #board_round_4_corner_mask(radius=board_corner_radius, spacing_x=board_width-2*board_corner_radius, spacing_y=board_height-2*board_corner_radius, depth=screw_hole_depth);\n }\n\n translate([board_width\/2 + hinge_shelf_width\/2, 0, 0]) {\n cube([hinge_shelf_width, hinge_length, board_depth], center=true);\n }\n\n translate([board_width\/2 + hinge_shelf_width, 0, hinge_radius_out - board_depth\/2]) {\n rotate(a=[90,0,0]) {\n feet_hinge(radius_in=hinge_radius_in, radius_out=hinge_radius_out, length=hinge_length);\n }\n }\n}\n\nmodule feet_ventilation_holes(radius, depth) {\n\t$fn=50;\n\t\n translate([-33, 17, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n\n translate([33, -17, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n\n translate([8, 0, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n\n translate([-8, 0, 0]) { \n translate([-4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([-4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, -4, 0]) cylinder(r=radius, h=depth, center=true);\n translate([+4, +4, 0]) cylinder(r=radius, h=depth, center=true);\n }\n}\n\nmodule feet_main_board(width, height, depth, radius) {\n cube([width, height, depth], center=true);\n}\n\nmodule feet_hinge(radius_in, radius_out, length) {\n difference() {\n cylinder(r=radius_out, h=length, center=true, $fn=50);\n #cylinder(r=radius_in, h=length+10, center=true, $fn=50);\n }\n}\n\n\/\/ COMMON \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nmodule round_corner_mask(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n difference() {\n cube([2*radius+1, 2*radius+1, depth], center=true);\n union() {\n cylinder(r=radius, h=depth+2, center=true);\n translate([(radius+2)\/2, 0, 0]) cube([radius+2, 2*radius+2, depth+2], center=true);\n translate([0, (radius+2)\/2, 0]) cube([2*radius+2, radius+2, depth+2], center=true);\n }\n }\n}\n\nmodule four_screw_holes(radius, spacing_x, spacing_y, depth) {\n\t$fn=50;\n\t\n\tfor (i = [-1, 1]) { \n for (j = [-1, 1]) { \n translate([i*spacing_x\/2, j*spacing_y\/2, 0]) { \n cylinder(r=radius, h=depth, center=true);\n }\n }\n\t}\n}\n\nmodule board_round_4_corner_mask(radius, spacing_x, spacing_y, depth) {\n translate([-spacing_x\/2, spacing_y\/2, 0]) mirror([0,1,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([-spacing_x\/2, -spacing_y\/2, 0]) mirror([0,0,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([ spacing_x\/2, spacing_y\/2, 0]) mirror([1,1,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n translate([ spacing_x\/2, -spacing_y\/2, 0]) mirror([1,0,0]) round_corner_mask(radius, spacing_x, spacing_y, depth);\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\nassign(feet_board_width=98,\n feet_board_height=65,\n feet_board_depth=3,\n feet_board_corner_radius=5, \/\/ TODO\n feet_screw_holes_radius=1.5, \/\/ TODO\n feet_screw_holes_spacing_x=89, \/\/ TODO\n feet_screw_holes_spacing_y=56, \/\/ TODO\n feet_screw_hole_depth=10,\n feet_hinge_shelf_width=20,\n feet_ventilation_holes_radius=2.5,\n body_board_width=100,\n body_board_height=40,\n body_board_depth=3,\n body_board_corner_radius=3,\n body_screw_hole_radius=1.5, \/\/ TODO\n body_screw_hole_spacing=5,\n body_screw_hole_depth=10,\n body_num_screw_holes=9,\n body_camera_screw_holes_radius=1.5,\n body_camera_screw_holes_spacing_x=12, \/\/ TODO\n body_camera_screw_holes_spacing_y=20, \/\/ TODO\n body_camera_slot_width=9,\n hinge_radius=1.5,\n hinge_head_radius=4.6,\n hinge_head_length=5,\n camera_protection_depth=2) {\n\n color([0,0,1]) {\n translate([0, 50, body_board_depth\/2]) {\n body(board_width=body_board_width, board_height=body_board_height, board_depth=body_board_depth, board_corner_radius=body_board_corner_radius, screw_hole_radius=body_screw_hole_radius, screw_hole_spacing=body_screw_hole_spacing, screw_hole_depth=body_screw_hole_depth, num_screw_holes=body_num_screw_holes, camera_screw_holes_radius=body_camera_screw_holes_radius, camera_screw_holes_spacing_x=body_camera_screw_holes_spacing_x, camera_screw_holes_spacing_y=body_camera_screw_holes_spacing_y, camera_slot_width=body_camera_slot_width, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_slot_length=body_board_height \/ 3 + 1.5);\n }\n }\n\n color([1,0,0]) {\n translate([0, -55, feet_board_depth\/2]) {\n feet(board_width=feet_board_width, board_height=feet_board_height, board_depth=feet_board_depth, board_corner_radius=feet_board_corner_radius, screw_holes_radius=feet_screw_holes_radius, screw_holes_spacing_x=feet_screw_holes_spacing_x, screw_holes_spacing_y=feet_screw_holes_spacing_y, screw_hole_depth=feet_screw_hole_depth, hinge_length=body_board_height\/3, hinge_radius_in=hinge_radius + 0.5, hinge_radius_out=hinge_radius + 0.5 + feet_board_depth, hinge_shelf_width=feet_hinge_shelf_width, ventilation_holes_radius=feet_ventilation_holes_radius);\n }\n }\n\n color([0,1,0]) {\n translate([-50, 0, 0]) {\n hinge_screw(radius=hinge_radius, head_radius=hinge_head_radius, length=body_board_height + 1 + hinge_head_length, head_length=hinge_head_length);\n }\n }\n\n translate([0, 0, camera_protection_depth\/2]) {\n body_board_camera_protection(board_width=body_camera_screw_holes_spacing_x + 10, board_height=body_camera_screw_holes_spacing_y + 10, board_depth=camera_protection_depth, board_corner_radius=1.5, screw_holes_radius=body_camera_screw_holes_radius, screw_holes_spacing_x=body_camera_screw_holes_spacing_x, screw_holes_spacing_y=body_camera_screw_holes_spacing_y);\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"54759df49a8e2862089920eb880a58d83f8b7210","subject":"Added wheel things","message":"Added wheel things\n","repos":"daubers\/Robot","old_file":"base.scad","new_file":"base.scad","new_contents":"include \ninclude \n\nrobot_diameter=300; \/\/ diameter of robot in mm\nacrylic_depth=8;\n\nwheel_width=19; \/\/ http:\/\/skpang.co.uk\/catalog\/pololu-wheel-42x19mm-pair-p-463.html\nwheel_diameter=42;\nwheel_w_clearence=5;\nwheel_d_clearence=5;\n\n\n\/\/standoffs(MEGA2560, mountType=PIN);\n\/\/holePlacement(boardType=MEGA2560)\n\/\/\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\nmodule WheelWell(h=16){\n\tcube([wheel_width+wheel_w_clearence,wheel_diameter+wheel_d_clearence,h], center=true);\n}\n\n\ndifference(){\n\tcylinder(r=robot_diameter\/2, h=acrylic_depth, $fn=100);\n\tholePlacement(boardType=MEGA2560)\n\t\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\ttranslate([(robot_diameter\/2)-(robot_diameter\/4\/2),0,0]) WheelWell();\n\ttranslate([-1*((robot_diameter\/2)-(robot_diameter\/4\/2)),0,0]) WheelWell();\n}","old_contents":"include \ninclude \n\nrobot_diameter=300; \/\/ diameter of robot in mm\nacrylic_depth=8;\n\n\n\n\/\/standoffs(MEGA2560, mountType=PIN);\n\/\/holePlacement(boardType=MEGA2560)\n\/\/\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n\ndifference(){\ncylinder(r=robot_diameter\/2, h=acrylic_depth, $fn=100);\nholePlacement(boardType=MEGA2560)\n\t\t\t\tcylinder(r = mountingHoleRadius + 1.5, h = 10, $fn = 32);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"15a272447badb424197b81b87ba3755b53b4e50f","subject":"extruder wip, guidler conn\/roll","message":"extruder wip, guidler conn\/roll\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-6*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.7, -guidler_bearing[1]\/1.7];\nextruder_guidler_mount_off = [.5*mm -guidler_mount_off[1]+hobbed_gear_d_inner\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\nmodule extruder_b(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ main house\n extruder_b_size=[10,extruder_filapath_offset,10];\n rcubea(extruder_b_size);\n\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n cubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);\n }\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ hobbed gear (inner)\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w+1*mm,guidler_bearing[1]*2], align=[x,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n \/\/ extruder shaft\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=1000, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=9;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -3*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nextruder_offset_b = extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0];\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 0;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\n\/*if(false)*\/\n{\n \/*%x_carriage(show_bearings=false);*\/\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n translate(extruder_offset_b)\n {\n extruder_b(show_vitamins=true);\n\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n }\n\n\n %x_extruder_hotend();\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-6*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\nguidler_arm_len = 15*mm;\n\nextruder_offset_guidler = extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0]+[guidler_bearing[1],0,0];\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\nextruder_guidler_mount_off = [hobbed_gear_d_inner\/2+10,0,guidler_mount_off_h];\n\nmodule extruder_b(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ main house\n extruder_b_size=[10,extruder_filapath_offset,10];\n rcubea(extruder_b_size);\n\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);\n }\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ hobbed gear (inner)\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w+1*mm,guidler_bearing[1]*2], align=[x,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=8;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -3*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nextruder_offset_b = extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0];\n\n\/*if(false)*\/\n{\n %x_carriage(show_bearings=false);\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n translate(extruder_offset_b)\n {\n extruder_b(show_vitamins=true);\n }\n\n translate(extruder_offset_guidler)\n rotate([0,0,90])\n {\n extruder_guidler(show_extras=true);\n }\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c2ed8e8a26488f3a3bbc43ccd9dec9c88c82afe6","subject":"Delete pahar_vero.scad","message":"Delete pahar_vero.scad","repos":"ceausuveronica\/ceausuveronica.github.io","old_file":"Imagine_Robotica\/pahar_vero.scad","new_file":"Imagine_Robotica\/pahar_vero.scad","new_contents":"","old_contents":"pahar_sampanie(raza_baza = 50, grosime_baza = 5, raza_picior = 3, inaltime_picior = 100, raza_cupa = 50, grosime_perete = 2);\n\n\/\/----------------------------------------------------\nmodule baza_pahar(raza_baza, grosime_baza, raza_picior)\n{\n cylinder(h = grosime_baza, r1 = raza_baza, r2 = raza_picior);\n}\n\/\/----------------------------------------------------\nmodule picior_pahar(inaltime_picior, raza_picior)\n{\n cylinder(h = inaltime_picior, r = raza_picior);\n}\n\/\/----------------------------------------------------\nmodule cupa_pahar(raza_cupa, grosime_perete)\n{\n difference(){\n sphere(r = raza_cupa);\n translate ([- raza_cupa, -raza_cupa, 0]) cube([2 * raza_cupa, 2 * raza_cupa, raza_cupa]);\n \n sphere(r = raza_cupa - grosime_perete);\n }\n}\n\/\/----------------------------------------------------\nmodule pahar_sampanie(raza_baza, grosime_baza, raza_picior, inaltime_picior, raza_cupa, grosime_perete)\n{\n baza_pahar(raza_baza, grosime_baza, raza_picior);\n translate ([0, 0, grosime_baza]) picior_pahar(inaltime_picior, raza_picior);\n translate ([0, 0, grosime_baza + inaltime_picior + raza_cupa]) cupa_pahar(raza_cupa, grosime_perete);\n}\n\n\n\n\n\ntresolution = 50; \n\n\nradius = 80;\n\n\nheight = 10;\n\n\nMessage = \"Bine a\u021bi venit la...\"; \n\n\nTo = \"Pagina Vero\";\n\n$fn = resolution;\n\nscale([1, 0.5]) difference() {\n cylinder(r =radius , h = 2 * height, center = true);\n translate([0, 0, height])\n cylinder(r = radius - 10, h = height + 1, center = true);\n}\nlinear_extrude(height = height) {\n translate([0, --4]) text(Message, halign = \"center\");\n translate([0, -16]) text(To, halign = \"center\");\n}\n\n\n\n$fn = 100;\nnumber_of_holes = 10;\n\nfor(i = [1 : 360 \/ number_of_holes : 360]) {\n \n make_cylinder(i);\n}\n\nmodule make_cylinder(i) {\n \n rotate([0, 0, i]) translate([100, 0, 0]) cylinder(h = 4, r = 20);\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"21f297af0f0cb0a84a53fad3015752b6ef2629b9","subject":"x\/carriage: reduce thickness a bit","message":"x\/carriage: reduce thickness a bit\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+1*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7310956f6ed6208f0bbc32955af638db08925f20","subject":"=> rules coding","message":"=> rules coding","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"x=55; \ny=19; \nz=5.5; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \n$fn=270; \nscale ([1.1,1.2,1.3]) { \ndifference (){ \ncolor(\"MediumPurple\") translate ([0,0,0]) cube ([x,y,z]); \ncolor(\"Red\") translate ([0,y\/2,0]) cylinder (z,y\/2,y\/2); \n} \n } \n \n \n \n","old_contents":"x=55;\ny=19;\nz=5.5; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d\n$fn=270;\nscale ([1.1,1.2,1.3]) {\ndifference (){\ncolor(\"MediumPurple\") translate ([0,0,0]) cube ([x,y,z]);\ncolor(\"Red\") translate ([0,y\/2,0]) cylinder (z,y\/2,y\/2);\n}\n }","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a041fa8eebb8b152e3309385632ada22009c7afd","subject":"x\/ends: fix pulley pos and motor teardrop truncation","message":"x\/ends: fix pulley pos and motor teardrop truncation\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ca6dd44e10b9455c6e5680a601b2939143ab3e59","subject":"Remove name printing","message":"Remove name printing\n","repos":"rubyist\/pingduino,rubyist\/pingduino","old_file":"models\/switch-mount.scad","new_file":"models\/switch-mount.scad","new_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You can inscribe something here. I print the box at lower resolution (.3mm), it\n \/\/ comes out OK but not very good looking. Higher res looks better.\n \/\/ name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"YourTextHere\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","old_contents":"\/\/ This box is the housing for the scoring buttons that get mounted\n\/\/ under the pingpong table. The buttons I used are these:\n\/\/ https:\/\/www.sparkfun.com\/products\/11275\n\/\/ In hindsight, these buttons are rather large. You could use smaller\n\/\/ buttons and adjust some of these values accordingly.\n\n\/\/ The overall radius of the button. The datasheet reports 100mm, but\n\/\/ mine both measure 98.\nbutton_radius = 49;\n\n\/\/ The radius of the hole the button back needs.\nhole_radius = 11.5;\n\n\/\/ There's a bar on the front of my table that is 40mm high\ntable_padding = 40;\n\n\/\/ I want 30mm around the button's hole\nbottom_padding = 30;\nextra_padding = 2;\n\n\/\/ The thickness of the box walls\nwall_thickness = 3;\n\n\/\/ Dimensions for the overall box\nmount_height = table_padding + extra_padding + button_radius + hole_radius + bottom_padding;\nmount_depth = 50;\nmount_width = (hole_radius * 2) + (bottom_padding * 2);\n\n$fn=100;\nfont = \"monaco.dxf\";\n\n\/\/ Comment or uncomment the body or cover, depending on which you need to render\n\n\/\/ Body\nunion() {\n difference() {\n bottom();\n \/\/ You don't have to put my name in your box ;)\n name();\n }\n \n difference() {\n sides();\n cover_screws();\n mount_screws();\n }\n}\n\n\/\/ Cover\n\/*\ndifference() {\n translate([0, 0, mount_depth-wall_thickness])\n cover();\n cover_screws();\n \/\/ Remove this line if you don't want the project's name on the cover\n project();\n}\n*\/\n\n\/\/ You shouldn't have to configure anything below this, except maybe text\n\/\/ attributes at the bottom if you're putting your own text in it.\n\nmodule bottom() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=wall_thickness);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, wall_thickness]);\n }\n\n union() {\n translate([mount_width\/2, wall_thickness+7.5, -1])\n cylinder(r=3, h=wall_thickness+2);\n\n translate([mount_width\/2-4.5, wall_thickness+7.5-2.5, wall_thickness-.8])\n cube(size=[9, 5, 1]);\n }\n }\n}\n\nmodule sides() {\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness*2, h=mount_depth);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n \n \/\/ upper left\n translate([0, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness*2, wall_thickness*2, mount_depth]);\n }\n \n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=mount_depth+1);\n\n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, mount_depth+1]);\n }\n }\n\n intersection() {\n translate([wall_thickness, wall_thickness, 0])\n cube([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), mount_depth]);\n\n union() {\n translate([wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height\/2, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([mount_width-wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-6-wall_thickness])\n cylinder(r=9, h=6);\n translate([wall_thickness, mount_height-wall_thickness, mount_depth-10-wall_thickness])\n cylinder(r1=3, r2=9, h=4);\n }\n }\n}\n\nmodule cover() {\n hole_center = mount_height - table_padding - button_radius;\n\n difference() {\n hull() {\n \/\/ lower left\n translate([wall_thickness*2, wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ lower right\n translate([mount_width-(wall_thickness*2), wall_thickness*2, 0])\n cylinder(r=wall_thickness, h=wall_thickness);\n \n \/\/ upper right\n translate([mount_width-(wall_thickness*2), mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n \n \/\/ upper left\n translate([wall_thickness, mount_height-(wall_thickness*2), 0])\n cube(size=[wall_thickness, wall_thickness, wall_thickness]);\n }\n \n translate([mount_width\/2, hole_center, -1])\n cylinder(r=hole_radius, h=wall_thickness*2);\n }\n\n \/\/ Fake button\n \/\/ translate([mount_width\/2, hole_center, 5])\n \/\/ cylinder(r=button_radius, h=20);\n}\n\nmodule cover_screws() {\n translate([wall_thickness+3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, wall_thickness+3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([mount_width-wall_thickness-3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n\n translate([wall_thickness+3.5, mount_height-wall_thickness-3.5, mount_depth\/2])\n cylinder(r=1.5, h=30);\n}\n\nmodule mount_screws() {\n spacing = 15;\n \n translate([spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, mount_depth-spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n\n translate([mount_width-spacing, mount_height, spacing])\n rotate([90, 0, 0])\n cylinder(r=2, h=wall_thickness+2);\n}\n\n\/\/ Text\nmodule letter(l, h=100, i=0) {\n union() {\n linear_extrude(height=h) import(font, layer=l[i]);\n translate([dxf_dim(file=font, name=\"advx\", layer=l[i]), dxf_dim(file=font, name=\"advy\", layer=l[i]), 0])\n child();\n }\n}\n\nmodule word(wrd, h=100, i=0) {\n if (i < len(wrd)) {\n letter(wrd, h, i) word(wrd, h, i+1);\n } else {\n child();\n }\n}\n\n\nmodule name() {\n translate([18.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Scott\", 1000);\n \n translate([46.5, mount_height - 20, wall_thickness-1.5])\n scale(0.002)\n word(\"Barron\", 1000);\n \n translate([34.5, mount_height - 35, wall_thickness-1.5])\n scale(0.002)\n word(\"2014\", 1000);\n}\n\nmodule project() {\n translate([22, mount_height-20, mount_depth-1.5])\n scale(0.002)\n word(\"Pingduino\", 1000);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6edee40bded8aee9fa7d4efa9ff8d2c1b8dc13bf","subject":"Add animation in figure of 8","message":"Add animation in figure of 8\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"kite.scad","new_file":"kite.scad","new_contents":"\nlineLength=20;\nbearing =0 + sin($t*360)*45;\nelevation = 30+sin(-$t*360*2)*15;\nyaw = bearing-sin($t*360)*30;\ndrift=5;\nroll = sin(360*$t+90+drift)*120;\nangleOfAttack=15;\npitch=elevation + angleOfAttack;\nuseNED=-1;\nrotate(a=bearing, v=[0,0,1*useNED]) rotate(a=elevation, v=[0,1*useNED,0]){\n\ttranslate(v=[lineLength\/2,0,0]) cube(size=[lineLength,0.1,0.1], center=true);\n\ttranslate(v=[lineLength,0,0]) \n \t rotate(a=-1*elevation, v=[0,1*useNED,0]) rotate(a=-1*bearing, v=[0,0,1*useNED])\n\t rotate(a=yaw ,v=[0,0,1*useNED]) rotate(a=pitch, v=[0,1*useNED,0]) rotate(a=roll, v=[1,0,0]) \n color(\"red\") cube(size=[0.1,,3,1],center=true); }","old_contents":"yaw = 90;\nroll = 0;\npitch=0;\nlineLength=20;\nbearing =90;\nelevation = 45;\nuseNED=-1;\n rotate(a=bearing, v=[0,0,1*useNED]) rotate(a=elevation, v=[0,1*useNED,0]) translate(v=[lineLength,0,0]) rotate(a=-1*elevation, v=[0,1*useNED,0]) rotate(a=-1*bearing, v=[0,0,1*useNED]) rotate(a=yaw ,v=[0,0,1*useNED]) rotate(a=pitch, v=[0,1*useNED,0]) rotate(a=roll, v=[1,0,0]) cube(size=[1,3,0.1]); ","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"566acb496fd53beaa968fecb86a464d17235c187","subject":"Include module for Pro Mini Serial Header","message":"Include module for Pro Mini Serial Header","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ProMicro.scad","new_file":"hardware\/vitamins\/ProMicro.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro(type = \"mini\") {\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro(type = \"mini\") {\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n }\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"13eb2a68203ffffc2c8cc0c46df3b222f9a89467","subject":"add setup for icons","message":"add setup for icons\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n \nmodule halfCirclePhoneStand(bed_cutout_zLength = 4.2,\n height = 19.125,\n \n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n\n bed_cutout_zLength = bed_cutout_zLength,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\n\/\/ererfafadsss\n\/\/function halfCirclePhoneStand_cradle_cutout_zLength() = 10; \/\/ 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n bed_cutout_zLength,\n\n iconColor, iconType, iconXyScale, iconHeight, icon_xOffset, icon_yOffset,\n\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate,\n bed_cutout_zLength = bed_cutout_zLength);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate,\n bed_cutout_zLength)\n{\n zLength = bed_cutout_zLength;\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\n{\n color(iconColor)\n translate([xOffset, yOffset, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=1.6);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbaseclef15scale(1.8);\n }\n else if(iconType == \"Cat\")\n {\n cat(1.8);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 1.6])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumtrooper(2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(bed_cutout_zLength,\n height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength = bed_cutout_zLength,\n bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength, minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = bed_cutout_zLength + minkowskiSphereRadius;\n \n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n\n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n iconColor, iconType, iconXyScale, iconHeight, icon_xOffset, icon_yOffset,\n\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\n{\n color(iconColor)\n translate([xOffset, yOffset, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=1.6);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbaseclef15scale(1.8);\n }\n else if(iconType == \"Cat\")\n {\n cat(1.8);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 1.6])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumtrooper(2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c5c64552dcf85a86c0f2b225346b43961a498734","subject":"Enlarge servo pilot holes to match other parts","message":"Enlarge servo pilot holes to match other parts\n","repos":"snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop,snhack\/Quadruloop","old_file":"hardware\/mk1\/coxa.scad","new_file":"hardware\/mk1\/coxa.scad","new_contents":"\/\/ 3dof quad\n\/\/\n\/\/ coxa\n\ninclude \ninclude \n\nmodule coxa(servo_height = 27, servo_clearance = 7) {\n\tarm_thick = 4;\n\tservo_width = 12;\n\tflange_length = 3;\n\tbase_thick = 4;\n\troot_radius = 4;\n\n\tfork_width = servo_width + flange_length + servo_clearance + base_thick;\n\tfork_height = arm_thick * 2 + servo_height;\n\n\tservo_cog_offset = 6;\n\n\ttranslate([fork_width\/2 - servo_cog_offset, 0, 0]) union() {\n\t\tdifference() {\n\t\t\tcube([fork_width, fork_height, 12], center = true);\n\t\t\ttranslate([-root_radius\/2 - base_thick\/2 - 1, 0, 0]) cube([1 + servo_width + flange_length + servo_clearance - root_radius, servo_height, 13], center = true);\n\t\t\ttranslate([-base_thick\/2, 0, 0]) cube([servo_width + flange_length + servo_clearance, servo_height-2*root_radius, 13], center = true);\n\t\t\ttranslate([5, -9.5, 0]) cylinder(r = root_radius, h = 13, center = true);\n\t\t\ttranslate([5, 9.5, 0]) cylinder(r = root_radius, h = 13, center = true);\n\t\t\tcolor(\"white\") translate([servo_cog_offset - fork_width\/2, 0.1 + fork_height\/2, 0]) rotate([90, 90, 0]) servo_arm();\n\t\t}\n\n\t\ttranslate([fork_width\/2 + 15\/2, 0, -3]) {\n\t\t\tdifference() {\n\t\t\t\tcube([15, fork_height, 6], center = true);\n\t\t\t\ttranslate([-1, 0, 0]) cube([12.5, 23.5, 7], center = true);\n\t\t\t\tfor(i = [-1, 1]) {\n\t\t\t\t\ttranslate([-1, i * 30\/2, 0]) cylinder(r=1, h=20, center = true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}\n\n\/\/translate([0,15,0]) coxa();\n\/\/scale([-1, 1, 1]) coxa();\n","old_contents":"\/\/ 3dof quad \n\/\/\n\/\/ coxa\n\ninclude \ninclude \n\nmodule coxa(servo_height = 27, servo_clearance = 7) {\n\tarm_thick = 4;\n\tservo_width = 12;\n\tflange_length = 3;\n\tbase_thick = 4;\n\troot_radius = 4;\n\n\tfork_width = servo_width + flange_length + servo_clearance + base_thick;\n\tfork_height = arm_thick * 2 + servo_height;\n\t\n\tservo_cog_offset = 6;\n\n\ttranslate([fork_width\/2 - servo_cog_offset, 0, 0]) union() {\n\t\tdifference() {\n\t\t\tcube([fork_width, fork_height, 12], center = true);\n\t\t\ttranslate([-root_radius\/2 - base_thick\/2 - 1, 0, 0]) cube([1 + servo_width + flange_length + servo_clearance - root_radius, servo_height, 13], center = true);\n\t\t\ttranslate([-base_thick\/2, 0, 0]) cube([servo_width + flange_length + servo_clearance, servo_height-2*root_radius, 13], center = true);\n\t\t\ttranslate([5, -9.5, 0]) cylinder(r = root_radius, h = 13, center = true);\t\n\t\t\ttranslate([5, 9.5, 0]) cylinder(r = root_radius, h = 13, center = true);\t\n\t\t\tcolor(\"white\") translate([servo_cog_offset - fork_width\/2, 0.1 + fork_height\/2, 0]) rotate([90, 90, 0]) servo_arm();\n\t\t}\n\n\t\ttranslate([fork_width\/2 + 15\/2, 0, -3]) {\n\t\t\tdifference() {\t\n\t\t\t\tcube([15, fork_height, 6], center = true);\n\t\t\t\ttranslate([-1, 0, 0]) cube([12.5, 23.5, 7], center = true);\n\t\t\t\tfor(i = [-1, 1]) {\n\t\t\t\t\ttranslate([-1, i * 30\/2, 0]) cylinder(r=0.5, h=20, center = true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}\n\n\/\/translate([0,15,0]) coxa(); \n\/\/scale([-1, 1, 1]) coxa();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cd4459676d07c08a949b2cfe943040ae56485031","subject":"config: tweak preview and","message":"config: tweak preview and\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 1.4;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 16;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\n\/*xaxis_endstop_type = \"SWITCH\"*\/\nxaxis_endstop_type = \"SN04\";\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 12;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\n\/*xaxis_endstop_type = \"SWITCH\"*\/\nxaxis_endstop_type = \"SN04\";\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1f00acee1b2787d982f90a62cc7b73c64808f3e7","subject":"Required pins","message":"Required pins\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/printedparts\/Bumper.scad","new_file":"hardware\/printedparts\/Bumper.scad","new_contents":"\/* Pins required - \n\npintack(side=true, h=7.8+2+2.5, bh=2);\n\n*\/\n\nmodule Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = dw;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0,1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0,0,90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\t}\n\n\t\/\/ Microswitch plates\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\tMicroSwitchPlate();\n\t\n}\n\n\nmodule MicroSwitchPlate()\n{\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Pin section\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0,0,dw])\n\t\tmirror([0,0,1])\n\t\t\tpinhole(fixed=true);\n\t}\n}","old_contents":"module Bumper_STL()\n{\n\tprintedPart(\"printedparts\/Bumper.scad\", \"Bumper\", \"Bumper_STL()\") {\n\n\t \/\/view(t=[0, -1, -1], r=[49, 0, 25], d=336);\n\n\t\tif (DebugCoordinateFrames) frame();\n\t\tif (DebugConnectors) connector(Wheel_Con_Default);\n\n\t color(Level2PlasticColor) {\n if (UseSTL) {\n import(str(STLPath, \"Bumper.stl\"));\n } else {\n\t\t\t\tBumperModel();\n }\n }\n\t}\n}\n\nBumper_Pin_Width = 3;\nBumper_Pin_Length = 18;\n\nmodule BumperModel()\n{\n\tthickness = dw;\n\theight = 15;\n\toffset = 5;\t\t\t\t\/\/ distance from base to inside of bumper\n\twrapAngle = 170;\t\t\/\/ angle that bumper wraps around\n\tmicroSwitchAngle = 43.5;\t\/\/ angle that microswitches are placed at\n\n\toutr = BaseDiameter\/2 + offset + thickness; \/\/ outr is the outside radius or the bumper\n\n\n\n\t\/\/ Bumper arc\n\tlinear_extrude(height)\n\tdifference() {\n\t\tcircle(r = outr);\n\n\t\tcircle(r = outr - thickness);\n\n\t\t\/\/ Chop off below X-axis\n\t\ttranslate([-outr, -outr])\n\t\t\tsquare([outr*2, outr]);\n\n\t\t\/\/ Trim left side of arc\n\t\trotate(a=wrapAngle\/2, v=[0,0,1])\n\t\ttranslate([-outr, 0])\n\t\t\tsquare([outr, outr * 2]);\n\n\t\t\/\/ Trim right side of arc\n\t\trotate(a=-wrapAngle\/2, v=[0,0,1])\n\t\t\tsquare([outr, outr * 2]);\n\t}\n\n\t\/\/ Springy bits\n\tfor(i=[0,1])\n\t\tmirror([i, 0, 0])\n\t\ttranslate([30, outr - 24, 0])\n\t\trotate([0,0,90])\n\t\tlinear_extrude(5)\n\t\t\tdonutSector(17, 17 - 2*perim, 175, center=true);\n\n\t\/\/ Flanges to hit microwitch\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate(a=microSwitchAngle, v=[0, 0, 1]) {\n\t\ttranslate([0, BaseDiameter\/2 - 1 , 0])\n\t\t\tcube([8, offset + 1 + eta, 5]);\n\t}\n\n\t\/\/ Microswitch plates\n\tfor(i=[0,1])\n\tmirror([i, 0, 0])\n\trotate([0, 0, microSwitchAngle])\n\ttranslate([-10, BaseDiameter\/2 - 23, 0])\n\t\tMicroSwitchPlate();\n\t\n}\n\n\nmodule MicroSwitchPlate()\n{\n\tms_length=12.9;\n\tms_width=6.6;\n\tms_height=5.8;\n\n\tbase_length = ms_length + 2 * dw + 0.5;\n\tbase_width = ms_width + 13.5;\n\n\t\/\/ Base\n\ttranslate([0, 6.5, 0])\n\t\tcube([base_length, base_width - 6.5, dw]);\n\n\t\/\/ Microswitch surround\n\ttranslate([0, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([base_length - dw, 7, 0])\n\t\tcube([dw, base_width - 7, dw + 3]);\n\ttranslate([0, 13-dw, 0])\n\t\tcube([base_length, dw, dw + 2]);\n\n\t\/\/ Pin section\n\tdifference() {\n\t\tlinear_extrude(dw + ms_height)\n\t\thull() {\n\t\t\ttranslate([2.5, 7])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([base_length, 9.5])\n\t\t\t\tcircle(r=eta);\n\t\t\ttranslate([13, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t\ttranslate([20, 1])\n\t\t\t\tcircle(r=2.5);\n\t\t}\n\n\t\ttranslate([base_length\/2 + 7, 2.65, dw + ms_height - eta])\n\t\ttranslate([0,0,dw])\n\t\tmirror([0,0,1])\n\t\t\tpinhole(fixed=true);\n\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0f135c7393cc9c3d63a9a2566db54e509b11f58b","subject":"ending for ventilation flow","message":"ending for ventilation flow\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"vent_shaft_doors\/vent.scad","new_file":"vent_shaft_doors\/vent.scad","new_contents":"use\nuse\ninclude\n\nmodule bars_()\n{\n l=2*r_shaft;\n for(i=[0:3])\n for(dir=[-1,+1])\n translate([i*dir*13, 0, 0])\n translate([-wall\/2, -l\/2, 0])\n cube([wall, l, wall]);\n}\n\n\nmodule lattice_()\n{\n for(rot=[0, 90])\n rotate([0, 0, rot])\n bars_();\n}\n\n\nmodule vent()\n{\n lattice_();\n\n difference()\n {\n cylinder(r=r_shaft+15, h=wall);\n translate([0, 0, -eps])\n cylinder(r=r_shaft-wall, h=h+2*eps);\n }\n \n for(rot=[0, 90])\n rotate([0, 0, rot])\n for(dx=[-1, 1])\n translate(dx*[r_shaft+5, 0, 0])\n grab();\n}\n\nvent();\n%translate([0, 0, -5\/2])\n oring();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'vent_shaft_doors\/vent.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"23021d9b753b5261bc26813035ac0172aa957506","subject":"added grab() helper, representing element one can catch via","message":"added grab() helper, representing element one can catch via\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"vent_shaft_doors\/detail\/common.scad","new_file":"vent_shaft_doors\/detail\/common.scad","new_contents":"$fn=360;\nwall=2;\nr_shaft=99.1\/2;\nh=70;\neps=0.01;\n\nmodule grab()\n{\n $fn=120;\n d=20;\n t=4;\n translate([-t\/2, -d\/2, 0])\n difference()\n {\n union()\n {\n cube([t, d, d]);\n translate([0, d\/2, d])\n rotate([0, 90, 0])\n cylinder(r=d\/2, h=t);\n }\n translate([-eps, d\/2, d])\n rotate([0, 90, 0])\n cylinder(r=6\/2, h=t+2*eps);\n }\n}\n\n\/\/grab();\n","old_contents":"$fn=360;\nwall=2;\nr_shaft=99.1\/2;\nh=70;\neps=0.01;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5349ed386d9bf03360bb844e35ac192fde14eb91","subject":"shapes: add rounded_rectange_profile","message":"shapes: add rounded_rectange_profile\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction rounded_rectangle_profile(size=[1,1],r=1,fn=$fn) = [\nfor (index = [0:fn-1])\nlet(a = index\/fn*360)\nr * [cos(a), sin(a)]\n+ sign_x(index, fn) * [size[0]\/2-r,0]\n+ sign_y(index, fn) * [0,size[1]\/2-r]\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(r=U, radius=5, radial_width, align=N, orient=Z)\n{\n r_ = fallback(r, radius);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_, center = true);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0d225109005070a9725df554652c0404fa929de0","subject":"extruder: Tweaks, lower motor etc","message":"extruder: Tweaks, lower motor etc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"extruder-direct.scad","new_file":"extruder-direct.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 5*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 22*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -9*mm;\nmotor_offset_y = 38*mm;\nmotor_offset_z = -pythag_leg(motor_offset_y,gears_distance);\necho(motor_offset_z);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-2,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 5*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 22*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -9*mm;\nmotor_offset_y = 27*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-2,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp();\n }\n\n if(true)\n {\n extras();\n }\n}\n\nmodule print()\n{\n extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\n attach([[0,0,0],[0,0,-1]], extruder_conn_layflat)\n {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false);\n }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2, guidler_mount_off_h], [0,-1,0]];\n attach([[34*mm,10*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false);\n }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp();\n }\n}\n\n\/*extruder();*\/\n\/*print();*\/\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"41d3843c360eb8c99ef0089ca0b3e3663c9628f5","subject":"openscad generative model","message":"openscad generative model\n","repos":"el-bart\/soft_playground,el-bart\/soft_playground","old_file":"openscad_svg_frame\/frame.scad","new_file":"openscad_svg_frame\/frame.scad","new_contents":"eps = 0.01;\nwall = 2;\nspacing = 1;\n\nmodule model_import(file)\n{\n offset(eps)\n import(file);\n}\n\nmodule shape_placeholder()\n{\n linear_extrude(2*wall)\n model_import(\"random_shape.svg\");\n}\n\nmodule model_slot_base(name)\n{\n module extended_base(r)\n {\n minkowski()\n {\n model_import(name);\n circle(r);\n }\n }\n\n module frame(wall)\n {\n difference()\n {\n extended_base(spacing + wall\/2 + 0.5);\n extended_base(spacing + wall\/2);\n }\n }\n\n module cut_in_frame()\n {\n difference()\n {\n \/\/ model\n frame(wall);\n \/\/ side wall cuts\n children(0);\n }\n }\n\n cut_in_frame()\n children(0);\n}\n\nmodule model_slot(name)\n{\n intersection()\n {\n minkowski()\n {\n\/\/ linear_extrude(2.7)\n model_slot_base(name)\n children(0);\n\/\/ sphere(r=wall\/2);\n }\n \/\/ cut-off for the bottom roundings\n #translate([-50, -50, 0])\n cube([200, 200, 100]);\n }\n}\n\n%shape_placeholder();\nmodel_slot(\"random_shape.svg\")\n{\n translate([0, 40, 0])\n square([70, 20]);\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad_svg_frame\/frame.scad' did not match any file(s) known to git\n","license":"bsd-3-clause","lang":"OpenSCAD"} {"commit":"6d88252e69f5d4125c96abef58bee94b7cf11a06","subject":"Got the base square set and working","message":"Got the base square set and working\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 1;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n \n if(seed_corner == \"center\") {\n translation = [0,0];\n translations = translation_vectors;\n rotations = rotation_vectors;\n }\n else if(seed_corner == \"bottom_left\") {\n translation = [current_size \/ 2, current_size \/ 2];\n translations = \n }\n else if(seed_corner == \"bottom_right\") {\n translation = [-current_size \/ 2, current_size \/ 2];\n }\n else if(seed_corner == \"top_left\") {\n translation = [current_size \/ 2, -current_size \/ 2];\n }\n else if(seed_corner == \"top_right\") {\n translation = [-current_size \/ 2, -current_size \/ 2];\n }\n\n translate(translation) {\n \/\/square(current_size, center = true);\n }\n}\n\npattern([0, 0], \"center\", 1);","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"23981a5222de1512105feb8b6e370333ee1e4d8b","subject":"Added an enclosure example","message":"Added an enclosure example\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/LogoBotInAnEnclosure.scad","new_file":"hardware\/LogoBotInAnEnclosure.scad","new_contents":"\/*\n\nLogoBot.scad\n\n*\/\n\n\/\/ Master include statement, causes everything else for the model to be included\ninclude \n\n\nEnclosureWidth \t\t= 500;\nEnclosureDepth \t\t= 500;\nEnclosureThickness \t= 1;\nEnclosureWallHeight = 30;\nEnclosureWallWidth \t= 10;\n\nBotPosition \t\t= [50, 30];\nBotRotation \t\t= 30;\n\n\n\n\/\/ Enclosure \/ Pen\n\/\/ ---------------\n\n\/\/ Pen\n\/\/\nmodule EnclosureBase() {\n\n\t\/\/ base\n\tcolor(White)\n\t\ttranslate([0,0, EnclosureThickness\/2])\n\t\tcube([EnclosureWidth, EnclosureDepth, EnclosureThickness], center=true);\n\t\n\t\/\/ walls\n\tcolor(Grey50) \n\t\ttranslate([0,0, EnclosureThickness])\n\t\tlinear_extrude(EnclosureWallHeight - EnclosureThickness)\n\t\tdifference() {\n\t\t\t\/\/ outer-edge of wall\n\t\t\tsquare([EnclosureWidth, EnclosureDepth], center=true);\n\t\t\t\n\t\t\t\/\/ hollow out the inside\n\t\t\tsquare([EnclosureWidth - 2*EnclosureWallWidth, EnclosureDepth - 2*EnclosureWallWidth], center=true);\n\t\t}\n\n}\n\n\n\n\n\/\/ Draw the enclosure\nEnclosureBase();\n\n\n\/\/ Position LogoBot inside it\ntranslate([ BotPosition[0], BotPosition[1], EnclosureThickness])\n\trotate(BotRotation)\n\tLogoBotAssembly();","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/LogoBotInAnEnclosure.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"656e0ae68388e951296c5b493b58b3bab1a84d1e","subject":"Misc update.","message":"Misc update.\n","repos":"jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets,jeremiedecock\/snippets","old_file":"openscad\/intersection.scad","new_file":"openscad\/intersection.scad","new_contents":"\/\/ See http:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/The_OpenSCAD_Language#CSG_Modeling\n\nintersection() {\n\tcylinder (h=20, r=5, center=true, $fn=100);\n\trotate ([90,0,0]) cylinder (h=20, r=4.5, center=true, $fn=100);\n}","old_contents":"\/\/ See http:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/The_OpenSCAD_Language#CSG_Modeling\n\nintersection() {\n\tcylinder (h = 4, r=1, center = true, $fn=100);\n\trotate ([90,0,0]) cylinder (h = 4, r=0.9, center = true, $fn=100);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"598ef3bdf2d4648ab263d0c1ce2b84b784108bd1","subject":"[3d] Add ThermistorJack option for 4.3.6 PCB","message":"[3d] Add ThermistorJack option for 4.3.6 PCB\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Probe mono jack type (MJ1 is the smaller new one for 4.3.6)\nThermistorJack = 1; \/\/ [0:MJ-2508N,1:MJ1-2503A]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 2; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 2.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3+([0, 3.0][ThermistorJack]); \/\/ case is split along probe centerline on the probe side\ncase_split = 12.3; \/\/ and the case split on the other 3 sides (12.4 ideal?)\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1-([0, 3.0][ThermistorJack])]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 2; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 2.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2be5aa3672e4bfcd5fd377c4f122a68b7340e8c2","subject":"fixed drill-holes radius","message":"fixed drill-holes radius\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"video_camera_holder\/vch.scad","new_file":"video_camera_holder\/vch.scad","new_contents":"module holder()\n{\n translate([0,0,110])\n rotate([90,0,0])\n difference()\n {\n translate([-70\/2, -110, 0])\n cube([70, 140, 5]);\n cylinder(r=30\/2, h=5, $fs=0.01);\n for(deg = [0, 120, 240])\n rotate(deg)\n translate([0, 24.83, -1])\n cylinder(r=3.5\/2, h=5+2*1, $fs=0.1);\n }\n}\n\nrotate([-90, 0, 0])\n{\n holder();\n translate([-120\/2, -110, 0])\n cube([120, 110, 5]);\n}","old_contents":"module holder()\n{\n translate([0,0,110])\n rotate([90,0,0])\n difference()\n {\n translate([-70\/2, -110, 0])\n cube([70, 140, 5]);\n cylinder(r=30\/2, h=5, $fs=0.01);\n for(deg = [0, 120, 240])\n rotate(deg)\n #translate([0, 21.25, -1])\n cylinder(r=3.5\/2, h=5+2*1, $fs=0.1);\n }\n}\n\nrotate([-90, 0, 0])\n{\n holder();\n translate([-120\/2, -110, 0])\n cube([120, 110, 5]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a9b0f3be1dcf4922449d099f995e89e1b05a0676","subject":"bearing\/data: Add thick-walled bronze bushings","message":"bearing\/data: Add thick-walled bronze bushings\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12];\nbearing_bronze_12_18_18 = [12,18,18];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"008ff4a2d7dcd48b646c56a81bf7a0904a255ac0","subject":"[3d] Added cube_fillet_chamfer (not used yet)","message":"[3d] Added cube_fillet_chamfer (not used yet)\n\nThis generates a cube with fileted vertical corners but chamfered top\nand bottoms\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"include \n\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.1*1.41; \/\/ thickness of side walls\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=4.5, $fn=16);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.25,-6.25,0]) cube([12.5,12.5,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w,-3.4\/2-ww_d,0])\n cube_fillet([5.5+2*ww_w,3.4+2.5*ww_d,6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -(nut_d\/2+ww_d), 0])\n cube_fillet([nut_d+2*ww_w,nut_d+2*ww_d,oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.3, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth+lip_tip_clip, 0],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_fillet([w+2*wall, d+2*wall, h_b+2*wall_t],\n vertical=[wall\/2,wall\/2,wall\/2,wall\/2], \n top=[wall,wall,wall_t,wall],\n bottom=[wall\/2,wall\/2,wall\/2,wall\/2], $fn=4);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n \/\/ ethernet\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,81.5,-1]) jhole(15,13);\n translate([0,81.5,-2]) jhole(5,5);\n }\n \/\/ USB 0+1\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,0.2]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,2.5]) jhole(9.2,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-65, wall_t]) {\n difference() {\n cube_fillet([10,65,3], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,27.5,e]) cube_fillet([3,14,3], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n \/\/ bottom locklip (postive)\n translate([wall, d+wall, probe_centerline+wall_t]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\nhm43_split();","old_contents":"include \n\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.1*1.41; \/\/ thickness of side walls\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=4.5, $fn=16);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.25,-6.25,0]) cube([12.5,12.5,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w,-3.4\/2-ww_d,0])\n cube_fillet([5.5+2*ww_w,3.4+2.5*ww_d,6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -(nut_d\/2+ww_d), 0])\n cube_fillet([nut_d+2*ww_w,nut_d+2*ww_d,oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.3, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth+lip_tip_clip, 0],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_fillet([w+2*wall, d+2*wall, h_b+2*wall_t],\n vertical=[wall\/2,wall\/2,wall\/2,wall\/2], \n top=[wall,wall,wall_t,wall],\n bottom=[wall\/2,wall\/2,wall\/2,wall\/2], $fn=4);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n }\n translate([wall, wall, wall_t]) cube([w, d, h_b+e]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n \/\/ ethernet\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,81.5,-1]) jhole(15,13);\n translate([0,81.5,-2]) jhole(5,5);\n }\n \/\/ USB 0+1\n if (Pi_Model == \"3B\/2B\/1B+\") {\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,0.2]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,2.5]) jhole(9.2,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-65, wall_t]) {\n difference() {\n cube_fillet([10,65,3], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,27.5,e]) cube_fillet([3,14,3], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n \/\/ bottom locklip (postive)\n translate([wall, d+wall, probe_centerline+wall_t]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\nhm43_split();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7e19c67a2dee4edd40e9eeca62759935d6a812f6","subject":"[3d] Add Zero extra lip, extend bottom screw head diameter into chamfer","message":"[3d] Add Zero extra lip, extend bottom screw head diameter into chamfer\n\nAlso cuts out some of the material on the botom screw bridging area\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3.5-0.4+wall_t, d=3.4, $fn=18);\n translate([0.0,0,h_b+wall_t-lcd_mount_t\/2-e])\n cylinder(lcd_mount_t\/2+e, d=(2.9*2)\/sin(60), $fn=6);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2;\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n dia = is_jig ? 3.2 : 3.4;\n cylinder(wall_t+2*e, d1=dia, d2=dia, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0])\n difference() {\n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n}\n\nmodule hm43() {\ndifference() {\n hm_base();\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[2,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,1]);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"55c973d1a6ca12df969734bcae205f2988c35442","subject":"\"\u0421\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439\" \u043a\u043e\u0434","message":"\"\u0421\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439\" \u043a\u043e\u0434","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Adenin.scad","new_file":"3D-models\/SCAD\/Adenin.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference() {\n translate ([dx\/2, t, 0]){ \n difference() { \n color() translate ([0, 0, 0]) cube ([x, y, z],center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\n union() { \n\n difference() {\n \n union() {\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n }\n } \n\ttranslate([-32, 0, 0]) cube([21, 21, 10],center=true);\n\n translate([-10, -10.5, 2]) cube([50, 21, 5]);\n } \n\n\n }\n #rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(6, 2.65, 2.65);\n translate([-13, -10.5, -1]) cube([39, 21, 5]);\n } \n } \n}\ndifference() {\n\n#translate([34, -10.5, -3.45]) cube([13, 21, 7]);\n#rotate([0, 90, 0]) translate([0, -5, 45]) cylinder(5, 2.65, 2.65);\n#rotate([0, 90, 0]) translate([0, 5, 45]) cylinder(5, 2.65, 2.65);\n}\n#rotate([90, 0, 0]) translate([-3, 0, -10.5]) cylinder(21, 3.5, 3.5);\n#rotate([90, 0, 0]) translate([34, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410\n translate([p, -7.55, 0-1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2-1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0-1]) cube ([9, 2, 2]);\n\n\n\n \n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=50; \ny=21; \nz=7; \nt=0; \nz2=2.5;\nedge=13.49; \ndx=19.0209; \np=14; \/\/\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0438\u043d\u0435 \u0431\u0443\u043a\u0432\u044b \u0410 \u043f\u043e \u043f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u0438\n\/\/\u0410\u0434\u0435\u043d\u0438\u043d \ndifference(){\n translate ([dx\/2, t, 0]){ \n difference(){ \n color() translate ([0, 0, 0]) cube ([x, y, z],center=true); \n rotate([180, 180, 0]) translate([41, 0, 0])\n\nunion(){ \n\n difference(){\n\nunion(){\n\n translate ([dx\/2, t, 0]) { \n\n color() translate ([0, 0, 5]) cube ([x-dx\/2, y, z+4], center=true); \n\n translate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([15, 15, z+2], center=true); \n\n translate([24.78, -9.5, -1]) cube([10, 19, 5]);\n}\n} \n\ttranslate([-32, 0, 0]) cube([21, 21, 10],center=true);\n\ntranslate([-10, -10.5, 2]) cube([50, 21, 5]);\n}\n\n\n}\n#rotate([0, 90, 0]) translate([0, 0, -23]) cylinder(6, 2.65, 2.65);\ntranslate([-13, -10.5, -1]) cube([39, 21, 5]);\n} \n\n} \n}\ndifference(){\n\n#translate([34,-10.5,-3.45]) cube([13, 21, 7]);\n#rotate([0, 90, 0]) translate([0, -5, 45]) cylinder(5, 2.65, 2.65);\n#rotate([0, 90, 0]) translate([0, 5, 45]) cylinder(5, 2.65, 2.65);\n}\n#rotate([90, 0, 0]) translate([-3, 0, -10.5]) cylinder(21, 3.5, 3.5);\n#rotate([90, 0, 0]) translate([34, 0, -10.5]) cylinder(21, 3.5, 3.5);\n\/\/\u0411\u0443\u043a\u0432\u0430 \u0410\n translate([p, -7.55, 0-1]) rotate ([0, 0, 22]) cube ([2, 16, 2]);\n translate([p, -6.8, 2-1]) rotate ([45, 90, 22]) cube ([2, 16, 2]);\n translate([p-3.8, 2, 0-1]) cube ([9, 2, 2]);\n\n\n\n \n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2cf2b55e760788170d57d12d36e6b5b1c2c10add","subject":"try a square tube at Hamstring for foot triangle. This might be easier to fabricate","message":"try a square tube at Hamstring for foot triangle.\nThis might be easier to fabricate\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=16,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+4,FGperp-3,-.3-1.7]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+4,\n FGperp-3,5.2+2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/\/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/\/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n \/\/translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4.5,FGperp-3.5,2.4]) rotate([0,0,142])\n cube([.75*2.54,.75*2.54,8],center=true);\n }\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/r38 = (3\/8)*2.54\/2; \/\/ radius of 3\/8\" bolt\n\na=360*$t;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.3);\n\n\/\/ -------------------------- crank-arm circle reference\n%color([1,.5,.3,.4]) translate([0,Ay,-2]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\ncolor([0.3,.3,1,.7]) \/\/ axles\nfor(x=[-1,1]) translate([x*Bx,0,0]) difference() { \n cylinder(r=2.54\/2,h=20,$fn=24,center=true);\n cylinder(r=2.54\/2-.4,h=22,$fn=19,center=true);\n}\n\n%translate([0,-93,0]) cube([200,2,2],center=true); \/\/ ground\n%color([0,0,1,.2]) translate([0,0,-8])\n cube([114,1.75*2.54,1.75*2.54],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/------------------------------------------------------- CrankLinks\ntranslate([xC,yC,linkOffset-.6]) rotate([0,0,atan2(yD-yC,xD-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CD);\ncheckLink(xC,yC,xD,yD,CD);\n\ntranslate([xC,yC,linkOffset+2]) rotate([0,0,atan2(yH-yC,xH-xC)])\n mirror([0,0,(linkOffset>0)?1:0]) crankLink(CH);\ncheckLink(xC,yC,xH,yH,CH);\n\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ include includes whole text.\n\/\/ use just imports modules\nuse \n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() {\nuseF698=0;\n hull() { \/\/ FG\n translate([4,0,.2]) cube([4,2.5,2.5],center=true);\n translate([FG-1.3,0,.2]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n\n \/\/ knee braces\/fork\n for (z=[-1.3,7]) rotate([0,0,(z>0)?25*0:0]) difference() {\n hull() {\n \/\/ This was elongated as a brace for knee\n \/\/translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n \/\/ wider knee shouldn't need brace\n translate([0,0,z]) cylinder(r=2.5,h=.4,$fn=24,center=true);\n translate([9,0,z])cylinder(r=1,h=.4,center=true);\n }\n #cylinder(r=.4,h=16,$fn=17,center=true);\n }\n\n\n \/\/ hinge holders at H\n if (useF698) {\n \/\/ F698 tubes for H-hinge fork\n %color([0,0,.6,.4])\n translate([FGleft,FGperp,-1]) difference() {\n cylinder(r=2.54\/2,h=7,$fn=36);\n\n cylinder(r=1.9\/2,h=22,center=true,$fn=24);\n translate([0,0,3.6])cube([3,3,2.8],center=true);\n }\n translate([FGleft,FGperp,-.87]) {\n rotate([180,0,0]) F698();\n translate([0,0,5.0]) rotate([180,0,0]) F698();\n translate([0,0,1.95]) F698();\n translate([0,0,6.75]) F698();\n }\n } else {\n \/\/ use SA8 Heim rod-ends for H fork\n \/\/ use some washers\/spacers to get heim a few mm inside fork, to allow\n \/\/ room for connecting rod to clear fork\n for (z=[-.7+.3,5.6-.3]) translate([FGleft,FGperp,z])\n rotate([0,0,142]) SI8onBolt(); \/\/SA8();\n }\n\n \/\/ vertical brace extension at knee\n translate([3.5,0,4.1]) cube([2.5,2.5,5.3],center=true);\n hull() { \/\/ gusset\n translate([ 5.5,-1,1]) cylinder(r=.2,h=5.8,$fn=8);\n translate([18, 1,0]) cylinder(r=.3,h=1 ,$fn=8);\n }\n\n \/\/ FH segment bracing\n for (z=[-.3,5.1]) hull() {\n translate([ 3 , 1 ,z]) barEnd1();\n translate([FGleft-(useF698?1:-4),\n FGperp-(useF698?1:4),z]) barEnd1();\n }\n hull() { \/\/ dig brace. Could be gusset?\n translate([3,1,5.7]) barEnd1();\n translate([useF698?12:13+2,11,-.3]) barEnd1();\n }\n hull() {\n translate([FGleft-(useF698?7.2:5-4),FGperp-8,5.3]) barEnd1();\n translate([useF698?14:15.5+2.6,13.5,-.3]) barEnd1();\n }\n\n \/\/ GH braces\n hull() {\n translate([FG-8,0,-.3]) barEnd1();\n translate([FGleft+5,FGperp-4,-.3]) barEnd1();\n }\n hull() {\n translate([FG-10,0,0]) barEnd1();\n translate([FGleft+5,\n FGperp-4,5.2]) barEnd1();\n }\n\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,5.2]) barEnd1();\n translate([FGleft+4,FGperp-4,5.2]) barEnd1();\n translate([FGleft,0,0]) barEnd1();\n }\n hull() { \/\/ perp brace\n \/\/translate([FGleft,FGperp-1,-.3]) barEnd1();\n translate([FGleft+4,FGperp-4,-.3]) barEnd1();\n translate([FGleft,0,-.3]) barEnd1();\n }\n\n \/\/ extra truss braces\n hull() {\n translate([46,15,3]) barEnd1();\n translate([35, 0,0]) barEnd1();\n }\n\n \/\/ out-of-plane perp braces\n if (useF698) {\n translate([FGleft+2,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft,FGperp-2,.3]) cylinder(r=.6,h=5);\n translate([FGleft-2,FGperp-2,.3]) cylinder(r=.8,h=5,$fn=11);\n } else {\n \/\/translate([FGleft+1,FGperp-2,.3]) cylinder(r=.6,h=5);\n \/\/translate([FGleft-1,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n translate([FGleft+4,FGperp-4,.3]) cylinder(r=.8,h=5,$fn=11);\n }\n}\n\n$fn=12;\nmodule hip() {\n translate([DE\/2,0,-.2]) rotate([0,90,0]) \/\/ top tube\n cylinder(r=.9,h=DE-4,$fn=17,center=true);\n\n translate([DE-DEleft,-DEperp,-1.2]) difference() {\n union() {\n cylinder(r=2.54*1.75\/2,h=7.2,$fn=36); \/\/ axle\n\n hull() { \/\/ diag tubes\n translate([-1.6,1.4,1.2]) barEnd1();\n translate([DEleft-DE+2,DEperp,1.2]) barEnd1();\n }\n hull() {\n translate([0,0,1.2]) barEnd1();\n translate([DE-DEleft-1,DEperp,1.2]) barEnd1();\n }\n\n \/\/ extra brace\n translate([0,0,6.2]) rotate([-105,0,0]) cylinder(r=.8,h=20);\n }\n\n \/\/ bore out for 6805 bearing\n cylinder(r=3.7\/2+.1,h=22,$fn=18,center=true);\n }\n\n \/\/ use cut-out square tube (or channel) for forks, instead of all welded.\n \/\/ easier to drill and maintain aligned holes\n \/\/ 14ga roughly 2mm thick\n translate([DE,0,0]) rotate([0,0,180]) channelFork();\n channelFork();\n\n\n \/\/ extra bracing\n translate([DE\/2,-15,0]) rotate([0,90,0]) cylinder(r=.8,h=35,center=true);\n}\n\n\/\/ cut-out square tube (or channel) for forks\n\/\/ easier to drill and maintain aligned holes\nmodule channelFork(od=2.54*1.24,gu=.2,len=3,hd=.82,co=.5)\ntranslate([co,0,0]) difference() { \n cube([od ,len ,od ],center=true);\n cube([od-2*gu,len+1,od-2*gu],center=true);\n\n \/\/ open one side of square tube to make a channel\n translate([-od\/2,0,0]) cube([2.1*gu,len+1,od-2*gu-.05],center=true);\n\n \/\/ put hole at x=0,y=0 in part space.\n translate([-co,0,0]) cylinder(r=hd\/2,h=od+1,$fn=17,center=true);\n}\n\n\/*\nmodule eFork() for(z=[-1,1]) difference() { \n hull() {\n translate([0,0,1.4*z]) cylinder(r=2,h=.3,$fn=24,center=true);\n translate([6,0,1.4*z]) cube([1,2,.3],center=true);\n }\n cylinder(r=.4,h=11,$fn=17,center=true);\n}\n*\/\n\nmodule crankLink(dx=CD) {\n %color([0,0,.6,.4]) difference() {\n cylinder(r=2.54\/2,h=.9,$fn=36,center=true);\n cylinder(r=2.54\/2-.17,h=2,$fn=24,center=true);\n }\n translate([0,0, .31]) F698(); \/\/cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([0,0,-.31]) rotate([180,0,0]) F698();\n\n \/\/translate([dx\/2-1,0,0]) cube([dx-3,1.3,1.3],center=true);\n %color([0,.8,0,.6])\n translate([dx\/2-1-1,0,0]) rotate([0,90,0])\n cylinder(r=.6,h=dx-3-3,$fn=11,center=true);\n\n translate([dx,0,0]) SI8onBolt(); \/\/SA8();\n}\n\n\nmodule EFlink() {\n translate([EF,0,0]) SI8onBolt(); \/\/SA8();\n translate([EF\/2-.4-1.5,0,0]) rotate([0,90,0])\n cylinder(r=.8,h=EF-3-3,$fn=13,center=true);\n\n \/\/ ------ tube and knee bearings\n %color([0,0,.6,.4])\n translate([0,0,-.84]) difference() {\n cylinder(r=2.54\/2,h=2.54*3-.25,$fn=36);\n cylinder(r=2.54\/2-.3,h=22,$fn=36,center=true);\n }\n translate([0,0,6.41]) F698();\n translate([0,0,-.7]) rotate([180,0,0]) F698();\n\n hull() { \/\/ gusset\n translate([1.3,0,2*2.54\/2]) cylinder(r=.2,h=2.54*3,$fn=12,center=true);\n translate([9,0, 0 ]) cylinder(r=.2,h=1,$fn=12); \n }\n\n \/\/translate([EF,0,0]) cylinder(r=r38,h=5,center=true);\n \/\/ \/\/cylinder(r=r38,h=55,center=true);\n \/\/cylinder(r=1.2,h=22,$fn=36,center=true);\n}\n\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n difference() { \/\/ main axle rings\n union() {\n \/\/ main axle tube\n translate([0,0,2.4]) cylinder(r=2.54*1.75\/2,h=13.5,$fn=36,center=true);\n\n for(z=[-2.4,7.2]) { \/\/ main side rails\n hull() {\n translate([BH-6,0,z]) barEnd1();\n translate([ 0,0,z]) barEnd1();\n }\n }\n\n }\n\n translate([0,0,2.4]) cube([5,5,7.9],center=true);\n cylinder(r=3.7\/2+.1,h=22,$fn=19,center=true);\n }\n\n\n \/\/ brace near axle\n translate([3.3,0,2.2]) cylinder(r=.8,h=10,$fn=19,center=true);\n\n\/* get rid of fork brace. Comes close to hitting CH cranklink.\n let cross members hold forks apart\n \/\/ fork brace \n translate([BH-7,0,2.43]) cube([2.5,2.5,7.6],center=true);\n\n hull() {\n translate([ 4,.7,-1.6]) barEnd1();\n translate([BH-9,.7, 6.2]) barEnd1(); \n }\n hull() {\n translate([ 4,-.7, 6.2]) barEnd1();\n translate([BH-9,-.7,-1.6]) barEnd1(); \n }\n*\/\n\n BHcrosses();\n\n \/\/ H forks\n for(z=[-1.7,6.2]) translate([BH,0,z]) difference() {\n hull() {\n cylinder(r=2,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n #cylinder(r=.4,h=2+6,center=true);\n }\n\n \/\/ to check dimensions\n \/\/%translate([BH\/2,0,2.4]) cube([BH,1,7.8],center=true);\n}\n\n\n\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses() {\nh1=BH-4; \/\/ node closest to H\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([b1, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n}\n\n\n\/*\n\/\/ diag braces. Try to leave fork area open to allow clearance for CH link\nmodule BHcrosses2() {\nh1=BH-4; \/\/ node closest to H\nh2=h1-19;\nb2=h2-4;\nb1=4;\nspread=.7;\nlo=-1.6;\nhi=6.5;\nrBar=.8;\n hull() {\n translate([h2, spread,lo]) barEnd1();\n translate([h1, spread,hi]) barEnd1(); \n }\n hull() {\n translate([h2,-spread,hi]) barEnd1();\n translate([h1,-spread,lo]) barEnd1(); \n }\n hull() {\n translate([b1,-spread,lo]) barEnd1();\n translate([b2,-spread,hi]) barEnd1(); \n }\n hull() {\n translate([b2,spread,lo]) barEnd1();\n translate([b1,spread,hi]) barEnd1(); \n }\n}\n*\/\n\n\nmodule barEnd1() sphere(.8,$fn=12);\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"77a801a7ae2fbe5b4628b3c8e1d850d5e7965757","subject":"added option to print names on each holder part","message":"added option to print names on each holder part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toothbrush_holder\/toothbrush_holder.scad","new_file":"toothbrush_holder\/toothbrush_holder.scad","new_contents":"include \n\n\/*\n * configuration\n *\/\nbrushes_count = 2;\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\nname = [\"name1\", \"name2\"];\n\nrotate([90, 0, 0])\n{\n for(i = [0:brushes_count-1])\n {\n translate([i*30,4,55])\n rotate([-90, 90, 0])\n scale([2,1,1])\n write(name[i], t=2, h=8, center=true);\n translate(i * [30, 0, 0])\n brush_holder();\n }\n}\n","old_contents":"\/*\n * configuration\n *\/\nbrushes_count = 2;\n\/\/$fn=200;\n\n\/*\n * modules\n *\/\n\nmodule lower_tub()\n{\n translate([0, (20+4)\/2, 0])\n difference()\n {\n cylinder(h=10+3, r=(20+3)\/2);\n translate([0,0,3])\n cylinder(h=10+3, r2=20\/2, r1=16\/2);\n }\n}\n\nmodule upper_ring()\n{\n translate([0, (24+5)\/2, 0])\n difference()\n {\n cylinder(h=10, r=(24+5)\/2);\n cylinder(h=10, r=(24+0)\/2);\n }\n}\n\n\nmodule back_wall()\n{\n \/\/ lower part\n translate([-40\/2, 0, 0])\n cube([40, 3, 20]);\n \/\/ upper part\n translate([-40\/2, 0, 100-10])\n cube([40, 3, 20]);\n \/\/ connector\n translate([-10\/2, 0, 0])\n cube([10, 3, 100]);\n}\n\n\nmodule brush_holder()\n{\n lower_tub();\n translate([0,0,100-5])\n upper_ring();\n back_wall();\n \/\/ lower mounting\n difference()\n {\n translate([-15\/2, 3, 0])\n cube([15, 4, 10+3]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n lower_tub();\n }\n \/\/ upper mounting\n translate([0, 0, 100-5])\n {\n difference()\n {\n translate([-25\/2, 3, 0])\n cube([25, 10, 10]);\n translate([0, 0.1, 0]) \/\/ needed to make model simple (aka: manifold)\n hull()\n upper_ring();\n }\n }\n}\n\n\n\/*\n * main program\n *\/\n\nrotate([90, 0, 0])\n{\n for(offset = [0:brushes_count-1])\n {\n translate(offset * [30, 0, 0])\n brush_holder();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f9c9628b2a16f927265473a39e6c633726e7a4f6","subject":"bearing: add assert","message":"bearing: add assert\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"include \ninclude \ninclude \n\nuse ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=U, orient=Z, align=N)\n{\n assert(bearing_type != U);\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n material(Mat_Aluminium)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=N);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=N);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=-z*Z);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=-z*Z);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, align=N, orient=Z, ziptie_dist=U, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=Z);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+2*mm, h=100, orient=Z);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n material(Mat_Ziptie)\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=Z);\n translate([30,0,0])\n bearing(b, orient=Z);\n}\n","old_contents":"include \ninclude \ninclude \n\nuse ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=U, orient=Z, align=N)\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n material(Mat_Aluminium)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=N);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=N);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=-z*Z);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=-z*Z);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, extra_h=0, override_h=U, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, align=N, orient=Z, ziptie_dist=U, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=Z);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=N\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+2*mm, h=100, orient=Z);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n material(Mat_Ziptie)\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=Z,\n align=-z*Z\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=Z);\n translate([30,0,0])\n bearing(b, orient=Z);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"343b690f26b3049b90386edb525202059baa38f6","subject":"x\/carriage\/extruder\/b: increase guidler cut for tolerance","message":"x\/carriage\/extruder\/b: increase guidler cut for tolerance\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=true);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+5*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=true);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7ab0436744e9959ab7a193f80c9ad58d1f0fae39","subject":"x\/carriage\/extruder\/a: fix bearing support","message":"x\/carriage\/extruder\/a: fix bearing support\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n translate(-h*Y)\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n screw_cut(nut=motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_bearing[2]-extruder_a_bearing_offset_y.y+1*mm, orient=Y, align=-Y);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n \/*x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);*\/\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extrasize=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extrasize_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=Y, align=Y);\n cylindera(d=10*mm, h= 3*mm, orient=Y, align=Y);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=Y, align=Y);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=Y, align=Y);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n \/\/ round dia\n rotate([0,extruder_motor_mount_angle,0])\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=Y, align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n translate(-h*Y)\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n screw_cut(nut=motor_nut, h=h, with_nut=false, orient=Y, align=Y);\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=Y, align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=Y, align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=Y, extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ main body\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n \/\/ mount onto carriage\n if(with_sensormount)\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1])\n sensormount(part, align=-Y);\n\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n proj_extrude_axis(axis=Y, offset=extruder_b_sensormount_offset[1]+1)\n sensormount(part, align=-Y);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=Y);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=Y);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*X)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=Y, align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=Z, orient=X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-Y);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n if(with_sensormount)\n translate(-80*Z)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=Y, align=N);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=Y, align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(pos=extruder_a_mount_offsets)\n translate(pos)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n }\n}\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=Y, extrasize=[0,0,guidler_extra_h_up], extrasize_align=Z);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=X);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=Y);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=Y, orient=Y);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=Y, orient=Y);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-Y)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=Y, align=Y);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=Y);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=Y, orient=Y);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=Z);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=X);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=X, align=X);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=Y);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=X);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=X);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=X);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=X);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, align=N)\n{\n sensormount_cylinder(part=part, align=align);\n \/*if(part == \"pos\")*\/\n \/*{*\/\n \/*cubea();*\/\n \/*}*\/\n \/*else if(part == \"neg\")*\/\n \/*{*\/\n \/*cubea(s=[11,11,11]);*\/\n \/*}*\/\n \/*if(part == \"vit\")*\/\n \/*{*\/\n \/*%translate([-6,2,5])*\/\n \/*[>rotate(Z*-90 + X*180)<]*\/\n \/*[>rotate(X*180)<]*\/\n \/*rotate(X*90)*\/\n \/*rotate(Z*180)*\/\n \/*import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");*\/\n \/*}*\/\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=N)\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=Z)\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=Z);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=Z);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n \/*x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);*\/\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"61b4452c644ee5693a33d6eaaeb4cf70f4b8ea7d","subject":"nipple: constant","message":"nipple: constant\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/nipple.scad","new_file":"class1\/exercise\/refactor\/nipple.scad","new_contents":"include ;\nHEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nmodule top_little()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = FINE);\n}\nmodule nipple()\n{\n top_little();\n \n \/\/First shoulder\ncolor(GREY)\ntranslate([0,0,-BORDER_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n\n\/\/Main nipple cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = FINE);\n\n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = FINE);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = FINE);\n \n} \n\nnipple();\n","old_contents":"HEIGHT_NIPPLE = 0.8;\nDIAMETER_NIPPLE = 3;\nBORDER_NIPPLE = 0.2;\nDIAMETER_BASE_NIPPLE = 6;\n\nGREY = \"LightGrey\";\n\nmodule nipple()\n{\n color(GREY)\n translate([0,0,-BORDER_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE, \n d = (DIAMETER_NIPPLE - (2 * BORDER_NIPPLE)),\n $fn = 100);\n \n \/\/First shoulder\ncolor(GREY)\ntranslate([0,0,-BORDER_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n\n\/\/Main nipple cylinder\ncolor(GREY)\ntranslate([0,0,-(HEIGHT_NIPPLE - BORDER_NIPPLE)])\n cylinder(\n h = (HEIGHT_NIPPLE - (BORDER_NIPPLE + BORDER_NIPPLE)),\n d = DIAMETER_NIPPLE,\n $fn = 100);\n\n\/\/Main nipple cylinder; base fillet\ncolor(GREY)\ndifference()\n{\n translate([0,0,BORDER_NIPPLE - HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2), 0, 0])\n square((BORDER_NIPPLE),(BORDER_NIPPLE));\n\n translate([0,0,(2 * BORDER_NIPPLE) - HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_NIPPLE\/2)+ BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n}\n \n\/\/Nipple shoulder cylinder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n cylinder(\n h = BORDER_NIPPLE,\n d = DIAMETER_BASE_NIPPLE - (2 * BORDER_NIPPLE),\n $fn = 100);\n \n\/\/Nipple base shoulder\ncolor(GREY)\ntranslate([0,0,-HEIGHT_NIPPLE])\n rotate_extrude(convexity = 10, $fn = 100)\n translate([(DIAMETER_BASE_NIPPLE\/2)-BORDER_NIPPLE, 0, 0])\n circle(r = BORDER_NIPPLE, $fn = 100);\n \n} \n\nnipple();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"f1fb0e3e19b31cb324adfd4908661fa3d9921903","subject":"tweak","message":"tweak\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\n*\/\n\n\nmodule LogoBotAssembly() {\n\t\n\t\/\/ TODO: needs to be translated up to correct height\n\ttranslate([0, 0, 0]) {\n\t\n\t\t\/\/ Base\n\t\tLogoBotBase_STL();\n\t\n\t\t\/\/ Bumper assembly\n\t\n\t\t\/\/ Motor + Wheel assemblies (x2)\n\t\t\n\t\n\t\t\/\/ Battery assembly\n\t\n\t\t\/\/ Shell\n\t\n\t\t\/\/ bolts?\n\t\n\t\n\t\t\/\/ etc\n\t\n\t\n\t\t\/\/ Caster\n\t\t\/\/ Example of using attach\n\t\tattach(Base_Con_Caster, PlasticCastor_Con_Default)\n\t\t\tPlasticCaster();\n\t\t\n\t}\n}\n\n\n\n\/*\n\tSTL: LogoBotBase_STL\n\t\n\tThe printable base plate for the robot.\n\t\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\t\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\n\/\/ LogoBot Base Connectors\n\/\/\n\/\/ Connectors are defined as an array of 5 parameters:\n\/\/ 0: Translation vector as [x,y,z]\n\/\/ 1: Vector defining the normal of the connection as [x,y,z]\n\/\/ 2: Rotation angle for the connection\n\/\/ 3: Thickness of the mating part - used for bolt holes\n\/\/ 4: Clearance diameter of the mating hole - used for bolt holes\n\n\/\/ Connector: Base_Con_Caster\n\/\/ Connection point for the caster at back edge of the base plate\nBase_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\n\nmodule LogoBotBase_STL() {\n\t\n\t\/\/ Color it as a printed plastic part\n\tcolor(PlasticColor)\n\t\t\/\/ Pre-render to speed editing and avoid overloading the cache\n\t\trender()\n\t\t\/\/ Extrude to correct thickness\n\t\tlinear_extrude(BaseThickness)\n\t\tdifference() {\n\t\t\t\/\/ Union together all the bits to make the plate\n\t\t\tunion() {\n\t\t\t\t\/\/ Base plate\n\t\t\t\tcircle(r=BaseDiameter\/2);\n\t\t\t}\n\t\t\t\n\t\t\t\/\/ Now punch some holes...\n\t\t\n\t\t\t\/\/ Centre hole for pen\n\t\t\tcircle(r=PenHoleDiameter\/2);\n\t\n\t\t\t\/\/ Chevron at the front so we're clear where the front is!\n\t\t\ttranslate([0, BaseDiameter\/2 - 10, 0])\n\t\t\t\tChevron(width=10, height=6, thickness=3);\n\t\t\t\t\n\t\t\t\/\/ Caster\n\t\t\t\/\/ Example of using attach to punch an appropriate fixing hole\n\t\t\tattach(Base_Con_Caster, PlasticCastor_Con_Default)\n\t\t\t\tcircle(r = connector_bore(PlasticCastor_Con_Default) \/ 2);\n\t\n\t\t\t\n\t\t\t\n\t\t\t\/\/ A load of fixing holes around the edge... just as an example of how to do it\n\t\t\t\/\/ NB: This is one of the examples we discussed during the wk1 session\n\t\t\tfor (i=[0:9])\n\t\t\t\trotate([0, 0, i * 360\/10])\n\t\t\t\ttranslate([BaseDiameter\/2 - 5, 0, 0])\n\t\t\t\tcircle(r=4.3\/2); \/\/ M4 fixing holes\n\t\t}\n}","old_contents":"\/*\n\tAssembly: LogoBotAssembly\n\t\n\tMaster assembly for the LogoBot\n\t\n\tLocal Frame:\n\t\tCentred on the origin, such that bottom edge of wheels sit on XY plane.\n\t\tFront of the robot faces towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tComplete LogoBot model\n\t\n*\/\n\n\nmodule LogoBotAssembly() {\n\t\n\t\/\/ TODO: needs to be translated up to correct height\n\ttranslate([0, 0, 0]) {\n\t\n\t\t\/\/ Base\n\t\tLogoBotBase_STL();\n\t\n\t\t\/\/ Bumper assembly\n\t\n\t\t\/\/ Motor + Wheel assemblies (x2)\n\t\t\n\t\n\t\t\/\/ Battery assembly\n\t\n\t\t\/\/ Shell\n\t\n\t\t\/\/ etc\n\t\n\t\n\t\t\/\/ Caster\n\t\t\/\/ Example of using attach\n\t\tattach(Base_Con_Caster, PlasticCastor_Con_Default)\n\t\t\tPlasticCaster();\n\t\t\n\t}\n}\n\n\n\n\/*\n\tSTL: LogoBotBase_STL\n\t\n\tThe printable base plate for the robot.\n\t\n\tThe _STL suffix denotes this is a printable part, and is used by the bulk STL generating program\n\t\n\tLocal Frame:\n\t\tBase lies on XY plane, centered on origin, front of robot is towards y+\n\t\n\tParameters:\n\t\tNone\n\t\n\tReturns:\n\t\tBase plate, rendered and colored\n*\/\n\n\/\/ LogoBot Base Connectors\n\/\/\n\/\/ Connectors are defined as an array of 5 parameters:\n\/\/ 0: Translation vector as [x,y,z]\n\/\/ 1: Vector defining the normal of the connection as [x,y,z]\n\/\/ 2: Rotation angle for the connection\n\/\/ 3: Thickness of the mating part - used for bolt holes\n\/\/ 4: Clearance diameter of the mating hole - used for bolt holes\n\n\/\/ Connector: Base_Con_Caster\n\/\/ Connection point for the caster at back edge of the base plate\nBase_Con_Caster = [ [0, -BaseDiameter\/2 + 10, 0], [0,0,1], 0, 0, 0];\n\n\nmodule LogoBotBase_STL() {\n\t\n\t\/\/ Color it as a printed plastic part\n\tcolor(PlasticColor)\n\t\t\/\/ Pre-render to speed editing and avoid overloading the cache\n\t\trender()\n\t\t\/\/ Extrude to correct thickness\n\t\tlinear_extrude(BaseThickness)\n\t\tdifference() {\n\t\t\t\/\/ Union together all the bits to make the plate\n\t\t\tunion() {\n\t\t\t\t\/\/ Base plate\n\t\t\t\tcircle(r=BaseDiameter\/2);\n\t\t\t}\n\t\t\t\n\t\t\t\/\/ Now punch some holes...\n\t\t\n\t\t\t\/\/ Centre hole for pen\n\t\t\tcircle(r=PenHoleDiameter\/2);\n\t\n\t\t\t\/\/ Chevron at the front so we're clear where the front is!\n\t\t\ttranslate([0, BaseDiameter\/2 - 10, 0])\n\t\t\t\tChevron(width=10, height=6, thickness=3);\n\t\t\t\t\n\t\t\t\/\/ Caster\n\t\t\t\/\/ Example of using attach to punch an appropriate fixing hole\n\t\t\tattach(Base_Con_Caster, PlasticCastor_Con_Default)\n\t\t\t\tcircle(r = connector_bore(PlasticCastor_Con_Default) \/ 2);\n\t\n\t\t\t\n\t\t\t\n\t\t\t\/\/ A load of fixing holes around the edge... just as an example of how to do it\n\t\t\t\/\/ NB: This is one of the examples we discussed during the wk1 session\n\t\t\tfor (i=[0:9])\n\t\t\t\trotate([0, 0, i * 360\/10])\n\t\t\t\ttranslate([BaseDiameter\/2 - 5, 0, 0])\n\t\t\t\tcircle(r=4.3\/2); \/\/ M4 fixing holes\n\t\t}\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"182eae2de0fedee917e2560fc99ff85f03b0a7a8","subject":"Add clearance area for board components","message":"Add clearance area for board components","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ProMicro.scad","new_file":"hardware\/vitamins\/ProMicro.scad","new_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\n\/\/ Pro Micro\/Mini\nboard_colour = [26\/255, 90\/255, 160\/255];\nmetal_colour = [220\/255, 220\/255, 220\/255];\n\n\/\/ Show board clearance area for components\nboard_clearance = 3;\nshow_clearance = true;\n\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n micro_usb_area = [7.7, 5.2];\n micro_usb_height = 2.7;\n\n color(metal_colour)\n translate([pcbWidth\/2 - holeInset, pcbLength - holeSpace, pcbHeight])\n linear_extrude(height=2.7)\n square(size = micro_usb_area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(board_colour)\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (show_clearance)\n color(board_colour, 0.1)\n translate([-holeInset, -holeInset, pcbHeight])\n linear_extrude(height=board_clearance)\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: Pro Micro\n Model of an Arduino Pro Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n FIXME: type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n FIXME: Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ PCB Variables\nholeDiam = 1.25; \/\/ The hole diameter in mm\nholeSpace = 2.54; \/\/ The spacing of the holes in mm\nholeInset = holeSpace\/2; \/\/ The spacing of the holes in mm\npcbHeight = .063 * 25.4; \/\/ The thickness of the PCB in mm\npcbLength = 1.3 * 25.4; \/\/ The length of the PCB in mm\npcbWidth = 0.7 * 25.4; \/\/ The width of the PCB in mm\n\n\/\/ Pro Micro\/Mini\nboard_colour = [26\/255, 90\/255, 160\/255];\nmetal_colour = [220\/255, 220\/255, 220\/255];\n\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n micro_usb_area = [7.7, 5.2];\n micro_usb_height = 2.7;\n\n color(metal_colour)\n translate([pcbWidth\/2 - holeInset, pcbLength - holeSpace, pcbHeight])\n linear_extrude(height=2.7)\n square(size = micro_usb_area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin at location for bottom left hole\n translate([-holeInset, -holeInset, 0]) {\n square(size = [pcbWidth, pcbLength]);\n }\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = pcbWidth - holeInset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = pcbLength - holeSpace - holeInset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : holeSpace : rowlength]) {\n translate([x, y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = pcbLength - holeInset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = pcbWidth - holeInset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [holeInset : holeSpace : rowwidth]) {\n translate([x, header_y, 0]) {\n \/\/ Standard PCB hole\n circle(r = holeDiam\/2);\n }\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(board_colour)\n linear_extrude(height=pcbHeight)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n }\n}\n\nArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6907cd85dc0327fb9be3d1217afa715afb3f6e6e","subject":"Fix bug in ULN2003","message":"Fix bug in ULN2003\n\nnested vitamins (LEDs) not correctly wrapped in ULN2003 vitamin\nstatement\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ULN2003DriverBoard.scad","new_file":"hardware\/vitamins\/ULN2003DriverBoard.scad","new_contents":"\/*\n\tVitamin: ULN2003DriverBoard\n\tModel of a stepper driver board.\n\tBased on http:\/\/42bots.com\/tutorials\/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno\/\n\n\tLocal Frame:\n\t\tCentred on the bottom left mounting hole\n*\/\n\nULN2003Driver_BoardHeight = 35;\nULN2003Driver_BoardWidth = 30;\nULN2003Driver_PCBThickness = 1.5;\nULN2003Driver_HoleDia = 3;\nULN2003Driver_HoleInset = 2.5;\n\n\/\/ Connectors\nULN2003DriverBoard_Con_LowerLeft\t= [ [0, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_LowerRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperLeft\t= [ [0, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\n\nULN2003DriverBoard_Con_Stepper\t\t= [ [4 - ULN2003Driver_HoleInset, 22 - ULN2003Driver_HoleInset, ULN2003Driver_PCBThickness + 2.25], [0, 0, -1], 0, 0 ];\nULN2003DriverBoard_Con_Arduino\t\t= [ [6 - ULN2003Driver_HoleInset, 6 - ULN2003Driver_HoleInset, ULN2003Driver_PCBThickness + 2.25], [0, 0, -1], 180, 0 ];\nULN2003DriverBoard_Con_Power\t\t= [ [24.5 - ULN2003Driver_HoleInset, 9 - ULN2003Driver_HoleInset, ULN2003Driver_PCBThickness + 2.25], [0, 0, -1], 90, 0 ];\n\nULN2003DriverBoard_Cons = [\n\tULN2003DriverBoard_Con_LowerLeft,\n\tULN2003DriverBoard_Con_LowerRight,\n\tULN2003DriverBoard_Con_UpperLeft,\n\tULN2003DriverBoard_Con_UpperRight,\n\tULN2003DriverBoard_Con_Stepper,\n\tULN2003DriverBoard_Con_Arduino,\n\tULN2003DriverBoard_Con_Power\n];\n\n\n\nmodule ULN2003DriverBoard_PCB(includeFixings=true, thickness=ULN2003Driver_PCBThickness) {\n\t\/\/ Base PCB\n\t\/\/ offset origin to bottom left\n\tcolor([0.2,0.6,0.3])\n\ttranslate([(ULN2003Driver_BoardWidth \/ 2) - ULN2003Driver_HoleInset, (ULN2003Driver_BoardHeight \/ 2) - ULN2003Driver_HoleInset, 0])\n\t\tlinear_extrude(thickness)\n\t\tdifference() {\n\t\t\tsquare([ULN2003Driver_BoardWidth, ULN2003Driver_BoardHeight], center=true);\n\n\t\t\t\/\/ Mounting holes\n\t\t\tif (includeFixings)\n\t\t\t\tfor (i = [0:1], j = [0:1])\n\t\t\t\tmirror([i, 0, 0])\n\t\t\t\tmirror([0, j, 0])\n\t\t\t\ttranslate([ULN2003Driver_BoardWidth \/ 2 - ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight \/ 2 - ULN2003Driver_HoleInset, 0])\n\t\t\t\t\tcircle(r = ULN2003Driver_HoleDia \/ 2);\n\t\t}\n}\n\n\nmodule ULN2003DriverBoard() {\n\n\tif (DebugCoordinateFrames) frame();\n\n\tif (DebugConnectors)\n\t\tfor (c = ULN2003DriverBoard_Cons)\n\t\t\tconnector(c);\n\n\tvitamin(\n\t\t\"vitamins\/ULN2003DriverBoard.scad\",\n\t\tstr(\"ULN2003 Driver Board\"),\n\t\tstr(\"ULN2003DriverBoard()\")\n\t) {\n\t\tview(d=140);\n\n\t\tULN2003DriverBoard_PCB();\n\n\t\t\/\/ everything else\n\t\ttranslate([(ULN2003Driver_BoardWidth \/ 2) - ULN2003Driver_HoleInset, (ULN2003Driver_BoardHeight \/ 2) - ULN2003Driver_HoleInset, 0])\n\t\t{\n\t\t\t\/\/ Move us to the bottom left of the PCB\n\t\t\ttranslate([-ULN2003Driver_BoardWidth \/ 2, -ULN2003Driver_BoardHeight \/ 2, 0]) {\n\n\t\t\t\t\/\/ ULN2003 chip\n\t\t\t\tcolor(\"darkgrey\")\n\t\t\t\ttranslate([1, 8, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tcube([20, 10, 8]);\n\n\t\t\t\t\/\/ Arduino header\n\t\t\t\ttranslate([6, 6, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tPcbPinStrip(4);\n\n\t\t\t\t\/\/ Stepper Connection\n\t\t\t\tcolor(\"white\")\n\t\t\t\ttranslate([1.5, 19, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tdifference() {\n\t\t\t\t\t\tcube([15.5, 6, 8]);\n\t\t\t\t\t\ttranslate([1, 1, 1])\n\t\t\t\t\t\t\tcube([13.5, 4, 8]);\n\t\t\t\t\t}\n\t\t\t\ttranslate([4, 22, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tPcbPinStrip(5, 0, false);\n\n\t\t\t\t\/\/ Power & On\/Off Jumper\n\t\t\t\ttranslate([24.5, 9, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tPcbPinStrip(4, 90);\n\n\t\t\t\t\/\/ LEDS\n\t\t\t\ttranslate([6, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tLED_3mm();\n\t\t\t\ttranslate([10, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tLED_3mm();\n\t\t\t\ttranslate([14.5, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tLED_3mm();\n\t\t\t\ttranslate([19, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\t\tLED_3mm();\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule PcbPinStrip(numPins = 4, a = 0, spacers = true)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n\trotate(a = a)\n\tfor (i = [0 : numPins - 1]) {\n\t\ttranslate([i * pcbholepitch, 0, 0]) {\n\t\t\t\/\/ Header Pins\n\t\t\tcolor(\"white\")\n\t\t\ttranslate([0, 0, -pinoffset])\n\t\t\tlinear_extrude(pinheight)\n\t\t\t\tsquare(pinwidth, center = true);\n\n\t\t\tif (spacers) {\n\t\t\t\t\/\/ Pin Spacers\n\t\t\t\tcolor(Grey20)\n\t\t\t\tlinear_extrude(spacerheight)\n\t\t\t\t\tsquare(spacerwidth, center = true);\n\n\t\t\t\t\/\/ Break-Away Material\n\t\t\t\tcolor(Grey20)\n\t\t\t\ttranslate([pcbholepitch\/2, 0, 0])\n\t\t\t\tlinear_extrude(spacerheight)\n\t\t\t\t\tsquare([pcbholepitch - spacerwidth, spacerwidth * 0.85], center = true);\n\t\t\t}\n\t\t}\n\t}\n}\n","old_contents":"\/*\n\tVitamin: ULN2003DriverBoard\n\tModel of a stepper driver board.\n\tBased on http:\/\/42bots.com\/tutorials\/28byj-48-stepper-motor-with-uln2003-driver-and-arduino-uno\/\n\n\tLocal Frame:\n\t\tCentred on the bottom left mounting hole\n*\/\n\nULN2003Driver_BoardHeight = 35;\nULN2003Driver_BoardWidth = 30;\nULN2003Driver_PCBThickness = 1.5;\nULN2003Driver_HoleDia = 3;\nULN2003Driver_HoleInset = 2.5;\n\n\/\/ Connectors\nULN2003DriverBoard_Con_LowerLeft\t= [ [0, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_LowerRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, 0, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperLeft\t= [ [0, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\nULN2003DriverBoard_Con_UpperRight\t= [ [ULN2003Driver_BoardWidth - 2 * ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight - 2 * ULN2003Driver_HoleInset, 0], [0, 0, -1], 0, ULN2003Driver_PCBThickness, ULN2003Driver_HoleDia];\n\nULN2003DriverBoard_Con_Stepper\t\t= [ [4 - ULN2003Driver_HoleInset, 22 - ULN2003Driver_HoleInset, ULN2003Driver_PCBThickness + 2.25], [0, 0, -1], 0, 0 ];\nULN2003DriverBoard_Con_Arduino\t\t= [ [6 - ULN2003Driver_HoleInset, 6 - ULN2003Driver_HoleInset, ULN2003Driver_PCBThickness + 2.25], [0, 0, -1], 180, 0 ];\nULN2003DriverBoard_Con_Power\t\t= [ [24.5 - ULN2003Driver_HoleInset, 9 - ULN2003Driver_HoleInset, ULN2003Driver_PCBThickness + 2.25], [0, 0, -1], 90, 0 ];\n\nULN2003DriverBoard_Cons = [\n\tULN2003DriverBoard_Con_LowerLeft,\n\tULN2003DriverBoard_Con_LowerRight,\n\tULN2003DriverBoard_Con_UpperLeft,\n\tULN2003DriverBoard_Con_UpperRight,\n\tULN2003DriverBoard_Con_Stepper,\n\tULN2003DriverBoard_Con_Arduino,\n\tULN2003DriverBoard_Con_Power\n];\n\n\n\nmodule ULN2003DriverBoard_PCB(includeFixings=true, thickness=ULN2003Driver_PCBThickness) {\n\t\/\/ Base PCB\n\t\/\/ offset origin to bottom left\n\tcolor([0.2,0.6,0.3])\n\ttranslate([(ULN2003Driver_BoardWidth \/ 2) - ULN2003Driver_HoleInset, (ULN2003Driver_BoardHeight \/ 2) - ULN2003Driver_HoleInset, 0])\n\t\tlinear_extrude(thickness)\n\t\tdifference() {\n\t\t\tsquare([ULN2003Driver_BoardWidth, ULN2003Driver_BoardHeight], center=true);\n\n\t\t\t\/\/ Mounting holes\n\t\t\tif (includeFixings)\n\t\t\t\tfor (i = [0:1], j = [0:1])\n\t\t\t\tmirror([i, 0, 0])\n\t\t\t\tmirror([0, j, 0])\n\t\t\t\ttranslate([ULN2003Driver_BoardWidth \/ 2 - ULN2003Driver_HoleInset, ULN2003Driver_BoardHeight \/ 2 - ULN2003Driver_HoleInset, 0])\n\t\t\t\t\tcircle(r = ULN2003Driver_HoleDia \/ 2);\n\t\t}\n}\n\n\nmodule ULN2003DriverBoard() {\n\n\tvitamin(\n\t\t\"vitamins\/ULN2003DriverBoard.scad\",\n\t\tstr(\"ULN2003 Driver Board\"),\n\t\tstr(\"ULN2003DriverBoard()\")\n\t) {\n\t\tview(d=140);\n\t}\n\n\tif (DebugCoordinateFrames) frame();\n\n\tif (DebugConnectors)\n\t\tfor (c = ULN2003DriverBoard_Cons)\n\t\t\tconnector(c);\n\n\tULN2003DriverBoard_PCB();\n\n\t\/\/ everything else\n\ttranslate([(ULN2003Driver_BoardWidth \/ 2) - ULN2003Driver_HoleInset, (ULN2003Driver_BoardHeight \/ 2) - ULN2003Driver_HoleInset, 0])\n\t{\n\t\t\/\/ Move us to the bottom left of the PCB\n\t\ttranslate([-ULN2003Driver_BoardWidth \/ 2, -ULN2003Driver_BoardHeight \/ 2, 0]) {\n\n\t\t\t\/\/ ULN2003 chip\n\t\t\tcolor(\"darkgrey\")\n\t\t\ttranslate([1, 8, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tcube([20, 10, 8]);\n\n\t\t\t\/\/ Arduino header\n\t\t\ttranslate([6, 6, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tPcbPinStrip(4);\n\n\t\t\t\/\/ Stepper Connection\n\t\t\tcolor(\"white\")\n\t\t\ttranslate([1.5, 19, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tdifference() {\n\t\t\t\t\tcube([15.5, 6, 8]);\n\t\t\t\t\ttranslate([1, 1, 1])\n\t\t\t\t\t\tcube([13.5, 4, 8]);\n\t\t\t\t}\n\t\t\ttranslate([4, 22, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tPcbPinStrip(5, 0, false);\n\n\t\t\t\/\/ Power & On\/Off Jumper\n\t\t\ttranslate([24.5, 9, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tPcbPinStrip(4, 90);\n\n\t\t\t\/\/ LEDS\n\t\t\ttranslate([6, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([10, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([14.5, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t\ttranslate([19, 29, ULN2003Driver_PCBThickness - eta])\n\t\t\t\tLED_3mm();\n\t\t}\n\t}\n}\n\nmodule PcbPinStrip(numPins = 4, a = 0, spacers = true)\n{\n \/\/ Standard PCB header pin\n pcbholepitch = 2.54; \/\/ spacing of PCB holes\n holediameter = 1.25; \/\/ diameter of PCB hole\n pinheight = 11; \/\/ length of PCB pins\n pinoffset = 3; \/\/ offset of PCB pins\n pinwidth = 0.63; \/\/ width\/gauge of PCB pins\n spacerwidth = 2.25; \/\/ height of breakaway pin frame\n spacerheight = 2.25; \/\/ height of breakaway pin frame\n\n\trotate(a = a)\n\tfor (i = [0 : numPins - 1]) {\n\t\ttranslate([i * pcbholepitch, 0, 0]) {\n\t\t\t\/\/ Header Pins\n\t\t\tcolor(\"white\")\n\t\t\ttranslate([0, 0, -pinoffset])\n\t\t\tlinear_extrude(pinheight)\n\t\t\t\tsquare(pinwidth, center = true);\n\n\t\t\tif (spacers) {\n\t\t\t\t\/\/ Pin Spacers\n\t\t\t\tcolor(Grey20)\n\t\t\t\tlinear_extrude(spacerheight)\n\t\t\t\t\tsquare(spacerwidth, center = true);\n\n\t\t\t\t\/\/ Break-Away Material\n\t\t\t\tcolor(Grey20)\n\t\t\t\ttranslate([pcbholepitch\/2, 0, 0])\n\t\t\t\tlinear_extrude(spacerheight)\n\t\t\t\t\tsquare([pcbholepitch - spacerwidth, spacerwidth * 0.85], center = true);\n\t\t\t}\n\t\t}\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5e12cc384eee20bded0a70f60b2e6a8c2f058586","subject":"\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0430","message":"\u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u043a\u0430","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Timin_v2.scad","new_file":"3D-models\/SCAD\/Timin_v2.scad","new_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=19; \nz=7; \nt=0; \nz2=2.5;\nedge=0.71*y; \ndx=edge*1.41; \n\/\/\u0422\u0438\u043c\u0438\u043d \ndifference() {\nunion() {\ntranslate ([dx\/2, t, 0]) { \n\ncolor() translate ([0, 0, 0]) cube ([x-dx\/2, y, z], center=true); \n\ntranslate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([edge, edge, z], center=true); \n} \ntranslate([24.78, -9.5, -1]) cube([10, 19, 5]);\n}\n\ntranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n#rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(3, 2.65, 2.65);\n\n#rotate([0, 90, 0]) translate([0, 4.5, 31.5]) cylinder(9, 2.65, 2.65);\n\n#rotate([0, 90, 0]) translate([0, -4.5, 31.5]) cylinder(9, 2.65, 2.65);\n\ntranslate([-10, -10.5, 0]) cube([35, 21, 5]);\n}\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10]) cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\nrotate([90, 0, 0]) translate([25.3, 0.5, -9.5]) cylinder(19, 3.5, 3.5);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ntranslate([8, -6, 0]) cube([xx, e+2, xx]);\ntranslate([3, -6, 0]) cube([e, xx, xx]);\n\n\n\n\n","old_contents":"\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=19; \nz=7; \nt=0; \nz2=2.5;\nedge=0.71*y; \ndx=edge*1.41; \n\/\/\u0422\u0438\u043c\u0438\u043d \ndifference() {\nunion() {\ntranslate ([dx\/2, t, 0]) { \n\ncolor() translate ([0, 0, 0]) cube ([x-dx\/2, y, z], center=true); \n\ntranslate([-25, 0, 0]) color() rotate ([0, 0, 45]) cube ([edge, edge, z], center=true); \n} \ntranslate([24.78, -9.5, -1]) cube([10, 19, 5]);\n}\n\ntranslate([-32, 0, 0]) cube([21, 21, 10], center=true);\n\n#rotate([0, 90, 0]) translate([0, 0, -22]) cylinder(3, 2.65, 2.65);\n\n#rotate([0, 90, 0]) translate([0, 4.5, 31.5]) cylinder(9, 2.65, 2.65);\n\n#rotate([0, 90, 0]) translate([0, -4.5, 31.5]) cylinder(9, 2.65, 2.65);\n\ntranslate([-10, -10.5, 0]) cube([35, 21, 5]);\n}\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10]) cube([40, 0.5, 30])\n\nrotate([90, 0, 0]) translate([-10.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\nrotate([90, 0, 0]) translate([25.3, 0.5, -9.5]) cylinder(19, 3.5, 3.5);\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u043e\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ntranslate([8, -6, 0]) cube([xx, e+2, xx]);\ntranslate([3, -6, 0]) cube([e, xx, xx]);\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"89ade5c1e2727c5c89edfb6405c77e08050e4773","subject":"Fix definition of the output mode in unit tests","message":"Fix definition of the output mode in unit tests\n","repos":"jsconan\/camelSCAD","old_file":"util\/test-utils.scad","new_file":"util\/test-utils.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Sets the console mode to prevent HTML use.\n * Should be set using the CLI.\n * @type Boolean\n *\/\nCONSOLE = false;\n\n\/**\n * Activate the ANSI support for colored console output.\n * Should be set using the CLI.\n * @type Boolean\n *\/\nANSI = false;\n\n\/**\n * Activate the CSV support\n * Should be set using the CLI.\n * @type Boolean\n *\/\nCSV = false;\n\n\/**\n * The mode used to output the results.\n * Default to HTML\n * @type String\n *\/\noutputMode = CSV ? \"csv\"\n :ANSI ? \"ansi\"\n :CONSOLE ? \"text\"\n : \"html\"\n;\n\n\/**\n * Formats a title with respect to the current output mode.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitle(title, type, big) =\n outputMode == \"html\" ? formatTestTitleHTML(title, type, big)\n :outputMode == \"ansi\" ? formatTestTitleANSI(title, type, big)\n :outputMode == \"csv\" ? formatTestTitleCSV(title, type, big)\n : formatTestTitleText(title, type, big)\n;\n\n\/**\n * Formats an assert result with respect to the current output mode.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n * @returns String\n *\/\nfunction formatAssertResult(result, message, details) =\n let(details = assertDetails(details))\n outputMode == \"html\" ? formatAssertResultHTML(result, message, details)\n :outputMode == \"ansi\" ? formatAssertResultANSI(result, message, details)\n :outputMode == \"csv\" ? formatAssertResultCSV(result, message, details)\n : formatAssertResultText(result, message, details)\n;\n\n\/**\n * Formats the message related to the expected number of asserts with respect to the current output mode.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAsserts(actual, expected, type) =\n outputMode == \"html\" ? formatExpectedAssertsHTML(actual, expected, type)\n :outputMode == \"ansi\" ? formatExpectedAssertsANSI(actual, expected, type)\n :outputMode == \"csv\" ? formatExpectedAssertsCSV(actual, expected, type)\n : formatExpectedAssertsText(actual, expected, type)\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: HTML\n\/\/\n\n\/**\n * Formats a title to be displayed on HTML container.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleHTML(title, type, big) = htmlColorize(\n big ? \"blue\" : \"darkblue\",\n str(\n string(type),\n htmlTag(big ? \"big\" : \"small\", wrap(\" [\", title, \"]\"))\n )\n);\n\n\/**\n * Formats an assert result to be displayed on HTML container.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultHTML(result, message, details) = htmlColorize(\n result ? \"green\" : \"red\",\n str(\n htmlTag(\"b\", assertStatus(result)),\n htmlTag(\"small\", wrap(\" [\", assertContext(), \"]\")),\n \" \",\n htmlTag(\"code\", message),\n wrap(\" (\", !result && details ? htmlTag(\"tt\", details) : \"\", \")\")\n )\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed on HTML container.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsHTML(actual, expected, type) =\n let(\n result = checkExpectedAsserts(actual, expected),\n message = messageExpectedAsserts(actual, expected, type)\n )\n htmlColorize(\n result ? \"green\" : \"red\",\n str(\n htmlTag(\"small\", wrap(\"[\", assertContext(), \"] \")),\n htmlTag(\"code\", message)\n )\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: ANSI\n\/\/\n\n\/**\n * Formats a title to be displayed on ANSI console.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleANSI(title, type, big) = str(\n ansiForeground(ANSI_COLOR_BLUE, big),\n formatTestTitleText(title, type, big),\n ansiCodeOff()\n);\n\n\/**\n * Formats an assert result to be displayed on ANSI console.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultANSI(result, message, details) = str(\n ansiForeground(result ? ANSI_COLOR_GREEN : ANSI_COLOR_RED),\n formatAssertResultText(result, message, details),\n ansiCodeOff()\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed on ANSI console.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsANSI(actual, expected, type) =\n let(\n result = checkExpectedAsserts(actual, expected)\n )\n str(\n ansiForeground(result ? ANSI_COLOR_GREEN : ANSI_COLOR_RED),\n formatExpectedAssertsText(actual, expected, type),\n ansiCodeOff()\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: TEXT\n\/\/\n\n\/**\n * Formats a title as a simple text.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleText(title, type, big) = str(\n string(type),\n wrap(\" [\", title, \"]\")\n);\n\n\/**\n * Formats an assert result to be displayed as simple text.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultText(result, message, details) = str(\n \"assert \",\n assertStatus(result),\n wrap(\" [\", assertContext(), \"]\"),\n \" \",\n string(message),\n wrap(\" (\", !result ? string(details) : \"\", \")\")\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed as simple text.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsText(actual, expected, type) =\n let(\n message = messageExpectedAsserts(actual, expected, type)\n )\n str(\n \"expect \",\n wrap(\"[\", assertContext(), \"] \"),\n string(message)\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: CSV\n\/\/\n\n\/**\n * Formats a title to be displayed as CSV.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleCSV(title, type, big) = str(\n string(type),\n \";\",\n string(title)\n);\n\n\/**\n * Formats an assert result to be displayed as CSV.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultCSV(result, message, details) = str(\n \"assert;\",\n assertStatus(result),\n \";\",\n assertContext(),\n \";\",\n string(message),\n \";\",\n !result ? string(details) : \"\"\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed as CSV.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsCSV(actual, expected, type) =\n let(\n result = checkExpectedAsserts(actual, expected),\n message = messageExpectedAsserts(actual, expected, type)\n )\n str(\n \"expect;\",\n string(type),\n \";\",\n uor(expected, \"\"),\n \";\",\n integer(actual),\n \";\",\n result,\n \";\",\n assertContext(),\n \";\",\n string(message)\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ HELPERS\n\/\/\n\n\/**\n * Gets the right assert status label.\n *\n * @private\n * @param Boolean result\n * @returns String\n *\/\nfunction assertStatus(result) = result ? \"#OK\" : \"#FAILED\";\n\n\/**\n * Build the context label for the current assert.\n *\n * @private\n * @returns String\n *\/\nfunction assertContext() = str(\n string($testModule),\n $testModule && $testUnit ? \":\" : \"\",\n string($testUnit)\n);\n\n\/**\n * Formats the context of an assert.\n *\n * @private\n * @param Array details\n * @returns String\n *\/\nfunction assertDetails(details) =\n let(l = len(details))\n l > 1 ? str(\"[expected: \", details[1], \"] [actual: \", details[0], \"]\")\n :l > 0 ? str(\"[value: \", details[0], \"]\")\n : \"\"\n;\n\n\/**\n * Checks if the expected number of asserts is respected.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @returns Boolean\n *\/\nfunction checkExpectedAsserts(actual, expected) =\n let(\n actual = integer(actual),\n single = isUndef(expected),\n expected = integer(expected)\n )\n single ? !!actual : actual == expected\n;\n\n\/**\n * Builds the message related to the expected number of asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction messageExpectedAsserts(actual, expected, type) =\n let(\n type = string(type),\n actual = integer(actual),\n single = isUndef(expected),\n expected = integer(expected)\n )\n str(\n !actual && expected ? str(\"Expected \", expected, \" \", type, expected > 1 ? \"s\" : \"\", \" but none were run\")\n :!actual ? str(\"Expected at least one \", type, \", but none were run\")\n :single ? str(actual, \" \", type, actual > 1 ? \"s were run\" : \" was run\")\n :actual == expected ? str(actual, \" \", type, expected > 1 ? \"s\" : \"\", \" of \", expected, actual > 1 ? \" were run\" : \" was run\")\n :str(\"Expected \", expected, \" \", type, expected > 1 ? \"s\" : \"\", \" but \", actual, actual > 1 ? \" were run\" : \" was run\")\n )\n;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Sets the console mode to prevent HTML use.\n * Should be set using the CLI.\n * @type Boolean\n *\/\nCONSOLE = false;\n\n\/**\n * Activate the ANSI support for colored console output.\n * Should be set using the CLI.\n * @type Boolean\n *\/\nANSI = false;\n\n\/**\n * Activate the CSV support\n * Should be set using the CLI.\n * @type Boolean\n *\/\nCSV = false;\n\n\/**\n * The mode used to output the results.\n * Default to HTML\n * @type String\n *\/\n$outputMode = $outputMode ? $outputMode\n :CSV ? \"csv\"\n :ANSI ? \"ansi\"\n :CONSOLE ? \"text\"\n : \"html\"\n;\n\n\/**\n * Formats a title with respect to the current output mode.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitle(title, type, big) =\n $outputMode == \"html\" ? formatTestTitleHTML(title, type, big)\n :$outputMode == \"ansi\" ? formatTestTitleANSI(title, type, big)\n :$outputMode == \"csv\" ? formatTestTitleCSV(title, type, big)\n : formatTestTitleText(title, type, big)\n;\n\n\/**\n * Formats an assert result with respect to the current output mode.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n * @returns String\n *\/\nfunction formatAssertResult(result, message, details) =\n let(details = assertDetails(details))\n $outputMode == \"html\" ? formatAssertResultHTML(result, message, details)\n :$outputMode == \"ansi\" ? formatAssertResultANSI(result, message, details)\n :$outputMode == \"csv\" ? formatAssertResultCSV(result, message, details)\n : formatAssertResultText(result, message, details)\n;\n\n\/**\n * Formats the message related to the expected number of asserts with respect to the current output mode.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAsserts(actual, expected, type) =\n $outputMode == \"html\" ? formatExpectedAssertsHTML(actual, expected, type)\n :$outputMode == \"ansi\" ? formatExpectedAssertsANSI(actual, expected, type)\n :$outputMode == \"csv\" ? formatExpectedAssertsCSV(actual, expected, type)\n : formatExpectedAssertsText(actual, expected, type)\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: HTML\n\/\/\n\n\/**\n * Formats a title to be displayed on HTML container.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleHTML(title, type, big) = htmlColorize(\n big ? \"blue\" : \"darkblue\",\n str(\n string(type),\n htmlTag(big ? \"big\" : \"small\", wrap(\" [\", title, \"]\"))\n )\n);\n\n\/**\n * Formats an assert result to be displayed on HTML container.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultHTML(result, message, details) = htmlColorize(\n result ? \"green\" : \"red\",\n str(\n htmlTag(\"b\", assertStatus(result)),\n htmlTag(\"small\", wrap(\" [\", assertContext(), \"]\")),\n \" \",\n htmlTag(\"code\", message),\n wrap(\" (\", !result && details ? htmlTag(\"tt\", details) : \"\", \")\")\n )\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed on HTML container.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsHTML(actual, expected, type) =\n let(\n result = checkExpectedAsserts(actual, expected),\n message = messageExpectedAsserts(actual, expected, type)\n )\n htmlColorize(\n result ? \"green\" : \"red\",\n str(\n htmlTag(\"small\", wrap(\"[\", assertContext(), \"] \")),\n htmlTag(\"code\", message)\n )\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: ANSI\n\/\/\n\n\/**\n * Formats a title to be displayed on ANSI console.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleANSI(title, type, big) = str(\n ansiForeground(ANSI_COLOR_BLUE, big),\n formatTestTitleText(title, type, big),\n ansiCodeOff()\n);\n\n\/**\n * Formats an assert result to be displayed on ANSI console.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultANSI(result, message, details) = str(\n ansiForeground(result ? ANSI_COLOR_GREEN : ANSI_COLOR_RED),\n formatAssertResultText(result, message, details),\n ansiCodeOff()\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed on ANSI console.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsANSI(actual, expected, type) =\n let(\n result = checkExpectedAsserts(actual, expected)\n )\n str(\n ansiForeground(result ? ANSI_COLOR_GREEN : ANSI_COLOR_RED),\n formatExpectedAssertsText(actual, expected, type),\n ansiCodeOff()\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: TEXT\n\/\/\n\n\/**\n * Formats a title as a simple text.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleText(title, type, big) = str(\n string(type),\n wrap(\" [\", title, \"]\")\n);\n\n\/**\n * Formats an assert result to be displayed as simple text.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultText(result, message, details) = str(\n \"assert \",\n assertStatus(result),\n wrap(\" [\", assertContext(), \"]\"),\n \" \",\n string(message),\n wrap(\" (\", !result ? string(details) : \"\", \")\")\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed as simple text.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsText(actual, expected, type) =\n let(\n message = messageExpectedAsserts(actual, expected, type)\n )\n str(\n \"expect \",\n wrap(\"[\", assertContext(), \"] \"),\n string(message)\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ MODE: CSV\n\/\/\n\n\/**\n * Formats a title to be displayed as CSV.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n * @returns String\n *\/\nfunction formatTestTitleCSV(title, type, big) = str(\n string(type),\n \";\",\n string(title)\n);\n\n\/**\n * Formats an assert result to be displayed as CSV.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param String [details]\n * @returns String\n *\/\nfunction formatAssertResultCSV(result, message, details) = str(\n \"assert;\",\n assertStatus(result),\n \";\",\n assertContext(),\n \";\",\n string(message),\n \";\",\n !result ? string(details) : \"\"\n);\n\n\/**\n * Formats the message related to the expected number of asserts to be displayed as CSV.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction formatExpectedAssertsCSV(actual, expected, type) =\n let(\n result = checkExpectedAsserts(actual, expected),\n message = messageExpectedAsserts(actual, expected, type)\n )\n str(\n \"expect;\",\n string(type),\n \";\",\n uor(expected, \"\"),\n \";\",\n integer(actual),\n \";\",\n result,\n \";\",\n assertContext(),\n \";\",\n string(message)\n )\n;\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ HELPERS\n\/\/\n\n\/**\n * Gets the right assert status label.\n *\n * @private\n * @param Boolean result\n * @returns String\n *\/\nfunction assertStatus(result) = result ? \"#OK\" : \"#FAILED\";\n\n\/**\n * Build the context label for the current assert.\n *\n * @private\n * @returns String\n *\/\nfunction assertContext() = str(\n string($testModule),\n $testModule && $testUnit ? \":\" : \"\",\n string($testUnit)\n);\n\n\/**\n * Formats the context of an assert.\n *\n * @private\n * @param Array details\n * @returns String\n *\/\nfunction assertDetails(details) =\n let(l = len(details))\n l > 1 ? str(\"[expected: \", details[1], \"] [actual: \", details[0], \"]\")\n :l > 0 ? str(\"[value: \", details[0], \"]\")\n : \"\"\n;\n\n\/**\n * Checks if the expected number of asserts is respected.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @returns Boolean\n *\/\nfunction checkExpectedAsserts(actual, expected) =\n let(\n actual = integer(actual),\n single = isUndef(expected),\n expected = integer(expected)\n )\n single ? !!actual : actual == expected\n;\n\n\/**\n * Builds the message related to the expected number of asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n * @returns String\n *\/\nfunction messageExpectedAsserts(actual, expected, type) =\n let(\n type = string(type),\n actual = integer(actual),\n single = isUndef(expected),\n expected = integer(expected)\n )\n str(\n !actual && expected ? str(\"Expected \", expected, \" \", type, expected > 1 ? \"s\" : \"\", \" but none were run\")\n :!actual ? str(\"Expected at least one \", type, \", but none were run\")\n :single ? str(actual, \" \", type, actual > 1 ? \"s were run\" : \" was run\")\n :actual == expected ? str(actual, \" \", type, expected > 1 ? \"s\" : \"\", \" of \", expected, actual > 1 ? \" were run\" : \" was run\")\n :str(\"Expected \", expected, \" \", type, expected > 1 ? \"s\" : \"\", \" but \", actual, actual > 1 ? \" were run\" : \" was run\")\n )\n;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dc660935eda9109e5e4897f49c2f0267eb836a78","subject":"Add connector (currently centre of whole thing!)","message":"Add connector (currently centre of whole thing!)\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/BatteryPack.scad","new_file":"hardware\/vitamins\/BatteryPack.scad","new_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\n\/\/ Battery len, Battery dia, Pack width, Pack depth, Pack height, Linear?, Batteries, Name \nBatteryPack_AA_4_SQ = [ 50.5, 14.5, 31.4, 27.5, 57.4, 0, , 4, \"AA\" ];\n\n\/\/ Default:\nBatteryPack_AA = BatteryPack_AA_4_SQ;\n\n\/\/ Constants for access:\nBatteryPack_Const_BLen = 0;\nBatteryPack_Const_BDia = 1;\nBatteryPack_Const_PWidth = 2;\nBatteryPack_Const_PDepth = 3;\nBatteryPack_Const_PHeight = 4;\nBatteryPack_Const_Linear = 5;\nBatteryPack_Const_Count = 6;\nBatteryPack_Const_Name = 7;\n\n\/\/ Connectors:\nfunction BatteryPack_Con_Centre(BP) = [\n [\n BP[BatteryPack_Const_PWidth]\/2 + BP[BatteryPack_Const_BDia]\/2,\n BP[BatteryPack_Const_PDepth]\/2 + BP[BatteryPack_Const_BDia]\/2,\n BP[BatteryPack_Const_PHeight]\/2, \n ],\n [ 0,0,0 ],\n 0, 0, 0\n];\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n\n}\n\nmodule battery_pack_linear(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n if(i % 2 == 1) {\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery(BP);\n } else {\n battery(BP);\n }\n }\n}\n\nmodule battery_pack_double(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery();\n }\n}\n\n\/\/ NB, This completely ignores battery count\/linear setting! 2x2 is what you get!\nmodule BatteryPack(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n BatteryPack_height = BP[BatteryPack_Const_PHeight];\n BatteryPack_width = BP[BatteryPack_Const_BWidth];\n BatteryPack_depth = BP[BatteryPack_Const_BDepth];\n\n \/\/ Actually measured, it overhangs by 2mm, 1 because this is actually\n \/\/ a radius -- how far is the center-line of the battery offset from the edge\n \/\/ of the case (in the y direction).\n battery_depth_offset = Battery_dia\/2 - 1;\n\n render()\n translate([-Battery_dia\/2, -Battery_dia\/2,0])\n difference() {\n linear_extrude(height=BatteryPack_height)\n hull() {\n \/\/ Main body\n translate([Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n }\n\n \/\/ Subtract battery shapes\n translate([Battery_dia\/2-eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n \n\n translate([BatteryPack_width-Battery_dia\/2+eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([Battery_dia\/2-eta, BatteryPack_depth-battery_depth_offset+eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2+eta,BatteryPack_depth-battery_depth_offset+eta,(BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([BatteryPack_width\/4,-BatteryPack_depth+6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n translate([BatteryPack_width\/4,BatteryPack_depth-6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n\n }\n}\n\n*battery_pack_linear(BatteryPack_AA, 2,4);\n*battery_pack_double(BatteryPack_AA, 2, 4);\n","old_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\ninclude <..\/config\/colors.scad>\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\n\/\/ Battery len, Battery dia, Pack width, Pack depth, Pack height, Linear?, Name \nBatteryPack_AA = [ 50.5, 14.5, 31.4, 27.5, 57.4, 0, \"AA\" ];\n\n\/\/ Constants for access:\nBatteryPack_Const_BLen = 0;\nBatteryPack_Const_BDia = 1;\nBatteryPack_Const_PWidth = 2;\nBatteryPack_Const_PDepth = 3;\nBatteryPack_Const_PHeight = 4;\nBatteryPack_Const_Linear = 5;\nBatteryPack_Const_Name = 6;\n\n\/\/ We have the total battery length, assume the positive terminal is 1\/20th of the length\nmodule battery(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n button_h = (1\/20)*Battery_len;\n top_h = (1\/3)*Battery_len;\n bottom_h = Battery_len-(top_h+button_h);\n\n color(\"black\")\n linear_extrude(height=bottom_h)\n circle(r=Battery_dia\/2);\n\n color(\"red\")\n translate([0, 0, bottom_h])\n linear_extrude(height=top_h)\n circle(r=Battery_dia\/2);\n\n color(MetalColor)\n translate([0, 0, bottom_h+top_h])\n linear_extrude(height=button_h)\n circle(r=Battery_dia\/4);\n\n}\n\nmodule battery_pack_linear(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n if(i % 2 == 1) {\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery(BP);\n } else {\n battery(BP);\n }\n }\n}\n\nmodule battery_pack_double(BP, battery_sep, battery_count) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n\n\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n translate([0,0,Battery_len\/2])\n rotate([180, 0, 0])\n translate([0,0,-Battery_len\/2])\n battery();\n }\n}\n\n\/\/ NB, This completely ignores battery count\/linear setting! 2x2 is what you get!\nmodule BatteryPack(BP) {\n\n Battery_len = BP[BatteryPack_Const_BLen];\n Battery_dia = BP[BatteryPack_Const_BDia];\n BatteryPack_height = BP[BatteryPack_Const_PHeight];\n BatteryPack_width = BP[BatteryPack_Const_BWidth];\n BatteryPack_depth = BP[BatteryPack_Const_BDepth];\n\n \/\/ Actually measured, it overhangs by 2mm, 1 because this is actually\n \/\/ a radius -- how far is the center-line of the battery offset from the edge\n \/\/ of the case (in the y direction).\n battery_depth_offset = Battery_dia\/2 - 1;\n\n render()\n translate([-Battery_dia\/2, -Battery_dia\/2,0])\n difference() {\n linear_extrude(height=BatteryPack_height)\n hull() {\n \/\/ Main body\n translate([Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2, BatteryPack_depth-Battery_dia\/2, 0])\n circle(r=Battery_dia\/2);\n }\n\n \/\/ Subtract battery shapes\n translate([Battery_dia\/2-eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n \n\n translate([BatteryPack_width-Battery_dia\/2+eta, battery_depth_offset-eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([Battery_dia\/2-eta, BatteryPack_depth-battery_depth_offset+eta, (BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n translate([BatteryPack_width-Battery_dia\/2+eta,BatteryPack_depth-battery_depth_offset+eta,(BatteryPack_height-Battery_len)\/2])\n cylinder(h=Battery_len, r=Battery_dia\/2);\n\n translate([BatteryPack_width\/4,-BatteryPack_depth+6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n translate([BatteryPack_width\/4,BatteryPack_depth-6,(BatteryPack_height-Battery_len)\/2])\n cube([BatteryPack_width\/2, BatteryPack_depth, Battery_len]);\n\n }\n}\n\n*battery_pack_linear(BatteryPack_AA, 2,4);\n*battery_pack_double(BatteryPack_AA, 2, 4);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"aed99d9fc336240b14de37ba95870ac17680458e","subject":"body: convexity","message":"body: convexity\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\n\nmodule body()\n{ \n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\n\nmodule body()\n{ \n\/\/Top face of main body\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n \n\/\/Body top shoulder\ntranslate([0,0,-(HEIGHT_NIPPLE + BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n\n\/\/Main body cylinder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2* BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n \n\/\/Body bottom shoulder\ntranslate([0,0,-(HEIGHT_BODY - BORDER_RADIUS_BODY)])\n rotate_extrude(convexity = 10, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ffdef31de4c0c5411d2a157b5f0cf0bc0aca5bde","subject":"[scad] add a small hole for pushing out the pcb","message":"[scad] add a small hole for pushing out the pcb\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_g = gap\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.1;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 1;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\nsupport_w = 1;\nsupport_g = 3;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\nhole_r = 1.2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t\ttranslate([outer_w\/2, outer_w\/2, 0]) cylinder(r=hole_r, h=wall_w);\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\trotate(a=[0, 0, 45]) difference() {\n\t\t\tcylinder(r=support_r, h=support_h);\n\t\t\tcylinder(r=support_r - support_w, h=support_h);\n\t\t\ttranslate([-support_r, -support_g\/2, 0]) cube([support_r*2, support_g, support_h]);\n\t\t\ttranslate([-support_g\/2, -support_r, 0]) cube([support_g, support_r*2, support_h]);\n\t\t}\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","old_contents":"\/*\n\tkube.scad - OpenSCAD code generating the Fluksokube enclosure\n\n\tCopyright (C) 2014 Bart Van Der Meerssche \n\n\tThis program is free software: you can redistribute it and\/or modify\n\tit under the terms of the GNU General Public License as published by\n\tthe Free Software Foundation, either version 3 of the License, or\n\t(at your option) any later version.\n\n\tThis program is distributed in the hope that it will be useful,\n\tbut WITHOUT ANY WARRANTY; without even the implied warranty of\n\tMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\tGNU General Public License for more details.\n\n\tYou should have received a copy of the GNU General Public License\n\talong with this program. If not, see .\n*\/\n\n$fn = 100; \/* number of facets per circle *\/\n\n\/*\n\t_h = height\n\t_w = width\n\t_r = radius\n\t_g = gap\n\t_t = tolerance\n\t_s = scaling factor (printer specific)\n*\/\n\ndim_s = 1;\ndim_s = 1.015; \/* makerbot *\/\nkube_s = [dim_s, dim_s, dim_s];\n\nmagnet_h = 5;\nmagnet_t = 0.1;\nmagnet_r = 8 - magnet_t; \/* inner diameter now! *\/\n\nflk_h = 23.5;\nflk_t = 0.2;\nflk_w = 30.5 + 2*flk_t;\n\nwall_w = 1;\nouter_w = flk_w + 2*wall_w;\n\nsupport_h = outer_w - wall_w - flk_h;\nsupport_r = magnet_r;\nsupport_w = 1;\nsupport_g = 3;\n\nring_h = support_h - magnet_h;\nring_t = 0.2;\nring_inner_r = support_r + ring_t;\nring_outer_r = ring_inner_r + 2;\n\necho(\"*** kube dimensions ***\");\necho(\"scaling vector\", \"=\", kube_s);\necho(\"magnet diameter\", \"=\", magnet_r*2);\necho(\"flk width\", \"=\", flk_w);\necho(\"kube width\", \"=\", outer_w);\necho(\"support diameter\", \"=\", support_r*2);\necho(\"support height\", \"=\", support_h);\necho(\"ring height\", \"=\", ring_h);\necho(\"ring inner diameter\", \"=\", ring_inner_r*2);\necho(\"ring outer diameter\", \"=\", ring_outer_r*2);\necho(\"***********************\");\n\nmodule kube()\n{\n\tdifference() {\n\t\tcube(outer_w);\n\t\ttranslate([wall_w, wall_w, wall_w]) {\n\t\t\tcube([flk_w, flk_w, outer_w - wall_w]);\n\t\t}\n\t}\n\n\ttranslate([outer_w\/2, outer_w\/2, wall_w]) {\n\t\trotate(a=[0, 0, 45]) difference() {\n\t\t\tcylinder(r=support_r, h=support_h);\n\t\t\tcylinder(r=support_r - support_w, h=support_h);\n\t\t\ttranslate([-support_r, -support_g\/2, 0]) cube([support_r*2, support_g, support_h]);\n\t\t\ttranslate([-support_g\/2, -support_r, 0]) cube([support_g, support_r*2, support_h]);\n\t\t}\n\t}\n}\n\nmodule ring()\n{\n\tdifference() {\n\t\tcylinder(r=ring_outer_r, h=ring_h);\n\t\tcylinder(r=ring_inner_r, h=ring_h);\n\t}\n}\n\nscale(kube_s) {\n\tkube();\n\ttranslate([1.5*outer_w, outer_w\/2, 0]) ring();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6b795a6093a1a02394981bf82602a3c177b37e4e","subject":"A todo was added.","message":"A todo was added.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad> \r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n\/\/ font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\", \r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Arial\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseColor, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail();\r\n } \r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=5);\r\n\/\/ \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight, \r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor, baseThickness, baseWidth, baseHeight, \r\n chainLoop, \r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition, \r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8,\r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n\r\n\r\n\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius \r\n yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate, yTranslate, 0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n yPercentage = chainLoopLengthPercentageY,\r\n zLength = chainLoopLengthZ,\r\n zPercentage = chainLoopLengthPercentageZ);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\n\/\/module trebleClefScaledDown(h)\r\n\/\/{\r\n\/\/ scale([25.4\/90, -25.4\/90, 1]) union()\r\n\/\/ {\r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ linear_extrude(height=h)\r\n\/\/ polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad> \r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad> \r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6, \r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n\/\/ font=\"write\/orbitron.dxf\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\", \r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Arial\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n { \r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n if (holes==4) \r\n {\r\n base4holes(baseColor, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail();\r\n } \r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=5);\r\n\/\/ \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight, \r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor, baseThickness, baseWidth, baseHeight, \r\n chainLoop, \r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition, \r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth, \r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8,\r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\r\n\r\n\r\n\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius \r\n yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate, yTranslate, 0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n yPercentage = chainLoopLengthPercentageY,\r\n zLength = chainLoopLengthZ,\r\n zPercentage = chainLoopLengthPercentageZ);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\n\/\/module trebleClefScaledDown(h)\r\n\/\/{\r\n\/\/ scale([25.4\/90, -25.4\/90, 1]) union()\r\n\/\/ {\r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ linear_extrude(height=h)\r\n\/\/ polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"33d164ed35b00fc0ac7f5cb754fba1a53c12ab8a","subject":"removed some dead code","message":"removed some dead code\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"qiabasz\/qiabasz.scad","new_file":"qiabasz\/qiabasz.scad","new_contents":"eps = 0.01;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\n\ndifference()\n{\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n}\nqiagen_logo();\n","old_contents":"eps = 0.01;\n\nmodule qiagen_logo()\n{\n translate([-10.5, -9, 0])\n translate([0,0,1+1])\n linear_extrude(1)\n\/\/ mirror([1,0,0])\n scale(.42*[1,1])\n import(\"qiagen_logo.svg\");\n}\n\n\ndifference()\n{\n cylinder(d=30, h=1+1, $fn=100);\n translate([0,0,-eps])\n linear_extrude(1+eps)\n text(\"#!\", size=18, halign=\"center\", valign=\"center\");\n}\n#qiagen_logo();\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ad6d2009c178cd635171eb328c326071071426ed","subject":"Hardware vitamins for modelling the battery pack","message":"Hardware vitamins for modelling the battery pack\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/BatteryPack.scad","new_file":"hardware\/vitamins\/BatteryPack.scad","new_contents":"\/\/ Battery packs\n\/\/ battery_pack_linear - all batteries in a row\n\/\/ battery_pack_double - 2 rows of batteries (can't cope with odd numbers!)\n\n\/\/ Point of origin is the centre of the end of the end battery.\n\n\/\/ AAs - http:\/\/en.wikipedia.org\/wiki\/AA_battery\n\/\/ len includes the positive-end button\nBattery_dia = 14.5;\nBattery_len = 50.5;\n\nmodule battery() {\n\n linear_extrude(height=Battery_len) {\n circle(r=Battery_dia\/2);\n }\n}\n\nmodule battery_pack_linear(battery_sep, battery_count) {\n for(i=[0:battery_count-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n }\n}\n\nmodule battery_pack_double(battery_sep, battery_count) {\n for(i=[0:(battery_count\/2)-1]) {\n translate([i*(Battery_dia+battery_sep), 0, 0])\n battery();\n translate([i*(Battery_dia+battery_sep), Battery_dia+battery_sep, 0])\n battery();\n }\n}\n\n*battery_pack_linear(2,4);\n*battery_pack_double(2, 4);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/vitamins\/BatteryPack.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1159e4d0dc1350bc9acc45e1afd88c7ecd5b7e4c","subject":"generation now prints multiple elements at a time","message":"generation now prints multiple elements at a time\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"car_flap_extension\/car_flap_extension.scad","new_file":"car_flap_extension\/car_flap_extension.scad","new_contents":"h=2;\ncount=3;\n\nmodule extension()\n{\n cube([25,10,h]);\n translate([25,5,0])\n cylinder(h=h, r=5, $fs=0.1);\n}\n\nfor(x=[0:2])\n translate([0, x*13, 0])\n extension();\n","old_contents":"h=2;\ncube([25,10,h]);\ntranslate([25,5,0])\n cylinder(h=h, r=5, $fs=0.1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"908a2de7f4caeb0ef9b6c2b0c778a86462d77a30","subject":"Head tuning","message":"Head tuning\n","repos":"futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor,futurice\/vor","old_file":"3d-models\/chilicorn.scad","new_file":"3d-models\/chilicorn.scad","new_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 4.5;\nhead_spacing = 18;\nhead_angle = 50;\n\nhorn_length = 20;\nhorn_radius = 2.8;\n\nneck_radius = 2;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3;\n\nbody_x = 15;\nbody_z = 28;\nbody_radius = 15;\nbody_back_radius = 13;\nbody_length = 33;\n\nleg_length = 28 + body_radius;\nleg_radius = 4;\n\ncute_leg_first_ratio = 0.65;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\nleg(theta=5, sideways=3);\ncute_leg(theta=-5, sideways=-3, downwards=3);\nleg(lengthwards = body_length, sideways=2, theta=15);\nleg(lengthwards = body_length, sideways=-2, theta=-15);\n","old_contents":"\/\/ Chilicorn\n$fn=45;\n\nhead_big_radius = 10;\nhead_small_radius = 5;\nhead_spacing = 18;\nhead_angle = 45;\n\nhorn_length = 18;\nhorn_radius = 3;\n\nneck_radius = 2;\nneck_ratio = .2; \/\/ Flattens the interface to the top body\nneck_top_x = 3;\n\nbody_x = 15;\nbody_z = 28;\nbody_radius = 15;\nbody_back_radius = 13;\nbody_length = 33;\n\nleg_length = 28 + body_radius;\nleg_radius = 4;\n\ncute_leg_first_ratio = 0.65;\ncute_leg_second_ratio = 0.25;\ncute_leg_third_ratio = 0.11;\n\nmodule head() {\n rotate([0, -head_angle, 0]) {\n hull () {\n sphere(r=head_big_radius);\n translate([-head_spacing, 0, 0])\n sphere(r=head_small_radius); \n }\n }\n}\n\nmodule horn() {\n rotate([0, -head_angle, 0]) {\n translate([0, 0, head_big_radius - .2])\n cylinder(h = horn_length, r1 = horn_radius, r2 = 0);\n }\n}\n\nmodule neck() {\n hull() {\n translate([neck_top_x, 0, 0]) rotate([0, 180, 0]) {\n cylinder(h = head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n translate([body_x, 0, -body_z])\n difference() {\n sphere(r = body_radius);\n translate([body_radius*neck_ratio, -body_radius, -body_radius])\n cube([body_radius, 2*body_radius, 2*body_radius]);\n }\n }\n}\n\nmodule mane() {\n rotate([0, -neck_angle + 180, 0]) {\n cylinder(h = neck_length + head_big_radius - .2, r1 = neck_radius, r2 = neck_radius);\n }\n}\n\nmodule body() {\n translate([body_x, 0, -body_z])\n hull() {\n sphere(r = body_radius);\n translate([body_length, 0, 0]) \n sphere(r = body_back_radius);\n }\n}\n\nmodule leg(lengthwards=0, sideways=0, theta=20) {\n translate([body_x + lengthwards, sideways, -body_z])\n rotate([180 + theta, 0, 0]) {\n cylinder(h = leg_length, r1 = leg_radius, r2 = leg_radius);\n }\n}\n\nmodule cute_leg(lengthwards=0, sideways=0, downwards=0, theta=20, rise_angle=70) {\n translate([body_x + lengthwards, sideways, -body_z - downwards])\n rotate([180 + theta, rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_first_ratio, r1 = leg_radius, r2 = leg_radius);\n translate([0, 0, leg_length*cute_leg_first_ratio])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90, 0]) {\n cylinder(h = leg_length*cute_leg_second_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n translate([leg_length*cute_leg_second_ratio, 0, 0])\n union() {\n sphere(r = leg_radius);\n rotate([0, 90 + rise_angle, 0]) {\n cylinder(h = leg_length*cute_leg_third_ratio, r1 = leg_radius, r2 = leg_radius);\n }\n }\n }\n }\n}\n\nhead();\nhorn();\nneck();\nbody();\nleg(theta=5, sideways=3);\ncute_leg(theta=-5, sideways=-3, downwards=3);\nleg(lengthwards = body_length, sideways=2, theta=15);\nleg(lengthwards = body_length, sideways=-2, theta=-15);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"615345632de8a4316a52ae0caed07abdfcba619d","subject":"Refine MicroUSB dimensions and overhang","message":"Refine MicroUSB dimensions and overhang","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/vitamins\/ArduinoPro.scad","new_file":"hardware\/vitamins\/ArduinoPro.scad","new_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch\/2; \/\/ inset from board edge\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB (along z)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ dimensions for micro usb header\n \/\/ http:\/\/www.farnell.com\/datasheets\/1693470.pdf\n height = 2.8;\n width = 7.5;\n depth = 5.3;\n flange = 7.8; \/\/ width of front flange\n\n \/\/ distance to overhang board edge\n offset = 2.15 + 0.6 - 1.45;\n\n move_x = ArduinoPro_PCB_Width \/ 2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset + offset - depth\/2;\n move_z = ArduinoPro_PCB_Height;\n\n color(Grey80)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square([flange, depth], center=true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole(d = 1.25) {\n \/\/ Standard PCB hole\n circle(d = d);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","old_contents":"\/*\n Vitamin: ArduinoPro\n Model of an Arduino Pro Mini\/Micro\n\n Derived from: https:\/\/github.com\/sparkfun\/Pro_Micro\/\n and: https:\/\/github.com\/sparkfun\/Arduino_Pro_Mini_328\/\n\n Authors:\n Jamie Osborne (@jmeosbn)\n\n Local Frame:\n Point of origin is the centre of the bottom left pin (9)\n\n Parameters:\n type: can be \"mini\", or \"micro\";\n otherwise returns a blank board with header pin holes\n\n Returns:\n Model of an Arduino Pro Mini\/Micro with header holes\n*\/\n\n\/\/ ArduinoPro PCB Variables\nArduinoPro_PCB_Pitch = 2.54; \/\/ spacing of the holes\nArduinoPro_PCB_Inset = ArduinoPro_PCB_Pitch\/2; \/\/ inset from board edge\nArduinoPro_PCB_Width = 0.7 * 25.4; \/\/ width of the PCB (along x)\nArduinoPro_PCB_Length = 1.3 * 25.4; \/\/ length of the PCB (along y)\nArduinoPro_PCB_Height = .063 * 25.4; \/\/ thickness of the PCB (along z)\nArduinoPro_PCB_Colour = [26\/255, 90\/255, 160\/255]; \/\/ colour of solder mask\n\n\/\/ Show board clearance area for components\nArduinoPro_PCB_Clearance = 3;\nArduinoPro_PCB_Clearance_Show = true;\n\n\/\/ FIXME: export to external vitamin?\nmodule Micro_USB_Clearance() {\n \/\/ Rough dimensions for micro usb header\n height = 2.7;\n area = [7.7, 5.2];\n colour = [220\/255, 220\/255, 220\/255];\n move_x = ArduinoPro_PCB_Width\/2 - ArduinoPro_PCB_Inset;\n move_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch;\n move_z = ArduinoPro_PCB_Height;\n\n color(colour)\n translate([move_x, move_y, move_z])\n linear_extrude(height=height)\n square(size = area, center = true);\n}\n\nmodule ArduinoPro_PCB() {\n \/\/ Bare PCB, origin through location for bottom left hole\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, 0])\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n}\n\n\/\/ TODO: Add throughhole\/padding\n\/\/ TODO: Option to show header pins?\n\/\/ FIXME: export to external vitamin?\nmodule ArduinoPro_Header_Hole(d = 1.25) {\n \/\/ Standard PCB hole\n circle(d = d);\n}\n\nmodule ArduinoPro_Headers() {\n \/\/ distance between the two header rows\n rowpitch = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n \/\/ length for holes, leaving room for end header and insets\n rowlength = ArduinoPro_PCB_Length - ArduinoPro_PCB_Pitch - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add headers to either side (along y)\n for (x = [0, rowpitch], y = [0 : ArduinoPro_PCB_Pitch : rowlength]) {\n translate([x, y, 0]) ArduinoPro_Header_Hole();\n }\n\n}\n\nmodule ArduinoPro_Serial_Header() {\n \/\/ y position for header\n header_y = ArduinoPro_PCB_Length - ArduinoPro_PCB_Inset*2;\n \/\/ width for holes, leaving room for insets\n rowwidth = ArduinoPro_PCB_Width - ArduinoPro_PCB_Inset*2;\n\n \/\/ Add serial header along top of board (along x)\n for (x = [ArduinoPro_PCB_Inset : ArduinoPro_PCB_Pitch : rowwidth]) {\n translate([x, header_y, 0]) ArduinoPro_Header_Hole();\n }\n}\n\nmodule ArduinoPro(type = \"mini\") {\n union() {\n color(ArduinoPro_PCB_Colour)\n linear_extrude(height=ArduinoPro_PCB_Height)\n difference() {\n \/\/ Common Features for Pro Mini\/Micro\n ArduinoPro_PCB();\n ArduinoPro_Headers();\n\n \/\/ Features for Pro Mini\n if (type == \"mini\") {\n \/\/ Pro Mini Serial Header\n ArduinoPro_Serial_Header();\n }\n }\n\n \/\/ Features for Pro Micro\n if (type == \"micro\") {\n \/\/ Pro Micro USB port\n Micro_USB_Clearance();\n }\n\n \/\/ Indicate area for minimum board clearance\n if (ArduinoPro_PCB_Clearance_Show)\n color(ArduinoPro_PCB_Colour, 0.1)\n translate([-ArduinoPro_PCB_Inset, -ArduinoPro_PCB_Inset, ArduinoPro_PCB_Height])\n linear_extrude(height=ArduinoPro_PCB_Clearance)\n square(size = [ArduinoPro_PCB_Width, ArduinoPro_PCB_Length]);\n }\n}\n\n\n\n\/\/ Example Usage\n*ArduinoPro(\"mini\");\n*ArduinoPro(\"micro\");\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"5e925f4f86b3442b9a1a8c0409379b5ba4374e1b","subject":"rack: started","message":"rack: started\n","repos":"rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru,rigidus\/rigidus.ru","old_file":"org\/lrn\/openscad\/Untitled.scad","new_file":"org\/lrn\/openscad\/Untitled.scad","new_contents":"","old_contents":"color([1,0,0]) cube([2,3,4]);\ntranslate([3,0,0])\ncolor([0,1,0]) cube([2,3,4]);\ntranslate([6,0,0])\ncolor([0,0,1]) cube([2,3,4]);","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"93d57ec938738a8695ee39680c0d86bc2527004d","subject":"wall mount prototype done","message":"wall mount prototype done\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/wallMount.scad","new_file":"tablet_toilet_mount\/wallMount.scad","new_contents":"use \n\nmodule _wallSurface()\n{\n difference()\n {\n union()\n {\n \/\/ root element\n cube([150, 40, 2]);\n \/\/ lock mount\n translate([(150-20)\/2, 40, 0])\n cube([20, 7, 2]);\n }\n \/\/ holes\n for(offset = [30, 90])\n translate([offset, 10, 0])\n cube([30, 20, 2]);\n }\n}\n\n\nmodule lock()\n{\n translate([0, 3, 0])\n rotate([0, 0, -90])\n joint(4);\n}\n\n\nmodule wallMount()\n{\n _wallSurface();\n for(offset = [10, 150-10-3])\n translate([offset, 0, 2])\n joint(2);\n translate([(150-20)\/2 + 10-6.5\/2, 40+7-3, 2])\n lock();\n}\n\n\nwallMount();\n","old_contents":"module wallMount()\n{\n cube([2,3,4]);\n}\n\nwallMount();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ba19a97e665e8dca94c8117522c54185ccf3556f","subject":"update rudder dimensions","message":"update rudder dimensions\n","repos":"DanNixon\/BubbleCopter,DanNixon\/Multirotors,DanNixon\/BubbleCopter,DanNixon\/Multirotors","old_file":"Komachi\/config.scad","new_file":"Komachi\/config.scad","new_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0; \/\/For the JAS laser at Maker Space\n\/* MACHINE_TOLERANCE = 0.1; \/\/For most other lasers *\/\n\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* General *\/\nCORNER = 1;\nHALF_CORNER = CORNER \/ 2;\nSPACER_TAB_WIDTH_FACTOR = 0.35;\n\n\/* Base plate *\/\nBASE_DIMENSIONS = [180, 240];\nBASE_FRONT_CORNER_RADIUS = BASE_DIMENSIONS[0] \/ 2;\nBASE_REAR_CORNER_RADIUS = 30;\n\n\/* Lift fan duct mount *\/\nLIFT_FAN_DUCT_DIMENSIONS = [71, 28]; \/\/ [diameter, length]\nLIFT_FAN_DUCT_MOUNT_PADDING = 30;\nLIFT_FAN_DUCT_POSITION = [0, (BASE_DIMENSIONS[1] \/ 2) - LIFT_FAN_DUCT_DIMENSIONS[0]];\nLIFT_FAN_DUCT_MOUNT_SPACING = 18;\nLIFT_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\n\n\/* Thrust fan duct mount *\/\nTHRUST_FAN_DUCT_DIMENSIONS = [74.5, 48]; \/\/ [diameter, length]\nTHRUST_FAN_DUCT_HEIGHT = 60;\nTHRUST_FAN_DUCT_MOUNT_PADDING = 30;\nTHRUST_FAN_DUCT_MOUNT_POSITION = [0, -40];\nTHRUST_FAN_DUCT_MOUNT_SPACING = THRUST_FAN_DUCT_DIMENSIONS[1] - 8;\nTHRUST_FAN_DUCT_MOUNT_WIDTH = BASE_DIMENSIONS[0] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\nTHRUST_FAN_DUCT_MOUNT_TAB_POSITIONS = [-THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4, 0, THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4];\nTHRUST_FAN_DUCT_MOUNT_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_DIM = [25, THRUST_FAN_DUCT_HEIGHT * 0.95];\nTHRUST_FAN_DUCT_MOUNT_BRACE_SPACING = THRUST_FAN_DUCT_MOUNT_WIDTH * 0.7;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[1] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_WIDTH = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.75;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.5;\n\n\/* Rudder *\/\nRUDDER_DIMENSIONS = [30, THRUST_FAN_DUCT_DIMENSIONS[0] * 0.9];\nRUDDER_CORNER_RADIUS = 2;\nRUDDER_PIVOT_LENGTH = 5;\nRUDDER_SPACING = THRUST_FAN_DUCT_DIMENSIONS[0] * 0.475;\nRUDDER_ARM_HOLE_POSITION = [RUDDER_DIMENSIONS[0] * 0.2, -RUDDER_DIMENSIONS[1] * 0.45];\nRUDDER_ARM_HOLE_DIAM = 2;\n\n\/* Rudder mount *\/\nRUDDER_MOUNT_DIMENSIONS = [THRUST_FAN_DUCT_DIMENSIONS[0] * 0.8, 10];\nRUDDER_MOUNT_CORNER_RADIUS = 5;\nRUDDER_MOUNT_OFFSET = (RUDDER_DIMENSIONS[1] \/ 2) + MATERIAL_THICKNESS;\nRUDDER_MOUNT_TAB_WIDTH = 5;\nRUDDER_MOUNT_TAB_OFFSET = (RUDDER_MOUNT_DIMENSIONS[0] - RUDDER_MOUNT_TAB_WIDTH) \/ 2;\n\n\/* Skirt clamp *\/\nSKIRT_CLAMP_PADDING = 10;\nSKIRT_CLAMP_HOLE_DIAM = 3;\n\n\/* Lower skirt mount *\/\nLOWER_SKIRT_MOUNT_SCALE = 0.6;\n","old_contents":"\/* Machine *\/\nMACHINE_TOLERANCE = 0; \/\/For the JAS laser at Maker Space\n\/* MACHINE_TOLERANCE = 0.1; \/\/For most other lasers *\/\n\n\n\/* Material *\/\nMATERIAL_THICKNESS = 3;\nHALF_MATERIAL_THICKNESS = MATERIAL_THICKNESS \/ 2;\n\n\/* General *\/\nCORNER = 1;\nHALF_CORNER = CORNER \/ 2;\nSPACER_TAB_WIDTH_FACTOR = 0.35;\n\n\/* Base plate *\/\nBASE_DIMENSIONS = [180, 240];\nBASE_FRONT_CORNER_RADIUS = BASE_DIMENSIONS[0] \/ 2;\nBASE_REAR_CORNER_RADIUS = 30;\n\n\/* Lift fan duct mount *\/\nLIFT_FAN_DUCT_DIMENSIONS = [71, 28]; \/\/ [diameter, length]\nLIFT_FAN_DUCT_MOUNT_PADDING = 30;\nLIFT_FAN_DUCT_POSITION = [0, (BASE_DIMENSIONS[1] \/ 2) - LIFT_FAN_DUCT_DIMENSIONS[0]];\nLIFT_FAN_DUCT_MOUNT_SPACING = 18;\nLIFT_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\n\n\/* Thrust fan duct mount *\/\nTHRUST_FAN_DUCT_DIMENSIONS = [74.5, 48]; \/\/ [diameter, length]\nTHRUST_FAN_DUCT_HEIGHT = 60;\nTHRUST_FAN_DUCT_MOUNT_PADDING = 30;\nTHRUST_FAN_DUCT_MOUNT_POSITION = [0, -40];\nTHRUST_FAN_DUCT_MOUNT_SPACING = THRUST_FAN_DUCT_DIMENSIONS[1] - 8;\nTHRUST_FAN_DUCT_MOUNT_WIDTH = BASE_DIMENSIONS[0] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_SEP_WIDTH = 14;\nTHRUST_FAN_DUCT_MOUNT_TAB_POSITIONS = [-THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4, 0, THRUST_FAN_DUCT_MOUNT_WIDTH * 0.4];\nTHRUST_FAN_DUCT_MOUNT_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_DIM = [25, THRUST_FAN_DUCT_HEIGHT * 0.95];\nTHRUST_FAN_DUCT_MOUNT_BRACE_SPACING = THRUST_FAN_DUCT_MOUNT_WIDTH * 0.7;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_WIDTH = 10;\nTHRUST_FAN_DUCT_MOUNT_BRACE_TOP_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[1] * 0.8;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_WIDTH = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.75;\nTHRUST_FAN_DUCT_MOUNT_BRACE_BOTTOM_TAB_POS = THRUST_FAN_DUCT_MOUNT_BRACE_DIM[0] * 0.5;\n\n\/* Rudder *\/\nRUDDER_DIMENSIONS = [20, THRUST_FAN_DUCT_DIMENSIONS[0] * 0.9];\nRUDDER_CORNER_RADIUS = 2;\nRUDDER_PIVOT_LENGTH = 5;\nRUDDER_SPACING = THRUST_FAN_DUCT_DIMENSIONS[0] * 0.475;\nRUDDER_ARM_HOLE_POSITION = [RUDDER_DIMENSIONS[0] * 0.4, -RUDDER_DIMENSIONS[1] * 0.45];\nRUDDER_ARM_HOLE_DIAM = 2;\n\n\/* Rudder mount *\/\nRUDDER_MOUNT_DIMENSIONS = [THRUST_FAN_DUCT_DIMENSIONS[0] * 0.8, 10];\nRUDDER_MOUNT_CORNER_RADIUS = 5;\nRUDDER_MOUNT_OFFSET = (RUDDER_DIMENSIONS[1] \/ 2) + MATERIAL_THICKNESS;\nRUDDER_MOUNT_TAB_WIDTH = 5;\nRUDDER_MOUNT_TAB_OFFSET = (RUDDER_MOUNT_DIMENSIONS[0] - RUDDER_MOUNT_TAB_WIDTH) \/ 2;\n\n\/* Skirt clamp *\/\nSKIRT_CLAMP_PADDING = 10;\nSKIRT_CLAMP_HOLE_DIAM = 3;\n\n\/* Lower skirt mount *\/\nLOWER_SKIRT_MOUNT_SCALE = 0.6;\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"f59711e1d248d62f4bb0a699fc5107448c069961","subject":"Second try at case, using U-panels to make a box, coming along very well; test print ongoing..","message":"Second try at case, using U-panels to make a box, coming along very well; test print ongoing..\n","repos":"skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak,skeezix\/zikzak","old_file":"zikcase\/openscad-zzr3-case-r1\/zikcase-Ubox-all.scad","new_file":"zikcase\/openscad-zzr3-case-r1\/zikcase-Ubox-all.scad","new_contents":"\/* Case parts for Zikzak rev3\r\n * www.zikzak.ca\r\n *\/\r\n use <_fanholes.scad>;\r\n use <_assert.scad>;\r\n \r\n \/\/ ref\r\n\/\/ colours: https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/Transformations#color\r\n\r\n\/\/ TODO:\r\n\/\/ - FIX: INVERT\r\n\/\/ - VERIFY: HEIGHT positions to actually be right for jacks, relative to height padding\r\n\/\/ - FIX: so it actually fits together; sloppyness ratio? or just use scaling?\r\n\/\/ - add cart hole 'sides' as guides for the cart to go down nicely into edge connector\r\n\/\/ - 2 fastener bits per side instead of 1 ... problem is jacks\r\n\r\n\/\/ render target\r\n\/\/ - frontbacktop\r\n\/\/ - leftrightbottom\r\n\/\/ - all\r\ntarget = \"frontbacktop\";\r\n\/\/target = \"leftrightbottom\";\r\n\/\/target = \"all\";\r\n\r\n\/\/ scale? Use this to print out tiny versions for inspection prior to printing real ones\r\nscale_factor_x = 1;\r\nscale_factor_y = 1;\r\nscale_factor_z = 1;\r\n\/\/scale_factor_x = 0.4;\r\n\/\/scale_factor_y = 0.4;\r\n\/\/scale_factor_z = 0.4;\r\n\r\n\/\/ invert for printing?\r\n\/\/rotate_y = 0; \/\/ for modelling or printing bottom\r\nrotate_y = 180; \/\/ for printing top\r\n\r\n\/\/ fan holes?\r\nfan_holes = 1; \/\/ render fan holes\r\n\/\/fan_holes = 0; \/\/ skip fan holes\r\n\/\/holedia_top = 10; \/\/ larger (faster rendering) fan holes on top\r\nholedia_top = 7; \/\/ nicer smaller fan holes on top\r\n\r\n\/\/ facets\r\n$fn = 10;\r\n\r\n\/\/ board params\r\nwall_thickness = 2.5;\r\njack_buffer = 2; \t\t\t\/\/ amount of extra cutout space around each side of a jack\r\ntooth_width = wall_thickness;\r\ntooth_depth = 20;\r\ntooth_height = 20;\r\n\r\npcb_slush_factor = 3;\r\npcb_width = 150 + pcb_slush_factor;\r\npcb_depth = 100 + pcb_slush_factor;\r\npcb_height = 40 + pcb_slush_factor + (1*wall_thickness);\r\n\r\nmodule outline_frame ( offset = 10 ) {\r\n \/\/ a thick edged rect frame\r\n \/\/ full surface - smaller surface\r\n \/\/ frame thickness is 'offset'\r\n\r\n difference() {\r\n \r\n \/\/ top or bottom full size surface\r\n cube ( [ pcb_width + (wall_thickness*4), pcb_depth + (2*wall_thickness), wall_thickness] );\r\n \/\/ top or bottom smaller surface\r\n translate ( [ offset, offset, 0 ] ) {\r\n cube ( [ (pcb_width + (wall_thickness*4)) - (2*offset), (pcb_depth + (2*wall_thickness)) - (2*offset), wall_thickness] );\r\n }\r\n\r\n } \/\/ diff\r\n\r\n} \/\/ outline frame\r\n\r\nmodule frontbacktop () {\r\n\r\n module top() {\r\n union() {\r\n\t\t\t\/\/ top\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n\t\t\t\ttranslate ( [ 0, 0, pcb_height + (1*wall_thickness) ] ) {\r\n\t\t\t\t\tcube ( [ pcb_width + (wall_thickness*4), pcb_depth + (2*wall_thickness), wall_thickness] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n }\r\n\r\n\tmodule walls() {\r\n\t\tunion() {\r\n\t\t\t\/\/ front wall\r\n\t\t\tcolor ( \"thistle\" ) {\r\n\t\t\t\tcube ( [ pcb_width + (wall_thickness*4), wall_thickness, pcb_height + (2*wall_thickness) ] );\r\n\t\t\t}\r\n\t\t\t\/\/ back wall\r\n\t\t\tcolor ( \"green\" ) {\r\n\t\t\t\ttranslate ( [ 0, pcb_depth + (1*wall_thickness), 0 ] ) {\r\n\t\t\t\t\tcube ( [ pcb_width + (wall_thickness*4), wall_thickness, pcb_height + (2*wall_thickness)] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n \/\/ left fastener tooth\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n\t\t\t\ttranslate ( [ wall_thickness, pcb_depth \/ 3 * 2, pcb_height - tooth_height + (1*wall_thickness) ] ) {\r\n\t\t\t\t\tcube ( [ tooth_width, tooth_depth, tooth_height ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n \/\/ right fastener tooth\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n\t\t\t\ttranslate ( [ pcb_width + (2*wall_thickness), pcb_depth \/ 3 * 2, pcb_height - tooth_height + (1*wall_thickness) ] ) {\r\n\t\t\t\t\tcube ( [ tooth_width, tooth_depth, tooth_height ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n } \/\/ union\r\n\t} \/\/ walls\r\n\r\n\tmodule cutouts() {\r\n\t\t\/\/ LEFT SIDE\r\n\t\t\/\/\r\n\r\n \/\/ left fastener small hole\r\n translate ( [ 0, ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=0.75,r2=0.75 );\r\n }\r\n }\r\n\r\n\t\t\/\/ BACK\r\n\t\t\/\/\r\n\r\n\t\t\/\/ USB power\/serial\r\n\t\ttranslate ( [ 3 - jack_buffer, pcb_depth + (1*wall_thickness), 25 - jack_buffer + (1*wall_thickness) ] ) {\r\n\t\t\tcube( [ 7 + (2*jack_buffer), 20, 4 + (2*jack_buffer) ] );\r\n\t\t}\r\n\t\t\/\/ volume potwheel\r\n\t\ttranslate ( [ 16, pcb_depth + (1*wall_thickness), 25 - jack_buffer + (1*wall_thickness) ] ) {\r\n\t\t\tcube( [ 15 + (2*jack_buffer), 20, 2 + (2*jack_buffer) ] );\r\n\t\t}\r\n\t\t\/\/ PS\/2 keyb\r\n\t\ttranslate ( [ 36, pcb_depth + (1*wall_thickness), 25 - jack_buffer + (1*wall_thickness) ] ) {\r\n\t\t\tcube( [ 15, 20, 15 + (2*jack_buffer) ] );\r\n\t\t}\r\n\t\t\/\/ VGA\r\n\t\ttranslate ( [ 55, pcb_depth + (1*wall_thickness), 25 - jack_buffer + (1*wall_thickness) ] ) {\r\n\t\t\tcube( [ 31, 20, 14 + (2*jack_buffer) ] );\r\n\t\t}\r\n \r\n \/\/ TOP\r\n \/\/\r\n\r\n \t\t\/\/ cart\r\n\t\ttranslate ( [ 30 + (wall_thickness*2), 2, 35 - jack_buffer + (1*wall_thickness) ] ) {\r\n\t\t\tcube( [ 82 + (2*jack_buffer), 25+(2*jack_buffer), 20 ] );\r\n\t\t}\r\n \r\n \/\/ RIGHT\r\n \/\/\r\n \r\n \/\/ right fastener small hole\r\n translate ( [ pcb_width + (wall_thickness*2), ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=0.75,r2=0.75 );\r\n }\r\n }\r\n\r\n\t} \/\/ cutouts\r\n\r\n module cart_frame() {\r\n\t\ttranslate ( [ 25 + (wall_thickness*2), 2+(1*wall_thickness), pcb_height + (1*wall_thickness) ] ) {\r\n\t\t\tcube( [ 95, 35, wall_thickness ] );\r\n\t\t}\r\n }\r\n\r\n module toptrim_frame() {\r\n \r\n \/\/ frame\r\n translate ( [ 80, 60, pcb_height + (1*wall_thickness) ] ) {\r\n \/\/cube ( [ 60, 40, wall_thickness ] );\r\n cylinder ( h=wall_thickness, r1=25, r2=25 );\r\n } \/\/ tr\r\n \r\n } \/\/ top trim frame\r\n\r\n module toptrim_text() {\r\n \r\n \/\/ ZZ\r\n translate ( [ 63, 52 + (1*wall_thickness), 39 + (1*wall_thickness) ] ) {\r\n linear_extrude(slices=1,height=15) {\r\n text ( text=\"ZZ\", size=20, font=\"DejaVu Sans Mono:style=Bold\" );\r\n } \/\/ ex\r\n } \/\/ tr\r\n \r\n } \/\/ top trim text\r\n \r\n difference() {\r\n union() {\r\n\r\n \/\/ top - fanholes\r\n if ( fan_holes == 1 ) {\r\n difference() {\r\n top();\r\n translate( [ 75, 55, 38 + pcb_slush_factor ] ) fanholes(dia=140,holedia=holedia_top,height=10);\r\n } \/\/ diff\r\n } else {\r\n difference() {\r\n top();\r\n \/\/ approximate holes with a single big cutout\r\n translate ( [ 20, 15, pcb_height ] ) {\r\n cube ( [ pcb_width - 40, pcb_depth - 30, wall_thickness ] );\r\n } \/\/ tr\r\n }\r\n }\r\n \/\/ + walls\r\n \/\/ + outline frame\r\n \/\/ + cart frame\r\n \/\/ + top trim frame\r\n walls();\r\n translate ( [ 0, 0, pcb_height + (1*wall_thickness) ] ) {\r\n outline_frame ( 12 );\r\n }\r\n cart_frame();\r\n toptrim_frame();\r\n }\r\n \/\/ - cutouts\r\n \/\/ - top trim text\r\n cutouts();\r\n toptrim_text();\r\n } \/\/ diff\r\n\r\n} \/\/ front back top\r\n\r\nmodule leftrightbottom () {\r\n\r\n\tmodule walls() {\r\n\t\tunion() {\r\n\t\t\t\/\/ left wall\r\n\t\t\tcolor ( \"cadetblue\" ) {\r\n translate ( [ 0, wall_thickness, 0 ] ) {\r\n cube ( [ wall_thickness, pcb_depth, pcb_height + (1*wall_thickness) ] );\r\n }\r\n\t\t\t}\r\n\t\t\t\/\/ right wall\r\n\t\t\tcolor ( \"thistle\" ) {\r\n translate ( [ pcb_width + (wall_thickness*3), wall_thickness, 0 ] ) {\r\n cube ( [ wall_thickness, pcb_depth, pcb_height + (1*wall_thickness) ] );\r\n }\r\n\t\t\t}\r\n\r\n } \/\/ union\r\n\t} \/\/ walls\r\n \r\n module bottom() {\r\n union() {\r\n\t\t\t\/\/ bottom\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n cube ( [ pcb_width + (wall_thickness*4), pcb_depth, wall_thickness] );\r\n\t\t\t}\r\n }\r\n }\r\n \r\n\tmodule cutouts() {\r\n\t\t\/\/ LEFT SIDE\r\n\t\t\/\/\r\n\r\n\t\t\/\/ joy0 + headphone\r\n\t\ttranslate ( [ -10, 9 - jack_buffer, 25 - jack_buffer ] ) {\r\n\t\t\tcube( [ 20, 30 + 15 + (2*jack_buffer), 13 + (2*jack_buffer) ] );\r\n\t\t}\r\n\r\n \/\/ left fastener hole\r\n translate ( [ 0, ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=1,r2=1 );\r\n }\r\n }\r\n\r\n \/\/ RIGHT SIDE\r\n \/\/\r\n \r\n \/\/ right fastener hole\r\n translate ( [ pcb_width + (3*wall_thickness), ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=1,r2=1 );\r\n }\r\n }\r\n\r\n } \/\/ cutouts\r\n\r\n difference() {\r\n union() {\r\n difference() {\r\n bottom();\r\n if ( fan_holes == 1 ) {\r\n translate( [ 75, 55, 0 ] ) fanholes(dia=140,holedia=10,height=20);\r\n } \/\/ if\r\n }\r\n walls();\r\n outline_frame ( 12 );\r\n } \/\/ union\r\n cutouts();\r\n }\r\n\r\n} \/\/ left right bottom\r\n\r\n\/\/ DO IT\r\n\/\/\r\n\r\nrotate ( [ 0, rotate_y, 0 ] ) {\r\n scale ( [ scale_factor_x, scale_factor_y, scale_factor_z ] ) {\r\n if ( target == \"frontbacktop\" ) {\r\n frontbacktop();\r\n } else if ( target == \"leftrightbottom\" ) {\r\n leftrightbottom();\r\n } else if ( target == \"all\" ) {\r\n frontbacktop();\r\n leftrightbottom();\r\n }\r\n }\r\n}\r\n","old_contents":"\/* Case parts for Zikzak rev3\r\n * www.zikzak.ca\r\n *\/\r\n use <_fanholes.scad>;\r\n use <_assert.scad>;\r\n \r\n \/\/ ref\r\n\/\/ colours: https:\/\/en.wikibooks.org\/wiki\/OpenSCAD_User_Manual\/Transformations#color\r\n\r\n\/\/ TODO:\r\n\/\/ - FIX: INVERT\r\n\/\/ - VERIFY: HEIGHT positions to actually be right for jacks, relative to height padding\r\n\/\/ - FIX: so it actually fits together; sloppyness ratio? or just use scaling?\r\n\/\/ - add cart hole 'sides' as guides for the cart to go down nicely into edge connector\r\n\/\/ - 2 fastener bits per side instead of 1 ... problem is jacks\r\n\r\n\/\/ render target\r\n\/\/ - frontbacktop\r\n\/\/ - leftrightbottom\r\n\/\/ - all\r\n\/\/target = \"frontbacktop\";\r\n\/\/target = \"leftrightbottom\";\r\ntarget = \"all\";\r\n\r\n\/\/ scale? Use this to print out tiny versions for inspection prior to printing real ones\r\n\/\/scale_factor_x = 1;\r\n\/\/scale_factor_y = 1;\r\n\/\/scale_factor_z = 1;\r\nscale_factor_x = 0.4;\r\nscale_factor_y = 0.4;\r\nscale_factor_z = 0.4;\r\n\r\n\/\/ invert for printing?\r\ninvert_y = 1;\r\n\r\n\/\/ fan holes?\r\nfan_holes = 1; \/\/ render fan holes\r\n\/\/fan_holes = 0; \/\/ skip fan holes\r\nholedia_top = 10; \/\/ larger (faster rendering) fan holes on top\r\n\/\/holedia_top = 5; \/\/ nicer smaller fan holes on top\r\n\r\n\/\/ facets\r\n$fn = 50;\r\n\r\n\/\/ board params\r\nwall_thickness = 2.5;\r\njack_buffer = 2; \t\t\t\/\/ amount of extra cutout space around each side of a jack\r\ntooth_width = wall_thickness;\r\ntooth_depth = 20;\r\ntooth_height = 20;\r\n\r\npcb_width = 150;\r\npcb_depth = 100;\r\npcb_height = 40 + (1*wall_thickness);\r\n\r\nmodule outline_frame ( offset = 10 ) {\r\n \/\/ a thick edged rect frame\r\n \/\/ full surface - smaller surface\r\n \/\/ frame thickness is 'offset'\r\n\r\n difference() {\r\n \r\n \/\/ top or bottom full size surface\r\n cube ( [ pcb_width + (wall_thickness*4), pcb_depth + (2*wall_thickness), wall_thickness] );\r\n \/\/ top or bottom smaller surface\r\n translate ( [ offset, offset, 0 ] ) {\r\n cube ( [ (pcb_width + (wall_thickness*4)) - (2*offset), (pcb_depth + (2*wall_thickness)) - (2*offset), wall_thickness] );\r\n }\r\n\r\n } \/\/ diff\r\n\r\n} \/\/ outline frame\r\n\r\nmodule frontbacktop () {\r\n\r\n module top() {\r\n union() {\r\n\t\t\t\/\/ top\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n\t\t\t\ttranslate ( [ 0, 0, pcb_height ] ) {\r\n\t\t\t\t\tcube ( [ pcb_width + (wall_thickness*4), pcb_depth + (2*wall_thickness), wall_thickness] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n }\r\n\r\n\tmodule walls() {\r\n\t\tunion() {\r\n\t\t\t\/\/ front wall\r\n\t\t\tcolor ( \"thistle\" ) {\r\n\t\t\t\tcube ( [ pcb_width + (wall_thickness*4), wall_thickness, pcb_height ] );\r\n\t\t\t}\r\n\t\t\t\/\/ back wall\r\n\t\t\tcolor ( \"green\" ) {\r\n\t\t\t\ttranslate ( [ 0, pcb_depth + (1*wall_thickness), 0 ] ) {\r\n\t\t\t\t\tcube ( [ pcb_width + (wall_thickness*4), wall_thickness, pcb_height ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n \/\/ left fastener tooth\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n\t\t\t\ttranslate ( [ wall_thickness, pcb_depth \/ 3 * 2, pcb_height - tooth_height ] ) {\r\n\t\t\t\t\tcube ( [ tooth_width, tooth_depth, tooth_height ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n \/\/ right fastener tooth\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n\t\t\t\ttranslate ( [ pcb_width + (2*wall_thickness), pcb_depth \/ 3 * 2, pcb_height - tooth_height ] ) {\r\n\t\t\t\t\tcube ( [ tooth_width, tooth_depth, tooth_height ] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n } \/\/ union\r\n\t} \/\/ walls\r\n\r\n\tmodule cutouts() {\r\n\t\t\/\/ LEFT SIDE\r\n\t\t\/\/\r\n\r\n \/\/ left fastener small hole\r\n translate ( [ 0, ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=1,r2=1 );\r\n }\r\n }\r\n\r\n\t\t\/\/ BACK\r\n\t\t\/\/\r\n\r\n\t\t\/\/ USB power\/serial\r\n\t\ttranslate ( [ 3 - jack_buffer, pcb_depth + (1*wall_thickness), 25 - jack_buffer ] ) {\r\n\t\t\tcube( [ 7 + (2*jack_buffer), 20, 4 + (2*jack_buffer) ] );\r\n\t\t}\r\n\t\t\/\/ volume potwheel\r\n\t\ttranslate ( [ 16, pcb_depth + (1*wall_thickness), 25 - jack_buffer ] ) {\r\n\t\t\tcube( [ 15 + (2*jack_buffer), 20, 2 + (2*jack_buffer) ] );\r\n\t\t}\r\n\t\t\/\/ PS\/2 keyb\r\n\t\ttranslate ( [ 36, pcb_depth + (1*wall_thickness), 25 - jack_buffer ] ) {\r\n\t\t\tcube( [ 15, 20, 15 + (2*jack_buffer) ] );\r\n\t\t}\r\n\t\t\/\/ VGA\r\n\t\ttranslate ( [ 55, pcb_depth + (1*wall_thickness), 25 - jack_buffer ] ) {\r\n\t\t\tcube( [ 31, 20, 14 + (2*jack_buffer) ] );\r\n\t\t}\r\n \r\n \/\/ TOP\r\n \/\/\r\n\r\n \t\t\/\/ cart\r\n\t\ttranslate ( [ 30 + (wall_thickness*2), 2, 35 - jack_buffer ] ) {\r\n\t\t\tcube( [ 82 + (2*jack_buffer), 25+(2*jack_buffer), 20 ] );\r\n\t\t}\r\n \r\n \/\/ RIGHT\r\n \/\/\r\n \r\n \/\/ right fastener small hole\r\n translate ( [ pcb_width + (wall_thickness*2), ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=1,r2=1 );\r\n }\r\n }\r\n\r\n\t} \/\/ cutouts\r\n\r\n module cart_frame() {\r\n\t\ttranslate ( [ 25 + (wall_thickness*2), 2+(1*wall_thickness), pcb_height ] ) {\r\n\t\t\tcube( [ 95, 35, wall_thickness ] );\r\n\t\t}\r\n }\r\n\r\n module toptrim_frame() {\r\n \r\n \/\/ frame\r\n translate ( [ 80, 60, pcb_height ] ) {\r\n \/\/cube ( [ 60, 40, wall_thickness ] );\r\n cylinder ( h=wall_thickness, r1=25, r2=25 );\r\n } \/\/ tr\r\n \r\n } \/\/ top trim frame\r\n\r\n module toptrim_text() {\r\n \r\n \/\/ ZZ\r\n translate ( [ 63, 52 + (1*wall_thickness), 39 ] ) {\r\n linear_extrude(slices=1,height=15) {\r\n text ( text=\"ZZ\", size=20, font=\"DejaVu Sans Mono:style=Bold\" );\r\n } \/\/ ex\r\n } \/\/ tr\r\n \r\n } \/\/ top trim text\r\n \r\n difference() {\r\n union() {\r\n\r\n \/\/ top - fanholes\r\n if ( fan_holes == 1 ) {\r\n difference() {\r\n top();\r\n translate( [ 75, 55, 38 ] ) fanholes(dia=140,holedia=holedia_top,height=10);\r\n } \/\/ diff\r\n } else {\r\n difference() {\r\n top();\r\n \/\/ approximate holes with a single big cutout\r\n translate ( [ 20, 15, pcb_height ] ) {\r\n cube ( [ pcb_width - 40, pcb_depth - 30, wall_thickness ] );\r\n } \/\/ tr\r\n }\r\n }\r\n \/\/ + walls\r\n \/\/ + outline frame\r\n \/\/ + cart frame\r\n \/\/ + top trim frame\r\n walls();\r\n translate ( [ 0, 0, pcb_height ] ) {\r\n outline_frame ( 12 );\r\n }\r\n cart_frame();\r\n toptrim_frame();\r\n }\r\n \/\/ - cutouts\r\n \/\/ - top trim text\r\n cutouts();\r\n toptrim_text();\r\n } \/\/ diff\r\n\r\n} \/\/ front back top\r\n\r\nmodule leftrightbottom () {\r\n\r\n\tmodule walls() {\r\n\t\tunion() {\r\n\t\t\t\/\/ left wall\r\n\t\t\tcolor ( \"cadetblue\" ) {\r\n translate ( [ 0, wall_thickness, 0 ] ) {\r\n cube ( [ wall_thickness, pcb_depth, pcb_height ] );\r\n }\r\n\t\t\t}\r\n\t\t\t\/\/ right wall\r\n\t\t\tcolor ( \"thistle\" ) {\r\n translate ( [ pcb_width + (wall_thickness*3), wall_thickness, 0 ] ) {\r\n cube ( [ wall_thickness, pcb_depth, pcb_height ] );\r\n }\r\n\t\t\t}\r\n\r\n } \/\/ union\r\n\t} \/\/ walls\r\n \r\n module bottom() {\r\n union() {\r\n\t\t\t\/\/ bottom\r\n\t\t\tcolor ( \"MediumSeaGreen\" ) {\r\n cube ( [ pcb_width + (wall_thickness*4), pcb_depth, wall_thickness] );\r\n\t\t\t}\r\n }\r\n }\r\n \r\n\tmodule cutouts() {\r\n\t\t\/\/ LEFT SIDE\r\n\t\t\/\/\r\n\r\n\t\t\/\/ joy0 + headphone\r\n\t\ttranslate ( [ -10, 9 - jack_buffer, 25 - jack_buffer ] ) {\r\n\t\t\tcube( [ 20, 30 + 15 + (2*jack_buffer), 13 + (2*jack_buffer) ] );\r\n\t\t}\r\n\r\n \/\/ left fastener hole\r\n translate ( [ 0, ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=2,r2=2 );\r\n }\r\n }\r\n\r\n \/\/ RIGHT SIDE\r\n \/\/\r\n \r\n \/\/ right fastener hole\r\n translate ( [ pcb_width + (3*wall_thickness), ( pcb_depth \/ 3 * 2 ) + ( tooth_depth \/2 ), pcb_height - ( tooth_height \/ 2 ) ] ) {\r\n rotate ( [ 0, 90, 0 ] ) {\r\n cylinder ( h=wall_thickness*2,r1=2,r2=2 );\r\n }\r\n }\r\n\r\n } \/\/ cutouts\r\n\r\n difference() {\r\n union() {\r\n difference() {\r\n bottom();\r\n if ( fan_holes == 1 ) {\r\n translate( [ 75, 55, 0 ] ) fanholes(dia=140,holedia=10,height=20);\r\n } \/\/ if\r\n }\r\n walls();\r\n outline_frame ( 12 );\r\n } \/\/ union\r\n cutouts();\r\n }\r\n\r\n} \/\/ left right bottom\r\n\r\n\/\/ DO IT\r\n\/\/\r\n\r\nrotate_y = 0;\r\n\r\nif ( invert_y == 1 ) {\r\n \/\/assert ( 1==2, \"Invert not coded yet\" );\r\n rotate_y = 180;\r\n}\r\necho (\"Rotate Y \", rotate_y );\r\n\r\nrotate ( [ 0, rotate_y, 0 ] ) {\r\n scale ( [ scale_factor_x, scale_factor_y, scale_factor_z ] ) {\r\n if ( target == \"frontbacktop\" ) {\r\n frontbacktop();\r\n } else if ( target == \"leftrightbottom\" ) {\r\n leftrightbottom();\r\n } else if ( target == \"all\" ) {\r\n frontbacktop();\r\n leftrightbottom();\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"8a1d65b426e49bc202e5d2c6b703984962b4e428","subject":"xaxis\/carriage: reduce belt fasten width","message":"xaxis\/carriage: reduce belt fasten width\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\n\/\/ main house\nextruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n];\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 12*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n union()\n {\n \/\/ belt path cutout\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n\n \/\/ belt path cutout\n for(z=xaxis_beltpath_z_offsets)\n translate([0, 0, z])\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n }\n }\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n translate([0,-1*mm,0])\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -extruder_b_size[1]-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\n\/\/ main house\nextruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n];\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=8*mm, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR125;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n \/*color(color_xcarriage)*\/\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n color(color_extruder)\n translate(extruder_offset_a)\n {\n extruder_a();\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-95,53,20])<]*\/\n \/*[>rotate([-152,0,0])<]*\/\n \/*[>import(\"stl\/E3D_40_mm_Duct.stl\");<]*\/\n\n \/*[>translate([explode[0],-explode[1],explode[2]])<]*\/\n \/*[>translate([-123.5,78.5,-54])<]*\/\n \/*[>rotate([0,0,-90])<]*\/\n \/*[>import(\"stl\/E3D_30_mm_Duct.stl\");<]*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*color(color_hotend)*\/\n \/*x_extruder_hotend();*\/\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_extras=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"93a8053d8ddc1e658e75172d476ea09bcc3c4136","subject":"yaxis\/bearingmount: fix minor debug error","message":"yaxis\/bearingmount: fix minor debug error\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-carriage-bearing-mount.scad","new_file":"y-axis-carriage-bearing-mount.scad","new_contents":"use \ninclude \ninclude \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule yaxis_carriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick;*\/\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,1]];*\/\n\/*attach(c1,yaxis_carriage_bearing_mount_conn_bottom)*\/\n\/*{*\/\n \/*yaxis_carriage_bearing_mount();*\/\n \/*#connector(yaxis_carriage_bearing_mount_conn_bottom);*\/\n\/*}*\/\n","old_contents":"use \ninclude \ninclude \n\nyaxis_carriage_bearing_mount_bottom_thick = 3;\nyaxis_carriage_bearing_mount_conn_bottom = [[0,0,0], [0,0,1]];\nyaxis_carriage_bearing_mount_conn_bearing = [[0,0,yaxis_carriage_bearing_mount_bottom_thick+yaxis_bearing[1]\/2], [0,0,1]];\n\nmodule yaxis_carriage_bearing_mount(show_bearing=false, show_zips=false)\n{\n \/\/ x distance of holes\n screw_dx=28;\n \/\/ y distance of holes\n screw_dy=21;\n\n carriage_plate_thread=ThreadM4;\n carriage_plate_thread_d=lookup(ThreadSize, carriage_plate_thread);\n\n width = screw_dx+carriage_plate_thread_d*2;\n depth = max(yaxis_bearing[1], screw_dx+carriage_plate_thread_d*2);\n \/*height = yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick;*\/\n height = 5+yaxis_carriage_bearing_mount_bottom_thick;\n\n difference()\n {\n union()\n {\n cubea ([width, depth, height], align=[0,0,1]);\n }\n\n translate ([+screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([+screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, +screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n translate ([-screw_dx\/2, -screw_dy\/2, -1]) fncylindera(d=carriage_plate_thread_d, h=height+2, align=[0,0,1]);\n\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing_mount_holes(yaxis_bearing, orient=[0,1,0], ziptie_dist=5, show_zips=show_zips);\n }\n\n %if(show_bearing)\n {\n translate([0,0,yaxis_bearing[1]\/2+yaxis_carriage_bearing_mount_bottom_thick])\n bearing(yaxis_bearing, orient=[0,1,0]);\n }\n}\n\n\/*c1=[[0,0,0],[0,0,-1]];*\/\n\/*attach(c1,yaxis_carriage_bearing_mount_conn)*\/\n\/*{*\/\n \/*yaxis_carriage_bearing_mount();*\/\n \/*#connector(yaxis_carriage_bearing_mount_conn);*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"1fe910f36a000d249b8b95af09e9f7a405fe59a1","subject":"Rectagular examples are given instead of square ones.","message":"Rectagular examples are given instead of square ones.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/basics\/rounded-cube.scad","new_file":"OpenSCAD\/basics\/rounded-cube.scad","new_contents":"\r\n\/**\r\n * \r\n * some parts of this software were inspired by \r\n * \t\r\n * \t http:\/\/www.thingiverse.com\/thing:9347\r\n * \r\n *\/\r\n \r\nboardLength = 150;\r\nboardWidth = 100;\r\n\r\nroundedCube([boardLength, boardWidth, 1], 5, sides=20);\r\n\r\ntranslate([0, 130, 0])\r\nroundedCube([boardLength, boardWidth, 1], 5, sides=20, sidesOnly=true);\r\n\r\n\/**\r\n * makes a rounded cube\r\n *\/\r\nmodule roundedCube(size, cornerRadius, sides=30, sidesOnly=false)\r\n{\r\n\t$fn=sides;\r\n\t\r\n\tx = size[0] - cornerRadius\/2;\r\n\ty = size[1] - cornerRadius\/2;\r\n\tz = size[2];\r\n\t\r\n\tminkowski(size, cornerRadius)\r\n\t{\r\n\t cube(size=[x,y,z]);\r\n\t \r\n\t if(sidesOnly)\r\n\t {\r\n\t \tcylinder(r=cornerRadius);\r\n\t }\r\n\t else\r\n\t {\r\n\t \tsphere(r=cornerRadius);\r\n\t \t\r\n \t}\r\n\t}\t\r\n}\r\n ","old_contents":"\r\n\/**\r\n * \r\n * some parts of this software were inspired by \r\n * \t\r\n * \t http:\/\/www.thingiverse.com\/thing:9347\r\n * \r\n *\/\r\n \r\nboardLength = 100;\r\n\r\nroundedCube([boardLength, boardLength, 1], 5, sides=20);\r\n\r\ntranslate([0, 130, 0])\r\nroundedCube([boardLength, boardLength, 1], 5, sides=20, sidesOnly=true);\r\n\r\n\/**\r\n * makes a rounded cube\r\n *\/\r\nmodule roundedCube(size, cornerRadius, sides=30, sidesOnly=false)\r\n{\r\n\t$fn=sides;\r\n\t\r\n\tx = size[0] - cornerRadius\/2;\r\n\ty = size[1] - cornerRadius\/2;\r\n\tz = size[2];\r\n\t\r\n\tminkowski(size, cornerRadius)\r\n\t{\r\n\t cube(size=[x,y,z]);\r\n\t \r\n\t if(sidesOnly)\r\n\t {\r\n\t \tcylinder(r=cornerRadius);\r\n\t }\r\n\t else\r\n\t {\r\n\t \tsphere(r=cornerRadius);\r\n\t \t\r\n \t}\r\n\t}\t\r\n}\r\n ","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"50d24ddcc141edf2cf17bd6bee878409db76d8b3","subject":"config: Increase X rods distance to 60mm","message":"config: Increase X rods distance to 60mm\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n","old_contents":"include \ninclude \ninclude \n\ne=0.01;\n\n\/\/ resolution of any round object (segment length)\nfnr = 0.4;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_color = [0.5,0.5,0.5];\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\n\nmain_lower_dist_z= 80*mm;\nmain_upper_dist_y= 160*mm;\n\nxaxis_rod_distance = 45*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_bearing=bearing_igus_rj4jp_01_10;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\nycarriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\nzaxis_bearing=bearing_igus_rj4jp_01_12;\n\n\/\/ NEMA17 motor w\/340mm leadscrew\nzaxis_motor = [\n [NemaModel, 17],\n [NemaLengthShort, 33*mm],\n [NemaLengthMedium, 39*mm],\n [NemaLengthLong, 47*mm],\n [NemaSideSize, 42.20*mm], \n [NemaDistanceBetweenMountingHoles, 31.04*mm], \n [NemaMountingHoleDiameter, 4*mm], \n [NemaMountingHoleDepth, 4.5*mm], \n [NemaMountingHoleLip, -1*mm], \n [NemaMountingHoleCutoutRadius, 0*mm], \n [NemaEdgeRoundingRadius, 7*mm], \n [NemaRoundExtrusionDiameter, 22*mm], \n [NemaRoundExtrusionHeight, 1.9*mm], \n [NemaAxleDiameter, 8*mm], \n \/\/ custom front axle length\n [NemaFrontAxleLength, 340*mm], \n [NemaBackAxleLength, 15*mm],\n [NemaAxleFlatDepth, 0.5*mm],\n [NemaAxleFlatLengthFront, 15*mm],\n [NemaAxleFlatLengthBack, 14*mm]\n ];\n\nzaxis_motor_offset_z = 10*mm;\n\n\/\/ inner_d, outer_d, thread\nzaxis_nut = [20*mm, 36.5*mm, 8*mm];\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_bearing[1]\/2 + 3;\n\n\/\/ place z rod on edge of motor\n\/*zaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + lookup(NemaSideSize,zaxis_motor)\/2);*\/\nzaxis_rod_screw_distance_x = zaxis_nut_mount_outer;\n\nxaxis_zaxis_distance_y = xaxis_rod_d\/2 + zaxis_bearing[1]\/2;\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"25c9b5f079d05d2b03b532e63c0fb130baa4d102","subject":"pale with a disk on the bottom","message":"pale with a disk on the bottom\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"wall_mount_pale\/wall_mount_pale.scad","new_file":"wall_mount_pale\/wall_mount_pale.scad","new_contents":"count = 2; \/\/ number of pales needed\n\nmodule element()\n{\n for(i = [0:9])\n translate([0, 3*i, 0])\n rotate([-90, 0, 0])\n cylinder(h=5, r1=5\/2, r2=0, $fs=0.01);\n translate([0, -2, 0])\n rotate([-90, 0, 0])\n cylinder(h=2, r=20\/2, $fn=100);\n}\n\nmodule halfElement()\n{\n difference()\n {\n element();\n translate([-20, -3, -12])\n cube([50,50,12]);\n }\n}\n\nfor(i = [0:count-1])\n translate([i*22, 0, 0])\n {\n translate([0, 5, 0])\n halfElement();\n rotate([0, 0, 180])\n halfElement();\n }\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"fa723d82a408ba774ef523dc6b901b20c651b75d","subject":"added matrix NxM elements on the print","message":"added matrix NxM elements on the print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"cable_support\/cable_support.scad","new_file":"cable_support\/cable_support.scad","new_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\nN=4;\nM=2;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[1:N])\n for(j=[1:M])\n translate([(j-1)*25, (i-1)*12, 0])\n element();\n","old_contents":"eps=0.01;\nwall=4;\nh=wall+8+5;\n$fn=60;\nN=4;\n\nmodule support_()\n{\n translate(-wall\/2*[0, 1, 0])\n {\n dist=8+wall+(8+2)\/2;\n cube([dist, wall, wall]);\n translate([dist-wall, 0, 0])\n cube([wall, wall, wall+8]);\n }\n}\n\nmodule screw_space_()\n{\n cylinder(r=(3.5+0.4)\/2, h=h+eps);\n translate(-eps*[0,0,1])\n cylinder(r1=(8+0.5)\/2, r2=(3.5+0.5)\/2, h=4.5+eps);\n}\n\n\nmodule element()\n{\n difference()\n {\n union()\n {\n cylinder(r=(8+2)\/2, h=h);\n support_();\n }\n screw_space_();\n }\n}\n\n\nfor(i=[1:N])\n translate([0, (i-1)*12, 0])\n element();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"04054e9c667be9363d2a334d4d80af5cabc22d88","subject":"bearings\/linear: fix clip groove depth","message":"bearings\/linear: fix clip groove depth\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing-linear.scad","new_file":"bearing-linear.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7094a4338ff0e2e8daf15c71676540f247e9ce46","subject":"bottom holder part","message":"bottom holder part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"sink_pipe_support\/holder.scad","new_file":"sink_pipe_support\/holder.scad","new_contents":"module holder()\n{\n cylinder(h=5, r=50);\n d=30;\n e=d+4;\n h=5+40;\n difference()\n {\n translate([-e\/2, -e\/2, 0])\n cube([e, e, h]);\n translate([-d\/2, -d\/2, 0])\n cube([d, d, h]);\n translate([-h\/2, 0, h-10])\n rotate([0, 90, 0])\n cylinder(r=5+1, h=h);\n }\n}\n\nholder();","old_contents":"","returncode":1,"stderr":"error: pathspec 'sink_pipe_support\/holder.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1beb74f93dde3025d35a153388dc73f444d82c71","subject":"lcd2004: fix oops","message":"lcd2004: fix oops\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"lcd2004.scad","new_file":"lcd2004.scad","new_contents":"include \ninclude \n\ninclude \n\nuse \nuse \nuse \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=Z, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror(Y)\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=Z);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=Z);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=Z);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=Y);\n }\n }\n }\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=Z, align=N)\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s, rounding_radius=3);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=Z, orient=Z);\n }\n}\n\nlcd2004_offset = [0, -34.2*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\nmodule part_lcd2004_mount()\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\nif(false)\n{\n mount_lcd2004(show_gantry=true);\n}\n","old_contents":"include \ninclude \n\ninclude \n\nuse \nuse \nuse \n\n\/\/ wall thickness\nlcd2004_wall_thick=4;\nlcd2004_width=151+2*lcd2004_wall_thick;\nlcd2004_depth=63.5+2*lcd2004_wall_thick;\nmount_lcd2004_mount_angle=45;\n\nmodule mount_lcd2004_parts(\n eps=[0.1,0.1,0], \/\/ gap for cavities\n part=undef,\n height=16*mm,\n align, orient, roll, extra_roll, extra_roll_orient\n )\n{\n\n size_align(size=[lcd2004_width,lcd2004_depth,height], align=align, orient=orient, orient_ref=Z, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"pos\", height=height);\n mount_lcd2004_parts(lcd2004_wall_thick=lcd2004_wall_thick, eps=eps, part=\"neg\", height=height);\n }\n }\n else if(part==\"pos\")\n {\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n rcubea(size=[lcd2004_width,lcd2004_depth,height], rounding_radius=3, align=[1,1,1]);\n }\n else if(part==\"neg\")\n mirror(Y)\n translate([-lcd2004_width\/2,-lcd2004_depth\/2,-height\/2])\n translate([lcd2004_wall_thick,lcd2004_wall_thick,0])\n {\n \/\/ LCD cutout\n translate([14.5,10,-2])\n cubea([97,40,19], align=[1,1,1]);\n\n \/\/ LCD PCB\n translate([14,-0.25,4])\n cubea([98.5,60.5,9+10], align=[1,1,1]);\n\n \/\/ Main PCB\n translate([0,7.75,8]) \n cubea([151,56,5+22], align=[1,1,1]);\n\n \/\/ Switch axis\n translate([137,35,-2]) \n cylindera(r=8\/2, h=19, align=Z);\n\n \/\/ buzzer\n translate([130+13.5\/2,8+39+12.5\/2,-2]) \n cylindera(r=12.5\/2, h=19, align=Z);\n\n \/\/ reset switch\n translate([137,16,-2]) \n cylindera(r=2, h=19, align=Z);\n\n \/\/ buzzer\/switch\/reset\n translate([116,8,2]) \n cubea([29,55.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([118,18,2]) \n cubea([33,35.5,10], align=[1,1,1]);\n\n \/\/ buzzer\/switch\/reset\n translate([0,18,2]) \n cubea([11,35.5,10], align=[1,1,1]);\n\n \/\/ SD slot\n translate([-lcd2004_wall_thick-1,17,9]) \n cubea([lcd2004_wall_thick+2,27,10], align=[1,1,1]);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([0+2.9,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ Screw hole for PCB\n translate([151-2.7,8+55.5-2.5,3]) \n cylindera(r=2.5\/2, h=6, align=Z);\n\n \/\/ LCD pin header\n translate([14.5+8,60-5,2])\n cubea([42,8.5,9], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([50,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n\n \/\/ Anti-Warping\n translate([90,-lcd2004_wall_thick\/2,2])\n cubea([2,55.5+8+lcd2004_wall_thick,11], align=[1,1,1]);\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if($preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if($preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=Y);\n }\n }\n }\n }\n}\n\nlcd2004_mount_thickness = 5*mm;\nmodule lcd2004_extrusion_conn(part, orient=Z, align=N)\n{\n s = [extrusion_size, extrusion_size, lcd2004_mount_thickness];\n size_align(size=s, orient=orient, orient_ref=Z, align=align)\n if(part==undef)\n {\n difference()\n {\n lcd2004_extrusion_conn(part=\"pos\");\n lcd2004_extrusion_conn(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n rcubea(size=s, rounding_radius=3);\n }\n else if(part==\"neg\")\n {\n translate([0,0,-lcd2004_mount_thickness\/2])\n screw_cut(nut=extrusion_nut, with_nut=true, nut_cut_h=30, with_head=true, head_cut_h=30, length=12*mm, align=Z, orient=Z);\n }\n}\n\nlcd2004_offset = [0, -34.2*mm,-5*mm];\n\nmodule mount_lcd2004(part, show_gantry=false)\n{\n if(part==undef)\n {\n difference()\n {\n mount_lcd2004(part=\"pos\", show_gantry=show_gantry);\n mount_lcd2004(part=\"neg\", show_gantry=show_gantry);\n }\n }\n else if(part == \"pos\")\n {\n hull()\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n }\n\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,-main_lower_dist_z\/2])\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n }\n if(show_gantry)\n {\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n }\n else if(part == \"neg\")\n {\n for(x=[-1,1])\n translate([x*(lcd2004_width\/2+extrusion_size),0,0])\n {\n translate([0,0,main_lower_dist_z\/2-extrusion_size])\n lcd2004_extrusion_conn(part=part, orient=Z, align=[-x,0,-1]);\n\n translate([0,0,-main_lower_dist_z\/2])\n {\n lcd2004_extrusion_conn(part=part, orient=[0,0,-1], align=[-x,0,1]);\n }\n }\n\n translate([0,10*mm,-extrusion_size\/2])\n \/*#rcubea([lcd2004_width+30*mm, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);*\/\n rcubea([1000, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*2]);\n\n \/*translate([0,0,-extrusion_size\/2])*\/\n \/*rcubea([lcd2004_width, extrusion_size+.2, main_lower_dist_z-extrusion_size-lcd2004_mount_thickness*1]);*\/\n\n\n translate(lcd2004_offset)\n rotate([-mount_lcd2004_mount_angle,0,0])\n {\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,1000+5,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n }\n\n translate(lcd2004_offset)\n translate([0,27,-13])\n translate([0,1000,0])\n rotate([90,0,0])\n linear_extrude(height=1000)\n projection(cut=false)\n rotate([-90,0,0])\n mount_lcd2004_parts(part=part, orient=Y, align=Y);\n\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size\/2,0])\n gantry_lower();\n }\n\n}\n\nmodule part_lcd2004_mount()\n{\n rotate([90+mount_lcd2004_mount_angle,0,0])\n translate(-lcd2004_offset)\n mount_lcd2004();\n}\n\n\/*if(false)*\/\n{\n mount_lcd2004(show_gantry=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"310101bfa1f25a6fd0ca2fc502f034c6f5725ca6","subject":"Init context of test modules and test units in test package","message":"Init context of test modules and test units in test package\n","repos":"jsconan\/camelSCAD","old_file":"util\/test.scad","new_file":"util\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n $testModule = \"\";\n $testUnit = \"\";\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Declares a unit test context. That allows to isolate context data from other unit tests.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnitContext(title, expected) {\n $testUnit = str($testUnit, \" - \", string(title));\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n if (!checkExpectedAsserts(actual, expected)) {\n color([1, 0.4, 0.2]) {\n cube(15, center=true);\n }\n }\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Unit testing API.\n *\n * @package util\/test\n * @author jsconan\n *\/\n\n\/**\n * Declares the target package of the test suite.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testPackage(title, expected) {\n $testPackage = string(title);\n\n displayTestTitle(title, \"package\", true);\n children();\n displayExpectedAsserts($children, expected, \"module\");\n}\n\n\/**\n * Declares the function or the feature that is tested.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testModule(title, expected) {\n $testModule = string(title);\n\n displayTestTitle(title, \"module\");\n children();\n displayExpectedAsserts($children, expected, \"test\");\n}\n\n\/**\n * Declares a unit test.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnit(title, expected) {\n $testUnit = string(title);\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Declares a unit test context. That allows to isolate context data from other unit tests.\n *\n * @param String title\n * @param Number [expected]\n *\/\nmodule testUnitContext(title, expected) {\n $testUnit = str($testUnit, \" - \", string(title));\n\n children();\n displayExpectedAsserts($children, expected, \"assertion\");\n}\n\n\/**\n * Asserts the actual value is equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertEqual(actual, expected, message) {\n result = actual == expected;\n message = or(message, \"Should be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotEqual(actual, expected, message) {\n result = actual != expected;\n message = or(message, \"Should not be equal\");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertApproxEqual(actual, expected, message) {\n result = approx(actual, expected);\n message = or(message, \"Should be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the actual value is not approximately equal to the expected value.\n *\n * @param * actual\n * @param * expected\n * @param String [message]\n *\/\nmodule assertNotApproxEqual(actual, expected, message) {\n result = !approx(actual, expected);\n message = or(message, \"Should not be approximately equal \");\n details = [actual, expected];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is equivalent to true.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertTrue(value, message) {\n result = !!value;\n message = or(message, \"Should be true\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is falsy.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertFalse(value, message) {\n result = !value;\n message = or(message, \"Should be false\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Failed assert.\n *\n * @param String [message]\n *\/\nmodule failed(message) {\n message = or(message, \"Failed!\");\n\n displayAssertResult(false, message);\n}\n\n\/**\n * Asserts the value is undefined.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertUndef(value, message) {\n result = isUndef(value);\n message = or(message, \"Should be an undefined value\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a number.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNumber(value, message) {\n result = isNumber(value);\n message = or(message, \"Should be a number\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an integer.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertInteger(value, message) {\n result = isInteger(value);\n message = or(message, \"Should be an integer\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a boolean.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertBoolean(value, message) {\n result = isBoolean(value);\n message = or(message, \"Should be a boolean\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a vector.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertVector(value, message) {\n result = isVector(value);\n message = or(message, \"Should be a vector\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertArray(value, message) {\n result = isArray(value);\n message = or(message, \"Should be an array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyArray(value, message) {\n result = value == [];\n message = or(message, \"Should be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is not an empty array.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyArray(value, message) {\n result = isArray(value) && value != [];\n message = or(message, \"Should not be an empty array\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertString(value, message) {\n result = isString(value);\n message = or(message, \"Should be a string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is an empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertEmptyString(value, message) {\n result = value == \"\";\n message = or(message, \"Should be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Asserts the value is a not empty string.\n *\n * @param * value\n * @param String [message]\n *\/\nmodule assertNotEmptyString(value, message) {\n result = isString(value) && value != \"\";\n message = or(message, \"Should not be an empty string\");\n details = [value];\n\n displayAssertResult(result, message, details);\n}\n\n\/**\n * Displays a title.\n *\n * @private\n * @param String title\n * @param String type\n * @param Boolean [big]\n *\/\nmodule displayTestTitle(title, type, big) {\n echo(formatTestTitle(title, type, big));\n}\n\n\/**\n * Displays the number of expected asserts.\n *\n * @private\n * @param Number actual\n * @param Number [expected]\n * @param String [type]\n *\/\nmodule displayExpectedAsserts(actual, expected, type) {\n echo(formatExpectedAsserts(actual, expected, type));\n if (!checkExpectedAsserts(actual, expected)) {\n color([1, 0.4, 0.2]) {\n cube(15, center=true);\n }\n }\n}\n\n\/**\n * Displays an assert result.\n *\n * @private\n * @param Boolean result\n * @param String message\n * @param Array [details]\n *\/\nmodule displayAssertResult(result, message, details) {\n echo(formatAssertResult(result, message, details));\n if (!result) {\n color([1, 0, 0]) {\n sphere(10);\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7a6573f16a5ad05499a93e9189d2d834490ffae7","subject":"feat: add parameter to center the simple test elements","message":"feat: add parameter to center the simple test elements\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [size] - The size of the element.\n * @param Boolean [center] - Whether or not the element is centered.\n *\/\nmodule testElement(c=\"red\", size=1, center=false) {\n color(c) {\n cube(size=size, center=center);\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [size] - The size of the element.\n *\/\nmodule testElement(c=\"red\", size=1) {\n color(c) {\n cube(size);\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `selectTest`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n selectTest = is_undef(selectTest) ? undef : min(max(0, selectTest), count - 1);\n start = is_undef(selectTest) ? 0 : selectTest;\n end = is_undef(selectTest) ? count - 1 : selectTest;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n\n\/\/ Select a single test to show\nselectTest = undef;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ab549bb68093e5ef09465c9d2be0141ec0d5a25c","subject":"make echo statements compatible with convert-2d.sh","message":"make echo statements compatible with convert-2d.sh\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(str(\"[LC] \/\/ screw thread major dia must be < \", thickness));\n echo(str(\"[LC] \/\/ screw thread length must be < \", thickness*5));\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(str(\"[LC] \/\/ nut thickness must be < \", thickness));\n echo(str(\"[LC] \/\/ nut flats must be < \", nut_flat_width));\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n if (len(captive_nuts) < 4) {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness*3, thickness);\n } else {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], captive_nuts[t][3], thickness);\n }\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + milling_bit*2 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5 + milling_bit*2, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, nut_flat_width, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n echo(\"screw thread major dia must be < \", thickness);\n echo(\"screw thread length must be < \", thickness*5);\n translate([-nut_flat_width\/2,thickness,-thickness]) cube([nut_flat_width, thickness, thickness*3]); \n echo(\"nut thickness must be < \", thickness);\n echo(\"nut flats must be < \", nut_flat_width);\n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n if(start_up == 1) \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([2*(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n else \n {\n translate([((range_max-range_min)\/fingers)*p,0,0]) \n {\n translate([bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([(range_max-range_min)\/(fingers*2) - bit\/2,thickness,0]) cylinder(h=thickness*4, d=bit, center=true );\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=2,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"9c85822ed0a67628c00469895afef1597322dfe3","subject":"Transitioning to a more elegant design w.r.t. the push buttons","message":"Transitioning to a more elegant design w.r.t. the push buttons\n","repos":"joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/extendo,joshsh\/extendo,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo,joshsh\/smsn,joshsh\/smsn,joshsh\/extendo","old_file":"typeatron\/typeatron.scad","new_file":"typeatron\/typeatron.scad","new_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nvisualizeInternalComponents = false;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.10;\nchargerHeaderWidth = 2.56;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\nledDomeRadius = 2.5;\nledRimRadius = 2.9;\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 11;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\nlidMargin = 1;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\npushButtonWellWidth = 7;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1;\npushButtonLegLength = 4;\npushButtonHeight = 5.0;\npushButtonPressDepth = 0.3;\n\/\/pushButtonRadius = 3.5\/2;\npushButtonLegProtrusion = pushButtonLegLength - pushButtonBaseThick;\nbuttonThick = 8;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonStabilizerRodHeight = pushButtonHeight - (pushButtonPressDepth + 0.5 + error);\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + pushButtonPressDepth + pushButtonWellDepth;\n\nbuttonClearance = 0.3;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\nlidWidth = caseWidth - wallThick + lidMargin - totalFingerWellDepth + 3;\nlidLength = caseLength - thumbBevelLength - wallThick + 2*lidMargin;\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([-1,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+pushButtonPressDepth+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2); \n }\n}\n\n\/\/ create the lid\n\/\/ buffer: hyper-extends the lid, for better rendering\n\/\/ shrinkage: clearance around the edges of the lid\nmodule lid(buffer, shrinkage) {\n translate([0,0,-buffer]) {\n translate([wallThick-lidMargin+shrinkage,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth,lidLength,lidThick+buffer]);\n }\n translate([thumbBevelWidth,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth-thumbBevelWidth+wallThick,cavityLength+(lidMargin-shrinkage)*2,lidThick+buffer]);\n }\n\n \/\/ note: currently no \"shrinkage\" on this edge\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n rotate([180,0,0]) {\n translate([-27,-wallThick,pushButtonBaseThick]) {\n translate([0,0,-6]) {\n cube([47,lidThick+buffer,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\nmodule button() {\n difference() {\n union() {\n translate([buttonClearance,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength-2*buttonClearance,r=buttonWidth\/2-buttonClearance); }\n }\n\n translate([buttonClearance,buttonClearance,buttonWidth\/2]) {\n cube([buttonLength-2*buttonClearance,buttonWidth-2*buttonClearance,buttonThick-buttonWidth\/2]);\n }\n\n translate([buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n\n translate([buttonLength-buttonStabilizerWellWidth+buttonClearance,buttonClearance,buttonThick]) {\n cube([buttonStabilizerWellWidth-2*buttonClearance, buttonWidth-2*buttonClearance, buttonStabilizerRodHeight]);\n\t\t }\n }\n\n translate([buttonClearance+1,0,0]) { cube([1,buttonWidth,2]); }\n translate([buttonLength-buttonClearance-2,0,0]) { cube([1,buttonWidth,2]); }\n\n \/\/translate([0,buttonWidth\/2,buttonWidth\/2]) {\n \/\/ rotate([0,90,0]) { cylinder(h=buttonLength+1,r=buttonWidth\/3); }\n \/\/}\n\n \/\/translate([buttonLength\/2,buttonWidth\/2,buttonThick-0.5]) {\n \/\/ cylinder(h=1,r=pushButtonRadius);\n \/\/}\n }\n}\n\nmodule screwHoles() {\n translate([0,0,-1]) {\n translate([15,caseLength-thumbBevelLength-wallThick+9,0]) { cylinder(h=caseHeight+2,r=1.5); }\n\n translate([wallThick+cavityWidth+2.5,caseLength-fingerHeightOffset-fingerRad*2,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+2.5,caseLength-fingerHeightOffset-fingerRad*4,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+2.5,caseLength-fingerHeightOffset-fingerRad*6,0]) { cylinder(h=caseHeight+2,r=1.5); }\n }\n}\n\nmodule caseConvexHull() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick);\n }\n }\n }\n}\n\nmodule basicCase() {\n difference() {\n caseConvexHull();\n\n \/\/ inner compartment\n translate([wallThick,wallThick,lidThick]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick-lidThick]);\n }\n translate([thumbBevelWidth+2,wallThick,lidThick]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-2,cavityLength,caseHeight-floorThick-lidThick]);\n }\n\n \/*\n \/\/ depression for lid\n lid(1,0);\n *\/\n\n screwHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick+lidThick,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick-lidThick,15]);\n cube([22,caseHeight-floorThick-lidThick,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius+error);\n\n \/\/ note: the rim depression uses a larger error\/clearance, since it doesn't need\n \/\/ to fit tightly and can't be filed down\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius+clearance);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick,0,caseHeight-floorThick-chargerHeaderLength-2*error]) {\n cube([chargerHeaderWidth+2*error,wallThick,chargerHeaderLength+2*error]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+2*error,wallThick,powerSwitchWidth+2*error]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick,nanoUsbHeight+clearance]);\n }\n \/\/ trim off the thin remainder above the USB port which would be problematic to print,\n \/\/ and make it harder to get the Nano into its socket anyway\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,wallThick-lidMargin,0]) {\n cube([nanoUsbWidth+2*clearance,lidMargin,2]);\n }\n }\n}\n\ndifference() {\n basicCase();\n cube([caseWidth, caseLength, (caseHeight-buttonWidth)\/2+0.0001]);\n}\n\ntranslate([caseWidth + 10, 0, 0]) {\n difference() {\n basicCase();\n translate([0,0,(caseHeight-buttonWidth)\/2]) {\n cube([caseWidth, caseLength, caseHeight]);\n }\n }\n}\n\n\/*\n\/\/ lid\ntranslate([0,0,caseHeight + 2]) {\n difference() {\n \/\/ the gap of 0.4 was determined by taking into account the 0.15mm accuracy of\n \/\/ the device and the 0.15% error by longest axis of the material, keeping in mind\n\t \/\/ that there are always a pair of gaps across the lid from each other.\n \/\/ 0.4mm is actually larger than necessary in the horizontal (narrower) dimension.\n lid(0,0.4);\n\n screwHoles();\n }\n}\n*\/\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the most smooth\ntranslate([-5,0,10]) {\n for (i = [0:4]) {\n translate([0,i*(buttonLength+2),0]) { rotate([90,180,-90]) {\n \/\/cube([10,20,40]);\n\n button();\n }} \n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+2*error,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ container for Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (visualizeInternalComponents) {\n \/\/ Arduino Nano v3.0\n translate([0,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([1,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,3,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\t translate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([1,4,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","old_contents":"\nfunction pythag(a, b) = sqrt(a*a + b*b);\nfunction angle(a, b) = atan(a\/b);\n\nincludeInternalComponents = true;\n\n\/\/ this is the accuracy value for Shapeways' \"Strong & Flexible Plastics\" option\nerror = 0.15;\n\n\/\/ note: AFAIK, \"clearance\" is a minimum gap in printed parts. Here, however, it is used\n\/\/ as a lesser\/safer accuracy for gaps between the printed part and foreign objects such as\n\/\/ circuit boards, which may not have been cut or measured with the same degree of precision.\nclearance = 0.5;\n\ncontainmentWallThick = 1;\n\nnanoLength = 43.2;\nnanoWidth = 18.0;\nnanoHeightWithoutUsb = 5.4;\nnanoHeightToUsbBase = 3.3;\nnanoUsbWidth = 7.6;\nnanoUsbHeight = 3.9;\nnanoLeftMargin = 5;\n\nchargerHeaderLength = 5.10;\nchargerHeaderWidth = 2.56;\n\npowerSwitchLength = 11.6;\npowerSwitchWidth = 4.0;\npowerSwitchDepth = 7.5;\npowerSwitchOffset = 12;\n\ncaseWidth = 70;\ncaseLength = 130;\ncaseHeight = 11;\n\nwallThick = caseHeight\/2;\nlidThick = 1.5;\nfloorThick = 1.5;\nlidMargin = 1;\n\nfingerHeightOffset = 5;\nfingerWellDepth = 10;\nfingerRad = 15;\nthumbWellDepth = wallThick;\nthumbWellRadius = 30;\npushButtonWellWidth = 7;\npushButtonWellDepth = 4;\npushButtonBaseThick = 1;\npushButtonLegLength = 4;\npushButtonRadius = 3.5\/2;\npushButtonLegProtrusion = pushButtonLegLength - pushButtonBaseThick;\nbuttonThick = 8;\nbuttonPressDepth = 0.3;\nbuttonWidth = pushButtonWellWidth;\nbuttonLength = 25;\nbuttonStabilizerWellWidth = 3;\nbuttonStabilizerRodHeight = pushButtonWellDepth - 1;\ntotalFingerWellDepth = fingerWellDepth + buttonThick\/2 + buttonPressDepth + pushButtonWellDepth;\ntotalThumbWellDepth = thumbWellDepth + buttonThick\/2 + buttonPressDepth + pushButtonWellDepth;\n\nledDomeRadius = 2.6;\nledRimRadius = 3.1;\n\nthumbBevelLength = 48;\nthumbBevelWidth = 31;\n\nthumbBevelAngle = angle(thumbBevelLength-wallThick,thumbBevelWidth-wallThick);\nthumbBevelStretch = pythag(thumbBevelLength-wallThick, thumbBevelWidth-wallThick);\n\nthumbKeyOffset = 23;\n\ncavityWidth = caseWidth - wallThick - totalFingerWellDepth - pushButtonBaseThick;\ncavityLength = caseLength - (2 * wallThick);\n\nlidWidth = caseWidth - wallThick + lidMargin - totalFingerWellDepth + 3;\nlidLength = caseLength - thumbBevelLength - wallThick + 2*lidMargin;\n\n\/\/ button well with origin at the center of the base of the switch\n\/\/ legs of the switch run along the x axis\nmodule pushButtonWell(depth) {\n translate([-pushButtonWellWidth\/2, -pushButtonWellWidth\/2, 0]) {\n\n\t\t\/\/ square well for body of switch\n cube([pushButtonWellWidth,pushButtonWellWidth, depth]);\n\n\t\t\/\/ channels for legs\/wires of switch\n translate([0,0,-pushButtonLegLength]) {\n translate([-1,0,0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n translate([pushButtonWellWidth-1,0, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n } \n translate([pushButtonWellWidth-1,pushButtonWellWidth-2, 0]) {\n cube([2,2,depth+pushButtonLegLength]);\n }\n }\t\t\n }\n\n \/\/ rectangular well for button body, and stabilizer wells\n translate([-buttonLength\/2,-buttonWidth\/2,pushButtonWellDepth]) {\n cube([buttonLength,buttonWidth,buttonThick+buttonPressDepth+10]);\n\n translate([0,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n\n translate([buttonLength-buttonStabilizerWellWidth,0,-pushButtonWellDepth]) {\n cube([buttonStabilizerWellWidth, buttonWidth, pushButtonWellDepth]);\n\t\t}\n }\n}\n\nmodule fingerWell(depth, radius) {\n translate([radius - depth,0,0]) {\n cylinder(h=caseHeight,r=radius);\n }\n\n translate([radius - depth, 0, wallThick]) {\n cylinder(h=wallThick+.001, r1=radius-wallThick\/2, r2=radius+wallThick\/2); \n }\n\n translate([radius - depth,0,0]) {\n cylinder(h=wallThick+.001, r2=radius-wallThick\/2, r1=radius+wallThick\/2); \n }\n}\n\n\/\/ create the lid\n\/\/ buffer: hyper-extends the lid, for better rendering\n\/\/ shrinkage: clearance around the edges of the lid\nmodule lid(buffer, shrinkage) {\n translate([0,0,-buffer]) {\n translate([wallThick-lidMargin+shrinkage,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth,lidLength,lidThick+buffer]);\n }\n translate([thumbBevelWidth,wallThick-lidMargin+shrinkage,0]) {\n cube([lidWidth-thumbBevelWidth+wallThick,cavityLength+(lidMargin-shrinkage)*2,lidThick+buffer]);\n }\n\n \/\/ note: currently no \"shrinkage\" on this edge\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n rotate([180,0,0]) {\n translate([-27,-wallThick,pushButtonBaseThick]) {\n translate([0,0,-6]) {\n cube([47,lidThick+buffer,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n\nmodule screwHoles() {\n translate([0,0,-1]) {\n translate([15,caseLength-thumbBevelLength-wallThick+9,0]) { cylinder(h=caseHeight+2,r=1.5); }\n\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*2,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*4,0]) { cylinder(h=caseHeight+2,r=1.5); }\n translate([wallThick+cavityWidth+3.5,caseLength-fingerHeightOffset-fingerRad*6,0]) { cylinder(h=caseHeight+2,r=1.5); }\n }\n}\n\ndifference() {\n \/\/ basic shape of the case\n union() {\n\t\t\/\/ box with thumb bevel\n difference() {\n translate([wallThick, wallThick,0]) {\n cube([caseWidth-caseHeight,caseLength-caseHeight,caseHeight]);\n }\n translate([thumbBevelWidth,caseLength-wallThick,-1]) {\n rotate([0,0,thumbBevelAngle]) {\n rotate([0,-90,0]) { \n cube([caseHeight+1, 100, thumbBevelStretch]);\n }\n }\n }\n }\n\n translate([wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-thumbBevelLength-wallThick, r=wallThick);\n }\n rotate([0,90,0]) {\n cylinder(h=caseWidth-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,wallThick,wallThick]) {\n sphere(wallThick);\n rotate([-90,0,0]) {\n cylinder(h=caseLength-caseHeight, r=wallThick);\n }\n }\n translate([caseWidth-wallThick,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n }\n\n\t\t\/\/ thumb bevel\n\t\ttranslate([wallThick,caseLength-thumbBevelLength,wallThick]) {\n sphere(wallThick);\n }\n translate([thumbBevelWidth,caseLength-wallThick,wallThick]) {\n sphere(wallThick);\n rotate([0,90,0]) {\n cylinder(h=caseWidth-thumbBevelWidth-wallThick, r=wallThick);\n }\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) { \n cylinder(h=thumbBevelStretch, r=wallThick);\n }\n }\n }\n }\n\n \/\/ inner compartment\n translate([wallThick,wallThick,0]) {\n cube([cavityWidth,caseLength-thumbBevelLength-wallThick,caseHeight-floorThick]);\n }\n translate([thumbBevelWidth+2,wallThick,0]) {\n cube([cavityWidth-thumbBevelWidth+wallThick-2,cavityLength,caseHeight-floorThick]);\n }\n\n \/\/ depression for lid\n lid(1,0);\n\n screwHoles();\n\n \/\/ finger button wells\n for (i = [0:3]) {\n translate([\n caseWidth,\n caseLength - fingerHeightOffset - fingerRad * (1 + 2 * i),\n 0]) {\n\n fingerWell(fingerWellDepth, fingerRad);\n\n \/\/ well and channels for push button switch and wires\n translate([-totalFingerWellDepth,0,caseHeight\/2]) {\n rotate([0,90,0]) { rotate([0,0,90]) {\n pushButtonWell(pushButtonWellDepth+fingerRad);\n }}\n }\n } \n }\n\n \/\/ thumb button well\n translate([thumbBevelWidth,caseLength-wallThick,caseHeight]) {\n rotate([0,0,180+thumbBevelAngle]) {\n rotate([0,90,0]) {\n translate([0,0,thumbKeyOffset]) {\n rotate([0,90,0]) { rotate([0,0,-90]) {\n \/\/cube([50,100,200]);\n\n translate([wallThick,0,0]) {\n fingerWell(thumbWellDepth, thumbWellRadius);\n }\n }}\n\n rotate([0,90,-90]) {\n translate([0,wallThick,wallThick-totalThumbWellDepth]) {\n pushButtonWell(pushButtonWellDepth+100);\n\n rotate([180,0,0]) {\n translate([-27,-wallThick-1,pushButtonBaseThick]) {\n cube([39,caseHeight-floorThick+1,15]);\n cube([22,caseHeight-floorThick+1,20]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n \/\/ hole for status LED\n translate([cavityWidth+wallThick-ledRimRadius-3,caseLength+1,wallThick]) {\n \t rotate(a=[90,0,0]) {\n cylinder(h=wallThick+2,r=ledDomeRadius);\n\n translate([0,0,wallThick]) {\n cylinder(h=10+1,r=ledRimRadius);\n }\n } \n }\n\n \/\/ hole for battery charger headers\n\ttranslate([wallThick,0,caseHeight-floorThick-chargerHeaderLength-2*error]) {\n cube([chargerHeaderWidth+2*error,wallThick,chargerHeaderLength+2*error]);\n }\n\n \/\/ hole for SPDT Mini Power Switch\n translate([powerSwitchOffset,0,wallThick-powerSwitchWidth\/2-error]) {\n cube([powerSwitchLength+2*error,wallThick,powerSwitchWidth+2*error]);\n }\n\n \/\/ hole for USB port\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,0,caseHeight-floorThick-nanoHeightToUsbBase-nanoUsbHeight-clearance]) {\n cube([nanoUsbWidth+2*clearance,wallThick,nanoUsbHeight+clearance]);\n }\n \/\/ trim off the thin remainder above the USB port which would be problematic to print,\n \/\/ and make it harder to get the Nano into its socket anyway\n translate([wallThick+cavityWidth-nanoLeftMargin-nanoWidth\/2-nanoUsbWidth\/2-clearance,wallThick-lidMargin,0]) {\n cube([nanoUsbWidth+2*clearance,lidMargin,2]);\n }\n}\n\n\/\/ lid\ntranslate([0,0,caseHeight + 2]) {\n difference() {\n \/\/ the gap of 0.4 was determined by taking into account the 0.15mm accuracy of\n \/\/ the device and the 0.15% error by longest axis of the material, keeping in mind\n\t \/\/ that there are always a pair of gaps across the lid from each other.\n \/\/ 0.4mm is actually larger than necessary in the horizontal (narrower) dimension.\n lid(0,0.4);\n\n screwHoles();\n }\n}\n\n\/\/ buttons\n\/\/ Note: the buttons are oriented so as to make the longest surfaces the most smooth\ntranslate([-5,0,10]) {\n for (i = [0:4]) {\n translate([0,i*(buttonLength+2),0]) { rotate([90,180,-90]) {\n \/\/cube([10,20,40]);\n\n difference() {\n union() {\n translate([0,buttonWidth\/2,buttonWidth\/2]) {\n rotate([0,90,0]) { cylinder(h=buttonLength,r=buttonWidth\/2); }\n }\n\n translate([0,0,buttonWidth\/2]) {\n cube([buttonLength,buttonWidth,buttonThick-buttonWidth\/2]);\n }\n\n translate([0,0,buttonThick]) {\n cube([buttonStabilizerWellWidth, buttonWidth, buttonStabilizerRodHeight]);\n\t\t }\n\n translate([buttonLength-buttonStabilizerWellWidth,0,buttonThick]) {\n cube([buttonStabilizerWellWidth, buttonWidth, buttonStabilizerRodHeight]);\n\t\t }\n }\n\n translate([buttonLength\/2,buttonWidth\/2,buttonThick-0.5]) {\n cylinder(h=1,r=pushButtonRadius);\n }\n }\n }} \n }\n}\n\n\/\/ electronic components\ntranslate([wallThick,wallThick,0]) {\n \/\/ power switch\n translate([powerSwitchOffset-wallThick,0,wallThick-powerSwitchWidth\/2-error]) {\n translate([-containmentWallThick,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([powerSwitchLength+2*error,0,0]) {\n cube([containmentWallThick,powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick+powerSwitchWidth\/2+error]);\n }\n translate([-containmentWallThick,0,powerSwitchWidth+2*error]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),powerSwitchDepth-wallThick+error+containmentWallThick,caseHeight-floorThick-wallThick-powerSwitchWidth\/2-error]);\n }\n translate([-containmentWallThick,powerSwitchDepth-wallThick+error,powerSwitchWidth+2*error-1]) {\n cube([powerSwitchLength+2*(containmentWallThick+error),containmentWallThick,1]);\n }\n }\n\n \/\/ Arduino Nano v3.0\n translate([cavityWidth-nanoLeftMargin-nanoWidth,0,0]) {\n if (includeInternalComponents) {\n translate([0,0,-10]) {\n cube([nanoWidth,nanoLength,nanoHeightWithoutUsb]);\n }\n }\n\n translate([0,0,caseHeight-floorThick-nanoHeightToUsbBase-error]) {\n translate([-containmentWallThick-clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([nanoWidth+clearance,0,0]) {\n cube([containmentWallThick,nanoLength+clearance+containmentWallThick,nanoHeightToUsbBase+error]);\n }\n translate([-containmentWallThick-clearance,nanoLength+clearance,0]) {\n cube([nanoWidth+2*(clearance+containmentWallThick),containmentWallThick,nanoHeightToUsbBase+error]);\n }\n }\n }\n\n if (includeInternalComponents) {\n \/\/ Surface Transducer - Small\n translate([thumbBevelWidth-wallThick+4,caseLength-2*wallThick-21.4-4,-10]) {\n cube([13.8,21.4,7.9]);\n }\n \/\/ Bluetooth Modem - BlueSMiRF Silver -- 42.0 x 16.0 x 3.9\n translate([1,31,-10]) { cube([16,42,3.9]); }\n \/\/ Polymer Lithium Ion Battery - 110mAh\n translate([-40,3,-10]) { cube([12,28,5.7]); }\n \/\/ Polymer Lithium Ion Battery - 400mAh\n\ttranslate([18,47,-10]) { cube([25,35,5]); }\n \/\/ Triple Axis Accelerometer & Gyro Breakout - MPU-6050\n translate([1,4,-10]) { cube([15.5, 25.7, 2.5]); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"18a4cc91ddf09eedec33efb1c78accb3ad203a3f","subject":"Add possibility to use colsons","message":"Add possibility to use colsons\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/bar_mount.scad","new_file":"Hardware\/bar_mount.scad","new_contents":"tube_diameter = 28;\nspace_margin = 1;\nthickness = 2;\nscrew_diameter = 5;\nscrew_head_thickness = 2;\n\na = tube_diameter + 2* space_margin +2*thickness;\ndifference(){\n\tunion(){\n\t\t\/\/Main part\n\t\tdifference(){\n\t\tcube(size=[a,a,a+4], center = true);\n\t\ttranslate([a\/4, 0,0]) cube(size=[4,2*a, 2*a], center = true);\n\t\ttranslate([-a\/4, 0,0]) cube(size=[4,2*a, 2*a], center = true);\n\t\t}\n\t\t\/\/Screw tube\n\t\ttranslate([0, a\/2+screw_diameter\/2,0]) difference(){\n\t\t\tcylinder(r = screw_diameter\/2+thickness, h = a, center=\t\t\t\ttrue);\n\t\t\tcylinder(r = screw_diameter\/2, h = a, center=true);\n\t\t}\n\t\t\/\/Second screw tube\n\t\ttranslate([0, -a\/2-screw_diameter\/2,0]) difference(){\n\t\t\tcylinder(r = screw_diameter\/2+thickness, h = a, center=\t\t\t\ttrue);\n\t\t\tcylinder(r = screw_diameter\/2, h = a, center=true);\n\n\t\t}\n\trotate([0,90,0]) cylinder(r=tube_diameter\/2. + space_margin+thickness, h= a, center = \ttrue);\n\t}\n\trotate([0,90,0]) cylinder(r=tube_diameter\/2. + space_margin, h= 2*a, center = true);\n cube(size =[2*a, 2*a,tube_diameter\/5.], center = true);\n\ttranslate([0,-a\/2-screw_diameter\/2,a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,-a\/2-screw_diameter\/2,-a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,+a\/2+screw_diameter\/2,a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,+a\/2+screw_diameter\/2,-a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\t\n\t\/\/ To erase one half\n\ttranslate([0, 0, a]) cube([2*a,2*a,2*a], center = true);\n}\n\n\n","old_contents":"tube_diameter = 28;\nspace_margin = 1;\nthickness = 5;\nscrew_diameter = 5;\nscrew_head_thickness = 5;\n\na = tube_diameter + 2* space_margin +2*thickness;\ndifference(){\n\tunion(){\n\t\t\/\/Main part\n\t\tcube(size=[a,a,a], center = true);\n\t\t\n\t\t\/\/Screw tube\n\t\ttranslate([0, a\/2+screw_diameter\/2,0]) difference(){\n\t\t\tcylinder(r = screw_diameter\/2+thickness, h = a, center=\t\t\t\ttrue);\n\t\t\tcylinder(r = screw_diameter\/2, h = a, center=true);\n\t\t}\n\t\t\/\/Second screw tube\n\t\ttranslate([0, -a\/2-screw_diameter\/2,0]) difference(){\n\t\t\tcylinder(r = screw_diameter\/2+thickness, h = a, center=\t\t\t\ttrue);\n\t\t\tcylinder(r = screw_diameter\/2, h = a, center=true);\n\n\t\t}\n\t}\n\trotate([0,90,0]) cylinder(r=tube_diameter\/2. + space_margin, h= 2*a, center = true);\n cube(size =[2*a, 2*a,tube_diameter\/5.], center = true);\n\ttranslate([0,-a\/2-screw_diameter\/2,a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,-a\/2-screw_diameter\/2,-a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,+a\/2+screw_diameter\/2,a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n\ttranslate([0,+a\/2+screw_diameter\/2,-a\/2]) cylinder(r = screw_diameter\/2+thickness+0.1, h = 2*screw_head_thickness, center=\t\t\t\ttrue);\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"418feedafb63047fb349848f847d015569425565","subject":"xaxis\/carriage+extruder: more wip","message":"xaxis\/carriage+extruder: more wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cuberounda([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*cuberounda([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cuberounda([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n cuberounda([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#cuberounda([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n cuberounda([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n cuberounda([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*cuberounda([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*cuberounda([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*cuberounda([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_shaft_d = 5*mm;\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n cuberounda([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*cuberounda([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-4*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_guilder_bearing = bearing_625;\nextruder_b_bearing = bearing_MR105;\nextruder_hotmount_clamp_thread = ThreadM3;\nmodule extruder_b(show_vitamins=false)\n{\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n \/\/ guidler mount\n guidler_arm_len = 15*mm;\n translate([hobbed_gear_d_inner\/2,0,guidler_arm_len])\n {\n difference()\n {\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n }\n }\n\n difference()\n {\n hull()\n \/*union()*\/\n {\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=lookup(ThreadSize, extruder_hotmount_clamp_thread)+3*mm, h=extruder_b_w);\n }\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[-1,1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([extruder_guilder_bearing[1]+1*mm,extruder_guilder_bearing[2]+1*mm,extruder_guilder_bearing[1]*2], align=[x,0,1]);\n cylindera(d=extruder_guilder_bearing[1]+1*mm, h=extruder_guilder_bearing[2]+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1);\n }\n\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n \n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base();\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n\n \/*if(false)*\/\n translate(extruder_offset)\n {\n extruder_b(show_vitamins=true);\n\n translate(extruder_offset_a)\n {\n %extruder_a(show_vitamins=true);\n }\n }\n\n \/*translate([0,-42,38])*\/\n \/*rotate([0,0,90])*\/\n \/*translate([0,-1,-42])*\/\n \/*translate([-83,25,-42])*\/\n \/*rotate([90,0,0])*\/\n \/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\n\/*if(false)*\/\n{\n\/*extruder_a(show_vitamins=true);*\/\n x_carriage();\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n cuberounda([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*cuberounda([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n cuberounda([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n cuberounda([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#cuberounda([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n cuberounda([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n cuberounda([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*cuberounda([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*cuberounda([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*cuberounda([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_shaft_d = 5*mm;\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n cuberounda([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*cuberounda([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-4*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_guilder_bearing = bearing_625;\nextruder_b_bearing = bearing_MR105;\nmodule extruder_b(show_vitamins=false)\n{\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n translate([0,-extruder_b_bearing[2]-5*mm,0])\n cylindera(d=extruder_b_bearing[1]+5*mm, h=abs(extruder_filapath_offset[1]), align=[0,-1,0], orient=[0,1,0]);\n\n }\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0]+3*mm, h=extruder_b_w);\n }\n }\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+1*mm, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n scale([1.03,1,1.03])\n bearing(extruder_b_bearing, override_h=6*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([hobbed_gear_d_inner\/2+extruder_guilder_bearing[1]\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([extruder_guilder_bearing[1]+1*mm,extruder_guilder_bearing[2]+1*mm,extruder_guilder_bearing[1]*2], align=[0,0,1]);\n cylindera(d=extruder_guilder_bearing[1]+1*mm, h=extruder_guilder_bearing[2]+1*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=extruder_b_w+1);\n }\n\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n \n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base();\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n\n \/*if(false)*\/\n translate(extruder_offset)\n {\n extruder_b(show_vitamins=true);\n\n translate(extruder_offset_a)\n {\n %extruder_a(show_vitamins=true);\n }\n }\n\n \/*translate([0,-42,38])*\/\n \/*rotate([0,0,90])*\/\n \/*translate([0,-1,-42])*\/\n \/*translate([-83,25,-42])*\/\n \/*rotate([90,0,0])*\/\n \/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\n\/*if(false)*\/\n{\n\/*extruder_a(show_vitamins=true);*\/\n x_carriage();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9ed7b04643612879a5c4ba29eb953892f8e97aa9","subject":"Correcting missing tab","message":"Correcting missing tab\n","repos":"bmsleight\/lasercut,bmsleight\/lasercut","old_file":"lasercut.scad","new_file":"lasercut.scad","new_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false, milling_bit=milling_bit);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true, milling_bit=0)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=milling_bit);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,thickness,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + kerfSize + bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([-bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,thickness,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + kerfSize + bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n translate([-bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=4,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4],\n milling_bit = milling_bit);\n }\n \n if (sides>5)\n {\n # translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","old_contents":"UP = 0;\nDOWN = 180;\nLEFT = 90;\nRIGHT = 270;\nMID = 360;\nkerf=0.0;\/\/ Hacky global for kerf\n\ngenerate = $generate == undef ? 0: $generate; \n\nif (generate == 1)\n{\n \/\/ openscad examples.scad -D generate=1 -o \/tmp\/d.csg 2>&1 >\/dev\/null | sed 's\/ECHO: \\\"\\[LC\\] \/\/' | sed 's\/\"$\/\/' | sed '$a;' >.\/generate.scad ; openscad .\/generate.scad -o generate.dxf\n \/\/ (from http:\/\/forum.openscad.org\/Sharing-Dump-echo-output-to-a-file-td12529.html)\n\/\/ echo(\"[LC] use ; \\nprojection(cut = false) \\n\\t\");\n}\n\n\nmodule lasercutoutSquare(thickness, x=0, y=0, \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n points = [[0,0], [x,0], [x,y], [0,y], [0,0]];\nlasercutout(thickness=thickness, \n points = points, \n simple_tabs = simple_tabs, \n simple_tab_holes = simple_tab_holes, \n captive_nuts = captive_nuts, \n captive_nut_holes = captive_nut_holes,\n finger_joints = finger_joints,\n bumpy_finger_joints = bumpy_finger_joints,\n screw_tabs= screw_tabs, screw_tab_holes= screw_tab_holes,\n twist_holes=twist_holes, twist_connect=twist_connect,\n clips=clips, clip_holes=clip_holes,\n circles_add = circles_add,\n circles_remove = circles_remove,\n slits = slits,\n cutouts = cutouts,\n flat_adjust = flat_adjust,\n milling_bit = milling_bit\n );\n}\n\nmodule lasercutout(thickness, points= [], \n simple_tabs=[], simple_tab_holes=[], \n captive_nuts=[], captive_nut_holes = [],\n finger_joints = [],\n bumpy_finger_joints = [],\n screw_tabs=[], screw_tab_holes=[],\n twist_holes=[], twist_connect=[],\n clips=[], clip_holes=[],\n circles_add = [],\n circles_remove = [],\n slits = [],\n cutouts = [],\n flat_adjust = [],\n milling_bit = 0.0,\n)\n{\n path_total = len(points);\n path = [ for (p = [0 : 1 : path_total]) p ];\n\n function max_y(points) = max([for (a = [0:1:len(points)-1]) points[a][1]]); \n function min_y(points) = min([for (a = [0:1:len(points)-1]) points[a][1]]); \n function max_x(points) = max([for (a = [0:1:len(points)-1]) points[a][0]]); \n function min_x(points) = min([for (a = [0:1:len(points)-1]) points[a][0]]); \n \n max_y = max_y(points);\n min_y = min_y(points);\n max_x = max_x(points);\n min_x = min_x(points);\n \n difference() \n { \n union() \n {\n linear_extrude(height = thickness , center = false) polygon(points=points, path=path);\n for (t = [0:1:len(simple_tabs)-1]) \n {\n simpleTab(simple_tabs[t][0], simple_tabs[t][1], simple_tabs[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutTab(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n } \n for (t = [0:1:len(circles_add)-1]) \n {\n circlesAdd(circles_add[t][0], circles_add[t][1], circles_add[t][2], thickness);\n } \n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(bumpy_finger_joints)-1]) \n {\n fingerJoint(bumpy_finger_joints[t][0], bumpy_finger_joints[t][1], bumpy_finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, bumps=true);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTab(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipTab(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n } \/\/ end union\n\n for (t = [0:1:len(simple_tab_holes)-1]) \n {\n simpleTabHole(simple_tab_holes[t][0], simple_tab_holes[t][1], simple_tab_holes[t][2], thickness);\n }\n for (t = [0:1:len(captive_nuts)-1]) \n {\n captiveNutBoltHole(captive_nuts[t][0], captive_nuts[t][1], captive_nuts[t][2], thickness);\n }\n for (t = [0:1:len(captive_nut_holes)-1]) \n {\n captiveNutHole(captive_nut_holes[t][0], captive_nut_holes[t][1], captive_nut_holes[t][2], thickness);\n } \n for (t = [0:1:len(twist_holes)-1]) \n {\n twistHole(twist_holes[t][0], twist_holes[t][1], twist_holes[t][2], twist_holes[t][3], thickness);\n } \n for (t = [0:1:len(twist_connect)-1]) \n {\n twistConnect(twist_connect[t][0], twist_connect[t][1], twist_connect[t][2], thickness, max_y, min_y, max_x, min_x);\n } \n for (t = [0:1:len(clips)-1]) \n {\n clipInner(clips[t][0], clips[t][1], clips[t][2], thickness);\n } \n for (t = [0:1:len(clip_holes)-1]) \n {\n clipHole(clip_holes[t][0], clip_holes[t][1], clip_holes[t][2], thickness);\n } \n for (t = [0:1:len(circles_remove)-1]) \n {\n circlesRemove(circles_remove[t][0], circles_remove[t][1], circles_remove[t][2], thickness);\n } \n for (t = [0:1:len(slits)-1]) \n {\n simpleSlit(slits[t][0], slits[t][1], slits[t][2], slits[t][3], thickness);\n }\n for (t = [0:1:len(cutouts)-1]) \n {\n simpleCutouts(cutouts[t][0], cutouts[t][1], cutouts[t][2], cutouts[t][3], thickness);\n }\n for (t = [0:1:len(screw_tabs)-1]) \n {\n screwTabHoleForScrew(screw_tabs[t][0], screw_tabs[t][1], screw_tabs[t][2], screw_tabs[t][3], thickness);\n }\n for (t = [0:1:len(screw_tab_holes)-1]) \n {\n screwTabHole(screw_tab_holes[t][0], screw_tab_holes[t][1], screw_tab_holes[t][2], screw_tab_holes[t][3], thickness);\n }\n \/\/ Used for milling (not lasercutting) fingerJoint, \n if (milling_bit > 0.0)\n {\n for (t = [0:1:len(finger_joints)-1]) \n {\n fingerJoint(finger_joints[t][0], finger_joints[t][1], finger_joints[t][2], thickness, max_y, min_y, max_x, min_x, not_mill=false);\n } \n }\n }\n \n if (flat_adjust)\n {\n if ($children) translate([0 + flat_adjust[0], max_y(points) + thickness*3 + flat_adjust[1], 0])\n children();\n }\n else\n {\n if ($children) translate([0, max_y(points) + thickness*2.5, 0])\n children(); \n }\n\n if (generate == 1)\n {\n echo(str(\"[LC] lasercutout(thickness = \",thickness,\", \\n points = \",points));\n if(simple_tabs)\n echo(str(\"[LC] , simple_tabs = \", simple_tabs));\n if(simple_tab_holes)\n echo(str(\"[LC] , simple_tab_holes = \", simple_tab_holes));\n if(captive_nuts)\n echo(str(\"[LC] , captive_nuts = \", captive_nuts));\n if(captive_nut_holes)\n echo(str(\"[LC] , captive_nut_holes = \", captive_nut_holes));\n if(finger_joints)\n echo(str(\"[LC] , finger_joints = \", finger_joints));\n if(bumpy_finger_joints)\n echo(str(\"[LC] , bumpy_finger_joints = \", bumpy_finger_joints));\n if(screw_tabs)\n echo(str(\"[LC] , screw_tabs = \", screw_tabs));\n if(screw_tab_holes)\n echo(str(\"[LC] , screw_tab_holes = \", screw_tab_holes));\n if(twist_holes)\n echo(str(\"[LC] , twist_holes = \", twist_holes));\n if(twist_connect)\n echo(str(\"[LC] , twist_connect = \", twist_connect));\n if(clips)\n echo(str(\"[LC] , clips = \", clips));\n if(clip_holes)\n echo(str(\"[LC] , clip_holes = \", clip_holes));\n if(circles_add)\n echo(str(\"[LC] , circles_add = \", circles_add));\n if(circles_remove)\n echo(str(\"[LC] , circles_remove = \", circles_remove));\n if(slits)\n echo(str(\"[LC] , slits = \", slits));\n if(cutouts)\n echo(str(\"[LC] , cutouts = \", cutouts));\n if(flat_adjust)\n echo(str(\"[LC] , flat_adjust = \", flat_adjust));\n if(milling_bit>0)\n echo(str(\"[LC] , milling_bit = \", milling_bit));\n echo(\"[LC] ) \\n\");\n }\n}\n\n\n\nmodule simpleTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-thickness\/2,0,0]) cube([thickness, thickness, thickness]); \n}\n\nmodule simpleTabHole(angle, x, y, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([thickness, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, screw*2, thickness*3]); \n }\n}\n\nmodule captiveNutBoltHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) union() \n {\n translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*4, thickness*3]); \n translate([-thickness\/2-thickness,thickness,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule fingerJoint(angle, start_up, fingers, thickness, max_y, min_y, max_x, min_x, bumps = false, not_mill=true)\n{\n if ( angle == UP )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = min_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n if ( angle == DOWN )\n {\n range_min = min_x; \n range_max = max_x; \n t_x = max_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n if ( angle == LEFT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = min_x;\n t_y = min_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n if ( angle == RIGHT )\n {\n range_min = min_y; \n range_max = max_y; \n t_x = max_x;\n t_y = max_y;\n if(not_mill)\n {\n fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n else\n {\n fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = bumps);\n }\n }\n\n}\n\n\nmodule fingers(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bumps = false)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2) + kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,0,0]) \n {\n cube([ (range_max-range_min)\/(fingers*2)+kerfSize, thickness*2, thickness]);\n if(bumps == true)\n {\n if (i < (range_max - (range_max-range_min)\/fingers ))\n {\n translate([(range_max-range_min)\/(fingers*2), thickness*1.5, 0]) cylinder(h=thickness, r=thickness\/10);\n }\n }\n }\n }\n }\n }\n\n}\n\nmodule fingers_mill(angle, start_up, fingers, thickness, range_min, range_max, t_x, t_y, bit=6.35\/2)\n{\n\n \/\/ The tweaks to y translate([0, -thickness,0]) ... thickness*2 rather than *1\n \/\/ Are to avoid edge cases and make the dxf export better.\n \/\/ All fun\n translate([t_x, t_y,0]) rotate([0,0,angle]) translate([0, -thickness,0])\n {\n for ( p = [ 0 : 1 : fingers-1] )\n\t\t{\n\t\t\n\t\t\tkerfSize = (p > 0) ? kerf\/2 : kerf\/2 ;\n\t\t\tkerfMove = (p > 0) ? kerf\/4 : 0;\n\t\t\t\n\t\t\ti=range_min + ((range_max-range_min)\/fingers)*p;\n if(start_up == 1) \n {\n\t\t\t\n translate([i-kerfMove,thickness,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + kerfSize + bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true );\n translate([-bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n }\n }\n else \n {\n translate([i+(range_max-range_min)\/(fingers*2)-kerfMove,thickness,0]) \n {\n translate([(range_max-range_min)\/(fingers*2) + kerfSize + bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n translate([-bit\/2,0,0]) cylinder(h=thickness*4, d=bit, center=true);\n }\n }\n }\n }\n\n}\n\n\n\nmodule screwTab(angle, x, y, screw, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) translate([-screw\/2,0,0]) cube([screw*2, thickness+screw*2, thickness]); \n}\n\nmodule screwTabHoleForScrew(angle, x, y, screw, thickness)\n{\n \/\/ not to be confused with screwTabHole\n translate([x,y,0]) rotate([0,0,angle]) translate([screw\/2,thickness+screw,-thickness]) cylinder(h=thickness*3, r=screw\/2); \n}\n\nmodule screwTabHole(angle, x, y, screw, thickness)\n{\n \/\/ Special case does not go past edge - so make only 1 thickness y\n if (angle == 360)\n {\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([screw*2, thickness, thickness*3]); \n }\n else\n {\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, thickness*2, thickness*3]); \n }\n}\n\n\nmodule captiveNutTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2+thickness*2,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n translate([-thickness\/2-thickness*4,-thickness,0]) cube([thickness*3, thickness*2, thickness]); \n }\n}\n\nmodule captiveNutHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2,-thickness*2,-thickness]) cube([thickness, thickness, thickness*3]); \n translate([-thickness\/2+thickness*2,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n translate([-thickness\/2-thickness*4,-thickness*2,-thickness]) cube([thickness*3, thickness, thickness*3]); \n }\n}\n\nmodule twistHole(angle, x, y, width, thickness)\n{\n\/\/ http:\/\/msraynsford.blogspot.co.uk\/2012\/06\/panel-joinery-10.html\n translate([x,y,0]) rotate([0,0,angle-90]) union()\n {\n cube([width, thickness, thickness*3], center=true); \n difference()\n {\n \/\/ Need some trig, radius is hypo of triangle\n \/\/ Other sides are thinkness\/2 and thinkness*3\n \/\/ \n \/\/ \n radius = sqrt( ((thickness\/2)*(thickness\/2)) + (thickness*1.5*thickness*1.5) ); \n translate([0,0, -thickness]) cylinder(h=thickness*3, r=radius);\n translate([-thickness*3\/2,thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n translate([thickness*3\/2,-thickness,0]) cube([thickness*2, thickness, thickness*3], center=true); \n }\n }\n}\n\nmodule twistConnect(angle, x, y, thickness, max_y, min_y, max_x, min_x)\n{\n \/\/ Really should do trianometry for non-90 Angles, but hey ho\n if( (angle == LEFT) || (angle == RIGHT) )\n {\n translate([0,y,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_x - min_x;\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n if( (angle == UP) || (angle == DOWN) )\n {\n translate([x,0,-thickness]) rotate([0,0,angle+90]) union()\n {\n gap = max_y - min_y;\n echo(gap);\n translate([-gap\/2-(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n translate([+gap\/2+(thickness*3\/2),0,0]) cube([gap, thickness, thickness*3]); \n }\n }\n}\n\nmodule clipInner(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([-thickness\/2-1,0,0])\n {\n translate([-(1+thickness)\/2,-thickness*10,-thickness]) cube([1, thickness*11, thickness*3]);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n translate([(1+thickness)\/2+1-thickness+1,thickness-1,-thickness]) cube([thickness\/2, thickness, thickness*3]);\n translate([-thickness*3\/2,0,-thickness]) cube([thickness, thickness, thickness*3]);\n }\n }\n}\n\nmodule clipTab(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n \/\/ make off-center\n translate([-thickness\/2-1,0,0])\n {\n difference()\n {\n translate([0,thickness\/2,thickness\/2]) cube([thickness+1,thickness,thickness], center=true);\n translate([(1+thickness)\/2+1,-thickness*8,0]) linear_extrude(height = thickness*3, center = true) polygon(points=[[0,0],[0,9*thickness],[-(thickness-1), 9*thickness]]);\n }\n translate([-thickness,thickness,0]) linear_extrude(height = thickness) polygon(points=[[0,0],[thickness+1,0],[thickness,thickness-1],[1,thickness-1]]);\n }\n translate([0.5,0,0]) cube([thickness,thickness,thickness]);\n* cube([thickness*2+1,thickness,thickness], center=true); \n }\n}\n\nmodule clipHole(angle, x, y, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle]) union()\n {\n translate([0,-thickness\/2,thickness\/2]) cube([thickness*2+1,thickness,thickness*3], center=true);\n }\n}\n\nmodule circlesAdd(radius, x, y, thickness)\n{\n translate([x,y,0]) cylinder(h=thickness, r=radius);\n}\n\nmodule circlesRemove(radius, x, y, thickness)\n{\n translate([x,y,-thickness]) cylinder(h=thickness*3, r=radius);\n}\n\n\nmodule simpleSlit(angle, x, y, length, thickness)\n{\n translate([x,y,0]) rotate([0,0,angle-180]) translate([-thickness\/2,-thickness,-thickness]) cube([thickness, length+thickness, thickness*3]); \n}\n\nmodule simpleCutouts(x, y, width, height, thickness)\n{\n translate([x,y,0]) rotate([0,0,0]) translate([0,0,-thickness]) cube([width, height, thickness*3]); \n}\n\nmodule lasercutoutBox(thickness, x=0, y=0, z=0, sides=6, num_fingers=4,\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a=[],\n screw_tab_holes_a=[],\n twist_holes_a=[],\n clip_holes_a=[],\n circles_add_a=[],\n circles_remove_a=[],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n if (sides==4)\n {\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], ],\n ];\n translate([0,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n }\n if (sides==5)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] ],\n [[DOWN, -thickness\/2, 0], ],\n [[UP, -thickness\/2, z-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n \n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n }\n if (sides==6)\n {\n st = [\n [[DOWN, -thickness\/2, 0], [DOWN, -thickness\/2, y-thickness] , [RIGHT, x-thickness*2, -thickness\/2]],\n [[DOWN, -thickness\/2, 0], [RIGHT, x-thickness*2, -thickness\/2]],\n [[UP, -thickness\/2, z-thickness*2], [DOWN, x-thickness*1.5, 0], ],\n [[UP, z-thickness*1.5, y-thickness*2], ],\n ];\n fj = [\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 0, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 1, num_fingers], [DOWN, 1, num_fingers], [LEFT, 1, num_fingers], [RIGHT, 0, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n [ [UP, 0, num_fingers], [DOWN, 1, num_fingers], [LEFT, 0, num_fingers], [RIGHT, 1, num_fingers] ],\n ];\n translate([thickness,thickness,0]) lasercutoutBoxAdjustedFJ(thickness = thickness, x=x-thickness*2, y=y-thickness*2 , z=z-thickness*2, sides=sides, fj=fj, st=st,\n simple_tab_holes_a=simple_tab_holes_a, \n captive_nuts_a=captive_nuts_a, captive_nut_holes_a=captive_nut_holes_a,\n screw_tab_holes_a=screw_tab_holes_a,\n twist_holes_a=twist_holes_a,\n clip_holes_a=clip_holes_a,\n circles_add_a=circles_add_a,\n circles_remove_a=circles_remove_a,\n slits_a=slits_a,\n cutouts_a=cutouts_a,\n milling_bit = milling_bit\n );\n\n } \n}\n\n\nmodule lasercutoutBoxAdjustedFJ(thickness, x=0, y=0, z=0, sides=6, fj=[], st=[],\n simple_tab_holes_a=[], \n captive_nuts_a=[], captive_nut_holes_a = [],\n circles_add_a = [],\n circles_remove_a = [],\n slits_a = [],\n cutouts_a = [],\n milling_bit = 0.0\n)\n{\n\n translate([0,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[0], finger_joints = fj[0],\n simple_tab_holes=simple_tab_holes_a[0], captive_nuts=captive_nuts_a[0],\n captive_nut_holes = captive_nut_holes_a[0],\n screw_tab_holes = screw_tab_holes_a[0],\n twist_holes = twist_holes_a[0],\n clip_holes = clip_holes_a[0],\n circles_add = circles_add_a[0], circles_remove = circles_remove_a[0],\n slits = slits_a[0],\n cutouts = cutouts_a[0],\n milling_bit = milling_bit);\n\n translate([0,0,z+thickness]) lasercutoutSquare(thickness=thickness,x=x, y=y, simple_tabs = st[1], finger_joints = fj[1],\n simple_tab_holes=simple_tab_holes_a[1], captive_nuts=captive_nuts_a[1],\n captive_nut_holes = captive_nut_holes_a[1],\n screw_tab_holes = screw_tab_holes_a[1],\n twist_holes = twist_holes_a[1],\n clip_holes = clip_holes_a[1],\n circles_add = circles_add_a[1], circles_remove = circles_remove_a[1],\n slits = slits_a[1],\n cutouts = cutouts_a[1],\n milling_bit = milling_bit);\n\n translate([0,0,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, finger_joints = fj[2],\n simple_tab_holes=simple_tab_holes_a[2], captive_nuts=captive_nuts_a[2],\n captive_nut_holes = captive_nut_holes_a[2],\n screw_tab_holes = screw_tab_holes_a[2],\n twist_holes = twist_holes_a[2],\n clip_holes = clip_holes_a[2],\n circles_add = circles_add_a[2], circles_remove = circles_remove_a[2],\n slits = slits_a[2],\n cutouts = cutouts_a[2],\n milling_bit = milling_bit);\n\n translate([0,y+thickness,thickness]) rotate([90,0,0]) lasercutoutSquare(thickness=thickness,x=x, y=z, simple_tabs = st[2], \n finger_joints = fj[3],\n simple_tab_holes=simple_tab_holes_a[3], captive_nuts=captive_nuts_a[3],\n captive_nut_holes = captive_nut_holes_a[3],\n screw_tab_holes = screw_tab_holes_a[3],\n twist_holes = twist_holes_a[3],\n clip_holes = clip_holes_a[3],\n circles_add = circles_add_a[3], circles_remove = circles_remove_a[3],\n slits = slits_a[3],\n cutouts = cutouts_a[3],\n milling_bit = milling_bit\n );\n \n if (sides>4)\n {\n translate([0,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, finger_joints = fj[4],\n simple_tab_holes=simple_tab_holes_a[4], captive_nuts=captive_nuts_a[4],\n captive_nut_holes = captive_nut_holes_a[4],\n screw_tab_holes = screw_tab_holes_a[4],\n twist_holes = twist_holes_a[4],\n clip_holes = clip_holes_a[4],\n circles_add = circles_add_a[4], circles_remove = circles_remove_a[4],\n slits = slits_a[4],\n cutouts = cutouts_a[4]);\n }\n \n if (sides>5)\n {\n translate([x+thickness,0,thickness]) rotate([0,-90,0]) lasercutoutSquare(thickness=thickness,x=z, y=y, \n simple_tabs = st[3], finger_joints = fj[5],\n simple_tab_holes=simple_tab_holes_a[5], captive_nuts=captive_nuts_a[5],\n captive_nut_holes = captive_nut_holes_a[5],\n screw_tab_holes = screw_tab_holes_a[5],\n twist_holes = twist_holes_a[5],\n clip_holes = clip_holes_a[5],\n circles_add = circles_add_a[5], circles_remove = circles_remove_a[5],\n slits = slits_a[5],\n cutouts = cutouts_a[5],\n milling_bit = milling_bit);\n }\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"048f141b418b109968e5ebab6b5b175600dcf4a0","subject":"Update","message":"Update\n","repos":"ksuszka\/3d-projects","old_file":"small\/car_sensor_brackets.scad","new_file":"small\/car_sensor_brackets.scad","new_contents":"\nFFF=[false,false,false];FFT=[false,false,true];\nFTF=[false,true,false];FTT=[false,true,true];\nTFF=[true,false,false];TFT=[true,false,true];\nTTF=[true,true,false];TTT=[true,true,true];\nmodule cube2(size, center) {\n translate([\n center[0] ? -size[0]\/2 : 0,\n center[1] ? -size[1]\/2 : 0,\n center[2] ? -size[2]\/2 : 0]) cube(size);\n}\nmodule mirror_x() {\n for(a=[0,1])mirror([a,0,0])children();\n}\nmodule mirror_y() {\n for(a=[0,1])mirror([0,a,0])children();\n}\nmodule mirror_z() {\n for(a=[0,1])mirror([0,0,a])children();\n}\n\n\nmodule switch_bracket() {\n dist_x=141\/2;\n hook_x=34;\n points1=[[dist_x,hook_x],[dist_x,hook_x+47.5],[-dist_x,hook_x],[-dist_x,hook_x+47.5]];\n holes1=[[dist_x,hook_x],[-dist_x,hook_x+36.8],[-dist_x,hook_x],[dist_x,hook_x+47.5]];\n holes2=[[50,0],[0,0],[-50,0]];\n points=concat(points1,holes2);\n module joint(array, i1, i2) {\n hull() {\n translate(array[i1]) cylinder(d=12,h=4);\n translate(array[i2]) cylinder(d=12,h=4);\n }\n }\n difference() {\n union() {\n joint(points, 0, 1);\n joint(points, 1, 3);\n joint(points, 3, 2);\n joint(points, 2, 6);\n joint(points, 6, 5);\n joint(points, 5, 4);\n joint(points, 4, 0);\n }\n \n for(xy=holes2)translate(xy)cylinder(d=3.2,h=20,center=true,$fn=24);\n for(xy=holes1)translate(xy) {\n cylinder(d=3.2,h=20,center=true,$fn=24);\n translate([0,0,-0.01])cylinder(d1=6.2,d2=3.2,h=3,$fn=24);\n }\n }\n}\n\nmodule realsense_bracket() {\n distance_x=62.25\/2;\n difference() {\n union() {\n cube2([72,6,50-6],TFF);\n mirror_x()translate([25,-12.5])cube2([12,13,25-6-2],TFF);\n \n mirror_x()translate([distance_x,0])cube2([12,35,5],TFF);\n mirror_x()translate([distance_x+6,0])hull() {\n cube2([3,35,5],TFF);\n cube2([3,6,50-6],TFF);\n }\n }\n mirror_x()translate([50\/2,0,12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n translate([0,25-12.5+6])rotate([90,0])cylinder(d=6,h=25,$fn=36);\n }\n mirror_x()translate([45\/2,0,25+12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n }\n mirror_x() for(a=[10,20,30])translate([distance_x,a])cylinder(d=3.2,h=30,$fn=24,center=true);\n }\n}\n\nswitch_bracket();\n\/\/realsense_bracket();","old_contents":"\nFFF=[false,false,false];FFT=[false,false,true];\nFTF=[false,true,false];FTT=[false,true,true];\nTFF=[true,false,false];TFT=[true,false,true];\nTTF=[true,true,false];TTT=[true,true,true];\nmodule cube2(size, center) {\n translate([\n center[0] ? -size[0]\/2 : 0,\n center[1] ? -size[1]\/2 : 0,\n center[2] ? -size[2]\/2 : 0]) cube(size);\n}\nmodule mirror_x() {\n for(a=[0,1])mirror([a,0,0])children();\n}\nmodule mirror_y() {\n for(a=[0,1])mirror([0,a,0])children();\n}\nmodule mirror_z() {\n for(a=[0,1])mirror([0,0,a])children();\n}\n\n\nmodule switch_bracket() {\n points1=[[70,35],[70,35+48],[-70,35],[-70,35+48]];\n holes1=[[70,35],[70,35+37],[-70,35],[-70,35+48]];\n holes2=[[50,0],[0,0],[-50,0]];\n points=concat(points1,holes2);\n module joint(array, i1, i2) {\n hull() {\n translate(array[i1]) cylinder(d=12,h=4);\n translate(array[i2]) cylinder(d=12,h=4);\n }\n }\n difference() {\n union() {\n joint(points, 0, 1);\n joint(points, 1, 3);\n joint(points, 3, 2);\n joint(points, 2, 6);\n joint(points, 6, 5);\n joint(points, 5, 4);\n joint(points, 4, 0);\n }\n \n for(xy=holes2)translate(xy)cylinder(d=3.2,h=20,center=true,$fn=24);\n for(xy=holes1)translate(xy) {\n cylinder(d=3.2,h=20,center=true,$fn=24);\n translate([0,0,-0.01])cylinder(d1=6.2,d2=3.2,h=3,$fn=24);\n }\n }\n}\n\nmodule realsense_bracket() {\n distance_x=62.25\/2;\n difference() {\n union() {\n cube2([72,6,50-6],TFF);\n mirror_x()translate([25,-12.5])cube2([12,13,25-6-2],TFF);\n \n mirror_x()translate([distance_x,0])cube2([12,35,5],TFF);\n mirror_x()translate([distance_x+6,0])hull() {\n cube2([3,35,5],TFF);\n cube2([3,6,50-6],TFF);\n }\n }\n mirror_x()translate([50\/2,0,12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n translate([0,25-12.5+6])rotate([90,0])cylinder(d=6,h=25,$fn=36);\n }\n mirror_x()translate([45\/2,0,25+12.5-6]) {\n rotate([90,0])cylinder(d=3.2,h=100,center=true,$fn=24);\n }\n mirror_x() for(a=[10,20,30])translate([distance_x,a])cylinder(d=3.2,h=30,$fn=24,center=true);\n }\n}\n\n\/\/switch_bracket();\nrealsense_bracket();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8f1136266259d4e457401d952f12922f5966954a","subject":"removed dead code","message":"removed dead code\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/kite_handle_bar.scad","new_file":"kite_roller\/kite_handle_bar.scad","new_contents":"eps = 0.01;\nd_rod = 8+0.5;\nd_hand = 20;\nh_hand = 110;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule bearing_mount()\n{\n $fn=90;\n wall = 5;\n d_ext = 22+2*wall;\n\n \/\/ bottom bearing hold\n difference()\n {\n cylinder(d=d_ext, h=7);\n translate([0,0,-eps])\n cylinder(d=22+0.5, h=7+2*eps, $fn=180);\n }\n %bearing();\n\n \/\/ connecting element\n translate([0, 0, 7])\n difference()\n {\n cylinder(d1=d_ext, d2=d_hand, h=(d_ext-d_hand)\/2);\n cylinder(d1=d_ext-2*wall+0.5, d2=d_rod, h=(d_ext-d_hand)\/2);\n }\n}\n\n\nmodule handle()\n{\n h_bm = 13;\n \/\/ bottom bearing mount\n bearing_mount();\n translate([0, 0, h_bm])\n {\n \/\/ center rod\n difference()\n {\n cylinder(d=d_hand, h=h_hand, $fn=100);\n cylinder(d=d_rod, h=h_hand, $fn=100);\n }\n \/\/ top bearing mount\n translate([0, 0, h_hand])\n translate([0, 0, h_bm])\n mirror([0,0,1])\n bearing_mount();\n }\n}\n\n\nfor(i=[0:1])\n translate(i*[35,0,0])\n handle();\n","old_contents":"use \n\neps = 0.01;\nd_rod = 8+0.5;\nd_hand = 20;\nh_hand = 110;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule screw_head() { screw_head_hex_m8(); }\n\nmodule washer(dh=0)\n{\n difference()\n {\n cylinder(d=15.5, h=1.4+dh);\n translate(eps*[0,0,-1])\n cylinder(d=8.5, h=1.4+dh+2*eps);\n }\n}\n\n\n\/\/ slot for ball bearing + 2 washers\nmodule bearing_slot()\n{\n d_spacing = 0.5;\n h_spacing = 0.2;\n screw_head_hex_m8(d_spacing, h_spacing);\n\n for(dh=[-1.4, 7+h_spacing])\n translate([0, 0, dh])\n washer();\n}\n\n\nmodule bearing_mount()\n{\n $fn=90;\n wall = 5;\n d_ext = 22+2*wall;\n\n \/\/ bottom bearing hold\n difference()\n {\n cylinder(d=d_ext, h=7);\n translate([0,0,-eps])\n cylinder(d=22+0.5, h=7+2*eps, $fn=180);\n }\n %bearing();\n\n translate([0, 0, 7])\n {\n \/\/ connecting element\n difference()\n {\n cylinder(d1=d_ext, d2=d_hand, h=(d_ext-d_hand)\/2);\n cylinder(d1=d_ext-2*wall+0.5, d2=d_rod, h=(d_ext-d_hand)\/2);\n }\n \n \/\/ main e\n }\n}\n\n\nmodule handle()\n{\n h_bm = 13;\n \/\/ bottom bearing mount\n bearing_mount();\n translate([0, 0, h_bm])\n {\n \/\/ center rod\n difference()\n {\n cylinder(d=d_hand, h=h_hand, $fn=100);\n cylinder(d=d_rod, h=h_hand, $fn=100);\n }\n \/\/ top bearing mount\n translate([0, 0, h_hand])\n translate([0, 0, h_bm])\n mirror([0,0,1])\n bearing_mount();\n }\n}\n\n\nfor(i=[0:1])\n translate(i*[35,0,0])\n handle();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6415ed7376b79256398439d3a0aae91814247a4e","subject":"We don't love GPLv3 because it is not fair!","message":"We don't love GPLv3 because it is not fair!\n","repos":"keesj\/A10-OLinuXino-LIME-5510-Shield,keesj\/A10-OLinuXino-LIME-5510-Shield","old_file":"lcd5110.pretty\/rounded_square.scad","new_file":"lcd5110.pretty\/rounded_square.scad","new_contents":"\/\/ helper module for drawing rectangles with rounded borders\n\/\/\n\/\/ (c) 2016 Kees Jongenburger: Licence of this file only applies\n\/\/ to this file and does not infect other parts of the design.\n\/\/ (c) 2013 Felipe C. da S. Sanches \n\/\/ Lincensed under the terms of the GNU General Public License\n\/\/ version 3 (or later).\n\/\/https:\/\/raw.githubusercontent.com\/Metamaquina\/Metamaquina2Beta\/master\/rounded_square.scad\n\nmodule rounded_square(dim, corners=[10,10,10,10], center=false){\n w=dim[0];\n h=dim[1];\n\n if (center){\n translate([-w\/2, -h\/2])\n rounded_square_(dim, corners=corners);\n }else{\n rounded_square_(dim, corners=corners);\n }\n}\n\nmodule rounded_square_(dim, corners, center=false){\n w=dim[0];\n h=dim[1];\n render(){\n difference(){\n square([w,h]);\n\n if (corners[0])\n square([corners[0], corners[0]]);\n\n if (corners[1])\n translate([w-corners[1],0])\n square([corners[1], corners[1]]);\n\n if (corners[2])\n translate([0,h-corners[2]])\n square([corners[2], corners[2]]);\n\n if (corners[3])\n translate([w-corners[3], h-corners[3]])\n square([corners[3], corners[3]]);\n }\n\n if (corners[0])\n translate([corners[0], corners[0]])\n intersection(){\n circle(r=corners[0]);\n translate([-corners[0], -corners[0]])\n square([corners[0], corners[0]]);\n }\n\n if (corners[1])\n translate([w-corners[1], corners[1]])\n intersection(){\n circle(r=corners[1]);\n translate([0, -corners[1]])\n square([corners[1], corners[1]]);\n }\n\n if (corners[2])\n translate([corners[2], h-corners[2]])\n intersection(){\n circle(r=corners[2]);\n translate([-corners[2], 0])\n square([corners[2], corners[2]]);\n }\n\n if (corners[3])\n translate([w-corners[3], h-corners[3]])\n intersection(){\n circle(r=corners[3]);\n square([corners[3], corners[3]]);\n }\n }\n}\n\n","old_contents":"\/\/ helper module for drawing rectangles with rounded borders\n\/\/\n\/\/ (c) 2013 Felipe C. da S. Sanches \n\/\/ Lincensed under the terms of the GNU General Public License\n\/\/ version 3 (or later).\n\/\/https:\/\/raw.githubusercontent.com\/Metamaquina\/Metamaquina2Beta\/master\/rounded_square.scad\n\nmodule rounded_square(dim, corners=[10,10,10,10], center=false){\n w=dim[0];\n h=dim[1];\n\n if (center){\n translate([-w\/2, -h\/2])\n rounded_square_(dim, corners=corners);\n }else{\n rounded_square_(dim, corners=corners);\n }\n}\n\nmodule rounded_square_(dim, corners, center=false){\n w=dim[0];\n h=dim[1];\n render(){\n difference(){\n square([w,h]);\n\n if (corners[0])\n square([corners[0], corners[0]]);\n\n if (corners[1])\n translate([w-corners[1],0])\n square([corners[1], corners[1]]);\n\n if (corners[2])\n translate([0,h-corners[2]])\n square([corners[2], corners[2]]);\n\n if (corners[3])\n translate([w-corners[3], h-corners[3]])\n square([corners[3], corners[3]]);\n }\n\n if (corners[0])\n translate([corners[0], corners[0]])\n intersection(){\n circle(r=corners[0]);\n translate([-corners[0], -corners[0]])\n square([corners[0], corners[0]]);\n }\n\n if (corners[1])\n translate([w-corners[1], corners[1]])\n intersection(){\n circle(r=corners[1]);\n translate([0, -corners[1]])\n square([corners[1], corners[1]]);\n }\n\n if (corners[2])\n translate([corners[2], h-corners[2]])\n intersection(){\n circle(r=corners[2]);\n translate([-corners[2], 0])\n square([corners[2], corners[2]]);\n }\n\n if (corners[3])\n translate([w-corners[3], h-corners[3]])\n intersection(){\n circle(r=corners[3]);\n square([corners[3], corners[3]]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e2ab609a692b9df4df70eb0615d74434539ddb05","subject":"xTubeConnecter","message":"xTubeConnecter\n\nV0.1\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"xTubeConnector.scad","new_file":"xTubeConnector.scad","new_contents":"\/\/Parameters\n$fn=50;\ndOne = 26.4;\ndTwo = 30; \/\/ ?? Messen\nhOne =10;\nhTwo =20;\nwall =1.5;\nslot = 3;\nscrewHoleDiameter = 3;\nscrewNutRadius = screwHoleDiameter * 0.9;\n\nmodule connector(d=20,h=10) {\n difference() {\n cylinder(r=d\/2+wall,h=h,center=true);\n cylinder(r=d\/2,h=h,center=true);\n translate([d\/2,0])cube([d\/2*1.1,slot,h],center=true);\n }\n \n translate([d\/2+1.5*wall+screwHoleDiameter\/2,slot])screwHold(a=2.5*wall+screwHoleDiameter,b=slot,c=h);\n translate([d\/2+1.5*wall+screwHoleDiameter\/2,-slot])screwHoldNut(a=2.5*wall+screwHoleDiameter,b=slot,c=h);\n}\nmodule screwHold(a,b,c) {\n difference() {\n cube([a,b,c],center=true);\n rotate([90])cylinder(r=screwHoleDiameter\/2,h=c,center=true);\n }\n}\nmodule screwHoldNut(a,b,c) {\n difference() {\n cube([a,b,c],center=true);\n rotate([90])translate([0,0,-b])cylinder(r=screwHoleDiameter\/2,h=c);\n rotate([90])translate([0,0,0])cylinder(r=screwNutRadius,h=b,$fn=6);\n }\n}\nmodule assembly() {\n connector(d=dOne,h=hOne);\n translate([-dOne-3*wall,0])rotate([90,0,180])connector(d=dTwo,h=hTwo);\n}\nmodule hullCut() {\n intersection() {\n assembly();\n translate([-dOne\/2-wall\/2,l,0])cube([wall,hTwo,hOne],center=true);\n }\n}\nassembly();\nhull()hullCut();","old_contents":"","returncode":1,"stderr":"error: pathspec 'xTubeConnector.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"d4c2a0e3ae6fb6cf6df2aa5e51f3c9d728201933","subject":"refactor: rewrite the repeat operators, using direct loops instead of nesting operators and mutiplying the translates","message":"refactor: rewrite the repeat operators, using direct loops instead of nesting operators and mutiplying the translates\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/translate.scad","new_file":"operator\/repeat\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = 0,\n center = false,\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n offset = center ? -interval * (count - 1) \/ 2 : ORIGIN_3D;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = 0,\n intervalY = 0,\n center = false) {\n\n intervalX = vector3D(intervalX);\n intervalY = vector3D(intervalY);\n offsetX = center ? -intervalX * (countX - 1) \/ 2 : ORIGIN_3D;\n offsetY = center ? -intervalY * (countY - 1) \/ 2 : ORIGIN_3D;\n offset = offsetX + offsetY;\n\n for (y = [0 : countY - 1] ) {\n for (x = [0 : countX - 1] ) {\n translate(offset + intervalX * x + intervalY * y) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = 0,\n intervalY = 0,\n intervalZ = 0,\n center = false) {\n\n intervalX = vector3D(intervalX);\n intervalY = vector3D(intervalY);\n intervalZ = vector3D(intervalZ);\n offsetX = center ? -intervalX * (countX - 1) \/ 2 : ORIGIN_3D;\n offsetY = center ? -intervalY * (countY - 1) \/ 2 : ORIGIN_3D;\n offsetZ = center ? -intervalZ * (countZ - 1) \/ 2 : ORIGIN_3D;\n offset = offsetX + offsetY + offsetZ;\n\n for (z = [0 : countZ - 1] ) {\n for (y = [0 : countY - 1] ) {\n for (x = [0 : countX - 1] ) {\n translate(offset + intervalX * x + intervalY * y + intervalZ * z) {\n children();\n }\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n repeat2D(\n countX = count.x,\n countY = count.y,\n intervalX = xAxis3D(size.x),\n intervalY = yAxis3D(size.y),\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n repeat3D(\n countX = count.x,\n countY = count.y,\n countZ = count.z,\n intervalX = xAxis3D(size.x),\n intervalY = yAxis3D(size.y),\n intervalZ = zAxis3D(size.z),\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats the children modules on every position given in the `map`.\n *\n * @param Vector[] map - The list of position at which place the children.\n * @param Vector [offset] - An offset to add on each position.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n translate(offset + vector3D(at)) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = 0,\n center = false,\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n offset = center ? -interval * (count - 1) \/ 2 : ORIGIN_3D;\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = 0,\n intervalY = 0,\n center = false) {\n\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = 0,\n intervalY = 0,\n intervalZ = 0,\n center = false) {\n\n repeat(count=countZ, interval=vector3D(intervalZ), center=center) {\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n repeat2D(\n countX = count.x,\n countY = count.y,\n intervalX = [size.x, 0, 0],\n intervalY = [0, size.y, 0],\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n repeat3D(\n countX = count.x,\n countY = count.y,\n countZ = count.z,\n intervalX = [size.x, 0, 0],\n intervalY = [0, size.y, 0],\n intervalZ = [0, 0, size.z],\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats the children modules on every position given in the `map`.\n *\n * @param Vector[] map - The list of position at which place the children.\n * @param Vector [offset] - An offset to add on each position.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n translate(offset + vector3D(at)) {\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8cc17534313f19973c071f3c00b8155e21949f00","subject":"bearing: use fallback func","message":"bearing: use fallback func\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = (override_h==undef ? bearing_type[2] : override_h) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = (ziptie_dist==undef?bearing_type[3]\/2:ziptie_dist);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=true,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ea9b10c7640e5a293024dc19f0f2babbdb347701","subject":"Added a short OpenSCAD description to aid in the creation of simple modifier meshes that describe a change every N layers","message":"Added a short OpenSCAD description to aid in the creation of simple modifier meshes that describe a change every N layers\n","repos":"platsch\/Slic3r,curieos\/Slic3r,tmotl\/Slic3r,pieis2pi\/Slic3r,pieis2pi\/Slic3r,curieos\/Slic3r,xoan\/Slic3r,mcilhargey\/Slic3r,alexrj\/Slic3r,alexrj\/Slic3r,xoan\/Slic3r,xoan\/Slic3r,prusa3d\/Slic3r,tmotl\/Slic3r,prusa3d\/Slic3r,alexrj\/Slic3r,lordofhyphens\/Slic3r,platsch\/Slic3r,alexrj\/Slic3r,xoan\/Slic3r,pieis2pi\/Slic3r,xoan\/Slic3r,curieos\/Slic3r,prusa3d\/Slic3r,mcilhargey\/Slic3r,pieis2pi\/Slic3r,pieis2pi\/Slic3r,tmotl\/Slic3r,tmotl\/Slic3r,platsch\/Slic3r,pieis2pi\/Slic3r,lordofhyphens\/Slic3r,prusa3d\/Slic3r,xoan\/Slic3r,curieos\/Slic3r,tmotl\/Slic3r,lordofhyphens\/Slic3r,prusa3d\/Slic3r,alexrj\/Slic3r,mcilhargey\/Slic3r,lordofhyphens\/Slic3r,prusa3d\/Slic3r,mcilhargey\/Slic3r,curieos\/Slic3r,platsch\/Slic3r,mcilhargey\/Slic3r,curieos\/Slic3r,tmotl\/Slic3r,lordofhyphens\/Slic3r,platsch\/Slic3r,platsch\/Slic3r,mcilhargey\/Slic3r,prusa3d\/Slic3r,mcilhargey\/Slic3r,lordofhyphens\/Slic3r,alexrj\/Slic3r","old_file":"utils\/modifier_helpers\/solid_layers.scad","new_file":"utils\/modifier_helpers\/solid_layers.scad","new_contents":"\/\/ Used to generate a modifier mesh to do something every few layers. \n\/\/ Load into OpenSCAD, tweak the variables below, export as STL and load as \n\/\/ a modifier mesh. Then change settings for the modifier mesh.\n\n\/\/ Written by Joseph Lenox; in public domain.\n\nlayer_height = 0.3; \/\/ set to layer height in slic3r for \"best\" results.\nnumber_of_solid_layers = 2;\nN = 4; \/\/ N > number_of_solid_layers or else the whole thing will be solid\nmodel_height = 300.0;\nmodel_width = 300.0; \/\/ these two should be at least as big as the model \nmodel_depth = 300.0; \/\/ but bigger isn't a problem\ninitial_offset=0; \/\/ don't generate below this\n\nposition_on_bed=[0,0,0]; \/\/ in case you need to move it around\n\n\/\/ don't touch below unless you know what you are doing.\nsimple_layers = round(model_height\/0.3);\ntranslate(position_on_bed)\n for (i = [initial_offset:N:simple_layers]) {\n translate([0,0,i*layer_height])\n translate([0,0,(layer_height*number_of_solid_layers)\/2])\n cube([model_width,model_depth,layer_height*number_of_solid_layers], center=true);\n }\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'utils\/modifier_helpers\/solid_layers.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"039f46c9e721c8ffca580f1e9da24e6644ac0e86","subject":"rocket nose cone","message":"rocket nose cone\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"water_rocket_launcher\/rocket_cone.scad","new_file":"water_rocket_launcher\/rocket_cone.scad","new_contents":"module cone()\n{\n wall = 3*0.6; \/\/ i.e. 3x extrusion width\n difference()\n {\n cylinder(d1=80, d2=0.1, h=50, $fn=100);\n cylinder(d1=80-2*wall, d2=0.1, h=50-wall, $fn=100);\n }\n}\n\ncone();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'water_rocket_launcher\/rocket_cone.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"282f9fb10f6ac0405d610cb19eb4ec24b79bb373","subject":"misc: add v_xz","message":"misc: add v_xz\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nif($test_mode)\n{\n assert_v(v_mul([0,1], [1,2]), [0, 2]);\n assert_v(v_mul([1,1], [1,2]), [1, 2]);\n assert_v(v_mul([1,2], [1,2]), [1, 4]);\n}\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\nfunction v_filter(vec,val=U) = filter(vec,val);\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(filter(v, U), [0,1,2]);\n assert_v(filter(v, 1), [0,2]);\n}\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xz(v) = [v[0],0,v[2]];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_mul(A,B) = [for(i=[0:len(A)-1]) A[i]*B[i]];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nif($test_mode)\n{\n assert_v(v_mul([0,1], [1,2]), [0, 2]);\n assert_v(v_mul([1,1], [1,2]), [1, 2]);\n assert_v(v_mul([1,2], [1,2]), [1, 4]);\n}\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\nfunction v_filter(vec,val=U) = filter(vec,val);\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(filter(v, U), [0,1,2]);\n assert_v(filter(v, 1), [0,2]);\n}\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a109a2e872c85b69293185aab0970dc44b79d300","subject":"removed test code and updated distances and hole diameters","message":"removed test code and updated distances and hole diameters\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filament_holder\/fork_mk2.scad","new_file":"filament_holder\/fork_mk2.scad","new_contents":"h=11; \/\/ height\nw=14; \/\/ width\nd=(5+1.5)\/2; \/\/ diameter of the holes\n\ndifference()\n{\n union()\n {\n \/\/ lower arc\n difference()\n {\n cylinder(h=h, r=(80+2*w)\/2);\n translate([-(80+2*w)\/2, 0, 0])\n cube([80+2*w, (80+2*w)\/2, h]);\n cylinder(h=h, r=(80)\/2);\n }\n\n \/\/ leg\n translate([-w\/2,-80-80\/2,0])\n cube([w, 80, h]);\n\n \/\/ forks\n translate([40, 0, 0])\n cube([w, 40, h]);\n translate([-40-w, 0, 0])\n cube([w, 40, h]);\n }\n\n \/\/ lower hole for screw\n translate([0, -80-34.5, -1])\n cylinder(h=h+2, r=d);\n \/\/ higher hole for screw\n translate([0, -80-34.5+11, -1])\n cylinder(h=h+2, r=d);\n}\n","old_contents":"h=11; \/\/ height\nw=14; \/\/ width\nd=(5+1)\/2; \/\/ diameter of the holes\n\n\t\tdifference() {\ndifference()\n{\n union()\n {\n \/\/ lower arc\n difference()\n {\n cylinder(h=h, r=(80+2*w)\/2);\n translate([-(80+2*w)\/2, 0, 0])\n cube([80+2*w, (80+2*w)\/2, h]);\n cylinder(h=h, r=(80)\/2);\n }\n\n \/\/ leg\n translate([-w\/2,-80-80\/2,0])\n cube([w, 80, h]);\n\n \/\/ forks\n translate([40, 0, 0])\n cube([w, 40, h]);\n translate([-40-w, 0, 0])\n cube([w, 40, h]);\n }\n\n \/\/ lower hole for screw\n translate([0, -80-33, -1])\n cylinder(h=h+2, r=d);\n \/\/ higher hole for screw\n translate([0, -80-33+11, -1])\n cylinder(h=h+2, r=d);\n}\n\n\t translate([-60, -96, 0])\n\t\t cube([200, 200, h]);\n\t translate([3, -98, 0])\n\t\t cube([200, 200, h]);\n\t\t\t}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6f1323f763c21a057bb5824849353a4952edcbf3","subject":"font panel is now properly rotate by default","message":"font panel is now properly rotate by default\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \ninclude \n\nmodule front()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ LCD mounting drills\n translate(lcdOffset)\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}\n\nrotate([180, 0, 0])\n front();\n","old_contents":"use \nuse \nuse \nuse \nuse \nuse \ninclude \n\nmodule front()\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ LCD mounting drills\n translate(lcdOffset)\n for(offset = [\n [3\/2+1, 3\/2+1, -1],\n [98-3\/2-1, 3\/2+1, -1],\n [3\/2+1, 60-3\/2-1, -1],\n [98-3\/2-1, 60-3\/2-1, -1]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}\n\n\/\/rotate([180, 0, 0])\n front();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"01bc7c29ab94c17db9e3ae54bca4ec532b806c8b","subject":"Create AluFrame.scad","message":"Create AluFrame.scad","repos":"Aggebitter\/R2-3D,Aggebitter\/R2-3D","old_file":"AluFrame.scad","new_file":"AluFrame.scad","new_contents":"include <20x20_Profile.scad>\n\nmodule AluFrame (){\n\n\/\/ frame vertical\n AluProfile(410); \/\/ South West corner\n translate([420,0,0]) { \/\/ South East corner\n AluProfile(410);\n }\n translate([0,320,0]) { \/\/ North West corner\n AluProfile(410);\n }\n translate([420,320,0]) { \/\/ North East corner \n AluProfile(410);\n }\n\n\/\/ frame horisontal North and South\n translate([20,0,410]) { \/\/ Front top\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n translate([20,0,320]) { \/\/ Front top 2\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n translate([20,0,105]) { \/\/ Front bottom\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n translate([20,0,35]) { \/\/ Front bottom 2\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n translate([20,320,410]) { \/\/ Back top\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n translate([20,320,320]) { \/\/ Back top 2\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n translate([20,320,35]) { \/\/ Back bottom\n rotate ([0,90,0]){ \n AluProfile(400);\n }}\n\n\n\/\/ frame horisontal West and East\n translate([0,20,320]) { \/\/ West top\n rotate ([270,0,0]){ \n AluProfile(300);\n }}\n\n translate([0,20,105]) { \/\/ West bottom\n rotate ([270,0,0]){ \n AluProfile(300);\n }}\n\n translate([420,20,320]) { \/\/ East Ttop\n rotate ([270,0,0]){ \n AluProfile(300);\n }}\n\n translate([420,20,105]) { \/\/ East bottom\n rotate ([270,0,0]){ \n AluProfile(300);\n }}\n\n}\n\n\nAluFrame ();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'AluFrame.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"7786d3bfa647b3566efc9872e42b9d01193866c9","subject":"kantcon","message":"kantcon\n\nfixing comments\n","repos":"JoeSuber\/QuickerPicker","old_file":"quicker_pickerupper5.scad","new_file":"quicker_pickerupper5.scad","new_contents":"use \n\necho(version=version());\necho(\"main picker assembly\");\n\n\n\nfanrad = 57\/2;\nfanheight = 25;\nscrewcenter = 48.5\/2;\n\/\/ actual box outside is 2mm bigger due to curve\noutsidebox = 64.5;\noutextendo = 25.5;\nscrewd = 1.6;\ngearheight = 7.1;\npinrad = .865;\n\/\/ bearing placements\nbx=28;\nby=30+outextendo;\nbz=20;\n\/\/ flaps for airflow valve\nflapthick = 1.2;\ntruss = 9;\t\t\/\/ knobby bit on flap\nsprd = .6;\nknobrad = 1.2;\t\t\/\/ on side of chamber\nlowknob = 9.5 + knobrad; \/\/ distance from wire\n\nmodule gearmotor(l=25, w=12, h=10, r=3\n){\n\tcube([l,w,h], center=true);\n\ttranslate([-5,0,0]) rotate([0,90,0])\n\t\tcylinder(r=r, h=l+10+1, center=true, $fn=16);\n\ttranslate([l\/2,0,0]) rotate([0,90,0])\n\t\tcylinder(r=1, h=w, center=true, $fn=16);\n\ttranslate([l\/2,0,0]) rotate([90,0,0])\n\t\tcylinder(r=1.5, h=65, center=true, $fn=16);\n\n}\n\nmodule flapattach(ra=3, t=flapthick, trusslen=truss){\n\/\/ the little bit going from rod to flap\n\tdifference(){\n\t\/\/ disk-hull-disk\n\thull(){\n\t\tunion(){\n\t\t\tcylinder(r1=ra-1, r2=ra, h=t, center=true, $fn=36);\n\t\t\ttranslate([0,0,t])\n\t\t\t\tcylinder(r1=ra, r2=ra-1, h=t, center=true, $fn=36);\n\t\t}\n\t\ttranslate([trusslen,0,0])\n\t\t union(){\n\t\t\t cylinder(r1=ra-1, r2=ra, h=t, center=true, $fn=36);\n\t\t\t translate([0,0,t])\n\t\t\t\t cylinder(r1=ra, r2=ra-1, h=t, center=true, $fn=36);\n\t\t }\n\t\t} \/\/ end of disk-hull-disk\n\t\/\/ hole for metal pin or wire (to swivel on)\n\tcylinder(r=pinrad+.1, h=t*6, center=true, $fn=12);\n\t}\n}\n\nmodule flap(rd=fanrad-1, t=flapthick, trs=truss){\n\/\/ make quarter-section of stopper\n\tdifference(){\n\t\tunion(){\n\t\tdifference(){\n\t\t\tcylinder(r=rd, h=t, center=false, $fn=128);\n\t\t\ttranslate([rd\/2, -rd\/2, t\/2])\n\t\t\t\tcube([rd,rd,t*2], center=true);\n\t\t\ttranslate([-rd\/2, -rd\/2, t\/2])\n\t\t\t\tcube([rd,rd,t*2], center=true);\n\t\t\ttranslate([-rd\/2, rd\/2, t\/2])\n\t\t\t\tcube([rd,rd,t*2], center=true);\n\t\t}\n\t\ttranslate([0, trs, -6]) rotate([90,-60,0])\n\t\t\tflapattach();\n\t\ttranslate([0, rd-trs, -6]) rotate([90,-60,0])\n\t\t\tflapattach();\n\t\t}\n\ttranslate([rd\/2, rd\/2, t*3])\n\t\tcube([rd*2,rd,t*4], center=true);\n\t}\n}\n\nmodule flaps(){\n\tdifference(){\n\t\tflap();\n\t\trotate([0,0,-90])\n\t\t\tflap();\n\t}\n}\n\nmodule nodule(rat=45){\n\/\/ cam for valve leaves\n\trotate([0,0,rat]) scale([2,1,.5])\n\t\tsphere(r=2.42, $fn=64);\n}\n\n\/\/ nut at end of bolt for cut-outs\nmodule m3nut(d=6.4, \n\t\t\t\th=2.7, \n\t\t\t\trodd=3.1, \n\t\t\t\trodlen=19, \n\t\t\t\thdled=3, \n\t\t\t\thdrad=6\/2, \n\t\t\t\tcapture_channel=20, \n\t\t\t\tchannel_dir=90, \n\t\t\t\tfat=.1){\n\ttranslate([0,0,-rodlen\/2+h\/2]){\n\t\t\/\/ nut on end of threads\n\t\tcylinder(r=d\/2, h=h, center=true, $fn=6);\n\t\t\/\/ 'tunnel' to nut\n\t\ttranslate([(capture_channel\/2)*cos(channel_dir-90), (capture_channel\/2)*sin(channel_dir-90), 0]) rotate([0,0,channel_dir]) \n\t\t\tcube([d, capture_channel, h], center=true);\n\t}\n\t\/\/ head of bolt is hexxed even if round\n\ttranslate([0,0,rodlen\/2 - hdled\/2])\n\t\tcylinder(r=hdrad+fat, h=hdled, center=true, $fn=6);\n\t\/\/ threaded part\n\tcylinder(r=rodd\/2+fat, h=rodlen, center=true, $fn=12);\n}\n\n\nmodule z608z(mntrad=7.45\/2, ht=7, innermnt=2.35, race=2.6, edge=2.35){\n\/\/ 608zz bearing mount cutter\n\ttranslate([0,0,0])\n\t\tunion(){\n\t\t\tring((innermnt+mntrad)*2, mntrad*2, height=ht-.1);\n\t\t\tring((innermnt+mntrad+race)*2, (innermnt+mntrad)*2-.1, height=ht-.25);\n\t\t\tring((innermnt+mntrad+race+edge)*2, (innermnt+mntrad+race)*2-.1, height=ht+.1);\n\t\t\t\/\/ thread-groove cutter:\n\t\t\tring((innermnt+mntrad+race+edge)*2+.35, (innermnt+mntrad+race+edge)*2-.1, height=.7);\n\t\t}\n}\n\n\/\/ linear bearing for 6mm w\/ rod sticking through it\nmodule LMB6mm(OD=12, \n\t\t\t\tOD_groove=11.41, \n\t\t\t\tID=6, len=18.86, \n\t\t\t\tstripe=1.25, \n\t\t\t\tstripe_to_end=2.66, \n\t\t\t\trodlen=100){\ndifference(){\n\tunion(){\n\t\t\/\/ body of bearing, stacked up\n\t\ttranslate([0,0,-.05])\n\t\t\tcylinder(r=OD\/2, h=stripe_to_end+.1, $fn=64);\n\t\ttranslate([0,0,stripe_to_end])\n\t\t\tcylinder(r=OD_groove\/2, h=stripe+.05, $fn=48);\n\t\ttranslate([0,0,stripe_to_end+stripe])\n\t\t\tcylinder(r=OD\/2, h=len-stripe*2-stripe_to_end*2+.05, $fn=64);\n\t\ttranslate([0,0,len-stripe-stripe_to_end])\n\t\t\tcylinder(r=OD_groove\/2, h=stripe+.05, $fn=48);\n\t\ttranslate([0,0,len-stripe_to_end])\n\t\t\tcylinder(r=OD\/2, h=stripe_to_end+.05, $fn=64);\n\t\t\/\/ transition for printing upright\n\t\ttranslate([0,0,len])\n\t\t\tcylinder(r=OD\/2-1.1, h=stripe\/2, $fn=64);\n\t\t}\n\t\/\/ hole for rod\n\tcylinder(r=ID\/2, h=stripe_to_end, $fn=64);\n}\n\/\/ rod stand-in for use in cuts\ncylinder(r=ID\/2, h=rodlen, center=true, $fn=36);\n}\n\n\nmodule ring(rOD, rID, height)\n{\ndifference(){\n\tcylinder(r=rOD\/2, h=height, center=true, $fn=96);\n\tcylinder(r=rID\/2, h=height, center=true, $fn=96);\n\t}\n}\n\n\nmodule fan(side=57.2, w=fanheight, curve=3, screwcenter=screwcenter){\n\/\/ box fan 60mm sqr nominal x 25mm high + 50mm OD air hole\n\/\/ fan is a tad bigger here to allow for shrink\n\trealside = curve*2 + side;\n\toldz = 1;\n\ttranslate([29,18,0])\n\t\tcube(size=[7, 2, 22], center=true);\n\ttranslate([38,18,5])\n\t\tcube(size=[35, 2, 5], center=true);\n\ttranslate([0,0,-32.4])\n\t\tcylinder(r=fanrad, h=40, center=true, $fn=64);\n\tfor (z = [[screwcenter-9.4,screwcenter+7.7],\n\t\t\t\t[screwcenter-9.4,-screwcenter-7.7],\n\t\t\t\t[-screwcenter+9.4,screwcenter+7.7],\n\t\t\t\t[-screwcenter+9.4,-screwcenter-7.7]]){\n\t\ttranslate(z) \n\t\t\tcylinder(r=1.6, h=130, center=true, $fn=12);\n\t}\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube(size=[side-curve, side-curve, w], center=true);\n\t\t\tcylinder(r=curve, h=.1, $fn=20);\n\t\t}\n\t\/\/translate([29,20,0])\n\t\/\/\tcube(size=[4, 2, 2], center=true);\n\techo(\"realside = \", realside);\n\t}\n}\n\nmodule nut_insert(nutrad=6.15\/2, nutheight=2.6, into=6, direction=-1) {\n\/\/ slide in captured nuts\n\thull(){\n\t\tcylinder(r=nutrad, h=nutheight, center=true, $fn=6);\n\t\ttranslate([into*direction,0, 0])\n\t\t\tcylinder(r=nutrad, h=nutheight, center=true, $fn=6);\n\t\t}\n}\t\t\n\nmodule forbearance(screw=screwcenter+4.75){\n\/\/ bearings cut into four corners\n\tfor (z = [[screw,screw],\n\t\t\t\t[screw,-screw],\n\t\t\t\t[-screw,screw],\n\t\t\t\t[-screw,-screw]]){\n\t\ttranslate(z) translate([0,0,-15.9])\n\t\t\tz608z();\n\t\t\/\/ m3 bolts through 608zz centers\n\t\ttranslate(z) translate([0,0,-15.9])\n\t\t\tcylinder(r=1.6, h=30, center=true, $fn=12);\n\t\ttranslate(z) translate([0,0,0])\n\t\t\tcylinder(r=2.65, h=22, center=true, $fn=12);\n\t\ttranslate(z) translate([0,0,-26]){\n\t\t\tcylinder(r=3.1, h=2.5, center=true, $fn=6);\n\t\ttranslate([3*(z[0]\/z[1]),0,0])\n\t\t\tcylinder(r=3.6, h=2.5, center=true, $fn=6);\n\t\ttranslate([-3*(z[0]\/z[1]),0,0])\n\t\t\tcylinder(r=3.6, h=2.5, center=true, $fn=6);\n\t\t}\n\t}\n}\n\/\/small switch\nmodule contact_switch(len=13.4, dp=5.4, ht=6.4, blade_ht=65, bladew=1.8, bladethk=1){\n\tcube([len, dp, ht], center=false);\n\tfor (i=[.5, 5, 10.5]){\n\t\ttranslate([i+bladethk\/2, dp\/2, ht+blade_ht\/2]) \n\t\t\tcube([bladethk, bladew, blade_ht], center=true);\n\t}\n}\n\t\t\t\n\/\/ main section\nmodule main(baselevel=-46.8){\n\tdifference(){\n\t\ttranslate([0,outextendo\/2,-18])\n\t\tunion(){\n\t\t\/\/ the big box\n\t\t\tminkowski(){\n\t\t\tcube([outsidebox,outsidebox+outextendo,60], center=true);\n\t\t\tcylinder(r=2, h=.1, $fn=20);\n\t\t}\t\t\n\t\ttranslate([-bx, by*.6, bz\/2+4.5]) scale([.4,1.8,1])\n\t\t\tcylinder(r=8.8, h=26, center=true, $fn=64);\n\t\ttranslate([bx, by*.6, bz\/2+4.5]) scale([.4,1.8,1])\n\t\t\tcylinder(r=8.8, h=26, center=true, $fn=64);\n\t\t\/\/translate([0, -by*1.48, bz\/2+3]) scale([1.8,.4,1])\n\t\t\/\/\tcylinder(r=9, h=26, center=true, $fn=64);\n\t\t\/\/translate([0,33.15\/2,-12]) rotate([0,90,0])\n\t\t\/\/\tcylinder(r=screwd, h=71, center=true, $fn=20);\n\t\t\/\/translate([0,0,-12]) rotate([0,90,0])\n\t\t\/\/\tcylinder(r=screwd, h=71, center=true, $fn=20);\n\t\t}\n\t\tfan();\n\t\t\/\/ groove for gear\n\t\ttranslate([0,0,-16])\n\t\t\tring(fanrad*2+5, fanrad*2-.1, gearheight);\n\t\t\/\/ m3bearing bolt-head access\n\t\t\n\t\t\/\/ 4 pin holes for flap control\n\t\ttranslate([0,0,-17-lowknob]) rotate([0,90,45])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\ttranslate([0,0,-17-lowknob]) rotate([0,90,-45])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\ttranslate([0,0,-21.5]) rotate([0,90,51])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\ttranslate([0,0,-21.5]) rotate([0,90,-39])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\t\/\/ can is gripped here\n\t\ttranslate([0,0,-38])\n\t\t\tring(64.75, 63, 25);\n\t\t\/\/ taper to can\n\t\ttranslate([0,0,-45])\n\t\t\tcylinder(r1=62.2\/2, r2=fanrad, 12, center=true, $fn=64);\n\t\t\/\/ linear bearing holders\n\t\ttranslate([-bx, by*.8, bz])\n\t\t\tLMB6mm(rodlen=120);\n\t\ttranslate([bx, by*.8, bz])\n\t\t\tLMB6mm(rodlen=120);\n\t\t\/\/ captured nuts for attachments\n\t\ttranslate([-screwcenter, -(outsidebox-fanrad)+3, 0])\n\t\t\trotate([90,0,0]) m3nut();\n\t\ttranslate([screwcenter, -(outsidebox-fanrad)+3, 0])\n\t\t\trotate([90,0,0]) m3nut();\n\t\ttranslate([0, -(outsidebox-fanrad)+3, 0])\n\t\t\trotate([90,0,0]) m3nut();\n\t\t\/\/switches man, switches\n\t\ttranslate([-29, (outsidebox+outextendo)\/2+8, -48.1])\n\t\t\tcontact_switch();\n\t\ttranslate([8, (outsidebox+outextendo)\/2-9, -48.1]) rotate([0,0,-7])\n\t\t\tcontact_switch();\n\t\ttranslate([-8, -(outsidebox)\/2-5.5, -48.1]) rotate([0,0,0])\n\t\t\tcontact_switch();\n\t\t\/\/ ring mount bearings\n\t\tforbearance();\n\t\t\/\/ stepper for turning ring\n\t\t\/\/translate([0,52,-11]) rotate([90,0,0])\n\t\t\/\/\tsmall_stepper();\n\t\t\/\/ tiny gearmotor\n\t\ttranslate([0,34.7,-1]) rotate([0,-90,90])\n\t\t\tgearmotor();\n\t\t\/\/ spool mount hole for thread-drive of ring\n\t\ttranslate([0,outsidebox\/2+2.5, -16.0]) rotate([0,0,0])\n\t\t\tcylinder(r=4.68, h=7, center=true, $fn=128);\n\t\t\/\/ thread passageway\n\t\ttranslate([0,outsidebox\/2+2.5, -16.3]) rotate([0,90,0])\n\t\t\tcylinder(r=.7, h=60, center=true, $fn=6);\n\t}\n\/*\n\/\/ flaps for valve\ntranslate([sprd, -sprd, baselevel]) rotate([180,0,0])\n\tflaps();\ntranslate([sprd, sprd, baselevel]) rotate([180,0,90])\n\tflaps();\ntranslate([-sprd, sprd, baselevel]) rotate([180,0,180])\n\tflaps();\ntranslate([-sprd, -sprd, baselevel]) rotate([180,0,-90])\n\tflaps();\n*\/\n\/\/ knobs for valve leaves\nfor (i = [45,-45,135,-135]){\n\ttranslate([.5*fanrad\/sin(i),.5*fanrad\/cos(180-i),-17.8-lowknob])\n\t\tnodule(rat=i);\n\t\/\/translate([fanrad*sin(i+40),fanrad*cos(180-(i+40)),-13.7-lowknob])\n\t\/\/\tnodule(rat=(i+40));\n\/\/ push_down the flaps as they rotate\n\ttranslate([fanrad*sin(i+40),fanrad*cos(180-(i+40)),-13.7-lowknob])\n\t\tsphere(r=3.2);\n\t}\n}\n\nmodule main_bottom(){\n\tdifference(){\n\t\tmain();\n\t\ttranslate([0,0+outextendo\/2,-.1])\n\t\t\tcube([100,100+outextendo,fanheight], center=true);\n\t}\n}\n\nmodule main_top(){\ntranslate([(outsidebox+10), +29, 26\/2])\n\tdifference(){\n\t\tmain();\n\t\ttranslate([0,0+outextendo\/2,-42.4])\n\t\t\tcube([100,100+outextendo,60], center=true);\n\t}\n}\nmodule inner_ring(){\n\/\/ inner ring for printing\ntranslate([outsidebox+3, +outextendo, 0])\n\tdifference(){\n\t\tunion(){\n\t\t\t\/\/ bottom bevel grabber\n\t\t\tcylinder(r1=fanrad+2.1, r2=fanrad+1.8, h=.5, center=false, $fn=128);\n\t\t\t\/\/ mid-section w\/ thread\t\n\t\t\ttranslate([0,0,0.5])\n\t\t\t\tcylinder(r1=fanrad+1.8, r2=fanrad+1.4, h=3, center=false, $fn=128);\n\t\t\ttranslate([0,0,3.5])\n\t\t\t\tcylinder(r1=fanrad+1.4, r2=fanrad+1.8, h=3, center=false, $fn=128);\n\t\t\t\/\/ top bevel grabber\n\t\t\ttranslate([0,0,6.5])\n\t\t\t\tcylinder(r1=fanrad+1.8, r2=fanrad+2.1, h=.5, center=false, $fn=128);\n\t\t}\n\t\t\/\/ cut out from center\n\t\ttranslate([0,0,-0.1])\n\t\t\tcylinder(r1=fanrad-.6, r2=fanrad-.1, h=7.15, center=false, $fn=128);\n\t\t\/\/ wire holder holes\n\t\ttranslate([0,0,.9]) rotate([0,90,0])\n\t\t\tcylinder(r=pinrad, h=(fanrad+1)*2, center=true, $fn=6);\n\t\ttranslate([0,0,.9]) rotate([90,0,0])\n\t\t\tcylinder(r=pinrad, h=(fanrad+1)*2, center=true, $fn=6);\n\t}\n}\n\nmodule print_gasket(screw=screwcenter+4.75){\ntranslate([(outsidebox+8), -(outsidebox+5), 21])\n\tdifference(){\n\t\tmain_bottom();\n\t\t\n\t\ttranslate([0,0+outextendo\/2,-50])\n\t\t\tcube([100,100+outextendo,58], center=true);\n\t\ttranslate([0,0+outextendo\/2,-10])\n\t\t\tcube([100,100+outextendo,15.5], center=true);\n\t\ttranslate([0,0+outextendo\/2,-10])\n\t\t\tcube([100,100+outextendo,15.5], center=true);\n\t\tfor (z = [[screw,screw],\n\t\t\t\t[screw,-screw],\n\t\t\t\t[-screw,screw],\n\t\t\t\t[-screw,-screw]]){\n\t\t\t\/\/ m3 hex-bolt-heads\n\t\t\ttranslate(z) translate([0,0,-21.75+1.5])\n\t\t\t\tcylinder(r=2.75, h=3, center=true, $fn=12);\n\t\t}\n\t}\n}\nmodule can_holder(){\ntranslate([0, 0, 23+(50\/2)])\n\tdifference(){\n\ttranslate([0,-(outsidebox+5),0])\n\t\tmain_bottom();\n\ttranslate([0,-(outsidebox+5)+outextendo\/2,-16])\n\t\tcube([70,70+outextendo+10,12], center=true);\n\t}\n}\n\nmodule ring_holder(){\ntranslate([0,0+outextendo+1,22])\n\tdifference(){\n\t\tmain_bottom();\n\t\ttranslate([0,0+outextendo\/2,-50])\n\t\t\tcube([100,100+outextendo,56], center=true);\n\t}\n}\n\nmodule spool(){\n\/\/ round thread puller for motor attach\n\/\/first some spacers for flap-wires\ntranslate([15,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([-15,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([-10,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([10,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([0,-10+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([0,10+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\n\t\/\/ remember to adjust socket in main if changing radius here\ntranslate([0,+outextendo,7\/2]){\n\tdifference(){\n\ttranslate([0,0,-7\/2]) union(){\n\tcylinder(r1=4.5,r2=4.2, h=1.5, center=false, $fn=128);\n\ttranslate([0,0,1.5])\n\t\tcylinder(r1=4.2,r2=4.65, h=1.5, center=false, $fn=128);\n\ttranslate([0,0,3])\n\t\tcylinder(r1=4.65,r2=4.3, h=2, center=false, $fn=128);\n\ttranslate([0,0,5])\n\t\tcylinder(r1=4.3,r2=4.65, h=2, center=false, $fn=128);\n\t\t\t}\n\t\t\/\/ nub insert for gear-motor\n\t\ttranslate([0,0,(7-5.25)\/2]){\n\t\t\tdifference(){\n\t\t\t\tcylinder(r=3.63, h=5.3, center=true, $fn=64);\n\t\t\t\ttranslate([3.57,0,0])\n\t\t\t\t\tcube([(3.57-4.9\/2)*2, 5.4, 6], center=true);\n\t\t\t\ttranslate([-3.57,0,0])\n\t\t\t\t\tcube([(3.57-4.9\/2)*2, 5.4, 6], center=true);\n\t\t\t}\n\t\t}\n\t\tcylinder(r=1, h=8, center=true, $fn=12);\n\t\ttranslate([0,0,1.35]) rotate([0,90,0])\n\t\t\tcylinder(r=.6, h=10, center=true, $fn=12);\n\t\ttranslate([0,0,0])\n\t\t\tcube([5.7,.4,3.7], center=true);\n\t}\n}}\n\n\n\/\/ samples for export\n\/\/rotate([0,180,0]) translate([0,0,-fanheight])\n\/\/\tmain_top();\n\n\/\/print_gasket();\n\n\/\/inner_ring();\n\n\/\/spool();\n\/\/rotate([0,0,-90]) translate([50,20,0])\n\/\/\tcan_holder();\n\n\/\/ring_holder();\n\nm3nut(capture_channel=50, channel_dir=13);\n\/\/pusher_down();\n\n\/\/contact_switch();\n\n\/\/ sample bearing\n\/\/z608z();\n\t\t\n\t\n\n","old_contents":"use \n\necho(version=version());\necho(\"main picker assembly\");\n\n\n\nfanrad = 57\/2;\nfanheight = 25;\nscrewcenter = 48.5\/2;\n\/\/ actual box outside is 2mm bigger due to curve\noutsidebox = 64.5;\noutextendo = 25.5;\nscrewd = 1.6;\ngearheight = 7.1;\npinrad = .865;\n\/\/ bearing placements\nbx=28;\nby=30+outextendo;\nbz=20;\n\/\/ flaps for airflow valve\nflapthick = 1.2;\ntruss = 9;\t\t\/\/ knobby bit on flap\nsprd = .6;\nknobrad = 1.2;\t\t\/\/ on side of chamber\nlowknob = 9.5 + knobrad; \/\/ distance from wire\n\nmodule gearmotor(l=25, w=12, h=10, r=3\n){\n\tcube([l,w,h], center=true);\n\ttranslate([-5,0,0]) rotate([0,90,0])\n\t\tcylinder(r=r, h=l+10+1, center=true, $fn=16);\n\ttranslate([l\/2,0,0]) rotate([0,90,0])\n\t\tcylinder(r=1, h=w, center=true, $fn=16);\n\ttranslate([l\/2,0,0]) rotate([90,0,0])\n\t\tcylinder(r=1.5, h=65, center=true, $fn=16);\n\n}\n\nmodule flapattach(ra=3, t=flapthick, trusslen=truss){\n\/\/ the little bit going from rod to flap\n\tdifference(){\n\t\/\/ disk-hull-disk\n\thull(){\n\t\tunion(){\n\t\t\tcylinder(r1=ra-1, r2=ra, h=t, center=true, $fn=36);\n\t\t\ttranslate([0,0,t])\n\t\t\t\tcylinder(r1=ra, r2=ra-1, h=t, center=true, $fn=36);\n\t\t}\n\t\ttranslate([trusslen,0,0])\n\t\t union(){\n\t\t\t cylinder(r1=ra-1, r2=ra, h=t, center=true, $fn=36);\n\t\t\t translate([0,0,t])\n\t\t\t\t cylinder(r1=ra, r2=ra-1, h=t, center=true, $fn=36);\n\t\t }\n\t\t} \/\/ end of disk-hull-disk\n\t\/\/ hole for metal pin or wire (to swivel on)\n\tcylinder(r=pinrad+.1, h=t*6, center=true, $fn=12);\n\t}\n}\n\nmodule flap(rd=fanrad-1, t=flapthick, trs=truss){\n\/\/ make quarter-section of stopper\n\tdifference(){\n\t\tunion(){\n\t\tdifference(){\n\t\t\tcylinder(r=rd, h=t, center=false, $fn=128);\n\t\t\ttranslate([rd\/2, -rd\/2, t\/2])\n\t\t\t\tcube([rd,rd,t*2], center=true);\n\t\t\ttranslate([-rd\/2, -rd\/2, t\/2])\n\t\t\t\tcube([rd,rd,t*2], center=true);\n\t\t\ttranslate([-rd\/2, rd\/2, t\/2])\n\t\t\t\tcube([rd,rd,t*2], center=true);\n\t\t}\n\t\ttranslate([0, trs, -6]) rotate([90,-60,0])\n\t\t\tflapattach();\n\t\ttranslate([0, rd-trs, -6]) rotate([90,-60,0])\n\t\t\tflapattach();\n\t\t}\n\ttranslate([rd\/2, rd\/2, t*3])\n\t\tcube([rd*2,rd,t*4], center=true);\n\t}\n}\n\nmodule flaps(){\n\tdifference(){\n\t\tflap();\n\t\trotate([0,0,-90])\n\t\t\tflap();\n\t}\n}\n\nmodule nodule(rat=45){\n\/\/ cam for valve leaves\n\trotate([0,0,rat]) scale([2,1,.5])\n\t\tsphere(r=2.42, $fn=64);\n}\n\n\/\/ nut at end of bolt for cut-outs\nmodule m3nut(d=6.4, h=2.7, rodd=3.1, rodlen=19, hdled=3, hdrad=6\/2, capture_channel=20, channel_dir=90, fat=.1){\n\ttranslate([0,0,-rodlen\/2+h\/2]){\n\t\tcylinder(r=d\/2, h=h, center=true, $fn=6);\n\t\t\/\/translate([rad*cos(i), rad*sin(i), lift]) rotate([0,0,i])\n\t\ttranslate([(capture_channel\/2)*cos(channel_dir-90), (capture_channel\/2)*sin(channel_dir-90), 0]) rotate([0,0,channel_dir]) \n\t\t\tcube([d, capture_channel, h], center=true);\n\t}\n\t\/\/ head of bolt is hexxed even if round\n\ttranslate([0,0,rodlen\/2 - hdled\/2])\n\t\tcylinder(r=hdrad, h=hdled, center=true, $fn=6);\n\n\t\/\/ threaded part\n\tcylinder(r=rodd\/2+fat, h=rodlen, center=true, $fn=12);\n}\n\n\/\/ 608zz bearing mount cutter\nmodule z608z(mntrad=7.45\/2, ht=7, innermnt=2.35, race=2.6, edge=2.35){\n\ttranslate([0,0,0])\n\t\tunion(){\n\t\t\tring((innermnt+mntrad)*2, mntrad*2, height=ht-.1);\n\t\t\tring((innermnt+mntrad+race)*2, (innermnt+mntrad)*2-.1, height=ht-.25);\n\t\t\tring((innermnt+mntrad+race+edge)*2, (innermnt+mntrad+race)*2-.1, height=ht+.1);\n\t\t\t\/\/ thread-groove cutter:\n\t\t\tring((innermnt+mntrad+race+edge)*2+.35, (innermnt+mntrad+race+edge)*2-.1, height=.7);\n\t\t}\n}\n\n\/\/ linear bearing for 6mm w\/ rod sticking through it\nmodule LMB6mm(OD=12, OD_groove=11.41, ID=6, len=18.86, stripe=1.25, stripe_to_end=2.66, rodlen=100){\ndifference(){\n\tunion(){\n\t\t\/\/ body of bearing, stacked up\n\t\ttranslate([0,0,-.05])\n\t\t\tcylinder(r=OD\/2, h=stripe_to_end+.1, $fn=64);\n\t\ttranslate([0,0,stripe_to_end])\n\t\t\tcylinder(r=OD_groove\/2, h=stripe+.05, $fn=48);\n\t\ttranslate([0,0,stripe_to_end+stripe])\n\t\t\tcylinder(r=OD\/2, h=len-stripe*2-stripe_to_end*2+.05, $fn=64);\n\t\ttranslate([0,0,len-stripe-stripe_to_end])\n\t\t\tcylinder(r=OD_groove\/2, h=stripe+.05, $fn=48);\n\t\ttranslate([0,0,len-stripe_to_end])\n\t\t\tcylinder(r=OD\/2, h=stripe_to_end+.05, $fn=64);\n\t\t\/\/ transition for printing upright\n\t\ttranslate([0,0,len])\n\t\t\tcylinder(r=OD\/2-1.1, h=stripe\/2, $fn=64);\n\t\t}\n\t\/\/ hole for rod\n\tcylinder(r=ID\/2, h=stripe_to_end, $fn=64);\n}\n\/\/ rod stand-in for use in cuts\ncylinder(r=ID\/2, h=rodlen, center=true, $fn=36);\n}\n\n\nmodule ring(rOD, rID, height)\n{\ndifference(){\n\tcylinder(r=rOD\/2, h=height, center=true, $fn=96);\n\tcylinder(r=rID\/2, h=height, center=true, $fn=96);\n\t}\n}\n\n\nmodule fan(side=57.2, w=fanheight, curve=3, screwcenter=screwcenter){\n\/\/ box fan 60mm sqr nominal x 25mm high + 50mm OD air hole\n\/\/ fan is a tad bigger here to allow for shrink\n\trealside = curve*2 + side;\n\toldz = 1;\n\ttranslate([29,18,0])\n\t\tcube(size=[7, 2, 22], center=true);\n\ttranslate([38,18,5])\n\t\tcube(size=[35, 2, 5], center=true);\n\ttranslate([0,0,-32.4])\n\t\tcylinder(r=fanrad, h=40, center=true, $fn=64);\n\tfor (z = [[screwcenter-9.4,screwcenter+7.7],\n\t\t\t\t[screwcenter-9.4,-screwcenter-7.7],\n\t\t\t\t[-screwcenter+9.4,screwcenter+7.7],\n\t\t\t\t[-screwcenter+9.4,-screwcenter-7.7]]){\n\t\ttranslate(z) \n\t\t\tcylinder(r=1.6, h=130, center=true, $fn=12);\n\t}\n\tdifference(){\n\t\tminkowski(){\n\t\t\tcube(size=[side-curve, side-curve, w], center=true);\n\t\t\tcylinder(r=curve, h=.1, $fn=20);\n\t\t}\n\t\/\/translate([29,20,0])\n\t\/\/\tcube(size=[4, 2, 2], center=true);\n\techo(\"realside = \", realside);\n\t}\n}\n\nmodule nut_insert(nutrad=6.15\/2, nutheight=2.6, into=6, direction=-1) {\n\/\/ slide in captured nuts\n\thull(){\n\t\tcylinder(r=nutrad, h=nutheight, center=true, $fn=6);\n\t\ttranslate([into*direction,0, 0])\n\t\t\tcylinder(r=nutrad, h=nutheight, center=true, $fn=6);\n\t\t}\n}\t\t\n\nmodule forbearance(screw=screwcenter+4.75){\n\/\/ bearings cut into four corners\n\tfor (z = [[screw,screw],\n\t\t\t\t[screw,-screw],\n\t\t\t\t[-screw,screw],\n\t\t\t\t[-screw,-screw]]){\n\t\ttranslate(z) translate([0,0,-15.9])\n\t\t\tz608z();\n\t\t\/\/ m3 bolts through 608zz centers\n\t\ttranslate(z) translate([0,0,-15.9])\n\t\t\tcylinder(r=1.6, h=30, center=true, $fn=12);\n\t\ttranslate(z) translate([0,0,0])\n\t\t\tcylinder(r=2.65, h=22, center=true, $fn=12);\n\t\ttranslate(z) translate([0,0,-26]){\n\t\t\tcylinder(r=3.1, h=2.5, center=true, $fn=6);\n\t\ttranslate([3*(z[0]\/z[1]),0,0])\n\t\t\tcylinder(r=3.6, h=2.5, center=true, $fn=6);\n\t\ttranslate([-3*(z[0]\/z[1]),0,0])\n\t\t\tcylinder(r=3.6, h=2.5, center=true, $fn=6);\n\t\t}\n\t}\n}\n\/\/small switch\nmodule contact_switch(len=13.4, dp=5.4, ht=6.4, blade_ht=65, bladew=1.8, bladethk=1){\n\tcube([len, dp, ht], center=false);\n\tfor (i=[.5, 5, 10.5]){\n\t\ttranslate([i+bladethk\/2, dp\/2, ht+blade_ht\/2]) \n\t\t\tcube([bladethk, bladew, blade_ht], center=true);\n\t}\n}\n\t\t\t\n\/\/ main section\nmodule main(baselevel=-46.8){\n\tdifference(){\n\t\ttranslate([0,outextendo\/2,-18])\n\t\tunion(){\n\t\t\/\/ the big box\n\t\t\tminkowski(){\n\t\t\tcube([outsidebox,outsidebox+outextendo,60], center=true);\n\t\t\tcylinder(r=2, h=.1, $fn=20);\n\t\t}\t\t\n\t\ttranslate([-bx, by*.6, bz\/2+4.5]) scale([.4,1.8,1])\n\t\t\tcylinder(r=8.8, h=26, center=true, $fn=64);\n\t\ttranslate([bx, by*.6, bz\/2+4.5]) scale([.4,1.8,1])\n\t\t\tcylinder(r=8.8, h=26, center=true, $fn=64);\n\t\t\/\/translate([0, -by*1.48, bz\/2+3]) scale([1.8,.4,1])\n\t\t\/\/\tcylinder(r=9, h=26, center=true, $fn=64);\n\t\t\/\/translate([0,33.15\/2,-12]) rotate([0,90,0])\n\t\t\/\/\tcylinder(r=screwd, h=71, center=true, $fn=20);\n\t\t\/\/translate([0,0,-12]) rotate([0,90,0])\n\t\t\/\/\tcylinder(r=screwd, h=71, center=true, $fn=20);\n\t\t}\n\t\tfan();\n\t\t\/\/ groove for gear\n\t\ttranslate([0,0,-16])\n\t\t\tring(fanrad*2+5, fanrad*2-.1, gearheight);\n\t\t\/\/ m3bearing bolt-head access\n\t\t\n\t\t\/\/ 4 pin holes for flap control\n\t\ttranslate([0,0,-17-lowknob]) rotate([0,90,45])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\ttranslate([0,0,-17-lowknob]) rotate([0,90,-45])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\ttranslate([0,0,-21.5]) rotate([0,90,51])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\ttranslate([0,0,-21.5]) rotate([0,90,-39])\n\t\t\tcylinder(r=pinrad, h=fanrad*2+10, center=true, $fn=5);\n\t\t\/\/ can is gripped here\n\t\ttranslate([0,0,-38])\n\t\t\tring(64.75, 63, 25);\n\t\t\/\/ taper to can\n\t\ttranslate([0,0,-45])\n\t\t\tcylinder(r1=62.2\/2, r2=fanrad, 12, center=true, $fn=64);\n\t\t\/\/ linear bearing holders\n\t\ttranslate([-bx, by*.8, bz])\n\t\t\tLMB6mm(rodlen=120);\n\t\ttranslate([bx, by*.8, bz])\n\t\t\tLMB6mm(rodlen=120);\n\t\t\/\/ captured nuts for attachments\n\t\ttranslate([-screwcenter, -(outsidebox-fanrad)+3, 0])\n\t\t\trotate([90,0,0]) m3nut();\n\t\ttranslate([screwcenter, -(outsidebox-fanrad)+3, 0])\n\t\t\trotate([90,0,0]) m3nut();\n\t\ttranslate([0, -(outsidebox-fanrad)+3, 0])\n\t\t\trotate([90,0,0]) m3nut();\n\t\t\/\/switches man, switches\n\t\ttranslate([-29, (outsidebox+outextendo)\/2+8, -48.1])\n\t\t\tcontact_switch();\n\t\ttranslate([8, (outsidebox+outextendo)\/2-9, -48.1]) rotate([0,0,-7])\n\t\t\tcontact_switch();\n\t\ttranslate([-8, -(outsidebox)\/2-5.5, -48.1]) rotate([0,0,0])\n\t\t\tcontact_switch();\n\t\t\/\/ ring mount bearings\n\t\tforbearance();\n\t\t\/\/ stepper for turning ring\n\t\t\/\/translate([0,52,-11]) rotate([90,0,0])\n\t\t\/\/\tsmall_stepper();\n\t\t\/\/ tiny gearmotor\n\t\ttranslate([0,34.7,-1]) rotate([0,-90,90])\n\t\t\tgearmotor();\n\t\t\/\/ spool mount hole for thread-drive of ring\n\t\ttranslate([0,outsidebox\/2+2.5, -16.0]) rotate([0,0,0])\n\t\t\tcylinder(r=4.68, h=7, center=true, $fn=128);\n\t\t\/\/ thread passageway\n\t\ttranslate([0,outsidebox\/2+2.5, -16.3]) rotate([0,90,0])\n\t\t\tcylinder(r=.7, h=60, center=true, $fn=6);\n\t}\n\/*\n\/\/ flaps for valve\ntranslate([sprd, -sprd, baselevel]) rotate([180,0,0])\n\tflaps();\ntranslate([sprd, sprd, baselevel]) rotate([180,0,90])\n\tflaps();\ntranslate([-sprd, sprd, baselevel]) rotate([180,0,180])\n\tflaps();\ntranslate([-sprd, -sprd, baselevel]) rotate([180,0,-90])\n\tflaps();\n*\/\n\/\/ knobs for valve leaves\nfor (i = [45,-45,135,-135]){\n\ttranslate([.5*fanrad\/sin(i),.5*fanrad\/cos(180-i),-17.8-lowknob])\n\t\tnodule(rat=i);\n\t\/\/translate([fanrad*sin(i+40),fanrad*cos(180-(i+40)),-13.7-lowknob])\n\t\/\/\tnodule(rat=(i+40));\n\/\/ push_down the flaps as they rotate\n\ttranslate([fanrad*sin(i+40),fanrad*cos(180-(i+40)),-13.7-lowknob])\n\t\tsphere(r=3.2);\n\t}\n}\n\nmodule main_bottom(){\n\tdifference(){\n\t\tmain();\n\t\ttranslate([0,0+outextendo\/2,-.1])\n\t\t\tcube([100,100+outextendo,fanheight], center=true);\n\t}\n}\n\nmodule main_top(){\ntranslate([(outsidebox+10), +29, 26\/2])\n\tdifference(){\n\t\tmain();\n\t\ttranslate([0,0+outextendo\/2,-42.4])\n\t\t\tcube([100,100+outextendo,60], center=true);\n\t}\n}\nmodule inner_ring(){\n\/\/ inner ring for printing\ntranslate([outsidebox+3, +outextendo, 0])\n\tdifference(){\n\t\tunion(){\n\t\t\t\/\/ bottom bevel grabber\n\t\t\tcylinder(r1=fanrad+2.1, r2=fanrad+1.8, h=.5, center=false, $fn=128);\n\t\t\t\/\/ mid-section w\/ thread\t\n\t\t\ttranslate([0,0,0.5])\n\t\t\t\tcylinder(r1=fanrad+1.8, r2=fanrad+1.4, h=3, center=false, $fn=128);\n\t\t\ttranslate([0,0,3.5])\n\t\t\t\tcylinder(r1=fanrad+1.4, r2=fanrad+1.8, h=3, center=false, $fn=128);\n\t\t\t\/\/ top bevel grabber\n\t\t\ttranslate([0,0,6.5])\n\t\t\t\tcylinder(r1=fanrad+1.8, r2=fanrad+2.1, h=.5, center=false, $fn=128);\n\t\t}\n\t\t\/\/ cut out from center\n\t\ttranslate([0,0,-0.1])\n\t\t\tcylinder(r1=fanrad-.6, r2=fanrad-.1, h=7.15, center=false, $fn=128);\n\t\t\/\/ wire holder holes\n\t\ttranslate([0,0,.9]) rotate([0,90,0])\n\t\t\tcylinder(r=pinrad, h=(fanrad+1)*2, center=true, $fn=6);\n\t\ttranslate([0,0,.9]) rotate([90,0,0])\n\t\t\tcylinder(r=pinrad, h=(fanrad+1)*2, center=true, $fn=6);\n\t}\n}\n\nmodule print_gasket(screw=screwcenter+4.75){\ntranslate([(outsidebox+8), -(outsidebox+5), 21])\n\tdifference(){\n\t\tmain_bottom();\n\t\t\n\t\ttranslate([0,0+outextendo\/2,-50])\n\t\t\tcube([100,100+outextendo,58], center=true);\n\t\ttranslate([0,0+outextendo\/2,-10])\n\t\t\tcube([100,100+outextendo,15.5], center=true);\n\t\ttranslate([0,0+outextendo\/2,-10])\n\t\t\tcube([100,100+outextendo,15.5], center=true);\n\t\tfor (z = [[screw,screw],\n\t\t\t\t[screw,-screw],\n\t\t\t\t[-screw,screw],\n\t\t\t\t[-screw,-screw]]){\n\t\t\t\/\/ m3 hex-bolt-heads\n\t\t\ttranslate(z) translate([0,0,-21.75+1.5])\n\t\t\t\tcylinder(r=2.75, h=3, center=true, $fn=12);\n\t\t}\n\t}\n}\nmodule can_holder(){\ntranslate([0, 0, 23+(50\/2)])\n\tdifference(){\n\ttranslate([0,-(outsidebox+5),0])\n\t\tmain_bottom();\n\ttranslate([0,-(outsidebox+5)+outextendo\/2,-16])\n\t\tcube([70,70+outextendo+10,12], center=true);\n\t}\n}\n\nmodule ring_holder(){\ntranslate([0,0+outextendo+1,22])\n\tdifference(){\n\t\tmain_bottom();\n\t\ttranslate([0,0+outextendo\/2,-50])\n\t\t\tcube([100,100+outextendo,56], center=true);\n\t}\n}\n\nmodule spool(){\n\/\/ round thread puller for motor attach\n\/\/first some spacers for flap-wires\ntranslate([15,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([-15,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([-10,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([10,+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([0,-10+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\ntranslate([0,10+outextendo,0])\n\tdifference(){\n\t\tcylinder(r=pinrad+1, h=12, center=false, $fn=18);\n\t\tcylinder(r=pinrad+.1, h=12.1, center=false, $fn=18);\n\t}\n\t\/\/ remember to adjust socket in main if changing radius here\ntranslate([0,+outextendo,7\/2]){\n\tdifference(){\n\ttranslate([0,0,-7\/2]) union(){\n\tcylinder(r1=4.5,r2=4.2, h=1.5, center=false, $fn=128);\n\ttranslate([0,0,1.5])\n\t\tcylinder(r1=4.2,r2=4.65, h=1.5, center=false, $fn=128);\n\ttranslate([0,0,3])\n\t\tcylinder(r1=4.65,r2=4.3, h=2, center=false, $fn=128);\n\ttranslate([0,0,5])\n\t\tcylinder(r1=4.3,r2=4.65, h=2, center=false, $fn=128);\n\t\t\t}\n\t\t\/\/ nub insert for gear-motor\n\t\ttranslate([0,0,(7-5.25)\/2]){\n\t\t\tdifference(){\n\t\t\t\tcylinder(r=3.63, h=5.3, center=true, $fn=64);\n\t\t\t\ttranslate([3.57,0,0])\n\t\t\t\t\tcube([(3.57-4.9\/2)*2, 5.4, 6], center=true);\n\t\t\t\ttranslate([-3.57,0,0])\n\t\t\t\t\tcube([(3.57-4.9\/2)*2, 5.4, 6], center=true);\n\t\t\t}\n\t\t}\n\t\tcylinder(r=1, h=8, center=true, $fn=12);\n\t\ttranslate([0,0,1.35]) rotate([0,90,0])\n\t\t\tcylinder(r=.6, h=10, center=true, $fn=12);\n\t\ttranslate([0,0,0])\n\t\t\tcube([5.7,.4,3.7], center=true);\n\t}\n}}\n\n\n\/\/ samples for export\n\/\/rotate([0,180,0]) translate([0,0,-fanheight])\n\/\/\tmain_top();\n\n\/\/print_gasket();\n\n\/\/inner_ring();\n\n\/\/spool();\n\/\/rotate([0,0,-90]) translate([50,20,0])\n\/\/\tcan_holder();\n\n\/\/ring_holder();\n\nm3nut(capture_channel=50, channel_dir=13);\n\/\/pusher_down();\n\n\/\/contact_switch();\n\n\/\/ sample bearing\n\/\/z608z();\n\t\t\n\t\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"059a92b0ccb65794680650d3afebf22c4ac8be27","subject":"The path was corrected.","message":"The path was corrected.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/models\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/square\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6,\r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n\t\t\t chaneLoopCutoutAxis = \"x\",\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\",\r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Helvetica\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8,\r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight,\r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset,\r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n }\r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth,\r\n baseHeight,\r\n roundedCorners,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n showBorder,\r\n borderradius,\r\n borderdistance)\r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText,\r\n textSize = textSize,\r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\r\n \/\/ Having the assignments in the method call caused an issue.\r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\r\n\r\n if (holes==2)\r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n if (holes==4)\r\n {\r\n base4holes(baseColor, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail();\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=5);\r\n\/\/ \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor, baseThickness, baseWidth, baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType,\r\n leftIconXyScale,\r\n rightIconXyScale,\r\n leftIconHeight,\r\n rightIconHeight,\r\n xOffset,\r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n\r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n roundedCorners)\r\n{\r\n size = [baseWidth, baseHeight, baseThickness];\r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8,\r\n sides=30,\r\n sidesOnly=true,\r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n\r\n xTranslate = -x \/ 2.0;\r\n\r\n\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\r\n yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n\r\n translate([xTranslate, yTranslate, 0])\r\n chainLoop(cutoutAxis = chaneLoopCutoutAxis,\r\n\t\t\t\t xLength = x,\r\n yLength = y,\r\n yPercentage = chainLoopLengthPercentageY,\r\n zLength = chainLoopLengthZ,\r\n zPercentage = chainLoopLengthPercentageZ);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection()\r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\n\/\/module trebleClefScaledDown(h)\r\n\/\/{\r\n\/\/ scale([25.4\/90, -25.4\/90, 1]) union()\r\n\/\/ {\r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ linear_extrude(height=h)\r\n\/\/ polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6,\r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n\t\t\t chaneLoopCutoutAxis = \"x\",\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\",\r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Helvetica\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font=font,\r\n letterThickness,\r\n topText=topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8,\r\n borderdistance = 5);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight,\r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset,\r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n }\r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n baseThickness,\r\n borderColor,\r\n borderHeight,\r\n font,\r\n letterThickness,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth,\r\n baseHeight,\r\n roundedCorners,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n showBorder,\r\n borderradius,\r\n borderdistance)\r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText,\r\n textSize = textSize,\r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\r\n \/\/ Having the assignments in the method call caused an issue.\r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners);\r\n }\r\n\r\n if (holes==2)\r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n if (holes==4)\r\n {\r\n base4holes(baseColor, baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail();\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=5);\r\n\/\/ \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor, baseThickness, baseWidth, baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType,\r\n leftIconXyScale,\r\n rightIconXyScale,\r\n leftIconHeight,\r\n rightIconHeight,\r\n xOffset,\r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n\r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n roundedCorners)\r\n{\r\n size = [baseWidth, baseHeight, baseThickness];\r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8,\r\n sides=30,\r\n sidesOnly=true,\r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n\r\n xTranslate = -x \/ 2.0;\r\n\r\n\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\r\n yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n\r\n translate([xTranslate, yTranslate, 0])\r\n chainLoop(cutoutAxis = chaneLoopCutoutAxis,\r\n\t\t\t\t xLength = x,\r\n yLength = y,\r\n yPercentage = chainLoopLengthPercentageY,\r\n zLength = chainLoopLengthZ,\r\n zPercentage = chainLoopLengthPercentageZ);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n borderHeight,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n\/\/ linear_extrude(height = 6, center = false, convexity = 10, twist = 0)\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n\/\/ linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection()\r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\n\/\/module trebleClefScaledDown(h)\r\n\/\/{\r\n\/\/ scale([25.4\/90, -25.4\/90, 1]) union()\r\n\/\/ {\r\n\/\/ difference()\r\n\/\/ {\r\n\/\/ linear_extrude(height=h)\r\n\/\/ polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n\/\/ translate([0, 0, -fudge])\r\n\/\/ linear_extrude(height=h+2*fudge)\r\n\/\/ polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"12dbcbdc08cfc7c6d70d6735d34cba191272fe0d","subject":"The diagonal lines were added.","message":"The diagonal lines were added.","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/cosplay\/star-trek\/masaka-mask-by-data\/masaka-mask-by-data.scad","new_file":"openscad\/models\/src\/main\/openscad\/cosplay\/star-trek\/masaka-mask-by-data\/masaka-mask-by-data.scad","new_contents":"\n\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>\n\nmasakasMask();\n\nmodule masakasMask()\n{\n\trightEdge_x = 53;\n\n\ttopRadius = rightEdge_x + 20;\n\n\tdifference()\n\t{\n\t\tmasakasMask_solid(topRadius, rightEdge_x);\n\n\t\tmasakasMask_cutouts(topRadius, rightEdge_x);\n\t}\n}\n\n\/\/ support modules follow\n\nmodule masakasMask_bottom(rightEdge_x)\n{\n\tmasakasMask_cheekFlap();\n\n\txTranslate = rightEdge_x * 2;\n\tzTranslate = 1;\n\n\t\/\/ the mirrored cheek flap\n\ttranslate([xTranslate, 0, zTranslate])\n\trotate([0,180,0])\n\tmasakasMask_cheekFlap();\n\n}\n\nmodule masakasMask_cheekFlap()\n{\n\tminkowski()\n\t{\n\t\tlinear_extrude(height=1, scale=[1,1], slices=20, twist=0)\n\t\tpolygon(points=\n\t\t[\n\t\t\t[0,0],[15,-15],[30,-5],\n\n\t\t\t[35, 20],\n\n\t\t\t\/\/ inner cheek area\n\t\t\t[38, 23],\n\n\t\t\t\/\/ nose bridge\n\t\t\t[48, 25], [53, 27],\n\n\t\t\t\/\/ right edge\n\t\t\t[53, 40],\n\n\t\t\t\/\/ outer cheek\n\t\t\t[25, 28]\n\n\t\t]);\n\n\t sphere(r=1, $fn=10);\n\t}\n}\n\nmodule masakasMask_cutouts(topRadius, rightEdge_x)\n{\n\tmasakasMask_EyeCutouts(rightEdge_x);\n\n\t\/\/ bottom flattener\n\ttranslate([0,0, -1.7])\n\tcube([400, 400, 2], center= true);\n}\n\nmodule masakasMask_EyeCutouts(rightEdge_x)\n{\n\txTranslateOffset = 22;\n\n\txTranslate = rightEdge_x - xTranslateOffset;\n\tyTranslate = 34;\n\n\ttranslate([xTranslate, yTranslate, -15])\n\tmasakasMask_LeftEyeCoutout();\n\n\t\/\/ right eye mirrored from left\n\trightEye_xTranslate = rightEdge_x + xTranslateOffset;\n\ttranslate([rightEye_xTranslate, yTranslate, 20])\n\trotate([0,180,0])\n\tmasakasMask_LeftEyeCoutout();\n}\n\nmodule masakasMask_LeftEyeCoutout(rightEdge_x)\n{\n\tminkowski()\n\t{\n\t\tlinear_extrude(height=50, scale=[1,1], slices=20, twist=0)\n\t\tpolygon(points=\n\t\t[\n\t\t\t\/\/ below the first direction is the side, second direction is the orientation on that side\n\n\t\t\t\/\/ top left\n\t\t\t[0,0],\n\n\t\t\t\/\/ left bottom\n\t\t\t[4,-6],\n\n\t\t\t\/\/ bottom right\n\t\t\t[11,-6],\n\n\t\t\t\/\/ diagnal top\n\t\t\t[14, -4],\n\n\t\t\t\/\/ right top\n\t\t\t[15, 1]\n\n\t\t]);\n\n\t\tcylinder(r=1, $fn=30);\n\t}\n}\n\nmodule masakasMask_solid(topRadius, rightEdge_x)\n{\n\tunion()\n\t{\n\t\ttranslate([rightEdge_x, 51, 6])\n\t\trotate([-14, 0, 0])\n\t\tmasakasMask_sunEmblem();\n\n\t\tmasakasMask_top(radius = topRadius,\n\t\t\t\t\t\trightEdge_x = rightEdge_x);\n\n\t\tmasakasMask_bottom(rightEdge_x = rightEdge_x);\n\t}\n}\n\nmodule masakasMask_sunEmblem()\n{\n\tinnerRadius = 6;\n\tminkowskiSphereRadius = 2;\n\touterRadius = 7;\n\n\troundDoughnut(height = 1,\n\t\t\t\t innerRadius = innerRadius,\n\t\t \t\t minkowskiSphereRadius = minkowskiSphereRadius,\n\t\t\t outerRadius = outerRadius);\n\n ringRadius = outerRadius + minkowskiSphereRadius;\n\n\tdifference()\n\t{\n\t\ttranslate([0, 0, 1])\n\t\tmasakasMask_sunEmblemLines(ringRadius = ringRadius);\n\n\t\tcylinder(r = innerRadius,\n\t\t\t\t h = 10,\n\t\t\t\t center = true);\n\t}\n}\n\nmodule masakasMask_sunEmblemSingleLine(height, radius)\n{\n\tcolor(\"green\")\n\trotate([0,90,0])\n\tcylinder(h = height,\n\t\t\t r = radius);\n}\n\nmodule masakasMask_sunEmblemLines()\n{\n\tmasakasMask_sunEmblemCrossLines(radius = 0.5,\n\t\t\t\t\t\t\t\t\tyTranslate = 1.5);\n\n\tmasakasMask_sunEmblemDiagnalLines();\n}\n\nmodule masakasMask_sunEmblemCrossLines(radius,\n\t\t\t\t\t\t\t\t\t yTranslate)\n{\n\/\/TODO where is this used?\n\tringRadius = 7;\n\n\theight = 35;\n\n\txTranslate = -(height \/ 2.0 ) ;\n\n\ttranslate([xTranslate, yTranslate, 0])\n\tmasakasMask_sunEmblemSingleLine(height = height,\n\t\t\t\t\t\t\t radius = radius);\n\n translate([xTranslate, -yTranslate, 0])\n masakasMask_sunEmblemSingleLine(height = height,\n\t \t\t\t\t\t\t radius = radius);\n\n vertical_xTranslate = -yTranslate;\n\tvertical_yTranslate = xTranslate;\n\n\ttranslate([vertical_xTranslate, vertical_yTranslate, 0])\n rotate([0, 0, 90])\n masakasMask_sunEmblemSingleLine(height = height,\n \t\t\t\t\t\t \t radius = radius);\n\n translate([-vertical_xTranslate, vertical_yTranslate, 0])\n rotate([0, 0, 90])\n masakasMask_sunEmblemSingleLine(height = height,\n\t\t\t\t\t\t \t radius = radius);\n}\n\nmodule masakasMask_sunEmblemDiagnalLines()\n{\n\trotate([0, 0, 45])\n\tmasakasMask_sunEmblemCrossLines(radius = 1.5,\n\t\t\t\t\t\t\t\t\tyTranslate = 3);\n}\n\nmodule masakasMask_top(radius, rightEdge_x)\n{\n\tcube_zLength = 10;\n\n\txTranslate = rightEdge_x;\n\tyTranslate = 29;\n\tzTranslate = -radius + cube_zLength - 0.450;\n\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\n\tdifference()\n\t{\n\t\tsphere(r = radius, $fn = 60);\n\n\t\t\/\/ xy plane cutout\n\t\ttranslate([0, 0, -10])\n\t\tcube([400, 400, 145], center=true);\n\n\t\t\/\/ xz plane cutout\n\t\tcolor(\"green\")\n\t\ttranslate([0, -radius\/2.0, -10])\n\t\tcube([190, radius, 190], center=true);\n\t}\n}\n","old_contents":"\n\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>\n\nmasakasMask();\n\nmodule masakasMask()\n{\n\trightEdge_x = 53;\n\n\ttopRadius = rightEdge_x + 20;\n\n\tdifference()\n\t{\n\t\tmasakasMask_solid(topRadius, rightEdge_x);\n\n\t\tmasakasMask_cutouts(topRadius, rightEdge_x);\n\t}\n}\n\n\/\/ support modules follow\n\nmodule masakasMask_bottom(rightEdge_x)\n{\n\tmasakasMask_cheekFlap();\n\n\txTranslate = rightEdge_x * 2;\n\tzTranslate = 1;\n\n\t\/\/ the mirrored cheek flap\n\ttranslate([xTranslate, 0, zTranslate])\n\trotate([0,180,0])\n\tmasakasMask_cheekFlap();\n\n}\n\nmodule masakasMask_cheekFlap()\n{\n\tminkowski()\n\t{\n\t\tlinear_extrude(height=1, scale=[1,1], slices=20, twist=0)\n\t\tpolygon(points=\n\t\t[\n\t\t\t[0,0],[15,-15],[30,-5],\n\n\t\t\t[35, 20],\n\n\t\t\t\/\/ inner cheek area\n\t\t\t[38, 23],\n\n\t\t\t\/\/ nose bridge\n\t\t\t[48, 25], [53, 27],\n\n\t\t\t\/\/ right edge\n\t\t\t[53, 40],\n\n\t\t\t\/\/ outer cheek\n\t\t\t[25, 28]\n\n\t\t]);\n\n\t sphere(r=1, $fn=10);\n\t}\n}\n\nmodule masakasMask_cutouts(topRadius, rightEdge_x)\n{\n\tmasakasMask_EyeCutouts(rightEdge_x);\n\n\t\/\/ bottom flattener\n\ttranslate([0,0, -1.7])\n\tcube([400, 400, 2], center= true);\n}\n\nmodule masakasMask_EyeCutouts(rightEdge_x)\n{\n\txTranslateOffset = 22;\n\n\txTranslate = rightEdge_x - xTranslateOffset;\n\tyTranslate = 34;\n\n\ttranslate([xTranslate, yTranslate, -15])\n\tmasakasMask_LeftEyeCoutout();\n\n\t\/\/ right eye mirrored from left\n\trightEye_xTranslate = rightEdge_x + xTranslateOffset;\n\ttranslate([rightEye_xTranslate, yTranslate, 20])\n\trotate([0,180,0])\n\tmasakasMask_LeftEyeCoutout();\n}\n\nmodule masakasMask_LeftEyeCoutout(rightEdge_x)\n{\n\tminkowski()\n\t{\n\t\tlinear_extrude(height=50, scale=[1,1], slices=20, twist=0)\n\t\tpolygon(points=\n\t\t[\n\t\t\t\/\/ below the first direction is the side, second direction is the orientation on that side\n\n\t\t\t\/\/ top left\n\t\t\t[0,0],\n\n\t\t\t\/\/ left bottom\n\t\t\t[4,-6],\n\n\t\t\t\/\/ bottom right\n\t\t\t[11,-6],\n\n\t\t\t\/\/ diagnal top\n\t\t\t[14, -4],\n\n\t\t\t\/\/ right top\n\t\t\t[15, 1]\n\n\t\t]);\n\n\t\tcylinder(r=1, $fn=30);\n\t}\n}\n\nmodule masakasMask_solid(topRadius, rightEdge_x)\n{\n\tunion()\n\t{\n\t\ttranslate([rightEdge_x, 51, 8])\n\t\trotate([-10, 0, 0])\n\t\tmasakasMask_sunEmblem();\n\n\t\tmasakasMask_top(radius = topRadius,\n\t\t\t\t\t\trightEdge_x = rightEdge_x);\n\n\t\tmasakasMask_bottom(rightEdge_x = rightEdge_x);\n\t}\n}\n\nmodule masakasMask_sunEmblem()\n{\n\tinnerRadius = 6;\n\tminkowskiSphereRadius = 2;\n\touterRadius = 7;\n\n\troundDoughnut(height = 1,\n\t\t\t\t innerRadius = innerRadius,\n\t\t \t\t minkowskiSphereRadius = minkowskiSphereRadius,\n\t\t\t outerRadius = outerRadius);\n\n ringRadius = outerRadius + minkowskiSphereRadius;\n\n\tdifference()\n\t{\n\t\tmasakasMask_sunEmblemLines(ringRadius = ringRadius);\n\n\t\tcylinder(r = innerRadius,\n\t\t\t\t h = 10,\n\t\t\t\t center = true);\n\t}\n}\n\nmodule masakasMask_sunEmblemLine(height, radius)\n{\n\tcolor(\"green\")\n\trotate([0,90,0])\n\tcylinder(h = height,\n\t\t\t r = radius);\n}\n\nmodule masakasMask_sunEmblemLines()\n{\n\tmasakasMask_sunEmblemCrossLines();\n\n\tmasakasMask_sunEmblemDiagnalLines();\n}\n\nmodule masakasMask_sunEmblemCrossLines()\n{\nringRadius = 7;\n\n\theight = 35;\n\tradius = 1;\n\n\txTranslate = -(height \/ 2.0 ) ;\n\tyTranslate = 3;\n\n\ttranslate([xTranslate, yTranslate, 0])\n\tmasakasMask_sunEmblemLine(height = height,\n\t\t\t\t\t\t\t radius = radius);\n\n translate([xTranslate, -yTranslate, 0])\n masakasMask_sunEmblemLine(height = height,\n\t \t\t\t\t\t\t radius = radius);\n\n vertical_xTranslate = -yTranslate;\n\tvertical_yTranslate = xTranslate;\n\n\ttranslate([vertical_xTranslate, vertical_yTranslate, 0])\n rotate([0, 0, 90])\n masakasMask_sunEmblemLine(height = height,\n \t\t\t\t\t\t \t radius = radius);\n\n translate([-vertical_xTranslate, vertical_yTranslate, 0])\n rotate([0, 0, 90])\n masakasMask_sunEmblemLine(height = height,\n\t\t\t\t\t\t \t radius = radius);\n}\n\nmodule masakasMask_sunEmblemDiagnalLines()\n{\n\n}\n\nmodule masakasMask_top(radius, rightEdge_x)\n{\n\tcube_zLength = 10;\n\n\txTranslate = rightEdge_x;\n\tyTranslate = 29;\n\tzTranslate = -radius + cube_zLength - 0.450;\n\n\ttranslate([xTranslate, yTranslate, zTranslate])\n\n\tdifference()\n\t{\n\t\tsphere(r = radius, $fn = 60);\n\n\t\t\/\/ xy plane cutout\n\t\ttranslate([0, 0, -10])\n\t\tcube([400, 400, 145], center=true);\n\n\t\t\/\/ xz plane cutout\n\t\tcolor(\"green\")\n\t\ttranslate([0, -radius\/2.0, -10])\n\t\tcube([190, radius, 190], center=true);\n\t}\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"d0ef11929c177c1f3bd682233f6fa6541d8e208f","subject":"Update belt clamp with known-working version","message":"Update belt clamp with known-working version\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"shapeoko-beltclamp\/beltclamp.scad","new_file":"shapeoko-beltclamp\/beltclamp.scad","new_contents":"\/\/ This printed part is one possible way to anchor Shapeoko belts.\n\/\/ See http:\/\/www.shapeoko.com\/wiki\/index.php\/Belt_Anchors for other ideas.\n\/\/ Motivated by http:\/\/www.thingiverse.com\/thing:33881 not being strong enough\n\/\/ when I initially printed it.\n\n\/\/ Upright: printed, but not stress tested, looks sturdy\n\/\/ Top: completely untested\n\ngThick = 8;\ngRibHeight = 6;\ngTopRoundoverRadius = 4;\ngSideRoundoverRadius = 4;\ngMainWidth = 16;\ngMainHeight = 66;\n\ngTopWidth = 30;\ngRibWidth = 3.4;\ngRibLength = 50;\ngHoleSpacing = 20;\ngBeltWide = 14; \/\/ 1\/4\" belt + slop\ngBeltPitch = 2.032; \/\/ MXL in mm\ngBeltThick = 1.5;\ne = 0.02;\n\n\/\/ screw_clearance_diameter, socket_head_clearance_diameter, nut outside diameter\n\/\/ TODO untested numbers, these should move to a common include.\nM3 = [3.8, 6.4, 6.5];\nM5 = [5.5, 9.4, 9.4];\nM8 = [8, 13, 13];\n\nmodule InsetHole(x) {\n d = x[0];\n socket_head = x[1];\n union() {\n translate([0,0,-50]) cylinder(r=d\/2, h=100);\n cylinder(r=socket_head\/2, h=10);\n }\n}\n\nmodule NutHole(x) {\n d = x[0];\n nut_size = x[2];\n union() {\n translate([0,0,1]) cylinder(r=d\/2, h=50);\n cylinder(r=nut_size\/2, $fn=6, h=6);\n }\n}\n\nmodule Rib(t=4) {\n translate([-t\/2,0,-0.1])\n rotate([90,0,90])\n linear_extrude(height=t)\n polygon(points=[[0,0],[gRibLength,0],[0,gRibHeight]],paths=[[0,1,2]]);\n}\n\nmodule Roundover(r) {\n translate([0.1,0.1,-50])\n difference() {\n cube([r,r,100]);\n translate([0,0,-1]) cylinder(r=r,h=102,$fn=20);\n }\n}\n\nmodule Upright() {\n difference() {\n union() {\n \/\/ body, for now (until beziers work)\n translate([0,-gMainHeight\/2-4.9,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n translate([0,0,gThick\/2]) cube([gMainWidth,gMainHeight,gThick], center=true);\n \/\/ ribs\n translate([(gMainWidth-gRibWidth)\/2,-gMainHeight\/2,gThick]) Rib(t=gRibWidth);\n translate([-(gMainWidth-gRibWidth)\/2,-gMainHeight\/2,gThick]) Rib(t=gRibWidth);\n }\n \/\/ Chamfer top edges\n \/\/ TODO make these translation numbers constants as well, and fix Roundover's\n \/\/ origin.\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ Chamfer edges near bottom mounting hole\n translate([gMainWidth\/2-gSideRoundoverRadius,gMainHeight\/2-4,0])\n Roundover(r=gSideRoundoverRadius);\n translate([-(gMainWidth\/2-gSideRoundoverRadius),gMainHeight\/2-4,0])\n rotate([0,0,90])\n Roundover(r=gSideRoundoverRadius);\n \/\/ M5 mounting holes\n translate([0,gMainHeight\/2-30,gThick-2]) InsetHole(M5);\n translate([0,gMainHeight\/2-10,gThick-2]) InsetHole(M5);\n \/\/ M3 nut traps (20mm spacing, for compat with old part)\n translate([-gHoleSpacing\/2,-gMainHeight\/2+4,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,-gMainHeight\/2+4,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n }\n}\n\nmodule Belt() {\n translate([0,0,gBeltThick\/2]) cube([gBeltWide,30,gBeltThick], center=true);\n for(i = [0:30\/gBeltPitch]) {\n translate([0,i * gBeltPitch,-gBeltThick\/2+e]) cube([gBeltWide,gBeltPitch \/ 2,gBeltThick], center=true);\n }\n}\n\nmodule Top() {\n rotate([-90,0,0]) difference() {\n translate([0,-6\/2,(gThick+gRibHeight)\/2]) cube([gTopWidth,6,gThick+gRibHeight], center=true);\n \/\/ holes\n translate([-gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n \/\/ chamfer\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ TODO remove magic number\n translate([0,-8+(1.6*gBeltThick),0]) rotate([90,0,0]) Belt();\n }\n}\n\nunion() {\n Upright();\n translate([0,-gMainHeight\/2-12,0]) rotate([0,0,180]) Top();\n}\n\/\/union() {\n\/\/ for(i=[1:4]) {\n\/\/ translate([0,-15*i,0]) Top();\n\/\/ }\n\/\/}\n","old_contents":"\/\/ This printed part is one possible way to anchor Shapeoko belts.\n\/\/ See http:\/\/www.shapeoko.com\/wiki\/index.php\/Belt_Anchors for other ideas.\n\/\/ Motivated by http:\/\/www.thingiverse.com\/thing:33881 not being strong enough\n\/\/ when I initially printed it.\n\n\/\/ Upright: printed, but not stress tested, looks sturdy\n\/\/ Top: completely untested\n\ngThick = 8;\ngRibHeight = 6;\ngTopRoundoverRadius = 4;\ngSideRoundoverRadius = 4;\ngMainWidth = 16;\ngTopWidth = 30;\ngRibWidth = 3.4;\ngHoleSpacing = 20;\ngBeltWide = 14; \/\/ 1\/4\" belt + slop\ngBeltPitch = 2.032; \/\/ MXL in mm\ngBeltThick = 1.5;\ne = 0.02;\n\n\/\/ screw_clearance_diameter, socket_head_clearance_diameter, nut outside diameter\n\/\/ TODO untested numbers, these should move to a common include.\nM3 = [3.5, 6.4, 6.4];\nM5 = [5.5, 9.4, 9.4];\nM8 = [8, 13, 13];\n\nmodule InsetHole(x) {\n d = x[0];\n socket_head = x[1];\n union() {\n translate([0,0,-50]) cylinder(r=d\/2, h=100);\n cylinder(r=socket_head\/2, h=10);\n }\n}\n\nmodule NutHole(x) {\n d = x[0];\n nut_size = x[2];\n union() {\n translate([0,0,1]) cylinder(r=d\/2, h=50);\n cylinder(r=nut_size\/2, $fn=6, h=6);\n }\n}\n\nmodule Rib(t=4) {\n translate([-t\/2,0,-0.1])\n rotate([90,0,90])\n linear_extrude(height=t)\n polygon(points=[[0,0],[40,0],[0,gRibHeight]],paths=[[0,1,2]]);\n}\n\nmodule Roundover(r) {\n translate([0.1,0.1,-50])\n difference() {\n cube([r,r,100]);\n translate([0,0,-1]) cylinder(r=r,h=102,$fn=20);\n }\n}\n\nmodule Upright() {\n difference() {\n union() {\n \/\/ body, for now (until beziers work)\n translate([0,-25,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n translate([0,0,gThick\/2]) cube([gMainWidth,60,gThick], center=true);\n \/\/ ribs\n translate([(gMainWidth-gRibWidth)\/2,-20,gThick]) Rib(t=gRibWidth);\n translate([-(gMainWidth-gRibWidth)\/2,-20,gThick]) Rib(t=gRibWidth);\n }\n \/\/ Chamfer top edges\n \/\/ TODO make these translation numbers constants as well, and fix Roundover's\n \/\/ origin.\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ Chamfer edges near bottom mounting hole\n translate([gMainWidth\/2-gSideRoundoverRadius,26,0])\n Roundover(r=gSideRoundoverRadius);\n translate([-(gMainWidth\/2-gSideRoundoverRadius),26,0])\n rotate([0,0,90])\n Roundover(r=gSideRoundoverRadius);\n \/\/ M5 mounting holes\n translate([0,0,gThick-2]) InsetHole(M5);\n translate([0,20,gThick-2]) InsetHole(M5);\n \/\/ M3 nut traps (20mm spacing, for compat with old part)\n translate([-gHoleSpacing\/2,-16,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,-16,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n }\n}\n\nmodule Belt() {\n translate([0,0,gBeltThick\/2]) cube([gBeltWide,30,gBeltThick], center=true);\n for(i = [0:30\/gBeltPitch]) {\n translate([0,i * gBeltPitch,-gBeltThick\/2+e]) cube([gBeltWide,gBeltPitch \/ 2,gBeltThick], center=true);\n }\n}\n\nmodule Top() {\n rotate([-90,0,0]) difference() {\n translate([0,-5,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n \/\/ holes\n translate([-gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n \/\/ chamfer\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ TODO remove 12 as magic number\n translate([0,-12+(1.6*gBeltThick),0]) rotate([90,0,0]) Belt();\n }\n}\n\nunion() {\n Upright();\n translate([0,-50,0]) Top();\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"599d73dea91cb85a4f6e35d9d2d31758ef3857ac","subject":"Protect sinusoid() and cosinusoid() when the length is null","message":"Protect sinusoid() and cosinusoid() when the length is null\n","repos":"jsconan\/camelSCAD","old_file":"core\/line.scad","new_file":"core\/line.scad","new_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Lines handling.\r\n *\r\n * @package core\/line\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Computes the coordinates of a 2D arc by rotating a vector along the provided angle.\r\n *\r\n * @param Number|Vector r - The number or the vector that defines the radius of the arc (can be ellipse).\r\n * @param Number [a] - The angle to cover.\r\n * @param Vector [o] - The coordinates of the center of the arc.\r\n * @param Number [a1] - The start angle of the arc.\r\n * @param Number [a2] - The end angle of the arc.\r\n * @returns Vector[]\r\n *\/\r\nfunction arc(r, a=DEGREES, o, a1, a2) =\r\n let(\r\n r = vector2D(r),\r\n o = vector2D(o),\r\n a1 = deg(a1),\r\n a2 = a2 != undef ? deg(a2) : a1 + deg(a)\r\n )\r\n !r[0] || !r[1] || (!a1 && !a2) ? []\r\n :let(\r\n start = min(a1, a2),\r\n end = max(a1, a2),\r\n range = end - start,\r\n step = astep(max(r), absdeg(range)),\r\n inc = sign(a2 - a1) * step\r\n )\r\n complete(\r\n \/\/ intermediate points\r\n range <= step ? []\r\n :[ for (a = [a1 + inc : inc : a2]) arcp(r, a) + o ],\r\n \/\/ the start point\r\n arcp(r, a1) + o,\r\n \/\/ the final point\r\n arcp(r, a2) + o\r\n )\r\n;\r\n\r\n\/**\r\n * Computes a sinusoid wave.\r\n * Without angle, the line will be horizontal.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the sinusoid.\r\n * @param Number p - The phase of the sinusoid (the start angle).\r\n * @param Number o - The offset of the sinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction sinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n !l ? []\r\n :[\r\n for (x = [0 : step : l])\r\n let( p = sinp(x=x, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a cosinusoid wave.\r\n * Without angle, the line will be vertical.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the cosinusoid.\r\n * @param Number p - The phase of the cosinusoid (the start angle).\r\n * @param Number o - The offset of the cosinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction cosinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n !l ? []\r\n :[\r\n for (y = [0 : step : l])\r\n let( p = cosp(y=y, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a line from a path.\r\n *\r\n * A path is composed of commands, each one being a simple array starting by the\r\n * command name. Each command will produce points relative to the last command\r\n * or to the last existing point. When the line starts it will rely on the\r\n * existing points, if any. If no existing points is provided, the line will\r\n * start from the absolute origin ([0, 0]), unless the first command is a point.\r\n *\r\n * The following commands are recognized:\r\n * - P, Point: [\"P\", , ] | [\"P\", ] - Adds a point at the given absolute coordinates.\r\n * - L, Line: [\"L\", , ] | [\"L\", ] - Adds a line from the last point to the given relative coordinates.\r\n * - H, Horizontal line: [\"H\", ] - Adds an horizontal line from the last point with the given length. The sign of the length determines the direction.\r\n * - V, Vertical line: [\"V\", ] - Adds a vertical line from the last point with the given length. The sign of the length determines the direction.\r\n * - I, Intersection: [\"I\", , , ] - Adds a line from the last point, that pass through P1 and intersects with the line defined by P2 and P3.\r\n * - T, Tangent: [\"T\", , , ] | [\"T\", , ] - Adds a line from the last point, that ends at the tangent point with the defined circle. The sign of the radius determines the direction\r\n * - A, Angle: [\"A\", , ] - Adds a leaned line from the last point with the given angle and the given length. The sign of the length determines the direction.\r\n * - C, Circle: [\"C\", , , ] - Adds a circle arc from the last point with the given radius and with the given angle.\r\n * - B, Bezier curve: [\"B\", , , ] - Adds a cubic bezier curve from the last point with the given control points (up to 3, the first beeing the last existing point).\r\n *\r\n * @param Array p - The path from which build the line\r\n * @param Vector[] points - The existing points to start the line from.\r\n * @param Number i - The start index in the path (default: 0)\r\n * @returns Vector[]\r\n *\/\r\nfunction path(p, points, i) =\r\n let(\r\n p = array(p),\r\n i = integer(i),\r\n points = array(points),\r\n length = len(points),\r\n point = vector2D(points[length - 1]),\r\n cur = p[i],\r\n cmd = cur[0],\r\n l = len(cur)\r\n )\r\n i >= len(p) ? points\r\n :let(\r\n values = (\r\n l <= 1 ? [point]\r\n :cmd == \"P\" || cmd == \"p\" ? [isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2])]\r\n :cmd == \"L\" || cmd == \"l\" ? [point, point + (isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2]))]\r\n :cmd == \"H\" || cmd == \"h\" ? [point, point + apply2D(x=cur[1])]\r\n :cmd == \"V\" || cmd == \"v\" ? [point, point + apply2D(y=cur[1])]\r\n :cmd == \"I\" || cmd == \"i\" ? [point, intersect2D(point, cur[1], cur[2], cur[3])]\r\n :cmd == \"T\" || cmd == \"t\" ? let(isv = isVector(cur[1])) [point, tangent2D(point, isv ? cur[1] : apply2D(x=cur[1], y=cur[2]), isv ? cur[2] : cur[3])]\r\n :cmd == \"A\" || cmd == \"a\" ? [point, point + arcPoint(a=cur[1], r=cur[2])]\r\n :cmd == \"C\" || cmd == \"c\" ? arc(r=cur[1], a1=cur[2], a2=cur[3], o=point + arcPoint(a=float(cur[2]) + STRAIGHT, r=cur[1]))\r\n :cmd == \"B\" || cmd == \"b\" ? (\r\n l >= 4 ? concat([point], cubicBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2]), point + vector2D(cur[3])))\r\n :l == 3 ? concat([point], quadraticBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2])))\r\n :[point, point + vector2D(cur[1])]\r\n )\r\n :[]\r\n )\r\n )\r\n path(p=p, points=concat(values[0] == point ? slice(points, 0, -1) : points, values), i=i + 1)\r\n;\r\n\r\n\/**\r\n * Computes the outline of a polygon. The outline can be at a particular distance.\r\n *\r\n * @param Vector[] points - The points defining the polygon to outline.\r\n * @param Number distance - The distance from the polygon for the outline.\r\n * A positive distance will place the outline outside,\r\n * while a negative distance will place it inside.\r\n * @returns Vector[]\r\n *\/\r\nfunction outline(points, distance) =\r\n let(\r\n points = array(points),\r\n l = len(points),\r\n prev = l - 1,\r\n next = 1\r\n )\r\n l >= 3 ? [\r\n for (i = [0 : 1 : l - 1])\r\n vertexOutline2D(\r\n a=points[(i + prev) % l],\r\n v=points[i],\r\n b=points[(i + next) % l],\r\n distance=distance\r\n )\r\n ] : points\r\n;\r\n\r\n\/**\r\n * Adds a value to each point of a line.\r\n *\r\n * @param Vector[] points - The points defining the line.\r\n * @param Number|Vector value - The value to add to the line.\r\n * @returns Vector[]\r\n *\/\r\nfunction lineAdd(points, value) =\r\n let(\r\n l = max(\r\n float(len(value)),\r\n float(len(points[0]))\r\n ),\r\n value = vector3D(value)\r\n )\r\n l > 2 ? [ for (p = points) vector3D(p) + value ]\r\n : [ for (p = points) vector2D(p) + value ]\r\n;\r\n\r\n\/**\r\n * Builds a vector of faces to be used in a polyhedron. The function accepts the\r\n * number of points defining one main face of the polyhedron, then returns the\r\n * faces vector that contains the indices of each face enclosing the solid. This\r\n * only apply on simple polyhedron where two opposite faces share the same\r\n * number of points.\r\n *\r\n * @param Number length - The number of points for one main face of the polyhedron\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronFaces(length) =\r\n let(\r\n length = integer(length)\r\n )\r\n length < 3 ? []\r\n :let(\r\n r1 = 0,\r\n r2 = length - 1,\r\n r3 = length,\r\n r4 = length * 2 - 1\r\n )\r\n concat([\r\n range(r1, r2),\r\n range(r4, r3)\r\n ], [\r\n for (i = [r1 : r2]) [\r\n r3 + i,\r\n r3 + (i + 1) % length,\r\n (r1 + i + 1) % length,\r\n r1 + i\r\n ]\r\n ])\r\n;\r\n\r\n\/**\r\n * Composes a list of points to be used in a simple polyhedron.\r\n *\r\n * @param Vector[] [bottom] - The list of points for the bottom face.\r\n * @param Vector[] [top] - The list of points for the top face.\r\n * @param Vector[] [points] - The list of points for a main face.\r\n * @param Vector [distane] - The distance between two main faces.\r\n * @param Number [x] - The distance between two main faces on the X-axis.\r\n * @param Number [y] - The distance between two main faces on the Y-axis.\r\n * @param Number [z] - The distance between two main faces on the Z-axis.\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronPoints(bottom, top, points, distance, x, y, z) =\r\n let(\r\n distance = apply3D(v=distance, x=x, y=y, z=z)\r\n )\r\n top && bottom ? concat(\r\n [ for (p = bottom) vector3D(p) ],\r\n [ for (p = top) vector3D(p) + distance ]\r\n )\r\n :let(\r\n points = [ for (p = (points ? points : (top ? top : bottom))) vector3D(p) ]\r\n )\r\n concat(\r\n points,\r\n [ for (p = points) p + distance ]\r\n )\r\n;\r\n","old_contents":"\/**\r\n * @license\r\n * MIT License\r\n *\r\n * Copyright (c) 2017 Jean-Sebastien CONAN\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n *\/\r\n\r\n\/**\r\n * Part of the camelSCAD library.\r\n *\r\n * Lines handling.\r\n *\r\n * @package core\/line\r\n * @author jsconan\r\n *\/\r\n\r\n\/**\r\n * Computes the coordinates of a 2D arc by rotating a vector along the provided angle.\r\n *\r\n * @param Number|Vector r - The number or the vector that defines the radius of the arc (can be ellipse).\r\n * @param Number [a] - The angle to cover.\r\n * @param Vector [o] - The coordinates of the center of the arc.\r\n * @param Number [a1] - The start angle of the arc.\r\n * @param Number [a2] - The end angle of the arc.\r\n * @returns Vector[]\r\n *\/\r\nfunction arc(r, a=DEGREES, o, a1, a2) =\r\n let(\r\n r = vector2D(r),\r\n o = vector2D(o),\r\n a1 = deg(a1),\r\n a2 = a2 != undef ? deg(a2) : a1 + deg(a)\r\n )\r\n !r[0] || !r[1] || (!a1 && !a2) ? []\r\n :let(\r\n start = min(a1, a2),\r\n end = max(a1, a2),\r\n range = end - start,\r\n step = astep(max(r), absdeg(range)),\r\n inc = sign(a2 - a1) * step\r\n )\r\n complete(\r\n \/\/ intermediate points\r\n range <= step ? []\r\n :[ for (a = [a1 + inc : inc : a2]) arcp(r, a) + o ],\r\n \/\/ the start point\r\n arcp(r, a1) + o,\r\n \/\/ the final point\r\n arcp(r, a2) + o\r\n )\r\n;\r\n\r\n\/**\r\n * Computes a sinusoid wave.\r\n * Without angle, the line will be horizontal.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the sinusoid.\r\n * @param Number p - The phase of the sinusoid (the start angle).\r\n * @param Number o - The offset of the sinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction sinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n [\r\n for (x = [0 : step : l])\r\n let( p = sinp(x=x, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a cosinusoid wave.\r\n * Without angle, the line will be vertical.\r\n *\r\n * @param Number l - The length of the curve.\r\n * @param Number w - The wave length.\r\n * @param Number h - The amplitude of the cosinusoid.\r\n * @param Number p - The phase of the cosinusoid (the start angle).\r\n * @param Number o - The offset of the cosinusoid.\r\n * @param Number a - A rotation angle.\r\n * @returns Vector[]\r\n *\/\r\nfunction cosinusoid(l, w, h, p, o, a) =\r\n let(\r\n a = deg(a),\r\n l = float(l),\r\n w = divisor(w),\r\n h = divisor(h),\r\n step = l \/ (fragments(h) * l \/ w)\r\n )\r\n [\r\n for (y = [0 : step : l])\r\n let( p = cosp(y=y, w=w, h=h, p=p, o=o) )\r\n a ? rotp(p, a) : p\r\n ]\r\n;\r\n\r\n\/**\r\n * Computes a line from a path.\r\n *\r\n * A path is composed of commands, each one being a simple array starting by the\r\n * command name. Each command will produce points relative to the last command\r\n * or to the last existing point. When the line starts it will rely on the\r\n * existing points, if any. If no existing points is provided, the line will\r\n * start from the absolute origin ([0, 0]), unless the first command is a point.\r\n *\r\n * The following commands are recognized:\r\n * - P, Point: [\"P\", , ] | [\"P\", ] - Adds a point at the given absolute coordinates.\r\n * - L, Line: [\"L\", , ] | [\"L\", ] - Adds a line from the last point to the given relative coordinates.\r\n * - H, Horizontal line: [\"H\", ] - Adds an horizontal line from the last point with the given length. The sign of the length determines the direction.\r\n * - V, Vertical line: [\"V\", ] - Adds a vertical line from the last point with the given length. The sign of the length determines the direction.\r\n * - I, Intersection: [\"I\", , , ] - Adds a line from the last point, that pass through P1 and intersects with the line defined by P2 and P3.\r\n * - T, Tangent: [\"T\", , , ] | [\"T\", , ] - Adds a line from the last point, that ends at the tangent point with the defined circle. The sign of the radius determines the direction\r\n * - A, Angle: [\"A\", , ] - Adds a leaned line from the last point with the given angle and the given length. The sign of the length determines the direction.\r\n * - C, Circle: [\"C\", , , ] - Adds a circle arc from the last point with the given radius and with the given angle.\r\n * - B, Bezier curve: [\"B\", , , ] - Adds a cubic bezier curve from the last point with the given control points (up to 3, the first beeing the last existing point).\r\n *\r\n * @param Array p - The path from which build the line\r\n * @param Vector[] points - The existing points to start the line from.\r\n * @param Number i - The start index in the path (default: 0)\r\n * @returns Vector[]\r\n *\/\r\nfunction path(p, points, i) =\r\n let(\r\n p = array(p),\r\n i = integer(i),\r\n points = array(points),\r\n length = len(points),\r\n point = vector2D(points[length - 1]),\r\n cur = p[i],\r\n cmd = cur[0],\r\n l = len(cur)\r\n )\r\n i >= len(p) ? points\r\n :let(\r\n values = (\r\n l <= 1 ? [point]\r\n :cmd == \"P\" || cmd == \"p\" ? [isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2])]\r\n :cmd == \"L\" || cmd == \"l\" ? [point, point + (isVector(cur[1]) ? vector2D(cur[1]) : apply2D(x=cur[1], y=cur[2]))]\r\n :cmd == \"H\" || cmd == \"h\" ? [point, point + apply2D(x=cur[1])]\r\n :cmd == \"V\" || cmd == \"v\" ? [point, point + apply2D(y=cur[1])]\r\n :cmd == \"I\" || cmd == \"i\" ? [point, intersect2D(point, cur[1], cur[2], cur[3])]\r\n :cmd == \"T\" || cmd == \"t\" ? let(isv = isVector(cur[1])) [point, tangent2D(point, isv ? cur[1] : apply2D(x=cur[1], y=cur[2]), isv ? cur[2] : cur[3])]\r\n :cmd == \"A\" || cmd == \"a\" ? [point, point + arcPoint(a=cur[1], r=cur[2])]\r\n :cmd == \"C\" || cmd == \"c\" ? arc(r=cur[1], a1=cur[2], a2=cur[3], o=point + arcPoint(a=float(cur[2]) + STRAIGHT, r=cur[1]))\r\n :cmd == \"B\" || cmd == \"b\" ? (\r\n l >= 4 ? concat([point], cubicBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2]), point + vector2D(cur[3])))\r\n :l == 3 ? concat([point], quadraticBezierCurve(point, point + vector2D(cur[1]), point + vector2D(cur[2])))\r\n :[point, point + vector2D(cur[1])]\r\n )\r\n :[]\r\n )\r\n )\r\n path(p=p, points=concat(values[0] == point ? slice(points, 0, -1) : points, values), i=i + 1)\r\n;\r\n\r\n\/**\r\n * Computes the outline of a polygon. The outline can be at a particular distance.\r\n *\r\n * @param Vector[] points - The points defining the polygon to outline.\r\n * @param Number distance - The distance from the polygon for the outline.\r\n * A positive distance will place the outline outside,\r\n * while a negative distance will place it inside.\r\n * @returns Vector[]\r\n *\/\r\nfunction outline(points, distance) =\r\n let(\r\n points = array(points),\r\n l = len(points),\r\n prev = l - 1,\r\n next = 1\r\n )\r\n l >= 3 ? [\r\n for (i = [0 : 1 : l - 1])\r\n vertexOutline2D(\r\n a=points[(i + prev) % l],\r\n v=points[i],\r\n b=points[(i + next) % l],\r\n distance=distance\r\n )\r\n ] : points\r\n;\r\n\r\n\/**\r\n * Adds a value to each point of a line.\r\n *\r\n * @param Vector[] points - The points defining the line.\r\n * @param Number|Vector value - The value to add to the line.\r\n * @returns Vector[]\r\n *\/\r\nfunction lineAdd(points, value) =\r\n let(\r\n l = max(\r\n float(len(value)),\r\n float(len(points[0]))\r\n ),\r\n value = vector3D(value)\r\n )\r\n l > 2 ? [ for (p = points) vector3D(p) + value ]\r\n : [ for (p = points) vector2D(p) + value ]\r\n;\r\n\r\n\/**\r\n * Builds a vector of faces to be used in a polyhedron. The function accepts the\r\n * number of points defining one main face of the polyhedron, then returns the\r\n * faces vector that contains the indices of each face enclosing the solid. This\r\n * only apply on simple polyhedron where two opposite faces share the same\r\n * number of points.\r\n *\r\n * @param Number length - The number of points for one main face of the polyhedron\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronFaces(length) =\r\n let(\r\n length = integer(length)\r\n )\r\n length < 3 ? []\r\n :let(\r\n r1 = 0,\r\n r2 = length - 1,\r\n r3 = length,\r\n r4 = length * 2 - 1\r\n )\r\n concat([\r\n range(r1, r2),\r\n range(r4, r3)\r\n ], [\r\n for (i = [r1 : r2]) [\r\n r3 + i,\r\n r3 + (i + 1) % length,\r\n (r1 + i + 1) % length,\r\n r1 + i\r\n ]\r\n ])\r\n;\r\n\r\n\/**\r\n * Composes a list of points to be used in a simple polyhedron.\r\n *\r\n * @param Vector[] [bottom] - The list of points for the bottom face.\r\n * @param Vector[] [top] - The list of points for the top face.\r\n * @param Vector[] [points] - The list of points for a main face.\r\n * @param Vector [distane] - The distance between two main faces.\r\n * @param Number [x] - The distance between two main faces on the X-axis.\r\n * @param Number [y] - The distance between two main faces on the Y-axis.\r\n * @param Number [z] - The distance between two main faces on the Z-axis.\r\n * @returns Vector[]\r\n *\/\r\nfunction simplePolyhedronPoints(bottom, top, points, distance, x, y, z) =\r\n let(\r\n distance = apply3D(v=distance, x=x, y=y, z=z)\r\n )\r\n top && bottom ? concat(\r\n [ for (p = bottom) vector3D(p) ],\r\n [ for (p = top) vector3D(p) + distance ]\r\n )\r\n :let(\r\n points = [ for (p = (points ? points : (top ? top : bottom))) vector3D(p) ]\r\n )\r\n concat(\r\n points,\r\n [ for (p = points) p + distance ]\r\n )\r\n;\r\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"edca3b2568a8899208ee6c105e051343b5cff543","subject":"Reworking enclosure shell w. LED strip channel","message":"Reworking enclosure shell w. LED strip channel\n","repos":"kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot,kdsolo\/project_haiku.iot","old_file":"Prototype-UR2\/assets\/3d\/enclosure.scad","new_file":"Prototype-UR2\/assets\/3d\/enclosure.scad","new_contents":"use ;\nwidth=40;\nlength=66;\nheight=17.5;\nlid_height=7;\nwall=1;\nradius_xy=wall*4;\nradius_z=wall*2;\ninset=0.75;\n\n\/\/ the base\ntranslate([-1.2*width\/2,0,height\/2+wall]) {\n difference() {\n union() {\n hinged_box(width, length, height, 1);\n }\n union() {\n \/\/ aperture for the usb port\n *translate([0, -length\/2, -2]) {\n charge_port(10, 5, wall);\n }\n \/\/ top strap receiver\n top_strap(width\/3);\n }\n }\n}\n\n\/\/ the lid\ntranslate([1.2*width\/2,0,lid_height\/2+wall]) rotate([0,180,0]) {\n difference() {\n union() {\n hinged_box(width, length, lid_height, -1);\n }\n #translate([0,12,lid_height\/2]) rotate(180) button(10,36,wall*2);\n }\n\n}\n\n\/\/ the strap\ntranslate([1.2*width+1.2*width\/2,0,width\/3\/2]) {\n rotate([0,90,0]) {\n top_strap(width\/3);\n }\n}\n\nmodule top_strap(strap_w) {\n strap_len=length+inset;\n wall=1;\n translate([0,0,inset*2]) difference() {\n union() {\n cube([strap_w, strap_len, height-wall], center=true);\n translate([0,0,-height\/2+inset*2]) {\n rotate([0,0,90]) outer_ridges(inset, strap_w, [strap_len, strap_w, height]);\n }\n }\n translate([0,0,-wall\/2]) cube([strap_w, strap_len-2*wall, height-wall*2], center=true);\n }\n}\nmodule outer_ridges(radius, length, bounds) {\n translate([-1*(bounds[0]\/2+radius\/2), 0]) {\n rotate([180,0,0]) ridge(radius, length, 1);\n }\n translate([bounds[0]\/2+radius\/2, 0]) {\n rotate([180,0,0]) ridge(radius, length, -1);\n }\n}\nmodule ridge(radius, length, orient=1) {\n rotate([0,0,orient<0?0:180])\n translate([-radius\/2, 0, radius\/2]) difference() {\n rotate([90,0,0]) cylinder(r=radius, h=length, center=true, $fn=12);\n union() {\n translate([0,0,radius\/2]) cube([radius*2, length, radius], center=true);\n translate([-radius\/2,0,0]) cube([radius, length, radius*2], center=true);\n }\n }\n}\n\nmodule hinged_oval_box(width, length, height, orient) {\n hull() {\n translate([0, -length\/2+5, 2]) {\n resize(newsize=[width, width\/2, height]) sphere(d=width, center=true);\n }\n translate([0, +length\/2-5, 2]) {\n resize(newsize=[width*1.25, width\/2, height]) sphere(d=width, center=true);\n }\n }\n}\nmodule hinged_box(width, length, height, orient) {\n hinge_radius=4;\n hinge_y_offset=length\/2+radius_xy+hinge_radius\/2;\n difference() {\n union() {\n difference() {\n shell(width, length, height, orient);\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[0,90,0]) translate([0,0,0.25]) {\n cylinder(r=hinge_radius, h=width*.66, center=true);\n }\n }\n\n }\n translate([0, -1*hinge_y_offset, orient*(height\/2)]) {\n rotate(a=[90,180,0]) translate([0,0,0.25]) {\n _pin_hinge(width*.66, hinge_radius, orient>0?0:1);\n }\n }\n }\n union() {\n \/\/ the slot for the LEDs\n }\n }\n}\n\nmodule _pin_hinge(h, radius, is_top=0, clearance=0) {\n fingers=5; pin_radius=1.5; gap=0.75;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n rotate([-90,0,0]) rotate([0,90,0]) translate([0,-radius,-1*(h\/2)+unit_h\/2]) {\n for(i=[0:fingers-1]) {\n if (i%2>0 && is_top) {\n translate([0,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i);\n translate([radius-1,radius*2,0]) #cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n if (i%2==0 && !is_top) {\n translate([0,0, gap*i+i*unit_h]) {\n pin_hinge_unit(unit_h, radius, pin_radius, i);\n translate([-1*(radius-1),radius*2,0]) #cube([radius*1.5, radius, unit_h], center=true);\n }\n }\n }\n }\n}\n\nmodule shell(width, length, height, orient=1) {\n difference() {\n union() {\n \/\/cube([2,length, 2], center=true);\n hull() {\n linear_extrude(height=height+wall, center=true) {\n offset(radius_xy) square([width-radius_xy*2+wall*2, length], center=true);\n }\n translate([0,length\/2-wall,0]) {\n difference() {\n resize([width, width\/2, height]) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4,0]) cube([width, width\/2, height], center=true);\n }\n }\n }\n }\n translate([0,0,orient*wall]) {\n translate([0,length\/2-inset, orient*wall]) {\n difference() {\n resize([width-wall, width\/2-wall*4, height], auto=true) cylinder(d=width, height=height, center=true);\n translate([0,-width\/4+wall*2,0]) cube([width-wall, width\/2-wall*4, height], center=true);\n }\n }\n cube([width, length, height], center=true);\n }\n }\n translate([0,length\/2+wall,0]) {\n cube([width*0.75, wall*2, height], center=true);\n }\n}\n\nmodule radiused_cube(dims, radii, center=true) {\n \/\/ radiused box sized to *outer* dimensions\n \/\/ flatten the radii to 1\/2 height\n rad_x=radii[0];\n rad_y=radii[1];\n rad_z=radii[2];\n w=dims[0]; l=dims[1]; h=dims[2];\n\n translate([-w\/2,-l\/2,-h\/2]) hull() {\n for(z=[0:1]) {\n translate([rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n translate([w-rad_x,l-rad_y,z==0?rad_z:h-rad_z]) {\n resize(newsize=[rad_x, rad_y, rad_z]) sphere(rad_x, center=true);\n }\n }\n }\n}\n\nmodule button(radius, length, depth) {\n gap=1;\n difference() {\n linear_extrude(height=depth, twist=0, center=true) {\n difference() {\n offset(r=radius_xy+gap) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n offset(r=radius_xy) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n }\n }\n translate([0, radius*2.5, 0]) cube([radius*2, radius_xy+gap, depth], center=true);\n }\n}\n\n\nmodule hanger() {\n hull() {\n translate([w\/2, 0, h]) resize([width, width*0.66, radius*4]) #sphere(radius, center=true);\n translate([w\/2, 10, h]) resize([width, width*0.66, radius*4]) #sphere(radius, center=true);\n }\n}\n\nmodule charge_port(width, height, wall) {\n radius=height\/2;\n rotate([90, 0, 0]) hull() {\n translate([-width\/2+radius, 0, 0]) cylinder(r=radius, h=wall, $fn=16);\n translate([width\/2-radius, 0, 0]) cylinder(r=radius, h=wall, $fn=16);\n }\n}\n\n\n","old_contents":"use ;\nwidth=40;\nlength=66;\nheight=17.5;\nlid_height=5;\nwall=1.5;\nr=wall*2;\ninset=0.75;\n\n\/\/ the base\ntranslate([-1.2*width\/2,0,height\/2+wall]) {\n difference() {\n union() {\n hinged_box(width, length, height, 1);\n }\n union() {\n \/\/ aperture for the usb port\n *translate([0, -length\/2, -2]) {\n charge_port(10, 5, wall);\n }\n \/\/ top strap receiver\n #top_strap(width\/3);\n }\n }\n}\n\n\/\/ the lid\ntranslate([1.2*width\/2,0,lid_height\/2+wall]) rotate([0,180,0]) {\n difference() {\n union() {\n hinged_box(width, length, lid_height, -1);\n }\n translate([0,12,lid_height\/2+wall]) rotate(180) button(10,36,wall*2);\n }\n\n}\n\n\/\/ the strap\ntranslate([1.2*width+1.2*width\/2,0,width\/3\/2]) {\n rotate([0,90,0]) {\n top_strap(width\/3);\n }\n}\n\nmodule top_strap(strap_w) {\n strap_len=length+inset;\n wall=1;\n translate([0,0,inset*2]) union() {\n union() {\n cube([strap_w, strap_len, height-wall], center=true);\n translate([0,0,-height\/2+inset*2]) {\n rotate([0,0,90]) outer_ridges(inset, strap_w, [strap_len, strap_w, height]);\n }\n }\n translate([0,0,-wall\/2]) #cube([strap_w, strap_len-2*wall, height-wall*2], center=true);\n }\n}\nmodule outer_ridges(radius, length, bounds) {\n translate([-1*(bounds[0]\/2+radius\/2), 0]) {\n rotate([180,0,0]) ridge(radius, length, 1);\n }\n translate([bounds[0]\/2+radius\/2, 0]) {\n rotate([180,0,0]) ridge(radius, length, -1);\n }\n}\nmodule ridge(radius, length, orient=1) {\n rotate([0,0,orient<0?0:180]) \n translate([-radius\/2, 0, radius\/2]) difference() {\n rotate([90,0,0]) cylinder(r=radius, h=length, center=true, $fn=12);\n union() {\n translate([0,0,radius\/2]) cube([radius*2, length, radius], center=true);\n translate([-radius\/2,0,0]) #cube([radius, length, radius*2], center=true);\n }\n }\n}\n\nmodule hinged_oval_box(width, length, height, orient) {\n hull() {\n translate([0, -length\/2+5, 2]) {\n resize(newsize=[width, width\/2, height]) sphere(d=width, center=true);\n }\n translate([0, +length\/2-5, 2]) {\n resize(newsize=[width*1.25, width\/2, height]) sphere(d=width, center=true);\n }\n }\n}\nmodule hinged_box(width, length, height, orient) {\n difference() {\n union() {\n shell(width, length, height, r, orient);\n clearance=wall;\n translate([0,-1*(length\/2+r+clearance),orient*(height\/2+r\/2)]) {\n rotate(a=[90,180,0]) translate([0,0,0.25]) {\n _pin_hinge(width*.66, 4, orient>0?0:1);\n }\n }\n }\n union() {\n translate([0,0,orient*wall]) radiused_cube([width, length, height+r*2], r\/2);\n }\n }\n}\n\nmodule _pin_hinge(h, radius, is_top=0) {\n fingers=5; pin_radius=1.5; gap=0.75;\n total_gap=(fingers-1)*gap;\n unit_h=(h-total_gap)\/fingers;\n rotate([-90,0,0]) rotate([0,90,0]) translate([0,-radius,-1*(h\/2)+unit_h\/2]) {\n for(i=[0:fingers-1]) {\n if (i%2>0 && is_top) {\n translate([0,0, gap*i+i*unit_h]) pin_hinge_unit(unit_h, radius, pin_radius, i);\n }\n if (i%2==0 && !is_top) {\n translate([0,0, gap*i+i*unit_h]) pin_hinge_unit(unit_h, radius, pin_radius, i);\n }\n }\n }\n}\n\nmodule shell(width, length, height, r, orient=1) {\n \/\/ hollow box sized to interior dimension\n \/\/ w. thicker end walls\n difference() {\n radiused_cube([width+wall*2, length+wall*4, height+wall*2], r);\n translate([0,0,orient*r\/2]) radiused_cube([width, length, height+r], r);\n }\n}\n\nmodule radiused_cube(dims, radius, center=true) {\n \/\/ radiused box sized to *outer* dimensions\n w=dims[0]; l=dims[1]; h=dims[2];\n offset=radius;\n translate([-w\/2,-l\/2,-h\/2]) hull() {\n for(z=[0:1]) {\n translate([offset,offset,z==0?offset:h-offset]) sphere(radius, center=true);\n translate([w-offset,offset,z==0?offset:h-offset]) sphere(radius, center=true);\n translate([offset,l-offset,z==0?offset:h-offset]) sphere(radius, center=true);\n translate([w-offset,l-offset,z==0?offset:h-offset]) sphere(radius, center=true);\n }\n }\n}\n\nmodule button(radius, length, depth) {\n gap=1;\n difference() {\n linear_extrude(height=depth, twist=0, center=true) {\n difference() {\n offset(r=r+gap) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n offset(r=r) {\n circle(radius, center = true);\n translate([0, 10, 0]) square([radius, radius*2.5], center = true);\n }\n }\n }\n translate([0, radius*2.5, 0]) #cube([radius*2, r+gap, depth], center=true);\n }\n}\n\n\nmodule hanger() {\n hull() {\n translate([w\/2, 0, h]) resize([width, width*0.66, radius*4]) #sphere(radius, center=true);\n translate([w\/2, 10, h]) resize([width, width*0.66, radius*4]) #sphere(radius, center=true);\n }\n}\n\nmodule charge_port(width, height, wall) {\n radius=height\/2;\n rotate([90, 0, 0]) hull() {\n translate([-width\/2+radius, 0, 0]) cylinder(r=radius, h=wall, $fn=16);\n translate([width\/2-radius, 0, 0]) cylinder(r=radius, h=wall, $fn=16);\n }\n}\n\n\n","returncode":0,"stderr":"","license":"mpl-2.0","lang":"OpenSCAD"} {"commit":"8473a4083760ec90eb82412ced0756b9a3d168e4","subject":"joint model","message":"joint model\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/joint.scad","new_file":"tablet_toilet_mount\/joint.scad","new_contents":"module joint(groundSpacing)\n{\n hch = groundSpacing + 6.5\/2; \/\/ hole center height\n\n difference()\n {\n \/\/ main element\n union()\n {\n cube([3, 6.5, hch]);\n translate([0, 6.5\/2, hch])\n rotate([0, 90, 0])\n cylinder(r=6.5\/2, h=3, $fs=0.01);\n }\n \/\/ screw hole\n translate([-1, 6.5\/2, hch])\n rotate([0, 90, 0])\n cylinder(r=4.5\/2, h=3+2*1, $fs=0.01);\n }\n}\n\n\njoint(1);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'tablet_toilet_mount\/joint.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"65b86ad3dea5dc5788a415a5b94f0137b98a438f","subject":"This is the inital work for the top part of the pendant.","message":"This is the inital work for the top part of the pendant.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag-owl-of-diego.scad","new_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag-owl-of-diego.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\n\r\n\/\/ leftIconType and rightIconType are passed to the oneIcon() module\r\nleftIconType = \"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/ This is the X,Y scale of the icons.\r\n\/\/ For the Thingiverse Customizer, the music note XY scale is 0.6 and 0.3\r\nleftIconXyScale = 0.5; \/\/ [0.1 : 0.05 : 5]\r\nrightIconXyScale = 0.25; \/\/ [0.1 : 0.05 : 5]\r\n\r\nleftIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\nrightIconHeight = 1.5; \/\/ [0.1: 0.1 :5]\r\n\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Mark\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nbottomText = \"Music Instructor\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag()\r\n{\r\n union()\r\n {\r\n nametag_assembly();\r\n\r\n icons();\r\n } \r\n}\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'OpenSCAD\/src\/main\/openscad\/name-tags\/name-tag-owl-of-diego.scad' did not match any file(s) known to git\n","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e00c72a63750ed202a2392c3bb36b09248f0bde9","subject":"Fix typo in annotation (controlPoints)","message":"Fix typo in annotation (controlPoints)\n","repos":"jsconan\/camelSCAD","old_file":"shape\/context\/control.scad","new_file":"shape\/context\/control.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Control stuff visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Displays a list of control points.\n *\n * @param Vector [points] - The control points to display.\n * @param Number|Vector [size] - The size of the points.\n * @param Number [l] - The length of a point.\n * @param Number [w] - The width of a point.\n * @param Number [h] - The height of a point.\n *\/\nmodule controlPoints(points, size, l, w, h) {\n %color([1, .2, .2, .3]) {\n for (p = points) {\n translate(vector3D(p)) {\n ellipsoid(d=uor(size, 1), dx=l, dy=w, dz=h);\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Control stuff visualization.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Displays a list of control points\n *\n * @param Vector [points] - The control points to display.\n * @param Number|Vector [size] - The size of the points.\n * @param Number [l] - The length of a point.\n * @param Number [w] - The width of a point.\n * @param Number [h] - The height of a point.\n *\/\nmodule controlPoints(points, size, l, w, h) {\n %color([1, .2, .2, .3]) {\n for (p = points) {\n translate(vector3D(p)) {\n ellipsoid(d=uor(size, 1), dx=l, dy=w, dz=h);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"15447573f7d50b8d0bb76fffc29fbb1b65c4eb49","subject":"fan\/5015S: add","message":"fan\/5015S: add\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"fan_5015S.scad","new_file":"fan_5015S.scad","new_contents":"include \ninclude \nuse ;\n\nfan_5015S_screwpos = [[-20.15*mm,20.3*mm],[22*mm, -19.5*mm]];\nfan_5015S_X = 51.2;\nfan_5015S_Y = 51.2;\nfan_5015S_Z = 15;\nfan_5015S_output_X = 19;\nfan_5015S_output_Y = 11;\nfan_5015S_output_screw_Y = -6.5;\nfan_5015S_output_screw_X = 9.5;\n\nfan_5015S();\n\n\/*translate([0,0,-10])*\/\n\/*fan_5015S_bracket();*\/\n\n\/\/optional 5015S fan_5015S fan mockup\nmodule fan_5015S(part)\n{\n if(part==undef)\n {\n difference()\n {\n fan_5015S(part=\"pos\");\n fan_5015S(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -fan_5015S_output_Y, 0])\n cube([fan_5015S_output_X, fan_5015S_output_Y+fan_5015S_Y\/2, fan_5015S_Z]);\n\n cylindera(r=fan_5015S_X\/2, h=fan_5015S_Z, align=[1,1,1]);\n translate([fan_5015S_X\/2, fan_5015S_Y\/2, 0])\n union()\n {\n hull()\n {\n for(pos=fan_5015S_screwpos)\n translate([pos[0], pos[1], 0])\n cylindera(d=8*mm, h=fan_5015S_Z, align=[0,0,1]);\n }\n }\n }\n else if(part==\"neg\")\n {\n translate([fan_5015S_X\/2, fan_5015S_Y\/2, 0])\n union()\n {\n for(pos=fan_5015S_screwpos)\n translate([pos[0], pos[1], 0])\n cylindera(d=3.3*mm, h=fan_5015S_Z+.1, align=[0,0,1]);\n }\n }\n}\n\n\n\/\/ fan_5015S mounting plate\nmodule fan_5015S_bracket(thickness=2.2*mm)\n{\n linear_extrude(thickness)\n projection(cut=false)\n fan_5015S();\n}\n\n\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fan_5015S.scad' did not match any file(s) known to git\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"6637c7338ea8c7fa34f0835661bd56e340884f60","subject":"removed debug code","message":"removed debug code\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/Breadboard.scad","new_file":"hardware\/assemblies\/Breadboard.scad","new_contents":"\/*\n\tAssembly: BreadboardAssembly\n\tBreadboard assembly - includes Arduino and fixings\n\t\n\tLocal Frame: \n\t\tOrigin\n\n*\/\n\n\/\/ Connectors\n\/\/ ----------\n\nmodule BreadboardAssembly() {\n\n Assembly(\"Breadboard\");\n\n\tif (DebugCoordinateFrames) frame();\n\t\n\t\/\/ debug connectors?\n\tif (DebugConnectors) {\n\t\t\n\t}\n\t\n\t\/\/ Vitamins\n\t\/\/ --------\n\t\n\t\/\/ Breadboard\n\tBreadboard(Breadboard_170);\n\t\n \/\/ Arduino\n step(1, \n \"Push the Arduino onto the breadboard - make sure you position it correctly, as it's a tight fit with the Robot base!\", \n \"400 300 21 17 9 62 0 218 316\")\n attachWithOffset(Breadboard_Con_Pin(Breadboard_170, along=3, across=7, ang=90), DefConDown, [0,0,3]) {\n ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n }\n\t\t\t\n\tEnd(\"Breadboard\");\n}\n","old_contents":"\/*\n\tAssembly: BreadboardAssembly\n\tBreadboard assembly - includes Arduino and fixings\n\t\n\tLocal Frame: \n\t\tOrigin\n\n*\/\n\nuse \"test.scad\"\ninclude \n\n\/\/ Connectors\n\/\/ ----------\n\nmodule BreadboardAssembly() {\n\n Assembly(\"Breadboard\");\n\n\tif (DebugCoordinateFrames) frame();\n\t\n\t\/\/ debug connectors?\n\tif (DebugConnectors) {\n\t\t\n\t}\n\t\n\t\/\/ Vitamins\n\t\/\/ --------\n\t\n\t\/\/ Breadboard\n\tBreadboard(Breadboard_170);\n\t\n \/\/ Arduino\n step(1, \n \"Push the Arduino onto the breadboard - make sure you position it correctly, as it's a tight fit with the Robot base!\", \n \"400 300 21 17 9 62 0 218 316\")\n attachWithOffset(Breadboard_Con_Pin(Breadboard_170, along=3, across=7, ang=90), DefConDown, [0,0,3]) {\n ArduinoPro(ArduinoPro_Micro, ArduinoPro_Pins_Normal);\n }\n\t\t\t\n\tEnd(\"Breadboard\");\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8d14a5e256ce3a3f4969b2311ae40421f6d65a83","subject":"cleanup","message":"cleanup\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nuse <..\/..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\nuse <..\/..\/..\/external-resources\/cat\/cat.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/bass-clef\/bass-clef.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/l\/luigi-outline.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/m\/mario.scad>\nuse <..\/..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\nuse <..\/..\/..\/external-resources\/thundercats\/thundercats-logo.scad>\nuse <..\/..\/..\/external-resources\/trooper\/scrum-trooper.scad>\nuse <..\/..\/..\/shapes\/crescent-moon\/crescent-moon.scad>\nuse <..\/..\/..\/shapes\/fan\/iso-7000-fan.scad>\nuse <..\/..\/..\/shapes\/fish\/fish.scad>\nuse <..\/..\/..\/shapes\/heart\/heart.scad>\nuse <..\/..\/..\/shapes\/light-bulb\/light-bulb.scad>\nuse <..\/..\/..\/shapes\/minecraft\/creeper\/creeper-face.scad>\nuse <..\/..\/..\/shapes\/spurs\/spurs-a.scad>\nuse <..\/..\/..\/shapes\/weather\/sun\/sun.scad>\n\nmodule halfCirclePhoneStand(base_xTranslate = 0,\n base_yTranslate = 0,\n bed_cutout_zLength = 4.2,\n height = 19.125,\n \n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n icon_zOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n\n bed_cutout_zLength = bed_cutout_zLength,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n bed_cutout_zLength,\n\n iconColor, iconType, iconXyScale, iconHeight, \n icon_xOffset, icon_yOffset, icon_zOffset,\n \n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate,\n bed_cutout_zLength = bed_cutout_zLength);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset,\n zOffset = icon_zOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate,\n bed_cutout_zLength)\n{\n zLength = bed_cutout_zLength;\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset, zOffset)\n{\n\/\/echo(\"xOffset\", xOffset);\n\n color(iconColor)\n \n translate([xOffset, yOffset, zOffset])\n rotate([0, 90, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=2.19);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbassClefThumbnail(height = 2.7);\n }\n else if(iconType == \"Cat\")\n {\n catThumbnail(height = 2, xyScale = 0.37);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 2.1])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Heart\")\n {\n scale([1, 1, 1.9])\n heartThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumTrooperThumbnail(height = 2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(base_xTranslate,\n base_yTranslate,\n bed_cutout_zLength,\n height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength = bed_cutout_zLength,\n bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xTranslate = base_xTranslate,\n yTranslate = base_yTranslate);\n}\n \nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius,\n xTranslate,\n yTranslate)\n{\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength, minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = bed_cutout_zLength + minkowskiSphereRadius;\n \n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105;\n yTranslate = 8.85;\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9,\n outerRadius = 2.6,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/basics\/rounded-edges\/rounded-pyramid\/rounded-pyramid.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nuse <..\/..\/..\/external-resources\/aquaman\/aquaman-logo.scad>\nuse <..\/..\/..\/external-resources\/cat\/cat.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/bass-clef\/bass-clef.scad>\nuse <..\/..\/..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/l\/luigi-outline.scad>\nuse <..\/..\/..\/external-resources\/plumber-brother\/m\/mario.scad>\nuse <..\/..\/..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\nuse <..\/..\/..\/external-resources\/thundercats\/thundercats-logo.scad>\nuse <..\/..\/..\/external-resources\/trooper\/scrum-trooper.scad>\nuse <..\/..\/..\/shapes\/crescent-moon\/crescent-moon.scad>\nuse <..\/..\/..\/shapes\/fan\/iso-7000-fan.scad>\nuse <..\/..\/..\/shapes\/fish\/fish.scad>\nuse <..\/..\/..\/shapes\/heart\/heart.scad>\nuse <..\/..\/..\/shapes\/light-bulb\/light-bulb.scad>\nuse <..\/..\/..\/shapes\/minecraft\/creeper\/creeper-face.scad>\nuse <..\/..\/..\/shapes\/spurs\/spurs-a.scad>\nuse <..\/..\/..\/shapes\/weather\/sun\/sun.scad>\n\nmodule halfCirclePhoneStand(base_xTranslate = 0,\n base_yTranslate = 0,\n bed_cutout_zLength = 4.2,\n height = 19.125,\n \n iconColor = \"red\", \n iconType = \"None\", \n iconXyScale = 1.0, \n iconHeight = 3.0, \n icon_xOffset = 5, \n icon_yOffset = 5,\n icon_zOffset = 5,\n\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n\n bed_cutout_zLength = bed_cutout_zLength,\n\n iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n icon_xOffset = icon_xOffset, \n icon_yOffset = icon_yOffset,\n icon_zOffset = icon_zOffset,\n\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(base_xTranslate = base_xTranslate,\n base_yTranslate = base_yTranslate,\n bed_cutout_zLength = bed_cutout_zLength,\n height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n\n bed_cutout_zLength,\n\n iconColor, iconType, iconXyScale, iconHeight, \n icon_xOffset, icon_yOffset, icon_zOffset,\n \n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate,\n bed_cutout_zLength = bed_cutout_zLength);\n }\n\n halfCirclePhoneStand_cradle_icon(iconColor = iconColor, \n iconType = iconType, \n iconXyScale = iconXyScale, \n iconHeight = iconHeight, \n xOffset = icon_xOffset, \n yOffset = icon_yOffset,\n zOffset = icon_zOffset); \n\n halfCirclePhoneStand_cradle_ends(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate,\n bed_cutout_zLength)\n{\n zLength = bed_cutout_zLength;\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_ends(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_cradle_ends_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_cradle_ends_bottom(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_bottom(height,\n minkowskiSphereRadius)\n{\n xTranslate = 2.8;\n yTranslate = 56.35;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 40.3;\n yTranslate = -2.5;\n zTranslate = minkowskiSphereRadius;\n\n \/\/ bottom end\n color(\"PaleTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n halfCirclePhoneStand_cradle_ends_cylinder(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_cradle_ends_cylinder(height,\n minkowskiSphereRadius)\n{\n roundedPyramid(h = height,\n cornerRadius = minkowskiSphereRadius,\n cylinderFn = 20,\n r1 = 2.57,\n r2 = 2.57,\n sides = 30);\n}\n\nmodule halfCirclePhoneStand_cradle_icon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset, zOffset)\n{\n\/\/echo(\"xOffset\", xOffset);\n\n color(iconColor)\n \n translate([xOffset, yOffset, zOffset])\n rotate([0, 90, 0])\n scale([iconXyScale, iconXyScale, iconHeight])\n if(iconType == \"Aqua Dude\")\n {\n aquamanThumbnail(height=2.19);\n }\n else if(iconType == \"Bass Clef\")\n {\n \tbassClefThumbnail(height = 2.7);\n }\n else if(iconType == \"Cat\")\n {\n catThumbnail(height = 2, xyScale = 0.37);\n }\n else if(iconType == \"Creeper\")\n {\n creeperFaceThumbnail(height = 1.7);\n }\n else if(iconType == \"Fan\")\n {\n scale([1, 1, 2.1])\n fanThumbnail();\n }\n else if(iconType == \"Fish\")\n {\n scale([1, 1, 1.6])\n fishThumbnail();\n }\n else if(iconType == \"Heart\")\n {\n scale([1, 1, 1.9])\n heartThumbnail();\n }\n else if(iconType == \"Light Bulb\")\n {\n lightBulbThumbnail();\n }\n else if(iconType == \"Mario\")\n {\n marioThumbnail();\n }\n else if(iconType == \"Luigi\")\n {\n luigiThumbnail();\n }\n else if(iconType == \"Moon\")\n {\n crescentMoonThumbnail();\n }\n else if(iconType == \"Rebel\")\n {\n rebelAllianceThumbnail(height = 1.7);\n }\n else if(iconType == \"Spur\")\n {\n spurThumbnail();\n }\n else if(iconType == \"Sun\")\n {\n sunThumbnail(height = 1.6);\n }\n else if(iconType == \"Trooper\")\n {\n scrumTrooperThumbnail(height = 2);\n }\n else if(iconType == \"Thundercat\")\n {\n thundercatsLogoThumbnail(height = 1.7);\n }\n else if(iconType == \"Treble Clef\")\n {\n trebleClefScaledDownThumbnail(h=2);\n }\n else\n {\n echo(\"drawing no icon\");\n }\n}\n\nmodule halfCirclePhoneStand_stand(base_xTranslate,\n base_yTranslate,\n bed_cutout_zLength,\n height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength = bed_cutout_zLength,\n bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n xTranslate = base_xTranslate,\n yTranslate = base_yTranslate);\n}\n \nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius,\n xTranslate,\n yTranslate)\n{\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(bed_cutout_zLength, minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = bed_cutout_zLength + minkowskiSphereRadius;\n \n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"eee5c4da69cc334eff8cf93e2e0f83eeefc59f8e","subject":"Holder for 4 phones - for the charging station","message":"Holder for 4 phones - for the charging station\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/phone-charging-holder\/holder.scad","new_file":"openscad\/phone-charging-holder\/holder.scad","new_contents":"\/\/ Holder for 4 phones - for the charging station\nuse <..\/common\/extrusions.scad>\nLARGE = 100;\nEPSILON = 0.01;\nmodule marker_thing() {\n w = 4.5*25.4;\n thick = 3;\n d = 2*25.4;\n h = 2*25.4;\n ri = 3;\n ro = 1;\n \n O_channel(\n w+2*thick, h+thick, \n w, LARGE, \n thick, thick, ro, ri, d);\n \/\/cube([w, d, h]);\n}\n\niw = 10; \/\/ enough to fit phone thickness\nthick = 3; \/\/ wall thickness\now = iw + 2*thick;\nri = 3; \/\/ internal curvature - should work with phone curvature\nro = 0;\nwall_height = 20; \/\/ wall height\nlength = 30; \/\/ front-to-back length - along phone should be at least half phone length\ndome_r = 4;\n\nmodule U() {\n O_channel(\n ow, wall_height, \n iw, LARGE,\n thick, thick,\n ro, ri, length\n );\n}\n\nmodule dome_U() {\n hi = 2*wall_height;\n translate([LARGE-EPSILON,0,0]) rotate([0,-90,0])translate([-thick, 0, 0])\n O_channel(\n length+2*thick, hi\/2+2*thick,\n length, hi,\n thick, -hi\/2, \/\/ offsets\n 0, dome_r,\n LARGE\n );\n}\n\nmodule many_Us(n) {\n separation = ow - thick;\n for (i = [0 : n-1]) {\n translate([i*separation, 0, 0]) U();\n }\n}\n\nmodule holder() {\n difference() {\n many_Us(4);\n dome_U();\n }\n}\n\nholder();\n\/\/dome_U();\n\/\/translate ([50, 0, 0]) many_Us(4);","old_contents":"","returncode":1,"stderr":"error: pathspec 'openscad\/phone-charging-holder\/holder.scad' did not match any file(s) known to git\n","license":"unlicense","lang":"OpenSCAD"} {"commit":"a64c85e8961419ee61d5d7e90b3740a1cf1dd6eb","subject":"low_bottom","message":"low_bottom\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom_wo_programmator.scad","new_file":"3d\/bottom_wo_programmator.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 2;\n\nshift_x = 4;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + 4;\nbox_y = pcb_y + shift_y + th;\n\npcb_width = 2;\npcb_up = 2;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\nsocket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 12;\nusb_type_b_h = 11;\nstart_type_b_y = shift_y + 81.5;\n\/\/start_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 13.4;\nusb_type_a_h = 7.3;\nstart_type_a_y = shift_y + 47;\n\/\/start_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nfn = 10;\ngaika_h = 2;\ngaika_w = 5.6;\nstoiki_r = 4;\nwide_stoiki_r = stoiki_r + 2;\n\n\n\ntranslate([0,0,-50]) {\n\n!difference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n translate([dx,dy,th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n cylinder($fn=6, r=wide_stoiki_r, h=gaika_h);\n }\n }\n }\n translate([box_x\/2, box_y\/2, th-eps]) {\n cylinder($fn=6, r=stoiki_r, h=pcb_up);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_w \/ 2 \/ cos(30) + 0.05, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n \/\/translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n \/\/cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n \/\/}\n\n \/\/ contrast\n \/\/translate([contrast_start_x, contrast_start_y, -eps]) {\n \/\/cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n \/\/}\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n}\n}\n\ntop_box_z = 15 + th;\nstoiki_h = top_box_z - th;\nwide_stoiki_h = 2;\npcb_room = 0.5;\nscreen_start_x = shift_x + 28;\nscreen_start_y = shift_y + 40;\nscreen_length_x = 72;\nscreen_length_y = 24;\nscreen_hold_x = 40;\nscreen_hold_y = 4;\nscreen_hold_start_z = 12;\nscreen_hold_y_shift = 2;\nscreen_hold_up_x = 25;\nscreen_hold_up_x_shift = 5;\n\nmaster_button_y = shift_y + 10;\nmaster_button_x = shift_x + 43;\nmaster_button_int = 21.8;\nmaster_button_r = 3;\ntop_bolt_h = 1.5;\ntop_bolt_r = 3.5;\nspeaker_shift = 18;\nspeaker_r = 15;\nspeaker_h = 15;\nspeaker_hole_d = 10;\nspeaker_hole_int = 3;\nspeaker_hole_w = 1.5;\nspeaker_shift = 18;\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,top_box_z], false);\n translate([th, th, -eps]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, top_box_z-th+eps], false);\n }\n }\n \/\/ stoiki\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_room]) {\n\t cylinder($fn=6, r=stoiki_r, h=top_box_z-th+eps);\n }\n translate([dx,dy,top_box_z-th-wide_stoiki_h+eps]) {\n\t cylinder($fn=6, r=wide_stoiki_r, h=wide_stoiki_h+th-2*eps);\n }\n }\n }\n \/\/ screen_hold\n translate([screen_start_x + (screen_length_x - screen_hold_x)\/2, screen_start_y - screen_hold_y_shift - screen_hold_y, screen_hold_start_z]) {\n\tcube([screen_hold_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n translate([screen_start_x + screen_length_x - screen_hold_up_x - screen_hold_up_x_shift, screen_start_y + screen_length_y + screen_hold_y_shift, screen_hold_start_z]) {\n\tcube([screen_hold_up_x, screen_hold_y, top_box_z - screen_hold_start_z - th + eps]);\n }\n }\n \/\/ - speaker na stoikah\n translate([shift_x + pcb_x - 18, shift_y + 18, 0]) {\n cylinder(r=speaker_r, h = 15, $fn=20);\n }\n \/\/ speaker_hole\n for (dy = [shift_y + speaker_shift - speaker_hole_int - speaker_hole_w*3\/2, \n shift_y + speaker_shift - speaker_hole_w\/2, \n shift_y + speaker_shift + speaker_hole_int + speaker_hole_w\/2]) { \n translate([shift_x + pcb_x - speaker_shift - speaker_hole_d, dy, top_box_z-th-eps]) {\n cube(size=[speaker_hole_d, speaker_hole_w, th + 2*eps]);\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=top_box_z+2*eps);\n }\n translate([dx, dy, top_box_z - top_bolt_h]) {\n cylinder($fn=6, r=top_bolt_r, h=top_bolt_h + eps);\n }\n }\n }\n\n \/\/ screen\n translate([screen_start_x, screen_start_y, top_box_z - th - eps]) {\n cube([screen_length_x, screen_length_y + tol, th + 2*eps]);\n }\n \/\/ sockets\n for (i = [0:1:socket_n-1]) {\n translate([start_socket_x+i*socket_int-tol, box_y-th-eps, -eps]) {\n\t cube(size=[socket_w+2*tol, th+2*eps, socket_h]);\n }\n }\n \/\/ type_b\n translate([box_x - th - eps, start_type_b_y - tol, -tol]) {\n cube([th + 2*eps, usb_type_b_w + 2*tol, usb_type_b_h + 2*tol]);\n }\n \/\/ type_a\n translate([-eps, start_type_a_y, -eps]) {\n cube([th + 2*eps, usb_type_a_w+eps, usb_type_a_h+2*eps]);\n }\n \/\/ master buttons\n for (i = [0:1:2]) {\n translate([master_button_x + master_button_int*i, master_button_y, top_box_z - th - eps]) {\n cylinder($fn=fn, r=master_button_r+tol, h=th+2*eps);\n }\n }\n}\n\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d\/bottom_wo_programmator.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"c4e848c6e66f0800464cb382e1210d763e7e7773","subject":"more spacing between elements","message":"more spacing between elements\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"wall_mount_pale\/wall_mount_pale.scad","new_file":"wall_mount_pale\/wall_mount_pale.scad","new_contents":"count = 2; \/\/ number of pales needed\n\nmodule element()\n{\n for(i = [0:9])\n translate([0, 3*i, 0])\n rotate([-90, 0, 0])\n cylinder(h=5, r1=5\/2, r2=0, $fs=0.01);\n translate([0, -2, 0])\n rotate([-90, 0, 0])\n cylinder(h=2, r=20\/2, $fn=100);\n}\n\nmodule halfElement()\n{\n difference()\n {\n element();\n translate([-20, -3, -12])\n cube([50,50,12]);\n }\n}\n\nfor(i = [0:count-1])\n translate([i*22, 0, 0])\n {\n translate([0, 7, 0])\n halfElement();\n rotate([0, 0, 180])\n halfElement();\n }\n","old_contents":"count = 2; \/\/ number of pales needed\n\nmodule element()\n{\n for(i = [0:9])\n translate([0, 3*i, 0])\n rotate([-90, 0, 0])\n cylinder(h=5, r1=5\/2, r2=0, $fs=0.01);\n translate([0, -2, 0])\n rotate([-90, 0, 0])\n cylinder(h=2, r=20\/2, $fn=100);\n}\n\nmodule halfElement()\n{\n difference()\n {\n element();\n translate([-20, -3, -12])\n cube([50,50,12]);\n }\n}\n\nfor(i = [0:count-1])\n translate([i*22, 0, 0])\n {\n translate([0, 5, 0])\n halfElement();\n rotate([0, 0, 180])\n halfElement();\n }\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"faa6800d6c1a210f7e4d7096ee4089408ffb4e33","subject":"fan_axial: rename modules to fan_axial","message":"fan_axial: rename modules to fan_axial\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"fan_axial.scad","new_file":"fan_axial.scad","new_contents":"\/\/ Remixed from MiseryBot's original work: http:\/\/www.thingiverse.com\/thing:8063\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule fan_axial(width, depth, mount_dist, thread, head_embed=true, corner_radius=3, blade_angle=-45, bore_dia_walls=1.5, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n bore_diameter = width - bore_dia_walls;\n s = [width, width, depth];\n difference()\n {\n union()\n {\n roundedBox(size=s, radius=corner_radius, sidesonly=true);\n }\n\n difference()\n {\n cylindera(d=bore_diameter, h=depth+.2, orient=Z);\n cylindera(d=bore_diameter\/2 + 2*mm, h=depth+.2, orient=Z);\n }\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=depth, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n fan_axial_blades(width=bore_diameter, depth=depth, blade_angle=blade_angle);\n }\n}\n\n\nmodule fan_axial_cut(width, depth, tolerance=.3*mm, mount_dist, screw_l, thread, head_embed=true, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n cubea(size=s, extrasize=[tolerance,tolerance,tolerance]);\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=screw_l, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n}\n\nmodule body(width, depth, bore_diameter, mount_dist, corner_radius, thread)\n{\n\n}\n\nmodule fan_axial_blades(width, depth, angle)\n{\n linear_extrude(height=depth-1, center = true, convexity = 4, twist = angle)\n {\n for(i=[0:6])\n rotate((360*i)\/7)\n translate([0,-1.5\/2]) square([width\/2-0.75,1.5]);\n }\n}\n\n\nif(false)\n{\n fan_axial(width=40*mm, depth=10.5*mm, mount_dist=32*mm, thread=ThreadM3, orient=Y, align=N);\n %fan_axial_cut(width=40*mm, depth=10.5*mm, mount_dist=32*mm, screw_l=25*mm, thread=ThreadM3, orient=Y, align=N);\n}\n","old_contents":"\/\/ Remixed from MiseryBot's original work: http:\/\/www.thingiverse.com\/thing:8063\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\nmodule axialfan(width, depth, mount_dist, thread, head_embed=true, corner_radius=3, blade_angle=-45, bore_dia_walls=1.5, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n bore_diameter = width - bore_dia_walls;\n s = [width, width, depth];\n difference()\n {\n union()\n {\n roundedBox(size=s, radius=corner_radius, sidesonly=true);\n }\n\n difference()\n {\n cylindera(d=bore_diameter, h=depth+.2, orient=Z);\n cylindera(d=bore_diameter\/2 + 2*mm, h=depth+.2, orient=Z);\n }\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=depth, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n axialfan_blades(width=bore_diameter, depth=depth, blade_angle=blade_angle);\n }\n}\n\n\nmodule axialfan_cut(width, depth, tolerance=.3*mm, mount_dist, screw_l, thread, head_embed=true, orient=Z, align=N)\n{\n s = [width, width, depth];\n size_align(size=s, orient=orient, orient_ref=-Z, align=align)\n {\n cubea(size=s, extrasize=[tolerance,tolerance,tolerance]);\n\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*mount_dist\/2, y*mount_dist\/2, depth\/2])\n {\n screw_cut(thread=thread, h=screw_l, head_embed=head_embed, orient=-Z, align=-Z);\n }\n }\n}\n\nmodule body(width, depth, bore_diameter, mount_dist, corner_radius, thread)\n{\n\n}\n\nmodule axialfan_blades(width, depth, angle)\n{\n linear_extrude(height=depth-1, center = true, convexity = 4, twist = angle)\n {\n for(i=[0:6])\n rotate((360*i)\/7)\n translate([0,-1.5\/2]) square([width\/2-0.75,1.5]);\n }\n}\n\n\nif(false)\n{\n axialfan(width=40*mm, depth=10.5*mm, mount_dist=32*mm, thread=ThreadM3, orient=Y, align=N);\n %axialfan_cut(width=40*mm, depth=10.5*mm, mount_dist=32*mm, screw_l=25*mm, thread=ThreadM3, orient=Y, align=N);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"42623d9e5cf4543b3ed43220568ff51d6f1f6753","subject":"extruder: use proper variable (extruder_motor)","message":"extruder: use proper variable (extruder_motor)\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"extruder-direct.scad","new_file":"extruder-direct.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nextruder_motor = dict_replace_multiple(Nema17, \n [\n [NemaFrontAxleLength, 22*mm]\n ]);\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(extruder_motor);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(extruder_motor);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(extruder_motor), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x-1,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %fncylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n fncylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n fncylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n fncylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n fncylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n fncylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\nCustomNema17 = dict_replace_multiple(Nema17, \n [\n [NemaFrontAxleLength, 22*mm]\n ]);\nextruder_motor = CustomNema17;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_x = -8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n fncylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n mount_thickness = motor_offset_x+house_w\/2;\n side = motorWidth(CustomNema17);\n\n translate([-mount_thickness,0,0])\n cubea([mount_thickness, side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n side = motorWidth(CustomNema17);\n mount_thickness = motor_offset_x+house_w\/2;\n\n cubea([motorLength(CustomNema17), side+slide_dist, side],[1,0,0]);\n\n translate([-mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n fncylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n fncylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n fncylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n fncylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n fncylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n fncylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n fncylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n fncylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n fncylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n fncylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n fncylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n fncylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n fncylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n fncylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*fncylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([0,bolt_center_offset,0])\n translate([motor_offset_x-1,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, NemaShort, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() { extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\nattach([[0,0,0],[0,0,-1]], extruder_conn_layflat) {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2,\n guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]],\n guidler_conn_layflat) {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); } }\n\n\/*extruder();*\/\n\/*print();*\/\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7574c8700e4a9aa6de240fd9de3361319a021888","subject":"extruder wip","message":"extruder wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nextruder_guilder_bearing = bearing_625;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-4*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\nmodule extruder_b(show_vitamins=false)\n{\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n \/\/ guidler mount\n guidler_arm_len = 15*mm;\n translate([hobbed_gear_d_inner\/2,0,guidler_arm_len])\n {\n difference()\n {\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n }\n }\n\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ main house\n extruder_b_size=[10,extruder_filapath_offset,10];\n #rcubea(extruder_b_size);\n\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=lookup(ThreadSize, extruder_hotmount_clamp_thread)+3*mm, h=extruder_b_w);\n }\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[-1,1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([extruder_guilder_bearing[1]+1*mm,extruder_guilder_bearing[2]+1*mm,extruder_guilder_bearing[1]*2], align=[x,0,1]);\n cylindera(d=extruder_guilder_bearing[1]+1*mm, h=extruder_guilder_bearing[2]+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1);\n }\n\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n \n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\nmodule x_extruder_a()\n{\n translate(extruder_offset)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n}\n\nmodule x_extruder_b()\n{\n translate(extruder_offset)\n {\n extruder_b(show_vitamins=true);\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\n\/*if(false)*\/\n{\n \/*extruder_a(show_vitamins=true);*\/\n %x_carriage(show_bearings=false);\n\n \/*if(false)*\/\n %x_extruder_a();\n\n \/*if(false)*\/\n x_extruder_b();\n\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\nmodule x_carriage_base()\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_shaft_d = 5*mm;\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-4*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_guilder_bearing = bearing_625;\nextruder_b_bearing = bearing_MR105;\nextruder_hotmount_clamp_thread = ThreadM3;\nmodule extruder_b(show_vitamins=false)\n{\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n \/\/ guidler mount\n guidler_arm_len = 15*mm;\n translate([hobbed_gear_d_inner\/2,0,guidler_arm_len])\n {\n difference()\n {\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n }\n }\n\n difference()\n {\n hull()\n \/*union()*\/\n {\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=lookup(ThreadSize, extruder_hotmount_clamp_thread)+3*mm, h=extruder_b_w);\n }\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[-1,1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([extruder_guilder_bearing[1]+1*mm,extruder_guilder_bearing[2]+1*mm,extruder_guilder_bearing[1]*2], align=[x,0,1]);\n cylindera(d=extruder_guilder_bearing[1]+1*mm, h=extruder_guilder_bearing[2]+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1);\n }\n\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n \n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base();\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n\n \/*if(false)*\/\n translate(extruder_offset)\n {\n extruder_b(show_vitamins=true);\n\n translate(extruder_offset_a)\n {\n %extruder_a(show_vitamins=true);\n }\n }\n\n \/*translate([0,-42,38])*\/\n \/*rotate([0,0,90])*\/\n \/*translate([0,-1,-42])*\/\n \/*translate([-83,25,-42])*\/\n \/*rotate([90,0,0])*\/\n \/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\n\/*if(false)*\/\n{\n\/*extruder_a(show_vitamins=true);*\/\n x_carriage();\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"64b55ba70e00f5a2cd0e54c03601ea190a3b8236","subject":"polygon wave ant3","message":"polygon wave ant3\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"ant3\/polygonWave.scad","new_file":"ant3\/polygonWave.scad","new_contents":"points = [[0,0],[1,0.5],[2,2],[3,1],[3.5,2],[4,0]];\npolygon(points=points);","old_contents":"","returncode":1,"stderr":"error: pathspec 'ant3\/polygonWave.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"7a3af06e1294ff9287ea7234168f0892e077bd37","subject":"Adapt boardholder to box.","message":"Adapt boardholder to box.\n","repos":"coreyabshire\/marv,coreyabshire\/marv","old_file":"scad\/boardholder.scad","new_file":"scad\/boardholder.scad","new_contents":"$fs=0.2;\n\nplate_width = 110.0;\nplate_depth = 120.0;\nplate_thickness = 3;\n\nmain_standoff_mounting_holes = [\n [-45, 50], [ 45, 50],\n [-45, -44], [ 45, -44],\n];\n\nmodule esc_cutout() {\n translate([0.0, plate_depth \/ 2.0, 0.0]) {\n cube([62.0, 38.0 * 2.0, plate_thickness * 4.0], \n center=true);\n }\n translate([0.0, 23.0, 0.0]) {\n cylinder(h=10.0,r=5, center=true);\n }\n}\n\nmodule corner_cutouts() {\n union() {\n translate([plate_width \/ 2, plate_depth \/ 2, 0.0]) {\n rotate(60.0) {\n cube([20.0, 40.0, 8.0], center=true);\n }\n }\n translate([-plate_width \/ 2, plate_depth \/ 2, 0.0]) {\n rotate(-600.0) {\n cube([20.0, 40.0, 8.0], center=true);\n }\n }\n }\n}\n\nmodule power_switch_cutout() {\n translate([-45.0, 35.0, 0.0]) {\n cylinder(h=10.0,r=3.175, center=true);\n }\n}\n\nmodule main_plate_base() {\n translate([0.0, 0.0, plate_thickness \/ 2.0]) {\n cube([plate_width, plate_depth, plate_thickness], \n center=true);\n }\n \n}\n\nmodule main_plate() {\n difference() {\n union() {\n main_plate_base();\n }\n union() {\n esc_cutout();\n \/\/corner_cutouts();\n \/\/power_switch_cutout();\n for (hole = main_standoff_mounting_holes) {\n translate([hole[0], hole[1], 0.0]) {\n cylinder(h=10.0,r=1.5, center=true);\n }\n }\n for (x = [-1, 1], y=[-1, 1]) {\n translate([x * 25, y * 25-25, 0.0]) {\n cylinder(h=10.0,r=1.5, center=true);\n }\n }\n }\n }\n}\n\n\nmain_plate();\n","old_contents":"$fs=0.2;\n\nplate_width = 130.0;\nplate_depth = 120.0;\nplate_thickness = 2.5;\n\nmain_standoff_mounting_holes = [\n [-45, 50], [ 45, 50],\n [-45, -44], [ 45, -44],\n];\n\npi_holes = [\n [0, 0], [49, 0],\n [0, 58], [49, 58],\n];\n\nmodule esc_cutout() {\n translate([0.0, plate_depth \/ 2.0, 0.0]) {\n cube([62.0, 38.0 * 2.0, plate_thickness * 4.0], \n center=true);\n }\n translate([0.0, 23.0, 0.0]) {\n cylinder(h=10.0,r=5, center=true);\n }\n}\n\nmodule corner_cutouts() {\n union() {\n translate([plate_width \/ 2, plate_depth \/ 2, 0.0]) {\n rotate(60.0) {\n cube([20.0, 40.0, 8.0], center=true);\n }\n }\n translate([-plate_width \/ 2, plate_depth \/ 2, 0.0]) {\n rotate(-600.0) {\n cube([20.0, 40.0, 8.0], center=true);\n }\n }\n }\n}\n\nmodule power_switch_cutout() {\n translate([-45.0, 35.0, 0.0]) {\n cylinder(h=10.0,r=3.175, center=true);\n }\n}\n\nmodule main_plate_base() {\n translate([0.0, 0.0, plate_thickness \/ 2.0]) {\n cube([plate_width, plate_depth, plate_thickness], \n center=true);\n }\n for (hole = pi_holes) {\n translate([hole[0] + 10, hole[1] - 55, 8]) {\n cylinder(h=16,r=2.5, center=true);\n }\n translate([hole[0] + 10, hole[1] - 55, 5]) {\n cylinder(h=10,r=4, center=true);\n }\n }\n translate([0,-plate_depth\/2-2,3.25]) {\n difference() {\n cube([20,10,6.5], center=true);\n translate([0,0,2.5])\n cube([16,4,10], center=true);\n }\n }\n}\n\nmodule breadboard() {\n cube([54.45, 82.56, 9.5]);\n}\n\nmodule breadboard_support() {\n cube([54.45, 10, 4.0]);\n}\n\nmodule breadboard_clip() {\n h = 20;\n rotate([90,0,0]) linear_extrude(height=5) \n polygon(points=[[0,0],[3,0],[3,h],[2,h],[0,h-3],[0,h-4],[1.5,h-4],[1.5,0]]);\n}\n\nmodule breadboard_clips() {\n translate([-8,0,0])\n breadboard_clip();\n translate([-8,-32,0])\n breadboard_clip();\n translate([-59.45,-5,0]) rotate([0,0,180]) \n breadboard_clip();\n translate([-59.45,-37,0]) rotate([0,0,180]) \n breadboard_clip();\n translate([-25,20,0]) rotate([0,0,90])\n breadboard_clip();\n translate([-50,20,0]) rotate([0,0,90])\n breadboard_clip();\n translate([-20,-82.56+20+3,0]) rotate([0,0,-90])\n breadboard_clip();\n translate([-45,-82.56+20+3,0]) rotate([0,0,-90])\n breadboard_clip();\n}\n\nmodule breadboard_mount() {\n union() {\n translate([(-plate_width\/2)+4,(-plate_depth\/2),2.5]) {\n breadboard_support();\n }\n translate([(-plate_width\/2)+4,(-plate_depth\/2)-2+82.56\/2-5,2.5]) {\n breadboard_support();\n }\n translate([(-plate_width\/2)+4,(-plate_depth\/2)-3+82.56-8,2.5]) {\n breadboard_support();\n }\n }\n}\n\nmodule main_plate() {\n difference() {\n union() {\n main_plate_base();\n breadboard_mount();\n }\n union() {\n esc_cutout();\n corner_cutouts();\n power_switch_cutout();\n for (hole = main_standoff_mounting_holes) {\n translate([hole[0], hole[1], 0.0]) {\n cylinder(h=10.0,r=1.5, center=true);\n }\n }\n for (hole = pi_holes) {\n translate([hole[0] + 10, hole[1] - 55, 0.0]) {\n cylinder(h=40.0,r=1.135, center=true);\n }\n }\n translate([-plate_width\/2+4, 6, 0.0]) {\n cylinder(h=20.0,r=1.135, center=true);\n }\n translate([-plate_width\/2+4, -11, 0.0]) {\n cylinder(h=20.0,r=1.135, center=true);\n }\n }\n }\n}\n\n\nmain_plate();\ntranslate([(-plate_width\/2)+4,(-plate_depth\/2)-1,6.5]) {\n %breadboard();\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e1d49a81301c3913bac251fe84bb73453d277d31","subject":"checking in before changing to have braces under main bar","message":"checking in before changing to have braces under main bar\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/walkerChassis.scad","new_file":"Drawings\/steel\/walkerChassis.scad","new_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) mainBar();\n\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,1]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves... shorter on outside\n translate([0,0, 20*a]) cylinder(r=2.5,h=6 ,$fn=16,center=true);\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n translate([loX*a,loY,0]) {\n cube([3.8,3.8,217],center=true); \/\/ lower rails\n for(z=[-1,1]) translate([0,0,z*108])\n color([0,0,1,1]) cube([2.5,2.5,6],center=true); \/\/ lower rail pegs\n }\n translate([0,loY+3.8,a*103]) cube([2*loX+4,3.8,3.8],center=true);\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ outer front diag\n translate([loX,loY,68*a]) sphere(1);\n translate([ Bx, 0 ,40*a]) sphere(1);\n }\n for(x=[-1,1]) {\n #hull() { \/\/ inner back trap\n translate([x*loX,loY,25*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*loX,loY,35*a]) sphere(1);\n translate([x*Bx , 0 ,60*a]) sphere(1);\n }\n }\n\n for (b=[-1,1]) { \/\/ outside diagonal brace\n hull() {\n translate([loX*b,loY,110*a]) sphere(1);\n translate([ Bx*b, 0 ,110*a]) sphere(1);\n }\n }\n hull() for(b=[-1,1]) translate([ Bx*b, 0 ,110*a]) sphere(1);\n\n *hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n *hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n *for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n \/\/ expanded mesh floor\n color([0,.2,.8,.2]) translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n}\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","old_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-40; \/\/ location of lower brace beams\nloX= 20;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0, 80*a]) legProxy();\n %translate([0,0,100*a]) legProxy();\n translate([0,0,90*a]) mainBar();\n translate([Bx*a,0,0]) cylinder(r=2.5,h=300,$fn=16,center=true); \/\/ main axle\n translate([-20*a,-40,0]) cube([2.5,2.5,300],center=true); \/\/ lower rails\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,70*a]) sphere(1); \/\/ arm guard bar\n hull() for (b=[-1,1]) translate([loX*b,loY,70*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n hull() { \/\/ inner support on outside trapaoid\n translate([ 5*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n }\n\n hull() { \/\/ center front trap\n translate([loX,loY, 2*a]) sphere(1);\n translate([ Bx, 0 ,25*a]) sphere(1);\n }\n hull() { \/\/ outer front diag\n translate([loX,loY,68*a]) sphere(1);\n translate([ Bx, 0 ,40*a]) sphere(1);\n }\n hull() { \/\/ inner back trap\n translate([-loX,loY,25*a]) sphere(1);\n translate([ -Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([-loX,loY,35*a]) sphere(1);\n translate([ -Bx, 0 ,65*a]) sphere(1);\n }\n\n for (b=[-1,1]) { \/\/ outside diagonal brace\n hull() {\n translate([loX*b,loY,140*a]) sphere(1);\n translate([ Bx*b, 0 ,110*a]) sphere(1);\n }\n hull() {\n translate([ Bx*b, 0 ,140*a]) sphere(1);\n translate([loX*b,loY,110*a]) sphere(1);\n }\n hull() {\n translate([loX*b,loY,110*a]) sphere(1);\n translate([ Bx*b, 0 ,110*a]) sphere(1);\n }\n }\n hull() for(b=[-1,1]) translate([loX*b,loY,140*a]) sphere(1);\n hull() for(b=[-1,1]) translate([ Bx*b, 0 ,110*a]) sphere(1);\n\n\n hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n}\nmodule legProxy() {\n\n legProxy1();\n mirror([1,0,0]) legProxy1();\n\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"656d4346a3cc1c38097d1a3513c86c02501225fe","subject":"completed first version of 5 part assembly","message":"completed first version of 5 part assembly\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/walkerChassis.scad","new_file":"Drawings\/steel\/walkerChassis.scad","new_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) mainBar();\n translate([0,0,a*(zBar+20)]) rotate([0,90*(a+1),0]) outerCap();\n}\nbasket();\n\nmodule basket() {\n for(a=[-1,1]) {\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,1]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n translate([loX*a,loY,0]) {\n color([0,0,1,1]) cube([2.5,2.5,230],center=true); \/\/ lower rails\n }\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ outer front diag\n translate([loX,loY,68*a]) sphere(1);\n translate([ Bx, 0 ,40*a]) sphere(1);\n }\n for(x=[-1,1]) {\n #hull() { \/\/ inner back trap\n translate([x*loX,loY,25*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*loX,loY,35*a]) sphere(1);\n translate([x*Bx , 0 ,60*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n *hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n *for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n \/\/ may do something more complicated for payload bay,\n \/\/ but for now, just stich sides together\n translate([a*(Bx+2),2,0]) cube([3.8,3.8,140],center=true);\n }\n\n \/\/ expanded mesh floor\n color([0,.2,.8,.2]) translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n \/\/ lower support\n for(x=[-1,1]) {\n \/\/ lower rail tubes\n translate([x*loX,loY,0]) cube([3.8,3.8,10],center=true);\n\n hull() { \/\/ diagonals\n translate([x*(loX+2),loY,0]) sphere(1);\n translate([x*(Bx-8),0,0]) sphere(1);\n }\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n}\n\nmodule outerCap() {\n for (b=[-1,1]) translate([Bx*b,0,-1]) {\n \/\/ axle brace sleves... shorter on outside\n cylinder(r=2.5,h=6 ,$fn=16,center=true);\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n for(x=[-1,1]) translate([x*loX,loY,1])\n cube([3.8,3.8,8],center=true); \/\/ lower rail sleves\n\n for (b=[-1,1]) hull() { \/\/ outside diagonal brace\n translate([loX*b,loY,0]) sphere(1);\n translate([ Bx*b, 0 ,0]) sphere(1);\n }\n hull() for(b=[-1,1]) translate([Bx*b,0,0]) sphere(1);\n}\n\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","old_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) mainBar();\n\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,1]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves... shorter on outside\n translate([0,0, 20*a]) cylinder(r=2.5,h=6 ,$fn=16,center=true);\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n translate([loX*a,loY,0]) {\n cube([3.8,3.8,217],center=true); \/\/ lower rails\n for(z=[-1,1]) translate([0,0,z*108])\n color([0,0,1,1]) cube([2.5,2.5,6],center=true); \/\/ lower rail pegs\n }\n translate([0,loY+3.8,a*103]) cube([2*loX+4,3.8,3.8],center=true);\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([loX*b,loY,70*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ outer front diag\n translate([loX,loY,68*a]) sphere(1);\n translate([ Bx, 0 ,40*a]) sphere(1);\n }\n for(x=[-1,1]) {\n #hull() { \/\/ inner back trap\n translate([x*loX,loY,25*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*loX,loY,35*a]) sphere(1);\n translate([x*Bx , 0 ,60*a]) sphere(1);\n }\n }\n\n for (b=[-1,1]) { \/\/ outside diagonal brace\n hull() {\n translate([loX*b,loY,110*a]) sphere(1);\n translate([ Bx*b, 0 ,110*a]) sphere(1);\n }\n }\n hull() for(b=[-1,1]) translate([ Bx*b, 0 ,110*a]) sphere(1);\n\n *hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n *hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n *for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n \/\/ expanded mesh floor\n color([0,.2,.8,.2]) translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n}\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e4abed3b146b5a43ba8603a11b3a262fe78c087e","subject":"changes in library","message":"changes in library\n","repos":"mauricebasement\/MyOpenSCADLibrary","old_file":"library3d.scad","new_file":"library3d.scad","new_contents":"\/\/Objects\nmodule ring(r=5,d=1,h=2) {\n\tdifference() {\n\t\tcylinder(r=r,h=h);\n\t\tcylinder(r=r-d,h=h);\n\t}\n}\n\/\/Translations \/\/expand for z axis\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x) {\n\tfor(i=[0:3])rotate(a=[0,0,90*i])translate([x,0])children();\n}","old_contents":"module ring(r=5,d=1,h=2) {\n\tdifference() {\n\t\tcylinder(r=r,h=h);\n\t\tcylinder(r=r-d,h=h);\n\t}\n}\nmodule tr_xy(x,y=0) {\n\tif(y==0) {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,x*j])children();\n\t} else {\n\t\tfor(i=[-1,1])for(j=[-1,1])translate([x*i,y*j])children();\n\t}\n}\nmodule rot_x(x) {\n\tfor(i=[0:3])rotate(a=[0,0,90*i])translate([x,0])children();\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"156ae9742ceca5aa0e22de92045193c01d06ada2","subject":"fixup! x\/carriage: Work on X endstops, SN04 pos etc","message":"fixup! x\/carriage: Work on X endstops, SN04 pos etc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0]);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = (xaxis_rod_distance - 2*xaxis_bearing[3])\/sqrt(2);\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\nxaxis_endstop_SN04_pos = [-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2] + v_z(xaxis_endstop_size_SN04)\/2;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\ngear_20t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 20]\n];\n\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(extruder_gear_small,extruder_gear_big);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=YAXIS+ZAXIS+XAXIS);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n {\n hull()\n {\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n \/*rcubea(size=[20*mm,xaxis_endstop_size_SN04[1]+4*mm,xaxis_endstop_size_SN04[2]], align=YAXIS+ZAXIS+XAXIS);*\/\n }\n }\n }\n\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n rcylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = extruder_b_w\/2+1)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-YAXIS+ZAXIS);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0]);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0]);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n rcylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*translate([-xaxis_carriage_top_width\/2,xaxis_endstop_size_SN04[1]\/2+4*mm,xaxis_end_wz\/2+8.5*mm-2*mm])*\/\n screw_cut(nut=NutHexM4, h=16*mm, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.3,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 10*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n rcylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0]);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, align=[0,0,0])\n{\n \/*sensormount_cylinder(part=part, align=align);*\/\n if(part == \"pos\")\n {\n cubea();\n }\n else if(part == \"neg\")\n {\n cubea(s=[11,11,11]);\n }\n if(part == \"vit\")\n {\n %translate([-6,2,5])\n \/*rotate(ZAXIS*-90 + XAXIS*180)*\/\n \/*rotate(XAXIS*180)*\/\n rotate(XAXIS*90)\n rotate(ZAXIS*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule sensormount_cylinder(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea(size=[1000, xaxis_belt_width+.1, belt_t2], extrasize=1000*Y, extrasize_align=Y);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS, extra_h=1000, extra_align=Y);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, trap_h=1000, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"48318c19e077d90dca0c304d2b918413a70efcc0","subject":"nut-data: add NutKnurlM3_5_46","message":"nut-data: add NutKnurlM3_5_46\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"nut-data.scad","new_file":"nut-data.scad","new_contents":"\/\/ THIS FILE HAS BEEN GENERATED\n\/\/ DO NOT MODIFY DIRECTLY\n\ninclude \ninclude \n\nNutHoleDia = 0;\nNutWidthMin = 1;\nNutThickness = 2;\nNutWidthMax = 3;\nNutThread = 4;\nNutFacets = 5;\n\nNutHexM1_2 = [\n [NutHoleDia, 1.2*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_2],\n [NutFacets, 6],\n];\n\nNutHexM1_4 = [\n [NutHoleDia, 1.4*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_4],\n [NutFacets, 6],\n];\n\nNutHexM1_6 = [\n [NutHoleDia, 1.6*mm],\n [NutWidthMin, 3.2*mm],\n [NutThickness, 1.3*mm],\n [NutWidthMax, 3.48*mm],\n [NutThread, ThreadM1_6],\n [NutFacets, 6],\n];\n\nNutHexM1_8 = [\n [NutHoleDia, 1.8*mm],\n [NutWidthMin, 3.5*mm],\n [NutThickness, 1.4*mm],\n [NutWidthMax, 3.82*mm],\n [NutThread, ThreadM1_8],\n [NutFacets, 6],\n];\n\nNutHexM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 2.4*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2.8*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 4.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 5.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexM7 = [\n [NutHoleDia, 7*mm],\n [NutWidthMin, 11*mm],\n [NutThickness, 5.5*mm],\n [NutWidthMax, 12.12*mm],\n [NutThread, ThreadM7],\n [NutFacets, 6],\n];\n\nNutHexM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 6.8*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 8.4*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 10.8*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 12.8*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 14.8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 15.8*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 19.4*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 21.5*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 23.8*mm],\n [NutWidthMax, 45.29*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexM30 = [\n [NutHoleDia, 30*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 25.6*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 28.7*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 31*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 33.4*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 34*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 36*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 38*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexM52 = [\n [NutHoleDia, 52*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 42*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 45*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 48*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 51*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutHexThinM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexThinM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexThinM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 1.8*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexThinM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexThinM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 2.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexThinM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 2.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexThinM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexThinM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexThinM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexThinM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexThinM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 7*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexThinM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexThinM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 9*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexThinM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 10*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexThinM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 11*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexThinM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 12*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexThinM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 13.5*mm],\n [NutWidthMax, 45.2*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexThinM30 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 15*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexThinM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 16.5*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexThinM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexThinM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 19.5*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexThinM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 21*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexThinM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 22.5*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexThinM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 24*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexThinM52 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 26*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexThinM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 28*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexThinM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 30*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexThinM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 32*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutKnurlM2_4_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM2_6_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM3_8_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_3_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 3*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM5_5_42 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 6.7*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 7.25*mm],\n [NutThread, ThreadM5],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_46 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.5*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.5*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nAllNut = [NutHexM1_2,\nNutHexM1_4,\nNutHexM1_6,\nNutHexM1_8,\nNutHexM2,\nNutHexM2_5,\nNutHexM3,\nNutHexM3_5,\nNutHexM4,\nNutHexM5,\nNutHexM6,\nNutHexM7,\nNutHexM8,\nNutHexM10,\nNutHexM12,\nNutHexM14,\nNutHexM16,\nNutHexM18,\nNutHexM20,\nNutHexM22,\nNutHexM24,\nNutHexM27,\nNutHexM30,\nNutHexM33,\nNutHexM36,\nNutHexM39,\nNutHexM42,\nNutHexM45,\nNutHexM48,\nNutHexM52,\nNutHexM56,\nNutHexM60,\nNutHexM64,\nNutHexThinM2,\nNutHexThinM2_5,\nNutHexThinM3,\nNutHexThinM3_5,\nNutHexThinM4,\nNutHexThinM5,\nNutHexThinM6,\nNutHexThinM8,\nNutHexThinM10,\nNutHexThinM12,\nNutHexThinM14,\nNutHexThinM16,\nNutHexThinM18,\nNutHexThinM20,\nNutHexThinM22,\nNutHexThinM24,\nNutHexThinM27,\nNutHexThinM30,\nNutHexThinM33,\nNutHexThinM36,\nNutHexThinM39,\nNutHexThinM42,\nNutHexThinM45,\nNutHexThinM48,\nNutHexThinM52,\nNutHexThinM56,\nNutHexThinM60,\nNutHexThinM64,\nNutKnurlM2_4_42,\nNutKnurlM2_6_42,\nNutKnurlM3_5_42,\nNutKnurlM3_3_42,\nNutKnurlM5_5_42,\n];\n","old_contents":"\/\/ THIS FILE HAS BEEN GENERATED\n\/\/ DO NOT MODIFY DIRECTLY\n\ninclude \ninclude \n\nNutHoleDia = 0;\nNutWidthMin = 1;\nNutThickness = 2;\nNutWidthMax = 3;\nNutThread = 4;\nNutFacets = 5;\n\nNutHexM1_2 = [\n [NutHoleDia, 1.2*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_2],\n [NutFacets, 6],\n];\n\nNutHexM1_4 = [\n [NutHoleDia, 1.4*mm],\n [NutWidthMin, 3*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 3.28*mm],\n [NutThread, ThreadM1_4],\n [NutFacets, 6],\n];\n\nNutHexM1_6 = [\n [NutHoleDia, 1.6*mm],\n [NutWidthMin, 3.2*mm],\n [NutThickness, 1.3*mm],\n [NutWidthMax, 3.48*mm],\n [NutThread, ThreadM1_6],\n [NutFacets, 6],\n];\n\nNutHexM1_8 = [\n [NutHoleDia, 1.8*mm],\n [NutWidthMin, 3.5*mm],\n [NutThickness, 1.4*mm],\n [NutWidthMax, 3.82*mm],\n [NutThread, ThreadM1_8],\n [NutFacets, 6],\n];\n\nNutHexM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 2.4*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2.8*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 4.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 5.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexM7 = [\n [NutHoleDia, 7*mm],\n [NutWidthMin, 11*mm],\n [NutThickness, 5.5*mm],\n [NutWidthMax, 12.12*mm],\n [NutThread, ThreadM7],\n [NutFacets, 6],\n];\n\nNutHexM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 6.8*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 8.4*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 10.8*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 12.8*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 14.8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 15.8*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 19.4*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 21.5*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 23.8*mm],\n [NutWidthMax, 45.29*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexM30 = [\n [NutHoleDia, 30*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 25.6*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 28.7*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 31*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 33.4*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 34*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 36*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 38*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexM52 = [\n [NutHoleDia, 52*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 42*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 45*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 48*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 51*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutHexThinM2 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 4*mm],\n [NutThickness, 1.2*mm],\n [NutWidthMax, 4.32*mm],\n [NutThread, ThreadM2],\n [NutFacets, 6],\n];\n\nNutHexThinM2_5 = [\n [NutHoleDia, 2.5*mm],\n [NutWidthMin, 5*mm],\n [NutThickness, 1.6*mm],\n [NutWidthMax, 5.45*mm],\n [NutThread, ThreadM2_5],\n [NutFacets, 6],\n];\n\nNutHexThinM3 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 5.5*mm],\n [NutThickness, 1.8*mm],\n [NutWidthMax, 6.01*mm],\n [NutThread, ThreadM3],\n [NutFacets, 6],\n];\n\nNutHexThinM3_5 = [\n [NutHoleDia, 3.5*mm],\n [NutWidthMin, 6*mm],\n [NutThickness, 2*mm],\n [NutWidthMax, 6.58*mm],\n [NutThread, ThreadM3_5],\n [NutFacets, 6],\n];\n\nNutHexThinM4 = [\n [NutHoleDia, 4*mm],\n [NutWidthMin, 7*mm],\n [NutThickness, 2.2*mm],\n [NutWidthMax, 7.66*mm],\n [NutThread, ThreadM4],\n [NutFacets, 6],\n];\n\nNutHexThinM5 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 8*mm],\n [NutThickness, 2.7*mm],\n [NutWidthMax, 8.79*mm],\n [NutThread, ThreadM5],\n [NutFacets, 6],\n];\n\nNutHexThinM6 = [\n [NutHoleDia, 6*mm],\n [NutWidthMin, 10*mm],\n [NutThickness, 3.2*mm],\n [NutWidthMax, 11.05*mm],\n [NutThread, ThreadM6],\n [NutFacets, 6],\n];\n\nNutHexThinM8 = [\n [NutHoleDia, 8*mm],\n [NutWidthMin, 13*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 14.38*mm],\n [NutThread, ThreadM8],\n [NutFacets, 6],\n];\n\nNutHexThinM10 = [\n [NutHoleDia, 10*mm],\n [NutWidthMin, 16*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 17.77*mm],\n [NutThread, ThreadM10],\n [NutFacets, 6],\n];\n\nNutHexThinM12 = [\n [NutHoleDia, 12*mm],\n [NutWidthMin, 18*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 20.03*mm],\n [NutThread, ThreadM12],\n [NutFacets, 6],\n];\n\nNutHexThinM14 = [\n [NutHoleDia, 14*mm],\n [NutWidthMin, 21*mm],\n [NutThickness, 7*mm],\n [NutWidthMax, 23.35*mm],\n [NutThread, ThreadM14],\n [NutFacets, 6],\n];\n\nNutHexThinM16 = [\n [NutHoleDia, 16*mm],\n [NutWidthMin, 24*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 26.75*mm],\n [NutThread, ThreadM16],\n [NutFacets, 6],\n];\n\nNutHexThinM18 = [\n [NutHoleDia, 18*mm],\n [NutWidthMin, 27*mm],\n [NutThickness, 9*mm],\n [NutWidthMax, 29.56*mm],\n [NutThread, ThreadM18],\n [NutFacets, 6],\n];\n\nNutHexThinM20 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 30*mm],\n [NutThickness, 10*mm],\n [NutWidthMax, 32.95*mm],\n [NutThread, ThreadM20],\n [NutFacets, 6],\n];\n\nNutHexThinM22 = [\n [NutHoleDia, 22*mm],\n [NutWidthMin, 34*mm],\n [NutThickness, 11*mm],\n [NutWidthMax, 37.29*mm],\n [NutThread, ThreadM22],\n [NutFacets, 6],\n];\n\nNutHexThinM24 = [\n [NutHoleDia, 24*mm],\n [NutWidthMin, 36*mm],\n [NutThickness, 12*mm],\n [NutWidthMax, 39.55*mm],\n [NutThread, ThreadM24],\n [NutFacets, 6],\n];\n\nNutHexThinM27 = [\n [NutHoleDia, 27*mm],\n [NutWidthMin, 41*mm],\n [NutThickness, 13.5*mm],\n [NutWidthMax, 45.2*mm],\n [NutThread, ThreadM27],\n [NutFacets, 6],\n];\n\nNutHexThinM30 = [\n [NutHoleDia, 20*mm],\n [NutWidthMin, 46*mm],\n [NutThickness, 15*mm],\n [NutWidthMax, 50.85*mm],\n [NutThread, ThreadM30],\n [NutFacets, 6],\n];\n\nNutHexThinM33 = [\n [NutHoleDia, 33*mm],\n [NutWidthMin, 50*mm],\n [NutThickness, 16.5*mm],\n [NutWidthMax, 55.37*mm],\n [NutThread, ThreadM33],\n [NutFacets, 6],\n];\n\nNutHexThinM36 = [\n [NutHoleDia, 36*mm],\n [NutWidthMin, 55*mm],\n [NutThickness, 18*mm],\n [NutWidthMax, 60.79*mm],\n [NutThread, ThreadM36],\n [NutFacets, 6],\n];\n\nNutHexThinM39 = [\n [NutHoleDia, 39*mm],\n [NutWidthMin, 60*mm],\n [NutThickness, 19.5*mm],\n [NutWidthMax, 66.44*mm],\n [NutThread, ThreadM39],\n [NutFacets, 6],\n];\n\nNutHexThinM42 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 65*mm],\n [NutThickness, 21*mm],\n [NutWidthMax, 71.3*mm],\n [NutThread, ThreadM42],\n [NutFacets, 6],\n];\n\nNutHexThinM45 = [\n [NutHoleDia, 45*mm],\n [NutWidthMin, 70*mm],\n [NutThickness, 22.5*mm],\n [NutWidthMax, 76.95*mm],\n [NutThread, ThreadM45],\n [NutFacets, 6],\n];\n\nNutHexThinM48 = [\n [NutHoleDia, 48*mm],\n [NutWidthMin, 75*mm],\n [NutThickness, 24*mm],\n [NutWidthMax, 82.6*mm],\n [NutThread, ThreadM48],\n [NutFacets, 6],\n];\n\nNutHexThinM52 = [\n [NutHoleDia, 42*mm],\n [NutWidthMin, 80*mm],\n [NutThickness, 26*mm],\n [NutWidthMax, 88.25*mm],\n [NutThread, ThreadM52],\n [NutFacets, 6],\n];\n\nNutHexThinM56 = [\n [NutHoleDia, 56*mm],\n [NutWidthMin, 85*mm],\n [NutThickness, 28*mm],\n [NutWidthMax, 93.56*mm],\n [NutThread, ThreadM56],\n [NutFacets, 6],\n];\n\nNutHexThinM60 = [\n [NutHoleDia, 60*mm],\n [NutWidthMin, 90*mm],\n [NutThickness, 30*mm],\n [NutWidthMax, 99.21*mm],\n [NutThread, ThreadM60],\n [NutFacets, 6],\n];\n\nNutHexThinM64 = [\n [NutHoleDia, 64*mm],\n [NutWidthMin, 95*mm],\n [NutThickness, 32*mm],\n [NutWidthMax, 104.86*mm],\n [NutThread, ThreadM64],\n [NutFacets, 6],\n];\n\nNutKnurlM2_4_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 4*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM2_6_42 = [\n [NutHoleDia, 2*mm],\n [NutWidthMin, 3.25*mm],\n [NutThickness, 6*mm],\n [NutWidthMax, 3.25*mm],\n [NutThread, ThreadM2],\n [NutFacets, 20],\n];\n\nNutKnurlM3_8_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 8*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_5_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM3_3_42 = [\n [NutHoleDia, 3*mm],\n [NutWidthMin, 4.1*mm],\n [NutThickness, 3*mm],\n [NutWidthMax, 4.1*mm],\n [NutThread, ThreadM3],\n [NutFacets, 20],\n];\n\nNutKnurlM5_5_42 = [\n [NutHoleDia, 5*mm],\n [NutWidthMin, 6.7*mm],\n [NutThickness, 5*mm],\n [NutWidthMax, 7.25*mm],\n [NutThread, ThreadM5],\n [NutFacets, 20],\n];\n\nAllNut = [NutHexM1_2,\nNutHexM1_4,\nNutHexM1_6,\nNutHexM1_8,\nNutHexM2,\nNutHexM2_5,\nNutHexM3,\nNutHexM3_5,\nNutHexM4,\nNutHexM5,\nNutHexM6,\nNutHexM7,\nNutHexM8,\nNutHexM10,\nNutHexM12,\nNutHexM14,\nNutHexM16,\nNutHexM18,\nNutHexM20,\nNutHexM22,\nNutHexM24,\nNutHexM27,\nNutHexM30,\nNutHexM33,\nNutHexM36,\nNutHexM39,\nNutHexM42,\nNutHexM45,\nNutHexM48,\nNutHexM52,\nNutHexM56,\nNutHexM60,\nNutHexM64,\nNutHexThinM2,\nNutHexThinM2_5,\nNutHexThinM3,\nNutHexThinM3_5,\nNutHexThinM4,\nNutHexThinM5,\nNutHexThinM6,\nNutHexThinM8,\nNutHexThinM10,\nNutHexThinM12,\nNutHexThinM14,\nNutHexThinM16,\nNutHexThinM18,\nNutHexThinM20,\nNutHexThinM22,\nNutHexThinM24,\nNutHexThinM27,\nNutHexThinM30,\nNutHexThinM33,\nNutHexThinM36,\nNutHexThinM39,\nNutHexThinM42,\nNutHexThinM45,\nNutHexThinM48,\nNutHexThinM52,\nNutHexThinM56,\nNutHexThinM60,\nNutHexThinM64,\nNutKnurlM2_4_42,\nNutKnurlM2_6_42,\nNutKnurlM3_5_42,\nNutKnurlM3_3_42,\nNutKnurlM5_5_42,\n];\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"b7607949834458e86b48dd328afffb2a798cbbdc","subject":"guanin","message":"guanin","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Guanin.scad","new_file":"3D-models\/SCAD\/Guanin.scad","new_contents":"x=50; \ny=19; \nz=7;\nz2=2.5; \/\/\u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439\n \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0413\u0443\u0430\u043d\u0438\u043d \ndifference(){\n union(){ \ndifference() { \ncolor(\"Red\") cube ([x+10, y, z], center=true);\n #rotate([0, 90, 0]) translate([0, 4.5, 26.5]) cylinder(9, 2.65, 2.65);\n\n #rotate([0, 90, 0]) translate([0, -4.5, 26.5]) cylinder(9, 2.65, 2.65); \n} \n\ncolor(\"Red\") translate ([-29, y\/200000, -3.5]) cylinder (z, y\/2, y\/2);\n} \n#rotate([90, 0, 90]) translate([0, 0, -44.4]) cylinder(9, 2.65, 2.65);\n\ntranslate([-3, 0, 1.1]) cube([40, 21, 5], center=true);\n\n} \nrotate([90, 0, 0]) color(\"red\") translate([-23, 0, -9.5]) cylinder(19, 3.5, 3.5);\nrotate([90, 0, 0]) color(\"red\") translate([17.5, 0, -9.5]) cylinder(19, 3.5, 3.5);\n\n\n\n","old_contents":"<<<<<<< HEAD\n\/\/\u0410\u0437\u043e\u0442\u0438\u0441\u0442\u044b\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044f: \nx=60; \ny=19; \nz=7; \nt=0; \nz2=2.5;\nedge=0.71*y; \ndx=edge*1.41; \nc=\"blue\";\n\/\/\u0422\u0438\u043c\u0438\u043d \n=======\nx=50; \ny=19; \nz=7;\nz2=2.5; \/\/\u0440\u0430\u0434\u0438\u0443\u0441 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439\n \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \n\/\/\u0413\u0443\u0430\u043d\u0438\u043d \n\n$fn=270; \n>>>>>>> 795fbde9371efb160a283f760954fcc6482fc0d1\ndifference(){\nunion(){\ntranslate ([dx\/2,t,0]) { \n\n<<<<<<< HEAD\ncolor(c) translate ([0,0,0]) cube ([x-dx\/2,y,z], center=true); \n=======\ncolor(\"Red\") translate ([-26,y\/200000,-3.5]) cylinder (z,y\/2,y\/2);\n} \n\trotate([90,0,90]) translate([0,0,-100]) cylinder(70,z2,z2);\n\n\ttranslate([-3,0,1.1]) cube([40,21,5], center=true);\n>>>>>>> 795fbde9371efb160a283f760954fcc6482fc0d1\n\ntranslate([-25,0,0]) color(c) rotate ([0,0,45]) cube ([edge,edge,z], center=true); \n} \n<<<<<<< HEAD\ntranslate([24.78,-9.5,-1]) color(c) cube([10,19,5]);\n}\n\ntranslate([-32,0,0]) color(c) cube([21,21,10],center=true);\n\nrotate([0,90,0]) color(c) translate([0,0,-22]) cylinder(5,2.7,2.7);\n\nrotate([0,90,0]) color(c) translate([0,0,27]) cylinder(9,2.7,2.7);\n\ntranslate([-10,-10.5,0]) color(c) cube([35,21,5]);\n}\n\nrotate([90,0,0]) color(c) translate([-10.5,0,-9.5]) cylinder(19,3.5,3.5);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0422 \u043e\u0437\u043d\u043e\u0447\u0430\u0435\u0442 \u0422\u0438\u043c\u0438\u043d\nxx=2;\ne=12;\ntranslate([8,-6,0]) cube([xx,e+2,xx]);\ntranslate([3,-6,0]) cube([e,xx,xx]);\n=======\nrotate([90,0,0]) translate([-22.5,0,-9.5]) cylinder(19,3.5,3.5);\n \n \n>>>>>>> 795fbde9371efb160a283f760954fcc6482fc0d1\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c5a1837eacb1b7387a2ea75c905cfc7b7afb5ccd","subject":"fix: properly position the sample","message":"fix: properly position the sample\n","repos":"jsconan\/camelSCAD","old_file":"operator\/sample.scad","new_file":"operator\/sample.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Takes a sample of the scene.\n *\n * @package operator\n * @author jsconan\n *\/\n\n\/**\n * Takes a sample of the scene and place it at the origin.\n * @param Number|Vector [size] - The size of sample.\n * @param Number|Vector [offset] - The position of the sample center. Will be the on the bottom face if center=false,\n and on the actual center if center=true.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [x] - The horizontal offset.\n * @param Number [y] - The depth offset.\n * @param Number [z] - The vertical offset.\n * @param Boolean [center] - Whether or not center the sample on all axis.\n *\/\nmodule sample(size, offset, l, w, h, x, y, z, center) {\n size = apply3D(size, l, w, h);\n offset = apply3D(offset, x, y, z) \/ (center ? 2 : 1);\n\n translate(-offset) {\n intersection() {\n translate(offset) {\n cube(size, center=center);\n }\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Takes a sample of the scene.\n *\n * @package operator\n * @author jsconan\n *\/\n\n\/**\n * Takes a sample of the scene and place it at the origin.\n * @param Number|Vector [size] - The size of sample.\n * @param Number|Vector [offset] - The position of the sample center. Will be the on the bottom face if center=false,\n and on the actual center if center=true.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [x] - The horizontal offset.\n * @param Number [y] - The depth offset.\n * @param Number [z] - The vertical offset.\n * @param Boolean [center] - Whether or not center the sample on the vertical axis.\n *\/\nmodule sample(size, offset, l, w, h, x, y, z, center) {\n size = apply3D(size, l, w, h);\n offset = apply3D(offset, x, y, z);\n\n translate(-offset) {\n intersection() {\n translate(offset) {\n box(size, center=center);\n }\n children();\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"092fdd540a9c18650548bde6163391b769544954","subject":"fixed hole sizes and its locations","message":"fixed hole sizes and its locations\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"heater_handle\/heater_handle.scad","new_file":"heater_handle\/heater_handle.scad","new_contents":"span=172;\ndia=18;\nh=60+dia;\n$fn=100;\n\nmodule _handle_main()\n{\n difference()\n {\n union()\n {\n \/\/ side blocks\n for(dx=[0, span])\n translate(dx*[1,0,0])\n cube([dia, h, dia\/2]);\n \/\/ top holder\n translate([dia, h, 0])\n cube([span-dia, dia, dia\/2]);\n \/\/ rounded edges\n for(dx=[0, span-dia])\n translate([dia+dx, h,0])\n cylinder(r=dia, h=dia\/2);\n }\n for(dx=[0, span-3*dia])\n translate([2*dia+dx, h-dia, -1])\n cylinder(r=dia, h=dia\/2+2);\n }\n}\n\nmodule _hole()\n{\n hull()\n for(dx=[-0.5, 0.5])\n translate([dx, 0, -1])\n cylinder(r=(3.8+0.5)\/2, h=dia\/2+2, $fn=20);\n}\n\n\nmodule _handle()\n{\n difference()\n {\n _handle_main();\n \/\/ left cut in\n translate([0, 0, -1])\n rotate(-45*[0, 0, 1])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ right cut it\n translate([span+dia, 0, dia+1])\n rotate([0, 180, 45])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ screw holes\n for(dx=[0, span])\n translate([dx+dia\/2, dia-2, 0])\n _hole();\n }\n}\n\n_handle();\n\/\/_hole();\n","old_contents":"span=172;\ndia=18;\nh=60+dia;\n$fn=100;\n\nmodule _handle_main()\n{\n difference()\n {\n union()\n {\n \/\/ side blocks\n for(dx=[0, span])\n translate(dx*[1,0,0])\n cube([dia, h, dia\/2]);\n \/\/ top holder\n translate([dia, h, 0])\n cube([span-dia, dia, dia\/2]);\n \/\/ rounded edges\n for(dx=[0, span-dia])\n translate([dia+dx, h,0])\n cylinder(r=dia, h=dia\/2);\n }\n for(dx=[0, span-3*dia])\n translate([2*dia+dx, h-dia, -1])\n cylinder(r=dia, h=dia\/2+2);\n }\n}\n\nmodule _hole()\n{\n hull()\n for(dx=[-0.5, 0.5])\n translate([dx, 0, -1])\n cylinder(r=3.8+0.5\/2, h=dia\/2+2, $fn=20);\n}\n\n\nmodule _handle()\n{\n difference()\n {\n _handle_main();\n \/\/ left cut in\n translate([0, 0, -1])\n rotate(-45*[0, 0, 1])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ right cut it\n translate([span+dia, 0, dia+1])\n rotate([0, 180, 45])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ screw holes\n for(dx=[0, span])\n translate([dx+dia\/2, dia, 0])\n _hole();\n }\n}\n\n_handle();\n\/\/_hole();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"cd0a713ae54358f255d0f24620238ecec60d8c69","subject":"Small fixes after test print and also added to comments and some cleanup","message":"Small fixes after test print and also added to comments and some cleanup\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/limit-switches\/limit-switch-large.scad","new_file":"openscad\/limit-switches\/limit-switch-large.scad","new_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, specifically this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\n\nLARGE = 100;\nEPSILON = 0.1;\n\n\nmodule switch_cover() {\n base_thick = 1; \/\/ Thickness of \"base\" plate\n base_ro = 2; \/\/ Outer radii of base plate\n switch_thick = 8;\n \n \/\/ Switch dimensions\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10 + 0.5; \/\/ for sticky tape or wire\n \n \/\/ Nominal offset in y and x of the lower-left-corner\n \/\/ of the switch well.\n switch_off_d0 = 8;\n switch_off_w = 12;\n \n switch_r = 3; \/\/ inner radius of switch well \n top_gap_w = 18.5; \/\/ width of gap on the top, from LHS\n top_gap_d = 5; \/\/ depth (in y) of the top gap, from the top\n top_wall_thick = 3.5; \/\/ thickness (y) of top wall\n right_wall_thick = 3; \/\/ thickness (x) of right wall\n \n bottom_gap_w = 14; \/\/ width of bottom gap, from RHS\n bottom_gap_d = 11; \/\/ depth (in y) of bottom gap, from bottom\n\n \/\/ These are for screw holes\n hole_dist_x = 16; \/\/Distance of screw holes in x == Tetrix spacing\n hole_dist_y = 8; \/\/ Distance of scew holes in y == Lego spacing\n hole_wall_thick = 3; \/\/ Min thickness of walls around a hole\n hole_r = 2.05; \/\/ Just enough for 3\/32 (imperial) screws to slip through easily\n \n \/\/ These are minimum distances to check against when computing\n \/\/ how much deep (in y) to start the well for the switch - so that there is\n \/\/ enough space around each hole in the y-direction\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n\n top_gap_end_x = switch_off_w + top_gap_w;\n bottom_gap_end_x = switch_off_w + bottom_gap_w;\n bottom_gap_end_y = switch_off_d + bottom_gap_d;\n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_thick;\n hole_x = hole_wall_thick + hole_r;\n hole_y = hole_wall_thick + hole_r;\n base_w = switch_off_w + switch_w + right_wall_thick; \/\/ thickness of base\n \n\n difference() {\n oblong(base_w, base_d, base_ro, tot_thick);\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE);\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_end_x+EPSILON, LARGE, LARGE]);\n translate([bottom_gap_end_x, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_end_y + 2*EPSILON, LARGE]);\n translate([hole_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole_x, hole_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole_x + hole_dist_x, hole_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n }\n}\n\nmodule trial1() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([LARGE, 18, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\nmodule trial2() {\n difference() {\n switch_cover();\n translate([-EPSILON, -EPSILON, -EPSILON]) cube([30, LARGE, LARGE]);\n translate([35, -EPSILON, -EPSILON]) cube([35, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, 6]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\n\/\/switch_cover();\ntranslate([60, 0, 0]) trial1();\ntranslate([80, 0, 0]) trial2();","old_contents":"\/\/\n\/\/ Enclosure for the larger limit switch, such as this one:\n\/\/ \"Cylewet V-154-1C25 Micro Limit Switch\"\n\/\/\nuse <..\/common\/extrusions.scad>\nbase_thick = 1;\nswitch_thick = 8;\nLARGE = 100;\nEPSILON = 0.1;\n\nmodule switch_base() {\n base_w = 50;\n switch_w = 28 + 0.2;\n switch_d = 16 + 0.2;\n switch_h = 10 + 0.5; \/\/ for sticky tape or wire\n switch_off_d0 = 8;\n switch_off_w = 12;\n switch_r = 3;\n top_gap_w = switch_off_w + 18.5;\n top_gap_d = 5;\n top_wall_thick = 3.5;\n hole_dist_x = 16;\n hole_dist_y = 8;\n hole_wall_thick = 3;\n hole_r = 2; \/\/ enough for 3\/32 (imperial) screws\n top_of_top_hole = 2*hole_wall_thick + hole_r + hole_dist_y + hole_r;\n bot_hole_check = 2*hole_wall_thick + 2*hole_r;\n top_hole_check = top_of_top_hole - (switch_d - top_gap_d);\n \/\/switch_off_d = max(switch_off_d0, bot_hole_check, top_hole_check);\n switch_off_d = max(switch_off_d0, bot_hole_check);\n\n bottom_gap_w = switch_off_w + 14;\n bottom_gap_d = switch_off_d + 11; \n base_d = switch_off_d + switch_d + top_wall_thick;\n tot_thick = base_thick + switch_thick;\n hole1_x = hole_wall_thick + hole_r;\n hole1_y = hole_wall_thick + hole_r;\n\n ro = 2;\n difference() {\n oblong(base_w, base_d, ro, tot_thick);\n translate([switch_off_w, switch_off_d, base_thick]) \n oblong(switch_w, switch_d, switch_r, LARGE);\n translate([-EPSILON, switch_off_d + switch_d - top_gap_d, base_thick])\n cube([top_gap_w+EPSILON, LARGE, LARGE]);\n translate([bottom_gap_w, -EPSILON, base_thick])\n cube([LARGE, bottom_gap_d + 2*EPSILON, LARGE]);\n translate([hole1_x, hole1_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole1_x, hole1_y + hole_dist_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n translate([hole1_x + hole_dist_x, hole1_y, -EPSILON])\n cylinder(r=hole_r, h=LARGE);\n }\n}\n\nmodule trial() {\n difference() {\n switch_base();\n translate([25, -EPSILON, -EPSILON]) cube([LARGE, LARGE, LARGE]);\n translate([-EPSILON, -EPSILON, base_thick + 5]) cube([LARGE, LARGE, LARGE]);\n }\n}\n\n$fn = 50;\n\/\/switch_base();\ntrial();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"71aff8c63fe12cd8734385009414cfe355f33bf8","subject":"Adding updates for switchover","message":"Adding updates for switchover\n","repos":"agupta231\/fractal_prints","old_file":"infinite_shelves.scad","new_file":"infinite_shelves.scad","new_contents":"\/\/ www.github.com\/agupta231\n\n\/\/ user set variables\ninitial_side_length = 100;\ninitial_side_height = 30;\npadding_ratio = .07;\n\nknob_ratio = .2;\n\nmax_iterations = 3;\n\ntop_opening_ratio = .3;\nbottom_opening_ratio = .7;\n\necho(version());\n\nmodule shelf(length, depth, height) {\n difference() {\n cube([length, depth, height], center = true);\n\n translate([0, 0, length * padding_ratio]) {\n cube([(1 - padding_ratio) * length, depth - length * padding_ratio, height], center = true);\n }\n }\n\n translate([0, (1 + knob_ratio \/ 2) * depth \/ 2 ,0])\n cube([length * knob_ratio, depth * knob_ratio \/ 2, height * knob_ratio], center = true);\n}\n\nmodule pattern(current_iteration, starting_pos, length, depth, height) {\n len_padding = length * padding_ratio;\n height_padding = height * padding_ratio;\n\n length_new = length \/ 2 - len_padding;\n height_new = (height - 3 * height_padding) \/ 2;\n\n echo(height);\n echo(height_new);\n\n if(current_iteration % 2 == 0) {\n echo(starting_pos + [0, depth \/ 2, 0]);\n\n translate(starting_pos + [0, (length_new * top_opening_ratio) \/ 2, (height_new + 3\/2 * height_padding) \/ 2]) {\n shelf(length_new, length_new * top_opening_ratio, height_new);\n }\n\n translate(starting_pos + [0, (length_new * bottom_opening_ratio) \/ 2, -(height_new + 3\/2 * height_padding) \/ 2]) {\n shelf(length_new, length_new * bottom_opening_ratio, height_new);\n }\n }\n else if(current_iteration % 2 == 1) {\n\n }\n}\n\n#shelf(initial_side_length, initial_side_length * bottom_opening_ratio, initial_side_height);\n\npattern(0, [0, 35, 0], initial_side_length, initial_side_length, initial_side_height);\n","old_contents":"\/\/ www.github.com\/agupta231\n\n\/\/ user set variables\ninitial_side_length = 100;\ninitial_side_height = 30;\npadding_ratio = .05;\n\nknob_ratio = .2;\n\nmax_iterations = 3;\n\ntop_opening_ratio = .3;\nbottom_opening_ratio = .7;\n\necho(version());\n\nmodule shelf(length, depth, height) {\n difference() {\n cube([length, depth, height], center = true);\n\n translate([0, 0, length * padding_ratio]) {\n cube([(1 - padding_ratio) * length, depth - length * padding_ratio, height], center = true);\n }\n }\n\n translate([0, (1 + knob_ratio \/ 2) * depth \/ 2 ,0])\n cube([length * knob_ratio, depth * knob_ratio \/ 2, height * knob_ratio], center = true);\n}\n\nmodule pattern(current_iteration, starting_pos, length, depth, height) {\n padding = length * padding_ratio;\n\n length_new = length \/ 2 - padding;\n height_new = (height - padding * 3) \/ 2;\n\n if(current_iteration % 2 == 0) {\n echo(starting_pos + [0, depth \/ 2, 0]);\n\n translate(starting_pos + [0, (length_new * top_opening_ratio) \/ 2, 0]) {\n shelf(length_new, length_new * top_opening_ratio, height_new);\n }\n }\n else if(current_iteration % 2 == 1) {\n\n }\n}\n\n#shelf(initial_side_length, initial_side_length * bottom_opening_ratio, initial_side_height);\n\npattern(0, [0, 35, 0], initial_side_length, initial_side_length, initial_side_height);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3fa098baa36862658a9a68ca202776a69f702767","subject":"Updated enclosure demo for UseSTL","message":"Updated enclosure demo for UseSTL\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/LogoBotInAnEnclosure.scad","new_file":"hardware\/LogoBotInAnEnclosure.scad","new_contents":"\/*\n\n\tFile: LogoBotInAnEnclosure.scad\n\n\tExample to show how to use the complete robot within a more complex model.\n\tThis example models a basic tabletop enclosure, with the robot positioned inside.\n\t\n\tThis kind of technique is useful for creating various visualisations of the design.\n\t\n*\/\n\n\/\/ Master include statement, causes everything else for the model to be included\ninclude \n\nSTLPath = \"stl\/\";\n\nEnclosureWidth \t\t= 500;\nEnclosureDepth \t\t= 500;\nEnclosureThickness \t= 1;\nEnclosureWallHeight = 30;\nEnclosureWallWidth \t= 10;\n\nBotPosition \t\t= [50, 30];\nBotRotation \t\t= 30;\n\n\n\n\/\/ Enclosure \/ Pen\n\/\/ ---------------\n\n\/\/ Pen\n\/\/\nmodule EnclosureBase() {\n\n\t\/\/ base\n\tcolor(White)\n\t\ttranslate([0,0, EnclosureThickness\/2])\n\t\tcube([EnclosureWidth, EnclosureDepth, EnclosureThickness], center=true);\n\t\n\t\/\/ walls\n\tcolor(Grey50) \n\t\ttranslate([0,0, EnclosureThickness])\n\t\tlinear_extrude(EnclosureWallHeight - EnclosureThickness)\n\t\tdifference() {\n\t\t\t\/\/ outer-edge of wall\n\t\t\tsquare([EnclosureWidth, EnclosureDepth], center=true);\n\t\t\t\n\t\t\t\/\/ hollow out the inside\n\t\t\tsquare([EnclosureWidth - 2*EnclosureWallWidth, EnclosureDepth - 2*EnclosureWallWidth], center=true);\n\t\t}\n\n}\n\n\n\n\n\/\/ Draw the enclosure\nEnclosureBase();\n\n\n\/\/ Position LogoBot inside it\ntranslate([ BotPosition[0], BotPosition[1], EnclosureThickness])\n\trotate(BotRotation)\n\tLogoBotAssembly();","old_contents":"\/*\n\n\tFile: LogoBotInAnEnclosure.scad\n\n\tExample to show how to use the complete robot within a more complex model.\n\tThis example models a basic tabletop enclosure, with the robot positioned inside.\n\t\n\tThis kind of technique is useful for creating various visualisations of the design.\n\t\n*\/\n\n\/\/ Master include statement, causes everything else for the model to be included\ninclude \n\n\nEnclosureWidth \t\t= 500;\nEnclosureDepth \t\t= 500;\nEnclosureThickness \t= 1;\nEnclosureWallHeight = 30;\nEnclosureWallWidth \t= 10;\n\nBotPosition \t\t= [50, 30];\nBotRotation \t\t= 30;\n\n\n\n\/\/ Enclosure \/ Pen\n\/\/ ---------------\n\n\/\/ Pen\n\/\/\nmodule EnclosureBase() {\n\n\t\/\/ base\n\tcolor(White)\n\t\ttranslate([0,0, EnclosureThickness\/2])\n\t\tcube([EnclosureWidth, EnclosureDepth, EnclosureThickness], center=true);\n\t\n\t\/\/ walls\n\tcolor(Grey50) \n\t\ttranslate([0,0, EnclosureThickness])\n\t\tlinear_extrude(EnclosureWallHeight - EnclosureThickness)\n\t\tdifference() {\n\t\t\t\/\/ outer-edge of wall\n\t\t\tsquare([EnclosureWidth, EnclosureDepth], center=true);\n\t\t\t\n\t\t\t\/\/ hollow out the inside\n\t\t\tsquare([EnclosureWidth - 2*EnclosureWallWidth, EnclosureDepth - 2*EnclosureWallWidth], center=true);\n\t\t}\n\n}\n\n\n\n\n\/\/ Draw the enclosure\nEnclosureBase();\n\n\n\/\/ Position LogoBot inside it\ntranslate([ BotPosition[0], BotPosition[1], EnclosureThickness])\n\trotate(BotRotation)\n\tLogoBotAssembly();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"866439f090c5dda86e195ecea7dddf56305219c1","subject":"minor bug fixes and details.","message":"minor bug fixes and details.\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/legAssembly.scad","new_file":"Drawings\/steel\/legAssembly.scad","new_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\na=44;\nlegAssembly(a,0);\nmirror([1,0,0]) legAssembly(180-a,1.2);\n\/\/legAssembly(100);\n\n%translate([0,-93,0]) cube([200,2,2],center=true);\n\n\/\/ -----------------------------------------------------------------\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n *translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n\n\/\/ ===================================================================\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\ntranslate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ncheckLink(xC,yC,xD,yD,CD);\n\n\/\/%EFlink1(xE,yE,xF,yF);\ntranslate([xF,yF,0]) rotate([0,0,atan2(yE-yF,xE-xF)]) EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\ntranslate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ncheckLink(xC,yC,xH,yH,CH);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ -----------------------------------------------------------------\n\nmodule foot() difference() {\n union() {\n hull() { \/\/ FG\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n for (z=[-1,1]) hull() {\n translate([-5,2,1.5*z])scale([3,5,1])cylinder(r=1,h=.4,$fn=64,center=true);\n translate([ 8,0,1.5*z])cylinder(r=.3,h=.4,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+3,2.6,2.6],center=true);\n #cylinder(r=.5,h=6,center=true);\n cube([7,3,2],center=true);\n\n translate([DE,0,0]) {\n #cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.5]) cylinder(r=1.4,h=8,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.65,h=1.3,$fn=24,center=true);\n }\n}\n\nmodule EFlink() {\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ 2,0,0]) cube([7,3,2],center=true);\n translate([EF-2,0,0]) cube([7,3,2],center=true);\n }\n translate([EF\/2,0,0]) cube([EF-6,2.6,2.6],center=true);\n }\n\n translate([EF,0,0]) cylinder(r=.7,h=3,center=true);\n cylinder(r=.7,h=3,center=true);\n }\n}\n\nmodule EFlink1(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,.9]) {\n translate([ex,ey,0]) cube([4,3,2],center=true);\n translate([fx,fy,0]) cube([4,3,2],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n\n \/\/%translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n for (q=[-1,1]) hull() {\n translate([ 0 ,1.5*q,1]) sphere(0.8);\n translate([BH-3,1 *q,1]) sphere(0.8);\n }\n hull() {\n translate([ 0 ,0,5]) sphere(0.8);\n translate([BH-3,0,1]) sphere(0.8);\n }\n\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","old_contents":"\/\/ try to draw Jansen linkage leg assembly as it might appear in steel\n\n\/\/ these are for configuration \"E\" as referenced in other drawings\nAC=17.5;\nAy = 3.318; Bx = 53.833;\nBD = 48.020; BE = 46.977; BH = 40.359;\nCD = 59.635; CH = 71.441; DE = 66.437;\nEF = 47.467; FG = 75.792;\nFH = 40.843; GH = 55.790;\n\nDEleft = (DE*DE + BD*BD - BE*BE)\/(2*DE);\nFGleft = (FG*FG + FH*FH - GH*GH)\/(2*FG);\nDEperp = sqrt(BD*BD - DEleft*DEleft);\nFGperp = sqrt(FH*FH - FGleft*FGleft);\n\necho(str(\"DEleft=\",DEleft,\" DEperp=\",DEperp));\necho(str(\"FGleft=\",FGleft,\" FGperp=\",FGperp));\n\n\/\/a=0;\n\/\/legAssembly(a,0);\n\/\/mirror([1,0,0]) legAssembly(180-a,1.2);\nlegAssembly(0);\n\nfunction triK1(ax,ay,ca,bx,by,cb) = (cb*cb - ca*ca + ax*ax -bx*bx +ay*ay -by*by)\/(2*(ax-bx));\n \nmodule legAssembly(ang=0,linkOffset=0) {\n\n\/\/ solve kinematics for given crank angle\nxC = AC*cos(ang);\nyC = AC*sin(ang)+Ay;\necho(\"C\",xC,yC);\n\nk1=(yC*yC - Bx*Bx + BD*BD - CD*CD + xC*xC)\/(2*yC);\nk2=(xC+Bx)\/yC;\nc=k1*k1-BD*BD+Bx*Bx;\nb=2*(Bx-k1*k2);\na=k2*k2+1;\nsgnD=(yC<0)?1:-1;\nxD=(-b+sgnD*sqrt(b*b-4*a*c))\/(2*a);\nyD=sqrt(BD*BD - pow(xD+Bx,2));\necho(\"D\",xD,yD,\"CD err\",sqrt(pow(xC-xD,2)+pow(yC-yD,2))-CD);\n\nhipRot = atan2(yD,Bx+xD)-atan2(DEperp,DEleft);\necho(\"hipRot\",hipRot);\nxE = cos(hipRot) * (DEleft-DE) - sin(hipRot) * DEperp - Bx;\nyE = sin(hipRot) * (DEleft-DE) + cos(hipRot) * DEperp;\n\/*\nke1=(yD*yD + xD*xD + DE*DE + BE*BE)\/(2*yD);\nke2=(xD+Bx)\/yD;\nae=2+ke2*ke2;\nbe=2*(Bx-ke1*ke2);\nce=ke1*ke1 - BE*BE +Bx*Bx;\necho(\"E abc:\",ae,be,ce);\nxE=(-be+sqrt(be*be-4*ae*ce))\/(2*ae);\nyE=sqrt(BE*BE - pow(xE+Bx,2));\n*\/\necho(\"E\",xE,yE);\n\n\/\/ this initial soln. seems wrong.\n\/\/xH=(BH*BH + xC*xC - CH*CH - Bx*Bx)\/(2*(xC+Bx));\n\/\/yH=-sqrt(CH*CH - xC*xC + 2*xC*xH - xH*xH);\nk1h=(xC*xC + yC*yC + BH*BH - CH*CH - Bx*Bx)\/(2*yC);\nk2h=-(xC+Bx)\/yC;\nah=k2h*k2h+1;\nbh=2*(k1h*k2h + Bx);\nch=k1h*k1h + Bx*Bx - BH*BH;\nsgnH=(yC>0)?1:-1;\nxH=(-bh+sgnH*sqrt(bh*bh-4*ah*ch))\/(2*ah);\nyH=-sqrt(BH*BH - pow(xH+Bx,2));\nbhRot=atan2(yH,xH+Bx);\necho(\"H\",xH,yH,\"rot\",bhRot,\"CH err\",sqrt(pow(xH-xC,2)+pow(yH-yC,2))-CH);\n\n\/*\nk1f=(FH*FH - EF*EF - yE*yE - yH*yH + xE*xE - xH*xH) \/ (2*(yE-yH));\nk2f=(xH-xE)\/(yE-yH);\naf=k2f*k2f+1;\nbf=2*(k1f*k2f - xH - k2f*yH);\ncf=xH*xH + yH*yH - 2*k1f*yH + k1f*k1f - FH*FH;\nxF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nyF=k1f+k2f*xF;\n*\/\nk2f = (yE-yH)\/(xE-xH);\nk1f = triK1(xE,yE,EF,xH,yH,FH);\naf=k2f*k2f+1;\nbf=2*(k2f*xE - k1f*k2f -yE);\ncf=k1f*k1f - 2*k1f*xE + xE*xE + yE*yE - EF*EF;\nyF=(-bf-sqrt(bf*bf - 4*af*cf))\/(2*af);\nxF=k1f-k2f*yF;\necho(\"F\",xF,yF,\"EF err\",sqrt(pow(xF-xE,2)+pow(yF-yE,2))-EF);\necho(\"FH err\",sqrt(pow(xF-xH,2)+pow(yF-yH,2))-FH);\n\n\/\/ -------------------------- crank-arm circle reference\n%translate([0,Ay,0]) difference() {\n cylinder(r=AC,h=1,$fn=48,center=true);\n cylinder(r=2,h=2,center=true);\n}\n\n\/\/ draw the hip so that the main \"plane\", the ED centerline plane, is at z=0\ntranslate([-Bx,0,0]) rotate([0,0,hipRot])\n translate([DEleft-DE,DEperp,0]) hip();\n\/\/translate([-Bx,0,2.5]) rotate([0,0,12.5]) translate([-DEleft,DEperp,0]) hip();\n\/\/translate([ Bx,0,0]) rotate([0,0,-20]) translate([DE-DEleft,DEperp,0]) mirror([1,0,0])\n\/\/ hip();\ncheckLink(-Bx,0,xD,yD,BD);\ncheckLink(-Bx,0,xE,yE,BE);\ncheckLink(xD,yD,xE,yE,DE);\n\ntranslate([-Bx,0,0]) rotate([0,0,bhRot])\n BHlinks();\ncheckLink(-Bx,0,xH,yH,BH);\n\n\/\/translate([xC,yC,2]) rotate([0,0,142]) \n\/\/ CDlink();\ntranslate([0,0,linkOffset-.5]) CDlink(xC,yC,xD,yD);\ncheckLink(xC,yC,xD,yD,CD);\n\nEFlink(xE,yE,xF,yF);\n\/\/EFlink();\ncheckLink(xE,yE,xF,yF,EF);\n\ntranslate([0,0,linkOffset+1.8]) CDlink(xC,yC,xH,yH);\ncheckLink(xC,yC,xH,yH,CH);\n\nfootRot = atan2(yH-yF,xH-xF)-atan2(FGperp,FGleft);\ntranslate([xF,yF,0]) rotate([0,0,footRot])\n foot();\ncheckLink(xF,yF,xH,yH,FH);\n\n} \/\/ end module legAssembly()\n\n\/\/ plot a link shadow, a different way, to check kinematic correctness\nmodule checkLink(xa,ya,xb,yb,ab) {\n %translate([(xa+xb)\/2,(ya+yb)\/2,-9])\n rotate([0,0,atan2(yb-ya,xb-xa)]) cube([ab,1,1],center=true);\n}\n\nmodule foot() difference() {\n union() {\n hull() {\n cube([4,2.6,2.6],center=true);\n translate([FG-1.3,0,0]) cylinder(r=1.3,h=2.6,$fn=24,center=true);\n }\n translate([FGleft,FGperp-5,0]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,4.8]) cube([2.6,6,2.6],center=true);\n translate([FGleft,FGperp-5,2.5]) cube([2.6,2.6,7],center=true);\n color([.3,.3,.4,.8]) {\n translate([FGleft,FGperp-.5, 0 ]) cube([3.5,5,2.2],center=true);\n translate([FGleft,FGperp-.5,4.8]) cube([3.5,5,2.2],center=true);\n }\n hull() {\n translate([6,0,0]) sphere(.8);\n translate([FGleft,FGperp-5,0]) sphere(.8);\n }\n hull() {\n translate([FG-6,0,0]) sphere(.8);\n translate([FGleft,FGperp-6,0]) sphere(.8);\n }\n hull() {\n translate([FGleft,FGperp-5,5]) sphere(.8);\n translate([FGleft,0,0]) sphere(.8);\n }\n }\n\n cylinder(r=.3,h=4,center=true);\n cube([4.4,3,2],center=true);\n translate([FGleft,FGperp,0]) cylinder(r=.7,h=33,center=true);\n}\n$fn=12;\n\nmodule hip() {\n \/\/color(\"Black\") cube([3,3,2.5],center=true);\n difference() {\n translate([DE\/2,0,0]) cube([DE+4,2.6,2.6],center=true);\n #cylinder(r=.5,h=4,center=true);\n cube([5,3,2],center=true);\n\n translate([DE,0,0]) {\n #cylinder(r=.25,h=8,center=true);\n cube([5,3,2],center=true);\n }\n }\n translate([DE-DEleft,-DEperp,-1.5]) cylinder(r=1.4,h=8,$fn=36);\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([8,0,0]) sphere(.8);\n }\n hull() {\n translate([DE-DEleft,-DEperp,0]) sphere(.8);\n translate([DE-8,0,0]) sphere(.8);\n }\n translate([DE\/2,-20,0]) rotate([0,90,0]) cylinder(r=.8,h=20,center=true);\n translate([DE-DEleft,-DEperp,4]) rotate([-105,0,0]) cylinder(r=.8,h=14);\n}\n\nmodule CDlink(cx=0,cy=0,dx=CD,dy=0) {\necho(\"CD\",cx,cy,dx,dy);\n translate([dx,dy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=1.4,h=.7,$fn=24,center=true);\n hull() {\n translate([dx,dy,0]) cylinder(r=.7,h=.7,$fn=24,center=true);\n translate([cx,cy,0]) cylinder(r=.7,h=.7,$fn=24,center=true);\n }\n \/\/%translate([CD\/2,0,0]) cube([CD-2,1.4,1.4],center=true);\n}\n\nmodule EFlink(ex=0,ey=0,fx=EF,fy=0) {\necho(\"EF\",ex,ey,fx,fy);\n difference() {\n union() {\n color([.3,.3,.4,1]) {\n translate([ex,ey,0]) cube([4,3,3],center=true);\n translate([fx,fy,0]) cube([4,3,3],center=true);\n }\n hull() {\n translate([ex,ey,0]) cylinder(r=1.3,h=2.6,center=true);\n translate([fx,fy,0]) cylinder(r=1.3,h=2.6,center=true);\n }\n }\n\n translate([ex,ey,0]) cylinder(r=.7,h=3,center=true);\n translate([fx,fy,0]) cylinder(r=.7,h=3,center=true);\n }\n}\n\n\/\/ this link drawn with B axle at origin, always.\nmodule BHlinks() {\n translate([0,0, 6.8]) BHlink();\n translate([0,0,-2 ]) mirror([0,0,1]) BHlink();\n}\nmodule BHlink() {\n cylinder(r=1.4,h=6,$fn=24);\n translate([BH\/2-1,0,1.3]) cube([BH-2,2.5,2.5],center=true);\n translate([BH,0,-.3]) difference() {\n hull() {\n cylinder(r=3,h=.33,$fn=36);\n translate([-8,0,0]) cylinder(r=1,h=.33);\n }\n cylinder(r=.7,h=2,center=true);\n }\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a722012057612c8e7eea634410c329b20b1f283f","subject":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019","message":"\/ \u2018Impression 3D\/2016 - Trocar\/trocar-test1.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_file":"Impression 3D\/2016 - Trocar\/trocar-test1.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"125509d011c779e7f1a6db53f09626d93484c702","subject":"config: Increase ziptie thickness","message":"config: Increase ziptie thickness\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 12;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2.5*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01*mm;\n\n\/\/ high quality etc\nis_build = false;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = is_build ? 0.5 : 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = is_build ? 4 : 12;\n\n$show_vit = is_build ? false : true;\n\n\/\/ enable preview model (faster openscad)\n$preview_mode = is_build ? false : true;\n\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = NutHexM5;\nextrusion_nut_dia = lookup(NutWidthMax, extrusion_nut);\n\nextrusion_mount_thread = ThreadM4;\n\n\/\/ for tapped ends\nextrusion_end_nut = NutHexM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 65*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt = TimingBelt_GT2_2;\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-3*mm-xaxis_beltpath_z_offset_pulley, 3*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=NutHexM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = extrusion_mount_thread;\nzmotor_mount_clamp_nut = NutHexM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(NutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(NutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"f898c0e33e9945f87c3fb28c05847e597301d1f5","subject":"bearing: increase rod cutout","message":"bearing: increase rod cutout\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+2*mm, h=100, orient=[0,0,1]);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"84ca1b4fc89dfcfbaa00ccebc967de0f0de16156","subject":"xaxis\/carriage: fix extruder a part orient stuff","message":"xaxis\/carriage: fix extruder a part orient stuff\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1:1])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = xaxis_bearing_bottom[2] + 2*xaxis_carriage_padding;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_carriage_beltfasten_h], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2bf702bd69f8ef4f4df2ed99453f4dfb6baa14b1","subject":"screws: add debug test","message":"screws: add debug test\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=Z, align=-Z);\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=-Z, align=-Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*15*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 40*mm;\n box_h = 10*mm;\n box_d = 10*mm;\n o = 10*mm;\n\n \/*$show_vit = true;*\/\n $fs= 0.2;\n $fa = 4;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n difference()\n {\n \/*rcubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=Z, align=Z);\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=-Z, align=Z);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=Z, align=Z);*\/\n\n \/*screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=-Z, align=Z);*\/\n \/*screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=-Z, align=Z);*\/\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=Z, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=Z, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=Z, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=-Z, align=N);\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=Z, align=N);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=Z, orient=Y, align=N);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=-Z, orient=Y, align=N);*\/\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n translate([0,0,head_embed?-head_h:0])\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\n\/\/ distance from center to flat on a polygon (taking in the diagonal distance)\nfunction apothem(radius, facets) = radius\/cos(180\/facets);\n\nfunction nut_radius(nut) = apothem(get(NutWidthMax, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=Z, align=-Z);\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=-trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=-Z, align=-Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n box_w = 40*mm;\n box_h = 10*mm;\n box_d = 10*mm;\n o = 10*mm;\n\n \/*$show_vit = true;*\/\n $fs= 0.2;\n $fa = 4;\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n difference()\n {\n \/*rcubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n rcubea([box_w,box_d,box_h], align=[1,0,1]);\n\n test_cuts();\n }\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=Z, align=Z);\n \/*screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=-Z, align=Z);*\/\n \/*screw_cut(nut=nut1, h=box_h, head_embed=false, orient=Z, align=Z);*\/\n\n \/*screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=-Z, align=Z);*\/\n \/*screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=-Z, align=Z);*\/\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=Z, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=Z, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=Z, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=-Z, align=N);\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=Z, align=N);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=Z, orient=Y, align=N);*\/\n\n \/*translate([0,0,box_h\/2])*\/\n \/*nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=-Z, orient=Y, align=N);*\/\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"281ec46f7bbd34ece63be8999a81f3b44add7caf","subject":"doc: wrong variable mentioned to show\/hide testbed in visualTest","message":"doc: wrong variable mentioned to show\/hide testbed in visualTest\n","repos":"jsconan\/camelSCAD","old_file":"operator\/test\/test.scad","new_file":"operator\/test\/test.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element. If no children is given, a cube with an arrow on top is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [angle] - The angle of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", angle=0, size=1, center=false) {\n color(c) {\n rotate(angle) {\n if ($children) {\n children();\n } else let(\n size = vector3D(size),\n half = size \/ 2,\n quarter = size \/ 4,\n offset = center ? -half : vector3D()\n ) {\n translate(offset) {\n linear_extrude(height=size.z, convexity=10) {\n polygon(\n points = path([\n [\"P\", half.x, size.y],\n [\"L\", half.x, -half.y],\n [\"H\", -quarter.x],\n [\"V\", -half.y],\n [\"H\", -half.x],\n [\"V\", half.y],\n [\"H\", -quarter.x],\n ]),\n convexity = 10\n );\n }\n translateZ(quarter.z) {\n cube(size=[size.x, size.y, half.z]);\n }\n }\n }\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * A testbed is shown, unless the global variable `SHOW_TESTBED` is set to `false`.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n if (SHOW_TESTBED) {\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `SELECT_TEST`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n SELECT_TEST = is_undef(SELECT_TEST) ? undef : min(max(0, SELECT_TEST), count - 1);\n start = is_undef(SELECT_TEST) ? 0 : SELECT_TEST;\n end = is_undef(SELECT_TEST) ? count - 1 : SELECT_TEST;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Testing helpers for visual tests.\n *\n * @package shape\/context\n * @author jsconan\n *\/\n\n\/**\n * Places the children at the proper test area.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param Number [index] - The index number of the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule placeVisualTest(length, width, index=0, margin=0, cols=0, center=false) {\n margin = vector2D(margin);\n x = cols ? index % cols : index;\n y = cols ? floor(index \/ cols) : 0;\n offset = center ? [length, width, 0] \/ 2 : ORIGIN_3D;\n\n translate(offset + [(length + margin.x) * x, (width + margin.y) * y, 0]) {\n children();\n }\n}\n\n\/**\n * Renders a test element. If no children is given, a cube with an arrow on top is rendered.\n * @param String|Vector [c] - The color of the element.\n * @param Number|Vector [angle] - The angle of the element.\n * @param Number|Vector [size] - The size of the element. It only applies if no children is given.\n * @param Boolean [center] - Whether or not the element is centered. It only applies if no children is given.\n *\/\nmodule testElement(c=\"red\", angle=0, size=1, center=false) {\n color(c) {\n rotate(angle) {\n if ($children) {\n children();\n } else let(\n size = vector3D(size),\n half = size \/ 2,\n quarter = size \/ 4,\n offset = center ? -half : vector3D()\n ) {\n translate(offset) {\n linear_extrude(height=size.z, convexity=10) {\n polygon(\n points = path([\n [\"P\", half.x, size.y],\n [\"L\", half.x, -half.y],\n [\"H\", -quarter.x],\n [\"V\", -half.y],\n [\"H\", -half.x],\n [\"V\", half.y],\n [\"H\", -quarter.x],\n ]),\n convexity = 10\n );\n }\n translateZ(quarter.z) {\n cube(size=[size.x, size.y, half.z]);\n }\n }\n }\n }\n }\n}\n\n\/**\n * Colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedColor(alpha) {\n %color(TESTBED_COLOR, alpha) {\n children();\n }\n}\n\n\/**\n * Extrudes and colorizes a test element.\n * @param Number alpha - The alpha level for the testbed color.\n *\/\nmodule testbedExtrude(alpha) {\n testbedColor(alpha) {\n linear_extrude(height=TESTBED_THICKNESS, convexity=10, center=true) {\n children();\n }\n }\n}\n\n\/**\n * Renders a test area, moving the tested shapes in it.\n * A testbed is shown, unless the global variable `SELECT_TEST` is set to `false`.\n * @param Number index - The index number of the test.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not the children are centered and need to be moved.\n *\/\nmodule visualTest(index, length, width, title=\"test\", margin=1, cols=0, center=false) {\n title = str(title, \" \", index);\n\n placeVisualTest(\n length = length,\n width = width,\n index = index,\n margin = margin,\n cols = cols,\n center = center\n ) {\n \/\/ test area\n if (SHOW_TESTBED) {\n testbedExtrude(.1) {\n square([length, width], center=center);\n }\n translate(center ? ORIGIN_3D : [length, width, 0] \/ 2) {\n testbedExtrude(1) {\n text(title, size=min(length, width) \/ len(title), font=\"Liberation Sans\", valign=\"center\", halign=\"center\");\n }\n }\n }\n\n \/\/ tested shapes\n children();\n }\n}\n\n\/**\n * Renders a test area for each child module, moving the tested shapes in it.\n * A single test can be selected by its index thanks to the global variable `SELECT_TEST`.\n * @param Number length - The length of the test area.\n * @param Number width - The width of the test area.\n * @param String [title] - The title for the test.\n * @param Number|Vector [margin] - A margin between each test.\n * @param Number [cols] - The number of columns per lines.\n * @param Boolean [center] - Whether or not center the whole suite.\n * @param Boolean [centerEach] - Whether or not center each test area.\n *\/\nmodule visualTestSuite(length, width, title=\"test\", margin=1, cols=0, center=false, centerEach=false) {\n margin = vector2D(margin);\n count = $children;\n SELECT_TEST = is_undef(SELECT_TEST) ? undef : min(max(0, SELECT_TEST), count - 1);\n start = is_undef(SELECT_TEST) ? 0 : SELECT_TEST;\n end = is_undef(SELECT_TEST) ? count - 1 : SELECT_TEST;\n lines = cols ? ceil(count \/ cols) : 1;\n offset = center ? -([margin.x * (cols - 1), margin.y * (lines - 1), 0] + [length * cols, width * lines, 0]) \/ 2 : ORIGIN_3D;\n\n translate(offset) {\n for (i = [start : end]) {\n visualTest(\n index = i,\n length = length,\n width = width,\n title = title,\n margin = margin,\n cols = cols,\n center = centerEach\n ) {\n children(i);\n }\n }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c8864f5afe40edd6985ee8fec32858e5682c0d61","subject":"updated plotter3.scad, was an old version, should be better now.","message":"updated plotter3.scad, was an old version, should be better now.\n","repos":"snebragd\/stringent,snebragd\/stringent,snebragd\/stringent,snebragd\/stringent","old_file":"Hardware\/plotter3.scad","new_file":"Hardware\/plotter3.scad","new_contents":"\/\/todo\n\/\/h\u00e5l f\u00f6r kontakter\n\ninclude \ninclude \n\ndraw_components=0;\n\nplate_w = 100;\nplate_h = 135;\nplate_t = 1;\n\ndistances_h=6;\n\nplate_board_dist = 20;\n\n$fn=40;\n\narduino_x=30;\narduino_y=73;\narduino_rotation=180;\n\npen_y=plate_h\/2-105;\npen_angle=-45;\npen_radius=10;\n\nstepper_x=27;\nstepper_y=-(plate_h\/2-15);\n\ndriver_x=44;\ndriver_y=-15;\n\nbattery_x=0;\nbattery_y=0;\n\nservo_x=-18;\nservo_y=-10;\nservo_z=20;\n\ny_cut=53.5;\n\n\/\/base\ndifference() {\n\tunion() {\n\t\ttranslate([0,-y_cut\/2,0]) cube(center=true, [plate_w,plate_h-y_cut,plate_t]);\n\t\tedge();\n\n\t}\n\n\t\/\/stepper holes\n\ttranslate([-stepper_x, stepper_y,0]) stepperholes();\n\ttranslate([stepper_x, stepper_y,0]) stepperholes();\n\n\t\/\/uno holes\n\ttranslate([arduino_x,arduino_y,0]) {\n\t\trotate([0,0,arduino_rotation])\n\t\t\tunion() {\n\t\t\t\tuno_holes();\n\t\t\t}\n\t}\n\n\t\/\/pen hole\n\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) translate([0,0,-50]) cylinder(r=pen_radius, h=100);\n\n\t\/\/extra holes\n\ttranslate([-34,-15,-5]) cylinder(r=12, h=10);\n\ttranslate([34,-15,-5]) cylinder(r=12, h=10);\n\n\t\/\/stepper driver holes \n\ttranslate([-driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(true);\t\n\ttranslate([driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(false);\t\t\n}\n\nif(draw_components) {\n\t\/\/spools\n\tcolor(\"White\", alpha=0.2) {\n\t\ttranslate([-stepper_x,stepper_y,2]) spool(15, 8, 3.3, 1);\n\t\ttranslate([stepper_x,stepper_y,2]) spool(15, 8, 3.3, 1);\t\n\t}\n\n\t\/\/steppers\n\ttranslate([-stepper_x,stepper_y,0]) stepper(); \n\ttranslate([stepper_x,stepper_y,0]) stepper();\t\n\t\n\t\t\n\t\/\/uno components\n\ttranslate([arduino_x,arduino_y,distances_h]) rotate([0,0,arduino_rotation]) arduino();\n\t\n\t\/\/battery\n\ttranslate([battery_x,battery_y,-17*3\/2]) {\n\t\tbattery();\n\t}\n\n\t\/\/stepper drivers\n\tcolor(\"Green\", alpha=0.5) {\t\n\t\ttranslate([driver_x, driver_y,5]) cube(center=true, [32,35,1]);\n\t\ttranslate([-driver_x, driver_y,5]) cube(center=true, [32,35,1]);\n\t}\t\n\n\t\/\/servo\n\ttranslate([servo_x, servo_y, servo_z]) rotate([-pen_angle+90,0,0]) rotate([0,90,0]) servo();\n\n\t\/\/pen\n\tcolor(\"Red\", alpha=0.5) {\t\n\t\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) union() {\n\t\t\ttranslate([0,0,-10]) cylinder(r=pen_radius-1, h=100);\n\t\t\ttranslate([0,0,-30]) cylinder(r1=1, r2=pen_radius-1, h=20);\n\t\t}\n\t}\n}\n\n\/\/stepper driver distances \ndifference() {\n\tunion() {\n\t\ttranslate([-driver_x, driver_y]) rotate([0,0,90]) stepper_driver_pins(true);\t\n\t\ttranslate([driver_x,driver_y]) rotate([0,0,90]) stepper_driver_pins(false);\t\n\t}\n\ttranslate([-driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(true);\t\n\ttranslate([driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(false);\t\t\n}\n\n\n\/\/wire guide\ndifference() {\n\tunion() {\n\t\ttranslate([-6.0,-plate_h\/2,0]) cylinder(r=5,h=12);\n\t\ttranslate([6.0,-plate_h\/2,0]) cylinder(r=5,h=12);\n\t\ttranslate([-3.5,-plate_h\/2+1.5,3]) rotate([0,90,0]) cylinder(r=1,h=7);\n\t\ttranslate([-3.5,-plate_h\/2+1.5,7]) rotate([0,90,0]) cylinder(r=1,h=7);\n\t\ttranslate([-3.5,-plate_h\/2+1.5,11]) rotate([0,90,0]) cylinder(r=1,h=7);\n\/\/\t\ttranslate([-3.5,-plate_h\/2+1.5,15]) rotate([0,90,0]) cylinder(r=1,h=7);\n\/\/\t\ttranslate([-3.5,-plate_h\/2+1.5,19]) rotate([0,90,0]) cylinder(r=1,h=7);\n\/\/\t\ttranslate([-3.5,-plate_h\/2+1.5,23]) rotate([0,90,0]) cylinder(r=1,h=7);\n\t\ttranslate([-0.5,-plate_h\/2+1.5,0]) cube([1,29,12]);\n\t}\n\ttranslate([-50,-plate_h\/2-100,-1]) cube([100,100,100]);\n\ttranslate([-1,-plate_h\/2+5,10]) rotate([-33,0,0]) translate([0,-10,2]) cube([2,40,24]);\n\n\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) {\n\t\t\ttranslate([0,0,-50]) cylinder(r=pen_radius, h=250);\n\t}\n}\n\n\/\/pen guide\ndifference() {\n intersection() {\n translate([0,pen_y,0]) rotate([pen_angle,0,0]) {\n difference() {\n union() {\n translate([0,0,-50]) cylinder(r1=pen_radius+2, r2=pen_radius+1, h=120);\n translate([-2,20,0]) rotate([-pen_angle,0,0]) cube([4,20,40]);\n translate([-25.5,8,0]) rotate([-pen_angle,0,0]) cube([15,30,40]);\n \n }\n translate([0,0,-50]) cylinder(r=pen_radius, h=250);\n translate([0,0,150]) rotate([-25,0,0]) cube(center=true,[100,100,1000]);\t\n\/\/ translate([-7.5,5,20]) cube(center=true,[3,10,6]\t);\n\/\/ translate([7.5,5,20]) cube(center=true,[3,10,6]\t); \n } \n }\n translate([-100,-100,0]) cube(200,200,200); \n }\n translate([servo_x, servo_y, servo_z]) rotate([-pen_angle+90,0,0]) rotate([0,90,0]) servo(cutout=1);\n}\n\n\/\/arduino distances\ntranslate([arduino_x,arduino_y,0])\n\trotate([0,0,arduino_rotation])\n\t\tuno_holes(distances_h);\n\n\/\/ ************ modules **************\n\n\/\/distances\nmodule distance(height=17) {\n\tdifference() {\n\t\t\/\/translate([0,0,0]) cylinder(r=3, h=height);\n\t\ttranslate([-3,-7,0]) cube([6,10,height]);\n\t\ttranslate([0,0,-1]) cylinder(r=1.7, h=distances_h+2);\n\t}\n}\n\nmodule driver_pin() {\t\n\trotate([0,0,45]) cylinder($fn=4, r=2.8+1.4, h=5); \n}\n\nmodule corner_holes() {\n\ttranslate([plate_w\/2-4, plate_h\/2-4, -50]) cylinder(r=2, h=100);\n translate([-plate_w\/2+4, plate_h\/2-4, -50]) cylinder(r=2, h=100);\n}\n\nmodule stepper_driver_holes(left) {\n\tdx=30;\n\tdy=26;\n\tunion() { \n if(left) {\n translate([-dx\/2,-dy\/2,-5]) cylinder(r=1.7, h=11);\n translate([dx\/2,-dy\/2,-5]) cylinder(r=1.7, h=11);\n }\n else {\n translate([-dx\/2,dy\/2,-5]) cylinder(r=1.7, h=11);\n translate([dx\/2,dy\/2,-5]) cylinder(r=1.7, h=11);\n }\n\t}\n}\n \nmodule edge() {\n\n\tdifference() {\n\t\tunion() {\n\t\t\tdifference() {\n\t\t\t\ttranslate([0,-y_cut\/2,2.4]) cube(center=true, [plate_w,plate_h-y_cut, plate_t+3]);\n\t\t\t\ttranslate([0,-y_cut\/2,-1]) cube(center=true, [plate_w-4,plate_h-4-y_cut, 20]);\n\t\t\t}\n\t\t\ttranslate([0,plate_h\/2-66,1.5]) cube(center=true, [4,22, 3]);\n\t\t\ttranslate([0,3,1.5]) cube(center=true, [plate_w,3, 3]);\n\t\t\ttranslate([0,-32,1.5]) cube(center=true, [plate_w,3, 3]);\n\t\t}\n\t\ttranslate([-stepper_x,stepper_y,1.5]) cylinder(r=19, h=10); \n\t\ttranslate([stepper_x,stepper_y,1.5]) cylinder(r=19, h=10);\t\n\t\t\n\t}\n}\n\nmodule stepper_driver_pins(left) {\n\tdx=30;\n\tdy=26;\n\tunion() {\n if(left) {\n translate([-dx\/2,-dy\/2,0]) driver_pin();\n translate([dx\/2,-dy\/2,0]) driver_pin();\n }\n else {\n translate([-dx\/2,dy\/2,0]) driver_pin();\n translate([dx\/2,dy\/2,0]) driver_pin();\n }\n\t}\n}\n\n\/\/arduino\n\/\/import(\"Slim_Arduino_Uno_Case\/arduino-case_bottom.stl\");\n\nmodule uno_holes(make_distances=0) {\n\tholes = [\n\/\/\t\t[ 2.54, 15.24,-5 ],\n\t\t[ 17.78, 66.04,-5 ],\n\t\t[ 45.72, 66.04,-5 ],\n\/\/\t\t[ 50.8, 13.97,-5 ]\n\t\t];\n\tunion(){\n\t\tfor(i = holes ) {\n\t\t\ttranslate(i) \n\t\t\t\tunion() {\n\t\t\t\t\tif(make_distances > 0) {\n\t\t\t\t\t\ttranslate([0,0,5]) distance(make_distances);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcylinder(r=1.7,h=10);\n\t\t\t\t\t\t\/\/translate([0,0,5.5]) cylinder(r=4,h=10);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t}\n\t}\n}\n\nmodule uno_connector_holes() {\n\n}\n\nmodule stepperholes() {\n\ttranslate([0,0,-50])cylinder(r=5, h=100);\n\ttranslate([35\/2, -8, -50]) cylinder(r=2, h=100);\n\ttranslate([-35\/2, -8, -50]) cylinder(r=2, h=100);\n}\n\nmodule stepper() {\n\tcolor(\"Goldenrod\", alpha=0.8) {\n\t\ttranslate([0,0,0])cylinder(r=2.5, h=8);\n\t}\n\tcolor(\"Silver\", alpha=0.5) {\n\t\ttranslate([0,0,-1])cylinder(r=5, h=1);\n\t\ttranslate([0, -8, -20]) cylinder(r=14, h=19);\n\t\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\ttranslate([-35\/2, -8, -2]) cylinder(r=3.5, h=1);\n\t\t\t\ttranslate([35\/2, -8, -2]) cylinder(r=3.5, h=1);\n\t\t\t\ttranslate([-35\/2, -8-3.5, -2]) cube([35,7,1]);\n\t\t\t}\n\t\t\ttranslate([-35\/2, -8, -4]) cylinder(r=2, h=10);\n\t\t\ttranslate([35\/2, -8, -4]) cylinder(r=2, h=10);\t\t\n\t\t}\t\n\t}\n\tcolor(\"Blue\", alpha=0.5) {\n\t\ttranslate([-7.5,-8-18,-18]) cube([15,18,17]);\n\t}\n}\n\nmodule battery() {\n\ttranslate([-45\/2, -26\/2,17\/2]) {\n\t\tcolor(\"Black\", alpha=0.5) {\n\t\t\tcube([45,26,17]);\n\t\t}\n\t\tcolor(\"Silver\", alpha=0.5) {\n\t\t\ttranslate([0,0,17\/2]) rotate([0,-90,0]) {\n\t\t\t\ttranslate([0,13-6,0]) cylinder(r=3,h=3);\n\t\t\t\ttranslate([0,13+6,0]) difference() {\n\t\t\t\t\tcylinder(r=4,h=3,$fn=6);\n\t\t\t\t\tcylinder(r=3,h=4,$fn=6);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule servo(cutout=0) {\n\n if(cutout) {\n cube(center=true, [23+1,21+1,12+1]);\t\t\n translate([0,21\/2-3+5,0]) cube(center=true, [32+1,1+10,12+1]);\t\t\n translate([14,20,0]) rotate([90,0,0]) cylinder(r=0.8, h=20);\t\t \n translate([14-28,20,0]) rotate([90,0,0]) cylinder(r=0.8, h=20);\t\t \n }\n else {\n color(\"Black\", alpha=0.5) {\t\n cube(center=true, [23,21,12]);\t\t\n translate([0,21\/2-3,0]) cube(center=true, [32,1,12]);\t\t\n translate([23\/2-11.5\/2,21\/2,0]) rotate([-90,180,0]) {\n union() {\n cylinder(r=11.5\/2, h=5);\n cylinder(r=2, h=10);\n translate([-3,-3, 9]) cube([6,20,1]);\n }\n }\n }\n color(\"White\", alpla=0.5) {\n\n }\n } \n}\n","old_contents":"\/\/todo\n\/\/h\u00e5l f\u00f6r kontakter\n\ninclude \ninclude \n\ndraw_components=0;\n\nplate_w = 100;\nplate_h = 135;\nplate_t = 1;\n\ndistances_h=6;\n\nplate_board_dist = 20;\n\n$fn=40;\n\narduino_x=30;\narduino_y=73;\narduino_rotation=180;\n\npen_y=plate_h\/2-105;\npen_angle=-45;\npen_radius=10;\n\nstepper_x=27;\nstepper_y=-(plate_h\/2-15);\n\ndriver_x=34;\ndriver_y=-15;\n\nbattery_x=0;\nbattery_y=0;\n\nservo_x=0;\nservo_y=-87;\n\ny_cut=53.5;\n\n\/\/base\ndifference() {\n\tunion() {\n\t\ttranslate([0,-y_cut\/2,0]) cube(center=true, [plate_w,plate_h-y_cut,plate_t]);\n\t\tedge();\n\n\t}\n\n\t\/\/stepper holes\n\ttranslate([-stepper_x, stepper_y,0]) stepperholes();\n\ttranslate([stepper_x, stepper_y,0]) stepperholes();\n\n\t\/\/uno holes\n\ttranslate([arduino_x,arduino_y,0]) {\n\t\trotate([0,0,arduino_rotation])\n\t\t\tunion() {\n\t\t\t\tuno_holes();\n\t\t\t}\n\t}\n\n\t\/\/pen hole\n\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) translate([0,0,-50]) cylinder(r=pen_radius, h=100);\n\n\t\/\/extra holes\n\ttranslate([-34,-15,-5]) cylinder(r=12, h=10);\n\ttranslate([34,-15,-5]) cylinder(r=12, h=10);\n\n\t\/\/stepper driver holes \n\ttranslate([-driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(true);\t\n\ttranslate([driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(false);\t\t\n}\n\nif(draw_components) {\n\t\/\/spools\n\tcolor(\"White\", alpha=0.2) {\n\t\ttranslate([-stepper_x,stepper_y,2]) spool(15, 8, 3.3, 1);\n\t\ttranslate([stepper_x,stepper_y,2]) spool(15, 8, 3.3, 1);\t\n\t}\n\n\t\/\/steppers\n\ttranslate([-stepper_x,stepper_y,0]) stepper(); \n\ttranslate([stepper_x,stepper_y,0]) stepper();\t\n\t\n\t\t\n\t\/\/uno components\n\ttranslate([arduino_x,arduino_y,distances_h]) rotate([0,0,arduino_rotation]) arduino();\n\t\n\t\/\/battery\n\ttranslate([battery_x,battery_y,-17*3\/2]) {\n\t\tbattery();\n\t}\n\n\t\/\/stepper drivers\n\tcolor(\"Green\", alpha=0.5) {\t\n\t\ttranslate([driver_x, driver_y,5]) cube(center=true, [32,35,1]);\n\t\ttranslate([-driver_x, driver_y,5]) cube(center=true, [32,35,1]);\n\t}\t\n\n\t\/\/servo\n\ttranslate([servo_x, servo_y, -12\/2-plate_t\/2]) servo();\n\n\t\/\/pen\n\tcolor(\"Red\", alpha=0.5) {\t\n\t\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) union() {\n\t\t\ttranslate([0,0,-10]) cylinder(r=pen_radius-1, h=100);\n\t\t\ttranslate([0,0,-30]) cylinder(r1=1, r2=pen_radius-1, h=20);\n\t\t}\n\t}\n}\n\n\/\/stepper driver distances \ndifference() {\n\tunion() {\n\t\ttranslate([-driver_x, driver_y]) rotate([0,0,90]) stepper_driver_pins(true);\t\n\t\ttranslate([driver_x,driver_y]) rotate([0,0,90]) stepper_driver_pins(false);\t\n\t}\n\ttranslate([-driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(true);\t\n\ttranslate([driver_x,driver_y]) rotate([0,0,90]) stepper_driver_holes(false);\t\t\n}\n\n\n\/\/wire guide\ndifference() {\n\tunion() {\n\t\ttranslate([-6.0,-plate_h\/2,0]) cylinder(r=5,h=12);\n\t\ttranslate([6.0,-plate_h\/2,0]) cylinder(r=5,h=12);\n\t\ttranslate([-3.5,-plate_h\/2+1.5,3]) rotate([0,90,0]) cylinder(r=1,h=7);\n\t\ttranslate([-3.5,-plate_h\/2+1.5,7]) rotate([0,90,0]) cylinder(r=1,h=7);\n\t\ttranslate([-3.5,-plate_h\/2+1.5,11]) rotate([0,90,0]) cylinder(r=1,h=7);\n\/\/\t\ttranslate([-3.5,-plate_h\/2+1.5,15]) rotate([0,90,0]) cylinder(r=1,h=7);\n\/\/\t\ttranslate([-3.5,-plate_h\/2+1.5,19]) rotate([0,90,0]) cylinder(r=1,h=7);\n\/\/\t\ttranslate([-3.5,-plate_h\/2+1.5,23]) rotate([0,90,0]) cylinder(r=1,h=7);\n\t\ttranslate([-0.5,-plate_h\/2+1.5,0]) cube([1,29,12]);\n\t}\n\ttranslate([-50,-plate_h\/2-100,-1]) cube([100,100,100]);\n\ttranslate([-1,-plate_h\/2+5,10]) rotate([-33,0,0]) translate([0,-10,2]) cube([2,40,24]);\n\n\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) {\n\t\t\ttranslate([0,0,-50]) cylinder(r=pen_radius, h=250);\n\t}\n}\n\n\/\/pen guide\nintersection() {\n\ttranslate([0,pen_y,0]) rotate([pen_angle,0,0]) {\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\ttranslate([0,0,-50]) cylinder(r1=pen_radius+2, r2=pen_radius+1, h=120);\n\t\t\t\ttranslate([-2,20,0]) rotate([-pen_angle,0,0]) cube([4,20,40]);\n\t\t\t}\n\t\t\ttranslate([0,0,-50]) cylinder(r=pen_radius, h=250);\n\t\t\ttranslate([0,0,150]) rotate([-25,0,0]) cube(center=true,[100,100,1000]);\t\n\t\t\ttranslate([-7.5,5,20]) cube(center=true,[3,10,6]\t);\n\t\t\ttranslate([7.5,5,20]) cube(center=true,[3,10,6]\t);\n\t\t}\n\t}\n\ttranslate([-100,-100,0]) cube(200,200,200);\n}\n\n\/\/arduino distances\ntranslate([arduino_x,arduino_y,0])\n\trotate([0,0,arduino_rotation])\n\t\tuno_holes(distances_h);\n\n\/\/ ************ modules **************\n\n\/\/distances\nmodule distance(height=17) {\n\tdifference() {\n\t\t\/\/translate([0,0,0]) cylinder(r=3, h=height);\n\t\ttranslate([-3,-7,0]) cube([6,10,height]);\n\t\ttranslate([0,0,-1]) cylinder(r=1.7, h=distances_h+2);\n\t}\n}\n\nmodule driver_pin() {\t\n\trotate([0,0,45]) cylinder($fn=4, r=2.8+1.4, h=5); \n}\n\nmodule corner_holes() {\n\ttranslate([plate_w\/2-4, plate_h\/2-4, -50]) cylinder(r=2, h=100);\n translate([-plate_w\/2+4, plate_h\/2-4, -50]) cylinder(r=2, h=100);\n}\n\nmodule stepper_driver_holes(left) {\n\tdx=30;\n\tdy=26;\n\tunion() { \n if(left) {\n translate([-dx\/2,dy\/2,-5]) cylinder(r=1.7, h=11);\n translate([dx\/2,-dy\/2,-5]) cylinder(r=1.7, h=11);\n }\n else {\n translate([-dx\/2,-dy\/2,-5]) cylinder(r=1.7, h=11);\n translate([dx\/2,dy\/2,-5]) cylinder(r=1.7, h=11);\n }\n\t}\n}\n \nmodule edge() {\n\n\tdifference() {\n\t\tunion() {\n\t\t\tdifference() {\n\t\t\t\ttranslate([0,-y_cut\/2,2.4]) cube(center=true, [plate_w,plate_h-y_cut, plate_t+3]);\n\t\t\t\ttranslate([0,-y_cut\/2,-1]) cube(center=true, [plate_w-4,plate_h-4-y_cut, 20]);\n\t\t\t}\n\t\t\ttranslate([0,plate_h\/2-66,1.5]) cube(center=true, [4,22, 3]);\n\t\t\ttranslate([0,3,1.5]) cube(center=true, [plate_w,3, 3]);\n\t\t\ttranslate([0,-32,1.5]) cube(center=true, [plate_w,3, 3]);\n\t\t}\n\t\ttranslate([-stepper_x,stepper_y,1.5]) cylinder(r=19, h=10); \n\t\ttranslate([stepper_x,stepper_y,1.5]) cylinder(r=19, h=10);\t\n\t\t\n\t}\n}\n\nmodule stepper_driver_pins(left) {\n\tdx=30;\n\tdy=26;\n\tunion() {\n if(left) {\n translate([-dx\/2,dy\/2,0]) driver_pin();\n translate([dx\/2,-dy\/2,0]) driver_pin();\n }\n else {\n translate([-dx\/2,-dy\/2,0]) driver_pin();\n translate([dx\/2,dy\/2,0]) driver_pin();\n }\n\t}\n}\n\n\/\/arduino\n\/\/import(\"Slim_Arduino_Uno_Case\/arduino-case_bottom.stl\");\n\nmodule uno_holes(make_distances=0) {\n\tholes = [\n\/\/\t\t[ 2.54, 15.24,-5 ],\n\t\t[ 17.78, 66.04,-5 ],\n\t\t[ 45.72, 66.04,-5 ],\n\/\/\t\t[ 50.8, 13.97,-5 ]\n\t\t];\n\tunion(){\n\t\tfor(i = holes ) {\n\t\t\ttranslate(i) \n\t\t\t\tunion() {\n\t\t\t\t\tif(make_distances > 0) {\n\t\t\t\t\t\ttranslate([0,0,5]) distance(make_distances);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tcylinder(r=1.7,h=10);\n\t\t\t\t\t\t\/\/translate([0,0,5.5]) cylinder(r=4,h=10);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t}\n\t}\n}\n\nmodule uno_connector_holes() {\n\n}\n\nmodule stepperholes() {\n\ttranslate([0,0,-50])cylinder(r=5, h=100);\n\ttranslate([35\/2, -8, -50]) cylinder(r=2, h=100);\n\ttranslate([-35\/2, -8, -50]) cylinder(r=2, h=100);\n}\n\nmodule stepper() {\n\tcolor(\"Goldenrod\", alpha=0.8) {\n\t\ttranslate([0,0,0])cylinder(r=2.5, h=8);\n\t}\n\tcolor(\"Silver\", alpha=0.5) {\n\t\ttranslate([0,0,-1])cylinder(r=5, h=1);\n\t\ttranslate([0, -8, -20]) cylinder(r=14, h=19);\n\t\n\t\tdifference() {\n\t\t\tunion() {\n\t\t\t\ttranslate([-35\/2, -8, -2]) cylinder(r=3.5, h=1);\n\t\t\t\ttranslate([35\/2, -8, -2]) cylinder(r=3.5, h=1);\n\t\t\t\ttranslate([-35\/2, -8-3.5, -2]) cube([35,7,1]);\n\t\t\t}\n\t\t\ttranslate([-35\/2, -8, -4]) cylinder(r=2, h=10);\n\t\t\ttranslate([35\/2, -8, -4]) cylinder(r=2, h=10);\t\t\n\t\t}\t\n\t}\n\tcolor(\"Blue\", alpha=0.5) {\n\t\ttranslate([-7.5,-8-18,-18]) cube([15,18,17]);\n\t}\n}\n\nmodule battery() {\n\ttranslate([-45\/2, -26\/2,17\/2]) {\n\t\tcolor(\"Black\", alpha=0.5) {\n\t\t\tcube([45,26,17]);\n\t\t}\n\t\tcolor(\"Silver\", alpha=0.5) {\n\t\t\ttranslate([0,0,17\/2]) rotate([0,-90,0]) {\n\t\t\t\ttranslate([0,13-6,0]) cylinder(r=3,h=3);\n\t\t\t\ttranslate([0,13+6,0]) difference() {\n\t\t\t\t\tcylinder(r=4,h=3,$fn=6);\n\t\t\t\t\tcylinder(r=3,h=4,$fn=6);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nmodule servo() {\n\n\tcolor(\"Black\", alpha=0.5) {\t\n\t\tcube(center=true, [23,21,12]);\t\t\n\t\ttranslate([0,21\/2-3,0]) cube(center=true, [32,1,12]);\t\t\n\t\ttranslate([23\/2-11.5\/2,21\/2,0]) rotate([-90,0,0]) {\n\t\t\tunion() {\n\t\t\t\tcylinder(r=11.5\/2, h=5);\n\t\t\t\tcylinder(r=2, h=10);\n\t\t\t\ttranslate([-3,-3, 9]) cube([6,20,1]);\n\t\t\t}\n\t\t}\n\t}\n\tcolor(\"White\", alpla=0.5) {\n\n\t}\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"51824684f5795172bd2d15634f3595f3754a3581","subject":"Base complete","message":"Base complete\n\nBase structure is complete, though dimensions have not been verified.\n","repos":"rinworks\/rig","old_file":"hw\/models\/rostockMaxAdapter\/RostockCenter_v1.scad","new_file":"hw\/models\/rostockMaxAdapter\/RostockCenter_v1.scad","new_contents":"\/\/washer(15, 25, 5);\n\/\/pipeSegment(id1=15, id2=20, od1=20, od2=25, h=10);\n\/\/radialCylinders(cd=25, pd=3, h=5, angles=[0, 45,90, 180]);\nbaseThickness=3;\nwallThickness=baseThickness; \/\/ Thickness of vertical structures.\nboltsCircleDia=50;\nboltsDia=3;\nboltsFlangeDia=10;\nboltBigFlangeDia= boltsFlangeDia+2*wallThickness; \/\/ to accomodate for cylinder\ncentralHoleBase=30;\nbaseOuterDia=boltsCircleDia+boltsDia;\nbaseExtensionRadius = 79; \/\/ From center (it's 29mm from bolt hole center.)\nbaseExtensionNarrowWidth = 10;\nbaseExtensionWideWidth = 15;\n\n\n\npunchThickness = baseThickness+2; \/\/ We extend punch solids by 1 in each direction\ndifference() {\n union() {\n washer(centralHoleBase, baseOuterDia, baseThickness);\n radialCylinders(cd=boltsCircleDia, pd=boltsFlangeDia, h=baseThickness, angles=[120,240], $fn=60);\n radialCylinders(cd=boltsCircleDia, pd=boltBigFlangeDia, h=baseThickness, angles=[0], $fn=60);\n translate([0,-baseExtensionNarrowWidth\/2, 0])\n cube([baseExtensionRadius, baseExtensionNarrowWidth, baseThickness]);\n translate([baseExtensionRadius,-baseExtensionWideWidth\/2, 0])\n cube([wallThickness, baseExtensionWideWidth, baseThickness]);\n }\n union() {\n translate([0,0,-1])\n cylinder(d=centralHoleBase, h=punchThickness);\n radialCylinders(cd=boltsCircleDia, pd=boltsDia, h=punchThickness, angles=[0, 120,240], zo=-1, $fn=60);\n }\n}\n\n\n\n\/\/ A washer with base on x-y plane and axis == z-axis\nmodule washer(id, od, h) {\n difference() {\n cylinder(h, d=od, $fn=60);\n translate([0,0,-h*0.05])\n cylinder(h*1.1, d=id, $fn=60);\n }\n}\n\n\/\/ Creates a segment of a pipe. The center of the segment is the z-axis.\n\/\/ The base of the segment is the x-y plane. The base inner\/outer dia are\n\/\/ id1\/id2 and the top inner\/outer dia are id2\/od2. The height of the\n\/\/ segment is h.\nmodule pipeSegment(id1, od1, id2, od2, h) {\n difference() {\n cylinder(h, d1=od1, d2=od2, $fn=60);\n translate([0,0,-h*0.05])\n cylinder(h*1.1, d1=id1, d2=id2, $fn=60);\n }\n}\n\n\/\/ Creates a union of several cylinders along a circle with diameter cd.\n\/\/ One application: subtract these from a circular gasket.\n\/\/ The cylinders have diameter pd and height h. The circle is on the x-y\n\/\/ plane and it's center the origin. The *base* of the punches is paralel\n\/\/ to the x-y plane, with z=zo. The cylinders are positioned at the\n\/\/ specified vector of angles.\nmodule radialCylinders(cd, pd, h, angles, zo) {\n \/\/cylinder(d=pd, h);\n translate([0,0, 0]) {\n for(a = angles) {\n rotate(a)\n translate([cd\/2, 0, zo])\n cylinder(d=pd, h);\n }\n }\n}\n\n","old_contents":"\n\n\/\/ A washer with base on x-y plane and axis == z-axis\nmodule washer(id, od, h) {\n}\n\n\/\/ Creates several cylinders along a circle with diameter cd.\n\/\/ One application: subtract these from a circular gasket.\n\/\/ The cylinders have diameter pd and height h. The circle is on the x-y\n\/\/ plane and it's center the origin. The *base* of the punches is on \n\/\/ the x-y plane. The cylinders are positioned at the specified vector\n\/\/ of angles.\nmodule radialCylinders(cd, pd, h, angles) {\n}\n\n\/\/ Creates a segment of a pipe. The center of the segment is the z-axis.\n\/\/ The base of the segment is the x-y plane. The base inner\/outer dia are\n\/\/ id1\/id2 and the top inner\/outer dia are id2\/od2. The height of the\n\/\/ segment is h.\nmodule pipeSegment(id1, od1, id2, od2, h) {\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"b603255e1fcb960e787e8735fcc05d56b22f6ee2","subject":"Update shim for guitar neck","message":"Update shim for guitar neck\n","repos":"ehaskins\/OpenSCAD","old_file":"LSJ\/Neck Shim.scad","new_file":"LSJ\/Neck Shim.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"6b52e638fd762da99b6afad0ae69ceab0c21d8a3","subject":"bearing\/data: add clip dist for thick bushings","message":"bearing\/data: add clip dist for thick bushings\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,8,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12];\nbearing_bronze_12_18_18 = [12,18,18];\n\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"79b2d08a7594869fdaf4b6e45913d657d3a1a416","subject":"bearing: remove show_zips, use instead","message":"bearing: remove show_zips, use instead\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing.scad","new_file":"bearing.scad","new_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if($show_vit)\n {\n %bearing(bearing_type=bearing_type);\n\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","old_contents":"use ;\nuse \ninclude \ninclude \ninclude \n\nmodule bearing(bearing_type, extra_h=0, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n h = fallback(override_h, bearing_type[2]) + extra_h;\n size_align(size=[bearing_type[1],bearing_type[1],h], align=align ,orient=orient)\n difference()\n {\n \/\/ outer\n cylindera(h=h, d=bearing_type[1], align=[0,0,0]);\n \/\/ inner\n cylindera(h=h+.1, d=bearing_type[0], align=[0,0,0]);\n \/\/ clips\n if(len(bearing_type) > 3)\n {\n clip_depth=.5;\n for(z=[-1,1])\n translate([0,0,z*bearing_type[3]\/2])\n difference()\n {\n cylindera(h=1*mm, d=bearing_type[2]+1, align=[0,0,-z]);\n cylindera(h=1*mm+.1, d=bearing_type[4]-clip_depth, align=[0,0,-z]);\n }\n\n }\n }\n}\n\nmodule bearing_mount_holes(bearing_type, ziptie_type=[2*mm, 3*mm], ziptie_bearing_distance=3*mm, tolerance=1.01, orient=[1,0,0], ziptie_dist=undef, with_zips=true, show_zips=false)\n{\n ziptie_thickness = ziptie_type[0];\n ziptie_width = ziptie_type[1]+0.6*mm;\n\n ziptie_dist_ = fallback(ziptie_dist, bearing_type[3]\/2);\n\n orient(orient)\n {\n \/\/ Main bearing cut\n cylindera(h=bearing_type[2]*tolerance, d=bearing_type[1]*tolerance, orient=[0,0,1]);\n\n if(with_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_ - z*1\/2])\n hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness*2,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,0]\n );\n }\n\n \/\/ for linear rod\n cylindera(d=bearing_type[0]+1*mm, h=100, orient=[0,0,1]);\n\n if(show_zips)\n {\n for(z=[-1,1])\n translate([0,0,z*ziptie_dist_])\n {\n %hollow_cylinder(\n d=bearing_type[1]+ziptie_bearing_distance+ziptie_thickness,\n thickness = ziptie_thickness,\n h = ziptie_width,\n taper=false,\n orient=[0,0,1],\n align=[0,0,-z]\n );\n }\n }\n }\n}\n\nif(false)\n{\n b=bearing_igus_rj4jp_01_12;\n bearing_mount_holes(b, orient=[0,0,1]);\n translate([30,0,0])\n bearing(b, orient=[0,0,1]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"86922d14e73b07a72730f6604fe183a4a1e4e7e6","subject":"screw\/screw_cut: fix head cutout position","message":"screw\/screw_cut: fix head cutout position\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread_);\n assert(head_h != undef, \"screw_cut: head_h is undef!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.1*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.1*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != undef, \"screw_cut: threadsize is undef!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != undef, \"screw_cut: s is undef!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.1*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.1*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n {\n rotate([0,0,30])\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n }\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ba500ef8486ad6e7b2b5665f817bfeae9963f0e9","subject":"bearing_data: add some linear ball bearings","message":"bearing_data: add some linear ball bearings\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"bearing_data.scad","new_file":"bearing_data.scad","new_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ SKF linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_LBBR12 = [12, 19, 28, 23, 20];\n\n\/\/ PBC linear ball bearings\n\/\/ http:\/\/www.skf.com\/binary\/21-245746\/Linear-bearings-and-units---4182_2-EN(1).pdf\nbearing_KHP12 = [12, 19, 28, 23, 20];\n\n\/\/ Bosch Rexroth linear ball bearing\nbearing_KBC12 = [12, 19, 28, 23, 20];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","old_contents":"include \n\n\/\/ radial bearings\n\/\/ inner_d, outer_d, length\/width (thickness)\nbearing_608 = [8,22,7];\nbearing_626 = [8,19,6];\nbearing_625 = [5,16,5];\nbearing_608 = [8,22,7];\nbearing_MR128 = [8,12,3.5];\nbearing_MR85 = [5,8,4];\nbearing_MR105 = [5,10,4];\nbearing_MR115 = [5,11,4];\nbearing_MR125 = [5,12,4];\n\n\/\/ linear bearings\n\/\/ inner_d, outer_d, length, clips_len, clips_d\n\nbearing_sf1_1010 = [10,12,10];\nbearing_sf1_1212 = [12,14,12];\n\nbearing_bronze_10_16_12 = [10,16,12,0,16];\nbearing_bronze_10_16_18 = [10,16,18,12,16];\nbearing_bronze_12_18_18 = [12,18,18,9,18];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35107431\/view\/6565.jpg\nbearing_LM3UU = [3, 7, 10];\nbearing_LM4UU = [4, 8, 12];\nbearing_LM5UU = [5, 10, 15, 10.2, 9.6];\nbearing_LM6UU = [6, 12, 19, 13.5, 11.5];\nbearing_LM8SUU = [8, 15, 17, 11.5, 14.3];\nbearing_LM8UU = [8, 15, 24, 17.5, 14.3];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM10UU = [10, 19, 29, 22, 18];\nbearing_LM12UU = [12, 21, 30, 23, 20];\nbearing_LM13UU = [13, 21, 32, 23, 22];\nbearing_LM16UU = [16, 28, 37, 26.5, 27];\nbearing_LM20UU = [20, 32, 42, 30.5, 30.5];\nbearing_LM25UU = [25, 40, 59, 41, 38];\nbearing_LM30UU = [30, 45, 64, 44.5, 43];\nbearing_LM35UU = [35, 52, 70, 49.5, 49];\nbearing_LM40UU = [40, 60, 80, 60.5, 57];\nbearing_LM50UU = [50, 80, 100, 74.5, 76.5];\nbearing_LM60UU = [60, 90, 110, 85.5, 85.5];\nbearing_LM80UU = [80, 120, 140, 105.5, 116];\nbearing_LM100UU = [100, 150, 150, 125.5, 145];\n\n\/\/ http:\/\/imagehost.vendio.com\/a\/35114350\/view\/19_002.jpg\nbearing_LM6LUU = [6, 12, 35, 27, 11.5];\nbearing_LM8LUU = [8, 15, 45, 35, 14.3];\nbearing_LM10LUU = [10, 19, 55, 44, 18];\nbearing_LM12LUU = [12, 21, 57, 46, 20];\nbearing_LM13LUU = [13, 21, 61, 46, 22];\nbearing_LM16LUU = [16, 28, 70, 53, 27];\nbearing_LM20LUU = [20, 32, 80, 61, 30.5];\nbearing_LM25LUU = [25, 40, 112, 82, 38];\nbearing_LM30LUU = [30, 45, 123, 89, 43];\nbearing_LM35LUU = [35, 52, 135, 99, 49];\nbearing_LM40LUU = [40, 60, 151, 121, 57];\nbearing_LM50LUU = [50, 80, 192, 148, 76.5];\nbearing_LM60LUU = [60, 90, 209, 170, 85.5];\n\n\/\/ http:\/\/www.igus.eu\/wpck\/12157\/Motek14_N14_6_3_Vollkunststofflager?L=en\nbearing_igus_rj4jp_01_08 = [8,15,24,17.5,14.3];\nbearing_igus_rj4jp_01_10 = [10,19,29,22.5,18];\nbearing_igus_rj4jp_01_12 = [12,21,30,23.5,20];\nbearing_igus_rj4jp_01_16 = [16,28,37,26.5,26.6];\nbearing_igus_rj4jp_01_20 = [20,32,42,30.5,30.3];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"6625103b4ca1df04a995933469d57d3b5a48f713","subject":"Update fan (blower) mount to include parameters for bigger slot, similar to older axial design.","message":"Update fan (blower) mount to include parameters for bigger slot, similar to older axial design.\n","repos":"twstdpear\/i3_parts","old_file":"bg10\/extruder\/cooling_fan_mount.scad","new_file":"bg10\/extruder\/cooling_fan_mount.scad","new_contents":"\n\nhot_rad = 30\/2\/cos(30);\nhotend_x=25;\nfan_x = 15+5;\n\nhotend_y=-5;\n\nthickness = 10;\nwall=2;\nslop=.2;\n\nfan_hole = (40-wall-wall)\/2;\nmount_drop = 10;\nfan_z = fan_hole+wall;\n\n\/\/fan_mount();\nfan_mount_blower();\n\/\/bowden_fan();\n\/\/translate([0,60,0]) cyclops_fan();\n\n%cylinder(r=hot_rad, h=20, center=true);\n%translate([-23,0,0]) cylinder(r=hot_rad, h=20, center=true);\n\nm3_cap_rad = 4;\nm3_rad = 2;\nm3_nut_rad = 6.01\/2+.1;\n\nfacets = 6;\n\nduct_angle=-5;\nduct_jut = -5;\n\nmodule fan_mount(){\n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n \/\/fan mount\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n hull() for(i=[0:90:359]) rotate([0,0,i]) {\n #translate([20-wall,20-wall,-wall]) cylinder(r=wall,h=wall*2, $fn=16);\n } \n }\n \n \/\/mounting lugs above fan\n #translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/fan holes\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) for(j=[-16, 16]) {\n #translate([j,i,-.1]) cylinder(r=m3_rad, h=wall+.2, $fn=16);\n translate([j,i,-wall*2-.1]) cylinder(r2=m3_nut_rad, r1=m3_nut_rad+.25, h=wall*2+.2, $fn=6);\n }\n }\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n translate([0,-5+hotend_y\/2,0])cube([100,10,wall]);\n }\n }\n}\n\nmodule bowden_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=38;\n \n mount_height = 46;\n \n offset = -20;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[10,-20,-40]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([5,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule cyclops_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=38;\n \n mount_height = 46-1.5;\n mount_offset = 10;\n \n offset = -11;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n #hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[10-mount_offset,-20-mount_offset]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([5,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([5*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([5*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule fan_mount_blower(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n \/\/duct_offset=38;\n\n\/\/ Rakish \n\/\/ duct_jut = -7;\n\/\/ duct_angle = -25;\n\/\/ duct_extend = 3;\n\/\/ fan_x = 15+5+10+10+5-8;\n\/\/ tongue_width = hot_rad*2-wall;\n\n\/\/ Longer, lower angle \n duct_jut = -5;\n duct_angle = -10;\n duct_extend = 8;\n fan_x = 8+15+5+10+10+5-8;\n tongue_width = 10;\n \n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n \/\/rear duct transition\n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n \n \/\/this is the duct!\n #translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n \n %translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) translate([25,0,0]) cube([50,15,50], center=true);\n }\n \n \/\/front duct transition\n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n \/\/this is the duct!\n translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([fan_x,duct_jut,0]) rotate([0,0,duct_angle]) {\n translate([duct_extend\/2,0,duct_h\/2+wall]) difference(){\n cube([duct_extend*1.05, duct_w+wall*2, duct_h+wall*2], center=true);\n cube([duct_extend*1.1, duct_w, duct_h], center=true);\n }\n translate([duct_extend,0,0]) duct_angle(angle=0);\n }\n \n \/\/mounting lugs above fan\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall*2);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n \n \/\/this is the duct!\n translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.1,duct_w, duct_h], center=true);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n \n \/\/this is the duct!\n translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.1,duct_w, duct_h], center=true);\n }\n \n \/\/translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n \n \/\/cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n difference(){\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n \/\/this adds some holes to direct air straight into the hotend\n for(i=[30:360\/6:179]) rotate([0,0,i]) {\n cube([100,8,8],center=true);\n }\n }\n \n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \/\/an extra tongue for strength\n translate([0,0,0])cube([100,tongue_width,wall], center=true);\n }\n }\n}\n\nmodule duct(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 90, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n }\n \n translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n #translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n}\n\nmodule duct_angle(angle=30){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 45, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n translate([0,0,-100]) rotate([0,0,90-angle]) cube([200,200,200]);\n }\n \n rotate([0,0,90-angle]) translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n}\n\n","old_contents":"\n\nhot_rad = 30\/2\/cos(30);\nhotend_x=25;\nfan_x = 15+5;\n\nhotend_y=-5;\n\nthickness = 10;\nwall=2;\nslop=.2;\n\nfan_hole = (40-wall-wall)\/2;\nmount_drop = 10;\nfan_z = fan_hole+wall;\n\n\/\/fan_mount();\nfan_mount_blower();\n\/\/bowden_fan();\n\/\/translate([0,60,0]) cyclops_fan();\n\n%cylinder(r=hot_rad, h=20, center=true);\n%translate([-23,0,0]) cylinder(r=hot_rad, h=20, center=true);\n\nm3_cap_rad = 4;\nm3_rad = 2;\nm3_nut_rad = 6.01\/2+.1;\n\nfacets = 6;\n\nduct_angle=-5;\nduct_jut = -5;\n\nmodule fan_mount(){\n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole+wall, h=5);\n }\n \n \/\/fan mount\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n hull() for(i=[0:90:359]) rotate([0,0,i]) {\n #translate([20-wall,20-wall,-wall]) cylinder(r=wall,h=wall*2, $fn=16);\n } \n }\n \n \/\/mounting lugs above fan\n #translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/fan holes\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) for(j=[-16, 16]) {\n #translate([j,i,-.1]) cylinder(r=m3_rad, h=wall+.2, $fn=16);\n translate([j,i,-wall*2-.1]) cylinder(r2=m3_nut_rad, r1=m3_nut_rad+.25, h=wall*2+.2, $fn=6);\n }\n }\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=.3);\n }\n \n translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n translate([0,-5+hotend_y\/2,0])cube([100,10,wall]);\n }\n }\n}\n\nmodule bowden_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=38;\n \n mount_height = 46;\n \n offset = -20;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[10,-20,-40]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([5,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([2*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule cyclops_fan(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n duct_offset=38;\n \n mount_height = 46-1.5;\n mount_offset = 10;\n \n offset = -11;\n difference(){\n union(){\n \/\/core\n hull(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([offset,0,0]) cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n }\n \n \/\/connection to duct\n #hull(){\n intersection(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([hot_rad+wall*2,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([duct_offset,duct_jut,0]) rotate([0,0,duct_angle]) duct();\n \n \/\/mounting lugs\n for(i=[10-mount_offset,-20-mount_offset]) difference(){\n translate([i,hot_rad+wall*2,0]) hull(){\n translate([5,0,thickness]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall*2, h=wall, center=true);\n translate([0,0,mount_height]) rotate([90,0,0]) cylinder(r=m3_cap_rad+wall, h=wall, center=true);\n }\n \n \/\/mounting holes up top\n translate([i,hot_rad+wall*2,mount_height]) rotate([90,0,0]) cylinder(r=m3_rad+slop, h=20, center=true);\n }\n }\n \n \/\/connection to duct airflow\n hull(){\n intersection(){\n translate([0,0,wall]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2, h=thickness-wall, $fn=facets);\n translate([hot_rad+wall*3,0,0]) cube([1,200,200], center=true);\n }\n translate([duct_offset,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.2,duct_w, duct_h], center=true);\n }\n \n \/\/center cutout\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n translate([5*offset,0,0]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/air path\n difference(){\n \/\/core\n translate([0,0,-.1]) hull(){\n cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([offset+wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n }\n \n \/\/keep the center walls in place\n translate([0,0,-.5]) hull(){\n cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n translate([5*offset,0,0]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*4, h=thickness+wall+1, $fn=facets);\n }\n \n \/\/bottom on the near side\n translate([10,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*2.5, h=wall+.5, $fn=facets);\n }\n }\n}\n\nmodule fan_mount_blower(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n \/\/duct_offset=38;\n \n duct_jut = -7;\n duct_angle = -25;\n duct_extend = 3;\n fan_x = 15+5+10+10+5-8;\n \n difference(){\n union(){\n \/\/core\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n \n \/\/rear duct transition\n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n \n \/\/this is the duct!\n #translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n \n %translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) translate([25,0,0]) cube([50,15,50], center=true);\n }\n \n \/\/front duct transition\n hull(){\n intersection(){\n difference(){\n cylinder(r1=hot_rad+thickness+wall, r2=hot_rad+thickness*2+wall, h=thickness+wall, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n \/\/this is the duct!\n translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1,duct_w+wall*2, duct_h+wall*2], center=true);\n }\n \n \/\/the duct connector\n translate([fan_x,duct_jut,0]) rotate([0,0,duct_angle]) {\n translate([duct_extend\/2,0,duct_h\/2+wall]) difference(){\n cube([duct_extend*1.05, duct_w+wall*2, duct_h+wall*2], center=true);\n cube([duct_extend*1.1, duct_w, duct_h], center=true);\n }\n translate([duct_extend,0,0]) duct_angle(angle=0);\n }\n \n \/\/mounting lugs above fan\n translate([hotend_x+fan_x,hotend_y,fan_z]) rotate([0,90,0]){\n for(i=[-16, 16]) difference(){\n hull(){\n translate([-16-mount_drop,i,-fan_x+3]) cylinder(r=m3_rad+wall, h=wall*2, $fn=16);\n translate([0,i,-fan_x+3]) cylinder(r=m3_cap_rad*2, h=wall*2);\n }\n translate([-16-mount_drop,i,-fan_x+3-.1]) cylinder(r=m3_rad, h=wall*2+1, $fn=16);\n }\n }\n }\n \n \/\/center cutout\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall, r2=hot_rad+wall+wall, h=thickness+wall+1, $fn=facets);\n \n \/\/front cutout\n translate([-(hot_rad+thickness*2+wall),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \n \/\/air path\n translate([0,0,-.1]) difference(){\n union(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,50,50]) cube([100,100,100], center=true);\n }\n \n \/\/this is the duct!\n translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.1,duct_w, duct_h], center=true);\n }\n \n hull(){\n intersection(){\n difference(){\n translate([-wall,0,0]) cylinder(r1=hot_rad+thickness, r2=hot_rad+thickness*2-wall, h=thickness, $fn=facets);\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall*2, r2=hot_rad+wall*3, h=thickness+wall+1, $fn=facets);\n }\n translate([50+hot_rad-6.7,-50,50]) cube([100,100,100], center=true);\n }\n \n \/\/this is the duct!\n translate([fan_x,duct_jut,duct_h\/2+wall]) rotate([0,0,duct_angle]) cube([1.1,duct_w, duct_h], center=true);\n }\n \n \/\/translate([hotend_x+fan_x-5,hotend_y,fan_z]) rotate([0,90,0]) cylinder(r=fan_hole, h=wall+1+5);\n }\n \n \/\/cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall, $fn=facets);\n difference(){\n translate([0,0,-.5]) cylinder(r1=hot_rad+wall+wall, r2=hot_rad+wall+wall+wall, h=thickness+wall+1, $fn=facets);\n \/\/this adds some holes to direct air straight into the hotend\n for(i=[30:360\/6:179]) rotate([0,0,i]) {\n cube([100,8,8],center=true);\n }\n }\n \n translate([-(hot_rad+thickness*2),0,0]) cylinder(r=hot_rad+thickness*2+wall, h=thickness+wall*10, center=true, $fn=facets);\n \/\/an extra tongue for strength\n translate([0,0,0])cube([100,hot_rad*2-wall,wall], center=true);\n }\n }\n}\n\nmodule duct(){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 90, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n }\n \n translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n #translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n}\n\nmodule duct_angle(angle=30){\n duct_w = 15+slop;\n duct_h = 20+slop;\n rad = 20;\n \n translate([0,0,rad+wall+duct_h\/2]) rotate([-90,0,0]) union(){\n intersection(){\n rotate_extrude(angle = 45, convexity = 2){\n translate([rad,0,0])\n difference(){\n square([duct_h+wall*2, duct_w+wall*2], center=true);\n square([duct_h, duct_w], center=true);\n }\n }\n translate([0,0,-100]) cube([200,200,200]);\n translate([0,0,-100]) rotate([0,0,90-angle]) cube([200,200,200]);\n }\n \n rotate([0,0,90-angle]) translate([rad,0,0]) rotate([90,0,0]) translate([0,0,8]) difference(){\n hull(){\n translate([0,0,-8]) cube([duct_h+wall*2,duct_w+wall*2,.1], center=true);\n translate([duct_h\/2+wall\/2,0,8]) cube([wall,duct_w+wall*2,.1], center=true);\n }\n \n \/\/hollow center\n cube([duct_h,duct_w,16.3], center=true);\n \n \/\/slot for the clip\n translate([wall+1,0,(12-16)\/2]) cube([duct_h+wall*2,2,12], center=true);\n }\n \n }\n}\n\n","returncode":0,"stderr":"","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"195f6153b59a3a89733e97ff4129910c2fde2513","subject":"x\/extruder\/guidler: roundify","message":"x\/extruder\/guidler: roundify\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nif(false)\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \nuse \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8*mm;\nxaxis_carriage_padding = 4*mm;\nxaxis_carriage_mount_distance = 23*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20*mm;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-2,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nMKnurlInsertNutM3_5_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 5*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nMKnurlInsertNutM3_3_42 = [\n [MHexNutHoleDia, 3*mm],\n [MHexNutWidthMin, 4.2*mm-.4*mm],\n [MHexNutThickness, 3*mm],\n [MHexNutWidthMax, 4.2*mm],\n [MHexNutThread, ThreadM3],\n [MHexNutFacets, 10],\n];\n\nextruder_a_h = 15*mm;\n\nmodule x_carriage(mode=undef)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else \n if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n scale(1.03)\n bearing(extruder_a_bearing, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n else\n {\n \/\/ use knurl nut for the one screw that is hidden by gear\n translate([0,h,0])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=5*mm, orient=[0,-1,0], align=[0,-1,0]);\n }\n }\n}\n\nmodule extruder_a(show_vitamins=false)\n{\n \/*if(false)*\/\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n \/*rcubea([extruder_motor_holedist+side\/2+5*mm,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);*\/\n hull()\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*45,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/cutout for access to small gear tightscrew\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=11*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutout for access to big gear tightscrew\n \/*translate([-lookup(NemaSideSize, extruder_motor)\/2,0,0])*\/\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([0,extruder_gear_big_h[1]\/2+1*mm,0])\n rotate([0,-25,0])\n cylindera(d=7*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=12*mm+3*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.02)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n between_bearing_and_gear=0*mm;\n \/*if(false)*\/\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n \/*translate([0,extruder_a_bearing[2],0])*\/\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n translate([0,-1*mm,0])\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[1,0,-1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2, 0, 0]);\n {\n rcubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-1,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * 1, 0, 0]);\n {\n rcubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-1,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * 1) + (-0.5*1), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-1], extra_h=2, round_radius=2);\n }\n }\n}\n\nextruder_a_bearing = bearing_MR105;\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-15*mm],\n [extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]\n];\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n intersection()\n {\n translate(extruder_b_capmount_offset)\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n capmount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_capmount_offset[1],0])\n capmount(part);\n\n rotate([90,0,0])\n capmount(part);\n }\n\n hull()\n \/*union()*\/\n {\n \/\/ main house\n extruder_b_size=[\n hobbed_gear_d_outer+5*mm,\n abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm,\n hobbed_gear_d_outer+5*mm\n ];\n \/*translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])*\/\n \/*translate([hobbed_gear_d_inner\/2,0,0])*\/\n \/*rcubea(extruder_b_size, align=[0,sign(extruder_filapath_offset[1]),0]);*\/\n\n\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, align=[0,1,0], orient=[0,1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick-1*mm, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick, head_embed=true, nut_offset=-10, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1], h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]*1.5+1*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n rotate([0,90,90])\n pie_slice(guidler_pivot_r+4*mm, 125, 270, guidler_w_cut);\n }\n\n \/*translate(extruder_guidler_mount_off)*\/\n \/*{*\/\n \/*hull()*\/\n \/*for(y=[-1,1])*\/\n \/*translate([0,y*guidler_mount_w\/2,0])*\/\n \/*{*\/\n \/*cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0], align=[0,-y,0]);*\/\n \/*translate([-guidler_mount_d,0,-guidler_mount_d\/2])*\/\n \/*cubea([10,(guidler_w-guidler_mount_w)\/2+1*mm,10], align=[1,y,1]);*\/\n \/*}*\/\n \/*}*\/\n }\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+2*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[2]*1.25,nut_m3[1]+.5*mm,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2, 0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([i*hotmount_clamp_screws_dist, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n screw_cut(nut=MKnurlInsertNutM3_5_42, h=1000, nut_offset=5*mm, head_embed=false, orient=[0,1,0], align=[0,-1,0]);\n }\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n \/*extruder_shaft_len = 1000;*\/\n extruder_shaft_len = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm;\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-extruder_filapath_offset[1]+.1,0])\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n rotate([0,0,-90])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+1.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-1,0,0], extrasize=[100,0,0], extrasize_align=[1,0,0]);\n }\n }\n\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([0, -extruder_b_w\/2 * (1), -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,0,-90])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n translate(extruder_b_capmount_offset)\n capmount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage(mode=\"pos\");\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=-1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_thickness, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\");\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=5, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n translate([0, -0.1, 0])\n {\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, 0, v*r\/2])\n {\n cylindera(r=r,h=guidler_d+.2, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n\n }\n\n if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule capmount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height,e-1);\n translate([0,0,-hs])\n if(e==0||e==2)\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n else\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,-1]);\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n\nextruder_b_capmount_offset=[35,-7,-41];\n\nif(false)\n{\n color(color_xcarriage)\n x_carriage_withmounts(show_vitamins=true);\n\n translate(extruder_offset)\n {\n color(color_extruder)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n color(color_extruder)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n\n extruder_b(part=\"neg\");\n }\n }\n extruder_b(part=\"vit\");\n\n color(color_guidler)\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_extras=true);\n }\n\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n color(color_hotend)\n x_extruder_hotend();\n\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false);*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_a();*\/\n\n \/*rotate([-90,0,0])*\/\n \/*extruder_b();*\/\n\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_extras=false);\n }\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"eb9a22b70b676a7f786ab183eafcd5dc87a38169","subject":"fixup! main: use fncylindera orient param","message":"fixup! main: use fncylindera orient param\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\nxaxis_pos_x = -225\/2*mm;\nxaxis_range_z=[85,350];\nxaxis_pos_z = 350*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n translate([xaxis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\n\ninclude \ninclude \n\ninclude \ninclude \n\n\nxaxis_pos_x = -225\/2*mm;\nxaxis_range_z=[85,350];\nxaxis_pos_z = 350*mm;\n\nmain();\n\nmodule main()\n{\n color(extrusion_color)\n gantry_lower();\n\n color(extrusion_color)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(extrusion_color)\n for(i=[-1,1])\n translate([0,i*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n \/\/ x axis\n translate([0,0,xaxis_pos_z])\n {\n translate([xaxis_pos_x,0,0])\n {\n xaxis_bearing_dist = 10;\n translate([0,xaxis_zaxis_distance_y,0])\n translate([0,xaxis_bearing[1]\/2,0])\n cubea([xaxis_bearing[2]*2+xaxis_bearing_dist,5,xaxis_rod_distance+xaxis_bearing[1]], align=[0,1,0]);\n\n attach([[-8,-15,-16],[-1,0,0]],extruder_conn_xcarriage)\n extruder();\n\n \/\/ x carriage\n for(i=[-1,1])\n for(j=[-1,1])\n translate([j*(xaxis_bearing_dist+xaxis_bearing[2])\/2,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n bearing(xaxis_bearing);\n }\n\n \/\/ x smooth rods\n for(i=[-1,1])\n translate([0,xaxis_zaxis_distance_y,i*(xaxis_rod_distance\/2)])\n rotate([0,90,0])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d);\n }\n\n \/\/ y smooth rods\n for(i=[-1,1])\n translate([i*(yaxis_rod_distance\/2),0,0])\n {\n rotate([90,0,0])\n fncylindera(h=yaxis_rod_l,d=yaxis_rod_d, align=[0,1,0]);\n }\n\n translate([0,0,yaxis_rod_d])\n cubea(ycarriage_size, align=[0,0,1]);\n\n \/\/ z axis\n for(i=[-1,1])\n translate([i*(main_width\/2 + lookup(NemaSideSize,zaxis_motor)\/2), 0, zaxis_motor_offset_z])\n {\n mirror([i==-1?1:0,0,0])\n {\n zmotor_mount();\n\n attach([[0,0,0],[0,0,0]],zmotor_mount_conn_motor)\n {\n \/\/ z motor\/leadscrews\n motor(zaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n }\n }\n\n \/\/ z smooth rods\n translate([i*zaxis_rod_screw_distance_x\/2+zmotor_mount_motor_offset,0,0])\n {\n fncylindera(h=zaxis_rod_l,d=zaxis_rod_d,align=[0,0,1]);\n\n translate([0,0,xaxis_pos_z-zaxis_motor_offset_z])\n fncylindera(h=zaxis_bearing[2], d=zaxis_bearing[1], align=[0,0,0]);\n }\n }\n}\n\nzmotor_mount_motor_offset=5;\nzmotor_mount_conn_motor=[[-zmotor_mount_motor_offset, 0, 0],[0,1,0]];\n\nmodule zmotor_mount()\n{\n motor_w = lookup(NemaSideSize,zaxis_motor);\n\n mount_thickness = 5;\n mount_thickness_h = 8;\n mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n mount_width = motor_w+mount_thickness*2 + mount_thread_dia*8;\n mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\n \/\/ side triangles\n translate([-motor_w\/2, 0, 0])\n for(i=[-1,1])\n {\n translate([mount_thickness, i*((motor_w\/2)+mount_thickness\/2), 0])\n rotate([90,90,0])\n Right_Angled_Triangle(a=motor_w-mount_thickness+zmotor_mount_motor_offset, b=main_lower_dist_z+extrusion_size+zaxis_motor_offset_z, height=mount_thickness, centerXYZ=[0,0,1]);\n\n translate([0, i*((motor_w\/2)+mount_thickness\/2), 0])\n cubea([mount_thickness, mount_thickness, mount_h], align=[1,0,-1]);\n }\n\n \/\/ top mount plate\n difference()\n {\n translate([-motor_w\/2,0,-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia, orient=[1,0,0]);\n }\n\n \/\/ bottom mount plate\n difference()\n {\n translate([-motor_w\/2,0,-main_lower_dist_z-extrusion_size-zaxis_motor_offset_z])\n cubea([mount_thickness, mount_width, extrusion_size], align=[1,0,1]);\n\n for(i=[-1,1])\n translate([-motor_w\/2,i*(motor_w\/2+mount_thread_dia*3),-extrusion_size-main_lower_dist_z])\n fncylindera(h=mount_thickness*3,d=mount_thread_dia,align=[0,0,0], orient=[1,0,0]);\n }\n\n\/*# cubea([motor_w+mount_thickness,motor_w+mount_thickness,zaxis_motor_offset_z], align=[0,0,-1]);*\/\n\n \/\/ top plate\n difference()\n {\n cubea([motor_w, motor_w+mount_thickness*2, mount_thickness_h], align=[0,0,1], extrasize=[5,0,0], extrasize_align=[1,0,0]);\n\n translate([zmotor_mount_motor_offset,0,-1])\n linear_extrude(mount_thickness_h+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule gantry_upper()\n{\n for(i=[-1,1])\n translate([i*(main_width\/2), 0])\n linear_extrusion(h=main_height, align=[-i,0,1], orient=[0,0,1]);\n\n translate([0, 0, main_height])\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n}\n\nmodule gantry_lower()\n{\n for(i=[-1,1])\n translate([0, i*(main_depth\/2), 0]) \n linear_extrusion(h=main_width, align=[0,i,-1], orient=[1,0,0]);\n\n for(i=[-1,1])\n translate([i*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=[-i,0,-1], orient=[0,1,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"a106499977f9085565ab95e42643d9b533a07e54","subject":"x\/ends: reduce top\/bottom thickness","message":"x\/ends: reduce top\/bottom thickness\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 39*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=MHexNutM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=MHexNutM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"34c7ac8d15f79cf13cb8e0db5ceb946b5307407a","subject":"=First version","message":"=First version\n","repos":"oprobst\/Tauchlampe","old_file":"Backup-Lampe.scad","new_file":"Backup-Lampe.scad","new_contents":"\/*\n * Backup Lampe\n *\n * Klein, praktisch, ausfallsicher\n *\/\n$fn=150;\n\n\/*\n\/\/ Materialliste \nAlurohr Aussendurchmesser = 30, Innendurchmesser = 27, l\u00e4nge = XX?\nCree XP-G2 R5, wei\u00df, 521lm\n26650er LiFePo4 e.g. 3.3Ah\n\n*\/\n\naussenRohr(15, 14, 150);\n\nakkuBlock(26.5,68); \/\/26650er\n\ntranslate ([0,0, 140]){\n ledCreeXpG2 (true);\n}\n\n\nmodule ledCreeXpG2 (withStar){\n \n color(\"LightSteelBlue\"){\n difference (){ \n sphere (1.53);\n translate ([-5,-5,-3.53]){\n cube ([10,10,3.53]);\n }\n }\n translate ([-3.45\/2,-3.45\/2,-.83]){\n cube ([3.45,3.45,.83]); \n }\n }\n\n if (withStar){\n color(\"DarkGreen\"){\n translate ([0,0,-1.5]){\n difference (){\n octagon(20,1.5);\n rotate ([0,0, 22.5]){\n translate ([0,0,-5]){\n LEDSternBohrungen(9,1.6,8,10);\n }\n }\n } \n }\n } \n } \n}\n\nmodule aussenRohr (aussenRadius, innenRadius, hoehe){ \n \n %ring (aussenRadius, innenRadius, hoehe);\n}\n\n\nmodule akkuBlock (durchmesser, hoehe){\n liFePO4 (durchmesser,hoehe);\n translate ([0,0, hoehe + 2]){\n liFePO4 (durchmesser,hoehe);\n }\n}\n \n\nmodule liFePO4 (durchmesser, hoehe) {\n color (\"Blue\"){\n cylinder (r = durchmesser \/2, h = hoehe); \n }\n color (\"Silver\"){\n translate ([0,0,-.1]){\n cylinder (r = durchmesser \/2 -2, h = hoehe +.2);\n } \n }\n}\n\n\n\n\n\/\/ Ein einfacher Ring\nmodule ring(aussenRadius, innenRadius, hoehe) {\n difference() {\n cylinder(r = aussenRadius, h = hoehe);\n translate([ 0, 0, -1 ]) cylinder(r = innenRadius, h = hoehe+2);\n }\n}\n\n\n\/\/ size is the XY plane size, height in Z\nmodule octagon(size, height) {\n intersection() {\n cube([size, size, height], true);\n rotate([0,0,45]) cube([size, size, height], true);\n }\n}\n\n\/\/ size is the XY plane size, height in Z\nmodule hexagon(size, height) {\n boxWidth = size\/1.75;\n for (r = [-60, 0, 60]) rotate([0,0,r]) cube([boxWidth, size, height], true);\n}\n\n\nmodule LEDSternBohrungen (radius, lochRadius, anzahl, tiefe){\n for ( i = [0 : anzahl] ) {\n rotate( i * 360 \/ anzahl + 1, [0, 0, 1]){\n translate ([radius ,0 , -0.1]){\n cylinder (h = tiefe + 0.1, r = lochRadius); \n } \n translate ([radius ,lochRadius * -1, -0.1]){\n cube ([lochRadius*2,lochRadius*2,tiefe]) ;\n }\n } \n }\n}\n\n\/\/ Zeichnet eine Reihe von Zylindern auf einem festgelegtem Radius.\n\/\/ Gut geeignet um auf einem Ring Bohrungen anzubringen.\nmodule bohrungenAufRadius (radius, lochRadius, anzahl, tiefe){\n for ( i = [0 : anzahl] ) {\n rotate( i * 360 \/ anzahl + 1, [0, 0, 1]){\n translate ([radius ,0 , -0.1]){\n cylinder (h = tiefe + 0.1, r = lochRadius); \n } \n } \n }\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'Backup-Lampe.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6b49d50203c2e17f6375bb1a83467bc977ab5039","subject":"finished lid","message":"finished lid\n","repos":"beckdac\/zynthian-build","old_file":"controller\/case\/controller-case.scad","new_file":"controller\/case\/controller-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\nOLEDWidth = 27.3;\nOLEDDisplayHeight = 19;\nOLEDScrewWidth = 20.7;\nOLEDScrewHeight = 23.2;\nOLEDScrewDiameter = 3;\nOLEDDepth = 1;\nOLEDDisplayDepth = 1;\nmodule display() {\n difference() {\n union() {\n cube([OLEDWidth, OLEDWidth, OLEDDepth]);\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, 1])\n cube([OLEDWidth, OLEDDisplayHeight, OLEDDisplayDepth]);\n }\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule pentagon_lid() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n translate([-OLEDWidth \/ 2, 0, 0]) rotate([0, 0, -18]) {\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, -.1])\n cube([OLEDWidth, OLEDDisplayHeight, boxThickness + .2]);\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n for (i = [3:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - ledButtonDiameter * 1.5, 0, -.1])\n momentary_button(color=\"red\");\n for (i = [3:4])\n rotate([0, 0, 180 + i * 72])\n translate([pentagonRadius - latchButtonDiameter * 2.2, 0, -.1])\n latch_button((i == 3 ? \"red\" : \"green\"));\n for (i = [0,2])\n rotate([0, 0, (i == 0 ? - 1 : 1) * 12 + i * 72])\n translate([pentagonRadius - latchButtonDiameter * 2.2, 0, -10])\n encoder();\n }\n\/\/ display();\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/translate([0, 0, boxHeight + boxThickness]) spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n \/\/pentagon_core();\n \/\/translate([0, 0, boxHeight + boxThickness]) \n pentagon_lid();\n \/\/display();\n}\n\ncase();\n","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ latch buttons\nlatchButtonDiameter = 13;\nlatchButtonHeight = 30;\nmodule latch_button(color=\"green\") {\n color(color)\n cylinder(h = latchButtonHeight, d = latchButtonDiameter, center = false);\n}\n\n\/\/ led momentary buttons\nledButtonDiameter = 25;\nledButtonHeight = 33;\nmodule momentary_button(color=\"white\") {\n color(color)\n cylinder(h = ledButtonHeight, d = ledButtonDiameter, center = false);\n}\n\n\/\/ encoders\nencoderShaftDiameter = 8;\nencoderShaftHeight = 18;\nencoderShaftOffset = 9;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderShaftOffset, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ string\nstringWallThickness = 1;\nstringRecess = 5;\nstringLength = 60;\nphotoresistorWidth = 5.5 + iFitAdjust_d;\nphotoresistorLength = photoresistorWidth;\nphotoresistorWireSep = 3.5;\nledLaserDiameter = 6.5 + iFitAdjust_d;\nledLaserLength = 10;\nwireCasingDepth = 3;\nstringWidth = ledLaserDiameter;\nmodule photoresistor_holder() {\n difference() {\n cylinder(h = stringRecess + stringWallThickness * 2, d = 2 * stringWallThickness + photoresistorWidth + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = stringRecess + stringWallThickness * 2 + 1, d = photoresistorWidth + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n rotate([0, 0, 180])\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule led_holder() {\n difference() {\n cylinder(h = ledLaserLength + stringWallThickness * 2, d = 2 * stringWallThickness + ledLaserDiameter + iFitAdjust_d, center = false);\n translate([0,0,-.1])\n cylinder(h = ledLaserLength + stringWallThickness * 2 + 1, d = ledLaserDiameter + iFitAdjust_d, center = false);\n \/*\n for (i = [-1,1])\n translate([i * photoresistorWireSep \/ 2, 0, -1])\n cylinder(h = 20, d = 1, center = false);\n *\/\n }\n translate([-(ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness)\/2, -(ledLaserDiameter )\/2 - 1, -(wireCasingDepth + stringWallThickness * 2)])\n difference() {\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter + ledLaserDiameter \/ 2 + 1, wireCasingDepth + stringWallThickness * 2], center=false);\n translate([stringWallThickness, stringWallThickness * 2 + 1, stringWallThickness])\n cube([ledLaserDiameter + iFitAdjust_d , ledLaserDiameter + ledLaserDiameter \/ 2 - stringWallThickness, wireCasingDepth], center=false);\n translate([ledLaserDiameter \/ 2 + stringWallThickness, ledLaserDiameter \/ 2 + stringWallThickness, stringWallThickness])\n cylinder(h=wireCasingDepth + 2 * stringWallThickness, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n}\nmodule string() {\n rotate([0, 0, 90])\n translate([0, -(wireCasingDepth + stringWallThickness * 2), ledLaserDiameter]) rotate([90, 0, 0])\n union() {\n photoresistor_holder();\n translate([0, 0, stringLength])\n rotate([180, 0, 0])\n led_holder();\n difference() {\n translate([-(ledLaserDiameter + 2 * stringWallThickness + iFitAdjust_d)\/2, - ledLaserDiameter, 0])\n cube([ledLaserDiameter + iFitAdjust_d + 2 * stringWallThickness, ledLaserDiameter \/ 2, stringLength ], center = false);\n cylinder(h=100, d = ledLaserDiameter + iFitAdjust, center=false);\n }\n }\n}\n\n\/\/ display\nOLEDWidth = 27.3;\nOLEDDisplayHeight = 19;\nOLEDScrewWidth = 20.7;\nOLEDScrewHeight = 23.2;\nOLEDScrewDiameter = 3;\nOLEDDepth = 1;\nOLEDDisplayDepth = 1;\nmodule display() {\n difference() {\n union() {\n cube([OLEDWidth, OLEDWidth, OLEDDepth]);\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, 1])\n cube([OLEDWidth, OLEDDisplayHeight, OLEDDisplayDepth]);\n }\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n}\n\nlidWidth = 100;\nlidThickness = 2.5;\nrowWidth = ledButtonDiameter + 10;\nlidLength = rowWidth * 2 + ledButtonDiameter \/ 2;\ncontrolOffset = 10;\nlidScrewDiameter = 3.5;\nlidScrewBoundaryOffset = 10;\nmodule spoke_lid() {\n union() {\n difference () {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0:1]) {\n translate([0, ledButtonDiameter + i * rowWidth, -lidThickness * 2]) {\n \/\/ led buttons\n translate([ledButtonDiameter \/ 2 + controlOffset, 0, 0])\n momentary_button();\n \/\/ encoders\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength \/ 4, 0, 0])\n rotate([0, 0, 270])\n encoder();\n \/\/ latch buttons\n translate([ledButtonDiameter \/ 2 + controlOffset + 2 * controlOffset + latchButtonDiameter \/ 2 + encoderLength + 5, 0, 0])\n latch_button();\n \n }\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n }\n }\n}\n\nmodule string_lid() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n }\n translate([lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n translate([lidWidth - lidScrewBoundaryOffset\/2, lidLength - lidScrewBoundaryOffset\/2, -.1])\n cylinder(h=lidThickness * 2, d=lidScrewDiameter);\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, -.01])\n rotate([0, 0, 90])\n hull() string();\n }\n for (i = [0:7])\n translate([15 + stringWidth * i * 1.5, 5, 0])\n rotate([0, 0, 90])\n string();\n }\n}\n\nboxHeight = 45;\nscrewTabDim = 10;\nboxThickness = lidThickness;\nboxWidth = lidWidth;\nboxLength = lidLength;\nboxScrewDiameter = lidScrewDiameter;\nmodule spoke_box() {\n difference() {\n union() {\n difference () {\n union() {\n cube([lidWidth, lidLength, lidThickness]);\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * lidWidth - i * screwTabDim, j * lidLength - j * screwTabDim, 0])\n cube([screwTabDim, screwTabDim, boxHeight]);\n }\n cube([boxWidth, boxThickness, boxHeight]);\n translate([0, boxLength - boxThickness, 0])\n cube([boxWidth, boxThickness, boxHeight]);\n cube([boxThickness, boxLength, boxHeight]);\n translate([boxWidth - screwTabDim, 0, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n }\n for (i = [0,1])\n for (j = [0,1]) {\n translate([i * boxWidth - i * screwTabDim + screwTabDim \/ 2, j * boxLength - j * screwTabDim + screwTabDim \/ 2, boxHeight - 9])\n cylinder(h=20, d = lidScrewDiameter);\n }\n for (i = [1, 2])\n translate([boxWidth - screwTabDim \/ 2, i * boxLength \/ 3, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, screwTabDim + .1, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([boxWidth - screwTabDim \/ 2, boxLength - boxThickness, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n }\n }\n}\n\npentagonRadius = boxLength \/ (2.0 * sin(180. \/ 5.));\npentagonR = (1\/10) * sqrt(25 + 10 * sqrt(5)) * boxLength;\nmodule pentagon_core() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 2 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 3 * 36])\n translate([pentagonR - screwTabDim, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n rotate([0, 0, 4 * 36])\n translate([-pentagonR, 0, 0])\n translate([0, -boxLength \/ 2, 0])\n cube([screwTabDim, boxLength, screwTabDim]);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - j * screwTabDim \/ 2, 0]) \n translate([0, 0, boxHeight\/2])\n cube([screwTabDim, screwTabDim, boxHeight], center=true);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([-pentagonR + screwTabDim \/ 2, 0, 0]) {\n translate([0, -boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n translate([0, boxLength \/ 3 \/ 2, boxThickness])\n cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n for (j = [-1, 1])\n translate([-pentagonR + screwTabDim \/ 2, j * boxLength \/ 2 - (j == -1 ? -1 * screwTabDim : screwTabDim \/ 4), 0]) \n translate([0, 0, (boxHeight \/ 3) * 2])\n rotate([90, 0, 0])\n #cylinder(h=screwTabDim + .1 - boxThickness, d=boxScrewDiameter);\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, boxHeight - 9.9])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule pentagon_lid() {\n difference() {\n union() {\n cylinder(h=boxThickness, r=pentagonRadius, $fn=5);\n }\n for (i = [0:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n translate([-OLEDWidth \/ 2, 0, 0]) rotate([0, 0, -18]) {\n translate([0, (OLEDWidth - OLEDDisplayHeight) \/ 2, -.1])\n cube([OLEDWidth, OLEDDisplayHeight, boxThickness + .2]);\n for (i = [0: 1])\n for (j = [0: 1])\n translate([(OLEDWidth - OLEDScrewWidth) \/ 2 + i * OLEDScrewWidth, (OLEDWidth - OLEDScrewHeight) \/ 2 + j * OLEDScrewHeight, -.1])\n cylinder(h=boxThickness + 1, d=OLEDScrewDiameter);\n }\n for (i = [3:4])\n rotate([0, 0, i * 72])\n translate([pentagonRadius - (screwTabDim \/ 3) * 2, 0, -.1])\n #cylinder(h=10, d=boxScrewDiameter);\n }\n\/\/ display();\n}\n\nmodule screw_tab() {\n difference() {\n cube([screwTabDim, 2 * screwTabDim, boxThickness]);\n for (i = [0,1])\n translate([screwTabDim \/ 2, screwTabDim \/ 2 + i * screwTabDim, -.1])\n cylinder(h=10, d=boxScrewDiameter);\n }\n}\n\nmodule case() {\n \/\/translate([0, 0, boxHeight + boxThickness]) spoke_lid();\n \/\/string_lid();\n \/\/spoke_box();\n \/\/screw_tab();\n \/\/pentagon_core();\n \/\/translate([0, 0, boxHeight + boxThickness]) \n pentagon_lid();\n \/\/display();\n}\n\ncase();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7cad750c26f52f4ec95620b3f6e1df8d6408cb8f","subject":"xaxis\/carriage: fix\/use hotend_mount_offset","message":"xaxis\/carriage: fix\/use hotend_mount_offset\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-hobbed_gear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \nuse \ninclude \ninclude \n\ninclude \n\n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/3;\nxaxis_carriage_padding = 2*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 8*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nhobbed_gear_d_outer = 12.65*mm;\nhobbed_gear_d_inner = 11.5*mm;\nhobbed_gear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 15*mm;\n\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -20*mm, 0];\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\nextruder_b_w = hobbed_gear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-21*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -70;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0],0,21*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + .2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = MHexNutM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule xaxis_carriage_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n cubea([length,width,width\/2], align=align);\n}\n\nmodule x_carriage(mode=undef, quad=false, beltpath_offset=0)\n{\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n bottom_width = quad ? top_width : xaxis_bearing[2] + 2*xaxis_carriage_padding;\n\n\n if(mode==undef)\n {\n difference()\n {\n x_carriage(mode=\"pos\");\n x_carriage(mode=\"neg\");\n }\n }\n else if(mode==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n }\n\n \/\/ to connect belt\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n else if(mode==\"neg\")\n {\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([0,xaxis_carriage_beltpath_offset_y+.1-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n xaxis_carriage_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width+10*mm, align=[0,1,0], orient=[1,0,0]);\n\n \/\/ to connect belt\n translate([0,-xaxis_beltpath_width,0])\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[beltpath_offset];\n translate([x*xaxis_carriage_beltfasten_dist, 0, z-sign(z)*(xaxis_beltpath_z_offset_pulley+1*mm)])\n {\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height_body\/4], align=[0,1,sign(z)]);\n }\n }\n }\n }\n }\n else if(mode==\"vit\")\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n for(i=quad?[-1,1]:[0])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);\n }\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n for(i=[-1,1])\n rotate([0,i*extruder_motor_mount_angle,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n cylindera(d=15*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n translate(extruder_gear_big_offset)\n translate([0,extruder_gear_big_h[0],0])\n translate([1,extruder_gear_big_h[1]\/2+1*mm,0])\n for(i=[0:6])\n rotate([0,20+i*-35,0])\n cylindera(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n translate([0,-extruder_gear_big_h[1],0])\n {\n translate([0,2*mm,0])\n cylindera(d=extruder_gear_big_OD+2*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,-.1,0])\n cylindera(d=10.25*mm+2*mm, h=extruder_gear_big_h[1]+.2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=10*mm, orient=[0,1,0], align=[0,1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-5*mm;\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MKnurlInsertNutM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(nut=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ gear support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, orient=[0,1,0], align=[0,1,0], round_radius=2);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+3*mm, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(extruder_filapath_offset)\n translate([0,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_filapath_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_filapath_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/* support for clamp mount screw holes*\/\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n\n \/\/ guidler cutout\n translate(extruder_filapath_offset)\n \/*translate(extruder_filapath_offset-[,0,0])*\/\n translate([-.1,-hobbed_gear_h\/2-.5*mm,0])\n translate(-[hobbed_gear_d_inner,0,0])\n {\n s=[hobbed_gear_d_inner,hobbed_gear_h+5*mm,hobbed_gear_d_inner];\n cubea(s, align=[0,1,0]);\n }\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([hobbed_gear_d_inner\/2+3,0,0])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_filapath_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n cylindera(\n h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+1.1*mm,\n d=hobbed_gear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,-1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ gear cutout\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ gear cutout\n cylindera(h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ extruder shaft\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([-.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n hotmount_clamp();\n\n translate([-0.1,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(show_vitamins=false, beltpath_offset=0)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/*x_carriage(mode=\"pos\");*\/\n\n union()\n {\n x_carriage(mode=\"pos\", beltpath_offset=beltpath_offset);\n }\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n\n x_carriage(mode=\"neg\", beltpath_offset=beltpath_offset);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+2*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=MHexNutM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=MKnurlInsertNutM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n x_carriage(mode=\"vit\");\n }\n}\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_filapath_offset)\n attach([[0,0,0]], hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+hobbed_gear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = MHexNutM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 11*mm;\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\n if(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-95,53,20])\n rotate([-152,0,0])\n import(\"stl\/E3D_40_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n translate([-123.5,78.5,-54])\n rotate([0,0,-90])\n import(\"stl\/E3D_30_mm_Duct.stl\");\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n x_extruder_hotend();\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nif(false)\n{\n x_carriage_withmounts(show_vitamins=true);\n\n x_carriage_extruder(show_vitamins=true);\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_thickness, z])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_offset=offset);*\/\n\n rotate([-90,0,0])\n {\n \/*extruder_a();*\/\n\n \/*extruder_a(part=\"support\");*\/\n \/*%extruder_a(part=\"vit\");*\/\n }\n\n rotate([-90,0,0])\n {\n \/*extruder_b(with_sensormount=true);*\/\n }\n\n \/*guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; *\/\n \/*attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)*\/\n \/*{*\/\n \/*extruder_guidler(show_vit=false);*\/\n \/*}*\/\n\n \/*hotmount_clamp();*\/\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"d65b04c12485cfa7fde26147798855f558088534","subject":"x\/carriage\/extruder\/a: disable heatsink and fan","message":"x\/carriage\/extruder\/a: disable heatsink and fan\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n if(false)\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n if(false)\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=true);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","old_contents":"include \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\ninclude ;\ninclude ;\ninclude \ninclude \n\nmodule x_extruder_hotend()\n{\n material(Mat_Aluminium)\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ official 30mm duct\n \/*ty(-22)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/V6.6_Duct.stl\");*\/\n\n \/*ty(-21.5)*\/\n \/*rotate(180*Y)*\/\n \/*import(\"stl\/30mm_Clamp.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(27)*\/\n \/*tz(-44)*\/\n \/*ty(38)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_SN04.stl\");*\/\n\n \/*mirror(Z)*\/\n \/*tx(10)*\/\n \/*tx(37)*\/\n \/*tz(-43.6)*\/\n \/*ty(34)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(270*Y)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015.stl\");*\/\n\n \/*tx(10) \/\/ E3D fan thickness*\/\n \/*tx(-12.7)*\/\n \/*ty(22)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_mod.stl\");*\/\n\n tz(0)\n tx(24.5)\n ty(-7.5)\n ry(90)\n ry(180)\n import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");\n\n tt = 10*mm; \/\/ E3D fan thickness\n\n tx(tt)\n tx(-5.7)\n ty(28)\n rx(90)\n import(\"extras\/Fang_5015_40mm_v4 - Copy.stl\");\n\n \/\/ E3D fan\n tx(7.2)\n tx(tt)\n tx(12.5*mm)\n ty(-6*mm)\n {\n d=40*mm;\n difference()\n {\n cubea([tt,d,d]);\n cylindera(d=d-5*mm, h=1000, orient=X);\n\n for(x=[-1,1])\n for(y=[-1,1])\n tz(x*(d\/2 - 3.5*mm))\n ty(y*(d\/2 - 3.5*mm))\n screw_cut(thread=extruder_hotend_clamp_thread, h=12*mm, orient=-X, align=-X);\n }\n }\n\n \/*tx(25)*\/\n \/*ty(-7)*\/\n \/*rotate(-90*Y)*\/\n \/*import(\"stl\/Custom_E3D_V6_40mm_Fan_V2.stl\");*\/\n\n \/*[>tx(10)<]*\/\n \/*tx(22)*\/\n \/*tz(-56)*\/\n \/*ty(49)*\/\n \/*rotate(-22*Z)*\/\n \/*rotate(90*X)*\/\n \/*import(\"stl\/Radial_Fan_Fang_5015_for_40mm_thicker.stl\");*\/\n\n}\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing_top_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=Y);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom_OD+xaxis_carriage_padding+ziptie_bearing_distance*2], align=Y);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n position(extruder_b_mount_offsets)\n rcylindera(r=4*mm, align=Y, orient=Y);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-Y*extruder_offset_a[1])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=Y, align=Y);\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size_switch, align=ZAXIS+XAXIS, extra_size=Y*(xaxis_carriage_beltpath_offset_y-xaxis_endstop_size_switch.y\/2), extra_align=-Y);\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n \/*proj_extrude_axis(axis=Y, offset=xaxis_carriage_beltpath_offset_y)*\/\n rcylindera(d=12*mm, h=20*mm, orient=XAXIS, align=XAXIS);\n }\n }\n else if(part==\"neg\")\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror(X)\n {\n belt_fastener(\n part=part,\n width=55*mm,\n belt=xaxis_belt,\n belt_width=xaxis_belt_width,\n belt_dist=xaxis_pulley_inner_d,\n thick=xaxis_carriage_thickness,\n with_tensioner=beltpath_sign==sign(z)\n );\n }\n }\n else if(part==\"vit\")\n {\n }\n\n \/\/ bearing mount top\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_top))\n translate([x,xaxis_bearing_top_OD\/2+xaxis_carriage_bearing_offset_y,xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_top, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n\n \/\/ bearing mount bottom\n \/*tx(-20)*\/\n for(x=spread(-xaxis_carriage_bearing_distance\/2,xaxis_carriage_bearing_distance\/2,xaxis_bearings_bottom))\n translate([x,xaxis_bearing_bottom_OD\/2+xaxis_carriage_bearing_offset_y,-xaxis_rod_distance\/2])\n linear_bearing_mount(part=part, bearing=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=X, align=-sign(x)*X, mount_dir_align=Y);\n}\n\nmodule extruder_gear_small(orient, align)\n{\n material(Mat_Steel)\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=orient, align=align);\n cylindera(d=10*mm, h= 3*mm, orient=orient, align=align);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=orient, align=align);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=orient, align=align);\n }\n}\n\n\nmodule extruder_gear_big(align=N, orient=Z)\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n material(Mat_Steel)\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=Z)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=Z, align=Z);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=Z, align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=Z, align=N);\n }\n}\n\n\nmodule extruder_a_motor_mount(part)\n{\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n\n if(part==\"pos\")\n material(Mat_Plastic)\n ry(extruder_motor_mount_angle)\n {\n \/\/ mounts\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=Y, align=Y);\n\n \/\/ motor mounts support\n \/\/ screws for mounting motor\n hull()\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n rcylindera(d=get(ThreadSize, motor_thread)+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n else if(part==\"neg\")\n ry(extruder_motor_mount_angle)\n {\n \/\/ round dia\n translate([0,extruder_a_h,0])\n translate([0, .1, 0])\n {\n cylindera(h=2*mm, d=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), orient=Y, align=[0,-1,0]);\n\n translate(-Y*(2*mm-0.01))\n cylindera(h=extruder_a_h\/2, d1=1.1*lookup(NemaRoundExtrusionDiameter, extruder_motor), d2=lookup(NemaRoundExtrusionDiameter, extruder_motor)*mm\/1.5, orient=-Y, align=-Y);\n\n translate([0,-2*mm+.1-extruder_a_h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, extruder_motor), h=extruder_a_h\/2, orient=Y, align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, extruder_motor), h=lookup(NemaFrontAxleLength, extruder_motor)+2*mm, orient=Y, align=[0,-1,0]);\n }\n\n position(extruder_a_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n\n \/\/ screws for mounting motor\n translate(-Y*3*mm)\n translate(Y*extruder_a_h)\n for(x=[-1,1])\n for(z=[-1,1])\n tx(x*extruder_motor_holedist\/2)\n tz(z*extruder_motor_holedist\/2)\n screw_cut(nut=motor_nut, h=6*mm, with_nut=false, head_embed=false, orient=Y, align=Y);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n %extruder_a(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/*hull()*\/\n {\n \/\/ create a base plate\n hull()\n {\n intersection()\n {\n extruder_a_motor_mount(part=part);\n translate([0,extruder_a_h,0])\n cubea(size=[1000,extruder_a_base_h,1000], align=-Y);\n }\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n rcylindera(d=extruder_a_bearing[1]+6*mm, h=extruder_a_base_h, orient=Y, align=-Y);\n }\n\n extruder_a_motor_mount(part=part);\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*rcylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=Y, align=Y);*\/\n\n }\n }\n else if(part==\"neg\")\n {\n extruder_a_motor_mount(part=part);\n\n \/\/cutouts for access to small gear tightscrew\n \/*rotate([0,extruder_motor_mount_angle,0])*\/\n \/*for(i=[-1,10])*\/\n \/*rotate([0,i*90,0])*\/\n \/*translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])*\/\n \/*translate([0,extruder_a_h,0])*\/\n \/*teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=Z, roll=90, align=[0,0,-1]);*\/\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=X, align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=Y, align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"vit\")\n {\n extruder_a_motor_mount(part=part);\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n translate(-Y*.5*mm)\n extruder_gear_small(orient=Y, align=-Y);\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n ty(-1*mm)\n extruder_gear_big(orient=-Y, align=-Y);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=Y, align=[0,-1,0]);\n\n cylindera(h=extruder_shaft_len, d=extruder_shaft_d, orient=Y, align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=Y);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=Y);\n cylindera(d=38*mm, h=10*mm+.1, orient=Y, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\nmodule hotend_cut(extend_cut=false, extend_cut_amount = 1000)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotend_d_h,1);\n for(e=v_itrlen(hotend_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotend_d_h[e][0]*hotend_tolerance;\n h=hotend_d_h[e][1]*hotend_tolerance;\n cylindera(d=d,h=h,align=Z);\n if(extend_cut)\n {\n cubea([d, extend_cut_amount, h], align=-Y+Z);\n }\n }\n }\n}\n\nmodule hotend_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotend_clamp(part=\"pos\");\n hotend_clamp(part=\"neg\");\n }\n %hotend_clamp(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n t(hotend_clamp_offset)\n {\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n }\n}\n\nmodule hotend_clamp_cut()\n{\n \/\/ clamp mount screw holes\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n t(hotend_clamp_offset)\n screw_cut(thread=extruder_hotend_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=Y, align=Y);\n\n \/\/ hotend clamp cutout\n t(hotend_clamp_offset)\n ty(2*mm)\n rcubea([hotend_clamp_w[0], hotend_clamp_thickness, hotend_clamp_height], align=Y, extra_size=[0,100,.2], extra_align=[0,-1,0]);\n\n hotend_cut(extend_cut = true);\n}\n\nmodule extruder_b(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\");\n extruder_b(part=\"neg\");\n }\n %extruder_b(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n \/\/ main body\n hull()\n {\n position(extruder_b_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=Y, align=[0,-1,0]);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n rcylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1]), orient=Y, align=N);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n ty(1*mm)\n rcylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=Y, align=-Y);\n\n \/\/ guidler screw nuts support\n t(extruder_b_filapath_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n rcylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=X);\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n rcylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n\n \/\/ hotend support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotend_outer_size_xy, hotend_outer_size_h], align=[0,0,-1]);\n\n ty(-extruder_b_drivegear_offset[1])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotend_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n tz(-hotend_d_h[0][1]-hotend_d_h[1][1]\/2)\n for(x=[-1,1])\n tx(x*hotend_clamp_screws_dist)\n {\n d = lookup(ThreadSize, extruder_hotend_clamp_thread)+8*mm;\n rcubea([d, extruder_b_w, d]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n translate([0, -extruder_b_mount_thick, 0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=Y, align=Y);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n tx(-extruder_drivegear_d_inner)\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_outer+3*mm];\n rcubea(s, align=[0,0,0], extra_size=[100,3*mm,2*mm], extra_align=Y-X+Z);\n }\n\n union()\n {\n guidler_w_cut = guidler_w+6*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n t(extruder_b_filapath_offset)\n \/*translate(extruder_guidler_mount_off)*\/\n translate(3*mm*X)\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=X+Z);\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=Y, align=N);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n t(-guidler_mount_off)\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=Y, align=N);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[0]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=Y, align=N);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=Y, align=N);\n }\n\n ty(guidler_w_cut\/2)\n \/*ty(-extruder_b_drivegear_offset[1])*\/\n \/*ty(-extruder_b_mount_thickness\/2])*\/\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3.5*mm, h=guidler_w_cut_ext, orient=Y, align=-Y);\n tz(-guidler_screws_thread_dia)\n cubea([100,guidler_w_cut_ext,100], align=X-Y+Z);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=Y);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n t(extruder_b_filapath_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=X);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, cut_screw=false, trap_axis=-Z, orient=X, align=-X);\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=Y);\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=Y,\n align=Y\n );\n\n \/\/ filament path\n translate(extruder_b_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=Z, align=Z);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=Z, align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n ty(-extruder_b_bearing[2]\/2)\n ty(-1*mm)\n cylindera(d=extruder_b_bearing[1]+.2*mm, h=extruder_b_bearing[2]+1000, align=Y, orient=Y);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=Y, align=Y);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotend_clamp(part=part, $show_vit=false);\n hotend_clamp_cut($show_vit=false);\n }\n }\n else if(part==\"vit\")\n {\n translate(extruder_b_bearing_offset)\n {\n bearing(bearing_type=extruder_b_bearing, orient=Y, align=N);\n\n material(Mat_Aluminium)\n ty(-extruder_b_bearing[2]\/2)\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=Y, align=Y);\n }\n\n translate(extruder_b_drivegear_offset)\n extruder_drivegear();\n\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n tz(-hotend_height)\n t(hotend_mount_offset)\n {\n cylindera(h=10, d=filament_d, align=-Z);\n\n translate(sensormount_sensor_hotend_offset)\n cylindera(h=10, d=filament_d, align=-Z);\n }\n }\n}\n\nmodule extruder_drivegear()\n{\n material(Mat_Aluminium)\n {\n cylindera(h=extruder_drivegear_drivepath_h, d=extruder_drivegear_d_inner, orient=Y, align=N);\n\n translate([0,extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2, d=extruder_drivegear_d_outer, orient=Y, align=Y);\n\n translate([0,-extruder_drivegear_drivepath_h\/2,0])\n cylindera(h=extruder_drivegear_h-extruder_drivegear_h\/2+extruder_drivegear_drivepath_offset\/2-extruder_drivegear_drivepath_h\/2-extruder_drivegear_drivepath_h, d=extruder_drivegear_d_outer, orient=Y, align=-Y);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, beltpath_sign, with_sensormount)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n x_carriage_withmounts(part=\"neg\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n\n %x_carriage_withmounts(part=\"vit\", beltpath_sign=beltpath_sign, with_sensormount=with_sensormount);\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n\n \/\/ extruder A mount\n material(Mat_Plastic)\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n rcylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=Y, align=[0,-1,0]);\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=Y, align=N);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n rotate([0,extruder_motor_mount_angle,0])\n position(extruder_a_mount_offsets)\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=Y,\n align=Y\n );\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n position(extruder_b_mount_offsets)\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=Y, align=Y);\n\n \/\/ endstop bumper for physical switch endstop\n translate([0,xaxis_carriage_beltpath_offset_y,0])\n if(xaxis_endstop_type == \"SWITCH\")\n {\n }\n else if(xaxis_endstop_type == \"SN04\")\n {\n translate(xaxis_endstop_SN04_pos)\n screw_cut(nut=NutHexM5, h=10*mm, head_embed=true, with_nut=false, orient=X, align=X);\n }\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n if(with_sensormount)\n t(extruder_offset)\n attach(extruder_carriage_sensormount_conn, sensormount_conn)\n {\n sensormount(part, align=-Y);\n }\n }\n}\n\nmodule extruder_guidler(part)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n %extruder_guidler(part=\"vit\");\n }\n else if(part==\"pos\")\n material(Mat_Plastic)\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X);\n\n \/\/ guidler bearing bolt holder\n rcylindera(d=guidler_bolt_mount_d, h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n rcubea([guidler_d, guidler_w, guidler_h], align=-X, extra_size=[0,0,guidler_extra_h_up], extra_align=Z);\n\n \/\/ guidler mount point\n t(guidler_mount_off)\n rcylindera(d=guidler_mount_d,h=guidler_w, orient=Y);\n }\n\n hull()\n {\n \/\/ guidler main block\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(guidler_h)\n rcubea([guidler_d, guidler_w, 1], align=-X);\n\n \/\/ guidler screws mount\n for(y=[-1,1])\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n ty(y*(guidler_screws_distance))\n tz(extruder_b_guidler_screw_offset_h)\n rcylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=-X, orient=-X);\n\n \/\/ tab above screw mount, for easier open\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3)\n rcylindera(r=5*mm,h=guidler_d\/2, align=-X, orient=-X);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(y=[-1,1])\n ty(y*(guidler_screws_distance))\n tx(guidler_mount_off[0]+guidler_mount_d\/2)\n tz(extruder_b_guidler_screw_offset_h)\n {\n \/\/ offset for spring\n tx(7*mm)\n screw_cut(thread=guidler_screws_thread, h=30*mm, orient=-X, align=-X);\n\n r = guidler_screws_thread_dia\/2*1.1;\n cubea([guidler_d,r*2,r], align=-X, extra_size=X*.2*mm);\n\n for(v=[-1,1])\n tz(v*r\/2)\n cylindera(r=r, h=guidler_d, align=-X, orient=-X, extra_h=.2*mm);\n }\n\n mount_tolerance = .5*mm;\n\n \/\/ cutout middle mount point pivot\n t(guidler_mount_off)\n cylindera(d=guidler_mount_d+2*mm, h=guidler_mount_w+mount_tolerance, orient=Y);\n\n \/\/ mount screw hole\n t(guidler_mount_off)\n ty(-guidler_w\/2)\n screw_cut(thread=guidler_screws_thread, head=\"button\", h=16*mm, orient=Y, align=Y);\n\n \/\/ guidler bearing screw holder cutout\n ty(-guidler_w\/2)\n screw_cut(thread=ThreadM3, head=\"button\", h=guidler_w, orient=Y, align=Y);\n\n \/\/ guidler bearing cutout\n bearing_mount_bump = .6*mm;\n bearing_cut_w = guidler_bearing[2]+2*bearing_mount_bump;\n difference()\n {\n cylindera(d=guidler_bearing[1]+3*mm, h=bearing_cut_w, orient=Y);\n\n \/\/ add some bumps to avoid bearing grinding on walls\n for(y=[-1,1])\n ty(y*bearing_cut_w\/2)\n ty(-y*bearing_mount_bump)\n mirror([0,max(0,y),0])\n cylindera(d2=guidler_bearing[0]+.8*mm, d1=guidler_bolt_mount_d, h=1, orient=Y, align=-Y);\n }\n }\n else if(part==\"vit\")\n {\n \/\/ filament path\n material(Mat_filament)\n tx(-guidler_bearing[1]\/2)\n tx(extruder_filament_bite)\n cylindera(d=filament_d, h=1000*mm, align=-X);\n\n bearing(guidler_bearing, orient=Y);\n\n \/\/ bearing bolt\n material(Mat_Chrome)\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=Y);\n }\n}\n\nmodule sensormount(part=undef, align=N)\n{\n if(part==U)\n {\n difference()\n {\n sensormount(part=\"pos\", align=align);\n sensormount(part=\"neg\", align=align);\n }\n %sensormount(part=\"vit\", align=align);\n }\n else if(part == \"pos\")\n material(Mat_Plastic)\n {\n rcubea(size=sensormount_size, align=Y);\n }\n else if(part == \"neg\")\n {\n \/*cubea(s=[11,11,11]);*\/\n ty(-14*mm)\n for(x=[-1,1])\n tx(x*5.5*mm)\n screw_cut(nut=NutKnurlM3_5_42, h=20*mm, with_nut=true, orient=Y, align=Y);\n }\n else if(part == \"vit\")\n {\n \/*tz(8)*\/\n \/*rcubea(size=[17.8*mm,sensormount_thickness,35.7*mm], align=-Y-Z);*\/\n\n translate([-8.8,0,8])\n rotate(X*90)\n rotate(Z*180)\n import(\"stl\/SN04-N_Inductive_Proximity_Sensor_3528_0.stl\");\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1, with_sensormount=true);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b();\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror(X)\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror(X)\n extruder_b();\n}\n\nmodule part_x_carriage_hotend_clamp()\n{\n tz(hotend_d_h[1][1]\/2)\n tz(hotend_d_h[0][1]+hotend_d_h[1][1]\/2)\n hotend_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ guidler_mount_off - X*(-guidler_mount_d\/2), -X]; \n attach([[0*mm,0*mm,0],Z], guidler_conn_layflat)\n {\n extruder_guidler();\n }\n}\n\nexplode=N;\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full()\n{\n x_carriage_withmounts();\n\n x_carriage_extruder();\n}\n\nmodule x_carriage_extruder()\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n extruder_a();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n extruder_b();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n translate(hotend_mount_offset)\n hotend_clamp();\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_offset_b)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll, Y)\n extruder_guidler();\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n x_extruder_hotend();\n\n \/\/filament path\n translate([explode[0],-explode[1],explode[2]])\n material(Mat_PlasticBlack)\n translate(extruder_offset_b)\n translate(extruder_b_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=Z, align=N);\n }\n}\n\nmodule xaxis_end_bucket(part)\n{\n s=[60,60,30];\n\n if(part==U)\n {\n difference()\n {\n xaxis_end_bucket(part=\"pos\");\n xaxis_end_bucket(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n material(Mat_Plastic)\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n translate(X*100)\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s, align=-Z);\n }\n else if(part==\"neg\")\n {\n tz(extruder_offset.z)\n tz(extruder_offset_b.z)\n tz(-hotend_height)\n t(hotend_mount_offset)\n \/*translate(-Z*xaxis_end_wz\/2)*\/\n\n translate(X*100)\n \/*translate(-Y*xaxis_carriage_beltpath_offset_y)*\/\n \/*translate(Y*extruder_joffset_b.y)*\/\n translate(Y*extruder_b_filapath_offset.y)\n rcubea(size=s-[3,3,3], align=-Z, extra_size=1000*Z, extra_align=Z);\n }\n}\n\n\/*if(false)*\/\n{\n \/*if(false)*\/\n for(x=[-1])\n \/*for(x=[-1,1])*\/\n translate(x*40*mm*X)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(beltpath_sign=x, with_sensormount=true);\n\n x_carriage_extruder();\n }\n\n if(false)\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate(90*X)\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=X, align=X);\n\n if(false)\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n\n xaxis_end_bucket();\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"4092d5d0309075ceda4b36b179aa3ebfc49bdff3","subject":"top+bottom part with fixed sizes","message":"top+bottom part with fixed sizes\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"trousers_button\/button.scad","new_file":"trousers_button\/button.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"428e9d157a758d660cd7f67f0a64685cb0b0c6fb","subject":"Very rough version of a pivoting filter holder","message":"Very rough version of a pivoting filter holder\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"fan-filter-pivot\/fan-filter-pivot.scad","new_file":"fan-filter-pivot\/fan-filter-pivot.scad","new_contents":"module thin_wall_cube(dims, thick=1) {\n \/* centers in XY *\/\n inner_dim0 = dims[0] - thick * 2;\n inner_dim1 = dims[1] - thick * 2;\n difference() {\n translate([-dims[0]\/2,-dims[1]\/2,0])\n cube(dims);\n translate([-inner_dim0\/2,-inner_dim1\/2,-1])\n cube([inner_dim0, inner_dim1, dims[2] + 2]);\n }\n}\n\nmodule arrow(l=10, w=3, r=1) {\n \/* stem *\/\n hull() {\n circle(r=r);\n translate([0,-l]) circle(r=r);\n }\n \/* left *\/\n hull() {\n circle(r=r);\n translate([-w, -w]) circle(r=r);\n }\n \/* right *\/\n hull() {\n circle(r=r);\n translate([w, -w]) circle(r=r);\n }\n}\n \n\nunion () {\n thin_wall_cube([10,12,7]);\n translate([0,6.2,5]) rotate([90,0,0])\n linear_extrude(height=1)\n arrow(l=4,$fn=16);\n}\n\n\/* back leg *\/\ntranslate([-3.5,-4.5,-20])\n cube([7,5,40]);\n\/* back top retainer *\/\ntranslate([-3.5,-6,15])\n cube([7,4,5]);\n\/* back piece *\/\ntranslate([-130\/2,-6,-131])\n cube([130,6.5,130]);\n\n\/* front leg *\/\ntranslate([-3.5,1,-20])\n cube([7,3.5,28]);\n\/* front piece *\/\ntranslate([-130\/2,2,-131])\n cube([130,6.5,130]);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fan-filter-pivot\/fan-filter-pivot.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"fd6bf2d2e093bafb357eb0d3c2c93c94ca5ef8ae","subject":"main+config: add x carriage park option","message":"main+config: add x carriage park option\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1* axis_range_x_,-1*axis_range_x_+x_carriage_w];\naxis_printrange_x = [-1\/2, 1\/2] * printbed_size[0];\naxis_x_parked = [true, false];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : -axis_printrange_x[x];\n\n translate([pos,0,0])\n mirror([x==0?0:1,0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x==0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \nuse \ninclude \nuse \nuse \nuse \n\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 + zmotor_mount_rod_offset_x - xaxis_end_width(true) - x_carriage_w\/2;\naxis_range_x = [-1,1] * axis_range_x_;\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[90*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n\n\n for(x=axis_range_x)\n translate([x,0,0])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n mirror([min(0,-x),0,0])\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_withmounts(show_vitamins=true, beltpath_offset=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<=0);\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n {\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n yaxis_carriage_size_inner = [32*mm,32*mm,0];\n\n \/\/ y axis plate \"arms\"\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*yaxis_carriage_size[1]\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-yaxis_carriage_size_inner[0]\/2), y*(yaxis_carriage_size[1]\/2-yaxis_carriage_size_inner[1]\/2*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n \/\/ y axis plate\n cubea(yaxis_carriage_size - yaxis_carriage_size_inner, align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(printbed_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n translate(-zaxis_rod_offset)\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=[0,1,0]);\n\n if(!preview_mode)\n {\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"abafe326941f42dae6daf7ed964b324169eb3290","subject":"fix: set the default height to 1 if none supplied to the link shape","message":"fix: set the default height to 1 if none supplied to the link shape\n","repos":"jsconan\/camelSCAD","old_file":"shape\/3D\/rounded.scad","new_file":"shape\/3D\/rounded.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rounded shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a 3D rounded shape.\n *\n * @param Number|Vector [r] - The radius of the rounded part or a vector that contains radius for each dimensions.\n * @param Number|Vector [d] - The diameter of the rounded part or a vector that contains diameters for each dimensions.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns the radius vector.\n *\/\nfunction sizeRounded3D(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n d.x && !rx ? d.x \/ 2 : r.x,\n d.y && !ry ? d.y \/ 2 : r.y,\n d.z && !rz ? d.z \/ 2 : r.z\n ]\n;\n\n\/**\n * Computes the size of an arch box.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeArchBox(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y),\n divisor(s.z)\n ],\n horRadius = size.x \/ 2,\n radius = [\n horRadius,\n min(size.y, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a stadium shape.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeSlot(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y * 2),\n divisor(s.z)\n ],\n horRadius = size.x \/ 2,\n radius = [\n horRadius,\n min(size.y \/ 2, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a cushion shape.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeCushion(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y * 2),\n divisor(s.z)\n ],\n radius = [\n min(size.x \/ 2, c.x),\n min(size.y \/ 2, c.y)\n ]\n )\n [ size, radius.x && radius.y ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y)\n ],\n horRadius = max(size.x, size.y) \/ 2,\n radius = [\n horRadius,\n min(size.z, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y * 2)\n ],\n horRadius = max(size.x, size.y) \/ 2,\n radius = [\n horRadius,\n min(size.z \/ 2, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y * 2)\n ],\n radius = [\n min(max(size.x, size.y) \/ 2, c.x),\n min(size.z \/ 2, c.y)\n ]\n )\n [ size, radius.x && radius.y ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y * 2)\n ],\n verRadius = size.z \/ 2,\n radius = [\n min(max(size.x, size.y) \/ 2, or(c.x, verRadius)),\n verRadius\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the points that draw the sketch of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size.z - radius.y\n ],\n points = arc(r=radius, o=center, a=RIGHT)\n )\n complete(points, [radius.x, 0], [0, 0])\n;\n\n\/**\n * Computes the points that draw the sketch of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size.z \/ 2 - radius.y\n ]\n )\n center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :concat(\n arc(r=radius, o=-center, a=RIGHT, a1=-RIGHT),\n arc(r=radius, o=center, a=RIGHT)\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n right = max(size.x, size.y) \/ 2,\n top = size.z \/ 2,\n center = [\n right - radius.x,\n top - radius.y\n ]\n )\n radius == [0, 0] ? [ [right, top], [0, top], [0, -top], [right, -top] ]\n :center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :complete(\n concat(\n arc(r=radius, o=[center.x, -center.y], a1=QUADRANT_3, a2=QUADRANT_4),\n arc(r=radius, o=center, a1=0, a2=QUADRANT_1)\n ),\n [0, -top],\n [0, top]\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n max(size.x, size.y) \/ 2 - radius.x, 0\n ],\n points = arc(r=radius, o=center, a1=-RIGHT, a2=RIGHT)\n )\n center == [0, 0] ? points\n :complete(points, -[0, radius.y], [0, radius.y])\n;\n\n\/**\n * Creates an arch box at the origin.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule archBox(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeArchBox(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n arch(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a slot shape at the origin.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule slot(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeSlot(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n stadium(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a cushion shape at the origin.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule cushion(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeCushion(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n roundedRectangle(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a bullet shape at the origin.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule bullet(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawBullet(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a pill shape at the origin.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pill(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPill(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a peg shape at the origin.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule peg(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPeg(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a plate shape at the origin.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule plate(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPlate(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a rounded corner wedge at the origin.\n * For now the function can only handle square corner.\n *\n * @param Number [size] - The size of the corner.\n * @param Number [r] - The radius of the round.\n * @param Number [h] - The height of the solid.\n * @param Number [d] - The diameter of the round.\n * @param String|Vector [p] - The position of the corner, as a cardinal point (default: \"ne\", aka North East).\n * @param Boolean [convex] - Whether makes a convex corner (default: false).\n * @param Number [adjust] - An adjust value added to the size in order to fix wall alignment issue.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule roundedCornerWedge(size, r, h, d, p, convex, adjust, center) {\n linear_extrude(height=divisor(h), center=center, convexity=10) {\n roundedCorner(size=size, r=r, d=d, p=p, convex=convex, adjust=adjust);\n }\n}\n\n\/**\n * Draws a link.\n * @param Vector|Number neck - The size of the link neck.\n * @param Vector|Number bulk - The size of the link bulb.\n * @param Number Height - The thickness of the link.\n * @param Number [w] - The width of the neck.\n * @param Number [h] - The height of the neck.\n * @param Number [rx] - The horizontal radius of the bulb.\n * @param Number [ry] - The vertical radius of the bulb.\n * @param Number [dx] - The horizontal diameter of the bulb.\n * @param Number [dy] - The vertical diameter of the bulb.\n * @param Number [distance] - An additional distance added to the outline of the profile.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule link(neck, bulb, height, w, h, rx, ry, dx, dy, distance = 0, center=false) {\n linear_extrude(height=divisor(height), center=center, convexity=10) {\n linkProfile(\n neck = neck,\n bulb = bulb,\n w = w,\n h = h,\n rx = rx,\n ry = ry,\n dx = dx,\n dy = dy,\n distance = distance\n );\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2022 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Rounded shapes.\n *\n * @package shape\/3D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of a 3D rounded shape.\n *\n * @param Number|Vector [r] - The radius of the rounded part or a vector that contains radius for each dimensions.\n * @param Number|Vector [d] - The diameter of the rounded part or a vector that contains diameters for each dimensions.\n * @param Number [rx] - The length radius.\n * @param Number [ry] - The width radius.\n * @param Number [rz] - The height radius.\n * @param Number [dx] - The length diameter.\n * @param Number [dy] - The width diameter.\n * @param Number [dz] - The height diameter.\n * @returns Vector - Returns the radius vector.\n *\/\nfunction sizeRounded3D(r, d, rx, ry, rz, dx, dy, dz) =\n let(\n r = apply3D(r, rx, ry, rz),\n d = apply3D(d, dx, dy, dz)\n )\n [\n d.x && !rx ? d.x \/ 2 : r.x,\n d.y && !ry ? d.y \/ 2 : r.y,\n d.z && !rz ? d.z \/ 2 : r.z\n ]\n;\n\n\/**\n * Computes the size of an arch box.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeArchBox(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y),\n divisor(s.z)\n ],\n horRadius = size.x \/ 2,\n radius = [\n horRadius,\n min(size.y, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a stadium shape.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeSlot(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y * 2),\n divisor(s.z)\n ],\n horRadius = size.x \/ 2,\n radius = [\n horRadius,\n min(size.y \/ 2, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a cushion shape.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeCushion(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.y * 2),\n divisor(s.z)\n ],\n radius = [\n min(size.x \/ 2, c.x),\n min(size.y \/ 2, c.y)\n ]\n )\n [ size, radius.x && radius.y ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizeBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y)\n ],\n horRadius = max(size.x, size.y) \/ 2,\n radius = [\n horRadius,\n min(size.z, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y * 2)\n ],\n horRadius = max(size.x, size.y) \/ 2,\n radius = [\n horRadius,\n min(size.z \/ 2, or(c.y, horRadius))\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the size of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y * 2)\n ],\n radius = [\n min(max(size.x, size.y) \/ 2, c.x),\n min(size.z \/ 2, c.y)\n ]\n )\n [ size, radius.x && radius.y ? radius : [0, 0] ]\n;\n\n\/**\n * Computes the size of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[] - Returns an array containing the size vector and the radius vector.\n *\/\nfunction sizePlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n s = apply3D(size, l, w, h),\n c = sizeRounded2D(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n size = [\n divisor(s.x ? s.x : c.x * 2),\n divisor(s.y ? s.y : c.x * 2),\n divisor(s.z ? s.z : c.y * 2)\n ],\n verRadius = size.z \/ 2,\n radius = [\n min(max(size.x, size.y) \/ 2, or(c.x, verRadius)),\n verRadius\n ]\n )\n [ size, radius ]\n;\n\n\/**\n * Computes the points that draw the sketch of a bullet shape.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawBullet(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size.z - radius.y\n ],\n points = arc(r=radius, o=center, a=RIGHT)\n )\n complete(points, [radius.x, 0], [0, 0])\n;\n\n\/**\n * Computes the points that draw the sketch of a pill shape.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPill(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n 0, size.z \/ 2 - radius.y\n ]\n )\n center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :concat(\n arc(r=radius, o=-center, a=RIGHT, a1=-RIGHT),\n arc(r=radius, o=center, a=RIGHT)\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a peg shape.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPeg(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n right = max(size.x, size.y) \/ 2,\n top = size.z \/ 2,\n center = [\n right - radius.x,\n top - radius.y\n ]\n )\n radius == [0, 0] ? [ [right, top], [0, top], [0, -top], [right, -top] ]\n :center == [0, 0] ? arc(r=radius, a1=-RIGHT, a2=RIGHT)\n :complete(\n concat(\n arc(r=radius, o=[center.x, -center.y], a1=QUADRANT_3, a2=QUADRANT_4),\n arc(r=radius, o=center, a1=0, a2=QUADRANT_1)\n ),\n [0, -top],\n [0, top]\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a plate shape.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPlate(size, r, d, l, w, h, rx, ry, dx, dy) =\n let(\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy),\n size = specs[0],\n radius = specs[1],\n center = [\n max(size.x, size.y) \/ 2 - radius.x, 0\n ],\n points = arc(r=radius, o=center, a1=-RIGHT, a2=RIGHT)\n )\n center == [0, 0] ? points\n :complete(points, -[0, radius.y], [0, radius.y])\n;\n\n\/**\n * Creates an arch box at the origin.\n *\n * @param Number|Vector [size] - The size of the arch.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule archBox(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeArchBox(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n arch(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a slot shape at the origin.\n *\n * @param Number|Vector [size] - The size of the stadium.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule slot(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeSlot(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n stadium(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a cushion shape at the origin.\n *\n * @param Number|Vector [size] - The size of the rounded rectangle.\n * @param Number|Vector [r] - The radius of the corners or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter of the corners or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius of the corners.\n * @param Number [ry] - The vertical radius of the corners.\n * @param Number [dx] - The horizontal diameter of the corners.\n * @param Number [dy] - The vertical diameter of the corners.\n * @param Boolean [center] - Whether or not center the box on the vertical axis.\n *\/\nmodule cushion(size, r, d, l, w, h, rx, ry, dx, dy, center) {\n size = sizeCushion(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n linear_extrude(height=size[0].z, center=center, convexity=10) {\n roundedRectangle(size[0], size[1]);\n }\n}\n\n\/**\n * Creates a bullet shape at the origin.\n *\n * @param Number|Vector [size] - The size of the bullet.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule bullet(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizeBullet(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawBullet(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a pill shape at the origin.\n *\n * @param Number|Vector [size] - The size of the pill.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pill(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePill(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPill(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a peg shape at the origin.\n *\n * @param Number|Vector [size] - The size of the peg.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule peg(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePeg(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPeg(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a plate shape at the origin.\n *\n * @param Number|Vector [size] - The size of the plate.\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [l] - The overall length.\n * @param Number [w] - The overall width.\n * @param Number [h] - The overall height.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule plate(size, r, d, l, w, h, rx, ry, dx, dy) {\n specs = sizePlate(size=size, r=r, d=d, l=l, w=w, h=h, rx=rx, ry=ry, dx=dx, dy=dy);\n resize(specs[0]) {\n rotate_extrude(convexity=10) {\n polygon(\n points=drawPlate(size=specs[0], r=specs[1]),\n convexity=10\n );\n }\n }\n}\n\n\/**\n * Creates a rounded corner wedge at the origin.\n * For now the function can only handle square corner.\n *\n * @param Number [size] - The size of the corner.\n * @param Number [r] - The radius of the round.\n * @param Number [h] - The height of the solid.\n * @param Number [d] - The diameter of the round.\n * @param String|Vector [p] - The position of the corner, as a cardinal point (default: \"ne\", aka North East).\n * @param Boolean [convex] - Whether makes a convex corner (default: false).\n * @param Number [adjust] - An adjust value added to the size in order to fix wall alignment issue.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule roundedCornerWedge(size, r, h, d, p, convex, adjust, center) {\n linear_extrude(height=divisor(h), center=center, convexity=10) {\n roundedCorner(size=size, r=r, d=d, p=p, convex=convex, adjust=adjust);\n }\n}\n\n\/**\n * Draws a link.\n * @param Vector|Number neck - The size of the link neck.\n * @param Vector|Number bulk - The size of the link bulb.\n * @param Number Height - The thickness of the link.\n * @param Number [w] - The width of the neck.\n * @param Number [h] - The height of the neck.\n * @param Number [rx] - The horizontal radius of the bulb.\n * @param Number [ry] - The vertical radius of the bulb.\n * @param Number [dx] - The horizontal diameter of the bulb.\n * @param Number [dy] - The vertical diameter of the bulb.\n * @param Number [distance] - An additional distance added to the outline of the profile.\n * @param Boolean [center] - Whether or not center the solid on the vertical axis.\n *\/\nmodule link(neck, bulb, height, w, h, rx, ry, dx, dy, distance = 0, center=false) {\n linear_extrude(height=height, center=center, convexity=10) {\n linkProfile(\n neck = neck,\n bulb = bulb,\n w = w,\n h = h,\n rx = rx,\n ry = ry,\n dx = dx,\n dy = dy,\n distance = distance\n );\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"569887158a7302e2c3a6acc79fd929f8f65a3fe3","subject":"adding comments","message":"adding comments\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/LogoBot.scad","new_file":"hardware\/LogoBot.scad","new_contents":"\/*\n\nLogoBot.scad\n\n*\/\n\n\/\/ Master include statement, causes everything else for the model to be included\ninclude \n\n\n\/\/ Master assembly\n\/\/ Defined within: assemblies\/LogoBot.scad\nLogoBotAssembly();\n\n\n\n\n\n","old_contents":"\/*\n\nLogoBot.scad\n\n*\/\n\n\/\/ Master include statement, causes everything else for the model to be included\ninclude \n\n\n\/\/ Master assembly\nLogoBotAssembly();\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a43adda3ea814e9461d198771ed8dad53a00774b","subject":"model of the tube top","message":"model of the tube top\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"ask_zielonka\/cable_tube_enclosure.scad","new_file":"ask_zielonka\/cable_tube_enclosure.scad","new_contents":"size = [92.75, 41, 15];\nwall = 1.75;\nspacing = 2;\nl = 3.2;\n\nmodule tooth()\n{\n difference()\n {\n cube([l, wall, 16]);\n translate([0, 0, 16+l\/2.5])\n rotate([0, 45, 0])\n translate([0, 0, -l])\n cube(l*[1, 1, 2]);\n }\n}\n\n\/\/ body\ndifference()\n{\n cube(size);\n translate(wall*[1, 0, 1])\n cube(size - wall*[2, 1, 1]);\n}\n\n\/\/ side teeth\nfor(dy=[5, 25])\n translate([wall+spacing, dy, wall])\n {\n tooth();\n translate([size[0]-2*(wall+spacing), wall, 0])\n rotate([0, 0, 180])\n tooth();\n }\n\n\/\/ upper teeth\nfor(dx=[0:3])\n translate([wall + 15 + dx*18.5, size[1]-wall-spacing-l, 0])\n translate([0, l, 0])\n rotate([0, 0, -90])\n tooth();\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7587b887c7ec42c0f70f584977143cbd64613c6d","subject":"added both horizontal and vertical rod at the same time","message":"added both horizontal and vertical rod at the same time\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/cube_rod.scad","new_file":"3d_cube\/cube_rod.scad","new_contents":"cube([100, 10, 10]);\ntranslate([0, 15, 0])\n cube([10, 10, 100]);\n","old_contents":"","returncode":1,"stderr":"error: pathspec '3d_cube\/cube_rod.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"37d0101318e855f1bb02f2a3b54e592dd62cd3cd","subject":"timing-belts: add belt_path","message":"timing-belts: add belt_path\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"timing-belts.scad","new_file":"timing-belts.scad","new_contents":"\/*Parametric belting section generator\n * types GT2 2mm T2.5 T5 T10 MXL\n *\n * (c) ALJ_rprp\n *\n * Derived from http:\/\/www.thingiverse.com\/\n * thing:19758 By The DoomMeister\n * thing:16627 by Droftarts\n *\n * licence GPL 2.1 or later\n *\n * deal properly with ends\n * allow circular segments\n * length is given in mm not nb of teeth\n * belt is centered at z=0 and extend along x\n *\n * TODO : add ofset for cosmetic teeth liaisons between segments\n *\n * usage :\n * belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90)\n * belt_len (prf = tT2_5, belt_width = 6, len = 10)\n *\/\n\ninclude \ninclude \n\n\/\/ profiles\ntGT2_2=0;\ntT2_5=1;\ntT5=2;\ntT10=3;\ntMXL=4;\n\n\/*test_belt();*\/\n\nmodule test_belt()\n{\n $fs= 0.5;\n $fa = 4;\n\n translate([-00.5,0,5.5]) cube([1,40,1]);\n\n stack(dist=20, axis=[0,0,-1])\n {\n belt_len(profile = tT10, belt_width = 10, len = 100);\n color(\"red\") belt_len(profile = tT5, belt_width = 10, len = 100);\n color(\"green\") belt_len(profile = tT2_5, belt_width = 10, len = 80);\n color(\"blue\") belt_len(profile = tGT2_2, belt_width = 10, len = 100);\n color(\"orange\") belt_len(profile = tMXL, belt_width = 10, len = 100);\n\n belt_angle(tT10,20,10,180);\n belt_angle(tT5,15,10,90);\n belt_angle(tT2_5,25,10,120);\n belt_angle(tGT2_2,30,10,40);\n belt_angle(tMXL,30,10,40);\n\n color(\"aquamarine\") {\n belt_len(tT2_5,10, 50);\n translate([50,30,0]) rotate([0,0,180]) belt_len(tT2_5,10,50);\n translate([ 0,30,0]) rotate([0,0,180]) belt_angle(tT2_5,15,10,180);\n translate([50,0,0]) rotate([0,0,0]) belt_angle(tT2_5,15,10,180);\n }\n }\n}\n\nmodule belt_path(len=200*mm, belt_width=6*mm, pulley_d=10*mm, belt=tGT2_2, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[pulley_d, belt_width, len], align=align, orient=orient)\n orient([1,0,0])\n orient([0,1,0])\n translate([-len\/2, -pulley_d\/2, 0])\n {\n belt_len(belt, belt_width, len);\n translate([len,pulley_d,0]) rotate([0,0,180]) belt_len(belt, belt_width, len);\n translate([0,pulley_d,0]) rotate([0,0,180]) belt_angle(belt, pulley_d\/2, belt_width, 180);\n translate([len,0,0]) rotate([0,0,0]) belt_angle(belt, pulley_d\/2 ,belt_width,180);\n }\n}\n\nmodule belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90)\n{\n av=360\/2\/rad\/3.14159*tpitch[prf];\n bk=bk_thick[prf];\n\n nn=ceil(angle\/av);\n ang=av*nn;\n\n intersection()\n {\n translate([0,-bk-.5,0])\n pie_slice(r=rad+bk+.5,start_angle=-90,end_angle=angle-90,h=bwdth, align=[0,1,0]);\n\n union ()\n {\n for(i=[0:nn])\n {\n translate ([0,rad,-bwdth\/2])\n rotate ([0,0,av*i])\n translate ([0,-rad,0])\n draw_tooth(prf,0,bwdth);\n }\n\n translate ([0,rad,-bwdth\/2])\n rotate([0,0,-90])\n rotate_extrude(angle = angle)\n polygon([[rad,0],[rad+bk,0],[rad+bk,bwdth],[rad,bwdth]]);\n }\n }\n}\n\n\/\/Outer Module\nmodule belt_len(profile = tT2_5, belt_width = 6, len = 10){\n if ( profile == tT2_5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT10 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tMXL )\t{ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tGT2_2 ){ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n}\n\n\/\/inner module\nmodule _belt_len(prf = -1, len = 10, bwdth = 5) {\n\n n=ceil(len\/tpitch[prf]);\n\n translate ([0,0,-bwdth\/2]) intersection() {\n union(){\n for( i = [0:n]) {\n draw_tooth(prf,i,bwdth);\n }\n translate([-1,-bk_thick[prf],0])cube([len+1,bk_thick[prf],bwdth]);\n }\n translate([0,-bk_thick[prf],0])cube([len,max_h[prf]+bk_thick[prf],bwdth]);\n }\n}\n\nmodule draw_tooth(prf,i,bwdth) {\n if ( prf == tT2_5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T2_5);}\n if ( prf == tT5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T5);}\n if ( prf == tT10 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T10);}\n if ( prf == tMXL ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_MXL);}\n if ( prf == tGT2_2 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_GT2_2);}\n}\n\n\/************************************\n *\t\t\t\tDATA TABLES\t\t\t\t\t*\n ************************************\/\n tpitch = [2,2.5,5,10,2.032];\n bk_thick=[0.6,0.6,1,2,0.64];\n max_h=[0.76447, 0.699911, 1.189895, 2.499784, 0.508035];\n\n pf_GT2_2= [[ 0.747183,-0.5 ],[ 0.747183, 0 ],[ 0.647876, 0.037218],\n [ 0.598311, 0.130528],[ 0.578556, 0.238423],[ 0.547158, 0.343077],\n [ 0.504649, 0.443762],[ 0.451556, 0.53975 ],[ 0.358229, 0.636924],\n [ 0.2484 , 0.707276],[ 0.127259, 0.750044],[ 0 , 0.76447 ],\n [-0.127259, 0.750044],[-0.2484 , 0.707276],[-0.358229, 0.636924],\n [-0.451556, 0.53975 ],[-0.504797, 0.443762],[-0.547291, 0.343077],\n [-0.578605, 0.238423],[-0.598311, 0.130528],[-0.648009, 0.037218],\n [-0.747183, 0 ],[-0.747183,-0.5]];\npf_T2_5= [[-0.839258,-0.5 ],[-0.839258, 0 ],[-0.770246, 0.021652],\n [-0.726369, 0.079022],[-0.529167, 0.620889],[-0.485025, 0.67826 ],\n [-0.416278, 0.699911],[ 0.416278, 0.699911],[ 0.484849, 0.67826 ],\n [ 0.528814, 0.620889],[ 0.726369, 0.079022],[ 0.770114, 0.021652],\n [ 0.839258, 0 ],[ 0.839258,-0.5]];\npf_T5= \t [[-1.632126,-0.5 ],[-1.632126, 0 ],[-1.568549, 0.004939],\n [-1.507539, 0.019367],[-1.450023, 0.042686],[-1.396912, 0.074224],\n [-1.349125, 0.113379],[-1.307581, 0.159508],[-1.273186, 0.211991],\n [-1.246868, 0.270192],[-1.009802, 0.920362],[-0.983414, 0.978433],\n [-0.949018, 1.030788],[-0.907524, 1.076798],[-0.859829, 1.115847],\n [-0.80682 , 1.147314],[-0.749402, 1.170562],[-0.688471, 1.184956],\n [-0.624921, 1.189895],[ 0.624971, 1.189895],[ 0.688622, 1.184956],\n [ 0.749607, 1.170562],[ 0.807043, 1.147314],[ 0.860055, 1.115847],\n [ 0.907754, 1.076798],[ 0.949269, 1.030788],[ 0.9837 , 0.978433],\n [ 1.010193, 0.920362],[ 1.246907, 0.270192],[ 1.273295, 0.211991],\n [ 1.307726, 0.159508],[ 1.349276, 0.113379],[ 1.397039, 0.074224],\n [ 1.450111, 0.042686],[ 1.507589, 0.019367],[ 1.568563, 0.004939],\n [ 1.632126, 0 ],[ 1.632126,-0.5]];\npf_T10= [[-3.06511 ,-1 ],[-3.06511 , 0 ],[-2.971998, 0.007239],\n [-2.882718, 0.028344],[-2.79859 , 0.062396],[-2.720931, 0.108479],\n [-2.651061, 0.165675],[-2.590298, 0.233065],[-2.539962, 0.309732],\n [-2.501371, 0.394759],[-1.879071, 2.105025],[-1.840363, 2.190052],\n [-1.789939, 2.266719],[-1.729114, 2.334109],[-1.659202, 2.391304],\n [-1.581518, 2.437387],[-1.497376, 2.47144 ],[-1.408092, 2.492545],\n [-1.314979, 2.499784],[ 1.314979, 2.499784],[ 1.408091, 2.492545],\n [ 1.497371, 2.47144 ],[ 1.581499, 2.437387],[ 1.659158, 2.391304],\n [ 1.729028, 2.334109],[ 1.789791, 2.266719],[ 1.840127, 2.190052],\n [ 1.878718, 2.105025],[ 2.501018, 0.394759],[ 2.539726, 0.309732],\n [ 2.59015 , 0.233065],[ 2.650975, 0.165675],[ 2.720887, 0.108479],\n [ 2.798571, 0.062396],[ 2.882713, 0.028344],[ 2.971997, 0.007239],\n [ 3.06511 , 0 ],[ 3.06511 ,-1]];\npf_MXL= [[-0.660421,-0.5 ],[-0.660421, 0 ],[-0.621898, 0.006033],\n [-0.587714, 0.023037],[-0.560056, 0.049424],[-0.541182, 0.083609],\n [-0.417357, 0.424392],[-0.398413, 0.458752],[-0.370649, 0.48514 ],\n [-0.336324, 0.502074],[-0.297744, 0.508035],[ 0.297744, 0.508035],\n [ 0.336268, 0.502074],[ 0.370452, 0.48514 ],[ 0.39811 , 0.458752],\n [ 0.416983, 0.424392],[ 0.540808, 0.083609],[ 0.559752, 0.049424],\n [ 0.587516, 0.023037],[ 0.621841, 0.006033],[ 0.660421, 0 ],\n [ 0.660421,-0.5]];\n\n","old_contents":"\/*Parametric belting section generator\n * types GT2 2mm T2.5 T5 T10 MXL\n *\n * (c) ALJ_rprp\n *\n * Derived from http:\/\/www.thingiverse.com\/\n * thing:19758 By The DoomMeister\n * thing:16627 by Droftarts\n *\n * licence GPL 2.1 or later\n *\n * deal properly with ends\n * allow circular segments\n * length is given in mm not nb of teeth\n * belt is centered at z=0 and extend along x\n *\n * TODO : add ofset for cosmetic teeth liaisons between segments\n *\n * usage :\n * belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90)\n * belt_len (prf = tT2_5, belt_width = 6, len = 10)\n *\/\n\ninclude \ninclude \n\n\/\/ profiles\ntGT2_2=0;\ntT2_5=1;\ntT5=2;\ntT10=3;\ntMXL=4;\n\n\/*test_belt();*\/\n\nmodule test_belt()\n{\n $fs= 0.5;\n $fa = 4;\n\n translate([-00.5,0,5.5]) cube([1,40,1]);\n\n stack(dist=20, axis=[0,0,-1])\n {\n belt_len(profile = tT10, belt_width = 10, len = 100);\n color(\"red\") belt_len(profile = tT5, belt_width = 10, len = 100);\n color(\"green\") belt_len(profile = tT2_5, belt_width = 10, len = 80);\n color(\"blue\") belt_len(profile = tGT2_2, belt_width = 10, len = 100);\n color(\"orange\") belt_len(profile = tMXL, belt_width = 10, len = 100);\n\n belt_angle(tT10,20,10,180);\n belt_angle(tT5,15,10,90);\n belt_angle(tT2_5,25,10,120);\n belt_angle(tGT2_2,30,10,40);\n belt_angle(tMXL,30,10,40);\n\n color(\"aquamarine\") {\n belt_len(tT2_5,10, 50);\n translate([50,30,0]) rotate([0,0,180]) belt_len(tT2_5,10,50);\n translate([ 0,30,0]) rotate([0,0,180]) belt_angle(tT2_5,15,10,180);\n translate([50,0,0]) rotate([0,0,0]) belt_angle(tT2_5,15,10,180);\n }\n }\n}\n\nmodule belt_angle(prf = tT2_5, rad=25, bwdth = 6, angle=90)\n{\n av=360\/2\/rad\/3.14159*tpitch[prf];\n bk=bk_thick[prf];\n\n nn=ceil(angle\/av);\n ang=av*nn;\n\n intersection()\n {\n translate([0,-bk-.5,0])\n pie_slice(r=rad+bk+.5,start_angle=-90,end_angle=angle-90,h=bwdth, align=[0,1,0]);\n\n union ()\n {\n for(i=[0:nn])\n {\n translate ([0,rad,-bwdth\/2])\n rotate ([0,0,av*i])\n translate ([0,-rad,0])\n draw_tooth(prf,0,bwdth);\n }\n\n translate ([0,rad,-bwdth\/2])\n rotate([0,0,-90])\n rotate_extrude(angle = angle)\n polygon([[rad,0],[rad+bk,0],[rad+bk,bwdth],[rad,bwdth]]);\n }\n }\n}\n\n\/\/Outer Module\nmodule belt_len(profile = tT2_5, belt_width = 6, len = 10){\n if ( profile == tT2_5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT5 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tT10 ) { _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tMXL )\t{ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n if ( profile == tGT2_2 ){ _belt_len(prf=profile,len = len,bwdth = belt_width);}\n}\n\n\/\/inner module\nmodule _belt_len(prf = -1, len = 10, bwdth = 5) {\n\n n=ceil(len\/tpitch[prf]);\n\n translate ([0,0,-bwdth\/2]) intersection() {\n union(){\n for( i = [0:n]) {\n draw_tooth(prf,i,bwdth);\n }\n translate([-1,-bk_thick[prf],0])cube([len+1,bk_thick[prf],bwdth]);\n }\n translate([0,-bk_thick[prf],0])cube([len,max_h[prf]+bk_thick[prf],bwdth]);\n }\n}\n\nmodule draw_tooth(prf,i,bwdth) {\n if ( prf == tT2_5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T2_5);}\n if ( prf == tT5 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T5);}\n if ( prf == tT10 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_T10);}\n if ( prf == tMXL ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_MXL);}\n if ( prf == tGT2_2 ) { translate([tpitch[prf]*i,0,0])\n linear_extrude(height=bwdth) polygon(pf_GT2_2);}\n}\n\n\/************************************\n *\t\t\t\tDATA TABLES\t\t\t\t\t*\n ************************************\/\n tpitch = [2,2.5,5,10,2.032];\n bk_thick=[0.6,0.6,1,2,0.64];\n max_h=[0.76447, 0.699911, 1.189895, 2.499784, 0.508035];\n\n pf_GT2_2= [[ 0.747183,-0.5 ],[ 0.747183, 0 ],[ 0.647876, 0.037218],\n [ 0.598311, 0.130528],[ 0.578556, 0.238423],[ 0.547158, 0.343077],\n [ 0.504649, 0.443762],[ 0.451556, 0.53975 ],[ 0.358229, 0.636924],\n [ 0.2484 , 0.707276],[ 0.127259, 0.750044],[ 0 , 0.76447 ],\n [-0.127259, 0.750044],[-0.2484 , 0.707276],[-0.358229, 0.636924],\n [-0.451556, 0.53975 ],[-0.504797, 0.443762],[-0.547291, 0.343077],\n [-0.578605, 0.238423],[-0.598311, 0.130528],[-0.648009, 0.037218],\n [-0.747183, 0 ],[-0.747183,-0.5]];\npf_T2_5= [[-0.839258,-0.5 ],[-0.839258, 0 ],[-0.770246, 0.021652],\n [-0.726369, 0.079022],[-0.529167, 0.620889],[-0.485025, 0.67826 ],\n [-0.416278, 0.699911],[ 0.416278, 0.699911],[ 0.484849, 0.67826 ],\n [ 0.528814, 0.620889],[ 0.726369, 0.079022],[ 0.770114, 0.021652],\n [ 0.839258, 0 ],[ 0.839258,-0.5]];\npf_T5= \t [[-1.632126,-0.5 ],[-1.632126, 0 ],[-1.568549, 0.004939],\n [-1.507539, 0.019367],[-1.450023, 0.042686],[-1.396912, 0.074224],\n [-1.349125, 0.113379],[-1.307581, 0.159508],[-1.273186, 0.211991],\n [-1.246868, 0.270192],[-1.009802, 0.920362],[-0.983414, 0.978433],\n [-0.949018, 1.030788],[-0.907524, 1.076798],[-0.859829, 1.115847],\n [-0.80682 , 1.147314],[-0.749402, 1.170562],[-0.688471, 1.184956],\n [-0.624921, 1.189895],[ 0.624971, 1.189895],[ 0.688622, 1.184956],\n [ 0.749607, 1.170562],[ 0.807043, 1.147314],[ 0.860055, 1.115847],\n [ 0.907754, 1.076798],[ 0.949269, 1.030788],[ 0.9837 , 0.978433],\n [ 1.010193, 0.920362],[ 1.246907, 0.270192],[ 1.273295, 0.211991],\n [ 1.307726, 0.159508],[ 1.349276, 0.113379],[ 1.397039, 0.074224],\n [ 1.450111, 0.042686],[ 1.507589, 0.019367],[ 1.568563, 0.004939],\n [ 1.632126, 0 ],[ 1.632126,-0.5]];\npf_T10= [[-3.06511 ,-1 ],[-3.06511 , 0 ],[-2.971998, 0.007239],\n [-2.882718, 0.028344],[-2.79859 , 0.062396],[-2.720931, 0.108479],\n [-2.651061, 0.165675],[-2.590298, 0.233065],[-2.539962, 0.309732],\n [-2.501371, 0.394759],[-1.879071, 2.105025],[-1.840363, 2.190052],\n [-1.789939, 2.266719],[-1.729114, 2.334109],[-1.659202, 2.391304],\n [-1.581518, 2.437387],[-1.497376, 2.47144 ],[-1.408092, 2.492545],\n [-1.314979, 2.499784],[ 1.314979, 2.499784],[ 1.408091, 2.492545],\n [ 1.497371, 2.47144 ],[ 1.581499, 2.437387],[ 1.659158, 2.391304],\n [ 1.729028, 2.334109],[ 1.789791, 2.266719],[ 1.840127, 2.190052],\n [ 1.878718, 2.105025],[ 2.501018, 0.394759],[ 2.539726, 0.309732],\n [ 2.59015 , 0.233065],[ 2.650975, 0.165675],[ 2.720887, 0.108479],\n [ 2.798571, 0.062396],[ 2.882713, 0.028344],[ 2.971997, 0.007239],\n [ 3.06511 , 0 ],[ 3.06511 ,-1]];\npf_MXL= [[-0.660421,-0.5 ],[-0.660421, 0 ],[-0.621898, 0.006033],\n [-0.587714, 0.023037],[-0.560056, 0.049424],[-0.541182, 0.083609],\n [-0.417357, 0.424392],[-0.398413, 0.458752],[-0.370649, 0.48514 ],\n [-0.336324, 0.502074],[-0.297744, 0.508035],[ 0.297744, 0.508035],\n [ 0.336268, 0.502074],[ 0.370452, 0.48514 ],[ 0.39811 , 0.458752],\n [ 0.416983, 0.424392],[ 0.540808, 0.083609],[ 0.559752, 0.049424],\n [ 0.587516, 0.023037],[ 0.621841, 0.006033],[ 0.660421, 0 ],\n [ 0.660421,-0.5]];\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ce94dab9d26037ec141210f0e46e6f95c0f516c3","subject":"added temp for tests","message":"added temp for tests\n","repos":"fponticelli\/smallbridges","old_file":"resin\/temp.scad","new_file":"resin\/temp.scad","new_contents":"use <..\/scad\/brackets.scad>\n\n\/\/rotate_y_at(90, [10,10])\n angle_corner_connector();","old_contents":"","returncode":1,"stderr":"error: pathspec 'resin\/temp.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"11db81997e8f969663190172546600d5bf781968","subject":"shapes\/circle_profile: use $fa instead of $fn","message":"shapes\/circle_profile: use $fa instead of $fn\n\n$fn may be 0\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fa=$fa) = [for (i=[0:fa-1]) [r*sin(i*360\/fa), r*cos(i*360\/fa)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","old_contents":"\/*use <..\/scad-utils\/transformations.scad>*\/\ninclude \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n cube(size+extra_size, center=true);\n}\n\nmodule rcubea(size=[10,10,10], round_r=1, align=N, extra_size=N, extra_align=N, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n assert(size.x > round_r);\n assert(size.y > round_r);\n assert(size.z > round_r);\n\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n rcube(size=size+extra_size, round_r=round_r);\n}\n\nmodule rcube(size=[20,20,20], round_r=1)\n{\n if($preview_mode || round_r == 0)\n {\n cubea(size);\n }\n else\n {\n hull()\n for(x=[-(size[0]\/2-round_r),(size[0]\/2-round_r)])\n for(y=[-(size[1]\/2-round_r),(size[1]\/2-round_r)])\n for(z=[-(size[2]\/2-round_r),(size[2]\/2-round_r)])\n translate([x,y,z])\n {\n sphere(r=round_r);\n }\n }\n}\n\nmodule pyramid(size=[10,10,10], orient, align)\n{\n let(s=size)\n size_align(size=s, align=align, orient=orient)\n polyhedron(\n points=[\n \/\/ the four points at base\n [s.x\/2,s.y\/2,-s.z\/2],[s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,-s.y\/2,-s.z\/2],[-s.x\/2,s.y\/2,-s.z\/2],\n \/\/ the apex point\n [0,0,s.z\/2]\n ],\n faces=[\n \/\/ each triangle side\n [0,1,4],[1,2,4],[2,3,4],[3,0,4],\n \/\/ two triangles for square base\n [1,0,3],[2,1,3] \n ]\n );\n}\n\nmodule spherea(r, d, align=N, extra_r, extra_d, extra_align, orient=Z, orient_ref=Z, roll=0, extra_roll, extra_roll_orient)\n{\n d_ = v_fallback(d, [r*2]);\n assert(d_ != U);\n\n extra_d_ = v_fallback(extra_d, [extra_r*2, 0]);\n\n size=[d_,d_,d_];\n extra_size=[extra_d_,extra_d_,extra_d_];\n size_align(size=size, extra_size=extra_size, align=align, extra_align=extra_align, orient=orient, orient_ref=orient_ref, roll=roll, extra_roll=extra_roll, extra_roll_orient=extra_roll_orient)\n sphere(d=d_+extra_d_);\n}\n\nmodule cylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n assert(h>0);\n\n pi=3.1415926536;\n\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r1=r1_+extra_r_, r2=r2_+extra_r_, center=true);\n }\n }\n}\n\n\/\/ polycylinder (polyhole\/3d printing size compensated hole)\nmodule pcylindera(\n h=10,\n r=U,\n d=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=0,\n debug=false\n )\n{\n pi=3.1415926536;\n\n d_ = v_fallback(d, [r*2]);\n r__ = v_fallback(r, [d_\/2, d\/2, r]);\n r_ = polyhole_d(r__*2)\/2;\n $fn = polyhole_n(r__*2);\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n if(debug)\n {\n echo(h, r_, extra_r_, align);\n }\n\n size_align(size=[r_*2,r_*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if(round_r>0)\n {\n rcylindera(h=h+extra_h, r=r_+extra_r_, round_r=round_r);\n }\n else\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, center=true);\n }\n }\n}\n\nmodule torus(d, r, radius, radial_width, align=N, orient=Z)\n{\n r_ = v_fallback(r,[d\/2, radius, 5]);\n size_align(size=[r_*2+radial_width*2, r_*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate(r_*X)\n circle(radial_width);\n}\n\nmodule rcylindera(\n h=10,\n r=U,\n r1=U,\n r2=U,\n d=U,\n d1=U,\n d2=U,\n align=N,\n orient=Z,\n extra_h=0,\n extra_r=U,\n extra_d=U,\n extra_align=N,\n round_r=1,\n debug=false,\n poly=false\n )\n{\n d1_ = v_fallback(d1, [r*2, r1*2]);\n d2_ = v_fallback(d2, [r*2, r2*2]);\n\n r1_ = v_fallback(r1, [d1_\/2, d\/2, r]);\n r2_ = v_fallback(r2, [d2_\/2, d\/2, r]);\n\n r_max = v_fallback(r, [max(r1_,r2_)]);\n\n h_ = h+extra_h;\n\n extra_r_ = v_fallback(extra_r, [extra_d\/2, 0]);\n\n assert(r1_ != U);\n assert(r2_ != U);\n assert(extra_r_ != U);\n\n assert(h >= 2*round_r);\n\n if(debug)\n {\n echo(h, r_, r1_, r2_, extra_r_, align);\n }\n\n size_align(size=[r_max*2,r_max*2,h], extra_size=[extra_r_*2, extra_r_*2, extra_h], orient=orient, orient_ref=Z, align=align, extra_align=extra_align)\n {\n if($preview_mode || round_r == 0)\n {\n cylindera(h=h_, r1=r1_+extra_r_, r2=r2_+extra_r_);\n }\n else\n {\n r_ = [r1_+extra_r_\/2,r2_+extra_r_\/2];\n\n hull()\n {\n for(z=[-1,1])\n translate([0, 0, z*(-h_\/2)])\n {\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_r, radial_width=round_r, align=z*Z);\n }\n }\n }\n }\n}\n\nfunction circle_profile(r=10, fn=$fn) = [for (i=[0:fn-1]) [r*sin(i*360\/fn), r*cos(i*360\/fn)]];\n\nfunction rounded_rectangle_profile(size=[10,10],r=[1,1],fn=32) = [\nlet(r_ = is_list(r) ? r : [r,r])\nfor (index = [0:fn-1])\nlet(a = index\/fn*360) \n[cos(a)*r.x, sin(a)*r.y]\n+ sign_x(index, fn) * X * (size.x\/2-r.x)\n+ sign_y(index, fn) * Y * (size.y\/2-r.y)\n];\n\nfunction sign_x(i,n) =\ni < n\/4 || i > n-n\/4 ? 1 :\ni > n\/4 && i < n-n\/4 ? -1 :\n 0;\n\nfunction sign_y(i,n) =\ni > 0 && i < n\/2 ? 1 :\ni > n\/2 ? -1 :\n 0;\n\n\/\/ From Obiscad\n\/\/ Draw a point in the position given by the vector p\nmodule point(p, r=0.7, fn)\n{\n translate(p)\n sphere(r=r);\n}\n\n\/\/ Draw a vector poiting to the z axis\n\/\/ This is an auxiliary module for implementing the vector module\n\/\/\n\/\/ Parameters:\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vectorz(l=10, l_arrow=4, mark=true)\n{\n \/\/ vector body length (not including the arrow)\n lb = l - l_arrow;\n\n \/\/ The vector is located at 0,0,0\n union()\n {\n \/\/ Draw the arrow\n tz(lb)\n cylindera(r1=2\/2, r2=0.2, h=l_arrow);\n\n \/\/ Draw the mark\n if(mark)\n tz(lb)\n tx(X)\n cubea([2,0.3,l_arrow*0.8], align=X);\n\n \/\/ Draw the body\n cylindera(r=1\/2, h=lb, align=Z);\n }\n\n \/\/ Draw a sphere in the vector base\n spherea(r=1\/2, align=-Z);\n}\n\n\/\/ From Obiscad,\n\/\/ Draw a vector\n\/\/\n\/\/ There are two modes of drawing the vector\n\/\/ * Mode 1: Given by a cartesian point(x,y,z). A vector from the origin\n\/\/ to the end (x,y,z) is drawn. The l parameter (length) must \n\/\/ be 0 (l=0)\n\/\/ * Mode 2: Give by direction and length\n\/\/ A vector of length l pointing to the direction given by\n\/\/ v is drawn\n\/\/ Parameters:\n\/\/ v: Vector cartesian coordinates\n\/\/ l: total vector length (line + arrow)\n\/\/ l_arrow: Vector arrow length\n\/\/ mark: If true, a mark is draw in the vector head, for having\n\/\/ a visual reference of the rolling angle\nmodule vector(v, l=4, l_arrow=2, mark=false)\n{\n \/\/-- Get the vector length from the coordinates\n mod = v_mod(v);\n\n \/\/-- The vector is very easy implemented by means of the orientate\n \/\/-- operator:\n \/\/-- orientate(v) vectorz(l=mod, l_arrow=l_arrow)\n \/\/-- BUT... in OPENSCAD 2012.02.22 the recursion does not\n \/\/-- not work, so that if the user use the orientate operator\n \/\/-- on a vector, openscad will ignore it..\n \/\/-- The solution at the moment (I hope the openscad developers\n \/\/-- implement the recursion in the near future...)\n \/\/-- is to repite the orientate operation in this module\n\n \/\/---- SAME CALCULATIONS THAN THE ORIENTATE OPERATOR!\n \/\/-- Calculate the rotation axis\n\n vref = Z;\n raxis = v_cross(vref,v);\n\n \/\/-- Calculate the angle between the vectors\n ang = v_anglev(vref,v);\n\n raxis_=ang==180&&raxis==N?X:raxis;\n\n \/\/-- orientate the vector\n \/\/-- Draw the vector. The vector length is given either\n \/\/--- by the mod variable (when l=0) or by l (when l!=0)\n if (l==0)\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=mod, l_arrow=l_arrow, mark=mark);\n }\n else\n {\n rotate(a=ang, v=raxis_)\n vectorz(l=l, l_arrow=l_arrow, mark=mark);\n }\n\n}\n\n\/\/ From Obiscad,\n\/\/--------------------------------------------------------------------\n\/\/-- Draw a connector\n\/\/-- A connector is defined a 3-tuple that consist of a point\n\/\/--- (the attachment point), and axis (the attachment axis) and\n\/\/--- an angle the connected part should be rotate around the \n\/\/-- attachment axis\n\/\/--\n\/\/--- Input parameters:\n\/\/--\n\/\/-- Connector c = [p , n, ang] where:\n\/\/--\n\/\/-- p : The attachment point\n\/\/-- v : The attachment axis\n\/\/-- ang : the angle\n\/\/--------------------------------------------------------------------\nmodule connector(c)\n{\n \/\/-- Get the three components from the connector\n p = c[0];\n v = c[1];\n ang = c[2];\n\n \/\/-- Draw the attachment point\n color(v)\n point(p);\n\n \/\/-- Draw the attachment axis vector (with a mark)\n translate(p)\n rotate(a=ang, v=v)\n color(v)\n vector($fn=16, v=v_unitv(v), l=6, l_arrow=2, mark=true);\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=Z, align=N)\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=Z, align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=U, orient=Z, align=N)\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n taper_h = taper_h == U ? min(h\/4, (outer_d-inner_d)\/2) : max(taper_h,h\/2);\n taper_ = taper && taper_h > 0;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align);\n difference()\n {\n union()\n {\n cylindera(h=h-(taper_?taper_h*2:0), d=outer_d, orient=Z, align=N);\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h, align=Z);\n }\n }\n if(taper_)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n cylindera(d1=inner_d, d2=outer_d, h=taper_h+.1, align=Z, extra_h=.2);\n\n \/\/ override fn for inner cylinder cut, to ensure same fragments as taper\n \/\/ this ensures cleaner mesh\n fn = fn_from_d(d=outer_d);\n cylindera(h=h+.2+taper_h, d=inner_d, orient=Z, align=N, $fn=fn);\n }\n else\n {\n cylindera(h=h, d=inner_d, orient=Z, align=N, extra_h=.4);\n }\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=N, orient=Z)\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, round_r=2, align=N, orient=Z)\n{\n size = [a_len-round_r, depth-round_r, o_len-round_r];\n r_x = round_r;\n r_y = round_r;\n r_z = -round_r;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color(X)\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color(X)*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+round_r,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+round_r,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+round_r,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=round_r);\n}\n\nmodule teardrop(r, d, h=10, truncate=1, align=N, orient=Y, roll=0)\n{\n r_= v_fallback(r, [d\/2]);\n\n sx1 = r_ * sin(-45);\n sx2 = r_ * -sin(-45);\n sy = r_ * -cos(-45);\n ex = 0;\n ey = (sin(-135) + cos(-135)) * r_;\n\n dx= ex-sx1;\n dy = ey-sy;\n\n eys = lerp(-r_,ey,1-truncate);\n\n dys = eys-sy;\n ex1 = sy+dys*dx\/dy;\n ex2 = -ex1;\n\n size_align(size=[d,d,h], align=align, orient=orient, orient_ref=Z, roll=roll)\n union()\n {\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n circle(r = r_);\n\n linear_extrude(height = h, center = true, convexity = r_, twist = 0)\n polygon(points = [\n [sy, sx1],\n [sy, sx2],\n [eys, ex2],\n [eys, ex1]],\n paths = [[0, 1, 2, 3]]);\n }\n}\n\n\/\/ test teardrop\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n teardrop(r=r, h=20, orient=$axis, align=$axis);\n}\n\n\/\/ test cubea\nif(false)\n{\n w=5*mm;\n h=2*mm;\n all_axes()\n color($color)\n cubea([w,w,h], orient=$axis, align=$axis*3);\n}\n\/**\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=-Z);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=Z);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=Z);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=Z);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n stack(axis=X, dist=15)\n {\n hollow_cylinder(thickness=5, h=10, taper=false, orient=Z, align=Z);\n hollow_cylinder(thickness=5, h=10, taper=true, orient=Z, align=Z);\n }\n\n \/*cylindera(d=10, h=10, orient=Z, align=Z);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=Z, align=Z);*\/\n \/*cylindera(d=8, h=10, orient=Z, align=Z);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],X);*\/\n \/*%cubea([10,10,10],X,[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=X, extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], round_r=10);*\/\n \/*rcubea(s=[35,35,35], align=-Y);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=Y, orient=Z, $fn=100);\n\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Z)*\/\n\/*size_align(size=[5,5,20], orient=Y, orient_ref=Y, align=Y)*\/\n\/*size_align(size=[5,20,5], orient=Z, orient_ref=Y, align=N)*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=Y, align=Z);*\/\n}\n\nif(false)\n{\n \/*cubea();*\/\n \/*rcubea(size=[10,10,10]);*\/\n\n is_build = true;\n $fs = is_build ? 0.5 : 2;\n $fa = is_build ? 4 : 12;\n\n stack(axis=X, dist=15)\n {\n cylindera(h=10,r=5);\n\n rcylindera(h=10,r=5);\n\n\n rcubea([10,10,10]);\n }\n}\n\n\nif(false)\n{\n r=5*mm;\n all_axes()\n translate($axis*r*2)\n color($color)\n \/*orient(axis=$axis, axis_ref=Z)*\/\n \/*translate(Z*10)*\/\n \/*rcylindera(r1=5, r2=3, h=10);*\/\n {\n rcylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n cylindera(h=20, extra_d = 1*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16); \/*cylindera(h=20, round_r=1, extra_r = 2*mm, r1=r, r2=r\/2, align=$axis, orient=$axis, extra_h=r, extra_align=-$axis, $fn=16);*\/\n }\n\n}\n\nif(false)\n{\n all_axes()\n translate($axis*r*2)\n color($color)\n {\n orient(axis=$axis, axis_ref=Z)\n hull()\n {\n cubea(size=[5,8,7]);\n translate(5*Z)\n cubea(size=[2,2,2]);\n }\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=Y)\n {\n stack(dist=10, axis=-Z)\n {\n \/*cylindera(orient=-Z, align=-Z);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Z, align=-Z);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Z, align=Z);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=-Z);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=-Z);*\/\n }\n\n stack(dist=10, axis=Y)\n {\n \/*cylindera(orient=Y, align=Y);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=-Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=Y, align=Y);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=Y, align=Y);\n }\n }\n}\n\nif(false)\n{\n \/*$fs = 0.5;*\/\n \/*$fa = 4;*\/\n\n r=5;\n hull()\n {\n stack(dist=10, axis=-Z)\n {\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n rcylindera(r=r, h=r*2, orient=Y, align=Y);\n }\n\n rcylindera(r=5, h=r, orient=X, align=Y+X+Z);\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f5311bd2a55f40d9b19b0ebfaa8cba601577d642","subject":"main\/gantry: show lower gantry connector","message":"main\/gantry: show lower gantry connector\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_range_x=[0*mm,200*mm];\naxis_pos_x = axis_range_x[0];\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = axis_range_y[0];\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n color(color_extrusion)\n for(y=[-1,1])\n translate([0,y*(main_upper_dist_y\/2),0])\n {\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n }\n\n \/\/ upper gantry connectors\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n }\n\n }\n }\n}\n\nmodule gantry_lower()\n{\n color(color_extrusion)\n for(z=[-1,1])\n {\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n }\n\n }\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n {\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n {\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n {\n color(color_gantry_connectors)\n gantry_lower_connector();\n }\n\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"use \nuse ;\nuse ;\ninclude ;\ninclude ;\nuse ;\ninclude ;\n\ninclude \ninclude \n\ninclude \n\/*include *\/\ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \nuse \n\nuse \nuse \nuse \nuse \nuse \n\naxis_pos_x = -213\/2*mm;\naxis_pos_y = 0*mm;\naxis_range_z=[98*mm,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nmodule x_axis()\n{\n \/\/ x axis\n translate([0,0,axis_pos_z])\n {\n if(!preview_mode)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, 0])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n translate([axis_pos_x,0,0])\n {\n \/\/ x carriage\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])\n {\n x_carriage_full();\n }\n }\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n xaxis_end(with_motor=x==-1, show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n color(color_part)\n attach([[yaxis_belt_path_offset_x,main_depth\/2,yaxis_motor_offset_z], [0,-1,0]], yaxis_motor_mount_conn)\n {\n yaxis_motor_mount(show_motor=true);\n }\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n color(color_part)\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n {\n color(color_part)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n {\n if(!preview_mode)\n {\n translate([0,main_depth\/2-yaxis_motor_offset_x,0])\n {\n \/*cubea([10,main_depth-yaxis_motor_offset_x,10], align=[0,-1,0]);*\/\n belt_path(main_depth-yaxis_motor_offset_x-yaxis_idler_pulley_offset_y, 6, yaxis_pulley_inner_d, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n }\n\n color(color_part)\n translate([0,-axis_pos_y,yaxis_bearing[0]\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n {\n yaxis_belt_holder();\n }\n\n translate([0,0,yaxis_bearing[0]\/2])\n {\n for(x=[-1,1])\n for(y=[-1,1])\n {\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],[0,0,1]],mount_rod_clamp_conn_rod)\n {\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=zmotor_mount_clamp_thread, orient=[0,1,0]);\n }\n }\n\n \/\/ y smooth rods\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n color(color_rods)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=[0,1,0]);\n\n for(y=[-1,1])\n {\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],[0,0,-1]], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount(show_bearing=true, show_zips=true);\n }\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [[0,axis_pos_y,0],[0,0,1]])\n {\n \/*translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1]-16*mm)\/2, 0])*\/\n \/\/ y axis plate\n for(x=[-1,1])\n for(y=[-1,1])\n hull()\n {\n translate([x*yaxis_carriage_size[0]\/2, y*(yaxis_carriage_size[1])\/2, 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n translate([x*(yaxis_carriage_size[0]\/2-16*mm), y*(yaxis_carriage_size[1]\/2-16*mm), 0])\n {\n cylindera(d=10*mm, h=yaxis_carriage_size[2], align=[-x,-y,1]);\n }\n }\n\n cubea([yaxis_carriage_size[0]-16*mm*2,yaxis_carriage_size[1]-16*mm*2, yaxis_carriage_size[2]], align=[0,0,1]);\n\n translate([0,0,10*mm])\n cubea(yaxis_carriage_size, align=[0,0,1]);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n translate([x*(main_width\/2),0,main_height])\n {\n mirror([x==-1?1:0,0,0])\n {\n color(color_gantry_connectors)\n gantry_upper_connector();\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, extrusion_size\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n }\n\n\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0,0,zaxis_motor_offset_z])\n mirror([x==-1?1:0,0,0])\n {\n color(color_part)\n zaxis_motor_mount(show_motor=true);\n\n color(color_part)\n translate([zmotor_mount_rod_offset_x, 0, zmotor_mount_thickness_h\/2])\n {\n mount_rod_clamp_half(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=zmotor_mount_thickness_h,\n thread=zmotor_mount_clamp_thread);\n }\n }\n\n \/\/ z smooth rods\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n {\n \/\/ z rods\n color(color_rods)\n translate([0,0,zaxis_motor_offset_z-50])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=[0,0,1]);\n\n for(z=[-1,1])\n translate([0,0,axis_pos_z-z*xaxis_rod_distance\/2])\n bearing(zaxis_bearing);\n\n }\n }\n }\n\n}\n\nmodule main()\n{\n color(color_extrusion)\n gantry_lower();\n\n color(color_extrusion)\n translate([0,0,-main_lower_dist_z])\n gantry_lower();\n\n color(color_extrusion)\n for(x=[-1,1])\n translate([0,x*(main_upper_dist_y\/2),0])\n gantry_upper();\n\n x_axis();\n y_axis();\n z_axis();\n\n if(!preview_mode)\n {\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n {\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n psu_a();\n\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n }\n\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\nmodule gantry_upper()\n{\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea(size=[extrusion_size, extrusion_size, main_height], align=[-x,0,1]);\n }\n else\n {\n linear_extrusion(h=main_height, align=[-x,0,1], orient=[0,0,1]);\n }\n }\n\n translate([0, 0, main_height])\n {\n if(preview_mode)\n {\n cubea(size=[main_upper_width, extrusion_size, extrusion_size], align=[0,0,1]);\n }\n else\n {\n linear_extrusion(h=main_upper_width, align=[0,0,1], orient=[1,0,0]);\n }\n }\n}\n\nmodule gantry_lower()\n{\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n {\n if(preview_mode)\n {\n cubea([main_width, extrusion_size, extrusion_size], align=[0,y,-1]);\n }\n else\n {\n linear_extrusion(h=main_width, align=[0,y,-1], orient=[1,0,0]);\n }\n }\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n {\n if(preview_mode)\n {\n cubea([extrusion_size, main_depth, extrusion_size], align=[-x,0,-1]);\n }\n else\n {\n linear_extrusion(h=main_depth, align=[-x,0,-1], orient=[0,1,0]);\n }\n }\n}\n\nmodule enclosure()\n{\n w=60*cm;\n h=60*cm;\n d=60*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[-x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w-wallthick*2,d,wallthick], align=[0,0, -z]);\n }\n}\n\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"ff2bc4b9ff8ed9b9ef6b357d74756b0797971b5c","subject":"main: some cleanup","message":"main: some cleanup\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"main.scad","new_file":"main.scad","new_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - x_carriage_w\/2 + 20;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n \/*render()*\/\n tz(-main_lower_dist_z\/2)\n gantry_lower();\n\n \/*render()*\/\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n \/*render()*\/\n x_axis();\n\n \/*render()*\/\n y_axis();\n\n \/*render()*\/\n z_axis();\n\n \/*render()*\/\n \/*translate([-75*mm,0,0])*\/\n \/*translate([0,main_depth\/2,0])*\/\n \/*translate([0,extrusion_size,0])*\/\n \/*translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])*\/\n \/*power_panel_iec320(orient=[0,-1,0], align=Y);*\/\n\n if(!$preview_mode)\n {\n render()\n ty(-main_depth\/2)\n ty(-extrusion_size\/2)\n tz(-main_lower_dist_z\/2)\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render()\n psu_a();\n\n render()\n mirror([x==-1?1:0,0,0])\n ty(-psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_side();\n\n render()\n translate(psu_a_screw_dist_y\/2)\n psu_a_extrusion_bracket_back();\n }\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","old_contents":"include \n\ninclude \ninclude \ninclude \n\nuse \nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \ninclude \n\nuse \nuse \n\nuse \ninclude \n\nuse \ninclude \n\n\/*use *\/\n\/*include *\/\n\n\/*use *\/\n\/*use *\/\n\n\/\/ x carriage\naxis_range_x_ = main_width\/2 - extrusion_size - x_carriage_w\/2 + 20;\naxis_range_x = [-1,1] * axis_range_x_;\naxis_printrange_x = [-1, 1] * (printbed_size[0]\/2+extruder_b_hotend_mount_offset.x);\naxis_x_pos_relative=[1,0];\naxis_x_parked = [false, true];\n\naxis_range_y=[0*mm,200*mm];\naxis_pos_y = -axis_range_y[0]\/2-30*mm;\naxis_range_z=[-extruder_offset.z-extruder_offset_b.z-extruder_b_hotend_mount_offset.z+hotend_height+yaxis_carriage_offset.z+yaxis_carriage_bearing_mount_conn_bearing[0].z+yaxis_carriage_printbed_offset.z+printbed_size.z,353*mm];\naxis_pos_z = axis_range_z[0];\n\necho(str(\"Axis range X: \" , axis_range_x[0], \" \", axis_range_x[1],\" mm\"));\necho(str(\"Axis range Y: \" , axis_range_y[0], \" \", axis_range_y[1],\" mm\"));\necho(str(\"Axis range Z: \" , axis_range_z[0], \" \", axis_range_z[1],\" mm\"));\n\necho(str(\"Build area Z: \" , axis_range_z[1]-axis_range_z[0] , \" mm\"));\n\nhome_offset_x0 = axis_range_x[0] - axis_printrange_x[0] + v_x(extruder_b_filapath_offset)[0];\necho(str(\"Home offset X0: \" , home_offset_x0));\necho(str(\"Tool offset X: \" , axis_range_x_+x_carriage_w\/2));\n\nmodule x_axis()\n{\n \/\/ x axis\n tz(axis_pos_z)\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=xaxis_beltpath_z_offsets)\n tz(z)\n ty(xaxis_zaxis_distance_y)\n tx(-sign(z)*(-main_width\/2-zrod_offset+xaxis_end_motor_offset[0]))\n rotate(90*X)\n belt_path(\n len=main_width+xaxis_end_motor_offset[0],\n belt_width=xaxis_belt_width,\n belt=xaxis_belt,\n pulley_d=xaxis_pulley_inner_d,\n orient=X, align=-sign(z)*X);\n\n for(x=[0:len(axis_range_x)-1])\n {\n \/*#cubea(size=[x_carriage_w,10,100]);*\/\n\n pos = axis_x_parked[x] ? axis_range_x[x] : (axis_printrange_x[x]+axis_x_pos_relative[x]*printbed_size[0]);\n echo(\"x carriage\", x, pos);\n\n tx(pos)\n attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],N])\n {\n $show_vit=true;\n\n mirror([x==0?0:1,0,0])\n x_carriage_withmounts(beltpath_sign=x==0?-1:1, with_sensormount=x==0);\n\n x_carriage_extruder(x==0?-1:1);\n }\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n material(Mat_Chrome)\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=true, show_nut=true);\n\n xaxis_end_bucket();\n }\n }\n}\n\nmodule y_axis()\n{\n \/\/ y axis\n attach([[yaxis_belt_path_offset_x,main_depth\/2+extrusion_size,yaxis_motor_offset_z], Y], yaxis_motor_mount_conn)\n yaxis_motor_mount();\n\n extrusion_idler_conn = [[yaxis_belt_path_offset_x, -main_depth\/2-extrusion_size, -extrusion_size+yaxis_idler_offset_z], [0,-1,0]];\n attach(extrusion_idler_conn, yaxis_idler_conn)\n {\n yaxis_idler();\n\n attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)\n yaxis_idler_pulleyblock(show_pulley=true);\n }\n\n translate([yaxis_belt_path_offset_x,0,yaxis_belt_path_offset_z])\n translate([0,main_depth\/2+extrusion_size+yaxis_motor_offset_x,0])\n rotate(90*Y)\n belt_path(\n len=main_depth+yaxis_motor_offset_x-yaxis_idler_pulley_offset_y+extrusion_size,\n belt_width=yaxis_belt_width,\n pulley_d=yaxis_pulley_inner_d,\n belt=yaxis_belt,\n align=-Y, orient=Y);\n\n translate([0,-axis_pos_y,get(LinearBearingInnerDiameter, yaxis_bearing)\/2])\n attach(yaxis_carriage_bearing_mount_conn_bearing, yaxis_belt_mount_conn)\n yaxis_belt_holder();\n\n t(yaxis_carriage_offset)\n {\n \/\/ y smooth rod clamps to frame\n for(x=[-1,1])\n for(y=[-1,1])\n attach([[x*(yaxis_rod_distance\/2),y*(main_depth\/2+extrusion_size\/2),0],Z],mount_rod_clamp_conn_rod)\n mount_rod_clamp_full(rod_d=zaxis_rod_d, thick=4, width=extrusion_size, thread=extrusion_thread, orient=Y);\n\n for(x=[-1,1])\n translate([x*(yaxis_rod_distance\/2), 0, 0])\n {\n \/\/ y smooth rods\n material(Mat_Chrome)\n cylindera(h=yaxis_rod_l,d=yaxis_rod_d, orient=Y);\n\n \/\/ y bearing mounts\n for(y=[-1,1])\n attach([[0,y*(yaxis_bearing_distance_y\/2)-axis_pos_y,0],-Z], yaxis_carriage_bearing_mount_conn_bearing)\n {\n yaxis_carriage_bearing_mount();\n }\n }\n\n attach(yaxis_carriage_bearing_mount_conn_bearing, [Y*axis_pos_y,Z])\n {\n yaxis_carriage();\n\n t(yaxis_carriage_printbed_offset)\n printbed(align=Z);\n }\n }\n\n}\n\nmodule z_axis()\n{\n \/\/ z axis\n for(x=[-1,1])\n {\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(main_height)\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=extrusion_mount_thread\n );\n\n \/*tx(zmotor_mount_rod_offset_x)*\/\n tx(extrusion_size)\n tx(+zaxis_rod_d\/2)\n tz(-extrusion_size\/2)\n mount_rod_clamp_full(\n rod_d=zaxis_rod_d,\n screw_dist=zmotor_mount_clamp_dist,\n thick=5,\n base_thick=5,\n width=extrusion_size,\n thread=zmotor_mount_clamp_thread);\n }\n\n\n tx(x*(main_width\/2))\n mirror([x==-1?0:1,0,0])\n {\n tz(zaxis_motor_offset_z)\n mirror(X)\n zaxis_motor_mount(show_motor=true);\n\n \/\/ z smooth rods\n tx(extrusion_size+zaxis_rod_d\/2)\n tz(zaxis_motor_offset_z-80*mm)\n material(Mat_Chrome)\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, align=Z);\n }\n }\n}\n\nmodule gantry_upper()\n{\n for(y=[-1,1])\n ty(y*(main_upper_dist_y\/2+extrusion_size\/2))\n {\n for(x=[-1,1])\n tx(x*(main_width\/2))\n linear_extrusion(h=main_height, align=-x*X+Z, orient=Z);\n\n tz(main_height)\n linear_extrusion(h=main_upper_width, align=Z, orient=X);\n }\n\n\n ty(-gantry_upper_offset_y)\n for(x=[-1,1])\n tx(x*(main_width\/2))\n tz(main_height)\n linear_extrusion(h=main_upper_dist_y, align=-x*X+Z, orient=Y);\n\n \/\/ upper gantry connectors\n \/*for(x=[-1,1])*\/\n \/*translate([x*(main_width\/2),0,main_height])*\/\n \/*mirror([x==-1?1:0,0,0])*\/\n \/*gantry_upper_connector();*\/\n}\n\nmodule gantry_lower()\n{\n for(z=[-1,1])\n translate([0,0,z*-main_lower_dist_z\/2])\n {\n for(y=[-1,1])\n translate([0, y*(main_depth\/2), 0])\n linear_extrusion(h=main_width, align=[0,y,-1], orient=X);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n linear_extrusion(h=main_depth, align=-x*X-Z, orient=Y);\n }\n\n\n \/\/ lower gantry connectors\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*(main_width\/2),y*(main_depth\/2),-extrusion_size\/2])\n mirror([x==1?0:-1,0,0])\n mirror([0,y==1?1:0,0])\n gantry_lower_connector();\n\n}\n\nmodule enclosure()\n{\n \/\/ inner\n w=56*cm;\n h=56*cm;\n d=58*cm;\n wallthick=2*cm;\n backthick=0.5*cm;\n\n translate([0, 0, h\/2+wallthick])\n {\n \/\/ left\/right walls\n for(x=[-1,1])\n translate([x*w\/2,0,0])\n cubea([wallthick,d,h], align=[x, 0, 0]);\n\n \/\/ back plate\n translate([0,d\/2,0])\n cubea([w,backthick,h], align=[0,-1, 0]);\n\n \/\/ top\/bottom plate\n for(z=[-1,1])\n translate([0,0,z*h\/2])\n cubea([w+wallthick*2,d,wallthick], align=[0,0, z]);\n }\n}\n\nmodule main()\n{\n render();\n translate([0,0,-main_lower_dist_z\/2])\n gantry_lower();\n\n render();\n translate(-zaxis_rod_offset)\n ty(gantry_upper_offset_y)\n gantry_upper();\n\n render();\n x_axis();\n\n render();\n y_axis();\n\n render();\n z_axis();\n\n render();\n translate([-75*mm,0,0])\n translate([0,main_depth\/2,0])\n translate([0,extrusion_size,0])\n translate([0,0,-main_lower_dist_z\/2-extrusion_size\/2])\n power_panel_iec320(orient=[0,-1,0], align=Y);\n\n if(!$preview_mode)\n {\n render();\n translate([0,-main_depth\/2,0])\n translate([0,-extrusion_size\/2,0])\n translate([0,0,-main_lower_dist_z\/2])\n mount_lcd2004(show_gantry=true);\n\n for(x=[-1,1])\n translate([x*(main_width\/2-extrusion_size),main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-x*psu_a_w\/2, -psu_a_d\/2, psu_a_h\/2])\n {\n render();\n psu_a();\n\n render();\n mirror([x==-1?1:0,0,0])\n translate([0, -psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_side();\n\n render();\n translate([0, psu_a_screw_dist_y\/2, 0])\n psu_a_extrusion_bracket_back();\n }\n\n render();\n translate([0,-main_depth\/2,-main_lower_dist_z-extrusion_size])\n translate([-100,100,0])\n rotate([0,0,270])\n import(\"stl\/RAMPS1_4.STL\");\n }\n}\n\n\n\nfeet_height = 8*mm;\ntranslate([0, 0, main_lower_dist_z+extrusion_size*2+feet_height])\nmain();\n\n\/*psu();*\/\n\n\/*%enclosure();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"69f074b09d49fea9d514d9b4bbee7ac391000d1e","subject":"metric-screw: fix bugs","message":"metric-screw: fix bugs\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut=nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut=nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(nut) = lookup(ThreadSize, nut);\nfunction get_screw_head_d(nut) = 2 * lookup(ThreadSize, nut);\n\nmodule screw(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,-1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(nut, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut=MHexNutM3, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n thread = get(MHexNutThread, nut);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(nut, tolerance=1.25, override_h=1000, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread, h=h+.1, tolerance=tolerance, align=[0,0,0]);\n\n if(with_nut)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut, h, tolerance, head_embed, with_nut, nut_offset, orient, align);\n }\n}\n\nmodule screw_thread(thread=ThreadM3, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread=ThreadM3, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, thread[1]);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(nut=MHexNutM3, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n head_d = get_screw_head_d(nut)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut=MHexNutM3, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut=MHexNutM3, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut=MHexNutM3, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n threadsize = lookup(ThreadSize, nut);\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n thread = get(MHexNutThread, nut);\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n\n}\n\nfunction get(key, dict) =\n let(x= search(MHexNutThread, MHexNutM3))\n dict[x[0]];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n \/*$show_vit = true;*\/\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"dbe50da05e49cb73fbeca847f975912a94c02824","subject":"xaxis\/ends\/idlerholder: Fix screw_cut screw length and use nut_trap_cut","message":"xaxis\/ends\/idlerholder: Fix screw_cut screw length and use nut_trap_cut\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+5*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-3*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, trap_axis=[1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=100, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+5*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n\n \/*%rcubea([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n rcubea([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n difference()\n {\n cylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n translate([0,-zaxis_nut[0]\/2-1*mm,0])\n cubea([zaxis_nut[4]*2,zaxis_nut[4]+.2,zaxis_nut[4]+.2], align=[0,-1,1]);\n }\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);*\/\n }\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0]);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]+10*mm;\n cylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n \/*#cubea([sizey+.1, sizey\/2+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);*\/\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,-3*mm])\n nut_trap_cut(nut=MHexNutM3, screw_l=6*mm, trap_axis=[1,0,0], orient=[0,0,1], align=[0,0,-1]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height+v_sum(v_abs(xaxis_beltpath_z_offsets)));\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n\n union()\n {\n cylindera(d=round_d, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n rotate([0,45,0])\n difference()\n {\n cubea([round_d, motor_mount_wall_thick, round_d], align=[0,-1,0]);\n\n cubea([round_d, motor_mount_wall_thick, round_d\/2], align=[0,-1,-1]);\n cubea([round_d\/2, motor_mount_wall_thick, round_d], align=[1,-1,0]);\n }\n }\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+3*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=100, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5*mm, 0, -zaxis_nut[3]])\n screw_cut(thread=ThreadM3, h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw_cut(nut=MHexNutM3, h=10*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n}\n\nmodule xaxis_end_beltpath(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length = 1000)\n{\n diag = pythag_hyp(width,width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(height=xaxis_beltpath_height, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n diag = pythag_hyp(width, width)\/2;\n width = 20*mm;\n\n difference()\n {\n union()\n {\n \/*translate([10*mm, 0,0])*\/\n rcubea([width, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2, 0,0])\n cylindera(h=width\/2,d=xaxis_rod_d, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=100, orient=[1,0,0], align=[1,0,0]);\n\n translate([width\/2-1*mm, 0,0])\n hull()\n {\n rotate([90,0,0])\n translate([0,0,-1])\n screw_nut(MHexNutM4, tolerance=1.15, orient=[1,0,0], align=[-1,0,0]);\n\n translate([0,-10,0])\n rotate([90,0,0])\n screw_nut(MHexNutM4, tolerance=1.15, orient=[1,0,0], align=[-1,0,0]);\n }\n\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2-zrod_offset+xaxis_end_motor_offset[0], xaxis_zaxis_distance_y, z])\n belt_path(main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d+.1, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n\n translate([x*110, 0, 0])\n xaxis_end_idlerholder();\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n\n for(x=[-1,1])\n translate([0,0,xaxis_end_wz\/2])\n translate([x*45,25,0])\n translate([x*105,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"bf9c4d8f128fe0a95f6e80703ea9366d0fb3c2b7","subject":"TrooperDoorLockBushing.scad: initial checkin","message":"TrooperDoorLockBushing.scad: initial checkin\n","repos":"tschutter\/printrbot","old_file":"things\/TrooperDoorLockBushing.scad","new_file":"things\/TrooperDoorLockBushing.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"e33fa6f6a4efdcf53b4293a03aaf0b84b461908c","subject":"Add operator repeatMap()","message":"Add operator repeatMap()\n","repos":"jsconan\/camelSCAD","old_file":"operator\/repeat\/translate.scad","new_file":"operator\/repeat\/translate.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2020 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n offset = center ? -interval * (count - 1) \/ 2 : [0, 0, 0];\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n center = false) {\n\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n center = false) {\n\n repeat(count=countZ, interval=vector3D(intervalZ), center=center) {\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]],\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats the children modules on every position given in the `map`.\n *\n * @param Vector[] map - The list of position at which place the children.\n * @param Vector [offset] - An offset to add on each position.\n * @param Number [x] - The X-coordinate to apply on the offset.\n * @param Number [y] - The Y-coordinate to apply on the offset.\n * @param Number [z] - The Z-coordinate to apply on the offset.\n *\/\nmodule repeatMap(map, offset, x, y, z) {\n offset = apply3D(offset, x, y, z);\n\n for (at = map) {\n translate(offset + vector3D(at)) {\n children();\n }\n }\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2020 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Operators that repeat children modules with respect to particular rules.\n *\n * @package operator\/repeat\n * @author jsconan\n *\/\n\n\/**\n * Repeats the children modules `count` times with the provided `interval`.\n *\n * @param Number [count] - The number of times the children must be repeated.\n * @param Vector [interval] - The interval between each repeated children.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n * @param Number [intervalX] - The X interval between each repeated children\n * (will overwrite the X coordinate in the `interval` vector).\n * @param Number [intervalY] - The Y interval between each repeated children\n * (will overwrite the Y coordinate in the `interval` vector).\n * @param Number [intervalZ] - The Z interval between each repeated children\n * (will overwrite the Z coordinate in the `interval` vector).\n *\/\nmodule repeat(count = 2,\n interval = [0, 0, 0],\n center = false,\n intervalX, intervalY, intervalZ) {\n\n interval = apply3D(interval, intervalX, intervalY, intervalZ);\n offset = center ? -interval * (count - 1) \/ 2 : [0, 0, 0];\n\n for (i = [0 : count - 1]) {\n translate(offset + interval * i) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in two directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat2D(countX = 2,\n countY = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n center = false) {\n\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n}\n\n\/**\n * Repeats the children modules in three directions `count` times with the provided `interval`.\n *\n * @param Number [countX] - The number of times the children must be repeated along the X axis.\n * @param Number [countY] - The number of times the children must be repeated along the Y axis.\n * @param Number [countZ] - The number of times the children must be repeated along the Z axis.\n * @param Vector [intervalX] - The interval between each repeated children along the X axis.\n * @param Vector [intervalY] - The interval between each repeated children along the Y axis.\n * @param Vector [intervalZ] - The interval between each repeated children along the Z axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeat3D(countX = 2,\n countY = 2,\n countZ = 2,\n intervalX = [0, 0, 0],\n intervalY = [0, 0, 0],\n intervalZ = [0, 0, 0],\n center = false) {\n\n repeat(count=countZ, interval=vector3D(intervalZ), center=center) {\n repeat(count=countY, interval=vector3D(intervalY), center=center) {\n repeat(count=countX, interval=vector3D(intervalX), center=center) {\n children();\n }\n }\n }\n}\n\n\/**\n * Repeats horizontally a shape in two directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape2D(size, count = 1, center) {\n size = vector2D(size);\n count = vector2D(count);\n\n repeat2D(\n countX = count[0],\n countY = count[1],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n center = center\n ) {\n children();\n }\n}\n\n\/**\n * Repeats a shape in three directions, the interval is set by the size of the shape.\n * @param Vector size - The size of the shape.\n * @param Vector [count] - The number of shapes on each axis.\n * @param Boolean [center] - Whether or not center the repeated shapes.\n *\/\nmodule repeatShape3D(size, count = 1, center) {\n size = vector3D(size);\n count = vector3D(count);\n\n repeat3D(\n countX = count[0],\n countY = count[1],\n countZ = count[2],\n intervalX = [size[0], 0, 0],\n intervalY = [0, size[1], 0],\n intervalZ = [0, 0, size[2]],\n center = center\n ) {\n children();\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"97b36e7d7539618892db45bc4a328d581099ef40","subject":"x\/carriage: Fix sensor offset echo calc","message":"x\/carriage: Fix sensor offset echo calc\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part, align=-YAXIS);\n\n rotate([90,0,0])\n sensormount(part, align=-YAXIS);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part, align=-YAXIS);\n }\n else if(part==\"vit\")\n {\n \/*\/\/ debug to ensure sensor\/hotend positions are correct*\/\n \/*if(false)*\/\n translate(-80*ZAXIS)\n {\n translate(v_xy(hotend_mount_offset))\n {\n cylindera();\n\n translate(sensormount_sensor_hotend_offset)\n cylindera();\n }\n }\n\n translate(hotend_mount_offset)\n {\n hotmount_clamp();\n }\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n {\n sensormount(part, align=-YAXIS);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,sensormount_thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nsensor_diameter=12;\nsensormount_thickness=5;\nsensormount_OD_cut = 0*mm;\nsensormount_OD = sensor_diameter+2*sensormount_thickness;\nsensormount_h_ = 10;\nsensormount_size = [sensormount_OD,sensormount_OD-2*sensormount_OD_cut,sensormount_h_];\n\nsensormount_sensor_hotend_offset = v_xy(extruder_b_sensormount_offset) - v_y(sensormount_size\/2) - v_xy(hotend_mount_offset);\necho(\"Sensor mount offset\", sensormount_sensor_hotend_offset);\n\nmodule sensormount(part=undef, screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],align=[0,0,0])\n{\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=sensormount_size, align=align, orient=[0,0,1])\n {\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=sensormount_OD, h=sensormount_h_);\n cubea([sensormount_OD,sensormount_OD\/2,sensormount_h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=sensormount_h_+.2);\n\n translate([0,0,-sensormount_h_\/2])\n cylindera(d=sensormount_OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*sensormount_OD\/2, 0])\n cubea([sensor_diameter+sensormount_thickness*2,sensormount_OD_cut,sensormount_h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","old_contents":"include \ninclude \ninclude ;\ninclude ;\ninclude \ninclude \n\nuse ;\nuse ;\nuse ;\nuse ;\nuse ;\nuse \nuse \nuse \n\nxaxis_carriage_bearing_distance = xaxis_rod_distance\/sqrt(2) - 5*mm;\nxaxis_carriage_padding = 1*mm;\nxaxis_carriage_mount_distance = xaxis_carriage_bearing_distance+5*mm;\nxaxis_carriage_mount_offset_z = 0*mm;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_top_width = xaxis_bearing[2]*xaxis_bearings_top + xaxis_carriage_bearing_distance*(xaxis_bearings_top-1) + xaxis_carriage_padding*2;\nxaxis_carriage_bottom_width = xaxis_bearing_bottom[2]*xaxis_bearings_bottom + xaxis_carriage_bearing_distance*(xaxis_bearings_bottom-1) + 2*xaxis_carriage_padding;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 11*mm;\nxaxis_carriage_beltfasten_h = 4*mm;\nxaxis_carriage_beltfasten_dist = xaxis_carriage_beltfasten_w\/2+2*mm;\n\nxaxis_carriage_thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\nextruder_drivegear_d_outer = 12.65*mm;\nextruder_drivegear_d_inner = 11.5*mm;\nextruder_drivegear_h = 11*mm;\n\ngear_60t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 60]\n];\n\ngear_13t_mod05 =[\n[GearMod, 0.5],\n[GearTeeth, 13]\n];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gear_small = gear_13t_mod05;\nextruder_gear_big = gear_60t_mod05;\n\nextruder_gears_distance=calc_gears_center_distance(gear_60t_mod05,gear_13t_mod05);\nextruder_gear_small_PD = calc_gear_PD(extruder_gear_small);\nextruder_gear_big_PD = calc_gear_PD(extruder_gear_big);\nextruder_gear_big_OD = calc_gear_OD(extruder_gear_big);\n\nextruder_gear_big_h = [3.85*mm, 5*mm];\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\nextruder_a_h = 13*mm;\n\nextruder_a_bearing = bearing_MR125;\nextruder_b_bearing = bearing_MR125;\n\nextruder_filapath_offset = [0, -20*mm, 0] + [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_drivegear_offset = extruder_filapath_offset - [extruder_drivegear_d_inner\/2,0,0];\nextruder_b_bearing_offset = extruder_b_drivegear_offset - [0,extruder_drivegear_h\/2+extruder_b_bearing[2]\/2+1*mm];\n\nextruder_b_w = extruder_drivegear_d_outer+15*mm;\n\nextruder_b_mount_thick = 5*mm;\n\nextruder_b_mount_offsets=[\n \/*[extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-15*mm],*\/\n \/*[extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm)-5*mm,0,-25*mm],*\/\n \/*[extruder_filapath_offset[0]-4*mm,0,44.5*mm-15*mm]*\/\n\n [extruder_filapath_offset[0]-1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]+1*(extruder_b_w\/2+4*mm),0,-13*mm],\n [extruder_filapath_offset[0]-4*mm,0,35*mm-15*mm]\n];\n\nextruder_a_bearing_offset_y = [0,-.5*mm,0];\n\nextruder_motor_mount_angle = 45;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_gear_offset_angle = -90;\nextruder_motor_offset_x = cos(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_gear_offset_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [-extruder_filapath_offset[0]+6*mm, 0, 24.5*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 2*mm,\n 0];\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\nextruder_shaft_len_b = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2];\nextruder_shaft_len = extruder_shaft_len_b+extruder_a_h+extruder_offset_a[1];\n\necho(\"Extruder B main shaft length: \", extruder_shaft_len);\n\nextruder_hotmount_clamp_nut = NutHexM3;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage(part=undef, beltpath_sign=1)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage(part=\"pos\");\n x_carriage(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_top_width, xaxis_carriage_thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([xaxis_carriage_top_width,xaxis_carriage_thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([xaxis_carriage_bottom_width, xaxis_carriage_thickness, xaxis_bearing_bottom[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/\/\/ support for extruder mount\n translate(extruder_offset)\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n rcylinder(r=4*mm, align=[0,1,0], orient=[0,1,0]);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n translate([x*extruder_motor_holedist\/2,-extruder_offset_a[1],z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=xaxis_carriage_thickness, orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n\n \/*if(with_sensor_SN04_mount)*\/\n \/*{*\/\n \/*translate(extruder_offset)*\/\n \/*translate(extruder_b_sensor_SN04_mount_offset)*\/\n \/*translate(sensor_SN04_mount_offset)*\/\n \/*cubea([sensor_SN04_size[0], 5*mm, 10*mm], align=[0,1,0]);*\/\n \/*}*\/\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n }\n else if(part==\"neg\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing[2]+2*mm,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n for(x=[-1,1])\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(bearing_type=xaxis_bearing_bottom, ziptie_type=ziptie_type, ziptie_bearing_distance=ziptie_bearing_distance, orient=[1,0,0]);\n cubea([xaxis_bearing_bottom[2]*2*mm,xaxis_bearing_bottom[1]\/2+10,xaxis_bearing_bottom[1]+1*mm], align=[0,1,0]);\n }\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n mirror([1,0,0])\n {\n beltpath(part=part, with_tensioner=beltpath_sign==sign(z));\n }\n }\n else if(part==\"vit\")\n {\n for(x=[-1,1])\n {\n dist_top = (xaxis_bearings_top-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_top,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n dist_bot = (xaxis_bearings_bottom-1) * (xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2;\n translate([\n x*dist_bot,\n xaxis_bearing_bottom[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing_bottom, orient=[1,0,0]);\n }\n }\n}\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_PD, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_PD, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_PD, extruder_gear_big_PD, total_h], align=align, orient=orient, orient_ref=[0,0,1])\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_PD, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule extruder_a_motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n {\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=2*mm, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1,0])\n cylindera(d1=1.1*lookup(NemaRoundExtrusionDiameter, motor),d2=lookup(NemaRoundExtrusionDiameter, motor)*mm\/1.5, h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,-2*mm+.1-h\/2+.1,0])\n cylindera(d=0.5*lookup(NemaRoundExtrusionDiameter, motor), h=h\/2, orient=[0,1,0], align=[0,-1,0]);\n\n \/\/ motor axle\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_thread=ThreadM3;\n motor_nut=NutHexM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n {\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n\nmodule extruder_a(part=undef)\n{\n between_bearing_and_gear=0*mm;\n if(part==undef)\n {\n difference()\n {\n extruder_a(part=\"pos\");\n extruder_a(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n side = 15*mm;\n hull()\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])\n rotate([0,x*extruder_motor_mount_angle,0])\n cylindera(d=extruder_b_mount_dia, h=extruder_a_h, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ support round big gear, needed?\n \/*translate(extruder_gear_big_offset)*\/\n \/*cylindera(d=extruder_gear_big_OD+2*mm+5*mm, h=extruder_a_h, orient=[0,1,0], align=[0,1,0], round_radius=2);*\/\n\n \/\/ support around bearing\n translate([0,extruder_a_h,0])\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1]+5*mm, h=extruder_a_bearing[2], orient=[0,1,0], align=[0,-1,0]);\n }\n }\n else if(part==\"support\")\n {\n translate([0,extruder_a_h,0])\n translate(extruder_gear_big_offset)\n translate([0,.1,0])\n scale(1.5)\n bearing(extruder_a_bearing, extra_h=.3*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n else if(part==\"neg\")\n {\n \/\/cutouts for access to small gear tightscrew\n rotate([0,extruder_motor_mount_angle,0])\n for(i=[-1:0])\n rotate([0,i*90,0])\n translate([0,0,lookup(NemaSideSize, extruder_motor)\/2])\n translate([0,extruder_a_h,0])\n teardrop(d=17*mm, h=lookup(NemaSideSize, extruder_motor)\/2, orient=[0,0,1], roll=90, align=[0,0,-1]);\n\n \/\/cutouts for access to big gear tightscrew\n \/*translate(extruder_gear_big_offset)*\/\n \/*translate([0,extruder_gear_big_h[0],0])*\/\n \/*translate([1,extruder_gear_big_h[1]\/2+1*mm,0])*\/\n \/*for(i=[0:6])*\/\n \/*rotate([0,20+i*-35,0])*\/\n \/*teardrop(d=9*mm, h=1000, orient=[1,0,0], align=[-1,0,0], roll=90);*\/\n\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n translate(extruder_gear_big_offset)\n {\n \/\/ big gear cutout\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n {\n cylindera(d=extruder_gear_big_OD+5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n }\n\n cylindera(d=extruder_shaft_d+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,-1,0]);\n\n translate(extruder_a_bearing_offset_y)\n scale(1.02)\n cylindera(d=extruder_a_bearing[1], h=1000*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n rotate([0,-extruder_motor_mount_angle,0])\n extruder_a_motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,-between_bearing_and_gear,0])\n translate([0,-extruder_a_bearing[2],0])\n extruder_gear_big(orient=-YAXIS, align=-YAXIS);\n\n \/\/ bearing\n translate(extruder_a_bearing_offset_y)\n bearing(extruder_a_bearing, orient=[0,1,0], align=[0,-1,0]);\n\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n }\n }\n rotate([0,extruder_motor_mount_angle,0])\n {\n translate([0,-1*mm,0])\n {\n %motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n\n \/\/ motor heatsink\n translate([0,lookup(NemaLengthMedium, extruder_motor)+2*mm,0])\n {\n w = lookup(NemaSideSize, extruder_motor);\n color([.5,.5,.5])\n cubea([40*mm,11*mm,40*mm], align=[0,1,0]);\n\n \/\/ fan\n color([.9,.9,.9])\n translate([0,11*mm,0])\n {\n difference()\n {\n cubea([40*mm,10*mm,40*mm], align=YAXIS);\n cylindera(d=38*mm, h=10*mm+.1, orient=YAXIS, align=[0,-1,0]);\n }\n\n }\n }\n\n }\n\n }\n\n }\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\n\/\/ relative to hotend mount\nhotmount_clamp_offset = [0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2];\n\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = NutKnurlM3_5_42;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_w = [\n2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad),\n2*(hotmount_clamp_screws_dist - hotmount_clamp_screw_dia\/2),\n];\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotend_cut(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[0,-1,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp(part=undef)\n{\n if(part==undef)\n {\n difference()\n {\n hotmount_clamp(part=\"pos\");\n hotmount_clamp(part=\"neg\");\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0]);\n }\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[1], hotmount_d_h[1][0], hotmount_clamp_height], align=[0,1,0]);\n }\n }\n else if(part==\"neg\")\n {\n hotend_cut(extend_cut = false);\n\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\nmodule hotmount_clamp_cut()\n{\n \/\/ clamp mount screw holes\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(i=[-1,1])\n translate([i*hotmount_clamp_screws_dist, 0, 0])\n screw_cut(thread=extruder_hotmount_clamp_thread, h=30*mm, nut_offset=0*mm, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ hotmount clamp cutout\n translate([0, -hotmount_clamp_offset-extruder_filapath_offset[1], 0])\n translate([0, 0, 0-hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_w[0], hotmount_clamp_thickness, hotmount_clamp_height], align=[0,1,0], extrasize=[0,100,0], extrasize_align=[0,-1,0]);\n }\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2+.1])\n {\n rcubea([hotmount_clamp_w[1], 1000, hotmount_clamp_height+.2], align=[0,-1,0]);\n }\n\n hotend_cut(extend_cut = true);\n}\n\nhotmount_clamp_offset = abs(extruder_filapath_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+4*mm;\n\nmodule extruder_b(part=undef, with_sensormount=true)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n }\n }\n else if(part==\"pos\")\n {\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n \/\/ mount onto carriage\n hull()\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n cylindera(d=extruder_b_mount_dia, h=extruder_b_mount_thick, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n\n if(with_sensormount)\n intersection()\n {\n translate(extruder_b_sensormount_offset)\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n cubea([1000,extruder_b_mount_thick,1000], align=[0,-1,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n rotate([-90,0,0])\n hull()\n {\n linear_extrude(1)\n projection()\n rotate([90,0,0])\n sensormount(part);\n\n rotate([90,0,0])\n translate(-[0,extruder_b_sensormount_offset[1],0])\n sensormount(part);\n\n rotate([90,0,0])\n sensormount(part);\n }\n\n hull()\n {\n \/\/ hobbed gear support\n translate(extruder_b_drivegear_offset)\n cylindera(d=extruder_drivegear_d_outer+5*mm, h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2, orient=[0,1,0], align=[0,0,0], round_radius=2);\n\n \/\/ hobbed gear bearing support\n translate(extruder_b_bearing_offset)\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+2*mm, orient=YAXIS, align=YAXIS, round_radius=2);\n\n \/\/ guidler screw nuts support\n translate(extruder_b_drivegear_offset)\n translate([extruder_b_guidler_screw_offset_x, 0, extruder_b_guidler_screw_offset_h])\n {\n for(i=[-1,1])\n translate([0,i*(guidler_screws_distance), 0])\n cylindera(h=house_guidler_screw_h, d=guidler_screws_mount_d, orient=[1,0,0], round_radius=2);\n }\n\n \/\/ guidler mount\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate(hotend_mount_offset)\n {\n rcubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n translate([0,-extruder_b_drivegear_offset[1],0])\n rcubea([extruder_b_w, abs(extruder_b_drivegear_offset[1]), hotmount_outer_size_h], align=[0,-1,-1]);\n }\n\n \/\/ support for clamp mount screw holes\n translate(hotend_mount_offset)\n translate([0, 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n for(x=[-1,1])\n {\n translate([x*hotmount_clamp_screws_dist, 0, 0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[0,1,0]);\n }\n }\n\n }\n else if(part==\"neg\")\n {\n \/\/ mount onto carriage\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n translate([0, -extruder_b_mount_thick, 0])\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=true, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ drive gear window cutout\n translate(extruder_b_drivegear_offset)\n translate([-.1,-.5*mm,0])\n translate(-[extruder_drivegear_d_inner,0,0])\n {\n s=[extruder_drivegear_d_inner,extruder_drivegear_h+1*mm,extruder_drivegear_d_inner];\n cubea(s, align=[0,0,0], extrasize=[0,3*mm,0], extrasize_align=YAXIS);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n guidler_w_cut = guidler_w+2*mm;\n guidler_w_cut_inner = guidler_bearing[2]+1*mm;\n guidler_w_cut_ext = 1000;\n difference()\n {\n union()\n {\n \/*hull()*\/\n {\n \/*hull()*\/\n {\n translate([extruder_drivegear_d_inner\/2,0,0])\n translate(3*mm*XAXIS)\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w_cut,guidler_bearing[1]*2], align=[1,0,1]);\n }\n\n \/\/ cut for guidler bearing\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[1]+2*mm, h=guidler_w_cut_inner, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ cut for guidler\n translate(extruder_guidler_mount_off)\n translate(-[-guidler_mount_off[1],0,guidler_mount_off[2]])\n cylindera(d=guidler_bearing[0]+4*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off[1]),abs(guidler_mount_off[2]))+(guidler_bearing[1])\/2;\n\n \/\/ cutout pivot to make sure guidler can rotate out\n translate([0,-guidler_w_cut\/2,0])\n translate(extruder_guidler_mount_off)\n translate([0,0,-guidler_mount_d\/2])\n rotate([0,90,90])\n pie_slice(guidler_pivot_r, 130, 270, guidler_w_cut);\n }\n }\n translate(extruder_guidler_mount_off)\n {\n difference()\n {\n cylindera(d=guidler_mount_d+3*mm, h=guidler_w_cut, orient=[0,1,0], align=[0,0,0]);\n\n cylindera(d=guidler_mount_d+3*mm+.1, h=guidler_mount_w, orient=[0,1,0], align=[0,0,0]);\n }\n\n translate(-[0,extruder_b_drivegear_offset[1],0])\n translate(-[0,extruder_b_mount_thickness\/2,0])\n hull()\n {\n cylindera(d=guidler_screws_thread_dia+3*mm, h=guidler_w_cut_ext, orient=[0,1,0], align=[0,-1,0]);\n translate([0,0,-(guidler_screws_thread_dia+0*mm)])\n cubea([10,guidler_w_cut_ext,100], align=[1,-1,1]);\n }\n }\n }\n \/\/ dont cut away the guilder mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n cubea([guidler_mount_d, guidler_mount_w, 10], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ guidler screws cutouts\n translate(extruder_b_drivegear_offset)\n for(y=[-1,1])\n translate([extruder_b_guidler_screw_offset_x, y*(guidler_screws_distance), extruder_b_guidler_screw_offset_h])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([1000, r*2, r]);\n\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n cylindera(r=r,h=1000, orient=[1,0,0]);\n\n \/\/ guidler screw nuts drop-in slots\n nut_trap_cut(nut=guidler_screws_nut, screw_l=1000, screw_l_extra=1000, trap_axis=[0,0,1], orient=[1,0,0]);\n }\n\n \/\/ guidler mount screw\n translate(extruder_b_drivegear_offset)\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ cutout for hobbed gear (inner)\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_d_outer\/2,0])\n cylindera(\n h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+1.1*mm,\n d=extruder_drivegear_d_outer+1.5*mm,\n orient=[0,1,0],\n align=[0,1,0]\n );\n\n \/\/ filament path\n translate(extruder_filapath_offset)\n {\n \/\/ above drive gear\n cylindera(h=1000, d=filament_d+.7*mm, orient=[0,0,1], align=[0,0,1]);\n\n \/\/ below drive gear (into hotend)\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,-1]);\n }\n\n \/\/ b bearing cutout\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+1000, align=YAXIS, orient=YAXIS);\n\n \/\/ drive gear cutout\n translate(extruder_b_drivegear_offset)\n translate([0,-extruder_drivegear_h\/2+1*mm,0])\n cylindera(h=abs(extruder_b_drivegear_offset[1])+extruder_drivegear_h\/2+extruder_b_bearing[2]+1*mm, d=extruder_b_bearing[1]+.1*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ extruder shaft\n translate(extruder_b_bearing_offset)\n translate([0,-extruder_b_bearing[2]-.5*mm,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n\n translate(hotend_mount_offset)\n {\n hotend_cut(extend_cut=true);\n hotmount_clamp(part=part);\n hotmount_clamp_cut();\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n else if(part==\"vit\")\n {\n translate(hotend_mount_offset)\n hotmount_clamp();\n\n translate(extruder_b_bearing_offset)\n {\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,0,0]);\n\n translate([0,-extruder_b_bearing[2]\/2,0])\n cylindera(h=extruder_shaft_len+.2, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n\n translate(extruder_b_drivegear_offset)\n {\n \/\/ drive gear\n cylindera(h=extruder_drivegear_h, d=extruder_drivegear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*extruder_drivegear_h\/2,0])\n {\n cylindera(h=extruder_drivegear_h\/3, d=extruder_drivegear_d_outer, orient=[0,1,0], align=[0,-y,0]);\n }\n }\n\n if(with_sensormount)\n translate(extruder_b_sensormount_offset)\n sensormount(part);\n }\n}\n\n\/\/ Final part\nmodule x_carriage_withmounts(part, show_vitamins=false, beltpath_sign)\n{\n if(part==undef)\n {\n difference()\n {\n x_carriage_withmounts(part=\"pos\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n x_carriage_withmounts(part=\"neg\", show_vitamins=show_vitamins, beltpath_sign=beltpath_sign);\n }\n\n if(show_vitamins)\n {\n x_carriage(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n \/*hull()*\/\n \/*union()*\/\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ endstop bumper\n translate([-xaxis_carriage_top_width\/2,0,xaxis_end_wz\/2])\n rcubea(size=xaxis_endstop_size, align=YAXIS+ZAXIS+XAXIS);\n\n \/\/ extruder A mount\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n {\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=extruder_b_mount_dia, h=extruder_offset_a[1], orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n }\n }\n }\n else if(part==\"neg\")\n {\n x_carriage(part=part, beltpath_sign=beltpath_sign);\n\n \/\/ rod between extruder part A and B\n translate(extruder_offset)\n {\n cylindera(h=100*mm, d=extruder_shaft_d+5*mm, orient=[0,1,0], align=[0,0,0]);\n }\n\n \/\/ extruder A mount cutout\n translate(extruder_offset)\n translate(extruder_offset_a)\n translate(-[0,extruder_offset_a[1],0])\n {\n rotate([0,extruder_motor_mount_angle,0])\n for(x=[-1,1])\n for(z=[-1,1])\n if(x!=1||z!=-1)\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n screw_cut(\n nut=NutHexM3,\n h=extruder_offset_a[1]+.2,\n head_embed=true,\n with_nut=false,\n orient=[0,1,0],\n align=[0,1,0]\n );\n }\n\n \/\/ extruder B mount cutout\n translate(extruder_offset)\n translate([0,-extruder_b_mount_thick,0])\n {\n for(pos=extruder_b_mount_offsets)\n translate(pos)\n {\n screw_cut(nut=NutKnurlM3_3_42, h=extruder_b_mount_thick+xaxis_carriage_thickness-xaxis_beltpath_width\/2, head_embed=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n}\n\n\/\/ as per E3D spec\nhotend_height = 63*mm;\nhotend_mount_offset = extruder_filapath_offset + [0,0,-extruder_drivegear_d_outer\/2 + -5*mm];\nhotend_mount_conn = [hotend_mount_offset, [0,0,1]];\nhotend_conn = [[0,21.475,0], [0,1,0]];\n\nmodule x_extruder_hotend()\n{\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/*translate([0,-20,0])*\/\n \/*translate(extruder_offset)*\/\n \/*translate(hotend_mount_offset)*\/\n \/*cubea([10,10,hotend_height], align=[0,0,-1]);*\/\n}\n\nguidler_bearing = bearing_MR105;\n\nguidler_mount_off = [0,-guidler_bearing[1]\/1.8, -guidler_bearing[1]\/1.4];\nextruder_guidler_mount_off = [-.3*mm -guidler_mount_off[1]+extruder_drivegear_d_outer\/2+guidler_bearing[1]\/2,0,guidler_mount_off[2]];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\nguidler_bolt_h=guidler_bearing[2]+4*mm;\n\nguidler_w=max(guidler_mount_w+9*mm, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=7;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_nut = NutHexM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = guidler_screws_thread_dia*2+5*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+10*mm;\n\nextruder_b_guidler_screw_offset_h = 15*mm + guidler_screws_thread_dia -6*mm;\nextruder_b_guidler_screw_offset_x = 2*mm;\n\nextruder_b_mount_thickness = 10*mm;\nextruder_b_mount_dia = 7*mm;\n\nx_carriage_w = max(xaxis_carriage_top_width, xaxis_carriage_bottom_width, sqrt(2)*(extruder_motor_holedist+extruder_b_mount_dia));\n\nmodule extruder_guidler(part, show_vit=false)\n{\n if(part==undef)\n {\n difference()\n {\n extruder_guidler(part=\"pos\");\n extruder_guidler(part=\"neg\");\n }\n if(show_vit)\n {\n extruder_guidler(part=\"vit\");\n }\n }\n else if(part==\"pos\")\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]+2*mm,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, 0])\n rcubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0], round_radius=2);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, guidler_h])\n rcubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n \/\/ tab above screw mount, for easier open\n translate([0,guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h+guidler_screws_thread_dia\/2*3])\n cylindera(r=5*mm,h=guidler_d\/2, align=[0,1,0], orient=[0,1,0], round_radius=2);\n\n }\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off[1]-guidler_mount_d\/2, extruder_b_guidler_screw_offset_h])\n {\n \/\/ offset for spring\n translate(7*mm*-YAXIS)\n screw_cut(thread=guidler_screws_thread, h=40*mm, orient=YAXIS, align=YAXIS);\n\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,guidler_d+.2,r], align=[0,1,0]);\n for(v=[-1,1])\n translate([0, -0.1, 0])\n translate([0, 0, v*r\/2])\n cylindera(r=r,h=guidler_d+.2, align=[0,1,0], orient=[0,1,0]);\n }\n\n bearing_cut_w = guidler_bearing[2]+1*mm;\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2+2*mm,0])\n cubea([bearing_cut_w, 100, guidler_bearing[1]\/2+2*mm], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off[1], guidler_mount_off[2]])\n cylindera(d=guidler_mount_d+2*mm,h=guidler_mount_w+1*mm, orient=[1,0,0]);\n\n \/\/ mount screw hole\n translate([-guidler_w\/2,guidler_mount_off[1], guidler_mount_off[2]])\n screw_cut(thread=guidler_screws_thread, h=16*mm, orient=XAXIS, align=XAXIS);\n\n \/\/ guidler bearing screw holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]+3*mm, h=guidler_bearing[2]+.5*mm, orient=[1,0,0]);\n }\n else if(part==\"vit\")\n {\n bearing(guidler_bearing, orient=[1,0,0]);\n\n \/\/ bearing bolt\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nmodule sensor_LJ12A3_mount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n}\n\nmodule sensormount(part=undef, height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n align=[0,-1,0];\n\n OD_cut = 0*mm;\n OD = sensor_diameter+2*thickness;\n h_ = height;\n sensor_h = v_sum(sensor_height,2);\n\n size_align(size=[OD,OD-2*OD_cut,h_], align=align, orient=[0,0,1])\n {\n\n if(part == \"pos\")\n {\n \/\/Sensor mount\n cylindera(d=OD, h=h_);\n cubea([OD,OD\/2,h_], align=[0,1,0]);\n }\n\n else if(part == \"neg\")\n {\n translate([0,0,h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,1]);\n\n cylindera(d=sensor_diameter+0,5, h=h_+.2);\n\n translate([0,0,-h_\/2])\n cylindera(d=OD+1*mm, h=sensor_h, align=[0,0,-1]);\n\n for(y=[-1,1])\n translate([0,y*OD\/2, 0])\n cubea([sensor_diameter+thickness*2,OD_cut,h_+2*e],[0,-y,0]);\n }\n else if(part == \"vit\")\n {\n translate([0,0,sensor_h\/2])\n {\n for(e=v_itrlen(sensor_height))\n {\n hs=v_sum(sensor_height, e);\n translate([0,0,-hs])\n {\n if(e==0||e==2)\n {\n color([0.3,.4,0])\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n else\n {\n cylindera(d=sensor_diameter,h=sensor_height[e], align=[0,0,1]);\n }\n }\n }\n }\n }\n }\n}\n\nmodule e3d_heatsink_duct()\n{\n hotend_heatsink_diameter = 25;\n hotend_heatsink_height = 32;\n hotend_heatsink_offset = 16; \/\/ offset off bottom of body that heatsink starts\n\n length = 55;\n width = 40;\n height = hotend_heatsink_offset+hotend_heatsink_height;\n\n fan_hole_dist = 32;\n m3_hexnut_dia = 6.4;\n m3_hexnut_flat_dia = 5.54;\n m3_hexnut_thickness = 2.4;\n\n difference() {\n union() {\n \/\/cube([length, width, hotend_heatsink_offset+hotend_heatsink_height]);\n hull() {\n translate([0,0,20]) cube([20,40,height-20]);\n translate([50,5+17.5,height\/2+20\/2]) cube([5,30,height-20],center=true);\n translate([1,20,20]) rotate([0, 90, 0]) cylinder(r=38\/2,h=1,center=true);\n }\n }\n\n \/\/ hotend heatsink hole\n translate([50, 5+17.75, hotend_heatsink_offset]) cylinder(r=hotend_heatsink_diameter\/2, hotend_heatsink_height+1);\n translate([50, 5+17.75, 0]) cylinder(r=25\/2, hotend_heatsink_offset+1);\n\n \/\/ first portion of fan duct\n difference() {\n hull() {\n translate([-1,20,20]) rotate([0, 90, 0]) cylinder(r=35\/2,h=1,center=true);\n translate([50,5+17.5,24+25\/2]) cube([20,20,20],center=true);\n }\n \/*\/\/ support material ribs*\/\n \/*translate([0,12,0]) cube([length, 1, height]);*\/\n \/*translate([0,18,0]) cube([length, 1, height]);*\/\n \/*translate([0,23,0]) cube([length, 1, height]);*\/\n \/*translate([0,28,0]) cube([length, 1, height]);*\/\n }\n\n \/\/ m3 traps for fan\n for (end = [-1,1]) {\n translate([-1,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) cylinder(r=1.6,h=30,center=true, $fn=7);\n translate([5,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([0,90,0]) rotate([0,0,30]) cylinder(r=m3_hexnut_dia\/2,h=m3_hexnut_thickness,center=true,$fn=6);\n translate([5-m3_hexnut_thickness\/2,20+end*fan_hole_dist\/2,20+fan_hole_dist\/2]) rotate([end*-90,0,0]) translate([0,-m3_hexnut_flat_dia\/2,0]) cube([m3_hexnut_thickness,m3_hexnut_flat_dia,10]);\n }\n\n if (1) {\n \/\/ clearance existing fan mounts\n cube([10,width,8]);\n\n \/\/ hole for clearance for wingnuts\n \/\/translate([10,0,0]) cube([length-10,width+1,10]);\n\n translate([25, 5+17.75, 9]) cylinder(r=2.5, h=5, center=true);\n\n }\n else\n {\n \/\/ whatever. just get rid of everything for the bottom whatever mm\n \/\/translate([-1,-1,-1]) cube([length+2,width+2,18+1]);\n }\n\n \/\/ clearance for bearing holder\n translate([18,0,0]) cube([40,5,25]);\n translate([10-3,0,0]) cube([50,9,6.5]);\n\n \/\/ TODO; clearance for extruder mounting bolt\n }\n}\n\nmodule beltpath(part, with_tensioner=true)\n{\n belt_t2 = belt_t2_thickness(xaxis_belt) + .2*mm;\n tension_screw_nut = NutHexM3;\n tension_screw_thread = ThreadM3;\n tension_screw_dia = lookup(ThreadSize, tension_screw_thread);\n angle_screw_thread = ThreadM4;\n angle_screw_dia = 3.25*mm;\n width = max(xaxis_carriage_top_width,55*mm);\n height = belt_t2*8;\n\n if(part==undef)\n {\n difference()\n {\n beltpath(\"pos\", with_tensioner=with_tensioner);\n beltpath(\"neg\", with_tensioner=with_tensioner);\n }\n }\n else if(part==\"pos\")\n {\n translate([0, -xaxis_carriage_beltpath_offset_y, 0])\n rcubea([width, xaxis_carriage_thickness, height], align=[0,1,0]);\n\n rcubea([width, xaxis_belt_width, height], extrasize=[0,angle_screw_dia+3*mm,0], extrasize_align=-YAXIS);\n }\n else if(part==\"neg\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n {\n if(with_tensioner)\n {\n translate([0,0,belt_t2\/4])\n cubea([1000, xaxis_belt_width+.1, belt_t2]);\n\n \/*translate([0,0,angle_screw_dia\/2])*\/\n {\n hull()\n {\n for(i=[-1,1])\n translate(i*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+belt_t2, h=xaxis_belt_width+.1, orient=YAXIS);\n }\n\n hull()\n {\n \/*translate(*8*mm*XAXIS)*\/\n for(i=[-1,1])\n translate(i*10*mm*XAXIS)\n translate(-xaxis_belt_width*YAXIS)\n cylindera(d=angle_screw_dia+.2, h=10000, orient=YAXIS, align=YAXIS);\n }\n\n translate([0,-xaxis_belt_width,0])\n {\n \/\/ cut for angle screw\n translate(-1*2*mm*YAXIS)\n translate(-1*11*mm*XAXIS)\n cylindera(d=angle_screw_dia+.2*mm, h=1000, orient=XAXIS, align=XAXIS);\n\n translate(-1*11*mm*XAXIS)\n nut_trap_cut(nut=tension_screw_nut, orient=-XAXIS, trap_axis=YAXIS);\n\n \/\/ cut for tension screw\n translate(-1*25*mm*XAXIS)\n \/*translate(-width\/2*XAXIS)*\/\n screw_cut(nut=tension_screw_nut, h=25*mm, with_head=true, head_embed=true, with_nut=false, orient=XAXIS, align=XAXIS);\n }\n }\n\n }\n else\n {\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*1.8], extrasize=[0,0,1*mm], extrasize_align=ZAXIS);\n }\n\n translate(xaxis_pulley_inner_d*ZAXIS)\n cubea([1000, xaxis_belt_width+3*mm, belt_t2*2]);\n }\n }\n else if(part==\"vit\")\n {\n translate(-xaxis_pulley_inner_d\/2*ZAXIS)\n if(with_tensioner)\n {\n \/\/ 90 angle metal screw\n translate([0,0,angle_screw_dia\/2])\n {\n translate([0,-angle_screw_dia\/2,0])\n cylindera(d=angle_screw_dia+.2*mm, h=25*mm, orient=XAXIS, align=XAXIS);\n cylindera(d=angle_screw_dia+.2*mm, h=5*mm, orient=YAXIS, align=YAXIS+XAXIS);\n\n \/*translate([0,-xaxis_belt_width,0])*\/\n \/*{*\/\n \/*translate(-1*11*mm*XAXIS)*\/\n \/*#screw(thread=tension_screw_thread, orient=XAXIS, align=-XAXIS);*\/\n \/*}*\/\n }\n }\n }\n}\n\nmodule test_beltpath(x)\n{\n difference()\n {\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"pos\", with_tensioner=sign(z)==x);\n }\n\n for(z=xaxis_beltpath_z_offsets)\n translate([0, xaxis_carriage_beltpath_offset_y, z])\n mirror([0,0,sign(z)<1?1:0])\n {\n beltpath(part=\"neg\", with_tensioner=sign(z)==x);\n }\n }\n\n \/*for(z=xaxis_beltpath_z_offsets)*\/\n \/*translate([0, xaxis_carriage_beltpath_offset_y, z])*\/\n \/*mirror([0,0,sign(z)<1?1:0])*\/\n \/*{*\/\n \/*%beltpath(part=\"vit\", with_tensioner=sign(z)==x);*\/\n \/*}*\/\n}\n\n\/\/ flip for printing\n\/*e3d_heatsink_duct();*\/\n\n\/\/ extruder guidler mount point\nextruder_conn_guidler = [ extruder_guidler_mount_off, [0,1,0]];\n\n\/\/ guidler connection point\nextruder_guidler_conn_mount = [ guidler_mount_off, [1,0,0]];\nextruder_guidler_roll = 45;\n\nif(false)\nattach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n{\n extruder_guidler(show_extras=true);\n}\n\nif(false)\nextruder_a(show_vitamins=true);\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.5,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\ncolor_filament = [0,0,0, alpha];\n \/\/ belt path cutout\n\n\/*extruder_b_sensormount_offset=[35,-7,-41];*\/\nextruder_b_sensormount_offset=[-25,-7,-41];\n\nexplode=[0,0,0];\n\/*explode=[0,10,0];*\/\n\nmodule x_carriage_full(show_vitamins=true)\n{\n x_carriage_withmounts(show_vitamins=show_vitamins);\n\n x_carriage_extruder(show_vitamins=show_vitamins);\n}\n\nmodule x_carriage_extruder(show_vitamins=false, with_sensormount=false)\n{\n translate(extruder_offset)\n {\n translate([explode[0],explode[1],explode[2]])\n translate(extruder_offset_a)\n {\n extruder_a();\n if(show_vitamins)\n extruder_a(part=\"vit\");\n }\n\n translate([explode[0],-explode[1],explode[2]])\n {\n difference()\n {\n extruder_b(part=\"pos\", with_sensormount=with_sensormount);\n\n extruder_b(part=\"neg\", with_sensormount=with_sensormount);\n\n \/*translate([0,-21,0])*\/\n \/*cubea([1000,1000,1000], align=[0,-1,0]);*\/\n }\n }\n\n if(show_vitamins)\n translate([explode[0],-explode[1],explode[2]])\n extruder_b(part=\"vit\", with_sensormount=with_sensormount);\n\n translate([explode[0],-explode[1],explode[2]])\n translate(extruder_b_drivegear_offset)\n attach(extruder_conn_guidler, extruder_guidler_conn_mount, extruder_guidler_roll)\n {\n extruder_guidler(show_vit=true);\n }\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-95,53,20])*\/\n \/*rotate([-152,0,0])*\/\n \/*import(\"stl\/E3D_40_mm_Duct.stl\");*\/\n\n \/*translate([explode[0],-explode[1],explode[2]])*\/\n \/*translate([-123.5,78.5,-54])*\/\n \/*rotate([0,0,-90])*\/\n \/*import(\"stl\/E3D_30_mm_Duct.stl\");*\/\n\n translate([explode[0],-explode[1],explode[2]])\n color(color_hotend)\n attach(hotend_mount_conn, hotend_conn, roll=-90)\n {\n x_extruder_hotend();\n }\n\n translate([explode[0],-explode[1],explode[2]])\n \/\/filament path\n color(color_filament)\n translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\nmodule part_x_carriage_left()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n x_carriage_withmounts(beltpath_sign=-1);\n}\n\nmodule part_x_carriage_left_extruder_a()\n{\n rotate([-90,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_left_extruder_b()\n{\n rotate([-90,0,0])\n extruder_b(with_sensormount=true);\n}\n\nmodule part_x_carriage_right()\n{\n rotate([0,0,180])\n rotate([90,0,0])\n mirror([1,0,0])\n x_carriage_withmounts(beltpath_sign=1);\n}\n\nmodule part_x_carriage_right_extruder_a()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_a();\n}\n\nmodule part_x_carriage_right_extruder_b()\n{\n rotate([-90,0,0])\n mirror([1,0,0])\n extruder_b(with_sensormount=false);\n}\n\nmodule part_x_carriage_hotmount_clamp()\n{\n translate([0, 0, hotmount_d_h[1][1]\/2])\n translate([0, 0, 0+hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n}\n\nmodule part_x_carriage_extruder_guidler()\n{\n guidler_conn_layflat = [ [0, guidler_mount_off[1]-guidler_mount_d\/2, guidler_mount_off[2]], [0,-1,0]]; \n attach([[0*mm,0*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n extruder_guidler(show_vit=false);\n }\n}\n\nif(false)\n{\n \/*for(x=[-1])*\/\n for(x=[-1,1])\n translate(x*40*mm*XAXIS)\n mirror([x<0?0:1,0,0])\n {\n x_carriage_withmounts(show_vitamins=false, beltpath_sign=x);\n\n x_carriage_extruder(show_vitamins=true, with_sensormount=x<0);\n\n \/*mirror([x>0?0:1,0,0])*\/\n \/*test_beltpath(x=x);*\/\n }\n\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-main_width\/2, xaxis_carriage_beltpath_offset_y, z])\n rotate([90,0,0])\n belt_path(main_width, xaxis_belt_width, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n\n \/*for(offset=[0,1])*\/\n \/*translate([offset*60,0,0])*\/\n \/*rotate([90,0,0])*\/\n \/*x_carriage_withmounts(show_vitamins=false, beltpath_sign=offset);*\/\n\n for(x=[-1,1])\n translate([x*200,0,0])\n translate([0, xaxis_carriage_beltpath_offset_y, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9de40e5efc7dccb137b3eb8111390065f67fad3c","subject":"Tweaks for fit.","message":"Tweaks for fit.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.5;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.3mm for just a smidge more...\n \/\/ * 2016-06-17: 3.3 is *still* too tight in a few connections!\n \/\/ Most are fine, but we need to handle the variability\n \/\/ in material thickness, so...\n \/\/ 3.5mm. (Final?)\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 195 + thickness; \/\/ z = 19.5cm to accomodate 16cm tank height plus wires for shock\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ height of insert for rear tank support\ninsert_height = height\/6;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover(spacing=1);\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n} else if (DXF_REAR_SUPPORT) {\n projection() rotate(a=[90,0,0]) rear_support(1);\n translate([overhang*3,0,0])\n projection() rotate(a=[90,0,0]) rear_support(2);\n translate([overhang*6,0,0])\n projection() rotate(a=[90,0,0]) rear_support(3);\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n rear_support();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x, tab_extra=0) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ bottom opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ top openings for wires (electrical stim)\n translate([0, depth-15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n translate([0, 15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2], extra=tab_extra);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n translate([thickness+epsilon,0,-insert_height\/2])\n rear_support();\n wire_opening();\n power_jack_cutout();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n if (center) {\n rounded_rect_centered(x,y,z, radius);\n }\n else {\n translate([x\/2, y\/2, z\/2])\n rounded_rect_centered(x,y,z, radius);\n }\n}\n \nmodule rounded_rect_centered(x,y,z, radius) {\n difference() {\n cube([x,y,z], center=true);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover(spacing=0) {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Grey\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n \/\/ spacing added to make separate pieces for laser cutting\n translate([spacing,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc, tab_extra=5);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans, extra=0) {\n \/\/ \"extra\" is *removed* from width of cubes\n \/\/ so that resulting tabs (after differencing this) are *wider*\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w + extra\/2, -thickness\/2, -thickness\/2])\n cube([w-extra, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule power_jack_cutout() {\n translate([width, depth-40, overhang+30])\n rotate(a=[0,90,0])\n cylinder(d=8, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule rear_support(num_high=1) {\n support_height = num_high*height;\n ypos = depth\/2-thickness\/2;\n color(\"Orange\")\n translate([width+thickness\/2, ypos, 0])\n union() {\n \/\/ entering-tank part\n translate([-overhang, 0, insert_height\/2+overhang])\n difference() {\n rounded_rect(overhang*2, thickness, insert_height, radius=overhang\/2);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n cube([thickness, thickness*2, height]);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n difference() {\n translate([0,0,overhang*0.8])\n cube([thickness+overhang, thickness*2, height]);\n translate([overhang+thickness, 0, overhang*0.8])\n rotate(a=[90,0,0])\n cylinder(d=overhang*2, h=100, center=true);\n }\n }\n \/\/ connect and fill in one of the rounded corners\n cube([overhang, thickness, insert_height\/2+overhang+overhang]);\n \/\/ below-tank part\n translate([0, 0, -support_height])\n cube([overhang, thickness, support_height]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.3;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n \/\/ * 2016-02-26: Still tighter than is ideal for sliding parts together.\n \/\/ 3.3mm for just a smidge more...\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 195 + thickness; \/\/ z = 19.5cm to accomodate 16cm tank height plus wires for shock\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ height of insert for rear tank support\ninsert_height = height\/6;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 65;\nview_opening_right = 78;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 24;\nview_opening_height = 96;\n\n\/\/ camera mounting measurements\ncamera_hole_diameter = 1.7; \/\/ bolts are m2; 2mm nominal, 1.9mm actual, and a bit less for the beam width\ncamera_hole_horiz_offset = 21\/2; \/\/ 21mm between mounting holes, horizontally (so half that away from the camera center\ncamera_hole_vert_offset = 12.5; \/\/ 12.5mm between mounting holes, vertically (one set on the camera center, one set up that much from center)\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover(spacing=1);\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n} else if (DXF_REAR_SUPPORT) {\n projection() rotate(a=[90,0,0]) rear_support(1);\n translate([overhang*3,0,0])\n projection() rotate(a=[90,0,0]) rear_support(2);\n translate([overhang*6,0,0])\n projection() rotate(a=[90,0,0]) rear_support(3);\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n rear_support();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x, tab_extra=0) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ bottom opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ top openings for wires (electrical stim)\n translate([0, depth-15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n translate([0, 15, height-thickness\/2])\n rotate(a=[0,90,0])\n cylinder(r=5, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2], extra=tab_extra);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n translate([thickness+epsilon,0,-insert_height\/2])\n rear_support();\n wire_opening();\n power_jack_cutout();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n union() {\n cube([thickness*2,10,10], center=true);\n translate([0, camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n translate([0, -camera_hole_horiz_offset, camera_hole_vert_offset])\n rotate(a=[0, 90, 0])\n cylinder(d=camera_hole_diameter, h=100, center=true);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n if (center) {\n rounded_rect_centered(x,y,z, radius);\n }\n else {\n translate([x\/2, y\/2, z\/2])\n rounded_rect_centered(x,y,z, radius);\n }\n}\n \nmodule rounded_rect_centered(x,y,z, radius) {\n difference() {\n cube([x,y,z], center=true);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover(spacing=0) {\n \/\/ width1 = main cover ; width2 = tank section cover\n width1 = width - mask_loc - thickness\/2;\n width2 = mask_loc - thickness\/2;\n color(\"Grey\", alpha=0.5)\n union() {\n \/\/ back piece (over empty space)\n \/\/ spacing added to make separate pieces for laser cutting\n translate([spacing,-outset,height-thickness])\n difference() {\n translate([mask_loc,0,0])\n cube([width1+thickness+outset,depth+outset*2,thickness]);\n cutouts(4,width1,outset,rot=0,trans=[width1\/2+mask_loc,0,0]);\n cutouts(4,width1,outset,rot=180,trans=[width1\/2+mask_loc,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset,depth\/2+outset,0]);\n }\n \/\/ front piece (over tank)\n translate([-outset-thickness\/2,-overhang,height-thickness])\n difference() {\n cube([width2+thickness+outset,depth+overhang*2,thickness]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[outset+thickness\/2,depth\/2+overhang,0]);\n }\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc, tab_extra=5);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n difference() {\n cube([tank_width, depth-thickness, thickness]);\n translate([tank_width\/2, depth-tank_width\/2, 0])\n cylinder(d=25, h=100, center=true);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans, extra=0) {\n \/\/ \"extra\" is *removed* from width of cubes\n \/\/ so that resulting tabs (after differencing this) are *wider*\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w + extra\/2, -thickness\/2, -thickness\/2])\n cube([w-extra, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule power_jack_cutout() {\n translate([width, depth-40, overhang+30])\n rotate(a=[0,90,0])\n cylinder(d=7, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,0])\n difference() {\n cube([width+overhang*2, thickness, height]);\n translate([width+overhang+thickness\/2, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true, rot=[0,0,-90]);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-window_thickness\/2, up=true, rot=[0,0,-90]);\n }\n}\n\nmodule rear_support(num_high=1) {\n support_height = num_high*height;\n ypos = depth\/2-thickness\/2;\n color(\"Orange\")\n translate([width+thickness\/2, ypos, 0])\n union() {\n \/\/ entering-tank part\n translate([-overhang, 0, insert_height\/2+overhang])\n difference() {\n rounded_rect(overhang*2, thickness, insert_height, radius=overhang\/2);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n cube([thickness, thickness*2, height]);\n translate([overhang-thickness, -thickness\/2, insert_height\/2])\n difference() {\n translate([0,0,overhang*0.8])\n cube([thickness+overhang, thickness*2, height]);\n translate([overhang+thickness, 0, overhang*0.8])\n rotate(a=[90,0,0])\n cylinder(d=overhang*2, h=100, center=true);\n }\n }\n \/\/ connect and fill in one of the rounded corners\n cube([overhang, thickness, insert_height\/2+overhang+overhang]);\n \/\/ below-tank part\n translate([0, 0, -support_height])\n cube([overhang, thickness, support_height]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6575bf2f91c00e804b39f37010e550fefdbee5c1","subject":"use unencrypted nunchuck","message":"use unencrypted nunchuck","repos":"arpruss\/gamecube-usb-adapter,arpruss\/gamecube-usb-adapter,arpruss\/gamecube-usb-adapter","old_file":"adaptercase.scad","new_file":"adaptercase.scad","new_contents":"use ;\r\n\r\n\/\/\r\nincludeBottom = 1; \/\/ [1:yes, 0:no]\r\nincludeTop = 1; \/\/ [1:yes, 0:no]\r\nincludeGamecubePort = 1; \/\/ [1:yes, 0:no]\r\nincludeEllipticalPort = 1; \/\/ [1:yes, 0:no]\r\nincludeNunchuckPort = 1; \/\/ [1:yes, 0:no]\r\nincludeDirectionSwitchPort = 1; \/\/ [1:yes, 0:no]\r\nincludeWashers = 0; \/\/ [1:yes, 0:no]\r\nincludeFeet = 0; \/\/ [1:yes, 0:no]\r\ninnerLength = 80;\r\nextraWidth = 15;\r\nsideWall = 1.5;\r\ntopWall = 1.6;\r\nbottomWall = 2;\r\nbottomScrewLength = 8;\r\ntopScrewLength = 5.7;\r\nscrewDiameter = 2.12;\r\nscrewHeadDiameter = 4.8;\r\nthinPillarDiameter = 5.5;\r\nfatPillarDiameter = 9;\r\nstm32Width = 24.35;\r\nstm32Length = 57.2;\r\ntolerance = 0.2;\r\npcbThickness = 1.25;\r\nbottomOverlap = 4;\r\ntopUnderlap = 4.8;\r\nstm32ScrewYSpacing=18.8;\r\nstm32ScrewXSpacing=52;\r\nstm32ScrewOffset=2.4;\r\ngcCableDiameter=3.7;\r\nellipticalCableMajorDiameter=5.32;\r\nellipticalCableMinorDiameter=2.66;\r\ntopOffset = 4.8;\r\ntopScrewX1 = 6;\r\ntopScrewXSpacing = 54.66;\r\nbuttonHoleDiameter = 5;\r\nbutton1OffsetFromHole = 12.7;\r\nbutton2OffsetFromHole = 5.78;\r\nledHoleDiameter = 4;\r\nled1XOffsetFromButton1 = 10.16; \r\nled1YOffsetFromButton1 = 1.27; \r\nledSpacing = 5.08;\r\npcbToPCBSpacing = 12;\r\nusbPortWidth = 10;\r\nusbPortHeight = 4.5;\r\nusbPortZOffsetDown = 1;\r\ndirectionSwitchNeckDiameter = 5.8;\r\ndirectionSwitchOuterDiameter = 11.12;\r\ndirectionSwitchNeck = 1.1;\r\nnunchuckPortTolerance = 0.25;\r\nnunchuckPortHeight = 7.36;\r\nnunchuckPortWidth = 12.24;\r\nnunchuckPortInsetDepth = 1.28;\r\nnunchuckPortInsetWidth = 4.59;\r\nnunchuckPortPillarTopFromCenter = 4.9;\r\nnunchuckPortZOffset = 2;\r\nnunchuckScrewHoleYMinusFromCenterOfPort = 6.99;\r\nnunchuckScrewHoleXMinusFromOutsideOfWall = 12.91;\r\nnunchuckScrewHoleYSpacing = 2.54*5;\r\nnunchuckScrewHoleXSpacing = 2.54*6;\r\n\/\/<\/params>\r\n\r\nmodule dummy() {}\r\n\r\nincludeSpacer = 0;\r\n$fn = 32;\r\nnudge = 0.001;\r\n\r\ninnerWidth = extraWidth+stm32Width+fatPillarDiameter*2;\r\nbottomOffset = bottomScrewLength-pcbThickness;\r\nbottomHeight = bottomWall+bottomOffset+pcbThickness;\r\nbottomFatPillarLength = bottomHeight+bottomOverlap;\r\ntopHeight = topWall + topOffset + pcbThickness + max(topUnderlap,pcbToPCBSpacing);\r\ntopFatPillarLength = topHeight-topUnderlap;\r\nnunchuckPillarLength = bottomHeight + nunchuckPortZOffset - nunchuckPortPillarTopFromCenter;\r\n\r\nfatPillarLocations = [\r\n [-sideWall+fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [-sideWall+fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0]\r\n];\r\nstm32ScrewX1 = stm32ScrewOffset;\r\nstm32ScrewY1 = fatPillarLocations[0][1]+fatPillarDiameter\/2+thinPillarDiameter\/2;\r\n\r\n\r\nellipticalCableY = fatPillarLocations[1][1]-fatPillarDiameter-1.5*ellipticalCableMinorDiameter;\r\ngcPortY = stm32ScrewY1+stm32ScrewYSpacing\/2;\r\n\r\nnunchuckPortY = innerWidth+sideWall-fatPillarDiameter-nunchuckPortWidth\/2-nunchuckPortTolerance*2;\/\/ (stm32ScrewY1+stm32ScrewYSpacing+thinPillarDiameter+innerWidth-fatPillarDiameter)*0.5;\r\nnx0 = innerLength+sideWall-nunchuckScrewHoleXMinusFromOutsideOfWall;\r\nny0 = nunchuckPortY-nunchuckScrewHoleYMinusFromCenterOfPort;\r\nnunchuckPillarLocations = [\r\n [nx0,ny0],\r\n [nx0-nunchuckScrewHoleXSpacing,ny0],\r\n [nx0-nunchuckScrewHoleXSpacing,ny0+nunchuckScrewHoleYSpacing],\r\n [nx0,ny0+nunchuckScrewHoleYSpacing]];\r\necho(nunchuckPillarLocations);\r\n\r\ntopScrewY = innerWidth-stm32ScrewY1-stm32ScrewYSpacing\/2;\r\nbottomThinPillarLocations = [\r\n [stm32ScrewX1,stm32ScrewY1,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1,0],\r\n [stm32ScrewX1,stm32ScrewY1+stm32ScrewYSpacing,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1+stm32ScrewYSpacing,0] ];\r\n\r\ndirectionSwitchX = (topScrewX1+button1OffsetFromHole+topScrewX1+topScrewXSpacing-button2OffsetFromHole)\/2;\r\ndirectionSwitchY = topScrewY\/2;\r\n\r\nmodule base(inset=0) {\r\n translate([-sideWall+inset,-sideWall+inset])\r\n roundedSquare([innerLength+2*sideWall-2*inset,innerWidth+2*sideWall-2*inset], radius=fatPillarDiameter\/2-inset);\r\n}\r\n\r\nmodule ellipticalCable() {\r\n rotate([0,90,0])\r\n translate([0,0,-nudge-sideWall])\r\n linear_extrude(height=3*sideWall+2*nudge)\r\n hull() {\r\n translate([-(ellipticalCableMajorDiameter-ellipticalCableMinorDiameter)\/2-tolerance,0,0])\r\n circle(d=ellipticalCableMinorDiameter);\r\n translate([(ellipticalCableMajorDiameter-ellipticalCableMinorDiameter)\/2+tolerance,0,0])\r\n circle(d=ellipticalCableMinorDiameter);\r\n }\r\n}\r\n\r\nnunchuckPortHeight = 7.36;\r\nnunchuckPortWidth = 12.24;\r\nnunchuckPortInsetDepth = 1.28;\r\nnunchuckPortInsetWidth = 4.59;\r\n\r\nmodule nunchuckConnector() {\r\n h = nunchuckPortHeight + 2*nunchuckPortTolerance;\r\n w = nunchuckPortWidth + 2*nunchuckPortTolerance;\r\n insetDepth = nunchuckPortInsetDepth;\r\n insetWidth = nunchuckPortInsetWidth+2*nunchuckPortTolerance;\r\n rotate([0,90,0])\r\n translate([0,0,-sideWall-nudge])\r\n linear_extrude(height=sideWall*2+2*nudge)\r\n polygon([[-h\/2,-w\/2],[h\/2,-w\/2],[h\/2,w\/2],[-h\/2,w\/2],[-h\/2,insetWidth\/2],[-h\/2+insetDepth,insetWidth\/2],[-h\/2+insetDepth,-insetWidth\/2],[-h\/2,-insetWidth\/2]]);\r\n}\r\n\r\nmodule sideWalls() {\r\n difference() {\r\n base();\r\n base(inset=sideWall);\r\n }\r\n}\r\n\r\nmodule tweakedSideWalls() {\r\n difference() {\r\n base(inset=-sideWall);\r\n base(inset=sideWall+tolerance);\r\n }\r\n}\r\n\r\nmodule fatPillar(hole=false,bottom=true) {\r\n fatPillarLength = bottom?bottomFatPillarLength:topFatPillarLength;\r\n if (!hole)\r\n cylinder(d=fatPillarDiameter,fatPillarLength);\r\n else {\r\n if (bottom)\r\n cylinder(d=screwHeadDiameter+2*tolerance,h=fatPillarLength-(bottom?bottomWall:topWall));\r\n cylinder(d=screwDiameter+2*tolerance,h=fatPillarLength+nudge);\r\n }\r\n}\r\n\r\nmodule thinPillar(hole=false,height=10) {\r\n if (!hole)\r\n cylinder(d=thinPillarDiameter,h=height);\r\n else {\r\n cylinder(d=screwDiameter+2*tolerance,h=height);\r\n }\r\n}\r\n\r\nmodule spacer() {\r\n linear_extrude(height=0.75) {\r\n difference() {\r\n hull() {\r\n circle(d=thinPillarDiameter);\r\n translate([0,stm32ScrewYSpacing]) circle(d=thinPillarDiameter);\r\n }\r\n circle(d=screwDiameter+5*tolerance);\r\n translate([0,stm32ScrewYSpacing]) circle(d=screwDiameter+5*tolerance);\r\n }\r\n }\r\n}\r\n\r\nmodule bottom() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=bottomWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar();\r\n linear_extrude(height=bottomHeight+nudge) sideWalls();\r\n for (p=bottomThinPillarLocations)\r\n translate(p) thinPillar(height=bottomWall+bottomOffset);\r\n if (includeNunchuckPort)\r\n for (p=nunchuckPillarLocations)\r\n translate(p) thinPillar(height=nunchuckPillarLength);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,gcPortY-gcCableDiameter*1.5,0]) cube([2*sideWall+nudge,3*gcCableDiameter,bottomHeight]);\r\n if (includeNunchuckPort) \r\n translate([innerLength-sideWall,nunchuckPortY-nunchuckPortWidth\/2-2*sideWall,0])\r\n cube([2*sideWall,nunchuckPortWidth+4*sideWall,bottomHeight]);\r\n if (includeEllipticalPort) \r\n translate([-nudge,ellipticalCableY-ellipticalCableMinorDiameter*1.5,0]) cube([2*sideWall+nudge,3*ellipticalCableMinorDiameter,bottomHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(hole=true);\r\n translate([0,0,bottomHeight]) linear_extrude(height=bottomOverlap+nudge) tweakedSideWalls();\r\n if (includeNunchuckPort)\r\n for (p=nunchuckPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(height=nunchuckPillarLength,hole=true);\r\n for (p=bottomThinPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(hole=true,height=bottomHeight+nudge);\r\n if (includeNunchuckPort)\r\n translate([innerLength,nunchuckPortY,bottomHeight+nunchuckPortZOffset]) nunchuckConnector();\r\n translate([-sideWall-nudge,(stm32ScrewY1+stm32ScrewYSpacing\/2)-usbPortWidth\/2,bottomHeight-usbPortZOffsetDown]) cube([sideWall+2*nudge,usbPortWidth,usbPortHeight+nudge]);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,gcPortY,bottomHeight]) rotate([0,90,0]) cylinder(d=gcCableDiameter,h=3*sideWall+2*nudge);\r\n if (includeEllipticalPort)\r\n translate([0,ellipticalCableY,bottomHeight]) ellipticalCable();\r\n }\r\n}\r\n\r\nmodule top() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=topWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(bottom=false);\r\n linear_extrude(height=topHeight+nudge) sideWalls();\r\n translate([topScrewX1,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n if (includeNunchuckPort) \r\n translate([innerLength-sideWall,innerWidth-nunchuckPortY-nunchuckPortWidth\/2-2*sideWall,0])\r\n cube([2*sideWall,nunchuckPortWidth+4*sideWall,topHeight]);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,innerWidth-gcPortY-gcCableDiameter*1.5,0]) cube([2*sideWall+nudge,3*gcCableDiameter,topHeight]);\r\n if (includeEllipticalPort) \r\n translate([-nudge,innerWidth-ellipticalCableY-ellipticalCableMinorDiameter*1.5,0]) cube([2*sideWall+nudge,3*ellipticalCableMinorDiameter,topHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate([0,0,topWall]) translate(p) fatPillar(hole=true,bottom=false);\r\n translate([topScrewX1,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n\r\n y0=innerWidth-(stm32ScrewY1+stm32ScrewYSpacing\/2);\r\n if (includeNunchuckPort)\r\n translate([innerLength,innerWidth-nunchuckPortY,topHeight-nunchuckPortZOffset]) rotate([180,0,0]) nunchuckConnector();\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,innerWidth-gcPortY,topHeight]) rotate([0,90,0]) cylinder(d=gcCableDiameter,h=3*sideWall+2*nudge);\r\n if (includeEllipticalPort)\r\n translate([0,innerWidth-ellipticalCableY,topHeight]) ellipticalCable();\r\n translate([-sideWall-nudge,y0-usbPortWidth\/2,topHeight-usbPortHeight+usbPortZOffsetDown]) cube([sideWall+2*nudge,usbPortWidth,usbPortHeight+nudge]);\r\n translate([-sideWall*0.25-tolerance,y0-(stm32Width+2*tolerance)\/2,topHeight-pcbThickness-tolerance]) cube([sideWall*0.25+tolerance+nudge,stm32Width+2*tolerance,pcbThickness+tolerance+nudge]);\r\n translate([topScrewX1+button1OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n translate([topScrewX1+topScrewXSpacing-button2OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n for(i=[0:3]) translate([topScrewX1+button1OffsetFromHole+led1XOffsetFromButton1+i*ledSpacing,topScrewY+led1YOffsetFromButton1,-nudge]) cylinder(d=ledHoleDiameter,h=topWall+2*nudge);\r\n if (includeDirectionSwitchPort)\r\n translate([directionSwitchX,directionSwitchY,-nudge]) { cylinder(d=directionSwitchNeckDiameter+4*tolerance,h=topWall+2*nudge);\r\n translate([0,0,directionSwitchNeck])\r\n cylinder(d=directionSwitchOuterDiameter+4*tolerance,h=topWall);\r\n }\r\n }\r\n}\r\n\r\nif (includeBottom)\r\n bottom();\r\nif (includeTop)\r\n translate([0,innerWidth+sideWall+8,0])\r\n top();\r\nif (includeWashers) \r\n render(convexity=2)\r\n translate([-30,0,0]) {\r\n for (i=[0:3])\r\n translate([0,i*15,0])\r\n scale([1.25,1.25,0])\r\n difference() {\r\n thinPillar(hole=false,height=2);\r\n translate([0,0,-nudge]) thinPillar(hole=true,height=2+2*nudge);\r\n }\r\n }\r\n if (includeSpacer) \r\n translate([-50,0,0]) spacer();\r\n if (includeFeet) \r\n translate([-70,0,0]) {\r\n for (i=[0:0])\r\n translate([0,i*15,0]) {\r\n cylinder(d=fatPillarDiameter,h=3);\r\n cylinder(d=screwHeadDiameter-1,h=7.5);\r\n }\r\n }","old_contents":"use ;\r\n\r\n\/\/\r\nincludeBottom = 0; \/\/ [1:yes, 0:no]\r\nincludeTop = 0; \/\/ [1:yes, 0:no]\r\nincludeGamecubePort = 0; \/\/ [1:yes, 0:no]\r\nincludeEllipticalPort = 0; \/\/ [1:yes, 0:no]\r\nincludeNunchuckPort = 0; \/\/ [1:yes, 0:no]\r\nincludeDirectionSwitchPort = 1; \/\/ [1:yes, 0:no]\r\nincludeWashers = 0; \/\/ [1:yes, 0:no]\r\nincludeFeet = 1; \/\/ [1:yes, 0:no]\r\ninnerLength = 80;\r\nextraWidth = 15;\r\nsideWall = 1.5;\r\ntopWall = 1.6;\r\nbottomWall = 2;\r\nbottomScrewLength = 8;\r\ntopScrewLength = 5.7;\r\nscrewDiameter = 2.12;\r\nscrewHeadDiameter = 4.8;\r\nthinPillarDiameter = 5.5;\r\nfatPillarDiameter = 9;\r\nstm32Width = 24.35;\r\nstm32Length = 57.2;\r\ntolerance = 0.2;\r\npcbThickness = 1.25;\r\nbottomOverlap = 4;\r\ntopUnderlap = 4.8;\r\nstm32ScrewYSpacing=18.8;\r\nstm32ScrewXSpacing=52;\r\nstm32ScrewOffset=2.4;\r\ngcCableDiameter=3.7;\r\nellipticalCableMajorDiameter=5.32;\r\nellipticalCableMinorDiameter=2.66;\r\ntopOffset = 4.8;\r\ntopScrewX1 = 6;\r\ntopScrewXSpacing = 54.66;\r\nbuttonHoleDiameter = 5;\r\nbutton1OffsetFromHole = 12.7;\r\nbutton2OffsetFromHole = 5.78;\r\nledHoleDiameter = 4;\r\nled1XOffsetFromButton1 = 10.16; \r\nled1YOffsetFromButton1 = 1.27; \r\nledSpacing = 5.08;\r\npcbToPCBSpacing = 12;\r\nusbPortWidth = 10;\r\nusbPortHeight = 4.5;\r\nusbPortZOffsetDown = 1;\r\ndirectionSwitchNeckDiameter = 5.8;\r\ndirectionSwitchOuterDiameter = 11.12;\r\ndirectionSwitchNeck = 1.1;\r\nnunchuckPortTolerance = 0.25;\r\nnunchuckPortHeight = 7.36;\r\nnunchuckPortWidth = 12.24;\r\nnunchuckPortInsetDepth = 1.28;\r\nnunchuckPortInsetWidth = 4.59;\r\nnunchuckPortPillarTopFromCenter = 4.9;\r\nnunchuckPortZOffset = 2;\r\nnunchuckScrewHoleYMinusFromCenterOfPort = 6.99;\r\nnunchuckScrewHoleXMinusFromOutsideOfWall = 12.91;\r\nnunchuckScrewHoleYSpacing = 2.54*5;\r\nnunchuckScrewHoleXSpacing = 2.54*6;\r\n\/\/<\/params>\r\n\r\nmodule dummy() {}\r\n\r\nincludeSpacer = 0;\r\n$fn = 32;\r\nnudge = 0.001;\r\n\r\ninnerWidth = extraWidth+stm32Width+fatPillarDiameter*2;\r\nbottomOffset = bottomScrewLength-pcbThickness;\r\nbottomHeight = bottomWall+bottomOffset+pcbThickness;\r\nbottomFatPillarLength = bottomHeight+bottomOverlap;\r\ntopHeight = topWall + topOffset + pcbThickness + max(topUnderlap,pcbToPCBSpacing);\r\ntopFatPillarLength = topHeight-topUnderlap;\r\nnunchuckPillarLength = bottomHeight + nunchuckPortZOffset - nunchuckPortPillarTopFromCenter;\r\n\r\nfatPillarLocations = [\r\n [-sideWall+fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [-sideWall+fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,-sideWall+fatPillarDiameter\/2,0],\r\n [innerLength+sideWall-fatPillarDiameter\/2,innerWidth+sideWall-fatPillarDiameter\/2,0]\r\n];\r\nstm32ScrewX1 = stm32ScrewOffset;\r\nstm32ScrewY1 = fatPillarLocations[0][1]+fatPillarDiameter\/2+thinPillarDiameter\/2;\r\n\r\n\r\nellipticalCableY = fatPillarLocations[1][1]-fatPillarDiameter-1.5*ellipticalCableMinorDiameter;\r\ngcPortY = stm32ScrewY1+stm32ScrewYSpacing\/2;\r\n\r\nnunchuckPortY = innerWidth+sideWall-fatPillarDiameter-nunchuckPortWidth\/2-nunchuckPortTolerance*2;\/\/ (stm32ScrewY1+stm32ScrewYSpacing+thinPillarDiameter+innerWidth-fatPillarDiameter)*0.5;\r\nnx0 = innerLength+sideWall-nunchuckScrewHoleXMinusFromOutsideOfWall;\r\nny0 = nunchuckPortY-nunchuckScrewHoleYMinusFromCenterOfPort;\r\nnunchuckPillarLocations = [\r\n [nx0,ny0],\r\n [nx0-nunchuckScrewHoleXSpacing,ny0],\r\n [nx0-nunchuckScrewHoleXSpacing,ny0+nunchuckScrewHoleYSpacing],\r\n [nx0,ny0+nunchuckScrewHoleYSpacing]];\r\necho(nunchuckPillarLocations);\r\n\r\ntopScrewY = innerWidth-stm32ScrewY1-stm32ScrewYSpacing\/2;\r\nbottomThinPillarLocations = [\r\n [stm32ScrewX1,stm32ScrewY1,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1,0],\r\n [stm32ScrewX1,stm32ScrewY1+stm32ScrewYSpacing,0],\r\n [stm32ScrewX1+stm32ScrewXSpacing,stm32ScrewY1+stm32ScrewYSpacing,0] ];\r\n\r\ndirectionSwitchX = (topScrewX1+button1OffsetFromHole+topScrewX1+topScrewXSpacing-button2OffsetFromHole)\/2;\r\ndirectionSwitchY = topScrewY\/2;\r\n\r\nmodule base(inset=0) {\r\n translate([-sideWall+inset,-sideWall+inset])\r\n roundedSquare([innerLength+2*sideWall-2*inset,innerWidth+2*sideWall-2*inset], radius=fatPillarDiameter\/2-inset);\r\n}\r\n\r\nmodule ellipticalCable() {\r\n rotate([0,90,0])\r\n translate([0,0,-nudge-sideWall])\r\n linear_extrude(height=3*sideWall+2*nudge)\r\n hull() {\r\n translate([-(ellipticalCableMajorDiameter-ellipticalCableMinorDiameter)\/2-tolerance,0,0])\r\n circle(d=ellipticalCableMinorDiameter);\r\n translate([(ellipticalCableMajorDiameter-ellipticalCableMinorDiameter)\/2+tolerance,0,0])\r\n circle(d=ellipticalCableMinorDiameter);\r\n }\r\n}\r\n\r\nnunchuckPortHeight = 7.36;\r\nnunchuckPortWidth = 12.24;\r\nnunchuckPortInsetDepth = 1.28;\r\nnunchuckPortInsetWidth = 4.59;\r\n\r\nmodule nunchuckConnector() {\r\n h = nunchuckPortHeight + 2*nunchuckPortTolerance;\r\n w = nunchuckPortWidth + 2*nunchuckPortTolerance;\r\n insetDepth = nunchuckPortInsetDepth;\r\n insetWidth = nunchuckPortInsetWidth+2*nunchuckPortTolerance;\r\n rotate([0,90,0])\r\n translate([0,0,-sideWall-nudge])\r\n linear_extrude(height=sideWall*2+2*nudge)\r\n polygon([[-h\/2,-w\/2],[h\/2,-w\/2],[h\/2,w\/2],[-h\/2,w\/2],[-h\/2,insetWidth\/2],[-h\/2+insetDepth,insetWidth\/2],[-h\/2+insetDepth,-insetWidth\/2],[-h\/2,-insetWidth\/2]]);\r\n}\r\n\r\nmodule sideWalls() {\r\n difference() {\r\n base();\r\n base(inset=sideWall);\r\n }\r\n}\r\n\r\nmodule tweakedSideWalls() {\r\n difference() {\r\n base(inset=-sideWall);\r\n base(inset=sideWall+tolerance);\r\n }\r\n}\r\n\r\nmodule fatPillar(hole=false,bottom=true) {\r\n fatPillarLength = bottom?bottomFatPillarLength:topFatPillarLength;\r\n if (!hole)\r\n cylinder(d=fatPillarDiameter,fatPillarLength);\r\n else {\r\n if (bottom)\r\n cylinder(d=screwHeadDiameter+2*tolerance,h=fatPillarLength-(bottom?bottomWall:topWall));\r\n cylinder(d=screwDiameter+2*tolerance,h=fatPillarLength+nudge);\r\n }\r\n}\r\n\r\nmodule thinPillar(hole=false,height=10) {\r\n if (!hole)\r\n cylinder(d=thinPillarDiameter,h=height);\r\n else {\r\n cylinder(d=screwDiameter+2*tolerance,h=height);\r\n }\r\n}\r\n\r\nmodule spacer() {\r\n linear_extrude(height=0.75) {\r\n difference() {\r\n hull() {\r\n circle(d=thinPillarDiameter);\r\n translate([0,stm32ScrewYSpacing]) circle(d=thinPillarDiameter);\r\n }\r\n circle(d=screwDiameter+5*tolerance);\r\n translate([0,stm32ScrewYSpacing]) circle(d=screwDiameter+5*tolerance);\r\n }\r\n }\r\n}\r\n\r\nmodule bottom() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=bottomWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar();\r\n linear_extrude(height=bottomHeight+nudge) sideWalls();\r\n for (p=bottomThinPillarLocations)\r\n translate(p) thinPillar(height=bottomWall+bottomOffset);\r\n if (includeNunchuckPort)\r\n for (p=nunchuckPillarLocations)\r\n translate(p) thinPillar(height=nunchuckPillarLength);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,gcPortY-gcCableDiameter*1.5,0]) cube([2*sideWall+nudge,3*gcCableDiameter,bottomHeight]);\r\n if (includeNunchuckPort) \r\n translate([innerLength-sideWall,nunchuckPortY-nunchuckPortWidth\/2-2*sideWall,0])\r\n cube([2*sideWall,nunchuckPortWidth+4*sideWall,bottomHeight]);\r\n if (includeEllipticalPort) \r\n translate([-nudge,ellipticalCableY-ellipticalCableMinorDiameter*1.5,0]) cube([2*sideWall+nudge,3*ellipticalCableMinorDiameter,bottomHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(hole=true);\r\n translate([0,0,bottomHeight]) linear_extrude(height=bottomOverlap+nudge) tweakedSideWalls();\r\n if (includeNunchuckPort)\r\n for (p=nunchuckPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(height=nunchuckPillarLength,hole=true);\r\n for (p=bottomThinPillarLocations)\r\n translate([0,0,bottomWall]) translate(p) thinPillar(hole=true,height=bottomHeight+nudge);\r\n if (includeNunchuckPort)\r\n translate([innerLength,nunchuckPortY,bottomHeight+nunchuckPortZOffset]) nunchuckConnector();\r\n translate([-sideWall-nudge,(stm32ScrewY1+stm32ScrewYSpacing\/2)-usbPortWidth\/2,bottomHeight-usbPortZOffsetDown]) cube([sideWall+2*nudge,usbPortWidth,usbPortHeight+nudge]);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,gcPortY,bottomHeight]) rotate([0,90,0]) cylinder(d=gcCableDiameter,h=3*sideWall+2*nudge);\r\n if (includeEllipticalPort)\r\n translate([0,ellipticalCableY,bottomHeight]) ellipticalCable();\r\n }\r\n}\r\n\r\nmodule top() {\r\n render(convexity=2)\r\n difference() {\r\n union() {\r\n linear_extrude(height=topWall+nudge) base();\r\n for (p=fatPillarLocations)\r\n translate(p) fatPillar(bottom=false);\r\n linear_extrude(height=topHeight+nudge) sideWalls();\r\n translate([topScrewX1,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0])\r\n thinPillar(height=topWall+topOffset);\r\n if (includeNunchuckPort) \r\n translate([innerLength-sideWall,innerWidth-nunchuckPortY-nunchuckPortWidth\/2-2*sideWall,0])\r\n cube([2*sideWall,nunchuckPortWidth+4*sideWall,topHeight]);\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,innerWidth-gcPortY-gcCableDiameter*1.5,0]) cube([2*sideWall+nudge,3*gcCableDiameter,topHeight]);\r\n if (includeEllipticalPort) \r\n translate([-nudge,innerWidth-ellipticalCableY-ellipticalCableMinorDiameter*1.5,0]) cube([2*sideWall+nudge,3*ellipticalCableMinorDiameter,topHeight]);\r\n }\r\n for (p=fatPillarLocations)\r\n translate([0,0,topWall]) translate(p) fatPillar(hole=true,bottom=false);\r\n translate([topScrewX1,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n translate([topScrewX1+topScrewXSpacing,topScrewY,0.5])\r\n thinPillar(height=topWall+topOffset,hole=true);\r\n\r\n y0=innerWidth-(stm32ScrewY1+stm32ScrewYSpacing\/2);\r\n if (includeNunchuckPort)\r\n translate([innerLength,innerWidth-nunchuckPortY,topHeight-nunchuckPortZOffset]) rotate([180,0,0]) nunchuckConnector();\r\n if (includeGamecubePort) \r\n translate([innerLength-2*sideWall,innerWidth-gcPortY,topHeight]) rotate([0,90,0]) cylinder(d=gcCableDiameter,h=3*sideWall+2*nudge);\r\n if (includeEllipticalPort)\r\n translate([0,innerWidth-ellipticalCableY,topHeight]) ellipticalCable();\r\n translate([-sideWall-nudge,y0-usbPortWidth\/2,topHeight-usbPortHeight+usbPortZOffsetDown]) cube([sideWall+2*nudge,usbPortWidth,usbPortHeight+nudge]);\r\n translate([-sideWall*0.25-tolerance,y0-(stm32Width+2*tolerance)\/2,topHeight-pcbThickness-tolerance]) cube([sideWall*0.25+tolerance+nudge,stm32Width+2*tolerance,pcbThickness+tolerance+nudge]);\r\n translate([topScrewX1+button1OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n translate([topScrewX1+topScrewXSpacing-button2OffsetFromHole,topScrewY,-nudge]) cylinder(d=buttonHoleDiameter,h=topWall+2*nudge);\r\n for(i=[0:3]) translate([topScrewX1+button1OffsetFromHole+led1XOffsetFromButton1+i*ledSpacing,topScrewY+led1YOffsetFromButton1,-nudge]) cylinder(d=ledHoleDiameter,h=topWall+2*nudge);\r\n if (includeDirectionSwitchPort)\r\n translate([directionSwitchX,directionSwitchY,-nudge]) { cylinder(d=directionSwitchNeckDiameter+4*tolerance,h=topWall+2*nudge);\r\n translate([0,0,directionSwitchNeck])\r\n cylinder(d=directionSwitchOuterDiameter+4*tolerance,h=topWall);\r\n }\r\n }\r\n}\r\n\r\nif (includeBottom)\r\n bottom();\r\nif (includeTop)\r\n translate([0,innerWidth+sideWall+8,0])\r\n top();\r\nif (includeWashers) \r\n render(convexity=2)\r\n translate([-30,0,0]) {\r\n for (i=[0:3])\r\n translate([0,i*15,0])\r\n scale([1.25,1.25,0])\r\n difference() {\r\n thinPillar(hole=false,height=2);\r\n translate([0,0,-nudge]) thinPillar(hole=true,height=2+2*nudge);\r\n }\r\n }\r\n if (includeSpacer) \r\n translate([-50,0,0]) spacer();\r\n if (includeFeet) \r\n translate([-70,0,0]) {\r\n for (i=[0:0])\r\n translate([0,i*15,0]) {\r\n cylinder(d=fatPillarDiameter,h=3);\r\n cylinder(d=screwHeadDiameter-1,h=7.5);\r\n }\r\n }","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"ff327114c5ac25186211850165a32232f4380a21","subject":"xaxis\/ends: don't % vitamins","message":"xaxis\/ends: don't % vitamins\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2-1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[5], h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders, width=xaxis_beltpath_width);\n }\n }\n else if(part==\"vit\")\n {\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n {\n xaxis_end_idlerholder();\n xaxis_end_idlerholder(part=\"vit\");\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n translate([x*45,25,0])\n translate([x*-0,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2-1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+5*mm;\n\n\/\/ overlap of the X and Z rods\nxaxis_end_xz_rod_overlap = 4*mm;\n\n\/\/ how much \"stop\" for the x rods\nxaxis_end_rod_stop = 10*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n bearing_sizey= zaxis_bearing[1]+10*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);\n }\n\n \/\/ x axis rod holders\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap, d=xaxis_rod_d_support, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey\/2+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-1,0,0]);\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=false, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false)\n{\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top);\n }\n }\n else if(part==\"neg\")\n {\n \/\/endstop mount screw cuts\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=MHexNutM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true,\n show_zips=false\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n \/\/ x smooth rods\n x_rod_stop = stop_x_rods ? xaxis_end_rod_stop : 0;\n for(z=[-1,1])\n translate([-xaxis_end_xz_rod_overlap-.1+x_rod_stop,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=wx_+xaxis_end_xz_rod_overlap-x_rod_stop+.2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[5], h=16*mm, with_nut=false, orient=[0,0,1], align=[0,0,1]);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n if(with_motor && show_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n\n \/\/endstop\n %if($show_vit)\n {\n translate([wx_,0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=MHexNutM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n %if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=.5);\n}\n\nmodule xaxis_end_idlerholder(part, width=xaxis_beltpath_width, length=10, beltpath_index=0)\n{\n width = 20*mm;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_idlerholder(part=\"pos\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n xaxis_end_idlerholder(part=\"neg\", width=xaxis_beltpath_width, length=length, beltpath_index=beltpath_index);\n }\n }\n else if(part==\"pos\")\n {\n hull()\n {\n \/\/ support for x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=width, d=xaxis_rod_d+4*mm, orient=[1,0,0], align=[1,0,0], round_radius=2);\n\n \/\/ extra support for pulley\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n cylindera(h=8*mm+pulley_height(xaxis_idler_pulley), d=xaxis_idler_pulley[3], orient=[0,1,0], round_radius=2);\n }\n }\n else if(part==\"neg\")\n {\n for(z=[-1,1])\n {\n translate([0,0,z*(xaxis_rod_distance\/2)])\n {\n \/\/ x smooth rods\n translate([width\/2+.1,0,0])\n cylindera(h=width\/2,d=xaxis_rod_d+.2*mm, orient=[1,0,0], align=[1,0,0]);\n\n screw_cut(nut=MHexNutM4, h=16*mm, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([6*mm,0,0])\n nut_trap_cut(nut=MHexNutM4, screw_l=16*mm, trap_axis=[0,-1,0], orient=[1,0,0], $show_vit=false);\n }\n }\n\n translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([width\/2,0,0])\n cylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_holders, width=xaxis_beltpath_width);\n }\n }\n else if(part==\"vit\")\n {\n %translate([0,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n translate([width\/2,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\ninclude ;\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(z=[-1,1])\n for(z=xaxis_beltpath_z_offsets)\n translate([-z*3*mm, xaxis_zaxis_distance_y, z])\n belt_path(5*mm+main_width+2*(zrod_offset)+xaxis_end_motor_offset[0], 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[0,0,0]);\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n\n translate([x*95, xaxis_zaxis_distance_y, 0])\n mirror([0,0,max(0,x)])\n mirror([max(0,x),0,0])\n {\n xaxis_end_idlerholder();\n xaxis_end_idlerholder(part=\"vit\");\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n translate([0, xaxis_zaxis_distance_y, 0])\n {\n for(x=[-1,1])\n translate([x*55,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n xaxis_end(part=\"vit\", with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false);\n }\n\n for(x=[-1,1])\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n translate([x*45,25,0])\n translate([x*-0,0,0])\n mirror([max(0,x),0,0])\n rotate([0,-90,0])\n xaxis_end_idlerholder(beltpath_index=max(0,x));\n }\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"9609b7a33995b1da5cfe405a25978135a65db308","subject":"main\/xends: fix motor 1mm offset","message":"main\/xends: fix motor 1mm offset\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-axis-end.scad","new_file":"x-axis-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1]+0*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\nxaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-0*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n translate([0,-1,0])\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*debug=false;*\/\n\/*[>debug=true;<]*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*\/\/ x smooth rods*\/\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*(xaxis_rod_distance\/2)])*\/\n \/*%fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);*\/\n\n \/*xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n\n \/*translate([150,0,0])*\/\n \/*{*\/\n \/*xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n \/*xaxis_end_idlerholder();*\/\n \/*}*\/\n\/*}*\/\n\n\/*print=false;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n\/*}*\/\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1]+1*mm-xaxis_pulley[0]\/2;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+9*mm,motor_mount_wall_thick,0];\n\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\nmodule xaxis_end_body(with_motor, nut_top=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n\n \/*%cuberounda([wx_, xaxis_rod_d*2, xaxis_end_wz], rounding_radius=3, align=[with_motor?1:-1,0,0]);*\/\n\n if(with_motor)\n translate(xaxis_end_motor_offset)\n translate([0,1*mm,0])\n cuberounda([xaxis_end_motorsize, motor_mount_wall_thick, xaxis_end_motorsize], rounding_radius=3, align=[0,-1,0]);\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n fncylindera(h=zaxis_nut[4], d=zaxis_nut[1], align=[0,0,1]);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n fncylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1]);\n }\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=wx_,d=xaxis_rod_d*2, orient=[1,0,0], align=[x_side,0,0]);\n\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n difference()\n {\n sizey= zaxis_bearing[1]*2;\n fncylindera(h=xaxis_end_wz,d=sizey, orient=[0,0,1], align=[0,0,0]);\n translate([0,0,.1])\n cubea([sizey\/2+.1, sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[-x_side,0,0]);\n }\n }\n}\n\nmodule xaxis_end(with_motor=false, show_motor=false, nut_top=false, show_nut=false, show_rods=false)\n{\n x_side = with_motor?1:-1;\n nut_h = zaxis_nut[4];\n wx = zaxis_bearing[1]\/2+zaxis_nut[1];\n wx_ = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : wx;\n wy = xaxis_bearing[1]*2+xaxis_zaxis_distance_y;\n xaxis_end_wz = xaxis_rod_distance+xaxis_bearing[2]+5*mm;\n difference()\n {\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = with_motor?-1:1;\n\n hull()\n {\n xaxis_end_body(with_motor, nut_top);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(with_motor);\n }\n\n xaxis_end_beltpath();\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing_mount_holes(\n zaxis_bearing,\n ziptie_type,\n ziptie_bearing_distance,\n orient=[0,0,1],\n show_zips=false\n );\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate(xaxis_end_motor_offset)\n {\n translate([0, .1, 0])\n translate([0,1,0])\n fncylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor), h=motor_mount_wall_thick, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n fncylindera(d=1.1*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor), orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -xaxis_pulley[1]-1*mm+.1, 0])\n scale(1.03)\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n xaxis_motor_thread=ThreadM3;\n xaxis_motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -motor_mount_wall_thick, z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=motor_mount_wall_thick, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n fncylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n fncylindera(h=xaxis_end_wz+1, d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*13.5, 0, 0])\n fncylindera(h=5, r=1.6, align=[0,0,1]);\n }\n }\n }\n }\n\n if(with_motor && show_motor)\n {\n translate(xaxis_end_motor_offset)\n {\n \/*translate([0,-motor_mount_wall_thick,0])*\/\n \/*translate([0,-5,0])*\/\n translate([0,-1,0])\n \/*translate([0,-xaxis_pulley[0]\/2,0])*\/\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n\n %if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([x_side*zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n %if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n fncylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n}\n\nxaxis_end_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_end_beltpath_width = max(belt_width+3*mm, xaxis_pulley[0]+3*mm);\n\nmodule xaxis_end_beltpath(xaxis_end_beltpath_length=1000)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n hull()\n for(z=[-1,1])\n translate([0,0,z*xaxis_end_beltpath_height\/2])\n translate([-diag\/2,0,0])\n translate([diag\/2,0,0])\n rotate([z*-45,0,0])\n cubea([xaxis_end_beltpath_length, diag, diag]);\n}\n\nmodule xaxis_end_idlerholder(xaxis_end_beltpath_length=10)\n{\n diag = pythag_hyp(xaxis_end_beltpath_width,xaxis_end_beltpath_width)\/2;\n\n difference()\n {\n union()\n {\n cubea([10*mm, xaxis_end_beltpath_width\/sqrt(2), xaxis_rod_distance], align=[1,0,0]);\n\n translate([10*mm, 0,0])\n cubea([15*mm, xaxis_idler_pulley[0]+8*mm, xaxis_rod_distance+xaxis_rod_d*2], align=[1,0,0]);\n }\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n translate([20,0,0])\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n\n translate([10*mm+15*mm\/2,0,0])\n fncylindera(d=lookup(ThreadSize, ThreadM5), h=100, orient=[0,1,0]);\n\n xaxis_end_beltpath();\n }\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n fncylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n fncylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n translate([0,0,-.1])\n fncylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\n\/*debug=false;*\/\n\/*[>debug=true;<]*\/\n\/*if(debug)*\/\n\/*{*\/\n \/*\/\/ x smooth rods*\/\n \/*for(z=[-1,1])*\/\n \/*translate([0,0,z*(xaxis_rod_distance\/2)])*\/\n \/*%fncylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);*\/\n\n \/*xaxis_end(with_motor=true, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n\n \/*translate([150,0,0])*\/\n \/*{*\/\n \/*xaxis_end(with_motor=false, show_motor=true, nut_top=false, show_nut=true, show_rods=true);*\/\n \/*xaxis_end_idlerholder();*\/\n \/*}*\/\n\/*}*\/\n\n\/*print=false;*\/\n\/*if(print)*\/\n\/*{*\/\n \/*translate([0,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=true, show_motor=false, show_nut=false);*\/\n\n \/*translate([100,0,xaxis_end_wz\/2])*\/\n \/*xaxis_end(with_motor=false, show_motor=false, show_nut=false);*\/\n\n \/*translate([50,30,25])*\/\n \/*rotate([0,90,0])*\/\n \/*xaxis_end_idlerholder();*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"7a0edf11a4399c72c2185a9a7e49e86458c8bc6d","subject":"extruder wip","message":"extruder wip\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-carriage.scad","new_file":"x-carriage.scad","new_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nguidler_bearing = bearing_MR105;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-6*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\nguidler_arm_len = 15*mm;\n\nextruder_offset_guidler = extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0]+[guidler_bearing[1],0,0];\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\nextruder_guidler_mount_off = [hobbed_gear_d_inner\/2+10,0,guidler_mount_off_h];\n\nmodule extruder_b(show_vitamins=false)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ main house\n extruder_b_size=[10,extruder_filapath_offset,10];\n rcubea(extruder_b_size);\n\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n\n \/\/ guidler mount\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w, orient=[0,1,0]);\n }\n\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread)+6*mm, h=extruder_b_w, orient=[1,0,0]);\n }\n }\n\n \/\/ guidler mount screw\n translate(extruder_guidler_mount_off)\n {\n cylindera(d=lookup(ThreadSize, guidler_screws_thread), h=guidler_mount_w+.1, orient=[0,1,0]);\n }\n\n \/\/ hobbed gear (inner)\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n \/\/ hotmount clamp screws\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([guidler_bearing[1]+1*mm,guidler_w+1*mm,guidler_bearing[1]*2], align=[x,0,1]);\n cylindera(d=guidler_bearing[1]+1*mm, h=guidler_w+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1, orient=[1,0,0]);\n }\n\n \/\/ hotmount clamp cutout\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n rcubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n\n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\nhouse_w = 20;\nhouse_h = 30;\n\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=8*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=8;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=4*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nguidler_srew_distance = 10;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia -3*mm;\n\nmodule extruder_guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n cylindera(d=guidler_mount_d,h=guidler_w, orient=[1,0,0]);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,-1,0], orient=[0,1,0]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+.1,r]);\n for(v=[-1,1])\n translate([0, -0.1, v*r\/2])\n {\n cylindera(r=r,h=house_w+1, align=[0,-1,0], orient=[0,1,0]);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1, orient=[1,0,0]);\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n cylindera(d=lookup(ThreadSize, guidler_screws_thread),h=100, orient=[1,0,0]);\n\n \/\/ guidler bearing bolt holder cutout\n union()\n {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05, orient=[1,0,0]);\n }\n\n \/\/ guidler bearing cutout\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1, orient=[1,0,0]);\n }\n\n\n %if(show_extras)\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2], orient=[1,0,0]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h, orient=[1,0,0]);\n }\n}\n\nextruder_offset_b = extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0];\n\n\/*if(false)*\/\n{\n %x_carriage(show_bearings=false);\n\n translate(extruder_offset)\n {\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n\n translate(extruder_offset_b)\n {\n extruder_b(show_vitamins=true);\n }\n\n translate(extruder_offset_guidler)\n rotate([0,0,90])\n {\n extruder_guidler(show_extras=true);\n }\n }\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","old_contents":"use ;\nuse ;\nuse ;\nuse ;\nuse \nuse ;\nuse \nuse \n\ninclude \n\n\nxaxis_carriage_bearing_distance = 8;\nxaxis_carriage_padding = 2;\nxaxis_carriage_mount_distance = 23;\nxaxis_carriage_mount_offset_z = 0;\nxaxis_carriage_teeth_height=xaxis_belt_width*1.5;\nxaxis_carriage_mount_screws = ThreadM4;\n\nxaxis_carriage_conn = [[0, -xaxis_bearing[1]\/2 - xaxis_carriage_bearing_offset_y,0], [0,0,0]];\n\nxaxis_carriage_beltfasten_w = 20;\n\nhobbed_gear_d_outer = 12.65;\nhobbed_gear_d_inner = 11.5;\nhobbed_gear_h = 11;\n\nextruder_gear_small_d_inner = 5.75*mm;\nextruder_gear_big_d_inner = 29.35*mm;\nextruder_gear_big_d_outer = 30.85*mm;\nextruder_gear_big_h = [3.85*mm, 5*mm];\n\n\/\/ 13t metal gear and 60t metal gear\nextruder_gears_distance=extruder_gear_big_d_inner\/2+extruder_gear_small_d_inner\/2;\n\nextruder_motor = dict_replace_multiple(Nema17,\n [\n [NemaLengthMedium, 11.75*mm],\n [NemaFrontAxleLength, 5*mm],\n ]);\n\n\/\/ shaft from big gear to hobbed gear\nextruder_shaft_d = 5*mm;\n\n\/\/ dist between gear and motor\nextruder_gear_motor_dist = .5*mm;\nextruder_motor_angle = -80;\nextruder_motor_offset_x = cos(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_offset_z = sin(extruder_motor_angle) * extruder_gears_distance;\nextruder_motor_holedist = lookup(NemaDistanceBetweenMountingHoles, extruder_motor);\n\nextruder_gear_big_offset=[-extruder_motor_offset_x,0,extruder_motor_offset_z];\n\nextruder_offset = [0,0,10*mm];\nextruder_offset_a = -extruder_gear_big_offset+[\n 0,\n xaxis_bearing[1] + xaxis_carriage_bearing_offset_y + 1*mm,\n 0];\nextruder_filapath_offset = [hobbed_gear_d_inner\/2, -15*mm, 0];\n\nextruder_guilder_bearing = bearing_625;\nextruder_hotmount_clamp_thread = ThreadM3;\n\nmodule x_carriage_base(show_bearings=false)\n{\n bottom_width = xaxis_bearing[2] + 2*xaxis_carriage_padding;\n top_width = xaxis_bearing[2]*2 + xaxis_carriage_bearing_distance + 2*xaxis_carriage_padding;\n thickness = xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y;\n\n hull()\n {\n \/\/ top bearings\n translate([0,0,xaxis_rod_distance\/2])\n rcubea([top_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n \/*rcubea([top_width,thickness,xaxis_rod_distance\/2], align=[0,1,0]);*\/\n\n \/\/ bottom bearing\n translate([0,0,-xaxis_rod_distance\/2])\n rcubea([bottom_width, thickness, xaxis_bearing[1]+xaxis_carriage_padding+ziptie_bearing_distance*2], align=[0,1,0]);\n\n }\n translate([0,xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y+xaxis_carriage_beltpath_offset+.1,0])\n {\n translate([0,-xaxis_beltpath_width\/2,0])\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width,xaxis_beltpath_height\/3], align=[0,0,-1]);\n }\n\n if(show_bearings)\n {\n for(x=[-1,1])\n translate([\n x*(xaxis_carriage_bearing_distance+xaxis_bearing[2])\/2,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n translate([\n 0,\n xaxis_bearing[1]\/2 + xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2\n ])\n bearing(xaxis_bearing, orient=[1,0,0]);\n\n \/*translate([0,xaxis_carriage_beltpath_offset,0])*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*100,0,0])*\/\n \/*pulley(xaxis_idler_pulley, orient=[0,1,0]);*\/\n }\n\n}\n\nmodule x_carriage_holes()\n{\n for(i=[-1,1])\n translate([\n i*(xaxis_bearing[2]\/2+xaxis_carriage_bearing_distance\/2),\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y, \n xaxis_rod_distance\/2\n ])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n translate([\n 0,\n xaxis_bearing[1]\/2+xaxis_carriage_bearing_offset_y,\n -xaxis_rod_distance\/2])\n {\n bearing_mount_holes(xaxis_bearing, orient=[1,0,0]);\n cubea([xaxis_bearing[2]*2,xaxis_bearing[1]\/2+10,xaxis_bearing[1]+1*mm], align=[0,1,0]);\n }\n\n \/\/ Extruder mounting holes\n \/*translate([0,0,xaxis_carriage_mount_offset_z])*\/\n \/*for(j=[-1,1])*\/\n \/*for(i=[-1,1])*\/\n \/*{*\/\n \/*translate([i*xaxis_carriage_mount_distance\/2,0,j*xaxis_carriage_mount_distance\/2])*\/\n \/*{*\/\n \/*screw_dia = lookup(ThreadSize, xaxis_carriage_mount_screws);*\/\n \/*cylindera(d=screw_dia, h=100, orient=[0,1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n translate([0,xaxis_carriage_beltpath_offset+.1,0])\n {\n \/\/ Cut clearing space for the belt\n \/*translate([0,-xaxis_beltpath_width\/2,-xaxis_beltpath_height\/2])*\/\n \/*#rcubea([500,xaxis_beltpath_width+1,5], align=[0,1,0], extrasize=[0,0,4], extrasize_align=[0,0,1]);*\/\n\n translate([0,-xaxis_beltpath_width\/2,0])\n {\n difference()\n {\n rcubea([500,xaxis_beltpath_width*2,xaxis_beltpath_height], align=[0,1,0]);\n for(x=[-1,1])\n translate([x*(xaxis_carriage_beltfasten_w\/2+5),-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])\n rcubea([xaxis_carriage_beltfasten_w,xaxis_beltpath_width*2,xaxis_beltpath_height\/3], align=[0,1,-1]);\n }\n }\n\n \/*belt_thickness=1.5;*\/\n \/*for(i=[-1,1])*\/\n \/*translate([i*30,0,0])*\/\n \/*rcubea([15,xaxis_beltpath_width,15-belt_thickness], align=[0,0,0]);*\/\n\n \/\/ Cut in the middle for belt\n \/*rcubea([7,xaxis_beltpath_width,xaxis_beltpath_height], align=[0,0,0]);*\/\n\n \/*translate([0,-xaxis_beltpath_width\/2,xaxis_pulley_inner_d\/2])*\/\n \/*{*\/\n \/*\/\/ Belt slit*\/\n \/*rcubea([500,xaxis_beltpath_width,belt_thickness], align=[0,1,0]);*\/\n\n \/*[>\/\/ Teeth cuts<]*\/\n \/*[>teeth = 50;<]*\/\n \/*[>teeth_height = 2;<]*\/\n \/*[>translate([-belt_tooth_distance\/2*teeth-.5,0,0])<]*\/\n \/*[>for(i=[0:teeth])<]*\/\n \/*[>{<]*\/\n \/*[>translate([i*belt_tooth_distance,0,0])<]*\/\n \/*[>cubea([belt_tooth_distance*belt_tooth_ratio,xaxis_carriage_teeth_height,teeth_height], align=[0,0,-1]);<]*\/\n \/*[>}<]*\/\n \/*}*\/\n }\n}\n\n\nmodule extruder_gear_small()\n{\n difference()\n {\n union()\n {\n hull()\n {\n cylindera(d=extruder_gear_small_d_inner, h=7*mm, orient=[0,1,0], align=[0,1,0]);\n cylindera(d=10*mm, h= 3*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=extruder_gear_small_d_inner, h=13*mm, orient=[0,1,0], align=[0,1,0]);\n }\n cylindera(d=5*mm, h=13*mm+.1, orient=[0,1,0], align=[0,1,0]);\n }\n}\n\n\nmodule extruder_gear_big(align=[0,0,0], orient=[0,0,1])\n{\n total_h = extruder_gear_big_h[0]+extruder_gear_big_h[1];\n size_align([extruder_gear_big_d_inner, extruder_gear_big_d_inner, total_h], align=align, orient=orient)\n translate([0,0,-extruder_gear_big_h[0] + total_h\/2])\n difference()\n {\n union()\n {\n cylindera(d=extruder_gear_big_d_inner, h=extruder_gear_big_h[0], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=12*mm, h=extruder_gear_big_h[1], orient=[0,0,1], align=[0,0,-1]);\n }\n translate([0,0,-.5])\n cylindera(d=5*mm, h=total_h+.2, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\nmodule motor_mount_cut(motor=Nema17, h=10*mm)\n{\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, motor);\n\n \/\/ round dia\n translate([0, .1, 0])\n cylindera(d=1.1*lookup(NemaRoundExtrusionDiameter, motor), h=h, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, motor), h=lookup(NemaFrontAxleLength, motor)+2*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n \/*translate([0, -1*mm-xaxis_pulley[1]-.1, 0])*\/\n scale(1.03)\n bearing(bearing_MR105, override_h=h, orient=[0,1,0], align=[0,-1,0]);\n\n motor_thread=ThreadM3;\n motor_nut=MHexNutM3;\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*screw_dist\/2, -h, z*screw_dist\/2])\n {\n if(x!=-1 || z!=-1)\n screw_cut(motor_nut, h=h, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n}\nextruder_a_h = 14*mm;\n\nmodule extruder_a(show_vitamins=false)\n{\n difference()\n {\n hull()\n \/*union()*\/\n {\n side = 15*mm;\n rcubea([extruder_motor_holedist+side\/2,extruder_a_h,extruder_motor_holedist+side\/2], align=[0,1,0]);\n \/*hull()*\/\n \/*{*\/\n \/*for(x=[-1,1])*\/\n \/*for(z=[-1,1])*\/\n \/*translate([(extruder_motor_holedist\/2)*x,0,(extruder_motor_holedist\/2)*z])*\/\n \/*rotate([0,x*45,0])*\/\n \/*rcubea([side\/2,extruder_a_h,side\/2], align=[0,1,0]);*\/\n \/*}*\/\n translate(extruder_gear_big_offset)\n cylindera(d=extruder_gear_big_d_outer+3*mm, h=extruder_a_h, orient=[0,1,0], align=[0,-1,0], round_radius=2);\n }\n\n translate([0,extruder_a_h,0])\n {\n translate(extruder_gear_big_offset)\n {\n \/*scale([1.3,2.0,1.3])*\/\n \/*#extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);*\/\n\n \/\/ big gear cutout\n translate([0,-bearing_MR105[2]+.1,0])\n cylindera(d=extruder_gear_big_d_outer+1*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n cylindera(d=extruder_shaft_d+.5*mm, h=extruder_a_h+.2, orient=[0,1,0], align=[0,1,0]);\n\n translate([0,.1,0])\n scale(1.03)\n bearing(bearing_MR105, override_h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n }\n\n motor_mount_cut(extruder_motor, h=extruder_a_h+1);\n }\n\n }\n\n if(show_vitamins)\n translate([0,extruder_a_h,0])\n {\n translate([0,-extruder_gear_motor_dist,0])\n {\n extruder_gear_small();\n\n \/\/ big gear\n translate(extruder_gear_big_offset)\n {\n translate([0,1,0])\n translate([0,-bearing_MR105[2]+.1,0])\n extruder_gear_big(orient=[0,-1,0], align=[0,-1,0]);\n\n translate([0,1,0])\n bearing(bearing_MR105, orient=[0,1,0], align=[0,-1,0]);\n\n translate([0,bearing_MR105[2],0])\n {\n cylindera(h=60*mm, d=extruder_shaft_d, orient=[0,1,0], align=[0,1,0]);\n }\n }\n }\n motor(extruder_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n}\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size_xy=max(vec_i(hotmount_d_h,0))+5*mm;\nhotmount_outer_size_h=max(vec_i(hotmount_d_h,1))+5*mm;\nhotmount_offset_h=-4*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1;\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 1.5*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 0;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e-1);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,-1]);\n if(extend_cut)\n {\n cubea([extruder_b_w\/2+1,d,h],align=[hotmount_clamp_side,0,-1]);\n }\n }\n }\n}\n\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([extruder_b_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([extruder_b_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-extruder_b_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([.1, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness+.2, align=[0,0,-hotmount_clamp_side], extra_h=2);\n }\n }\n}\n\nextruder_b_bearing = bearing_MR105;\nextruder_b_w = hobbed_gear_d_outer+10*mm;\n\n\nmodule extruder_b(show_vitamins=false)\n{\n translate(extruder_filapath_offset-[hobbed_gear_d_inner\/2,0,0])\n {\n \/\/ guidler mount\n guidler_arm_len = 15*mm;\n translate([hobbed_gear_d_inner\/2,0,guidler_arm_len])\n {\n difference()\n {\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n cylindera(d=2*lookup(ThreadSize, ThreadM3), h=10*mm, orient=[0,1,0]);\n }\n }\n\n difference()\n {\n \/*hull()*\/\n union()\n {\n \/\/ main house\n extruder_b_size=[10,extruder_filapath_offset,10];\n #rcubea(extruder_b_size);\n\n \/\/ gear support\n translate([0,-hobbed_gear_h\/2,0])\n {\n \/\/ hobbed gear support\n cylindera(d=hobbed_gear_d_outer+5*mm, h=abs(extruder_filapath_offset[1])+hobbed_gear_h\/2, align=[0,-1,0], orient=[0,1,0]);\n\n \/\/ bearing support\n cylindera(d=extruder_b_bearing[1]+5*mm, h=extruder_b_bearing[2]+4*mm, align=[0,1,0], orient=[0,1,0]);\n\n }\n \/\/ hotmount support\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n cubea([extruder_b_w, hotmount_outer_size_xy, hotmount_outer_size_h], align=[0,0,-1]);\n\n \/\/ clamp mount screw holes\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=lookup(ThreadSize, extruder_hotmount_clamp_thread)+3*mm, h=extruder_b_w);\n }\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_outer+2*mm, orient=[0,1,0], align=[0,0,0]);\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h])\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+10);\n }\n\n \/\/ filament path\n translate([hobbed_gear_d_outer\/2,0,0])\n cylindera(h=1000, d=4*mm, orient=[0,0,1], align=[0,0,0]);\n\n \/\/ gear cutout\n translate([0,-hobbed_gear_h\/2-.5*mm,0])\n cylindera(d=extruder_b_bearing[1]+.3*mm, h=extruder_b_bearing[2]+.5*mm, align=[0,1,0], orient=[0,1,0]);\n\n for(x=[-1,1])\n translate([x*hobbed_gear_d_inner\/2,0,0])\n scale([1.03,1,1.03])\n {\n cubea([extruder_guilder_bearing[1]+1*mm,extruder_guilder_bearing[2]+1*mm,extruder_guilder_bearing[1]*2], align=[x,0,1]);\n cylindera(d=extruder_guilder_bearing[1]+1*mm, h=extruder_guilder_bearing[2]+1*mm, orient=[0,1,0], align=[x,0,0]);\n }\n\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(d=lookup(ThreadSize, extruder_hotmount_clamp_thread), h=extruder_b_w+1);\n }\n\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n }\n\n if(show_vitamins)\n {\n translate([hobbed_gear_d_inner\/2,0,-hobbed_gear_d_outer\/2 + hotmount_offset_h+.01])\n translate([extruder_b_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n hotmount_clamp();\n \n translate([0,-hobbed_gear_h\/2-extruder_b_bearing[2]-.5*mm,0])\n {\n cylindera(h=extruder_a_h+extruder_offset_a[1]-extruder_filapath_offset[1], d=extruder_shaft_d, orient=[0,1,0], align=[0,-1,0]);\n\n bearing(extruder_b_bearing, orient=[0,1,0], align=[0,1,0]);\n }\n\n \/\/ hobbed gear\n cylindera(h=hobbed_gear_h, d=hobbed_gear_d_inner, orient=[0,1,0], align=[0,0,0]);\n for(y=[-1,1])\n translate([0,y*hobbed_gear_h\/2,0])\n {\n cylindera(h=hobbed_gear_h\/3, d=hobbed_gear_d_outer, orient=[0,1,0], align=[0,y,0]);\n }\n }\n }\n}\n\n\/\/ Final part\nmodule x_carriage(show_bearings=true)\n{\n difference()\n {\n \/*hull()*\/\n union()\n {\n x_carriage_base(show_bearings=show_bearings);\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n cylindera(d=10*mm, h=extruder_offset_a[1], orient=[0,1,0], align=[0,1,0], round_radius=2);\n }\n }\n translate(extruder_offset)\n translate(extruder_offset_a)\n {\n for(x=[-1,1])\n for(z=[-1,1])\n translate([x*extruder_motor_holedist\/2,0,z*extruder_motor_holedist\/2])\n translate([0,.1,0])\n cylindera(d=3*mm, h=extruder_offset_a[1]+.2, orient=[0,1,0], align=[0,1,0]);\n }\n x_carriage_holes();\n }\n}\n\nmodule x_extruder_a()\n{\n translate(extruder_offset)\n translate(extruder_offset_a)\n extruder_a(show_vitamins=true);\n}\n\nmodule x_extruder_b()\n{\n translate(extruder_offset)\n {\n extruder_b(show_vitamins=true);\n }\n}\n\n\/*translate([0,-42,38])*\/\n\/*rotate([0,0,90])*\/\n\/*translate([0,-1,-42])*\/\n\/*translate([-83,25,-42])*\/\n\/*rotate([90,0,0])*\/\n\/*import(\"stl\/i3R_Compact_E3Dv6_Extruder_1.75_01.STL\");*\/\n\nmodule x_extruder_hotend()\n{\n hotend_conn =[[0,0,27.8-hotmount_offset_h],[0,0,1]];\n translate(extruder_offset)\n translate(extruder_filapath_offset)\n attach(extruder_conn_hotend, hotend_conn)\n rotate([90,0,270])\n %import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n}\n\n\/*if(false)*\/\n{\n \/*extruder_a(show_vitamins=true);*\/\n %x_carriage(show_bearings=false);\n\n \/*if(false)*\/\n %x_extruder_a();\n\n \/*if(false)*\/\n x_extruder_b();\n\n \/\/filament path\n %translate(extruder_filapath_offset)\n cylindera(h=1000, d=1.75*mm, orient=[0,0,1], align=[0,0,0]);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"98125210c89130fff3f15ed8d95d8c7214984b23","subject":"Fix mask panel tabs to be symmetric (won't matter which way bottom is installed).","message":"Fix mask panel tabs to be symmetric (won't matter which way bottom is installed).\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 29;\nview_opening_height = 90;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,depth\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness\/2, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 75;\nview_opening_right = 85;\nview_opening_width = depth-thickness - view_opening_left - view_opening_right;\nview_opening_bottom = 29;\nview_opening_height = 90;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos+20, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7f1273069e4cba63589cb03477466a4a1af85422","subject":"main block is now ready","message":"main block is now ready\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"kite_roller\/kite_roller.scad","new_file":"kite_roller\/kite_roller.scad","new_contents":"use \n\neps = 0.01;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule screw_head() { screw_head_hex_m8(); }\nmodule screw_head_slot(dh=0) { screw_head_hex_m8(0.5, 2*0.2+dh); }\n\n\nmodule washer(dh=0)\n{\n difference()\n {\n cylinder(d=15.5, h=1.4+dh);\n translate(eps*[0,0,-1])\n cylinder(d=8.5, h=1.4+dh+2*eps);\n }\n}\n\n\n\/\/ slot for ball bearing + 2 washers\nmodule bearing_slot()\n{\n d_spacing = 0.5;\n h_spacing = 0.2;\n cylinder(d=22+d_spacing, h=7+h_spacing, $fn=150);\n\n for(dh=[-1.4, 7+h_spacing])\n translate([0,0,dh])\n washer();\n}\n\n\nmodule side_block()\n{\n module fin()\n {\n translate(-0.5*[1, 2, 0])\n hull()\n {\n cube([1, 2, 5]);\n for(dx=[-1,+1])\n translate(dx*(120\/2-1\/2)*[1,0,0])\n cube([1, 2, 2]);\n }\n }\n\n dx_offset = 80\/2;\n module core_body()\n {\n cylinder(d=120, h=5, $fn=360);\n cylinder(d=30, h=5+25, $fn=100);\n \/\/ spherical slot around screw head\n translate([dx_offset, 0, 5])\n intersection()\n {\n scale([1,1,0.5])\n sphere(d=30, $fn=100);\n translate([-20, -20, 0])\n cube([40, 40, 6]);\n }\n \/\/ fins\n translate([0,0,5])\n for(r=[0:20:180])\n rotate([0, 0, r])\n fin();\n }\n\n difference()\n {\n core_body();\n \/\/ screw slot\n translate([dx_offset, 0, -eps])\n {\n translate([0,0,5])\n {\n screw_head_slot(0.5);\n %screw_head();\n }\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n }\n \/\/ screw holes in the center block part\n {\n offset = 7;\n h = 10;\n \/\/ top\n translate([0, offset, -eps])\n {\n cylinder(d1=10, d2=7, h=h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n \/\/ bottom\n translate([0, -offset, -eps])\n {\n screw_head_hex_m3(0.5, h);\n cylinder(d=3+0.7, h=50, $fn=50);\n }\n\n }\n\n \/\/ asymetric cut, to connect 2 parts with friction\n translate([-20, 0, 5+25-10+eps])\n cube([40, 40, 10]);\n }\n}\n\n\nside_block();\n","old_contents":"use \n\neps = 0.01;\n\n\/\/ standard ball bearing: 8x22x7mm\nmodule bearing()\n{\n difference()\n {\n cylinder(d=22, h=7, $fn=100);\n translate(eps*[0,0,-1])\n cylinder(d=8, h=7+2*eps, $fn=40);\n }\n}\n\n\nmodule screw_head_slot(dh=0)\n{\n screw_head_hex_m8(0.5, 2*0.2+dh);\n}\n\n\nmodule washer(dh=0)\n{\n difference()\n {\n cylinder(d=15.5, h=1.4+dh);\n translate(eps*[0,0,-1])\n cylinder(d=8.5, h=1.4+dh+2*eps);\n }\n}\n\n\n\/\/ slot for ball bearing + 2 washers\nmodule bearing_slot()\n{\n d_spacing = 0.5;\n h_spacing = 0.2;\n cylinder(d=22+d_spacing, h=7+h_spacing, $fn=150);\n\n for(dh=[-1.4, 7+h_spacing])\n translate([0,0,dh])\n washer();\n}\n\nmodule side_block()\n{\n difference()\n {\n \/\/ main element\n cylinder(d1=120, d2=30, h=20, $fn=360);\n \/\/ screw slot\n translate([60\/2, 0, -eps])\n {\n screw_head_slot(0.5);\n \/\/ rod\n cylinder(d=8+0.55, h=100, $fn=50);\n translate([0, 0, 12])\n washer(dh=100);\n }\n }\n}\n\nside_block();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"96c9c3207e11dc1615e012150199f1c6588183b0","subject":"basic encoder model","message":"basic encoder model\n","repos":"beckdac\/zynthian-build","old_file":"zynthian-case.scad","new_file":"zynthian-case.scad","new_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n %translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n %translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2, j * displayBoardHeight\/2, -displayBoardThickness])\n difference() {\n cube([20, 20, 3], center=true);\n translate([i *2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderShaftHeight = 18;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n cylinder(h = encoderShaftHeight, d = encoderShaftDiameter, center=false);\n \/\/ encoder base\n translate([-encoderWidth\/2, -encoderLength\/2, -encoderDepth\/2])\n cube([encoderWidth, encoderLength, encoderDepth]);\n}\n\n\/\/ lid with screen and encoders\nmodule lid() {\n \/\/ face plate\n \/\/ screen cutout\n \/\/ encoder cutout\n \/\/ screw holes\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}\n\n\/\/display();\nencoder();","old_contents":"$fn = 64;\n\n\/\/ interference fit adjustment for 3D printer\niFitAdjust = .4;\niFitAdjust_d = .25;\n\n\/\/ waveshare 5\" knock off\ndisplayScreenWidth = 118;\ndisplayScreenHeight = 70;\ndisplayScreenThickness = 3;\ndisplayBoardWidth = 122;\ndisplayBoardHeight = 78.5;\ndisplayBoardThickness = 7;\ndisplayDepth = 22;\ndisplayScrewDiameter = 3;\nmodule display() {\n \/\/ screen\n %translate([-displayScreenWidth \/ 2, -displayScreenHeight \/ 2, 0])\n cube([displayScreenWidth, displayScreenHeight, displayScreenThickness], center=false);\n \/\/ board\n %translate([-displayBoardWidth \/ 2, -displayBoardHeight \/ 2, -displayBoardThickness])\n cube([displayBoardWidth, displayBoardHeight, displayBoardThickness], center=false);\n \/\/ screen mounts\n \/\/ corner tabs\n for (i = [-1,1])\n for (j = [-1,1]) {\n translate([i * displayBoardWidth\/2, j * displayBoardHeight\/2, -displayBoardThickness])\n difference() {\n cube([20, 20, 3], center=true);\n translate([i *2, j * 2, -displayBoardThickness \/ 2])\n cylinder(h=displayBoardThickness + 2, r = displayScrewDiameter + iFitAdjust_d);\n }\n }\n}\n\n\/\/ encoders\nencoderShaftDiameter = 7;\nencoderWidth = 18;\nencoderLength = 31;\nencoderDepth = 8.2;\nmodule encoder() {\n \/\/ encoder shaft\n \/\/ encoder base\n}\n\n\/\/ lid with screen and encoders\nmodule lid() {\n \/\/ face plate\n \/\/ screen cutout\n \/\/ encoder cutout\n \/\/ screw holes\n}\n\n\/\/ box with pi mounts and holes\nmodule box() {\n \/\/ bottom\n \/\/ pi mount holes\n \/\/ sides\n \/\/ pi usb \/ ethernet\n \/\/ hifi audio out\n}\n\ndisplay();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"eb58b04bad794c3f4eaf3ec67bcf5869572c1d1b","subject":"elements rotate to better fit printer's dimentions","message":"elements rotate to better fit printer's dimentions\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"tablet_toilet_mount\/all.scad","new_file":"tablet_toilet_mount\/all.scad","new_contents":"use \nuse \n\nmodule bothElements()\n{\n translate([0, 55, 0])\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n\/\/%openPosition();\n\nrotate([0, 0, 90])\n bothElements();\n","old_contents":"use \nuse \n\nmodule bothElements()\n{\n translate([0, 55, 0])\n support();\n wallMount();\n}\n\n\nmodule closedPosition()\n{\n wallMount();\n translate([150, 0, 14.5])\n rotate([0, 180, 0])\n support();\n}\n\nmodule openPosition()\n{\n wallMount();\n translate([150, -4, 4])\n rotate([-90, 180, 0])\n support();\n}\n\n\n\/\/%closedPosition();\n\/\/%openPosition();\n\nbothElements();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"395d22abdbd619426293ee21372579b36ca80476","subject":"metric\/screw: fix screw head cut diametea","message":"metric\/screw: fix screw head cut diametea\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"metric-screw.scad","new_file":"metric-screw.scad","new_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 2 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\ninclude \ninclude \ninclude \n\nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(thread) = lookup(ThreadSize, thread);\nfunction get_screw_head_d(thread) = 1.5 * lookup(ThreadSize, thread);\n\nmodule screw(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(nut);\n nut_h = lookup(MHexNutThickness,nut)*tolerance;\n threadsize = lookup(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(thread=thread_, orient=[0,0,1], align=[0,0,1]);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(MHexNutThickness,nut)*tolerance;\n head_h = get_screw_head_h(thread);\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(thread=thread_, tolerance=1.25, override_h=head_cut_h, align=[0,0,1]);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=[0,0,1], align=[0,0,0]);\n\n if(with_nut && nut != undef)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=[0,0,-1]);\n }\n }\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, h=h, tolerance=tolerance, head_embed=head_embed, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=orient, align=align);\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_thread_cut: thread is undef\");\n threadsize = lookup(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(thread, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread);\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n difference()\n {\n cylindera(d=head_d, h = fallback(override_h,head_h));\n translate([0,0,head_h\/2])\n cylindera(d=threadsize, h = head_d\/2);\n }\n}\n\nmodule screw_head_cut(thread, tolerance=1.05, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(thread!=undef, \"screw_head_cut: thread is undef\");\n\n threadsize = lookup(ThreadSize, thread);\n head_h = get_screw_head_h(thread);\n head_d = get_screw_head_d(thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=[0,0,1]);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n facets = lookup(MHexNutFacets, nut);\n cylindera($fn=lookup(MHexNutFacets, nut), d=d, h=fallback(override_h, thickness), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=[0,0,1], align=[0,0,0])\n{\n assert(nut!=undef, \"screw_nut_cut: nut is undef\");\n\n thickness = lookup(MHexNutThickness,nut)*tolerance;\n d = lookup(MHexNutWidthMin, nut)*tolerance;\n size_align(size=[d,d,thickness], orient=orient, align=align)\n {\n translate([0,0,thickness\/2])\n {\n screw_nut(nut, tolerance, orient=[0,0,1], align=[0,0,-1]);\n translate([0,0,-thickness+.01])\n {\n cylindera(d=d*1.1, h=h, orient=[0,0,1], align=[0,0,-1]);\n }\n }\n }\n}\n\nmodule nut_trap_cut(nut, thread, trap_offset=10, screw_l=10*mm, screw_l_extra=2*mm, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,1], align=[0,0,0])\n{\n nut_thread = get(MHexNutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != undef, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=undef && thread!=undef && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = lookup(ThreadSize, thread_);\n head_h = get_screw_head_h(thread);\n nut_h = lookup(MHexNutThickness,nut)+.5*mm;\n\n nut_width_min = lookup(MHexNutWidthMin, nut)+.2*mm;\n nut_width_max = lookup(MHexNutWidthMax, nut)+.2*mm;\n s = nut_width_min;\n total_h = nut_h;\n\n size_align(size=[s, s, total_h], orient=orient, orient_ref=[0,0,1], align=align)\n {\n translate([0,0,nut_h\/2-.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l, orient=[0,0,-1], align=[0,0,1]);\n\n if(screw_l_extra>0)\n translate([0,0,-nut_h\/2+.1])\n screw_thread_cut(thread=thread_, tolerance=1.1, h=screw_l_extra+.1, orient=[0,0,1], align=[0,0,-1]);\n\n hull()\n {\n orient(-orient)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(orient)\n cylindera($fn=lookup(MHexNutFacets, nut), d=nut_width_max, h=nut_h, align=[0,0,0]);\n\n orient(orient)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=[0,0,0]);\n }\n }\n\n if($show_vit)\n {\n translate([0,0, screw_l])\n translate([0,0, -nut_h\/2])\n %screw(nut=nut, thread=thread, tolerance=1, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=[0,0,-1], align=[0,0,0]);\n }\n\n }\n}\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\n\nif(false)\n{\n nut1 = MHexNutM3;\n nut2 = MHexNutM5;\n nut3 = MKnurlInsertNutM3_3_42;\n nut4 = MKnurlInsertNutM3_5_42;\n\n \/*translate([0,20,0])*\/\n \/*translate([0,20,0])*\/\n \/*for(axis1=[0:len(AXES)-1])*\/\n \/*[>for(axis2=AXES)<]*\/\n \/*translate(20*AXES[axis1])*\/\n \/*{*\/\n \/*ta = v_rotate(90, AXES[axis1])*AXES[axis1];*\/\n \/*echo(AXES[axis1], ta);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=ta, orient=AXES[axis1]);*\/\n \/*}*\/\n\n \/*stack(d=30, axis=[1,0,0])*\/\n \/*{*\/\n \/*stack(d=20, axis=[0,1,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[1,0,0]);*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[-1,0,0]);*\/\n \/*}*\/\n\n \/*stack(d=20, axis=[1,0,0])*\/\n \/*{*\/\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,1,0]);*\/\n\n \/*nut_trap_cut(nut=nut1, trap_axis=[0,0,1], orient=[0,-1,0]);*\/\n \/*}*\/\n \/*}*\/\n\n box_w = 100;\n box_h = 10;\n box_d = 10;\n o = 10;\n\n $show_vit = true;\n $fs= 0.5;\n $fa = 4;\n\n difference()\n {\n cubea([box_w,box_d\/2,box_h], align=[1,1,1]);\n\n test_cuts();\n }\n \/*difference()*\/\n \/*{*\/\n \/*cubea([box_w,box_d\/2,box_h], align=[1,-1,1]);*\/\n\n \/*test_cuts();*\/\n \/*}*\/\n\n}\n\nmodule test_cuts()\n{\n union()\n {\n offset = 0;\n \/*offset = -5;*\/\n translate([0,offset,0])\n translate([5,0,0])\n stack(dist=10,axis=[1,0,0])\n {\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=[0,0,1], align=[0,0,1]);\n\n screw_cut(nut=nut1, h=box_h*mm, nut_offset=0*mm, head_embed=true, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut2, h=box_h*mm, nut_offset=3*mm, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=[0,0,-1], align=[0,0,1]);\n\n \/*translate([0,5,0])*\/\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,-1,0], orient=[0,0,-1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=[0,1,0], orient=[0,0,1], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,1], orient=[0,1,0], align=[0,0,0]);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_l_extra=2*mm, trap_axis=[0,0,-1], orient=[0,1,0], align=[0,0,0]);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c80bb59077a04059b364ae9982b87565032a9bac","subject":"Round edges of part below fan; correct two profiles which were supposed to line up.","message":"Round edges of part below fan; correct two profiles which were supposed to line up.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-fan-spacer\/spacer1.scad","new_file":"wanhao-i3-fan-spacer\/spacer1.scad","new_contents":"\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=9) {\n difference() {\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) cylinder(r=r,h=thick);\n }\n}\n\nmodule SpacerHole(thick=9) {\n translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\nmodule LowerHull(w,r,thick,d=0) {\n hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) cylinder(r=r,h=thick);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) cylinder(r=r,h=thick);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y,-1]) cylinder(r=r,h=thick+2);\n }\n hull() {\n for(y=[-r-1,-10])\n translate([0,y,thick])\n rotate([0,90,0]) cylinder(r=2,h=100,center=true);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.6,h=100);\n }\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=3) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01]) ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n FanGrill(r=16,height=thick-1);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n }\n \/\/ Top part\n difference() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\ntranslate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\/\/translate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","old_contents":"\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=9) {\n difference() {\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) cylinder(r=r,h=thick);\n }\n}\n\nmodule SpacerHole(thick=9) {\n translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\nmodule LowerHull(w,r,thick) {\n hull() {\n for(x=[w\/2-r,-(w\/2-r)])\n translate([x,r]) cylinder(r=r,h=thick);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) cylinder(r=r,h=thick);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,r,thick);\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y,-1]) cylinder(r=r,h=thick+2);\n }\n hull() {\n for(y=[-r-1,-10])\n translate([0,y,thick])\n rotate([0,90,0]) cylinder(r=2,h=100,center=true);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.6,h=100);\n }\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\ntranslate([0,-40,0]) SpacerPair();\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=3) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\nmodule FanMount(w=40,r=4,thick=3) {\n difference() {\n union() {\n hull() {\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,r,thick);\n }\n for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01]) ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n FanGrill(r=16,height=thick-1);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n }\n difference() {\n translate([0,-20,0]) LowerHull(w,r,thick+11);\n cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\nFanMount($fn=64);\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"7f3928a5e9f3651faf64764cfb1dbaa4971b79ac","subject":"[scad] add ring magnet snap-to-fit","message":"[scad] add ring magnet snap-to-fit\n","repos":"flukso\/kube,flukso\/kube","old_file":"enclosure\/kube.scad","new_file":"enclosure\/kube.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"39054176acff1e9f0e2b30702b40c744a50081a8","subject":"Added new BG10 X\/Y idlers to better fit metal, toothed, flanged idler; also .5mm taller to allow less movement.","message":"Added new BG10 X\/Y idlers to better fit metal, toothed, flanged idler; also .5mm taller to allow less movement.\n","repos":"twstdpear\/i3_parts","old_file":"bg10\/x_axis\/y-drivetrain.scad","new_file":"bg10\/x_axis\/y-drivetrain.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"475574f008430e2d819b223ed59efd83f3ccb7d1","subject":"shapes: add roll param to cube","message":"shapes: add roll param to cube\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"shapes.scad","new_file":"shapes.scad","new_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0], orient=[0,0,1], roll=0)\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align, orient=orient, orient_ref=[0,0,1], roll=roll)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n size_align(size=[sizexy,sizexy,h], extra_size=[extra_sizexy, extra_sizexy, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","old_contents":"include \ninclude \nuse \nuse \n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align)\n {\n cube(size+extrasize, center=true);\n }\n}\n\nmodule rcubea(size=[10,10,10], rounding_radius=1, align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(size=size,extra_size=extrasize, align=align, extra_align=extrasize_align)\n {\n rcube(size=size+extrasize, rounding_radius=rounding_radius);\n }\n}\n\nmodule rcube(size=[20,20,20], rounding_radius=1)\n{\n hull()\n for(x=[-(size[0]\/2-rounding_radius),(size[0]\/2-rounding_radius)])\n for(y=[-(size[1]\/2-rounding_radius),(size[1]\/2-rounding_radius)])\n for(z=[-(size[2]\/2-rounding_radius),(size[2]\/2-rounding_radius)])\n translate([x,y,z])\n sphere(r=rounding_radius);\n}\n\n\nmodule cylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n orient=[0,0,1],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n round_radius=undef,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?d\/2:(r==undef?0:r);\n r1r2max = max(r1,r2) == undef ? max(d1,d2)\/2 : max(r1,r2);\n r__ = r_==undef? r1r2max : r_;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_r);\n\n sizexy=r__*2;\n extra_sizexy=extra_r_*2;\n\n if(debug)\n {\n echo(useDia, h, r_, r1_, r2_, extra_r_, align);\n }\n\n \/\/ some orient hax here to properly support extra_align\n size_align(size=[sizexy,sizexy,h], extra_size=[extra_sizexy, extra_sizexy, extra_h], orient=orient, orient_ref=[0,0,1], align=align, extra_align=extra_align)\n {\n if(round_radius==undef)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true);\n }\n else\n {\n rcylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, round_radius=round_radius);\n }\n }\n}\n\n\/*translate([10,0,0])*\/\n\/*rotate_extrude()*\/\n \/*translate([10-2,2,0])*\/\n\/*$fa = 5.6;*\/\n\/*$fs = 0.3;*\/\n\/*circle(r = 100);*\/\n\/*torus(10, 2, align=[0,0,0], orient=[0,0,1]);*\/\n\nmodule torus(radius, radial_width, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[radius*2+radial_width*2, radius*2+radial_width*2, radial_width*2], align=align, orient=orient)\n rotate_extrude()\n translate([radius, 0, 0])\n circle(radial_width);\n}\n\nmodule rcylinder(d=undef, r1=undef, r2=undef, h=10, round_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n r_= useDia?[d\/2,d\/2]:(r==undef?[r1_,r2_]:[r,r]);\n size_align(align=align, orient=orient)\n \/*translate([0,0,-h\/2])*\/\n hull()\n {\n \/*a = r_[0]-r_[1];*\/\n \/*b = h;*\/\n \/*c = pythag_hyp(a,b);*\/\n \/*echo(c);*\/\n \/*d = c;\/\/pythag_leg(a,c);*\/\n \/*echo(d);*\/\n \/*translate([0,r1-round_radius,0])*\/\n \/*cube([d,d,d]);*\/\n \/*angle2 = -atan2(-h, r1-r2);*\/\n \/*echo(angle2);*\/\n \/*x2 = r2-r1 < 0 ? (round_radius*2*cos(angle2)) : (round_radius*2*sin(angle2));*\/\n \/*echo(x2)*\/\n \/*translate([0, 0, h\/2-round_radius])*\/\n \/*torus(radius=r_[1]-round_radius, radial_width=round_radius, align=[0,0,0]);*\/\n\n for(z=[-1,1])\n translate([0, 0, z*(-h\/2)])\n {\n \/*rd = abs(r1-r2);*\/\n \/*angle1 = atan2(h, abs(r2-r1));*\/\n \/*x1 = round_radius*2*cos(angle1);*\/\n \/*echo(angle1, x1);*\/\n r__=z!=-1?r_[0]:r_[1];\n torus(radius=r__-round_radius\/2, radial_width=round_radius\/2, align=[0,0,z]);\n\n \/*translate([0, 0, -round_radius])*\/\n \/*cubea([r__*2,r__*2,5], align=[0,0,-z]);*\/\n }\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n}\n\n\/\/ positive angles go from start to end counterclockwise\n\/\/ negative angles are allowed\nmodule pie_slice(r, start_angle, end_angle, h, orient=[0,0,1], align=[0,0,0])\n{\n size_align(size=[r*2, r*2, h], orient=orient, orient_ref=[0,0,1], align=align)\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\nmodule hollow_cylinder(d=10, thickness=1, h=10, taper=false, taper_h=undef, orient=[0,0,1], align=[0,0,0])\n{\n outer_d = d+thickness\/2;\n inner_d = d-thickness\/2;\n size_align(size=[outer_d, outer_d, h], orient=orient, align=align)\n difference()\n {\n \/*hull()*\/\n union()\n {\n cylindera(h=h-taper_h*2, d=outer_d, orient=[0,0,1], align=[0,0,0]);\n taper_h = taper_h == undef ? (outer_d-inner_d)\/4 : taper_h;\n \/*taper_h_ = pythag_leg(taper_h, outer_d-inner_d);*\/\n \/*echo(taper_h_);*\/\n if(taper)\n {\n for(z=[-1,1])\n translate([0,0,z*(h\/2-taper_h)])\n mirror([0,0,z==-1?1:0])\n difference()\n {\n cylindera(d1=outer_d, d2=outer_d-inner_d\/4, h=taper_h*2, align=[0,0,1]);\n cylindera(d1=inner_d, d2=outer_d, h=taper_h*2+.1, align=[0,0,1]);\n }\n }\n }\n\n cylindera(h=h+.4, d=inner_d, orient=[0,0,1], align=[0,0,0]);\n }\n}\n\n\n\/**\n * Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule triangle(o_len, a_len, depth, align=[0,0,0], orient=[0,0,1])\n{\n size_align(size=[a_len, depth, o_len], align=align, orient=orient)\n rotate([90,0,0])\n translate([-a_len\/2, -o_len\/2, -depth\/2])\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,o_len]], paths=[[0,1,2]]);\n }\n}\n\n\/**\n * Rounded Standard right-angled triangle\n *\n * @param number o_len Lenght of the opposite side\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n * @todo a better way ?\n *\/\nmodule rtriangle(o_len, a_len, depth, rounding_radius=2, align=[0,0,0], orient=[0,0,1])\n{\n size = [a_len-rounding_radius, depth-rounding_radius, o_len-rounding_radius];\n r_x = rounding_radius;\n r_y = rounding_radius;\n r_z = -rounding_radius;\n\n hyp = pythag_hyp(o_len,a_len);\n a_z = atan(a_len\/o_len);\n\n translate([0,0,size[2]+2])\n color([1,0,0])\n rotate([90,90,0])\n pie_slice(r=2, start_angle=0, end_angle=a_z, h=depth);\n\n \/*translate([size[0]+4,0,0])*\/\n \/*color([1,0,0])*\/\n \/*rotate([90,90,0])*\/\n \/*pie_slice(r=2, start_angle=90, end_angle=90+a_z, h=depth);*\/\n\n size_align(size=size, align=align, orient=orient)\n \/*hull()*\/\n for(x=[-(size[0]\/2)+rounding_radius,(size[0]\/2)-r_x])\n for(y=[-(size[1]\/2)+rounding_radius,(size[1]\/2)-r_y])\n for(z=[-(size[2]\/2)+rounding_radius,(size[2]\/2)-r_z])\n translate([x,y,z])\n if(x<=1 || z<=1)\n sphere(r=rounding_radius);\n}\n\n\/*debug();*\/\n\nmodule debug()\n{\n $fs = 0.1;\n $fa = 1;\n\n \/*triangle_a(45, 5, 5);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,-1]);*\/\n \/*triangle(15, 10, 5, align=[1,1,1], orient=[0,0,1]);*\/\n\n triangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n translate([0,-10,0])\n rtriangle(10, 30, 5, align=[1,1,1], orient=[0,0,1]);\n}\n\n\/**\n * Standard right-angled triangle (tangent version)\n *\n * @param number angle of adjacent to hypotenuse (ie tangent)\n * @param number a_len Lenght of the adjacent side\n * @param number depth How wide\/deep the triangle is in the 3rd dimension\n *\/\nmodule triangle_a(tan_angle, a_len, depth)\n{\n linear_extrude(height=depth)\n {\n polygon(points=[[0,0],[a_len,0],[0,tan(tan_angle) * a_len]], paths=[[0,1,2]]);\n }\n}\n\n\/\/ Tests:\nmodule test_triangles()\n{\n \/\/ Generate a bunch of triangles by sizes\n for (i = [1:10])\n {\n translate([i*7, -30, i*7])\n {\n triangle(i*5, sqrt(i*5+pow(i,2)), 5);\n }\n }\n\n \/\/ Generate a bunch of triangles by angle\n for (i = [1:85\/5])\n {\n translate([i*7, 22, i*7])\n {\n triangle_a(i*5, 10, 5);\n }\n }\n}\n\n\nif(false)\n{\n \/*hollow_cylinder(thickness=5, h=10, taper=true, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=10, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*translate([10,0,0])*\/\n \/*{*\/\n \/*hollow_cylinder(d=10, thickness=4, h=10, taper=true, taper_h=.5, orient=[0,0,1], align=[0,0,1]);*\/\n \/*cylindera(d=8, h=10, orient=[0,0,1], align=[0,0,1]);*\/\n \/*}*\/\n\n \/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n \/*cubea([10,10,10],[1,0,0]);*\/\n \/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n \/*%cubea([10,10,10],[-1,0,1]);*\/\n \/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n \/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n \/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n \/*%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);*\/\n\n \/*hull_pairwise()*\/\n \/*sphere(30\/2);*\/\n\n \/*translate([30,0,0])*\/\n \/*rcubea(s=[35,35,35], rounding_radius=10);*\/\n \/*rcubea(s=[35,35,35], align=[0,-1,0]);*\/\n\n \/*translate([60,0,0])*\/\n \/*sphere(30\/2);*\/\n\n\n cylindera(h=20, r=5*mm, align=[0,1,0], orient=[0,0,1], $fn=100);\n\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,0,1])*\/\n\/*size_align(size=[5,5,20], orient=[0,1,0], orient_ref=[0,1,0], align=[0,1,0])*\/\n\/*size_align(size=[5,20,5], orient=[0,0,1], orient_ref=[0,1,0], align=[0,0,0])*\/\n\/*rotate([90,0,0])*\/\n\/*cylinder(d=5, h=20, center=true);*\/\n\n\/*cylindera(d=10, h=10, orient=[0,1,0], align=[0,0,1]);*\/\n}\n\n\nif(false)\n{\n r=5*mm;\n for(axis=concat(AXES,-AXES))\n translate(axis*r*2)\n {\n c= v_abs(axis*.3 + v_clamp(v_sign(axis),0,1)*.7);\n color(c)\n cylindera(h=20, r=r, align=axis, orient=axis, extra_h=r, extra_align=-axis, $fn=100);\n }\n}\n\nif(false)\n{\n stack(dist=50, axis=[0,1,0])\n {\n stack(dist=10, axis=[0,0,-1])\n {\n \/*cylindera(orient=[0,0,-1], align=[0,0,-1]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,1], align=[0,0,-1]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,0,-1], align=[0,0,1]);\n \/*pie_slice(r=30, h=5, start_angle=-90, end_angle=180, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=90, end_angle=270, align=[0,0,-1]);*\/\n \/*pie_slice(r=30, h=5, start_angle=0, end_angle=270, align=[0,0,-1]);*\/\n }\n\n stack(dist=10, axis=[0,1,0])\n {\n \/*cylindera(orient=[0,1,0], align=[0,1,0]);*\/\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,-1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=120, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=-90, end_angle=180, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=90, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n pie_slice(r=30, h=5, start_angle=0, end_angle=270, orient=[0,1,0], align=[0,1,0]);\n }\n }\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"c37995fe1cbb61673e18762de72499d9c7bef3e4","subject":"config: increase ziptie width to 4mm","message":"config: increase ziptie width to 4mm\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 4*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/*$show_vit=true;*\/\n\n\/\/ enable preview model (faster openscad)\npreview_mode=true;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 420*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 500*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [2*mm, 3*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance = 3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearings_top=2;\nxaxis_bearings_bottom=1;\nxaxis_bearing=bearing_bronze_10_16_12;\nxaxis_bearing_bottom=bearing_bronze_10_16_18;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_pulley_outer_d = xaxis_pulley[3];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\nxaxis_beltpath_height_body = xaxis_pulley_outer_d\/2+3*mm+v_sum(v_abs(xaxis_beltpath_z_offsets))+5*mm;\nxaxis_beltpath_height_holders = max(xaxis_pulley_outer_d+2*mm, xaxis_pulley_inner_d+xaxis_beltpath_z_offsets[0]+3*mm);\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\nxaxis_motor_thread=ThreadM3;\nxaxis_motor_nut=MHexNutM3;\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\n\/*yaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nyaxis_bearing=bearing_bronze_12_18_18;\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 10*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size = [220*mm,220*mm,5*mm];\nprintbed_size = [213*mm,213*mm,3*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/\/ relative to entire machine\nzaxis_rod_offset = [0,-20*mm,0];\nzaxis_bearing=bearing_bronze_12_18_18;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h, screw_dist, screw_thread\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm, 13.5*mm, ThreadM3];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"75042eda70ebb1c83da72a63b436b4b63c7e5679","subject":"config: remove x rod offset","message":"config: remove x rod offset\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"config.scad","new_file":"config.scad","new_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 0*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","old_contents":"include \ninclude \ninclude \ninclude \ninclude \ninclude \ninclude \n\ne=0.01;\n\n\/\/ minimum size of a fragment\n\/\/ resolution of any round object (segment length)\n\/\/ Because of this variable very small circles have a smaller number of fragments than specified using $fa. \n\/\/ The default value is 2.\n$fs = 2;\n\n\/\/ minimum angle for a fragment.\n\/\/ The default value is 12 (i.e. 30 fragments for a full circle)\n$fa = 12;\n\n\/\/hq\nif(false)\n{\n $fs= 0.5;\n $fa = 4;\n}\n\n\/\/ enable preview model (faster openscad)\npreview_mode=false;\n\nextrusion_height = 0.4*mm;\n\n\/\/ width of a single wall, should match your slicer settings\nextrusion_width = 0.4*mm;\n\n\/\/ how many lines should a normal wall have (i.e. 0.6(extrusion_width)*6(normal_wall_factor)= 3.6mm wall width)\nnormal_wall_factor = 3;\n\nthick_wall_factor = 4;\n\n\/\/ diameter of your filament.\nfilament_d = 1.75*mm;\nfilament_r = filament_d\/2;\n\n\nmain_width = 340*mm;\nmain_depth = 420*mm;\nmain_height = 400*mm;\nmain_upper_width = 420*mm;\n\nextrusion_size = 20*mm;\nextrusion_thread = ThreadM5;\nextrusion_thread_dia = lookup(ThreadSize, extrusion_thread);\nextrusion_nut = MHexNutM5;\nextrusion_nut_dia = lookup(MHexNutWidthMax, extrusion_nut);\n\n\/\/ for tapped ends\nextrusion_end_nut = MHexNutM6;\n\nmain_lower_dist_z = 80*mm;\nmain_upper_dist_y = 160*mm;\n\ngantry_connector_thickness = 5;\n\nrod_fit_tolerance=1.01;\n\nziptie_type = [1.2*mm, 2.8*mm];\nziptie_thickness = ziptie_type[0];\nziptie_width = ziptie_type[1]+0.6*mm;\nziptie_bearing_distance=3*mm;\n\nxaxis_rod_distance = 60*mm;\nxaxis_rod_d = 9.975*mm;\nxaxis_rod_l = 500*mm;\nxaxis_rod_offset_x = 20*mm;\nxaxis_bearing=bearing_sf1_1010;\n\/*xaxis_bearing=bearing_igus_rj4jp_01_10;*\/\n\nxaxis_pulley = pulley_2GT_20T;\nxaxis_pulley_inner_d = xaxis_pulley[2];\nxaxis_idler_pulley = pulley_2GT_20T_idler;\nxaxis_idler_pulley_inner_d = xaxis_idler_pulley[2];\nxaxis_idler_pulley_outer_d = xaxis_idler_pulley[3];\n\nxaxis_belt_width = 6*mm;\nxaxis_beltpath_height = xaxis_pulley_inner_d+5*mm;\nxaxis_beltpath_width = max(xaxis_belt_width+3*mm, xaxis_pulley[0]+2*mm);\nxaxis_beltpath_z_offset_pulley = xaxis_pulley_inner_d\/2;\n\/*xaxis_beltpath_z_offsets = [xaxis_beltpath_z_offset_pulley];*\/\nxaxis_beltpath_z_offsets = [-2*mm-xaxis_beltpath_z_offset_pulley, 2*mm+xaxis_beltpath_z_offset_pulley];\n\nxaxis_carriage_bearing_offset_y = ziptie_thickness+3*mm;\nxaxis_carriage_beltpath_offset_y = xaxis_carriage_bearing_offset_y+xaxis_bearing[1]\/2;\n\nxaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_rod_distance = 170*mm;\nyaxis_rod_d = 11.975*mm;\nyaxis_rod_l = 500*mm;\nyaxis_bearing=bearing_igus_rj4jp_01_12;\n\/*yaxis_bearing=bearing_sf1_1212;*\/\nyaxis_bearing_distance_y = 7*cm;\n\nyaxis_motor = dict_replace(Nema17, NemaFrontAxleLength, 22*mm);\n\nyaxis_pulley = pulley_2GT_20T;\nyaxis_pulley_inner_d = yaxis_pulley[2];\nymotor_mount_thickness = 5;\nymotor_mount_thickness_h = 5;\nyaxis_motor_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_motor_offset_z = -5*mm;\nyaxis_belt_path_offset_x = -yaxis_pulley_inner_d\/2;\nyaxis_belt_path_offset_z = yaxis_motor_offset_z + 15*mm;\n\nyaxis_idler_pulley = pulley_2GT_20T_idler;\nyaxis_idler_pulley_inner_d = yaxis_idler_pulley[2];\nyaxis_idler_pulley_outer_d = yaxis_idler_pulley[3];\nyaxis_idler_pulley_h = yaxis_idler_pulley[0];\nyaxis_idler_mount_thickness = 5;\nyaxis_idler_pulley_tight_len = 20*mm;\nyaxis_idler_pulley_offset_y = yaxis_idler_mount_thickness + yaxis_pulley_inner_d\/2 + yaxis_idler_pulley_tight_len;\nyaxis_idler_offset_x = lookup(NemaSideSize,yaxis_motor)\/2+ymotor_mount_thickness;\nyaxis_idler_offset_z = 10*mm;\n\nyaxis_carriage_size=[220*mm,220*mm,5*mm];\n\nzaxis_rod_d = 11.975*mm;\nzaxis_rod_l = 500*mm;\n\/*zaxis_bearing=bearing_igus_rj4jp_01_12;*\/\nzaxis_bearing=bearing_sf1_1212;\n\n\/\/ Nema17 motor w\/340mm long 8*mm leadscrew\nzaxis_motor = dict_replace_multiple(Nema17,\n [\n [NemaAxleDiameter, 8*mm],\n [NemaFrontAxleLength, 340*mm],\n ]);\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\n\n\/\/ inner_d, outer_d, thread, outer_h, full_h\nzaxis_nut = [20*mm, 36*mm, 8*mm, 5*mm, 23*mm];\n\nzaxis_motor_offset_z = 10*mm;\nzmotor_mount_thickness = 5;\nzmotor_mount_thickness_h = 10;\nzmotor_mount_motor_offset=5;\n\nzmotor_w = lookup(NemaSideSize,zaxis_motor);\nzmotor_h = lookup(NemaLengthLong,zaxis_motor);\nzmotor_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\nzmotor_mount_width = zmotor_w+zmotor_mount_thickness*2 + zmotor_mount_thread_dia*8;\nzmotor_mount_h = main_lower_dist_z+extrusion_size+zaxis_motor_offset_z;\n\nzmotor_mount_clamp_dist = zaxis_rod_d*2.5;\nzmotor_mount_clamp_thread = ThreadM4;\nzmotor_mount_clamp_nut = MHexNutM4;\nzmotor_mount_clamp_thread_dia = lookup(ThreadSize, zmotor_mount_clamp_thread);\nzmotor_mount_clamp_nut_dia = lookup(MHexNutWidthMin, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_nut_thick = lookup(MHexNutThickness, zmotor_mount_clamp_nut);\nzmotor_mount_clamp_width = zmotor_mount_clamp_dist+zmotor_mount_clamp_thread_dia*3;\n\nxaxis_zaxis_distance_y_ = max(xaxis_rod_d\/2 + zaxis_bearing[1]\/2, zaxis_nut[1]\/2 - xaxis_rod_d\/2);\nxaxis_zaxis_distance_y = xaxis_zaxis_distance_y_ + ziptie_type[0]+.5*mm + 1*mm;\n\nzaxis_nut_mount_outer = zaxis_nut[1]\/2 + zaxis_rod_d\/2 + 1*mm;\n\n\/\/ offset between Z motor screw and z rod\n\/\/ place z rod as close as possible (depends on z nut and also motor etc)\nzaxis_rod_screw_distance_x = max(zaxis_nut_mount_outer, zaxis_rod_d\/2 + zmotor_w\/2 + 1*mm);\n\n\/\/ z rod offset from lower extrusion (outer)\nzmotor_mount_rod_offset_x = zmotor_w\/2+zaxis_rod_screw_distance_x+zmotor_mount_motor_offset;\n\n\/\/ z screw offset from lower extrusion (outer)\nzmotor_mount_screw_offset_x = zmotor_mount_rod_offset_x - zaxis_rod_screw_distance_x ;\n\ncolor_extrusion = \"DimGray\";\ncolor_rods = \"CornflowerBlue\";\ncolor_part = \"DarkRed\";\ncolor_gantry_connectors = \"OliveDrab\";\n\n\/\/ GT2 \n\/\/ there is bunch of GT2 belts with different tooth-to-tooth distance\n\/\/ this one is most common in reprap world\n\/\/ adjust to your needs.\nbelt_width = 6.5;\nbelt_tooth_distance = 2;\nbelt_tooth_ratio = 0.5;\nbelt_thickness = 0.8;\n\n\/\/T2.5\n\/\/belt_tooth_distance = 2.5;\n\/\/belt_tooth_ratio = 0.5;\n\n\/\/T5 (strongly discouraged)\n\/\/belt_tooth_distance = 5;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/HTD3\n\/\/belt_tooth_distance = 3;\n\/\/belt_tooth_ratio = 0.75;\n\n\/\/MXL\n\/\/belt_tooth_distance = 2.032;\n\/\/belt_tooth_ratio = 0.64;\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"26fcaccbcba7f00085750581b6dd84c01d3c97f6","subject":"moved screw hole a bit","message":"moved screw hole a bit\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_door_stop\/closet_door_stop.scad","new_file":"closet_door_stop\/closet_door_stop.scad","new_contents":"N=2;\nM=2;\nspacing=3;\n\nmodule door_stop()\n{\n span=10;\n difference()\n {\n union()\n {\n scale([0.5, 1, 1])\n rotate([-90, 0, 0])\n cylinder(r=10, h=span, $fn=50);\n cube([10, span, 10]);\n }\n \/\/ cutt bottom part\n translate([-10, -5, -15])\n cube([30, span+10, 15]);\n \/\/ drill\n translate([5\/2, span\/2, -5])\n cylinder(d=3.5, h=20, $fn=50);\n }\n}\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*(15+spacing), j*(10+spacing), 0])\n door_stop();\n","old_contents":"N=2;\nM=2;\nspacing=3;\n\nmodule door_stop()\n{\n span=10;\n difference()\n {\n union()\n {\n scale([0.5, 1, 1])\n rotate([-90, 0, 0])\n cylinder(r=10, h=span, $fn=50);\n cube([10, span, 10]);\n }\n \/\/ cutt bottom part\n translate([-10, -5, -15])\n cube([30, span+10, 15]);\n \/\/ drill\n translate([5, span\/2, -5])\n cylinder(d=3.5, h=20, $fn=50);\n }\n}\n\nfor(i=[0:N-1])\n for(j=[0:M-1])\n translate([i*(15+spacing), j*(10+spacing), 0])\n door_stop();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1f996b9d8d04151b9f6a97f06722d052e18509f9","subject":"added rounded surfaces helper functions + reworking original elements code","message":"added rounded surfaces helper functions + reworking original elements code\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_file":"philips_sonicare_brush_holder\/brush_holder.scad","new_contents":"names=[\"John\", \"Jane\"];\n\n\nmodule rounded_surface_(size)\n{\n r=size[2]\/2;\n translate([0, 0, r])\n hull()\n for(dx=[r, size[0]-r])\n for(dy=[r, size[1]-r])\n translate([dx, dy, 0])\n sphere(r=r, $fn=30);\n}\n\nmodule rounded_half_surface_(size)\n{\n translate([0, 0, -size[2]\/2])\n difference()\n {\n rounded_surface_(size);\n translate(size[2]\/2*[0,0,-1])\n cube(size);\n }\n}\n\n\n\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(size)\n{\n hull()\n difference()\n {\n #for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(size)\n{\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n}\n\n\nmodule brush_holder()\n{\n wall([36,50,2]);\n plane([0,16.5,50\/2-2], [36-2*2,29,2]);\n for(dx=[-1, +1])\n translate([dx*20\/2-1, -1, 2])\n holder([3,25,18]);\n}\n\n\nbrush_holder();\n\n\n\/\/rounded_surface_([20,30,5]);\n\/\/rounded_half_surface_([20,30,5]);\n","old_contents":"$fn=30;\n\ncorrners = [ [-1,-1,0], [-1,+1,0], [+1,-1,0], [+1,+1,0] ];\n\n\/\/ wall-mounted part\nmodule wall(tr, size)\n{\n translate(tr)\n hull()\n difference()\n {\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n translate([0,0,-size[2]]) cube(2*size, center=true);\n }\n}\n\n\/\/ water drops catching plane\nmodule plane(tr, size)\n{\n rotate([90,0,0])\n translate(tr)\n hull()\n for(t = corrners)\n {\n off = [size[0]\/2*t[0], size[1]\/2*t[1], 0*t[2]];\n translate(off)\n sphere(size[2]);\n };\n}\n\n\/\/ element for holding a single brush\nmodule holder(tr, size)\n{\n translate(tr)\n {\n cube([size[0], 7, size[2]]);\n translate([1.5, 7, size[2]-3])\n rotate([-90,0,0])\n {\n cylinder(r=(8-1.5)\/2, h=7+2);\n cylinder(r=(3-1)\/2, h=14+2);\n }\n }\n}\n\n\nmodule brush_holder()\n{\n wall([0,0,0], [36,50,2]);\n plane([0,16.5,50\/2-2], [36-2*2,29,2]);\n holder([20\/2-1,-1,2], [3,25,18]);\n holder([-20\/2-1,-1,2], [3,25,18]);\n}\n\n\nbrush_holder();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"85968de2f4ead9dd57d97fdaa8539f78ae4908dd","subject":"screws\/nut_trap_cut: don't show screw if not cutting it","message":"screws\/nut_trap_cut: don't show screw if not cutting it\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"screws.scad","new_file":"screws.scad","new_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n material(Mat_Steel)\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n }\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","old_contents":"include \ninclude \ninclude \ninclude \n\nuse \nuse \nuse \n\n\/\/ naive, assume head height is same as thread size (generally true for cap heads)\nfunction get_screw_head_h(head, thread) = get(ThreadSize, thread);\nfunction get_screw_head_d(head, thread) = 2 * get(ThreadSize, thread);\n\nmodule screw(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, with_head=true, nut_offset=0, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw: No nut or thread given\");\n assert(head != U, \"screw: head == U\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw: Mismatched nut and thread\");*\/\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n nut_h = get(NutThickness,nut)*tolerance;\n threadsize = get(ThreadSize, thread_);\n\n s = threadsize*tolerance;\n total_h = h;\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head(head=head, thread=thread_, orient=Z, align=Z);\n }\n\n screw_thread(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut(nut=nut, tolerance=tolerance, orient=Z, align=-Z);\n }\n }\n\n if($show_vit)\n {\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n %screw_nut(nut=nut, align=-Z);\n }\n }\n }\n}\n\nmodule screw_cut(nut, thread, head=\"socket\", h=10, tolerance=1.05, head_embed=false, with_nut=true, nut_cut_h=1000, with_head=true, head_cut_h=1000, nut_offset=0, cut_access=true, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"screw_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"screw_cut: Mismatched nut and thread\");*\/\n\n nut_h = get(NutThickness,nut)*tolerance;\n assert(head != U, \"screw_cut: head == U\");\n\n head_h = get_screw_head_h(head=head, thread=thread_);\n assert(head_h != U, \"screw_cut: head_h is U!\");\n\n threadsize = get(ThreadSize, thread_);\n assert(threadsize != U, \"screw_cut: threadsize is U!\");\n\n s = threadsize*tolerance;\n total_h = h;\n assert(s != U, \"screw_cut: s is U!\");\n size_align(size=[s, s, total_h], orient=-orient, orient_ref=Z, align=align)\n {\n translate([0,0,head_embed?-head_h:0])\n {\n if(with_head)\n {\n translate([0,0,h\/2+.01])\n screw_head_cut(head=head, thread=thread_, tolerance=tolerance, override_h=head_cut_h, align=Z);\n }\n\n screw_thread_cut(thread=thread_, h=h+.1, tolerance=tolerance, orient=Z, align=N);\n\n if(with_nut && nut != U)\n {\n translate([0,0,-h\/2+nut_h+nut_offset+(head_embed?head_h:0)])\n screw_nut_cut(nut=nut, tolerance=tolerance, h=nut_cut_h, align=-Z);\n }\n\n if($show_vit)\n {\n %screw(nut=nut, thread=thread, head=head, h=h, tolerance=tolerance, with_nut=with_nut, with_head=with_head, nut_offset=nut_offset, orient=-Z, align=N);\n }\n }\n }\n}\n\nmodule screw_thread(thread, h=10, tolerance=1.00, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread: thread is undef\");\n \/\/ TODO render thread\n threadsize = get(ThreadSize, thread);\n\n material(Mat_Steel)\n cylindera(d=threadsize, h=h, orient=orient, align=align);\n}\n\nmodule screw_thread_cut(thread, h=10, tolerance=1.05, orient=Z, align=N)\n{\n assert(thread!=U, \"screw_thread_cut: thread is undef\");\n threadsize = get(ThreadSize, thread);\n cylindera(d=threadsize*tolerance, h=h, orient=orient, align=align);\n}\n\nmodule screw_head(head=\"socket\", drive=\"hex\", thread, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head: thread == undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread);\n material(Mat_Steel)\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n {\n if(head==\"socket\")\n {\n difference()\n {\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h), align=Z);\n\n if(drive == \"hex\")\n {\n cylindera(d = fn_radius(threadsize, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n }\n else if(head==\"button\")\n {\n c = head_d;\n f = head_h*1.25;\n r = ( pow(c,2)\/4 + pow(f,2) )\/(2*f); \n\n d = r - f; \/\/ displacement to move sphere\n\n difference()\n {\n intersection()\n {\n tz(-head_h\/2)\n scale([1,1,.5])\n spherea(r = head_h, align=N);\n\n tz(-head_h\/2)\n cylindera(d=head_d, h = fallback(override_h,head_h)\/2, align=Z);\n }\n\n if(drive == \"hex\")\n {\n \/\/ button head uses -0.5*mm smaller hex\n tz(-head_h\/2)\n cylindera(d = fn_radius(threadsize-.5, 6), h = 1000, $fn = 6, align=Z);\n }\n }\n\n }\n }\n}\n\nmodule screw_head_cut(head=\"socket\", thread, tolerance=1.05, override_h=U, orient=Z, align=N)\n{\n assert(head != U, \"screw_head: head == U\");\n assert(thread!=U, \"screw_head_cut: thread is undef\");\n\n threadsize = get(ThreadSize, thread);\n head_h = get_screw_head_h(head=head, thread=thread);\n head_d = get_screw_head_d(head=head, thread=thread)*tolerance;\n size_align(size=[head_d, head_d, head_h], orient=orient, align=align)\n translate([0,0,-head_h\/2])\n cylindera(d=head_d, h=fallback(override_h, head_h), align=Z);\n}\n\nmodule screw_nut(nut, tolerance=1.00, override_h=U, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n material(Mat_Steel)\n cylindera($fn=nut_facets, d=nut_dia, h=fallback(override_h, nut_thick), orient=orient, align=align);\n}\n\nmodule screw_nut_cut(nut, tolerance=1.05, h=1000, orient=Z, align=N)\n{\n assert(nut!=U, \"screw_nut_cut: nut is undef\");\n\n nut_thick = get(NutThickness,nut)*tolerance;\n nut_dia = nut_dia(nut);\n size_align(size=[nut_dia, nut_dia, nut_thick], orient=orient, align=align)\n {\n translate([0,0,nut_thick\/2])\n {\n screw_nut(nut, tolerance, orient=Z, align=-Z);\n translate([0,0,-nut_thick+.01])\n {\n cylindera(d=nut_dia+2*mm, h=h, orient=Z, align=-Z);\n }\n }\n }\n}\n\nfunction nut_radius(nut) = outradius(get(NutWidthMin, nut)\/2, get(NutFacets, nut));\nfunction nut_dia(nut) = 2*nut_radius(nut);\n\nmodule nut_trap_cut(nut, thread, head, trap_offset=10, screw_l=10*mm, screw_offset=0*mm, cut_screw=false, trap_h=10, trap_axis=-Y, orient=Z, align=N)\n{\n nut_thread = get(NutThread, nut);\n thread_ = fallback(thread, nut_thread);\n assert(thread_ != U, \"nut_trap_cut: No nut or thread given\");\n \/*assert(nut!=U && thread!=U && nut_thread != thread_, \"nut_trap_cut: Mismatched nut and thread\");*\/\n\n threadsize = get(ThreadSize, thread_);\n head_h = get_screw_head_h(head=head, thread=thread);\n nut_h = get(NutThickness, nut) +.5*mm;\n\n nut_width_min = get(NutWidthMin, nut);\n nut_facets = get(NutFacets, nut);\n nut_dia = nut_dia(nut);\n total_h = nut_h;\n size_align(size=[nut_dia, nut_dia, total_h], orient=orient, orient_ref=Z, align=align)\n {\n if(cut_screw)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n screw_cut($show_vit=false, nut=nut, thread=thread_, with_nut=false, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n else\n {\n translate([0,0,nut_h\/2+screw_offset])\n screw_thread_cut($show_vit=false, thread=thread_, tolerance=1.1, h=screw_l, orient=-Z, align=Z);\n }\n\n hull()\n {\n orient(axis=Z, axis_ref=orient)\n translate(-.15*mm*trap_axis)\n stack(dist=trap_h, axis=trap_axis)\n {\n orient(axis=orient, axis_ref=Z)\n {\n rotate([0,0,30])\n cylindera($fn=nut_facets, d=nut_dia, h=nut_h, align=N);\n }\n\n orient(axis=orient, axis_ref=Z)\n cubea(size=[nut_width_min,nut_width_min,nut_h], align=N);\n }\n }\n\n if($show_vit)\n {\n translate(-nut_h\/2*Z)\n translate(screw_offset*Z)\n %screw(nut=nut, thread=thread_, with_nut=false, tolerance=1, h=screw_l, orient=-Z, align=Z);\n\n rotate([0,0,30])\n %screw_nut(nut=nut, thread=thread, tolerance=1, orient=-Z, align=N);\n }\n\n }\n}\n\nif(false)\n{\n all_axes()\n translate($axis*5*mm)\n color($color)\n screw(nut=NutHexM3, h=10*mm, orient=-$axis, align=$axis);\n}\n\n\/\/ all nuts\nif(false)\n{\n for(nuti=[0:1:len(AllNut)-1])\n {\n nut = AllNut[nuti];\n v_threadsize = v_get(AllNut,ThreadSize);\n v_nutwidthmin = v_get(AllNut,NutWidthMin);\n dist = v_cumsum(v_nutwidthmin, 0, nuti)[nuti]*1.2;\n translate(X*dist)\n rotate([0,0,30])\n screw(nut=nut, h=get(NutWidthMax, nut)*5, head_embed=false, orient=-Z, align=Z);\n }\n}\n\nif(false)\n{\n nut1 = NutHexM3;\n stack(axis=X, dist = 10)\n {\n screw(nut=nut1, head=\"button\", h=10, orient=-Z);\n screw(nut=nut1, head=\"socket\", h=10, orient=-Z);\n }\n}\n\nif(false)\n{\n box_w = 150*mm;\n box_d = 10*mm;\n box_h = 10*mm;\n o = 10*mm;\n\n $show_vit = true;\n \/*$fs= 0.2;*\/\n \/*$fa = 4;*\/\n\n nut1 = NutHexM3;\n nut2 = NutHexM5;\n nut3 = NutKnurlM3_3_42;\n nut4 = NutKnurlM3_5_42;\n\n \/*all_axes()*\/\n \/*for($axis=[X])*\/\n \/*color($color)*\/\n \/*translate($axis*15)*\/\n \/*echo($axis)*\/\n\n \/*orient(axis=$axis, axis_ref=-X)*\/\n for(y=[-1,1])\n translate(-y*Y*20*mm)\n difference()\n {\n cubea([box_w,box_d,box_h], align=X+Z);\n test_cuts(orient=y*Z);\n \/*%test_cuts(orient=y, axis_ref=-Z);*\/\n }\n\n}\n\nmodule test_cuts(orient)\n{\n union()\n {\n \/*offset = 0;*\/\n offset = -5;\n \/*translate([0,offset,0])*\/\n \/*translate([5,0,-5])*\/\n translate([5,0,0])\n stack(dist=10,axis=X)\n {\n screw_cut(nut=nut1, head=\"button\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, head=\"socket\", h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(thread=ThreadM5, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut1, h=box_h, head_embed=false, orient=orient, align=Z);\n\n screw_cut(nut=nut1, h=box_h, nut_offset=0*mm, head_embed=true, orient=orient, align=Z);\n screw_cut(nut=nut2, h=box_h, nut_offset=3*mm, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n screw_cut(nut=nut4, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,-5*mm])\n screw_cut(nut=nut3, h=box_h, head_embed=false, orient=orient, align=Z);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=-Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=5, head_embed=false, trap_h=10, trap_axis=Y, orient=orient, align=N);\n\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=Z, orient=orient, align=N);\n translate([0,0,box_h\/2])\n nut_trap_cut(nut=nut1, h=box_d, head_embed=false, trap_h=10, screw_offset=2*mm, trap_axis=-Z, orient=orient, align=N);\n }\n }\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"decd5358ac224f3b9ac84937ac159dbcd8e2fd7f","subject":"make small end of BH a little thinner, to allow nylock to lock using 1 inch screw for H node.","message":"make small end of BH a little thinner, to allow nylock to lock using 1 inch screw for H node.\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/Jansen.scad","new_file":"Drawings\/Jansen.scad","new_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"BH\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\n\/\/ make small end of BH a little shorter to make it easier to use a 1\" screw for 'hamstirng' node\nelse if (PART==\"BHs\" ) BHs( BH,2.5*NodeHeight+1.5,Brad+1.8,BradFree,3.7,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight+1.5,Brad+1.8,BradFree,3.7,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","old_contents":"\/\/ $URL: svn+ssh:\/\/mrwhat@ssh.boim.com\/home\/mrwhat\/svn\/Walker\/trunk\/Jansen.scad $\n\/\/ $Id: Jansen.scad 427 2014-08-23 20:42:39Z mrwhat $\n\n\/\/ Define PART to one of the following values to generate model for desired part.\n\/\/ HipA, HipB, FootA, FootB, CH, CD, EF, BH, AC, pulley, mainBar, drivePulley\n\/\/ For a 2-leg (half-trotter) : print (2) CH, CD ; (4) EF, BH ; (1) of the others\n\/\/ For a production robot, glue a rectangular support\/spacer between BH pairs for stiffness\n\/\/\n\/\/ Combined parts with pads, optimized for RepRap :\n\/\/ Hip, Feet, crankLinks, EFs, BHs : main, pulley, drivePulley as above (brace)\nPART=\"HipA\";\nhingeStyle = \"spacer\"; \/\/6standoff\"; \/\/ spacer or standoff\necho(str(\"PART=\",PART));\n\nHoleFuzz = 0.1; \/\/ extra radius (mm) to add to holes to account for printer slop\ndHoleFuzz = 0.2; \/\/ extra radius (mm) to add to d-shaft holes. Sometimes not the same as HoleFuzz since it is harder to clean D-shaft holes\n\n\/\/ measured diameter of '3\/16\"' spacer was 4.74 to 4.76, not 4.7625 as expected.\n\/\/ Current design: 3\/16\" axles at B\n\/\/ 3\/16\" long 1\/4\" OD standoffs at D, E, F\n\/\/ 1\/2\" long 3\/16\" OD standoffs at H, A, C\nBdiam = 4.7625; \/\/ larger brass tube rdiameter, measured on 3\/16\" tube\nAdiam = 4.76;\nHdiam = Adiam;\n\/\/Ddiam = 6.35; \/\/ 1\/4\" OD standoffs\nDdiam = Adiam; \/\/ 3\/16\" OD standoffs\/spacers\ndiam4 = 2.76; \/\/ diameter of #4-40 screw, OD of thread\n\n\n\/\/ on spacer tests:\n\/\/ Brad +.125 mm was snug, but not quite free rotating\n\/\/ +.05 turned, but not freely\n\/\/ -.025 still turned, was very close\n\/\/ Arad +.125 turned free (good for main, crankLinks)\n\/\/ +.05 was press-to-fit (good for crankArm)\n\/\/ rad4 + 0.2 allowed a screw to go through snugly but freely\n\/\/ +.125 only threaded through\n\/\/ 1\/4\"OD + 0.2 was a snug fit, no turn. almost press-to-fit\n\/\/ + 0.275 snug, free turn... good for hinges on standoff\n\nBrad = Bdiam\/2 + HoleFuzz\/2; \/\/ 4.76mm diam brass tube -- critical fit\nArad = Adiam\/2 + HoleFuzz\/2.3; \/\/ 3.18mm diam brass tube -- critical fit\nrad4 = diam4\/2 + HoleFuzz; \/\/ good for screw pass-through\nHrad = Hdiam\/2 + HoleFuzz*1.35; \/\/ standoff holes for freely-moving hinges\nDrad = Ddiam\/2 + HoleFuzz;\nAradFree = Adiam\/2 + .25; \/\/ loose fit on spindle\n\nBradTight = Brad-0.05;\nBradFree = Brad+0.05;\n\nFrad = 7; \/\/ radius of beefed-up \"knee\"\n\nLinkRad=3;\nBarHeight=3;\n\/\/NodeHeight=5.8; \/\/ gives a little room for 6.35 mm (.25 inch) standoffs\nlayer1bias=0.4; \/\/ shift up for 1 layer of brim\/raft\n\n\/\/ 9\/16\" spacer height 14.37mm, not 14.287 as expected\n\/\/ 3\/16\" spacer height 4.79mm, not 4.7625 as expected (*3=14.37)\n\/\/ 1\/4\" Al standoffs were pretty close, and 3x was 19.02mm high, not 19.05 as expected, pretty close\n\/\/TrueNodeHeight = (hingeStyle == \"spacer\") ? 4.79-.2 : 6.35;\nTrueNodeHeight = 4.79-.2;\nNodeHeight = TrueNodeHeight - 0.3; \/\/ a little room for hinges\n\/\/NodeHeight3 = 25.4*((hingeStyle == \"spacer\") ? 9\/16 : 3\/4) - 0.3;\n\/\/ moving to slightly thinner 1\/2\" standoffs at H\nNodeHeight3 = 25.4\/2 - 0.3;\n\n\/\/ Forks should be 1 node thick for standoffs... short screws go into variable length standoff.\n\/\/ they should be 2 nodes thick for spacers, extra long so that ALL hinges are 5 nodes wide.\n\/\/ForkHeight = (hingeStyle == \"spacer\") ? 2*NodeHeight : NodeHeight;\nForkHeight = NodeHeight;\n\n\/\/ definitions of linkage lengths: AC;Ay;Bx;BH;EF;CD;CH;BD;BE;DE;FG;FH;GH\n\/\/ derived quantities: DEleft;FGleft;DEperp;FGperp\ninclude ;\n\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\/\/ define some standard part dimensions for re-use in groups, etc.\nacH0 = NodeHeight;\nacH1 = acH0+2;\nacOR = Arad+3;\nacIR = rad4;\npulleyR = 17;\n\/\/++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\nmodule nodeCyl(nodeHeight,nodeRad)\n{ cylinder(h=nodeHeight,r1=nodeRad+.3,r2=nodeRad-.3,$fn=64); } \/\/ set to 20+ for production quality\n\nmodule drillHole(holeRad) { translate([0,0,-.03])\n cylinder(h=22,r=holeRad,$fn=80); } \/\/ set to 80 for production run\n\nmodule footpad(r) { \/\/ pad to help a part stick to plate for 3D printer\n color(\"Cyan\") cylinder(h=layer1bias,r1=r,r2=r-.3,$fn=11); }\n\n\/\/ place a point, usually inside a linkage bar, to use in a hull\n\/\/ with a part connected to a linkage bar\nmodule barAnchor(dx) {\n translate([dx,0,0]) cylinder(h=BarHeight,r1=.8,r2=.6,$fn=6);\n}\n\nuse ;\n\ninclude \ninclude \n\nmodule monoBracedLinkage(len) {\nlro = Drad+1.8; \/\/ outisde link radius\ndifference() { union() { \/\/------------------------ EF\n difference() { hull() { \/\/ main bar\n translate([ 0 ,0,0]) nodeCyl(BarHeight,Frad);\n translate([len,0,0]) nodeCyl(BarHeight,lro*.5);\n }\n hull() { translate([0,0,-1.5]) { nodeCyl(BarHeight,Frad-1.5);\n translate([len,0 ,0]) nodeCyl(BarHeight,1); }}\n }\n\n \/\/ non-braced (BED side) reinforcement \n translate( [len,0,0]) { nodeCyl(BarHeight,lro);\n hull() { translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=lro-.8,r2=rad4+1.2,$fn=64);\n cylinder(h=NodeHeight-1,r1=lro+.1,r2=rad4+1.2,$fn=16);\n \/\/barAnchor(-1.5*lro);\n translate([-2*lro,0,2]) sphere(r=.4,$fn=12);\n }\n }\n hull() { translate([1.3*Frad,0,1.5]) scale([1,1,1]) sphere(r=1,$fn=16);\n translate([0,0,BarHeight-1])\n cylinder(h=ForkHeight-BarHeight+1,r1=Frad-.6,r2=rad4+1.6,$fn=64); }\n cylinder(h=BarHeight-1,r1=rad4+2.2,r2=rad4+3.3,$fn=32);\n\n hull() { \/\/ out-of-plane ridge\/brace\n translate([ 0 ,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16);\n translate([len,0,2.2]) scale([1,1,2]) sphere(r=1,$fn=16); }\n }\n drillHole(rad4);\n translate([len,0,0]) drillHole(rad4);\n}}\n\n\/\/------------------------------------------------------------ crankLink\n\/\/ linkage with thin, wide connection for crank side, full node height on other\nmodule crankLink(len,dFlat,rHole) {\n\/\/ changing crank spindle to a 3\/16 spacer instead of the 1\/8\" brass tube\nradA = AradFree; \/\/ free spinning on 3\/16 OD standoff\necho(str(\"rHole=\",rHole));\ndifference() { union() {\n hull() { cylinder(h=NodeHeight\/2,r1=radA+3,r2=radA+2.8,$fn=48);\n translate([dFlat+4,0,0]) cylinder(h=NodeHeight\/2,r1=1.2,r2=1,$fn=6); }\n translate([len,0,0]) { hull() {\n cylinder(h=NodeHeight,r1=rHole+2.2,r2=rHole+2,$fn=48);\n translate([-rHole-4,0,0]) cylinder(h=BarHeight,r1=1.2,r2=1,$fn=6); }}\n hull() { cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6);\n translate([len\/2,0,0]) cylinder(h=NodeHeight\/2,r1=LinkRad+.4,r2=LinkRad,$fn=6); }\n hull() { translate([dFlat-2,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6);\n translate([len-2 ,0,0]) cylinder(h=BarHeight,r1=LinkRad+.4,r2=LinkRad-.2,$fn=6); }\n hull() {\n translate([dFlat+2 ,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len-rHole,0,BarHeight-1]) scale([1,1,1.5]) sphere(r=1,$fn=12);\n translate([len*0.65 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n translate([dFlat+15 ,0,BarHeight+.5]){scale([0.6,0.6,1.7]) sphere(r=1,$fn=12);\n translate([0,0,-2]) scale([2,2,1]) sphere(r=1,$fn=12);}\n }\n }\n drillHole(radA); \/\/ a little extra to move freely\n translate([len,0,0]) drillHole(rHole);\n}}\n\nmodule linkage1(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\n hull() { barAnchor(1.5*r0);\n cylinder(h=h0,r1=r0+.2,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-1.5*r1);\n cylinder(h=h1,r1=r1,r2=0.4*r1+0.6*d1,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\nmodule linkage(len,h0,r0,d0,h1,r1,d1) { difference() { union() {\necho(str(\"linkage:\",len,\",\",h0,\",\",r0,\",\",d0,\",\",h1,\",\",r1,\",\",d1));\n hull() { barAnchor(2.5*r0);\n cylinder(h=h0,r1=r0+.1,r2=r0-0.2,$fn=48); }\n translate([len,0,0]) { hull() { barAnchor(-2.5*r1);\n cylinder(h=h1,r1=r1+.1,r2=r1-.2,$fn=48); }}\n hull() { cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6);\n translate([len,0,0]) cylinder(h=BarHeight,r1=LinkRad+.2,r2=LinkRad-.2,$fn=6); }\n hull() { cylinder(h=h0-0.5,r1=2,r2=.6,$fn=6);\n translate([len-d1,0,0]) cylinder(h=h1-0.5,r1=2,r2=.6,$fn=6); }\n }\n drillHole(d0);\n translate([len,0,0]) drillHole(d1);\n}}\n\n\/\/ beefier version of a simple linkage, with same ends on both sides\nmodule brace(len,h0,r0) {\nr1=r0+1.7;\ndifference() { union() {\n difference() { hull() { cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48);\n translate([len,0,0]) cylinder(h=3,r1=r1+.1,r2=r1-.1,$fn=48); }\n translate([1.5,0,-1.5]) hull() { cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6);\n translate([len-1.5,0,0]) cylinder(h=3,r1=r1-1.6,r2=r1-1.4,$fn=6); }}\n\n translate([len,0,0])\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([-r1-4,0,2]) sphere(r=1,$fn=12); }\n hull() { cylinder(h=h0,r1=r1+.2,r2=r1-.1,$fn=48);\n translate([ r1+4,0,2]) sphere(r=1,$fn=12); }\n\n translate([0,0,h0\/2]) hull() { scale([1,1,h0\/2]) sphere(r=1,$fn=12);\n translate([len,0,0]) scale([1,1,h0\/2]) sphere(r=1,$fn=12); }\n \n }\n drillHole(r0);\n translate([len,0,0]) drillHole(r0);\n}}\n\n\nmodule crankArm(len,h0,r0,d0,h1,r1,d1) { difference() {\n linkage(len,h0,r0,d0,h1,r1,d1);\n\n \/\/\/\/ add little hole for \"cotter-wire\" on crank arm\n \/\/translate([0,0,h0\/2]) rotate(a=[90,0,0])\n \/\/ cylinder(h=3*r0,r=.8,$fn=80,center=true);\n\n \/\/ for change to using standoffs as axle, counter sink axle screw\n translate([0,0,h0-1.5]) cylinder(h=2+.2,r1=rad4,r2=3.3,$fn=24);\n\n \/\/ try another countersink for spindle screw.\n translate([len,0,-1]) cylinder(h=2.2,r1=3.3,r2=rad4,$fn=24);\n}}\n\ninclude ;\n\n\/\/============================================ Parts with brim\/pads underneath\n\nmodule BED_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(11);\n translate([base-left,0,0]) footpad(11);\n translate([0,perp,0]) footpad(13);}\n translate([0,0,.2]) imBED(left,base,perp);\n}}\nmodule bracedFoot_pad(left,base,perp) { union() { color(\"Cyan\") hull() {\n translate([-left,0,0]) footpad(17);\n translate([0,perp,0]) footpad(11);\n translate([base-left,0,0]) footpad(13); }\n translate([0,0,.2]) bracedFoot(left,base,perp);\n}}\nmodule crankLink_pad(len,dFlat,rHole) { union() { color(\"Cyan\") hull() {\n footpad(13);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) crankLink(len,dFlat,rHole);\n}}\nmodule monoBracedLinkage_pad(len) { union() { color(\"Cyan\") hull() {\n footpad(15);\n translate([len,0,0]) footpad(13); }\n translate([0,0,.2]) monoBracedLinkage(len);\n}}\nmodule linkage_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule brace_pad(len,h0,r0) { union() { color(\"Cyan\") hull() { translate([len,0,0])\n footpad(r0+7);\n footpad(r0+7); }\n translate([0,0,.2]) brace(len,h0,r0);\n}}\nmodule linkage1_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) linkage1(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule crankArm_pad(len,h0,r0,d0,h1,r1,d1) { union() { color(\"Cyan\") hull() {\n footpad(11);\n translate([len,0,0]) footpad(11); }\n translate([0,0,.2]) crankArm(len,h0,r0,d0,h1,r1,d1);\n}}\nmodule mainBar_pad(x,y) { union() { color(\"Cyan\") hull() {\n translate([-x,0,0]) footpad(12);\n translate([ x,0,0]) footpad(12);\n }\n translate([0,0,.2]) mainBar(x,y);\n}}\n\n\/\/---------------------\nmodule BED(dLeft,dBase,dPerp) { union() { rotate([0,0,50]) {\n translate([dBase*0.2,-3*Drad,0]) rotate([0,0,180]) mirror([1,0,0])\n BED_pad(dLeft,dBase,dPerp);\n BED_pad(dLeft,dBase,dPerp);\n}}}\nmodule feet(dLeft,dBase,dPerp) { union() { \n translate([dBase*0.15,-0.5*dPerp,0]) rotate([0,0,190]) mirror([1,0,0])\n bracedFoot_pad(dLeft,dBase,dPerp);\n bracedFoot_pad(dLeft,dBase,dPerp);\n}}\nmodule crankLinks() {\nspc=6;\nunion() {\n translate([0,spc*3.2,0]) \n crankLink_pad(CH,15,Hrad);\n crankLink_pad(CH,15,Hrad);\n rotate([0,0,180]) { \n translate([-CD-1.5*spc, spc*1.6,0]) crankLink_pad(CD,15,Drad);\n translate([-CD-1.5*spc,-spc*1.6,0]) crankLink_pad(CD,15,Drad); }\n\n \/\/ tight holes to glue to axle, not spin\n translate([5*spc,-3.2*spc,0])\n crankArm_pad(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n}}\nmodule EFs(len) {\nspc=6;\nunion() {\n translate([len-spc, 1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([len-spc,-1.9*spc,0]) rotate([0,0,180]) monoBracedLinkage_pad(len);\n translate([0,-3.8*spc,0]) monoBracedLinkage_pad(len);\n monoBracedLinkage_pad(len);\n}}\nmodule BHs(len,h0,r0,d0,h1,r1,d1) {\nspc = 2*Brad;\nunion() {\n translate([spc*1.1, 1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([spc*1.1,-1.6*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n translate([ 0 ,-3.2*spc,0]) linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n linkage1_pad(len,h0,r0,d0,h1,r1,d1);\n}}\n\n\/\/=====================================================\nuse ;\n\nif (PART==\"BED\" ) { BED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDa\" ) { imBED(DEleft,DE,DEperp); }\n\/\/else if (PART==\"BEDb\" ) { mirror([1,0,0]) imBED(DEleft,DE,DEperp); }\nelse if (PART==\"HipA\" ) { BED1(DEleft,DE,DEperp); }\nelse if (PART==\"HipB\" ) { mirror([1,0,0]) BED1(DEleft,DE,DEperp); }\nelse if (PART==\"jHipA\" ) { imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"jHipB\" ) { mirror([1,0,0]) imBEDj(DEleft,DE,DEperp); }\nelse if (PART==\"Feet\" ) feet(FGleft,FG,FGperp);\nelse if (PART==\"FootA\") \n\/\/difference() {\n bracedFoot(FGleft,FG,FGperp);\n \/\/ translate([0,0,18]) cube([200,200,20],center=true); }\nelse if (PART==\"FootB\") { mirror([1,0,0]) bracedFoot(FGleft,FG,FGperp); }\nelse if (PART==\"crankLinks\") crankLinks();\nelse if (PART==\"CH\" ) crankLink(CH,15,Hrad); \/\/ build 2\nelse if (PART==\"CD\" ) crankLink(CD,15,Drad); \/\/ build 2\nelse if (PART==\"EF\" ) monoBracedLinkage(EF); \/\/ build 4\nelse if (PART==\"EFs\" ) EFs(EF);\nelse if (PART==\"BHs\" ) BHs(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\nelse if (PART==\"BH\" ) linkage1(BH,2.5*NodeHeight+1.5,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4); \/\/ build 4, glue them together with a rectangle if desired\nelse if (PART==\"AC\" ) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \nelse if (PART==\"halfPulley\") { union() { color(\"Cyan\") footpad(pulleyR+7);\n translate([0,0,.2]) halfPulley(pulleyR,2.5,AradTight,-1); }}\nelse if (PART==\"halfDrivePulley\") { union() { color(\"Cyan\") footpad(15);\n translate([0,0,.1]) halfPulley(8,2.5,1.5+.3,1+.3); }}\nelse if (PART==\"pulley_pad\") { union() { footpad(23); translate([0,0,.2])\n pulley(18,5,rad4,0); }}\nelse if (PART==\"pulley\") { pulley(18,5,rad4,0); }\nelse if (PART==\"drivePulley_pad\") { union() { footpad(15); translate([0,0,.2])\n pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }}\nelse if (PART==\"drivePulley\") { pulley(10,4,1.5+dHoleFuzz,1+dHoleFuzz); }\nelse if (PART==\"mainBar\") { mainBar(Bx,Ay); }\nelse if (PART==\"main\") { mainBar_pad(Bx,Ay); }\nelse if (PART==\"braceBar\") { brace(2*Bx,8,Brad); }\nelse if (PART==\"brace\") { brace_pad(2*Bx,8,Brad); }\nelse if (PART==\"spacers\") { union(){ spacers(NodeHeight\/2,Bhole+3,Brad);\n translate([0,-7.5*LinkRad*1.414+1,0]) spacers(NodeHeight\/2,LinkRad,rad4); }}\n\/\/else if (PART==\"demo\") { \/\/show all unique parts\nelse {\n mainBar(Bx,Ay);\n #translate([0,Ay,20]) pulley(18,5,rad4,0);\n translate([0,-50,0]) pulley(10,4,1.5+.3,1+.3);\n translate([ 50, 30,0]) BED1(DEleft,DE,DEperp);\/\/imBED(DEleft,DE,DEperp);\n translate([-26, 44,0]) rotate([0,0,180]) bracedFoot(FGleft,FG,FGperp);\n translate([-12,-16,0]) crankLink(CD,15,Drad);\n translate([-36,-28,0]) crankLink(CH,15,Hrad);\n translate([-73,-15,0]) monoBracedLinkage(EF);\n translate([-60, 15,0]) crankArm(AC,acH0,acOR,acIR,acH1,acOR,acIR); \n\n translate([ 25, 15,0]) linkage1(BH,2.5*NodeHeight,Brad+1.8,BradFree,ForkHeight,Hrad+2,rad4);\n translate([40,-42,0]) rotate([0,0,50]) brace(2*Bx,8,Brad);\n}\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"c4b5aba9dee003e9536cbf0055d54d7173ea2c7a","subject":"AA-batteries dispenser","message":"AA-batteries dispenser\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"battery_dispenser\/dispenser_aa.scad","new_file":"battery_dispenser\/dispenser_aa.scad","new_contents":"use \n\nsurround = 15;\nheight = 150;\nwall = 2;\nbatteryDiameter = 20;\nbatteryLength = 56;\n\nmodule channel(h)\n{\n \/\/ side\n cube([2*wall+batteryDiameter, h, wall]);\n \/\/ back wall\n cube([wall, h, batteryLength\/2]);\n \/\/ front holding\n translate([wall+batteryDiameter, 0, 0])\n cube([wall, h, surround]);\n}\n\nmodule wing()\n{\n difference()\n {\n \/\/ main channel part\n union()\n {\n channel(height);\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n channel(2*batteryDiameter);\n }\n \/\/ removal of unnecessary elements\n translate([wall, 0, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n rotate([0,0,60])\n translate([wall, -2*batteryDiameter, wall])\n cube([batteryDiameter, 2*batteryDiameter, surround]);\n \/\/ removal of part from which battery will be extracted\n rotate([0,0,60])\n translate([3*wall, -2*batteryDiameter+wall, wall])\n cube([batteryDiameter, batteryDiameter, surround]);\n }\n rotate([0,0,60])\n translate([0, -2*batteryDiameter, 0])\n cube([2*wall+batteryDiameter, wall, surround]);\n}\n\n\nfor(m = [0,1])\n{\n mirror([m,0,0])\n {\n translate([5,0,0])\n wing();\n %translate([35, -3, wall+1])\n batteryAA();\n }\n}\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'battery_dispenser\/dispenser_aa.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1762b4803f1da79052b2a1bb24ddc839d9076e1e","subject":"Added header to lashes scad.","message":"Added header to lashes scad.\n","repos":"ianlee74\/LumineaterBot","old_file":"3dPrinted\/Lumineater_lashes.scad","new_file":"3dPrinted\/Lumineater_lashes.scad","new_contents":"\/\/ Lumineater Bot Lashes\n\/\/\n\/\/ Author: Ian Lee\n\/\/ GitHub Page: http:\/\/ianlee74.github.io\/LumineaterBot\/\n\n\nldr_dia = 5.4;\nldr_thickness = 2.8;\nwall_thickness = 1.5;\ntolerance = 0.1;\n\nmodule ldr()\n{\n\tunion()\n\t{\n\t\t\/\/ main body\n\t\tcylinder(h=ldr_thickness, r=ldr_dia\/2 + tolerance, $fn=50);\n\t\t\/\/ wires\n\t\ttranslate([1.9,0,0]) cylinder(h=5, r=0.75, $fn=20);\n\t\ttranslate([-1.9,0,0]) cylinder(h=5, r=0.75, $fn=20);\n\t}\n}\n\nmodule eyelash()\n{\n\tr = (ldr_dia + (wall_thickness + tolerance)*2)\/2;\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\t\/\/ Main sphere\n\t\t\tsphere(r, center=true, $fn=50);\n\n\t\t\t\/\/ lashes\t\t\n\t\t\tfor(x=[120:30:240])\n\t\t\t{\n\t\t\t\trotate([0,0,x])\n\t\t\t\t\tcube([1, 12, 1]);\n\t\t\t}\n\t\t}\n\n\t\t\/\/ cut it in half\n\t\ttranslate([0, 0, -r\/2-0.5]) cube([r*2 + 1, r*2 + 1, r + 1], center=true);\n\n\t\t\/\/ cut out the LDR.\n\t\ttranslate([0,0,-0.1]) ldr();\n\t}\n}\n\n\/\/ldr();\neyelash();","old_contents":"ldr_dia = 5.4;\nldr_thickness = 2.8;\nwall_thickness = 1.5;\ntolerance = 0.1;\n\nmodule ldr()\n{\n\tunion()\n\t{\n\t\t\/\/ main body\n\t\tcylinder(h=ldr_thickness, r=ldr_dia\/2 + tolerance, $fn=50);\n\t\t\/\/ wires\n\t\ttranslate([1.9,0,0]) cylinder(h=5, r=0.75, $fn=20);\n\t\ttranslate([-1.9,0,0]) cylinder(h=5, r=0.75, $fn=20);\n\t}\n}\n\nmodule eyelash()\n{\n\tr = (ldr_dia + (wall_thickness + tolerance)*2)\/2;\n\tdifference()\n\t{\n\t\tunion()\n\t\t{\n\t\t\t\/\/ Main sphere\n\t\t\tsphere(r, center=true, $fn=50);\n\n\t\t\t\/\/ lashes\t\t\n\t\t\tfor(x=[120:30:240])\n\t\t\t{\n\t\t\t\trotate([0,0,x])\n\t\t\t\t\tcube([1, 12, 1]);\n\t\t\t}\n\t\t}\n\n\t\t\/\/ cut it in half\n\t\ttranslate([0, 0, -r\/2-0.5]) cube([r*2 + 1, r*2 + 1, r + 1], center=true);\n\n\t\t\/\/ cut out the LDR.\n\t\ttranslate([0,0,-0.1]) ldr();\n\t}\n}\n\n\/\/ldr();\neyelash();","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"fe460fa6bfd4f6a30c8ba782577a174da1178197","subject":"Change fan spacer2 so that people stop assembling it backwards.","message":"Change fan spacer2 so that people stop assembling it backwards.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-fan-spacer\/spacer2.scad","new_file":"wanhao-i3-fan-spacer\/spacer2.scad","new_contents":"\/* This is a bit of a hack since angled holes are required. *\/\ngSpacerThick = 9;\ngSpacerPlusHeatsinkThick = 11;\ngFanThick = 10; \/\/ hole right in the middle?\ngMotorHoleSpacing = 31;\ngFanHoleSpacing = 32;\ngGrillThick = 3;\ngBottomFilletRad = 5;\n\n\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=gSpacerThick) {\n linear_extrude(height=thick)\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) circle(r=r);\n}\n\nmodule SpacerHole(thick=gSpacerThick) {\n \/\/ TODO\n \/\/translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\n\/* For reuse building the two parts to line up *\/\nmodule LowerHull(w,r,thick,d=0) {\n linear_extrude(height=thick) hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) circle(r=r);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) circle(r=r);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n translate([0,0,-1]) linear_extrude(height=thick+2)\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y]) circle(r=r);\n }\n \/\/ this is rotated, and mostly for looks but also assembly affordance\n translate([-50,-8+gBottomFilletRad-0.01,thick-gBottomFilletRad+0.01]) rotate([180,-90,0])\n linear_extrude(height=100,convexity=2) difference() {\n square([gBottomFilletRad,gBottomFilletRad]);\n circle(r=gBottomFilletRad);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.7,h=100);\n }\n translate([0,-4.5,-1]) linear_extrude(height=2.5) offset(delta=0.1) AlignmentShape();\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=gGrillThick) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\nmodule AlignmentShape() {\n hull() for(x=[6,-6]) translate([x,0])\n circle(d=2,$fn=32);\n}\n\ngOffset = 0.5;\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01])\n ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n translate([0,gOffset,0]) FanGrill(r=16,height=thick-1);\n \/\/ TOOD angle this\n \/*for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n *\/\n }\n \/\/ Top part\n difference() {\n union() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n translate([0,-20-4.5,1]) linear_extrude(height=thick+11) AlignmentShape();\n }\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\n\/\/translate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\ntranslate([0,-40,0]) translate([0,20,-12])\ndifference() {\n union() {\n translate([0,-20,12]) SpacerPair();\n \/\/FanMount($fn=64);\n }\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\ndifference() {\n FanMount($fn=64);\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","old_contents":"\/* This is a bit of a hack since angled holes are required. *\/\ngSpacerThick = 9;\ngSpacerPlusHeatsinkThick = 11;\ngFanThick = 10; \/\/ hole right in the middle?\ngMotorHoleSpacing = 31;\ngFanHoleSpacing = 32;\ngGrillThick = 3;\n\n\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=gSpacerThick) {\n linear_extrude(height=thick)\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) circle(r=r);\n}\n\nmodule SpacerHole(thick=gSpacerThick) {\n \/\/ TODO\n \/\/translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\n\/* For reuse building the two parts to line up *\/\nmodule LowerHull(w,r,thick,d=0) {\n linear_extrude(height=thick) hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) circle(r=r);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) circle(r=r);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n translate([0,0,-1]) linear_extrude(height=thick+2)\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y]) circle(r=r);\n }\n \/\/ this is rotated, so can't linear_extrude easily\n hull() {\n for(y=[-r-1,-10])\n translate([0,y,thick])\n rotate([0,90,0]) cylinder(r=2,h=100,center=true);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.7,h=100);\n }\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=gGrillThick) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\ngOffset = 0.5;\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01])\n ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n translate([0,gOffset,0]) FanGrill(r=16,height=thick-1);\n \/\/ TOOD angle this\n \/*for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n *\/\n }\n \/\/ Top part\n difference() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\n\/\/translate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\ntranslate([0,-40,0]) translate([0,20,-12])\ndifference() {\n union() {\n translate([0,-20,12]) SpacerPair();\n \/\/FanMount($fn=64);\n }\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\ndifference() {\n FanMount($fn=64);\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"90b6386698e63d4737e87d358aa2dc2bc9e81c69","subject":"result","message":"result\n","repos":"JoeSuber\/QuickerPicker","old_file":"innerds.scad","new_file":"innerds.scad","new_contents":"\/\/ collection of parts for the new picker idea\n\nairflow = 57;\nsleeveout = airflow+1;\n\n\/\/ [fullOD, shaftD, thickness, turning_hubD]\nhubbearing = [22,8,7,13];\ntravelbearing = [6,3,2.5,5];\ntravelwheel = 60;\ntravelpeg = travelwheel - travelbearing[1];\n\nfat = 0.3; \/\/ add-on to make walls cut out enough space\nhb = 12.7 + fat; \/\/ height of bar cross-section\nwthk = 1.5 + fat; \/\/ thickness of walls\nflrthk = 1.6 + fat; \/\/ thickness of floor (that walls extend from)\ninside = 6.9 - fat; \/\/ between walls, across floor (subtracting 2*.5*fat)\nc_bar = [[0,0], [0,hb], [wthk, hb], [wthk, flrthk], [wthk+inside, flrthk], [wthk+inside, hb], [wthk+inside+wthk, hb], [wthk+inside+wthk, 0]];\n\n\/\/#shaft(travelbearing);\n\/\/#cbar(barH=100);\n\/\/#can_sleeve();\n\/\/translate([50,50,0])\n\/\/ for (i=[0:3:360]){\n\/\/ nutbolt(nut_position=20*i\/360, channel_ang=i);\n\/\/ }\n\/\/bigwheel_part();\n\/\/ bartest();\n\n\/\/ ** the can traveler by itself ***\n\/\/rotate([0,0,180]) translate([0, -56, +25.9])\n \/\/upndown(); \n\n\/\/motorcut();\n\/\/cbar();\n\nrackpush();\n\n\/\/ ** the main picker body ** \n\/\/cbracket();\n\n\/\/ ** the valve parts **\n\/\/louvers();\n\n\/\/plate_air_parts();\n \n\n\/\/ for cutting out shaft and hub-turning space\nmodule shaft(bearing, xtraH=0, hubclearance=0.5){\n height=bearing[2] + xtraH;\n translate([0,0,-height\/2-hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n translate([0,0,0])\n cylinder(r=bearing[1]\/2, h=height, center=true, $fn=24);\n translate([0,0,height\/2+hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n echo(\"shaft of bearing = \", bearing, \"is top-to-bottom = \", hubclearance*2 + height);\n} \n\n\/\/ alluminum c-channel, positive or negative\nmodule cbar(outline=c_bar, barH=50){\n midbar = outline[7][0] \/ 2;\n echo(\"midbar read as: \",midbar);\n translate([-midbar,0,0])\n linear_extrude(center=true, height=barH, convexity=10, slices=2)\n polygon(points=outline);\n}\n\n\/\/ intended as positive model, could add scale or thickness\nmodule can_sleeve (emptyness=airflow, thickness=sleeveout-airflow-0.2, sleeveH=25){\n translate([0,0,-sleeveH\/2])\n rotate_extrude($fn=196)\n translate([(emptyness+thickness) \/ 2, 0, 0])\n polygon(points=[[0,0], [0,sleeveH], [thickness,sleeveH], [thickness,0]]);\n}\n\n\/\/ negative model with channel for captured nut insertion\nmodule nutbolt(hexhead=6.65, \n shaftD=3.1, \n shaftlen=20, \n nut_position=17,\n nut_thick=2.33, \n channel_len=30, \n channel_ang=0,){\n color( .5, .9, .9 )\n translate([0,0,-shaftlen\/2]){ \/\/center it by shaftlen\n \/\/shaft\n cylinder(r=shaftD\/2, h=shaftlen, center=false, $fn=18);\n \/\/head\n #translate([0,0,shaftlen-hexhead\/2])\n cylinder(r=hexhead\/2, h=hexhead\/2, center=false, $fn=6);\n \/\/nut + channel\n translate([0,0,shaftlen-nut_position])\n hull(){\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.1, h=nut_thick+.1, center=false, $fn=6);\n translate([cos(channel_ang)*channel_len, \n sin(channel_ang)*channel_len, 0])\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.2, h=nut_thick+.1, center=false, $fn=6);\n }\n }\n}\n\nmodule motorhub(flat_to_flat=4.76, diameter=7.4, height=5.57, baseD=9, baseH=1.0){\n cutrad = (diameter - flat_to_flat)\/2;\n cutcenter = flat_to_flat\/2 + cutrad;\n cylinder(r=baseD\/2, h=baseH+0.1, center=false, $fn=36);\n cylinder(r=0.8, h=baseH+5*height+.1, center=true, $fn=6);\n translate([0,0,baseH])\n difference(){\n cylinder(r=diameter\/2, h=height+baseH, center=false, $fn=24);\n for (i=[cutcenter+0.05, -cutcenter-0.05]){\n translate([0,i,(height+baseH)\/2])\n cube([diameter+0.1, cutrad+0.1, height+.1], center=true);\n }\n\n }\n}\n \nmodule bigwheel_part(od=travelwheel, thk=4, hub=12, hubthk=4, holes=6, lever=5){\n overall_thk = thk+hubthk;\n echo(\"overall bigwheel thickness is : \", overall_thk);\n difference(){\n union(){\n cylinder(r=od\/2, h=thk, $fn=196);\n translate([0,0,4])\n cylinder(r=hub\/2, h=hubthk, $fn=64);\n }\n translate([0,0,overall_thk+0.05]) rotate([180,0,0])\n motorhub();\n for (i=[0 : 360\/holes : 360-(360\/holes)*.5]){\n translate([od\/3.14*cos(i), od\/3.14*sin(i), hubthk\/2])\n cylinder(r=od*.5\/(holes-1), h=hubthk+.1, center=true, $fn=42);\n }\n translate([0,od\/2-lever,-9]) rotate([0,0,0])\n nutbolt();\n translate([0,-od\/2+lever,-9]) rotate([0,0,0])\n nutbolt();\n }\n}\n\nmodule ring(ID, OD, ht){\n difference(){\n cylinder(r=OD\/2, h=ht, center=true, $fn=96);\n cylinder(r=ID\/2, h=ht+.1, center=true, $fn=96);\n }\n}\n\n\/\/ for LMB8MM\nmodule bearingcut(D=15.1\/2, dring=14.41\/2, drod=8.9\/2, dziptie=[19,3.3],){\n rotate_extrude(center=true, convexity=10, $fn=36){\n polygon(points=[[0,-2], [D,0], \n [D,3.3], [dring,3.3], \n [dring,4.55], [D,4.55], \n [D,19.35], [dring,19.35], \n [dring,20.8], [D,20.8], \n [D, 24.01], [0,26.01]]);\n }\n \/\/ zip tie rings\n for (i=[(3.3+4.55)\/2, (19.35+20.8)\/2]){\n translate([0,0,i])\n ring(dziptie[0], dziptie[0]+dziptie[1], 5);\n }\n \/\/ rod upon which it travels\n translate([0,0,12])\n cylinder(r=drod, h=90, $fn=18, center=true);\n}\n\nmodule bigwheel_cutout(od=travelwheel+3, thk=10){\n cylinder(r=od\/2, h=thk, $fn=128);\n}\n\nmodule bartest(ht=10){\n difference(){\n minkowski(){\n cube([20,20,10], center=true);\n cylinder(r=4, h=.1, center=true, $fn=24);\n }\n translate([-7,-9,0])\n #cbar(barH=30);\n translate([17,0,0]) rotate([0,0,90])\n #cbar(barH=30);\n translate([0,10.5,0]) rotate([90,0,0])\n #shaft(hubbearing);\n }\n}\n\nmodule upndown(ht=travelwheel){\n difference(){\n cube([travelwheel, travelwheel\/2, ht], center=true);\n \/\/ lift rail\n translate([0, travelwheel\/2-hb, 0])\n cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+.5 ,3.25, 0]) rotate([0,0,-0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n translate([travelwheel\/2-.5 ,3.25, 0]) rotate([0,0,0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n\n \/\/ cylinder space\n translate([0, -travelwheel\/2, 0])\n cylinder(r = (sleeveout+.5)\/2, h=ht+.1, $fn=196, center=true);\n \/\/ nuts\n translate([0,0,ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=90);\n translate([0,0,-ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=-90);\n }\n \/\/ underside printing supports for lift rail\n for (i=[0:5:travelwheel-1]){\n translate([i - travelwheel\/2+2.5, travelwheel\/2-hb*1.333, 0])\n cube([.5, hb*.37, c_bar[6][0]+.1], center=true);\n }\n}\n\nmodule upndown_cutout(ht=travelwheel){\n translate([0,-4.5,0])\n cube([travelwheel+1, travelwheel\/2+9.5, ht+2], center=true);\n \/\/ lift rail\n \/\/translate([0, travelwheel\/2+hb, 0])\n \/\/ cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+hb\/2+.2,-5, 0]) rotate([0,0,90])\n cbar(barH=70);\n translate([travelwheel\/2-hb\/2-.2,-5, 0]) rotate([0,0,-90])\n cbar(barH=70);\n \/\/ cylinder of suckage\n translate([0, -travelwheel\/2 -9.5, 0])\n cylinder(r = (sleeveout+2)\/2, h=ht+2, $fn=196, center=true);\n\n}\n\nmodule motorcut(x=23,y=22,z=37,tab=[6,4,5],tabpos=7,curverad=5, shaftpos=[0,11,16], canheight=28){\n tiptop = canheight + z + tab[2] - curverad;\n \/\/ top-motorhousing\n translate([0,y\/2, tiptop - canheight])\n cylinder(r=x\/2, h=canheight, center=false, $fn=36);\n \/\/ gearbox housing\n translate([-(x-curverad*2)\/2, 0, curverad+tab[2]])\n minkowski(){\n cube([x-curverad*2,y,z-curverad*2], center=false);\n rotate([90,0,0])\n cylinder(r=curverad, h=.1, center=false, $fn=64);\n }\n \/\/ tab thingy for motor attachment\n translate([0,tabpos+tab[1]\/2, tab[2]\/2]){\n cube(tab, center=true);\n \/\/ cuts hole for bolting tab\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ driven hub stub and slide-in track\n translate(shaftpos)\n rotate([90,0,0])\n hull(){\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n }\n \/\/ cuts shaft for holes that penetrate housing\n for (i=[1,-1]){\n translate([17.75\/2 * i, 0, 36])\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ add on the driven wheel\n translate(shaftpos)\n rotate([90, 0,0]) translate([0,0,-y]){\n bigwheel_cutout();\n \/\/ and its connection hub\n translate([0,0,+3])\n hull(){\n cylinder(r=8, h=15, $fn=16, center=false);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=8, h=15, $fn=16, center=false);\n }\n }\n \/\/ make a cut-out for the traveling part\n rotate([0,0,180]) translate(shaftpos) translate([0,-59,0])\n upndown_cutout();\n}\n\n\n\/\/ carve the big thing out of a block \nmodule cbracket(z=travelwheel\/2, bs=1.5){\n difference(){\n translate([-travelwheel\/2, 0, -4])\n minkowski(){\n cube([travelwheel, travelwheel*1.2, travelwheel-17], center=false);\n cylinder(r=8, h=1, $fn=16);\n }\n motorcut();\n translate([-travelwheel\/2-bs, -bs, 4]) \n bearingcut();\n translate([travelwheel\/2+bs,-bs, 4])\n bearingcut();\n translate([z+2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=45);\n translate([-z-2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=135);\n translate([-z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=180);\n translate([z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=0);\n }\n}\n\/\/\/\/-----------------------------\/\/\/\/\n\/\/\/\/ *** air valve section **** \/\/\/\/\n\/\/\/\/ ____________________________\/\/\/\/\n\nflapquant=4;\nopeningside=airflow\/flapquant;\nflapthick = 5;\nbuttonht = 4;\ngap = 1.8; \/\/ between walls\n\nflap = [[0,0], [flapthick,openingside], [flapthick,0], [0,-openingside]];\n\nmodule pie(arc=90, center=90, rad=11, height=3){\n rotate([0,0,center-arc\/2])\n difference(){\n children();\n translate([0,-rad, 0])\n cube([rad*2,rad*2,rad*2], center=true);\n rotate([0,0,arc])\n translate([0,rad, 0])\n cube([rad*2,rad*2,rad*2], center=true);\n }\n}\n\nmodule degreed(sect=90, mks=60, size=15){\n for (i=[0:sect\/mks:sect-1]){\n translate([cos(i)*size, sin(i)*size, 3])\n color([.9, i\/sect*2+.5,0,1])\n cylinder(r=sect\/mks\/4, h=6, $fn=12, center=true);\n }\n}\n\nmodule one_love(scaler=1){\n \/\/ one flap with key holes \n difference(){\n translate([-flapthick\/2, 0, 0])\n linear_extrude(height=airflow){\n polygon(points=flap);\n }\n translate([0,0, airflow\/2]) rotate([0,0,-10.1])\n scale([scaler,scaler,1]){\n cube([flapthick\/2.8, openingside\/1.5, airflow+.1], center=true);\n cylinder(r=1.65, h=airflow+.1, $fn=16, center=true);\n }\n }\n}\n\nmodule carabas(wheelrad=openingside\/2, leverscale=1){\n \/\/ its the place for louvers\n wheel = max(wheelrad, 3);\n translate([0,0,-gap\/2- buttonht\/2])\n cylinder(r=wheel+.1, h= gap\/2, $fn=24, center=false);\n difference(){\n cylinder(r1=wheel, r2=wheel-3, h=buttonht, $fn=196, center=true);\n scale([1.07,1.07,1]) \n one_love(scaler=0.85);\n cylinder(r=1.7, h=4.1, $fn=16, center=true);\n }\n translate([-wheel+(openingside\/2+1.5)\/4, 0, -buttonht\/2 - gap\/2])\n lever(lvrad= openingside\/2 +1.5, lvthk=gap\/2, lvscale=leverscale);\n}\n\nmodule lever(lvrad=openingside\/2 + 1.5, lvthk=gap\/2, lvscale=1){\n difference(){\n union(){\n hull(){\n cylinder(r=(lvrad + 1.5)\/4, h=lvthk, center=false, $fn=16);\n translate([0,9\/lvscale,0])\n cylinder(r=(lvrad + 1.5)\/4, h=lvthk, center=false, $fn=16);\n }\n translate([0,9\/lvscale,0])\n cylinder(r=2, h=lvthk*2 + 0.25, center=false, $fn=16);\n }\n if (lvscale < 1.001){\n translate([0,9\/lvscale,-0.05])\n cylinder(r=1.65, h=lvthk*2 + 0.25 + 0.1, center=false, $fn=6);\n }\n }\n}\n\nmodule louvers(){\n \/\/ the flaps- working well standing up\n for (i=[0:flapquant-2]){\n translate([i*openingside, 0, 0]) rotate([0,0,75])\n one_love(); \n translate([i*(openingside+.5)+5,-openingside*2.8 ,buttonht\/2+gap\/2]){\n carabas();\n \/\/translate([0, 0, -buttonht\/2 - gap\/2])\n \/\/ lever();\n mirror([0,1,0]) \/\/{\n translate([-openingside*0.4, -openingside*1.8, 0]) \n carabas();\n \/\/ translate([0, openingside*1.2, - buttonht\/2- gap\/2])\n \/\/ lever();}\n } \n } \n \/\/translate([airflow\/2-openingside,openingside,airflow\/2]) rotate([90,0,0])\n \/\/ #circle(r=30, $fn=128, center=true);\n}\n\nmodule side_plate(sidethick=2, insider=1, scalecut=1.07){\n \/\/ laying on its... side \n difference(){\n translate([airflow - openingside*(flapquant-1), 0, buttonht\/4])\n union(){\n cube([airflow, openingside*2 + 1, buttonht\/2], center=true);\n for (i=[1,-1]){\n translate([i * (airflow\/2+sidethick\/2), 0,0]) rotate([0,-i*90,0])\n notcher();\n }\n }\n \n if (insider==1){\n echo(\"flapquant =\",flapquant); \n for (i=[0:flapquant-2]){ \n echo(\"i*openingside = \",i*openingside); \n translate([i*openingside*1.06, 0, buttonht\/2+0.05]){ \n scale([scalecut,scalecut,scalecut])\n rotate([0,0,-81])\n carabas(leverscale=scalecut);\n translate([0,0,-buttonht\/2])\n pie(arc=109, center=95, rad=13.6, height=4){\n rotate_extrude(convexity=10, $fn=36){\n translate([11\/scalecut, 0, 0])\n square([4.2,2.5], center=true);\n }\n }\n }\n }\n }\n }\n}\n\nmodule notcher(cd=2.2, cz=6, clong=1){\n difference(){\n cube([cd, openingside*2, cz], center=true);\n translate([0,0,-clong\/2-0.05])\n cube([cd+0.05, openingside*2-((cz-clong)*2), cz-clong], center=true);\n }\n}\n \nmodule end_plate(sidethick=2.2, ridge=1, cc=buttonht\/2+0.2){\n xlen = airflow+sidethick*4+gap*4+ridge*2;\n translate([0,0,(sidethick+ridge)\/2])\n difference(){\n cube([xlen, openingside*2 + 1, sidethick+ridge], center=true);\n translate([0,openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n translate([0,-openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n for (i=[1,-1], j=[cc, cc*3.5]){\n translate([i*(xlen\/2-j),0, 0])\n scale([1.05,1.05,1.05])\n notcher(cd=cc, cz=6.75, clong=ridge);\n }\n }\n}\n\nmodule rackpush(camsize=openingside*2, travelspace=openingside+2.5, curv=2){\n difference(){\n union(){\n\t\tcube([100,10,10], center=true);\n translate([airflow \/ 2, (camsize - gap * 3.1) \/ 2,0])\n minkowski(){\n cube([camsize + airflow - travelspace - curv, openingside * 2 - gap*2-curv*2, gap-.1], center=true);\n cylinder(r=curv, $fn=20, center=true);\n }\n for (i=[0:flapquant-2]){ \n translate([i*openingside*1.06+camsize+gap, openingside*2 - gap*4, -3.5\/2])\n cylinder(r=2, h = 3.5, $fn=20, center=true);\n }\n }\n for (i=[0:flapquant-2]){ \n translate([i*openingside*1.06+camsize+gap, openingside*2-gap*4, (gap-.1)\/2])\n cylinder(r=0.8, h = 10, $fn=14, center=true);\n }\n\t\ttranslate([openingside\/2, openingside-curv,0])\n\t\t\tcylinder(r=openingside*1.5\/2, h=15, center=true, $fn=80);\n }\n}\n\n\nmodule plate_air_parts(){\n \/\/ for printing the parts\n translate([33,52,0]) rotate([0,0,0])\n end_plate();\n mirror([ 1, 0, 0 ]) { \n translate([33,22,0]) rotate([0,0,0])\n end_plate(); }\n\n translate([23.5,21,2]) rotate([180,0,0]) side_plate();\n mirror([ 1, 0, 0 ]) { \n translate([23.5,52,2]) rotate([180,0,0]) side_plate(); }\n translate([-56,-12,0]) rotate([0,0,0]){\n side_plate(insider=0);\n mirror([ 1, 0, 0 ]) {\n translate([-113,-29,0]) rotate([0,0,90])\n side_plate(insider=0); }\n }\n}\n","old_contents":"\/\/ collection of parts for the new picker idea\n\nairflow = 57;\nsleeveout = airflow+1;\n\n\/\/ [fullOD, shaftD, thickness, turning_hubD]\nhubbearing = [22,8,7,13];\ntravelbearing = [6,3,2.5,5];\ntravelwheel = 60;\ntravelpeg = travelwheel - travelbearing[1];\n\nfat = 0.3; \/\/ add-on to make walls cut out enough space\nhb = 12.7 + fat; \/\/ height of bar cross-section\nwthk = 1.5 + fat; \/\/ thickness of walls\nflrthk = 1.6 + fat; \/\/ thickness of floor (that walls extend from)\ninside = 6.9 - fat; \/\/ between walls, across floor (subtracting 2*.5*fat)\nc_bar = [[0,0], [0,hb], [wthk, hb], [wthk, flrthk], [wthk+inside, flrthk], [wthk+inside, hb], [wthk+inside+wthk, hb], [wthk+inside+wthk, 0]];\n\n\/\/#shaft(travelbearing);\n\/\/#cbar(barH=100);\n\/\/#can_sleeve();\n\/\/translate([50,50,0])\n\/\/ for (i=[0:3:360]){\n\/\/ nutbolt(nut_position=20*i\/360, channel_ang=i);\n\/\/ }\n\/\/bigwheel_part();\n\/\/ bartest();\n\n\/\/ ** the can traveler by itself ***\n\/\/rotate([0,0,180]) translate([0, -56, +25.9])\n \/\/upndown(); \n\n\/\/motorcut();\n\/\/cbar();\n\nrackpush();\n\n\/\/ ** the main picker body ** \n\/\/cbracket();\n\n\/\/ ** the valve parts **\n\/\/louvers();\n\n\/\/plate_air_parts();\n \n\n\/\/ for cutting out shaft and hub-turning space\nmodule shaft(bearing, xtraH=0, hubclearance=0.5){\n height=bearing[2] + xtraH;\n translate([0,0,-height\/2-hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n translate([0,0,0])\n cylinder(r=bearing[1]\/2, h=height, center=true, $fn=24);\n translate([0,0,height\/2+hubclearance\/2])\n cylinder(r=bearing[3]\/2, h=hubclearance, center=true, $fn=28);\n echo(\"shaft of bearing = \", bearing, \"is top-to-bottom = \", hubclearance*2 + height);\n} \n\n\/\/ alluminum c-channel, positive or negative\nmodule cbar(outline=c_bar, barH=50){\n midbar = outline[7][0] \/ 2;\n echo(\"midbar read as: \",midbar);\n translate([-midbar,0,0])\n linear_extrude(center=true, height=barH, convexity=10, slices=2)\n polygon(points=outline);\n}\n\n\/\/ intended as positive model, could add scale or thickness\nmodule can_sleeve (emptyness=airflow, thickness=sleeveout-airflow-0.2, sleeveH=25){\n translate([0,0,-sleeveH\/2])\n rotate_extrude($fn=196)\n translate([(emptyness+thickness) \/ 2, 0, 0])\n polygon(points=[[0,0], [0,sleeveH], [thickness,sleeveH], [thickness,0]]);\n}\n\n\/\/ negative model with channel for captured nut insertion\nmodule nutbolt(hexhead=6.65, \n shaftD=3.1, \n shaftlen=20, \n nut_position=17,\n nut_thick=2.33, \n channel_len=30, \n channel_ang=0,){\n color( .5, .9, .9 )\n translate([0,0,-shaftlen\/2]){ \/\/center it by shaftlen\n \/\/shaft\n cylinder(r=shaftD\/2, h=shaftlen, center=false, $fn=18);\n \/\/head\n #translate([0,0,shaftlen-hexhead\/2])\n cylinder(r=hexhead\/2, h=hexhead\/2, center=false, $fn=6);\n \/\/nut + channel\n translate([0,0,shaftlen-nut_position])\n hull(){\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.1, h=nut_thick+.1, center=false, $fn=6);\n translate([cos(channel_ang)*channel_len, \n sin(channel_ang)*channel_len, 0])\n rotate([0,0,channel_ang])\n cylinder(r=hexhead\/2+.2, h=nut_thick+.1, center=false, $fn=6);\n }\n }\n}\n\nmodule motorhub(flat_to_flat=4.76, diameter=7.4, height=5.57, baseD=9, baseH=1.0){\n cutrad = (diameter - flat_to_flat)\/2;\n cutcenter = flat_to_flat\/2 + cutrad;\n cylinder(r=baseD\/2, h=baseH+0.1, center=false, $fn=36);\n cylinder(r=0.8, h=baseH+5*height+.1, center=true, $fn=6);\n translate([0,0,baseH])\n difference(){\n cylinder(r=diameter\/2, h=height+baseH, center=false, $fn=24);\n for (i=[cutcenter+0.05, -cutcenter-0.05]){\n translate([0,i,(height+baseH)\/2])\n cube([diameter+0.1, cutrad+0.1, height+.1], center=true);\n }\n\n }\n}\n \nmodule bigwheel_part(od=travelwheel, thk=4, hub=12, hubthk=4, holes=6, lever=5){\n overall_thk = thk+hubthk;\n echo(\"overall bigwheel thickness is : \", overall_thk);\n difference(){\n union(){\n cylinder(r=od\/2, h=thk, $fn=196);\n translate([0,0,4])\n cylinder(r=hub\/2, h=hubthk, $fn=64);\n }\n translate([0,0,overall_thk+0.05]) rotate([180,0,0])\n motorhub();\n for (i=[0 : 360\/holes : 360-(360\/holes)*.5]){\n translate([od\/3.14*cos(i), od\/3.14*sin(i), hubthk\/2])\n cylinder(r=od*.5\/(holes-1), h=hubthk+.1, center=true, $fn=42);\n }\n translate([0,od\/2-lever,-9]) rotate([0,0,0])\n nutbolt();\n translate([0,-od\/2+lever,-9]) rotate([0,0,0])\n nutbolt();\n }\n}\n\nmodule ring(ID, OD, ht){\n difference(){\n cylinder(r=OD\/2, h=ht, center=true, $fn=96);\n cylinder(r=ID\/2, h=ht+.1, center=true, $fn=96);\n }\n}\n\n\/\/ for LMB8MM\nmodule bearingcut(D=15.1\/2, dring=14.41\/2, drod=8.9\/2, dziptie=[19,3.3],){\n rotate_extrude(center=true, convexity=10, $fn=36){\n polygon(points=[[0,-2], [D,0], \n [D,3.3], [dring,3.3], \n [dring,4.55], [D,4.55], \n [D,19.35], [dring,19.35], \n [dring,20.8], [D,20.8], \n [D, 24.01], [0,26.01]]);\n }\n \/\/ zip tie rings\n for (i=[(3.3+4.55)\/2, (19.35+20.8)\/2]){\n translate([0,0,i])\n ring(dziptie[0], dziptie[0]+dziptie[1], 5);\n }\n \/\/ rod upon which it travels\n translate([0,0,12])\n cylinder(r=drod, h=90, $fn=18, center=true);\n}\n\nmodule bigwheel_cutout(od=travelwheel+3, thk=10){\n cylinder(r=od\/2, h=thk, $fn=128);\n}\n\nmodule bartest(ht=10){\n difference(){\n minkowski(){\n cube([20,20,10], center=true);\n cylinder(r=4, h=.1, center=true, $fn=24);\n }\n translate([-7,-9,0])\n #cbar(barH=30);\n translate([17,0,0]) rotate([0,0,90])\n #cbar(barH=30);\n translate([0,10.5,0]) rotate([90,0,0])\n #shaft(hubbearing);\n }\n}\n\nmodule upndown(ht=travelwheel){\n difference(){\n cube([travelwheel, travelwheel\/2, ht], center=true);\n \/\/ lift rail\n translate([0, travelwheel\/2-hb, 0])\n cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+.5 ,3.25, 0]) rotate([0,0,-0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n translate([travelwheel\/2-.5 ,3.25, 0]) rotate([0,0,0])\n cube([hb+.5, c_bar[6][0]+1, travelwheel+.1], center=true);\n\n \/\/ cylinder space\n translate([0, -travelwheel\/2, 0])\n cylinder(r = (sleeveout+.5)\/2, h=ht+.1, $fn=196, center=true);\n \/\/ nuts\n translate([0,0,ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=90);\n translate([0,0,-ht\/4]) rotate([90,0,0])\n #nutbolt(channel_ang=-90);\n }\n \/\/ underside printing supports for lift rail\n for (i=[0:5:travelwheel-1]){\n translate([i - travelwheel\/2+2.5, travelwheel\/2-hb*1.333, 0])\n cube([.5, hb*.37, c_bar[6][0]+.1], center=true);\n }\n}\n\nmodule upndown_cutout(ht=travelwheel){\n translate([0,-4.5,0])\n cube([travelwheel+1, travelwheel\/2+9.5, ht+2], center=true);\n \/\/ lift rail\n \/\/translate([0, travelwheel\/2+hb, 0])\n \/\/ cube([travelwheel+.1, hb+.1, c_bar[6][0]+.1], center=true);\n \/\/ side rails\n translate([-travelwheel\/2+hb\/2+.2,-5, 0]) rotate([0,0,90])\n cbar(barH=70);\n translate([travelwheel\/2-hb\/2-.2,-5, 0]) rotate([0,0,-90])\n cbar(barH=70);\n \/\/ cylinder of suckage\n translate([0, -travelwheel\/2 -9.5, 0])\n cylinder(r = (sleeveout+2)\/2, h=ht+2, $fn=196, center=true);\n\n}\n\nmodule motorcut(x=23,y=22,z=37,tab=[6,4,5],tabpos=7,curverad=5, shaftpos=[0,11,16], canheight=28){\n tiptop = canheight + z + tab[2] - curverad;\n \/\/ top-motorhousing\n translate([0,y\/2, tiptop - canheight])\n cylinder(r=x\/2, h=canheight, center=false, $fn=36);\n \/\/ gearbox housing\n translate([-(x-curverad*2)\/2, 0, curverad+tab[2]])\n minkowski(){\n cube([x-curverad*2,y,z-curverad*2], center=false);\n rotate([90,0,0])\n cylinder(r=curverad, h=.1, center=false, $fn=64);\n }\n \/\/ tab thingy for motor attachment\n translate([0,tabpos+tab[1]\/2, tab[2]\/2]){\n cube(tab, center=true);\n \/\/ cuts hole for bolting tab\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ driven hub stub and slide-in track\n translate(shaftpos)\n rotate([90,0,0])\n hull(){\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=9.14\/2, h=y+4, center=true, $fn=18);\n }\n \/\/ cuts shaft for holes that penetrate housing\n for (i=[1,-1]){\n translate([17.75\/2 * i, 0, 36])\n rotate([90,0,0])\n cylinder(r=3.26\/2, h=50, center=true, $fn=12);\n }\n \/\/ add on the driven wheel\n translate(shaftpos)\n rotate([90, 0,0]) translate([0,0,-y]){\n bigwheel_cutout();\n \/\/ and its connection hub\n translate([0,0,+3])\n hull(){\n cylinder(r=8, h=15, $fn=16, center=false);\n translate([0,z-shaftpos[0], 0])\n cylinder(r=8, h=15, $fn=16, center=false);\n }\n }\n \/\/ make a cut-out for the traveling part\n rotate([0,0,180]) translate(shaftpos) translate([0,-59,0])\n upndown_cutout();\n}\n\n\n\/\/ carve the big thing out of a block \nmodule cbracket(z=travelwheel\/2, bs=1.5){\n difference(){\n translate([-travelwheel\/2, 0, -4])\n minkowski(){\n cube([travelwheel, travelwheel*1.2, travelwheel-17], center=false);\n cylinder(r=8, h=1, $fn=16);\n }\n motorcut();\n translate([-travelwheel\/2-bs, -bs, 4]) \n bearingcut();\n translate([travelwheel\/2+bs,-bs, 4])\n bearingcut();\n translate([z+2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=45);\n translate([-z-2.5,z*2.5+.5,z*1.3]) rotate([0,0,0])\n #nutbolt(channel_ang=135);\n translate([-z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=180);\n translate([z*.8, z*.5,z*1.23]) rotate([0,0,0])\n #nutbolt(channel_ang=0);\n }\n}\n\/\/\/\/-----------------------------\/\/\/\/\n\/\/\/\/ *** air valve section **** \/\/\/\/\n\/\/\/\/ ____________________________\/\/\/\/\n\nflapquant=4;\nopeningside=airflow\/flapquant;\nflapthick = 5;\nbuttonht = 4;\ngap = 1.8; \/\/ between walls\n\nflap = [[0,0], [flapthick,openingside], [flapthick,0], [0,-openingside]];\n\nmodule pie(arc=90, center=90, rad=11, height=3){\n rotate([0,0,center-arc\/2])\n difference(){\n children();\n translate([0,-rad, 0])\n cube([rad*2,rad*2,rad*2], center=true);\n rotate([0,0,arc])\n translate([0,rad, 0])\n cube([rad*2,rad*2,rad*2], center=true);\n }\n}\n\nmodule degreed(sect=90, mks=60, size=15){\n for (i=[0:sect\/mks:sect-1]){\n translate([cos(i)*size, sin(i)*size, 3])\n color([.9, i\/sect*2+.5,0,1])\n cylinder(r=sect\/mks\/4, h=6, $fn=12, center=true);\n }\n}\n\nmodule one_love(scaler=1){\n \/\/ one flap with key holes \n difference(){\n translate([-flapthick\/2, 0, 0])\n linear_extrude(height=airflow){\n polygon(points=flap);\n }\n translate([0,0, airflow\/2]) rotate([0,0,-10.1])\n scale([scaler,scaler,1]){\n cube([flapthick\/2.8, openingside\/1.5, airflow+.1], center=true);\n cylinder(r=1.65, h=airflow+.1, $fn=16, center=true);\n }\n }\n}\n\nmodule carabas(wheelrad=openingside\/2, leverscale=1){\n \/\/ its the place for louvers\n wheel = max(wheelrad, 3);\n translate([0,0,-gap\/2- buttonht\/2])\n cylinder(r=wheel+.1, h= gap\/2, $fn=24, center=false);\n difference(){\n cylinder(r1=wheel, r2=wheel-3, h=buttonht, $fn=196, center=true);\n scale([1.07,1.07,1]) \n one_love(scaler=0.85);\n cylinder(r=1.7, h=4.1, $fn=16, center=true);\n }\n translate([-wheel+(openingside\/2+1.5)\/4, 0, -buttonht\/2 - gap\/2])\n lever(lvrad= openingside\/2 +1.5, lvthk=gap\/2, lvscale=leverscale);\n}\n\nmodule lever(lvrad=openingside\/2 + 1.5, lvthk=gap\/2, lvscale=1){\n difference(){\n union(){\n hull(){\n cylinder(r=(lvrad + 1.5)\/4, h=lvthk, center=false, $fn=16);\n translate([0,9\/lvscale,0])\n cylinder(r=(lvrad + 1.5)\/4, h=lvthk, center=false, $fn=16);\n }\n translate([0,9\/lvscale,0])\n cylinder(r=2, h=lvthk*2 + 0.25, center=false, $fn=16);\n }\n if (lvscale < 1.001){\n translate([0,9\/lvscale,-0.05])\n cylinder(r=1.65, h=lvthk*2 + 0.25 + 0.1, center=false, $fn=6);\n }\n }\n}\n\nmodule louvers(){\n \/\/ the flaps- working well standing up\n for (i=[0:flapquant-2]){\n translate([i*openingside, 0, 0]) rotate([0,0,75])\n one_love(); \n translate([i*(openingside+.5)+5,-openingside*2.8 ,buttonht\/2+gap\/2]){\n carabas();\n \/\/translate([0, 0, -buttonht\/2 - gap\/2])\n \/\/ lever();\n mirror([0,1,0]) \/\/{\n translate([-openingside*0.4, -openingside*1.8, 0]) \n carabas();\n \/\/ translate([0, openingside*1.2, - buttonht\/2- gap\/2])\n \/\/ lever();}\n } \n } \n \/\/translate([airflow\/2-openingside,openingside,airflow\/2]) rotate([90,0,0])\n \/\/ #circle(r=30, $fn=128, center=true);\n}\n\nmodule side_plate(sidethick=2, insider=1, scalecut=1.07){\n \/\/ laying on its... side \n difference(){\n translate([airflow - openingside*(flapquant-1), 0, buttonht\/4])\n union(){\n cube([airflow, openingside*2 + 1, buttonht\/2], center=true);\n for (i=[1,-1]){\n translate([i * (airflow\/2+sidethick\/2), 0,0]) rotate([0,-i*90,0])\n notcher();\n }\n }\n \n if (insider==1){\n echo(\"flapquant =\",flapquant); \n for (i=[0:flapquant-2]){ \n echo(\"i*openingside = \",i*openingside); \n translate([i*openingside*1.06, 0, buttonht\/2+0.05]){ \n scale([scalecut,scalecut,scalecut])\n rotate([0,0,-81])\n carabas(leverscale=scalecut);\n translate([0,0,-buttonht\/2])\n pie(arc=109, center=95, rad=13.6, height=4){\n rotate_extrude(convexity=10, $fn=36){\n translate([11\/scalecut, 0, 0])\n square([4.2,2.5], center=true);\n }\n }\n }\n }\n }\n }\n}\n\nmodule notcher(cd=2.2, cz=6, clong=1){\n difference(){\n cube([cd, openingside*2, cz], center=true);\n translate([0,0,-clong\/2-0.05])\n cube([cd+0.05, openingside*2-((cz-clong)*2), cz-clong], center=true);\n }\n}\n \nmodule end_plate(sidethick=2.2, ridge=1, cc=buttonht\/2+0.2){\n xlen = airflow+sidethick*4+gap*4+ridge*2;\n translate([0,0,(sidethick+ridge)\/2])\n difference(){\n cube([xlen, openingside*2 + 1, sidethick+ridge], center=true);\n translate([0,openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n translate([0,-openingside\/3, sidethick\/2])\n cube([airflow+sidethick*4+gap*2, openingside\/2-1, ridge+0.1], center=true);\n for (i=[1,-1], j=[cc, cc*3.5]){\n translate([i*(xlen\/2-j),0, 0])\n scale([1.05,1.05,1.05])\n notcher(cd=cc, cz=6.75, clong=ridge);\n }\n }\n}\n\nmodule rackpush(camsize=openingside*2, travelspace=openingside+2.5, curv=2){\n difference(){\n union(){\n translate([airflow\/2, (openingside*2-gap*3.1)\/2,0])\n minkowski(){\n\n cube([camsize + airflow - travelspace-curv, openingside*2-gap*2-curv*2, gap-.1], center=true);\n cylinder(r=curv, $fn=20, center=true);\n }\n for (i=[0:flapquant-2]){ \n translate([i*openingside*1.06+camsize+gap, openingside*2-gap*3, -3.5\/2])\n cylinder(r=2, h = 3.5, $fn=14, center=true);\n }\n }\n for (i=[0:flapquant-2]){ \n translate([i*openingside*1.06+camsize+gap, openingside*2-gap*4, (gap-.1)\/2])\n cylinder(r=0.8, h = 3.5, $fn=14, center=true);\n }\n }\n}\n\n\nmodule plate_air_parts(){\n \/\/ for printing the parts\n translate([33,52,0]) rotate([0,0,0])\n end_plate();\n mirror([ 1, 0, 0 ]) { \n translate([33,22,0]) rotate([0,0,0])\n end_plate(); }\n\n translate([23.5,21,2]) rotate([180,0,0]) side_plate();\n mirror([ 1, 0, 0 ]) { \n translate([23.5,52,2]) rotate([180,0,0]) side_plate(); }\n translate([-56,-12,0]) rotate([0,0,0]){\n side_plate(insider=0);\n mirror([ 1, 0, 0 ]) {\n translate([-113,-29,0]) rotate([0,0,90])\n side_plate(insider=0); }\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"6305d927d141cb8022470d81792e628ea635d9c6","subject":"[3d] MeterMonitor increase lid corner tolerence","message":"[3d] MeterMonitor increase lid corner tolerence\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/MeterMonitor.scad","new_file":"3d\/MeterMonitor.scad","new_contents":"\/\/ LCD type\r\nlt = 0; \/\/ [0: 0.56inch, 1: 0.36inch]\r\n\r\nwall = 1.3; \/\/ interior walls\r\nwall_o = 1.9; \/\/ outer walls\r\nwall_t = 1.45; \/\/ base thickness\r\n\r\n\/* Hidden *\/\r\nlid_h = wall_t;\r\n\r\nlcd_w = [67, 45.50][lt];\r\nlcd_d = [28, 23.00][lt];\r\nlcd_s_w = [60, 40.35][lt]; \/\/ width between screws\r\nlcd_s_d = [22, 17.76][lt];\r\nlcd_s_h = [8.5, 7.0][lt];\r\nlcd_s_dia = [3.1, 3.1][lt];\r\nlcd_a_w = [50, 30][lt]; \/\/ width of actual 7-segment area\r\nlcd_a_d = [17.5, 14][lt];\r\nlcd_ex_w = [0, 2][lt];\r\nlcd_ex_d = [2, 4][lt];\r\nlcd_window_offset = [2, (5.43-10.07)\/2][lt];\r\nw_extra = [2, 6][lt];\r\nd_extra = [0, 0][lt];\r\n\r\noa_w = 2*lcd_w + 2*lcd_ex_w + w_extra;\r\noa_d = 3*lcd_d + 3*lcd_ex_d + d_extra;\r\noa_h = 15;\r\npad_right = max(2*lcd_window_offset, 0); \/\/ padding is asymetrical so not included in oa_w\r\n\r\nmain();\r\ntranslate([-oa_w\/2, oa_d\/2+wall_o+5, 0]) lid();\r\n\/\/lid_stand();\r\n\r\nmodule main() {\r\n difference() {\r\n union() {\r\n translate([-oa_w\/2-wall_o, -oa_d\/2-wall_o, 0])\r\n cube_bchamfer([oa_w+pad_right+2*wall_o, oa_d+2*wall_o, oa_h+wall_t+lid_h+wall_t\/2], r=5, bottom=1);\r\n } \/\/ union\r\n \r\n \/\/ main cutout\r\n translate([-oa_w\/2, -oa_d\/2, wall_t])\r\n cube_bchamfer([oa_w+pad_right, oa_d, oa_h+e], r=5-wall, bottom=1, top=lid_h);\r\n \/\/ lid cutout\r\n translate([-oa_w\/2,-oa_d\/2-wall_o-e,wall_t+oa_h])\r\n cube_fillet([oa_w+pad_right, oa_d+wall_o+e, lid_h+wall_t+e],\r\n vertical=[2,2,0,0], top=[lid_h,lid_h,0,lid_h], $fn=4);\r\n \r\n \/\/ LCD holes\r\n lcd_places() lcd_mount_n();\r\n \r\n \/\/ USB power hole\r\n wemos_place() translate([-5.9, -35.2\/2-1.2-wall_o-e, 2.3+2-0.5]) \r\n cube_fillet([13, 10, 6+1.5], top=[0,1,0,1]);\r\n\r\n \/\/branding();\r\n } \/\/ diff\r\n\r\n lcd_places() lcd_mount_p();\r\n wemos_place() wemos_mount(2);\r\n}\r\n\r\nmodule lid() {\r\n ww = oa_w+pad_right+0.2;\r\n dd = oa_d+wall_o-0.2;\r\n difference() {\r\n cube_fillet([ww, dd, lid_h], bottom=[0.5, 0.5, 0, 0.5], vertical=[4, 4 ,1.5, 1.5]);\r\n \/\/ vent holes\r\n \/\/translate([15, dd\/2, 0])\r\n \/\/ for (X=[0:3])\r\n \/\/ translate([X*(ww-30)\/3, 0, -e]) rotate(90) cylcyl(d*0.7, 2, lid_h+2*e, $fn=12);\r\n }\r\n \/\/ lock bump\r\n \/\/translate([wall_o+wall_t+0.5, dd\/2-4*wall, lid_h-e]) cube_fillet([2*wall, 8*wall, 0.6], top=[0.6,0,0.6,0]);\r\n translate([ww\/4, wall_o+wall_t+0.5, lid_h-e])\r\n cube_fillet([ww\/2, 2*wall, 0.6], top=[0, 0.6, 0, 0.6]);\r\n}\r\n\r\nmodule lcd_places() {\r\n \/\/ center two\r\n translate([lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n translate([-lcd_w\/2-lcd_ex_w,0,0])\r\n children();\r\n \/\/ top\/bottom\r\n mirror2([0,1,0]) translate([-lcd_w\/2-lcd_ex_w,lcd_d+lcd_ex_d,0])\r\n children();\r\n}\r\n\r\nmodule lcd_mount_p() {\r\n mirror2([1,0,0]) mirror2([0,1,0]) translate([lcd_s_w\/2, lcd_s_d\/2, wall_t]) {\r\n difference() {\r\n cylinder(lcd_s_h, d=lcd_s_dia+2*wall, $fn=16);\r\n translate([0,0,-e]) cylinder(lcd_s_h+2*e, d=lcd_s_dia, $fn=16);\r\n }\r\n }\r\n}\r\n\r\nmodule lcd_mount_n() {\r\n translate([-lcd_a_w\/2+lcd_window_offset-wall_t, -lcd_a_d\/2-wall_t, -e])\r\n cube_bchamfer([lcd_a_w+2*wall_t, lcd_a_d+2*wall_t, wall_t+2*e], r=3, top=wall_t, $fn=12);\r\n}\r\n\r\nmodule wemos_place() {\r\n translate([oa_w\/2+pad_right+wall-20, -lcd_d-lcd_ex_d, wall_t]) rotate(90) children();\r\n}\r\n\r\nmodule wemos_mount(extra_h) {\r\n we_w=25.9;\r\n we_d=35.2;\r\n we_h=6;\r\n we_rad=2.4;\r\n we_wall=1.2;\r\n \r\n difference() {\r\n translate([-we_w\/2-we_wall, -we_d\/2-we_wall, 0])\r\n cube_fillet([we_w+2*we_wall, we_d+2*we_wall, we_h+extra_h],\r\n vertical=[we_rad+we_wall*0.5855, we_rad+we_wall*0.5855, 0, 0]);\r\n \r\n translate([0,0,extra_h]) {\r\n \/\/ Big hole\r\n translate([-we_w\/2, -we_d\/2, 3])\r\n cube_fillet([we_w, we_d, we_h+2*e], vertical=[we_rad, we_rad, 0, 0]);\r\n \/\/ USB jack\r\n translate([-5.9, -we_d\/2-we_wall-e, 2.3]) \r\n cube([13, 10, we_h]);\r\n \/\/ Reset button\r\n translate([we_w\/2-e, -we_d\/2+1.8, 3.5]) \r\n cube([we_wall+2*e, 5, we_h]);\r\n \/\/ Bottom small hole\r\n translate([-21\/2, -31\/2, -e])\r\n cube([21, 31, we_h+2*e]);\r\n \/\/ wifi antenna\r\n translate([-18\/2, we_d\/2-(we_d-31)\/2-e, 3-1.3]) \r\n cube([18, (we_d-31)\/2+e, 1.3+e]);\r\n }\r\n } \/\/ diff\r\n \r\n \/\/ Grab notches\r\n translate([0,0,extra_h]) {\r\n translate([we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n translate([-we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n }\r\n}\r\n\r\nmodule lid_stand()\r\n{\r\n ls_weight_dia = 19.1;\r\n ls_weight_h = 12;\r\n \r\n ls_w = 75;\r\n ls_d = ls_weight_dia + 2 * wall;\r\n ls_h = ls_weight_h + 5;\r\n \r\n ls_mag_w = 7;\r\n ls_mag_d = 12.7;\r\n ls_mag_h = 2.3;\r\n \r\n difference() {\r\n translate([-ls_w\/2, -ls_d\/2, 0])\r\n cube_fillet([ls_w, ls_d, ls_h], top=[5, ls_h\/2,0, ls_h\/2]);\r\n\r\n \/\/ weight hole\r\n translate([0, 0, -e])\r\n cylinder(ls_weight_h, d=ls_weight_dia, $fn=24);\r\n \/\/ magnet holes\r\n translate([-ls_w\/2+wall, -ls_mag_d\/2, -e]) cube([ls_mag_w, ls_mag_d, ls_mag_h]);\r\n translate([-ls_weight_dia\/2-ls_mag_w-wall, -ls_mag_d\/2, -e]) cube([ls_mag_w, ls_mag_d, ls_mag_h]);\r\n translate([ls_w\/2-ls_mag_w-wall, -ls_mag_d\/2, -e]) cube([ls_mag_w, ls_mag_d, ls_mag_h]);\r\n translate([ls_weight_dia\/2+wall, -ls_mag_d\/2, -e]) cube([ls_mag_w, ls_mag_d, ls_mag_h]);\r\n } \/\/ diff\r\n}\r\n\r\nmodule branding() {\r\n translate([lcd_w\/2-3,lcd_d+lcd_ex_d,-e]) mirror([1,0,0]) linear_extrude(0.24+e)\r\n text(\"HeaterMeter\", halign=\"center\", valign=\"center\", font=\"Impact\",\r\n spacing=1.3, size=7);\r\n}\r\n\r\n\/********************************** LIBRARY CODE BELOW HERE **********************\/\r\n\r\ne = 0.01;\r\n\r\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\r\n \/\/ bottom beaded area\r\n if (bottom != 0) hull(){\r\n translate([r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n }\r\n \/\/ center\r\n translate([0,0,bottom]) hull(){\r\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n }\r\n \/\/ top beaded area\r\n if (top != 0) translate([0,0,dim[2]-top-e]) hull(){\r\n translate([r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n }\r\n}\r\n\r\nmodule mirror2(dim) {\r\n \/\/ Create both item and mirror of item\r\n children();\r\n mirror(dim) children();\r\n}\r\n\r\nmodule fillet(radius, height=100, $fn=$fn) {\r\n if (radius > 0) {\r\n \/\/this creates acutal fillet\r\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\r\n cube([radius * 2, radius * 2, height + 0.04]);\r\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\r\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\r\n } else {\r\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\r\n }\r\n\r\n }\r\n }\r\n}\r\n\r\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\r\n if (center) {\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n } else {\r\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n }\r\n}\r\n\r\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n j=[1,0,1,0];\r\n\r\n fn_V = $fn[0] == undef ? $fn : $fn[0];\r\n fn_T = $fn[1] == undef ? $fn : $fn[1];\r\n fn_B = $fn[2] == undef ? $fn : $fn[2];\r\n \r\n for (i=[0:3]) {\r\n if (radius > -1) {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\r\n } else {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\r\n }\r\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\r\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\r\n\r\n }\r\n}\r\n\r\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n \/\/makes CENTERED cube with round corners\r\n \/\/ if you give it radius, it will fillet vertical corners.\r\n \/\/othervise use vertical, top, bottom arrays\r\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\r\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\r\n\r\n if (radius == 0) {\r\n cube(size, center=true);\r\n } else {\r\n difference() {\r\n cube(size, center=true);\r\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\r\n }\r\n }\r\n}\r\n\r\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ LCD type\r\nlt = 0; \/\/ [0: 0.56inch, 1: 0.36inch]\r\n\r\nwall = 1.3; \/\/ interior walls\r\nwall_o = 1.9; \/\/ outer walls\r\nwall_t = 1.45; \/\/ base thickness\r\n\r\n\/* Hidden *\/\r\nlid_h = wall_t;\r\n\r\nlcd_w = [67, 45.50][lt];\r\nlcd_d = [28, 23.00][lt];\r\nlcd_s_w = [60, 40.35][lt]; \/\/ width between screws\r\nlcd_s_d = [22, 17.76][lt];\r\nlcd_s_h = [8.5, 7.0][lt];\r\nlcd_s_dia = [3.1, 3.1][lt];\r\nlcd_a_w = [50, 30][lt]; \/\/ width of actual 7-segment area\r\nlcd_a_d = [17.5, 14][lt];\r\nlcd_ex_w = [0, 2][lt];\r\nlcd_ex_d = [2, 4][lt];\r\nlcd_window_offset = [2, (5.43-10.07)\/2][lt];\r\nw_extra = [2, 6][lt];\r\nd_extra = [0, 0][lt];\r\n\r\noa_w = 2*lcd_w + 2*lcd_ex_w + w_extra;\r\noa_d = 3*lcd_d + 3*lcd_ex_d + d_extra;\r\noa_h = 15;\r\npad_right = max(2*lcd_window_offset, 0); \/\/ padding is asymetrical so not included in oa_w\r\n\r\nmain();\r\n\/\/translate([-oa_w\/2, oa_d\/2+wall_o+5, 0]) lid();\r\n\r\nmodule main() {\r\n difference() {\r\n union() {\r\n translate([-oa_w\/2-wall_o, -oa_d\/2-wall_o, 0])\r\n cube_bchamfer([oa_w+pad_right+2*wall_o, oa_d+2*wall_o, oa_h+wall_t+lid_h+wall_t\/2], r=5, bottom=1);\r\n } \/\/ union\r\n \r\n \/\/ main cutout\r\n translate([-oa_w\/2, -oa_d\/2, wall_t])\r\n cube_bchamfer([oa_w+pad_right, oa_d, oa_h+e], r=5-wall, bottom=1, top=lid_h);\r\n \/\/ lid cutout\r\n translate([-oa_w\/2,-oa_d\/2-wall_o-e,wall_t+oa_h])\r\n cube_fillet([oa_w+pad_right, oa_d+wall_o+e, lid_h+wall_t+e],\r\n vertical=[2,2], top=[lid_h,lid_h,0,lid_h], $fn=4);\r\n \r\n \/\/ LCD holes\r\n lcd_places() lcd_mount_n();\r\n \r\n \/\/ USB power hole\r\n wemos_place() translate([-5.9, -35.2\/2-1.2-wall_o-e, 2.3+2-0.5]) \r\n cube_fillet([13, 10, 6+1.5], top=[0,1,0,1]);\r\n\r\n \/\/branding();\r\n } \/\/ diff\r\n\r\n lcd_places() lcd_mount_p();\r\n wemos_place() wemos_mount(2);\r\n}\r\n\r\nmodule lid() {\r\n ww = oa_w+pad_right+0.2;\r\n dd = oa_d+wall_o-0.2;\r\n difference() {\r\n cube_fillet([ww, dd, lid_h], bottom=[0.5, 0.5, 0, 0.5], vertical=[1.5, 1.5 ,1.5, 1.5]);\r\n \/\/ vent holes\r\n \/\/translate([15, dd\/2, 0])\r\n \/\/ for (X=[0:3])\r\n \/\/ translate([X*(ww-30)\/3, 0, -e]) rotate(90) cylcyl(d*0.7, 2, lid_h+2*e, $fn=12);\r\n }\r\n \/\/ lock bump\r\n \/\/translate([wall_o+wall_t+0.5, dd\/2-4*wall, lid_h-e]) cube_fillet([2*wall, 8*wall, 0.6], top=[0.6,0,0.6,0]);\r\n translate([ww\/4, wall_o+wall_t+0.5, lid_h-e]) cube_fillet([ww\/2, 2*wall, 0.6], top=[0,0.6,0,0.6]);\r\n}\r\n\r\nmodule lcd_places() {\r\n \/\/ center two\r\n translate([lcd_w\/2+lcd_ex_w,0,0])\r\n children();\r\n translate([-lcd_w\/2-lcd_ex_w,0,0])\r\n children();\r\n \/\/ top\/bottom\r\n mirror2([0,1,0]) translate([-lcd_w\/2-lcd_ex_w,lcd_d+lcd_ex_d,0])\r\n children();\r\n}\r\n\r\nmodule lcd_mount_p() {\r\n mirror2([1,0,0]) mirror2([0,1,0]) translate([lcd_s_w\/2, lcd_s_d\/2, wall_t]) {\r\n difference() {\r\n cylinder(lcd_s_h, d=lcd_s_dia+2*wall, $fn=16);\r\n translate([0,0,-e]) cylinder(lcd_s_h+2*e, d=lcd_s_dia, $fn=16);\r\n }\r\n }\r\n}\r\n\r\nmodule lcd_mount_n() {\r\n translate([-lcd_a_w\/2+lcd_window_offset-wall_t, -lcd_a_d\/2-wall_t, -e])\r\n cube_bchamfer([lcd_a_w+2*wall_t, lcd_a_d+2*wall_t, wall_t+2*e], r=3, top=wall_t, $fn=12);\r\n}\r\n\r\nmodule wemos_place() {\r\n translate([oa_w\/2+pad_right+wall-20, -lcd_d-lcd_ex_d, wall_t]) rotate(90) children();\r\n}\r\n\r\nmodule wemos_mount(extra_h) {\r\n we_w=25.9;\r\n we_d=35.2;\r\n we_h=6;\r\n we_rad=2.4;\r\n we_wall=1.2;\r\n \r\n difference() {\r\n translate([-we_w\/2-we_wall, -we_d\/2-we_wall, 0])\r\n cube_fillet([we_w+2*we_wall, we_d+2*we_wall, we_h+extra_h],\r\n vertical=[we_rad+we_wall*0.5855,we_rad+we_wall*0.5855]);\r\n \r\n translate([0,0,extra_h]) {\r\n \/\/ Big hole\r\n translate([-we_w\/2, -we_d\/2, 3])\r\n cube_fillet([we_w, we_d, we_h+2*e], vertical=[we_rad,we_rad]);\r\n \/\/ USB jack\r\n translate([-5.9, -we_d\/2-we_wall-e, 2.3]) \r\n cube([13, 10, we_h]);\r\n \/\/ Reset button\r\n translate([we_w\/2-e, -we_d\/2+1.8, 3.5]) \r\n cube([we_wall+2*e, 5, we_h]);\r\n \/\/ Bottom small hole\r\n translate([-21\/2, -31\/2, -e])\r\n cube([21, 31, we_h+2*e]);\r\n \/\/ wifi antenna\r\n translate([-18\/2, we_d\/2-(we_d-31)\/2-e, 3-1.3]) \r\n cube([18, (we_d-31)\/2+e, 1.3+e]);\r\n }\r\n } \/\/ diff\r\n \r\n \/\/ Grab notches\r\n translate([0,0,extra_h]) {\r\n translate([we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n translate([-we_w\/2,5\/2,we_h-0.8\/2]) rotate([90]) cylinder(5, d=0.8, $fn=4);\r\n }\r\n}\r\n\r\nmodule branding() {\r\n translate([lcd_w\/2-3,lcd_d+lcd_ex_d,-e]) mirror([1,0,0]) linear_extrude(0.24+e)\r\n text(\"HeaterMeter\", halign=\"center\", valign=\"center\", font=\"Impact\",\r\n spacing=1.3, size=7);\r\n}\r\n\r\n\/********************************** LIBRARY CODE BELOW HERE **********************\/\r\n\r\ne = 0.01;\r\n\r\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\r\n \/\/ bottom beaded area\r\n if (bottom != 0) hull(){\r\n translate([r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom+e, r1=max(0, r-bottom), r2=r, $fn=$fn);\r\n }\r\n \/\/ center\r\n translate([0,0,bottom]) hull(){\r\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\r\n }\r\n \/\/ top beaded area\r\n if (top != 0) translate([0,0,dim[2]-top-e]) hull(){\r\n translate([r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top+e, r2=max(0, r-top), r1=r, $fn=$fn);\r\n }\r\n}\r\n\r\nmodule mirror2(dim) {\r\n \/\/ Create both item and mirror of item\r\n children();\r\n mirror(dim) children();\r\n}\r\n\r\nmodule fillet(radius, height=100, $fn=$fn) {\r\n if (radius > 0) {\r\n \/\/this creates acutal fillet\r\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\r\n cube([radius * 2, radius * 2, height + 0.04]);\r\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\r\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\r\n } else {\r\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\r\n }\r\n\r\n }\r\n }\r\n}\r\n\r\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\r\n if (center) {\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n } else {\r\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\r\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\r\n }\r\n}\r\n\r\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n j=[1,0,1,0];\r\n\r\n fn_V = $fn[0] == undef ? $fn : $fn[0];\r\n fn_T = $fn[1] == undef ? $fn : $fn[1];\r\n fn_B = $fn[2] == undef ? $fn : $fn[2];\r\n \r\n for (i=[0:3]) {\r\n if (radius > -1) {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\r\n } else {\r\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\r\n }\r\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\r\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\r\n\r\n }\r\n}\r\n\r\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\r\n \/\/makes CENTERED cube with round corners\r\n \/\/ if you give it radius, it will fillet vertical corners.\r\n \/\/othervise use vertical, top, bottom arrays\r\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\r\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\r\n\r\n if (radius == 0) {\r\n cube(size, center=true);\r\n } else {\r\n difference() {\r\n cube(size, center=true);\r\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\r\n }\r\n }\r\n}\r\n\r\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"eb9ee5f348097ca898b0616abacd0a5fac19c66a","subject":"shapes: add pie_slice_shape and pie_slice","message":"shapes: add pie_slice_shape and pie_slice\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"utils-shapes.scad","new_file":"utils-shapes.scad","new_contents":"module size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\nmodule pie_slice_shape(r, start_angle, end_angle) {\n R = r * sqrt(2) + 1;\n a0 = (4 * start_angle + 0 * end_angle) \/ 4;\n a1 = (3 * start_angle + 1 * end_angle) \/ 4;\n a2 = (2 * start_angle + 2 * end_angle) \/ 4;\n a3 = (1 * start_angle + 3 * end_angle) \/ 4;\n a4 = (0 * start_angle + 4 * end_angle) \/ 4;\n if(end_angle > start_angle)\n {\n intersection() {\n circle(r);\n polygon([\n [0,0],\n [R * cos(a0), R * sin(a0)],\n [R * cos(a1), R * sin(a1)],\n [R * cos(a2), R * sin(a2)],\n [R * cos(a3), R * sin(a3)],\n [R * cos(a4), R * sin(a4)],\n [0,0]\n ]);\n }\n }\n}\n\nmodule pie_slice(r, start_angle, end_angle, h) \n{\n linear_extrude(h)\n {\n pie_slice_shape(r, start_angle, end_angle);\n }\n}\n\n\/*%pie_slice(r=10, start_angle=-30, end_angle=270, h=10);*\/\n\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);\n%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);\n","old_contents":"module size_align(size=[10,10,10], align=[0,0,0])\n{\n t=[align[0]*size[0]\/2,align[1]*size[1]\/2,align[2]*size[2]\/2];\n \/*echo(t);*\/\n translate(t)\n {\n children();\n }\n}\n\nmodule cubea(size=[10,10,10], align=[0,0,0], extrasize=[0,0,0], extrasize_align=[0,0,0])\n{\n size_align(extrasize,extrasize_align)\n {\n size_align(size,align)\n {\n cube(size+extrasize, center=true);\n }\n }\n}\n\n\nmodule cylindera(h=10, r=undef, r1=undef, r2=undef, d=undef, d1=undef, d2=undef, align=[0,0,0], extra_h=0,extra_r=undef,extra_d=undef,extra_align=[0,0,0])\n{\n extra_r_=(extra_r==undef?0:extra_r);\n extra_d_=(extra_d==undef?0:extra_d);\n extra_sizexy=extra_r_*2 + extra_d_;\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n r_=(r==undef?0:r);\n d_=(d==undef?0:d);\n sizexy=r_*2 + d_;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r+extra_r_, r1=r1, r2=r2, d=d+extra_d_, d1=d1, d2=d2, center=true);\n }\n }\n}\n\n\nmodule fncylinder(r, r2, d, d2, h, fn, center=false, enlarge=0, fnr=0.4){\n translate(center==false?[0,0,-enlarge]:[0,0,-h\/2-enlarge]) {\n if (fn==undef) {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=floor(2*(r?r:d?d\/2:1)*PI\/fnr));\n }\n } else {\n if (r2==undef && d2==undef) {\n cylinder(r=r?r:d?d\/2:1,h=h+enlarge*2,$fn=fn);\n } else {\n cylinder(r=r?r:d?d\/2:1,r2=r2?r2:d2?d2\/2:1,h=h+enlarge*2,$fn=fn);\n }\n }\n }\n}\n\n\/\/ specify segment length with fnr, $fn not needed but if desired use fn instead but if desired use fn instead\nmodule fncylindera(\n h=10,\n r=undef,\n r1=undef,\n r2=undef,\n d=undef,\n d1=undef,\n d2=undef,\n align=[0,0,0],\n extra_h=0,\n extra_r=undef,\n extra_d=undef,\n extra_align=[0,0,0],\n fn,\n fnr=0.4,\n debug=false\n )\n{\n pi=3.1415926536;\n\n useDia = r == undef && (r1 == undef && r2 == undef);\n\n r_= useDia?d\/2:(r==undef?0:r);\n r1_ = useDia?((d1==undef?undef:d1)\/2):r1;\n r2_ = useDia?((d2==undef?undef:d2)\/2):r2;\n extra_r_ = useDia?((extra_d==undef?0:extra_d)\/2):((extra_r==undef)?0:extra_d\/2);\n\n extra_sizexy=extra_r_*2;\n\n size_align([extra_sizexy,extra_sizexy,extra_h],extra_align)\n {\n\n fn_=fn==undef?(floor(2*(r_+extra_r_)*pi\/fnr)):fn;\n\n if(debug)\n echo(useDia, h, r_, r1_, r2_, extra_r_, align, fn_);\n\n sizexy=r_*2;\n size_align([sizexy,sizexy,h],align)\n {\n cylinder(h=h+extra_h, r=r_+extra_r_, r1=r1_, r2=r2_, center=true, $fn=fn_);\n }\n }\n}\n\/*cubea([10,10,10],[1,0,0]);*\/\n\/*%cubea([10,10,10],[1,0,0],[5,5,5],[1,1,1]);*\/\n\n\/*%cubea([10,10,10],[-1,0,1]);*\/\n\/*%cubea([10,10,10],[-1,0,1],[1,1,1],[-1,0,1]);*\/\n\/*%cylindera(h=10, r=10\/2, align=[-1,1,1], extra_r=5\/2, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[-1,1,1], extra_d=5, extra_h=2, extra_align=[-1,1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=15, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n\/*%cylindera(h=10, d=10, align=[1,-1,1], extra_d=5, extra_h=2, extra_align=[-1,-1,1], $fn=100);*\/\n\/*%cylindera(h=10, d=10, align=[1,1,1], extra_d=5, extra_h=2, extra_align=[1,1,1], $fn=100);*\/\n\n%cylindera(h=10, d=10, align=[1,0,0], extra_d=10);\n%cylindera(h=10, r=5, align=[-1,0,0], extra_r=5);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"7867cb02f0b0116ac22c73877130db6106e0c8cf","subject":"top is now fully covered (no need for passing any cables atm)","message":"top is now fully covered (no need for passing any cables atm)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"top_dummy\/top_dummy.scad","new_file":"top_dummy\/top_dummy.scad","new_contents":"$fn=200;\n\ndifference()\n{\n cylinder(r=(60-1)\/2, h=25);\n cylinder(r=(60-1)\/2-1.6, h=25);\n}\ncylinder(r=60\/2+5, h=1);\n","old_contents":"$fn=200;\n\ndifference()\n{\n union()\n {\n cylinder(r=(60-1)\/2, h=25);\n cylinder(r=60\/2+5, h=1);\n }\n cylinder(r=(60-1)\/2-1.6, h=25);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"de19d5b56c05f5252b8def867f0025e1df39597b","subject":"Created object is no longer centered","message":"Created object is no longer centered\n","repos":"btcspry\/3d-wallet-generator","old_file":"scad\/roundCornersCube.scad","new_file":"scad\/roundCornersCube.scad","new_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,center=true);}\nmodule roundCornersCube(x,y,z)translate([x\/2,y\/2,z\/2]){difference(){r=((x+y)\/2)*0.052;cube([x,y,z],center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}}","old_contents":"module createMeniscus(h,radius)difference(){translate([radius\/2+0.1,radius\/2+0.1,0]){cube([radius+0.2,radius+0.1,h+0.2],center=true);}cylinder(h=h+0.2,r=radius,center=true);}\nmodule roundCornersCube(x,y,z)difference(){r=((x+y)\/2)*0.052;cube([x,y,z],center=true);translate([x\/2-r,y\/2-r]){rotate(0){createMeniscus(z,r);}}translate([-x\/2+r,y\/2-r]){rotate(90){createMeniscus(z,r);}}translate([-x\/2+r,-y\/2+r]){rotate(180){createMeniscus(z,r);}}translate([x\/2-r,-y\/2+r]){rotate(270){createMeniscus(z,r);}}}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"10990064219ecf48f315fa1990cca22da9637059","subject":"extruder\/old: remove","message":"extruder\/old: remove\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"extruder-old.scad","new_file":"extruder-old.scad","new_contents":"","old_contents":"include ;\ninclude ;\nuse ;\nuse ;\nuse ;\ninclude \ninclude \n\ninclude \n\nmodule capmount(show_sensor=false,lower_height=12,mount_lower=12,height=10,thickness=5,screws_spacing=21,screw_offset=[1,0],screws_diameter=4,sensor_spacing=3,sensor_height=[15,40,5],sensor_diameter=12)\n{\n mount_start = 1.7+sensor_spacing+screws_spacing+screws_diameter+2*screw_offset[0];\n if(show_sensor)\n {\n translate([-8+sensor_diameter\/2+thickness,-.5+mount_start+thickness+sensor_diameter\/2,-39])\n {\n translate([0,0,sensor_height[1]+sensor_height[2]])\n cylindera(d=sensor_diameter-0.5,h=sensor_height[0]);\n translate([0,0,sensor_height[2]])\n %cylindera(d=sensor_diameter-0.5,h=sensor_height[1]);\n cylindera(d=sensor_diameter-0.5,h=sensor_height[2]);\n }\n }\n\n \/\/ Mount\n $fn=50;\n difference() {\n translate([0,0,-lower_height])\n cube([thickness+1, mount_start, height+lower_height]);\n\n\n \/\/Screws 1\n translate([2*e, 4+screw_offset[0], height\/2+screw_offset[1]])\n {\n rotate([0,90,0])\n {\n cylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n cylindera(h = 4, d=8.2, $fn=6);\n }\n \/\/Screws 2\n translate([0,screws_spacing,0])\n rotate([0,90,0])\n {\n cylindera(d=screws_diameter, h=thickness+1);\n translate([0,0,2.5])\n cylindera(h = 4, d=8.2, $fn=6);\n }\n }\n\n }\n \/\/Sensor mount\n $fn=200;\n translate([-8,-.3,0])\n difference() {\n union() {\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -lower_height])\n cylindera(d=sensor_diameter+2*thickness, h=height+lower_height-mount_lower);\n\n }\n translate([sensor_diameter\/2+thickness,mount_start+thickness+sensor_diameter\/2, -height\/2])\n cylindera(d=sensor_diameter+0,5, h=2*height, center=true);\n\n cutoff=[1,2];\n translate([0,mount_start, -lower_height-e])\n cubea([cutoff[0],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[1,1,1]);\n\n translate([sensor_diameter+thickness*2,mount_start, -lower_height-e])\n cubea([cutoff[1],sensor_diameter+thickness*2,height+lower_height-mount_lower+2*e],[-1,1,1]);\n }\n}\n\nhouse_bearing=bearing_MR128;\nguidler_bearing=bearing_625;\n\nhouse_padding_wd=11*mm;\nhouse_padding_h=4*mm;\n\nfilapath_width=10*mm;\n\n\/\/ 4mm ptfe tube\nfilament_path_d = 4*mm;\n\n\/\/ offset from the center of the bolt to the filament path\nbolt_center_offset = 4.2*mm;\n\nhotend_mount_h=10.5*mm;\n\n\/\/ from E3D V6 heatsink drawing\n\/\/ http:\/\/wiki.e3d-online.com\/wiki\/File:DRAWING-V6-175-SINK.png\n\/\/ each entry == dia + h\nhotmount_d_h=[[16*mm,3.7*mm],[12*mm,6*mm],[16*mm,3*mm]];\nhotmount_outer_size=max(vec_i(hotmount_d_h,0))+10*mm;\nhotmount_h_offset=-2*mm;\n\/\/ which side does hotend slide in (x-axis, i.e. -1 is left, 1 is right)\nhotmount_clamp_side=1*mm;\n\nhotmount_tolerance=1.05*mm;\n\n\/\/ hotmount clamp screws distance from center\nhotmount_clamp_thread = ThreadM3;\nhotmount_clamp_nut = MHexNutM3;\n\nhotmount_clamp_screw_dia = lookup(ThreadSize, hotmount_clamp_thread);\nhotmount_clamp_screws_dist = hotmount_d_h[1][1] + 2*hotmount_clamp_screw_dia;\nhotmount_clamp_pad = 2.5*mm;\nhotmount_clamp_thickness = 5*mm;\nhotmount_clamp_y = 2*(hotmount_clamp_screws_dist + hotmount_clamp_screw_dia + hotmount_clamp_pad);\nhotmount_clamp_height = hotmount_d_h[1][1];\n\n\/\/ length of the guidler bearing bolt\/screw\nguidler_bolt_h=10*mm;\n\nguidler_mount_w=guidler_bearing[2];\nguidler_mount_d=9*mm;\n\nguidler_w=max(guidler_mount_w+7, guidler_bearing[2]*2.8);\nguidler_d=5;\nguidler_h=12;\nguidler_extra_h_up=guidler_bearing[1]\/2+hotmount_clamp_screw_dia\/2;\n\nguidler_mount_off_d=-guidler_bearing[1]\/1.7;\nguidler_mount_off_h=-guidler_bearing[1]\/1.7;\n\nextruder_guidler_mount_off_y = guidler_mount_off_d - guidler_bearing[1]\/2;\n\nhouse_inner_w=max(guidler_w+3, filament_d*2 + 4*2);\n\nguidler_screws_thread = ThreadM3;\nguidler_screws_thread_dia= lookup(ThreadSize, guidler_screws_thread);\nguidler_screws_distance=6*mm;\nguidler_screws_mount_d = 10*mm;\nguidler_screws_mount_d_offset = 0*mm;\n\nxcarriage_mount_hole_distance = 23*mm;\nxcarriage_mount_w = xcarriage_mount_hole_distance + 6*mm;\nxcarriage_mount_d = 6*mm;\nxcarriage_mount_h = xcarriage_mount_w;\n\n\/\/ 80t + 20t w\/228-2GT-6 belt\ngears_distance=38.8*mm;\nmotor_offset_y = 20*mm;\nmotor_offset_z = pythag_leg(motor_offset_y,gears_distance);\n\nextruder_motor_type = NemaShort;\nextruder_motor = dict_replace_multiple(Nema17, \n [\n [NemaShort, 33*mm],\n [NemaFrontAxleLength, 22*mm]\n ]);\n\nextruder_motor_mount_thickness = 5*mm;\nextruder_motor_side = motorWidth(extruder_motor);\nextruder_motor_length = motorLength(extruder_motor);\n\nhouse_w = max(house_inner_w+2*house_bearing[2], hotmount_outer_size, xcarriage_mount_w);\nhouse_d=house_bearing[1]\/2+house_padding_wd;\nhouse_h=house_bearing[1]+house_padding_h;\n\nhouse_guidler_screw_h = guidler_screws_thread_dia+8*mm;\nhouse_guidler_screw_h_offset = house_h\/2 + guidler_screws_thread_dia + 4*mm;\n\n\nalpha = 0.7;\n\/*alpha = 1;*\/\ncolor_xcarriage = [0.3,0.8,0.3, alpha];\ncolor_hotend = [0.8,0.4,0.4, alpha];\ncolor_extruder = [0.2,0.6,0.9, alpha];\ncolor_guidler = [0.4,0.5,0.8, alpha];\n\nextruder_guidler_roll = 45;\n\nhouse_offset_xcarriage_y = house_d+19*mm;\nhouse_offset_xcarriage_z = -25;\n\n\/\/ extruder connection point for guidler\nextruder_conn_guidler = [ [0, extruder_guidler_mount_off_y, guidler_mount_off_h], [1,0,0]];\nextruder_conn_hotend = [[0,0,-house_h\/2+hotmount_h_offset-0.1],[0,0,1]];\nextruder_conn_xcarriage=[[0, house_offset_xcarriage_y, house_offset_xcarriage_z],[0,1,0]];\n\/*extruder_conn_xcarriage=[[house_w\/2+10, 15,-36],[-1,0,0]];*\/\n\nextruder_conn_hotmount_clamp=[[house_w\/2*(hotmount_clamp_side), 0,-house_h\/2+hotmount_h_offset -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2], [0,0,0]];\nhotmount_clamp_conn = [[0,0,0],[0,0,0]];\n\nmodule extruder_guidler_mount(){\n\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n {\n cubea([guidler_mount_w,guidler_mount_d,guidler_mount_d],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n rotate([0,90,0])\n {\n cylindera(d=guidler_mount_d, h=guidler_mount_w);\n }\n\n translate([0,0,-guidler_mount_d\/2-1])\n cubea([house_w,guidler_mount_d,guidler_mount_d\/2+1],align=[0,0,-1], extrasize=[0,5,0], extrasize_align=[0,1,0]);\n }\n}\n\nmodule extruder_own(show_filament=true)\n{\n color(color_extruder)\n difference()\n {\n union(){\n\n house_w_extended = max(house_w, extruder_motor_mount_thickness*2+extruder_motor_length);\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*cylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w,house_d,house_h], align=[0,0,0]);\n }\n\n \/\/ hotend mount housing\n translate([0,0,-house_h\/2 + hotmount_h_offset])\n {\n \/*cubea([house_w\/2, hotmount_outer_size, hotend_mount_h], align=[-1,0,-1], extrasize=[guidler_mount_w\/2,0,-hotmount_h_offset], extrasize_align=[1,-1,1]);*\/\n cubea([house_w, hotmount_outer_size, hotend_mount_h], align=[0,0,-1]);\n }\n\n }\n\n hull()\n {\n \/\/ main house\n translate([0,bolt_center_offset,0])\n {\n \/*rotate([0,90,0])*\/\n \/*cylindera(h=house_w, d=house_d);*\/\n cubea(size=[house_w, house_d, house_h], align=[0,0,0]);\n }\n\n \/\/ guidler screws mount\n translate([0, guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n cubea([house_w, guidler_screws_mount_d, house_guidler_screw_h], align=[0,0,0]);\n\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), 0, 0])\n rotate([0,90,90])\n cylindera(d=house_guidler_screw_h, h=guidler_screws_mount_d);\n }\n\n \/\/ mount onto xcarriage\n translate([0,0,0])\n translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])\n cubea([xcarriage_mount_w,xcarriage_mount_d,xcarriage_mount_h],[0,-1,0]);\n\n \/*translate([0, house_offset_xcarriage_y, house_offset_xcarriage_z])*\/\n \/*cubea([xcarriage_mount_w,house_offset_xcarriage_y,xcarriage_mount_h],[0,-1,0]);*\/\n }\n\n translate([0,bolt_center_offset,0])\n translate([0,motor_offset_y,motor_offset_z])\n {\n difference()\n {\n slide_dist=4;\n union()\n {\n \/\/ front mount plate for motor\n translate([-house_w\/2,0,0])\n {\n cubea([extruder_motor_mount_thickness, extruder_motor_side+slide_dist, extruder_motor_side],[1,0,0]);\n\n \/\/ back mount plate for motor\n translate([extruder_motor_length,0,0])\n cubea([extruder_motor_mount_thickness, extruder_motor_side+slide_dist, extruder_motor_side],[1,0,0]);\n }\n }\n\n translate([-extruder_motor_mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(extruder_motor_mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n }\n\n \/\/ guidler mount\n extruder_guidler_mount();\n }\n\n translate([0,bolt_center_offset,0])\n translate([0,motor_offset_y,motor_offset_z])\n {\n slide_dist=4;\n cubea([extruder_motor_length, extruder_motor_side+slide_dist, extruder_motor_side],[1,0,0]);\n\n translate([-extruder_motor_mount_thickness-1,0,0])\n rotate([90,90,90])\n linear_extrude(extruder_motor_mount_thickness+2)\n stepper_motor_mount(17, slide_distance=4, mochup=false);\n }\n\n \/\/ guidler screws cutouts\n for(i=[-1,1])\n translate([i*(guidler_screws_distance), guidler_screws_mount_d_offset, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2 * 1.1;\n cubea([r*2, guidler_screws_mount_d+1, r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n cylindera(r=r,h=guidler_screws_mount_d+1);\n }\n\n \/\/ guidler screw nuts drop-in slots\n translate([0,0, -r*2])\n cubea([nut_m3[1]*1.1,nut_m3[2]*1.25,house_guidler_screw_h], align=[0,0,1], extrasize=[0,0,1], extrasize_align=[0,0,1]);\n }\n\n \/\/ filament path ptfe line cutout\n cylindera(d=filament_path_d, h=50, align=[0,0,0]);\n\n translate([0,0,-house_h\/2+hotmount_h_offset])\n {\n hotmount_cutout(extend_cut=true);\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=house_w+1);\n }\n\n translate([house_w\/2 * (hotmount_clamp_side), 0, -hotmount_d_h[0][1]-hotmount_d_h[1][1]\/2])\n {\n cubea([hotmount_clamp_thickness+0.2, hotmount_clamp_y+0.2, hotmount_clamp_height+0.2], align=[-hotmount_clamp_side,0,0], extrasize=[1,0,0], extrasize_align=[hotmount_clamp_side,0,0]);\n }\n }\n\n \/\/ cutout pivot to make sure guidler can rotate out\n guidler_pivot_r=pythag_hyp(abs(guidler_mount_off_d),abs(guidler_mount_off_h))+(guidler_bearing[1])\/2;\n difference()\n {\n union()\n {\n \/*translate([-house_inner_w\/2,0,0])*\/\n \/*translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])*\/\n \/*rotate([0,90,0])*\/\n \/*pie_slice(guidler_pivot_r*1.05, 120, 180, house_inner_w, $fn=50);*\/\n\n translate([-house_inner_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n\n translate([guidler_mount_w\/2,0,0])\n translate([0,extruder_guidler_mount_off_y, guidler_mount_off_h])\n rotate([0,90,0])\n pie_slice(guidler_mount_d\/2*1.25, 0, 180, house_inner_w\/2 - guidler_mount_w\/2, $fn=50);\n }\n\n extruder_guidler_mount();\n }\n\n \/\/ cutout inside main house for guidler\n guidler_pivot_r=pythag_hyp(guidler_mount_off_d,guidler_mount_off_h);\n translate([-house_inner_w\/2,-guidler_bearing[1]\/2, 0])\n {\n rotate([0,90,0])\n {\n pie_slice(r=guidler_bearing[1]\/2*1.02, start_angle=0, end_angle=360, h=house_inner_w);\n }\n }\n\n \/*translate([0,-guidler_bearing[1]\/2,0])*\/\n \/*rotate([0,90,0])*\/\n \/*cylindera(d=guidler_bearing[1]*1.05, h=house_inner_w);*\/\n\n translate([0,bolt_center_offset,0])\n {\n \/\/ left bearing\n translate([-house_w\/2-2*e,0,0])\n rotate([90,0,90])\n cylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,1]);\n\n \/\/ right bearing\n translate([house_w\/2+2*e,0,0])\n rotate([90,0,90])\n cylindera(d=house_bearing[1]*1.02, h=house_bearing[2], align=[0,0,-1]);\n\n \/\/ hobbed bolt\n rotate([90,0,90])\n cylindera(d=8.5, h=house_w+1);\n }\n\n \/\/ guidler mount bolt hole\n translate([0,guidler_mount_off_d-guidler_bearing[1]\/2, guidler_mount_off_h])\n rotate([0,90,0])\n cylindera(r=screw_m3[0],h=guidler_w+1);\n }\n\n if(show_filament)\n {\n \/\/ filament\n cylindera(d=filament_d, h=50);\n }\n\n \/*translate([0,0,-house_h\/2])*\/\n}\n\nmodule hotmount_cutout(extend_cut=false)\n{\n \/\/ cutout of j-head\/e3d heatsink mount\n heights=vec_i(hotmount_d_h,1);\n for(e=v_itrlen(hotmount_d_h))\n {\n hs=v_sum(heights,e);\n translate([0,0,-hs])\n {\n d=hotmount_d_h[e][0]*hotmount_tolerance;\n h=hotmount_d_h[e][1]*hotmount_tolerance;\n cylindera(d=d,h=h,align=[0,0,1]);\n if(extend_cut)\n {\n cubea([house_w\/2+1,d,h],align=[hotmount_clamp_side,0,1]);\n }\n }\n }\n}\n\nmodule hotmount_clamp()\n{\n difference()\n {\n union()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([hotmount_clamp_thickness, hotmount_clamp_y, hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n difference()\n {\n translate([house_w\/2 * hotmount_clamp_side, 0, 0]);\n {\n cubea([house_w\/2, hotmount_d_h[1][0], hotmount_clamp_height], align=[-hotmount_clamp_side,0,0]);\n }\n\n translate([(-house_w\/2 * hotmount_clamp_side) + (-0.5*hotmount_clamp_side), 0, hotmount_d_h[0][1]+hotmount_d_h[1][1]\/2])\n {\n hotmount_cutout(extend_cut = false);\n }\n }\n\n }\n\n \/\/ clamp mount screw holes\n for(i=[-1,1])\n {\n translate([0, i*hotmount_clamp_screws_dist, 0])\n rotate([0,90,0])\n cylindera(r=screw_m3[0], h=hotmount_clamp_thickness, align=[0,0,-hotmount_clamp_side], extra_h=1);\n }\n }\n}\n\n\/\/ guidler connection point\nguidler_conn = [ [0, guidler_mount_off_d, guidler_mount_off_h], [1,0,0]];\n\nmodule guidler()\n{\n \/\/ everything inside this module is relative to the center of the \n \/\/ bearing (that clamps the filament)\n color(color_guidler)\n difference()\n {\n union()\n {\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0]);\n\n \/\/ guidler bearing bolt holder\n rotate([0,90,0])\n cylindera(d=guidler_bearing[0]*1.5,h=guidler_w);\n }\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, 0])\n cubea([guidler_w, guidler_d, guidler_h], align=[0,1,0], extrasize=[0,0,guidler_extra_h_up], extrasize_align=[0,0,1]);\n\n \/\/ guidler mount point\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n cylindera(d=guidler_mount_d,h=guidler_w);\n }\n\n hull()\n {\n \/\/ guidler main block\n translate([0,guidler_mount_off_d-guidler_mount_d\/2, guidler_h])\n cubea([guidler_w, guidler_d, 1], align=[0,1,0]);\n\n \/\/ guidler screws mount\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n rotate([0,90,90])\n cylindera(r=guidler_screws_thread_dia\/2*3,h=guidler_d, align=[0,0,1]);\n\n }\n }\n\n \/\/ cutouts for clamping screws\n for(i=[-1,1])\n translate([i*(guidler_screws_distance),guidler_mount_off_d-guidler_mount_d\/2, house_guidler_screw_h_offset])\n {\n r= guidler_screws_thread_dia\/2*1.1;\n cubea([r*2,house_w+1,r]);\n for(v=[-1,1])\n translate([0,0, v*r\/2])\n {\n rotate([0,90,90])\n cylindera(r=r,h=house_w+1);\n }\n }\n\n \/\/ port hole to see bearing\n translate([0,-guidler_bearing[1]\/2,0])\n cubea([guidler_bearing[0]*1.1, 100, guidler_bearing[1]\/2], align=[0,0,1]);\n\n \/\/ cutout middle mount point pivot\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n {\n cylindera(d=guidler_mount_d*1.25,h=guidler_mount_w*1.1);\n }\n\n \/\/ mount bolt hole\n translate([0,guidler_mount_off_d, guidler_mount_off_h])\n rotate([0,90,0])\n cylindera(r=screw_m3[0],h=100);\n\n \/\/ guidler bearing bolt holder cutout\n union() {\n cubea([guidler_bolt_h*1.05+2*e,guidler_bearing[0]*1.05,guidler_bearing[0]*1.05],align=[0,1,0]);\n\n rotate([0,90,0])\n cylindera(d=guidler_bearing[0]*1.05, h=guidler_bolt_h*1.05);\n }\n\n \/\/ guidler bearing cutout\n rotate([0,90,0])\n cylindera(d=guidler_bearing[1]*1.1, h=guidler_bearing[2]*1.1);\n }\n\n\n %if(show_extras)\n {\n rotate([0,90,0])\n {\n cylindera(d=guidler_bearing[1], h=guidler_bearing[2]);\n cylindera(d=guidler_bearing[0], h=guidler_bolt_h);\n }\n }\n}\n\n\nmodule extras()\n{\n hob_offset_x = -5*mm;\n\n \/\/ hobbed bolt\n \/\/ measurements from\n \/\/ http:\/\/wiki.e3d-online.com\/wiki\/E3D_HobbGoblin_Drawings\n hob_l = 64.5*mm;\n\n \/\/ center of the hob (from left side)\n hob_center = 37*mm;\n\n hob_conn_extruder=[[-hob_l\/2+hob_center,0,0], [0,0,0]];\n\n attach([[0,bolt_center_offset,0],[0,0,0]], hob_conn_extruder)\n {\n \/*connector(hob_conn_extruder);*\/\n\n \/\/ hob-goblin hobbed bolt\n union()\n {\n thread_left = 20.5;\n thread_right = 14;\n hob_width = 4.2;\n color([0.1,0.2,0.3])\n translate([-hob_l\/2,0,0])\n rotate([0,90,0])\n cylindera(h=thread_left, d=8, align=[0,0,1]);\n\n color([0.6,0.6,0.6])\n difference()\n {\n translate([-hob_l\/2+thread_left,0,0])\n rotate([0,90,0])\n cylindera(h=hob_l-thread_left-thread_right, d=8, align=[0,0,1]);\n\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n cylindera(h=hob_width, d=8.1);\n }\n color([0.6,0.2,0.3])\n translate([-hob_l\/2+hob_center,0,0])\n rotate([0,90,0])\n cylindera(h=hob_width, d=7);\n\n color([0.1,0.2,0.3])\n translate([hob_l\/2-thread_right,0,0])\n rotate([0,90,0])\n cylindera(h=thread_right, d=8, align=[0,0,1]);\n\n \/*rotate([0,90,0])*\/\n \/*cylindera(h=hob_l, d=8);*\/\n\n \/*translate([-hob_l\/2+hob_center,0,0])*\/\n \/*rotate([0,90,0])*\/\n \/*cylindera(h=hob_width, d=8.1);*\/\n\n }\n\n hob_conn_cog = [[-hob_l\/2 + 13*mm,0,0], [-1,0,0]];\n\n \/*connector(hob_conn_cog);*\/\n \/\/ gear\/cog\n \/\/ attach onto hobbed bolt\n cog_conn = [[11*mm,0,0],[1,0,0]];\n attach(hob_conn_cog, cog_conn, 019)\n {\n rotate([270,0,90])\n import(\"stl\/gt2_extruder_cog_80tooth.stl\");\n }\n }\n\n \/\/ motor\/belt\n translate([-1,bolt_center_offset,0])\n translate([-house_w\/2+extruder_motor_mount_thickness,motor_offset_y,motor_offset_z])\n {\n \/\/ main motor body\n motor(extruder_motor, extruder_motor_type, dualAxis=false, orientation=[0,90,0]);\n\n translate([-1,0,0])\n rotate([0,0,180])\n import(\"stl\/GT2_20tooth.stl\");\n }\n\n \/\/ hotend\n hotend_conn =[[0,0,21.35*mm],[0,0,1]];\n attach(extruder_conn_hotend, hotend_conn)\n color(color_hotend)\n rotate([90,0,270])\n import(\"stl\/E3D_V6_1.75mm_Universal_HotEnd_Mockup.stl\");\n\n \/\/ x carriage\n xcarriage_conn =[[-0.4,-8.5,-1],[0,-1,0]];\n attach(extruder_conn_xcarriage, xcarriage_conn)\n {\n \/*connector(xcarriage_conn);*\/\n color(color_xcarriage)\n translate([282*mm,-170,14])\n rotate([90,180,180])\n import(\"..\/wilson\/x-carriage.stl\");\n }\n}\n\nmodule extruder()\n{\n extruder_own();\n\n attach(extruder_conn_guidler, guidler_conn, extruder_guidler_roll)\n {\n guidler(show_extras=true);\n }\n\n attach(extruder_conn_hotmount_clamp, hotmount_clamp_conn)\n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); }\n\n if(true) { extras(); } }\n\nmodule print() \n{\n extruder_conn_layflat = [[-house_w\/2,0,0],[-1,0,0]];\n attach([[0,0,0],[0,0,-1]], extruder_conn_layflat)\n {\n \/*connector(extruder_conn_layflat);*\/\n extruder_own(false,false); \n }\n\n guidler_conn_layflat = [ [0, guidler_mount_off_d-guidler_mount_d\/2, guidler_mount_off_h], [0,-1,0]]; attach([[34*mm,10*mm,0],[0,0,-1]], guidler_conn_layflat)\n {\n \/*connector(guidler_conn_layflat);*\/\n guidler(false); \n }\n\n hotmount_clamp_conn_layflat=[[0,0,0],[-1,0,0]];\n attach([[54*mm,0,0],[0,0,1]], hotmount_clamp_conn_layflat) \n {\n \/*connector(hotmount_clamp_conn);*\/\n hotmount_clamp(); \n }\n}\n\n\/*extruder();*\/\n\/*print();*\/\n\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"cd2193629b5f71d7fda0e2f6ffdc577463ee3ee3","subject":"convert to actual angle beams for floor frame","message":"convert to actual angle beams for floor frame\n","repos":"Mr-What\/Sleipnir,Mr-What\/Sleipnir,Mr-What\/Sleipnir","old_file":"Drawings\/steel\/walkerChassis.scad","new_file":"Drawings\/steel\/walkerChassis.scad","new_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) color([.2,.2,.8,1]) mainBar();\n #translate([0,0,a*(zBar+20)]) rotate([0,90*(a+1),0]) outerCap();\n}\nbasket();\n\nmodule basket() {\n for(a=[-1,1]) {\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,.6]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n \/\/color([.6,.8,0,1]) \n translate([loX*a,loY,0]) difference() { \n cube([2.5,2.5,230],center=true); \/\/ lower rails\n\n \/\/ remove center section for wide platform version\n cube([3,3,66],center=true);\n }\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([20*b,loY+2,70*a]) sphere(1);\n }\n }\n\n for(x=[-1,1]) {\n hull() { \/\/ inner back trap\n translate([x*35,loY+4,22*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*35,loY+2,31*a]) sphere(1);\n translate([x*Bx, 0 ,60*a]) sphere(1);\n }\n }\n\n \/\/ may do something more complicated for payload bay,\n \/\/ but for now, just stich sides together\n translate([a*(Bx+2),2,0]) cube([3.8,3.8,140],center=true);\n\n translate([34*a,loY+2.7,0]) difference() {\n cube([2.5,2.5,138],center=true);\n translate([-.4*a,.4,0]) cube([2.5,2.5,139],center=true);\n }\n translate([0,loY+3,67*a]) rotate([0,90*(a+1),0]) difference() {\n cube([70,3.8,3.8],center=true);\n translate([0,.4,.4]) cube([72,3.8 ,3.8],center=true);\n }\n hull() { \/\/ central floor cross\n translate([ 34*a,loY+1, 32]) sphere(1);\n translate([-34*a,loY+1,-32]) sphere(1);\n }\n }\n\n \/\/for(z=[-1,0,1])\n for(z=[-1,1])\n translate([0,loY+.4,34*z]) rotate([0,(z==1)?180:0,0]) difference() {\n cube([70,2.5,2.5],center=true);\n translate([0,-.4,-.4]) cube([71,2.5,2.5],center=true);\n }\n translate([0,loY+2,0]) rotate([90,0,0]) cylinder(r=4,h=.4,$fn=32);\n color([0,.2,.8,.2]) \/\/ expanded mesh floor\n translate([0,loY+2,0]) cube([68,.5,134],center=true);\n \/\/translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n \/\/ lower support\n for(x=[-1,1]) {\n \/\/ lower rail tubes\n translate([x*loX,loY,0]) cube([3.8,3.8,10],center=true);\n\n hull() { \/\/ diagonals\n translate([x*(loX+2),loY,0]) sphere(1);\n translate([x*(Bx-8),0,0]) sphere(1);\n }\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n}\n\nmodule outerCap() {\n for (b=[-1,1]) translate([Bx*b,0,-1]) {\n \/\/ axle brace sleves... shorter on outside\n cylinder(r=2.5,h=6 ,$fn=16,center=true);\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n for(x=[-1,1]) translate([x*loX,loY,1])\n cube([3.8,3.8,8],center=true); \/\/ lower rail sleves\n\n for (b=[-1,1]) hull() { \/\/ outside diagonal brace\n translate([loX*b,loY,0]) sphere(1);\n translate([ Bx*b, 0 ,0]) sphere(1);\n }\n hull() for(b=[-1,1]) translate([Bx*b,0,0]) sphere(1);\n}\n\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","old_contents":"\/\/ config e\nAy=3.318;\nAC=17.5;\nBx=53.83;\n\nloY=-60; \/\/ location of lower brace beams\nloX= 10;\n\nzBar=90;\n\n$fn=8;\n\nfor (a=[-1,1]) {\n %translate([0,0,(zBar-10)*a]) legProxy();\n %translate([0,0,(zBar+10)*a]) legProxy();\n translate( [0,0, zBar *a]) color([.2,.2,.8,1]) mainBar();\n #translate([0,0,a*(zBar+20)]) rotate([0,90*(a+1),0]) outerCap();\n}\nbasket();\n\nmodule basket() {\n for(a=[-1,1]) {\n %translate([Bx*a,0,0]) cylinder(r=1,h=120,$fn=16,center=true); \/\/ main axle\n for (b=[-1,1]) translate([Bx*b,0,zBar*a]) {\n color([0,0,1,.6]) translate([0,0,-6*a])\n cylinder(r=1.9,h=60,$fn=16,center=true); \/\/ axle\n\n \/\/ axle brace sleves\n translate([0,0,-26*a]) cylinder(r=2.5,h=18,$fn=16,center=true);\n }\n\n \/\/color([.6,.8,0,1]) \n translate([loX*a,loY,0]) difference() { \n cube([2.5,2.5,230],center=true); \/\/ lower rails\n\n \/\/ remove center section for wide platform version\n cube([3,3,66],center=true);\n }\n\n hull() for (b=[-1,1]) translate([ Bx*b, 0 ,71*a]) sphere(1); \/\/ arm guard bar\n \/\/hull() for (b=[-1,1]) translate([loX*b,loY,71*a]) sphere(1); \/\/ outer foot bar\n for (b=[-1,1]) {\n hull() { \/\/ outer diagonal\n translate([ Bx*b, 0 ,70*a]) sphere(1);\n translate([20*b,loY+2,70*a]) sphere(1);\n }\n }\n\n for(x=[-1,1]) {\n hull() { \/\/ inner back trap\n translate([x*35,loY+4,22*a]) sphere(1);\n translate([x*Bx, 0 , 5*a]) sphere(1);\n }\n hull() { \/\/ outer back\n translate([x*35,loY+2,31*a]) sphere(1);\n translate([x*Bx, 0 ,60*a]) sphere(1);\n }\n }\n\n *hull() { \/\/ center foot low diag\n translate([ loX,loY, 5*a]) sphere(1);\n translate([-loX,loY,30*a]) sphere(1);\n }\n *hull() {\n translate([-loX,loY,40*a]) sphere(1);\n translate([ loX,loY,70*a]) sphere(1);\n }\n *for (b=[-1,1]) hull() { \/\/ outer low X\n translate([-loX*b,loY,130*a]) sphere(1);\n translate([ loX*b,loY, 70*a]) sphere(1);\n }\n\n \/\/ may do something more complicated for payload bay,\n \/\/ but for now, just stich sides together\n translate([a*(Bx+2),2,0]) cube([3.8,3.8,140],center=true);\n\n translate([34*a,loY+6,0]) cube([2.5,2.5,138],center=true);\n translate([0,loY+3,67*a]) cube([70,3.8 ,3.8],center=true);\n }\n\n for(z=[-1,0,1]) translate([0,loY+3,34*z])\n cube([70,2.5,2.5],center=true);\n color([0,.2,.8,.2]) \/\/ expanded mesh floor\n translate([0,loY+5,0]) cube([68,.5,130],center=true);\n \/\/translate([0,loY+2,0]) cube([2*loX,1,130],center=true);\n}\n\nmodule mainBar() {\n cube([110,5,5],center=true);\n translate([0,Ay,0]) {\n cylinder(r=1.5,h=4,$fn=16,center=true);\n #cylinder(r=AC,h=2,$fn=36,center=true);\n \/\/cylinder(r=AC+2,h=.4,$fn=36,center=true);\n }\n\n \/\/ lower support\n for(x=[-1,1]) {\n \/\/ lower rail tubes\n translate([x*loX,loY,0]) cube([3.8,3.8,10],center=true);\n\n hull() { \/\/ diagonals\n translate([x*(loX+2),loY,0]) sphere(1);\n translate([x*(Bx-8),0,0]) sphere(1);\n }\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n}\n\nmodule outerCap() {\n for (b=[-1,1]) translate([Bx*b,0,-1]) {\n \/\/ axle brace sleves... shorter on outside\n cylinder(r=2.5,h=6 ,$fn=16,center=true);\n }\n translate([0,loY,0]) cube([2*loX,3.8,3.8],center=true);\n for(x=[-1,1]) translate([x*loX,loY,1])\n cube([3.8,3.8,8],center=true); \/\/ lower rail sleves\n\n for (b=[-1,1]) hull() { \/\/ outside diagonal brace\n translate([loX*b,loY,0]) sphere(1);\n translate([ Bx*b, 0 ,0]) sphere(1);\n }\n hull() for(b=[-1,1]) translate([Bx*b,0,0]) sphere(1);\n}\n\nmodule legProxy() scale([1,1,12]) {\n legProxy1();\n mirror([1,0,0]) legProxy1();\n}\n\n\/\/ measurements from drawing, center pixel 600,300, 4 pixels\/cm\nmodule legProxy1() {\n\n hull() {\n translate([0,3.32,0]) cylinder(r=17.5+2,h=1,$fn=36,center=true);\n translate([-250\/4, 290\/4,0]) node();\n translate([-200\/4, 290\/4,0]) node();\n translate([-360\/4, 120\/4,0]) node();\n translate([-500\/4,-110\/4,0]) node();\n translate([-430\/4,-230\/4,0]) node();\n }\n hull() {\n translate([-400\/4,-220\/4 ,0]) node();\n translate([-340\/4,-370\/4+2,0]) node();\n translate([ -90\/4,-370\/4+2,0]) node();\n translate([-140\/4,-120\/4 ,0]) node();\n }\n}\n\nmodule node() cylinder(r=2,h=1,$fn=9,center=true);","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e02ed97b085b14b1a3b5c0b9c074b907570822ea","subject":"thicken frame","message":"thicken frame\n","repos":"jaw0\/minicopter","old_file":"cad\/frame.scad","new_file":"cad\/frame.scad","new_contents":"\/\/ Copyright (c) 2015\n\/\/ Author: Jeff Weisberg \n\/\/ Created: 2015-Oct-04 22:32 (EDT)\n\/\/ Function: frame for mini-copter\n\n\nshow_env = 0;\n\npcb_x = 25.0;\npcb_y = 25.0;\npcb_z = 1.6;\n\npeg_pos = 1.25;\t\/\/ in from corner\nprop_x = 56.0;\t\/\/ prop diam plus margin\nmot_z = 10.0; \t\/\/ ht of center of motor\nmotor_phi = 5.0;\t\/\/ slight dihedral\nmotor_diam = 7;\n\n\n\/\/################################################################\n\nmot_pos = (prop_x - pcb_x) \/ 2;\nmot_armang = atan( (mot_z + 2) \/ (mot_pos + peg_pos) \/ sqrt(2) );\n\n$fn = 64;\n$fa = .5;\n$fs = 0.05;\n\n\/\/################################################################\n\nmodule vcyl(x,y,z,diam1, diam2, len){\n translate([x,y,z])\n cylinder(r1=diam1\/2, r2=diam2\/2, h=len);\n}\n\nmodule hcyl(x,y,z,diam1, diam2, len){\n translate([x,y,z])\n rotate([0,90,0])\n cylinder(r1=diam1\/2, r2=diam2\/2, h=len);\n}\n\nmodule box(x,y,z, dx,dy,dz){\n translate([x, y, z]) cube([dx, dy, dz]);\n}\n\n\nmodule proparm(){\n\n \/\/ board support+attach\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, 0]) rotate([0,0,45]){\n vcyl(0,0,-4, 3.5, 3.5,4);\n \/\/ slightly tapered pins\n vcyl(0,0,-.1, 1.0, 0.85, 2.1);\n box(-3.5,-.5,-1.5, 4,1,1.5);\n box( -.5,-.5,-1.5, 1,4,1.5);\n\n }\n\n \/\/ legs\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, -3.0]) rotate([0,30,0]){\n\n intersection(){\n union(){\n box(0,-1.5,2.0, 25, 3, 1);\n rotate([0,-3,0]) box(0,-.5,0, 25, 1, 3);\n }\n box(0,-1.5,-1, 25, 3, 4);\n hcyl(0,0,2.5, 5.3,2.25, 25);\n }\n translate([25,0,1.25]) sphere(2.0);\n }\n\n difference(){\n union(){\n \/\/ motor arms\n intersection(){\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, -2.0]) rotate([0,-mot_armang,0]) {\n box(0, -1.5, 0, (mot_pos+peg_pos)*sqrt(2) \/ cos(mot_armang), 3.0,1 );\n box(0,-.5, -2, (mot_pos+peg_pos)*sqrt(2) \/ cos(mot_armang), 1,3.0 );\n }\n \/\/ clean up the bottom\n box(-5,-5,-4, 60,60,60);\n }\n \/\/ motor mounts\n translate([prop_x\/2 * sqrt(2),0, mot_z]) rotate([0,-motor_phi,0]){\n vcyl(0,0,-3.5, motor_diam+2, motor_diam+2, 6.5 );\n\n \/\/ prop\n if( show_env ) color([.75,0,.75,1]) vcyl(0,0,5, 45, 45, 5);\n }\n\n }\n union(){\n \/\/ hole for motor\n translate([prop_x\/2 * sqrt(2),0, mot_z]) rotate([0,-motor_phi,0]){\n vcyl(0,0,-5, motor_diam-.5, motor_diam-.5, 9 );\n rotate([0,0,90]) box(motor_diam\/2-2, -.5,-5, 5,1,9);\n }\n }\n }\n}\n\nmodule cage(){\n \/\/ outer box\n difference(){\n union(){\n box( 28\/2+.5, -28\/2-2, -2.0, 2.0, 28+4, 4.0);\n box( 28\/2-.5, -28\/2-2, -1.0, 2.0, 28+4, 2.0);\n }\n \/\/ clean up\/bevel the corners\n union(){\n for(a = [-45, 45]){\n rotate([0,0,a])\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, 0])\n rotate([0,-mot_armang,0])\n box(-2,-4,-6.1, 8,8,2);\n }\n }\n }\n \/\/ rubber band attachment pegs\n hcyl(28\/2+.5, -6, 0, 2,2,5);\n hcyl(28\/2+.5, 6, 0, 2,2,5);\n hcyl(28\/2+.5, -2, 0, 2,2,5);\n hcyl(28\/2+.5, 2, 0, 2,2,5);\n\n}\n\n\n\/\/ ################################################################\n\nif( show_env ) color([.75,0,.75, 1]) box(-pcb_x\/2, -pcb_y\/2, 0, pcb_x, pcb_y, pcb_z);\n\nfor( angle = [ 0 : 90 : 270 ] ){\n rotate([0,0,45+angle]) proparm();\n\n \/\/ outer cage\n rotate([0,0,angle]) translate([0,0,.4]) cage();\n\n}\n\n\n\n\n","old_contents":"\/\/ Copyright (c) 2015\n\/\/ Author: Jeff Weisberg \n\/\/ Created: 2015-Oct-04 22:32 (EDT)\n\/\/ Function: frame for mini-copter\n\n\nshow_env = 0;\n\npcb_x = 25.0;\npcb_y = 25.0;\npcb_z = 1.6;\n\npeg_pos = 1.25;\t\/\/ in from corner\nprop_x = 56.0;\t\/\/ prop diam plus margin\nmot_z = 10.0; \t\/\/ ht of center of motor\nmotor_phi = 5.0;\t\/\/ slight dihedral\nmotor_diam = 7;\n\n\n\/\/################################################################\n\nmot_pos = (prop_x - pcb_x) \/ 2;\nmot_armang = atan( (mot_z + 2) \/ (mot_pos + peg_pos) \/ sqrt(2) );\n\n$fn = 0;\n$fa = .5;\n$fs = 0.05;\n\n\/\/################################################################\n\nmodule vcyl(x,y,z,diam1, diam2, len){\n translate([x,y,z])\n cylinder(r1=diam1\/2, r2=diam2\/2, h=len);\n}\n\nmodule hcyl(x,y,z,diam1, diam2, len){\n translate([x,y,z])\n rotate([0,90,0])\n cylinder(r1=diam1\/2, r2=diam2\/2, h=len);\n}\n\nmodule box(x,y,z, dx,dy,dz){\n translate([x, y, z]) cube([dx, dy, dz]);\n}\n\n\nmodule proparm(){\n\n \/\/ board support+attach\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, 0]) rotate([0,0,45]){\n vcyl(0,0,-3, 3, 3,3);\n \/\/ slightly tapered pins\n vcyl(0,0,-.1, 1.0, 0.7, 2.1);\n box(-3.5,-.5,-1.5, 4,1,1.5);\n box( -.5,-.5,-1.5, 1,4,1.5);\n\n }\n\n \/\/ legs\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, -3.0]) rotate([0,30,0]){\n intersection(){\n box(0,-1,0, 15,2,1.5);\n hcyl(0,0,1, 2, 1, 15);\n }\n translate([15,0,.5]) sphere(1.0);\n }\n\n difference(){\n union(){\n \/\/ motor arms\n intersection(){\n translate([ (pcb_x\/2-peg_pos)*sqrt(2), 0, -2.0]) rotate([0,-mot_armang,0]) {\n box(0, -1.4, 0, (mot_pos+peg_pos)*sqrt(2) \/ cos(mot_armang), 2.8,1 );\n box(0,-.5, -1.5, (mot_pos+peg_pos)*sqrt(2) \/ cos(mot_armang), 1,2.5 );\n }\n \/\/ clean up the bottom\n box(-5,-5,-3, 60,60,60);\n }\n \/\/ motor mounts\n translate([prop_x\/2 * sqrt(2),0, mot_z]) rotate([0,-motor_phi,0]){\n vcyl(0,0,-3.25, motor_diam+2, motor_diam+2, 6.5 );\n\n \/\/ prop\n if( show_env ) color([.75,0,.75,1]) vcyl(0,0,5, 45, 45, 5);\n }\n\n }\n union(){\n \/\/ hole for motor\n translate([prop_x\/2 * sqrt(2),0, mot_z]) rotate([0,-motor_phi,0]){\n vcyl(0,0,-5, motor_diam-.5, motor_diam-.5, 9 );\n rotate([0,0,90]) box(motor_diam\/2-2, -.5,-5, 5,1,9);\n }\n }\n }\n}\n\nmodule cage(){\n \/\/ outer box\n box(-28\/2-1.5, 28\/2+.5, -1.25, 28+3, 1.0,2.5);\n box(-28\/2-1.5, 28\/2-.5, -.5, 28+3, 2.0,1.0);\n\n \/\/ rubber band attachment pegs\n hcyl(28\/2+.5, -6, 0, 2,2,3);\n hcyl(28\/2+.5, 6, 0, 2,2,3);\n hcyl(28\/2+.5, -2, 0, 2,2,3);\n hcyl(28\/2+.5, 2, 0, 2,2,3);\n}\n\n\n\/\/ ################################################################\n\nif( show_env ) color([.75,0,.75, 1]) box(-pcb_x\/2, -pcb_y\/2, 0, pcb_x, pcb_y, pcb_z);\n\nfor( angle = [ 0 : 90 : 270 ] ){\n rotate([0,0,45+angle]) proparm();\n\n \/\/ outer cage\n rotate([0,0,angle]) translate([0,0,.60]) cage();\n\n}\n\n\n\n\n","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"408aedc12111b136a7a53c1ae98f3fe8c2712893","subject":"Updated motor ribbon cable positions","message":"Updated motor ribbon cable positions\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/Wheel.scad","new_file":"hardware\/assemblies\/Wheel.scad","new_contents":"\/*\n\tAssembly: WheelAssembly\n\tCombined motor and wheel assembly\n\n\tLocal Frame:\n\t\tPlaces the motor default connector at the origin - i.e. use the motor default connector for attaching into a parent assembly\n\n*\/\n\n\/\/ Connectors\nWheel_Con_Default\t\t\t\t= [ [0, 0 ,0], [0, 0, 1], 90, 0, 0 ];\n\n\nmodule WheelAssembly( ) {\n\n assembly(\"assemblies\/Wheel.scad\", \"Drive Wheel\", str(\"WheelAssembly()\")) {\n\n if (DebugCoordinateFrames) frame();\n\n \/\/ debug connectors?\n if (DebugConnectors) {\n\n }\n\n \/\/ Vitamins\n logo_motor();\n\n \/\/ ribbon Cable :)\n if ($rightSide) {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [2.5, -23, 7],\n [10, -60, 10],\n [70, -15, 20],\n [26, -8, 25]\n ],\n vectors = [\n [-1, 0 ,0],\n [-0.5, 0.5, 1],\n [-0.5, 0, 1],\n [0, 0, 1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n\n\n } else {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [-2.5, -23, 7],\n [10, -60, 10],\n [70, -20, 40],\n [26, -8, 18]\n ],\n vectors = [\n [1, 0 ,0],\n [0.5, 0.5, -1],\n [-0.5, 0.5, -1],\n [0, 0,-1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n }\n\n \/\/ STL\n step(1, \"Push the wheel onto the motor shaft \\n**Optional:** add a rubber band to the wheel for extra grip.\") {\n view(t=[0, -3, 5], r=[349,102,178], d=500);\n\n attach(Wheel_Con_Default, [[0,0,2],[0,0,-1],0,0,0], ExplodeSpacing=20)\n Wheel_STL();\n }\n\t}\n}\n","old_contents":"\/*\n\tAssembly: WheelAssembly\n\tCombined motor and wheel assembly\n\t\n\tLocal Frame: \n\t\tPlaces the motor default connector at the origin - i.e. use the motor default connector for attaching into a parent assembly\n\n*\/\n\n\/\/ Connectors\nWheel_Con_Default\t\t\t\t= [ [0, 0 ,0], [0, 0, 1], 90, 0, 0 ];\n\n\nmodule WheelAssembly( ) {\n\n assembly(\"assemblies\/Wheel.scad\", \"Drive Wheel\", str(\"WheelAssembly()\")) {\n \n if (DebugCoordinateFrames) frame();\n \n \/\/ debug connectors?\n if (DebugConnectors) {\n \n }\n \n \/\/ Vitamins\n logo_motor();\n \n \/\/ ribbon Cable :)\n if ($rightSide) {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [2.5, -23, 7],\n [10, -60, 10],\n [20, -30,15],\n [26,0, 13]\n ],\n vectors = [\n [-1, 0 ,0],\n [-0.5, 0.5, 1],\n [-0.5, 0.5, 0],\n [0, 0,1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n \n \n } else {\n ribbonCable(\n cables=5,\n cableRadius = 0.6,\n points= [\n [-2.5, -23, 7],\n [10, -60, 10],\n [20, -30,25],\n [26,0, 30]\n ],\n vectors = [\n [1, 0 ,0],\n [0.5, 0.5, -1],\n [-0.5, 0.5, -1],\n [0, 0,-1]\n ],\n colors = [\n \"blue\",\n \"orange\",\n \"red\",\n \"pink\",\n \"yellow\"\n ],\n debug=false\n );\n }\n \n \/\/ STL\n step(1, \"Push the wheel onto the motor shaft \\n**Optional:** add a rubber band to wheel for extra grip.\") {\n view(t=[0, -3, 5], r=[349,102,178], d=500);\n\n attach(Wheel_Con_Default, [[0,0,2],[0,0,-1],0,0,0], ExplodeSpacing=20)\n Wheel_STL();\n }\n\t}\n}\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2667c53c3ee6b8c0f4e4b4b317da2d094487d92d","subject":"added gear.scad as a seperate file from gear library","message":"added gear.scad as a seperate file from gear library\n","repos":"wyolum\/Celeste,wyolum\/Celeste","old_file":"fabricate\/gears.scad","new_file":"fabricate\/gears.scad","new_contents":"include \n\n$fn=100;\nmm = 1;\ninch = 25.4 * mm;\n\nACRYLIC_THICKNESS = 6 * mm;\nACRYLIC_TOL = .5 * mm;\nPITCH = 360 * mm;\nN_TEETH = 6;\n\nPITCH_R = N_TEETH * PITCH \/ 360.;\nPITCH_D = 2 * PITCH_R;\nPRESSURE_ANGLE = 28;\nPITCH_DIAMETRIAL = N_TEETH \/ PITCH_D;\n\n\/\/ Addendum: Radial distance from pitch circle to outside circle.\nADDENDUM = 1\/PITCH_DIAMETRIAL;\n\n\/\/Outer Circle\nOUTER_RADIUS = PITCH_R+ADDENDUM;\n\nRIM_THICKNESS = 1 * mm;\nEXTRA_RIM_R = 3 * mm;\n\ndifference(){\n union(){\n gear (number_of_teeth=6,\n\t circular_pitch = PITCH,\n\t gear_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL,\n\t rim_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL,\n\t hub_thickness = ACRYLIC_THICKNESS + ACRYLIC_TOL,\n\t bore_diameter=0. * mm,\n\t circles=4,\n\t pressure_angle=28\n\t );\n translate([0, 0, -1*mm])cylinder(r=OUTER_RADIUS + EXTRA_RIM_R, h=RIM_THICKNESS);\n translate([0, 0, 6.5*mm])cylinder(r=OUTER_RADIUS, h=RIM_THICKNESS);\n }\n translate([0, 0, -1])cylinder(r=3mm, h=ACRYLIC_THICKNESS + ACRYLIC_TOL + 2);\n}\n\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'fabricate\/gears.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"79edc1b03a3ca13ae892a8df1e7b416684eb6e93","subject":"Sandbox for MicroSwitch","message":"Sandbox for MicroSwitch\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/sandbox\/MicroSwitchDev.scad","new_file":"hardware\/sandbox\/MicroSwitchDev.scad","new_contents":"\/*\n\n\tPlayground for vitamins\/MicroSwitch.scad\n\n*\/\n\ninclude <..\/config\/config.scad>\n\ninclude <..\/vitamins\/MicroSwitch.scad>\n\nmicroswitch();","old_contents":"","returncode":1,"stderr":"error: pathspec 'hardware\/sandbox\/MicroSwitchDev.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e73fe6f5d264b646eac4b5d976475e362af5ac8d","subject":"whole element is now completed","message":"whole element is now completed\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bike_flag_mount_btwin\/bike_flag_mount_btwin.scad","new_file":"bike_flag_mount_btwin\/bike_flag_mount_btwin.scad","new_contents":"use\nuse\n\neps = 0.01;\nd_stick = 6; \/\/ flag's stick diameter\nstick_hole_len = 40; \/\/ defines how deep stick goes into the form\nd_a = 7; \/\/ bottom hole (aka: hole A)\nd_b = 8; \/\/ top hole (aka: hole B)\na_b_distance = 10.5; \/\/ distance between A and B holes (edges! not the centers!)\nb_top_distance = 18; \/\/ distance from top of B hole to end of bike's frame (edge! not the center!)\n\nmount_len = d_a + a_b_distance + d_b + b_top_distance + 5;\nflag_stick_len = 150;\nbox_size = [ d_b*2.5, mount_len + flag_stick_len, d_b*2.5 ];\n\nmodule screw_holes(h, extra_d)\n{\n translate([0, d_a\/2+a_b_distance+d_b\/2, 0])\n cylinder(d=d_b+extra_d, h=h, $fn=fn(60));\n cylinder(d=d_a+extra_d, h=h, $fn=fn(60));\n}\n\nmodule bike_flag_mount()\n{\n difference()\n {\n rounded_cube(box_size, 3, $fn=fn(20));\n \/\/ screw mount cut\n {\n cut_size = [ box_size[0], mount_len + box_size[0]\/2, box_size[2]\/2];\n translate([-eps, -eps, box_size[2]\/2])\n cube(cut_size + eps*[2,1,1]);\n }\n \/\/ screw holes\n translate([box_size[0]\/2, box_size[0]\/2, -eps])\n screw_holes(h=box_size[2]+2*eps, extra_d=0.5);\n \/\/ main flag stick hole\n translate([box_size[0]\/2, box_size[1]-stick_hole_len, box_size[2]\/2])\n rotate([-90, 0, 0])\n cylinder(d=d_stick+0.5, h=stick_hole_len+eps, $fn=fn(70));\n \/\/ flag screw-in hole\n translate([box_size[0]\/2, box_size[1]-stick_hole_len+5, -eps])\n cylinder(d=3+0.5, h=box_size[2]+2*eps, $fn=fn(50));\n }\n}\n\nbike_flag_mount();\n","old_contents":"use\n\nd_stick = 6;\nd_a = 7; \/\/ bottom hole (aka: hole A)\nd_b = 8; \/\/ top hole (aka: hole B)\na_b_distance = 10.5; \/\/ distance between A and B holes (edges! not the centers!)\nb_top_distance = 18; \/\/ distance from top of B hole to end of bike's frame (edge! not the center!)\n\nmodule screw_holes(h, extra_d=0.5)\n{\n translate([0, d_a\/2+a_b_distance+d_b\/2, 0])\n cylinder(d=d_b+extra_d, h=h, $fn=fn(60));\n cylinder(d=d_a+extra_d, h=h, $fn=fn(60));\n}\n\ntranslate([-6\/2, 0, 0])\n cube([6, a_b_distance+d_a\/2+d_b+b_top_distance, 0.4]);\nscrew_holes(0.8, extra_d=0);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"729c6af5fa7dea15a1701b83026637e5fe67684b","subject":"lcd2004: fix compile errors\/warnings","message":"lcd2004: fix compile errors\/warnings\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"lcd2004.scad","new_file":"lcd2004.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"3edd1966869659677ac1c7173866dde395c7ab75","subject":"models of 2 buttons","message":"models of 2 buttons\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toy_button\/buttons.scad","new_file":"toy_button\/buttons.scad","new_contents":"eps=0.01;\n\nmodule button_flat()\n{\n difference()\n {\n cylinder(r=15\/2, h=2, $fn=120);\n for(dx=[-1,1])\n translate([dx*2.5, 0, -eps])\n cylinder(r=2\/2, h=2+2*eps, $fn=30);\n }\n}\n\nmodule button_thick()\n{\n difference()\n {\n union()\n {\n cylinder(r=15\/2, h=2, $fn=120);\n translate([0, 0, 2])\n resize((15-3)*[1, 1, 0] + [0, 0, 4])\n sphere(r=(15-3)\/2, $fn=120);\n }\n for(dx=[-1,1])\n translate([dx*2.5, 0, -eps])\n cylinder(r=2\/2, h=4+2*eps, $fn=30);\n }\n}\n\nfor(i=[0:1])\n translate([0, i*17, 0])\n button_flat();\n\nfor(i=[0:0])\n translate([17, i*17, 0])\n button_thick();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'toy_button\/buttons.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"e1a7be5f7c64d799f4af38ebc849b3a299cb02c8","subject":"Damn, finally working","message":"Damn, finally working\n","repos":"agupta231\/fractal_prints","old_file":"infinite_square.scad","new_file":"infinite_square.scad","new_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 20;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 8;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n next_square_center = corner + ev_mult(translation_vectors[i], [connector_size \/ sqrt(2), connector_size \/ sqrt(2)]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n\n if(i == 0) {\n pattern(next_square_center, \"bottom_left\", current_iteration + 1);\n }\n else if(i == 1) {\n pattern(next_square_center, \"top_right\", current_iteration + 1);\n }\n else if(i == 2) {\n pattern(next_square_center, \"bottom_right\", current_iteration + 1);\n }\n else if(i == 3){\n pattern(next_square_center, \"top_left\", current_iteration + 1);\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n center_pos = [0,0] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n center_pos = [current_size \/ 2, current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n center_pos = [-current_size \/ 2, current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 2], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n center_pos = [current_size \/ 2, -current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([0, 1, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n center_pos = [-current_size \/ 2, -current_size \/ 2] + starting_pos;\n translate(center_pos) square(current_size, center=true);\n\n connector([1, 2, 3], current_connector_size, current_size, center_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","old_contents":"\/**\nProgram by Ankur Gupta\nwww.github.com\/agupta231\nJan 2017\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n**\/\n\ninit_square_size = 40;\nconnector_length = 30;\nconnector_thickness = 0.1;\niteration_multiplier = 0.5;\niterations = 3;\n\necho(version());\n\ntranslation_vectors = [[1, 1], [-1, -1], [-1, 1], [1, -1]];\nrotation_vectors = [[1, 1, -1], [1, 1, -1], [1, 1, 1], [1, 1, 1]];\n\nfunction ev_mult(vec1, vec2) =\n len(vec1) != len(vec2) ? false : [for(i = [0:len(vec1) - 1]) vec1[i] * vec2[i]];\n\nmodule translated_cube(translation_vector, starting_pos, size) {\n translate(translation_vector + starting_pos) {\n square(size, center = true);\n }\n}\n\nmodule connector(vector_keys, connector_size, square_size, starting_pos, current_iteration) {\n if(current_iteration < iterations) {\n for(i = vector_keys) {\n corner = ev_mult(translation_vectors[i], [square_size \/ 2, square_size \/ 2]) + starting_pos;\n connector_correction = ev_mult(translation_vectors[i], [connector_size \/ (2 * sqrt(2)), connector_size \/ (2 * sqrt(2))]);\n next_square_center = corner + ev_mult(translation_vectors[i], [connector_size \/ sqrt(2), connector_size \/ sqrt(2)]);\n\n translate(corner + connector_correction) {\n rotate(ev_mult(rotation_vectors[i], [0, 45, 45])) {\n #square([connector_thickness, connector_size], center = true);\n }\n }\n\n if(i == 0) {\n pattern(next_square_center, \"bottom_left\", current_iteration + 1);\n }\n else if(i == 1) {\n pattern(next_square_center, \"top_right\", current_iteration + 1);\n }\n else if(i == 2) {\n pattern(next_square_center, \"bottom_right\", current_iteration + 1);\n }\n else if(i == 3){\n pattern(next_square_center, \"top_left\", current_iteration + 1);\n }\n }\n }\n}\n\nmodule pattern(starting_pos, seed_corner, current_iteration) {\n translation = false;\n translations = false;\n rotations = false;\n current_size = init_square_size * pow(iteration_multiplier, current_iteration - 1);\n current_connector_size = connector_length * pow(iteration_multiplier, current_iteration - 1);\n\n if(seed_corner == \"center\") {\n translated_cube([0,0], starting_pos, current_size);\n connector([0, 1, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_left\") {\n translated_cube([current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"bottom_right\") {\n translated_cube([-current_size \/ 2, current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 2], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_left\") {\n translated_cube([current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([0, 1, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n else if(seed_corner == \"top_right\") {\n translated_cube([-current_size \/ 2, -current_size \/ 2], starting_pos, current_size);\n connector([1, 2, 3], current_connector_size, current_size, starting_pos, current_iteration);\n }\n}\n\npattern([0, 0], \"center\", 1);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"e5660970b4e6dd334ec03d9711703fd64c2cb4ed","subject":"moineau: increase rotor clearence to reduce tension","message":"moineau: increase rotor clearence to reduce tension\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"3456f56e183f2e53c66163e3ae6421f1305e754a","subject":"initial commit","message":"initial commit\n","repos":"kintel\/OpenSCAD-models","old_file":"LetterBlock.scad","new_file":"LetterBlock.scad","new_contents":"module LetterBlock(letter, size=30) {\n difference() {\n translate([0,0,size\/4])\n cube([size,size,size\/2], center=true);\n translate([0,0,size\/6])\n linear_extrude(height=size, convexity=3)\n text(letter, \n size=size*22\/30,\n font=\"Tahoma\",\n halign=\"center\",\n valign=\"center\");\n }\n}\n\nsize=20;\nfor (i=[0:25])\n translate([(i%5)*(size+3),floor(i\/5)*-(size+1),0])\n LetterBlock(chr(i+65), size);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'LetterBlock.scad' did not match any file(s) known to git\n","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"729b8ec56a02dfbc2422da8ec357bc059449e490","subject":"add a protection to avoid to break potentiometer connection","message":"add a protection to avoid to break potentiometer connection\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/potentiometer_support.scad","new_file":"Hardware\/potentiometer_support.scad","new_contents":"width = 15;\nbeam_size = 10;\nbeam_thickness = 5;\nthickness = 3;\nbridge_length = 32;\npotentiometer_width = 16.1;\ntotal_length = bridge_length+2*width+2*thickness;\n\nmodule bottom_beam(){\ndifference(){\nunion(){\n\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tminkowski(){\n\t\t\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness\/2], center=true);\n\t\t\tcylinder(r= thickness, h=beam_thickness\/2,center=true);\n}\n\t}\n\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\n\t\n}\nmodule top_beam(){\ndifference(){\n\tunion(){\n\t\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\t}\n\t\tcylinder(r= 5+thickness, h= beam_thickness, center=true);\n\t}\n\tcylinder(r= 5, h= 2* beam_thickness, center=true);\n}\n}\n\nprojection() difference(){\n\tunion()\n\t{\n\t\tbottom_beam();\n\t\t\ttranslate([0,15,0]) minkowski(){\n\t\t\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness\/2], center=true);\n\t\t\tcylinder(r= thickness, h=beam_thickness\/2,center=true);\n}\n\t}\n\ttranslate([0 , potentiometer_width\/2+4],0) cube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\nprojection() translate([0, 38, beam_thickness+1]) bottom_beam();\n\nprojection() translate([0, 59, 2*beam_thickness+2])top_beam();\n\ntranslate([0, 0, 2* beam_thickness+2]) difference(){\n \tcylinder(r=3+thickness,h=beam_thickness, center=true);\n\tcylinder(r=3, h=2*beam_thickness, center=true);\n}\n\n\n","old_contents":"width = 15;\nbeam_size = 10;\nbeam_thickness = 5;\nthickness = 3;\nbridge_length = 32;\npotentiometer_width = 16.1;\ntotal_length = bridge_length+2*width+2*thickness;\n\nmodule bottom_beam(){\ndifference(){\nunion(){\n\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\n\t\/\/Remove space to save weight?\n\t\ttranslate([bridge_length\/2+width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t\ttranslate([-bridge_length\/2-width\/2,0,0]) cube(size = [width, beam_size-2*thickness, 2*beam_thickness], center=true);\n\t}\n\t\tminkowski(){\n\t\t\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness\/2], center=true);\n\t\t\tcylinder(r= thickness, h=beam_thickness\/2,center=true);\n}\n\t}\n\tcube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\n\t\n}\nmodule top_beam(){\ndifference(){\n\tunion(){\n\t\t\tdifference(){\n\t\tunion(){\n\t\t\tcube(size = [total_length, beam_size, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\t\n\t\t\ttranslate([total_length\/2 - thickness\/2-thickness-width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t\ttranslate([-total_length\/2 + thickness\/2+thickness+width,0,0]) cube(size = [thickness, beam_size+2*thickness, beam_thickness], center=true);\n\t\t}\n\t}\n\t\tcylinder(r= 5+thickness, h= beam_thickness, center=true);\n\t}\n\tcylinder(r= 5, h= 2* beam_thickness, center=true);\n}\n}\n\nprojection() difference(){\n\tbottom_beam();\n\ttranslate([0 , potentiometer_width\/2],0) cube(size = [potentiometer_width, potentiometer_width, beam_thickness*2], center=true);\n}\nprojection() translate([0, 23, beam_thickness+1]) bottom_beam();\n\nprojection() translate([0, 44, 2*beam_thickness+2])top_beam();\n\ntranslate([0, 0, 2* beam_thickness+2]) difference(){\n \tcylinder(r=3+thickness,h=beam_thickness, center=true);\n\tcylinder(r=3, h=2*beam_thickness, center=true);\n}\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"09320e90accd7aa9728fe9d56bced8ce3be83866","subject":"Moving the test file to a separate directory to make it clear it's not part of the final project.","message":"Moving the test file to a separate directory to make it clear it's not part of the final project.\n","repos":"sarahemm\/laserbox","old_file":"lasercut_parts\/test\/laserbox_test_plate.scad","new_file":"lasercut_parts\/test\/laserbox_test_plate.scad","new_contents":"nbr_lasers = 36;\nlaser_spacing = 5;\n\nfor(x = [0 : sqrt(nbr_lasers)]) {\n for(y = [0 : sqrt(nbr_lasers)]) {\n translate([x * laser_spacing, y * laser_spacing])\n circle(2);\n }\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'lasercut_parts\/test\/laserbox_test_plate.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"40b9fd5aeacc6a6c4bd86f26cd23f83439decdb7","subject":"Enlarge belt clamp holes slightly, narrow ribs so overall width remains the same.","message":"Enlarge belt clamp holes slightly, narrow ribs so overall width remains the same.\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"shapeoko-beltclamp\/beltclamp.scad","new_file":"shapeoko-beltclamp\/beltclamp.scad","new_contents":"\/\/ This printed part is one possible way to anchor Shapeoko belts.\n\/\/ See http:\/\/www.shapeoko.com\/wiki\/index.php\/Belt_Anchors for other ideas.\n\/\/ Motivated by http:\/\/www.thingiverse.com\/thing:33881 not being strong enough\n\/\/ when I initially printed it.\n\n\/\/ Upright: printed, but not stress tested, looks sturdy\n\/\/ Top: completely untested\n\ngThick = 8;\ngRibHeight = 6;\ngTopRoundoverRadius = 4;\ngSideRoundoverRadius = 4;\ngMainWidth = 16;\ngTopWidth = 30;\ngRibWidth = 3.4;\ngHoleSpacing = 20;\ngBeltWide = 14; \/\/ 1\/4\" belt + slop\ngBeltPitch = 2.032; \/\/ MXL in mm\ngBeltThick = 1.5;\ne = 0.02;\n\n\/\/ screw_clearance_diameter, socket_head_clearance_diameter, nut outside diameter\n\/\/ TODO untested numbers, these should move to a common include.\nM3 = [3.5, 6.4, 6.4];\nM5 = [5.5, 9.4, 9.4];\nM8 = [8, 13, 13];\n\nmodule InsetHole(x) {\n d = x[0];\n socket_head = x[1];\n union() {\n translate([0,0,-50]) cylinder(r=d\/2, h=100);\n cylinder(r=socket_head\/2, h=10);\n }\n}\n\nmodule NutHole(x) {\n d = x[0];\n nut_size = x[2];\n union() {\n translate([0,0,1]) cylinder(r=d\/2, h=50);\n cylinder(r=nut_size\/2, $fn=6, h=6);\n }\n}\n\nmodule Rib(t=4) {\n translate([-t\/2,0,-0.1])\n rotate([90,0,90])\n linear_extrude(height=t)\n polygon(points=[[0,0],[40,0],[0,gRibHeight]],paths=[[0,1,2]]);\n}\n\nmodule Roundover(r) {\n translate([0.1,0.1,-50])\n difference() {\n cube([r,r,100]);\n translate([0,0,-1]) cylinder(r=r,h=102,$fn=20);\n }\n}\n\nmodule Upright() {\n difference() {\n union() {\n \/\/ body, for now (until beziers work)\n translate([0,-25,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n translate([0,0,gThick\/2]) cube([gMainWidth,60,gThick], center=true);\n \/\/ ribs\n translate([(gMainWidth-gRibWidth)\/2,-20,gThick]) Rib(t=gRibWidth);\n translate([-(gMainWidth-gRibWidth)\/2,-20,gThick]) Rib(t=gRibWidth);\n }\n \/\/ Chamfer top edges\n \/\/ TODO make these translation numbers constants as well, and fix Roundover's\n \/\/ origin.\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ Chamfer edges near bottom mounting hole\n translate([gMainWidth\/2-gSideRoundoverRadius,26,0])\n Roundover(r=gSideRoundoverRadius);\n translate([-(gMainWidth\/2-gSideRoundoverRadius),26,0])\n rotate([0,0,90])\n Roundover(r=gSideRoundoverRadius);\n \/\/ M5 mounting holes\n translate([0,0,gThick-2]) InsetHole(M5);\n translate([0,20,gThick-2]) InsetHole(M5);\n \/\/ M3 nut traps (20mm spacing, for compat with old part)\n translate([-gHoleSpacing\/2,-16,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,-16,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n }\n}\n\nmodule Belt() {\n translate([0,0,gBeltThick\/2]) cube([gBeltWide,30,gBeltThick], center=true);\n for(i = [0:30\/gBeltPitch]) {\n translate([0,i * gBeltPitch,-gBeltThick\/2+e]) cube([gBeltWide,gBeltPitch \/ 2,gBeltThick], center=true);\n }\n}\n\nmodule Top() {\n rotate([-90,0,0]) difference() {\n translate([0,-5,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n \/\/ holes\n translate([-gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n \/\/ chamfer\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ TODO remove 12 as magic number\n translate([0,-12+(1.6*gBeltThick),0]) rotate([90,0,0]) Belt();\n }\n}\n\nunion() {\n Upright();\n translate([0,-50,0]) Top();\n}\n","old_contents":"\/\/ This printed part is one possible way to anchor Shapeoko belts.\n\/\/ See http:\/\/www.shapeoko.com\/wiki\/index.php\/Belt_Anchors for other ideas.\n\/\/ Motivated by http:\/\/www.thingiverse.com\/thing:33881 not being strong enough\n\/\/ when I initially printed it.\n\n\/\/ Upright: printed, but not stress tested, looks sturdy\n\/\/ Top: completely untested\n\ngThick = 8;\ngRibHeight = 6;\ngTopRoundoverRadius = 4;\ngSideRoundoverRadius = 4;\ngMainWidth = 16;\ngTopWidth = 30;\ngRibWidth = 3.5;\ngHoleSpacing = 20;\ngBeltWide = 14; \/\/ 1\/4\" belt + slop\ngBeltPitch = 2.032; \/\/ MXL in mm\ngBeltThick = 1.5;\ne = 0.02;\n\n\/\/ screw_clearance_diameter, socket_head_clearance_diameter, nut outside diameter\n\/\/ TODO untested numbers, these should move to a common include.\nM3 = [3.5, 6, 6];\nM5 = [5.5, 9, 9];\nM8 = [8, 13, 13];\n\nmodule InsetHole(x) {\n d = x[0];\n socket_head = x[1];\n union() {\n translate([0,0,-50]) cylinder(r=d\/2, h=100);\n cylinder(r=socket_head\/2, h=10);\n }\n}\n\nmodule NutHole(x) {\n d = x[0];\n nut_size = x[2];\n union() {\n translate([0,0,1]) cylinder(r=d\/2, h=50);\n cylinder(r=nut_size\/2, $fn=6, h=6);\n }\n}\n\nmodule Rib(t=4) {\n translate([-t\/2,0,-0.1])\n rotate([90,0,90])\n linear_extrude(height=t)\n polygon(points=[[0,0],[40,0],[0,gRibHeight]],paths=[[0,1,2]]);\n}\n\nmodule Roundover(r) {\n translate([0.1,0.1,-50])\n difference() {\n cube([r,r,100]);\n translate([0,0,-1]) cylinder(r=r,h=102,$fn=20);\n }\n}\n\nmodule Upright() {\n difference() {\n union() {\n \/\/ body, for now (until beziers work)\n translate([0,-25,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n translate([0,0,gThick\/2]) cube([gMainWidth,60,gThick], center=true);\n \/\/ ribs\n translate([(gMainWidth-gRibWidth)\/2,-20,gThick]) Rib(t=gRibWidth);\n translate([-(gMainWidth-gRibWidth)\/2,-20,gThick]) Rib(t=gRibWidth);\n }\n \/\/ Chamfer top edges\n \/\/ TODO make these translation numbers constants as well, and fix Roundover's\n \/\/ origin.\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ Chamfer edges near bottom mounting hole\n translate([gMainWidth\/2-gSideRoundoverRadius,26,0])\n Roundover(r=gSideRoundoverRadius);\n translate([-(gMainWidth\/2-gSideRoundoverRadius),26,0])\n rotate([0,0,90])\n Roundover(r=gSideRoundoverRadius);\n \/\/ M5 mounting holes\n translate([0,0,gThick-2]) InsetHole(M5);\n translate([0,20,gThick-2]) InsetHole(M5);\n \/\/ M3 nut traps (20mm spacing, for compat with old part)\n translate([-gHoleSpacing\/2,-16,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,-16,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n }\n}\n\nmodule Belt() {\n translate([0,0,gBeltThick\/2]) cube([gBeltWide,30,gBeltThick], center=true);\n for(i = [0:30\/gBeltPitch]) {\n translate([0,i * gBeltPitch,-gBeltThick\/2+e]) cube([gBeltWide,gBeltPitch \/ 2,gBeltThick], center=true);\n }\n}\n\nmodule Top() {\n rotate([-90,0,0]) difference() {\n translate([0,-5,(gThick+gRibHeight)\/2]) cube([gTopWidth,10,gThick+gRibHeight], center=true);\n \/\/ holes\n translate([-gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n translate([gHoleSpacing\/2,20,(gThick+gRibHeight)\/2]) rotate([90,-90,0]) NutHole(M3);\n \/\/ chamfer\n translate([gTopWidth\/2-gTopRoundoverRadius,0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,0])\n Roundover(r=gTopRoundoverRadius);\n translate([-(gTopWidth\/2-gTopRoundoverRadius),0,gThick+gRibHeight-gTopRoundoverRadius])\n rotate([90,0,180])\n Roundover(r=gTopRoundoverRadius);\n \/\/ TODO remove 12 as magic number\n translate([0,-12+(1.6*gBeltThick),0]) rotate([90,0,0]) Belt();\n }\n}\n\nunion() {\n Upright();\n translate([0,-50,0]) Top();\n}\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"b72f44507b3c2243f67976de000e8f80f6b1a11f","subject":"removed most of the elements. while it was roughy the copy of the original part, it turned out that most of it is not really needed, and may even make mounting more difficult. the minimal working part is just a drive connection, screwd to the brush. that's it. :)","message":"removed most of the elements. while it was roughy the copy of the original part, it turned out that most\nof it is not really needed, and may even make mounting more difficult. the minimal working part is just a\ndrive connection, screwd to the brush. that's it. :)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_contents":"difference()\n{\n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 3]);\n }\n \/\/ screw hole\n screw_box_size=7+0.5;\n translate([-screw_box_size\/2, -screw_box_size\/2, 0.5])\n cube([screw_box_size, screw_box_size, 3-0.5]);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","old_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24\/2, h=2.5);\n cylinder(r=(16+1.5)\/2, h=1.5);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-2\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([2.5, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 3]);\n }\n }\n \/\/ screw hole\n screw_box_size=7+0.5;\n translate([-screw_box_size\/2, -screw_box_size\/2, 2.5+0.5])\n cube([screw_box_size, screw_box_size, 3-0.5]);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"65ddcb65995edc15680ba858b1c0d83832258b3a","subject":"fix typo in the baseplate scad file","message":"fix typo in the baseplate scad file\n","repos":"pierreca\/dashboards,pierreca\/dashboards,pierreca\/dashboards","old_file":"jenkins\/hardware\/baseplate.scad","new_file":"jenkins\/hardware\/baseplate.scad","new_contents":"bar_depth = 3;\n\npi_height = 56;\npi_width = 85;\npi_standoff_radius = 4;\n\nledstrip_depth = 4;\nledstrip_height = 17;\nledstrip_length = 1000;\n\n$fa = 1;\n$fs = 0.1;\n\nmodule ledstrip () {\n color(\"green\") cube([ledstrip_length, ledstrip_height, ledstrip_depth]);\n}\n\nmodule pi() {\n color(\"green\") cube([pi_width, pi_height, 2]);\n}\n\nmodule device_support(bar_height) {\n radius = bar_height \/ 2;\n device_support_width = pi_width + 2 * radius;\n device_support_height = pi_height + 2 * radius;\n inner_plate_width = device_support_width - 2 * radius;\n inner_plate_height = device_support_height - 2 * radius;\n \n translate([radius, radius + inner_plate_height, 0])\n cylinder(h = bar_depth, r = radius);\n translate([radius + inner_plate_width, radius + inner_plate_height, 0])\n cylinder(h = bar_depth, r = radius);\n translate([0, -bar_height \/ 2, 0])\n cube([device_support_width, device_support_height, bar_depth]);\n translate([radius, device_support_height - radius, 0])\n cube([inner_plate_width, radius, bar_depth]);\n \n translate([device_support_width, 0, 0]) {\n difference() {\n cube([radius, radius, 1]);\n translate([radius, radius, 0])\n cylinder(h = bar_depth, r = radius);\n }\n }\n}\n\nmodule screw_holes(bar_end_radius, bar_length, bar_height) {\n translate([bar_end_radius, bar_end_radius, - bar_depth \/ 2])\n cylinder(h = bar_depth * 2, r = 1.5);\n \n translate([bar_length - bar_end_radius, bar_end_radius, - bar_depth \/ 2])\n cylinder(h = bar_depth * 2, r = 1.5);\n}\n\nmodule pi_holes(bar_height) {\n pi_padding = bar_height \/ 2;\n translate([pi_padding + pi_standoff_radius, bar_height + pi_padding + pi_height + 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n translate([pi_padding + pi_width - 10, bar_height + pi_padding + pi_height + 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n translate([pi_padding + pi_standoff_radius, bar_height + pi_padding - 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n translate([pi_padding + 47, bar_height + pi_padding - 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n \n}\n\nmodule bar(length, height) {\n radius = height \/ 2;\n difference() {\n union() {\n translate([radius, radius, 0]) \n cylinder(h = bar_depth, r = radius);\n translate([radius, 0, 0]) \n cube([length - 2*radius, height, bar_depth]);\n translate([length - radius, radius, 0])\n cylinder(h = bar_depth, r = radius);\n }\n screw_holes();\n }\n}\n\nmodule top_bar(length, height) {\n difference() {\n bar(length, height);\n screw_holes(height \/ 2, length);\n }\n}\n\nmodule bottom_bar_and_support(bar_length, bar_height) {\n difference() {\n union() {\n translate([0,bar_height,0])\n device_support(bar_height);\n bar(bar_length, bar_height);\n }\n screw_holes(bar_height \/ 2, bar_length);\n pi_holes(bar_height);\n }\n}\n\nmodule 3dmodel(bar_height, bar_length) {\n translate([bar_height \/ 2, bar_height + bar_height \/ 2 , bar_depth])\n pi();\n translate([bar_height \/ 2 + 15, bar_height \/ 2 - 17 \/ 2, bar_depth]) \n ledstrip();\n bottom_bar_and_support(bar_length, bar_height);\n translate([0, 0, bar_depth + ledstrip_depth]) {\n top_bar(bar_length, bar_height);\n }\n}\n\nmodule cutout(bar_height, bar_length) {\n projection() {\n translate([0, bar_height + 10, 0])\n bottom_bar_and_support(bar_length, bar_height);\n top_bar(bar_length, bar_height);\n }\n}\n\n\/*\n3dmodel(30, 1060);\ntranslate([5, 5, 10])\n 3dmodel(20, 1050);\n*\/\n\ncutout(30, 1060);\ntranslate([1040, 220, 0])\n rotate([0, 0, 180])\n cutout(20, 1040);\n","old_contents":"bar_depth = 3;\n\npi_height = 56;\npi_width = 85;\npi_standoff_radius = 4;\n\nledstrip_depth = 4;\nledstrip_height = 17;\nledstrip_length = 1000;\n\n$fa = 1;\n$fs = 0.1;\n\nmodule ledstrip () {\n color(\"green\") cube([ledstrip_length, ledstrip_height, ledstrip_depth]);\n}\n\nmodule pi() {\n color(\"green\") cube([pi_width, pi_height, 2]);\n}\n\nmodule device_support(bar_height) {\n radius = bar_height \/ 2;\n device_support_width = pi_width + 2 * radius;\n device_support_height = pi_height + 2 * radius;\n inner_plate_width = device_support_width - 2 * radius;\n inner_plate_height = device_support_height - 2 * radius;\n \n translate([radius, radius + inner_plate_height, 0])\n cylinder(h = bar_depth, r = radius);\n translate([radius + inner_plate_width, radius + inner_plate_height, 0])\n cylinder(h = bar_depth, r = radius);\n translate([0, -bar_height \/ 2, 0])\n cube([device_support_width, device_support_height, bar_depth]);\n translate([radius, device_support_height - radius, 0])\n cube([inner_plate_width, radius, bar_depth]);\n \n translate([device_support_width, 0, 0]) {\n difference() {\n cube([radius, radius, 1]);\n translate([radius, radius, 0])\n cylinder(h = bar_depth, r = radius);\n }\n }\n}\n\nmodule screw_holes(bar_end_radius, bar_length, bar_height) {\n translate([bar_end_radius, bar_end_radius, - bar_depth \/ 2])\n cylinder(h = bar_depth * 2, r = 1.5);\n \n translate([bar_length - bar_end_radius, bar_end_radius, - bar_depth \/ 2])\n cylinder(h = bar_depth * 2, r = 1.5);\n}\n\nmodule pi_holes(bar_height) {\n pi_padding = bar_height \/ 2;\n translate([pi_padding + pi_standoff_radius, bar_height + pi_padding + pi_height + 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n translate([pi_padding + pi_width - 10, bar_height + pi_padding + pi_height + 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n translate([pi_padding + pi_standoff_radius, bar_height + pi_padding - 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n translate([pi_padding + 47, bar_height + pi_padding - 0.5, - bar_depth \/ 2]) {\n cylinder(h = bar_depth * 2, r = 2);\n }\n \n}\n\nmodule bar(length, height) {\n radius = height \/ 2;\n difference() {\n union() {\n translate([radius, radius, 0]) \n cylinder(h = bar_depth, r = radius);\n translate([radius, 0, 0]) \n cube([length - 2*radius, height, bar_depth]);\n translate([length - radius, radius, 0])\n cylinder(h = bar_depth, r = radius);\n }\n screw_holes();\n }\n}\n\nmodule top_bar(length, height) {\n difference() {\n bar(length, height);\n screw_holes(height \/ 2, length);\n }\n}\n\nmodule bottom_bar_and_support(bar_length, bar_height) {\n difference() {\n union() {\n translate([0,bar_height,0])\n device_support(bar_height);\n bar(bar_length, bar_height);\n }\n screw_holes(bar_height \/ 2, bar_length);\n pi_holes(bar_height);\n }\n}\n\nmodule 3dmodel(bar_height, bar_length) {\n translate([bar_height \/ 2, bar_height + bar_height \/ 2 , bar_depth])\n pi();\n translate([bar_height \/ 2 + 15, bar_height \/ 2 - 17 \/ 2, bar_depth]) \n ledstrip();\n bottom_bar_and_support(bar_length, bar_height);\n translate([0, 0, bar_depth + ledstrip_depth]) {\n top_bar(bar_length, bar_height);\n }\n}\n\nmodule cutout(bar_height, bar_length) {\n projection() {\n translate([0, bar_height + 10, 0])\n bottom_bar_and_support(bar_length, bar_height);\n top_bar(bar_length, bar_height);\n }\n}\n\n\/*\n3dmodel(30, 1060);\ntranslate([5, 5, 10])\n 3dmodel(20, 1050);\n*\/\n\ncutout(30, 1060);\ntranslate([bar_length, 220, 0])\n rotate([0, 0, 180])\n cutout(20, 1040);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"8a5d2918df1b633de883b6d906e91a3bc1c8bfd5","subject":"misc\/lerp: fix tests","message":"misc\/lerp: fix tests\n","repos":"oysteinkrog\/thing_libutils,oysteinkrog\/thing_libutils","old_file":"misc.scad","new_file":"misc.scad","new_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp(-1, 1, .5) == 0);\n assert(lerp(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","old_contents":"include \nuse \nuse \n\nfunction posvec(path_vec) = [for(v=path_vec) translation_part(v)];\nfunction posvec_x(path_vec) = [for(v=path_vec) translation_part(v)[0]];\nfunction posvec_y(path_vec) = [for(v=path_vec) translation_part(v)[1]];\nfunction posvec_z(path_vec) = [for(v=path_vec) translation_part(v)[2]];\n\nfunction vec_i(v3,i) = [for(v=v3) v[i]];\nfunction vec_0(v3) = vec_i(v3,0);\nfunction vec_1(v3) = vec_i(v3,1);\nfunction vec_2(v3) = vec_i(v3,2);\n\n\/\/ if V is array and len == 1, return single value, otherwise return V\nfunction singlify(V) = len(V)==1?V[0]:V;\nif($test_mode)\n{\n assert_v(singlify(\"t\"),\"t\");\n assert_v(singlify(\"test\"),\"test\");\n assert_v(singlify(0),0);\n assert_v(singlify([]),[]);\n assert_v(singlify([0]),0);\n assert_v(singlify([0,1]),[0,1]);\n}\n\nfunction v_itrlen(vec) = [0:1:len(vec)-1];\n\nfunction range1(v1) = [min(v1), max(v1)];\nfunction range3(v3) = [range1(vec_0(v3)), range1(vec_1(v3)), range1(vec_2(v3))];\nfunction bbox(r) = [ [r[0][0],r[1][0],r[2][0]], [r[0][1],r[1][1],r[2][1]] ];\nfunction transform_pp(vec_m, t_pre, t_post) = [for(m=vec_m) (t_pre*m)*t_post];\nfunction transform_pre(vec_m, t) = [for(m=vec_m) t*m];\nfunction transform_post(vec_m, t) = [for(m=vec_m) m*t];\n\nfunction clamp(v, v1, v2) = min(max(v,v1),v2);\n\n\/\/ from the start (or s'th element) to the e'th element - remember elements are zero based\nfunction v_sum(v,e=U,start=0) =\nlet(e_= fallback(e, len(v)-1))\n(e==start ? v[e] : v[e_] + v_sum(v,e_-1,start));\n\nfunction get(key, dict) =\n let(x = search(key, dict))\n let(kv = dict[x[0]])\n kv[1];\n\nfunction v_i(vec,i) = [for(vv=vec) vv[i]];\nfunction v_get(vec,key) = [for(vv=vec) get(key, vv)];\nfunction v_add(vec,v) = [for(vv=vec) vv+v];\nfunction v_sub(vec,v) = [for(vv=vec) vv+v];\nfunction v_avg(v,e=U,start=0) = v_sum(v,e,start) \/ (len(v));\nfunction v_abs(v, start=0) = [for(i=[start:1:len(v)-1]) abs(v[i])];\nfunction v_sign(v, start=0) = [for(i=[start:1:len(v)-1]) sign(v[i])];\nfunction v_max(v, m, start=0) = [for(i=[start:1:len(v)-1]) max(v[i],m)];\nfunction v_min(v, m, start=0) = [for(i=[start:1:len(v)-1]) min(v[i],m)];\nfunction v_clamp(v, v1, v2, start=0) = [for(i=[start:1:len(v)-1]) clamp(v[i],v1,v2)];\n\nfunction v_slice(v, start, end) =\nlet(start_ = start==U?0:start)\nlet(end_ = end==U?len(v)-1:end)\n[for(i=[start_:1:end_]) v[i]];\n\nif($test_mode)\n{\n v=[0,1,2];\n assert_v(v_slice(v), [0, 1,2]);\n assert_v(v_slice(v,start=1), [1,2]);\n assert_v(v_slice(v,end=1), [0, 1]);\n assert_v(v_slice(v,start=1,end=1), [1]);\n}\n\n\/\/ cumulative sum of vector [1,2,3] = [1,3,6]\nfunction v_cumsum(v, start=0, end) = [for(i=[start:1:end==U?len(v)-1:end]) v_sum(v,i)];\n\n\/\/ filter\/remove a val from a vec\nfunction filter(vec,val=U) = [for(v=vec) if(v!=val) v];\n\nfunction vec_pair_double_transform_post(vec,t1,t2)=\n flatten(\n [for(v=vec)\n [transform_post(v,t1),transform_post(v,t2)]\n ]);\n\nfunction vec_pair_double(vec)=flatten([for(v=vec) [v,v] ]);\n\n\/** Calculates length of hypotenuse according to pythagoras *\/\nfunction pythag_hyp(a, b)=sqrt(a*a+b*b);\nfunction pythag_leg(b, c)=sqrt(c*c-b*b);\n\n\nfunction v_x(v) = [v[0],0,0];\nfunction v_y(v) = [0,v[1],0];\nfunction v_z(v) = [0,0,v[2]];\n\nfunction v_xy(v) = [v[0],v[1],0];\nfunction v_xyz(v) = [v[0],v[1],v[2]];\nfunction v_yz(v) = [0,v[1],v[2]];\nfunction v_z(v) = [0,0,v[2]];\n\n\/\/-- Calculate the module\/magnitude of a vector\nfunction v_mod(v) = (sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]));\n\n\/\/-- Calculate the cross product of two vectors\nfunction v_cross(u,v) = [\n u[1]*v[2] - v[1]*u[2],\n u[2]*v[0] - v[2]*u[0],\n u[0]*v[1] - v[0]*u[1]\n];\n\n\/\/-- Calculate the dot product of two vectors\nfunction v_dot(u,v) = u[0]*v[0]+u[1]*v[1]+u[2]*v[2];\n\n\/\/-- Return the unit vector of a vector\nfunction v_unitv(v) = v\/v_mod(v);\n\n\/\/-- Return the angle between two vectores\nfunction v_anglev(u,v) = acos( v_dot(u,v) \/ (v_mod(u)*v_mod(v)) );\n\nfunction _orient_angles(zaxis)=\n[\n -asin(zaxis.y \/ norm(zaxis)),\n atan2(zaxis.x, zaxis.z),\n 0\n];\n\n\/*function _orient_angles_(v)=*\/\n\/*[*\/\n \/*-atan2(sqrt(v.x*v.x+v.y*v.y), v.z),*\/\n \/*0,*\/\n \/*-atan2(v.x, v.z)*\/\n\/*];*\/\n\n\/\/matrix rotation functions\nfunction _rotate_x_matrix(a)=\n[[1,0,0,0],\n [0,cos(a),-sin(a),0],\n [0,sin(a),cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_y_matrix(a)=\n[[cos(a),0,sin(a),0],\n [0,1,0,0],\n [-sin(a),0,cos(a),0],\n [0,0,0,1]];\n\nfunction _rotate_z_matrix(a)=\n[[cos(a),-sin(a),0,0],\n [sin(a),cos(a),0,0],\n [0,0,1,0],\n [0,0,0,1]];\n\nfunction _rotate_matrix(a)=_rotate_z_matrix(a.z)*_rotate_y_matrix(a.y)*_rotate_x_matrix(a.x);\n\n\/\/hadamard product (aka \"component-wise\" product) for vectors\nfunction hadamard(v1,v2) = [v1.x*v2.x, v1.y*v2.y, v1.z*v2.z];\n\n\/\/ search in a dictionary (vector w\/key-value pairs) and replace the value for a given key\nfunction dict_replace(dict, key, newvalue)=[\n for(kv=dict)\n kv[0] == key ?\n [key, newvalue]\n :\n kv\n ];\n\nfunction dict_replace_multiple(dict, newvaluesdict)=[\n for(kv_old=dict)\n let(r = search(kv_old[0], newvaluesdict, num_returns_per_match=0, index_col_num=0))\n r==[]?kv_old:newvaluesdict[r[0]]\n ];\n\nfunction sinh(x) = (1 - pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction cosh(x) = (1 + pow(e, -2 * x)) \/ (2 * pow(e, -x));\nfunction tanh(x) = sinh(x) \/ cosh(x);\nfunction cot(x) = 1 \/ tan(x);\n\nfunction factorial(n) = n == 0 ? 1 : factorial(n - 1) * n;\n\nif(false)\n{\n vec=[ 10, 20, 30, 40 ];\n echo(\"v_sum=\", v_sum(vec,2,1)); \/\/ is 20+30=50\n echo(\"v_sum=\", v_sum(vec));\n echo(\"v_cumsum=\", v_cumsum(vec));\n}\n\n\/\/ FUNCTION: is_String(x)\n\/\/ Returns true if x is a string, false otherwise.\nfunction is_string(x) =\n\tx == U || len(x) == U\n\t\t? false \/\/ if U, a boolean or a number\n\t\t: len(str(x,x)) == len(x)*2; \/\/ if an array, this is false\n\n\n\/\/ FUNCTION: is_array(x)\n\/\/ Returns true if x is an array, false otherwise.\nfunction is_array(x) = is_string(x) ? false : len(x) != U;\n\nfunction identity(d) = d == 0 ? 1 : [for(y=[1:d]) [for(x=[1:d]) x == y ? 1 : 0] ];\nfunction unit_vector(v) = let(x=v[0], y=v[1], z=v[2]) [x\/norm(v), y\/norm(v), z\/norm(v)];\nfunction skew_symmetric(v) = let(x=v[0], y=v[1], z=v[2]) [[0, -z, y], [z, 0, -x], [-y, x, 0]];\nfunction tensor_product1(u) = let(x=u[0], y=u[1], z=u[2]) [[x*x, x*y, x*z], [x*y, y*y, y*z], [x*z, y*z, z*z]];\nfunction v_rotate(a, v)\n = is_array(a)\n? let(rx=a[0], ry=a[1], rz=a[2])\n [[1, 0, 0], [0, cos(rx), -sin(rx)], [0, sin(rx), cos(rx)]]\n * [[cos(ry), 0, sin(ry)], [0, 1, 0], [-sin(ry), 0, cos(ry)]]\n * [[cos(rz), -sin(rz), 0], [sin(rz), cos(rz), 0], [0, 0, 1]]\n : let(uv=unit_vector(v))\n cos(a)*identity(3) + sin(a)*skew_symmetric(uv) + (1 - cos(a))*tensor_product1(uv);\n\n\n \/*echo(rotate(90, X) * [1, 0, 0]);*\/\n \/*echo(rotate(90, X) * [0, 1, 0]);*\/\n \/*echo(rotate(90, X) * [0, 0, 1]);*\/\n\nfunction lerp(v0, v1, t) = (1-t)*v0 + t*v1;\n\nif($test_mode)\n{\n assert(lerp(-1, 1, 0) == -1);\n assert(lerp1(-1, 1, .5) == 0);\n assert(lerp1(-1, 1, 1) == 1);\n}\n\nif($test_mode)\n{\n assert_v(fallback(U,1), 1);\n}\n\nfunction fallback(a, b) = a==U?b:a;\n\n\/\/ echo(fallback(U,[U, 1]));\nfunction v_fallback(a,v,i=0) = (a!=U || i > len(v)-1) ? a : v_fallback(v[i],v,i+1);\n\nfunction zip(a,b,start=0,end) = [for(i=[start:1:fallback(end,len(a)-1)]) [a[i],b[i]] ];\nfunction zip_v(v,start=0,end) = [for(i=[start:1:fallback(end,len(v[0])-1)]) v_i(v,i) ];\n\nif($test_mode)\n{\n vec_a = [0,4];\n vec_b = [1,5];\n vec_c = [2,6];\n vec_d = [3,7];\n assert_v(zip(vec_a,vec_b),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b]),[[0,1],[4,5]]);\n assert_v(zip_v([vec_a,vec_b,vec_c,vec_d]), [[0,1,2,3],[4,5,6,7]]);\n}\n\nfunction vv_fallback(v,start=0,end) =\nlet(z = zip_v(v))\n[\nfor(i=[start:1:fallback(end,len(v[0])-1)])\n v_fallback(v=z[i],i=0)\n];\n\nif($test_mode)\n{\n vec_a=[ 10, U, U, 40 ];\n vec_b=[ 10, U, 30, U ];\n vec_c=[ U, 20, U, 40 ];\n assert(v_fallback(a=5, v=vec_a), 5);\n assert_v(vv_fallback(v=[vec_a, vec_b,vec_c]), [10,20,30,40]);\n}\n\nfunction fn_from_r(r) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, r*2*PI \/ $fs), 5));\n\nfunction fn_from_d(d) =\n $fn > 0.0 ?\n ($fn >= 3 ? $fn : 3)\n :\n ceil(max(min(360.0 \/ $fa, d*PI \/ $fs), 5));\n\nmodule assert_v(val, expected, message)\n{\n if(len(val) > 0)\n {\n if(len(val) != len(expected))\n {\n echo(\"assertion, not equal length of arrays\", val, expected);\n assert(val == expected, message);\n }\n for(i=[0:len(val)])\n {\n if(val[i] != expected[i])\n {\n echo(\"assertion, unexpected value at index\", i, val, expected);\n assert(val == expected, message);\n }\n }\n\n }\n else\n {\n if(val != expected)\n {\n echo(\"assertion, unexpected value\", val, expected);\n assert(val == expected, message);\n }\n }\n}\n\nfunction spread(v0,v1,a) =\na>=2 ?\n [for(i=[0:1\/(a-1):1]) lerp(v0,v1,i)]\n:\n [lerp(v0,v1,.5)]\n;\n\nif($test_mode)\n{\n assert_v(spread(-1, 1, 1), [0]);\n assert_v(spread(-1, 1, 2), [-1,1]);\n assert_v(spread(-1, 1, 3), [-1,0,1]);\n \/\/ fails because of float inaccuracy\n \/*assert_v(spread(-1, 1, 4), [-1,-1\/3,1\/3,1]);*\/\n assert_v(spread(-1, 1, 5), [-1,-.5,0,.5,1]);\n}\n\n\/\/ the apothem (inradius) is the distance from the center of a regular\n\/\/ polygon to the flat side (not a vertex)\nfunction apothem(circumradius, fn) = circumradius*cos(180\/fn);\nfunction inradius(circumradius, fn) = circumradius*cos(180\/fn);;\n\/\/ the circumradius (outradius) is the distance from the center of a regular\n\/\/ polygon to a vertex\nfunction circumradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction outradius(apothem, fn) = apothem \/ cos(180\/fn);\nfunction fn_radius(r, fn) = apothem(r,fn);\nfunction hex_radius(r) = apothem(r, 6);\n\n\nif($test_mode)\n{\n assert_v(apothem(circumradius(5,6)), circumradius(apothem(5),6));\n}\n\nfunction header_col_index(v, col_keys) = \n singlify(\n [for(col_key=col_keys)\n let(result=search([col_key], v[0], index_col_number=0, num_returns_per_match=0))\n result[0][0]\n ]\n );\n\nfunction geth(S, col_keys, row_index) = \n singlify(\n [for(col_key=col_keys)\n let(col_index = header_col_index(S, col_key))\n S[row_index+1][col_index]\n ]);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(header_col_index(A, \"Tx\"), 0);\n assert_v(header_col_index(A, \"Ty\"), 1);\n\n assert_v(header_col_index(A, [\"Ty\"]), 1);\n assert_v(header_col_index(A, [\"Tx\"]), 0);\n assert_v(header_col_index(A, [\"Tx\", \"Ty\"]), [0,1]);\n\n assert_v(geth(A, \"Tx\", 0), 1);\n assert_v(geth(A, \"Tx\", 1), 3);\n assert_v(geth(A, \"Ty\", 0), 2);\n assert_v(geth(A, \"Ty\", 1), 4);\n\n assert_v(geth(A, [\"Tx\",\"Ty\"], 0), [1,2]);\n assert_v(geth(A, [\"Tx\",\"Ty\"], 1), [3,4]);\n\n}\n\nfunction v_contains(V, val, start=0, end=U) =\n !is_array(V) ?\n V == val :\n let(e=end==U?len(V):end)\n V[start]==val ? true :\n start == len(V)-1 ? false :\n v_contains(V,val,start+1,end);\n\nif($test_mode)\n{\n assert_v(v_contains(0, 0), true);\n assert_v(v_contains(0, 1), false);\n assert_v(v_contains([0,1], 0), true);\n assert_v(v_contains([0,1], 1), true);\n assert_v(v_contains([0,1], 2), false);\n}\n\n\/\/ helper functions to work on headered-arrays (where first entry is column headers)\nfunction reverse_header(V) = concat([V[0]], reverse(v_slice(V,start=1)));\nfunction concat_header(A,B) =concat([A[0]], v_slice(A,start=1),v_slice(B,start=1));\n\n\/\/ add value from these columns in headered array\nfunction array_header_col_add(S, cols, val) =\n let(cols = header_col_index(S,cols))\n concat([S[0]],\n [\n for(i=[1:len(S)-1])\n [\n for(j=[0:len(S[0])-1])\n (v_contains(cols,j)) ?\n S[i][j] + val :\n S[i][j]\n ]\n ]);\n\nfunction array_header_col_subtract(S, cols, val) = array_header_col_add(S,cols,-val);\n\nif($test_mode)\n{\n A = [\n [\"Tx\", \"Ty\"],\n [1, 2],\n [3, 4],\n ];\n\n assert_v(\n array_header_col_add(A, \"Tx\", -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,2],\n [2,4],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Tx\",\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [0,1],\n [2,3],\n ]);\n\n assert_v(\n array_header_col_add(A, [\"Ty\"], -1),\n [[\"Tx\",\"Ty\"],\n [1,1],\n [3,3],\n ]);\n}\n\n\nfunction take3(v) = [v[0],v[1],v[2]];\n\nfunction vec3(V) =\nlet(l = len(V))\nl == 3 ? V :\nl < 3 ? vec3(concat(V,0)) :\ntake3(V);\n\nif($test_mode)\n{\n assert_v(take3([0,1,0,1]), [0,1,0]);\n\n assert_v(vec3([0,1]), [0,1,0]);\n assert_v(vec3([0]), [0,0,0]);\n assert_v(vec3([1]), [1,0,0]);\n assert_v(vec3([0,0,1]), [0,0,1]);\n assert_v(vec3([0,0,1,0]), [0,0,1]);\n}\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"17142f5ed39b89b69ccc37392600c4229691464d","subject":"Completed - 1st rev","message":"Completed - 1st rev\n\nThis is the version as originally envisioned. Now to print out a small version and test it out...\n","repos":"josephmjoy\/funstuff","old_file":"models\/cushiongrab\/cushiongrab.scad","new_file":"models\/cushiongrab\/cushiongrab.scad","new_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of extruded triangles\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([2*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ Dome - used for differencing\nmodule dome(width) {\n r = 10;\n ceiling_height = 3; \/\/ inner height;\n outer_height = r; \/\/ height of top of dome from above\n scale([1, ceiling_height\/r, 1])\n difference() {\n translate([-r, -r, -r]) cube([width+2*r, 3*outer_height, width+2*r]);\n translate([r, -r, r]) minkowski() {\n cube([width-2*r, r, width-2*r]);\n sphere(r);\n }\n }\n}\n\n\/\/ Final grabber structure\nmodule cushion_grabber(width) {\n tri_height = 2;\n base_height = 1;\n n = width \/ (2*tri_height); \/\/ each row is 2*tri_height, including space\n translate([0, width, 0]) rotate([90, 0, 0])\n difference() {\n union() { \n cube([width, base_height, width]);\n translate([0, base_height, 0]) prism_rows(tri_height, width, n);\n }\n dome(width);\n }\n}\n\n\ncushion_grabber(50);\n\/\/dome(100);\n\n\n\n\n\n","old_contents":"\/\/ Cushion Grabber - see README.md for details.\n\/\/ Author: Joseph M. Joy\n\nfunction range(stop, start=0, step=1) = [start: step: stop-1];\n\n\/\/ Coords of an isoceles right triangle\nfunction ir_tri(base) = [[0,0], [0, base], [base, 0]];\n\n\/\/ Extruded version\nmodule rt_prism(base, height) {\n linear_extrude(height) polygon(ir_tri(base));\n}\n\n\/\/ A row of them\nmodule prism_rows(base, height, n) {\n for (i = range(n)) {\n translate([2*base*i, 0, 0]) rt_prism(base, height);\n }\n}\n\n\/\/ \n\nprism_rows(10, 40, 10);\n\n\n\n\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"929a0a0ea0e98e595a3e2813222395fb9fb4b502","subject":"added tolerance","message":"added tolerance\n","repos":"fponticelli\/smallbridges","old_file":"resin\/tank\/modules.scad","new_file":"resin\/tank\/modules.scad","new_contents":"inch = 25.4;\nwidth = inch * 9;\nheight = inch * 6;\nglass_thickness = inch \/ 5 + 0.2;\nwall_thickness = inch \/ 8;\ncut_depth = 1;\ntank_depth = 40;\nsupport_height = 2;\nwall_height = tank_depth + support_height + glass_thickness;\n\nmodule glass(w,d,h) {\n color([1,1,1,0.35])\n cube([w,d,h], center=true);\n}\n\nmodule side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n color([1,0.1,0.0,0.85])\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.4,0.1,0.85])\n difference() {\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nmodule sideA() {\n side1(width + cut_depth * 0, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule sideB() {\n side2(height+(wall_thickness-cut_depth)*2, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n","old_contents":"inch = 25.4;\nwidth = inch * 9;\nheight = inch * 6;\nglass_thickness = inch \/ 5;\nwall_thickness = inch \/ 8;\ncut_depth = 1;\ntank_depth = 40;\nsupport_height = 2;\nwall_height = tank_depth + support_height + glass_thickness;\n\nmodule glass(w,d,h) {\n color([1,1,1,0.35])\n cube([w,d,h], center=true);\n}\n\nmodule side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n gap_width = width + 2;\n difference() {\n cube([width,height,wall_thickness], center=true);\n translate([\n -1,\n height \/ 2 - support_height - glass_thickness \/ 2,\n wall_thickness-cut_depth\n ])\n cube([gap_width,glass_thickness,wall_thickness], center=true);\n }\n}\n\nmodule side1(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n color([1,0.1,0.0,0.85])\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule side2(width, height, support_height, wall_thickness, cut_depth, glass_thickness) {\n height2 = height + 2;\n color([1,0.4,0.1,0.85])\n difference() {\n side0(width, height, support_height, wall_thickness, cut_depth, glass_thickness);\n translate([width\/2-wall_thickness\/2+1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n translate([-width\/2+wall_thickness\/2-1,0,wall_thickness-cut_depth])\n cube([wall_thickness+2,height2,wall_thickness], center=true);\n }\n}\n\nmodule sideA() {\n side1(width + cut_depth * 0, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n\nmodule sideB() {\n side2(height+(wall_thickness-cut_depth)*2, wall_height, support_height, wall_thickness, cut_depth, glass_thickness);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1bea6db7341a7266a933f9cd91d2ba0dea9fd4d2","subject":"Added more cable glands","message":"Added more cable glands\n","repos":"ksuszka\/3d-projects","old_file":"small\/car_battery_power_panel.scad","new_file":"small\/car_battery_power_panel.scad","new_contents":"\nmodule spacer1() {\n difference() {\n union() {\n cylinder(d=12,h=5,$fn=36);\n cylinder(d=7,h=6,$fn=36);\n }\n cylinder(d=4.5,h=100,center=true,$fn=36);\n }\n}\nmodule spacer2() {\n difference() {\n cylinder(d=14,h=1.7,$fn=36);\n translate([0,0,0.7]) {\n cylinder(d=9,h=10,$fn=36);\n translate([0,3,5])cube([3,5,10],true);\n }\n cylinder(d=5.5,h=100,center=true,$fn=36);\n }\n}\n\nmodule voltmeter_holder() {\n difference() {\n union() {\n cube([34,22,5],true);\n }\n cube([23.5,15,20],true);\n for(a=[0,1])mirror([a,0])translate([14,0]) cylinder(d=2,h=20,center=true,$fn=24);\n }\n}\nmodule fuse_holder() {\n difference() {\n union() {\n translate([-7,-7])cube([7+7+12,7+7+30+12,5]);\n }\n for(xy=[[0,0],[0,30],[12,42]]) translate(xy)\n cylinder(d=6,h=20,center=true,$fn=36);\n for(xy=[[10,0],[0,42],[12,30]]) translate(xy)\n cylinder(d=2.5,h=20,center=true,$fn=36);\n }\n}\n\nfuse_holder();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'small\/car_battery_power_panel.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"81d851252bfd9f151994a6b329363dd2f87e1c7a","subject":"Getting started on box itself","message":"Getting started on box itself\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"extras\/iotsaCase.scad","new_file":"extras\/iotsaCase.scad","new_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-5, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 20; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 3;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nmodule box() {\n innerXSize = (63-numberOfMMRemoved) + 5; \/\/ Add 5 for how far the esp12 antenna extends\n innerYSize = 43;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22, 0, 0]) cube([9, 2*boxFrontThickness, 11]);\n }\n union() {\n difference() {\n translate([-5-boxLeftThickness, -boxFrontThickness, -(boardThickness+iotsaSolderingHeight+boxBottomThickness)])\n union() {\n basicBox();\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n translate([0, innerYSize, 0])\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -boxFrontThickness, 0]) frontHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","old_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n translate([0, 0, 2])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-5, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\niotsaBoard();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"0ec2678329789ccc83e99deaa3ef8333ed3d152f","subject":"[3d] Add new Threaded Insert NutHardware 4.3mm diameter","message":"[3d] Add new Threaded Insert NutHardware 4.3mm diameter\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:5mm Injection Threaded Insert,2:Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1 || NutHardware == 2) { \/\/ Threaded inserts\n \/\/ 5mm injected molding threaded insert (M3 x 5.4 x 5.2 tall)\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall\n \/\/ Threaded insert (M3 x 4.6 x 5.7 tall)\n \/\/ 4.3mm dia 5.5mm tall, with 4.8mm alignment area at top 1.2mm tall\n nhd = [[5.0, 5.0, 5.6], [4.3, 5.5, 4.8]][NutHardware-1];\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n union() {\n cylinder((h_b-screw_l)+2, d=nhd[0]+2*wall, $fn=24);\n cylinder(1.2-e, d1=nhd[2]+2*wall, d2=nhd[0]+2*wall, $fn=24);\n translate([(nhd[0]+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([nhd[0]+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(nhd[1]+1.2, d=nhd[0], $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=nhd[2], d2=nhd[0], $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius != undef && radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor,None]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,Connectorless,1A+,Zero,3A+]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Include cutouts and mounts for LCD\/Buttons\nLCD = 1; \/\/ [0:None,1:2-line]\n\/\/ Thickness of side walls (mm) - Set to trace width multiple\nwall = 2.0;\n\/* [Advanced] *\/\n\/\/ Thickness of top and bottom faces (mm)\nwall_t = 1.45;\n\/\/ Height of the body edge bead chamfer (mm)\nbody_chamfer_height = 1.5;\n\/\/ Corner ear height (mm) - 0 to disable\nMouseEarHeight = 0;\n\/\/ Corner leg height (mm) - 0 to disable\nMouseLegHeight = 0; \/\/body_chamfer_height\/2;\n\/\/ Screw hardware\nNutHardware = 0; \/\/ [0:Captive Nut,1:Injection Threaded Insert]\n\n\/* [Hidden] *\/\n\/\/ External corner radius on the body (mm)\nbody_corner_radius = wall*2-1\/2;\nw_off = 0.5; \/\/ offset the heatermeter origin from the left edge\nd_off = 1.0; \/\/ offset the heatermeter origin from the front edge\nw = inch(3.725)+0.7+w_off; \/\/ overall interior case width\nd = inch(3.75)+1.0+d_off; \/\/ overall interior case depth\n\/\/ 19.1+ headless Zero\n\/\/ 22.4 headless Pi3 (limited by nuttrapps interfering with PCB to -6.7)\n\/\/ 32 standard\nh_b = [32.5-6.7, 32.5][LCD]; \/\/ overall interior case height\n\nprobe_centerline = 9.3; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 1.7;\nlcd_mount_t = 8.2 - (wall_t - 0.8);\npi_screw_t = 2.3;\n\nbody_chamfer_height_t = body_chamfer_height;\nbody_chamfer_height_b = body_chamfer_height;\n\nled_dia = 2.9;\nled_h = 4.6 - 1;\nled_fudge = 0.3; \/\/ total extra diameter to expand the hole and head sphere\nled_inset = 0.5; \/\/ amount to extend LED through case\n\ne = 0.01;\nis_jig = 0; \/\/ generate a jig for soldering LEDs\n\nfunction inch(x) = x*25.4;\n\necho(str(\"Case dimensions (mm): \", w+2*wall, \"x\", d+2*wall, \"x\", h_b+2*wall_t));\nmain();\n\nmodule main()\n{\n if (is_jig) {\n intersection() {\n hm43_split();\n translate([wall+6,-d-wall+3,-e]) cube([w-12,d-8,15]);\n }\n\n difference() {\n cube([w-12,d-8,8 - wall_t]);\n translate([wall,wall,-e]) cube([w-12-2*wall, d-8-2*wall, 8 - wall_t +2*e]);\n }\n } \/* is_jig *\/\n else\n hm43_split();\n}\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n}\n\nmodule pic_ex_cube(interior) {\n translate([0,33.75+interior*(pic_ex+1.3),2])\n cube_fillet([pic_ex+e, 59.8-interior*(pic_ex*2+1.3+1.5), 20.8], \n vertical=[0, (1-interior)*pic_ex, (1-interior)*pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n cylinder(wall_t+pi_screw_t, d=6.4, $fn=18);\n \/\/ alignment nubbies\n \/\/cylinder(wall_t+pi_screw_t+1.4, d=2.4, $fn=12);\n}\n\nmodule screw_keyhole() {\n d=6.2;\n d2=3.5;\n off=4.15; \/\/ ideally would be D but runs into edge of case\n h=3;\n \n cylinder(wall_t+2*e, d=d, $fn=18);\n translate([-d2\/2,0,0]) cube([d2,off,wall_t+2*e]);\n translate([0,off,0]) {\n cylinder(wall_t+2*e, d=d2, $fn=18);\n translate([0,0,wall_t+e]) cylinder(h+e, d=d, $fn=18);\n }\n}\n\nmodule screw_keyhole_p() {\n d=6.2+wall;\n h=2.3;\n \n difference() {\n cylinder(wall_t+h, d=d, $fn=18);\n translate([0,0,-e]) cylinder(wall_t+h+2*e, d=d-wall, $fn=18);\n translate([-d,0,-e]) cube([d*2, d\/2, wall_t+h+2*e]);\n }\n}\n\nmodule btn_rnd() {\n dia = is_jig ? 6.0 : 7.2; \/\/ TPU button covers was 8.0\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.5+e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led() {\n translate([0, 0, -(led_h+1)]) {\n cylinder(1, d=led_dia+0.3+led_fudge, $fn=24);\n translate([0, 0, 1-e]) cylinder(led_h-led_dia\/2+e, d=led_dia+led_fudge, $fn=24);\n translate([0, 0, 1+led_h-led_dia\/2]) sphere(d=led_dia+led_fudge, $fn=24);\n }\n}\n\nmodule led_pillar() {\n translate([0,0,-led_h-e])\n cylinder(led_h-led_inset, d=led_dia+led_fudge+2*wall, $fn=24);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=wall;\n nut_h=3.2;\n nut_ingress = 5.7;\n nut_d = nut_ingress \/ sin(60);\n nut_ingress_off = nut_ingress\/sqrt(3)\/2;\n oa_h=wall_t+0.4+nut_h+wall_t+[0,6.7][LCD];\n screw_l=[20,25][LCD];\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-d_off-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+d_off+ww_d, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n rotate(90) translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=16);\n \/\/ rectangular hole to remove some of the solid layer material\n translate([-5.7\/2, -(6*PI\/18)\/2, 0]) cube([5.7, 6*PI\/18, 3.5+0.3+e]);\n }\n \n \/\/ top half M3 nut trap\n if (NutHardware == 0) { \/\/ Captive Nut Slots\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-d_off, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+d_off+ww_d, oa_h+e],\n vertical=[ww_d\/2,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n \/\/ nut 2x for an elongated trap\n translate([-0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n translate([+0.2,0,0]) cylinder(nut_h*1.5+e, d=nut_d, $fn=6);\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n \/\/translate([-50,-50,-100]) cube([100,100,100+e]); \/\/ cutaway top\n }\n \/\/ nut ingress (sideways trapezoid with wider side at ingress)\n translate([nut_ingress_off,-nut_ingress\/2,wall_t+0.3])\n linear_extrude(nut_h+e) polygon([[0,0],\n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, -0.8], \n [nut_d\/2+ww_w-nut_ingress_off+0.4+e, nut_ingress+0.8],\n [0,nut_ingress]]);\n }\n } else if (NutHardware == 1) { \/\/ Inection molding threaded insert\n translate([0,0,h_b+wall_t-(h_b-screw_l+2)])\n difference() {\n \/\/ 5.0mm dia 5mm tall, with 5.6mm alignment area at top 1.2mm tall \n union() {\n cylinder((h_b-screw_l)+2, d=5.0+2*wall, $fn=24);\n cylinder(1.2-e, d1=5.6+2*wall, d2=5.0+2*wall, $fn=24);\n translate([(5.0+2*wall)\/-2, -nut_ingress\/2-d_off, 0])\n cube([5.0+2*wall, nut_ingress\/2+d_off, (h_b-screw_l)+2]);\n }\n cylinder(5+1.2, d=5.0, $fn=24);\n translate([0,0,-e]) cylinder(1.2, d1=5.6, d2=5.0, $fn=24); \/\/ alignment helper\n }\n }\n}\n\nmodule locklip_p(l, l_offset=0,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=2.5, \/\/ thickness of attachment beam\n insert_inset=[0,0] \/\/ inset the insert inside mating area\n ) {\n translate([l_offset,0,0]) rotate([90,0,90])\n difference() {\n linear_extrude(l-2*l_offset, convexity=11) polygon(points=[\n [0.1, -lip_w-lip_insert_depth-lip_h_off], \/\/ 0.1 to add depth to keep extrusion manifold\n [-lip_w-lip_insert_depth-lip_h_off, 0],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_insert_depth-lip_h_off, 0],\n [0.1, 0]\n ]);\n translate([-lip_w-lip_insert_depth-lip_h_off-e, 0, 0]) {\n if (insert_inset[0] > 0)\n translate([0,0,-e])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[0]+e]);\n if (insert_inset[1] > 0)\n translate([0, 0, l-2*l_offset-insert_inset[1]])\n cube([lip_w+lip_insert_depth+lip_h_off+0.1+2*e,\n lip_v_off+2*lip_insert_depth+e, insert_inset[1]+e]);\n }\n }\n}\n\nmodule locklip_n(l, l_offset=0,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n \/\/ (Note LCD is not centered vertically on PCB, top is 5.15, bottom is 4.55mm)\n translate([1.0, 1.55, 0])\n cube([73.0, 27.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.5, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n \/\/translate([4.23, -2.5, 0])\n \/\/ cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule locklip_top_n(split) {\n translate([wall, d+wall, split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n}\n\nmodule hm_base() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=body_corner_radius, top=body_chamfer_height_t, \n bottom=body_chamfer_height_b, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([-pic_ex,wall+d_off,wall_t])\n pic_ex_cube(0);\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+d_off+10,wall_t+19]) tc_plusminus();\n\n \/\/ Eliminate the chamfer where the screws are\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n translate([inch(2.0),0,0]) cylinder(body_chamfer_height_b, d=6+2*wall, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n difference() {\n hm_base();\n\n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b],\n bottom=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n top=[pi_screw_t,pi_screw_t,pi_screw_t,pi_screw_t],\n vertical=[body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2,body_corner_radius\/2],\n $fn=[36,4,4]);\n if (Pi_Model != \"Zero\" && Pi_Model != \"1A+\" && Pi_Model != \"3A+\")\n translate([wall-pic_ex+e,wall+d_off,wall_t]) pic_ex_cube(1);\n } \/\/ main diff\n\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t])\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led_pillar(); \/\/red\n translate([0, inch(0.35), 0]) led_pillar(); \/\/yellow\n translate([0, inch(0.70), 0]) led_pillar(); \/\/green\n }\n } \/\/ main union\n\n \/\/ Probe jack side\n translate([w+wall*0.5, wall+d_off, wall_t+probe_centerline]) {\n \/\/ Probe jacks\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(0.4)-16.5\/2,-1.1]) cube([2*wall, 16.5, 6.5]);\n else if (Control_Probe == \"Thermistor\")\n translate([0,inch(0.28),0]) phole();\n if (Control_Probe != \"None\") {\n translate([0,inch(0.95)+inch(0.37)*0,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*1,0]) phole();\n translate([0,inch(0.95)+inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([0,wall+d_off,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.8]) jhole(15,13);\n translate([0,81.5,-1.8]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25,1.7]) jhole(16.4,13);\n \/\/ HM power jack\n translate([0,inch(0.2),4.2]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n if (LCD)\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n if (LCD) translate([wall+inch(1.925)+w_off, wall+d_off+inch(1.15), h_b+2*wall_t]) {\n \/\/translate([-inch(1.1)\/2,-13\/2,-wall_t-e]) cube([inch(1.1), 13, 0.5+e]); \/\/ clear space between\n translate([-inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ left\n translate([inch(1.1)\/2,0,-wall_t-e]) btn_rnd(); \/\/ right\n translate([0,inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ up\n translate([0,-inch(0.9)\/2,-wall_t-e]) btn_rnd(); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), led_inset]) {\n led(); \/\/red\n translate([0, inch(0.35), 0]) led(); \/\/yellow\n translate([0, inch(0.70), 0]) led(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.825)+0.5,wall+d_off+inch(0.1),0]) {\n screwhole();\n translate([inch(2.0),0,0]) screwhole();\n }\n \/\/ keyholes\n \/\/translate([wall+24,wall+d_off+39,-e]) {\n \/\/ translate([0,49,0]) screw_keyhole();\n \/\/ translate([58,49,0]) screw_keyhole();\n \/\/}\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d_off+39,0]) {\n translate([0,0,0]) screw_pimount();\n translate([58,0,0]) screw_pimount();\n if (Pi_Model == \"Zero\") {\n translate([0,23,0]) screw_pimount();\n translate([58,23,0]) screw_pimount();\n }\n else {\n translate([0,49,0]) screw_pimount();\n translate([58,49,0]) screw_pimount();\n \/\/translate([0,49,0]) screw_keyhole_p();\n \/\/translate([58,49,0]) screw_keyhole_p();\n }\n }\n\n if (Pi_Model != \"Zero\") {\n \/\/ Pi right edge stop\n translate([wall+w-9.5, wall+d_off+35, wall_t])\n difference() {\n cube_fillet([9.5,d-d_off-35,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22,-e]) cube_fillet([5.5,14.5,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n } \/\/ if !Zero\n \n \/\/ close nut traps\n if (!is_jig) translate([wall+inch(0.825)+w_off,wall+d_off+inch(0.1),0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n if (Pi_Model == \"3B\/2B\/1B+\")\n locklip_top_n(case_split);\n else\n locklip_top_n(probe_centerline);\n \n \/\/ LCD mount\n if (LCD) difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d_off+78, h_b+wall_t-lcd_mount_t])\n cube([w,d-d_off-78,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,34.0-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.375+w_off, wall+d_off+inch(2), h_b+wall_t-e]) {\n translate([0, 0, -lcd_mount_t]) lcd_neg();\n \/\/ vv Keep screw holes where they have been since the beginning\n translate([0, 0.5, 0]) lcd_mount();\n }\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([-pic_ex, wall+d_off, wall_t+2]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-2.2\/2, 1.5])\n cube_fillet([pic_ex+wall, 2.2, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n translate([0, 81.5-15\/2-3, 1.5])\n cube_fillet([pic_ex+wall, 2.5, 20.8-1.5], bottom=[0,pic_ex,0,2], top=[0,pic_ex]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips(split) {\n translate([wall, wall, split+wall_t]) {\n \/\/ bottom locklip (positive)\n translate([0,d,0]) {\n locklip_p(28, insert_inset=[0,0]);\n translate([w-34,0,0]) locklip_p(34-wall, insert_inset=[0,0]);\n }\n\n \/\/ front guide lip (left, mid, right)\n translate([body_corner_radius, 0, 0])\n rotate([0,90]) lip_guide(12);\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(25);\n translate([w-body_corner_radius-12, 0, 0])\n rotate([0,90]) lip_guide(12);\n \/\/ left guide lip assortment\n translate([0, d_off+5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n if (Pi_Model == \"Zero\" || Pi_Model == \"1A+\" || Pi_Model == \"3A+\")\n translate([0, d_off+40, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(45);\n else if (Pi_Model == \"3B\/2B\/1B+\") {\n *translate([-pic_ex, d_off+52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, d_off+70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n }\n \/\/ probe side guide lip\n translate([wall+w, wall+d-45, probe_centerline+wall_t])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 20;\n me_overlap = wall;\n me_outset_bottom = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_b - me_overlap) * 0.707;\n me_outset_top = (me_d\/2 - body_corner_radius\/4 - body_chamfer_height_t - me_overlap) * 0.707;\n\n \/\/ Bottom outside corners\n if (Pieces != \"Top\") {\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n\n \/\/ top outside corners\n if (Pieces != \"Bottom\") {\n translate([0,-1,me_h]) rotate([180]) {\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d=me_d, $fn=24);\n }\n }\n\n \/\/ common corner area\n translate([-me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n translate([w+2*wall+me_outset_bottom\/0.707, 0, 0])\n cylinder(me_h, d=me_d, $fn=24);\n}\n\nmodule mouseleg(isBottom) {\n MouseLegWidth = 2*0.63;\n if (isBottom)\n translate([body_chamfer_height_b+0.3, -MouseLegWidth\/2, 0])\n cube([body_corner_radius+body_chamfer_height_b, MouseLegWidth, MouseLegHeight]);\n else\n translate([body_chamfer_height_t+0.3, -MouseLegWidth\/2, h_b+2*wall_t-MouseLegHeight])\n cube([body_corner_radius+body_chamfer_height_t, MouseLegWidth, MouseLegHeight]);\n}\n\nmodule mouselegs(isBottom) {\n translate([body_chamfer_height_t+body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-135) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n body_chamfer_height_t+body_corner_radius\/2, 0])\n rotate(-45) mouseleg(isBottom);\n translate([w+2*wall-body_chamfer_height_t-body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(45) mouseleg(isBottom);\n translate([body_chamfer_height_t+body_corner_radius\/2,\n d+2*wall-body_chamfer_height_t-body_corner_radius\/2, 0])\n rotate(135) mouseleg(isBottom);\n}\n\nmodule split_volume() {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n difference() {\n translate([-pic_ex-1,-1,-1])\n cube([w+pic_ex+2*wall+2, d+2*wall+2, wall_t+case_split+1]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+e]);\n }\n }\n else\n translate([-w,-d,-e])\n cube([3*w, 3*d, wall_t+probe_centerline+2*e]);\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") translate([0,4,0]) {\n intersection() { \n hm43();\n split_volume();\n }\n if (Pi_Model == \"3B\/2B\/1B+\")\n hm43_bottom_lips(case_split);\n else\n hm43_bottom_lips(probe_centerline);\n if (MouseLegHeight > 0.0) mouselegs(true);\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-1,h_b+2*wall_t]) rotate([180]) {\n difference() {\n hm43();\n \/\/translate([11,5,h_b+2*wall_t-0.24]) linear_extrude(0.5)\n \/\/ text(\"HeaterMeter\", font = \"Liberation Sans:style=Bold Italic\");\n split_volume();\n }\n if (MouseLegHeight > 0.0) mouselegs(false);\n }\n } \/\/ if include top\n if (MouseEarHeight > 0.0)\n color(\"silver\") mouseears();\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n fn_V = $fn[0] == undef ? $fn : $fn[0];\n fn_T = $fn[1] == undef ? $fn : $fn[1];\n fn_B = $fn[2] == undef ? $fn : $fn[2];\n \n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], fn_V);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], fn_V);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], fn_T);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], fn_B);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dd57ade38d6c666b6839fc424d322cf71b0b4731","subject":"body: rename","message":"body: rename\n","repos":"jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course,jeslopcru\/code-refactoring-course","old_file":"class1\/exercise\/refactor\/body.scad","new_file":"class1\/exercise\/refactor\/body.scad","new_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nHEIGHT_TOP = 2 * BORDER_RADIUS_BODY;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\n\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n diameter_base = DIAMETER_BODY - HEIGHT_TOP;\n \n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n position_ring = [0,0,top_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n position_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{\n heigh_main = HEIGHT_BODY - (HEIGHT_NIPPLE + HEIGHT_TOP);\n \n position = [0,0,main_position_z()];\n \n translate(position)\n cylinder(\n h = heigh_main,\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\n\nmodule body()\n{ \n top_surface();\n top_shoulder();\n main_cylinder();\n \n \n\/\/Body bottom shoulder\ntranslate([0,0,main_position_z()])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","old_contents":"include ;\nHEIGHT_BODY = 44.5;\nDIAMETER_BODY = 10.4;\nBORDER_RADIUS_BODY = 0.2;\nHEIGHT_NIPPLE = 0.8;\n\nfunction top_position_z () = -(HEIGHT_NIPPLE + BORDER_RADIUS_BODY);\nfunction main_position_z() = -(HEIGHT_BODY - BORDER_RADIUS_BODY);\nmodule top_surface()\n{\n position = [0,0,top_position_z()];\n \n correction_diameter = (2 * BORDER_RADIUS_BODY);\n diameter_base = DIAMETER_BODY - correction_diameter;\n\n translate(position)\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = diameter_base,\n $fn = FINE);\n}\n\nmodule top_shoulder()\n{\n position_ring = [0,0,top_position_z()];\n \n position_circle_x = radius(DIAMETER_BODY)-BORDER_RADIUS_BODY;\n position_circle = [position_circle_x, 0, 0];\n \n translate(position_ring)\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate(position_circle)\n circle(r = BORDER_RADIUS_BODY, $fn = FINE); \n}\n\nmodule main_cylinder()\n{\n position = [0,0,main_position_z()];\n translate(position)\n cylinder(\n h = (HEIGHT_BODY - (HEIGHT_NIPPLE + (2*BORDER_RADIUS_BODY))),\n d = DIAMETER_BODY,\n $fn = FINE);\n}\n\n\nmodule body()\n{ \n top_surface();\n top_shoulder();\n main_cylinder();\n \n \n\/\/Body bottom shoulder\ntranslate([0,0,main_position_z()])\n rotate_extrude(convexity = CONVEXITY, $fn = FINE)\n translate([(DIAMETER_BODY\/2)-BORDER_RADIUS_BODY, 0, 0])\n circle(r = BORDER_RADIUS_BODY, $fn = FINE);\n \n\/\/Bottom face of body\ntranslate([0,0,-(HEIGHT_BODY)])\n cylinder(\n h = BORDER_RADIUS_BODY, \n d = (DIAMETER_BODY - (2 * BORDER_RADIUS_BODY)),\n $fn = FINE);\n}\n\nbody();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"69af9261d0cc1c8f9bcc76a94ccbefb0b7ca7b1f","subject":"whitespace","message":"whitespace\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/basics\/difference\/difference.scad","new_file":"openscad\/models\/src\/main\/openscad\/basics\/difference\/difference.scad","new_contents":"\ndifference()\n{\n cylinder(h = 3,\n r = 20);\n\n translate([0,0,-0.1])\n cube (center=true,\n size = [7, 7, 7]);\n}\n","old_contents":"\ndifference()\n{\n cylinder(h = 3,\n r = 20);\n\n translate([0,0,-0.1])\n cube (center=true, \n size = [7, 7, 7]);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"a5c6204d4bf4360717dd406d566e3617f102148b","subject":"reordering steps","message":"reordering steps\n","repos":"snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot,snhack\/LogoBot","old_file":"hardware\/assemblies\/LogoBot.scad","new_file":"hardware\/assemblies\/LogoBot.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"mit","lang":"OpenSCAD"} {"commit":"55b5a8cf5115d4cafe7e76813bb2ba2e4de609d0","subject":"Add shape ringSegment","message":"Add shape ringSegment\n","repos":"jsconan\/camelSCAD","old_file":"shape\/2D\/ellipse.scad","new_file":"shape\/2D\/ellipse.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Ellipse shapes.\n *\n * @package shape\/2D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector - Returns a vector containing the horizontal and vertical radius.\n *\/\nfunction sizeEllipse(r, d, rx, ry, dx, dy) =\n let(\n r = apply2D(r, rx, ry),\n d = apply2D(d, dx, dy)\n )\n [\n \/\/ use divisor() to ensure the values will be forced to anything but 0\n divisor(d[0] && !rx ? d[0] \/ 2 : r[0]),\n divisor(d[1] && !ry ? d[1] \/ 2 : r[1])\n ]\n;\n\n\/**\n * Computes the size of a ring.\n *\n * @param Number|Vector [r] - The radius of the ring or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the ring.\n * @param Number|Vector [d] - The diameter of the ring or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the ring hole.\n * @param Number [wy] - The vertical thickness of the ring hole.\n * @returns Vector[] - Returns two vectors containing the horizontal and vertical radius of the outer and the inner circles.\n *\/\nfunction sizeRing(r, w, d, rx, ry, dx, dy, wx, wy) =\n let(\n out = sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n w = apply2D(w, wx, wy),\n in = [\n max(min(out[0], out[0] - w[0]), 0),\n max(min(out[1], out[1] - w[1]), 0)\n ]\n )\n [ out, in ]\n;\n\n\/**\n * Computes the points that draw the sketch of an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawEllipse(r, d, rx, ry, dx, dy) =\n arc(\n r=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n a=DEGREES\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a pie slice.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPie(r, a=RIGHT, d, a1, a2, rx, ry, dx, dy) =\n let (\n a1 = deg(a1),\n a2 = a2 != undef ? deg(a2) : a1 + deg(a),\n angle = absdeg(a2 - a1),\n points = arc(r=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a1=a1, a2=a2)\n )\n \/\/ add the origin to the list of points, unless it is a complete circle\n !angle || angle == DEGREES ? points : complete(points, [0, 0])\n;\n\n\/**\n * Creates an ellipse at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule ellipse(r, d, rx, ry, dx, dy) {\n polygon(\n points = drawEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a pie slice at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pie(r, a=RIGHT, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = drawPie(r=r, a=a, d=d, a1=a1, a2=a2, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a chord at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the chord\n * @param Number [a1] - The start angle of the chord\n * @param Number [a2] - The end angle of the chord\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule chord(r, a=RIGHT, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = arc(r=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a=a, a1=a1, a2=a2),\n convexity = 10\n );\n}\n\n\/**\n * Creates a ring at the origin.\n *\n * @param Number|Vector [r] - The radius of the ring or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the ring.\n * @param Number|Vector [d] - The diameter of the ring or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the ring hole.\n * @param Number [wy] - The vertical thickness of the ring hole.\n * @returns Vector[] - Returns two vectors containing the horizontal and vertical radius of the outer and the inner circles.\n *\/\nmodule ring(r, w, d, rx, ry, dx, dy, wx, wy) {\n size = sizeRing(r=r, w=w, d=d, rx=rx, ry=ry, dx=dx, dy=dy, wx=wx, wy=wy);\n difference() {\n ellipse(r=size[0]);\n ellipse(r=size[1]);\n }\n}\n\n\/**\n * Creates a ring segment at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the ring.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the segment\n * @param Number [a1] - The start angle of the segment\n * @param Number [a2] - The end angle of the segment\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the ring hole.\n * @param Number [wy] - The vertical thickness of the ring hole.\n *\/\nmodule ringSegment(r, w, a=RIGHT, d, a1, a2, rx, ry, dx, dy, wx, wy) {\n size = sizeRing(r=r, w=w, d=d, rx=rx, ry=ry, dx=dx, dy=dy, wx=wx, wy=wy);\n polygon(\n points = concat(\n arc(r=size[0], a=a, a1=a1, a2=a2),\n reverse(arc(r=size[1], a=a, a1=a1, a2=a2))\n ),\n convexity = 10\n );\n}\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Ellipse shapes.\n *\n * @package shape\/2D\n * @author jsconan\n *\/\n\n\/**\n * Computes the size of an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector - Returns a vector containing the horizontal and vertical radius.\n *\/\nfunction sizeEllipse(r, d, rx, ry, dx, dy) =\n let(\n r = apply2D(r, rx, ry),\n d = apply2D(d, dx, dy)\n )\n [\n \/\/ use divisor() to ensure the values will be forced to anything but 0\n divisor(d[0] && !rx ? d[0] \/ 2 : r[0]),\n divisor(d[1] && !ry ? d[1] \/ 2 : r[1])\n ]\n;\n\n\/**\n * Computes the size of a ring.\n *\n * @param Number|Vector [r] - The radius of the ring or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the ring.\n * @param Number|Vector [d] - The diameter of the ring or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the ring hole.\n * @param Number [wy] - The vertical thickness of the ring hole.\n * @returns Vector[] - Returns two vectors containing the horizontal and vertical radius of the outer and the inner circles.\n *\/\nfunction sizeRing(r, w, d, rx, ry, dx, dy, wx, wy) =\n let(\n out = sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n w = apply2D(w, wx, wy),\n in = [\n max(min(out[0], out[0] - w[0]), 0),\n max(min(out[1], out[1] - w[1]), 0)\n ]\n )\n [ out, in ]\n;\n\n\/**\n * Computes the points that draw the sketch of an ellipse.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawEllipse(r, d, rx, ry, dx, dy) =\n arc(\n r=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n a=DEGREES\n )\n;\n\n\/**\n * Computes the points that draw the sketch of a pie slice.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @returns Vector[]\n *\/\nfunction drawPie(r, a=RIGHT, d, a1, a2, rx, ry, dx, dy) =\n let (\n a1 = deg(a1),\n a2 = a2 != undef ? deg(a2) : a1 + deg(a),\n angle = absdeg(a2 - a1),\n points = arc(r=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a1=a1, a2=a2)\n )\n \/\/ add the origin to the list of points, unless it is a complete circle\n !angle || angle == DEGREES ? points : complete(points, [0, 0])\n;\n\n\/**\n * Creates an ellipse at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule ellipse(r, d, rx, ry, dx, dy) {\n polygon(\n points = drawEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a pie slice at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the pie\n * @param Number [a1] - The start angle of the pie\n * @param Number [a2] - The end angle of the pie\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule pie(r, a=RIGHT, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = drawPie(r=r, a=a, d=d, a1=a1, a2=a2, rx=rx, ry=ry, dx=dx, dy=dy),\n convexity = 10\n );\n}\n\n\/**\n * Creates a chord at the origin.\n *\n * @param Number|Vector [r] - The radius or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [d] - The diameter or a vector that contains horizontal and vertical diameters.\n * @param Number [a] - The angle of the chord\n * @param Number [a1] - The start angle of the chord\n * @param Number [a2] - The end angle of the chord\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n *\/\nmodule chord(r, a=RIGHT, d, a1, a2, rx, ry, dx, dy) {\n polygon(\n points = arc(v=sizeEllipse(r=r, d=d, rx=rx, ry=ry, dx=dx, dy=dy), a=a, a1=a1, a2=a2),\n convexity = 10\n );\n}\n\n\/**\n * Creates a ring at the origin.\n *\n * @param Number|Vector [r] - The radius of the ring or a vector that contains horizontal and vertical radius.\n * @param Number|Vector [w] - The thickness of the ring.\n * @param Number|Vector [d] - The diameter of the ring or a vector that contains horizontal and vertical diameters.\n * @param Number [rx] - The horizontal radius.\n * @param Number [ry] - The vertical radius.\n * @param Number [dx] - The horizontal diameter.\n * @param Number [dy] - The vertical diameter.\n * @param Number [wx] - The horizontal thickness of the ring hole.\n * @param Number [wy] - The vertical thickness of the ring hole.\n * @returns Vector[] - Returns two vectors containing the horizontal and vertical radius of the outer and the inner circles.\n *\/\nmodule ring(r, w, d, rx, ry, dx, dy, wx, wy) {\n size = sizeRing(r=r, w=w, d=d, rx=rx, ry=ry, dx=dx, dy=dy, wx=wx, wy=wy);\n difference() {\n ellipse(r=size[0]);\n ellipse(r=size[1]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c80fbdd5a252076afb4f7687c7ea978b5bb55b85","subject":"removed shapr edges from the bottom of the print","message":"removed shapr edges from the bottom of the print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"heater_handle\/heater_handle.scad","new_file":"heater_handle\/heater_handle.scad","new_contents":"span=172;\ndia=18;\nh=60+dia;\n$fn=100;\n\nmodule _handle_main()\n{\n difference()\n {\n union()\n {\n \/\/ side blocks\n for(dx=[0, span])\n translate(dx*[1,0,0])\n cube([dia, h, dia\/2]);\n \/\/ top holder\n translate([dia, h, 0])\n cube([span-dia, dia, dia\/2]);\n \/\/ rounded edges\n for(dx=[0, span-dia])\n translate([dia+dx, h,0])\n cylinder(r=dia, h=dia\/2);\n }\n for(dx=[0, span-3*dia])\n translate([2*dia+dx, h-dia, -1])\n cylinder(r=dia, h=dia\/2+2);\n }\n}\n\nmodule _hole()\n{\n hull()\n for(dx=[-0.5, 0.5])\n translate([dx, 0, -1])\n cylinder(r=(3.8+0.5)\/2, h=dia\/2+2, $fn=20);\n}\n\n\nmodule _handle()\n{\n difference()\n {\n _handle_main();\n \/\/ left cut in\n translate([0, 0, -1])\n rotate(-45*[0, 0, 1])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ right cut it\n translate([span+dia, 0, dia+1])\n rotate([0, 180, 45])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ screw holes\n for(dx=[0, span])\n translate([dx+dia\/2, dia-2, 0])\n _hole();\n \/\/ removing shapr edges from the bottom\n translate([-1, 0, -1])\n cube([span+dia+2, 4, dia\/2+2]);\n }\n}\n\n_handle();\n\/\/_hole();\n","old_contents":"span=172;\ndia=18;\nh=60+dia;\n$fn=100;\n\nmodule _handle_main()\n{\n difference()\n {\n union()\n {\n \/\/ side blocks\n for(dx=[0, span])\n translate(dx*[1,0,0])\n cube([dia, h, dia\/2]);\n \/\/ top holder\n translate([dia, h, 0])\n cube([span-dia, dia, dia\/2]);\n \/\/ rounded edges\n for(dx=[0, span-dia])\n translate([dia+dx, h,0])\n cylinder(r=dia, h=dia\/2);\n }\n for(dx=[0, span-3*dia])\n translate([2*dia+dx, h-dia, -1])\n cylinder(r=dia, h=dia\/2+2);\n }\n}\n\nmodule _hole()\n{\n hull()\n for(dx=[-0.5, 0.5])\n translate([dx, 0, -1])\n cylinder(r=(3.8+0.5)\/2, h=dia\/2+2, $fn=20);\n}\n\n\nmodule _handle()\n{\n difference()\n {\n _handle_main();\n \/\/ left cut in\n translate([0, 0, -1])\n rotate(-45*[0, 0, 1])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ right cut it\n translate([span+dia, 0, dia+1])\n rotate([0, 180, 45])\n cube(dia*[1,2,1]+[0,0,2]);\n \/\/ screw holes\n for(dx=[0, span])\n translate([dx+dia\/2, dia-2, 0])\n _hole();\n }\n}\n\n_handle();\n\/\/_hole();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"1c9af1784afecbe57a1544ff64b0a7f2851727b9","subject":"x\/ends: fix endstop screw offsets","message":"x\/ends: fix endstop screw offsets\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"x-end.scad","new_file":"x-end.scad","new_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-2.45*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=NutHexM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=NutHexM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","old_contents":"include \ninclude \n\ninclude \ninclude \ninclude \nuse \nuse \n\nmotor_mount_wall_thick = xaxis_pulley[1] - xaxis_pulley[0]\/2 + 4*mm;\nxaxis_end_pulley_offset = 41*mm;\nxaxis_end_motorsize = lookup(NemaSideSize,xaxis_motor);\nxaxis_end_motor_offset=[xaxis_end_motorsize\/2+zaxis_bearing[1]\/2+1*mm,motor_mount_wall_thick-2*mm,0];\nxaxis_end_wz = xaxis_rod_distance+zaxis_bearing[2]+2*mm;\n\nxaxis_endstop_size = [10.3*mm, 20*mm, 6.3*mm];\nxaxis_endstop_screw_offset = [-1.8*mm, 0*mm, 0*mm];\n\nfunction xaxis_end_width(with_motor) = with_motor? xaxis_end_motorsize+xaxis_end_motor_offset[0] - xaxis_end_motorsize\/2 : zaxis_bearing[1]\/2+zaxis_nut[1];\n\nmodule xaxis_end_body(part, with_motor, beltpath_index=0, nut_top=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n bearing_sizey = zaxis_bearing[1] + 5*mm;\n\n xaxis_end_xrod_offset_z = xaxis_rod_l\/2 - (main_width\/2 + zmotor_mount_rod_offset_x);\n xaxis_rod_d_support = xaxis_rod_d+5*mm;\n xaxis_rod_l_support = xaxis_end_xrod_offset_z + 8*mm + (with_xrod_adjustment?8*mm:0);\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end_body(part=\"pos\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end_body(part=\"neg\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end_body(part=\"vit\", with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n translate([x*screw_dist\/2, 0, z*screw_dist\/2])\n cylindera(d=lookup(ThreadSize,xaxis_motor_thread)+4*mm, h=motor_mount_wall_thick, orient=[0,1,0], align=[0,-1,0], rounding_radius=2);\n }\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n \/\/ main nut support\n cylindera(h=zaxis_nut[4], d=zaxis_nut[0]+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ nut screw holes support\n for(x=[-1,1])\n translate([x*zaxis_nut[5], 0, 0])\n cylindera(h=zaxis_nut[4], d=lookup(ThreadSize, zaxis_nut[6])+5*mm, align=[0,0,1], round_radius=2);\n\n \/\/ lead screw\n \/\/ ensure some support for the leadscrew cutout all the way to the top\n \/*cylindera(h=xaxis_end_wz, d=zaxis_nut[2]*2, align=[0,0,1], round_radius=2);*\/\n }\n\n \/\/ x axis rod holders\n for(z=[-1,1])\n translate([0,0,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l_support, d=xaxis_rod_d_support, orient=[1,0,0], align=[-1,0,0], round_radius=2);\n\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n rcubea(xaxis_endstop_size, align=[-1,0,-1]);\n }\n\n \/\/ support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(h=xaxis_end_wz,d=bearing_sizey, orient=[0,0,1], align=[0,0,0], round_radius=2);\n\n \/\/ belt idler screw cut support\n for(z=[-1,1])\n for(y=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0,y*-xaxis_beltpath_width\/2,0])\n cylindera(orient=YAXIS, d=15*mm, h=7*mm, align=-y*YAXIS);\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cut support around z axis bearings\n translate([0, -xaxis_zaxis_distance_y, 0])\n translate([0,0,.1])\n cubea([bearing_sizey+.1, bearing_sizey+.2, xaxis_end_wz+.4], orient=[0,0,1], align=[0,-1,0]);\n\n \/\/ x smooth rods\n for(z=[-1,1])\n translate([0,0*mm,z*(xaxis_rod_distance\/2)])\n {\n xoff = - xaxis_end_xrod_offset_z -(with_xrod_adjustment?6:0)*mm;\n translate([xoff,0,0])\n cylindera(h=abs(xoff)+xaxis_end_width(with_motor)+1,d=xaxis_rod_d+.5*mm, orient=[1,0,0], align=[1,0,0]);\n\n if(with_xrod_adjustment)\n {\n translate([-xaxis_rod_l_support+5*mm,0,0])\n nut_trap_cut(nut=NutHexM4, trap_axis=YAXIS, orient=-XAXIS, align=XAXIS);\n\n translate([-xaxis_rod_l_support-7*mm,0,0])\n cylindera(d=10, h=10, orient=XAXIS);\n }\n }\n }\n else if(part==\"vit\")\n {\n }\n}\n\nmodule xaxis_end(part, with_motor=false, stop_x_rods=true, beltpath_index=0, show_motor=false, nut_top=false, show_nut=false, show_rods=false, show_bearings=false, with_xrod_adjustment=false)\n{\n nut_h = zaxis_nut[4];\n extrasize = with_motor?0*mm:0*mm;\n extrasize_align = 1;\n\n if(part==undef)\n {\n difference()\n {\n xaxis_end(part=\"pos\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n xaxis_end(part=\"neg\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n %xaxis_end(part=\"vit\", with_motor=with_motor, stop_x_rods=stop_x_rods, beltpath_index=beltpath_index, show_motor=show_motor, nut_top=nut_top, show_nut=show_nut, show_rods=show_rods, show_bearings=show_bearings, with_xrod_adjustment=with_xrod_adjustment);\n }\n else if(part==\"pos\")\n {\n hull()\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ projection against z, ensure easy print\n translate([0,0,-xaxis_end_wz\/2])\n linear_extrude(1)\n projection(cut=false)\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n }\n }\n else if(part==\"neg\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n \/\/ belt idler screw cut\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw_cut(nut=NutHexM5, h=xaxis_beltpath_width+13*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n \/\/endstop mount screw cuts\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n {\n screw_cut(nut=NutHexM2_5, screw_l=6*mm, screw_l_extra=0*mm, embed_head=false, with_head=true, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n \/*nut_trap_cut(nut=NutHexM2_5, screw_l=6*mm, screw_l_extra=0*mm, trap_axis=[-1,0,0], orient=[0,0,1], align=[0,0,-1]);*\/\n }\n\n xaxis_end_beltpath(height=xaxis_beltpath_height_body, width=xaxis_beltpath_width);\n\n \/\/ z smooth bearing mounts\n for(z=[-1,1])\n {\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n {\n bearing_mount_holes(\n bearing_type=zaxis_bearing,\n ziptie_type=ziptie_type,\n ziptie_bearing_distance=ziptie_bearing_distance,\n orient=[0,0,1],\n with_zips=true\n );\n \/*hull()*\/\n \/*{*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n\n \/*translate([-5*cm,0,0])*\/\n \/*cylindera(d=zaxis_bearing[1],h=xaxis_end_wz);*\/\n \/*}*\/\n }\n }\n\n if(with_motor)\n {\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, xaxis_motor);\n\n \/\/ axle\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n round_d=1.1*lookup(NemaRoundExtrusionDiameter, xaxis_motor);\n translate([0, .1, 0])\n translate([0,1,0])\n teardrop(d=round_d,h=motor_mount_wall_thick, tear_orient=[0,0,1], orient=[0,1,0], align=[0,-1,0], roll=90, truncate=0.9);\n\n \/\/ motor axle\n translate([0, .1, 0])\n cylindera(d=1.2*lookup(NemaAxleDiameter, xaxis_motor), h=lookup(NemaFrontAxleLength, xaxis_motor)+3*mm, orient=[0,1,0], align=[0,1,0]);\n\n \/\/ bearing for offloading force on motor shaft\n translate([0, -2.5*mm-xaxis_pulley[1]-.1, 0])\n scale(1.03)\n cylindera(d=bearing_MR105[1], h=6*mm, orient=[0,1,0], align=[0,-1,0]);\n\n for(x=[-1,1])\n for(z=[-1,1])\n translate([0,-xaxis_end_motor_offset[1],0])\n translate([x*screw_dist\/2, -(xaxis_beltpath_width\/2+4*mm), z*screw_dist\/2])\n {\n screw_cut(xaxis_motor_nut, h=25, with_nut=false, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n }\n\n \/\/ nut mount\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2])\n {\n union()\n {\n translate([0,0,-.1])\n {\n \/\/ nut\n cylindera(h=nut_h+1, d=zaxis_nut[0]*1.05, align=[0,0,1]);\n\n \/\/ lead screw\n translate([0,0,-.1])\n cylindera(h=lookup(NemaFrontAxleLength,zaxis_motor), d=zaxis_nut[2]*1.5, align=[0,0,1]);\n\n for(i=[-1,1])\n translate([i*zaxis_nut[5], 0, -zaxis_nut[3]])\n screw_cut(thread=zaxis_nut[6], h=20*mm, with_nut=false, orient=ZAXIS, align=ZAXIS);\n }\n }\n }\n }\n else if(part==\"vit\")\n {\n xaxis_end_body(part=part, with_motor=with_motor, beltpath_index=beltpath_index, nut_top=nut_top, with_xrod_adjustment=with_xrod_adjustment);\n\n if(with_motor)\n {\n translate([0,0,xaxis_beltpath_z_offsets[beltpath_index]])\n translate(xaxis_end_motor_offset)\n {\n \/\/ 1mm due to motor offset\n translate([0,-1*mm,0])\n {\n \/\/ 1mm between pulley and motor\n translate([0,-1*mm,0])\n pulley(xaxis_pulley, flip=false, orient=[0,1,0], align=[0,-1,0]);\n\n if(show_motor)\n {\n motor(xaxis_motor, NemaMedium, dualAxis=false, orientation=[-90,0,0]);\n }\n }\n }\n }\n\n \/\/endstop\n if($show_vit)\n {\n translate([xaxis_end_width(with_motor),0,(xaxis_rod_distance\/2)+xaxis_rod_d])\n {\n difference()\n {\n rcubea(xaxis_endstop_size, align=[-1,0,1]);\n\n translate(xaxis_endstop_screw_offset)\n for(y=[-1,1])\n translate([-5*mm,y*9.5*mm\/2,xaxis_endstop_size[2]])\n screw(nut=NutHexM2_5, h=6*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n \/\/ belt idler pulley screw\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n translate([0, -xaxis_beltpath_width\/2 - 7*mm, 0])\n {\n screw(nut=NutHexM5, h=25*mm, with_nut=true, orient=[0,1,0], align=[0,1,0]);\n }\n }\n\n for(z=[-1,1])\n translate([xaxis_end_pulley_offset,0,-xaxis_beltpath_z_offsets[max(0,beltpath_index)]])\n {\n pulley(xaxis_idler_pulley, orient=[0,1,0]);\n }\n\n if(show_nut)\n {\n mirror([0,0,nut_top?1:0])\n translate([zaxis_rod_screw_distance_x, -xaxis_zaxis_distance_y, -xaxis_end_wz\/2-zaxis_nut[3]])\n xaxis_end_znut();\n }\n\n\n if(show_rods)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n cylindera(d=zaxis_rod_d, h=zaxis_rod_l, orient=[0,0,1]);\n }\n\n if(show_bearings)\n {\n for(z=[-1,1])\n translate([0,0,z*xaxis_rod_distance\/2])\n translate([0, -xaxis_zaxis_distance_y, 0])\n bearing(zaxis_bearing);\n }\n }\n}\n\nmodule xaxis_end_beltpath(height, width, length = 1000, align=[0,0,0], orient=[1,0,0])\n{\n hull()\n for(z=[-1,1])\n translate([0,0,z*height\/2])\n teardrop(h=length, d=width, orient=orient, align=align, roll=-180*min(0,z), truncate=1);\n}\n\nmodule xaxis_end_znut()\n{\n difference()\n {\n union()\n {\n cylindera(d=zaxis_nut[1], h=zaxis_nut[3], orient=[0,0,1], align=[0,0,1]);\n cylindera(d=zaxis_nut[0], h=zaxis_nut[4], orient=[0,0,1], align=[0,0,1]);\n }\n\n translate([0,0,-.1])\n cylindera(d=zaxis_nut[2], h=zaxis_nut[4]+.2, orient=[0,0,1], align=[0,0,1]);\n }\n}\n\n\nif(false)\n{\n \/\/ x axis\n \/*translate([0,0,axis_pos_z])*\/\n {\n \/*if(!$preview_mode)*\/\n {\n zrod_offset = zmotor_mount_rod_offset_x;\n for(x=[-1,1])\n {\n z=xaxis_beltpath_z_offsets[x<0?0:x];\n xo = x>0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n xw = x<0?xaxis_end_pulley_offset:xaxis_end_motor_offset[0];\n translate([-main_width\/2-xo\/2, xaxis_zaxis_distance_y, z])\n rotate([90,0,0])\n color(\"black\")\n belt_path(main_width+xw, 6, xaxis_pulley_inner_d, orient=[1,0,0], align=[1,0,0]);\n }\n }\n\n \/*translate([axis_pos_x,0,0])*\/\n \/*{*\/\n \/\/ x carriage\n \/*attach(xaxis_carriage_conn, [[0,-xaxis_zaxis_distance_y,0],[0,0,0]])*\/\n \/*{*\/\n \/*x_carriage_full();*\/\n \/*}*\/\n \/*}*\/\n\n \/\/ x smooth rods\n color(color_rods)\n for(z=[-1,1])\n translate([xaxis_rod_offset_x,xaxis_zaxis_distance_y,z*(xaxis_rod_distance\/2)])\n cylindera(h=xaxis_rod_l,d=xaxis_rod_d, orient=[1,0,0]);\n\n for(x=[-1,1])\n translate([x*(main_width\/2), 0, 0])\n translate([x*(zmotor_mount_rod_offset_x),0,0])\n cylindera(h=zaxis_rod_l,d=zaxis_rod_d, orient=ZAXIS, align=[0,0,0]);\n\n for(x=[-1,1])\n {\n translate([x*(main_width\/2), 0, 0])\n {\n translate([0, xaxis_zaxis_distance_y, 0])\n translate([x*zmotor_mount_rod_offset_x, 0, 0])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_nut=true, show_motor=true, show_nut=true);\n }\n }\n }\n }\n\n}\n\nif(false)\n{\n for(x=[-1,1])\n translate([x*55,x*55,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n {\n xaxis_end(with_motor=true, beltpath_index=max(0,x), show_motor=false, show_nut=false, show_bearings=false, with_xrod_adjustment=true);\n }\n}\n\nmodule part_x_end_right()\n{\n x=1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n\nmodule part_x_end_left()\n{\n x=-1;\n translate([0,0,xaxis_end_wz\/2])\n mirror([max(0,x),0,0])\n xaxis_end(with_motor=true, beltpath_index=max(0,x), with_xrod_adjustment=true);\n}\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"c8bce477b924ba8cbb9a7f40155f0daebc381a8b","subject":"The rainmaker code was refactored to parameterize more arguments.","message":"The rainmaker code was refactored to parameterize more arguments.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/rainmaker.scad","new_file":"openscad\/models\/src\/main\/openscad\/music\/rainmaker\/rainmaker.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ebc81c8fe56b5630e1f598ddd1653ce85b9cf8a0","subject":"both elements on one drawing","message":"both elements on one drawing\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"navibot_sr8980_docking_station_walls\/all.scad","new_file":"navibot_sr8980_docking_station_walls\/all.scad","new_contents":"use \nuse \n\nleftWall();\ntranslate([0, -85, 0])\n rightWall();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'navibot_sr8980_docking_station_walls\/all.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"6f43e8592e6b52e10c87bd21f3c4e02eb8e87193","subject":"Tweaks","message":"Tweaks\n","repos":"cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa,cwi-dis\/iotsa","old_file":"extras\/iotsaCase.scad","new_file":"extras\/iotsaCase.scad","new_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nesp12AntennaStickout = 5; \/\/ How many mm the esp12 antenna sticks out of the iotsa board\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-esp12AntennaStickout, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 14; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 1.5;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually)\n\nmodule box() {\n innerXSize = (63-numberOfMMRemoved) + esp12AntennaStickout + 2*leeWay;\n innerYSize = 43 + 2*leeWay;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n retainerWidth = 3;\n retainerLength = 6;\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n module rightHoles() {\n }\n module bottomHoles() {\n \/\/ Holes in the bottom. X and Y are relative to inner box frontleft corner, Z should be 2*bottomThickness\n translate([3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, 3+strutThickness, 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n translate([innerXSize-3, innerYSize-(3+strutThickness), 0]) cylinder(2*boxBottomThickness, d=3, $fn=12);\n }\n \n union() {\n difference() {\n translate([-esp12AntennaStickout-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n \/\/ left retainer hole\n translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ right retainer hole\n translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize+boxFrontThickness-strutThickness, 0])\n cube([outerXSize, boxBackThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n * translate() rightHoles();\n translate([-esp12AntennaStickout, -leeWay, -(boardThickness+iotsaSolderingHeight+1.5*boxBottomThickness+leeWay)]) bottomHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","old_contents":"\/\/\n\/\/ This is the iotsa board itself, including the important connectors and\n\/\/ holes. You can define here if you have shortened the board, which will\n\/\/ not only change the board itself, but also the box we are going to create around it.\n\/\/\nnumberOfRowsRemoved = 0;\nextraMMRemoved = 0; \/\/ 0 if nothing removed, 2.2 if any rows removed.\nnumberOfMMRemoved = extraMMRemoved + (numberOfRowsRemoved*2.54);\n\nboardThickness = 1.8; \/\/ The thickness of the PCB board\nregulatorAngle = 35; \/\/ 0, or higher if you've bent the regulator over backwards.\n\nmodule iotsaBoard() {\n module esp12() {\n union() {\n cube([24, 16, 2]); \/\/ the esp-12 board\n translate([8, 1.5, 2]) cube([15, 13, 2.5]); \/\/ the metal cap\n }\n }\n module regulator() {\n rotate([-regulatorAngle, 0, 0])\n translate([0, 0, 5])\n union() {\n translate([0, 4.5, 0]) cube([10.2, 1.3, 15]);\n translate([0, 0, 0]) cube([10.2, 4.5, 8.5]);\n }\n }\n module powerjack() {\n difference() {\n cube([9, 15, 11]);\n translate([4.5, -1, 7]) rotate([-90, 0, 0]) cylinder(14, d=6);\n }\n }\n translate([0, 0, -1.8])\n union() {\n \/\/ The board\n difference() {\n cube([63-numberOfMMRemoved,43,1.8]);\n translate([2, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([2, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([36.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 2, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n translate([60.5, 41, -0.1]) cylinder(2, d=2, center=false, $fn=12);\n }\n \/\/ The components\n translate([-5, 13.5, 1.8]) esp12();\n translate([20, 15, 1.8]) regulator();\n translate([22, -3, 1.8]) powerjack();\n }\n}\n\n\/\/\n\/\/ Box parameters. We are going to compute the size from the parameters.\n\/\/\niotsaComponentHeight = 20; \/\/ Make sure this is high enough\niotsaSolderingHeight = 3; \/\/ How far the soldering extends below the board.\nboxThickness = 3;\nboxBottomThickness = boxThickness;\nboxFrontThickness = boxThickness; \/\/ This is where the power connector is\nboxLeftThickness = boxThickness;\nboxRightThickness = boxThickness;\nboxBackThickness = boxThickness;\nboxTopThickness = boxThickness;\n\nleeWay = 0.3; \/\/ gap we want between board and box (on all sides, individually)\n\nmodule box() {\n innerXSize = (63-numberOfMMRemoved) + 5 + 2*leeWay; \/\/ Add 5 for how far the esp12 antenna extends\n innerYSize = 43 + 2*leeWay;\n innerZSize = boardThickness + iotsaComponentHeight + iotsaSolderingHeight + 2*leeWay;\n \n outerXSize = innerXSize + boxLeftThickness + boxRightThickness;\n outerYSize = innerYSize + boxFrontThickness + boxBackThickness;\n outerZSize = innerZSize + boxBottomThickness + boxTopThickness;\n \n strutThickness = 2;\n retainerWidth = 3;\n retainerLength = 6;\n \n module basicBox() {\n difference() {\n cube([outerXSize, outerYSize, outerZSize-boxTopThickness]);\n translate([boxLeftThickness, boxFrontThickness, boxBottomThickness])\n cube([innerXSize, innerYSize, innerZSize+1]);\n }\n }\n module frontHoles() {\n \/\/ Holes in the front. X and Z relative to iotsa frontleft corner, Y should be 2*frontThickness.\n translate([22-leeWay, 0, 0-leeWay]) cube([9+2*leeWay, 2*boxFrontThickness, 11+2*leeWay]);\n }\n union() {\n difference() {\n translate([-5-boxLeftThickness-leeWay, -boxFrontThickness-leeWay, -(boardThickness+iotsaSolderingHeight+boxBottomThickness+leeWay)])\n union() {\n \/\/ The box itself, with the cutouts for the lid\n difference() {\n basicBox();\n \/\/ Front cutout\n translate([boxLeftThickness, -boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 2*boxFrontThickness, 2*boxTopThickness]);\n \/\/ back cutout\n translate([boxLeftThickness, innerYSize+boxFrontThickness-0.5*leeWay, outerZSize-boxTopThickness-boxBottomThickness]) \n cube([innerXSize, 0.5*boxBackThickness+leeWay, 0.5*boxTopThickness]);\n \/\/ left retainer hole\n # translate([boxLeftThickness,-0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n \/\/ right retainer hole\n # translate([outerXSize-boxRightThickness-retainerWidth, -0.5*boxFrontThickness, outerZSize-boxTopThickness-boxBottomThickness-retainerLength]) \n cube([retainerWidth, 2*boxFrontThickness, retainerWidth]); \n }\n \/\/ The front support for the iotsa board\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n \/\/ The back support for the outsa board\n translate([0, innerYSize, 0])\n cube([outerXSize, boxFrontThickness+strutThickness, boxBottomThickness+iotsaSolderingHeight]);\n }\n translate([0, -1.5*boxFrontThickness-leeWay, 0]) frontHoles();\n }\n % iotsaBoard();\n }\n}\nbox();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"762107152930643dd445d25e555c9125f67dc343","subject":"Fix for new camera enclosure size.","message":"Fix for new camera enclosure size.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=inner_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Jan, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nwindow_thickness = 2.4; \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nthickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus light holder, plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ light bar\nlight_bar_width = 30;\nlight_pos_x = 50;\nlight_height = height-thickness*2-8;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_LIGHT_BAR) {\n projection() light_bar();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_supports(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n side(y=0);\n side(y=depth);\n tank_base();\n light_bar();\n camera_supports(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_supports(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness) {\n translate([x-face_thickness\/2, -overhang, 0])\n cube([face_thickness,depth+overhang*2,height]);\n}\n\nmodule rounded_truncation(up, rot=[0,0,0]) {\n real_overhang=overhang-thickness\/2;\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon\/2,0])\n cube([100, real_overhang+epsilon, truncation_height]);\n if (up) {\n translate([-50, real_overhang\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n else {\n translate([-50, real_overhang\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=real_overhang, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_supports(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 10;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=inner_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100, $fn=50);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n}\n\nmodule light_bar_opening() {\n \/\/ A wider opening, so the bar can slide out of the way of placing or removing the fish tank\n translate([light_pos_x-light_bar_width\/4, -outset, light_height])\n cube([light_bar_width*2, depth+outset*2, thickness]);\n}\n\nmodule light_bar() {\n translate([light_pos_x-light_bar_width\/2, -outset, light_height])\n difference() {\n cube([light_bar_width, depth+outset*2, thickness]);\n cutouts(2,light_bar_width,outset,rot=0,trans=[light_bar_width\/2,0,0]);\n cutouts(2,light_bar_width,outset,rot=180,trans=[light_bar_width\/2,depth+outset*2,0]);\n }\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true, $fn=50);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n light_bar_opening();\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"76af2279d032b80408c18ddb666756fddcd24383","subject":"added parameter for N elements","message":"added parameter for N elements\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"filter_support\/filter_support.scad","new_file":"filter_support\/filter_support.scad","new_contents":"eps=0.01;\nN = 4;\n\nmodule support()\n{\n rotate([90, 0, 0])\n {\n \/\/ main block\n intersection()\n {\n difference()\n {\n cube([30, 30, 10]);\n \/\/ magnet hole\n translate([5, -eps, 10\/2])\n rotate([-90, 0, 0])\n cylinder(d=5+0.5, h=5+0.5+eps, $fn=25);\n \/\/ main rounding\n translate([30, 30, -eps])\n cylinder(r=30, h=10+2*eps, $fn=200);\n }\n \/\/ truncating sharp edges\n cube([25, 25, 10+2*eps]);\n }\n \/\/ support prolonging\n cube([1.2, 35, 10]);\n }\n}\n\n\nfor(i=[0:N-1])\n translate([0, i*(10+3), 0])\n support();\n","old_contents":"eps=0.01;\n\nmodule support()\n{\n rotate([90, 0, 0])\n {\n \/\/ main block\n intersection()\n {\n difference()\n {\n cube([30, 30, 10]);\n \/\/ magnet hole\n translate([5, -eps, 10\/2])\n rotate([-90, 0, 0])\n cylinder(d=5+0.5, h=5+0.5+eps, $fn=25);\n \/\/ main rounding\n translate([30, 30, -eps])\n cylinder(r=30, h=10+2*eps, $fn=200);\n }\n \/\/ truncating sharp edges\n cube([25, 25, 10+2*eps]);\n }\n \/\/ support prolonging\n cube([1.2, 35, 10]);\n }\n}\n\n\nsupport();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"82af44c4ca70ca51a2051f535f8411753c3e7d5a","subject":"add stl","message":"add stl\n","repos":"hagleitn\/GuerrillaRadio,hagleitn\/GuerrillaRadio","old_file":"hardware\/controllerv2.scad","new_file":"hardware\/controllerv2.scad","new_contents":"use ;\nuse ;\n\ndebug = false;\nno_fillet = true;\n\nprint = false;\n\n$fa = 48; \/\/ 12 for printing\n$fs = 8; \/\/ 2 for printing\n$fn = 0;\n\nrender_outer = false;\nrender_full = false;\nrender_all = true;\n\n\/\/ thickness of the shell\nwall = 3;\n\n\/\/ handle dimensions\nhandle_max_width = 35;\nhandle_min_width = 20;\nhandle_length = 75;\n\n\/\/ used to avoid phantom wall when cutting objects\nspace = 1;\n\n\/\/ dimensions of the 4 switches\nswitch_r = 4;\nswitch_offset = [7,7]; \/\/ relative to top and bottom corner\n\n\/\/ dimensions of the led\nled_r = 3;\nled_offset = 2; \/\/ relative to bottom of the gimbal\n\n\/\/ dimensions of the module bay\nmodule_bay = [60,45,18];\ncutout = [13,4];\ncutout_offset = [3,3];\nmodule_bay_lip = 3;\n\n\/\/ gimbal dimensions\ngimbal = [58,58,30];\ngimbal_r = 25;\n\n\/\/ dimensions of 4 gimbal screws per gimbal\ngimbal_screw_offset = [5,5];\ngimbal_screw_r = 1.5;\ngimbal_space = [0,0];\n\n\/\/ power switch dimension\nswitch_cutout = [10,20];\n\n\/\/ angle of left and right side of controller\nside_angle = 10;\n\n\/\/ inclination of the handles\ntilt_angle = 25;\n\n\/\/ screw dimensions\nnut_r = 2.1;\nscrew_head_r = 2;\nscrew_body_r = 1;\nholder_r = 3.5;\nseparator = 4;\n\n\/\/ trim switches\ntrim_switch_r = 6.5\/2;\n\ndims = [gimbal[0]*2+gimbal_space[0]*2,\n max(gimbal[1]+2*gimbal_space[1], module_bay[1]+2*wall+2*module_bay_lip),\n gimbal[2]];\n \n\/\/ needs to be bigger than model\nbox_size = (max(dims[0],dims[1],dims[2]) + handle_length) * 10;\n \nmodule module_bay_cutout() {\n cube([15,2*wall,16], center=true);\n}\n\nmodule module_bay(solid=false) {\n translate([0,0,-wall])\n difference() {\n union() {\n translate([0,0,module_bay[2]\/2+wall\/2])\n cube([module_bay[0]+2*wall, module_bay[1]+2*wall, module_bay[2]+wall], center=true);\n difference() {\n translate([0,0,(module_bay_lip+wall)\/2+module_bay[2]])\n cube([module_bay[0]+2*wall+2*module_bay_lip, \n module_bay[1]+2*wall+2*module_bay_lip, \n module_bay_lip+wall], center=true);\n if (!solid) \n translate([0,0,module_bay[2]\/2+wall])\n cube([module_bay[0]+2*wall, \n module_bay[1]+2*wall, \n module_bay[2]+wall], center=true);\n } \n }\n \n if (!solid) {\n translate([0,0,module_bay[2]+module_bay_lip\/2+wall])\n cube([module_bay[0]+2*module_bay_lip, \n module_bay[1]+2*module_bay_lip, \n module_bay_lip], center=true);\n \n translate([0,0,wall+module_bay[2]\/2]) \n cube([module_bay[0], module_bay[1], module_bay[2]], center=true);\n \n \n translate([module_bay[0]\/2-cutout[0]-cutout_offset[0], \n module_bay[1]\/2-cutout[1]-cutout_offset[1],\n -space])\n cube([cutout[0], cutout[1], wall+2*space]);\n \n translate([0,module_bay[1]\/2+wall,wall+8]) module_bay_cutout();\n translate([0,-module_bay[1]\/2-wall,wall+8]) module_bay_cutout();\n }\n }\n}\n\n\/\/!module_bay();\n\nmodule core(d = [10,10,10], offset = 0, solid=false) {\n scale_cylinder = [1,0.1,1];\n \n addition = sin(side_angle)*d[1];\n \n minkowski() {\n hull() {\n translate([0,-d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,d[0]\/2+addition,d[0]\/2,center=true);\n translate([0,d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,r=d[0]\/2,center=true);\n }\n scale([0.6,0.6,1]) sphere(d[2]\/2 - offset);\n }\n}\n\nmodule core_with_bay(solid=false, debug=false) {\n if (!debug && !no_fillet) {\n fillet(r=25,steps=20) {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n } else {\n union() {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n }\n}\n\nmodule handle(debug=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n tilt_vector = tilt_angle*[cos(side_angle),sin(side_angle),0];\n sf = 0.75;\n scale_vector = [1,1,sf];\n \n hull() {\n difference() {\n core_with_bay(debug=debug);\n translate([-handle_max_width,0,0]) \n rotate([0,0,side_angle+5]) \n cube(dims[0],center=true);\n translate([0,11,0]) \n rotate([0,0,side_angle+5]) \n cube([2*dims[0],dims[0],dims[0]],center=true);\n }\n scale(scale_vector)\n rotate(tilt_vector)\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length,\n dims[2]\/2-sf*handle_min_width\/2])\n sphere(handle_min_width);\n }\n}\n\nmodule core_with_bay_and_handles(debug=false) {\n union() {\n core_with_bay(debug=debug);\n handle(debug=debug);\n mirror() handle(debug=debug);\n }\n}\n\nmodule skin(debug=false, thickness=5, box=box_size) {\n if (!debug) intersection() { \n children(); \n minkowski() {\n cylinder(thickness,thickness,0,$fn=3,center=true);\n difference() { \n cube(box,center=true); \n children(); \n } \n } \n }\n \n if (debug) children();\n}\n\nmodule cutouts() {\n \n h = 2*wall+2*space;\n\n \/\/ gimbal cutout\n translate([gimbal[0]\/2,0,dims[2]\/2]) \n cylinder(h, r=gimbal_r, center=true);\n \n \/\/ gimbal screw cutout\n translate([gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n translate([gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n \/\/ switches\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, dims[2]\/2-switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, -dims[2]\/2+switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n \n \/\/ power switch\n translate([0,dims[1]\/2+dims[2]\/2,0]) \n rotate([0,90,90])\n cube([switch_cutout[0], switch_cutout[1], gimbal[1]\/2], center=true);\n \n \/\/ led\n translate([0,-gimbal[1]\/2-led_offset-led_r,gimbal[2]\/2]) \n cylinder(h, r=led_r, center=true);\n \n \/\/ trim switches\n translate([-dims[0]\/2+handle_min_width+trim_switch_r-5, -dims[1]\/2-16, 0]) \n rotate([0,45,-25]) \n translate([0,0,dims[2]\/2]) \n cylinder(h=dims[2], r=trim_switch_r, center=true);\n}\n\nmodule screw_cylinder(h=30, solid=false) {\n spacing = 2;\n l = (h-separator)\/2;\n union() {\n translate([0,0,separator\/2+l\/2+spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=nut_r, $fn=6, center=true);\n }\n translate([0,0,separator\/2+spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-l\/2-spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=screw_head_r, center=true);\n }\n }\n}\n\nmodule screw__(solid=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n sf = 0.75;\n\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length-handle_min_width+4,\n dims[2]\/2-sf*handle_min_width\/2-3])\n rotate([tilt_angle,0,0]) \n translate([0,0,-handle_max_width-7])\n mirror([0,0,1]) \n screw_cylinder(2*handle_max_width, solid=solid);\n}\n\nmodule screw___(solid=false) { \n screw_offset = -3;\n \n translate([-module_bay[0]\/2+screw_offset-holder_r,gimbal[1]\/2+holder_r+1,0])\n mirror([0,0,1]) \n screw_cylinder(2*(gimbal[2]+module_bay[2]+wall), solid=solid);\n}\n\nmodule screw_(solid=false, debug=false) {\n intersection() {\n union() {\n screw__(solid=solid);\n screw___(solid=solid);\n }\n core_with_bay_and_handles(debug=debug);\n }\n}\n\n\/\/screw_cylinder();\nmodule screws(solid=false, debug=false) {\n screw_(solid=solid, debug=debug);\n mirror() screw_(solid=solid, debug=debug);\n}\n \nmodule body(solid = false, w = wall) {\n difference() {\n union() {\n difference() {\n skin(debug=debug,thickness=w, box=box_size) {\n core_with_bay_and_handles(debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(true);\n screws(solid=true, debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid);\n screws(solid=false, debug=debug);\n }\n \n if (!solid) cutouts();\n if (!solid) mirror() cutouts();\n }\n}\n\nmodule full_skin() render() {\n if (render_full || render_all) {\n body(w=wall);\n } else {\n import(\"full_skin.stl\");\n }\n}\n\nmodule inner_skin() render() {\n difference() {\n full_skin();\n outer_skin();\n }\n}\n\nmodule outer_skin() render() {\n if (render_outer || render_all) {\n body(w=wall\/2);\n } else {\n import(\"outer_skin.stl\");\n }\n}\n\nmodule bottom(box=box_size) {\n union () {\n difference() {\n outer_skin();\n translate([0,0,box\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2]) \n cube(box, center=true);\n }\n\n difference() {\n full_skin();\n translate([0,0,box\/2-wall\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2-wall\/2]) \n cube(box, center=true);\n }\n }\n}\n\nmodule cut_in_halves() {\n union() {\n translate([-100,0,gimbal[2]\/2]) difference() { \n bottom(box=box_size); \n battery_compartments(solid=true); \n }\n \n translate([100,0,0]) difference() { \n full_skin(); \n bottom(box=box_size); \n }\n }\n}\n\n\nmodule battery_compartments(solid=false) {\n union() {\n battery_compartment(solid);\n mirror() battery_compartment(solid);\n }\n}\n\nbatt = [61,21,24];\nbatt_pos = [-dims[0]\/2-2,-66,-16];\nbatt_rot = [90,26,-101];\n\nmodule battery_compartment_(solid = false) {\n offset = solid ? wall : 0;\n union() {\n intersection() {\n outer_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,offset\/2])\n cube([batt[0]+wall,batt[1],batt[2]-offset],center=true);\n }\n \n intersection() {\n inner_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot) \n translate([0,0,wall\/4+offset\/2])\n cube([batt[0],batt[1],batt[2]+wall\/2-offset],center=true);\n } \n \n \/\/ cutout to open compartment\n if (solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n union() {\n translate([0,0,wall\/2])\n cube([batt[0],batt[1],batt[2]-wall],center=true);\n translate([0,0,-batt[2]\/2]) \n cube([batt[2]\/2,batt[1],2*wall],center=true);\n }\n }\n }\n}\n\nmodule battery_compartment(solid=false) {\n difference() {\n union() {\n difference() {\n battery_compartment_(solid);\n \n \/\/ cutout block to be able to unlatch\n if (!solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2+wall])\n cube([batt[2],batt[1],wall],center=true);\n }\n }\n \n if (!solid) {\n scale([1.01,1.01,1.01])\n union() {\n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n }\n \n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n \n }\n }\n }\n }\n \n if (!solid) {\n difference() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2],batt[1],wall+2],center=true);\n }\n\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2]\/2,batt[1],wall+2],center=true);\n }\n }\n }\n }\n}\n\nif (render_outer) {\n outer_skin();\n} else if (render_full) {\n full_skin();\n} else {\n union() {\n cut_in_halves();\n translate([-100,dims[1]\/2+2*module_bay[1],0]) rotate([0,180,90]) module_cover();\n translate([-100,-dims[1]\/2-2*module_bay[1],0]) battery_compartments();\n }\n}","old_contents":"use ;\nuse ;\n\n$fa = 12; \/\/48\n$fs = 2; \/\/8\n$fn = 0;\n\ndebug = false;\n\nrender_outer = false;\nrender_full = false;\nrender_all = true;\n\n\/\/$fa = 0.5; \/\/ default minimum facet angle is now 0.5\n\/\/$fs = 0.5; \/\/ default minimum facet size is now 0.5 \n\/\/$fn = 50;\n\n\/\/ thickness of the shell\nwall = 3;\n\n\/\/ handle dimensions\nhandle_max_width = 35;\nhandle_min_width = 20;\nhandle_length = 75;\n\n\/\/ used to avoid phantom wall when cutting objects\nspace = 1;\n\n\/\/ dimensions of the 4 switches\nswitch_r = 4;\nswitch_offset = [7,7]; \/\/ relative to top and bottom corner\n\n\/\/ dimensions of the led\nled_r = 3;\nled_offset = 2; \/\/ relative to bottom of the gimbal\n\n\/\/ dimensions of the module bay\nmodule_bay = [60,45,18];\ncutout = [13,4];\ncutout_offset = [3,3];\nmodule_bay_lip = 3;\n\n\/\/ gimbal dimensions\ngimbal = [58,58,30];\ngimbal_r = 25;\n\n\/\/ dimensions of 4 gimbal screws per gimbal\ngimbal_screw_offset = [5,5];\ngimbal_screw_r = 1.5;\ngimbal_space = [0,0];\n\n\/\/ power switch dimension\nswitch_cutout = [10,20];\n\n\/\/ angle of left and right side of controller\nside_angle = 10;\n\n\/\/ inclination of the handles\ntilt_angle = 25;\n\n\/\/ screw dimensions\nnut_r = 2.1;\nscrew_head_r = 2;\nscrew_body_r = 1;\nholder_r = 3.5;\nseparator = 4;\n\n\/\/ trim switches\ntrim_switch_r = 6.5\/2;\n\ndims = [gimbal[0]*2+gimbal_space[0]*2,\n max(gimbal[1]+2*gimbal_space[1], module_bay[1]+2*wall+2*module_bay_lip),\n gimbal[2]];\n \nmodule module_bay_cutout() {\n cube([15,2*wall,16], center=true);\n}\n\nmodule module_bay(solid=false) {\n translate([0,0,-wall])\n difference() {\n union() {\n translate([0,0,module_bay[2]\/2+wall\/2])\n cube([module_bay[0]+2*wall, module_bay[1]+2*wall, module_bay[2]+wall], center=true);\n difference() {\n translate([0,0,(module_bay_lip+wall)\/2+module_bay[2]])\n cube([module_bay[0]+2*wall+2*module_bay_lip, \n module_bay[1]+2*wall+2*module_bay_lip, \n module_bay_lip+wall], center=true);\n if (!solid) \n translate([0,0,module_bay[2]\/2+wall])\n cube([module_bay[0]+2*wall, \n module_bay[1]+2*wall, \n module_bay[2]+wall], center=true);\n } \n }\n \n if (!solid) {\n translate([0,0,module_bay[2]+module_bay_lip\/2+wall])\n cube([module_bay[0]+2*module_bay_lip, \n module_bay[1]+2*module_bay_lip, \n module_bay_lip], center=true);\n \n translate([0,0,wall+module_bay[2]\/2]) \n cube([module_bay[0], module_bay[1], module_bay[2]], center=true);\n \n \n translate([module_bay[0]\/2-cutout[0]-cutout_offset[0], \n module_bay[1]\/2-cutout[1]-cutout_offset[1],\n -space])\n cube([cutout[0], cutout[1], wall+2*space]);\n \n translate([0,module_bay[1]\/2+wall,wall+8]) module_bay_cutout();\n translate([0,-module_bay[1]\/2-wall,wall+8]) module_bay_cutout();\n }\n }\n}\n\n\/\/!module_bay();\n\nmodule core(d = [10,10,10], offset = 0, solid=false) {\n scale_cylinder = [1,0.1,1];\n \n addition = sin(side_angle)*d[1];\n \n minkowski() {\n hull() {\n translate([0,-d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,d[0]\/2+addition,d[0]\/2,center=true);\n translate([0,d[1]\/2,0]) scale(scale_cylinder) \n cylinder(1,r=d[0]\/2,center=true);\n }\n scale([0.6,0.6,1]) sphere(d[2]\/2 - offset);\n }\n}\n\nmodule core_with_bay(solid=false, debug=false) {\n if (!debug) {\n fillet(r=25,steps=20) {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n } else {\n union() {\n core(dims, solid=true);\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid=true);\n }\n }\n}\n\nmodule handle(debug=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n tilt_vector = tilt_angle*[cos(side_angle),sin(side_angle),0];\n sf = 0.75;\n scale_vector = [1,1,sf];\n \n hull() {\n difference() {\n core_with_bay(debug=debug);\n translate([-handle_max_width,0,0]) \n rotate([0,0,side_angle+5]) \n cube(dims[0],center=true);\n translate([0,11,0]) \n rotate([0,0,side_angle+5]) \n cube([2*dims[0],dims[0],dims[0]],center=true);\n }\n scale(scale_vector)\n rotate(tilt_vector)\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length,\n dims[2]\/2-sf*handle_min_width\/2])\n sphere(handle_min_width);\n }\n}\n\nmodule core_with_bay_and_handles(debug=false) {\n union() {\n core_with_bay(debug=debug);\n handle(debug=debug);\n mirror() handle(debug=debug);\n }\n}\n\nmodule skin(debug=false, thickness=5, box=400) {\n if (!debug) intersection() { \n children(); \n minkowski() {\n cylinder(thickness,thickness,0,$fn=3,center=true);\n difference() { \n cube(box,center=true); \n children(); \n } \n } \n }\n \n if (debug) children();\n}\n\nmodule core_skin(debug=false, w=wall, box=400) {\n if (!debug) intersection() { \n core_with_bay_and_handles(); \n minkowski() {\n cylinder(w,w,0,$fn=3,center=true);\n difference() { \n cube(box,center=true); \n core_with_bay_and_handles(); \n } \n } \n }\n \n if (debug) core_with_bay_and_handles(debug=true);\n}\n\nmodule cutouts() {\n \n h = 2*wall+2*space;\n\n \/\/ gimbal cutout\n translate([gimbal[0]\/2,0,dims[2]\/2]) \n cylinder(h, r=gimbal_r, center=true);\n \n \/\/ gimbal screw cutout\n translate([gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],gimbal[1]\/2-gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n translate([gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n \n translate([gimbal[0] - gimbal_screw_offset[0],-gimbal[1]\/2+gimbal_screw_offset[1],dims[2]\/2]) \n cylinder(h, r=gimbal_screw_r, center=true);\n\n \/\/ switches\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, dims[2]\/2-switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n\n translate([-gimbal[0]+switch_offset[0], gimbal[1]\/2, -dims[2]\/2+switch_offset[1]]) \n rotate ([90,0,0]) \n cylinder(gimbal[1]\/2, r=switch_r, center=true);\n \n \/\/ power switch\n translate([0,dims[1]\/2+dims[2]\/2,0]) \n rotate([0,90,90])\n cube([switch_cutout[0], switch_cutout[1], gimbal[1]\/2], center=true);\n \n \/\/ led\n translate([0,-gimbal[1]\/2-led_offset-led_r,gimbal[2]\/2]) \n cylinder(h, r=led_r, center=true);\n \n \/\/ trim switches\n translate([-dims[0]\/2+handle_min_width+trim_switch_r-5, -dims[1]\/2-16, 0]) \n rotate([0,45,-25]) \n translate([0,0,dims[2]\/2]) \n cylinder(h=dims[2], r=trim_switch_r, center=true);\n}\n\nmodule screw_cylinder(h=30, solid=false) {\n spacing = 2;\n l = (h-separator)\/2;\n union() {\n translate([0,0,separator\/2+l\/2+spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=nut_r, $fn=6, center=true);\n }\n translate([0,0,separator\/2+spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-spacing\/2]) difference() {\n cylinder(separator\/2, r=holder_r, center=true);\n if (!solid) cylinder(separator\/2, r=screw_body_r, center=true);\n }\n translate([0,0,-separator\/2-l\/2-spacing\/2]) difference() {\n cylinder(l, r=holder_r, center=true);\n if (!solid) cylinder(l, r=screw_head_r, center=true);\n }\n }\n}\n\nmodule screw__(solid=false) {\n addition = (handle_length+dims[1])*sin(side_angle);\n sf = 0.75;\n\n translate([dims[0]\/2+addition-handle_min_width\/2,\n -dims[1]\/2-handle_length-handle_min_width+4,\n dims[2]\/2-sf*handle_min_width\/2-3])\n rotate([tilt_angle,0,0]) \n translate([0,0,-handle_max_width-7])\n mirror([0,0,1]) \n screw_cylinder(2*handle_max_width, solid=solid);\n}\n\nmodule screw___(solid=false) { \n screw_offset = -3;\n \n translate([-module_bay[0]\/2+screw_offset-holder_r,gimbal[1]\/2+holder_r+1,0])\n mirror([0,0,1]) \n screw_cylinder(2*(gimbal[2]+module_bay[2]+wall), solid=solid);\n}\n\nmodule screw_(solid=false, debug=false) {\n intersection() {\n union() {\n screw__(solid=solid);\n screw___(solid=solid);\n }\n core_with_bay_and_handles(debug=debug);\n }\n}\n\n\/\/screw_cylinder();\nmodule screws(solid=false, debug=false) {\n screw_(solid=solid, debug=debug);\n mirror() screw_(solid=solid, debug=debug);\n}\n \nmodule body(solid = false, w = wall) {\n difference() {\n union() {\n difference() {\n skin(debug=debug,thickness=w, box=2*dims[0]) {\n core_with_bay_and_handles(debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(true);\n screws(solid=true, debug=debug);\n }\n translate([0,0,-dims[2]\/2]) rotate([0,180,90])\n module_bay(solid);\n screws(solid=false, debug=debug);\n }\n \n if (!solid) cutouts();\n if (!solid) mirror() cutouts();\n }\n}\n\nmodule full_skin() render() {\n if (render_full || render_all) {\n body(w=wall);\n } else {\n import(\"full_skin.stl\");\n }\n}\n\nmodule inner_skin() render() {\n difference() {\n full_skin();\n outer_skin();\n }\n}\n\nmodule outer_skin() render() {\n if (render_outer || render_all) {\n body(w=wall\/2);\n } else {\n import(\"outer_skin.stl\");\n }\n}\n\nmodule bottom(box=400) {\n union () {\n difference() {\n outer_skin();\n translate([0,0,box\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2]) \n cube(box, center=true);\n }\n\n difference() {\n full_skin();\n translate([0,0,box\/2-wall\/2]) cube(box, center=true);\n translate([0,-gimbal[1]\/2,0])\n rotate([tilt_angle,0,0]) \n translate([0,0,box\/2-wall\/2]) \n cube(box, center=true);\n }\n }\n}\n\nmodule cut_in_halves() {\n union() {\n translate([-100,0,gimbal[2]\/2]) difference() { \n bottom(box=2*dims[0]); \n battery_compartments(solid=true); \n }\n \n translate([100,0,0]) difference() { \n full_skin(); \n bottom(box=2*dims[0]); \n }\n }\n}\n\n\nmodule battery_compartments(solid=false) {\n union() {\n battery_compartment(solid);\n mirror() battery_compartment(solid);\n }\n}\n\nbatt = [61,21,24];\nbatt_pos = [-dims[0]\/2-2,-66,-16];\nbatt_rot = [90,26,-101];\n\nmodule battery_compartment_(solid = false) {\n offset = solid ? wall : 0;\n union() {\n intersection() {\n outer_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,offset\/2])\n cube([batt[0]+wall,batt[1],batt[2]-offset],center=true);\n }\n \n intersection() {\n inner_skin();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot) \n translate([0,0,wall\/4+offset\/2])\n cube([batt[0],batt[1],batt[2]+wall\/2-offset],center=true);\n } \n \n \/\/ cutout to open compartment\n if (solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n union() {\n translate([0,0,wall\/2])\n cube([batt[0],batt[1],batt[2]-wall],center=true);\n translate([0,0,-batt[2]\/2]) \n cube([batt[2]\/2,batt[1],2*wall],center=true);\n }\n }\n }\n}\n\nmodule battery_compartment(solid=false) {\n difference() {\n union() {\n difference() {\n battery_compartment_(solid);\n \n \/\/ cutout block to be able to unlatch\n if (!solid) {\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2+wall])\n cube([batt[2],batt[1],wall],center=true);\n }\n }\n \n if (!solid) {\n scale([1.01,1.01,1.01])\n union() {\n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n }\n \n hull() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1],wall\/2],center=true);\n }\n \n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,batt[1]\/2-batt[1]\/96,-batt[2]\/2+wall\/4+2*wall])\n cube([batt[2],batt[1]\/48,wall\/2],center=true);\n \n }\n }\n }\n }\n \n if (!solid) {\n difference() {\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2],batt[1],wall+2],center=true);\n }\n\n intersection() {\n battery_compartment_();\n translate([batt_pos[0],batt_pos[1],batt_pos[2]-batt[2]\/2]) \n rotate(batt_rot)\n translate([0,0,-batt[2]\/2+wall\/2])\n cube([batt[2]\/2,batt[1],wall+2],center=true);\n }\n }\n }\n }\n}\n\nif (render_outer) {\n outer_skin();\n} else if (render_full) {\n full_skin();\n} else {\n union() {\n cut_in_halves();\n translate([-100,dims[1]\/2+2*module_bay[1],0]) rotate([0,180,90]) module_cover();\n translate([-100,-dims[1]\/2-2*module_bay[1],0]) battery_compartments();\n }\n}","returncode":0,"stderr":"","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"153cc6b8c538ce048e95b0ef961e6015e0a805a9","subject":"CITOSINE","message":"CITOSINE","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/Citosyne.scad","new_file":"3D-models\/SCAD\/Citosyne.scad","new_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([2, 0, 2.55]) cube ([x+3, y, z+3], center=true); \ncolor(\"lime\") translate ([-27, y\/200000, -4]) cylinder (z+9, y\/2, y\/2); \n \n } \nrotate([0, 90, 0]) translate([-0.5,0,-18.9]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-27.9, -11, 5.1]) cube([53.5, 22, 8]); \/\/\u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([15, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 38.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 38.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n\n\n\n\n","old_contents":"d=2.67;\nx=55; \ny=19; \nz=9; \/\/ \u043f\u043e \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u0449\u0438\u043d\u0443 \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \nz2=2.5;\n\/\/\u0426\u0438\u0442\u043e\u0437\u0438\u043d \ndifference(){ \ndifference (){ \ncolor(\"MediumPurple\") translate ([2, 0, 2.55]) cube ([x+3, y, z+3], center=true); \ncolor(\"lime\") translate ([-27, y\/200000, -4]) cylinder (z+9, y\/2, y\/2); \n \n } \nrotate([0, 90, 0]) translate([-0.5,0,-18.9]) cylinder(5, d, d); \ntranslate([-10, -10.5, 0]) cube([50, 21, 10]); \/\/\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n translate([-27.9, -11, 5.1]) cube([53.5, 22, 8]); \/\/\u0432\u0435\u0440\u0445\u043d\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\n}\n\n\n\/\/\u041f\u043b\u043e\u0441\u043a\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0446\u0435\u043d\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\n\/\/translate([4, -0.25, -10])cube([40, 0.5, 30]);\n\nrotate([90, 0, 0]) translate([27.5, 0.8, -9.5]) cylinder(19, 4.3, 4.25);\ndifference() { \n #translate([27.1, -9.5, -3.45]) cube([15, 19, 8.5]);\n #rotate([0, 90, 0]) translate([-.5, 4.5, 38.5]) cylinder(9, d, d);\n\n #rotate([0, 90, 0]) translate([-0.5, -4.5, 38.5]) cylinder(9, d, d);\n}\n\n#rotate([90, 0, 0]) translate([-9.9, 0.9, -9.5]) cylinder(19, 4.25, 4.25);\n\n\n\/\/\u0431\u0443\u043a\u0432\u0430 \u0426\n #translate([11, -7, 0]) cube([2, 12, 2]);\n #translate([4, -7, 0]) cube([2, 12, 2]);\n #translate([1, 3, 0]) cube([11, 2, 2]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"99b3a1684c51ea37a10069ea44061d461c2e8cdf","subject":"[3d] Make end piece snap hole slightly undersized for a tighter fit","message":"[3d] Make end piece snap hole slightly undersized for a tighter fit\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/probewrap.scad","new_file":"3d\/probewrap.scad","new_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4,5]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.0;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7.5;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 1.25;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\/\/fit_test(true);\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n else if (count == 5)\n complete_5();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_5() {\n complete_4();\n translate([-oa_w - 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule rextrude_180(diameter, h) {\n intersection() {\n translate([-diameter\/2-e, -e, -e])\n cube([diameter+2*e, diameter\/2+e, h+2*e]);\n rotate_extrude()\n children();\n }\n}\n\nmodule fit_test(is_end) {\n if (is_end)\n mirror([0,1,0]) translate([0,-20,0]) scale([10,10,10]) lip_poly_stack_end();\n else\n translate([0,0,0]) scale([10,10,10]) lip_poly_stack(height);\n translate([0,-96.5,0]) scale([10,10,10]) lip_poly_stack(height);\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \n translate([0,(center_d-center_w)\/2,0]) \n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.20;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.15;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8+err_v], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n extra_tight = 0.1; \/\/ extend more under the snap lip since there is only one point of contact for this piece\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5-extra_tight, wall_t], [-extra_tight, wall_t-0.5], [-extra_tight, wall_t-1],\n [0.8-extra_tight, wall_t-1-0.8], [0.8-extra_tight-stub, wall_t-1-0.8-stub]\n ]);\n}","old_contents":"\/\/ Total number of probes supported (0 for just an endpiece)\ncount = 4; \/\/ [0,1,2,3,4,5]\n\n\/\/ Wall thickness, set to multiple of perimeter width\nwall = 2.0;\n\/\/ Flat thickness\nwall_t = 2;\n\n\/\/ Overall width of flat\noa_w = 60;\n\/\/ Overall depth of flat\noa_d = 95;\n\/\/ Interior height between flats\nheight = 7.5;\n\/\/ Center hole ratio\ncenter_ratio = 3;\n\n\/\/ Diameter of probe-holding hole\nprobe_d = 4.75;\n\/\/ Length of probe holder\nprobe_l = 25;\n\/\/ Distance of probe holder offset\nprobe_off = 7;\n\/\/ Reduce thickness of probe holder (allow wire to pass more easily)\nprobe_cut = 1.25;\n\n\/\/ Include holes around the perimeter of the flat?\nflat_has_holes = true;\n\/\/ Include the probe holder flat stub on endpiece as well? (can help retain wire)\nend_has_stub = true;\n\n\/* [Hidden] *\/\n\/\/ Center hole width\ncenter_w = oa_w \/ center_ratio;\n\/\/ Center hole depth\ncenter_d = (oa_d - oa_w) + center_w;\n\/\/ Diameter of holes in flat\nflat_hole_d = (oa_w - center_w) \/ 4 - 0.5;\n\ne=0.01;\n\ndo_render();\n\nmodule do_render() {\n if (count == 0)\n half(true);\n else if (count == 1)\n single();\n else if (count == 2)\n complete_2();\n else if (count == 3)\n complete_3();\n else if (count == 4)\n complete_4();\n else if (count == 5)\n complete_5();\n}\n\nmodule single() {\n half(false);\n translate([-oa_w - 1,0,0]) rotate(180) half(true);\n}\n\nmodule complete_2() {\n half(false);\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1,0]) rotate(180) half(true);\n}\n\nmodule complete_3() {\n complete_2();\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_4() {\n single();\n translate([oa_w + probe_off + probe_d + 1, 0, 0]) rotate(180) half(false);\n translate([0, oa_d + 1, 0]) half(false);\n translate([oa_w + probe_off + probe_d + 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule complete_5() {\n complete_4();\n translate([-oa_w - 1, oa_d + 1, 0]) rotate(180) half(false);\n}\n\nmodule rextrude_180(diameter, h) {\n intersection() {\n translate([-diameter\/2-e, -e, -e])\n cube([diameter+2*e, diameter\/2+e, h+2*e]);\n rotate_extrude()\n children();\n }\n}\n\nmodule half(is_end) {\n probe_x=oa_w\/2 + probe_off;\n probe_y=-probe_l - 5; \/\/ -oa_w\/2 - 0;\n\n difference() {\n union() {\n flat();\n \n if (!is_end) {\n \/\/ probe holster\n intersection() {\n translate([probe_x, probe_y, probe_d\/2+wall]) rotate([-90]) {\n difference() {\n union() {\n cylinder(probe_l, d=probe_d+2*wall, $fn=24);\n translate([-probe_d\/2-wall,0,0])\n cube([probe_d+2*wall, probe_d\/2+wall, probe_l]);\n }\n translate([0,0,-e]) cylinder(probe_l+2*e, d=probe_d, $fn=16);\n }\n }\n \/\/ Keep the height of the cylinder less than the height of the layer\n translate([probe_x-probe_d\/2-wall, probe_y, 0])\n cube([probe_d+2*wall, probe_l, height+wall_t-probe_cut]);\n } \/\/ interection\n } \/\/ if !is_end\n\n if (!is_end)\n \/\/ connect to holster\n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n else if (end_has_stub)\n \/\/ connect to holster\n mirror([0,1,0]) \n translate([center_w\/2+wall, probe_y, 0])\n cube([probe_x-center_w\/2+probe_d\/2, probe_l, wall_t]);\n\n \/\/ lip round\n translate([0,-(center_d-center_w)\/2,0]) rotate(180)\n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \n translate([0,(center_d-center_w)\/2,0]) \n rextrude_180(oa_w, height*4, $fn=46)\n translate([center_w\/2,0,0]) lip_poly(is_end, height);\n \/\/ lip flat\n translate([center_w\/2,(center_d-center_w)\/2,0]) rotate([90]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n translate([-center_w\/2,-(center_d-center_w)\/2,0]) rotate([90,0,180]) \n linear_extrude(center_d-center_w) lip_poly(is_end, height);\n } \/\/ end union\n \n if (is_end)\n mirror([0,1,0]) flat_holes();\n else\n flat_holes();\n \n \/\/ chip away a bit of snap in mating area\n translate([-4\/2, -center_d\/2-wall-e, wall_t+height-wall])\n cube([4, center_d+2*(wall+e), height*2]);\n } \/\/ end diff\n}\n\nmodule flat_hole() {\n rotate(20) {\n cylinder(wall_t+2*e, d=flat_hole_d);\n cube([flat_hole_d\/2,flat_hole_d\/2,wall_t+2*e]);\n }\n}\n\nmodule flat_holes() {\n flat_hole_offset = (oa_w - center_w)\/4 + center_w\/2;\n \n if (flat_has_holes) {\n translate([0, -(oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(-rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([0, (oa_d-oa_w)\/2, 0]) for (rot=[0:180\/4:180])\n rotate(rot) translate([flat_hole_offset,0,-e]) flat_hole();\n translate([flat_hole_offset,0,-e]) flat_hole();\n translate([-flat_hole_offset,0,-e]) rotate(180) flat_hole();\n }\n}\n\nmodule flat() {\n difference() {\n hull() {\n translate([0, -(oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n translate([0, (oa_d-oa_w)\/2, 0]) cylinder(wall_t, d=oa_w, $fn=60);\n }\n \n \/\/ Center hole\n hull() {\n translate([0, -(center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n translate([0, (center_d-center_w)\/2, -e]) cylinder(wall_t+2*e, d=center_w+2, $fn=34);\n }\n }\n}\n\nmodule lip_poly(is_end, interior_h) {\n if (is_end)\n lip_poly_stack_end();\n else\n lip_poly_stack(interior_h);\n}\n\nmodule lip_poly_stack(interior_h) {\n h=interior_h+wall_t;\n t_sock=wall;\n t_plug=t_sock;\n \/\/ Back the top snap portion away from the mating area by this amount\n \/\/ The lip is only 0.6mm so err needs to be less than this for any engagement to occur\n err_h=0.20;\n \/\/ Raise the snap lip this extra amount to account for a non-smooth surface\n \/\/ or layer rounding error, 1\/2 a layer height is good\n err_v=0.15;\n\n polygon([\n \/\/ origin is bottom center, moving counterclockwise\n [0.5, 0], [t_sock,0], [t_sock, h], [-err_h, h],\n [-err_h, h+1+err_v], \n [0.6-err_h, h+1+0.6+err_v], [0.6-err_h, h+1+0.6+0.4+err_v],\n [-err_h, h+1+0.8+0.8+err_v],\n [-t_plug-err_h, h+1+0.8+0.8+err_v], [-t_plug-err_h, h], [0, h-t_plug-err_h],\n [0, 1+0.8+0.8], [0.8, 1+0.8], [0, 1], [0, 0.5]\n ]);\n}\n\nmodule lip_poly_stack_end() {\n t_sock = wall;\n stub = wall_t - 1.8;\n\n polygon([\n [0, 0], [t_sock, 0], \n \/\/ these points define the height, should be 1+0.8+0.8=2.6\n \/\/ but cut down to wall_t to be flush with flat(), this means wall_t\n \/\/ needs to be at least 1.8 to form a proper-sided socket\n [t_sock, wall_t], [0.5, wall_t], [0, wall_t-0.5], [0, wall_t-1],\n [0.8, wall_t-1-0.8], [0.8-stub, wall_t-1-0.8-stub]\n ]);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"76706c392b0d324e714f7c04c8c991991c00504e","subject":"added template for checking if holes are aligned properly","message":"added template for checking if holes are aligned properly\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"bike_flag_mount_btwin\/bike_flag_mount_btwin.scad","new_file":"bike_flag_mount_btwin\/bike_flag_mount_btwin.scad","new_contents":"use\n\nd_a = 7;\nd_b = 8;\na_b_distance = 10.5;\nb_top_distance = 18;\n\nmodule screw_holes(h, extra_d=0.5)\n{\n translate([0, d_a\/2+a_b_distance+d_b\/2, 0])\n cylinder(d=d_b+extra_d, h=h, $fn=fn(60));\n cylinder(d=d_a+extra_d, h=h, $fn=fn(60));\n}\n\ntranslate([-6\/2, 0, 0])\n cube([6, a_b_distance+d_a\/2+d_b+b_top_distance, 0.4]);\nscrew_holes(0.8, extra_d=0);\n","old_contents":"","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"a28db9bf7c8047025f9a97fbb6abd0d1bcc855eb","subject":"Oops. Put the mask panel on the correct side of the tank.","message":"Oops. Put the mask panel on the correct side of the tank.\n","repos":"liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS,liffiton\/ATLeS","old_file":"designs\/fishbox\/fishbox.scad","new_file":"designs\/fishbox\/fishbox.scad","new_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_loc = tank_width + thickness; \/\/ center-to-center\n\/\/ dimensions for mask view opening\nview_opening_left = 78;\nview_opening_bottom = 28;\nview_opening_width = 190;\nview_opening_height = 91;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_left+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, depth-thickness\/2, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","old_contents":"\/\/ fishbox.scad\n\/\/ - Enclosure design for zebrafish Skinner box\n\/\/ \n\/\/ Author: Mark Liffiton\n\/\/ Date: Oct, 2014 - Nov, 2015\n\/\/\n\/\/ Units are mm\n\n\/\/ Set thickness to account for thickness of material\n\/\/ PLUS needed clearance for cuts into which material should fit.\n\n\/\/ 0.100\" Acrylic:\nacrylic_thickness = 2.4;\n \/\/ 2.4mm = 0.094\" (looks good based on cut test piece for acrylic slotting into itself)\n\n\/\/ 1\/8\" Hardboard:\nhardboard_thickness = 3.1;\n \/\/ 2.8mm = 0.110\"\n \/\/ * looked good based on cut test piece for hardboard slotting into hardboard\n \/\/ * 2015-03-06: Hanging supports didn't fit into cutouts (or did only with lots of force)\n \/\/ 3.1mm for some breathing room\n\n\/\/ Assign materials: window\/back wall and everything else\n\/\/window_thickness = acrylic_thickness;\nwindow_thickness = hardboard_thickness;\nthickness = hardboard_thickness;\n\n\/\/ Interior box dimensions\n\/\/ The variables are used below to control placement of **centerpoints** centerpoints of walls,\n\/\/ so material thickness is added to account for that.\nwidth = 290 + thickness; \/\/ x = 29cm wall-to-wall\ndepth = 348 + thickness; \/\/ y = 34.8cm to accomodate 34.8cm tank length\ni_height = 190 + thickness; \/\/ z = 19cm to accomodate 16cm tank height plus cover\n \/\/ (i_height because 'height' is used for height of entire box)\n\n\/\/ amount faces extend past each other at corners\noverhang = 15;\n\n\/\/ amount horizontal support tabs extend past side supports (technically, it will go this distance minus thickness\/2)\noutset = thickness+2;\n\n\/\/ tank base plate\nbase_height = overhang\/2;\n\n\/\/ create height var to account for raised base\nheight = i_height + base_height;\n\n\/\/ hanging support thickness and drop (distance it \"sits down\" after in place)\nsupport_w = 10;\nsupport_drop = support_w\/2;\n\n\/\/ useful tank measurements\ntank_width = 70;\ntank_foot_offset_left = 105;\ntank_foot_offset_right = 101;\n\n\/\/ x-position of mask piece inside box\nmask_offset = tank_width + thickness; \/\/ center-to-center\nmask_loc = width - mask_offset;\n\/\/ dimensions for mask view opening\nview_opening_right = 80;\nview_opening_bottom = 28;\nview_opening_width = 190;\nview_opening_height = 91;\n\n\/\/ position of rpi and related parts\nrpi_ypos = depth\/2 + 60;\n\n\/\/ for slight offsets\/tweaks\nepsilon = 1;\n\n\/\/ set precision of all arcs\/spheres\/cylinders\/etc.\n$fn = 50;\n\n\/\/ vars to control projection for DXF export (see makefile)\nif (DXF_TOP) {\n projection() top_cover();\n} else if (DXF_BOTTOM) {\n projection() tank_base();\n} else if (DXF_SIDE1) {\n projection() rotate(a=[90,0,0]) side(y=0);\n} else if (DXF_SIDE2) {\n projection() rotate(a=[90,0,0]) side(y=depth);\n} else if (DXF_END1) {\n projection() rotate(a=[0,90,0]) vert_face(x=0);\n} else if (DXF_END2) {\n projection() rotate(a=[0,90,0]) vert_face(x=width);\n} else if (DXF_MASK) {\n projection() rotate(a=[0,90,0]) mask(x=mask_loc);\n} else if (DXF_TANK_SUPPORT) {\n projection() tank_support_layer1();\n projection() translate([tank_width+thickness,0,0]) tank_support_layer2();\n projection() translate([(tank_width+thickness)*2,0,0]) tank_support_layer3();\n} else if (DXF_CAMERA_SUPPORT) {\n projection() rotate(a=[90,0,0]) camera_support(justone=true);\n} else if (DXF_RPI_SUPPORT) {\n projection() rotate(a=[90,0,0]) rpi_support();\n}\nelse {\n \/\/ 3D model\n \/\/ components to include (comment out unwanted)\n vert_face(x=0); \/\/ \"near face, transparent for monitor\n vert_face(x=width); \/\/ \"far\" face, with camera, rpi, etc.\n mask(x=mask_loc);\n side(y=0);\n side(y=depth);\n tank_base();\n tank_support();\n camera_support(x=width, y=depth\/2, z=height\/2);\n rpi_support(x=width, y=rpi_ypos-10, z=height\/2);\n mock_rpi(x=width, y=rpi_ypos, z=height\/2);\n top_cover();\n}\n\n\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n\/\/ Module definitions\n\/\/\n\nmodule mask(x) {\n difference() {\n vert_face_base(x, top_offset=thickness, bottom_offset=base_height-thickness);\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n translate([0, depth+overhang+thickness\/2, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false);\n }\n \/\/ opening for tank view\n translate([0,view_opening_right+thickness\/2, view_opening_bottom+base_height+thickness\/2])\n cube([width, view_opening_width, view_opening_height]);\n \/\/ opening for wires\n translate([0, thickness, base_height+thickness])\n rotate(a=[0,90,0])\n cylinder(r=10, h=width);\n \/\/ tabs for rigidity w\/ bottom panel\n cutouts(4,depth-thickness,outset*2,rot=[-90,0,90],trans=[x+thickness\/2,(depth-thickness)\/2,base_height+thickness\/2]);\n }\n}\n\nmodule vert_face(x=0) {\n difference() {\n if (x == 0) {\n vert_face_base(0, window_thickness);\n }\n else {\n vert_face_base(x);\n }\n camera_opening();\n \/\/ round=false so we get the full width of the piece in the cutout, not reduced because we hit the rounded corner\n camera_support(x=width+thickness*2, y=depth\/2, z=height\/2+support_drop, round=false);\n rpi_support(x=width+thickness*2, y=rpi_ypos-10, z=height\/2+support_drop, round=false);\n wire_opening();\n \/\/ CAUTION: OpenSCAD won't let me make a projection of vert_face(x=0)\n \/\/ if tank_base is put after side(y=depth) here... bug. :(\n tank_base();\n top_cover();\n side(y=0);\n side(y=depth);\n translate([x-thickness\/2, -overhang, 0]) {\n translate([0, depth+overhang+thickness\/2, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n translate([0, 0, 3\/4*height])\n rounded_truncation(width=overhang-thickness\/2, up=true);\n }\n }\n}\n\nmodule vert_face_base(x, face_thickness=thickness, top_offset=0, bottom_offset=0) {\n translate([x-face_thickness\/2, -overhang, bottom_offset])\n cube([face_thickness,depth+overhang*2,height-top_offset-bottom_offset]);\n}\n\nmodule rounded_truncation(width, up, rot=[0,0,0]) {\n truncation_height=height\/4;\n rotate(a=rot)\n difference() {\n translate([-50,-epsilon,0])\n cube([100, width+2*epsilon, truncation_height]);\n if (up) {\n translate([-50, width\/2, 0])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n else {\n translate([-50, width\/2, truncation_height])\n rotate(a=[0, 90, 0])\n cylinder(d=width, h=100);\n }\n }\n}\n\nmodule camera_opening() {\n translate([width, depth\/2, height\/2])\n cube([thickness*2,10,10], center=true);\n}\n\nmodule camera_support(x, y, z, justone=false, round=true) {\n spacing = 20;\n out = 11;\n up = 36;\n hanging_support(x, y + spacing\/2, z, out, up, round=round);\n if (!justone) {\n hanging_support(x, y - spacing\/2, z, out, up, round=round);\n }\n}\n\nmodule rpi_support(x, y, z, round=true) {\n hanging_support(x, y, z, out=4, up=85, round=round);\n}\n\nmodule hanging_support(x, y, z, out, up, round=true) {\n inner_w = out+thickness;\n inner_h = up;\n color(\"Red\", alpha=0.5)\n translate([x,y,z])\n \/\/ push inner opening up against vert face\n translate([out\/2,0,0])\n difference() {\n if (round) {\n rounded_rect(inner_w+support_w*2, thickness, inner_h+support_w*2, center=true, radius=support_w);\n }\n else {\n cube([inner_w+support_w*2, thickness, inner_h+support_w*2], center=true);\n }\n \/\/ cutout for object\n cube([inner_w, thickness*2, inner_h], center=true);\n \/\/ cutout for passing through vertface\n translate([-(inner_w\/2+support_w\/2),0,-support_drop\/2])\n cube([support_w+2*epsilon, thickness*2, inner_h-support_drop], center=true);\n \/\/ bottom cutout\n translate([-out\/2,0,-(inner_h\/2+support_w-support_drop\/2)])\n cube([thickness, thickness*2, support_drop], center=true);\n }\n}\n\n\/\/ rounded corners in x,z directions\nmodule rounded_rect(x,y,z, center, radius) {\n difference() {\n cube([x,y,z], center);\n\n translate([x\/2-radius, 50, z\/2-radius])\n rotate(a=[90,0,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, z\/2-radius])\n rotate(a=[90,-90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([x\/2-radius, 50, -z\/2+radius])\n rotate(a=[90,90,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n translate([-x\/2+radius, 50, -z\/2+radius])\n rotate(a=[90,180,0])\n difference() {\n cube([radius,radius,100]);\n cylinder(r=radius, h=100);\n }\n }\n}\n\nmodule top_cover() {\n color(\"Grey\", alpha=0.5)\n translate([-outset,-outset,height-thickness])\n difference() {\n cube([width+outset*2,depth+outset*2,thickness]);\n cutouts(5,width-thickness,outset,rot=0,trans=[width\/2+outset,0,0]);\n cutouts(5,width-thickness,outset,rot=180,trans=[width\/2+outset,depth+outset*2,0]);\n cutouts(5,depth-thickness,outset,rot=-90,trans=[0,depth\/2+outset,0]);\n cutouts(5,depth-thickness,outset,rot=90,trans=[width+outset*2,depth\/2+outset,0]);\n }\n}\n\nmodule tank_base() {\n difference() {\n translate([-outset,thickness\/2,base_height])\n difference() {\n cube([width+outset*2, depth-thickness, thickness]);\n cutouts(5,depth,outset,rot=-90,trans=[0,(depth-thickness)\/2,0]);\n cutouts(5,depth,outset,rot=90,trans=[width+outset*2,(depth-thickness)\/2,0]);\n }\n mask(x=mask_loc);\n }\n}\n\nmodule tank_support() {\n translate([mask_loc+thickness\/2, thickness\/2, base_height+thickness])\n union() {\n tank_support_layer1();\n color(\"Grey\", alpha=0.5)\n tank_support_layer2();\n color(\"Grey\", alpha=0.5)\n tank_support_layer3();\n }\n}\n\/\/ Two strips of hardboard on either side of LED strip\nmodule tank_support_layer1() {\n \/\/ front bottom strip, w\/ space for wires\n translate([0, 20, 0])\n cube([tank_width\/3, depth-thickness-20, thickness]);\n \/\/ back bottom strip, full-depth\n translate([2*tank_width\/3, 0, 0])\n cube([tank_width\/3, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic over LED strip\nmodule tank_support_layer2() {\n translate([0, 0, thickness])\n cube([tank_width, depth-thickness, thickness]);\n}\n\/\/ Clear acrylic end blocks to prevent tank shifting \/ seat it in correct location\nmodule tank_support_layer3() {\n translate([0, 0, thickness*2])\n cube([tank_width, tank_foot_offset_right, thickness]);\n translate([0, depth-thickness-tank_foot_offset_left, thickness*2])\n cube([tank_width, tank_foot_offset_left, thickness]);\n}\n\nmodule cutouts(num, width, outset, rot, trans) {\n w = width \/ ((num-1) * 2);\n translate(trans)\n rotate([0,0,1], a=rot)\n for (i = [0 : num-1]) {\n translate([-width\/2 - w\/2 + i*2*w, -thickness\/2, -thickness\/2])\n cube([w, outset+thickness, thickness*2]);\n }\n}\n\nmodule wire_opening() {\n translate([width, rpi_ypos-35, overhang+20])\n scale([1,2,1])\n rotate(a=[0,90,0])\n cylinder(d=12, h=thickness+epsilon, center=true);\n}\n\nmodule side(y=0) {\n difference() {\n side_base(y);\n translate([0,0,height\/2])\n scale([1,1,0.5])\n vert_face_base(x=mask_loc);\n scale([1,1,0.5])\n vert_face_base(0, window_thickness);\n scale([1,1,0.5])\n vert_face_base(width);\n top_cover();\n }\n}\n\nmodule side_base(y) {\n translate([-overhang,y-thickness\/2,overhang\/2])\n difference() {\n cube([width+overhang*2, thickness, height-overhang\/2]);\n translate([width+overhang+thickness\/2, 0, 0])\n rounded_truncation(width=overhang-thickness\/2, up=false, rot=[0,0,-90]);\n translate([0, 0, 0])\n rounded_truncation(width=overhang-window_thickness\/2, up=false, rot=[0,0,-90]);\n }\n}\n\nmodule mock_rpi(x, y, z) {\n color(\"Blue\", alpha=0.5)\n translate([x+thickness, y, z])\n rotate(a=[0,-90,180])\n translate([-85\/2, -56\/2, 0])\n union() {\n cube([85, 56, 2]);\n \/\/ USB1\n translate([67, 41, 2])\n cube([20, 12, 12]);\n \/\/ USB2\n translate([67, 23, 2])\n cube([20, 12, 12]);\n }\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c93aabfae41f64e99f83491857880d70751a82b6","subject":"2D -> 3D take on the print","message":"2D -> 3D take on the print\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_hinge_cover\/window_hinge_cover.scad","new_file":"window_hinge_cover\/window_hinge_cover.scad","new_contents":"eps = 0.01;\nwall = 0.65;\nlength = 59;\nwidth = 21.6;\ncut_in_length = 15;\n\n\nmodule element()\n{\n module profile_shell()\n {\n module exterior()\n {\n module profile()\n {\n r=7;\n hull()\n {\n translate(r*[1,1,0] + [0,4,0])\n circle(r=r, $fn=50);\n square([width, 6]);\n }\n }\n intersection()\n {\n minkowski()\n {\n difference()\n {\n translate(-5*[1,1,0])\n square([30,30]);\n profile();\n }\n circle(r=wall, $fn=50);\n }\n profile();\n }\n }\n difference()\n {\n exterior();\n translate(wall*[1,0] - eps*[0,1])\n square([width-2*wall, wall+2*eps]);\n }\n }\n\n module surround()\n {\n linear_extrude(length)\n profile_shell();\n }\n module side()\n {\n linear_extrude(wall)\n hull()\n profile_shell();\n }\n\n module core()\n {\n surround();\n for(dz=[0, length-wall])\n translate([0,0,dz])\n side();\n }\n\n rotate([90, 0, 0])\n difference()\n {\n core();\n translate(length\/2*[0,0,1] - [6,0,0])\n translate(-cut_in_length\/2*[0,0,1])\n cube([width, 30, cut_in_length]);\n }\n}\n\n\nelement();\n","old_contents":"side_h = 17;\nbase_size = [21.6, 59, 6];\ntop_cylinder_start_h = 8;\ntop_r = side_h - top_cylinder_start_h;\n\nmodule element()\n{\n \n\/\/ cube(base_size);\n\/\/ translate([top_r, 0, top])\n\/\/ rotate([-90, 0, 0])\n\/\/ cylinder(r=top_r, h=base_size[1], $fn=100);\n}\n\nelement();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"2956bf9000b7384924a36c2c6064ee4e83045fd2","subject":"The two charms can now be different; the scale still needs separating though.","message":"The two charms can now be different; the scale still needs separating though.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad","new_file":"OpenSCAD\/src\/main\/openscad\/name-tags\/nametag.scad","new_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\n\/\/TODO: rename this to leftIconType, and make a new one that is rightIconType\r\n\/\/ then pass in the iconType as part of the parameters to the oneIcon() module\r\nleftIconType = \"Bass Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\nrightIconType = \"Treble Clef\";\r\n\r\n\/\/TODO: update the logic to look out for two a left and right icon scale\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(iconType, xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","old_contents":" \r\n\/\/ ************* Credits part *************\r\n\r\n\/\/ This was origianllay named uploads-b4-df-a6-25-4b-AnyNameSign.scad and came from \r\n\/\/\r\n\/\/\t\thttp:\/\/www.thingiverse.com\/thing:16193\r\n\/\/\r\n\/\/ Programmed by Fryns - March 2014\r\n\r\n\r\n\/\/ Adapted by Roberto Marquez - onebeartoe - 2015\r\n\r\n\/\/ Uses Write.scad by HarlanDMii, published on Thingiverse 18-Jan-2012 (thing:16193)\t \r\n\r\n\/\/ ************* Declaration part *************\r\n\r\n\/* [General] *\/\r\ntextColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\r\n\/* [Icons] *\/\r\n\/\/TODO: rename this to leftIconType, and make a new one that is rightIconType\r\n\/\/ then pass in the iconType as part of the parameters to the oneIcon() module\r\niconType = \"Treble Clef\"; \/\/ [Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\n\r\n\/\/TODO: update the logic to look out for two a left and right icon scale\r\n\/\/ This is the X,Y scale of the icons.\r\niconXyScale = 1.0; \/\/ [0.1 : 0.05 : 5]\r\niconHeight = 3.0; \/\/ [0.1: 0.1 :5]\r\nxOffset = 87; \/\/ [10:200]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Top Text] *\/\r\ntopText = \"Roberto M.\";\r\ntopTextYOffset = 7; \/\/ [0 : 30]\r\ntopLetterSize = 19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\nsubText = \"Scrum Trooper\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\nbottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nshowBorder = \"Yes\"; \/\/ [Yes, No]\r\nborderColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\nbaseWidth=228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight=54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth=2;\r\nborderradius=8;\r\nborderdistance=5;\t\/\/ Distance from edge\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes=4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfont=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\nnamematrix = \r\n[\r\n\t[ topTextYOffset, topText, topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\t[bottomTextYOffset, subText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n];\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Executable part *************\r\nuse \t\/\/ remember to download write.scad and fonts\r\n\r\n\r\n\r\nunion()\r\n{\r\n nametag_assembly();\r\n \r\n icons();\r\n}\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag_assembly() \r\n{\r\n\tcolor(textColor) \r\n\twriting();\r\n\t\r\n\tif(showBorder == \"Yes\")\r\n\t{\r\n\t\tcolor(borderColor)\t\r\n\t\tnametagBorder();\t\r\n\t}\t\r\n\t\r\n\tif (holes==2) \r\n\t{\r\n\t\tbase2holes();\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif (holes==4) base4holes();\r\n\t\telse nametagBase();\r\n\t}\r\n}\r\n\r\nmodule writing()\r\n{\r\n\t\/\/ max 100 names\r\n\tfor ( i = [0 : 99] )\r\n\t{\t\t\t\t\r\n\t\tif (namematrix[i][0]==undef)\r\n\t\t{\r\n\t\t\t;\t\/\/ then do nothing\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t \r\n\t\t\ttranslate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\t\t\twrite(namematrix[i][1],\r\n\t\t\t t = letterThickness,\r\n\t\t\t h = namematrix[i][2],\r\n\t\t\t center = true,\r\n\t\t\t font = font,\r\n\t\t\t space = namematrix[i][3]\r\n\/\/\t\t\t , bold=1\r\n\t\t\t );\r\n\t\t}\r\n\t}\r\n}\r\n\r\nmodule base2holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule base4holes() \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\nmodule oneIcon(xOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, 0, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icons\");\r\n }\r\n \r\n}\r\n\r\nmodule icons()\r\n{\r\n \/\/ left icon\r\n oneIcon(xOffset=-xOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(xOffset=xOffset);\r\n}\r\n\r\nmodule nametagBase()\r\n{\r\n color(baseColor)\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcube(size = [baseWidth,baseHeight,baseThickness], center = true);\r\n}\r\n\r\nmodule nametagBorder()\r\n{\r\n\ttranslate([0,0,baseThickness+letterThickness\/2])\r\n\tlinear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0){\r\n\t\ttranslate([0,baseHeight\/2-borderdistance,0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([0,-(baseHeight\/2-borderdistance),0])\r\n\t\t\tsquare ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\t\ttranslate([baseWidth\/2-borderdistance,0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),0,0])\r\n\t\t\tsquare ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,0])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,180])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,90])\r\n\t\t\t\tnametagQuarter();\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n\t\t\trotate(a=[0,0,270])\r\n\t\t\t\tnametagQuarter();\r\n\t}\r\n}\r\n\r\nmodule nametagQuarter()\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"f49d8e3f0cb077df016ba641963e38272c9b37ce","subject":"a little more complete","message":"a little more complete\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"openscad\/strain-relief\/phone-sr-v1.scad","new_file":"openscad\/strain-relief\/phone-sr-v1.scad","new_contents":"\/\/\n\/\/ Strain relief for FTC robot phones - driver station and robot controller\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Phone side - just the bottom\nmodule phone_part(base_w) {\n base_d = 20; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n cube([base_w, base_d, thick]);\n}\n\n\/\/ Support below usb cable - depth - in y-direction - is {d}\nmodule cable_support(base_w, cable_w, d) {\n \/\/cable_w = 13; \/\/ width - x \n cable_h = 11; \/\/ height - z\n cable_center_w = 5; \/\/ width of center protrusion\n cable_r = 1; \/\/ radii of curve in center protrusion\n cable_pad_h = 5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n cable_gap_d = 10; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n base_r = 10;\n cyl_r = cable_w\/2;\n cable_off = (base_w - cable_w)\/2; \/\/ offset in x of lug position\n \n difference() {\n\n union() {\n \n T_channel(cable_w, d-cyl_r, base_w, d-cable_gap_d, \n (base_w-cable_w)\/2,\n base_r, thick);\n translate([base_w\/2, 0, 0]) cylinder(r=cable_w\/2,h=thick);\n translate([cable_off, d-cable_gap_d, 0]) rotate([90, 0, 0])\n O_channel(cable_w, cable_h, cable_center_w, LARGE, \n (cable_w - cable_center_w)\/2, cable_pad_h+thick,\n cable_r, cable_r,\n d - cable_gap_d);\n }\n \/*\n translate([-thick, d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(cable_w+2*thick, thick+thick, cable_w, LARGE, \n thick, thick,\n 0, cable_r, d+2*EPSILON);*\/\n }\n}\n\n\nmodule switch_strain_relief() {\n base_w = 55;\n cable_w = 10;\n cable_d = 30; \/\/ depth - y - of lug\n translate([0, cable_d, 0]) phone_part(base_w);\n cable_support(base_w, cable_w, cable_d);\n}\n\n\nswitch_strain_relief();\n\/\/phone_part(55);\n\n\n\n","old_contents":"\/\/\n\/\/ Strain relief for FTC robot phones - driver station and robot controller\n\/\/\n\nuse <..\/common\/extrusions.scad>\n\n$fn = 20;\n\nthick = 3; \/\/ thickness of walls and base\nLARGE = 100; \/\/ Something larger than any demension - for O to become U\nEPSILON = 0.1; \/\/ Small emount to extend so that unions and intersections are clean\n\n\/\/ Phone side - just the bottom\nmodule phone_part(base_w) {\n \/\/base_w = 29; \/\/ width - x\n base_d = 20; \/\/ depth - y\n ro = 1; \/\/ outside-facing radii\n cube([base_w, base_d, thick]);\n}\n\n\/\/ Support below usb cable - depth - in y-direction - is {d}\nmodule cable_support(cable_w, d) {\n \/\/cable_w = 13; \/\/ width - x \n cable_h = 11; \/\/ height - z\n cable_center_w = 5; \/\/ width of center protrusion\n cable_r = 1; \/\/ radii of curve in center protrusion\n cable_pad_h = 5; \/\/ the base of the lug is slightly elevated (z) from the switch base\n cable_gap_d = 10; \/\/ a small gap in x between the start of the center protrusion.\n \/\/ This is because the lugs are slightly taller (z) where they\n \/\/ attach to the switch\n \n \/\/ The difference is to round the base of the lug - so that tape does not have to\n \/\/ wrap around a sharp corner.\n difference() {\n union() {\n cube([cable_w, d+EPSILON, thick]);\n translate([0, d-cable_gap_d, 0]) rotate([90, 0, 0])\n O_channel(cable_w, cable_h, cable_center_w, LARGE, \n (cable_w - cable_center_w)\/2, cable_pad_h+thick,\n cable_r, cable_r,\n d - cable_gap_d);\n }\n translate([-thick, d+EPSILON, -thick]) rotate([90, 0, 0])\n O_channel(cable_w+2*thick, thick+thick, cable_w, LARGE, \n thick, thick,\n 0, cable_r, d+2*EPSILON);\n }\n}\n\n\nmodule switch_strain_relief() {\n base_w = 55;\n cable_w = 10;\n cable_d = 30; \/\/ depth - y - of lug\n cable_off = (base_w - cable_w)\/2; \/\/ offset in x of lug position\n translate([0, cable_d, 0]) phone_part(base_w);\n translate([cable_off, 0, 0]) cable_support(cable_w, cable_d);\n}\n\n\nswitch_strain_relief();\n\n\n","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"0d9fcdf9a9c6ed3bf18fda9b10f7c1157e33f10a","subject":"added additional wall thickness on the exterior of the part","message":"added additional wall thickness on the exterior of the part\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"window_hinge_cover\/window_hinge_cover.scad","new_file":"window_hinge_cover\/window_hinge_cover.scad","new_contents":"eps = 0.01;\nwall = 0.65;\nlength = 59;\nwidth = 21.6;\ncut_in_length = 15;\nextra_walls = 1.5;\n\n\nmodule element()\n{\n module profile_shell_int()\n {\n module exterior()\n {\n module profile()\n {\n r=7;\n hull()\n {\n translate(r*[1,1,0] + [0,4,0])\n circle(r=r, $fn=50);\n square([width, 6]);\n }\n }\n intersection()\n {\n minkowski()\n {\n difference()\n {\n translate(-5*[1,1,0])\n square([30,30]);\n profile();\n }\n circle(r=wall, $fn=50);\n }\n profile();\n }\n }\n difference()\n {\n exterior();\n translate(wall*[1,0] - eps*[0,1])\n square([width-2*wall, wall+2*eps]);\n }\n }\n\n module profile_shell()\n {\n intersection()\n {\n \/\/ additional wall thickness\n union()\n {\n difference()\n {\n minkowski()\n {\n profile_shell_int();\n circle(r=wall*extra_walls, $fn=50);\n }\n #hull()\n profile_shell_int();\n }\n profile_shell_int();\n }\n \/\/ remove bottom overhang\n translate(-10*[1,0])\n square(100*[1,1]);\n }\n }\n\n module surround()\n {\n linear_extrude(length)\n profile_shell();\n }\n module side()\n {\n linear_extrude(wall*(1+extra_walls))\n hull()\n profile_shell();\n }\n\n module core()\n {\n surround();\n for(dz=[-extra_walls*wall, length-wall])\n translate([0,0,dz])\n side();\n }\n\n rotate([90, 0, 0])\n difference()\n {\n core();\n translate(length\/2*[0,0,1] - [6,0,0])\n translate(-cut_in_length\/2*[0,0,1])\n cube([width, 30, cut_in_length]);\n }\n}\n\n\nelement();\n","old_contents":"eps = 0.01;\nwall = 0.65;\nlength = 59;\nwidth = 21.6;\ncut_in_length = 15;\n\n\nmodule element()\n{\n module profile_shell()\n {\n module exterior()\n {\n module profile()\n {\n r=7;\n hull()\n {\n translate(r*[1,1,0] + [0,4,0])\n circle(r=r, $fn=50);\n square([width, 6]);\n }\n }\n intersection()\n {\n minkowski()\n {\n difference()\n {\n translate(-5*[1,1,0])\n square([30,30]);\n profile();\n }\n circle(r=wall, $fn=50);\n }\n profile();\n }\n }\n difference()\n {\n exterior();\n translate(wall*[1,0] - eps*[0,1])\n square([width-2*wall, wall+2*eps]);\n }\n }\n\n module surround()\n {\n linear_extrude(length)\n profile_shell();\n }\n module side()\n {\n linear_extrude(wall)\n hull()\n profile_shell();\n }\n\n module core()\n {\n surround();\n for(dz=[0, length-wall])\n translate([0,0,dz])\n side();\n }\n\n rotate([90, 0, 0])\n difference()\n {\n core();\n translate(length\/2*[0,0,1] - [6,0,0])\n translate(-cut_in_length\/2*[0,0,1])\n cube([width, 30, cut_in_length]);\n }\n}\n\n\nelement();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"d711a3c2d1aaf3a9da0d745a5a0091d8c4345bbb","subject":"Update public\/libs\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","message":"Update public\/libs\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad\n\nSigned-off-by: Bernard Ojengwa \n","repos":"apipanda\/openssl,apipanda\/openssl,apipanda\/openssl,apipanda\/openssl","old_file":"public\/libs\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","new_file":"public\/libs\/bower_components\/ace-builds\/demo\/kitchen-sink\/docs\/scad.scad","new_contents":"","old_contents":"\/\/ ace can highlight scad!\nmodule Element(xpos, ypos, zpos){\n\ttranslate([xpos,ypos,zpos]){\n\t\tunion(){\n\t\t\tcube([10,10,4],true);\n\t\t\tcylinder(10,15,5);\n\t\t\ttranslate([0,0,10])sphere(5);\n\t\t}\n\t}\n}\n\nunion(){\n\tfor(i=[0:30]){\n\t\t# Element(0,0,0);\n\t\tElement(15*i,0,0);\n\t}\n}\n\nfor (i = [3, 5, 7, 11]){\n\trotate([i*10,0,0])scale([1,1,i])cube(10);\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3a3f0f61cb2f6108971284dd7fa4eea30a541e11","subject":"cut for accessing regulation screw","message":"cut for accessing regulation screw\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_file":"closet_hinge_cover\/closet_hinge_cover.scad","new_contents":"use \n\nmodule cover_shape()\n{\n h1=5;\n polyhedron(\n points = [\n [55, 0, 0], \/\/ 0\n [55, 0, h1], \/\/ 1\n [55, 45, h1], \/\/ 2\n [55, 45, 0], \/\/ 3\n [ 0, 45, h1], \/\/ 4\n [ 0, 45, 0], \/\/ 5\n [ 0, 0, 0], \/\/ 6\n [ 0, 0, h1], \/\/ 7\n [55\/2,0, 30], \/\/ 8\n [55\/2,40,30] \/\/ 9\n ], \n faces = [\n [0,1,2],\n [0,2,3],\n [5,2,4],\n [2,5,3],\n [7,6,4],\n [5,4,6],\n [4,8,7],\n [9,8,4],\n [4,2,9],\n [1,8,9],\n [1,9,2],\n ]\n );\n}\n\nmodule cover()\n{\n extra_size = 2;\n difference()\n {\n minkowski()\n {\n cube(extra_size*[1,1,1]);\n cover_shape();\n }\n \/\/ cut for the regulation screw\n translate([21, 25, 0])\n cube([15, 15, 50]);\n }\n}\n\n%translate([18, 0, 0])\n closet_hinge();\ncover();","old_contents":"use \n\nmodule cover_shape()\n{\n h1=5;\n polyhedron(\n points = [\n [55, 0, 0], \/\/ 0\n [55, 0, h1], \/\/ 1\n [55, 45, h1], \/\/ 2\n [55, 45, 0], \/\/ 3\n [ 0, 45, h1], \/\/ 4\n [ 0, 45, 0], \/\/ 5\n [ 0, 0, 0], \/\/ 6\n [ 0, 0, h1], \/\/ 7\n [55\/2,0, 30], \/\/ 8\n [55\/2,40,30] \/\/ 9\n ], \n faces = [\n [0,1,2],\n [0,2,3],\n [5,2,4],\n [2,5,3],\n [7,6,4],\n [5,4,6],\n [4,8,7],\n [9,8,4],\n [4,2,9],\n [1,8,9],\n [1,9,2],\n ]\n );\n}\n\nmodule cover()\n{\n extra_size = 2;\n minkowski()\n {\n cube(extra_size*[1,1,1]);\n cover_shape();\n }\n}\n\n%translate([18, 0, 0])\n closet_hinge();\ncover();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"08080297a4b31bfa5c6810d5e65ad5aa411d1d8c","subject":"yaxis\/idler: round pulley idler block","message":"yaxis\/idler: round pulley idler block\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-axis-idler.scad","new_file":"y-axis-idler.scad","new_contents":"use \nuse \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = 2*yaxis_idler_pulley_inner_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut = MHexNutM4;\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, yaxis_idler_mount_tightscrew_hexnut);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, yaxis_idler_mount_tightscrew_hexnut);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.5;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n fncylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n }\n }\n\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n {\n translate([0, i*mount_screw_dist\/2, 0])\n {\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=[-1,0,0], align=[-1,0,0]); \n }\n }\n }\n}\n\nyaxis_idler_tightscrew_dist = 10*mm;\nyaxis_idler_pulley_nut = MHexNutM5;\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_idler_pulley_outer_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*fncylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n cuberounda([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=[1,0,0], align=[1,0,0]); \n }\n }\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","old_contents":"use \nuse \ninclude \ninclude \ninclude \n\nyaxis_idler_conn = [[-extrusion_size\/2, 0, 0], [-1,0,0]];\n\nyidler_w = 2*yaxis_idler_pulley_inner_d;\nyaxis_idler_mount_thread_dia = lookup(ThreadSize, extrusion_thread);\n\nyaxis_idler_mount_tightscrew_dia = lookup(ThreadSize, ThreadM4);\nyaxis_idler_mount_tightscrew_hexnut = MHexNutM4;\nyaxis_idler_mount_tightscrew_hexnut_dia = lookup(MHexNutWidthMax, yaxis_idler_mount_tightscrew_hexnut);\nyaxis_idler_mount_tightscrew_hexnut_thick = lookup(MHexNutThickness, yaxis_idler_mount_tightscrew_hexnut);\n\nyidler_mount_width = yidler_w+yaxis_idler_mount_thickness*2 + yaxis_idler_mount_thread_dia*3.5*2;\n\nmodule yaxis_idler()\n{\n difference()\n {\n \/\/ top plate\n union()\n {\n \/\/ top mount plate\n difference()\n {\n tighten_screw_dia_outer = yaxis_idler_mount_tightscrew_dia*4;\n mount_screw_dist = (yidler_w\/2+yaxis_idler_mount_thread_dia*3)*1.5;\n union()\n {\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n cubea(\n size=[extrusion_size, yidler_mount_width, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n\n hull()\n {\n for(y=[-1,1])\n translate([0, y*yaxis_idler_tightscrew_dist, 0])\n translate([-yaxis_idler_mount_thickness,0,extrusion_size\/2])\n {\n translate([yaxis_idler_mount_thickness\/2,0,yaxis_belt_path_offset_z])\n fncylindera(\n h=extrusion_size+yaxis_idler_mount_thickness,\n d=tighten_screw_dia_outer,\n align=[0,0,0],\n orient=[1,0,0]\n );\n cubea(\n size=[extrusion_size, mount_screw_dist-yaxis_idler_mount_tightscrew_dia*3, yaxis_idler_mount_thickness],\n align=[0,0,1],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0]\n );\n }\n }\n }\n\n translate([0,0,extrusion_size\/2+yaxis_idler_mount_thickness])\n {\n for(i=[-1,0,1])\n {\n translate([0, i*mount_screw_dist\/2, 0])\n {\n screw_cut(extrusion_nut, head_embed=false, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[0,0,-1], align=[0,0,-1]);\n }\n }\n }\n\n\n for(y=[-1,1])\n translate([\n -extrusion_size\/2-yaxis_idler_mount_thickness,\n y*yaxis_idler_tightscrew_dist,\n extrusion_size\/2+yaxis_belt_path_offset_z])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, h=extrusion_size+yaxis_idler_mount_thickness, with_nut=false, orient=[1,0,0], align=[1,0,0]);\n\n translate([0,0,extrusion_size\/2])\n cubea(size=[extrusion_size+1, yidler_mount_width, tighten_screw_dia_outer\/2],\n extrasize=[yaxis_idler_mount_thickness,0,0],\n extrasize_align=[1,0,0],\n align=[-1,0,-1]);\n }\n\n translate([-extrusion_size\/2,0,0])\n difference()\n {\n cubea([yaxis_idler_mount_thickness, yidler_mount_width, extrusion_size], align=[-1,0,0]);\n\n for(i=[-1,1])\n translate([0, i*(yidler_w\/2+yaxis_idler_mount_thread_dia*3), 0])\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, h=yaxis_idler_mount_thickness, with_nut=false, orient=[-1,0,0], align=[-1,0,0]); \n }\n }\n }\n}\n\nyaxis_idler_tightscrew_dist = 10*mm;\nyaxis_idler_pulley_nut = MHexNutM5;\nyaxis_idler_pulley_thread = ThreadM5;\nyaxis_idler_pulley_thread_dia = lookup(ThreadSize, yaxis_idler_pulley_thread);\nyaxis_idler_pulleyblock_supportsize = yaxis_idler_pulley_outer_d*1.2;\nyaxis_idler_pulleyblock_wallthick = 5*mm;\nyaxis_idler_pulleyblock_lenfrompulley = yaxis_idler_pulleyblock_supportsize\/2 + yaxis_idler_pulley_tight_len;\n\nmodule yaxis_idler_pulleyblock(show_pulley=false)\n{\n if(show_pulley)\n {\n %pulley(pulley_2GT_20T_idler);\n }\n\n h = yaxis_idler_pulley_h + 3*mm*2;\n difference()\n {\n hull()\n {\n \/*fncylindera(d=yaxis_idler_pulley_inner_d*1.5, h=h, orient=[0,0,1], align=[0,0,0]);*\/\n cubea([yaxis_idler_pulleyblock_supportsize, 2*yaxis_idler_pulleyblock_supportsize, h],\n align=[0,0,0],\n extrasize=[yaxis_idler_pulley_tight_len,0,0], \n extrasize_align=[-1,0,0]\n );\n \/*translate([-yaxis_idler_pulley_tight_len,0,0])*\/\n \/*cubea([yaxis_idler_pulley_inner_d, yaxis_idler_pulley_inner_d*1.5, h]);*\/\n }\n\n \/\/ pulley cutout\n translate([-3*mm,0,0])\n cubea(\n size=[yaxis_idler_pulley_outer_d, yaxis_idler_pulley_outer_d*3, yaxis_idler_pulley_h+0.5],\n align=[0,0,0],\n extrasize=[20*mm,0,0], extrasize_align=[1,0,0]\n );\n\n \/\/ pulley screw\n translate([0,0,h\/2])\n {\n screw_cut(yaxis_idler_pulley_nut, h=h+5*mm, orient=[0,0,-1], align=[0,0,-1]);\n }\n\n fncylindera(d=yaxis_idler_pulley_thread_dia, h=h*2, orient=[0,0,1], align=[0,0,0]);\n\n for(y=[-1,1])\n {\n translate([\n -yaxis_idler_pulleyblock_supportsize\/2-yaxis_idler_pulley_tight_len,\n y*yaxis_idler_tightscrew_dist, \n 0\n ])\n {\n screw_cut(yaxis_idler_mount_tightscrew_hexnut, head_embed=true, nut_offset=5*mm, h=yaxis_idler_pulley_tight_len, orient=[1,0,0], align=[1,0,0]); \n }\n }\n }\n\n}\n\n\/\/ the pulley block mounting point (mounting point in pulley block frame)\nyaxis_idler_pulleyblock_conn = [[-yaxis_idler_pulleyblock_lenfrompulley, 0, 0], [-1,0,0]];\n\nyaxis_idler_pulleyblock_conn_print = [[-yaxis_idler_pulleyblock_lenfrompulley, yaxis_idler_pulleyblock_supportsize\/2, 0], [0,1,0]];\n\n\/\/ the idler pulley block mounting point (mounting point in idler frame)\nyaxis_idler_conn_pulleyblock = [[extrusion_size\/2+yaxis_idler_mount_thickness, 0, extrusion_size\/2+yaxis_belt_path_offset_z], [1,0,0]];\n\nmodule print_yaxis_idler()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_conn)\n {\n yaxis_idler();\n }\n}\n\n\nmodule print_yaxis_idler_pulleyblock()\n{\n attach([[0,0,0], [0,0,-1]], yaxis_idler_pulleyblock_conn_print)\n {\n yaxis_idler_pulleyblock(show_pulley=false);\n }\n}\n\n\/*yaxis_idler();*\/\n\/*yaxis_idler_pulleyblock();*\/\n\n\/*print_yaxis_idler();*\/\n\/*print_yaxis_idler_pulleyblock();*\/\n\n\/*attach([[0,0,0],[-1,0,0]], yaxis_idler_conn)*\/\n\/*{*\/\n \/*yaxis_idler();*\/\n \/*attach(yaxis_idler_conn_pulleyblock, yaxis_idler_pulleyblock_conn)*\/\n \/*{*\/\n \/*yaxis_idler_pulleyblock(show_pulley=true);*\/\n \/*}*\/\n\/*}*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"58467d831aa79a71eab6cca1d3fce05cc4c69714","subject":"brush ending model - there is some problem with current OpenSCAD and this one...","message":"brush ending model - there is some problem with current OpenSCAD and this one...\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"philips_sonicare_brush_holder\/brush_ending_model.scad","new_file":"philips_sonicare_brush_holder\/brush_ending_model.scad","new_contents":"module brushEndingModel()\n{\n difference()\n {\n \/\/ main element's shape\n union()\n {\n cylinder(h=8, r=18\/2);\n translate([0,0,8])\n {\n cylinder(r=8\/2, h=60);\n translate([0,0,60] + [-8\/2,-13\/2,0])\n cube([17,13,17]);\n }\n }\n \/\/ cut-in for the mount\n cylinder(h=7, r=8\/2, $fs=0.01);\n translate([0,0,7])\n cylinder(r=3\/2, h=14-7, $fs=0.01);\n }\n}\n\nbrushEndingModel();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'philips_sonicare_brush_holder\/brush_ending_model.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"918fd1f54acc0e071371e3ae03bf038a79e2297b","subject":"[3d] Split case at two different heights to give more strength to USB pillars","message":"[3d] Split case at two different heights to give more strength to USB pillars\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline on the probe side\ncase_split = 12.4; \/\/ and the case split on the other 3 sides\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.0*1.41; \/\/ thickness of side walls (*1.41 so rounded corners are this width)\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\necho(\"WALL is \", wall);\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=4, top=1.5, bottom=1.5, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t,lcd_mount_t,lcd_mount_t,lcd_mount_t]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, case_split+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex+1, 2, h_b]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex+1, 2.5, h_b]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex+1, 3, h_b]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips() {\n translate([wall, wall, case_split+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34-wall+1);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n \/\/ probe side guide lip\n translate([wall, wall, probe_centerline+wall_t])\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n}\n\nmodule split_volume() {\n difference() {\n translate([-pic_ex-e,-e,-e])\n cube([w+pic_ex+2*wall+2*e, d+2*wall+2*e, wall_t+case_split+2*e]);\n translate([w,0,wall_t+probe_centerline])\n cube([3*wall, d+2*wall+2*e, wall_t+probe_centerline+2*e]);\n }\n}\n\nmodule hm43_split() {\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n split_volume();\n }\n hm43_bottom_lips();\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) difference() {\n hm43();\n split_volume();\n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","old_contents":"\/\/ preview[view:northeast, tilt:topdiagonal]\n\n\/* [Options] *\/\n\/\/ Pit probe type\nControl_Probe = \"Thermocouple\"; \/\/ [Thermocouple,Thermistor]\n\/\/ Raspberry Pi Model\nPi_Model = \"3B\/2B\/1B+\"; \/\/ [3B\/2B\/1B+,1A+,Zero]\n\/\/ Which case halves\nPieces = \"Both\"; \/\/ [Both,Top,Bottom]\n\/\/ Corner ear height\nMouseEarHeight = 0.0;\n\n\/* [Hidden] *\/\nfunction inch(x) = x*25.4;\n\nw = inch(3.75)+0.5; \/\/ overall interior case width\nd = inch(3.75)-0.5; \/\/ overall interior case depth\nh_b = 32; \/\/ overall interior case height\n\nprobe_centerline = 9.0; \/\/ case is split along probe centerline\n\npic_ex = 2;\nlcd_mount_t = 7;\n\nwall = 2.0*1.41; \/\/ thickness of side walls (*1.41 so rounded corners are this width)\nwall_t = 2; \/\/ thickness of top and bottom walls\ne = 0.01;\n\necho(\"WALL is \", wall);\nhm43_split();\n\nmodule cube_fillet_chamfer(size,f,c,$fn=32) {\n hull() {\n translate([f,f,c]) linear_extrude(height=size[2]-2*c) minkowski() {\n square([size[0]-2*f, size[1]-2*f]);\n circle(r=f, $fn=$fn);\n }\n translate([f+c,f+c,0]) linear_extrude(height=size[2]) minkowski() {\n square([size[0]-2*(f+c), size[1]-2*(f+c)]);\n circle(r=f, $fn=$fn);\n }\n }\n}\n\nmodule jhole(d, h) {\n translate([0,0,h\/2]) cube([2*(wall+pic_ex),d,h], center=true);\n}\n\nmodule phole() {\n dia=4.5;\n \/\/ Hole for thermistor probe jack\n rotate([0,90,0]) cylinder(2*wall, d=dia, $fn=16);\n \/\/ because 3d print tends to curl up slightly between the probe holes,\n \/\/ do not go right to the edge on the final layer (stop 0.25mm short on each side)\n translate([0,-(dia+0.5)\/2, -0.3]) cube([2*wall, dia+0.5, 0.6]);\n}\n\nmodule screwhole() {\n \/\/ Screw hole for bottom of case (including nut)\n \/\/translate([0,0,-e]) cylinder(h_b+wall_t, d=3.4, $fn=18);\n translate([0,0,-e]) {\n cylinder(0.4, d1=7.4, d2=6.6, $fn=6);\n translate([0,0,0.4]) cylinder(3, d=6.6, $fn=6);\n }\n translate([0,0,3+0.2]) cylinder(h_b+2*wall_t, d=3.4, $fn=18);\n translate([0,0,h_b+wall_t]) cylinder(3, d=5.5, $fn=18);\n}\n\nmodule screwhole2() {\n translate([0,0,-e]) cylinder(3, d=6, $fn=18);\n translate([0,0,3+0.4]) cylinder(h_b-3-0.4, d=3.4, $fn=18);\n}\n\nmodule pic_ex_cube() {\n translate([0,33.75,2])\n cube_fillet([pic_ex+e, 59.5, 20.8], \n vertical=[0, pic_ex, pic_ex, 0],\n top=[0,pic_ex,0,0],\n bottom=[0,pic_ex,0,0]);\n}\n\nmodule screw_pimount() {\n \/\/ 2mm height is good for screw holes\n difference() {\n cylinder(h=2.25, d=6.4, $fn=18);\n \/\/cylinder(h=2+e, d=2.5, $fn=16);\n }\n}\n\nmodule btn_rnd(dia=10) {\n cylinder(wall_t+2*e, d1=dia, d2=dia+1.5*wall_t, $fn=24);\n translate([-6.5,-6.5,0]) cube([13,13,0.75+e]);\n}\n\nmodule btn_square(sq=13) {\n translate([-sq\/2,-sq\/2,0]) cube([sq,sq,wall_t+2*e]);\n}\n\nmodule tc_plusminus() {\n T=0.75+e;\n H=2;\n W=6;\n \/\/ Minus\n translate([0,2,0]) \n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,-(2+W),0]) {\n cube_fillet([T, W, H], top=[0,0,0,T]);\n translate([0,(W-H)\/2,(H-W)\/2])\n cube_fillet([T, H, W], top=[0,0,0,T]);\n }\n}\n\nmodule led_hole() {\n cylinder(wall_t+2*e, d=3.4, $fn=16);\n}\n\nmodule nuttrap() {\n ww_w=3;\n ww_d=2.7;\n nut_h=2.8;\n nut_ingress = 5.8; \/\/nut_d * sin(60);\n nut_d = nut_ingress \/ sin(60);\n oa_h=wall_t+0.4+nut_h+wall_t+6.7;\n\n \/\/ bottom half for M3 socket cap screw (flush)\n difference() {\n translate([-5.5\/2-ww_w, -nut_ingress\/2-e, 0])\n cube_fillet([5.5+2*ww_w, nut_ingress+ww_d*0.8+e, 6], vertical=[3.4,3.4], $fn=20);\n \/\/ socket cap\n translate([0,0,-e]) cylinder(3.5, d=6, $fn=18);\n \/\/ screw shaft\n translate([0,0,3.5+0.3]) cylinder(oa_h-3, d=3.4, $fn=18);\n }\n \n \/\/ top half M3 nut trap\n translate([0,0,h_b+wall_t-oa_h])\n difference() {\n translate([-(nut_d\/2+ww_w), -nut_ingress\/2-e, 0])\n cube_fillet([nut_d+2*ww_w, nut_ingress+ww_d+e, oa_h],\n vertical=[3.4,3.4], $fn=20);\n \/\/ M3 screw\n translate([0,0,-e]) cylinder(wall_t, d1=4, d2=3.4, $fn=16);\n \/\/ nut hole \/ M3 extra\n translate([0,0,wall_t+0.3]) {\n translate([-0.4,0,0]) \/\/ nut offset slightly deeper for easier alignment\n cylinder(nut_h*1.5+e, d=nut_d, $fn=6); \/\/ nut\n cylinder(oa_h-wall_t-0.3, d=4, $fn=16); \/\/ M3 with plenty of clearance\n }\n \/\/ nut ingress\n translate([0,-nut_ingress\/2,wall_t+0.3])\n cube([nut_d\/2+ww_w+e,nut_ingress,nut_h+e]);\n }\n}\n\nmodule locklip_p(l, l_offset=1,\n lip_insert_depth=2.0, \/\/ how deep V to insert\n lip_v_off=0.2, \/\/ extra height before starting insert\n lip_h_off=0.4, \/\/ back connector away from mating area\n lip_w=1.5 \/\/ thickness of attachment beam\n ) {\n translate([l_offset,0,0]) rotate([90,0,0]) rotate([0,90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0, -lip_w-lip_insert_depth-lip_h_off],\n [0, 0],\n [-lip_insert_depth-lip_h_off, 0],\n [-lip_insert_depth-lip_h_off, lip_v_off],\n [-lip_h_off, lip_v_off+lip_insert_depth],\n [-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth,],\n [-lip_w-lip_insert_depth-lip_h_off, lip_v_off+2*lip_insert_depth],\n [-lip_w-lip_insert_depth-lip_h_off, 0]\n ]);\n}\n\nmodule locklip_n(l, l_offset=1,\n lip_insert_depth=2.2, \/\/ how deep V to insert\n lip_tip_clip=0.3, \/\/ how much to shave off the top tip\n ) {\n translate([l-l_offset,0,0]) rotate([90,0,0]) rotate([0,-90,0]) \n linear_extrude(height=l-2*l_offset) polygon(points=[\n [0.1, -3*lip_insert_depth], \/\/ 0.1 to add depth to keep extrusion manifold\n [0.1, -lip_tip_clip],\n [-lip_insert_depth+lip_tip_clip, -lip_tip_clip],\n [-e, -lip_insert_depth],\n [-lip_insert_depth, -2*lip_insert_depth]\n ]);\n}\n\nmodule lcd_screw() {\n rotate([180]) difference() {\n \/\/cylinder(lcd_mount_t, d=2.5+3.2, $fn=16);\n cylinder(lcd_mount_t+e, d=2.5, $fn=16);\n }\n}\n\nmodule lcd_mount() {\n \/\/ Assuming starting at bottom left screw hole\n lcd_screw(); \n \/\/translate([75,0,0]) lcd_screw(); \/\/ bottom right hole obscured by PCB\n translate([0,31,0]) lcd_screw();\n translate([75,31,0]) lcd_screw();\n}\n\nmodule lcd_neg() {\n \/\/ Assuming starting at bottom left screw hole\n translate([1.0, 2.1, 0])\n cube([73.0, 26.3, lcd_mount_t+wall_t-0.8]); \/\/ black bezel inset\n translate([5.5, 7.8, 0])\n cube([64.0, 15.4, lcd_mount_t+wall_t+2*e]); \/\/ LCD active area\n translate([4.23, -2.5, 0])\n cube([16*2.54, 5, lcd_mount_t+wall_t-0.8]); \/\/ pins cutout\n}\n\nmodule mouseears() {\n me_h = MouseEarHeight;\n me_d = 15;\n me_outset_bottom = (me_d\/4) - wall\/2;\n me_outset_top = (me_d\/4) - wall;\n \n \/\/ Bottom corners\n translate([-me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, -me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n translate([-me_outset_bottom, d+2*wall+me_outset_bottom, 0])\n cylinder(me_h, d1=me_d, d2=me_d-2*me_h, $fn=24);\n\n \/\/ top corners\n translate([0,0,h_b+2*wall_t-me_h]) {\n translate([-me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, -me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([w+2*wall+me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n translate([-me_outset_top, d+2*wall+me_outset_top, 0])\n cylinder(me_h, d2=me_d, d1=me_d-2*me_h, $fn=24);\n }\n}\n\nmodule hm43() {\ndifference() {\n union() {\n cube_bchamfer([w+2*wall, d+2*wall, h_b+2*wall_t], \n r=4, top=1.5, bottom=1.5, $fn=36);\n \/\/ extra thick by Pi connectors\n if (Pi_Model != \"Zero\")\n translate([-pic_ex,wall,wall_t])\n pic_ex_cube();\n \/\/ TC +\/-\n if (Control_Probe == \"Thermocouple\")\n translate([w+wall*2-e,wall+10,wall_t+18]) tc_plusminus();\n if (MouseEarHeight > 0.0)\n mouseears();\n }\n \n \/\/ Main cutout\n translate([wall, wall, wall_t])\n cube_fillet([w, d, h_b+e], bottom=[2,2,2,2],\n top=[lcd_mount_t,lcd_mount_t,lcd_mount_t,lcd_mount_t]);\n if (Pi_Model != \"Zero\")\n translate([wall-pic_ex+e,wall,wall_t]) pic_ex_cube();\n\n \/\/ Probe jack side\n translate([w+wall*0.5,wall,wall_t]) {\n \/\/ Probe jacks\n translate([0,24.25,probe_centerline]) {\n if (Control_Probe == \"Thermocouple\")\n \/\/ TC jack\n translate([0,inch(-0.55)-16.5\/2,-1.4]) cube([2*wall, 16.5, 6.5]);\n else\n translate([0,-17.25,0]) phole();\n translate([0,inch(0.37)*0,0]) phole();\n translate([0,inch(0.37)*1,0]) phole();\n translate([0,inch(0.37)*2,0]) phole();\n }\n }\n \/\/ Pi connector side \n translate([wall*-0.5,wall,wall_t]) {\n \/\/ Pi connectors\n translate([0,0,5]) {\n if (Pi_Model == \"3B\/2B\/1B+\") {\n \/\/ ethernet\n translate([0,81.5,-0.5]) jhole(15,13);\n translate([0,81.5,-1.5]) jhole(5,5);\n \/\/ USB 0+1\n translate([0,62.75,0]) jhole(13,14.8);\n translate([0,44.75,0]) jhole(13,14.8);\n }\n if (Pi_Model == \"1A+\")\n translate([0,44.75,0]) jhole(13,7.4);\n }\n \/\/ HeaterMeter connectors\n translate([0,0,0]) {\n \/\/ Blower\/Servo output\n translate([0,25.25,1.1]) jhole(16.7,13);\n \/\/ HM power jack\n translate([0,5.25,3.4]) jhole(9.4,11);\n }\n }\n \n \/\/ lcd hole\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n \n \/\/ button holes\n translate([wall+48.7, wall+29.4, h_b+wall_t-e]) {\n translate([-inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ left\n translate([inch(1.1)\/2,0,0]) btn_rnd(7.2); \/\/ right\n translate([0,inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ up\n translate([0,-inch(0.9)\/2,0]) btn_rnd(7.2); \/\/ down\n \/\/ LED holes\n translate([inch(1.3), inch(-0.05), 0]) {\n led_hole(); \/\/red\n translate([0, inch(0.35), 0]) led_hole(); \/\/yellow\n translate([0, inch(0.70), 0]) led_hole(); \/\/green\n } \n }\n \/\/ close screw holes\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n screwhole2();\n translate([inch(2.0),0,0]) screwhole2();\n }\n} \/\/ END OF DIFFERENCE\n\n \/\/ Pi mounting screws\n translate([wall+24,wall+d-7,wall_t]) {\n \/\/screw_pimount();\n translate([58,0,0]) screw_pimount();\n translate([58,-49,0]) screw_pimount();\n translate([0,-49,0]) screw_pimount();\n translate([0,0,0]) screw_pimount();\n }\n \/\/ Pi right edge stop\n translate([wall+w-10, wall+d-60, wall_t]) {\n difference() {\n cube_fillet([10,60,4], vertical=[0,0,10\/2], $fn=24);\n \/\/ Pi B+ microsd gap\n translate([-e,22.5,-e]) cube_fillet([6,14,4+2*e], vertical=[2,0,0,2], $fn=20);\n }\n }\n \n \/\/ close nut traps\n translate([wall+inch(0.8)+1.3,wall+2.9,0]) {\n nuttrap();\n translate([inch(2.0),0,0]) nuttrap();\n }\n \n \/\/ Top locklip (negative)\n translate([wall, d+wall, probe_centerline+wall_t+e])\n rotate([180]) {\n locklip_n(28);\n translate([w-34,0,0]) locklip_n(34);\n }\n \n \/\/ LCD mount\n difference() {\n union() {\n \/\/ Filled block above LCD hole\n translate([wall, wall+d-16, h_b+wall_t-lcd_mount_t]) cube([w,16,lcd_mount_t+e]);\n \/\/ LCD grab notch\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t])\n translate([(77.5-20)\/2,33.5-wall_t,-(1.8+wall_t)])\n \/\/ 1.8=thickness of LCD pcb\n cube_fillet([20,1.8+wall_t+wall,1.8+wall_t+e], top=[0,0,1.8+wall_t+e],\n vertical=[wall\/2,wall\/2]);\n }\n translate([wall+10.7, wall+52, h_b+wall_t-lcd_mount_t-e]) lcd_neg();\n translate([wall+10.7, wall+52, h_b+wall_t-e]) lcd_mount();\n }\n \n if (Pi_Model == \"3B\/2B\/1B+\")\n translate([wall-pic_ex, wall, wall_t]) {\n \/\/ USB pillar reinforcements\n translate([0, (44.75+62.75)\/2-1, 0]) cube([pic_ex+1, 2, h_b]);\n translate([0, 81.5-15\/2-3, 0]) cube([pic_ex+1, 2.5, h_b]);\n \/\/ Near pic_ex fill\n translate([0, 33.75, 0]) cube([pic_ex, 3, h_b]);\n \/\/ Far pic_ex fill (near ethernet)\n translate([0, (33.75+59.5)-3, 0]) cube([pic_ex+1, 3, h_b]);\n }\n}\n\nmodule lip_guide(l) {\n guide_offset = 0.2; \/\/ how much to recess the edge guides\n guide_h = 1.2; \/\/ how tall above the edge to extend\n linear_extrude(height=l) polygon([\n [0,-e], [wall+guide_offset,-e], [0, wall+guide_offset],\n [-guide_h, wall+guide_offset], [-guide_h, guide_offset],\n [0, guide_offset]\n ]);\n}\n\nmodule hm43_bottom_lips() {\n translate([wall, wall, probe_centerline+wall_t]) {\n \/\/ bottom locklip (postive)\n translate([0,d,0]) {\n locklip_p(28);\n translate([w-34,0,0]) locklip_p(34);\n }\n\n \/\/ front guide lip\n translate([w\/2-9, 0, 0])\n rotate([0,90]) lip_guide(30);\n \/\/ right guide lip\n translate([w, d-45, 0])\n rotate([-90]) rotate(90) lip_guide(40);\n \/\/ left guide lip assortment\n translate([0, 5.25+9.4\/2, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(25.25-5.25-9.4\/2-16.7\/2);\n *translate([-pic_ex, 52, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n *translate([-pic_ex, 70, 0])\n rotate([-90]) rotate(90) mirror([0,1,0]) lip_guide(3.5);\n }\n}\n\nmodule hm43_split() {\n half=wall_t+probe_centerline;\n\n \/\/ bottom\n if (Pieces != \"Top\") {\n intersection() { \n hm43(); \n translate([-w,-d,0]) cube([w*3, d*3, half]); \n }\n hm43_bottom_lips();\n } \/\/ if include bottom\n \n \/\/ top\n if (Pieces != \"Bottom\") {\n translate([0,-2,h_b+2*wall_t]) rotate([180]) intersection() {\n hm43();\n translate([-w,-d,half]) cube([w*3, d*3, h_b]); \n }\n } \/\/ if include top\n}\n\n\/********************** **********************\/\n\/********************** END OF CASE \/ LIBRARY FOLLOWS **********************\/\n\/********************** **********************\/\n\nmodule cube_bchamfer(dim, r, top=0, bottom=0, $fn=$fn) {\n \/\/ bottom beaded area\n if (bottom != 0) hull(){\n translate([r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(bottom, r1=r-bottom, r2=r, $fn=$fn);\n }\n \/\/ center\n translate([0,0,bottom]) hull(){\n translate([r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(dim[2]-top-bottom, r=r, $fn=$fn);\n }\n \/\/ top beaded area\n if (top != 0) translate([0,0,dim[2]-top]) hull(){\n translate([r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n translate([dim[0]-r,dim[1]-r,0]) cylinder(top, r2=r-top, r1=r, $fn=$fn);\n }\n}\n\nmodule fillet(radius, height=100, $fn=$fn) {\n if (radius > 0) {\n \/\/this creates acutal fillet\n translate([-radius, -radius, -height \/ 2 - 0.02]) difference() {\n cube([radius * 2, radius * 2, height + 0.04]);\n if ($fn == 0 && (radius == 2 || radius == 3 || radius == 4)) {\n cylinder(r=radius, h=height + 0.04, $fn=4 * radius);\n } else {\n cylinder(r=radius, h=height + 0.04, $fn=$fn);\n }\n\n }\n }\n}\n\nmodule cube_fillet(size, radius=-1, vertical=[0,0,0,0], top=[0,0,0,0], bottom=[0,0,0,0], center=false, $fn=4){\n if (center) {\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n } else {\n translate([size[0]\/2, size[1]\/2, size[2]\/2])\n cube_fillet_inside(size, radius, vertical, top, bottom, $fn);\n }\n}\n\nmodule cube_negative_fillet(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n j=[1,0,1,0];\n\n for (i=[0:3]) {\n if (radius > -1) {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(radius, size[2], $fn);\n } else {\n rotate([0, 0, 90*i]) translate([size[1-j[i]]\/2, size[j[i]]\/2, 0]) fillet(vertical[i], size[2], $fn);\n }\n rotate([90*i, -90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0 ]) fillet(top[i], size[1-j[i]], $fn);\n rotate([90*(4-i), 90, 0]) translate([size[2]\/2, size[j[i]]\/2, 0]) fillet(bottom[i], size[1-j[i]], $fn);\n\n }\n}\n\nmodule cube_fillet_inside(size, radius=-1, vertical=[3,3,3,3], top=[0,0,0,0], bottom=[0,0,0,0], $fn=$fn){\n \/\/makes CENTERED cube with round corners\n \/\/ if you give it radius, it will fillet vertical corners.\n \/\/othervise use vertical, top, bottom arrays\n \/\/when viewed from top, it starts in upper right corner (+x,+y quadrant) , goes counterclockwise\n \/\/top\/bottom fillet starts in direction of Y axis and goes CCW too\n\n if (radius == 0) {\n cube(size, center=true);\n } else {\n difference() {\n cube(size, center=true);\n cube_negative_fillet(size, radius, vertical, top, bottom, $fn);\n }\n }\n}\n\n\/\/cube_fillet([10,10,10]);","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"dbd709cc0600f9833aae4b6a9dc09599b24916da","subject":"updated cylinder sizes, lowered mount cube and fixed offset for screw","message":"updated cylinder sizes, lowered mount cube and fixed offset for screw\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_file":"samsung_navibot_sr8980\/main_brush_drive_mounting\/wheel.scad","new_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24\/2, h=2.5);\n cylinder(r=(16+1.5)\/2, h=1.5);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-2\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([2.5, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 3]);\n }\n }\n \/\/ screw hole\n screw_box_size=7+0.5;\n translate([-screw_box_size\/2, -screw_box_size\/2, 2.5+0.5])\n cube([screw_box_size, screw_box_size, 3-0.5]);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","old_contents":"difference()\n{\n union()\n {\n \/\/ main cylinder\n difference()\n {\n cylinder(r=24.5\/2, h=2.5);\n cylinder(r=16\/2, h=1.5);\n }\n \n \/\/ 3 side blockers\n for(angle = [0, 120, 240])\n rotate([0, 0, angle])\n translate([-1\/2, -1\/2, 0] + [16\/2-1\/2, 0, 0])\n cube([1.5, 1, 2]);\n \n \/\/ main screw mount - bottom part\n intersection()\n {\n int_cube_size=7.2;\n rotate([0, 0, 0])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n rotate([0, 0, 45])\n translate([-int_cube_size\/2, -int_cube_size\/2, 0])\n cube([int_cube_size, int_cube_size, 2]);\n }\n \n \/\/ main screw mount - top part\n {\n int_cube_size=9.5;\n translate([-int_cube_size\/2, -int_cube_size\/2, 0] + [0, 0, 2.5])\n cube([int_cube_size, int_cube_size, 7]);\n }\n }\n \/\/ screw hole\n screw_box_size=7+0.5;\n translate([-screw_box_size\/2, -screw_box_size\/2, 2.5+1])\n cube([screw_box_size, screw_box_size, 7-1]);\n cylinder(r=4\/2, h=12, $fs=1);\n}\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"7584e8402141915c2d681fa7adca3f2479aac715","subject":"toile papaer holder - print with 3 different sizes","message":"toile papaer holder - print with 3 different sizes\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"toilet_paper_holder_stop\/tp_holder_stop.scad","new_file":"toilet_paper_holder_stop\/tp_holder_stop.scad","new_contents":"$fs=0.01;\nh=7;\nspacing=20;\n\nmodule holderStop(phi)\n{\n difference()\n {\n cylinder(r=phi\/2+3, h=h);\n cylinder(r=phi\/2, h=h);\n }\n}\n\n\n\/\/ make different sizes\nfor(i = [0, 1, 2])\n \/\/ pack of 2 for each end of the holder\n for(j = [0, spacing])\n translate([j, i*spacing, 0])\n holderStop(6 + i*0.5);\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'toilet_paper_holder_stop\/tp_holder_stop.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"af3306b4a010f1c75caba290f04614862fbfb1a4","subject":"add a thumbnail","message":"add a thumbnail\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/external-resources\/che-thild\/che-thild.scad","new_file":"openscad\/models\/src\/main\/openscad\/external-resources\/che-thild\/che-thild.scad","new_contents":"\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\n\nmodule theChild(height = 2)\n{\n fudge = 0.1;\n\n h = height;\n\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-47.500000,-114.433125],[-25.500000,-111.613125],[-20.408906,-112.105938],[-14.103750,-113.118125],[-5.996719,-114.085312],[4.500000,-114.443125],[16.500000,-113.643125],[30.500000,-116.993125],[38.640313,-118.197031],[47.112500,-118.516875],[51.351758,-118.285801],[55.528437,-117.762344],[59.594023,-116.922715],[63.500000,-115.743125],[68.743125,-113.455469],[73.615000,-110.454375],[77.984375,-106.772656],[81.720000,-102.443125],[85.933750,-95.535625],[88.316719,-92.031250],[89.520215,-90.679844],[90.710000,-89.753125],[92.164902,-89.158711],[93.994219,-88.760938],[98.323750,-88.408125],[106.500000,-88.443125],[124.500000,-87.443125],[141.500000,-86.443125],[192.500000,-84.443125],[208.500000,-83.443125],[228.500000,-82.443125],[257.500000,-81.443125],[271.500000,-80.443125],[277.270000,-80.459375],[279.827813,-79.912969],[282.500000,-78.443125],[266.500000,-77.443125],[205.500000,-77.443125],[190.500000,-76.443125],[172.500000,-76.443125],[158.500000,-75.443125],[153.181094,-75.320000],[147.853750,-74.930625],[142.599531,-74.065000],[137.500000,-72.513125],[133.536094,-70.580156],[129.668750,-68.366875],[125.717031,-66.459219],[123.652988,-65.803105],[121.500000,-65.443125],[120.252734,-63.502305],[118.933750,-61.935313],[116.262500,-59.355625],[113.850000,-56.569687],[112.854453,-54.744883],[112.060000,-52.443125],[111.632187,-49.455469],[111.480000,-45.611875],[111.500000,-38.443125],[111.273672,-33.572129],[110.617500,-28.518906],[109.543203,-23.391855],[108.062500,-18.299375],[106.187109,-13.349863],[103.928750,-8.651719],[101.299141,-4.313340],[98.310000,-0.443125],[93.545176,4.262891],[88.710156,7.773125],[83.774121,10.353359],[78.706250,12.269375],[68.051719,15.171875],[62.403418,16.689922],[56.500000,18.606875],[43.309063,23.448750],[28.860000,28.301875],[21.500586,30.382266],[14.230938,32.045000],[7.185820,33.149922],[0.500000,33.556875],[-14.139219,33.052344],[-20.861816,32.394082],[-27.386250,31.455625],[-40.440156,28.709531],[-54.500000,24.756875],[-62.656563,22.588906],[-69.210000,20.905625],[-72.353711,19.798379],[-75.658437,18.275469],[-79.311445,16.157949],[-83.500000,13.266875],[-87.868398,9.587637],[-91.711563,5.447969],[-95.052695,0.912441],[-97.915000,-3.954375],[-100.321680,-9.087910],[-102.295938,-14.423594],[-103.860977,-19.896855],[-105.040000,-25.443125],[-106.105000,-35.324375],[-106.820312,-40.575781],[-107.950000,-44.433125],[-109.112109,-46.274707],[-110.641250,-48.088281],[-114.442500,-51.549375],[-118.637500,-54.652344],[-122.510000,-57.233125],[-129.888750,-62.014375],[-133.879531,-64.344531],[-137.500000,-66.053125],[-143.277812,-67.766875],[-149.335000,-68.790625],[-155.474688,-69.293125],[-161.500000,-69.443125],[-177.500000,-70.443125],[-195.500000,-70.443125],[-218.500000,-71.443125],[-255.500000,-71.443125],[-282.500000,-71.443125],[-281.385449,-72.625313],[-280.183594,-73.458750],[-277.543750,-74.315625],[-274.632031,-74.486250],[-271.500000,-74.443125],[-253.500000,-75.443125],[-223.500000,-76.443125],[-212.410000,-77.393125],[-199.500000,-77.393125],[-185.500000,-78.443125],[-158.500000,-79.443125],[-143.500000,-80.443125],[-90.500000,-82.443125],[-89.912830,-86.248250],[-88.886543,-89.821152],[-87.455227,-93.160002],[-85.652969,-96.262969],[-83.513855,-99.128220],[-81.071973,-101.753926],[-78.361409,-104.138254],[-75.416250,-106.279375],[-72.270583,-108.175457],[-68.958496,-109.824668],[-61.971406,-112.375156],[-54.727676,-113.916191],[-47.500000,-114.433125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[73.500000,-107.443125],[74.500000,-106.443125],[74.500000,-107.443125],[73.500000,-107.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[43.500000,-104.643125],[39.249727,-102.852773],[35.059688,-100.162188],[31.024805,-96.755820],[27.240000,-92.818125],[23.800195,-88.533555],[20.800313,-84.086563],[18.335273,-79.661602],[16.500000,-75.443125],[19.032187,-77.216211],[21.326250,-79.480312],[25.515000,-84.700625],[27.567187,-87.266367],[29.696250,-89.542188],[31.980937,-91.332852],[34.500000,-92.443125],[36.692856,-94.867864],[38.983477,-96.817129],[41.358062,-98.319119],[43.802813,-99.402031],[46.303931,-100.094065],[48.847617,-100.423418],[51.420073,-100.418289],[54.007500,-100.106875],[59.172070,-98.677988],[64.230937,-96.362344],[69.073711,-93.385527],[73.590000,-89.973125],[76.785625,-86.982188],[79.512500,-84.225625],[82.505625,-81.960312],[84.331719,-81.092148],[86.500000,-80.443125],[83.264375,-86.008223],[79.162500,-91.302031],[74.321875,-96.097324],[68.870000,-100.166875],[62.934375,-103.283457],[59.825000,-104.413376],[56.642500,-105.219844],[53.402812,-105.674456],[50.121875,-105.748809],[46.815625,-105.414500],[43.500000,-104.643125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[76.500000,-104.443125],[77.500000,-103.443125],[77.500000,-104.443125],[76.500000,-104.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[34.500000,-103.443125],[35.500000,-102.443125],[35.500000,-103.443125],[34.500000,-103.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-31.670000,-89.443125],[-36.096250,-94.043281],[-41.347500,-98.366875],[-44.218047,-100.117051],[-47.217500,-101.428594],[-50.320078,-102.178340],[-53.500000,-102.243125],[-57.732969,-101.223945],[-62.370000,-99.103438],[-67.175781,-96.117148],[-71.915000,-92.500625],[-76.352344,-88.489414],[-80.252500,-84.319063],[-83.380156,-80.225117],[-85.500000,-76.443125],[-81.811094,-77.998437],[-79.268750,-79.990625],[-74.410000,-85.353125],[-69.801094,-89.351094],[-64.433750,-92.714375],[-61.549746,-93.979590],[-58.577031,-94.872031],[-55.549238,-95.320332],[-52.500000,-95.253125],[-50.183535,-94.802813],[-47.860156,-94.015000],[-43.318750,-91.655625],[-39.127969,-88.632500],[-35.540000,-85.403125],[-30.758750,-80.039375],[-29.563730,-79.041504],[-28.183906,-78.252344],[-26.526816,-77.707637],[-24.500000,-77.443125],[-25.663906,-80.935313],[-27.248750,-83.900625],[-29.251719,-86.637188],[-31.670000,-89.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-63.500000,-101.443125],[-62.500000,-100.443125],[-62.500000,-101.443125],[-63.500000,-101.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-44.500000,-101.443125],[-43.500000,-100.443125],[-43.500000,-101.443125],[-44.500000,-101.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[79.500000,-99.443125],[80.500000,-98.443125],[80.500000,-99.443125],[79.500000,-99.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[76.500000,-96.443125],[77.500000,-95.443125],[77.500000,-96.443125],[76.500000,-96.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-35.500000,-94.443125],[-34.500000,-93.443125],[-34.500000,-94.443125],[-35.500000,-94.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-66.500000,-91.443125],[-65.500000,-90.443125],[-65.500000,-91.443125],[-66.500000,-91.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[80.500000,-91.443125],[81.500000,-90.443125],[81.500000,-91.443125],[80.500000,-91.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-68.500000,-90.443125],[-67.500000,-89.443125],[-67.500000,-90.443125],[-68.500000,-90.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[82.500000,-88.443125],[83.500000,-87.443125],[83.500000,-88.443125],[82.500000,-88.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-88.500000,-87.443125],[-87.500000,-86.443125],[-87.500000,-87.443125],[-88.500000,-87.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-85.500000,-87.443125],[-84.500000,-86.443125],[-84.500000,-87.443125],[-85.500000,-87.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[83.500000,-87.443125],[84.500000,-86.443125],[84.500000,-87.443125],[83.500000,-87.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-26.500000,-86.443125],[-25.500000,-85.443125],[-25.500000,-86.443125],[-26.500000,-86.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-81.500000,-85.443125],[-80.500000,-84.443125],[-80.500000,-85.443125],[-81.500000,-85.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-75.500000,-84.443125],[-74.500000,-83.443125],[-74.500000,-84.443125],[-75.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-73.500000,-84.443125],[-72.500000,-83.443125],[-72.500000,-84.443125],[-73.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-36.500000,-84.443125],[-35.500000,-83.443125],[-35.500000,-84.443125],[-36.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[25.500000,-84.443125],[26.500000,-83.443125],[26.500000,-84.443125],[25.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-83.500000,-83.443125],[-82.500000,-82.443125],[-82.500000,-83.443125],[-83.500000,-83.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-87.500000,-80.443125],[-86.500000,-79.443125],[-86.500000,-80.443125],[-87.500000,-80.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[22.990000,-57.483125],[20.311094,-54.781094],[17.961250,-52.704375],[16.438281,-50.757031],[16.142441,-49.676895],[16.240000,-48.443125],[16.699102,-47.305781],[17.477188,-46.191875],[19.680000,-44.098125],[24.500000,-40.893125],[31.142031,-37.559219],[38.493750,-34.936875],[46.098594,-33.182656],[53.500000,-32.453125],[58.255059,-32.648125],[63.374219,-33.443125],[68.593457,-34.849375],[73.648750,-36.878125],[78.276074,-39.540625],[82.211406,-42.848125],[83.837068,-44.747266],[85.190723,-46.811875],[86.239368,-49.043359],[86.950000,-51.443125],[87.165820,-53.250137],[87.079063,-55.086094],[86.182500,-58.754375],[84.629687,-62.267031],[82.790000,-65.443125],[80.026992,-69.369961],[77.065938,-72.687187],[73.877539,-75.401133],[70.432500,-77.518125],[66.701523,-79.044492],[62.655313,-79.986562],[58.264570,-80.350664],[53.500000,-80.143125],[48.079258,-78.781445],[43.456562,-76.937188],[39.462461,-74.641523],[35.927500,-71.925625],[32.682227,-68.820664],[29.557188,-65.357813],[22.990000,-57.483125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[69.500000,-80.443125],[70.500000,-79.443125],[70.500000,-80.443125],[69.500000,-80.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-88.060000,-56.443125],[-89.557500,-52.544375],[-89.992188,-50.498906],[-90.020000,-48.443125],[-89.585315,-46.199668],[-88.812676,-44.069531],[-87.734207,-42.056816],[-86.382031,-40.165625],[-82.985059,-36.764219],[-78.878750,-33.898125],[-74.320098,-31.600156],[-69.566094,-29.903125],[-64.873730,-28.839844],[-60.500000,-28.443125],[-51.819687,-28.760312],[-43.400000,-30.065625],[-39.300195,-31.156211],[-35.280313,-32.574688],[-31.345273,-34.348008],[-27.500000,-36.503125],[-22.576250,-39.918125],[-20.259219,-42.114062],[-19.435918,-43.241445],[-18.950000,-44.353125],[-18.843770,-45.355664],[-19.058281,-46.204688],[-20.228750,-47.630625],[-22.019844,-49.007812],[-23.990000,-50.713125],[-26.920000,-54.443125],[-30.604727,-59.129551],[-34.554062,-63.520781],[-38.798242,-67.480996],[-43.367500,-70.874375],[-48.292070,-73.565098],[-53.602188,-75.417344],[-59.328086,-76.295293],[-65.500000,-76.063125],[-69.266230,-74.799668],[-72.786719,-73.170469],[-76.049160,-71.188535],[-79.041250,-68.866875],[-81.750684,-66.218496],[-84.165156,-63.256406],[-86.272363,-59.993613],[-88.060000,-56.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[129.500000,-72.443125],[130.500000,-71.443125],[130.500000,-72.443125],[129.500000,-72.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[78.500000,-60.443125],[80.500000,-58.513125],[76.670000,-58.513125],[70.460000,-64.263125],[62.500000,-71.443125],[65.399883,-71.567656],[68.175312,-71.299375],[70.759961,-70.620469],[73.087500,-69.513125],[75.091602,-67.959531],[76.705938,-65.941875],[77.864180,-63.442344],[78.500000,-60.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[30.500000,-69.443125],[31.500000,-68.443125],[31.500000,-69.443125],[30.500000,-69.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[28.500000,-67.443125],[29.500000,-66.443125],[29.500000,-67.443125],[28.500000,-67.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[123.500000,-67.443125],[124.500000,-66.443125],[124.500000,-67.443125],[123.500000,-67.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[85.500000,-66.443125],[86.500000,-65.443125],[86.500000,-66.443125],[85.500000,-66.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-46.500000,-66.113125],[-43.513594,-64.770937],[-40.383750,-62.313125],[-37.777031,-59.337812],[-36.878145,-57.843008],[-36.360000,-56.443125],[-36.063750,-54.383125],[-36.360000,-52.443125],[-45.510000,-60.233125],[-52.500000,-65.443125],[-49.552500,-66.183125],[-48.084375,-66.298125],[-46.500000,-66.113125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-86.500000,-64.443125],[-85.500000,-63.443125],[-85.500000,-64.443125],[-86.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-44.500000,-64.443125],[-43.500000,-63.443125],[-43.500000,-64.443125],[-44.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[75.500000,-64.443125],[76.500000,-63.443125],[76.500000,-64.443125],[75.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[113.500000,-64.443125],[114.500000,-63.443125],[114.500000,-64.443125],[113.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-129.500000,-63.443125],[-128.500000,-62.443125],[-128.500000,-63.443125],[-129.500000,-63.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[73.500000,-63.443125],[74.500000,-62.443125],[74.500000,-63.443125],[73.500000,-63.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-44.500000,-61.443125],[-43.500000,-60.443125],[-43.500000,-61.443125],[-44.500000,-61.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[75.500000,-61.443125],[76.500000,-60.443125],[76.500000,-61.443125],[75.500000,-61.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-120.500000,-58.443125],[-119.500000,-57.443125],[-119.500000,-58.443125],[-120.500000,-58.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-41.500000,-58.443125],[-40.500000,-57.443125],[-40.500000,-58.443125],[-41.500000,-58.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-114.500000,-53.443125],[-113.500000,-52.443125],[-113.500000,-53.443125],[-114.500000,-53.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-93.500000,-49.443125],[-92.500000,-48.443125],[-92.500000,-49.443125],[-93.500000,-49.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-94.500000,-44.443125],[-93.500000,-43.443125],[-93.500000,-44.443125],[-94.500000,-44.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[16.500000,-44.443125],[17.500000,-43.443125],[17.500000,-44.443125],[16.500000,-44.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[18.500000,-43.443125],[19.500000,-42.443125],[19.500000,-43.443125],[18.500000,-43.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-85.500000,-38.443125],[-84.500000,-37.443125],[-84.500000,-38.443125],[-85.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-86.500000,-37.443125],[-85.500000,-36.443125],[-85.500000,-37.443125],[-86.500000,-37.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-83.500000,-36.443125],[-82.500000,-35.443125],[-82.500000,-36.443125],[-83.500000,-36.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-10.500000,-29.443125],[-8.552676,-27.385684],[-5.899531,-26.014844],[-2.778809,-25.299082],[0.571250,-25.206875],[3.912402,-25.706699],[7.006406,-26.767031],[9.615020,-28.356348],[11.500000,-30.443125],[-10.500000,-29.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-74.500000,-29.443125],[-73.500000,-28.443125],[-73.500000,-29.443125],[-74.500000,-29.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-20.500000,-4.443125],[-19.500000,-3.443125],[-19.500000,-4.443125],[-20.500000,-4.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[7.500000,-2.583125],[-9.500000,-2.583125],[-12.979375,-2.728125],[-15.757500,-2.730625],[-16.984375,-2.454609],[-18.156875,-1.874375],[-19.315313,-0.900391],[-20.500000,0.556875],[-17.167051,2.587695],[-14.092031,3.845312],[-11.175684,4.479961],[-8.318750,4.641875],[-2.386094,4.148438],[4.500000,3.566875],[9.455000,3.406563],[11.735156,3.145352],[13.795000,2.614375],[15.567969,1.701836],[16.987500,0.295937],[17.987031,-1.715117],[18.500000,-4.443125],[7.500000,-2.583125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-20.500000,1.556875],[-19.500000,2.556875],[-19.500000,1.556875],[-20.500000,1.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-90.500000,4.556875],[-89.500000,5.556875],[-89.500000,4.556875],[-90.500000,4.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[89.500000,4.556875],[90.500000,5.556875],[90.500000,4.556875],[89.500000,4.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-89.500000,5.556875],[-88.500000,6.556875],[-88.500000,5.556875],[-89.500000,5.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-82.500000,10.556875],[-81.500000,11.556875],[-81.500000,10.556875],[-82.500000,10.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-83.500000,11.556875],[-82.500000,12.556875],[-82.500000,11.556875],[-83.500000,11.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-78.500000,14.556875],[-77.500000,15.556875],[-77.500000,14.556875],[-78.500000,14.556875]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[251.540000,-54.263125],[247.825000,-50.214688],[244.995000,-46.093125],[242.450000,-41.851563],[239.590000,-37.443125],[235.468125,-32.139219],[230.825000,-27.036875],[225.791875,-22.330156],[220.500000,-18.213125],[216.675449,-15.742852],[212.988594,-13.771562],[209.363379,-12.246055],[205.723750,-11.113125],[201.993652,-10.319570],[198.097031,-9.812187],[189.500000,-9.443125],[184.494844,-9.202500],[179.428750,-8.583125],[169.500000,-6.553125],[137.500000,2.896875],[132.531563,4.879531],[128.300000,6.675625],[123.918437,7.997344],[118.500000,8.556875],[114.731562,8.607812],[110.432500,8.304375],[108.386914,7.841055],[106.572188,7.074687],[105.109492,5.933789],[104.120000,4.346875],[103.767090,2.453398],[104.092344,0.539062],[104.955488,-1.450742],[106.216250,-3.570625],[109.369531,-8.419062],[110.981504,-11.256836],[112.430000,-14.443125],[114.157344,-19.383750],[115.651250,-24.778125],[116.779531,-30.255000],[117.410000,-35.443125],[117.687500,-45.118125],[118.324062,-50.079375],[118.975977,-52.335000],[119.930000,-54.343125],[122.290625,-57.018750],[125.630000,-59.533125],[132.500000,-63.583125],[136.482461,-65.637051],[140.249063,-67.238281],[143.892383,-68.442246],[147.505000,-69.304375],[155.008438,-70.224844],[163.500000,-70.443125],[178.500000,-71.443125],[192.500000,-71.443125],[207.500000,-72.443125],[226.500000,-72.443125],[247.500000,-73.443125],[279.500000,-73.443125],[276.681758,-70.456641],[273.418437,-67.881250],[266.060000,-63.478125],[258.431562,-59.262500],[254.830742,-56.921484],[251.540000,-54.263125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[134.500000,-62.443125],[135.500000,-61.443125],[135.500000,-62.443125],[134.500000,-62.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[242.500000,-47.443125],[243.500000,-46.443125],[243.500000,-47.443125],[242.500000,-47.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[236.500000,-40.443125],[237.500000,-39.443125],[237.500000,-40.443125],[236.500000,-40.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[237.500000,-38.443125],[238.500000,-37.443125],[238.500000,-38.443125],[237.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[236.500000,-37.443125],[237.500000,-36.443125],[237.500000,-37.443125],[236.500000,-37.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[217.500000,-23.443125],[218.500000,-22.443125],[218.500000,-23.443125],[217.500000,-23.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[219.500000,-22.443125],[220.500000,-21.443125],[220.500000,-22.443125],[219.500000,-22.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[217.500000,-21.443125],[218.500000,-20.443125],[218.500000,-21.443125],[217.500000,-21.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[218.500000,-19.443125],[219.500000,-18.443125],[219.500000,-19.443125],[218.500000,-19.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[200.500000,-15.443125],[201.500000,-14.443125],[201.500000,-15.443125],[200.500000,-15.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[208.500000,-14.443125],[209.500000,-13.443125],[209.500000,-14.443125],[208.500000,-14.443125]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[-224.500000,-67.443125],[-209.500000,-66.443125],[-193.500000,-66.443125],[-179.500000,-65.443125],[-170.938906,-65.126250],[-161.508750,-64.363125],[-152.144219,-63.165000],[-143.780000,-61.543125],[-139.682656,-60.437813],[-135.713750,-58.895625],[-132.207969,-56.652188],[-130.733340,-55.184883],[-129.500000,-53.443125],[-127.043281,-53.036406],[-124.763750,-52.206875],[-120.500000,-49.643125],[-116.686406,-46.299180],[-114.013750,-42.625938],[-112.235469,-38.655039],[-111.105000,-34.418125],[-109.801250,-25.272813],[-109.134844,-20.427695],[-108.130000,-15.443125],[-106.555000,-9.853125],[-104.380000,-4.443125],[-101.045000,1.568594],[-99.366016,4.775020],[-98.167500,7.935625],[-97.815547,10.915762],[-98.071436,12.296077],[-98.676250,13.580781],[-99.675752,14.753044],[-101.115703,15.796035],[-103.041865,16.692922],[-105.500000,17.426875],[-112.500000,17.426875],[-117.500000,17.426875],[-122.552500,17.012344],[-126.397500,15.843125],[-134.500000,11.866875],[-145.947500,6.903125],[-152.120313,4.493906],[-157.500000,2.696875],[-163.642188,1.072656],[-169.865000,-0.231875],[-176.155313,-1.107031],[-182.500000,-1.443125],[-188.350781,-1.524531],[-194.198750,-1.906875],[-199.947344,-2.887344],[-205.500000,-4.763125],[-209.688887,-6.849629],[-213.691094,-9.273281],[-217.507441,-11.995293],[-221.138750,-14.976875],[-227.849531,-21.563594],[-233.830000,-28.723125],[-236.827812,-33.018594],[-238.950000,-36.446875],[-241.432188,-39.940781],[-245.510000,-44.433125],[-250.682500,-48.772813],[-257.122500,-53.493125],[-263.003750,-57.935938],[-265.164141,-59.847617],[-266.500000,-61.443125],[-268.650527,-61.342051],[-270.815469,-61.549531],[-275.073750,-62.759375],[-279.045156,-64.811094],[-282.500000,-67.443125],[-224.500000,-67.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-271.500000,-63.443125],[-270.500000,-62.443125],[-270.500000,-63.443125],[-271.500000,-63.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-269.500000,-62.443125],[-268.500000,-61.443125],[-268.500000,-62.443125],[-269.500000,-62.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-264.500000,-61.443125],[-263.500000,-60.443125],[-263.500000,-61.443125],[-264.500000,-61.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-144.500000,-60.443125],[-143.500000,-59.443125],[-143.500000,-60.443125],[-144.500000,-60.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-132.500000,-54.443125],[-131.500000,-53.443125],[-131.500000,-54.443125],[-132.500000,-54.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-252.500000,-52.443125],[-251.500000,-51.443125],[-251.500000,-52.443125],[-252.500000,-52.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-249.500000,-52.443125],[-248.500000,-51.443125],[-248.500000,-52.443125],[-249.500000,-52.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-251.500000,-51.443125],[-250.500000,-50.443125],[-250.500000,-51.443125],[-251.500000,-51.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-119.500000,-46.443125],[-118.500000,-45.443125],[-118.500000,-46.443125],[-119.500000,-46.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-244.500000,-45.443125],[-243.500000,-44.443125],[-243.500000,-45.443125],[-244.500000,-45.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-117.500000,-43.443125],[-116.500000,-42.443125],[-116.500000,-43.443125],[-117.500000,-43.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-240.500000,-41.443125],[-239.500000,-40.443125],[-239.500000,-41.443125],[-240.500000,-41.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-237.500000,-40.443125],[-236.500000,-39.443125],[-236.500000,-40.443125],[-237.500000,-40.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-238.500000,-38.443125],[-237.500000,-37.443125],[-237.500000,-38.443125],[-238.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-235.500000,-38.443125],[-234.500000,-37.443125],[-234.500000,-38.443125],[-235.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-232.500000,-32.443125],[-231.500000,-31.443125],[-231.500000,-32.443125],[-232.500000,-32.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-233.500000,-30.443125],[-232.500000,-29.443125],[-232.500000,-30.443125],[-233.500000,-30.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-227.500000,-23.443125],[-226.500000,-22.443125],[-226.500000,-23.443125],[-227.500000,-23.443125]]);\n }\n linear_extrude(height=h)\n polygon([[-131.500000,-55.443125],[-130.500000,-54.443125],[-130.500000,-55.443125],[-131.500000,-55.443125]]);\n difference()\n {\n linear_extrude(height=h)\n polygon([[163.500000,9.626875],[166.724688,9.947812],[169.962500,10.536875],[172.941562,11.710938],[174.249102,12.616367],[175.390000,13.786875],[177.206250,16.772188],[178.137500,19.864375],[178.472500,23.110312],[178.500000,26.556875],[177.953750,32.679570],[176.580625,38.154688],[174.576563,43.127773],[172.137500,47.744375],[166.738125,56.490312],[164.169688,60.910742],[161.950000,65.556875],[156.896250,78.549375],[153.733281,85.255625],[152.039941,88.000078],[150.290000,90.086875],[147.422344,92.417324],[143.929375,94.613594],[135.757500,98.543125],[127.154375,101.754531],[119.500000,104.126875],[108.176641,106.984609],[96.066250,109.386250],[83.412109,111.355703],[70.457500,112.916875],[57.445703,114.093672],[44.620000,114.910000],[32.223672,115.389766],[20.500000,115.556875],[7.500000,116.516875],[0.928750,116.415625],[-2.648906,116.113281],[-5.500000,115.616875],[-9.156421,114.313552],[-12.115898,112.571230],[-14.429380,110.440754],[-16.147812,107.972969],[-17.322144,105.218718],[-18.003320,102.228848],[-18.242290,99.054202],[-18.090000,95.745625],[-16.815430,88.930059],[-14.587187,82.188906],[-11.812852,75.928926],[-8.900000,70.556875],[-3.740000,62.556875],[-0.071250,58.156875],[3.920000,54.086875],[6.782305,51.963203],[9.487813,50.681875],[12.180664,50.002422],[15.005000,49.684375],[21.624687,49.170625],[25.708320,48.493984],[30.500000,47.216875],[59.500000,37.376875],[65.094531,36.627344],[69.673750,36.570625],[74.416094,36.354531],[80.500000,35.126875],[103.500000,26.316875],[107.243750,25.717187],[110.057500,25.756875],[112.342500,25.909063],[114.500000,25.646875],[116.418672,24.847598],[118.076250,23.688906],[120.812500,20.618125],[123.117500,17.084219],[125.400000,13.736875],[127.391406,11.609531],[129.466250,10.113125],[131.782969,9.016094],[134.500000,8.086875],[141.109687,7.689062],[148.797500,8.099375],[163.500000,9.626875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[3.500000,55.556875],[4.500000,56.556875],[4.500000,55.556875],[3.500000,55.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.500000,61.556875],[2.500000,62.556875],[2.500000,61.556875],[1.500000,61.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[150.500000,87.556875],[151.500000,88.556875],[151.500000,87.556875],[150.500000,87.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-12.500000,110.556875],[-11.500000,111.556875],[-11.500000,110.556875],[-12.500000,110.556875]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[-26.150000,90.556875],[-27.601250,98.538125],[-28.460000,106.556875],[-28.541250,111.514375],[-28.976094,113.984688],[-30.100000,115.976875],[-31.089414,116.735703],[-32.373438,117.335625],[-35.485000,118.124375],[-38.754063,118.474375],[-41.500000,118.516875],[-49.439180,117.890586],[-57.221563,116.613438],[-64.880664,114.823008],[-72.450000,112.656875],[-87.453437,107.747813],[-102.500000,102.986875],[-135.500000,96.806875],[-139.435156,95.500469],[-142.036250,94.253125],[-147.500000,91.226875],[-150.536465,90.028633],[-153.559219,89.251563],[-159.403750,88.361875],[-164.713906,87.359687],[-167.068691,86.441992],[-169.170000,85.046875],[-171.163437,82.745313],[-172.997500,79.699375],[-175.700000,73.556875],[-177.091152,69.003848],[-178.309219,63.573906],[-179.218613,57.584512],[-179.683750,51.353125],[-179.569043,45.197207],[-178.738906,39.434219],[-177.057754,34.381621],[-175.855676,32.220925],[-174.390000,30.356875],[-171.737500,28.358750],[-168.365000,26.821875],[-161.500000,24.696875],[-149.378750,20.919375],[-143.993594,19.910000],[-136.500000,19.556875],[-139.333750,25.048125],[-140.503594,27.962031],[-140.689199,29.217832],[-140.480000,30.246875],[-139.315625,31.502402],[-137.506250,32.207969],[-135.237500,32.485801],[-132.695000,32.458125],[-127.531250,31.975156],[-123.500000,31.736875],[-102.500000,33.976875],[-99.769375,33.695938],[-97.072500,33.176875],[-93.089375,32.702813],[-86.500000,32.556875],[-82.222148,33.056758],[-78.772813,34.266562],[-75.884570,35.954023],[-73.290000,37.886875],[-70.721680,39.832852],[-67.912188,41.559687],[-64.594102,42.835117],[-60.500000,43.426875],[-36.500000,40.556875],[-18.500000,40.556875],[-7.500000,41.466875],[1.082500,41.743125],[5.257500,42.250156],[9.500000,43.556875],[5.702991,44.527566],[2.141895,45.943496],[-1.189016,47.765452],[-4.295469,49.954219],[-7.183191,52.470583],[-9.857910,55.275332],[-14.591250,61.593125],[-18.541309,68.593887],[-21.753906,75.963906],[-24.274863,83.389473],[-26.150000,90.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-162.500000,25.556875],[-161.500000,26.556875],[-161.500000,25.556875],[-162.500000,25.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-171.500000,28.556875],[-170.500000,29.556875],[-170.500000,28.556875],[-171.500000,28.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-3.500000,46.556875],[-2.500000,47.556875],[-2.500000,46.556875],[-3.500000,46.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-174.500000,70.556875],[-173.500000,71.556875],[-173.500000,70.556875],[-174.500000,70.556875]]);\n }\n }\n}\n\nmodule theChildThumbnail(height = 2, xyScale = 0.5)\n{\n scale([xyScale, xyScale, 1])\n theChild(height = height);\n}\n\ntheChild(2);\n","old_contents":"\n\/\/ Module names are of the form poly_(). As a result,\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\n\/\/ SVG element in the Inkscape document by looking for the XML element with\n\/\/ the attribute id=\"inkscape-path-id\".\n\n\/\/ fudge value is used to ensure that subtracted solids are a tad taller\n\/\/ in the z dimension than the polygon being subtracted from. This helps\n\/\/ keep the resulting .stl file manifold.\n\nmodule theChild(height = 2)\n{\n fudge = 0.1;\n\n h = height;\n\n scale([25.4\/90, -25.4\/90, 1]) union()\n {\n difference()\n {\n linear_extrude(height=h)\n polygon([[-47.500000,-114.433125],[-25.500000,-111.613125],[-20.408906,-112.105938],[-14.103750,-113.118125],[-5.996719,-114.085312],[4.500000,-114.443125],[16.500000,-113.643125],[30.500000,-116.993125],[38.640313,-118.197031],[47.112500,-118.516875],[51.351758,-118.285801],[55.528437,-117.762344],[59.594023,-116.922715],[63.500000,-115.743125],[68.743125,-113.455469],[73.615000,-110.454375],[77.984375,-106.772656],[81.720000,-102.443125],[85.933750,-95.535625],[88.316719,-92.031250],[89.520215,-90.679844],[90.710000,-89.753125],[92.164902,-89.158711],[93.994219,-88.760938],[98.323750,-88.408125],[106.500000,-88.443125],[124.500000,-87.443125],[141.500000,-86.443125],[192.500000,-84.443125],[208.500000,-83.443125],[228.500000,-82.443125],[257.500000,-81.443125],[271.500000,-80.443125],[277.270000,-80.459375],[279.827813,-79.912969],[282.500000,-78.443125],[266.500000,-77.443125],[205.500000,-77.443125],[190.500000,-76.443125],[172.500000,-76.443125],[158.500000,-75.443125],[153.181094,-75.320000],[147.853750,-74.930625],[142.599531,-74.065000],[137.500000,-72.513125],[133.536094,-70.580156],[129.668750,-68.366875],[125.717031,-66.459219],[123.652988,-65.803105],[121.500000,-65.443125],[120.252734,-63.502305],[118.933750,-61.935313],[116.262500,-59.355625],[113.850000,-56.569687],[112.854453,-54.744883],[112.060000,-52.443125],[111.632187,-49.455469],[111.480000,-45.611875],[111.500000,-38.443125],[111.273672,-33.572129],[110.617500,-28.518906],[109.543203,-23.391855],[108.062500,-18.299375],[106.187109,-13.349863],[103.928750,-8.651719],[101.299141,-4.313340],[98.310000,-0.443125],[93.545176,4.262891],[88.710156,7.773125],[83.774121,10.353359],[78.706250,12.269375],[68.051719,15.171875],[62.403418,16.689922],[56.500000,18.606875],[43.309063,23.448750],[28.860000,28.301875],[21.500586,30.382266],[14.230938,32.045000],[7.185820,33.149922],[0.500000,33.556875],[-14.139219,33.052344],[-20.861816,32.394082],[-27.386250,31.455625],[-40.440156,28.709531],[-54.500000,24.756875],[-62.656563,22.588906],[-69.210000,20.905625],[-72.353711,19.798379],[-75.658437,18.275469],[-79.311445,16.157949],[-83.500000,13.266875],[-87.868398,9.587637],[-91.711563,5.447969],[-95.052695,0.912441],[-97.915000,-3.954375],[-100.321680,-9.087910],[-102.295938,-14.423594],[-103.860977,-19.896855],[-105.040000,-25.443125],[-106.105000,-35.324375],[-106.820312,-40.575781],[-107.950000,-44.433125],[-109.112109,-46.274707],[-110.641250,-48.088281],[-114.442500,-51.549375],[-118.637500,-54.652344],[-122.510000,-57.233125],[-129.888750,-62.014375],[-133.879531,-64.344531],[-137.500000,-66.053125],[-143.277812,-67.766875],[-149.335000,-68.790625],[-155.474688,-69.293125],[-161.500000,-69.443125],[-177.500000,-70.443125],[-195.500000,-70.443125],[-218.500000,-71.443125],[-255.500000,-71.443125],[-282.500000,-71.443125],[-281.385449,-72.625313],[-280.183594,-73.458750],[-277.543750,-74.315625],[-274.632031,-74.486250],[-271.500000,-74.443125],[-253.500000,-75.443125],[-223.500000,-76.443125],[-212.410000,-77.393125],[-199.500000,-77.393125],[-185.500000,-78.443125],[-158.500000,-79.443125],[-143.500000,-80.443125],[-90.500000,-82.443125],[-89.912830,-86.248250],[-88.886543,-89.821152],[-87.455227,-93.160002],[-85.652969,-96.262969],[-83.513855,-99.128220],[-81.071973,-101.753926],[-78.361409,-104.138254],[-75.416250,-106.279375],[-72.270583,-108.175457],[-68.958496,-109.824668],[-61.971406,-112.375156],[-54.727676,-113.916191],[-47.500000,-114.433125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[73.500000,-107.443125],[74.500000,-106.443125],[74.500000,-107.443125],[73.500000,-107.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[43.500000,-104.643125],[39.249727,-102.852773],[35.059688,-100.162188],[31.024805,-96.755820],[27.240000,-92.818125],[23.800195,-88.533555],[20.800313,-84.086563],[18.335273,-79.661602],[16.500000,-75.443125],[19.032187,-77.216211],[21.326250,-79.480312],[25.515000,-84.700625],[27.567187,-87.266367],[29.696250,-89.542188],[31.980937,-91.332852],[34.500000,-92.443125],[36.692856,-94.867864],[38.983477,-96.817129],[41.358062,-98.319119],[43.802813,-99.402031],[46.303931,-100.094065],[48.847617,-100.423418],[51.420073,-100.418289],[54.007500,-100.106875],[59.172070,-98.677988],[64.230937,-96.362344],[69.073711,-93.385527],[73.590000,-89.973125],[76.785625,-86.982188],[79.512500,-84.225625],[82.505625,-81.960312],[84.331719,-81.092148],[86.500000,-80.443125],[83.264375,-86.008223],[79.162500,-91.302031],[74.321875,-96.097324],[68.870000,-100.166875],[62.934375,-103.283457],[59.825000,-104.413376],[56.642500,-105.219844],[53.402812,-105.674456],[50.121875,-105.748809],[46.815625,-105.414500],[43.500000,-104.643125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[76.500000,-104.443125],[77.500000,-103.443125],[77.500000,-104.443125],[76.500000,-104.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[34.500000,-103.443125],[35.500000,-102.443125],[35.500000,-103.443125],[34.500000,-103.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-31.670000,-89.443125],[-36.096250,-94.043281],[-41.347500,-98.366875],[-44.218047,-100.117051],[-47.217500,-101.428594],[-50.320078,-102.178340],[-53.500000,-102.243125],[-57.732969,-101.223945],[-62.370000,-99.103438],[-67.175781,-96.117148],[-71.915000,-92.500625],[-76.352344,-88.489414],[-80.252500,-84.319063],[-83.380156,-80.225117],[-85.500000,-76.443125],[-81.811094,-77.998437],[-79.268750,-79.990625],[-74.410000,-85.353125],[-69.801094,-89.351094],[-64.433750,-92.714375],[-61.549746,-93.979590],[-58.577031,-94.872031],[-55.549238,-95.320332],[-52.500000,-95.253125],[-50.183535,-94.802813],[-47.860156,-94.015000],[-43.318750,-91.655625],[-39.127969,-88.632500],[-35.540000,-85.403125],[-30.758750,-80.039375],[-29.563730,-79.041504],[-28.183906,-78.252344],[-26.526816,-77.707637],[-24.500000,-77.443125],[-25.663906,-80.935313],[-27.248750,-83.900625],[-29.251719,-86.637188],[-31.670000,-89.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-63.500000,-101.443125],[-62.500000,-100.443125],[-62.500000,-101.443125],[-63.500000,-101.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-44.500000,-101.443125],[-43.500000,-100.443125],[-43.500000,-101.443125],[-44.500000,-101.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[79.500000,-99.443125],[80.500000,-98.443125],[80.500000,-99.443125],[79.500000,-99.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[76.500000,-96.443125],[77.500000,-95.443125],[77.500000,-96.443125],[76.500000,-96.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-35.500000,-94.443125],[-34.500000,-93.443125],[-34.500000,-94.443125],[-35.500000,-94.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-66.500000,-91.443125],[-65.500000,-90.443125],[-65.500000,-91.443125],[-66.500000,-91.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[80.500000,-91.443125],[81.500000,-90.443125],[81.500000,-91.443125],[80.500000,-91.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-68.500000,-90.443125],[-67.500000,-89.443125],[-67.500000,-90.443125],[-68.500000,-90.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[82.500000,-88.443125],[83.500000,-87.443125],[83.500000,-88.443125],[82.500000,-88.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-88.500000,-87.443125],[-87.500000,-86.443125],[-87.500000,-87.443125],[-88.500000,-87.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-85.500000,-87.443125],[-84.500000,-86.443125],[-84.500000,-87.443125],[-85.500000,-87.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[83.500000,-87.443125],[84.500000,-86.443125],[84.500000,-87.443125],[83.500000,-87.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-26.500000,-86.443125],[-25.500000,-85.443125],[-25.500000,-86.443125],[-26.500000,-86.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-81.500000,-85.443125],[-80.500000,-84.443125],[-80.500000,-85.443125],[-81.500000,-85.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-75.500000,-84.443125],[-74.500000,-83.443125],[-74.500000,-84.443125],[-75.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-73.500000,-84.443125],[-72.500000,-83.443125],[-72.500000,-84.443125],[-73.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-36.500000,-84.443125],[-35.500000,-83.443125],[-35.500000,-84.443125],[-36.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[25.500000,-84.443125],[26.500000,-83.443125],[26.500000,-84.443125],[25.500000,-84.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-83.500000,-83.443125],[-82.500000,-82.443125],[-82.500000,-83.443125],[-83.500000,-83.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-87.500000,-80.443125],[-86.500000,-79.443125],[-86.500000,-80.443125],[-87.500000,-80.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[22.990000,-57.483125],[20.311094,-54.781094],[17.961250,-52.704375],[16.438281,-50.757031],[16.142441,-49.676895],[16.240000,-48.443125],[16.699102,-47.305781],[17.477188,-46.191875],[19.680000,-44.098125],[24.500000,-40.893125],[31.142031,-37.559219],[38.493750,-34.936875],[46.098594,-33.182656],[53.500000,-32.453125],[58.255059,-32.648125],[63.374219,-33.443125],[68.593457,-34.849375],[73.648750,-36.878125],[78.276074,-39.540625],[82.211406,-42.848125],[83.837068,-44.747266],[85.190723,-46.811875],[86.239368,-49.043359],[86.950000,-51.443125],[87.165820,-53.250137],[87.079063,-55.086094],[86.182500,-58.754375],[84.629687,-62.267031],[82.790000,-65.443125],[80.026992,-69.369961],[77.065938,-72.687187],[73.877539,-75.401133],[70.432500,-77.518125],[66.701523,-79.044492],[62.655313,-79.986562],[58.264570,-80.350664],[53.500000,-80.143125],[48.079258,-78.781445],[43.456562,-76.937188],[39.462461,-74.641523],[35.927500,-71.925625],[32.682227,-68.820664],[29.557188,-65.357813],[22.990000,-57.483125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[69.500000,-80.443125],[70.500000,-79.443125],[70.500000,-80.443125],[69.500000,-80.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-88.060000,-56.443125],[-89.557500,-52.544375],[-89.992188,-50.498906],[-90.020000,-48.443125],[-89.585315,-46.199668],[-88.812676,-44.069531],[-87.734207,-42.056816],[-86.382031,-40.165625],[-82.985059,-36.764219],[-78.878750,-33.898125],[-74.320098,-31.600156],[-69.566094,-29.903125],[-64.873730,-28.839844],[-60.500000,-28.443125],[-51.819687,-28.760312],[-43.400000,-30.065625],[-39.300195,-31.156211],[-35.280313,-32.574688],[-31.345273,-34.348008],[-27.500000,-36.503125],[-22.576250,-39.918125],[-20.259219,-42.114062],[-19.435918,-43.241445],[-18.950000,-44.353125],[-18.843770,-45.355664],[-19.058281,-46.204688],[-20.228750,-47.630625],[-22.019844,-49.007812],[-23.990000,-50.713125],[-26.920000,-54.443125],[-30.604727,-59.129551],[-34.554062,-63.520781],[-38.798242,-67.480996],[-43.367500,-70.874375],[-48.292070,-73.565098],[-53.602188,-75.417344],[-59.328086,-76.295293],[-65.500000,-76.063125],[-69.266230,-74.799668],[-72.786719,-73.170469],[-76.049160,-71.188535],[-79.041250,-68.866875],[-81.750684,-66.218496],[-84.165156,-63.256406],[-86.272363,-59.993613],[-88.060000,-56.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[129.500000,-72.443125],[130.500000,-71.443125],[130.500000,-72.443125],[129.500000,-72.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[78.500000,-60.443125],[80.500000,-58.513125],[76.670000,-58.513125],[70.460000,-64.263125],[62.500000,-71.443125],[65.399883,-71.567656],[68.175312,-71.299375],[70.759961,-70.620469],[73.087500,-69.513125],[75.091602,-67.959531],[76.705938,-65.941875],[77.864180,-63.442344],[78.500000,-60.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[30.500000,-69.443125],[31.500000,-68.443125],[31.500000,-69.443125],[30.500000,-69.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[28.500000,-67.443125],[29.500000,-66.443125],[29.500000,-67.443125],[28.500000,-67.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[123.500000,-67.443125],[124.500000,-66.443125],[124.500000,-67.443125],[123.500000,-67.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[85.500000,-66.443125],[86.500000,-65.443125],[86.500000,-66.443125],[85.500000,-66.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-46.500000,-66.113125],[-43.513594,-64.770937],[-40.383750,-62.313125],[-37.777031,-59.337812],[-36.878145,-57.843008],[-36.360000,-56.443125],[-36.063750,-54.383125],[-36.360000,-52.443125],[-45.510000,-60.233125],[-52.500000,-65.443125],[-49.552500,-66.183125],[-48.084375,-66.298125],[-46.500000,-66.113125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-86.500000,-64.443125],[-85.500000,-63.443125],[-85.500000,-64.443125],[-86.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-44.500000,-64.443125],[-43.500000,-63.443125],[-43.500000,-64.443125],[-44.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[75.500000,-64.443125],[76.500000,-63.443125],[76.500000,-64.443125],[75.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[113.500000,-64.443125],[114.500000,-63.443125],[114.500000,-64.443125],[113.500000,-64.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-129.500000,-63.443125],[-128.500000,-62.443125],[-128.500000,-63.443125],[-129.500000,-63.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[73.500000,-63.443125],[74.500000,-62.443125],[74.500000,-63.443125],[73.500000,-63.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-44.500000,-61.443125],[-43.500000,-60.443125],[-43.500000,-61.443125],[-44.500000,-61.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[75.500000,-61.443125],[76.500000,-60.443125],[76.500000,-61.443125],[75.500000,-61.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-120.500000,-58.443125],[-119.500000,-57.443125],[-119.500000,-58.443125],[-120.500000,-58.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-41.500000,-58.443125],[-40.500000,-57.443125],[-40.500000,-58.443125],[-41.500000,-58.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-114.500000,-53.443125],[-113.500000,-52.443125],[-113.500000,-53.443125],[-114.500000,-53.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-93.500000,-49.443125],[-92.500000,-48.443125],[-92.500000,-49.443125],[-93.500000,-49.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-94.500000,-44.443125],[-93.500000,-43.443125],[-93.500000,-44.443125],[-94.500000,-44.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[16.500000,-44.443125],[17.500000,-43.443125],[17.500000,-44.443125],[16.500000,-44.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[18.500000,-43.443125],[19.500000,-42.443125],[19.500000,-43.443125],[18.500000,-43.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-85.500000,-38.443125],[-84.500000,-37.443125],[-84.500000,-38.443125],[-85.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-86.500000,-37.443125],[-85.500000,-36.443125],[-85.500000,-37.443125],[-86.500000,-37.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-83.500000,-36.443125],[-82.500000,-35.443125],[-82.500000,-36.443125],[-83.500000,-36.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-10.500000,-29.443125],[-8.552676,-27.385684],[-5.899531,-26.014844],[-2.778809,-25.299082],[0.571250,-25.206875],[3.912402,-25.706699],[7.006406,-26.767031],[9.615020,-28.356348],[11.500000,-30.443125],[-10.500000,-29.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-74.500000,-29.443125],[-73.500000,-28.443125],[-73.500000,-29.443125],[-74.500000,-29.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-20.500000,-4.443125],[-19.500000,-3.443125],[-19.500000,-4.443125],[-20.500000,-4.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[7.500000,-2.583125],[-9.500000,-2.583125],[-12.979375,-2.728125],[-15.757500,-2.730625],[-16.984375,-2.454609],[-18.156875,-1.874375],[-19.315313,-0.900391],[-20.500000,0.556875],[-17.167051,2.587695],[-14.092031,3.845312],[-11.175684,4.479961],[-8.318750,4.641875],[-2.386094,4.148438],[4.500000,3.566875],[9.455000,3.406563],[11.735156,3.145352],[13.795000,2.614375],[15.567969,1.701836],[16.987500,0.295937],[17.987031,-1.715117],[18.500000,-4.443125],[7.500000,-2.583125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-20.500000,1.556875],[-19.500000,2.556875],[-19.500000,1.556875],[-20.500000,1.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-90.500000,4.556875],[-89.500000,5.556875],[-89.500000,4.556875],[-90.500000,4.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[89.500000,4.556875],[90.500000,5.556875],[90.500000,4.556875],[89.500000,4.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-89.500000,5.556875],[-88.500000,6.556875],[-88.500000,5.556875],[-89.500000,5.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-82.500000,10.556875],[-81.500000,11.556875],[-81.500000,10.556875],[-82.500000,10.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-83.500000,11.556875],[-82.500000,12.556875],[-82.500000,11.556875],[-83.500000,11.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-78.500000,14.556875],[-77.500000,15.556875],[-77.500000,14.556875],[-78.500000,14.556875]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[251.540000,-54.263125],[247.825000,-50.214688],[244.995000,-46.093125],[242.450000,-41.851563],[239.590000,-37.443125],[235.468125,-32.139219],[230.825000,-27.036875],[225.791875,-22.330156],[220.500000,-18.213125],[216.675449,-15.742852],[212.988594,-13.771562],[209.363379,-12.246055],[205.723750,-11.113125],[201.993652,-10.319570],[198.097031,-9.812187],[189.500000,-9.443125],[184.494844,-9.202500],[179.428750,-8.583125],[169.500000,-6.553125],[137.500000,2.896875],[132.531563,4.879531],[128.300000,6.675625],[123.918437,7.997344],[118.500000,8.556875],[114.731562,8.607812],[110.432500,8.304375],[108.386914,7.841055],[106.572188,7.074687],[105.109492,5.933789],[104.120000,4.346875],[103.767090,2.453398],[104.092344,0.539062],[104.955488,-1.450742],[106.216250,-3.570625],[109.369531,-8.419062],[110.981504,-11.256836],[112.430000,-14.443125],[114.157344,-19.383750],[115.651250,-24.778125],[116.779531,-30.255000],[117.410000,-35.443125],[117.687500,-45.118125],[118.324062,-50.079375],[118.975977,-52.335000],[119.930000,-54.343125],[122.290625,-57.018750],[125.630000,-59.533125],[132.500000,-63.583125],[136.482461,-65.637051],[140.249063,-67.238281],[143.892383,-68.442246],[147.505000,-69.304375],[155.008438,-70.224844],[163.500000,-70.443125],[178.500000,-71.443125],[192.500000,-71.443125],[207.500000,-72.443125],[226.500000,-72.443125],[247.500000,-73.443125],[279.500000,-73.443125],[276.681758,-70.456641],[273.418437,-67.881250],[266.060000,-63.478125],[258.431562,-59.262500],[254.830742,-56.921484],[251.540000,-54.263125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[134.500000,-62.443125],[135.500000,-61.443125],[135.500000,-62.443125],[134.500000,-62.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[242.500000,-47.443125],[243.500000,-46.443125],[243.500000,-47.443125],[242.500000,-47.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[236.500000,-40.443125],[237.500000,-39.443125],[237.500000,-40.443125],[236.500000,-40.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[237.500000,-38.443125],[238.500000,-37.443125],[238.500000,-38.443125],[237.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[236.500000,-37.443125],[237.500000,-36.443125],[237.500000,-37.443125],[236.500000,-37.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[217.500000,-23.443125],[218.500000,-22.443125],[218.500000,-23.443125],[217.500000,-23.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[219.500000,-22.443125],[220.500000,-21.443125],[220.500000,-22.443125],[219.500000,-22.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[217.500000,-21.443125],[218.500000,-20.443125],[218.500000,-21.443125],[217.500000,-21.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[218.500000,-19.443125],[219.500000,-18.443125],[219.500000,-19.443125],[218.500000,-19.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[200.500000,-15.443125],[201.500000,-14.443125],[201.500000,-15.443125],[200.500000,-15.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[208.500000,-14.443125],[209.500000,-13.443125],[209.500000,-14.443125],[208.500000,-14.443125]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[-224.500000,-67.443125],[-209.500000,-66.443125],[-193.500000,-66.443125],[-179.500000,-65.443125],[-170.938906,-65.126250],[-161.508750,-64.363125],[-152.144219,-63.165000],[-143.780000,-61.543125],[-139.682656,-60.437813],[-135.713750,-58.895625],[-132.207969,-56.652188],[-130.733340,-55.184883],[-129.500000,-53.443125],[-127.043281,-53.036406],[-124.763750,-52.206875],[-120.500000,-49.643125],[-116.686406,-46.299180],[-114.013750,-42.625938],[-112.235469,-38.655039],[-111.105000,-34.418125],[-109.801250,-25.272813],[-109.134844,-20.427695],[-108.130000,-15.443125],[-106.555000,-9.853125],[-104.380000,-4.443125],[-101.045000,1.568594],[-99.366016,4.775020],[-98.167500,7.935625],[-97.815547,10.915762],[-98.071436,12.296077],[-98.676250,13.580781],[-99.675752,14.753044],[-101.115703,15.796035],[-103.041865,16.692922],[-105.500000,17.426875],[-112.500000,17.426875],[-117.500000,17.426875],[-122.552500,17.012344],[-126.397500,15.843125],[-134.500000,11.866875],[-145.947500,6.903125],[-152.120313,4.493906],[-157.500000,2.696875],[-163.642188,1.072656],[-169.865000,-0.231875],[-176.155313,-1.107031],[-182.500000,-1.443125],[-188.350781,-1.524531],[-194.198750,-1.906875],[-199.947344,-2.887344],[-205.500000,-4.763125],[-209.688887,-6.849629],[-213.691094,-9.273281],[-217.507441,-11.995293],[-221.138750,-14.976875],[-227.849531,-21.563594],[-233.830000,-28.723125],[-236.827812,-33.018594],[-238.950000,-36.446875],[-241.432188,-39.940781],[-245.510000,-44.433125],[-250.682500,-48.772813],[-257.122500,-53.493125],[-263.003750,-57.935938],[-265.164141,-59.847617],[-266.500000,-61.443125],[-268.650527,-61.342051],[-270.815469,-61.549531],[-275.073750,-62.759375],[-279.045156,-64.811094],[-282.500000,-67.443125],[-224.500000,-67.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-271.500000,-63.443125],[-270.500000,-62.443125],[-270.500000,-63.443125],[-271.500000,-63.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-269.500000,-62.443125],[-268.500000,-61.443125],[-268.500000,-62.443125],[-269.500000,-62.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-264.500000,-61.443125],[-263.500000,-60.443125],[-263.500000,-61.443125],[-264.500000,-61.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-144.500000,-60.443125],[-143.500000,-59.443125],[-143.500000,-60.443125],[-144.500000,-60.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-132.500000,-54.443125],[-131.500000,-53.443125],[-131.500000,-54.443125],[-132.500000,-54.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-252.500000,-52.443125],[-251.500000,-51.443125],[-251.500000,-52.443125],[-252.500000,-52.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-249.500000,-52.443125],[-248.500000,-51.443125],[-248.500000,-52.443125],[-249.500000,-52.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-251.500000,-51.443125],[-250.500000,-50.443125],[-250.500000,-51.443125],[-251.500000,-51.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-119.500000,-46.443125],[-118.500000,-45.443125],[-118.500000,-46.443125],[-119.500000,-46.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-244.500000,-45.443125],[-243.500000,-44.443125],[-243.500000,-45.443125],[-244.500000,-45.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-117.500000,-43.443125],[-116.500000,-42.443125],[-116.500000,-43.443125],[-117.500000,-43.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-240.500000,-41.443125],[-239.500000,-40.443125],[-239.500000,-41.443125],[-240.500000,-41.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-237.500000,-40.443125],[-236.500000,-39.443125],[-236.500000,-40.443125],[-237.500000,-40.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-238.500000,-38.443125],[-237.500000,-37.443125],[-237.500000,-38.443125],[-238.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-235.500000,-38.443125],[-234.500000,-37.443125],[-234.500000,-38.443125],[-235.500000,-38.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-232.500000,-32.443125],[-231.500000,-31.443125],[-231.500000,-32.443125],[-232.500000,-32.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-233.500000,-30.443125],[-232.500000,-29.443125],[-232.500000,-30.443125],[-233.500000,-30.443125]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-227.500000,-23.443125],[-226.500000,-22.443125],[-226.500000,-23.443125],[-227.500000,-23.443125]]);\n }\n linear_extrude(height=h)\n polygon([[-131.500000,-55.443125],[-130.500000,-54.443125],[-130.500000,-55.443125],[-131.500000,-55.443125]]);\n difference()\n {\n linear_extrude(height=h)\n polygon([[163.500000,9.626875],[166.724688,9.947812],[169.962500,10.536875],[172.941562,11.710938],[174.249102,12.616367],[175.390000,13.786875],[177.206250,16.772188],[178.137500,19.864375],[178.472500,23.110312],[178.500000,26.556875],[177.953750,32.679570],[176.580625,38.154688],[174.576563,43.127773],[172.137500,47.744375],[166.738125,56.490312],[164.169688,60.910742],[161.950000,65.556875],[156.896250,78.549375],[153.733281,85.255625],[152.039941,88.000078],[150.290000,90.086875],[147.422344,92.417324],[143.929375,94.613594],[135.757500,98.543125],[127.154375,101.754531],[119.500000,104.126875],[108.176641,106.984609],[96.066250,109.386250],[83.412109,111.355703],[70.457500,112.916875],[57.445703,114.093672],[44.620000,114.910000],[32.223672,115.389766],[20.500000,115.556875],[7.500000,116.516875],[0.928750,116.415625],[-2.648906,116.113281],[-5.500000,115.616875],[-9.156421,114.313552],[-12.115898,112.571230],[-14.429380,110.440754],[-16.147812,107.972969],[-17.322144,105.218718],[-18.003320,102.228848],[-18.242290,99.054202],[-18.090000,95.745625],[-16.815430,88.930059],[-14.587187,82.188906],[-11.812852,75.928926],[-8.900000,70.556875],[-3.740000,62.556875],[-0.071250,58.156875],[3.920000,54.086875],[6.782305,51.963203],[9.487813,50.681875],[12.180664,50.002422],[15.005000,49.684375],[21.624687,49.170625],[25.708320,48.493984],[30.500000,47.216875],[59.500000,37.376875],[65.094531,36.627344],[69.673750,36.570625],[74.416094,36.354531],[80.500000,35.126875],[103.500000,26.316875],[107.243750,25.717187],[110.057500,25.756875],[112.342500,25.909063],[114.500000,25.646875],[116.418672,24.847598],[118.076250,23.688906],[120.812500,20.618125],[123.117500,17.084219],[125.400000,13.736875],[127.391406,11.609531],[129.466250,10.113125],[131.782969,9.016094],[134.500000,8.086875],[141.109687,7.689062],[148.797500,8.099375],[163.500000,9.626875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[3.500000,55.556875],[4.500000,56.556875],[4.500000,55.556875],[3.500000,55.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[1.500000,61.556875],[2.500000,62.556875],[2.500000,61.556875],[1.500000,61.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[150.500000,87.556875],[151.500000,88.556875],[151.500000,87.556875],[150.500000,87.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-12.500000,110.556875],[-11.500000,111.556875],[-11.500000,110.556875],[-12.500000,110.556875]]);\n }\n difference()\n {\n linear_extrude(height=h)\n polygon([[-26.150000,90.556875],[-27.601250,98.538125],[-28.460000,106.556875],[-28.541250,111.514375],[-28.976094,113.984688],[-30.100000,115.976875],[-31.089414,116.735703],[-32.373438,117.335625],[-35.485000,118.124375],[-38.754063,118.474375],[-41.500000,118.516875],[-49.439180,117.890586],[-57.221563,116.613438],[-64.880664,114.823008],[-72.450000,112.656875],[-87.453437,107.747813],[-102.500000,102.986875],[-135.500000,96.806875],[-139.435156,95.500469],[-142.036250,94.253125],[-147.500000,91.226875],[-150.536465,90.028633],[-153.559219,89.251563],[-159.403750,88.361875],[-164.713906,87.359687],[-167.068691,86.441992],[-169.170000,85.046875],[-171.163437,82.745313],[-172.997500,79.699375],[-175.700000,73.556875],[-177.091152,69.003848],[-178.309219,63.573906],[-179.218613,57.584512],[-179.683750,51.353125],[-179.569043,45.197207],[-178.738906,39.434219],[-177.057754,34.381621],[-175.855676,32.220925],[-174.390000,30.356875],[-171.737500,28.358750],[-168.365000,26.821875],[-161.500000,24.696875],[-149.378750,20.919375],[-143.993594,19.910000],[-136.500000,19.556875],[-139.333750,25.048125],[-140.503594,27.962031],[-140.689199,29.217832],[-140.480000,30.246875],[-139.315625,31.502402],[-137.506250,32.207969],[-135.237500,32.485801],[-132.695000,32.458125],[-127.531250,31.975156],[-123.500000,31.736875],[-102.500000,33.976875],[-99.769375,33.695938],[-97.072500,33.176875],[-93.089375,32.702813],[-86.500000,32.556875],[-82.222148,33.056758],[-78.772813,34.266562],[-75.884570,35.954023],[-73.290000,37.886875],[-70.721680,39.832852],[-67.912188,41.559687],[-64.594102,42.835117],[-60.500000,43.426875],[-36.500000,40.556875],[-18.500000,40.556875],[-7.500000,41.466875],[1.082500,41.743125],[5.257500,42.250156],[9.500000,43.556875],[5.702991,44.527566],[2.141895,45.943496],[-1.189016,47.765452],[-4.295469,49.954219],[-7.183191,52.470583],[-9.857910,55.275332],[-14.591250,61.593125],[-18.541309,68.593887],[-21.753906,75.963906],[-24.274863,83.389473],[-26.150000,90.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-162.500000,25.556875],[-161.500000,26.556875],[-161.500000,25.556875],[-162.500000,25.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-171.500000,28.556875],[-170.500000,29.556875],[-170.500000,28.556875],[-171.500000,28.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-3.500000,46.556875],[-2.500000,47.556875],[-2.500000,46.556875],[-3.500000,46.556875]]);\n translate([0, 0, -fudge])\n linear_extrude(height=h+2*fudge)\n polygon([[-174.500000,70.556875],[-173.500000,71.556875],[-173.500000,70.556875],[-174.500000,70.556875]]);\n }\n }\n}\n\n\n\ntheChild(2);\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0b3d47f90a5933fa1ead5e3310f68a90bba338ef","subject":"This is a white space change.","message":"This is a white space change.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/office\/keyboard\/panels\/examples\/cherry-mx-switches\/cherry-mx-switches.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/office\/keyboard\/panels\/examples\/cherry-mx-switches\/cherry-mx-switches.scad","new_contents":"\r\n\/\/ This site lists the Cherry MX switch mounting hole dimensions as follows:\r\n\/\/\r\n\/\/ \t\thttp:\/\/www.makeuseof.com\/tag\/make-custom-shortcut-buttons-arduino\/\r\n\/\/\r\n\/\/\t\tx14mm x 14mm mounting hole, with a plate height less than 1.5mm\r\n","old_contents":"\r\n\r\n\/\/ This site lists the Cherry MX switch mounting hole dimensions as follows:\r\n\/\/\r\n\/\/ \t\thttp:\/\/www.makeuseof.com\/tag\/make-custom-shortcut-buttons-arduino\/\r\n\/\/\r\n\/\/\t\t14mm x 14mm mounting hole, with a plate height less than 1.5mm\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"eb3ec5f405dad7d35753a33b36ebdc210b361c8f","subject":"cleanup","message":"cleanup\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"openscad\/models\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\r\nuse <..\/external-resources\/aquaman\/aquaman-logo.scad>\r\nuse <..\/external-resources\/plumber-brother\/l\/luigi-outline.scad>\r\nuse <..\/external-resources\/plumber-brother\/m\/mario.scad>\r\nuse <..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\r\nuse <..\/external-resources\/thundercats\/thundercats-logo.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/rounded\/rounded-chain-loop.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/square\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/fish\/fish.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft, 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6,\r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n\t chaneLoopCutoutAxis = \"x\",\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n\t\t\t chainLoopType = \"square\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\",\r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText = \"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Helvetica\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor = baseColor,\r\n\t\t\t\tbaseHeight = baseHeight,\r\n baseThickness = baseThickness,\r\n\t\t\t\tbaseWidth = baseWidth,\r\n borderColor = borderColor,\r\n borderdistance = 5,\r\n borderHeight = borderHeight,\r\n borderradius = 8,\r\n\t\t\t\tbottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n\t\t\t\tchainLoop = chainLoop,\r\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\t\t\tchainLoopType = chainLoopType,\r\n letterThickness = letterThickness,\r\n\t\t\t\troundedCorners = roundedCorners,\r\n\t\t\t\tshowBorder = showBorder,\r\n topText = topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n topTextOffsetY = topTextOffsetY,\r\n\t\t\t\ttextSize = topTextSize);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight,\r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset,\r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n }\r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n\t\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n\t\t\t\t\t\tbaseWidth,\r\n borderColor,\r\n\t\t\t\t\t\tborderdistance,\r\n borderHeight,\r\n\t\t\t\t\t\tborderradius,\r\n\t\t\t\t\t\tbottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n\t\t\t\t\t\tchainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n letterThickness,\r\n\t\t\t\t\t\troundedCorners,\r\n\t\t\t\t\t\tshowBorder,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY)\r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText,\r\n textSize = textSize,\r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\r\n \/\/ Having the assignments in the method call caused an issue.\r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n borderHeight,\r\n\t\t\t\t\t borderradius,\r\n letterThickness,\r\n roundedCorners);\r\n }\r\n\r\n if (holes==2)\r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n if (holes==4)\r\n {\r\n base4holes(baseColor, baseWidth, baseHeight,\r\n\t\t\t\t\t chainLoop,\r\n\t\t\t\t\t chainLoopPosition,\r\n\t\t\t\t\t chainLoopType,\r\n\t\t\t\t\t borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t\t\tbaseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Aqua Dude\")\r\n {\r\n aquamanThumbnail(height=1.6);\r\n }\r\n else if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(1.8);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(1.8);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail(height = 1.7);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Fish\")\r\n {\r\n scale([1, 1, 1.6])\r\n fishThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n marioThumbnail();\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigiThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAllianceThumbnail(height = 1.7);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurThumbnail();\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail(height = 1.6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogoThumbnail(height = 1.7);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=2);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icon\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n\t\t\t\t\tbaseThickness,\r\n\t\t\t\t\tbaseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType,\r\n leftIconXyScale,\r\n rightIconXyScale,\r\n leftIconHeight,\r\n rightIconHeight,\r\n xOffset,\r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n\r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t baseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n size = [baseWidth, baseHeight, baseThickness];\r\n\r\n\tcornerRadius = 8;\r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius = cornerRadius,\r\n sides=30,\r\n sidesOnly=true,\r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n \t\tif(chainLoopType == \"square\")\r\n \t\t{\r\n\t\t\t x = 21;\r\n\t y = 8;\r\n\r\n\t xTranslate = -x \/ 2.0;\r\n\r\n\t\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\r\n\t yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n\t yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\t yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n\r\n\t translate([xTranslate, yTranslate, 0])\r\n\t chainLoop(cutoutAxis = chaneLoopCutoutAxis,\r\n\t\t\t\t\t xLength = x,\r\n\t yLength = y,\r\n\t yPercentage = chainLoopLengthPercentageY,\r\n\t zLength = chainLoopLengthZ,\r\n\t zPercentage = chainLoopLengthPercentageZ);\r\n }\r\n \t\t else if(chainLoopType == \"rounded\")\r\n \t\t {\r\n \t\t\touterRadius = 10;\r\n\r\n \t\t\txTranslate = 0;\r\n \t\t\tyTranslate = \/\/outerRadius * 2\r\n \/\/\t\t\t \t\t\t baseHeight - outerRadius - cornerRadius\r\n \t\t\t \t\t\t (outerRadius) + (cornerRadius \/ 2.0) + (baseHeight \/ 2.0);\r\n\r\n \t\t\ttranslate([xTranslate, yTranslate, 0])\r\n \t\t\troundedChainLoop(height = 5,\r\n \t\t\t\t\t\t\t outerRadius = outerRadius);\r\n\t\t }\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n\t\t\t\t\t borderHeight,\r\n borderradius,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n\tcolor(\"pink\")\r\n translate([0,0,baseThickness\/2])\r\n\/\/ this next commented line was causing the 'floating' border issue\r\n\/\/ translate([0,0,baseThickness+letterThickness\/2])\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection()\r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/external-resources\/music\/notes\/treble-clef\/treble-clef-scaled-down.scad>\r\nuse <..\/external-resources\/aquaman\/aquaman-logo.scad>\r\nuse <..\/external-resources\/plumber-brother\/l\/luigi-outline.scad>\r\nuse <..\/external-resources\/plumber-brother\/m\/mario.scad>\r\nuse <..\/external-resources\/rebel-alliance\/rebel-alliance.scad>\r\nuse <..\/external-resources\/thundercats\/thundercats-logo.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/rounded\/rounded-chain-loop.scad>\r\nuse <..\/mounting-hardware\/chain-loop\/square\/chain-loop.scad>\r\nuse <..\/shapes\/crescent-moon\/crescent-moon.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/fish\/fish.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\nuse <..\/shapes\/minecraft\/creeper\/creeper-face.scad>\r\nuse <..\/shapes\/spurs\/spurs-a.scad>\r\nuse <..\/shapes\/weather\/sun\/sun.scad>\r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft, 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\nfudge = 0.1;\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(baseColor = \"black\",\r\n baseHeight = 54,\r\n baseThickness = 2,\r\n baseWidth = 200,\r\n borderColor = \"yellow\",\r\n borderHeight = 6,\r\n bottomText = \"Love Lots\",\r\n bottomTextFont = \"Arial\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n chainLoop = true,\r\n\t chaneLoopCutoutAxis = \"x\",\r\n chainLoopLengthPercentageY = 0.75,\r\n chainLoopLengthPercentageZ = 0.65,\r\n chainLoopLengthZ = 10,\r\n chainLoopPosition = \"bottom\",\r\n\t\t\t chainLoopType = \"square\",\r\n iconColor = \"white\",\r\n leftIconHeight = 1.5,\r\n leftIconType = \"Light Bulb\",\r\n leftIconXyScale = 1.0,\r\n letterThickness = 3,\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n rightIconType = \"Light Bulb\",\r\n rightIconXyScale = 1.7,\r\n roundedCorners = true,\r\n showBorder = \"No\",\r\n topText = \"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextFont = \"Helvetica\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n xIconOffset = 87,\r\n yIconOffset = 87)\r\n{\r\n union()\r\n {\r\n nametag_assembly(baseColor = baseColor,\r\n\t\t\t\tbaseHeight = baseHeight,\r\n baseThickness = baseThickness,\r\n\t\t\t\tbaseWidth = baseWidth,\r\n borderColor = borderColor,\r\n borderdistance = 5,\r\n borderHeight = borderHeight,\r\n borderradius = 8,\r\n\t\t\t\tbottomText = bottomText,\r\n bottomTextFont = bottomTextFont,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n\t\t\t\tchainLoop = chainLoop,\r\n\t\t\t\tchaneLoopCutoutAxis = chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY = chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ = chainLoopLengthPercentageZ,\r\n chainLoopLengthZ = chainLoopLengthZ,\r\n chainLoopPosition = chainLoopPosition,\r\n\t\t\t\tchainLoopType = chainLoopType,\r\n letterThickness = letterThickness,\r\n\t\t\t\troundedCorners = roundedCorners,\r\n\t\t\t\tshowBorder = showBorder,\r\n topText = topText,\r\n topTextColor = topTextColor,\r\n topTextFont = topTextFont,\r\n topTextOffsetY = topTextOffsetY,\r\n\t\t\t\ttextSize = topTextSize);\r\n\r\n icons(iconColor = iconColor,\r\n leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight,\r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset,\r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n }\r\n}\r\n\r\nmodule nametag_assembly(baseColor,\r\n\t\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n\t\t\t\t\t\tbaseWidth,\r\n borderColor,\r\n\t\t\t\t\t\tborderdistance,\r\n borderHeight,\r\n\t\t\t\t\t\tborderradius,\r\n\t\t\t\t\t\tbottomText,\r\n bottomTextFont,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n\t\t\t\t\t\tchainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n letterThickness,\r\n\t\t\t\t\t\troundedCorners,\r\n\t\t\t\t\t\tshowBorder,\r\n topText,\r\n topTextColor,\r\n topTextFont,\r\n textSize,\r\n topTextOffsetY)\r\n{\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText,\r\n textSize = textSize,\r\n font = topTextFont,\r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = bottomTextFont,\r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\r\n \/\/ Having the assignments in the method call caused an issue.\r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n borderHeight,\r\n\t\t\t\t\t borderradius,\r\n letterThickness,\r\n roundedCorners);\r\n }\r\n\r\n if (holes==2)\r\n {\r\n base2holes(baseColor, baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n if (holes==4)\r\n {\r\n base4holes(baseColor, baseWidth, baseHeight,\r\n\t\t\t\t\t chainLoop,\r\n\t\t\t\t\t chainLoopPosition,\r\n\t\t\t\t\t chainLoopType,\r\n\t\t\t\t\t borderdistance, roundedCorners);\r\n }\r\n else\r\n {\r\n nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t\t\tbaseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconColor, iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Aqua Dude\")\r\n {\r\n aquamanThumbnail(height=1.6);\r\n\/\/ aquaman(4);\r\n }\r\n else if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(1.8);\r\n\/\/ \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(1.8);\r\n }\r\n else if(iconType == \"Creeper\")\r\n {\r\n creeperFaceThumbnail(height = 1.7);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Fish\")\r\n {\r\n scale([1, 1, 1.6])\r\n fishThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n marioThumbnail();\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigiThumbnail();\r\n }\r\n else if(iconType == \"Moon\")\r\n {\r\n crescentMoonThumbnail();\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAllianceThumbnail(height = 1.7);\r\n }\r\n else if(iconType == \"Spur\")\r\n {\r\n spurThumbnail();\r\n }\r\n else if(iconType == \"Sun\")\r\n {\r\n sunThumbnail(height = 1.6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogoThumbnail(height = 1.7);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n trebleClefScaledDownThumbnail(h=2);\r\n }\r\n else\r\n {\r\n echo(\"drawing no icon\");\r\n }\r\n}\r\n\r\nmodule base2holes(baseColor,\r\n baseThickness,\r\n baseWidth,\r\n baseHeight,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n\t\t\t\t\tbaseThickness,\r\n\t\t\t\t\tbaseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseColor,\r\n\t\t\t\t\tbaseHeight,\r\n baseThickness,\r\n baseWidth,\r\n\t\t\t\t\tborderdistance,\r\n chainLoop,\r\n\t\t\t\t\t\t\tchaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t\t\t\tchainLoopType,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole(baseThickness);\r\n\t}\r\n}\r\n\r\nmodule icons(iconColor,\r\n leftIconType,\r\n leftIconXyScale,\r\n rightIconXyScale,\r\n leftIconHeight,\r\n rightIconHeight,\r\n xOffset,\r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconColor = iconColor, iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n\r\n \/\/ right icon\r\n oneIcon(iconColor = iconColor, iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseColor,\r\n baseHeight,\r\n\t\t\t\t baseThickness,\r\n baseWidth,\r\n chainLoop,\r\n\t\t\t\t chaneLoopCutoutAxis,\r\n chainLoopLengthPercentageY,\r\n chainLoopLengthPercentageZ,\r\n chainLoopLengthZ,\r\n chainLoopPosition,\r\n\t\t\t\t chainLoopType,\r\n roundedCorners)\r\n{\r\n size = [baseWidth, baseHeight, baseThickness];\r\n\r\n\tcornerRadius = 8;\r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius = cornerRadius,\r\n sides=30,\r\n sidesOnly=true,\r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n \t\tif(chainLoopType == \"square\")\r\n \t\t{\r\n\t\t\t x = 21;\r\n\t y = 8;\r\n\r\n\t xTranslate = -x \/ 2.0;\r\n\r\n\t\/\/TODO: fix the 4 to be relative to the 8 of the rounded corner radius\r\n\t yBottomDelta = (-baseHeight \/ 2.0) - (y + 4);\r\n\t yTopDelta = (baseHeight \/ 2.0) + (y \/ 2.0);\r\n\r\n\t\/\/ yTranslate = (chainLoopPosition == \"top\") ? yTopDelta : - yTopDelta;\r\n\t yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n\r\n\t translate([xTranslate, yTranslate, 0])\r\n\t chainLoop(cutoutAxis = chaneLoopCutoutAxis,\r\n\t\t\t\t\t xLength = x,\r\n\t yLength = y,\r\n\t yPercentage = chainLoopLengthPercentageY,\r\n\t zLength = chainLoopLengthZ,\r\n\t zPercentage = chainLoopLengthPercentageZ);\r\n }\r\n \t\t else if(chainLoopType == \"rounded\")\r\n \t\t {\r\n \t\t\touterRadius = 10;\r\n\r\n \t\t\txTranslate = 0;\r\n \t\t\tyTranslate = \/\/outerRadius * 2\r\n \/\/\t\t\t \t\t\t baseHeight - outerRadius - cornerRadius\r\n \t\t\t \t\t\t (outerRadius) + (cornerRadius \/ 2.0) + (baseHeight \/ 2.0);\r\n\r\n \t\t\ttranslate([xTranslate, yTranslate, 0])\r\n \t\t\troundedChainLoop(height = 5,\r\n \t\t\t\t\t\t\t outerRadius = outerRadius);\r\n\t\t }\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseHeight,\r\n\t\t\t\t\t baseThickness,\r\n baseWidth,\r\n\t\t\t\t\t borderdistance,\r\n\t\t\t\t\t borderHeight,\r\n borderradius,\r\n letterThickness,\r\n roundedCorners)\r\n{\r\n\tcolor(\"pink\")\r\n translate([0,0,baseThickness\/2])\r\n\/\/ this next commented line was causing the 'floating' border issue\r\n\/\/ translate([0,0,baseThickness+letterThickness\/2])\r\n linear_extrude(height = borderHeight, center = false, convexity = 10, twist = 0)\r\n {\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection()\r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole(baseThickness)\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\n\/\/TODO: Replace this with: onebeartoe\/github\\3D-Modeling\\OpenSCAD\\library\\src\\main\\openscad\\external-resources\\music\\notes\\bass-clef\\bass-clef.scad\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"ae8ff74a5670a113e105cbd3a8e4699445fc16db","subject":"elements are now printer vertical, for better precision in key places","message":"elements are now printer vertical, for better precision in key places\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"walbrzych_dish_dryer_mount\/dish_dryer_support.scad","new_file":"walbrzych_dish_dryer_mount\/dish_dryer_support.scad","new_contents":"module _support_impl()\n{\n thick=3;\n d=7+2*thick;\n ox=2*20+d;\n difference()\n {\n union()\n {\n cube([ox, 20, thick]);\n translate([ox\/2, 0, thick])\n rotate([-90, 0, 0])\n cylinder(r=d\/2, h=20, $fn=50);\n }\n translate([ox\/2, 0, thick])\n {\n rotate([-90, 0, 0])\n cylinder(r=d\/2-thick, h=20, $fn=50);\n translate([-(d-2*thick)\/2, 0, -10])\n cube([d-2*thick, 20, 10]);\n }\n translate([0,0,-10])\n cube([ox, 20, 10]);\n }\n}\n\nmodule support()\n{\n rotate([90, 0, 0])\n _support_impl();\n}\n\nfor(i=[0:2])\n translate(i*[0, 12, 0])\n support();\n","old_contents":"module support()\n{\n thick=3;\n d=7+2*thick;\n ox=2*20+d;\n difference()\n {\n union()\n {\n cube([ox, 20, thick]);\n translate([ox\/2, 0, thick])\n rotate([-90, 0, 0])\n cylinder(r=d\/2, h=20, $fn=50);\n }\n translate([ox\/2, 0, thick])\n {\n rotate([-90, 0, 0])\n cylinder(r=d\/2-thick, h=20, $fn=50);\n translate([-(d-2*thick)\/2, 0, -10])\n cube([d-2*thick, 20, 10]);\n }\n translate([0,0,-10])\n cube([ox, 20, 10]);\n }\n}\n\nfor(i=[0:2])\n translate(i*[0, 20+5, 0])\n support();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3cd9fd46c76ee09a6cb77473c129e86617880a5a","subject":"y\/motor_mount: use new helpers","message":"y\/motor_mount: use new helpers\n","repos":"oysteinkrog\/kmax1,oysteinkrog\/kmax1","old_file":"y-motor-mount.scad","new_file":"y-motor-mount.scad","new_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n rcubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n tz(-1)\n cubea([depth\/2, ymotor_round_d, height*2], align=X+Z);\n\n \/\/ cut out motor mount holes etc\n tz(-1)\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n %yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n tz(yaxis_motor_offset_z)\n {\n \/\/ top plate\n tz(extrusion_size\/2)\n tx(ymotor_mount_thickness)\n tx(ymotor_w\/2)\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n\n \/\/ reinforcement plate between motor and extrusion\n tz(extrusion_size\/2)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extra_size=[0,0,ymotor_mount_thickness_h], extra_align=Z);\n\n \/\/ side triangles\n tz(extrusion_size\/2)\n for(y=[-1,1])\n ty(y*((ymotor_w\/2)+ymotor_mount_thickness\/2))\n {\n tx(ymotor_mount_thickness)\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=X-Z,\n orient=X\n );\n\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=X-Z);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n tz(-20*mm)\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=-Z);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n tz(7*mm)\n rotate(180*X)\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","old_contents":"use \nuse \nuse \nuse \ninclude \n\ninclude \n\nmodule yaxis_motor_mount_bearing_clamp(align=N)\n{\n bearing_d = bearing_625[1];\n bearing_h = bearing_625[2];\n width=ymotor_w+ymotor_mount_thickness;\n depth=ymotor_w+ymotor_mount_thickness*2;\n height=yaxis_motor_mount_bearing_clamp_offset_z;\n\n \/*size_align(size=[width,depth,height], align=align);*\/\n difference()\n {\n cubea([width, depth, height], align=[0,0,-1]);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n translate([0,0,.1])\n cylindera(h=bearing_h*2, d=bearing_d*rod_fit_tolerance, orient=Z, align=[0,0,-1]);\n\n \/\/ cutout for belt path\n cylindera(d=bearing_d, h=height*2, orient=Z, align=[0,0,-1]);\n translate([depth\/2, 0, -bearing_h])\n cubea([depth, ymotor_round_d, height-bearing_h+1], align=[0,0,-1]);\n\n \/\/ cut out motor mount holes etc\n screw_dist = lookup(NemaDistanceBetweenMountingHoles, yaxis_motor);\n for(x=[-1,1])\n for(y=[-1,1])\n translate([x*screw_dist\/2, y*screw_dist\/2, 1])\n screw_cut(nut=extrusion_nut, head=\"button\", h=12*mm, orient=Z, align=-Z);\n }\n\n \/\/ debug bearing\n %cylindera(h=bearing_h, d=bearing_d*rod_fit_tolerance, align=[0,0,-1], orient=Z);\n}\n\nmodule motor_mount_top(width, depth, height, belt_cutout=true, belt_cutout_orient=X, align=N)\n{\n size_align(size=[width, depth, height], align=align);\n difference()\n {\n rcubea([width, depth, height], align=Z);\n\n ymotor_round_d = lookup(NemaRoundExtrusionDiameter, yaxis_motor);\n\n \/\/ cutout for belt path\n cylindera(d=ymotor_round_d, h=height*2, orient=Z, align=N);\n translate([0, 0,-1])\n cubea([depth\/2, ymotor_round_d, height*2], align=[1,0,1]);\n\n \/\/ cut out motor mount holes etc\n translate([0,0,-1])\n linear_extrude(height+2)\n stepper_motor_mount(17, slide_distance=0, mochup=false);\n }\n}\n\nmodule yaxis_motor_mount(part)\n{\n if(part==U)\n {\n difference()\n {\n yaxis_motor_mount(part=\"pos\");\n yaxis_motor_mount(part=\"neg\");\n }\n %yaxis_motor_mount(part=\"vit\");\n }\n else if(part==\"pos\")\n {\n \/\/ top plate\n material(Mat_Plastic)\n union()\n {\n translate([0,0,yaxis_motor_offset_z])\n {\n \/\/ top plate\n tz(extrusion_size\/2)\n tx(ymotor_mount_thickness)\n tx(ymotor_w\/2)\n motor_mount_top(width=ymotor_w+ymotor_mount_thickness,\n depth=ymotor_w+ymotor_mount_thickness*2,\n height=ymotor_mount_thickness_h,\n belt_cutout=true,\n belt_cutout_orient=X);\n\n \/\/ reinforcement plate between motor and extrusion\n translate([0,0,extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, ymotor_h], align=[1,0,-1], extra_size=[0,0,ymotor_mount_thickness_h], extra_align=Z);\n\n \/\/ side triangles\n for(i=[-1,1])\n {\n translate([ymotor_mount_thickness, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n triangle(\n ymotor_w+ymotor_mount_thickness\/2,\n main_lower_dist_z+extrusion_size+yaxis_motor_offset_z,\n depth=ymotor_mount_thickness,\n align=[1,0,-1],\n orient=X\n );\n\n translate([0, i*((ymotor_w\/2)+ymotor_mount_thickness\/2), extrusion_size\/2])\n rcubea([ymotor_mount_thickness, ymotor_mount_thickness, ymotor_mount_h], align=[1,0,-1]);\n }\n }\n\n \/\/ top mount plate\n rcubea([ymotor_mount_thickness, ymotor_mount_width, extrusion_size], align=X);\n\n \/\/ bottom mount plate\n tz(-main_lower_dist_z)\n rcubea([ymotor_mount_thickness, ymotor_w+ymotor_mount_thickness*2, extrusion_size], align=X);\n\n }\n }\n else if(part==\"neg\")\n {\n \/\/ cutout for motor cables\n translate([0,0,-20*mm])\n cubea([ymotor_mount_thickness*3, 20*mm, ymotor_h], align=[0,0,-1]);\n\n \/\/ top mount plate screws\n tx(ymotor_mount_thickness)\n for(y=[-1,1])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n\n \/\/ bottom mount plate screw\n tx(ymotor_mount_thickness)\n tz(-main_lower_dist_z)\n for(y=[0])\n ty(y*(ymotor_w\/2+ymotor_mount_thread_dia*3))\n screw_cut(nut=extrusion_nut, head=\"button\", h=ymotor_mount_thickness*3, align=-X, orient=-X);\n }\n else if(part==\"vit\")\n {\n attach(yaxis_motor_mount_conn_motor,[N,N])\n {\n motor(yaxis_motor, NemaMedium, dualAxis=false, orientation=[0,180,0]);\n\n tz(7*mm)\n rotate(180*X)\n %pulley(pulley_2GT_20T);\n }\n }\n}\n\nmodule part_y_motor_mount()\n{\n attach(yaxis_motor_mount_conn_motor,[N,X])\n {\n yaxis_motor_mount();\n }\n}\n\n\/*yaxis_motor_mount_bearing_clamp();*\/\n\/*yaxis_motor_mount();*\/\n","returncode":0,"stderr":"","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"2b3c1295dcdc88e7655d7ccff7f4710509a78299","subject":"more spacing for proper surroundings","message":"more spacing for proper surroundings\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_file":"threaded_inserts_tester\/threaded_inserts_tester.scad","new_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module pair(d, h)\n {\n translate([0, 0, 11-h+eps])\n {\n cylinder(d=d, h=h);\n translate([0, 9, 0])\n cylinder(d=d, h=h+10);\n }\n translate([5+0.8*d, 0, 0])\n children();\n }\n\n difference()\n {\n cube([38, 20, 11]);\n translate([5, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","old_contents":"$fn = 100;\neps = 0.01;\n\nmodule tester()\n{\n module pair(d, h)\n {\n translate([0, 0, 11-h+eps])\n {\n cylinder(d=d, h=h);\n translate([0, 9, 0])\n cylinder(d=d, h=h+10);\n }\n translate([5+0.6*d, 0, 0])\n children();\n }\n\n difference()\n {\n cube([35, 20, 11]);\n translate([5, 5, 0])\n {\n pair(d=6.4, h=10.5) \/\/ M5x9.5\n pair(d=6.4, h=6.8) \/\/ M5x5.8\n pair(d=4.0, h=6.7) \/\/ M3x5.7\n pair(d=4.0, h=4.0) \/\/ M3x3.0\n ;\n }\n }\n}\n\ntester();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"733505b7b6a324e65fc8ffbd328b7e0c63422fd9","subject":"First non-WIP version of spacer2","message":"First non-WIP version of spacer2\n","repos":"thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things,thatch\/tim-open-things","old_file":"wanhao-i3-fan-spacer\/spacer2.scad","new_file":"wanhao-i3-fan-spacer\/spacer2.scad","new_contents":"\/* This is a bit of a hack since angled holes are required. *\/\ngSpacerThick = 9;\ngSpacerPlusHeatsinkThick = 11;\n\/\/ Use the real-world measurement here, e.g. 10.8mm for the stock fan.\ngFanThick = 10.8;\ngMotorHoleSpacing = 31;\ngFanHoleSpacing = 32;\ngGrillThick = 3;\ngBottomFilletRad = 5;\n\/\/ Only set to true if you have a counterbore on the non-label side.\ngAlignmentHoles = false;\ngAlignmentHoleDepth = 3.5;\ngAlignmentShape = false;\n\n\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=gSpacerThick) {\n linear_extrude(height=thick)\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) circle(r=r);\n}\n\n\n\/* For reuse building the two parts to line up *\/\nmodule LowerHull(w,r,thick,d=0) {\n linear_extrude(height=thick) hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) circle(r=r);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) circle(r=r);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n translate([0,0,-1]) linear_extrude(height=thick+2)\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y]) circle(r=r);\n }\n \/\/ this is rotated, and mostly for looks but also assembly affordance\n translate([-50,-8+gBottomFilletRad-0.01,thick-gBottomFilletRad+0.01]) rotate([180,-90,0])\n linear_extrude(height=100,convexity=2) difference() {\n square([gBottomFilletRad,gBottomFilletRad]);\n circle(r=gBottomFilletRad);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.7,h=100);\n }\n if(gAlignmentShape)\n translate([0,-4.5,-1]) linear_extrude(height=2.5) offset(delta=0.1) AlignmentShape();\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=gGrillThick) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\nmodule AlignmentShape() {\n hull() for(x=[6,-6]) translate([x,0])\n circle(d=2,$fn=32);\n}\n\ngOffset = 0.5;\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n if(gAlignmentHoles) translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01])\n ChamferCylinder(5.6\/2,thick+gAlignmentHoleDepth,0.6);\n }\n translate([0,gOffset,0]) FanGrill(r=16,height=thick-1);\n }\n \/\/ Top part\n difference() {\n union() {\n translate([0,-20,0]) LowerHull(w,2,thick+gFanThick,4);\n if(gAlignmentShape)\n translate([0,-20-4.5,1]) linear_extrude(height=thick+gFanThick) AlignmentShape();\n }\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\n\/\/translate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\ntranslate([0,-40,0]) translate([0,20,-12])\ndifference() {\n union() {\n translate([0,-20,12]) SpacerPair();\n \/\/FanMount($fn=64);\n }\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\ndifference() {\n FanMount($fn=64);\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","old_contents":"\/* This is a bit of a hack since angled holes are required. *\/\ngSpacerThick = 9;\ngSpacerPlusHeatsinkThick = 11;\ngFanThick = 10; \/\/ hole right in the middle?\ngMotorHoleSpacing = 31;\ngFanHoleSpacing = 32;\ngGrillThick = 3;\ngBottomFilletRad = 5;\n\n\/* Orientation is that \"up\" faces into the heatsink. *\/\nmodule Spacer(w=40,r=2,thick=gSpacerThick) {\n linear_extrude(height=thick)\n hull()\n for(x=[w\/2-r,w\/2-8+r])\n for(y=[r,9-r])\n translate([x,y]) circle(r=r);\n}\n\nmodule SpacerHole(thick=gSpacerThick) {\n \/\/ TODO\n \/\/translate([16,4.5,-1]) cylinder(d=3.4,h=thick+2);\n}\n\n\/* For reuse building the two parts to line up *\/\nmodule LowerHull(w,r,thick,d=0) {\n linear_extrude(height=thick) hull() {\n for(x=[w\/2-r-d,-(w\/2-r-d)])\n translate([x,r-d]) circle(r=r);\n for(x=[w\/2-8-r,-(w\/2-8-r)])\n translate([x,-8+r]) circle(r=r);\n }\n}\n\nmodule SpacerMount(w=40,r=2,thick=9) {\n difference() {\n LowerHull(w,2,thick);\n translate([0,0,-1]) linear_extrude(height=thick+2)\n hull() {\n for(x=[w\/2-7-r,-(w\/2-7-r)])\n for(y=[r+0.01,r*2])\n translate([x,y]) circle(r=r);\n }\n \/\/ this is rotated, and mostly for looks but also assembly affordance\n translate([-50,-8+gBottomFilletRad-0.01,thick-gBottomFilletRad+0.01]) rotate([180,-90,0])\n linear_extrude(height=100,convexity=2) difference() {\n square([gBottomFilletRad,gBottomFilletRad]);\n circle(r=gBottomFilletRad);\n }\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-4.5,-1]) union() {\n cylinder(d=3.4,h=100);\n translate([0,0,thick-3]) cylinder(d=5.7,h=100);\n }\n translate([0,-4.5,-1]) linear_extrude(height=2.5) offset(delta=0.1) AlignmentShape();\n }\n}\n\nmodule SpacerPair() {\n difference() {\n union() {\n Spacer($fn=32);\n scale([-1,1,1]) Spacer($fn=32);\n translate([-38\/2,1.32,0]) cube([38,1.7,8]);\n SpacerMount($fn=32);\n }\n SpacerHole($fn=32);\n scale([-1,1,1]) SpacerHole($fn=32);\n }\n}\n\nmodule ThinCylinder(r,h,t) {\n difference() {\n cylinder(r=r,h=h);\n translate([0,0,-1]) cylinder(r=r-t,h=h+2);\n }\n}\n\nmodule FanGrill(r,spacing1=1.6,spacing2=8,height=gGrillThick) {\n translate([0,0,-0.01]) difference() {\n cylinder(r=r,h=100);\n rotate([0,0,45]) cube([spacing1,100,height*2],center=true);\n rotate([0,0,-45]) cube([spacing1,100,height*2],center=true);\n for(x=[2.5:spacing2:r]) {\n ThinCylinder(x,height,spacing1);\n }\n }\n}\n\nmodule ChamferCylinder(r,h,c=2) {\n cylinder(r=r,h=h-c);\n translate([0,0,h-c]) cylinder(r1=r,r2=r-c,h=c);\n}\n\nmodule AlignmentShape() {\n hull() for(x=[6,-6]) translate([x,0])\n circle(d=2,$fn=32);\n}\n\ngOffset = 0.5;\nmodule FanMount(w=40,r=4,thick=3) {\n \/\/ Bottom flat part\n difference() {\n union() {\n hull() {\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([w\/2-r,w\/2-r])\n cylinder(r=r,h=thick);\n translate([0,-20,0]) LowerHull(w,2,thick);\n }\n translate([0,gOffset,0]) for(x_scale=[1,-1])\n for(y_scale=[1,-1])\n scale([x_scale,y_scale,1])\n translate([16,16,0.01])\n ChamferCylinder(5.6\/2,thick+3.5,0.6);\n }\n translate([0,gOffset,0]) FanGrill(r=16,height=thick-1);\n \/\/ TOOD angle this\n \/*for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([16,-16,-0.01]) cylinder(d=3.4,h=100);\n *\/\n }\n \/\/ Top part\n difference() {\n union() {\n translate([0,-20,0]) LowerHull(w,2,thick+11,4);\n translate([0,-20-4.5,1]) linear_extrude(height=thick+11) AlignmentShape();\n }\n \/\/cube([40,40,40],center=true);\n for(x_scale=[1,-1])\n scale([x_scale,1,1])\n translate([6,-20-4.5,-1]) cylinder(d=2.9,h=100);\n }\n}\n\n\/* For printing *\/\n\/\/translate([0,-40,0]) SpacerPair();\n\/* Assembly *\/\n\ntranslate([0,-40,0]) translate([0,20,-12])\ndifference() {\n union() {\n translate([0,-20,12]) SpacerPair();\n \/\/FanMount($fn=64);\n }\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\ndifference() {\n FanMount($fn=64);\n for(x_scale=[1,-1]) scale([x_scale,1,1])\n translate([-31\/2,-31\/2,gSpacerPlusHeatsinkThick+gFanThick+2])\n rotate([0,atan2(0.5,32),0])\n cylinder(d=3.4,h=100,$fn=16,center=true);\n}\n\n\/*\nprojection(cut=false) rotate([0,90,0]) {\ntranslate([0,-20,12]) SpacerPair();\nFanMount($fn=64);\n}\n*\/\n","returncode":0,"stderr":"","license":"bsd-2-clause","lang":"OpenSCAD"} {"commit":"bcb3053d93aff742459d3023a553609ad5cb9178","subject":"refactor","message":"refactor\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n\n halfCirclePhoneStand_cradle_cutout(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30; \/\/ 29.9\n yTranslate = 32.7; \/\/ 32.6\n zTranslate = minkowskiSphereRadius + 0; \/\/ 0.13;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \/\/ 212\n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n zLength = 5;\n\n zTranslate = minkowskiSphereRadius + (height \/ 2.0) - (zLength \/ 2.0);\n\n\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius)\n{\n xTranslate = 30; \/\/ 29.9\n yTranslate = 32.7; \/\/ 32.6\n zTranslate = minkowskiSphereRadius + 0; \/\/ 0.13;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \/\/ 212\n roundedRectangularArc(angle = 150,\n\n\/\/TODO: fix\/remove the height adjustment\nheight = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = 36, \/\/ 36\n radiusExtension = 1.5); \/\/ 1.3\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\n\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"bd3e5f16ccd7e2e7a78a97e721b3a9076d6adc2e","subject":"Add constant NAN","message":"Add constant NAN\n","repos":"jsconan\/camelSCAD","old_file":"core\/constants.scad","new_file":"core\/constants.scad","new_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017-2019 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = RIGHT;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = STRAIGHT;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = DEGREES - RIGHT;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = DEGREES;\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * The distance tolerance that will apply to $fs to check if we still need to subdivide the curve.\n * @type Number\n *\/\nBEZIER_TOLERANCE = .25;\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * The maximum recursion depth\n * @type Number\n *\/\nMAX_RECURSE = 32;\n\n\/**\n * A value representing the Infinity.\n * @type Number\n *\/\nINFINITY = 1e200 * 1e200;\n\n\/**\n * Not A Number.\n * @type Number\n *\/\nNAN = 0\/0;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","old_contents":"\/**\n * @license\n * MIT License\n *\n * Copyright (c) 2017 Jean-Sebastien CONAN\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\/\n\n\/**\n * Part of the camelSCAD library.\n *\n * Global constants to include.\n *\n * @package core\/constants\n * @author jsconan\n *\/\n\n\/**\n * The name of the development rendering mode.\n * @type String\n *\/\nMODE_DEV = \"dev\";\n\n\/**\n * The name of the production rendering mode.\n * @type String\n *\/\nMODE_PROD = \"prod\";\n\n\/**\n * The name of the dirty rendering mode.\n * @type String\n *\/\nMODE_DIRTY = \"dirty\";\n\n\/**\n * The name of the default rendering mode.\n * @type String\n *\/\nDEFAULT_MODE = MODE_DEV;\n\n\/**\n * Degrees in a circle.\n * @type Number\n *\/\nDEGREES = 360;\n\n\/**\n * Degrees of a right angle.\n * @type Number\n *\/\nRIGHT = 90;\n\n\/**\n * Degrees of a straight angle.\n * @type Number\n *\/\nSTRAIGHT = 180;\n\n\/**\n * The end angle of the first quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_1 = RIGHT;\n\n\/**\n * The end angle of the second quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_2 = STRAIGHT;\n\n\/**\n * The end angle of the third quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_3 = DEGREES - RIGHT;\n\n\/**\n * The end angle of the fourth quadrant in a circle.\n * @type Number\n *\/\nQUADRANT_4 = DEGREES;\n\n\/**\n * Useful value for computations based on hexagons.\n * @type Number\n *\/\nSQRT3 = sqrt(3);\n\n\/**\n * The distance tolerance that will apply to $fs to check if we still need to subdivide the curve.\n * @type Number\n *\/\nBEZIER_TOLERANCE = .25;\n\n\/**\n * Minimum value for $fa and $fs.\n * @type Number\n *\/\nMIN_ANGLE = 0.01;\n\n\/**\n * Minimum allowed size.\n * @type Number\n *\/\nMIN_SIZE = 0.000001;\n\n\/**\n * A very very small value.\n * @type Number\n *\/\nEPSILON = 0.0000001;\n\n\/**\n * The maximum number of decimals\n * @type Number\n *\/\nMAX_DECIMALS = 7;\n\n\/**\n * The maximum recursion depth\n * @type Number\n *\/\nMAX_RECURSE = 32;\n\n\/**\n * A value representing the Infinity.\n * @type Number\n *\/\nINFINITY = 1e200 * 1e200;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on one side.\n * @type Number\n *\/\nALIGN = 0.005;\n\n\/**\n * A value utilized to align wall and ensure proper cuts on both sides.\n * @type Number\n *\/\nALIGN2 = 2 * ALIGN;\n\n\/**\n * The default size of the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_SIZE = 200;\n\n\/**\n * The default size of the build volume.\n * @type Number\n *\/\nDEFAULT_BUILD_VOLUME_SIZE = DEFAULT_BUILD_PLATE_SIZE;\n\n\/**\n * The default size of a cell on the build plate.\n * @type Number\n *\/\nDEFAULT_BUILD_PLATE_CELL = 10;\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"39c0d11b54dad70715dcdd5fde720f4036ccd61c","subject":"Major revision after first test","message":"Major revision after first test\n\n- Wider, center hole becomes a cutout, and coutouts on upper left and right.\n","repos":"GreenJellyBeans\/FTC12598,GreenJellyBeans\/FTC12598","old_file":"3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad","new_file":"3dprinting\/openscad\/vinyl-cutter\/vinyl-cutter.scad","new_contents":"\/\/ Frame to mount OLFA rotary cutter on a rail and weigh it down.\n\/\/ Consists of a back plate, a front plate. Additonally,\n\/\/ a weight holder (made of wood or polycarb) attaches to the \n\/\/ front plate.\n\/\/\n\/\/ History:\n\/\/ 2020 May 1: JMJ Created original design\n\/\/\nuse <..\/common\/extrusions.scad>\n$fn = 50;\nEPSILON = 0.01;\nLARGE = 100;\nMM = 25.4; \/\/ Inch to mm\nhole_dist = 3.75*MM;\nbase_w = 0.4*MM; \/\/ from hole to edge\nro = 0.5*MM;\nrod_dia = 5\/32*1.1 *MM; \/\/ To let #8 threaded rod fit easily\n\n\n\/\/ Back plate\nmodule back_plate() {\n extra_below = 0.5*MM; \/\/ lower part is 1\"\n t = 0.28*3; \/\/ 3 layers\n r = rod_dia\/2;\n hole_y = base_w + extra_below;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=r, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n }\n}\n\n\/\/ Front plate\nmodule front_plate() {\n extra_below = 0.25*MM; \/\/ lower part is 1\"\n big_r = 1.25*MM; \/\/ Arc above\n t = 0.28*3;\n arc_y_drop = 0.125*MM; \n rod_y = base_w + extra_below;\n hole_y = rod_y - arc_y_drop; \/\/ Center of arc - amount below centerline\n big_hole_dia = 1*MM;\n big_hole_h = 2*MM; \/\/ WAS 1.25\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n \/\/ wide plate\n \/\/oblong(wbase, hbase, ro, t);\n wpad = wbase\/6;\n oblong(wpad, hbase, ro, t);\n translate([wbase - wpad, 0, 0])\n oblong(wpad, hbase, ro, t);\n oblong(wbase, hbase*0.7, ro, t);\n \n \/\/ Semi circle - upper half\n translate([base_w + hole_dist\/2, hole_y, 0]) {\n difference() {\n cylinder(r=big_r, h = t);\n translate([-big_r, -2*big_r, -EPSILON])\n cube([2*big_r, 2*big_r, 2*t]);\n }\n }\n }\n translate([base_w, rod_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t); \/\/ left rod hole\n translate([base_w + hole_dist, rod_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t); \/\/ right rod hole\n bdd = big_hole_dia;\n translate([base_w + hole_dist\/2 -bdd\/2, hole_y - big_hole_h + bdd\/2, -EPSILON])\n oblong(bdd, big_hole_h, bdd, 2*t); \/\/ center gap\n\n }\n}\n\n\nback_plate();\ntranslate([0, 5*base_w, 0])\n front_plate();","old_contents":"\/\/ Frame to mount OLFA rotary cutter on a rail and weigh it down.\n\/\/ Consists of a back plate, a front plate. Additonally,\n\/\/ a weight holder (made of wood or polycarb) attaches to the \n\/\/ front plate.\n\/\/\n\/\/ History:\n\/\/ 2020 May 1: JMJ Created original design\n\/\/\nuse <..\/common\/extrusions.scad>\n$fn = 50;\nEPSILON = 0.01;\nLARGE = 100;\nMM = 25.4; \/\/ Inch to mm\nhole_dist = 3.5*MM;\nbase_w = 0.4*MM; \/\/ from hole to edge\nro = 0.5*MM;\nrod_dia = 3\/16*1.2*MM; \/\/ To let #10 threaded rod fit easily\n\n\n\/\/ Back plate\nmodule back_plate() {\n extra_below = 0.5*MM; \/\/ lower part is 1\"\n t = 0.5;\n r = rod_dia\/2;\n hole_y = base_w + extra_below;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=r, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n }\n}\n\n\/\/ Front plate\nmodule front_plate() {\n extra_below = 0.25*MM; \/\/ lower part is 1\"\n big_r = 1.25*MM; \/\/ Arc above\n t = 0.5;\n hole_y = base_w + extra_below;\n big_hole_dia = 1*MM;\n big_hole_h = 1.25*MM;\n difference() {\n union() {\n\n wbase = 2*base_w + hole_dist;\n hbase = 2*base_w + extra_below;\n oblong(wbase, hbase, ro, t);\n translate([base_w + hole_dist\/2, hole_y, 0]) {\n difference() {\n cylinder(r=big_r, h = t);\n translate([-big_r, -2*big_r, -EPSILON])\n cube([2*big_r, 2*big_r, 2*t]);\n }\n }\n }\n translate([base_w, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n translate([base_w + hole_dist, hole_y, -EPSILON]) \n cylinder(r=rod_dia\/2, h=2*t);\n bdd = big_hole_dia;\n translate([base_w + hole_dist\/2 -bdd\/2, hole_y - bdd \/2, -EPSILON])\n oblong(bdd, bdd, bdd\/2, 2*t);\n\n }\n}\n\n\nback_plate();\ntranslate([0, 5*base_w, 0])\n front_plate();","returncode":0,"stderr":"","license":"unlicense","lang":"OpenSCAD"} {"commit":"ee842224b8542a1b9e1f6734f19095fd4883504d","subject":"Micrscope attachment adapter for the RoxtockMaxV2","message":"Micrscope attachment adapter for the RoxtockMaxV2\n\n3D print this and attach to the RostockMaxV2 effector platform instead\nof the extruder. Then attach the DynoLite to it.\n","repos":"rinworks\/rig","old_file":"hw\/models\/rostockMaxAdapter\/RostockCenter_v1.scad","new_file":"hw\/models\/rostockMaxAdapter\/RostockCenter_v1.scad","new_contents":"\n\n\/\/ A washer with base on x-y plane and axis == z-axis\nmodule washer(id, od, h) {\n}\n\n\/\/ Creates several cylinders along a circle with diameter cd.\n\/\/ One application: subtract these from a circular gasket.\n\/\/ The cylinders have diameter pd and height h. The circle is on the x-y\n\/\/ plane and it's center the origin. The *base* of the punches is on \n\/\/ the x-y plane. The cylinders are positioned at the specified vector\n\/\/ of angles.\nmodule radialCylinders(cd, pd, h, angles) {\n}\n\n\/\/ Creates a segment of a pipe. The center of the segment is the z-axis.\n\/\/ The base of the segment is the x-y plane. The base inner\/outer dia are\n\/\/ id1\/id2 and the top inner\/outer dia are id2\/od2. The height of the\n\/\/ segment is h.\nmodule pipeSegment(id1, od1, id2, od2, h) {\n}","old_contents":"","returncode":1,"stderr":"error: pathspec 'hw\/models\/rostockMaxAdapter\/RostockCenter_v1.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"7b5afd597d5310d77b548e59b57f35de97880852","subject":"improved projector","message":"improved projector\n","repos":"fponticelli\/smallbridges","old_file":"resin\/projector.scad","new_file":"resin\/projector.scad","new_contents":"module projector(width, depth, height, Acer_support_height, lensDiameter, lensX, lensY) {\n color(\"White\")\n difference() {\n translate([0, 0, Acer_support_height])\n cube([width, depth, height]);\n rotate([90,0,0])\n translate([lensX, lensY, -depth-2])\n cylinder(20, lensDiameter, lensDiameter \/ 3 * 2);\n }\n}\n\nmodule pyramid(w, l, h) {\n mw = w\/2;\n ml = l\/2;\n polyhedron(points = [\n [0, 0, 0],\n [w, 0, 0],\n [0, l, 0],\n [w, l, 0],\n [mw, ml, h]\n ], faces = [\n [4, 1, 0],\n [4, 3, 1],\n [4, 2, 3],\n [4, 0, 2],\n \/\/base\n [0, 1, 2],\n [2, 1, 3]\n ]);\n}\n\nmodule projection(center, distToWidth, widthToHeight, dist) {\n w = distToWidth * dist;\n h = widthToHeight * w;\n rotate([0,90,-90])\n translate([-w\/2,-h\/2,-dist])\n translate(center)\n pyramid(w, h, dist);\n}\n\nAcer_support_height = 8; \/\/ ~\n\nAcer_size_width = 264;\nAcer_size_depth = 220;\nAcer_size_height = 78;\n\nAcer_lens_diameter = 30; \/\/ ~\nAcer_lens_x = 55; \/\/ ~\nAcer_lens_y = Acer_support_height + Acer_size_height \/ 2; \/\/ ~\n\nacer_projector_distances = [112, 225, 337];\n\nmodule Acer_H6510BD(showProjection=true) {\n projector(Acer_size_width, Acer_size_depth, Acer_size_height, Acer_support_height, Acer_lens_diameter, Acer_lens_x, Acer_lens_y);\n if(showProjection) {\n distToWidth = 192\/225;\n widthToHeight = 16\/9;\n color([0.75,1,1,0.1]) {\n for(dist = acer_projector_distances)\n projection([-Acer_lens_y,Acer_lens_x,-Acer_size_depth], distToWidth, widthToHeight, dist);\n }\n\n }\n}\n\nmodule center_projector(pos) {\n if(pos == 1) { \/\/ on lens\n translate([-Acer_lens_x,-Acer_size_depth,-Acer_lens_y])\n children();\n } else {\n translate([-Acer_lens_x,-Acer_size_depth,0])\n children();\n }\n}\n\n\/\/Acer_H6510BD();\n","old_contents":"module projector(width, depth, height, Acer_support_height, lensDiameter, lensX, lensY) {\n color(\"White\")\n difference() {\n translate([0, 0, Acer_support_height])\n cube([width, depth, height]);\n rotate([90,0,0])\n translate([lensX, lensY, -depth-2])\n cylinder(20, lensDiameter, lensDiameter \/ 3 * 2);\n }\n}\n\nmodule pyramid(w, l, h) {\n mw = w\/2;\n ml = l\/2;\n polyhedron(points = [\n [0, 0, 0],\n [w, 0, 0],\n [0, l, 0],\n [w, l, 0],\n [mw, ml, h]\n ], faces = [\n [4, 1, 0],\n [4, 3, 1],\n [4, 2, 3],\n [4, 0, 2],\n \/\/base\n [0, 1, 2],\n [2, 1, 3]\n ]);\n}\n\nmodule projection(center, distToWidth, widthToHeight, dist) {\n w = distToWidth * dist;\n h = widthToHeight * w;\n rotate([0,90,-90])\n translate([-w\/2,-h\/2,-dist])\n translate(center)\n pyramid(w, h, dist);\n}\n\nAcer_support_height = 8; \/\/ ~\n\nAcer_size_width = 264;\nAcer_size_depth = 220;\nAcer_size_height = 78;\n\nAcer_lens_diameter = 30; \/\/ ~\nAcer_lens_x = 55; \/\/ ~\nAcer_lens_y = Acer_support_height + Acer_size_height \/ 2; \/\/ ~\n\nmodule Acer_H6510BD(showProjection=true) {\n projector(Acer_size_width, Acer_size_depth, Acer_size_height, Acer_support_height, Acer_lens_diameter, Acer_lens_x, Acer_lens_y);\n if(showProjection) {\n distToWidth = 192\/225;\n widthToHeight = 16\/9;\n color([0.75,1,1,0.1]) {\n for(dist = [112, 225, 337])\n projection([-Acer_lens_y,Acer_lens_x,-Acer_size_depth], distToWidth, widthToHeight, dist);\n }\n\n }\n}\n\nmodule center_projector(pos) {\n if(pos == 1) { \/\/ on lens\n translate([-Acer_lens_x,-Acer_size_depth,-Acer_lens_y])\n children();\n } else {\n translate([-Acer_lens_x,-Acer_size_depth,0])\n children();\n }\n}\n\nAcer_H6510BD();\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"30f95e139ebffb83f1317e53c24318c9efd483b3","subject":"updated structure","message":"updated structure\n","repos":"fponticelli\/smallbridges","old_file":"resin\/structure.scad","new_file":"resin\/structure.scad","new_contents":"use ;\nuse ;\nuse ;\ninclude ;\nuse <..\/scad\/ob_wheel.scad>\nuse <..\/scad\/ob_spacer.scad>\ninclude \n\n$fn = 12;\n$detailed = false;\n\noffset_depth = 50;\n\nprojector_movement = 0;\n\n\/\/ projector\ntranslate([0, 0, -offset_depth]) {\n translate([0, projector_movement, 0]) {\n center_projector() {\n Acer_Plate(160, 120, 85, 100);\n Acer_H6510BD(true);\n }\n }\n}\nwidth = 480;\nheight = 500;\nbeam_width = width - 2 * gantry_cart_wheel_mid;\n\ncarriage_tower_sections = 2;\n\ntranslate([0, projector_movement, -offset_depth]) {\n translate([-beam_width\/2,-60,-10])\n rotate([90,90,90])\n profile_20x60(beam_width);\n translate([beam_width\/2,-60,-10])\n rotate([90,0,90])\n gantry_cart_big(carriage_tower_sections);\n translate([-beam_width\/2,-60,-10])\n rotate([-90,0,90])\n gantry_cart_big(carriage_tower_sections);\n}\n\ntranslate([0, 0, -offset_depth]) {\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile(carriage_tower_sections, height);\n}\n\n\/\/ base\nbase_depth = 400;\nmodule base(width, depth, sections = 2) {\n profile_height = sections * 20;\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n}\n\n\nbottom_sections = 4;\ntranslate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\nmiddle_sections = 2;\ntranslate([0,(height+middle_sections*20)\/2,0])\n base(width, base_depth, middle_sections);\n\n\n\/\/ support towers\ntower_pos = base_depth \/ 2 - 20;\ntranslate([-width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile_20x40(height);\ntranslate([width\/2,-height\/2,tower_pos])\n rotate([-90,0,0])\n profile_20x40(height);","old_contents":"use ;\nuse ;\ninclude ;\n\n$detailed = false;\n\noffset_depth = 50;\n\ntranslate([0, 0, -offset_depth])\n center_projector() {\n Acer_Plate(200, 120, 60, 100);\n Acer_H6510BD(true);\n }\n\nwidth = 480;\noffset = 5;\nheight = 500;\nbeam_width = width - 2 * (20 + offset);\n\ntranslate([0, 0, -offset_depth]) {\n translate([-beam_width\/2,-60,-10])\n rotate([90,90,90])\n profile_20x60(beam_width);\n\n translate([-width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile_20x40(height);\n translate([width\/2,-height\/2,-10])\n rotate([-90,0,0])\n profile_20x40(height);\n}\n\n\/\/ base\nbase_depth = 400;\nmodule base(width, depth, sections = 2) {\n profile_height = sections * 20;\n translate([-width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n translate([width\/2,0,-base_depth\/2])\n rotate([0,0,0])\n profile(sections, base_depth);\n\n lateral_beam_width = width - 20;\n translate([-lateral_beam_width\/2,0,-base_depth\/2+10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n\n translate([-lateral_beam_width\/2,0,base_depth\/2-10])\n rotate([0,90,0])\n profile(sections, lateral_beam_width);\n}\n\nbottom_sections = 4;\ntranslate([0,-(height+bottom_sections*20)\/2,0])\n base(width, base_depth, bottom_sections);\n\nmiddle_sections = 2;\ntranslate([0,(height+middle_sections*20)\/2,0])\n base(width, base_depth, middle_sections);\n\n\n\/\/ support towers\ntower_pos = base_depth \/ 2 - 20;\ntranslate([-width\/2,-height\/2,-tower_pos])\n rotate([-90,0,0])\n profile_20x40(height);\ntranslate([width\/2,-height\/2,-tower_pos])\n rotate([-90,0,0])\n profile_20x40(height);\n\n\/*\nlen = 270;\ntranslate([-20,60,-len])\n profile_20x20(len);\ntranslate([-20,140,-len])\n profile_20x20(len);\n\ntranslate([50, 0, 0])\n profile_20x40(100);\n\ntranslate([100, 0, 0])\n profile_20x60(100);\n\ntranslate([150, 0, 0])\n profile_20x80(100);\n*\/","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"3d02a8f86b3611667e62b216d0bbb8b738e8cf34","subject":"Unused code was commented, temporarily.","message":"Unused code was commented, temporarily.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/name-tags\/name-tag.scad","new_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\n\r\n\/* [General] *\/\r\n\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\nrightIconType = \"\"; \/\/ [Light Bulb, Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Top Text] *\/\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\n\/\/bottomText = \"\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\n\/\/bottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\/\/font=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\n\/\/namematrix = \r\n\/\/[\r\n\/\/\t[ topTextYOffset, \"this value is no longer used\", topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\/\/\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n\/\/];\r\n\r\nfudge = 0.1;\r\n\/\/\r\n\/\/nametag(font=\"write\/orbitron.dxf\");\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\", \r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n\/\/echo(\"rc:1 \");\r\n\/\/echo(roundedCorners);\r\n\r\n nametag_assembly(font=font, \r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(font, \r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\necho(\"rc:2 \");\r\necho(baseWidth);\r\n\r\n \/\/ top text\r\n color(topTextColor)\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseWidth,\/\/ = baseWidth,\r\n baseHeight,\/\/ = baseHeight,\r\n borderradius,\/\/ = borderradius,\r\n borderdistance,\/\/ = borderdistance,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n\/\/echo(\"rc:3 \");\r\n\/\/echo(roundedCorners);\r\n base2holes(baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n\/\/echo(\"rc:4 \");\r\n\/\/echo(roundedCorners);\r\n if (holes==4) \r\n {\r\n\/\/echo(\"rc:5 \");\r\n\/\/echo(roundedCorners);\r\n base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n\/\/echo(\"rc:6 \");\r\n\/\/echo(roundedCorners); \r\n nametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n\/\/ translate([0,0,0])\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\n\/\/ TODO: Migrate this to use the built-in OpenSCAD text() module.\r\n\/\/module writing(font, topText)\r\n\/\/{\r\n\/\/ translate([0,namematrix[0][0],baseThickness+letterThickness\/2])\r\n\/\/ write(topText,\r\n\/\/ t = letterThickness,\r\n\/\/ h = namematrix[0][2],\r\n\/\/ center = true,\r\n\/\/ font = font,\r\n\/\/ space = namematrix[0][3]);\r\n\/\/ \r\n\/\/ \/\/ this writes the second element (sub-element 1 and on) and on, max 100 names\r\n\/\/ for ( i = [1 : 99] )\r\n\/\/ {\t\t\t\t\r\n\/\/ if (namematrix[i][0]==undef)\r\n\/\/ {\r\n\/\/ ;\t\/\/ then do nothing\r\n\/\/ }\r\n\/\/ else \r\n\/\/ {\t\t \r\n\/\/ translate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n\/\/ write(namematrix[i][1],\r\n\/\/ t = letterThickness,\r\n\/\/ h = namematrix[i][2],\r\n\/\/ center = true,\r\n\/\/ font = font,\r\n\/\/ space = namematrix[i][3]);\r\n\/\/ }\r\n\/\/ }\r\n\/\/}\r\n\r\nmodule base2holes(baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\t}\r\n}\r\n\r\nmodule icons(leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\/\/ yTranslate = -baseHeight - 6; \r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\/\/ echo(\"rc:7 \");\r\n\/\/ echo(baseWidth);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n\/\/ echo(\"rc:8 \");\r\n\/\/ echo(baseWidth);\r\n\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","old_contents":"\r\nuse \r\n\r\nuse <..\/basics\/rounded-edges\/rounded-cube.scad>\r\nuse <..\/basics\/text\/text-extrude\/text-extrude.scad>\r\nuse <..\/shapes\/chain-loop\/chain-loop.scad>\r\nuse <..\/shapes\/fan\/iso-7000-fan.scad>\r\nuse <..\/shapes\/light-bulb\/light-bulb.scad>\r\n\r\n\/* [General] *\/\r\n\r\nletterThickness = 3; \/\/ [1 : 15]\r\n\r\n\/* [Icons] *\/\r\nrightIconType = \"\"; \/\/ [Light Bulb, Rebel, Trooper, Aqua Dude, Cat, Spur, Mario, Luigi, Thundercat, Bass Clef, Treble Clef]\r\niconColor = \"white\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Top Text] *\/\r\ntopTextYOffset = 0;\/\/7; \/\/ [0 : 30]\r\ntopLetterSize = 9.6;\/\/19; \/\/ [2 : 25]\r\ntopLetterSpacing = 1.05;\/\/1.5; \/\/ [1 : 10]\r\n\r\n\/* [Bottom Text] *\/\r\n\/\/bottomText = \"\";\r\nbottomLetterSize = 8.8; \/\/ [2 : 25]\r\nbottomLetterSpacing = 1.2; \/\/ [1 : 10]\r\n\/\/bottomTextYOffset = -12; \/\/ [-20 : 30]\r\n\r\n\/* [Border] *\/\r\nborderColor = \"yellow\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\n\/* [Base] *\/\r\n\/\/ This determines how wide the name tag is.\r\n\/\/baseWidth = 46;\/\/228;\t\/\/ [228:600]\t\r\n\r\n\/\/ This determines the hieght of the nametag.\r\nbaseHeight = 15;\/\/54;\t\/\/ [54:150]\r\n\r\n\/\/ This parameter is all about that base color.\r\nbaseColor = \"black\"; \/\/ [pink, red, black, white, yellow, blue, green]\r\n\r\nbaseThickness=2; \/\/ [1 : 5] \r\n\r\n\/* [Hidden] *\/\r\n\r\nresolution=50; \t\/\/ Use 20 for draft 100 for nice\r\n\r\nborderWidth = 2;\/\/5;\r\n\r\nholediameter=3;\r\ncountersink=2;\r\nholes = 0;\/\/0;\/\/2;\/\/4; \t\t\t\/\/ Choose 0,2 or 4 (others=0)\r\n\r\n\/\/font=\"write\/orbitron.dxf\"; \t\t\/\/ BlackRose.dxf, orbitron.dxf, Letters.dxf\r\n\r\n\/\/ This row in this matrix holds the Y-offset (from center), top-text, font size (I think), and space-between-letters.\r\n\/\/ Add as many rows as you like.\r\n\/\/namematrix = \r\n\/\/[\r\n\/\/\t[ topTextYOffset, \"this value is no longer used\", topLetterSize, topLetterSpacing],\t \/\/[Y-placement, \"Name\"], note: Y-placement of center of text\r\n\/\/\t[bottomTextYOffset, bottomText, bottomLetterSize, bottomLetterSpacing]\t \/\/[Y-placement, \"Name\"] note: Y-placement of center of text \t\r\n\/\/];\r\n\r\nfudge = 0.1;\r\n\/\/\r\n\/\/nametag(font=\"write\/orbitron.dxf\");\r\n\r\n\/\/ ************* Nametag Modules *************\r\n\r\nmodule nametag(font=\"write\/orbitron.dxf\", \r\n topText=\"Love is the Answer\",\r\n topTextColor = \"white\",\r\n topTextSize = 5,\r\n topTextOffsetY = 0,\r\n bottomText = \"Love Lots\",\r\n bottomTextOffsetX = 0,\r\n bottomTextOffsetY = 0,\r\n bottomTextSize = 9,\r\n leftIconType = \"Light Bulb\",\r\n leftIconHeight = 1.5,\r\n rightIconType = \"Light Bulb\",\r\n rightIconHeight = 1.5,\r\n rightIconOffsetY = 0,\r\n leftIconXyScale = 1.0,\r\n rightIconXyScale = 1.7,\r\n xIconOffset = 87,\r\n yIconOffset = 87,\r\n baseWidth = 200,\r\n baseHeight = 54,\r\n roundedCorners = true,\r\n chainLoop = true,\r\n chainLoopPosition = \"bottom\",\r\n showBorder = \"No\")\r\n{\r\n union()\r\n {\r\n\/\/echo(\"rc:1 \");\r\n\/\/echo(roundedCorners);\r\n\r\n nametag_assembly(font=font, \r\n topText=topText,\r\n topTextColor = topTextColor,\r\n textSize = topTextSize,\r\n topTextOffsetY = topTextOffsetY,\r\n bottomText = bottomText,\r\n bottomTextOffsetX = bottomTextOffsetX,\r\n bottomTextOffsetY = bottomTextOffsetY,\r\n bottomTextSize = bottomTextSize,\r\n baseWidth = baseWidth,\r\n baseHeight = baseHeight,\r\n roundedCorners = roundedCorners,\r\n chainLoop=chainLoop,\r\n chainLoopPosition = chainLoopPosition,\r\n showBorder = showBorder,\r\n borderradius = 8, \r\n borderdistance = 5);\r\n\r\n icons(leftIconType = leftIconType,\r\n leftIconXyScale = leftIconXyScale,\r\n leftIconHeight = leftIconHeight, \r\n rightIconType = rightIconType,\r\n rightIconHeight = rightIconHeight,\r\n rightIconXyScale = rightIconXyScale,\r\n xOffset = xIconOffset, \r\n yOffset = yIconOffset,\r\n yRightOffset = rightIconOffsetY);\r\n } \r\n}\r\n\r\nmodule nametag_assembly(font, \r\n topText,\r\n topTextColor,\r\n textSize,\r\n topTextOffsetY,\r\n bottomText,\r\n bottomTextOffsetX,\r\n bottomTextOffsetY,\r\n bottomTextSize,\r\n baseWidth, \r\n baseHeight,\r\n roundedCorners,\r\n chainLoop, \r\n chainLoopPosition,\r\n showBorder, \r\n borderradius, \r\n borderdistance) \r\n{\r\necho(\"rc:2 \");\r\necho(baseWidth);\r\n\r\n \/\/ top text\r\n color(topTextColor) \r\n\/\/ writing(font=font, topText=topText);\r\n translate([0, topTextOffsetY, 0])\r\n textExtrude(text=topText, \r\n textSize = textSize, \r\n font = font, \r\n height = 5);\r\n\r\n \/\/ bottom text\r\n translate([bottomTextOffsetX, bottomTextOffsetY,0])\r\n textExtrude(text = bottomText,\r\n textSize=bottomTextSize,\r\n font = font, \r\n height = 5);\r\n\r\n if(showBorder == \"Yes\")\r\n {\r\n color(borderColor)\t\r\n \/\/ Having the assignments in the method call caused an issue. \r\n \/\/ So the assigments are left out.\r\n nametagBorder(baseWidth,\/\/ = baseWidth,\r\n baseHeight,\/\/ = baseHeight,\r\n borderradius,\/\/ = borderradius,\r\n borderdistance,\/\/ = borderdistance,\r\n roundedCorners);\r\n }\t\r\n\r\n if (holes==2) \r\n {\r\n\/\/echo(\"rc:3 \");\r\n\/\/echo(roundedCorners);\r\n base2holes(baseWidth, baseHeight, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n\/\/echo(\"rc:4 \");\r\n\/\/echo(roundedCorners);\r\n if (holes==4) \r\n {\r\n\/\/echo(\"rc:5 \");\r\n\/\/echo(roundedCorners);\r\n base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners);\r\n }\r\n else \r\n {\r\n\/\/echo(\"rc:6 \");\r\n\/\/echo(roundedCorners); \r\n nametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners);\r\n }\r\n }\r\n}\r\n\r\nmodule oneIcon(iconType, iconXyScale, iconHeight, xOffset, yOffset)\r\n{\r\n color(iconColor)\r\n translate([xOffset, yOffset, 0])\r\n scale([iconXyScale, iconXyScale, iconHeight])\r\n if(iconType == \"Bass Clef\")\r\n {\r\n \tbaseclef15scale(4);\r\n }\r\n else if(iconType == \"Rebel\")\r\n {\r\n rebelAlliance(6);\r\n }\r\n else if(iconType == \"Trooper\")\r\n {\r\n scrumtrooper(2);\r\n }\r\n else if(iconType == \"Aqua Dude\")\r\n {\r\n aquaman(4);\r\n }\r\n else if(iconType == \"Cat\")\r\n {\r\n cat(4);\r\n }\r\n else if(iconType == \"Fan\")\r\n {\r\n\/\/ translate([0,0,0])\r\n scale([1, 1, 1.6])\r\n fanThumbnail();\r\n }\r\n else if(iconType == \"Light Bulb\")\r\n {\r\n lightBulbThumbnail();\r\n } \r\n else if(iconType == \"Spur\")\r\n {\r\n spurs(5);\r\n }\r\n else if(iconType == \"Mario\")\r\n {\r\n mario(5);\r\n }\r\n else if(iconType == \"Luigi\")\r\n {\r\n luigi(5);\r\n }\r\n else if(iconType == \"Thundercat\")\r\n {\r\n thundercatsLogo(5);\r\n }\r\n else if(iconType == \"Treble Clef\")\r\n {\r\n \ttrebleClefScaledDown(4);\r\n }\r\n else\r\n {\r\n\/\/ echo(\"drawing no icons\");\r\n }\r\n}\r\n\r\n\/\/ TODO: Migrate this to use the built-in OpenSCAD text() module.\r\nmodule writing(font, topText)\r\n{\r\n translate([0,namematrix[0][0],baseThickness+letterThickness\/2])\r\n write(topText,\r\n t = letterThickness,\r\n h = namematrix[0][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[0][3]);\r\n \r\n \/\/ this writes the second element (sub-element 1 and on) and on, max 100 names\r\n for ( i = [1 : 99] )\r\n {\t\t\t\t\r\n if (namematrix[i][0]==undef)\r\n {\r\n ;\t\/\/ then do nothing\r\n }\r\n else \r\n {\t\t \r\n translate([0,namematrix[i][0],baseThickness+letterThickness\/2])\r\n write(namematrix[i][1],\r\n t = letterThickness,\r\n h = namematrix[i][2],\r\n center = true,\r\n font = font,\r\n space = namematrix[i][3]);\r\n }\r\n }\r\n}\r\n\r\nmodule base2holes(baseWidth, \r\n baseHeight, \r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners) \r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n \r\n\t\ttranslate([-(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),0,0])\r\n\t\t\tnametagHole();\r\n\t\ttranslate([(baseWidth\/2-borderdistance*2-borderWidth-countersink-holediameter),(0),0])\r\n\t\t\tnametagHole();\r\n\t}\r\n}\r\n\r\n\/\/TODO: whitespace format this module\r\nmodule base4holes(baseWidth, baseHeight, chainLoop, chainLoopPosition, borderdistance, roundedCorners)\r\n{\r\n\tdifference()\r\n\t{\r\n\t\tnametagBase(baseWidth, \r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition,\r\n borderdistance,\r\n roundedCorners);\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\r\n\t\ttranslate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n nametagHole();\r\n\t}\r\n}\r\n\r\nmodule icons(leftIconType, \r\n leftIconXyScale, \r\n rightIconXyScale,\r\n leftIconHeight, \r\n rightIconHeight, \r\n xOffset, \r\n yOffset,\r\n xRightOffset,\r\n yRightOffset)\r\n{\r\n \/\/ left icon\r\n oneIcon(iconType=leftIconType, iconXyScale=leftIconXyScale, iconHeight=leftIconHeight, xOffset=-xOffset, yOffset=yOffset);\r\n \r\n \/\/ right icon\r\n oneIcon(iconType=rightIconType, iconXyScale=rightIconXyScale, iconHeight=rightIconHeight, xOffset=xOffset, yOffset=yRightOffset);\r\n}\r\n\r\nmodule nametagBase(baseWidth,\r\n baseHeight,\r\n chainLoop, \r\n chainLoopPosition, \r\n roundedCorners)\r\n{ \r\n size = [baseWidth, baseHeight, baseThickness]; \r\n\r\n color(baseColor)\r\n translate([0,0,baseThickness\/2])\r\n if(roundedCorners)\r\n {\r\n roundedCube(size=size,\r\n cornerRadius=8, \r\n sides=30, \r\n sidesOnly=true, \r\n cubeCentered=true);\r\n }\r\n else\r\n {\r\n cube(size = size, center = true);\r\n }\r\n\r\n if(chainLoop)\r\n {\r\n x = 21;\r\n y = 8;\r\n z = 3;\r\n \r\n xTranslate = -x \/ 2.0;\r\n\/\/ yTranslate = -baseHeight - 6; \r\n\r\n echo(\"clp: \");\r\n echo(chainLoopPosition);\r\n\r\n yBottomDelta = -baseHeight -6;\r\n yTopDelta = baseHeight - 2;\r\n\r\n yTranslate = (chainLoopPosition == \"bottom\") ? yBottomDelta : yTopDelta;\r\n \r\n translate([xTranslate,yTranslate,0])\r\n chainLoop(xLength = x,\r\n yLength = y,\r\n zLength = z);\r\n }\r\n}\r\n\r\nmodule nametagBorder(baseWidth,\r\n baseHeight,\r\n borderradius,\r\n borderdistance,\r\n roundedCorners)\r\n{\r\n\/\/ echo(\"rc:7 \");\r\n\/\/ echo(baseWidth);\r\n\r\n translate([0,0,baseThickness+letterThickness\/2])\r\n linear_extrude(height = letterThickness, center = true, convexity = 10, twist = 0)\r\n {\r\n\/\/ echo(\"rc:8 \");\r\n\/\/ echo(baseWidth);\r\n\r\n translate([0,baseHeight\/2-borderdistance,0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([0,-(baseHeight\/2-borderdistance),0])\r\n square ([baseWidth-borderdistance*2-borderradius*2+borderWidth*2,borderWidth],center = true);\r\n\r\n translate([baseWidth\/2-borderdistance,0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),0,0])\r\n square ([borderWidth, baseHeight-borderdistance*2-borderradius*2+borderWidth*2,],center = true);\r\n\r\n translate([-(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,0])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,180])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([(baseWidth\/2-borderdistance),-(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,90])\r\n nametagQuarter(baseWidth, borderradius);\r\n\r\n translate([-(baseWidth\/2-borderdistance),(baseHeight\/2-borderdistance),0])\r\n rotate(a=[0,0,270])\r\n nametagQuarter(baseWidth, borderradius);\r\n }\r\n}\r\n\r\n\r\nmodule nametagQuarter(baseWidth, borderradius)\r\n{\r\n\tintersection() \r\n\t{\r\n\t\tdifference()\r\n\t\t{\r\n\t\t\tcircle(r = borderradius, center=true, $fn=resolution);\r\n\t\t\tcircle(r = borderradius-borderWidth, center=true, $fn=resolution);\r\n\t\t}\r\n\t\tsquare ([borderradius+1, borderradius+1],center = false);\r\n\t}\r\n}\r\n\r\nmodule nametagHole()\r\n{\r\n\ttranslate([0,0,baseThickness\/2])\r\n\t\tcylinder(h = baseThickness+0.1, r = holediameter\/2, $fn=resolution, center = true);\r\n\ttranslate([0,0,baseThickness-countersink])\r\n\t\tcylinder(h = countersink+0.1, r1 = holediameter\/2, r2 = (holediameter+2*countersink)\/2, $fn=resolution, center = false);\r\n}\r\n\r\n\/\/ ************* External Modules *************\r\n\r\nmodule baseclef15scale(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-53.879273,-55.635750],[-49.678523,-57.651750],[-45.266273,-59.060250],[-43.916273,-59.142750],[-42.116273,-59.387250],[-40.016273,-59.141250],[-38.816273,-59.060250],[-35.041594,-58.017938],[-31.373086,-56.193750],[-28.132922,-53.712563],[-25.643273,-50.699250],[-23.732648,-46.578375],[-22.746773,-42.149250],[-22.466273,-40.499250],[-22.169273,-36.599250],[-22.466273,-33.149250],[-22.734773,-31.499250],[-23.921461,-26.847000],[-26.063273,-22.541250],[-27.860599,-20.221860],[-29.935219,-18.298102],[-32.245351,-16.744714],[-34.749211,-15.536438],[-37.405017,-14.648013],[-40.170984,-14.054180],[-45.866273,-13.649250],[-49.038211,-13.977750],[-52.166273,-14.634750],[-56.627273,-16.542000],[-60.566273,-19.362750],[-62.965898,-22.170938],[-64.845773,-25.349250],[-66.906773,-29.849250],[-67.938398,-33.444234],[-68.623523,-37.107000],[-69.116273,-44.549250],[-68.672273,-49.349250],[-68.672273,-50.399250],[-68.394773,-51.449250],[-67.468758,-55.755070],[-66.147023,-59.731688],[-64.396664,-63.542086],[-62.184773,-67.349250],[-58.863773,-71.924250],[-54.917273,-75.872250],[-53.729273,-76.800750],[-48.884273,-80.480250],[-45.116273,-82.575750],[-39.767836,-85.007250],[-34.166273,-86.754750],[-31.766273,-87.393750],[-30.116273,-87.710250],[-29.066273,-87.797250],[-28.016273,-88.056750],[-26.816273,-88.056750],[-25.466273,-88.343250],[-23.966273,-88.343250],[-22.466273,-88.499250],[-13.016273,-88.335750],[-11.216273,-88.046250],[-10.016273,-88.046250],[-8.966273,-87.755250],[-7.916273,-87.755250],[-6.866273,-87.488250],[-5.966273,-87.410250],[-3.416273,-86.756250],[-0.116273,-85.992750],[6.681914,-83.633625],[10.069266,-82.097156],[13.085227,-80.412750],[18.385805,-76.472977],[23.161852,-71.784937],[27.323086,-66.532430],[30.779227,-60.899250],[33.239414,-55.528312],[35.214727,-49.949250],[36.116227,-46.949250],[36.863227,-43.349250],[37.176727,-42.299250],[37.265227,-41.249250],[37.527727,-40.199250],[37.527727,-38.849250],[37.726852,-38.037000],[37.833727,-36.599250],[38.133727,-34.049250],[38.433727,-29.099250],[38.433727,-19.499250],[38.133727,-15.749250],[38.041477,-14.423437],[37.832227,-13.499250],[37.832227,-11.999250],[37.530727,-10.949250],[37.530727,-9.899250],[37.272727,-8.999250],[37.178227,-8.099250],[36.572227,-5.549250],[35.817727,-2.099250],[33.915727,4.050750],[29.984977,13.970438],[24.983227,23.400750],[22.493227,27.150750],[18.755109,32.327648],[14.807039,37.119937],[10.576312,41.667258],[5.990227,46.109250],[4.559227,47.337750],[-3.378047,54.038203],[-11.767711,60.166875],[-20.534531,65.750484],[-29.603273,70.815750],[-36.591773,74.433750],[-40.316273,76.064250],[-49.079273,80.001750],[-51.224273,80.804250],[-62.966273,85.167750],[-70.016273,87.557250],[-71.610023,88.156500],[-73.316273,88.499250],[-74.524008,88.363430],[-75.811898,87.900938],[-76.572727,87.096727],[-76.565736,86.561774],[-76.199273,85.935750],[-75.521273,85.313250],[-73.657898,84.321188],[-71.666273,83.478750],[-66.416273,81.095250],[-56.216273,76.634250],[-48.836273,72.926250],[-43.329773,69.981750],[-37.767773,66.417750],[-34.466273,64.344750],[-29.340773,60.600750],[-23.730773,56.244750],[-22.458773,55.052250],[-17.222273,50.349750],[-15.168773,48.156750],[-11.691773,44.550750],[-9.078773,41.399250],[-5.213273,36.587250],[-2.285273,32.250750],[0.912727,27.150750],[3.285656,22.670156],[5.544539,17.708625],[7.527516,12.630656],[9.072727,7.800750],[10.830727,0.300750],[10.830727,-0.599250],[11.133727,-1.649250],[11.133727,-2.699250],[11.408227,-3.749250],[11.610727,-5.549250],[11.883727,-7.799250],[12.197227,-10.649250],[12.197227,-12.449250],[12.483727,-14.699250],[12.483727,-27.449250],[12.195727,-29.699250],[12.195727,-32.099250],[11.879227,-33.899250],[11.879227,-35.249250],[11.181727,-39.449250],[11.094727,-40.649250],[10.836727,-41.549250],[10.836727,-42.599250],[10.589227,-43.499250],[10.478227,-44.399250],[9.839227,-47.249250],[9.428227,-49.649250],[7.781227,-55.949250],[5.837227,-60.749250],[5.028727,-62.562750],[3.038812,-66.165844],[0.767789,-69.456750],[-1.859016,-72.464156],[-4.916273,-75.216750],[-8.188523,-77.533687],[-11.816273,-79.221750],[-13.466273,-79.842750],[-18.716273,-80.999250],[-20.366273,-80.999250],[-22.016273,-81.285750],[-24.266273,-81.285750],[-26.366273,-81.024750],[-28.316273,-80.930250],[-29.816273,-80.576250],[-33.188273,-79.936125],[-36.416273,-78.951750],[-41.974711,-76.728187],[-47.066273,-73.578750],[-49.952086,-71.410875],[-52.593773,-68.952750],[-53.447273,-67.862250],[-55.706086,-64.713000],[-57.329273,-61.199250],[-58.463273,-57.599250],[-58.463273,-56.699250],[-58.677773,-55.902562],[-58.766273,-54.749250],[-58.766273,-53.699250],[-58.616273,-52.199250],[-53.879273,-55.635750]]);\r\n linear_extrude(height=h)\r\n polygon([[66.483727,-72.005250],[68.183789,-71.796375],[69.797227,-71.220750],[72.819727,-69.378844],[74.975977,-66.879375],[76.236727,-63.820219],[76.572727,-60.299250],[76.046039,-57.155813],[74.663227,-54.281250],[73.105477,-52.499016],[71.092102,-51.025875],[68.819414,-50.022422],[66.483727,-49.649250],[63.633727,-49.649250],[61.985227,-49.936125],[60.422227,-50.544750],[57.933727,-51.977250],[56.394117,-53.517938],[55.157977,-55.426500],[54.334711,-57.540938],[54.033727,-59.699250],[54.033727,-62.099250],[54.380414,-64.165313],[55.097227,-66.149250],[56.467852,-68.241023],[58.316602,-69.921188],[60.502289,-71.158383],[62.883727,-71.921250],[64.533727,-72.086250],[66.483727,-72.005250]]);\r\n linear_extrude(height=h)\r\n polygon([[66.333727,-20.099250],[67.796414,-19.941750],[69.183727,-19.445250],[71.702930,-18.132797],[73.788727,-16.340250],[75.343523,-14.088703],[76.269727,-11.399250],[76.533727,-9.899250],[76.432664,-6.941438],[75.666727,-4.074750],[74.536453,-2.163844],[72.945914,-0.429000],[71.057531,0.971719],[69.033727,1.880250],[66.633727,2.276250],[65.133727,2.394750],[62.733727,2.211750],[59.699039,1.090500],[57.077227,-0.813750],[55.890188,-2.251781],[54.926039,-3.959250],[54.276609,-5.802844],[54.033727,-7.649250],[54.033727,-10.049250],[54.311344,-12.041531],[55.031789,-13.997250],[56.097328,-15.797719],[57.410227,-17.324250],[59.976539,-19.003875],[62.883727,-20.010750],[66.333727,-20.099250]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliancePolySelection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-140.090000,-711.580000],[-168.890000,-761.580000],[-175.158750,-770.355000],[-177.866094,-775.380938],[-178.460449,-777.642539],[-178.300000,-779.580000],[-176.323281,-782.664844],[-172.671250,-787.076250],[-165.910000,-794.580000],[-141.260000,-822.580000],[-46.120000,-930.580000],[-15.260000,-965.580000],[-9.823750,-971.838750],[-6.461094,-975.014531],[-3.750000,-976.380000],[-0.790781,-975.056719],[2.591250,-971.951250],[8.160000,-965.580000],[37.210000,-932.580000],[132.310000,-824.580000],[159.580000,-793.580000],[165.318750,-787.233750],[168.227031,-783.560469],[169.760000,-780.580000],[168.965313,-776.953438],[166.357500,-772.050000],[160.840000,-763.580000],[137.270000,-720.580000],[122.320000,-687.783281],[109.305000,-654.188750],[103.666094,-637.090254],[98.682500,-619.789844],[94.411406,-602.286699],[90.910000,-584.580000],[86.740000,-555.580000],[85.621250,-545.956250],[85.526406,-540.967656],[86.160000,-536.580000],[91.107500,-545.540938],[98.770000,-556.030000],[114.080000,-574.580000],[124.538477,-586.564258],[135.531562,-598.184063],[158.867500,-620.312500],[183.579687,-640.929688],[209.160000,-660.000000],[242.160000,-681.180000],[249.055000,-685.315000],[253.030312,-687.173438],[256.160000,-687.710000],[258.689531,-686.539531],[261.163750,-684.353750],[265.320000,-679.580000],[285.000000,-657.580000],[339.230000,-596.580000],[356.160000,-577.580000],[362.718750,-570.368750],[365.836406,-566.427031],[368.160000,-562.580000],[357.375859,-558.414766],[346.266875,-553.353750],[323.815000,-541.187500],[302.285625,-527.367500],[283.160000,-513.180000],[269.431836,-501.715566],[256.181563,-489.647031],[243.460508,-476.992793],[231.320000,-463.771250],[219.811367,-450.000801],[208.985937,-435.699844],[198.895039,-420.886777],[189.590000,-405.580000],[179.976875,-387.207969],[171.365000,-367.893750],[163.675625,-348.172656],[156.830000,-328.580000],[148.449844,-301.275781],[141.373750,-273.661250],[135.540781,-245.756094],[130.890000,-217.580000],[126.070000,-169.580000],[125.160000,-157.580000],[125.160000,-112.580000],[126.070000,-100.580000],[130.910000,-56.580000],[134.238149,-38.871221],[138.342695,-21.206797],[143.251909,-3.690850],[148.994063,13.572500],[155.597427,30.479131],[163.090273,46.924922],[171.500874,62.805752],[180.857500,78.017500],[191.188423,92.456045],[202.521914,106.017266],[214.886245,118.597041],[228.309688,130.091250],[242.820513,140.395771],[258.446992,149.406484],[275.217397,157.019268],[293.160000,163.130000],[315.028750,167.990000],[326.818594,169.694375],[337.160000,170.420000],[359.307383,169.551621],[380.936562,166.534844],[402.035586,161.539707],[422.592500,154.736250],[442.595352,146.294512],[462.032188,136.384531],[480.891055,125.176348],[499.160000,112.840000],[520.271250,96.973750],[531.499531,87.964844],[540.160000,80.380000],[553.044219,67.199219],[566.126250,52.401250],[578.692656,37.102656],[590.030000,22.420000],[610.259473,-6.374434],[628.792656,-36.459219],[645.531699,-67.682832],[660.378750,-99.893750],[673.235957,-132.940449],[684.005469,-166.671406],[692.589434,-200.935098],[698.890000,-235.580000],[703.250000,-278.580000],[704.160000,-290.580000],[704.160000,-339.580000],[703.250000,-349.580000],[698.430000,-395.580000],[695.232402,-415.143770],[691.295469,-434.775156],[686.665488,-454.395527],[681.388750,-473.926250],[675.511543,-493.288691],[669.080156,-512.404219],[654.740000,-549.580000],[637.470000,-587.580000],[626.562285,-609.956113],[614.280781,-632.755156],[600.879199,-655.711934],[586.611250,-678.561250],[571.730645,-701.037910],[556.491094,-722.876719],[525.950000,-763.580000],[493.070000,-803.580000],[490.134844,-806.846719],[486.733750,-811.518750],[485.844902,-813.644355],[486.023281,-815.236406],[487.663457,-815.999941],[491.160000,-815.640000],[496.848750,-813.647813],[502.207500,-810.622500],[512.160000,-803.430000],[545.160000,-778.950000],[578.029844,-753.726875],[610.261250,-727.675000],[641.692031,-700.678125],[672.160000,-672.620000],[701.120000,-644.580000],[720.731309,-623.489277],[739.709219,-601.861719],[758.018457,-579.692988],[775.623750,-556.978750],[792.489824,-533.714668],[808.581406,-509.896406],[823.863223,-485.519629],[838.300000,-460.580000],[856.918223,-424.955527],[873.757656,-388.501719],[888.874199,-351.311738],[902.323750,-313.478750],[914.162207,-275.095918],[924.445469,-236.256406],[933.229434,-197.053379],[940.570000,-157.580000],[944.501562,-132.125000],[947.842500,-106.677500],[953.330000,-55.580000],[956.840000,-4.580000],[956.160000,5.420000],[956.160000,20.420000],[955.160000,34.420000],[953.250000,66.420000],[951.004844,94.030625],[948.068750,121.555000],[944.470781,149.011875],[940.240000,176.420000],[933.811047,211.725286],[926.243691,246.805410],[917.533435,281.612400],[907.675781,316.098281],[896.666233,350.215081],[884.500293,383.914824],[871.173464,417.149539],[856.681250,449.871250],[841.019153,482.031985],[824.182676,513.583770],[806.167322,544.478630],[786.968594,574.668594],[766.581995,604.105686],[745.003027,632.741934],[722.227195,660.529363],[698.250000,687.420000],[656.160000,730.330000],[633.958083,750.351604],[611.220137,769.549395],[587.957864,787.918464],[564.182969,805.453906],[539.907156,822.150813],[515.142129,838.004277],[489.899592,853.009392],[464.191250,867.161250],[438.028806,880.454944],[411.423965,892.885566],[384.388430,904.448210],[356.933906,915.137969],[329.072097,924.949934],[300.814707,933.879199],[272.173440,941.920857],[243.160000,949.070000],[210.345781,956.090156],[178.001250,961.948750],[145.486094,966.747969],[112.160000,970.590000],[74.160000,973.510000],[64.160000,974.420000],[46.160000,975.420000],[26.160000,975.420000],[9.160000,976.380000],[-7.840000,976.380000],[-17.840000,975.420000],[-36.840000,975.420000],[-55.840000,974.420000],[-65.840000,973.510000],[-109.941250,969.558750],[-153.840000,963.500000],[-181.026191,958.615820],[-208.065781,952.980938],[-234.934043,946.588086],[-261.606250,939.430000],[-288.057676,931.499414],[-314.263594,922.789062],[-340.199277,913.291680],[-365.840000,903.000000],[-390.045730,892.449340],[-413.868069,881.279253],[-437.298800,869.500076],[-460.329707,857.122148],[-482.952575,844.155807],[-505.159187,830.611392],[-526.941328,816.499239],[-548.290781,801.829687],[-569.199331,786.613076],[-589.658762,770.859741],[-609.660858,754.580023],[-629.197402,737.784258],[-648.260180,720.482785],[-666.840974,702.685942],[-684.931570,684.404068],[-702.523750,665.647500],[-719.609300,646.426577],[-736.180002,626.751636],[-752.227643,606.633016],[-767.744004,586.081055],[-782.720871,565.106091],[-797.150027,543.718462],[-811.023257,521.928506],[-824.332344,499.746562],[-837.069073,477.182968],[-849.225227,454.248062],[-860.792591,430.952181],[-871.762949,407.305664],[-882.128085,383.318849],[-891.879783,359.002075],[-901.009826,334.365679],[-909.510000,309.420000],[-922.527812,266.043437],[-933.425000,222.342500],[-942.267188,178.180313],[-949.120000,133.420000],[-954.880000,73.420000],[-955.840000,62.420000],[-956.840000,42.420000],[-956.840000,-27.580000],[-955.840000,-47.580000],[-954.930000,-57.580000],[-951.086250,-100.166250],[-945.420000,-142.580000],[-940.506765,-171.172578],[-934.683027,-199.589375],[-927.963362,-227.806484],[-920.362344,-255.800000],[-911.894548,-283.546016],[-902.574551,-311.020625],[-892.416926,-338.199922],[-881.436250,-365.060000],[-869.647097,-391.576953],[-857.064043,-417.726875],[-843.701663,-443.485859],[-829.574531,-468.830000],[-814.697224,-493.735391],[-799.084316,-518.178125],[-782.750383,-542.134297],[-765.710000,-565.580000],[-746.478594,-590.558750],[-726.466250,-615.035000],[-705.608281,-638.783750],[-683.840000,-661.580000],[-649.840000,-695.490000],[-624.482969,-718.357344],[-598.513750,-740.383750],[-571.957656,-761.703281],[-544.840000,-782.450000],[-509.840000,-806.910000],[-505.204844,-810.186719],[-500.958750,-812.821250],[-496.403281,-814.167656],[-490.840000,-813.580000],[-493.135937,-808.834063],[-496.292500,-804.547500],[-503.410000,-796.580000],[-527.370000,-766.580000],[-545.513594,-741.598750],[-562.906250,-716.077500],[-579.543281,-690.057500],[-595.420000,-663.580000],[-613.111660,-631.683555],[-629.933906,-598.377813],[-645.653887,-563.941914],[-660.038750,-528.655000],[-672.855645,-492.796211],[-683.871719,-456.644688],[-692.854121,-420.479570],[-699.570000,-384.580000],[-705.930000,-326.580000],[-706.840000,-314.580000],[-706.840000,-266.580000],[-705.930000,-256.580000],[-702.110000,-218.580000],[-698.663379,-197.623223],[-694.453281,-177.287656],[-689.460605,-157.452949],[-683.666250,-137.998750],[-677.051113,-118.804707],[-669.596094,-99.750469],[-661.282090,-80.715684],[-652.090000,-61.580000],[-643.329219,-45.053594],[-633.836250,-28.833750],[-623.730156,-12.987031],[-613.130000,2.420000],[-600.017656,20.202812],[-586.298750,37.507500],[-571.925469,54.268438],[-556.850000,70.420000],[-547.800000,80.250000],[-537.114375,89.716094],[-525.562500,98.911250],[-501.840000,115.750000],[-479.450332,129.625664],[-455.821406,142.040937],[-431.182090,152.569492],[-418.555056,156.993022],[-405.761250,160.785000],[-392.829280,163.892134],[-379.787754,166.261133],[-366.665281,167.838706],[-353.490469,168.571562],[-340.291926,168.406411],[-327.098262,167.289961],[-313.938083,165.168921],[-300.840000,161.990000],[-286.895781,157.404219],[-273.391250,151.748750],[-260.361094,145.071406],[-247.840000,137.420000],[-233.948125,127.287500],[-219.745000,115.242500],[-206.411875,102.286250],[-195.130000,89.420000],[-187.927129,79.332539],[-180.885156,67.705938],[-174.107793,54.965117],[-167.698750,41.535000],[-156.400469,14.306563],[-147.820000,-10.580000],[-141.899351,-31.653450],[-137.075898,-52.750410],[-133.323013,-73.860173],[-130.614063,-94.972031],[-128.922417,-116.075276],[-128.221445,-137.159199],[-128.484517,-158.213093],[-129.685000,-179.226250],[-131.796265,-200.187961],[-134.791680,-221.087520],[-138.644614,-241.914216],[-143.328438,-262.657344],[-148.816519,-283.306194],[-155.082227,-303.850059],[-162.098931,-324.278230],[-169.840000,-344.580000],[-192.590000,-394.580000],[-200.620000,-411.580000],[-207.818438,-424.276250],[-216.110000,-436.987500],[-225.069063,-449.245000],[-234.270000,-460.580000],[-249.188574,-476.868008],[-265.131719,-492.146563],[-282.001816,-506.414961],[-299.701250,-519.672500],[-318.132402,-531.918477],[-337.197656,-543.152188],[-356.799395,-553.372930],[-376.840000,-562.580000],[-372.461406,-569.012500],[-365.481250,-577.110000],[-352.120000,-591.580000],[-291.560000,-658.580000],[-271.560000,-680.580000],[-267.217500,-685.145000],[-264.576563,-687.048750],[-261.840000,-687.880000],[-258.625781,-687.084844],[-254.306250,-685.111250],[-246.840000,-681.000000],[-212.840000,-659.860000],[-188.704687,-641.748750],[-165.842500,-622.092500],[-144.296563,-601.000000],[-124.110000,-578.580000],[-93.840000,-538.580000],[-94.814219,-559.930605],[-97.593125,-582.091094],[-101.961094,-604.695723],[-107.702500,-627.378750],[-114.601719,-649.774434],[-122.443125,-671.517031],[-131.011094,-692.240801],[-140.090000,-711.580000]]);\r\n }\r\n}\r\n\r\nmodule rebelAlliance(h)\r\n{\r\n scale(0.4, 0.4, 1)\r\n rebelAlliancePolySelection(h);\r\n}\r\n\r\nmodule scrumtrooper_poly_Selection(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-33.094424,-44.902344],[-25.219053,-51.135742],[-16.283955,-55.413281],[-6.691904,-57.734727],[3.154326,-58.099844],[12.851963,-56.508398],[21.998232,-52.960156],[30.190361,-47.454883],[33.802756,-43.968286],[37.025576,-39.992344],[40.318232,-33.900469],[42.396826,-27.062344],[43.487295,-19.939219],[43.815576,-12.992344],[16.815576,-20.552344],[0.885889,-21.888125],[-14.321924,-20.821094],[-29.210986,-17.479687],[-44.184424,-11.992344],[-43.358643,-21.146563],[-41.830674,-29.628594],[-38.707080,-37.520000],[-36.267725,-41.269707],[-33.094424,-44.902344]]);\r\n linear_extrude(height=h)\r\n polygon([[20.815576,1.937656],[26.856826,4.863906],[31.825576,7.707656],[33.005947,10.129336],[33.292295,12.911719],[32.819971,15.867070],[31.724326,18.807656],[28.204482,23.893594],[26.050986,25.663477],[23.815576,26.667656],[21.526357,26.542969],[19.391826,25.355156],[15.815576,22.017656],[8.953076,15.842656],[4.950889,13.324219],[0.815576,12.157656],[-3.940049,12.919531],[-8.414424,15.305156],[-12.453799,18.587031],[-15.904424,22.037656],[-19.470674,25.787656],[-21.637705,26.959531],[-24.184424,26.837656],[-26.283604,25.711230],[-28.302861,23.918125],[-31.631924,18.983906],[-33.232236,13.339062],[-33.090557,10.657676],[-32.164424,8.287656],[-30.441924,6.566250],[-28.126924,5.458906],[-22.184424,2.877656],[-17.192236,-0.728125],[-13.071924,-4.518594],[-9.007861,-8.145938],[-4.184424,-11.262344],[0.224365,-11.826777],[3.853389,-11.335938],[6.909131,-10.001113],[9.598076,-8.033594],[14.701514,-3.045625],[20.815576,1.937656]]);\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-52.144424,33.007656],[-52.736143,30.722500],[-52.565674,28.496406],[-51.404424,24.007656],[-49.066924,16.367656],[-47.044424,11.007656],[-45.736924,1.875156],[-44.136299,-1.848281],[-42.534893,-3.493555],[-40.184424,-4.992344],[-37.836924,-0.649844],[-36.947236,1.749219],[-36.704424,4.007656],[-37.693018,6.902031],[-39.513174,9.507656],[-41.323955,12.113281],[-42.284424,15.007656],[-41.150518,19.141719],[-38.050674,24.012656],[-31.094424,31.817656],[-27.954424,34.111406],[-26.180986,34.620312],[-24.184424,34.417656],[-21.906201,33.335020],[-19.520518,31.569063],[-14.300674,26.958906],[-8.272705,22.530625],[-4.876865,20.992012],[-1.184424,20.227656],[4.007451,20.756719],[8.648076,22.802656],[12.872451,25.793594],[16.815576,29.157656],[20.948076,32.712656],[23.360264,34.135781],[25.815576,34.617656],[28.609639,33.526875],[31.660576,31.163906],[36.605576,26.007656],[39.459326,22.172656],[41.705576,18.007656],[42.146260,15.846992],[41.961045,13.993594],[40.344326,10.900156],[38.118232,8.110469],[36.545576,5.007656],[36.600889,2.622500],[37.475576,-0.048594],[39.815576,-4.992344],[42.963076,-3.616094],[45.075576,-0.882344],[47.075576,12.007656],[51.106826,22.205156],[52.628857,27.723906],[52.736143,30.363516],[52.205576,32.837656],[50.927139,34.908281],[48.983076,36.915156],[44.905576,40.437656],[40.598076,44.997656],[36.815576,50.007656],[37.815576,51.007656],[47.815576,43.007656],[41.753076,51.403906],[37.898701,55.201250],[33.815576,57.497656],[28.674014,58.062031],[23.643076,57.137656],[13.815576,53.927656],[2.815576,52.177656],[-6.266924,52.541406],[-15.184424,54.367656],[-25.053174,57.572656],[-30.134268,58.099844],[-35.184424,56.847656],[-38.693486,54.471562],[-41.904424,51.196406],[-47.184424,44.007656],[-37.184424,50.007656],[-42.448330,43.177656],[-46.723174,38.950156],[-49.968643,36.001406],[-52.144424,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-46.184424,24.007656],[-39.184424,34.007656],[-34.184424,33.007656],[-36.198643,29.399219],[-38.838174,26.370156],[-42.150830,24.409844],[-46.184424,24.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[33.815576,33.007656],[38.815576,34.007656],[46.815576,24.007656],[42.582139,24.176406],[39.033076,26.152656],[36.125264,29.306406],[33.815576,33.007656]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[31.595576,51.217656],[33.840889,49.183906],[34.460576,46.062656],[34.007881,44.499687],[32.965264,43.151406],[31.271553,42.180000],[28.865576,41.747656],[26.638838,43.402676],[25.479795,45.194687],[25.221455,46.987871],[25.696826,48.646406],[28.180732,51.016250],[29.855283,51.455918],[31.595576,51.217656]]);\r\n }\r\n linear_extrude(height=h)\r\n polygon([[-47.184424,43.007656],[-50.184424,40.007656],[-47.184424,43.007656]]);\r\n }\r\n}\r\n\r\nmodule scrumtrooper(h)\r\n{\r\n scrumtrooper_poly_Selection(h);\r\n}\r\n\r\nmodule aquaman(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[10.730000,-174.810000],[23.440156,-158.167813],[37.043750,-138.925000],[61.610000,-101.510000],[82.505313,-67.248906],[101.767500,-33.648750],[119.893438,0.590781],[137.380000,36.770000],[160.330000,92.770000],[165.120000,105.792500],[167.220625,113.160625],[167.810000,118.770000],[166.300469,123.302187],[163.376250,127.892500],[156.610000,135.860000],[126.070000,168.980000],[118.280000,176.735000],[113.495313,180.190625],[111.265273,181.050078],[109.290000,181.040000],[107.712090,180.141875],[106.581719,178.611875],[105.368750,174.342500],[105.070000,165.770000],[104.030000,155.770000],[104.030000,146.770000],[100.908750,127.400000],[98.390938,117.430703],[95.215000,107.542500],[91.365938,97.938359],[86.828750,88.821250],[81.588437,80.394141],[75.630000,72.860000],[69.198594,66.305156],[61.896250,59.998750],[54.070781,54.380469],[46.070000,49.890000],[36.225313,46.008281],[25.550000,43.151250],[14.634687,41.383594],[4.070000,40.770000],[-7.293672,41.188145],[-18.233125,42.528906],[-28.727266,44.865527],[-38.755000,48.271250],[-48.295234,52.819316],[-57.326875,58.582969],[-65.828828,65.635449],[-73.780000,74.050000],[-79.637949,81.880215],[-84.801094,90.476719],[-89.283379,99.672051],[-93.098750,109.298750],[-96.261152,119.189355],[-98.784531,129.176406],[-101.970000,148.770000],[-101.970000,160.050000],[-102.930000,169.770000],[-103.073750,177.587500],[-104.239219,181.259063],[-105.395996,182.529414],[-107.050000,183.230000],[-109.195215,183.141855],[-111.544219,182.243594],[-116.453750,178.803750],[-124.320000,170.860000],[-137.650000,157.600000],[-147.680000,145.860000],[-157.140000,135.680000],[-163.716250,127.765000],[-166.478906,123.271250],[-167.810000,118.770000],[-167.375313,114.463750],[-165.982500,108.845000],[-162.760000,98.770000],[-144.350000,52.770000],[-132.058906,25.492969],[-118.973750,-1.421250],[-105.114219,-27.947344],[-90.500000,-54.060000],[-66.400000,-94.230000],[-50.790000,-118.230000],[-16.300000,-167.230000],[-12.294688,-172.806875],[-8.302500,-177.705000],[-3.466563,-181.365625],[-0.464414,-182.557266],[3.070000,-183.230000],[10.730000,-174.810000]]);\r\n }\r\n}\r\n\r\nmodule cat(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-89.303594,-104.629248],[-85.166094,-99.396748],[-82.764531,-97.935498],[-79.093594,-97.689248],[-73.093594,-98.369248],[-68.013594,-97.617998],[-65.480156,-97.394717],[-63.263594,-97.819248],[-59.814844,-100.871748],[-56.793594,-104.629248],[-50.784844,-111.007998],[-44.093594,-116.629248],[-42.441094,-105.601748],[-42.093594,-93.629248],[-43.143594,-78.629248],[-42.223594,-62.629248],[-41.788750,-58.176279],[-40.267344,-55.385498],[-34.553594,-49.619248],[-28.923594,-43.099248],[-25.092051,-40.151104],[-20.623125,-37.536592],[-10.392344,-32.887998],[0.530312,-28.312529],[10.906406,-22.969248],[19.912305,-16.495576],[27.339219,-9.343623],[33.410977,-1.556982],[38.351406,6.820752],[42.384336,15.745986],[45.733594,25.175127],[51.276406,45.370752],[54.823906,61.462002],[55.672344,69.984346],[54.906406,77.320752],[62.417656,78.348252],[66.107187,78.198252],[69.906406,77.320752],[74.808086,74.786826],[78.637969,71.183096],[81.452070,66.746631],[83.306406,61.714502],[84.256992,56.323779],[84.359844,50.811533],[83.670977,45.414834],[82.246406,40.370752],[78.707656,33.798096],[73.751406,27.209502],[68.622656,20.701533],[64.566406,14.370752],[62.782500,10.057783],[61.627656,5.599502],[60.916406,-3.629248],[61.565508,-10.284189],[63.193594,-17.100029],[65.771836,-23.759541],[69.271406,-29.945498],[73.663477,-35.340674],[78.919219,-39.627842],[85.009805,-42.489775],[91.906406,-43.609248],[95.427656,-43.562998],[98.866406,-43.059248],[101.152480,-42.035400],[102.940625,-40.559092],[105.022656,-36.640498],[105.111563,-32.086279],[103.206406,-27.679248],[100.696758,-25.168994],[97.396094,-23.109092],[89.716406,-19.370498],[85.984727,-17.206885],[82.756719,-14.523779],[80.356055,-11.078721],[79.106406,-6.629248],[79.120020,-3.430732],[79.783437,-0.235498],[82.520156,6.038252],[89.856406,17.370752],[93.929844,24.436221],[97.071406,31.662002],[99.117969,39.242158],[99.906406,47.370752],[99.805156,57.912002],[97.986406,68.370752],[95.456406,75.547002],[92.146406,82.370752],[86.956406,89.436846],[80.573906,95.369502],[73.167656,99.927783],[64.906406,102.870752],[55.353906,104.250752],[48.906406,104.580752],[39.906406,107.040752],[21.906406,108.660752],[12.209687,110.591064],[1.587656,113.288252],[-8.875000,115.576689],[-18.093594,116.280752],[-23.837813,115.457314],[-27.447344,113.983252],[-34.093594,109.930752],[-47.093594,105.370752],[-48.464844,109.924502],[-49.598125,111.902783],[-51.313594,113.720752],[-54.457051,115.659678],[-58.360000,116.977158],[-62.707559,117.629248],[-67.184844,117.572002],[-71.476973,116.761475],[-75.269063,115.153721],[-78.246230,112.704795],[-80.093594,109.370752],[-84.093594,109.370752],[-87.971406,109.297002],[-92.286094,108.683252],[-95.869531,106.918252],[-97.021992,105.413018],[-97.553594,103.390752],[-97.271699,101.220811],[-96.198438,99.561221],[-92.517344,97.129502],[-88.189375,94.808408],[-86.307520,93.287100],[-84.893594,91.310752],[-82.320781,83.058877],[-79.828594,70.723252],[-78.011406,58.196377],[-77.463594,49.370752],[-78.103906,42.263564],[-79.346094,35.533252],[-81.274531,28.971689],[-83.973594,22.370752],[-91.236094,8.637002],[-94.669531,1.674971],[-97.313594,-5.629248],[-98.282188,-10.995029],[-98.814844,-17.467998],[-99.093594,-29.629248],[-100.036719,-39.220029],[-102.093594,-48.275498],[-104.150469,-57.257842],[-105.093594,-66.629248],[-104.814844,-73.019092],[-104.183594,-77.382998],[-103.183594,-83.629248],[-103.848750,-89.460654],[-104.912344,-96.492998],[-105.111563,-105.593467],[-103.183594,-117.629248],[-95.853594,-111.579248],[-89.303594,-104.629248]]);\r\n }\r\n}\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}\r\n\r\nmodule thundercatsLogo(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-256.460000,-3.460000],[-236.500000,-21.710000],[-218.908750,-36.998750],[-209.883906,-44.371719],[-200.500000,-51.260000],[-177.500000,-65.290000],[-145.500000,-85.630000],[-131.951250,-95.348750],[-125.245781,-100.841406],[-119.670000,-106.290000],[-106.490000,-126.290000],[-99.821250,-133.856875],[-92.680000,-140.310000],[-84.946250,-146.050625],[-76.500000,-151.480000],[-62.602344,-159.072246],[-47.081875,-166.047969],[-30.396094,-172.420645],[-13.002500,-178.203750],[22.078125,-188.055156],[54.500000,-195.710000],[141.500000,-212.540000],[188.500000,-220.120000],[192.585859,-219.939043],[194.511250,-218.749219],[194.719141,-216.817598],[193.652500,-214.411250],[189.467500,-209.242656],[185.500000,-205.380000],[176.243125,-197.358437],[165.617500,-189.342500],[154.433125,-182.185312],[143.500000,-176.740000],[133.842656,-173.492031],[123.833750,-171.531250],[113.657969,-171.012344],[103.500000,-172.090000],[94.075000,-174.470312],[84.717500,-177.287500],[75.251250,-179.545937],[65.500000,-180.250000],[59.490937,-179.104531],[51.530000,-176.628750],[37.500000,-171.290000],[43.548594,-171.836094],[47.833750,-172.831250],[51.952031,-173.805781],[57.500000,-174.290000],[67.616875,-173.313906],[76.852500,-170.726250],[85.911875,-167.397969],[95.500000,-164.200000],[105.903281,-162.478750],[117.451250,-161.920000],[129.023594,-162.501250],[139.500000,-164.200000],[150.860937,-167.239531],[162.370000,-171.678750],[173.444062,-177.158594],[183.500000,-183.320000],[204.500000,-199.290000],[214.700000,-187.290000],[226.172500,-171.781250],[236.190000,-155.290000],[242.101602,-143.649180],[247.381562,-131.740937],[252.045117,-119.594102],[256.107500,-107.237500],[262.489687,-82.010312],[266.650000,-56.290000],[268.500000,-36.290000],[268.500000,-18.290000],[267.923437,-9.027500],[266.512500,2.657500],[262.920000,23.710000],[253.920000,57.710000],[250.035000,69.186250],[247.431563,74.997031],[244.500000,79.710000],[241.360078,70.819512],[236.533125,62.953594],[230.293359,56.161816],[222.915000,50.493750],[214.672266,45.998965],[205.839375,42.727031],[196.690547,40.727520],[187.500000,40.050000],[178.962500,40.990000],[170.500000,42.710000],[175.970313,27.689375],[178.622500,14.682500],[179.463438,1.439375],[179.500000,-14.290000],[178.664219,-28.272344],[176.083750,-42.403750],[171.581406,-55.978281],[168.554160,-62.336113],[164.980000,-68.290000],[159.143672,-75.972559],[152.568125,-82.886719],[145.341016,-89.053457],[137.550000,-94.493750],[129.282734,-99.228574],[120.626875,-103.278906],[111.670078,-106.665723],[102.500000,-109.410000],[93.040625,-111.530781],[81.380000,-113.393750],[69.779375,-114.234844],[64.708203,-114.033418],[60.500000,-113.290000],[67.326250,-112.443437],[75.075000,-110.762500],[89.500000,-106.630000],[99.328125,-103.141133],[108.965000,-98.984062],[118.283125,-94.128086],[127.155000,-88.542500],[135.453125,-82.196602],[143.050000,-75.059687],[149.818125,-67.101055],[155.630000,-58.290000],[159.294026,-51.051133],[162.250488,-43.445938],[164.517214,-35.536523],[166.112031,-27.385000],[167.052766,-19.053477],[167.357246,-10.604062],[167.043298,-2.098867],[166.128750,6.400000],[162.569160,23.130312],[156.821094,39.090000],[153.170950,46.625586],[149.027168,53.782188],[144.407576,60.497695],[139.330000,66.710000],[129.225000,76.751250],[123.512500,81.181719],[117.500000,84.730000],[90.500000,95.190000],[83.125801,99.602520],[75.788281,105.074531],[68.761309,111.455215],[62.318750,118.593750],[56.734473,126.339316],[52.282344,134.541094],[49.236230,143.048262],[47.870000,151.710000],[48.064609,155.966133],[49.044375,159.722813],[50.739453,162.894961],[53.080000,165.397500],[55.996172,167.145352],[59.418125,168.053438],[63.276016,168.036680],[67.500000,167.010000],[73.035137,164.554688],[78.128594,161.409375],[87.353750,153.667500],[95.902031,145.021875],[104.500000,136.710000],[102.826680,142.470449],[100.465937,148.376094],[94.157500,160.183750],[86.525312,171.254531],[78.520000,180.710000],[69.832148,189.340781],[60.924688,196.961875],[51.701758,203.548906],[42.067500,209.077500],[31.926055,213.523281],[21.181562,216.861875],[9.738164,219.068906],[-2.500000,220.120000],[-10.665469,219.957344],[-18.758750,218.931250],[-26.722656,217.134531],[-34.500000,214.660000],[-42.716250,211.132500],[-47.298281,209.476563],[-50.490000,209.120000],[-52.758438,210.480469],[-55.182500,212.848750],[-59.500000,217.710000],[-62.019219,211.255313],[-63.821250,204.465000],[-64.462656,197.547188],[-63.500000,190.710000],[-68.880547,189.241094],[-74.980625,186.801875],[-88.040000,179.792500],[-100.079375,171.241875],[-104.904453,166.876094],[-108.500000,162.710000],[-99.633438,166.451563],[-90.510000,169.760000],[-81.131562,172.033438],[-71.500000,172.670000],[-63.875352,171.913008],[-56.599688,170.298437],[-49.659180,167.899648],[-43.040000,164.790000],[-36.728320,161.042852],[-30.710312,156.731563],[-19.500000,146.710000],[-10.552480,136.679063],[-2.819844,125.988125],[3.743027,114.703750],[9.181250,102.892500],[13.539941,90.620938],[16.864219,77.955625],[19.199199,64.963125],[20.590000,51.710000],[21.500000,41.710000],[20.821250,29.101250],[18.740000,16.710000],[16.232500,9.526250],[12.870000,2.710000],[9.048096,-2.762307],[4.735234,-7.352676],[-0.015557,-11.118777],[-5.151250,-14.118281],[-10.618818,-16.408860],[-16.365234,-18.048184],[-28.482500,-19.603750],[-41.078828,-19.246348],[-53.730000,-17.437344],[-66.011797,-14.638105],[-77.500000,-11.310000],[-95.500000,-5.010000],[-116.500000,4.940000],[-129.360000,12.352500],[-141.500000,20.920000],[-153.160000,31.283281],[-158.533203,37.170449],[-163.357500,43.496250],[-167.449609,50.236895],[-170.626250,57.368594],[-172.704141,64.867559],[-173.500000,72.710000],[-172.978672,81.785723],[-171.281250,90.337031],[-168.533828,98.418887],[-164.862500,106.086250],[-160.393359,113.394082],[-155.252500,120.397344],[-143.460000,133.710000],[-126.500000,149.710000],[-145.802813,141.731563],[-162.460000,133.537500],[-170.316211,128.842227],[-178.134688,123.472188],[-186.123320,117.220430],[-194.490000,109.880000],[-202.025781,102.304688],[-209.228750,93.460000],[-215.064844,83.782813],[-217.147168,78.768555],[-218.500000,73.710000],[-223.157813,76.518281],[-225.004961,76.845059],[-226.707500,76.353750],[-230.208438,72.617344],[-234.720000,64.710000],[-239.374375,54.471406],[-242.750000,43.851250],[-244.805625,32.910469],[-245.500000,21.710000],[-251.823281,20.041875],[-257.521250,17.402500],[-268.500000,10.710000],[-266.088594,6.411875],[-263.271250,2.950000],[-256.460000,-3.460000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-70.500000,-140.620000],[-80.733750,-133.505000],[-90.180000,-125.850000],[-97.510000,-116.290000],[-111.510000,-100.300000],[-130.500000,-83.710000],[-142.500000,-74.290000],[-135.731230,-75.601934],[-128.651094,-77.600469],[-114.118750,-83.148750],[-100.027031,-89.917656],[-87.500000,-96.890000],[-78.500000,-101.683750],[-70.670000,-106.500000],[-64.379219,-114.040937],[-56.793750,-124.685000],[-48.081406,-136.326562],[-38.410000,-146.860000],[-30.811250,-153.128750],[-22.500000,-158.400000],[-16.387500,-161.116250],[-10.500000,-164.290000],[-18.257988,-163.674473],[-26.148281,-162.069531],[-34.067871,-159.635137],[-41.913750,-156.531250],[-56.972344,-148.954844],[-70.500000,-140.620000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule mario(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-112.818750,-165.015000],[-105.159844,-180.784531],[-94.567500,-198.238750],[-82.608281,-214.716094],[-76.605645,-221.756699],[-70.848750,-227.555000],[-63.364844,-233.567031],[-54.657500,-239.403750],[-37.018750,-249.265000],[-28.597969,-253.185000],[-18.942500,-256.977500],[-9.075156,-259.851250],[-0.018750,-261.015000],[12.981250,-261.015000],[22.195000,-260.093750],[30.981250,-257.005000],[38.314102,-253.440117],[44.955312,-249.045312],[50.863867,-243.887852],[55.998750,-238.035000],[60.318945,-231.554023],[63.783437,-224.512187],[66.351211,-216.976758],[67.981250,-209.015000],[73.427500,-212.536250],[77.981250,-215.885000],[82.402500,-218.100000],[86.561250,-220.525000],[95.636250,-229.051250],[100.376250,-232.015469],[107.981250,-234.345000],[113.121562,-234.915312],[118.788750,-234.625000],[124.302188,-233.442187],[128.981250,-231.335000],[134.041250,-227.230000],[139.071250,-223.725000],[146.848750,-221.982500],[152.785000,-220.397812],[159.981250,-217.525000],[165.471328,-214.430820],[170.639375,-210.570937],[175.362109,-206.046836],[179.516250,-200.960000],[182.978516,-195.411914],[185.625625,-189.504062],[187.334297,-183.337930],[187.981250,-177.015000],[187.384844,-166.160781],[185.325000,-155.716250],[181.778281,-145.671094],[176.721250,-136.015000],[165.001250,-120.015000],[164.113750,-116.689844],[163.436250,-112.253750],[162.008750,-107.095781],[158.871250,-101.605000],[154.069688,-96.899062],[149.416250,-94.025000],[145.250313,-91.533437],[141.911250,-87.975000],[139.958594,-83.362969],[139.250000,-78.656250],[138.801250,-69.015000],[136.420000,-60.361250],[132.861250,-52.015000],[129.647344,-47.038281],[126.147500,-43.183750],[122.439531,-39.244844],[118.601250,-34.015000],[109.521250,-16.015000],[101.459219,-3.807031],[92.365000,8.321250],[82.713906,20.031406],[72.981250,30.985000],[76.986250,34.753750],[80.991250,38.005000],[84.559844,39.392656],[87.347500,39.956250],[90.954531,41.789219],[96.981250,46.985000],[98.885547,42.841582],[101.646250,39.007656],[105.098828,35.530215],[109.078750,32.456250],[117.962500,27.706719],[126.981250,25.135000],[143.981250,25.135000],[151.642812,26.030625],[159.006250,28.550000],[165.814687,32.396875],[171.811250,37.275000],[175.618750,41.343750],[179.981250,45.465000],[189.052500,52.257500],[193.097344,56.160938],[196.181250,60.985000],[197.497500,65.545781],[198.018750,70.763750],[197.981250,80.985000],[197.571094,86.245664],[196.526250,91.718437],[192.926250,102.870000],[187.968750,113.579062],[182.441250,122.985000],[172.291250,135.985000],[169.881250,143.985000],[165.936719,154.197031],[163.381738,159.310137],[160.345000,164.061250],[156.756543,168.175332],[152.546406,171.377344],[147.644629,173.392246],[141.981250,173.945000],[137.238438,173.191250],[133.768750,171.807500],[130.655312,170.345000],[126.981250,169.355000],[111.981250,169.945000],[103.875156,168.496094],[95.065000,165.066250],[87.212969,160.085781],[84.165684,157.148535],[81.981250,153.985000],[79.981250,153.985000],[75.927813,159.810938],[70.428750,164.495000],[57.981250,171.975000],[45.714687,178.091875],[32.426250,182.780000],[18.665312,185.818125],[4.981250,186.985000],[-12.135000,187.200000],[-20.701094,186.627813],[-29.018750,184.985000],[-30.722500,196.878750],[-32.490781,202.525156],[-35.208750,207.985000],[-39.375000,213.043750],[-41.113594,214.893906],[-42.438750,217.075000],[-44.308750,226.636250],[-46.156875,233.897969],[-49.508750,241.815000],[-51.598398,244.800586],[-54.542813,247.804688],[-62.128750,253.477500],[-70.532188,258.051562],[-78.018750,260.745000],[-85.838750,261.015000],[-94.018750,260.745000],[-102.282188,259.986250],[-109.373750,257.765000],[-116.037813,254.366250],[-123.018750,250.075000],[-128.576250,247.257500],[-133.833750,245.145000],[-138.836250,242.470000],[-143.628750,237.965000],[-146.639531,233.070938],[-148.590000,227.545000],[-149.657344,221.734063],[-150.018750,215.985000],[-149.872656,203.377187],[-148.820000,190.475000],[-146.366719,177.827813],[-144.460449,171.771523],[-142.018750,165.985000],[-149.534941,164.300898],[-157.273906,161.429688],[-164.981230,157.526758],[-172.402500,152.747500],[-179.283301,147.247305],[-185.369219,141.181563],[-190.405840,134.705664],[-194.138750,127.975000],[-196.158281,122.183281],[-197.357500,116.193750],[-198.018750,103.985000],[-197.495059,98.005625],[-196.086719,91.272500],[-193.846582,84.213125],[-190.827500,77.255000],[-187.082324,70.825625],[-182.663906,65.352500],[-177.625098,61.263125],[-172.018750,58.985000],[-171.406895,53.994531],[-170.095781,49.635000],[-168.129590,45.849219],[-165.552500,42.580000],[-162.408691,39.770156],[-158.742344,37.362500],[-150.018750,33.525000],[-139.018750,30.535000],[-125.018750,20.885000],[-101.018750,9.985000],[-108.062500,7.899785],[-115.014375,4.903906],[-121.699063,1.072012],[-127.941250,-3.521250],[-133.565625,-8.801230],[-138.396875,-14.693281],[-142.259688,-21.122754],[-144.978750,-28.015000],[-147.718750,-51.015000],[-155.838750,-65.015000],[-158.952500,-73.263750],[-160.018750,-82.015000],[-160.020000,-89.063750],[-159.098750,-96.015000],[-157.074199,-101.715410],[-154.116719,-107.236406],[-150.355566,-112.442637],[-145.920000,-117.198750],[-140.939277,-121.369395],[-135.542656,-124.819219],[-129.859395,-127.412871],[-124.018750,-129.015000],[-122.597813,-137.224687],[-119.618750,-147.060000],[-112.818750,-165.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[52.711250,-213.015000],[49.047500,-221.901250],[46.789531,-225.982031],[43.771250,-230.015000],[38.713750,-234.818750],[32.981250,-238.475000],[29.048750,-241.088750],[24.981250,-243.335000],[20.067500,-244.561250],[14.981250,-245.285000],[2.384063,-246.160781],[-8.336250,-244.866250],[-18.647812,-241.526094],[-30.018750,-236.265000],[-45.928750,-227.555000],[-53.602031,-221.604844],[-61.820000,-213.891250],[-69.507344,-205.624531],[-75.588750,-198.015000],[-82.398750,-187.015000],[-89.268750,-177.015000],[-98.208750,-159.695000],[-106.158750,-142.015000],[-117.018750,-103.015000],[-117.941250,-109.537500],[-117.018750,-116.015000],[-123.288750,-114.855000],[-129.007500,-112.185625],[-134.056875,-108.266562],[-138.318750,-103.357500],[-141.675000,-97.718125],[-144.007500,-91.608125],[-145.198125,-85.287188],[-145.128750,-79.015000],[-144.376250,-74.339531],[-142.993750,-69.856250],[-140.651250,-65.952344],[-137.018750,-63.015000],[-130.305469,-71.001406],[-121.990000,-77.908750],[-117.345996,-80.600645],[-112.438906,-82.594219],[-107.314551,-83.746621],[-102.018750,-83.915000],[-97.488750,-83.137500],[-93.018750,-82.015000],[-82.002500,-101.790000],[-76.215469,-111.312812],[-69.508750,-120.845000],[-62.845000,-128.785000],[-55.581250,-136.207500],[-40.018750,-149.935000],[-25.855000,-160.990000],[-18.054531,-165.735625],[-10.018750,-169.015000],[-11.483281,-173.984375],[-13.387500,-177.630000],[-15.394844,-180.968125],[-17.168750,-185.015000],[-18.006250,-190.443750],[-18.018750,-196.015000],[-17.645000,-201.705000],[-16.483750,-206.502500],[-14.452500,-211.056250],[-11.468750,-216.015000],[-7.135000,-221.610000],[-1.848750,-226.305000],[2.086094,-228.486719],[6.695000,-230.191250],[15.981250,-231.925000],[23.587773,-231.349941],[30.496562,-228.905156],[36.612695,-224.894980],[41.841250,-219.623750],[46.087305,-213.395801],[49.255937,-206.515469],[51.252227,-199.287090],[51.981250,-192.015000],[56.981250,-192.015000],[56.863906,-198.395625],[56.312500,-202.792500],[52.711250,-213.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[45.381250,-190.865000],[46.425293,-192.528262],[46.865469,-194.781094],[46.387500,-200.293750],[44.853906,-205.879531],[43.171250,-210.015000],[40.838379,-213.864121],[37.901406,-217.376094],[34.456543,-220.467832],[30.600000,-223.056250],[26.427988,-225.058262],[22.036719,-226.390781],[17.522402,-226.970723],[12.981250,-226.715000],[7.344219,-225.241016],[2.231250,-222.741875],[-2.277969,-219.356797],[-6.103750,-215.225000],[-9.166406,-210.485703],[-11.386250,-205.278125],[-12.683594,-199.741484],[-12.978750,-194.015000],[-12.352031,-189.263281],[-10.837500,-183.181250],[-8.556094,-177.543594],[-7.165605,-175.445996],[-5.628750,-174.125000],[-2.230781,-173.759844],[1.950000,-174.998750],[8.981250,-179.015000],[-0.248750,-182.575000],[-0.978750,-193.015000],[-0.978750,-208.015000],[-0.018750,-217.015000],[15.981250,-206.015000],[17.222969,-210.406406],[19.082500,-215.008750],[21.641406,-219.114219],[24.981250,-222.015000],[35.671250,-204.295000],[41.321250,-195.015000],[38.981250,-189.015000],[42.357500,-189.426250],[45.381250,-190.865000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[144.981250,-129.575000],[148.954063,-131.571875],[152.418750,-134.210000],[158.311250,-140.735000],[164.419375,-150.222812],[169.008750,-161.250000],[170.405781,-167.035586],[171.029375,-172.839687],[170.748281,-178.540195],[169.431250,-184.015000],[165.667344,-191.543281],[160.350000,-197.628750],[153.710781,-202.317344],[145.981250,-205.655000],[133.981250,-208.485000],[128.356094,-211.930937],[122.077500,-215.997500],[118.569824,-217.327773],[114.750781,-217.690313],[110.571035,-216.710820],[105.981250,-214.015000],[112.951094,-211.512187],[119.612500,-208.595000],[125.338281,-204.387812],[127.654316,-201.526836],[129.501250,-198.015000],[130.572500,-194.458125],[130.923750,-191.505000],[131.143750,-188.806875],[131.821250,-186.015000],[134.223281,-180.750000],[135.557500,-178.320000],[135.813594,-175.237500],[134.981250,-168.015000],[141.992656,-166.133281],[147.760000,-165.043750],[153.637969,-165.189844],[160.981250,-167.015000],[159.132051,-163.936270],[156.860156,-161.452031],[154.230371,-159.542715],[151.307500,-158.188750],[144.841719,-157.068594],[137.981250,-157.935000],[132.413750,-159.926250],[129.555000,-160.698281],[126.981250,-160.665000],[124.230000,-159.282031],[120.758750,-156.801250],[113.981250,-151.895000],[107.174375,-148.510313],[98.901250,-145.262500],[90.418125,-142.610938],[82.981250,-141.015000],[83.106562,-135.065781],[84.126250,-130.688750],[85.294336,-129.118223],[87.073438,-127.974844],[92.981250,-127.015000],[98.587187,-126.837656],[103.748750,-126.181250],[108.734062,-124.724219],[113.811250,-122.145000],[130.981250,-109.615000],[135.409219,-109.261250],[139.900000,-110.752500],[143.818906,-113.530000],[146.531250,-117.035000],[147.668750,-120.446250],[147.981250,-124.015000],[139.548906,-123.091094],[131.267500,-123.786250],[127.404004,-124.973887],[123.842969,-126.845781],[120.672637,-129.495098],[117.981250,-133.015000],[124.517500,-130.397656],[131.233750,-128.568750],[138.073750,-128.102969],[144.981250,-129.575000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[116.881250,-199.375000],[110.941250,-202.361719],[103.283750,-204.008750],[95.450000,-204.191406],[88.981250,-202.785000],[85.636250,-200.808750],[82.981250,-198.015000],[108.981250,-195.775000],[121.981250,-192.015000],[119.945000,-196.040000],[116.881250,-199.375000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[20.981250,-187.015000],[9.981250,-195.015000],[10.981250,-179.015000],[31.981250,-186.015000],[25.981250,-200.015000],[20.981250,-187.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[70.981250,-188.015000],[62.960312,-187.304688],[53.921250,-185.662500],[36.981250,-181.435000],[22.692187,-177.086562],[8.671250,-171.930000],[-4.944688,-165.805937],[-18.018750,-158.555000],[-30.018750,-150.355000],[-39.397031,-143.611406],[-49.567500,-135.136250],[-58.963594,-125.935469],[-66.018750,-117.015000],[-58.064180,-115.076680],[-49.956563,-114.792813],[-41.783789,-115.865039],[-33.633750,-117.995000],[-17.753438,-124.234688],[-3.018750,-131.125000],[8.981250,-136.365000],[19.981250,-142.905000],[36.981250,-150.795000],[48.981250,-157.645000],[58.981250,-161.825000],[67.981250,-166.555000],[80.981250,-170.725000],[92.365781,-173.834062],[101.677500,-175.760000],[111.141094,-176.740937],[122.981250,-177.015000],[118.455742,-181.330410],[112.710312,-184.393906],[106.072852,-186.411387],[98.871250,-187.588750],[84.087187,-188.246719],[70.981250,-188.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[56.981250,-152.235000],[53.751719,-152.056094],[49.880000,-150.691250],[42.981250,-147.265000],[19.981250,-135.265000],[12.617500,-131.672500],[9.115156,-129.586562],[5.981250,-127.015000],[9.767402,-125.187090],[12.996094,-122.265469],[15.690176,-118.504551],[17.872500,-114.158750],[20.793281,-104.730156],[21.941250,-96.015000],[21.583750,-88.817500],[20.338125,-85.476563],[17.851250,-83.045000],[15.764238,-82.298086],[13.798281,-82.332812],[10.305000,-84.180000],[7.522344,-87.452187],[5.601250,-91.015000],[2.417188,-99.419844],[0.491250,-107.763750],[0.215312,-116.233281],[1.981250,-125.015000],[-2.108906,-123.947500],[-5.285000,-122.587500],[-12.018750,-119.245000],[-22.691094,-115.016875],[-35.230000,-111.002500],[-47.913281,-108.551875],[-53.770879,-108.334844],[-59.018750,-109.015000],[-57.648125,-102.849844],[-54.833750,-95.948750],[-51.059375,-89.570781],[-46.808750,-84.975000],[-36.767500,-79.022500],[-34.139707,-76.859961],[-32.041719,-74.335313],[-30.761934,-71.402383],[-30.588750,-68.015000],[-31.564844,-64.735312],[-33.245000,-62.102500],[-37.168750,-57.015000],[-39.216250,-52.145000],[-40.301875,-49.744687],[-42.238750,-47.125000],[-44.663423,-44.980906],[-47.199102,-43.622246],[-49.820151,-42.975706],[-52.500937,-42.967969],[-57.939180,-44.575645],[-63.308750,-47.858750],[-68.404570,-52.230762],[-73.021563,-57.105156],[-79.998750,-66.015000],[-83.387500,-70.483750],[-88.028750,-73.685000],[-95.865684,-76.326914],[-103.689844,-76.814687],[-111.191270,-75.353867],[-118.060000,-72.150000],[-123.986074,-67.408633],[-128.659531,-61.335312],[-131.770410,-54.135586],[-133.008750,-46.015000],[-132.659492,-39.562305],[-131.345313,-33.487188],[-129.116602,-27.857852],[-126.023750,-22.742500],[-122.117148,-18.209336],[-117.447188,-14.326562],[-112.064258,-11.162383],[-106.018750,-8.785000],[-100.377500,-7.533906],[-94.616250,-7.011250],[-83.018750,-7.015000],[-75.977188,-7.792812],[-70.306250,-9.232500],[-65.741562,-10.285937],[-62.018750,-9.905000],[-59.489219,-8.241250],[-56.640000,-5.632500],[-51.598750,-0.445000],[-44.063750,6.168750],[-36.018750,12.055000],[-25.253984,18.041152],[-14.396875,22.815469],[-3.495703,26.142988],[7.401250,27.788750],[18.245703,27.517793],[28.989375,25.095156],[39.583984,20.285879],[49.981250,12.855000],[57.568750,5.827500],[60.334063,2.063438],[62.981250,-3.015000],[58.426875,-1.533125],[55.376250,0.905000],[49.691250,7.945000],[42.743750,14.351250],[34.971250,19.715000],[31.077500,21.481250],[26.981250,22.655000],[20.486836,22.883438],[15.484687,21.246250],[11.781445,18.095937],[9.183750,13.785000],[7.498242,8.665937],[6.531562,3.091250],[5.981250,-8.015000],[3.981250,-28.015000],[-0.585586,-29.161836],[-4.647812,-31.435312],[-8.159258,-34.626133],[-11.073750,-38.525000],[-13.345117,-42.922617],[-14.927188,-47.609687],[-15.773789,-52.376914],[-15.838750,-57.015000],[-15.229688,-61.377031],[-13.831250,-66.433750],[-11.476563,-70.828594],[-9.888477,-72.353887],[-7.998750,-73.205000],[-5.568906,-73.112031],[-2.855000,-72.168750],[1.981250,-69.595000],[11.685000,-64.480000],[21.981250,-60.685000],[30.302500,-58.516094],[35.646250,-57.988750],[39.407500,-58.014531],[42.981250,-57.505000],[45.960156,-56.208750],[48.985000,-54.305000],[54.981250,-50.415000],[59.770000,-48.316875],[65.203750,-46.620000],[70.776250,-45.470625],[75.981250,-45.015000],[88.650000,-45.168750],[95.211719,-45.801094],[100.981250,-47.115000],[106.252363,-49.483633],[110.894531,-52.732813],[114.879746,-56.724961],[118.180000,-61.322500],[120.767285,-66.387852],[122.613594,-71.783437],[123.690918,-77.371680],[123.971250,-83.015000],[123.471797,-87.959688],[122.236875,-92.889375],[120.312891,-97.662500],[117.746250,-102.137500],[114.583359,-106.172813],[110.870625,-109.626875],[106.654453,-112.358125],[101.981250,-114.225000],[97.628437,-114.858906],[91.758750,-115.088750],[80.981250,-115.015000],[74.647754,-114.273535],[69.112656,-112.400156],[64.256543,-109.673887],[59.960000,-106.373750],[52.567969,-99.167969],[45.981250,-93.015000],[47.852969,-99.027969],[50.320000,-103.281250],[52.710156,-106.651406],[54.351250,-110.015000],[54.575156,-112.481719],[54.117500,-115.026250],[52.661250,-120.015000],[51.968750,-126.462500],[51.981250,-133.015000],[52.360156,-136.729219],[53.602500,-140.393750],[56.024219,-142.871406],[57.776074,-143.309785],[59.941250,-143.025000],[62.876270,-141.519609],[64.965781,-139.181250],[67.625000,-133.102500],[69.952344,-126.982500],[71.627012,-124.592578],[73.981250,-123.015000],[72.420469,-130.845937],[68.702500,-139.980000],[66.205371,-144.260508],[63.373906,-147.936562],[60.276426,-150.698086],[56.981250,-152.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.981250,-126.015000],[2.981250,-125.015000],[2.981250,-126.015000],[1.981250,-126.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-69.018750,-110.015000],[-76.647500,-98.086250],[-80.422031,-91.189531],[-82.168750,-86.015000],[-81.904375,-83.155781],[-80.961250,-80.286250],[-78.208750,-75.015000],[-71.085000,-64.470000],[-66.991094,-59.968125],[-62.018750,-55.455000],[-57.326250,-51.832500],[-54.647188,-50.310937],[-52.018750,-49.515000],[-49.403184,-49.601133],[-47.594219,-50.460938],[-46.423457,-51.894023],[-45.722500,-53.700000],[-45.056406,-57.629062],[-44.248750,-60.645000],[-40.148750,-64.627500],[-38.545000,-67.341563],[-38.360000,-69.019570],[-38.778750,-70.965000],[-40.772969,-73.847813],[-43.790000,-75.517500],[-47.836406,-77.678437],[-52.918750,-82.035000],[-56.913438,-87.630313],[-61.056250,-95.327500],[-64.655313,-103.373437],[-67.018750,-110.015000],[-69.018750,-110.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[59.981250,-38.915000],[55.726719,-41.292812],[52.517500,-43.665000],[49.790156,-45.752187],[46.981250,-47.275000],[41.601250,-48.021250],[35.981250,-48.055000],[29.443750,-48.907500],[22.981250,-50.405000],[3.981250,-58.775000],[-0.162500,-60.711250],[-2.477656,-61.273906],[-4.418750,-60.885000],[-5.534844,-59.261406],[-5.997500,-56.783750],[-6.008750,-52.015000],[-5.419531,-47.221875],[-3.830000,-43.295000],[-1.079844,-40.073125],[2.991250,-37.395000],[7.490000,-35.593750],[11.381250,-33.455000],[12.416406,-31.776406],[12.852500,-29.911250],[13.191250,-26.015000],[14.706250,-21.366250],[17.511250,-17.355000],[21.340625,-14.543594],[25.691250,-13.238750],[30.319375,-13.132031],[34.981250,-13.915000],[38.792500,-15.072500],[42.401250,-15.735000],[44.865000,-14.896719],[47.006250,-13.573750],[50.490000,-12.406406],[56.981250,-12.035000],[62.694375,-12.941406],[66.258750,-14.838750],[68.934375,-17.079219],[71.981250,-19.015000],[76.057500,-19.243750],[80.981250,-19.015000],[86.648906,-20.720312],[90.255000,-23.882500],[92.224219,-28.360938],[92.981250,-34.015000],[84.635625,-34.122500],[76.188750,-34.710000],[67.888125,-36.175000],[59.981250,-38.915000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-79.058750,-34.015000],[-80.452656,-28.253594],[-83.677500,-23.946250],[-88.332969,-21.005781],[-94.018750,-19.345000],[-99.645000,-19.041250],[-102.002031,-19.956719],[-104.018750,-22.015000],[-98.891250,-22.981406],[-93.666250,-25.021250],[-89.427500,-28.307969],[-88.016641,-30.473105],[-87.258750,-33.015000],[-87.346250,-35.973750],[-88.618750,-38.625000],[-91.650312,-40.930000],[-94.871250,-41.877500],[-98.065938,-43.046250],[-101.018750,-46.015000],[-93.018750,-46.015000],[-98.521406,-51.007969],[-103.462500,-53.731250],[-107.681719,-56.096406],[-109.470527,-57.742051],[-111.018750,-60.015000],[-99.494375,-58.036562],[-93.991172,-56.128477],[-88.993750,-53.495000],[-84.751953,-50.051523],[-81.515625,-45.713437],[-79.534609,-40.396133],[-79.058750,-34.015000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.611250,-9.025000],[69.941250,1.985000],[54.981250,20.985000],[58.673125,20.242656],[61.656250,18.376250],[66.981250,12.985000],[77.652500,2.103750],[82.437344,-3.553906],[86.981250,-10.015000],[77.611250,-9.025000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[40.981250,-7.305000],[26.981250,-5.125000],[11.981250,-9.015000],[12.099687,-2.003281],[13.131250,5.978750],[14.306445,9.664199],[16.090313,12.788906],[18.609648,15.085098],[21.991250,16.285000],[26.002793,16.213359],[30.119219,15.003125],[34.196973,12.871328],[38.092500,10.035000],[44.762656,3.116875],[48.981250,-4.015000],[40.981250,-7.305000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-77.018750,2.985000],[-62.018750,3.985000],[-66.018750,-2.015000],[-77.018750,2.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-98.018750,52.235000],[-92.747500,56.225000],[-89.883594,57.806563],[-87.018750,58.115000],[-84.274844,56.901250],[-81.275000,54.720000],[-76.018750,50.185000],[-70.243750,46.356250],[-64.018750,43.285000],[-55.090000,38.765000],[-50.790156,36.023125],[-47.128750,32.895000],[-44.687500,29.797500],[-43.985781,27.984375],[-43.978750,26.025000],[-45.149629,23.737109],[-47.394531,21.900625],[-53.935000,19.415000],[-61.257344,18.234375],[-67.018750,18.025000],[-81.569688,19.879844],[-97.656250,24.298750],[-105.461523,27.403809],[-112.674063,31.070781],[-118.968320,35.273301],[-124.018750,39.985000],[-98.018750,52.235000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-36.248750,33.945000],[-39.328809,36.806953],[-43.496719,39.757500],[-53.597500,45.772500],[-63.553906,51.686250],[-67.541348,54.510234],[-70.368750,57.195000],[-74.913750,67.087500],[-79.098750,77.985000],[-79.976250,81.946250],[-79.886250,83.937656],[-79.098750,85.885000],[-77.135469,88.131406],[-74.200000,90.093750],[-68.018750,92.765000],[-59.580313,94.590000],[-51.068750,94.622500],[-42.782188,92.753750],[-35.018750,88.875000],[-31.634785,86.183926],[-28.660156,82.944531],[-23.982500,75.248750],[-21.072969,66.643594],[-20.018750,57.985000],[-20.450938,48.671719],[-22.276250,39.473750],[-23.860742,35.118105],[-25.972813,31.031406],[-28.672227,27.293691],[-32.018750,23.985000],[-33.526250,29.066250],[-34.429062,31.346719],[-36.248750,33.945000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[55.981250,35.985000],[50.212500,30.232500],[47.061406,28.208438],[42.981250,26.985000],[46.940625,33.132813],[51.871250,39.177500],[55.856875,45.375938],[56.896484,48.613086],[56.981250,51.985000],[69.981250,51.985000],[67.253750,47.593594],[63.693750,43.493750],[55.981250,35.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[5.981250,37.125000],[1.027344,35.244531],[-6.207500,33.293750],[-19.018750,30.985000],[-17.859219,37.319375],[-16.215000,41.880000],[-14.722656,46.493125],[-14.018750,52.985000],[-14.570703,61.661777],[-16.416875,70.086719],[-19.527734,77.985488],[-23.873750,85.083750],[-29.425391,91.107168],[-36.153125,95.781406],[-44.027422,98.832129],[-53.018750,99.985000],[-61.163906,99.782812],[-67.555000,98.757500],[-73.677969,96.595937],[-81.018750,92.985000],[-77.448750,107.985000],[-76.881250,111.746250],[-76.301250,113.588906],[-75.278750,115.005000],[-64.018750,118.965000],[-57.850000,122.348750],[-52.108750,126.295000],[-47.738750,130.255000],[-40.018750,133.785000],[-34.608125,137.521875],[-31.248750,141.630000],[-29.539375,146.615625],[-29.078750,152.985000],[-29.078750,162.985000],[-28.450313,167.567188],[-27.521680,168.896523],[-26.226250,169.755000],[-22.663437,170.570313],[-18.018750,171.035000],[-10.018750,172.655000],[-2.176250,172.390000],[5.981250,171.405000],[17.008633,169.518184],[27.581562,166.990469],[37.629961,163.672207],[47.083750,159.413750],[55.872852,154.065449],[63.927187,147.477656],[71.176680,139.500723],[77.551250,129.985000],[80.594844,123.948906],[83.945000,115.821250],[86.378281,107.567969],[86.868770,104.008574],[86.671250,101.155000],[85.507500,98.726250],[83.518750,96.440000],[81.001250,93.718750],[78.251250,89.985000],[74.744062,83.285156],[71.808750,75.513750],[69.777187,67.477969],[68.981250,59.985000],[52.981250,59.165000],[41.941250,61.855000],[31.981250,62.985000],[38.204531,68.310625],[42.655000,75.027500],[45.041094,82.723125],[45.368887,86.809062],[45.071250,90.985000],[43.759863,95.906836],[41.425781,100.464687],[38.230371,104.523320],[34.335000,107.947500],[29.901035,110.601992],[25.089844,112.351563],[20.062793,113.060977],[14.981250,112.595000],[9.715000,110.490000],[4.981250,107.305000],[1.447302,104.135647],[-1.324238,100.748926],[-3.377917,97.197468],[-4.758281,93.533906],[-5.677246,86.080996],[-4.437500,78.811250],[-1.395410,72.145723],[3.092656,66.505469],[8.670332,62.311543],[14.981250,59.985000],[14.981250,54.985000],[19.981250,54.985000],[17.941406,49.937344],[14.560000,44.836250],[10.389219,40.344531],[5.981250,37.125000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[16.981250,36.985000],[25.981250,49.985000],[47.981250,45.985000],[36.981250,31.985000],[16.981250,36.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[105.121250,70.985000],[105.121250,85.985000],[104.758281,92.400313],[103.875000,95.802500],[102.419844,98.795938],[100.341250,103.985000],[98.101250,112.985000],[96.296250,121.037500],[93.921250,128.985000],[91.961250,133.891250],[91.390000,136.464844],[91.621250,138.985000],[93.502266,142.377891],[96.683125,145.377500],[100.823047,147.936484],[105.581250,150.007500],[115.589375,152.496250],[120.157734,152.819297],[123.981250,152.465000],[128.273809,151.192988],[131.792344,149.413906],[134.673145,147.179434],[137.052500,144.541250],[140.852031,138.260469],[144.281250,130.985000],[149.981250,118.985000],[155.976094,105.686719],[162.405000,89.983750],[164.970996,81.904043],[166.672031,74.031406],[167.183613,66.635254],[166.181250,59.985000],[164.825312,56.677969],[162.901250,53.583750],[157.971250,48.315000],[153.675000,45.263750],[148.981250,42.865000],[145.352344,41.632031],[142.075000,41.108750],[134.981250,41.175000],[127.981250,41.175000],[123.410117,43.004277],[119.282187,45.620469],[115.620664,48.901113],[112.448750,52.723750],[109.789648,56.965918],[107.666563,61.505156],[105.121250,70.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.188750,68.985000],[-94.394375,65.773125],[-97.376250,62.865000],[-104.018750,58.185000],[-112.399688,53.539688],[-120.283750,50.355000],[-128.535313,48.535313],[-138.018750,47.985000],[-144.096250,48.533906],[-148.741250,50.411250],[-152.025000,54.075469],[-154.018750,59.985000],[-148.018750,60.985000],[-148.018750,63.985000],[-154.161719,64.708281],[-158.897500,66.298750],[-163.196406,68.899844],[-168.028750,72.655000],[-172.286328,76.452734],[-175.695000,80.287500],[-178.338672,84.229141],[-180.301250,88.347500],[-182.518750,97.393750],[-183.018750,107.985000],[-182.202500,115.680000],[-179.638750,122.985000],[-177.227930,127.037637],[-174.154063,131.001094],[-166.533750,138.363750],[-157.810938,144.479531],[-149.018750,148.755000],[-143.691738,150.397363],[-137.767656,151.551406],[-131.538184,152.070059],[-125.295000,151.806250],[-119.329785,150.612910],[-113.934219,148.342969],[-109.399980,144.849355],[-106.018750,139.985000],[-113.018750,138.985000],[-114.424531,141.719375],[-116.180000,142.852500],[-117.989844,142.286875],[-119.558750,139.925000],[-119.996250,137.709687],[-119.758750,135.372500],[-118.218750,130.985000],[-114.542500,124.327500],[-112.153594,120.955625],[-109.838750,118.615000],[-107.098750,117.465469],[-105.048750,118.036250],[-104.123750,119.988906],[-104.758750,122.985000],[-108.018750,128.985000],[-102.018750,128.985000],[-97.940000,128.783750],[-94.018750,127.675000],[-90.238223,124.913750],[-87.615156,121.155000],[-86.031074,116.672500],[-85.367500,111.740000],[-85.505957,106.631250],[-86.327969,101.620000],[-87.715059,96.980000],[-89.548750,92.985000],[-92.495781,88.563906],[-95.972500,84.316250],[-103.018750,75.985000],[-91.018750,79.985000],[-91.033750,74.353750],[-91.364688,71.512344],[-92.188750,68.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[77.431250,61.275000],[77.425156,66.240938],[78.800000,72.697500],[82.711250,83.985000],[85.031250,88.592500],[86.772500,90.549375],[88.971250,91.355000],[90.346875,91.068457],[91.371875,90.288906],[92.568750,87.731250],[92.941250,81.985000],[91.730469,75.006094],[88.932500,68.198750],[84.898906,62.034531],[79.981250,56.985000],[78.451250,58.976250],[77.431250,61.275000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.061250,85.985000],[1.559238,90.070000],[2.973281,94.012500],[5.183496,97.651250],[8.070000,100.825000],[11.512910,103.372500],[15.392344,105.132500],[19.588418,105.943750],[23.981250,105.645000],[28.882500,103.553750],[32.891250,99.985000],[37.152500,94.987500],[38.692031,92.183125],[39.651250,88.985000],[39.916543,84.226074],[39.062344,79.696719],[37.223535,75.539316],[34.535000,71.896250],[31.131621,68.909902],[27.148281,66.722656],[22.719863,65.476895],[17.981250,65.315000],[14.721914,66.421777],[11.616562,68.107344],[6.213750,72.901250],[2.464687,79.069531],[1.426523,82.473066],[1.061250,85.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[168.671250,89.985000],[153.241250,122.985000],[145.671250,139.985000],[136.981250,152.985000],[140.804141,153.204434],[143.988125,151.991719],[146.616172,149.656582],[148.771250,146.508750],[151.994375,139.013906],[154.321250,131.985000],[156.922188,126.230469],[159.821250,122.008750],[163.020312,118.025156],[166.521250,112.985000],[172.746250,100.296250],[177.891250,86.985000],[179.435000,81.321406],[180.093750,75.388750],[179.173750,69.754219],[177.904922,67.225996],[175.981250,64.985000],[168.671250,89.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-153.638750,88.985000],[-156.643750,98.757500],[-159.204688,103.663438],[-162.228750,106.805000],[-165.364219,107.629531],[-168.202500,106.763750],[-170.138906,104.463594],[-170.568750,100.985000],[-169.035313,96.277344],[-166.011250,90.736250],[-162.353438,85.579531],[-158.918750,82.025000],[-155.413438,81.717500],[-153.683750,83.052500],[-153.251563,85.613750],[-153.638750,88.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-131.598750,98.985000],[-132.636250,103.991719],[-134.213750,109.271250],[-136.841250,113.825156],[-138.708125,115.517988],[-141.028750,116.655000],[-142.983555,116.982188],[-144.687813,116.715000],[-147.268750,114.780000],[-148.619688,111.615000],[-148.588750,107.985000],[-146.710938,103.114688],[-143.421250,98.122500],[-139.332813,93.801562],[-135.058750,90.945000],[-132.058594,91.710469],[-130.925000,93.483750],[-130.993281,95.997656],[-131.598750,98.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-65.838750,177.985000],[-63.258750,152.985000],[-61.150156,147.122656],[-59.102500,143.188750],[-58.020469,140.175469],[-58.808750,137.075000],[-62.011250,133.743125],[-66.976250,130.715000],[-72.410000,128.766875],[-77.018750,128.675000],[-81.522500,131.412500],[-86.018750,134.885000],[-90.772500,137.635000],[-92.896719,139.098125],[-94.978750,141.195000],[-99.033750,146.508750],[-104.018750,151.695000],[-108.636250,155.375000],[-112.488750,159.355000],[-115.468750,173.985000],[-117.765000,188.428750],[-119.108750,202.985000],[-120.018750,212.985000],[-119.792500,223.837500],[-118.658906,228.976875],[-116.168750,233.985000],[-111.779707,238.963223],[-106.318281,242.747656],[-100.093027,245.319199],[-93.412500,246.658750],[-86.585254,246.747207],[-79.919844,245.565469],[-73.724824,243.094434],[-68.308750,239.315000],[-64.880664,235.593242],[-62.313437,231.500937],[-60.482617,227.106289],[-59.263750,222.477500],[-58.164063,212.790313],[-58.018750,202.985000],[-52.545625,201.865000],[-49.326250,199.320000],[-47.505625,195.357500],[-46.228750,189.985000],[-43.877500,173.082500],[-43.018750,155.985000],[-43.052500,152.446250],[-43.618750,149.035000],[-45.597656,146.224844],[-48.477500,144.718750],[-51.722969,144.688281],[-54.798750,146.305000],[-56.650781,148.537656],[-57.982500,151.236250],[-59.568750,156.985000],[-61.168750,167.985000],[-63.018750,185.985000],[-65.018750,185.985000],[-65.838750,177.985000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-122.458750,163.005000],[-124.211250,165.457969],[-126.023750,169.511250],[-128.688750,176.985000],[-132.041563,188.304688],[-133.648750,197.305000],[-134.108438,206.395312],[-134.018750,217.985000],[-133.772969,222.349219],[-132.840000,225.793750],[-130.746406,228.583906],[-127.018750,230.985000],[-127.928594,219.820469],[-127.337500,207.473750],[-125.732031,195.132656],[-123.598750,183.985000],[-120.660000,173.217500],[-119.550156,168.150625],[-119.018750,161.985000],[-120.791250,162.258750],[-122.458750,163.005000]]);\r\n }\r\n }\r\n}\r\n\r\nmodule luigi(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-121.994375,-401.674766],[-112.908594,-402.996797],[-104.035625,-403.498516],[-85.994375,-403.484766],[-81.559375,-403.564766],[-79.370938,-404.021953],[-77.574375,-405.084766],[-74.741875,-411.756016],[-72.134375,-419.484766],[-65.099375,-434.758516],[-56.984375,-449.484766],[-45.513281,-467.211953],[-39.459512,-475.002930],[-32.993125,-482.162266],[-25.963770,-488.752539],[-18.221094,-494.836328],[-9.614746,-500.476211],[0.005625,-505.734766],[7.348281,-509.083359],[15.044375,-511.838516],[22.971094,-513.729297],[31.005625,-514.484766],[44.312500,-514.515234],[56.783125,-513.873516],[69.115000,-511.932422],[82.005625,-508.064766],[89.683142,-504.841077],[96.966074,-501.124160],[110.417969,-492.340547],[122.500879,-481.973730],[133.354375,-470.283516],[143.118027,-457.529707],[151.931406,-443.972109],[159.934082,-429.870527],[167.265625,-415.484766],[174.754062,-399.391172],[181.625625,-383.021016],[187.822187,-366.382734],[193.285625,-349.484766],[198.240625,-330.138516],[201.725625,-310.484766],[203.605625,-291.694766],[206.484844,-288.862734],[211.931875,-285.088516],[222.005625,-278.474766],[229.735781,-271.800234],[236.664375,-264.446016],[242.698594,-256.358672],[247.745625,-247.484766],[252.009668,-236.709434],[254.552344,-225.637734],[255.479473,-214.403613],[254.896875,-203.141016],[252.910371,-191.983887],[249.625781,-181.066172],[245.148926,-170.521816],[239.585625,-160.484766],[234.559844,-153.077109],[228.396875,-145.818516],[221.193281,-139.893047],[217.231426,-137.800254],[213.045625,-136.484766],[213.045625,-125.484766],[214.005625,-115.484766],[213.390000,-105.894297],[211.360625,-97.231016],[208.003750,-88.944609],[203.405625,-80.484766],[195.356875,-68.473516],[190.632656,-62.528359],[185.995625,-57.654766],[179.549434,-52.429863],[172.597344,-48.006172],[165.224082,-44.351465],[157.514375,-41.433516],[149.552949,-39.220098],[141.424531,-37.678984],[133.213848,-36.777949],[125.005625,-36.484766],[126.690625,-31.131016],[126.965625,-25.484766],[125.822012,-19.659160],[123.122969,-14.366172],[119.167441,-9.690293],[114.254375,-5.716016],[108.682715,-2.527832],[102.751406,-0.210234],[96.759395,1.152285],[91.005625,1.475234],[85.743125,0.778984],[81.005625,0.555234],[78.068750,1.946797],[75.218125,4.270234],[72.011250,6.976172],[68.005625,9.515234],[60.155000,12.037891],[51.370625,12.633984],[42.653750,11.420703],[35.005625,8.515234],[33.005625,19.515234],[39.573184,20.109531],[46.032344,21.650234],[52.374082,23.954062],[58.589375,26.837734],[70.604531,33.611484],[82.005625,40.505234],[91.489062,45.464609],[103.025625,50.757734],[125.005625,59.915234],[139.953125,65.465234],[148.169375,67.978672],[155.005625,69.335234],[159.716250,69.225859],[163.410625,68.122734],[171.005625,64.585234],[179.866875,62.250234],[189.005625,61.535234],[197.241875,62.556484],[205.005625,65.415234],[210.546875,68.893984],[216.005625,71.645234],[219.252187,71.771641],[223.468125,71.223984],[231.005625,69.475234],[241.879961,65.588301],[252.050938,60.887266],[270.975625,50.616484],[280.075742,45.833535],[289.165312,41.810078],[298.417539,38.939512],[308.005625,37.615234],[311.882637,37.809082],[315.439844,38.612891],[321.661875,41.313984],[326.805781,44.245703],[331.005625,45.935234],[339.215625,45.732734],[345.293125,46.641172],[353.005625,49.865234],[359.539062,54.655547],[363.408125,59.447734],[365.923437,63.733672],[368.395625,67.005234],[370.879375,68.585391],[373.835625,69.656484],[377.474375,70.969453],[382.005625,73.275234],[386.194844,76.166641],[389.835625,79.426484],[392.925156,83.033203],[395.460625,86.965234],[397.439219,91.201016],[398.858125,95.718984],[400.005625,105.515234],[400.004375,111.552734],[399.245625,117.515234],[397.166875,123.530234],[396.350156,126.593984],[396.295625,129.515234],[400.105625,140.515234],[401.754219,149.548828],[401.954375,158.453984],[400.337656,167.139766],[396.535625,175.515234],[391.010215,183.302285],[384.794219,189.916641],[377.959238,195.505605],[370.576875,200.216484],[362.718730,204.196582],[354.456406,207.593203],[337.005625,213.225234],[319.700625,217.581484],[310.894375,218.975391],[302.005625,219.515234],[309.995625,234.255234],[312.212187,241.205234],[313.005625,251.515234],[312.916875,260.037734],[311.515625,268.515234],[309.107637,275.211992],[305.755469,281.298672],[301.551816,286.694883],[296.589375,291.320234],[290.960840,295.094336],[284.758906,297.936797],[278.076270,299.767227],[271.005625,300.505234],[263.930625,300.205234],[257.005625,298.735234],[250.094492,295.410313],[244.207812,290.583984],[239.070664,284.643906],[234.408125,277.977734],[225.407187,264.017734],[220.518945,257.499219],[215.005625,251.805234],[186.005625,230.435234],[172.835625,217.545234],[170.586562,217.055859],[167.668125,217.095234],[162.005625,217.545234],[157.003594,217.406172],[152.664375,216.770234],[148.495781,215.399297],[144.005625,213.055234],[138.682402,209.403906],[134.333594,205.613359],[127.859375,198.025234],[123.183281,191.112109],[118.905625,185.695234],[113.820781,182.115391],[106.276875,177.943984],[92.005625,170.515234],[96.005625,207.515234],[96.005625,225.515234],[95.145625,239.150234],[92.425625,252.515234],[90.066875,260.097734],[89.350156,264.113984],[89.755625,267.515234],[92.705312,272.142266],[96.658125,275.078984],[106.005625,279.335234],[111.805625,283.036484],[117.005625,287.555234],[124.826406,295.835078],[128.999375,302.073984],[132.180469,308.543516],[137.025625,317.515234],[148.665625,333.515234],[152.300000,341.419141],[154.220625,349.076484],[154.948750,356.953203],[155.005625,365.515234],[154.622910,371.570781],[153.702656,377.128984],[150.716875,387.287734],[146.982969,397.060234],[143.435625,407.515234],[138.285625,430.515234],[134.951719,439.551016],[129.981875,450.923984],[119.945625,470.515234],[113.170801,479.788262],[104.981406,488.233828],[95.625059,495.726660],[85.349375,502.141484],[74.401973,507.353027],[63.030469,511.236016],[51.482480,513.665176],[40.005625,514.515234],[13.005625,514.515234],[6.356875,513.936016],[-0.711875,512.528984],[-13.994375,508.315234],[-21.106875,505.137734],[-27.994375,502.725234],[-34.324063,502.771797],[-40.996875,504.102734],[-48.168438,505.692422],[-55.994375,506.515234],[-72.906250,506.555078],[-90.391875,505.326484],[-98.951406,503.780371],[-107.176250,501.369766],[-114.907031,497.912207],[-121.984375,493.225234],[-129.399219,486.070391],[-133.243125,479.861484],[-135.975156,473.406953],[-140.054375,465.515234],[-145.811562,457.137266],[-151.116875,450.068984],[-155.953438,442.473828],[-160.304375,432.515234],[-162.485313,424.844414],[-163.655625,417.324297],[-163.867813,409.939648],[-163.174375,402.675234],[-161.627812,395.515820],[-159.280625,388.446172],[-156.185313,381.451055],[-152.394375,374.515234],[-148.105469,368.289297],[-142.735625,362.275234],[-136.595156,357.131172],[-129.994375,353.515234],[-132.144375,347.752891],[-133.574375,341.773984],[-134.134375,335.665703],[-133.674375,329.515234],[-131.196875,321.827734],[-130.279688,317.896797],[-130.774375,314.515234],[-134.353906,310.219766],[-141.043125,303.356484],[-152.954375,291.515234],[-158.795313,284.319609],[-165.301875,274.765234],[-171.317188,264.835859],[-175.684375,256.515234],[-180.856406,242.583672],[-185.080625,226.122734],[-187.934219,209.358047],[-188.994375,194.515234],[-188.994375,177.515234],[-188.004375,163.515234],[-188.497031,156.220078],[-189.868125,151.676484],[-191.304844,147.052266],[-191.994375,139.515234],[-192.089844,128.903359],[-191.700625,120.222734],[-189.993281,111.688359],[-186.134375,101.515234],[-182.327969,94.266328],[-177.350625,86.626484],[-171.730156,79.483516],[-165.994375,73.725234],[-162.226719,71.028828],[-158.780625,69.141484],[-155.493906,67.218516],[-152.204375,64.415234],[-146.321875,56.742422],[-140.791875,48.182734],[-134.665625,40.264297],[-131.082422,37.023086],[-126.994375,34.515234],[-154.534375,3.515234],[-165.082344,-10.477891],[-178.948125,-30.152266],[-202.574375,-65.484766],[-232.684375,-115.484766],[-245.484375,-140.174766],[-248.375781,-141.923516],[-251.845625,-142.509766],[-258.994375,-142.654766],[-264.228750,-143.643672],[-269.549375,-145.428516],[-274.592500,-147.878984],[-278.994375,-150.864766],[-283.015781,-154.727578],[-286.378125,-159.222266],[-288.988594,-164.193203],[-290.754375,-169.484766],[-291.825625,-176.337266],[-292.502344,-179.775703],[-293.594375,-182.394766],[-310.994375,-196.574766],[-317.338125,-203.027891],[-322.151875,-209.027266],[-331.344375,-222.484766],[-334.502148,-226.379180],[-337.894063,-229.445078],[-345.296875,-233.902266],[-353.385938,-237.478203],[-361.994375,-241.794766],[-366.326406,-244.696953],[-369.125625,-247.214766],[-375.004375,-253.204766],[-384.083281,-261.460859],[-390.718125,-268.636016],[-395.708594,-276.915547],[-399.854375,-288.484766],[-401.541875,-294.853516],[-401.954375,-301.484766],[-401.363828,-306.269375],[-400.046250,-310.562266],[-398.075234,-314.403281],[-395.524375,-317.832266],[-388.977500,-323.613516],[-380.994375,-328.224766],[-373.355625,-331.216016],[-369.380156,-332.990547],[-367.014375,-334.784766],[-366.222188,-337.331641],[-365.949375,-340.879766],[-365.994375,-347.484766],[-365.272246,-354.085469],[-363.359844,-360.673516],[-360.401895,-367.070313],[-356.543125,-373.097266],[-351.928262,-378.575781],[-346.702031,-383.327266],[-341.009160,-387.173125],[-334.994375,-389.934766],[-328.599531,-391.329766],[-323.210625,-391.487266],[-318.888594,-391.656016],[-315.694375,-393.084766],[-314.239844,-395.238984],[-313.035625,-398.221016],[-311.353281,-401.984922],[-308.464375,-406.484766],[-301.435781,-414.056797],[-292.728125,-420.741016],[-283.021094,-425.754609],[-278.005215,-427.390293],[-272.994375,-428.314766],[-266.285313,-428.523672],[-259.671875,-427.758516],[-253.219688,-426.091484],[-246.994375,-423.594766],[-240.318125,-419.479766],[-236.839844,-417.545078],[-233.994375,-416.834766],[-228.603125,-419.211016],[-222.994375,-422.374766],[-214.268125,-425.899766],[-204.994375,-427.444766],[-196.750918,-427.045176],[-188.719219,-425.264297],[-181.096035,-422.207715],[-174.078125,-417.981016],[-167.862246,-412.689785],[-162.645156,-406.439609],[-158.623613,-399.336074],[-155.994375,-391.484766],[-121.994375,-401.674766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[175.005625,-295.484766],[174.256914,-307.846738],[172.192187,-320.473672],[169.027305,-333.217090],[164.978125,-345.928516],[155.090312,-370.661484],[144.255625,-393.484766],[135.457812,-410.622891],[126.058125,-427.082266],[115.402188,-442.720391],[109.398633,-450.186953],[102.835625,-457.394766],[97.012187,-462.849141],[90.110625,-468.442266],[82.864062,-473.589141],[76.005625,-477.704766],[66.982812,-481.882266],[57.605625,-484.987266],[47.928437,-486.896016],[38.005625,-487.484766],[30.029717,-486.896973],[22.312266,-485.365703],[14.868682,-482.963496],[7.714375,-479.762891],[0.864756,-475.836426],[-5.664766,-471.256641],[-11.858779,-466.096074],[-17.701875,-460.427266],[-28.273672,-447.855078],[-37.256875,-434.120391],[-44.528203,-419.803516],[-49.964375,-405.484766],[-52.568125,-394.639766],[-53.994375,-384.484766],[-39.994375,-380.484766],[-39.133438,-385.025391],[-38.979375,-389.082266],[-38.534375,-397.484766],[-36.032344,-407.709922],[-32.265625,-417.546016],[-27.330781,-426.851484],[-21.324375,-435.484766],[-14.998906,-442.230703],[-7.440625,-447.962266],[1.008281,-452.182578],[10.005625,-454.394766],[25.005625,-454.394766],[31.270273,-453.862949],[37.304062,-452.410859],[43.058008,-450.129785],[48.483125,-447.111016],[53.530430,-443.445840],[58.150937,-439.225547],[62.295664,-434.541426],[65.915625,-429.484766],[70.522891,-421.244102],[73.703750,-413.143828],[75.528047,-405.130273],[76.065625,-397.149766],[75.386328,-389.148633],[73.560000,-381.073203],[70.656484,-372.869805],[66.745625,-364.484766],[62.634531,-357.283984],[58.164375,-351.323516],[52.799844,-346.193672],[46.005625,-341.484766],[48.311094,-336.871172],[51.541875,-332.813516],[59.005625,-325.484766],[72.259375,-312.962266],[77.085781,-307.870078],[85.745625,-297.484766],[93.159805,-287.904668],[99.669062,-278.541484],[110.568125,-259.863516],[119.633437,-240.246172],[128.055625,-218.484766],[135.150625,-197.217266],[137.871250,-185.865391],[139.005625,-175.484766],[148.820469,-176.598828],[159.406875,-176.462266],[169.792656,-174.806953],[174.606504,-173.325977],[179.005625,-171.364766],[197.005625,-159.564766],[199.069375,-159.388516],[201.005625,-160.134766],[206.284687,-164.358359],[211.490625,-170.523516],[216.021562,-177.331797],[219.275625,-183.484766],[222.836504,-192.839336],[225.063906,-202.007578],[225.953730,-210.996289],[225.501875,-219.812266],[223.704238,-228.462305],[220.556719,-236.953203],[216.055215,-245.291758],[210.195625,-253.484766],[204.447969,-259.644141],[197.656875,-265.027266],[190.087656,-269.139141],[182.005625,-271.484766],[178.985625,-249.864766],[175.005625,-246.484766],[175.005625,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[35.005625,-348.184766],[37.399121,-347.786895],[39.704844,-348.026172],[44.009375,-349.968516],[47.832031,-353.116484],[51.085625,-356.574766],[57.990156,-365.718984],[63.016875,-375.556016],[66.057969,-386.129922],[67.005625,-397.484766],[65.504375,-409.773516],[63.828906,-416.023359],[61.625625,-421.484766],[57.322637,-428.303809],[51.874844,-434.149609],[45.494004,-438.941426],[38.391875,-442.598516],[30.780215,-445.040137],[22.870781,-446.185547],[14.875332,-445.954004],[7.005625,-444.264766],[-0.560781,-441.003984],[-7.595625,-436.373516],[-13.889844,-430.743672],[-19.234375,-424.484766],[-24.144531,-416.918203],[-27.840625,-408.907266],[-30.173594,-400.435078],[-30.994375,-391.484766],[-30.994375,-379.484766],[-19.994375,-376.484766],[-18.994375,-384.484766],[-16.833750,-384.522246],[-15.061250,-385.172734],[-12.406875,-387.851016],[-8.744375,-395.484766],[4.255625,-421.484766],[6.995625,-427.003516],[8.721875,-429.878672],[10.395625,-431.704766],[12.283594,-432.363672],[14.234375,-432.198516],[18.005625,-430.764766],[24.889375,-427.817266],[32.005625,-425.484766],[14.005625,-388.484766],[33.005625,-382.484766],[36.625625,-381.061016],[38.175000,-379.904297],[39.015625,-378.264766],[38.752812,-376.095391],[37.693125,-373.337266],[35.245625,-368.484766],[32.921875,-364.142266],[31.382656,-362.038516],[29.675625,-360.714766],[27.574219,-360.500859],[25.269375,-361.156016],[21.005625,-363.134766],[12.028125,-365.584766],[7.064062,-366.048516],[3.005625,-365.484766],[35.005625,-348.184766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-239.584375,-329.484766],[-241.493203,-334.211758],[-242.886875,-340.083203],[-244.591875,-353.912266],[-245.625625,-368.277578],[-246.914375,-380.484766],[-249.204219,-389.367578],[-250.972988,-393.168086],[-253.255625,-396.414766],[-256.125605,-399.012695],[-259.656406,-400.866953],[-263.921504,-401.882617],[-268.994375,-401.964766],[-273.591875,-401.277266],[-277.994375,-399.914766],[-282.163125,-397.112266],[-285.664375,-393.484766],[-289.312813,-387.870195],[-291.541875,-381.755703],[-292.563438,-375.282617],[-292.589375,-368.592266],[-291.831563,-361.825977],[-290.501875,-355.125078],[-286.974375,-342.484766],[-284.671875,-335.819766],[-281.544375,-329.484766],[-275.703125,-319.968516],[-273.358594,-315.451797],[-270.994375,-309.484766],[-275.527813,-309.706797],[-279.316875,-311.396016],[-282.652188,-314.129609],[-285.824375,-317.484766],[-291.715000,-325.054297],[-297.324375,-333.851016],[-307.414375,-351.484766],[-312.734375,-360.284766],[-316.327188,-363.772578],[-318.505273,-364.885664],[-320.994375,-365.424766],[-324.404297,-365.309961],[-327.650625,-364.472578],[-330.675703,-363.005664],[-333.421875,-361.002266],[-337.846875,-355.758203],[-340.464375,-349.484766],[-340.988125,-344.541016],[-340.994375,-339.484766],[-340.389688,-333.097012],[-338.825000,-327.120234],[-336.438125,-321.511660],[-333.366875,-316.228516],[-325.722500,-306.467422],[-316.994375,-297.494766],[-309.401875,-290.661016],[-306.228125,-287.255859],[-302.994375,-282.484766],[-308.418770,-282.274863],[-313.569531,-283.604922],[-318.469277,-286.129590],[-323.140625,-289.503516],[-331.888594,-297.417734],[-339.994375,-304.584766],[-344.676250,-307.381016],[-350.074375,-309.247266],[-355.682500,-309.714766],[-360.994375,-308.314766],[-364.163125,-306.118516],[-366.994375,-303.464766],[-370.073125,-300.237266],[-372.394375,-296.484766],[-373.174844,-291.743047],[-372.248125,-287.321016],[-370.112031,-283.230859],[-367.264375,-279.484766],[-361.735313,-273.630078],[-355.626875,-268.324766],[-349.019688,-263.664453],[-341.994375,-259.744766],[-327.999375,-253.318516],[-321.190313,-249.587422],[-315.174375,-245.024766],[-312.093594,-241.423828],[-309.848125,-237.659766],[-307.638281,-233.693203],[-304.664375,-229.484766],[-299.448281,-224.176797],[-292.605625,-218.393516],[-278.994375,-208.914766],[-272.193125,-205.449766],[-264.994375,-203.004766],[-232.994375,-202.484766],[-229.054375,-202.436016],[-225.414375,-201.464766],[-224.278281,-200.066719],[-224.241875,-198.652266],[-226.459375,-195.982266],[-230.049375,-193.871016],[-232.994375,-192.734766],[-240.493750,-191.683047],[-250.074375,-191.348516],[-267.994375,-191.484766],[-267.994375,-184.484766],[-267.860625,-180.954766],[-267.194375,-177.484766],[-265.288164,-173.268203],[-262.716563,-170.264766],[-259.598867,-168.273828],[-256.054375,-167.094766],[-248.162188,-166.369766],[-239.994375,-166.484766],[-228.419375,-166.508516],[-223.158750,-167.172422],[-216.994375,-168.834766],[-209.715625,-171.523516],[-201.994375,-173.484766],[-208.184375,-194.484766],[-208.866875,-198.977266],[-208.994375,-203.484766],[-208.945625,-214.165703],[-208.206875,-223.412266],[-206.046875,-232.445078],[-201.734375,-242.484766],[-196.069375,-251.509609],[-189.166875,-259.176016],[-181.113125,-265.666797],[-171.994375,-271.164766],[-154.594375,-278.334766],[-153.337969,-280.892891],[-152.935625,-284.474766],[-152.664375,-291.484766],[-151.558906,-295.377266],[-150.098125,-298.774766],[-148.882969,-301.767266],[-148.514375,-304.444766],[-149.335625,-306.735391],[-150.996875,-308.767266],[-154.994375,-312.084766],[-165.265625,-320.429766],[-170.875156,-324.530078],[-175.994375,-327.484766],[-180.348125,-319.341016],[-182.984375,-310.484766],[-183.854375,-304.928516],[-184.534063,-302.062734],[-185.594375,-300.084766],[-187.880469,-298.910859],[-190.983125,-298.471016],[-196.994375,-298.484766],[-203.136094,-297.963672],[-208.560625,-296.566016],[-213.702031,-294.292734],[-218.994375,-291.144766],[-226.559375,-285.663516],[-230.607188,-283.453984],[-234.994375,-282.484766],[-231.217813,-290.561953],[-226.111875,-297.204766],[-219.697188,-302.670078],[-211.994375,-307.214766],[-198.554375,-312.464766],[-197.268438,-314.201797],[-196.314375,-316.633516],[-194.914375,-321.484766],[-185.784375,-342.484766],[-181.974375,-375.484766],[-181.243125,-382.022266],[-181.216406,-385.246953],[-181.974375,-388.484766],[-184.201309,-392.212129],[-187.426094,-395.286172],[-191.403457,-397.694824],[-195.888125,-399.426016],[-200.634824,-400.467676],[-205.398281,-400.807734],[-209.933223,-400.434121],[-213.994375,-399.334766],[-218.134375,-396.928516],[-221.464375,-393.464766],[-223.755508,-389.998804],[-225.628750,-386.044727],[-228.293125,-376.972578],[-229.800625,-366.849023],[-230.494375,-356.274766],[-230.813125,-336.176953],[-231.124375,-327.854805],[-231.994375,-321.484766],[-236.280625,-325.004766],[-239.584375,-329.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[85.025625,-284.484766],[71.705625,-302.484766],[60.924824,-313.956191],[48.931719,-324.729297],[35.931504,-334.723574],[22.129375,-343.858516],[7.730527,-352.053613],[-7.059844,-359.228359],[-22.036543,-365.302246],[-36.994375,-370.194766],[-48.277188,-373.145234],[-60.829375,-375.806016],[-73.464063,-377.733672],[-84.994375,-378.484766],[-99.132656,-378.687109],[-111.790625,-378.558516],[-124.300469,-377.063047],[-130.916152,-375.479004],[-137.994375,-373.164766],[-143.739063,-370.875391],[-148.904375,-368.139766],[-153.364688,-364.496641],[-156.994375,-359.484766],[-103.994375,-348.764766],[-63.994375,-335.674766],[-31.994375,-320.734766],[-12.707813,-310.988984],[4.428125,-301.718516],[21.102812,-291.486172],[39.005625,-278.854766],[60.311875,-262.844766],[71.002031,-255.570078],[83.005625,-248.514766],[88.987500,-245.570391],[95.235625,-243.462266],[101.618750,-242.872891],[104.819922,-243.361016],[108.005625,-244.484766],[103.489687,-255.133516],[97.880625,-265.234766],[85.025625,-284.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[1.005625,-367.484766],[2.005625,-366.484766],[2.005625,-367.484766],[1.005625,-367.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-2.994375,-292.614766],[-34.994375,-308.264766],[-57.994375,-318.484766],[-67.994375,-296.484766],[-64.109375,-298.124766],[-60.164375,-299.374766],[-57.135293,-299.535898],[-54.679844,-298.869453],[-52.744473,-297.518164],[-51.275625,-295.624766],[-49.523281,-290.782578],[-48.994375,-285.484766],[-49.419375,-276.937109],[-50.856875,-269.971016],[-56.394375,-255.484766],[-58.816875,-249.466016],[-60.654375,-243.484766],[-60.729883,-239.498438],[-59.992813,-235.669141],[-57.544375,-228.659766],[-56.564727,-225.568750],[-56.235938,-222.812891],[-56.923867,-220.436719],[-58.994375,-218.484766],[-60.493613,-222.308125],[-62.751406,-226.215391],[-68.883125,-233.904766],[-76.070469,-240.799141],[-82.994375,-246.144766],[-96.431875,-254.113516],[-103.581875,-257.300547],[-110.994375,-259.734766],[-116.612969,-260.882891],[-121.953125,-261.397266],[-132.994375,-261.484766],[-143.492500,-260.430234],[-153.581875,-257.391016],[-162.835000,-252.396172],[-167.014375,-249.174473],[-170.824375,-245.474766],[-176.021875,-238.821016],[-180.214375,-231.484766],[-183.710625,-221.743516],[-184.994375,-211.484766],[-184.994375,-204.484766],[-183.836152,-194.251934],[-180.590469,-184.626484],[-175.555801,-175.729238],[-169.030625,-167.681016],[-161.313418,-160.602637],[-152.702656,-154.614922],[-143.496816,-149.838691],[-133.994375,-146.394766],[-122.563906,-143.889922],[-113.935625,-143.471016],[-105.586719,-144.036484],[-94.994375,-144.484766],[-41.994375,-144.484766],[-34.772402,-144.887480],[-27.926719,-145.928984],[-15.095625,-149.063516],[-2.963906,-152.158672],[3.007559,-153.150957],[9.005625,-153.484766],[15.679375,-152.614922],[20.995625,-150.088516],[24.991875,-145.760234],[27.705625,-139.484766],[28.764375,-134.022266],[29.005625,-128.484766],[29.005625,-121.484766],[27.906797,-112.091426],[25.001875,-103.341797],[20.529453,-95.322715],[14.728125,-88.121016],[7.836484,-81.823535],[0.093125,-76.517109],[-8.263359,-72.288574],[-16.994375,-69.224766],[-26.893125,-67.438516],[-36.994375,-66.484766],[-38.149375,-57.834766],[-40.684375,-49.484766],[-42.893125,-44.312266],[-45.784375,-39.484766],[-48.891621,-35.729785],[-51.980469,-33.120547],[-55.084082,-31.590605],[-58.235625,-31.073516],[-61.468262,-31.502832],[-64.815156,-32.812109],[-71.984375,-37.804766],[-78.402031,-44.708359],[-84.205625,-53.366016],[-89.066094,-62.663047],[-92.654375,-71.484766],[-98.574375,-91.414766],[-100.166777,-92.918809],[-101.961094,-93.775859],[-105.943125,-93.983516],[-110.095781,-92.906797],[-113.994375,-91.414766],[-109.540156,-79.236797],[-103.230625,-65.241016],[-96.172969,-51.599609],[-89.474375,-40.484766],[-72.434375,-18.484766],[-68.384375,-11.743516],[-65.354375,-4.484766],[-64.228125,-0.176016],[-63.454531,2.002266],[-62.404375,3.495234],[-60.274219,4.345234],[-56.980625,4.992734],[-50.994375,5.785234],[-34.904375,8.208984],[-26.604375,9.170078],[-18.994375,9.515234],[-2.994375,7.935234],[0.298125,7.522734],[3.305625,6.525234],[4.825312,4.306797],[6.583125,0.500234],[9.485625,-6.484766],[16.010625,-18.179766],[23.345625,-29.484766],[33.872969,-43.321328],[46.904375,-57.437266],[54.009590,-64.021680],[61.321406,-69.981953],[68.700020,-75.086758],[76.005625,-79.104766],[78.906055,-80.164863],[81.070312,-80.299297],[82.705352,-79.653027],[84.018125,-78.371016],[86.504687,-74.479609],[90.185625,-69.784766],[93.847344,-66.797891],[98.066875,-64.242266],[107.005625,-60.514766],[113.392458,-58.853357],[119.839043,-57.884277],[126.298254,-57.583372],[132.722969,-57.926484],[139.066062,-58.889460],[145.280410,-60.448145],[157.134375,-65.256016],[167.907871,-72.156855],[172.771633,-76.331750],[177.223906,-80.957422],[181.217566,-86.009714],[184.705488,-91.464473],[187.640549,-97.297542],[189.975625,-103.484766],[192.133398,-112.435664],[192.969063,-121.526953],[192.407383,-130.486523],[190.373125,-139.042266],[186.791055,-146.922070],[181.585937,-153.853828],[174.682539,-159.565430],[166.005625,-163.784766],[158.603125,-165.662266],[151.005625,-166.474766],[141.284375,-165.828516],[136.390469,-164.763359],[132.005625,-163.104766],[123.636406,-157.747734],[115.834375,-151.246016],[108.367969,-144.993672],[101.005625,-140.384766],[94.275156,-138.440078],[86.986875,-138.072266],[79.707969,-139.043203],[73.005625,-141.114766],[66.690625,-144.383516],[61.005625,-148.664766],[55.058125,-155.098516],[50.325625,-162.484766],[48.251250,-167.342578],[46.510625,-173.229766],[45.392500,-179.244453],[45.185625,-184.484766],[46.132676,-189.901855],[48.108281,-195.578984],[50.995371,-201.179941],[54.676875,-206.368516],[59.035723,-210.808496],[63.954844,-214.163672],[69.317168,-216.097832],[75.005625,-216.274766],[80.131250,-214.667891],[84.735625,-212.067266],[88.725000,-209.552891],[92.005625,-208.204766],[94.393437,-208.366641],[96.783125,-209.274766],[101.005625,-211.994766],[105.449844,-215.472891],[109.416875,-219.412266],[112.178281,-224.015391],[112.879238,-226.629141],[113.005625,-229.484766],[103.005625,-229.484766],[93.520469,-230.721953],[84.124375,-233.817266],[75.168906,-238.183828],[67.005625,-243.234766],[52.005625,-254.684766],[47.659375,-258.154766],[43.005625,-260.814766],[38.476406,-260.848672],[31.086875,-260.096016],[18.005625,-258.484766],[17.738125,-245.849766],[16.672500,-240.836328],[14.335625,-233.484766],[11.129375,-225.312266],[7.135625,-217.484766],[2.754687,-210.813359],[-0.126602,-207.355020],[-3.326875,-204.373516],[-6.739961,-202.287793],[-10.259688,-201.516797],[-13.779883,-202.479473],[-17.194375,-205.594766],[-19.294375,-209.484766],[-19.976875,-213.205391],[-19.954375,-217.447266],[-18.784375,-225.484766],[-15.800000,-236.799297],[-10.921875,-249.851016],[-7.812500,-256.087598],[-4.277500,-261.629609],[-0.332813,-266.100762],[4.005625,-269.124766],[7.151719,-270.166797],[9.959375,-270.103516],[15.005625,-269.124766],[23.050625,-269.652266],[31.005625,-271.484766],[-2.994375,-292.614766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-124.994375,-295.484766],[-127.994375,-286.484766],[-107.994375,-284.484766],[-106.994375,-289.484766],[-124.994375,-295.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,-270.484766],[-80.994375,-269.484766],[-80.994375,-270.484766],[-81.994375,-270.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-84.994375,-263.484766],[-81.994375,-269.484766],[-84.994375,-263.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[91.005625,-194.544766],[87.453730,-195.149824],[84.362969,-196.473359],[78.964375,-199.901016],[76.356309,-201.317715],[73.608906,-202.078047],[70.572051,-201.838301],[67.095625,-200.254766],[62.875176,-196.321094],[60.148281,-191.092266],[58.876621,-184.987813],[59.021875,-178.427266],[60.545723,-171.830156],[63.409844,-165.616016],[67.575918,-160.204375],[73.005625,-156.014766],[78.090215,-153.783691],[83.164844,-152.757422],[88.204551,-152.773887],[93.184375,-153.671016],[98.079355,-155.286738],[102.864531,-157.458984],[112.005625,-162.824766],[116.498750,-165.717422],[121.325625,-169.316016],[125.140000,-173.583984],[126.246797,-175.957559],[126.595625,-178.484766],[118.005625,-209.484766],[105.776875,-199.521016],[99.101406,-195.825859],[95.280098,-194.810605],[91.005625,-194.544766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-86.994375,12.645234],[-83.603125,9.948984],[-82.203281,8.281641],[-81.494375,6.345234],[-81.768887,3.811602],[-82.927344,0.693672],[-86.980625,-6.452266],[-95.624375,-18.484766],[-123.874375,-64.484766],[-130.654375,-82.484766],[-132.403125,-87.452266],[-134.804375,-91.894766],[-138.181875,-93.563516],[-141.994375,-94.384766],[-148.114375,-96.231016],[-153.994375,-98.744766],[-160.544512,-102.339492],[-166.392344,-106.425703],[-171.489004,-111.025195],[-175.785625,-116.159766],[-179.233340,-121.851211],[-181.783281,-128.121328],[-183.386582,-134.991914],[-183.994375,-142.484766],[-183.943281,-148.001016],[-184.283125,-152.219766],[-185.978594,-155.996016],[-189.994375,-160.184766],[-192.788125,-162.292266],[-195.994375,-163.604766],[-201.878125,-162.604766],[-207.994375,-160.764766],[-214.823125,-158.627266],[-218.357031,-156.993203],[-220.324375,-155.064766],[-220.160469,-151.192734],[-218.405625,-145.763516],[-214.244375,-136.484766],[-188.224375,-87.484766],[-174.294375,-62.437266],[-166.787500,-50.236016],[-158.624375,-38.484766],[-125.144375,2.515234],[-114.270625,14.418984],[-108.180781,20.069453],[-101.994375,24.515234],[-86.994375,12.645234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-159.994375,-121.474766],[-155.159375,-116.672266],[-149.994375,-112.274766],[-142.600938,-108.276641],[-134.564375,-106.149766],[-126.242813,-105.822891],[-117.994375,-107.224766],[-107.795625,-111.142266],[-101.414375,-114.054766],[-99.376094,-113.902109],[-97.400625,-112.976016],[-93.994375,-110.314766],[-80.994375,-99.244766],[-72.015000,-93.379609],[-62.506875,-88.713516],[-52.492500,-85.335547],[-41.994375,-83.334766],[-37.565625,-82.717266],[-32.994375,-82.654766],[-26.123125,-83.632695],[-19.518125,-85.387578],[-13.256250,-87.906055],[-7.414375,-91.174766],[-2.069375,-95.180352],[2.701875,-99.909453],[6.822500,-105.348711],[10.215625,-111.484766],[12.067812,-117.108828],[13.025625,-124.129766],[12.897852,-127.624414],[12.220937,-130.820703],[10.886367,-133.502773],[8.785625,-135.454766],[6.149062,-136.328047],[2.970625,-136.456016],[-2.994375,-135.454766],[-13.379375,-131.991016],[-18.243750,-130.930859],[-24.994375,-130.484766],[-39.994375,-129.564766],[-53.994375,-130.654766],[-86.994375,-134.474766],[-92.217188,-133.891484],[-96.346875,-132.673516],[-104.994375,-129.724766],[-113.953125,-128.501016],[-122.994375,-128.484766],[-134.387813,-129.756641],[-146.004375,-132.824766],[-157.365938,-136.972891],[-167.994375,-141.484766],[-168.942207,-138.207090],[-169.113906,-135.265859],[-168.619277,-132.603770],[-167.568125,-130.163516],[-164.235469,-125.719297],[-159.994375,-121.474766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[130.265625,-78.084766],[128.655273,-77.031973],[126.598437,-76.538047],[121.725625,-76.833516],[116.807812,-78.184609],[113.005625,-79.804766],[105.021406,-85.089141],[101.720996,-88.253516],[98.984375,-91.772266],[96.888535,-95.650078],[95.510469,-99.891641],[94.927168,-104.501641],[95.215625,-109.484766],[96.242187,-113.477891],[97.998125,-117.092266],[103.045625,-123.484766],[111.463281,-130.618359],[120.834375,-135.621016],[131.051094,-138.555547],[142.005625,-139.484766],[146.497969,-139.359922],[150.756875,-138.591016],[154.140156,-136.518984],[155.302754,-134.788340],[156.005625,-132.484766],[148.297344,-132.144609],[139.601875,-130.918516],[131.358281,-128.475547],[127.855645,-126.694316],[125.005625,-124.484766],[140.005625,-118.484766],[138.005625,-113.484766],[129.873125,-115.729766],[126.285937,-116.347891],[121.005625,-116.474766],[115.825020,-115.753496],[111.773281,-114.019609],[108.805527,-111.490488],[106.876875,-108.383516],[105.942441,-104.916074],[105.957344,-101.305547],[106.876699,-97.769316],[108.655625,-94.524766],[113.360156,-89.960391],[119.269375,-86.704766],[125.709219,-84.349141],[132.005625,-82.484766],[131.476875,-80.153516],[130.265625,-78.084766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-80.414375,-69.484766],[-70.524375,-48.494766],[-66.490625,-43.748516],[-63.902344,-41.973984],[-60.994375,-40.944766],[-57.849727,-41.068555],[-55.190938,-42.514453],[-52.976992,-44.970508],[-51.166875,-48.124766],[-48.594063,-55.280078],[-47.144375,-61.484766],[-46.533125,-65.733516],[-46.532656,-68.019609],[-47.144375,-69.764766],[-49.026719,-71.090547],[-52.085625,-72.106016],[-57.994375,-73.524766],[-85.994375,-83.484766],[-83.658125,-76.289766],[-80.414375,-69.484766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[66.005625,-51.044766],[58.702969,-44.456797],[50.521875,-36.028516],[43.332656,-26.968359],[40.694473,-22.578965],[39.005625,-18.484766],[50.309375,-14.882266],[56.062031,-14.488203],[58.971348,-15.149102],[61.905625,-16.574766],[64.512969,-18.902109],[66.309375,-21.431016],[67.953906,-23.579297],[70.105625,-24.764766],[72.928906,-24.296328],[76.409375,-22.629766],[80.712969,-20.858203],[86.005625,-20.074766],[90.329375,-20.674766],[95.013125,-22.414766],[98.515625,-25.339766],[99.342266,-27.260703],[99.295625,-29.494766],[96.665625,-34.666016],[93.135625,-39.484766],[85.586875,-49.177266],[82.041719,-54.182891],[79.005625,-59.484766],[75.351563,-57.928359],[72.108125,-55.936016],[66.005625,-51.044766]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-56.994375,23.225234],[-60.652188,25.106016],[-64.446875,28.093984],[-70.954375,34.515234],[-82.091875,47.613984],[-92.404375,61.515234],[-97.539375,69.121484],[-99.624062,73.182891],[-100.994375,77.515234],[-65.994375,82.515234],[-64.472832,77.791270],[-62.139531,72.655391],[-55.825625,61.813984],[-42.124375,42.515234],[-35.861875,34.378984],[-33.048438,30.046016],[-30.994375,25.515234],[-44.654375,23.830234],[-52.113438,23.045859],[-56.994375,23.225234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-10.564375,26.495234],[-15.308125,31.133984],[-20.014375,36.515234],[-28.673438,46.325391],[-34.529375,54.268984],[-45.714375,73.515234],[-52.781875,85.598984],[-57.119063,91.961016],[-61.034375,96.115234],[-64.297031,97.318984],[-67.875625,97.465234],[-74.994375,96.115234],[-87.994375,93.315234],[-98.565625,91.661484],[-108.994375,89.295234],[-112.329063,87.878203],[-115.174375,85.856484],[-117.119688,83.109141],[-117.754375,79.515234],[-116.852031,75.427422],[-114.848125,70.745234],[-110.134375,62.515234],[-80.994375,25.515234],[-85.226719,27.883828],[-89.023125,30.798984],[-95.994375,37.515234],[-107.954375,50.636484],[-119.104375,64.515234],[-124.824375,72.398984],[-127.682500,76.978828],[-129.134375,80.515234],[-128.813906,83.893047],[-127.418125,87.610234],[-125.847969,92.279922],[-125.004375,98.515234],[-125.863906,109.448672],[-128.655625,121.535234],[-133.001719,133.111797],[-135.639590,138.189102],[-138.524375,142.515234],[-152.994375,157.515234],[-156.539375,160.986484],[-159.424375,164.795234],[-159.975625,168.091484],[-159.994375,171.515234],[-159.994375,200.515234],[-159.430176,209.503516],[-157.847031,218.353984],[-155.364121,227.030078],[-152.100625,235.495234],[-148.175723,243.712891],[-143.708594,251.646484],[-133.624375,266.515234],[-124.577422,277.491191],[-114.883125,287.192266],[-104.521328,295.619512],[-93.471875,302.773984],[-81.714609,308.656738],[-69.229375,313.268828],[-55.996016,316.611309],[-41.994375,318.685234],[-32.994375,319.505234],[-22.994375,318.595234],[-8.128750,316.299141],[6.260625,311.813984],[13.151328,308.759004],[19.772500,305.166953],[26.073984,301.041230],[32.005625,296.385234],[42.676875,285.711484],[47.427969,279.736641],[51.555625,273.515234],[56.684434,263.593555],[60.467344,253.463047],[63.049082,243.145508],[64.574375,232.662734],[65.187949,222.036523],[65.034531,211.288672],[63.005625,189.515234],[53.448125,193.472734],[49.035937,194.335859],[43.005625,194.505234],[35.196094,193.685605],[27.743750,191.685078],[20.684219,188.639941],[14.053125,184.686484],[7.886094,179.960996],[2.218750,174.599766],[-2.913281,168.739082],[-7.474375,162.515234],[-11.942188,154.819141],[-15.151875,147.783984],[-17.652813,141.864453],[-19.994375,137.515234],[-19.294375,142.488984],[-19.164375,147.515234],[-20.419707,154.509863],[-22.860156,161.417891],[-26.353652,168.039277],[-30.768125,174.173984],[-35.971504,179.621973],[-41.831719,184.183203],[-48.216699,187.657637],[-54.994375,189.845234],[-62.830195,190.543340],[-70.678438,189.469453],[-78.292773,186.832520],[-85.426875,182.841484],[-91.834414,177.705293],[-97.269063,171.632891],[-101.484492,164.833223],[-104.234375,157.515234],[-104.933125,153.030234],[-104.994375,148.515234],[-104.941875,138.383984],[-104.240625,133.683516],[-102.534375,128.515234],[-100.305820,124.065840],[-97.433438,119.700703],[-90.136875,111.661484],[-81.404063,105.274141],[-76.736367,102.973848],[-71.994375,101.415234],[-65.528125,100.537734],[-58.994375,100.515234],[-51.299375,101.331484],[-43.994375,103.895234],[-39.375313,106.806953],[-34.799375,110.703984],[-30.688438,115.101641],[-27.464375,119.515234],[-23.984375,126.202734],[-22.196562,129.491172],[-19.994375,132.515234],[-21.293770,123.002930],[-21.822656,113.369922],[-21.623340,103.678320],[-20.738125,93.990234],[-19.209316,84.367773],[-17.079219,74.873047],[-11.184375,56.515234],[4.005625,23.515234],[-3.571875,24.633984],[-10.564375,26.495234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[141.005625,91.095234],[118.175625,83.862734],[96.005625,75.205234],[46.005625,47.295234],[39.500625,44.387578],[32.515625,42.243984],[29.000156,41.835762],[25.553125,42.071016],[22.237344,43.100566],[19.115625,45.075234],[16.049375,48.807734],[15.045625,53.515234],[15.220391,58.622168],[16.237500,63.660078],[17.958672,68.594629],[20.245625,73.391484],[25.963750,82.434766],[32.285625,90.515234],[47.272500,106.849297],[63.328125,121.370234],[80.542500,134.511172],[99.005625,146.705234],[114.830625,156.078984],[123.463125,159.784766],[127.772344,160.958848],[132.005625,161.515234],[132.974531,152.120859],[135.234375,141.087734],[138.332344,130.268359],[141.815625,121.515234],[149.529375,107.883984],[153.427031,100.715391],[156.005625,94.515234],[141.005625,91.095234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[3.005625,58.515234],[-1.345254,70.607324],[-4.747031,82.983828],[-7.010918,95.525098],[-7.948125,108.111484],[-7.369863,120.623340],[-5.087344,132.941016],[-0.911777,144.944863],[5.345625,156.515234],[12.359062,165.725703],[16.373789,169.773535],[20.743125,173.318984],[25.479023,176.263965],[30.593437,178.510391],[36.098320,179.960176],[42.005625,180.515234],[47.005625,180.515234],[51.024062,180.030234],[55.018125,178.622734],[58.303437,176.161484],[60.195625,172.515234],[60.198437,170.433984],[59.610625,168.022734],[58.035625,163.515234],[52.665625,145.515234],[48.520625,132.125234],[45.955000,125.369297],[42.905625,119.515234],[26.515625,99.515234],[19.581406,90.130547],[13.454375,80.177734],[8.480469,69.643672],[5.005625,58.515234],[3.005625,58.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[304.005625,63.705234],[299.445391,64.708418],[293.976250,66.675703],[281.520625,72.468984],[259.005625,84.255234],[246.924844,89.277734],[236.961875,92.035234],[227.270781,94.042734],[216.005625,96.815234],[208.825625,99.331484],[202.005625,102.695234],[197.535625,105.227734],[193.005625,106.935234],[190.844375,106.540234],[189.005625,105.515234],[191.690000,102.724609],[193.890625,99.577734],[197.005625,92.515234],[194.110625,90.925234],[191.005625,89.815234],[187.149824,89.484336],[183.294844,89.984297],[179.511816,91.191602],[175.871875,92.982734],[169.305781,97.822422],[164.165625,103.515234],[157.076719,114.797266],[150.631875,128.296484],[145.913906,142.405078],[144.540879,149.185449],[144.005625,155.515234],[144.005625,162.515234],[144.369785,168.056680],[145.357031,173.109922],[147.012012,177.609570],[149.379375,181.490234],[152.503770,184.686523],[156.429844,187.133047],[161.202246,188.764414],[166.865625,189.515234],[166.138125,177.931484],[166.148437,172.785078],[166.865625,165.515234],[167.376875,159.210234],[168.742969,157.128359],[172.005625,155.515234],[173.081816,164.598867],[174.804531,172.886797],[177.232480,180.509570],[180.424375,187.597734],[184.438926,194.281836],[189.334844,200.692422],[195.170840,206.960039],[202.005625,213.215234],[210.043281,219.178516],[217.466875,223.811484],[226.399844,230.471328],[238.965625,242.515234],[243.177949,247.638203],[246.650469,252.985234],[252.594375,263.260234],[255.674902,267.642578],[259.233906,271.157734],[263.575957,273.532891],[269.005625,274.495234],[274.101875,274.406484],[278.965625,273.065234],[282.264922,270.647578],[284.821250,267.411484],[286.669766,263.566016],[287.845625,259.320234],[288.383984,254.883203],[288.320000,250.463984],[287.688828,246.271641],[286.525625,242.515234],[283.046562,236.593984],[277.893125,230.192734],[267.445625,218.515234],[264.507031,215.069141],[261.839375,211.121484],[261.063301,209.072363],[260.902344,207.033203],[261.538965,205.049121],[263.155625,203.165234],[265.743789,201.641172],[269.524687,200.225859],[279.218125,197.762734],[297.005625,194.595234],[313.356563,191.685234],[331.243125,187.657734],[348.510938,182.141484],[356.239570,178.709062],[363.005625,174.765234],[368.382969,170.352109],[372.214375,165.312734],[374.431406,159.437109],[374.965625,152.515234],[374.493750,148.783359],[373.283125,145.197734],[371.168750,142.170859],[367.985625,140.115234],[364.559375,139.546484],[361.005625,139.525234],[354.016875,140.271816],[346.688750,141.969141],[331.618125,146.806484],[317.001250,151.218203],[310.240312,152.383496],[304.045625,152.385234],[297.005625,150.515234],[299.330508,148.111562],[301.979063,146.186484],[307.985625,143.447734],[321.005625,140.145234],[332.875937,137.086484],[345.940625,133.000234],[358.240313,127.556484],[363.490977,124.222422],[367.815625,120.425234],[371.309551,115.555176],[373.207031,110.407266],[373.614121,105.303652],[372.636875,100.566484],[370.381348,96.517910],[366.953594,93.480078],[362.459668,91.775137],[357.005625,91.725234],[352.627813,93.069922],[347.400625,95.507734],[338.005625,100.655234],[323.268125,108.422734],[308.005625,115.095234],[298.619375,118.015234],[293.193594,118.838672],[291.133027,118.644180],[289.825625,117.875234],[289.115742,116.116953],[289.612187,114.511484],[293.015625,111.815234],[297.619062,109.898984],[301.005625,108.875234],[309.317969,105.721953],[319.414375,100.786484],[337.005625,90.485234],[343.328125,85.832734],[346.000000,82.815547],[347.085625,79.515234],[345.565625,74.535234],[342.933437,70.746953],[339.590625,68.858984],[335.595312,68.349141],[331.005625,68.695234],[326.647031,69.771797],[322.161875,71.778359],[313.055625,77.632734],[304.174375,84.360859],[296.005625,90.065234],[290.658125,92.881484],[285.025625,94.685234],[283.193594,94.554141],[281.694375,93.853984],[280.898281,92.574453],[281.175625,90.705234],[282.663594,88.925703],[285.106875,87.223984],[290.005625,84.455234],[295.930781,80.644922],[302.666875,75.722734],[308.572344,70.181797],[310.700605,67.333398],[312.005625,64.515234],[308.054375,63.716484],[304.005625,63.705234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-168.984375,129.515234],[-168.884375,134.184141],[-168.049375,139.873984],[-165.924375,144.706953],[-164.204688,146.215293],[-161.954375,146.805234],[-158.531563,145.871172],[-155.301875,143.465234],[-150.344375,137.515234],[-144.996094,128.842734],[-141.083125,120.005234],[-138.713281,110.672734],[-137.994375,100.515234],[-138.326094,96.299453],[-139.485625,92.836484],[-141.899531,90.335391],[-145.994375,89.005234],[-150.868457,91.096172],[-155.272031,94.831484],[-159.154590,99.813672],[-162.465625,105.645234],[-165.154629,111.928672],[-167.171094,118.266484],[-168.464512,124.261172],[-168.984375,129.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[229.745625,109.695234],[234.183125,105.872734],[240.885625,102.417734],[248.083125,99.828984],[254.005625,98.605234],[259.071875,98.548984],[263.875625,99.685234],[265.819375,101.320234],[267.005625,103.555234],[267.232793,105.868789],[266.608594,107.890547],[263.521875,111.110234],[259.177031,113.317422],[255.005625,114.615234],[250.013125,115.425234],[245.005625,115.515234],[228.005625,115.515234],[228.440625,112.492734],[229.745625,109.695234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-92.914375,144.515234],[-92.352891,150.159258],[-90.728750,155.544297],[-88.154922,160.528555],[-84.744375,164.970234],[-80.610078,168.727539],[-75.865000,171.658672],[-70.622109,173.621836],[-64.994375,174.475234],[-58.393125,174.110234],[-51.994375,172.425234],[-46.406045,169.696396],[-41.888516,166.151406],[-38.402354,161.935049],[-35.908125,157.192109],[-34.366396,152.067373],[-33.737734,146.705625],[-33.982705,141.251650],[-35.061875,135.850234],[-36.935811,130.646162],[-39.565078,125.784219],[-42.910244,121.409189],[-46.931875,117.665859],[-51.590537,114.699014],[-56.846797,112.653438],[-62.661221,111.673916],[-68.994375,111.905234],[-73.642227,113.851543],[-78.050313,116.737578],[-82.101680,120.397754],[-85.679375,124.666484],[-88.666445,129.378184],[-90.945938,134.367266],[-92.400898,139.468145],[-92.914375,144.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[256.005625,136.825234],[259.647207,137.425664],[262.623281,138.579922],[264.902090,140.183711],[266.451875,142.132734],[267.240879,144.322695],[267.237344,146.649297],[266.409512,149.008242],[264.725625,151.295234],[261.823906,153.446641],[258.349375,154.766484],[254.632969,155.383203],[251.005625,155.425234],[240.400625,153.493984],[230.005625,150.445234],[226.194375,148.408984],[224.882656,146.793203],[224.745625,144.685234],[225.704062,143.068516],[227.328125,141.823984],[231.005625,140.215234],[236.157031,138.751797],[241.009375,137.972734],[251.005625,136.825234],[256.005625,136.825234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[61.245625,301.515234],[55.880625,307.665234],[50.005625,313.425234],[43.768906,318.507734],[37.176875,322.735234],[23.005625,329.825234],[14.084531,333.870547],[6.124375,336.920234],[-2.145156,338.844922],[-11.994375,339.515234],[-11.376663,344.159255],[-10.060645,348.162246],[-8.120750,351.553723],[-5.631406,354.363203],[-2.667043,356.620203],[0.697910,358.354238],[8.331875,360.371484],[16.675059,360.651074],[25.132031,359.429141],[33.107363,356.941816],[40.005625,353.425234],[60.005625,337.515234],[59.122266,340.715723],[57.586875,343.812266],[53.083125,349.588984],[47.540625,354.636328],[42.005625,358.745234],[35.063125,362.515234],[33.123750,364.254922],[32.005625,367.515234],[38.797344,369.428672],[45.374375,372.810234],[51.267031,377.294297],[56.005625,382.515234],[46.586328,376.963691],[35.956250,373.009766],[24.569609,370.737012],[12.880625,370.228984],[1.343516,371.569238],[-9.587500,374.841328],[-14.683779,377.227922],[-19.458203,380.128809],[-23.853994,383.554431],[-27.814375,387.515234],[-32.536016,394.493828],[-35.668125,402.579609],[-37.288984,411.397578],[-37.476875,420.572734],[-36.310078,429.730078],[-33.866875,438.494609],[-30.225547,446.491328],[-25.464375,453.345234],[-21.879688,456.804297],[-17.321875,460.257734],[-7.994375,465.655234],[1.854062,469.049922],[11.183125,470.470234],[20.673437,470.698047],[31.005625,470.515234],[43.145117,469.337422],[53.886562,466.243359],[63.369414,461.430859],[71.733125,455.097734],[79.117148,447.441797],[85.660937,438.660859],[91.503945,428.952734],[96.785625,418.515234],[102.220781,406.145078],[106.764375,393.991484],[110.593594,381.599766],[113.885625,368.515234],[116.469375,353.093984],[117.005625,337.515234],[116.184004,330.104023],[113.993281,322.888047],[110.574668,316.096289],[106.069375,309.957734],[100.618613,304.701367],[94.363594,300.556172],[87.445527,297.751133],[80.005625,296.515234],[77.005625,308.515234],[73.005625,288.515234],[69.033437,291.093516],[66.240625,294.148984],[61.245625,301.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-81.994375,335.425234],[-93.059375,330.405234],[-98.495313,328.419297],[-104.994375,327.515234],[-104.978125,333.107734],[-103.904375,338.475234],[-101.771914,342.006504],[-99.052813,344.696016],[-95.864492,346.657324],[-92.324375,348.003984],[-84.658438,349.307578],[-76.994375,349.515234],[-73.475625,349.450234],[-69.994375,348.905234],[-62.705625,345.802734],[-55.994375,341.515234],[-81.994375,335.425234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-41.994375,341.685234],[-46.489375,344.802422],[-50.954375,348.742734],[-56.439375,352.611797],[-59.892500,354.240117],[-63.994375,355.515234],[-63.994375,359.515234],[-56.502031,361.343047],[-49.460625,364.935234],[-43.186094,369.817422],[-37.994375,375.515234],[-52.740625,366.900234],[-60.476094,363.795547],[-64.612012,362.879414],[-68.994375,362.515234],[-81.638594,362.776953],[-94.578125,364.316484],[-100.897012,365.785449],[-106.975781,367.837891],[-112.709785,370.561816],[-117.994375,374.045234],[-123.471172,379.305234],[-127.586250,385.377109],[-130.440391,392.076172],[-132.134375,399.217734],[-132.768984,406.617109],[-132.445000,414.089609],[-131.263203,421.450547],[-129.324375,428.515234],[-127.428125,434.161484],[-124.864375,439.515234],[-121.276250,444.375859],[-117.031875,448.715234],[-112.236250,452.424609],[-106.994375,455.395234],[-95.934375,459.609922],[-85.399375,461.760234],[-74.661875,462.508047],[-62.994375,462.515234],[-56.563906,461.919453],[-50.288125,460.508984],[-37.994375,456.515234],[-48.564375,430.515234],[-49.670352,425.276719],[-50.127813,419.863359],[-49.259375,408.855234],[-46.283438,398.177109],[-41.524375,388.515234],[-38.131563,383.916953],[-33.941875,379.418984],[-24.994375,371.515234],[-19.933125,367.476484],[-17.632656,364.991641],[-16.514375,362.425234],[-16.705664,360.281211],[-17.555313,357.837422],[-20.409375,352.310234],[-23.435938,346.363047],[-24.994375,340.515234],[-33.764375,340.436484],[-38.429688,340.755703],[-41.994375,341.685234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[124.795625,368.515234],[116.005625,399.515234],[111.381816,411.826367],[105.852031,423.975547],[99.351230,435.686445],[91.814375,446.682734],[83.176426,456.688086],[73.372344,465.426172],[62.337090,472.620664],[50.005625,477.995234],[41.394062,480.421328],[33.185625,481.818984],[24.887187,482.434766],[16.005625,482.515234],[6.186250,481.592891],[-1.574375,479.523984],[-8.795000,476.950703],[-16.994375,474.515234],[-12.387969,481.050859],[-7.030625,485.077734],[-0.655156,487.390859],[7.005625,488.785234],[19.555937,489.796328],[32.873125,489.358984],[46.006563,487.352266],[58.005625,483.655234],[66.836016,479.520742],[75.042500,474.673047],[82.614297,469.128320],[89.540625,462.902734],[95.810703,456.012461],[101.413750,448.473672],[106.338984,440.302539],[110.575625,431.515234],[121.005625,397.515234],[125.414062,385.743047],[129.378125,374.002734],[130.649180,368.058398],[131.155937,362.018672],[130.680664,355.849102],[129.005625,349.515234],[127.667187,353.410703],[126.563125,358.583984],[124.795625,368.515234]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-54.994375,471.845234],[-61.391094,472.921797],[-67.475625,473.407734],[-79.994375,473.515234],[-90.698125,472.704141],[-98.161875,470.791484],[-104.541875,468.490703],[-111.994375,466.515234],[-108.600449,471.477891],[-104.566094,475.203984],[-99.999941,477.870703],[-95.010625,479.655234],[-89.706777,480.734766],[-84.197031,481.286484],[-72.994375,481.515234],[-63.501875,481.517734],[-53.994375,480.305234],[-43.818125,477.518984],[-38.330156,475.359453],[-35.014375,473.015234],[-34.035625,469.400234],[-33.994375,465.515234],[-54.994375,471.845234]]);\r\n }\r\n }\r\n}\r\n\r\nmodule trebleClefScaledDown(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n difference()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[-24.300000,225.711000],[-20.904914,227.744250],[-17.076562,229.283625],[-13.072430,230.346562],[-9.150000,230.950500],[-4.650000,231.375000],[-2.400000,231.375000],[-0.750000,231.477000],[1.200000,231.375000],[6.441938,230.691562],[11.550000,229.228500],[17.963953,226.343086],[23.953500,222.481313],[29.333297,217.804758],[33.918000,212.475000],[36.001313,209.353500],[37.710000,206.025000],[39.239625,200.941266],[40.025625,195.604125],[40.313813,190.189922],[40.350000,184.875000],[40.200000,182.475000],[40.200000,181.875000],[40.050000,180.375000],[40.050000,179.025000],[39.625500,174.675000],[39.108000,169.725000],[38.163000,163.875000],[35.569500,147.525000],[33.061500,131.625000],[32.437500,127.725000],[32.304938,126.901687],[32.011500,126.178500],[31.477125,126.032438],[30.900000,126.094500],[27.900000,126.517500],[21.600000,127.125000],[18.150000,127.275000],[15.900000,127.425000],[6.450000,127.425000],[4.200000,127.275000],[0.450000,127.125000],[-1.050000,126.988500],[-6.900000,126.417000],[-14.121187,125.202375],[-21.150000,123.162000],[-25.122281,121.423898],[-29.721750,119.091937],[-38.100000,114.375000],[-47.735906,108.052430],[-56.707500,100.910437],[-60.888809,97.001440],[-64.837594,92.850727],[-68.531707,88.446009],[-71.949000,83.775000],[-74.397642,79.895827],[-76.585195,75.867117],[-80.229562,67.444687],[-82.987148,58.674914],[-84.963000,49.725000],[-85.938562,43.967437],[-86.674500,38.175000],[-86.875500,35.475000],[-87.300000,30.825000],[-87.300000,28.425000],[-87.450000,26.175000],[-87.300000,21.525000],[-87.144000,20.025000],[-87.144000,18.675000],[-85.863000,9.825000],[-83.910398,1.323727],[-81.214313,-7.041563],[-77.893570,-15.186070],[-74.067000,-23.025000],[-70.168688,-30.111375],[-65.889000,-36.975000],[-58.261688,-47.289750],[-49.794000,-56.925000],[-47.250000,-59.331000],[-44.700000,-61.861500],[-42.000000,-64.288500],[-25.950000,-78.436500],[-11.100000,-90.393000],[-6.600000,-93.877500],[-4.482000,-95.650500],[-4.472062,-97.087125],[-4.762500,-98.625000],[-5.959500,-106.575000],[-7.092000,-115.275000],[-7.774500,-120.675000],[-8.263500,-128.025000],[-8.700000,-135.075000],[-8.844000,-136.575000],[-8.844000,-138.225000],[-9.000000,-140.475000],[-9.000000,-143.175000],[-9.136500,-145.275000],[-9.000000,-147.075000],[-9.000000,-151.575000],[-8.850000,-154.125000],[-8.563500,-159.075000],[-8.374500,-162.825000],[-7.674000,-169.125000],[-6.621562,-176.851500],[-5.077500,-184.425000],[-2.264859,-192.825984],[1.380000,-201.070875],[5.599734,-209.055328],[10.137000,-216.675000],[13.052297,-221.147297],[16.333500,-225.667125],[19.907203,-229.933266],[23.700000,-233.644500],[25.999992,-235.447383],[28.477313,-236.931187],[31.153477,-237.929273],[34.050000,-238.275000],[35.551664,-238.042734],[36.959813,-237.458250],[39.450000,-235.681500],[41.708461,-233.258766],[43.953562,-230.149500],[47.587500,-223.875000],[51.215180,-216.119109],[54.444188,-208.193625],[57.288727,-200.121328],[59.763000,-191.925000],[61.640250,-184.112437],[62.874000,-176.175000],[63.300000,-171.675000],[63.450000,-168.825000],[63.450000,-161.625000],[63.300000,-159.375000],[63.107039,-154.029961],[62.593313,-148.235063],[60.900000,-137.175000],[59.131805,-129.916828],[56.930062,-123.245625],[54.247664,-116.751609],[51.037500,-110.025000],[45.847125,-100.324125],[43.025250,-95.787984],[39.768000,-91.125000],[30.870000,-79.575000],[26.086500,-73.725000],[19.800000,-67.747500],[16.200000,-64.843500],[12.000000,-61.488000],[9.900000,-59.835000],[8.982000,-58.849500],[9.088500,-57.675000],[9.562500,-54.975000],[11.188500,-45.375000],[15.337500,-20.925000],[16.662000,-13.125000],[17.250000,-9.375000],[22.350000,-9.825000],[28.200000,-9.825000],[30.000000,-9.675000],[31.350000,-9.675000],[34.050000,-9.400500],[41.226305,-8.403047],[48.188438,-6.673500],[54.831352,-4.027078],[58.000274,-2.302295],[61.050000,-0.279000],[66.087396,3.804407],[70.584352,8.285977],[74.542960,13.139604],[77.965312,18.339187],[80.853501,23.858622],[83.209617,29.671805],[85.035753,35.752632],[86.334000,42.075000],[86.985750,47.026688],[87.300000,51.975000],[87.450000,54.525000],[87.450000,57.675000],[87.300000,60.075000],[87.006328,64.111453],[86.255250,68.773125],[84.097500,77.325000],[80.820844,85.381289],[76.516500,93.155063],[71.359406,100.390805],[65.524500,106.833000],[61.740750,110.229938],[57.750000,113.380500],[50.635688,118.163250],[43.050000,122.154000],[38.550000,124.125000],[40.390500,136.725000],[43.690500,158.775000],[45.408000,170.025000],[46.644000,180.975000],[46.644000,182.325000],[46.950000,186.525000],[46.950000,193.875000],[46.813500,195.375000],[46.161937,200.995312],[44.746500,206.475000],[42.639000,211.100016],[39.758625,215.768625],[36.462562,220.174547],[33.108000,224.011500],[31.950000,225.081000],[29.193937,227.519250],[26.250000,229.728000],[21.373219,232.657312],[16.221375,234.945375],[10.833844,236.616375],[5.250000,237.694500],[-0.750000,238.275000],[-5.550000,238.275000],[-7.350000,238.119000],[-8.700000,238.119000],[-16.950000,236.862000],[-24.129938,234.818063],[-31.050000,232.021500],[-36.899273,229.032633],[-42.245813,225.473812],[-44.680151,223.412599],[-46.928320,221.127211],[-48.970157,218.590421],[-50.785500,215.775000],[-52.289602,212.730633],[-53.422313,209.539312],[-54.193617,206.240836],[-54.613500,202.875000],[-54.768000,201.225000],[-54.768000,198.375000],[-54.768000,197.025000],[-54.768000,195.675000],[-54.091500,190.425000],[-53.267306,187.018963],[-52.079227,183.666609],[-50.538706,180.433576],[-48.657187,177.385500],[-46.446114,174.588018],[-43.916930,172.106766],[-41.081077,170.007381],[-37.950000,168.355500],[-33.910195,167.014875],[-29.519813,166.258125],[-25.069523,166.129687],[-20.850000,166.674000],[-18.118011,167.475727],[-15.402211,168.636188],[-12.758728,170.114180],[-10.243687,171.868500],[-7.913218,173.857945],[-5.823445,176.041313],[-4.030497,178.377398],[-2.590500,180.825000],[-1.555688,183.216445],[-0.846000,185.575688],[-0.136500,190.575000],[-0.000000,192.975000],[-0.269438,196.226438],[-0.900000,199.425000],[-1.939125,202.504875],[-3.367500,205.425000],[-5.584611,208.570787],[-8.197266,211.317516],[-11.139756,213.701924],[-14.346375,215.760750],[-17.751416,217.530732],[-21.289172,219.048609],[-28.500000,221.475000],[-26.544000,223.709438],[-24.300000,225.711000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[4.500000,-102.885000],[8.250000,-105.975000],[14.046750,-111.119813],[19.650000,-116.475000],[25.966875,-123.077344],[31.965375,-129.996375],[37.559438,-137.242219],[42.663000,-144.825000],[45.803180,-150.212812],[48.660563,-156.006750],[50.961914,-162.022312],[52.434000,-168.075000],[52.884938,-172.119375],[52.950000,-176.175000],[52.522500,-180.525000],[51.656297,-185.449383],[50.014125,-190.334812],[48.819873,-192.574614],[47.333016,-194.578711],[45.520682,-196.271780],[43.350000,-197.578500],[40.037438,-198.534000],[36.600000,-198.675000],[33.481125,-198.269250],[30.450000,-197.388000],[27.309434,-195.899065],[24.469031,-193.970273],[21.905238,-191.674204],[19.594500,-189.083437],[15.637969,-183.308133],[12.411000,-177.225000],[9.124359,-169.568906],[6.484875,-161.672625],[4.415203,-153.602531],[2.838000,-145.425000],[1.525500,-135.225000],[1.336500,-131.775000],[1.050000,-127.575000],[1.050000,-125.025000],[0.900000,-122.625000],[0.900000,-116.775000],[1.050000,-114.525000],[1.200000,-111.225000],[1.525500,-106.575000],[2.100000,-101.175000],[3.351188,-101.946187],[4.500000,-102.885000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[-1.200000,-51.783000],[-9.000000,-45.862500],[-20.798062,-35.766000],[-32.100000,-25.125000],[-37.819500,-19.242563],[-43.287000,-13.125000],[-47.887852,-7.307086],[-52.065562,-1.286812],[-55.891992,4.964367],[-59.439000,11.475000],[-62.232750,17.191102],[-64.721625,23.034187],[-66.825187,29.022680],[-68.463000,35.175000],[-69.279750,39.577500],[-69.763500,44.025000],[-69.900000,45.825000],[-69.900000,50.025000],[-69.763500,51.825000],[-68.545875,60.648750],[-67.488750,65.025047],[-66.142500,69.225000],[-62.558625,77.368313],[-57.942000,84.975000],[-54.251531,89.796937],[-50.169000,94.328625],[-45.762469,98.549250],[-41.100000,102.438000],[-35.104711,106.714383],[-28.818188,110.409562],[-22.222570,113.514961],[-15.300000,116.022000],[-7.579313,118.003875],[0.300000,119.200500],[3.600000,119.488500],[5.100000,119.625000],[8.100000,119.775000],[11.550000,119.775000],[14.100000,119.625000],[19.740750,119.281313],[25.350000,118.534500],[30.900000,117.525000],[29.712000,110.325000],[27.361500,96.225000],[20.187000,52.275000],[17.337000,34.575000],[16.050000,26.475000],[11.529750,26.852438],[7.050000,27.559500],[0.773812,29.571023],[-2.128207,30.952720],[-4.856625,32.595188],[-7.399277,34.506038],[-9.744000,36.692883],[-11.878629,39.163333],[-13.791000,41.925000],[-15.589055,45.253922],[-16.988438,48.772125],[-17.957227,52.429266],[-18.463500,56.175000],[-18.600000,57.975000],[-18.600000,60.675000],[-18.277313,64.530375],[-17.485500,68.325000],[-16.122984,72.208078],[-14.360250,75.877125],[-12.258891,79.370109],[-9.880500,82.725000],[-6.345375,86.855625],[-2.250000,90.430500],[-0.361875,91.745625],[1.650000,92.775000],[0.263250,94.048125],[-0.750000,95.625000],[-6.450000,92.688000],[-12.827063,88.558125],[-18.600000,83.625000],[-23.312227,78.067219],[-27.269438,71.729250],[-30.393305,64.926656],[-32.605500,57.975000],[-33.637313,52.882313],[-34.200000,47.775000],[-34.200000,43.725000],[-33.942000,40.875000],[-33.304594,37.069922],[-32.362875,33.367500],[-29.679000,26.175000],[-27.295327,21.420275],[-24.485930,16.879547],[-21.284927,12.584982],[-17.726438,8.568750],[-13.844581,4.863018],[-9.673477,1.499953],[-5.247243,-1.488275],[-0.600000,-4.069500],[1.050000,-4.767000],[8.100000,-7.296000],[10.650000,-8.025000],[8.911500,-18.525000],[5.212500,-40.875000],[3.000000,-54.375000],[0.865125,-53.215687],[-1.200000,-51.783000]]);\r\n translate([0, 0, -fudge])\r\n linear_extrude(height=h+2*fudge)\r\n polygon([[58.689000,100.425000],[61.568438,95.799375],[63.796500,90.825000],[64.750500,87.825000],[66.101812,81.965250],[66.763500,75.975000],[66.900000,74.175000],[66.900000,67.575000],[66.750000,66.075000],[66.750000,64.725000],[66.475500,62.475000],[65.255063,54.855023],[64.268145,51.169989],[62.992875,47.603063],[61.401340,44.180347],[59.465625,40.927945],[57.157816,37.871962],[54.450000,35.038500],[52.211063,33.220313],[49.800000,31.635000],[45.973008,29.620477],[42.134063,28.160438],[38.153086,27.137180],[33.900000,26.433000],[32.250000,26.181000],[30.900000,26.181000],[29.400000,26.025000],[27.300000,25.902000],[25.500000,26.025000],[22.650000,26.025000],[23.913000,33.825000],[26.463000,49.725000],[32.937000,89.925000],[35.487000,105.825000],[37.050000,115.425000],[43.249852,112.879594],[49.044563,109.586625],[54.251742,105.462844],[56.578011,103.063383],[58.689000,100.425000]]);\r\n }\r\n }\r\n}\r\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"9e4042e6b1f48fe9e6f0f2c707e16e50d6866145","subject":"adjust the connector bar","message":"adjust the connector bar\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_file":"openscad\/models\/src\/main\/openscad\/electronics\/phone-stands\/half-circle\/half-circle-phone-stand.scad","new_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 5;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 5;\n yTranslate = 5;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n color(\"blue\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 45])\n cube([xLength, yLength, zLength], center = true);\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","old_contents":"\nuse <..\/..\/..\/basics\/rounded-edges\/doughnuts\/doughnuts.scad>;\n\nuse <..\/..\/..\/shapes\/geometry\/arc\/extruded\/extruded-arc.scad>;\n\nmodule halfCirclePhoneStand(height = 19.125,\n minkowskiSphereRadius = 0.5,\n arcRadius = 36,\n arcRadiusExtension = 1.5)\n{\n halfCirclePhoneStand_cradle(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = arcRadius,\n radiusExtension = arcRadiusExtension);\n\n halfCirclePhoneStand_stand(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\n\/\/ sub-modules and functions follow\n\nfunction halfCirclePhoneStand_cradle_cutout_zLength() = 4.2;\n\nfunction halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius, \n bedHeight,\n zLength) = minkowskiSphereRadius + (bedHeight \/ 2.0) - (zLength \/ 2.0);\n\nmodule halfCirclePhoneStand_cradle(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension)\n{\n xTranslate = 30;\n yTranslate = 32.7;\n\n difference()\n {\n halfCirclePhoneStand_cradle_bed(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n xTranslate = xTranslate,\n yTranslate = yTranslate);\n\n halfCirclePhoneStand_cradle_cutout(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension,\n bed_xTranslate = xTranslate,\n bed_yTranslate = yTranslate);\n }\n}\n\nmodule halfCirclePhoneStand_cradle_bed(height,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n xTranslate,\n yTranslate)\n{\n zTranslate = minkowskiSphereRadius;\n color(\"magenta\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 213]) \n roundedRectangularArc(angle = 150,\n height = height,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = radiusExtension);\n}\n\nmodule halfCirclePhoneStand_cradle_cutout(bedHeight,\n minkowskiSphereRadius,\n radius,\n radiusExtension,\n bed_xTranslate,\n bed_yTranslate)\n{\n zLength = halfCirclePhoneStand_cradle_cutout_zLength();\n\n cutoutRadiusExtension = radiusExtension + 3;\n\n xTranslate = bed_xTranslate + 0.2;\n yTranslate = bed_yTranslate + 0.2;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength);\n\n color(\"DarkTurquoise\")\n translate([xTranslate, yTranslate, zTranslate])\n rotate([0, 0, 227]) \n roundedRectangularArc(angle = 37,\n height = zLength,\n minkowskiRadius = minkowskiSphereRadius,\n radius = radius,\n radiusExtension = cutoutRadiusExtension);\n}\n\nmodule halfCirclePhoneStand_stand(height,\n minkowskiSphereRadius)\n{\n halfCirclePhoneStand_stand_top(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_connectorBar(bedHeight = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n\n halfCirclePhoneStand_stand_base(height = height,\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_base(height,\n minkowskiSphereRadius)\n{\n color(\"green\")\n translate([0, 0, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 4.9, \/\/ 4.9\n outerRadius = 5.59, \/\/ 5.59\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n\nmodule halfCirclePhoneStand_stand_connectorBar(minkowskiSphereRadius, bedHeight)\n{\n xLength = 40;\n yLength = 3;\n zLength = halfCirclePhoneStand_cradle_cutout_zLength() + minkowskiSphereRadius;\n\n xTranslate = 0;\n yTranslate = 0;\n zTranslate = halfCirclePhoneStand_cradle_cutout_zTranslate(minkowskiSphereRadius = minkowskiSphereRadius, \n bedHeight = bedHeight,\n zLength = zLength)\n + (zLength \/ 2.0);\n\n translate([xTranslate, yTranslate, zTranslate])\n\/\/ rotate([0, 0, 45])\n cube([xLength, yLength, zLength]\n , center = true\n );\n}\n\nmodule halfCirclePhoneStand_stand_top(height,\n minkowskiSphereRadius)\n{\n xTranslate = 8.105; \/\/ 8.05 \/\/ 8.1\n yTranslate = 8.85; \/\/ 8.85 \/\/ 8.9\n\n color(\"green\")\n translate([xTranslate, yTranslate, minkowskiSphereRadius])\n roundDoughnut(height = height,\n innerRadius = 1.9, \/\/ 2.0\n outerRadius = 2.6, \/\/ 2.6\n minkowskiSphereRadius = minkowskiSphereRadius);\n}\n","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"cd2c3e8e7df2afc866e0ff8f698692d1d7c4f2db","subject":"Added empty module femur.","message":"Added empty module femur.\n\nSigned-off-by: Thomas Helmke ","repos":"Syralist\/yet-another-hexapod,Syralist\/yet-another-hexapod","old_file":"hexacad\/leg-parts.scad","new_file":"hexacad\/leg-parts.scad","new_contents":"use \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\nmodule femur()\r\n{\r\n}\r\n\r\n\r\n\/\/coxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();\r\n\r\nfemur();\r\n\r\n","old_contents":"use \r\n\r\nmodule coxa()\r\n{\r\n\twidth = 40;\r\n\tlength = 80;\r\n\twall = 5;\r\n\tradiusaxle = 8.7\/2;\r\n\tradiuswheel = 20.7\/2;\r\n\theightwheel = 2.5;\r\n\tcompwidth = 26;\r\n\tcompheight = 20;\r\n\tcompwall = 8;\r\n\tservowidth = 41;\r\n\tdifference()\r\n\t{\r\n\t\tunion()\r\n\t\t{\r\n\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([length,0,0])\r\n\t\t\t\tcylinder(r=width\/2,h=wall);\r\n\t\t\ttranslate([0,-width\/2,0])\r\n\t\t\t\tcube([length, width, wall]);\r\n\t\t}\r\n\t\tcylinder(r=radiusaxle,h=wall);\r\n\t\ttranslate([0,0,heightwheel])\r\n\t\t\tcylinder(r=radiuswheel,h=wall);\r\n\t}\r\n\tunion()\r\n\t{\r\n\t\t\/\/translate([length-compwall,-width\/2,-compheight])\r\n\t\t\t\/\/cube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight])\r\n\t\t\tcube([compwall,compwidth,compheight]);\r\n\t\ttranslate([length-2*compwall-servowidth,-width\/2,-compheight-wall])\r\n\t\t\tcube([servowidth+2*compwall,compwidth,wall]);\r\n\t}\r\n}\r\n\r\ncoxa();\r\n\/\/translate([80-8,-20,0])rotate([0,90,0])servo_u_holder();","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"08e96f437ca52d7e2fc4a572a1745df42426d6ac","subject":"minor adjustments to bottom.scad","message":"minor adjustments to bottom.scad\n","repos":"iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji,iley\/kamaji","old_file":"3d\/bottom.scad","new_file":"3d\/bottom.scad","new_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 12.5;\nfn = 10;\ngaika_d = 6.25;\ngaika_h = 6;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_d\/2, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","old_contents":"tol = 0.5;\npcb_x = 130;\npcb_y = 110;\npcb_z = 4;\nbolt_d = 3.6;\nshift_bolt = 5;\n\n\/\/ box thickness\nth = 3;\n\nshift_x = th + 1;\nshift_y = th + 1;\n\nbox_x = pcb_x + shift_x + th + 1;\nbox_y = pcb_y + 2*th + 1;\n\npcb_width = 2;\npcb_up = 9;\n\nbox_z = th + pcb_up + pcb_width - 1;\n\n\/\/socket_h = 15;\nsocket_w = 10;\nsocket_n = 5;\nsocket_int = 20;\nstart_socket_x = 20 + shift_x;\nstart_socket_z = th + pcb_z + tol;\neps = 1e-1;\n\nusb_type_b_w = 15.2;\n\/\/usb_type_b_h = 3;\nstart_type_b_y = shift_y + pcb_y - 30.1;\nstart_type_b_z = th + pcb_z + tol;\n\nusb_type_a_w = 17.3;\n\/\/usb_type_a_h = 0.5;\nstart_type_a_y = shift_y + 44.7;\nstart_type_a_z = th + pcb_z + tol;\n\n\/\/ programmator\nmicro_x = 10;\nmicro_y = 21.1;\nmicro_start_x = shift_x + 4.75;\nmicro_start_y = shift_y + pcb_y - 23.3 - micro_y;\n\ncontrast_start_x = shift_x + 38.4;\ncontrast_start_y = shift_y + 25.7;\nvolume_start_x = shift_x + pcb_x - 39.2;\nvolume_start_y = contrast_start_y;\npot_d = 7;\nunder_pcb = 8;\nfn = 10;\ngaika_d = 6.25;\ngaika_h = 2.5;\n\n\n\ndifference() {\n union() {\n difference() {\n cube([box_x,box_y,box_z], false);\n translate([th, th, th]) {\n cube([box_x-2*th+eps, box_y-2*th+eps, box_z-th+eps], false);\n }\n }\n \/\/ under_pcb\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,pcb_up\/2+th-eps]) {\n cube(size=[under_pcb,under_pcb,pcb_up], center=true);\n }\n }\n }\n }\n\n \/\/ bolts\n for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n translate([dx,dy,-eps]) {\n cylinder($fn=fn, r=bolt_d\/2, h=th+pcb_up+2*eps);\n \/\/ gaika\n cylinder($fn=6, r=gaika_d\/2, h=gaika_h);\n }\n }\n }\n\n\/\/ for (i = [0:1:socket_n-1]) {\n\/\/ translate([start_socket_x+i*socket_int-tol, box_y-th-eps, start_socket_z]) {\n\/\/ cube(size=[socket_w+2*tol, th+2*eps, box_z]);\n\/\/ }\n\/\/ }\n\n\/\/ \/\/ usb_in1 type b\n\/\/ translate([box_x-th-eps, start_type_b_y-tol, start_type_b_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_b_w+2*tol, box_z]);\n\/\/ }\n\n\/\/ \/\/ usb_out1 type a\n\/\/ translate([-eps, start_type_a_y - tol, start_type_a_z]) {\n\/\/ cube(size=[th+2*eps, usb_type_a_w + 2*tol, box_z]);\n\/\/ }\n\n \/\/ programmator\n translate([micro_start_x-tol,micro_start_y-tol, -eps]) {\n cube(size=[micro_x+2*tol, micro_y+2*tol, th+2*eps]);\n }\n\n \/\/ contrast\n translate([contrast_start_x, contrast_start_y, -eps]) {\n cylinder($fn=fn, r=pot_d\/2, h=th+2*eps);\n }\n\n \/\/ volume\n\/\/ translate([volume_start_x, volume_start_y, -eps]) {\n\/\/ cylinder($fn=20, r=pot_d\/2, h=th+2*eps);\n\/\/ }\n};\n\n\/\/\/\/ bolts\n\/\/for (dx = [shift_x+shift_bolt, shift_x+pcb_x-shift_bolt]) {\n\/\/ for (dy = [shift_y+shift_bolt, shift_y+pcb_y-shift_bolt]) {\n\/\/ difference() {\n\/\/ translate([dx,dy,pcb_up\/2+th]) {\n\/\/ cube(size=[a,a,pcb_up], center=true);\n\/\/ }\n\/\/ translate([dx,dy,-eps]) {\n\/\/ cylinder($fn=20, r=bolt_d\/2, h=th+pcb_up+2*eps);\n\/\/ }\n\/\/ }\n\/\/ }\n\/\/}\n\n\n\/\/leg_r = t;\n\/\/shift = t\/2+leg_r;\n\/\/for (dx = [shift, a-shift])\n\/\/ for (dy = [shift, b-shift]) {\n\/\/ translate([dx, dy, 0]) {\n\/\/ cylinder(h=c, r=leg_r, $fn=40);\n\/\/ }\n\/\/ }\n\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"25929a92bbba3855feceb1469944bc0b17c25c6f","subject":"The documentation was updated a little.","message":"The documentation was updated a little.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/spur\/spur-rows\/spur-with-rows.scad","new_file":"OpenSCAD\/library\/src\/main\/openscad\/coins-pendants-ornaments\/coins\/spur\/spur-rows\/spur-with-rows.scad","new_contents":"\r\ndifference()\r\n{\r\n\tcylinder (h = 2, r=55, center = true, $fn=100);\r\n\r\n\t\/**\r\n\t * This double for loop creates x and y coordinates for a 4 by 4 grid.\r\n\t * 30 - -30 = 60\r\n\t * 60 \/ 20 = 4\r\n\t *\/\r\n for(x = [-30 : 20 : 30],\r\n y = [-30 : 20 : 30])\r\n {\r\n translate([x, y, -5])\r\n scale([0.1, 0.1, 13.9])\r\n import(\"..\/..\/..\/..\/shapes\/spurs\/spurs-a.stl\");\r\n }\r\n}\r\n","old_contents":"\r\ndifference()\r\n{\r\n\tcylinder (h = 2, r=55, center = true, $fn=100);\r\n \r\n for(x = [-30 : 20 : 30],\r\n y = [-30 : 20 : 30])\r\n {\r\n translate([x, y, -5])\r\n scale([0.1, 0.1, 13.9])\r\n import(\"..\/..\/..\/shapes\/spurs\/spurs-a.stl\");\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"e5c9502b73655bace752853f4837636f12b469d6","subject":"A default height was given to the spur.","message":"A default height was given to the spur.\n","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"OpenSCAD\/src\/main\/openscad\/shapes\/spurs\/spurs-a.scad","new_file":"OpenSCAD\/src\/main\/openscad\/shapes\/spurs\/spurs-a.scad","new_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nspurs(height=5);\r\n\r\nmodule spurs(height)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=height)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}","old_contents":"\r\n\/\/ Module names are of the form poly_(). As a result,\r\n\/\/ you can associate a polygon in this OpenSCAD program with the corresponding\r\n\/\/ SVG element in the Inkscape document by looking for the XML element with\r\n\/\/ the attribute id=\"inkscape-path-id\".\r\n\r\nspurs(5);\r\n\r\nmodule spurs(h)\r\n{\r\n scale([25.4\/90, -25.4\/90, 1]) union()\r\n {\r\n linear_extrude(height=h)\r\n polygon([[13.500000,-56.000000],[29.500000,-55.000000],[54.500000,-55.000000],[58.503750,-55.048750],[60.522969,-55.341719],[62.290000,-56.020000],[64.325156,-57.853594],[66.241250,-60.541250],[69.240000,-66.000000],[80.500000,-87.000000],[106.280000,-135.000000],[118.870000,-159.000000],[122.780000,-198.000000],[124.023594,-204.882813],[125.843750,-209.652500],[128.457031,-214.095937],[132.080000,-220.000000],[148.490000,-248.000000],[153.376719,-256.487656],[155.041895,-259.143652],[156.518750,-260.956250],[158.055137,-262.086816],[159.898906,-262.696719],[165.500000,-263.000000],[214.500000,-263.000000],[214.500000,-213.000000],[213.360000,-196.000000],[213.360000,-154.000000],[213.495000,-150.462500],[213.360000,-147.000000],[196.920000,-117.000000],[156.350000,-45.000000],[125.920000,9.000000],[120.671250,18.592500],[117.385469,23.577187],[115.794199,25.366055],[114.320000,26.400000],[112.797344,26.797500],[110.981250,26.970000],[107.500000,27.000000],[79.500000,27.000000],[65.500000,28.000000],[31.500000,28.000000],[27.943750,28.030000],[24.500000,28.600000],[22.684180,29.597539],[20.548438,31.277812],[15.792500,35.922500],[7.670000,45.000000],[-36.500000,94.040000],[-25.500000,94.040000],[-15.500000,95.000000],[1.500000,95.000000],[22.500000,96.000000],[2.500000,114.080000],[-38.500000,149.000000],[-23.230000,165.000000],[-3.230000,188.000000],[14.500000,210.000000],[-66.500000,189.000000],[-91.500000,263.000000],[-92.970664,261.624141],[-94.426562,259.592500],[-97.197500,254.302500],[-101.500000,244.000000],[-121.500000,198.000000],[-200.500000,222.000000],[-174.840000,182.000000],[-154.500000,151.000000],[-187.500000,128.020000],[-214.500000,108.000000],[-166.500000,103.830000],[-135.500000,101.000000],[-137.410000,77.000000],[-139.590000,41.000000],[-140.500000,31.000000],[-138.108496,32.343340],[-135.722969,34.055469],[-131.038750,38.223750],[-122.500000,47.000000],[-111.500000,57.040000],[-94.500000,74.000000],[-77.500000,27.000000],[-107.500000,26.000000],[-117.196250,25.451250],[-122.812656,24.814531],[-126.090000,23.980000],[-127.513906,22.488438],[-128.773750,20.335000],[-130.730000,16.000000],[-138.200000,-1.000000],[-140.195000,-5.868750],[-140.649688,-8.406719],[-140.330000,-11.000000],[-134.780000,-21.000000],[-120.780000,-45.000000],[-74.650000,-124.000000],[-55.110000,-158.000000],[-46.570000,-206.000000],[-30.280000,-238.000000],[-21.920000,-254.000000],[-19.818750,-257.793750],[-18.535156,-259.646094],[-17.110000,-260.980000],[-15.251406,-261.684844],[-12.943750,-261.983750],[-8.500000,-261.990000],[5.500000,-261.000000],[19.500000,-261.000000],[31.500000,-260.040000],[43.500000,-260.040000],[43.500000,-217.000000],[44.500000,-200.000000],[44.500000,-162.000000],[43.800000,-154.000000],[28.100000,-127.000000],[-14.500000,-56.000000],[13.500000,-56.000000]]);\r\n }\r\n}","returncode":0,"stderr":"","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"0b7936e12fe388d6303efb90279ff9740e886e04","subject":"SD-card mounting drills and hole added","message":"SD-card mounting drills and hole added\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"lcd_case_for_prusa_i3\/front.scad","new_file":"lcd_case_for_prusa_i3\/front.scad","new_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ SD card mounting drills\n translate(sdCardOffset)\n rotate([0,180,0])\n {\n for(offset = [\n [3\/2+1, 3\/2+1, -20\/2],\n [3\/2+1, 31-3\/2-1, -20\/2]\n ])\n {\n translate(offset)\n cylinder(r=3\/2, h=20, $fs=1);\n }\n }\n \/\/ SD card mounting place\n translate(sdCardOffset + [+2\/2, -2\/2, 0])\n rotate([0,180,0])\n cube([45+2,31+2,2+8]);\n\n \/\/ frame-mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","old_contents":"use \nuse \nuse \nuse \nuse \nuse \n\nboxSize = [143, 148, 6+7];\nlcdOffset = boxSize - [98+5, 60+5, 12];\nencoderOffset = [20-14\/2, boxSize[1]-30\/2-15\/2-3, boxSize[2]-(6+7)];\nsdCardOffset = [35, 80, boxSize[2]-6];\nresetButtonOffset = [encoderOffset[0]+14\/2, 68, 1];\n\n\/\/rotate([180, 0, 0])\n{\n difference()\n {\n union()\n {\n \/\/ main mounting legs\n for(offset = [ [boxSize[0]-16, 0, boxSize[2]-7], [boxSize[0]-70, 0, boxSize[2]-7] ])\n translate(offset)\n cube([16, 40+13, 7]);\n \/\/ side mounting wing\n translate([15, 0, 6])\n cube([18, 20, 7]);\n\n difference()\n {\n \/\/ main working area\n cube(boxSize);\n \/\/ prusa's framework corner\n translate([15, 0, 0])\n cube([143-15, 53, boxSize[2]]);\n \/\/ LCD\n translate(lcdOffset)\n {\n \/\/ LCD itself\n translate([1\/2-2\/2, 10-1, 2])\n cube([97+2, 40+2, 10]);\n \/\/ place for PCB\n translate([-2\/2, -1\/2, -lcdOffset[2]-7])\n cube([98+2, 60+1, 10]);\n \/\/ place for cables\n translate([9, 60-5, -2])\n cube([39,10,4]);\n lcdBoard();\n }\n \/\/ encoder\n translate(encoderOffset)\n {\n translate([-2, -1\/2, -8])\n cube([14+2*2, 12+1, 8+6]);\n menuKnob();\n }\n \/\/ SD card mount\n translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button\n translate(resetButtonOffset)\n {\n translate([0, 0, -resetButtonOffset[2]])\n cylinder(r=(16+1)\/2, h=boxSize[2])\n resetButton();\n }\n \/\/ cable guide drill\n translate([boxSize[0]-98-5, 40+16+6, 0])\n cableGuide();\n \/\/ side mounting wing cut-in, so that screw will hold tight\n cube([15, 40, 6]);\n }\n }\n\n \/\/ mounting drills\n for(offsetOY = [ 13\/2+5\/2, 40+13+5])\n for(offsetOX = [15\/2, boxSize[0]-70+16\/2, boxSize[0]-16\/2])\n translate([offsetOX, offsetOY, -1])\n cylinder(r=5\/2, h=6+7+2, $fs=1);\n }\n\n \/\/ LCD stub\n %translate(lcdOffset)\n lcdBoard();\n \/\/ encoder stub\n %translate(encoderOffset)\n {\n menuKnob();\n translate([7, 6, 23+4])\n rotate([180,0,0])\n menuKnobManipulator();\n }\n \/\/ SD card mount stub\n %translate(sdCardOffset)\n rotate([0,180,0])\n sdCardReader();\n \/\/ reset button stub\n %translate(resetButtonOffset)\n resetButton();\n}","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"c2ea9f6a8d7894f3ad5ad6a650d41ea87793cb75","subject":"This is the first commit for Masaka's mask by Data.","message":"This is the first commit for Masaka's mask by Data.","repos":"onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling,onebeartoe\/3D-Modeling","old_file":"openscad\/models\/src\/main\/openscad\/cosplay\/star-trek\/masaka-mask-by-data\/masaka-mask-by-data.scad","new_file":"openscad\/models\/src\/main\/openscad\/cosplay\/star-trek\/masaka-mask-by-data\/masaka-mask-by-data.scad","new_contents":"","old_contents":"","returncode":0,"stderr":"unknown","license":"lgpl-2.1","lang":"OpenSCAD"} {"commit":"65b0ad3b58c261e9d217ab12d4377666b5fe85fc","subject":"Adding CPU enclosure 3d model","message":"Adding CPU enclosure 3d model\n","repos":"sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning,sergesyrota\/hvac-zoning","old_file":"3d-models\/damper-mount\/vent-cpu-mount.scad","new_file":"3d-models\/damper-mount\/vent-cpu-mount.scad","new_contents":"\/*\nThis box generator is taken from here: http:\/\/www.thingiverse.com\/thing:66030\nYou need to have it in your library folder to be able to generate the enclosure properly.\n\n@brief Generic Electronic Device Packaging for Tyndall version 2\n@details This OpenSCAD script will generate a 2 part fit together packaging.\n\nThis starts with the user entering some basic values:\n\t1. Dimensions of the object to be packaged in XYZ (device_xyz, [x,y,z])\n\t2. Size of the gap between each side of the object and the internal wall of the packaging (clearance_xyz, [x,y,z])\n\t3. How thick the material of the packaging is (wall_t)\n\t4. The external radius of the rounded corners of the packaging (corner_radius)\n\t5. How many sides do these rounded corners have? (corner_sides, 3 to 10 are good for most items, 1 will give you chamfered edges)\n\t6. How high is the lip that connects the 2 halves? (lip_h, 1.5 to 3 are good for most applications)\n\t7. How tall is the top relative to the bottom? (top_bottom_ratio, 0.1 to 0.9, 0.5 will give you 2 halves of equal height)\n\t8. Does the part have mouse ears or not? (has_mouseears, true or false)\n\t9. How thick the flat discs that make the mouse ears should be (mouse_ear_thickness, twice print layer thickness is a good idea)\n\t10. How large the flat discs that make the mouse ears are (mouse_ear_radius, 5 to 15 generally work well)\n\t11. What parts you want and how they are laid out (layout, [beside, stacked, top, bottom])\n\t12. How far apart the 2 halves are in the \"beside\" layout (separation, 2 is good)\n\t13. How much of an overlap (-ve) or gap (+ve) is there between the inner and outer lip surfaces (lip_fit, a value of 0 implies they meet perfectly in the middle, this will depend on your material printer etc. so you will likely need to play around with this variable)\n\nNext the user can modify the data structures that create holes, posts and text on each face of the packaging. These are complicated and may require you to play around with values or read some of the comments further down in the code\n\t1. The cutouts and depressions used on the packaging (holes=[[]])\n\t\tformat for each hole [face_name, shape_name, shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,,,]]\n\t2. The internal supporting structures used on the packaging (posts=[[]])\n\t\tformat for each post [face_name, shape_name shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,,,]]\n\t3. The engraved text used on the packaging (text=[[]])\n\t\tformat for each piece of text [face_name, text_to_write, shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,font_height,font_spacing,mirror]] Note: for silly reasons mirror must be 0 or 1 corresponding to false and true in this version\n\t\n\tWhich of the 6 sides of the packaging do you want this feature on? (face_name, T,B,N,E,W,S)\n\t\t\"T\", The Top or Z+ face\n\t\t\"B\", The Bottom or Z- face\n\t\t\"N\", the North or Y+ face\n\t\t\"E\", the East or X+ face\n\t\t\"W\", the West or X- face\n\t\t\"S\", the South or Y- Face\n\tWhere on the face do you want this feature (shape_position [x_pos,y_pos,x_offs,y_offs,rotate,align] )\n\t\tx_pos, how far along the face do you move in X\n\t\ty_pos, how far along the face do you move in Y\n\t\tx_offs, where along the face do you take measurements from in X\n\t\ty_offs, where along the face do you take measurements from in Y\n\t\trotate, how much do you want the object rotated in degrees\n\t\t\tif you do not use any of the above please set them to 0! do not just leave them empty!\n\t\talign, do you want the object aligned with the \"inside\" or the \"outside\" of the packaging face\n\t\t\n\tWhat shape do you want? (shape_name, Cone\/Ellipse\/Cylinder\/Round_Rect\/Square\/Rectangle\/Nub_Post\/Dip_Post\/Hollow_Cylinder)\n\tWhat are the shape's dimensions (shape_size[depth,,,])...you will need to read the section below as they are different for each shape\n\t\t\"Square\" shape_size[depth, length_breadth]\n\t\t\"Rectangle\" shape_size[depth, length, breadth]\n\t\t\"Round_Rect\" shape_size[depth, length, breadth, corner_radius, corner_sides]\n\t\t\"Cylinder\" shape_size[depth, radius ,sides]\n\t\t\"Ellipse\" shape_size[depth, radius_length, radius_breadth, sides]\n\t\t\"Cone\" shape_size[depth, radius_bottom, radius_top ,sides]\n\t\t\"Nub_Post\" shape_size[depth, radius_bottom, radius_top, depth_nub, sides]\n\t\t\"Dip_Post\" shape_size[depth, radius_bottom, radius_top, depth_dip, sides]\n\t\t\"Hollow_Cylinder\" shape_size[depth, radius_outside, radius_inside ,sides]\n\tA string of text you want to have carved into a face (text_to_write)\n\t\tfor text shape_size[depth,font_height,font_spacing,mirror]\n\nOnce the user has provided this data the shape is made as follows:\n\t1. Calculate external size of packaging based on \"device_xyz\", \"clearance_xyz\" & \"wall_t\"\n\t2. Create Hollow cuboidal shape by differencing a slightly smaller one from a slightly larger one\n\t3. From \"posts\" create internal support structures and union that with the previous shape\n\t4. From \"holes\" create shapes on each face and difference that from the previous shape\n\t5. From \"text\" create letters on each face and difference that from the previous shape\n\t6. Using the packaging height, \"lip_h\", \"top_bottom_ratio\" & \"lip_fit\" split teh previous shape into a top and bottom half\n\t7. Using layout & separation arrange the parts as specified by the user\n\t8. Using layout, mouse_ears, mouse_ear_thickness & mouse_ear_radius union the mouse ears to the previous shapes correctly\n\t9. Done!\n\n\n\nAuthor Mark Gaffney\nVersion 2.6k\nDate 2013-07-09\n\n@ToDo:\nfix internal radii no-of-sides when using chamfered package to maintain wall thickness\n\nWarning:\n\tSome combinations of values, shapes and locations etc. may lead to an invalid or non-manifold shape beign created, preventing you from exporting a .stl\n\tIf this happens try to remove or change some of the features or values until you get a valid shape and then add them back gradually until you find the offending item, then change it so it doesn't cause a problem\n\t\n\tNote: This thing uses HarlanDMii's\"write.scad\" module http:\/\/www.thingiverse.com\/thing:16193\n\twhich you will need to have downloaded and located in the directory if you want to run this on your PC\n\t\n\tGenerating text can be very slow!\n\t\n\tWhen generating a stacked layout it may look like the top is taller than it should be, this seems to be a visualisation bug in OpenSCAD, if you create a .STL it will be perfect\n\n@note\nWIMUv4 variant 2013\n\tThis variant is used to make a production packaging for WIMUv3a\n\nChanges from previous versions:\nv2.6k\n\tmoved and enlarged uUSB & switch holes to prevent fragile structures being formed on advice of i.materialise\n\tmoved lables for switch, uUSB and uSD from top to sides of object\nv2.6j\n\tadded text for indicating switch on\/off\n\tadded holes and guides for internal reset\/bootloader-enable switches\n\tadded a hole for screw in screwpost\nv2.6i\n\tpackaging for WIMUv4 2013 version with small battery (same size as WIMUv3a and WIMUv3\n\tbegan to fix a bug where interlocking features didn't generate in the correct location if the top_bottom_ratio wasn't 0.5\n\t\tonly implemented and tested for spheroids\nv2.6h\n - \tadded option to choose style of interlocking features\n - \t\tadded new style of interlocking features(overlapping spheroid)\n - \tChanged depth of uUSB overmold cutout to remove unnecessary features\n - \tadded cutout beneath uUSB to enahnce visibility of SMT LEDs\n - \tAdded option to flip the halves if only makigna top or bottom\n\nv2.6g\n - \tchanged style of interlocking cutouts (overlapping flattened hemi-hexagonal prisms)\n - \tadded interlocking feature on side with many cutouts\n - \tadded support for controlling the r1 and r2 and height of the interlocking features (note: the side with cutouts has hardcoded length of 19)\n - \tmoved switch cutout down 0.5mm\n - \trotate post above zigbee from 30 to 0\n - \tremove post_tolerance from \"PCB lateral retainers\" as fit was very loose on prototypes and they can be easily pared down with a file etc.\nv2.6f\n - \tmodified tolerances from 0.2-0.35 on advice from i.materialise as minimum tolerance is 0.3mm\n - \tadded simple interlocking feature on centre of lips (slightly interlocking hemispherical tongue & groove)\n - \tmade corners more rounded (moved from 3 facets to 9)\nv2.6e\n - \tmodified text especially size and depth for i.materialise order 0.4-0.5mm wide and deep\n - \tensure model is output as 2 separate stl files with 1 part each!\nv2.6d\n - \tImplemented flanges on bottom half based on belt_holder_v3.1.scad\nv2.6c\n - \tImplemented ability to choose box shape i.e. \"cuboid\",\"rounded4sides\", \"rounded6sides\", \"chamfered6sides\"\n - \tEnsured \"box_type\" module is used in generation of each box_half\nv2.6b\n - \tinvestigated and fixed some top lip mis alignment\n - \tadded wimuv3 stack as imported .stl\nv2.6\n - \timplements loading external objects (such as .stl files) to place on faces\n - \timplemented overlooked translation of text on faces from previous version\n - \tfixed box_t in make_cutouts\n - \tNote: Top lip seems to be malformed lip_h is 0.5 less than it should be\nv2.5 (AKA cutouts_on_faces_for_loop-v0_2.scad)\n - \tImplement tolerancing of connection between 2 halves using lip_fit\n - \timplement text on faces\n - \tComplete documentation\nv2.4 (AKA cutouts_on_faces_for_loop-v0_4.scad)\n - \tuser provides device dimensions and internal clearance(s), packaging dimensions are calculated based on this\n - \tpreparations to allow for different wall_t in x,y,z\n - \timplement posts\n - \tmouse ears work properly\n - \t2 halves in \"beside\" layout joined by union\n\nv2.3 2013-03-23 (AKA cutouts_on_faces_for_loop-v0_3.scad)\n - \tfixed calls to make_box and half_box modules\n - \tadded ability to handle \"holes\" array for making cutouts to make_box and half_box modules\n - \tadded module for rounded cuboid\n - \tfixed errors on rounded cuboid cutouts's use of a_bit\n - \tfixed translate errors for making lips on box\n - \tensured all parts generate on z=0\n - \tgave top (greenish) and bottom (reddish) different colours for ease of identification\n - \trotated top in \"beside\" layout to more intuitive orientation\n - \tadded box cross module and included in hull calculations to ensure box sizes are exact even with low side count\n - \tadded box_type module to allow choice of different shaped boxes or automatically swap them based on the current variables\n - \tadded mouse_ears module\n Note: In stacked mode you may notice the red half looks like it is the full length, this appears to be a visualisation bug in openscad, the part is generated correctly\n\nv2.2 2013-03-22 (AKA cutouts_on_faces_for_loop-v0_2.scad)\nbased on My own structure\n - \tNew format [face_name, shape_name, shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,,,]]\n - \t - \tface_name (\"N\", \"S\", \"E\", \"W\", \"T\", \"B\")\n - \t - \tshape_name (\"Square\", \"Rectangle\" , \"Round_Rect\", \"Cylinder\", \"Ellipse\" , \"Cone\")\n - \t - \tshape_position[x_pos,y_pos,x_offs,y_offs,rotate,align=(\"inside\" or \"outside\")]\n - \t - \t - \t\"Square\" shape_size[depth, length_breadth]\n - \t - \t - \t\"Rectangle\" shape_size[depth, length, breadth]\n - \t - \t - \t\"Round_Rect\" shape_size[depth, length, breadth, corner_radius, corner_sides]\n - \t - \t - \t\"Cylinder\" shape_size[depth, radius ,sides]\n - \t - \t - \t\"Ellipse\" shape_size[depth, radius_length, radius_breadth, sides]\n - \t - \t - \t\"Cone\" shape_size[[depth, radius_bottom, radius_top ,sides]\n\n - \tpos_x and pos_y are chosen to align with views taken from the North, Top or East faces towards the origin so that they are aligned with [-x,+z], [+x,+y] & [+y,+z] respectively\n - \trotation is clockwise about the plane of the North, Top or East faces as lookign towards the origin this means they are anticlockwise for the opposite faces(i.e. same convention as above)\n - \tthese 2 conventiosn are chosen to make it easier to position cutouts that align with oppsite sides. e.g. a box that fits around a rotated ellipse pipe\n\t\nv2.1 2013-03-22 (AKA cutouts_on_faces_for_loop-v0_1.scad)\n - based on kitlaan's array structure, supporting cones and rectangles\n - from kitlaan's Customisable Electronic Device Packaging http:\/\/www.thingiverse.com\/thing:8607\n - \t - \trect [ x-offset, y-offset, x-width, y-width, corner-radius, corner-sides, depth, rotate ]\n - \t - \tcylinder [ x-offset, y-offset, inner-radius, outer-radius, sides, depth, rotate ]\n\n @attention\nCopyright (c) 2013 Tyndall National Institute.\nAll rights reserved.\nPermission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without written agreement is hereby granted, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. \n\nIN NO EVENT SHALL TYNDALL NATIONAL INSTITUTE BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF TYNDALL NATIONAL INSTITUTE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nTYNDALL NATIONAL INSTITUTE SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN \"AS IS\" BASIS, AND TYNDALL NATIONAL INSTITUTE HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n\n*\/\na_bit=0.1;\n\/* [User Controls] *\/\n\/\/dimensions of the object to be packaged\ndevice_xyz=[23,37,18];\n\/\/size of the gap between each side of the object and the internal wall of the packaging\nclearance_xyz=[0.5,0.25,0.5];\/\/\n\/\/how thick the material of the packaging in each direction\/\/recommend keeping X&Y value the same\n\/\/wall_thickness_xyz=[2,2,1];\/\/not yet implemented!!!\n\n\/\/how thick the material of the packaging\nwall_t=3;\/\/thickness\/\/actual most recent version has a base thickness of 2 but that is not yet fully implemented in this code\n\n\/\/The external radius of the rounded corners of the packaging\ncorner_radius=clearance_xyz[1]+wall_t;\n\n\/\/How many sides do these rounded corners have?\ncorner_sides=9;\n\n\/\/How high is the lip that connects the 2 halves?\nlip_h=2;\n\n\/\/How tall is the top relative to the bottom\ntop_bottom_ratio=0.65;\n\n\/\/Does the part have mouse ears or not?\nhas_mouseears=false;\/\/[true, false]\n\n\/\/how thick the flat discs that make the mosue ears should be (twice print layer thickness is a good idea)\nmouse_ear_thickness=0.32*2;\n\n\/\/how large the flat discs that make the mouse ears are (5 to 15 generally work well)\nmouse_ear_radius=10;\n\n\/\/the layout of the parts\nlayout=\"beside\";\/\/[beside, stacked, top, bottom, topflipped, bottomflipped]\n\n\/\/the orientation of the individual top\/bottom half parts when generated separately\nflipped=true;\/\/[true, false]\n\n\/\/how far apart the 2 halves are in the \"beside\" layout\nseparation=4;\/\/2;\n\n\/\/how much of an overlap (-ve) or gap (+ve) is there between the inner and outer lip surfaces, a value of 0 implies they meet perfectly in the middle\nlip_fit=0.5;\n\n\/\/does it have an imported representaion of the actual device to be packaged?\nhas_device=false;\/\/true\/false\n\n\/\/what style of box is it\nbox_type=\"rounded4sides\";\/\/\"rounded4sides\";\/\/\"cuboid\",\"rounded4sides\", \"rounded6sides\", \"chamfered6sides\"\n\n\/\/data structure defining all the cutouts and depressions used on the packaging\nholes = [ \/\/format [face_name, shape_name, shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,,,]]\n [\"S\", \"Rectangle\", [0, 0, -1.5, -device_xyz[2]\/2+5.5, 0, \"inside\"], [wall_t, 14, 7]],\n [\"W\", \"Rectangle\", [0, 0, -1.5, -device_xyz[2]\/2+5.5, 0, \"outside\"], [wall_t+3, 39, 7]],\n \/\/ Reset button; Not needed, really.\n \/\/[\"T\", \"Cylinder\", [0, 0, 0.5, -device_xyz[1]\/2+6, 0, \"outside\"], [wall_t, 1.5, 10]],\n \n\t\/\/[depth, length, breadth, corner_radius, corner_sides]\n\t];\n\n\n\tpost_tolerance=0.2;\n\/\/data structure defining all the internal supporting structures used on the packaging\nposts = [ \/\/format [face_name, shape_name shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,,,]]\n\t \n\t];\n\/\/data structure defining all the engraved text used on the packaging\ntext_engrave_emboss_depth=1;\ntext_height_big=7;\ntext_height_small=3;\ntext_spacing=1.1;\ntext = [\/\/recessed text on faces [face_name, text_to_write, shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth,font_height,font_spacing,mirror]] Note: for silly reasons mirror must be 0 or 1 corresponding to false and true in this version\n\t\/\/[\"T\", \"WIMUv4\",\t\t[0,6,0,0,0,\"outside\"], \t\t\t\t[text_engrave_emboss_depth,text_height_big,text_spacing,0]],\n\t\/\/[\"T\", \"+Z\",\t\t\t[0,-6,0,0,0,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_big,text_spacing,0]],\n\n\t\/\/[\"S\", \"uSD\",\t\t[-5,6.5,0,0,0,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_small,text_spacing,0]],\n\t\/\/[\"E\", \"I O\",\t\t[-10,-4,0,0,0,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_small,text_spacing,0]],\n\t\/\/[\"E\", \"USB\",\t\t[4,-4,0,0,0,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_small,text_spacing,0]],\n\t\/\/[\"S\", \"+X\",\t\t\t[10,0,0,5,0,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_big,text_spacing,0]],\n\t\/\/[\"N\", \"-X\",\t\t\t[0,0,0,0,0,\"outside\"], \t\t\t\t[text_engrave_emboss_depth,text_height_big,text_spacing,0]],\n\t\/\/[\"W\", \"-Y\",\t\t\t[0,0,0,0,0,\"outside\"], \t\t\t\t[text_engrave_emboss_depth,text_height_big,text_spacing,0]],\n\t\/\/ [\"E\", \"+Y\",\t\t\t[0,0,0,0,0,\"outside\"], \t\t\t\t[text_engrave_emboss_depth,text_height_big,text_spacing,0]],\n\t\/\/ [\"T\", \"USB\",\t\t[21,4,0,0,270,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_small,text_spacing,0]],\n\t\/\/ [\"T\", \"O I\",\t\t[21,-10,0,0,90,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_small,text_spacing,0]],\n\t\/\/ [\"T\", \"uSD\",\t\t[-5,-14,0,0,0,\"outside\"], \t\t\t[text_engrave_emboss_depth,text_height_small,text_spacing,0]],\n\t];\n\n\n\/\/data structure defining external items such as .stl files to import\nitems =[\/\/external items on faces [face_name, external_file, shape_position[x_pos,y_pos,x_offs,y_offs,rotate,align], shape_size[depth, scale_x,scale_y, scale_z, mirror]] Note: for silly reasons mirror must be 0 or 1 corresponding to false and true in this version\n\t\/\/[\"B\", \"tyndall_logo_v0_2.stl\",\t\t\t[0,0,0,0,00,\"outside\"], \t\t\t\t\t[0.5,10\/21.9,10\/21.9,1.1\/1.62,0]]\n\t];\n\n\/\/add external slotted flanges for say passing a belt or strap through in Z plane on up to 4 sides\nhas_flanges=true;\/\/[true, false]\n\/\/how thick are the flanges in Z-direction\nflange_t=wall_t;\n\/\/how \"tall\" is the slot in the flange i.e. thick is the material you will want to pass through the slot in the flange\nslot_t=5;\n\/\/how wide is the slot in the flange\nslot_w=5;\n\/\/define the flanges on each of the four sides\nflanges=[\n\/\/flange_sides, flange_type, position[x_pos, y_pos], shape_size[flange_t, flange_case_gap, flange_wall_t,slot_b,slot_l,flange_sides]\n\t[\"N\",\"rounded_slot\",[0,0],\t[flange_t,1,wall_t,slot_t,slot_w,corner_sides]],\n\t[\"S\",\"rounded_slot\",[0,0],\t[flange_t,1,wall_t,slot_t,slot_w,corner_sides]],\n\t\/\/ [\"E\",\"rounded_slot\",[0,0],\t[flange_t,0,wall_t,slot_t,slot_w,corner_sides]],\n\t\/\/ [\"W\",\"rounded_slot\",[0,0],\t[flange_t,0,wall_t,slot_t,slot_w,corner_sides]],\n\t\n\t\/\/[\"S\",\"2_holes\",\t\t[0,0], \t[flange_t,0,wall_t,hole_center_sep,hole_r,box_s]],\/\/[]\n];\n\/* [Hidden] *\/\n\/\/a small number used for manifoldness\na_bit=0.01;\n\/\/x dimension of packaging\nbox_l=device_xyz[0]+2*(clearance_xyz[0]+wall_t); \/\/box_l=device_xyz[0]+2*(clearance_xyz[0]+wall_thickness_xyz[0]);\n\/\/y dimension of packaging\nbox_b=device_xyz[1]+2*(clearance_xyz[1]+wall_t); \/\/box_b=device_xyz[1]+2*(clearance_xyz[1]+wall_thickness_xyz[1]);\n\/\/z dimension of packaging\nbox_h=device_xyz[2]+2*(clearance_xyz[2]+wall_t);\/\/box_h=device_xyz[2]+2*(clearance_xyz[2]+wall_thickness_xyz[2]);\n\/\/join together the 3 relevant mouse ear values\nmouse_ears=[has_mouseears, mouse_ear_thickness, mouse_ear_radius];\n\/\/join together the 5 relevant box values\nbox=[box_l,box_b,box_h,corner_radius,corner_sides,wall_t];\/\/\n\n\/\/choose if your packaging has a lockign feature between the lips\nhas_locking_feature=true;\/\/true, false\n\/\/choose the shape of this locking feature\nlocking_feature_type=\"spheroid\"; \/\/[\"spheroid\", \"hexagonal\", \"groove\"]\n\n\/\/for groove type locking features\nlocking_feature_r=lip_h\/4;\n\n\/\/for hexagon type locking features\n\/\/radius 1 of locking feature for hexagon type locking features\nlocking_feature_r1=lip_h\/4;\n\/\/radius 2 of locking feature for hexagon type locking features\nlocking_feature_r2=lip_h\/6;\n\/\/height (actually more like length) of locking features along X-direction for hexagon type locking features\nlocking_feature_hx=20;\n\/\/height (actually more like length) of locking features along Y-direction for hexagon type locking features\nlocking_feature_hy=15;\n\n\/\/for spheroid type locking feature\n\/\/height of locking features above vertical surface for spheroid type locking features\nlocking_feature_max_h=lip_fit;\n\/\/depth of locking features from top to bottom in direction of lip h for spheroid type locking features\nlocking_feature_max_d=lip_h\/2;\n\/\/length of locking features along X-direction for spheroid type locking features\nlocking_feature_max_lx=20;\n\/\/length of locking features along Y-direction for spheroid type locking features\nlocking_feature_max_ly=10;\n\n\/\/********************************includes******************\/\/\nuse;\n\n\/\/******************************calls**********************\/\/\n\tmake_box(box,corner_radius, corner_sides, lip_h, lip_fit, top_bottom_ratio, mouse_ears, layout, flipped, separation, holes, posts, text, items, has_device, box_type, has_flanges, flanges);\n\ninclude ;","old_contents":"","returncode":1,"stderr":"error: pathspec '3d-models\/damper-mount\/vent-cpu-mount.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"a66de907b52b33ef4cf29736d312224a2304f091","subject":"cube made bigger, so that there will be anything to print at all... ;)","message":"cube made bigger, so that there will be anything to print at all... ;)\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"3d_cube\/3d_cube.scad","new_file":"3d_cube\/3d_cube.scad","new_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([5, 10, 4]);\n","old_contents":"\/*\n * small 3D cube for test prints\n *\/\ncube([1, 2, 0.5]);\n","returncode":0,"stderr":"","license":"mit","lang":"OpenSCAD"} {"commit":"44a2bf755f379fa2aee1d74b2cc7ac06321d29a3","subject":"moineau: temporary change shaft to M8","message":"moineau: temporary change shaft to M8\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"350fa2168a89074b0a4c59e3c3051d1ca2ba91b1","subject":"Minor changes to Z-axis","message":"Minor changes to Z-axis\n","repos":"Scalpel78\/CNC-Machine","old_file":"zaxis.scad","new_file":"zaxis.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f60c4125d57732a1573c9cc189de366b06e9d6a0","subject":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019","message":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Impression' did not match any file(s) known to git\nerror: pathspec '3D\/Mod' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Creatr\/Maintien' did not match any file(s) known to git\nerror: pathspec 'fil' did not match any file(s) known to git\nerror: pathspec 'souple.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"2ae85c60d285bf91d4d8fa67ec14a3bed0eeb144","subject":"Adjust nut to prevent middle strings slipping out","message":"Adjust nut to prevent middle strings slipping out\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Measurements.scad","new_file":"Ukulele\/Measurements.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"36cbfc06c510790207b6f8672c6197a4ce36a8c7","subject":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019","message":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Impression' did not match any file(s) known to git\nerror: pathspec '3D\/Mod' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Creatr\/Maintien' did not match any file(s) known to git\nerror: pathspec 'fil' did not match any file(s) known to git\nerror: pathspec 'souple.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"8da9747db06790a4dd37e7daae4d6a6c1c0ddd40","subject":"Add missed change","message":"Add missed change\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Ukulele.scad","new_file":"Ukulele\/Ukulele.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"71eb924dae05d301e98c808ebd2ea915913de586","subject":"+ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019","message":"+ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Impression' did not match any file(s) known to git\nerror: pathspec '3D\/Mod' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Creatr\/Maintien' did not match any file(s) known to git\nerror: pathspec 'fil' did not match any file(s) known to git\nerror: pathspec 'souple.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"d943aa4100273a500fab14815f0a8e720e91c0dd","subject":"[3d] Increase front offset 0.8->1.0, move probes back 0.6mm, decrease pic_ex 2->1.7","message":"[3d] Increase front offset 0.8->1.0, move probes back 0.6mm, decrease pic_ex 2->1.7\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"99ed6b4cabcd88e7793c9b9b86cf872574b25b69","subject":"[3d] Return LCD screw holes to the case by request","message":"[3d] Return LCD screw holes to the case by request\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"52274a4c94789dd655f9d1fcd16654f0157cfdfe","subject":"[3d] Fix USB pillar reinforcements for walls <2.0mm","message":"[3d] Fix USB pillar reinforcements for walls <2.0mm\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"0c0be2d20275525a858e3fed6fcebe693063f431","subject":"[3d] Add USB pillar reinforcements","message":"[3d] Add USB pillar reinforcements\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"52c98fc3c1f2f22268fe447540cda40328b77211","subject":"moineau: extract BOLT_MARGIN","message":"moineau: extract BOLT_MARGIN\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"1bfea4b0eeacc5e4805145bcfc643fbc5c242276","subject":"slice_r=4.4 for rotor. Still not air-tight","message":"slice_r=4.4 for rotor. Still not air-tight\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"9ceb4396e230b143ec6cc450ed56fcbf20f58bbb","subject":"moineau: extract ROTOR_SLICE_R and REAL_ROTOR_SLICE_R = ROTOR_SLICE_R + ROTOR_SLICE_FIT.","message":"moineau: extract ROTOR_SLICE_R and REAL_ROTOR_SLICE_R = ROTOR_SLICE_R + ROTOR_SLICE_FIT.\n\nThis is a step towards reducing slice_r\/rotate_r and making the rotor metallic.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"73184b6022edb167e18f745054c9d528bc34ed34","subject":"moineau: implement nose with male luer fit (no threading). It's not great, but should be ok for now.","message":"moineau: implement nose with male luer fit (no threading). It's not great, but should be ok for now.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"53ec5e51e1e1e08aecfec7f314fffaee8ea53ee1","subject":"edge.scad: use r=1.8 mm hole to allow M3 bolt to rotate freely.","message":"edge.scad: use r=1.8 mm hole to allow M3 bolt to rotate freely.","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"972bb980bd6a52393ec57bf207ca54bdb78a10c0","subject":"Add power hole and make channel larger","message":"Add power hole and make channel larger\n","repos":"ehaskins\/OpenSCAD","old_file":"Printrbot Power Base\/base.scad","new_file":"Printrbot Power Base\/base.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"939b711f673a63bbda2a1438575aea19d31a407c","subject":"Create fret board mount screw test print","message":"Create fret board mount screw test print\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Tests\/FretBoardScrewDia.scad","new_file":"Ukulele\/Tests\/FretBoardScrewDia.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"59b04eba8f6b1d5a9ade224bd16734ad3434f034","subject":"moineau: rotor now has a oldham coupling.","message":"moineau: rotor now has a oldham coupling.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"ca9daf4a33bd41f1706b61b444c9ce0e84896f41","subject":"Test 1 time for dryer arrows","message":"Test 1 time for dryer arrows\n","repos":"ehaskins\/OpenSCAD","old_file":"Dryer Arrows\/Arrow.scad","new_file":"Dryer Arrows\/Arrow.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"6984528995754a3a7420333fafeee1ab12234d54","subject":"updates","message":"updates\n","repos":"holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger","old_file":"Misc 3d\/SpeakerMount.scad","new_file":"Misc 3d\/SpeakerMount.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc' did not match any file(s) known to git\nerror: pathspec '3d\/SpeakerMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"6edbcf936b28b9e65439d8545e58d49d29a60206","subject":"base_10 removed","message":"base_10 removed\n\n","repos":"diesphink\/openscad,diesphink\/openscad","old_file":"Order of the Gilded Compass\/base_10.scad","new_file":"Order of the Gilded Compass\/base_10.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Order' did not match any file(s) known to git\nerror: pathspec 'of' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Gilded' did not match any file(s) known to git\nerror: pathspec 'Compass\/base_10.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"2ef70bb99da5f3d3225868f6219a8a99b3f3542d","subject":"Add left hinge for Ultimaker 2 door","message":"Add left hinge for Ultimaker 2 door","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"left_hinge.scad","new_file":"left_hinge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"781e2538a838287feeda27a224f2b684d2bcde87","subject":"moineau: extract outer_neck_r.","message":"moineau: extract outer_neck_r.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"b10d5e763c158bc4818590a1a3ff0cb7a429315c","subject":"edge.scad: add hinge hole (r=1.6)","message":"edge.scad: add hinge hole (r=1.6)","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"0ef19f753d41af35b5c62ed4823ec515c98736f2","subject":"left_hinge: increase space between hinges from 10 mm to 11 mm.","message":"left_hinge: increase space between hinges from 10 mm to 11 mm.","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"left_hinge.scad","new_file":"left_hinge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5b7f1e377ac802dbda5e85c0377cc4deb5a4d6ef","subject":"Fix manifoldness issue","message":"Fix manifoldness issue\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Bridge.scad","new_file":"Ukulele\/Bridge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5a197a6695631fe6b78154de2e78bd87c6fa9fca","subject":"Added Center Mount","message":"Added Center Mount\n","repos":"holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger","old_file":"Misc 3d\/SpeakerCenterMount.scad","new_file":"Misc 3d\/SpeakerCenterMount.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc' did not match any file(s) known to git\nerror: pathspec '3d\/SpeakerCenterMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"9f4c7fb3970f6fc69175046aecec71e10722eaa1","subject":"moineau: it can be rotated in the manual mode, but not perfect. Needs more trials.","message":"moineau: it can be rotated in the manual mode, but not perfect. Needs more trials.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"ebae5be5e490b55e77646d471eca634581886503","subject":"added a few more connectors","message":"added a few more connectors\n","repos":"TomHodson\/Raspberry-Pi-OpenSCAD-Model,D4p0up\/Raspberry-Pi-OpenSCAD-Model","old_file":"raspberry pi.scad","new_file":"raspberry pi.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'raspberry' did not match any file(s) known to git\nerror: pathspec 'pi.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"699950bd12d26d2fb944f56953a2316728f4aa3d","subject":"[3d] Reduce wall thickness by 0.14mm","message":"[3d] Reduce wall thickness by 0.14mm\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"1eee7900b6e6cc6d05273e4273d502b305caff7e","subject":"[3d] Reduce the size of the Pi right edge stop -0.5mm","message":"[3d] Reduce the size of the Pi right edge stop -0.5mm\n\nIt makes the case a little more difficult to assemble if the Pi jams up\non it\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e49710f44832253b83577b5a9178a0a2d32d9c20","subject":"Update pontoon shape per Bill's request","message":"Update pontoon shape per Bill's request\n","repos":"ehaskins\/OpenSCAD","old_file":"Pontoon Tip\/Tip.scad","new_file":"Pontoon Tip\/Tip.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"06c2ed544523a50c6b9ad00bbd37b89e8889a2ae","subject":"[3d] Make nuttraps less round on nut opening side for less overhang","message":"[3d] Make nuttraps less round on nut opening side for less overhang\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f15af0eb35d9c0098e61226898156052c4642431","subject":"[3d] Add small lips to front, left, and right sides to help with alignment","message":"[3d] Add small lips to front, left, and right sides to help with alignment\n\nAlso changes meaning of lip_tip_clip in locklip_n to clip the top edge\ninstead of the point\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"31688e48cfbbdfcdb8a556e6f7bb721c2e3b1511","subject":"Improved Z-axis","message":"Improved Z-axis\n","repos":"Scalpel78\/CNC-Machine","old_file":"zaxis.scad","new_file":"zaxis.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"179ac3e7808f7db90797b88d3a2c12dd4d6c203c","subject":"[3D] Remove all connectors from 1A+, increase nuttrap height 0.2,","message":"[3D] Remove all connectors from 1A+, increase nuttrap height 0.2,\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3e60e7b3797339cd0d8e6f8ff826fdba7f7359d8","subject":"moineau: extract RAIL_W and RAIL_H for Oldham couplings.","message":"moineau: extract RAIL_W and RAIL_H for Oldham couplings.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e321a1542384f35cccaaf0eb9cd81b0928bc7f3a","subject":"moineau: increase slice_r to 4+0.2 mm. Currently, it's close to be water-tight, but not quite yet. Also, the required torque is already beyond a regular NEMA17 motor","message":"moineau: increase slice_r to 4+0.2 mm. Currently, it's close to be water-tight, but not quite yet. Also, the required torque is already beyond a regular NEMA17 motor\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"ab339944617790c3e97a57de03275c920c9884a0","subject":"Pontoon tip draft sent to bill","message":"Pontoon tip draft sent to bill\n","repos":"ehaskins\/OpenSCAD","old_file":"Pontoon Tip\/Tip.scad","new_file":"Pontoon Tip\/Tip.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b41432494cb87dd969a29d4efcdc19eb004f131","subject":"moineau: outer shape of stator is now a helix","message":"moineau: outer shape of stator is now a helix\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"d369b8e53386a36e9ae9f71b75d9d4e43af9c181","subject":"moineau: extract OUTER_NECK_H","message":"moineau: extract OUTER_NECK_H\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4f9fda62a10d1ba53b2315c297545940856f6df8","subject":"moineau: slice_r=4+0.3 mm. At this point, it's nearly impossible to rotate the rotor. And it's still not watertight. Not even cream-tight. Some thought is required.","message":"moineau: slice_r=4+0.3 mm. At this point, it's nearly impossible to rotate the rotor. And it's still not watertight. Not even cream-tight. Some thought is required.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"73b685e994679e2f50ea9536b521bc7e7cb5edcf","subject":"[3d] Add support for 3A+","message":"[3d] Add support for 3A+\n\nJust a mix of 3B+ and Zero configs.\nUSB port is NOT accessible from the outside.\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"b841826c70a8e717d7b562a6a514057d5325ad0b","subject":"Add first attempt at filling cap","message":"Add first attempt at filling cap\n","repos":"ehaskins\/OpenSCAD","old_file":"WaterCap\/Filler cap.scad","new_file":"WaterCap\/Filler cap.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"2888c3e0abfbea17c69b32ae674ce558d2f95bfe","subject":"Revert \"[3d] Add a heatshield option to help trap heat\"","message":"Revert \"[3d] Add a heatshield option to help trap heat\"\n\nThis reverts commit 620e2271dc6e01db7f90105e22c5294c80951553.\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"8b6558c212691363caf1269367eaed42678d83d6","subject":"[3d] Adjust LCD down ~0.5mm","message":"[3d] Adjust LCD down ~0.5mm\n\nThe LCD is actually not centered on its PCB which I failed to recognize\nwhen doing the design. This adjusts its window properly and also sets\nits anchor based on the actual board layout. Overall this moves the\nentire LCD\/Button\/LED section closer to the front by about 0.5mm and\nseems to fit a little better.\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"ffaf57313ed5ce30ee3102c3314a00a2000a65d0","subject":"Cleanup","message":"Cleanup\n","repos":"Scalpel78\/CNC-Machine","old_file":"CNC-v2.scad","new_file":"CNC-v2.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"dc054131a03917705f6c064818c22da917a4eb58","subject":"moineau: water test failed again. Setting slice_r=4-0.1. Not tested yet","message":"moineau: water test failed again. Setting slice_r=4-0.1. Not tested yet\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"b2f0430e950aa28269f36671033c9ec9358978a5","subject":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019","message":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Impression' did not match any file(s) known to git\nerror: pathspec '3D\/Mod' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Creatr\/Maintien' did not match any file(s) known to git\nerror: pathspec 'fil' did not match any file(s) known to git\nerror: pathspec 'souple.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"a258c738938be65c9efd6cc9e0671ab6deda0d01","subject":"\u0410\u0434\u0435\u043d\u0438\u043d \u0438 \u0433\u0443\u0430\u043d\u0438\u043d \u043c\u043e\u0434\u0435\u043b\u044c","message":"\u0410\u0434\u0435\u043d\u0438\u043d \u0438 \u0433\u0443\u0430\u043d\u0438\u043d \u043c\u043e\u0434\u0435\u043b\u044c","repos":"soda-without-bekerman\/DNA.research,soda-without-bekerman\/DNA.research","old_file":"3D-models\/SCAD\/A & T.scad","new_file":"3D-models\/SCAD\/A & T.scad","new_contents":"","old_contents":"","returncode":127,"stderr":"\/bin\/sh: 1: T.scad: not found\nerror: pathspec '3D-models\/SCAD\/A' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"8f8d1d6ab4188c45cdd06461df52a38d14b815e0","subject":"Adding engineering preview file.","message":"Adding engineering preview file.\n","repos":"gchristopher\/3dprinting,gchristopher\/3dprinting","old_file":"Teal Sport LED Strip Mod\/teal_drone_plus_led_strips_assembled_preview.scad","new_file":"Teal Sport LED Strip Mod\/teal_drone_plus_led_strips_assembled_preview.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Teal' did not match any file(s) known to git\nerror: pathspec 'Sport' did not match any file(s) known to git\nerror: pathspec 'LED' did not match any file(s) known to git\nerror: pathspec 'Strip' did not match any file(s) known to git\nerror: pathspec 'Mod\/teal_drone_plus_led_strips_assembled_preview.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b7a0ad19c3090ef966806391e5d4c18d92f1940b","subject":"Fix warnings in Printrbot base","message":"Fix warnings in Printrbot base\n","repos":"ehaskins\/OpenSCAD","old_file":"Printrbot Power Base\/base.scad","new_file":"Printrbot Power Base\/base.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"25860a3125aa499abf31c19118a7890f87644ebe","subject":"moineau: add stator_hollow","message":"moineau: add stator_hollow\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/stator_hollow.scad","new_file":"moineau\/stator_hollow.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"0b357b427ca1e6becc53aac4ad8943dac129d16e","subject":"moineau: enlarge slice_r from 4-0.3 to 4-0.2. Still was not watertight","message":"moineau: enlarge slice_r from 4-0.3 to 4-0.2. Still was not watertight\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"9e3106f8de2a3897bd1d6673a48f631dfbbf5b3c","subject":"Initial check-in of Cooling Fan. Has notches to hopefully help direct a little air towards the tip of the nozzle.","message":"Initial check-in of Cooling Fan. Has notches to hopefully help direct a little air towards the\ntip of the nozzle.\n","repos":"twstdpear\/nl_i3_parts","old_file":"Cooling Fan Mount\/cooling_fan_mount.scad","new_file":"Cooling Fan Mount\/cooling_fan_mount.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Cooling' did not match any file(s) known to git\nerror: pathspec 'Fan' did not match any file(s) known to git\nerror: pathspec 'Mount\/cooling_fan_mount.scad' did not match any file(s) known to git\n","license":"cc0-1.0","lang":"OpenSCAD"} {"commit":"91c31bbb5005b782d22f961ab447283956eeee33","subject":"Improve bridge mount hole printability","message":"Improve bridge mount hole printability\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Body.scad","new_file":"Ukulele\/Body.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"91b6f60952210a88ad1c263cfefc3ede3ba08977","subject":"[3d] Refactor to not use rotate_extrude(angle)","message":"[3d] Refactor to not use rotate_extrude(angle)\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/probewrap.scad","new_file":"3d\/probewrap.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"84a0fc387b2bfc824c66ca9472c776a42c2ba011","subject":"Create bristle clamp for vacuum bracket","message":"Create bristle clamp for vacuum bracket\n","repos":"ehaskins\/OpenSCAD","old_file":"XCarve Upgrades\/VacumeBracket.scad","new_file":"XCarve Upgrades\/VacumeBracket.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"abf14c9dd86b49db36774223a042b40220273d8e","subject":"moineau: correct oldham_byj_shaft.scad","message":"moineau: correct oldham_byj_shaft.scad\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/oldham_byj_shaft.scad","new_file":"moineau\/oldham_byj_shaft.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"27b4e7d85cefc7f905b7cb7d451e1202243dcade","subject":"moineau: factor out HELIX_H; make it longer 40mm -> 50 mm; now it's cream-tight at 30 psi.","message":"moineau: factor out HELIX_H; make it longer 40mm -> 50 mm; now it's cream-tight at 30 psi.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3b72e0db7dfa8d1b6838f66df8bee5589e53c757","subject":"moineau: merge _stator\/stator and rigid analogs","message":"moineau: merge _stator\/stator and rigid analogs\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e3029d813f01cb62b2831744fb3f11fa40c3da78","subject":"Fixed bad include","message":"Fixed bad include\n","repos":"Scalpel78\/CNC-Machine","old_file":"ballscrewMount.scad","new_file":"ballscrewMount.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4fc7cc45c917c7a0b401e59b297b29672bcad214","subject":"moineau: introduce make_holes for flex stator. Rigid stator uses it and is now higher","message":"moineau: introduce make_holes for flex stator. Rigid stator uses it and is now higher\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"7d9aab53cb4b8821ff181f82ea86ef1f6d8ca89e","subject":"Start hollowing chassis","message":"Start hollowing chassis\n","repos":"ehaskins\/OpenSCAD","old_file":"Robots\/Simple\/Chassis.scad","new_file":"Robots\/Simple\/Chassis.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"c94f434eebe41f3347e8180a81ac44f48d9a6ab0","subject":"moineau: rotate holes to have 3 holes on each side of the rigid stator. Note: stator is not yet splitted","message":"moineau: rotate holes to have 3 holes on each side of the rigid stator. Note: stator is not yet splitted\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f1fa506ebf85e0941d8d46a2e37e9f90c1d76a77","subject":"Rebuild of Speaker Mount","message":"Rebuild of Speaker Mount\n","repos":"holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger","old_file":"Misc 3d\/SpeakerMount.scad","new_file":"Misc 3d\/SpeakerMount.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc' did not match any file(s) known to git\nerror: pathspec '3d\/SpeakerMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1dbed66286d7ac89c100f30ff2a6f72a0febfebf","subject":"Real measurements for Z-axis. Needs more work.","message":"Real measurements for Z-axis. Needs more work.\n","repos":"Scalpel78\/CNC-Machine","old_file":"zaxis.scad","new_file":"zaxis.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4945d58c8cff34e8137efad0f56e642d0963b16b","subject":"moineau: rotor now has a spacer. Slightly enlarge slice_r and rotate_r. Does not quite work yet.","message":"moineau: rotor now has a spacer. Slightly enlarge slice_r and rotate_r. Does not quite work yet.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5ed609893f50b6c1baf1e237363e6032722a7aed","subject":"Changes to the upper gantry","message":"Changes to the upper gantry\n","repos":"Scalpel78\/CNC-Machine","old_file":"CNC-v2.scad","new_file":"CNC-v2.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"ec5e1cf55c5bfeaf61d657f992cdf6355b875530","subject":"Save the work in progress: support for the line tension measurement unit","message":"Save the work in progress: support for the line tension measurement unit\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/line_tension_measurement support.scad","new_file":"Hardware\/line_tension_measurement support.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/line_tension_measurement' did not match any file(s) known to git\nerror: pathspec 'support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"bfe6d51ac5034deed1d92289b10abe6003d39b50","subject":"Update tuner holes after print","message":"Update tuner holes after print\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/TunerHoles.scad","new_file":"Ukulele\/TunerHoles.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"89752b8db7c8d27f83935a9d80e01f922347ec10","subject":"[3d] Move LCD\/buttons\/LEDs 0.695mm to right, etc","message":"[3d] Move LCD\/buttons\/LEDs 0.695mm to right, etc\n\n-- Most LCD didn't include 0.025in offset. Seems like it could need more?\n-- Remove Pi alignment nubbies\n-- Expand Pi ethernet jack cutout interior 0.5mm\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"0eafdfa31e1a91d4cb8c0da5e91bf44ecb2189a1","subject":"Number plate 3 as printed","message":"Number plate 3 as printed\n","repos":"ehaskins\/OpenSCAD","old_file":"Engine Name Plate\/3.scad","new_file":"Engine Name Plate\/3.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4ba4b45ff861e0323700e57a44b1d161532634df","subject":"[3d] Fix screw head mismatch between screwhole and nuttrap","message":"[3d] Fix screw head mismatch between screwhole and nuttrap\n\nThe nuttrap() made a 6mm diameter 3.5mm deep hole and the screwhole()\nonly created a 3mm deep hole so the outer edge was angled internally for\n0.5mm\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"142afb397f536bd1e21d61d231bc391baf4575ec","subject":"Added Holder","message":"Added Holder\n","repos":"holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger","old_file":"Misc 3d\/3D Printer\/MoterHolder\/Holder.scad","new_file":"Misc 3d\/3D Printer\/MoterHolder\/Holder.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc' did not match any file(s) known to git\nerror: pathspec '3d\/3D' did not match any file(s) known to git\nerror: pathspec 'Printer\/MoterHolder\/Holder.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"486eee9616ced71d47552ceea24edab9cd4b91f7","subject":"Added PCB mount","message":"Added PCB mount\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Parts Lasercut\/PCB-mount.scad","new_file":"Parts Lasercut\/PCB-mount.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5e107f7ad54c1c19590ac119390ec8af00a8d752","subject":"[3d] Increased case height from 32mm to 32.5m, other tweaks","message":"[3d] Increased case height from 32mm to 32.5m, other tweaks\n\n-- Increase case depth 1.0mm\n-- Increase size of bottom wall chamfer to match pi mounting holes\n-- Reduce size of top wall chamfer to match bottom\n-- Pi Ethernet jack down 0.5mm\n-- HeaterMeter output RJ45 up 0.6mm, 0.3mm thinner\n-- Barrel power jack up 0.8mm\n-- Thermocouple jack up 0.3mm\n-- Thermocouple +\/- up 1mm\n-- Reduce size of nuttrap nut diameter by <0.01mm\n-- Reduce button inset 0.25mm\n-- Enable small Pi alignment nubs\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e12c35b2eeea4fd3ef634ebb93e94ec270e60662","subject":"[3d] Replace main cube fillet with new bead chamfer, round edges","message":"[3d] Replace main cube fillet with new bead chamfer, round edges\n\n-- Gives a round edge all the way around top and bottom lip instead of\npointy corners\n-- Fix nuttrap to not be a centered block, only go to wall (makes it\n0.25mm longer into case as well)\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5d8b2de346820062b149e10eeb5487c3f89e2189","subject":"moineau: increase seal_r by 1 mm, increase distance between bolt holes and edge by 0.5 mm","message":"moineau: increase seal_r by 1 mm, increase distance between bolt holes and edge by 0.5 mm\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"a35f5fca92ada11b425dbfd60f1101f329489b7f","subject":"[3d] Add option for mouselegs","message":"[3d] Add option for mouselegs\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"68a74b4252438f4ff99d267ba92f5cff406b494a","subject":"moineau: extract RAIL_D for Oldham coupler","message":"moineau: extract RAIL_D for Oldham coupler\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4eeda46a81baad330402ce5fa24d87172432ddeb","subject":"[3d] Add zero mounting hole supports","message":"[3d] Add zero mounting hole supports\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"20a3f6d26c3db86420276d7487e3572b9d22bf6e","subject":"moineau: try to decrease the rotor size (does not work as a pump).","message":"moineau: try to decrease the rotor size (does not work as a pump).\n\nIt's cream tight, but it does not push the paste to the nozzle. No idea what's wrong yet.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"a9bf54e680602cffa52e296dc89e1dc0efc6ab90","subject":"moineau: add neck to flex stator.","message":"moineau: add neck to flex stator.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"326e819ee2c06c030563e7dbf9c1562025801568","subject":"moineau: add neck to the rigid stator","message":"moineau: add neck to the rigid stator\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"31232921b4284fd0c1c4f7c4b3c26d31058da537","subject":"Create bar interlock dimensions test print","message":"Create bar interlock dimensions test print\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Tests\/BarInterlockSpacing.scad","new_file":"Ukulele\/Tests\/BarInterlockSpacing.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"49458d206d2f3b7e9cb10a6656807f29cae40f72","subject":"Correct number plate \"3\" with correct dimensions and text","message":"Correct number plate \"3\" with correct dimensions and text\n","repos":"ehaskins\/OpenSCAD","old_file":"Engine Name Plate\/3.scad","new_file":"Engine Name Plate\/3.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"8279ff8557157b6b6f80948e1dbc858c71525000","subject":"Add missing stator.scad","message":"Add missing stator.scad\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/stator.scad","new_file":"moineau\/stator.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"b4e7731fb046c048d4688fb9927c2903a02b3df1","subject":"[3d] Move power jack and ethernet jacks up slightly","message":"[3d] Move power jack and ethernet jacks up slightly\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"d10108e27089f4ae6d7390fd2c74168cf7286330","subject":"moineau: remove neck_h argument from _stator. Use INNER_NECK_H.","message":"moineau: remove neck_h argument from _stator. Use INNER_NECK_H.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"19c61608f4ade7801d7d10cd0279b1b2d42000a9","subject":"Update","message":"Update\n","repos":"holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger","old_file":"Misc 3d\/SpeakerMount.scad","new_file":"Misc 3d\/SpeakerMount.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc' did not match any file(s) known to git\nerror: pathspec '3d\/SpeakerMount.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"1cf12949e06b2864f981e829833768173390f30f","subject":"moineau: fix period\/twist calculation. Now, period is really a period.","message":"moineau: fix period\/twist calculation. Now, period is really a period.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"af94cf1852b01cd2de420ff49cb6dab8b92bf653","subject":"moineau: reduce rotate_r for rotor twice. Otherwise, rotor and stator don't fit and the difference between them is a spiral instead of disconnected chunks.","message":"moineau: reduce rotate_r for rotor twice. Otherwise, rotor and stator don't fit and the difference between them is a spiral instead of disconnected chunks.\n\nUseful: always test difference between rotor and stator hollow in both ways:\n -- rotor should always be inside the stator hollow;\n -- stator hollow minus rotor should be disconnected chunks;\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"0ca608719a84418e2a82699465ddbb3a29d10bad","subject":"moineau: delete steel_rotor: too many hardcoded constants which are out of date","message":"moineau: delete steel_rotor: too many hardcoded constants which are out of date\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"01cdc5b40c6df56aa62823ae77272de27994cfee","subject":"edge: 20 degrees","message":"edge: 20 degrees","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"cfcc9f3fdcb08c91d299ad2a4f3641c45fea4b86","subject":"moineau: merge rail and _rail, since _rail does not have any parameters anymore.","message":"moineau: merge rail and _rail, since _rail does not have any parameters anymore.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"a2a1e8008933029c2d8616e3ba19634350cabf21","subject":"left_hinge: extract hinge() subroutine.","message":"left_hinge: extract hinge() subroutine.","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"left_hinge.scad","new_file":"left_hinge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"bc84dae649995a57c2514ca493564d2f2f1f8579","subject":"moineau: slice_r = 4.5; still not water\/air-tight","message":"moineau: slice_r = 4.5; still not water\/air-tight\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"13859d327550592f7fd7e9073ee60fe6297f89f8","subject":"Increase slice_r, make rotor period twice smaller than rotor period","message":"Increase slice_r, make rotor period twice smaller than rotor period\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3c5f50e6b74c70adc60dc9fbb923b828cd3bb08b","subject":"[3d] Offset HeaterMeter slightly from front edge of case","message":"[3d] Offset HeaterMeter slightly from front edge of case\n\nGuarantees at least one perimeter in front of front screw holes, as well\nas allowing a small gap before the PCB starts which should make assembly\nslightly easier and reduced chance of the front locklip intersecting the\nclosest components.\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"a756b3bdafbed49ed72aae750c8698c4bd2d375d","subject":"Labels","message":"Labels\n","repos":"DanNixon\/Alice,DanNixon\/Alice","old_file":"CAD\/box\/alice.scad","new_file":"CAD\/box\/alice.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/DanNixon\/Alice.git\/'\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"32e193029fad34d7c075413d2760ebfdb85fad06","subject":"left_hinge: add actual hinges (2 parts, 5mm height, 10 mm spacing, r=1.6). The details is ugly yet.","message":"left_hinge: add actual hinges (2 parts, 5mm height, 10 mm spacing, r=1.6). The details is ugly yet.","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"left_hinge.scad","new_file":"left_hinge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"0ce5f17953930140097d5e5055df8694b60a3599","subject":"Add a script for line tension measurement unit","message":"Add a script for line tension measurement unit\n","repos":"baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite,baptistelabat\/robokite","old_file":"Hardware\/line_tension_measurement support.scad","new_file":"Hardware\/line_tension_measurement support.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Hardware\/line_tension_measurement' did not match any file(s) known to git\nerror: pathspec 'support.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"00e074ccb2629d15f51b452c41b6b66efa19ae9d","subject":"Add teeth to the edge","message":"Add teeth to the edge","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"835f55972c730c681daf55574a57f3f95010c2ac","subject":"moineau: make stator thicker. It will be printed with 20-25% infill, and it's expected to be more elastic.","message":"moineau: make stator thicker. It will be printed with 20-25% infill, and it's expected to be more elastic.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"af214424e98afdecb70d37be473bb4dd87585a57","subject":"Add cable chain mount to PSU base","message":"Add cable chain mount to PSU base\n","repos":"ehaskins\/OpenSCAD","old_file":"Printrbot Power Base\/base.scad","new_file":"Printrbot Power Base\/base.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5dc7cd3e2095bfe372cde552e2e991bcb0560de2","subject":"Refactored chassis into plate module for main shape.","message":"Refactored chassis into plate module for main shape.\n","repos":"ehaskins\/OpenSCAD","old_file":"Robots\/Simple\/Chassis.scad","new_file":"Robots\/Simple\/Chassis.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f44bf437763a5a4c70f65f7eaafc88a468c522d2","subject":"Added holder","message":"Added holder\n","repos":"holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger,holtsoftware\/bearded-avenger","old_file":"Misc 3d\/Lapplank\/holder.scad","new_file":"Misc 3d\/Lapplank\/holder.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Misc' did not match any file(s) known to git\nerror: pathspec '3d\/Lapplank\/holder.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"87013c8ba44bd45f70b9edc8259dc5ab674c4f6f","subject":"moineau: temporary switch rotor to M5 shaft","message":"moineau: temporary switch rotor to M5 shaft\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"6256d60838bc6ed762a6ed377732085e5a36207f","subject":"moineau: slice_r=4.9. It's still not water-tight, especially in the top. I should increase the distance between the material input and the top","message":"moineau: slice_r=4.9. It's still not water-tight, especially in the top. I should increase the distance between the material input and the top\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"24f9e6906032d5f8ae7e7e7fee9ce18b5039bc2b","subject":"syntax on scad","message":"syntax on scad\n","repos":"NationalAssociationOfRealtors\/IndoorAirQualitySensor","old_file":"enclosure\/v0.3 \/IAQ-Case.scad","new_file":"enclosure\/v0.3 \/IAQ-Case.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"fatal: \/IAQ-Case.scad: '\/IAQ-Case.scad' is outside repository\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"d1c9e75358918c9329ae908dcbf780971fe36280","subject":"[3d] Extend top nuttrapp +e to be sure it is fully connected in the model","message":"[3d] Extend top nuttrapp +e to be sure it is fully connected in the model\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"6fe36df2307b162220e4b48c143f3f1df132f334","subject":"[3d] Enlarge button recesses, power jack hole","message":"[3d] Enlarge button recesses, power jack hole\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"27cb101d9eacf77e6c01215502eb49fcb5046a2e","subject":"Cr\u00e9ditos","message":"Cr\u00e9ditos\n\n","repos":"diesphink\/openscad,diesphink\/openscad","old_file":"Order of the Gilded Compass\/lib\/prisma.scad","new_file":"Order of the Gilded Compass\/lib\/prisma.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Order' did not match any file(s) known to git\nerror: pathspec 'of' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Gilded' did not match any file(s) known to git\nerror: pathspec 'Compass\/lib\/prisma.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"1cd735b5c8fa09d76ce53a6b6d006023fc343245","subject":"moineau: add material input path","message":"moineau: add material input path\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f8ad81295e5fafacea83b1a0a3e7fcbe7759af82","subject":"[3d] Fillet the case interior cube to create more thickness near top\/bottom","message":"[3d] Fillet the case interior cube to create more thickness near top\/bottom\n\n-- Also increase the radius and height of the outside bchamfer\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f7c1b98085b62898c6d945b6592ed33b21dcdc46","subject":"Add missed change","message":"Add missed change\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/SoundHole.scad","new_file":"Ukulele\/SoundHole.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"8198b6e76045f6998811a14e82808d341d07dda2","subject":"Fixed comment","message":"Fixed comment\n","repos":"gchristopher\/3dprinting,gchristopher\/3dprinting","old_file":"Teal Sport LED Strip Mod\/teal_drone_top_cover_plain.scad","new_file":"Teal Sport LED Strip Mod\/teal_drone_top_cover_plain.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Teal' did not match any file(s) known to git\nerror: pathspec 'Sport' did not match any file(s) known to git\nerror: pathspec 'LED' did not match any file(s) known to git\nerror: pathspec 'Strip' did not match any file(s) known to git\nerror: pathspec 'Mod\/teal_drone_top_cover_plain.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"0e64fbe28990c1aa2b3e9d290ba1352a6693279d","subject":"Began working on my own TSlot library for 8020's extrusions","message":"Began working on my own TSlot library for 8020's extrusions\n","repos":"Scalpel78\/CNC-Machine","old_file":"TSlotProfile.scad","new_file":"TSlotProfile.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"125032a8088cbfe69a57bfdfc7455e573339595f","subject":"Revise vacuum bracket for bristles and better mouting","message":"Revise vacuum bracket for bristles and better mouting\n","repos":"ehaskins\/OpenSCAD","old_file":"XCarve Upgrades\/VacumeBracket.scad","new_file":"XCarve Upgrades\/VacumeBracket.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"23fd6bf08983544a0aec18afff59bdaf5ec2be6f","subject":"Cap threads test 2","message":"Cap threads test 2\n","repos":"ehaskins\/OpenSCAD","old_file":"WaterCap\/WaterCap.scad","new_file":"WaterCap\/WaterCap.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e310a4f7aad9fcd141a5db9f4f772ea8a07b2f97","subject":"[3d] Add case 'connectorless' option and fix A+ split in a weird place","message":"[3d] Add case 'connectorless' option and fix A+ split in a weird place\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"12e208c8f15752d47dabcc6bb4ce8f1219ec24e2","subject":"moineau: extract INNER_NECK_H","message":"moineau: extract INNER_NECK_H\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"6f7330db21a489c9dac159b4bf2af46ee022fc21","subject":"Update bridge interlock to match body hole","message":"Update bridge interlock to match body hole\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Bridge.scad","new_file":"Ukulele\/Bridge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"85c02c158d87270cc1e0cb481f2b898a3e7f8f99","subject":"moineau: enlarge rotor, slice_r=4+0.4 mm. Now, it's water-tight, unless high pressure is applied. In this case, water will find its way out. I guess it's less of an issue with paste. Torque required to turn the rotor is high, that's a problem.","message":"moineau: enlarge rotor, slice_r=4+0.4 mm. Now, it's water-tight, unless high pressure is applied. In this case, water will find its way out. I guess it's less of an issue with paste. Torque required to turn the rotor is high, that's a problem.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e33bfbc280658070cb76a5b8ebb2ae82b45c1269","subject":"moineau: extract BOLT_NUM.","message":"moineau: extract BOLT_NUM.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"d3fc991f5245260048703183f99c22f1fd60971c","subject":"moineau: enlarge rotor slice_r by 0.1mm. Previous value was not watertight","message":"moineau: enlarge rotor slice_r by 0.1mm. Previous value was not watertight\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e4c080d454e2654c5383710e3f35e552d6eb638a","subject":"Fix head overlab into neck","message":"Fix head overlab into neck\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Head.scad","new_file":"Ukulele\/Head.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"fbd788f1f8bfa80eec888c7f35dd9053a8c62365","subject":"moineau: adjust sizes to fit each other","message":"moineau: adjust sizes to fit each other\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5869dc42a4a59734326463a98bd7907eb5b55002","subject":"First cap that threads on, but is difficult to start.","message":"First cap that threads on, but is difficult to start.\n","repos":"ehaskins\/OpenSCAD","old_file":"WaterCap\/WaterCap.scad","new_file":"WaterCap\/WaterCap.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"14be2c51b70380050961eae466de11e4075e9bea","subject":"First version of 40mm fan duct for E3D hotend for Kossel","message":"First version of 40mm fan duct for E3D hotend for Kossel\n","repos":"ksuszka\/3d-projects","old_file":"e3d fan duct\/e3d-fan-duct.scad","new_file":"e3d fan duct\/e3d-fan-duct.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'e3d' did not match any file(s) known to git\nerror: pathspec 'fan' did not match any file(s) known to git\nerror: pathspec 'duct\/e3d-fan-duct.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"f4546b3877093b6c439c1886c0bc49c6ec00eb5b","subject":"Pickup Template for Lukas","message":"Pickup Template for Lukas\n","repos":"ehaskins\/OpenSCAD","old_file":"LSJ\/Pickup Template.scad","new_file":"LSJ\/Pickup Template.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"660f7cc5c21d2ed57d5f9cb00580e95b518a573b","subject":"Started battery tray","message":"Started battery tray\n","repos":"ehaskins\/OpenSCAD","old_file":"BatterySet\/BatteryTrary.scad","new_file":"BatterySet\/BatteryTrary.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"2a1a0f292c1731309fca12c70f27f65b1d24b949","subject":"Work on bridge with intonation adjustment","message":"Work on bridge with intonation adjustment\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Bridge.scad","new_file":"Ukulele\/Bridge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4035b176b27e01f8f860d58f09a1e45865448424","subject":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019","message":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Impression' did not match any file(s) known to git\nerror: pathspec '3D\/Mod' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Creatr\/Maintien' did not match any file(s) known to git\nerror: pathspec 'fil' did not match any file(s) known to git\nerror: pathspec 'souple.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"e942404ac3560794c534e6f98765a78e7a927966","subject":"edge: 30 degrees angle for easier snaps","message":"edge: 30 degrees angle for easier snaps","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4a0d65db57a9f86b485ec456bafd39f4ad04f946","subject":"Dust boot draft 2","message":"Dust boot draft 2\n","repos":"ehaskins\/OpenSCAD","old_file":"XCarve Upgrades\/VacumeBracket.scad","new_file":"XCarve Upgrades\/VacumeBracket.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f01728443f42936d1a6946a24b6a6f65af56be32","subject":"[3d] Add 5 probe version of probewrap, smallerdefault wall","message":"[3d] Add 5 probe version of probewrap, smallerdefault wall\n\n-- wall lowered from 2.5 to 2.0, remember to keep this a multiple of\ntrace width\n-- Added 5 probe layout\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/probewrap.scad","new_file":"3d\/probewrap.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3060b561a0fc1a48624542590b859a71f1843c39","subject":"Create pistol rack","message":"Create pistol rack\n","repos":"ehaskins\/OpenSCAD","old_file":"Pistol Rack\/PistolRack.scad","new_file":"Pistol Rack\/PistolRack.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3c4c2f39ed300ada319d1f9d3b49ba1d15fc2d8f","subject":"Corrigido tamanho do tile, diminu\u00eddo tamanho do dado e aumentado c\u00edrculo para pegar o dado","message":"Corrigido tamanho do tile, diminu\u00eddo tamanho do dado e aumentado c\u00edrculo para pegar o dado\n\n","repos":"diesphink\/openscad,diesphink\/openscad","old_file":"Order of the Gilded Compass\/6_iluminatti.scad","new_file":"Order of the Gilded Compass\/6_iluminatti.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Order' did not match any file(s) known to git\nerror: pathspec 'of' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Gilded' did not match any file(s) known to git\nerror: pathspec 'Compass\/6_iluminatti.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"0e1d388cf94bb25179eeb841cb88853dbde49b0a","subject":"Started on a lasercut sensorframe","message":"Started on a lasercut sensorframe\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Parts Lasercut\/SensorFrame.scad","new_file":"Parts Lasercut\/SensorFrame.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"80978f9ebc9bc31aa9882a6b961a97b9bc4f4dd4","subject":"some new stuff to test \u2026","message":"some new stuff to test \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"reference designs\/big+fine.scad","new_file":"reference designs\/big+fine.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"780b73c4d25956762b814975e94ca772d1216503","subject":"moineau: use $fn instead of $fs\/$fa in stator.scad. Speed up STL generation 5x","message":"moineau: use $fn instead of $fs\/$fa in stator.scad. Speed up STL generation 5x\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/stator.scad","new_file":"moineau\/stator.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"4c1b964dc2fdcb735b4f0bb2e3a1aca059bccc9a","subject":"Playing around","message":"Playing around\n","repos":"Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost,Scalpel78\/Ghost","old_file":"Parts 3D print\/SensorHolder1.scad","new_file":"Parts 3D print\/SensorHolder1.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/Ghost.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"b77beb3ce3423455e6e6fde8a4bca9bed045a788","subject":"[3d] Case LCD pins cutout isn't needed","message":"[3d] Case LCD pins cutout isn't needed\n\nThe LCD pins aren't even as long as the shift register pins are!\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"8baab597e0e2349536ec742f4c6e4c9ebc825b9c","subject":"Diminu\u00eddo o tamanho do dado","message":"Diminu\u00eddo o tamanho do dado\n\n","repos":"diesphink\/openscad,diesphink\/openscad","old_file":"Order of the Gilded Compass\/common.scad","new_file":"Order of the Gilded Compass\/common.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Order' did not match any file(s) known to git\nerror: pathspec 'of' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Gilded' did not match any file(s) known to git\nerror: pathspec 'Compass\/common.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"ce9f7dd1a3c9b146b819d6927256bcc276fd08ff","subject":"[3d] Move probe jacks back to calculated position, pi connector fix for v.thick walls","message":"[3d] Move probe jacks back to calculated position, pi connector fix for v.thick walls\n\nSeems that maybe the probe jacks were 0.6mm too far forward? Also the Pi\nconnectors wouldn't poke all the way through with a wall thickness of\n0.25\"\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"864c71110cc85ab2872836f284f7a62d919b9392","subject":"moineau: extract seal skip.","message":"moineau: extract seal skip.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"b7632d5ede054a612353d3136adf723df9dc4dec","subject":"moineau: add bottom seal to stator","message":"moineau: add bottom seal to stator\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"cb0f85cb32e2cd8305afc5a0f41bfa89b6390d73","subject":"Correct support channel dimensions","message":"Correct support channel dimensions\n","repos":"ehaskins\/OpenSCAD","old_file":"Ukulele\/Measurements.scad","new_file":"Ukulele\/Measurements.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"75b98e3c904cd4c0f27346625c03ba1f00d7200c","subject":"First draft of dryer top\/bottom sign","message":"First draft of dryer top\/bottom sign\n","repos":"ehaskins\/OpenSCAD","old_file":"Dryer Arrows\/Arrow.scad","new_file":"Dryer Arrows\/Arrow.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"5dc12b4d744ca18f57f28ab521c8a1152db81c71","subject":"edge: make it longer for easier stick.","message":"edge: make it longer for easier stick.","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"80489c7effb1cef8f931d3516a98c17858232725","subject":"Minor animation changes","message":"Minor animation changes\n","repos":"Scalpel78\/CNC-Machine","old_file":"CNC-v2.scad","new_file":"CNC-v2.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/Scalpel78\/CNC-Machine.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"19993a758792dd82daa93972a5e339a83bbee8d7","subject":"[3d] Add option for no probe holes, mousears back, center model","message":"[3d] Add option for no probe holes, mousears back, center model\n\n-- Adds a new Control_Probe = None which creates none of the 4 probe\nholes\n-- Readds MouseEarHeight. These do sort of work to help control ABS\nwarp. Set to one layer height.\n-- Model is now centered straddling the X axis\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"cab16e31a6410e1e056408eb3ecd8c97ff27e796","subject":"Cap threads on easily. Marked 6.","message":"Cap threads on easily. Marked 6.\n","repos":"ehaskins\/OpenSCAD","old_file":"WaterCap\/WaterCap.scad","new_file":"WaterCap\/WaterCap.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"58b0b3dfe9955266c430da54feb57b8ba4bd8d1f","subject":"[3d] Probe centerline moved up 0.3mm by math","message":"[3d] Probe centerline moved up 0.3mm by math\n\n2.25 - mount support\n1.5? - Pi PCB thickness\n2.54 - male header black bit\n8.5 - female header\n-5.5 - probe jack\n= 9.29mm\n","repos":"CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"47fb7e887248eeac889ce5720646bee32bcd46f0","subject":"Add trivial edge for 2.62 (~ 0.1\") acrylic door for Ultimaker 2","message":"Add trivial edge for 2.62 (~ 0.1\") acrylic door for Ultimaker 2","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"44b61c5f65cc42252e8f83f4a65933ebf6ed602d","subject":"moineau: extract FLEX_STATOR_SLICE_R and RIGID_STATOR_SLICE_R.","message":"moineau: extract FLEX_STATOR_SLICE_R and RIGID_STATOR_SLICE_R.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f1ba2ef655346f30b07fae75f2349461269d62ce","subject":"Fixed position of audio and composite video connector","message":"Fixed position of audio and composite video connector\n","repos":"TomHodson\/Raspberry-Pi-OpenSCAD-Model,D4p0up\/Raspberry-Pi-OpenSCAD-Model","old_file":"raspberry pi.scad","new_file":"raspberry pi.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'raspberry' did not match any file(s) known to git\nerror: pathspec 'pi.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"b802eed3a022452e4651d47b33b2d35f64395ed5","subject":"edge: set r = 1.7 mm because r = 1.8 mm was too large for M3 bolt.","message":"edge: set r = 1.7 mm because r = 1.8 mm was too large for M3 bolt.","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"edge.scad","new_file":"edge.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3ffe8568da6deeaa4415991ddd34ca1075850326","subject":"moineau: extract HOLE_R.","message":"moineau: extract HOLE_R.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"01799a74b57663df11b22fff5333004b15b35786","subject":"moineau: extract BOLT_R.","message":"moineau: extract BOLT_R.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"85bab179868be0782733835973f521a3494b62db","subject":"Bal bot wheel","message":"Bal bot wheel\n","repos":"ehaskins\/OpenSCAD","old_file":"Robots\/LilBalBot\/Wheel.scad","new_file":"Robots\/LilBalBot\/Wheel.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"7e6006c7e8d41e82853da2d9714c63a6cf65a011","subject":"[3d] Case adjust end stop and extra around phole","message":"[3d] Case adjust end stop and extra around phole\n\n-- Raise the Pi endstop 1mm and shrink its length\n-- Add small relief around probe holes to account for filament\naccumulation\n-- Reduce locklip_p height by 0.1mm\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"7861b504139a1cbd4cdb18564ed2da95ad374713","subject":"[3d] Expand the size of the LCD bezel inset by 1mm","message":"[3d] Expand the size of the LCD bezel inset by 1mm\n\nMove lcd_neg down 0.5mm and increase the size of the inset by 1mm. The\nLCD grab notch was kept in the same position allowing 0.5mm of vertical\nslop.\n","repos":"shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"d05970b6002881899b99200463015fbf62638593","subject":"[3d] Add optional mouseears to the case corners","message":"[3d] Add optional mouseears to the case corners\n","repos":"shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"9862d8aed8bd0ab2564f5d1e82ba78a13234bf1c","subject":"Base - print attempt 2","message":"Base - print attempt 2\n","repos":"ehaskins\/OpenSCAD","old_file":"Printrbot Power Base\/base.scad","new_file":"Printrbot Power Base\/base.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"e9f06ba7d5a51bf8fb6e630eadd5b7f5339c3b6d","subject":"moineau: add oldham shaft for BYJ48 stepper motor","message":"moineau: add oldham shaft for BYJ48 stepper motor\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/oldham_byj_shaft.scad","new_file":"moineau\/oldham_byj_shaft.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"2cd28239337d7d1a0487667bc43b2cfdffe9e3a9","subject":"moineau: extract RIGID_SEAL_H and FLEX_SEAL_H.","message":"moineau: extract RIGID_SEAL_H and FLEX_SEAL_H.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f0c49e544143748d02e7db0e8e11ec782a7ca228","subject":"Extract STATOR_ROTATE_R and ROTOR_ROTATE_R = STATOR_ROTATE_R \/ 2.","message":"Extract STATOR_ROTATE_R and ROTOR_ROTATE_R = STATOR_ROTATE_R \/ 2.\n\nThis is another step towards reducing the size of the rotor.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"moineau\/moineau.scad","new_file":"moineau\/moineau.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"79a06ce7a211ef137084d32a268e34e44482c62c","subject":"Add oldham coupling. It seems to work, but has not yet been fully tested.","message":"Add oldham coupling. It seems to work, but has not yet been fully tested.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"oldham_coupling.scad","new_file":"oldham_coupling.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"711a9712da7ae953296d09186c1c0a4726f14b9f","subject":"'nother test design \u2026","message":"'nother test design \u2026\n","repos":"trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone,trinamic\/T-Bone","old_file":"reference designs\/little-complex.scad","new_file":"reference designs\/little-complex.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/trinamic\/T-Bone.git\/'\n","license":"agpl-3.0","lang":"OpenSCAD"} {"commit":"cef5d81073318da99884cd3617760bbe0c7ccc92","subject":"[3d] Move WALL from Advanced to normal options","message":"[3d] Move WALL from Advanced to normal options\n\nWALL should be set to some sort of multiple of extrusion trace width to\nprevent a hollow wall.\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"6f6bb9a525d43bf7aecedc92532c93d0f2045897","subject":"Delete OttoDIY_CUSTOM.scad","message":"Delete OttoDIY_CUSTOM.scad","repos":"OttoDIY\/DIY,OttoDIY\/DIY","old_file":"3D print\/OttoDIY_CUSTOM.scad","new_file":"3D print\/OttoDIY_CUSTOM.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec '3D' did not match any file(s) known to git\nerror: pathspec 'print\/OttoDIY_CUSTOM.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"ce09a73c1d61eb481bb514a0e39ad9672267b8ea","subject":"LED controler for a dimension and sizing","message":"LED controler for a dimension and sizing\n","repos":"el-bart\/mini,el-bart\/mini,el-bart\/mini,el-bart\/mini","old_file":"led_controler_junction_box\/controller.scad","new_file":"led_controler_junction_box\/controller.scad","new_contents":"module controller()\n{\n difference()\n {\n \/\/ body\n union()\n {\n difference()\n {\n union()\n {\n translate([0,0,24])\n cube([88, 86, 13]);\n translate([15, 10, 0])\n cube([59, 66, 24]);\n }\n translate([15+2, 10, 0])\n cube([55, 16, 25]);\n }\n \/\/ power cord mounts\n translate([(88-20)\/2, 10+2, 24-10])\n cube([20, 8, 10]);\n \/\/ screw hole frame\n for(dx = [15, 88-15])\n translate([dx, 43-13\/2, 24-3])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=10.5\/2, h=3);\n }\n }\n\n \/\/ screw mounts\n for(dx = [15, 88-15])\n translate([dx, 43-13\/2, 0])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=10.5\/2, h=24-3);\n }\n\n \/\/ screw holes\n #for(dx = [15, 88-15+3\/2\/2])\n translate([dx, 43-13\/2, 24-3])\n hull()\n {\n for(dy = [0, 13-10.5])\n translate([0, dy, 0])\n cylinder(r=3\/2, h=3, $fs=0.01);\n }\n }\n}\n\n%controller();\n","old_contents":"","returncode":1,"stderr":"error: pathspec 'led_controler_junction_box\/controller.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"d8e975938db750fe70210c095fd217bfafa90e2d","subject":"XCarve dust boot draft 1","message":"XCarve dust boot draft 1\n","repos":"ehaskins\/OpenSCAD","old_file":"XCarve Upgrades\/VacumeBracket.scad","new_file":"XCarve Upgrades\/VacumeBracket.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/ehaskins\/OpenSCAD.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f054cac3b982966e384116197af74c16bfc4c887","subject":"[3d] One extended USB pillar was intersecting HM board","message":"[3d] One extended USB pillar was intersecting HM board\n","repos":"CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter,shmick\/HeaterMeter,CapnBry\/HeaterMeter","old_file":"3d\/hm-case-43.scad","new_file":"3d\/hm-case-43.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/shmick\/HeaterMeter.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"3e0f262e7cf7f27b6e1a7de462ad6eb5b123e1cd","subject":"scad b\u00e1sico pros testes","message":"scad b\u00e1sico pros testes\n\n","repos":"diesphink\/openscad,diesphink\/openscad","old_file":"Order of the Gilded Compass\/basic.scad","new_file":"Order of the Gilded Compass\/basic.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Order' did not match any file(s) known to git\nerror: pathspec 'of' did not match any file(s) known to git\nerror: pathspec 'the' did not match any file(s) known to git\nerror: pathspec 'Gilded' did not match any file(s) known to git\nerror: pathspec 'Compass\/basic.scad' did not match any file(s) known to git\n","license":"mit","lang":"OpenSCAD"} {"commit":"170f106f7b472843323c2ca6a68535664efcff1b","subject":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019","message":"\/ \u2018Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad\u2019\n","repos":"SoFABbyTV\/sofab-open-models,SoFABbyTV\/sofab-open-models","old_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_file":"Impression 3D\/Mod Extruder Creatr\/Maintien fil souple.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Impression' did not match any file(s) known to git\nerror: pathspec '3D\/Mod' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Creatr\/Maintien' did not match any file(s) known to git\nerror: pathspec 'fil' did not match any file(s) known to git\nerror: pathspec 'souple.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"} {"commit":"b58eee57211d5efcce022f94bda89d60f0e7d739","subject":"Add Schmidt coupling experiments. I don't like the number of moving parts, and the fact that I can't produce it smaller than ~60 mm diameter, due to the size of ball bearings.","message":"Add Schmidt coupling experiments. I don't like the number of moving parts, and the fact that I can't produce it smaller than ~60 mm diameter, due to the size of ball bearings.\n","repos":"krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube,krasin\/abc-cube","old_file":"schmidt_coupling.scad","new_file":"schmidt_coupling.scad","new_contents":"","old_contents":"","returncode":128,"stderr":"remote: Support for password authentication was removed on August 13, 2021.\nremote: Please see https:\/\/docs.github.com\/en\/get-started\/getting-started-with-git\/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.\nfatal: Authentication failed for 'https:\/\/github.com\/krasin\/abc-cube.git\/'\n","license":"mit","lang":"OpenSCAD"} {"commit":"f3802b7a2c2878ef80aa9b619b04b520de30cc80","subject":"First major commit of dual extruder holder design.","message":"First major commit of dual extruder holder design.\n","repos":"gchristopher\/3dprinting,gchristopher\/3dprinting","old_file":"Rostock Max V2 Dual Extruder Holder\/extruder_constants.scad","new_file":"Rostock Max V2 Dual Extruder Holder\/extruder_constants.scad","new_contents":"","old_contents":"","returncode":1,"stderr":"error: pathspec 'Rostock' did not match any file(s) known to git\nerror: pathspec 'Max' did not match any file(s) known to git\nerror: pathspec 'V2' did not match any file(s) known to git\nerror: pathspec 'Dual' did not match any file(s) known to git\nerror: pathspec 'Extruder' did not match any file(s) known to git\nerror: pathspec 'Holder\/extruder_constants.scad' did not match any file(s) known to git\n","license":"apache-2.0","lang":"OpenSCAD"}